67 (
struct OSRTSTREAM* pStream, OSOCTET* pbuffer,
size_t bufSize);
75 (
struct OSRTSTREAM* pStream, OSOCTET* pbuffer,
size_t toReadBytes);
83 const OSOCTET* data,
size_t numocts);
138 #define OSRTSTRMF_INPUT 0x0001 139 #define OSRTSTRMF_OUTPUT 0x0002 140 #define OSRTSTRMF_BUFFERED 0x8000 141 #define OSRTSTRMF_UNBUFFERED 0x4000 142 #define OSRTSTRMF_POSMARKED 0x2000 143 #define OSRTSTRMF_FIXINMEM 0x1000 144 #define OSRTSTRMF_HEXTEXT 0x0800 146 #define OSRTSTRMF_BUF_INPUT (OSRTSTRMF_INPUT|OSRTSTRMF_BUFFERED) 147 #define OSRTSTRMF_BUF_OUTPUT (OSRTSTRMF_OUTPUT|OSRTSTRMF_BUFFERED) 150 #define OSRTSTRMID_FILE 1 151 #define OSRTSTRMID_SOCKET 2 152 #define OSRTSTRMID_MEMORY 3 153 #define OSRTSTRMID_BUFFERED 4 154 #define OSRTSTRMID_DIRECTBUF 5 155 #define OSRTSTRMID_CTXTBUF 6 156 #define OSRTSTRMID_ZLIB 7 157 #define OSRTSTRMID_USER 1000 159 #define OSRTSTRM_K_BUFSIZE 1024 161 #define OSRTSTRM_K_INVALIDMARK ((size_t)-1) 163 #define OSRTSTREAM_BYTEINDEX(pctxt) \ 164 (((pctxt)->pStream->flags & OSRTSTRMF_BUFFERED) ? \ 165 ((pctxt)->pStream->bytesProcessed + (pctxt)->buffer.byteIndex) : \ 166 ((pctxt)->pStream->bytesProcessed )) 168 #define OSRTSTREAM_ID(pctxt) ((pctxt)->pStream->id) 169 #define OSRTSTREAM_FLAGS(pctxt) ((pctxt)->pStream->flags) 289 (
OSCTXT* pctxt, OSOCTET* pbuffer,
size_t bufSize);
291 EXTERNRT
long rtxStreamReadDirect
292 (
OSCTXT* pctxt, OSOCTET* pbuffer, OSSIZE bufSize);
311 (
OSCTXT* pctxt, OSOCTET* pbuffer,
size_t readBytes);
339 (
OSCTXT* pctxt,
const OSOCTET* data,
size_t numocts);
EXTERNRT int rtxStreamGetPos(OSCTXT *pctxt, size_t *ppos)
Get the current position in input stream.
OSRTStreamGetPosProc getPos
pointer to getPos function
EXTERNRT long rtxStreamWrite(OSCTXT *pctxt, const OSOCTET *data, size_t numocts)
This function writes the specified amount of octets from the specified array to the output stream...
int(* OSRTStreamSkipProc)(struct OSRTSTREAM *pStream, size_t skipBytes)
Stream skip function pointer type.
size_t markedBytesProcessed
the marked number of bytes already processed
size_t readAheadLimit
read ahead limit (used by rtxStreamMark/rtxStreamReset
EXTERNRT int rtxStreamInit(OSCTXT *pctxt)
This function initializes a stream part of the context block.
EXTERNRT void rtxStreamSetCapture(OSCTXT *pctxt, OSRTMEMBUF *pmembuf)
This function sets a capture buffer for the stream.
EXTERNRT OSBOOL rtxStreamMarkSupported(OSCTXT *pctxt)
Tests if this input stream supports the mark and reset methods.
EXTERNRT OSBOOL rtxStreamIsOpened(OSCTXT *pctxt)
Tests if this stream opened (for reading or writing).
OSUINT16 flags
flags (see OSRTSTRMF_* macros
int(* OSRTStreamCloseProc)(struct OSRTSTREAM *pStream)
Stream close function pointer type.
EXTERNRT int rtxStreamGetIOBytes(OSCTXT *pctxt, size_t *pPos)
This function returns the number of processed octets.
size_t segsize
size of decoded segment
OSUINT32 id
id of stream (see OSRTSTRMID_* macros)
OSRTStreamWriteProc write
pointer to write function
EXTERNRT int rtxStreamSetPos(OSCTXT *pctxt, size_t pos)
Set the current position in input stream.
size_t nextMarkOffset
offset of next appropriate mark position
EXTERNRT long rtxStreamBlockingRead(OSCTXT *pctxt, OSOCTET *pbuffer, size_t readBytes)
This function reads up to 'bufsize' bytes of data from the input stream into an array of octets...
OSRTMEMBUF * pCaptureBuf
Buffer into which data read from stream can be captured for debugging purposes.
int(* OSRTStreamSetPosProc)(struct OSRTSTREAM *pStream, size_t pos)
Stream set position function pointer type.
size_t bytesProcessed
the number of bytes processed by the application program
EXTERNRT int rtxStreamInitCtxtBuf(OSCTXT *pctxt)
This function initializes a stream to use the context memory buffer for stream buffering.
OSRTStreamSetPosProc setPos
pointer to setPos function
int(* OSRTStreamFlushProc)(struct OSRTSTREAM *pStream)
Stream flush function pointer type.
Common run-time context definitions.
EXTERNRT int rtxStreamFlush(OSCTXT *pctxt)
This function flushes the output stream and forces any buffered output octets to be written out...
EXTERNRT OSBOOL rtxStreamIsWritable(OSCTXT *pctxt)
Tests if this stream opened for writing.
long(* OSRTStreamWriteProc)(struct OSRTSTREAM *pStream, const OSOCTET *data, size_t numocts)
Stream write function pointer type.
EXTERNRT OSRTMEMBUF * rtxStreamGetCapture(OSCTXT *pctxt)
This function returns the capture buffer currently assigned to the stream.
OSRTStreamSkipProc skip
pointer to skip function
EXTERNRT long rtxStreamRead(OSCTXT *pctxt, OSOCTET *pbuffer, size_t bufSize)
This function reads up to 'bufsize' bytes of data from the input stream into an array of octets...
EXTERNRT int rtxStreamClose(OSCTXT *pctxt)
This function closes the input or output stream and releases any system resources associated with the...
int(* OSRTStreamResetProc)(struct OSRTSTREAM *pStream)
Stream reset function pointer type.
long(* OSRTStreamReadProc)(struct OSRTSTREAM *pStream, OSOCTET *pbuffer, size_t bufSize)
Stream read function pointer type.
int(* OSRTStreamMarkProc)(struct OSRTSTREAM *pStream, size_t readAheadLimit)
Stream mark function pointer type.
EXTERNRT int rtxStreamSkip(OSCTXT *pctxt, size_t skipBytes)
This function skips over and discards the specified amount of data octets from this input stream...
size_t bufsize
physical size of pctxt->buffer.data buffer
size_t ioBytes
the actual number of bytes read from or written to the stream
OSRTStreamMarkProc mark
pointer to mark function
EXTERNRT int rtxStreamRelease(OSCTXT *pctxt)
This function releases the stream's resources.
struct OSRTSTREAM OSRTSTREAM
The stream control block.
EXTERNRT OSBOOL rtxStreamIsReadable(OSCTXT *pctxt)
Tests if this stream opened for reading.
OSRTStreamReadProc read
pointer to read function
EXTERNRT int rtxStreamReset(OSCTXT *pctxt)
Repositions this stream to the position recorded by the last call to the rtxStreamMark function...
OSRTStreamCloseProc close
pointer to close function
OSRTStreamResetProc reset
pointer to reset function
Run-time context structure.
OSRTStreamFlushProc flush
pointer to flush function
The stream control block.
int(* OSRTStreamGetPosProc)(struct OSRTSTREAM *pStream, size_t *ppos)
Stream get position function pointer type.
long(* OSRTStreamBlockingReadProc)(struct OSRTSTREAM *pStream, OSOCTET *pbuffer, size_t toReadBytes)
Stream blockingRead function pointer type.
EXTERNRT int rtxStreamRemoveCtxtBuf(OSCTXT *pctxt)
This function removes the use of a context memory buffer from a stream.
OSRTStreamBlockingReadProc blockingRead
pointer to blockingRead function
EXTERNRT int rtxStreamMark(OSCTXT *pctxt, size_t readAheadLimit)
Marks the current position in this input stream.
void * extra
pointer to stream-specific data