diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-04 15:10:24 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-04 15:10:24 +0200 |
commit | f2800ba261d2fb7466cbdebbf80afe92f0bffd3d (patch) | |
tree | b9d36b01c5c24e392c005070d8c5f3f2456bc274 /runtime/stream.h | |
parent | 9e434f19a9baa4a6f411808b5cb6bc22d6a32781 (diff) | |
download | rsyslog-f2800ba261d2fb7466cbdebbf80afe92f0bffd3d.tar.gz rsyslog-f2800ba261d2fb7466cbdebbf80afe92f0bffd3d.tar.xz rsyslog-f2800ba261d2fb7466cbdebbf80afe92f0bffd3d.zip |
modified stream class and omfile to work with it
now some basic operations are carried out via the stream class.
Diffstat (limited to 'runtime/stream.h')
-rw-r--r-- | runtime/stream.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/stream.h b/runtime/stream.h index ece33270..449bf6c6 100644 --- a/runtime/stream.h +++ b/runtime/stream.h @@ -47,6 +47,7 @@ #include "obj-types.h" #include "glbl.h" #include "stream.h" +#include "zlibw.h" /* stream types */ typedef enum { @@ -55,10 +56,12 @@ typedef enum { STREAMTYPE_FILE_MONITOR = 2 /**< monitor a (third-party) file */ } strmType_t; -typedef enum { +typedef enum { /* when extending, do NOT change existing modes! */ STREAMMMODE_INVALID = 0, STREAMMODE_READ = 1, - STREAMMODE_WRITE = 2 + STREAMMODE_WRITE = 2, + STREAMMODE_WRITE_TRUNC = 3, + STREAMMODE_WRITE_APPEND = 4 } strmMode_t; /* The strm_t data structure */ @@ -89,6 +92,9 @@ typedef struct strm_s { size_t iBufPtr; /* pointer into current buffer */ int iUngetC; /* char set via UngetChar() call or -1 if none set */ int bInRecord; /* if 1, indicates that we are currently writing a not-yet complete record */ + int iZipLevel; /* zip level (0..9). If 0, zip is completely disabled */ + Bytef *pZipBuf; + } strm_t; /* interfaces */ @@ -121,6 +127,7 @@ BEGINinterface(strm) /* name must also be changed in ENDinterface macro! */ INTERFACEpropSetMeth(strm, tOperationsMode, int); INTERFACEpropSetMeth(strm, tOpenMode, mode_t); INTERFACEpropSetMeth(strm, sType, strmType_t); + INTERFACEpropSetMeth(strm, iZipLevel, int); ENDinterface(strm) #define strmCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ |