summaryrefslogtreecommitdiffstats
path: root/queue.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-04 16:05:42 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-04 16:05:42 +0000
commitfaf8e5a3849621acfbd0a0887f2e924a40cb029a (patch)
tree2cc3b3c4342ccded98f56f6ec7bc72cf46c35dc5 /queue.h
parentb95b5ab28407b75467c6cff63359cba9a0a3bd70 (diff)
downloadrsyslog-faf8e5a3849621acfbd0a0887f2e924a40cb029a.tar.gz
rsyslog-faf8e5a3849621acfbd0a0887f2e924a40cb029a.tar.xz
rsyslog-faf8e5a3849621acfbd0a0887f2e924a40cb029a.zip
- begun some work on Msg Object serializiation
- created a kind of general base class
Diffstat (limited to 'queue.h')
-rw-r--r--queue.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/queue.h b/queue.h
index 989fe4a7..8bf308ba 100644
--- a/queue.h
+++ b/queue.h
@@ -51,6 +51,12 @@ typedef struct queue_s {
rsRetVal (*qDestruct)(struct queue_s *pThis);
rsRetVal (*qAdd)(struct queue_s *pThis, void *pUsr);
rsRetVal (*qDel)(struct queue_s *pThis, void **ppUsr);
+ /* the following two are currently only required for disk queuing, but
+ * we keep them global because we otherwise needed to change the interface
+ * too much.
+ */
+ rsRetVal (*serializer)(uchar **ppOutBuf, size_t *lenBuf, void *pUsr);
+ rsRetVal (*deSerializer)(void *ppUsr, uchar *ppBuf, size_t lenBuf);
/* end type-specific handler */
/* synchronization variables */
pthread_mutex_t *mut;
@@ -66,8 +72,6 @@ typedef struct queue_s {
qLinkedList_t *pLast;
} linklist;
struct {
- rsRetVal (*serializer)(uchar **ppOutBuf, size_t *lenBuf, void *pUsr);
- rsRetVal (*deSerializer)(void *ppUsr, uchar *ppBuf, size_t lenBuf);
uchar *pszSpoolDir;
size_t lenSpoolDir;
uchar *pszFilePrefix;
@@ -82,8 +86,11 @@ typedef struct queue_s {
/* prototypes */
-rsRetVal queueConstruct(queue_t **ppThis, queueType_t qType, int iMaxQueueSize, rsRetVal (*pConsumer)(void*));
rsRetVal queueDestruct(queue_t *pThis);
rsRetVal queueEnqObj(queue_t *pThis, void *pUsr);
+rsRetVal queueConstruct(queue_t **ppThis, queueType_t qType, int iMaxQueueSize, rsRetVal (*pConsumer)(void*),
+ rsRetVal (*serializer)(uchar **ppOutBuf, size_t *lenBuf, void *pUsr),
+ rsRetVal (*deSerializer)(void *ppUsr, uchar *ppBuf, size_t lenBuf)
+ );
#endif /* #ifndef QUEUE_H_INCLUDED */