summaryrefslogtreecommitdiffstats
path: root/queue.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-03 11:14:03 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-03 11:14:03 +0000
commit9e67ae041d964748755e5c9c45ebe55ff612391e (patch)
tree451c4ba0a65acd70d38147e8148e0633c8b7485d /queue.h
parent48cb0a980f657fe1d6484a1322db26c753835f03 (diff)
downloadrsyslog-9e67ae041d964748755e5c9c45ebe55ff612391e.tar.gz
rsyslog-9e67ae041d964748755e5c9c45ebe55ff612391e.tar.xz
rsyslog-9e67ae041d964748755e5c9c45ebe55ff612391e.zip
implemented queue type "drivers"
Diffstat (limited to 'queue.h')
-rw-r--r--queue.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/queue.h b/queue.h
index 1a1722a0..86499306 100644
--- a/queue.h
+++ b/queue.h
@@ -26,14 +26,20 @@
/* queue types */
typedef enum {
- QUEUETYPE_FIXED_ARRAY, /* a simple queue made out of a fixed (initially malloced) array fast but memoryhog */
- QUEUETYPE_LINKEDLIST, /* linked list used as buffer, lower fixed memory overhead but slower */
+ QUEUETYPE_FIXED_ARRAY,/* a simple queue made out of a fixed (initially malloced) array fast but memoryhog */
+ QUEUETYPE_LINKEDLIST,/* linked list used as buffer, lower fixed memory overhead but slower */
} queueType_t;
/* the queue object */
-typedef struct {
+typedef struct queue_s {
queueType_t qType;
int iMaxQueueSize; /* how large can the queue grow? */
+ /* type-specific handlers (set during construction) */
+ rsRetVal (*qConstruct)(struct queue_s *pThis);
+ rsRetVal (*qDestruct)(struct queue_s *pThis);
+ rsRetVal (*qAdd)(struct queue_s *pThis, void *pUsr);
+ rsRetVal (*qDel)(struct queue_s *pThis, void **ppUsr);
+ /* end type-specific handler */
/* synchronization variables */
pthread_mutex_t *mut;
pthread_cond_t *notFull, *notEmpty;