36 #define MIN_STREAM_BACKOFF 0 60 EXTERNRT
int rtxCheckBuffer (
OSCTXT* pctxt,
size_t nbytes);
133 EXTERNRT
int rtxCopyAsciiText (
OSCTXT* pctxt,
const char* text);
135 EXTERNRT
int rtxCopyUTF8Text (
OSCTXT* pctxt,
const OSUTF8CHAR* text);
137 EXTERNRT
int rtxCopyUnicodeText (
OSCTXT* pctxt,
const OSUNICHAR* text);
185 OSSIZE nocts, OSSIZE* pactual);
200 (
OSCTXT* pctxt, OSOCTET* buffer,
size_t bufsize,
size_t nocts);
230 (
OSCTXT* pctxt, OSOCTET** ppdata,
size_t nocts, OSBOOL* pMemAlloc);
241 (
OSCTXT* pctxt,
const OSOCTET* pdata,
size_t nocts);
373 #define OSRTPUTCHAR(pctxt,ch) rtxWriteBytes (pctxt, (OSOCTET*)&ch, 1) 375 #define OSRTPUTCHARREV(pctxt,ch) \ 376 (pctxt)->buffer.data[--(pctxt)->buffer.byteIndex]=(OSOCTET)ch; 378 #define OSRTZTERM(pctxt) \ 379 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex]=(OSOCTET)0; 381 #define OSRTSAFEZTERM(pctxt) \ 383 if (rtxCheckOutputBuffer (pctxt, 1) == 0) \ 384 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex]=(OSOCTET)0; \ 385 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 388 #define OSRTSAFEPUTCHAR(pctxt,ch) \ 390 if (rtxCheckOutputBuffer (pctxt, 1) == 0) \ 392 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]=(OSOCTET)ch; \ 393 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 400 #define OSRTSAFEPUTCHAR_ZTERM(pctxt,ch) \ 402 if (rtxCheckOutputBuffer (pctxt, 2) == 0) { \ 404 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]=(OSOCTET)ch; \ 405 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex]=(OSOCTET)0; } \ 406 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 410 #define OSRTSAFEPUTCHAR1(pctxt,ch,stat) \ 412 OSOCTET b = (OSOCTET)ch; \ 413 rtxWriteBytes (pctxt, &b, 1); \ 417 #define OSRTSAFEPUTCHAR2(pctxt,ch,prealloc) \ 419 if (rtxCheckOutputBuffer (pctxt, ((prealloc > 1)?prealloc:1)) == 0) \ 421 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]=(OSOCTET)ch; \ 422 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 426 #define OSRTMEMCPY(pctxt,bdata,len) \ 428 OSCRTLSAFEMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], \ 429 (pctxt)->buffer.size-(pctxt)->buffer.byteIndex, bdata, len); \ 430 (pctxt)->buffer.byteIndex += len; \ 431 (pctxt)->lastChar = (pctxt)->buffer.data[(pctxt)->buffer.byteIndex-1]; \ 434 #define OSRTMEMCPYREV(pctxt,bdata,len) \ 436 (pctxt)->buffer.byteIndex -= len; \ 437 OSCRTLSAFEMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], \ 438 (pctxt)->buffer.size-(pctxt)->buffer.byteIndex, bdata, len); \ 441 #define OSRTSAFEMEMCPY(pctxt,bdata,len) \ 443 if (rtxCheckOutputBuffer (pctxt, len) == 0) { \ 444 OSCRTLMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], bdata, len); \ 445 (pctxt)->buffer.byteIndex += len; \ 446 (pctxt)->lastChar = (pctxt)->buffer.data[(pctxt)->buffer.byteIndex-1]; } \ 447 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 450 #define OSRTSAFEMEMCPY1(pctxt,bdata,len,stat) \ 452 if (rtxCheckOutputBuffer (pctxt, len) == 0) { \ 453 OSCRTLMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], bdata, len); \ 454 (pctxt)->buffer.byteIndex += len; \ 455 (pctxt)->lastChar = (pctxt)->buffer.data[(pctxt)->buffer.byteIndex-1]; \ 457 else stat = RTERR_BUFOVFLW; \ 460 #define OSRTGETBUFUTF8LEN(pctxt) \ 461 rtxCalcUTF8Len (OSRTBUFPTR (pctxt), OSRTBUFSIZE (pctxt)) 463 #define OSRTCHKBUFUTF8LEN(pctxt,lower,upper,stat) \ 464 do { size_t nchars = OSRTGETBUFUTF8LEN (pctxt); \ 465 stat = (nchars >= lower && nchars <= upper) ? 0 : RTERR_CONSVIO; } while(0) 467 #define OSRTENDOFBUF(pctxt) ((pctxt)->buffer.byteIndex >= (pctxt)->buffer.size) 469 #define OSRTByteAlign(pctxt) \ 470 if ((pctxt)->buffer.bitOffset != 8) { \ 471 (pctxt)->buffer.byteIndex++; \ 472 (pctxt)->buffer.bitOffset = 8; } \ 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)
void rtxIndentIncr(OSCTXT *pctxt)
int rtxCheckOutputBuffer(OSCTXT *pctxt, size_t nbytes)
struct _OSRTBufLocDescr OSRTBufLocDescr
Definition: rtxSList.h:68
Definition: rtxBuffer.h:50
int rtxCheckInputBuffer(OSCTXT *pctxt, size_t nbytes)
int rtxWriteIndent(OSCTXT *pctxt)
int rtxFlushOutputBuffer(OSCTXT *pctxt)
int rtxLoadInputBuffer(OSCTXT *pctxt, OSSIZE nbytes)
void rtxIndentReset(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)
void rtxIndentDecr(OSCTXT *pctxt)
OSBOOL rtxIsOutputBufferFlushable(OSCTXT *pctxt)
int rtxExpandOutputBuffer(OSCTXT *pctxt, size_t nbytes)
int rtxReadBytesSafe(OSCTXT *pctxt, OSOCTET *buffer, size_t bufsize, size_t nocts)
size_t rtxGetIndentLevels(OSCTXT *pctxt)
Definition: rtxContext.h:198
int rtxPeekBytes(OSCTXT *pctxt, OSOCTET *pdata, OSSIZE bufsize, OSSIZE nocts, OSSIZE *pactual)
int rtxPeekByte(OSCTXT *pctxt, OSOCTET *pbyte)