36 #define MIN_STREAM_BACKOFF 0 60 EXTERNRT
int rtxCheckBuffer (
OSCTXT* pctxt,
size_t nbytes);
118 EXTERNRT
int rtxCheckInputBuffer (
OSCTXT* pctxt,
size_t nbytes);
120 EXTERNRT
int rtxCopyAsciiText (
OSCTXT* pctxt,
const char* text);
122 EXTERNRT
int rtxCopyUTF8Text (
OSCTXT* pctxt,
const OSUTF8CHAR* text);
124 EXTERNRT
int rtxCopyUnicodeText (
OSCTXT* pctxt,
const OSUNICHAR* text);
139 (
OSCTXT* pctxt, OSOCTET* buffer,
size_t bufsize,
size_t nocts);
169 (
OSCTXT* pctxt, OSOCTET** ppdata,
size_t nocts, OSBOOL* pMemAlloc);
180 (
OSCTXT* pctxt,
const OSOCTET* pdata,
size_t nocts);
256 #define OSRTPUTCHAR(pctxt,ch) rtxWriteBytes (pctxt, (OSOCTET*)&ch, 1) 258 #define OSRTPUTCHARREV(pctxt,ch) \ 259 (pctxt)->buffer.data[--(pctxt)->buffer.byteIndex]=(OSOCTET)ch; 261 #define OSRTZTERM(pctxt) \ 262 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex]=(OSOCTET)0; 264 #define OSRTSAFEZTERM(pctxt) \ 266 if (rtxCheckOutputBuffer (pctxt, 1) == 0) \ 267 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex]=(OSOCTET)0; \ 268 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 271 #define OSRTSAFEPUTCHAR(pctxt,ch) \ 273 if (rtxCheckOutputBuffer (pctxt, 1) == 0) \ 275 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]=(OSOCTET)ch; \ 276 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 283 #define OSRTSAFEPUTCHAR_ZTERM(pctxt,ch) \ 285 if (rtxCheckOutputBuffer (pctxt, 2) == 0) { \ 287 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]=(OSOCTET)ch; \ 288 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex]=(OSOCTET)0; } \ 289 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 293 #define OSRTSAFEPUTCHAR1(pctxt,ch,stat) \ 295 OSOCTET b = (OSOCTET)ch; \ 296 rtxWriteBytes (pctxt, &b, 1); \ 300 #define OSRTSAFEPUTCHAR2(pctxt,ch,prealloc) \ 302 if (rtxCheckOutputBuffer (pctxt, ((prealloc > 1)?prealloc:1)) == 0) \ 304 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]=(OSOCTET)ch; \ 305 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 309 #define OSRTMEMCPY(pctxt,bdata,len) \ 311 OSCRTLSAFEMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], \ 312 (pctxt)->buffer.size-(pctxt)->buffer.byteIndex, bdata, len); \ 313 (pctxt)->buffer.byteIndex += len; \ 314 (pctxt)->lastChar = (pctxt)->buffer.data[(pctxt)->buffer.byteIndex-1]; \ 317 #define OSRTMEMCPYREV(pctxt,bdata,len) \ 319 (pctxt)->buffer.byteIndex -= len; \ 320 OSCRTLSAFEMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], \ 321 (pctxt)->buffer.size-(pctxt)->buffer.byteIndex, bdata, len); \ 324 #define OSRTSAFEMEMCPY(pctxt,bdata,len) \ 326 if (rtxCheckOutputBuffer (pctxt, len) == 0) { \ 327 OSCRTLMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], bdata, len); \ 328 (pctxt)->buffer.byteIndex += len; \ 329 (pctxt)->lastChar = (pctxt)->buffer.data[(pctxt)->buffer.byteIndex-1]; } \ 330 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 333 #define OSRTSAFEMEMCPY1(pctxt,bdata,len,stat) \ 335 if (rtxCheckOutputBuffer (pctxt, len) == 0) { \ 336 OSCRTLMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], bdata, len); \ 337 (pctxt)->buffer.byteIndex += len; \ 338 (pctxt)->lastChar = (pctxt)->buffer.data[(pctxt)->buffer.byteIndex-1]; \ 340 else stat = RTERR_BUFOVFLW; \ 343 #define OSRTGETBUFUTF8LEN(pctxt) \ 344 rtxCalcUTF8Len (OSRTBUFPTR (pctxt), OSRTBUFSIZE (pctxt)) 346 #define OSRTCHKBUFUTF8LEN(pctxt,lower,upper,stat) \ 347 do { size_t nchars = OSRTGETBUFUTF8LEN (pctxt); \ 348 stat = (nchars >= lower && nchars <= upper) ? 0 : RTERR_CONSVIO; } while(0) 350 #define OSRTENDOFBUF(pctxt) ((pctxt)->buffer.byteIndex >= (pctxt)->buffer.size) int rtxWriteBytes(OSCTXT *pctxt, const OSOCTET *pdata, size_t nocts)
int rtxReadBytes(OSCTXT *pctxt, OSOCTET *pdata, size_t nocts)
void rtxGetBufLocDescr(OSCTXT *pctxt, OSRTBufLocDescr *pDescr)
int rtxCheckOutputBuffer(OSCTXT *pctxt, size_t nbytes)
struct _OSRTBufLocDescr OSRTBufLocDescr
Definition: rtxSList.h:68
Definition: rtxBuffer.h:50
int rtxFlushOutputBuffer(OSCTXT *pctxt)
void rtxAddBufLocDescr(OSCTXT *pctxt, OSRTSList *pElemList, OSRTBufLocDescr *pDescr)
int rtxReadBytesDynamic(OSCTXT *pctxt, OSOCTET **ppdata, size_t nocts, OSBOOL *pMemAlloc)
OSBOOL rtxCanonicalSort(OSOCTET *refPoint, OSRTSList *pList, OSBOOL normal)
int rtxEncCanonicalSort(OSCTXT *pctxt, OSCTXT *pMemCtxt, OSRTSList *pList)
OSBOOL rtxIsOutputBufferFlushable(OSCTXT *pctxt)
int rtxExpandOutputBuffer(OSCTXT *pctxt, size_t nbytes)
int rtxReadBytesSafe(OSCTXT *pctxt, OSOCTET *buffer, size_t bufsize, size_t nocts)
Definition: rtxContext.h:189