summaryrefslogtreecommitdiffstats
path: root/stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'stream.h')
-rw-r--r--stream.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/stream.h b/stream.h
index 89d27b54..6e901449 100644
--- a/stream.h
+++ b/stream.h
@@ -62,8 +62,7 @@ typedef enum {
typedef struct strm_s {
BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */
strmType_t sType;
- int fd; /* the file descriptor, -1 if closed */
- uchar *pszCurrFName; /* name of current file (if open) */
+ /* descriptive properties */
int iCurrFNum;/* current file number (NOT descriptor, but the number in the file name!) */
uchar *pszDir; /* Directory */
int lenDir;
@@ -71,18 +70,21 @@ typedef struct strm_s {
int lenFilePrefix;
strmMode_t tOperationsMode;
mode_t tOpenMode;
- size_t iCurrOffs;/* current offset */
- uchar *pIOBuf; /* io Buffer */
size_t sIOBufSize;/* size of IO buffer */
- int iBufPtrMax; /* current max Ptr in Buffer (if partial read!) */
- int iBufPtr; /* pointer into current buffer */
- int iUngetC; /* char set via UngetChar() call or -1 if none set */
int iFlagsOpenOS;
int iModeOpenOS;
size_t iMaxFileSize;/* maximum size a file may grow to */
int bDeleteOnClose; /* set to 1 to auto-delete on close -- be careful with that setting! */
int iMaxFiles; /* maximum number of files if a circular mode is in use */
int iFileNumDigits;/* min number of digits to use in file number (only in circular mode) */
+ /* dynamic properties, valid only during file open, not to be persistet */
+ int fd; /* the file descriptor, -1 if closed */
+ size_t iCurrOffs;/* current offset */
+ uchar *pszCurrFName; /* name of current file (if open) */
+ uchar *pIOBuf; /* io Buffer */
+ size_t iBufPtrMax; /* current max Ptr in Buffer (if partial read!) */
+ 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 */
} strm_t;
@@ -95,11 +97,13 @@ rsRetVal strmSetFilePrefix(strm_t *pThis, uchar *pszPrefix, size_t iLenPrefix);
rsRetVal strmReadChar(strm_t *pThis, uchar *pC);
rsRetVal strmUnreadChar(strm_t *pThis, uchar c);
rsRetVal strmWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf);
-rsRetVal strmNextFile(strm_t *pThis);
-//rsRetVal strmOpenFile(strm_t *pThis, int flags, mode_t mode);
+rsRetVal strmWriteChar(strm_t *pThis, uchar c);
+rsRetVal strmWriteLong(strm_t *pThis, long i);
rsRetVal strmSetFilePrefix(strm_t *pThis, uchar *pszPrefix, size_t iLenPrefix);
rsRetVal strmSetDir(strm_t *pThis, uchar *pszDir, size_t iLenDir);
rsRetVal strmFlush(strm_t *pThis);
+rsRetVal strmRecordBegin(strm_t *pThis);
+rsRetVal strmRecordEnd(strm_t *pThis);
PROTOTYPEObjClassInit(strm);
PROTOTYPEpropSetMeth(strm, bDeleteOnClose, int);
PROTOTYPEpropSetMeth(strm, iMaxFileSize, int);