diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-03 11:14:03 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-03 11:14:03 +0000 |
commit | 9e67ae041d964748755e5c9c45ebe55ff612391e (patch) | |
tree | 451c4ba0a65acd70d38147e8148e0633c8b7485d /queue.h | |
parent | 48cb0a980f657fe1d6484a1322db26c753835f03 (diff) | |
download | rsyslog-9e67ae041d964748755e5c9c45ebe55ff612391e.tar.gz rsyslog-9e67ae041d964748755e5c9c45ebe55ff612391e.tar.bz2 rsyslog-9e67ae041d964748755e5c9c45ebe55ff612391e.zip |
implemented queue type "drivers"
Diffstat (limited to 'queue.h')
-rw-r--r-- | queue.h | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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; |