summaryrefslogtreecommitdiffstats
path: root/queue.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-07 09:51:55 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-07 09:51:55 +0000
commitcfbb74e7a59c93c3816b431ffb25adf2032c5ef0 (patch)
tree3289f5474b50ce2ffa5785998e38c43029529500 /queue.h
parentc8b946aa94251a93fc934d8e3e875f5f26fcfcfd (diff)
downloadrsyslog-cfbb74e7a59c93c3816b431ffb25adf2032c5ef0.tar.gz
rsyslog-cfbb74e7a59c93c3816b431ffb25adf2032c5ef0.tar.xz
rsyslog-cfbb74e7a59c93c3816b431ffb25adf2032c5ef0.zip
implemented disk queue as far as I could without an object de-serializer
Diffstat (limited to 'queue.h')
-rw-r--r--queue.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/queue.h b/queue.h
index 8c8782d3..f0740c44 100644
--- a/queue.h
+++ b/queue.h
@@ -26,6 +26,18 @@
#include <pthread.h>
#include "obj.h"
+/* some information about disk files used by the queue. In the long term, we may
+ * export this settings to a separate file module - or not (if they are too
+ * queue-specific. I just thought I mention it here so that everyone is aware
+ * of this possibility. -- rgerhards, 2008-01-07
+ */
+typedef struct {
+ int fd; /* the file descriptor, -1 if closed */
+ int iCurrFileNum;/* current file number (NOT descriptor, but the number in the file name!) */
+ int iCurrOffs; /* current offset */
+} queueFileDescription_t;
+
+
/* queue types */
typedef enum {
QUEUETYPE_FIXED_ARRAY = 0,/* a simple queue made out of a fixed (initially malloced) array fast but memoryhog */
@@ -73,10 +85,10 @@ typedef struct queue_s {
size_t lenSpoolDir;
uchar *pszFilePrefix;
size_t lenFilePrefix;
- int iCurrFileNum; /* number of file currently processed */
- int fd; /* current file descriptor */
- long iWritePos; /* next write position offset */
- long iReadPos; /* next read position offset */
+ int iNumberFiles; /* how many files make up the queue? */
+ int iMaxFileSize; /* max size for a single queue file */
+ queueFileDescription_t fWrite; /* current file to be written */
+ queueFileDescription_t fRead; /* current file to be read */
} disk;
} tVars;
} queue_t;