36 #define MIN_STREAM_BACKOFF 0 60 EXTERNRT
int rtxCheckBuffer (
OSCTXT* pctxt,
size_t nbytes);
140 EXTERNRT
int rtxCopyAsciiText (
OSCTXT* pctxt,
const char* text);
142 EXTERNRT
int rtxCopyUTF8Text (
OSCTXT* pctxt,
const OSUTF8CHAR* text);
144 EXTERNRT
int rtxCopyUnicodeText (
OSCTXT* pctxt,
const OSUNICHAR* text);
192 OSSIZE nocts, OSSIZE* pactual);
207 (
OSCTXT* pctxt, OSOCTET* buffer,
size_t bufsize,
size_t nocts);
237 (
OSCTXT* pctxt, OSOCTET** ppdata,
size_t nocts, OSBOOL* pMemAlloc);
248 (
OSCTXT* pctxt,
const OSOCTET* pdata,
size_t nocts);
380 #define OSRTPUTCHAR(pctxt,ch) rtxWriteBytes (pctxt, (OSOCTET*)&ch, 1) 382 #define OSRTPUTCHARREV(pctxt,ch) \ 383 (pctxt)->buffer.data[--(pctxt)->buffer.byteIndex]=(OSOCTET)ch; 385 #define OSRTZTERM(pctxt) \ 386 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex]=(OSOCTET)0; 388 #define OSRTSAFEZTERM(pctxt) \ 390 if (rtxCheckOutputBuffer (pctxt, 1) == 0) \ 391 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex]=(OSOCTET)0; \ 392 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 395 #define OSRTSAFEPUTCHAR(pctxt,ch) \ 397 if (rtxCheckOutputBuffer (pctxt, 1) == 0) \ 399 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]=(OSOCTET)ch; \ 400 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 407 #define OSRTSAFEPUTCHAR_ZTERM(pctxt,ch) \ 409 if (rtxCheckOutputBuffer (pctxt, 2) == 0) { \ 411 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]=(OSOCTET)ch; \ 412 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex]=(OSOCTET)0; } \ 413 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 417 #define OSRTSAFEPUTCHAR1(pctxt,ch,stat) \ 419 OSOCTET b = (OSOCTET)ch; \ 420 rtxWriteBytes (pctxt, &b, 1); \ 424 #define OSRTSAFEPUTCHAR2(pctxt,ch,prealloc) \ 426 if (rtxCheckOutputBuffer (pctxt, ((prealloc > 1)?prealloc:1)) == 0) \ 428 (pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]=(OSOCTET)ch; \ 429 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 433 #define OSRTMEMCPY(pctxt,bdata,len) \ 435 OSCRTLSAFEMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], \ 436 (pctxt)->buffer.size-(pctxt)->buffer.byteIndex, bdata, len); \ 437 (pctxt)->buffer.byteIndex += len; \ 438 (pctxt)->lastChar = (pctxt)->buffer.data[(pctxt)->buffer.byteIndex-1]; \ 441 #define OSRTMEMCPYREV(pctxt,bdata,len) \ 443 (pctxt)->buffer.byteIndex -= len; \ 444 OSCRTLSAFEMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], \ 445 (pctxt)->buffer.size-(pctxt)->buffer.byteIndex, bdata, len); \ 448 #define OSRTSAFEMEMCPY(pctxt,bdata,len) \ 450 if (rtxCheckOutputBuffer (pctxt, len) == 0) { \ 451 OSCRTLMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], bdata, len); \ 452 (pctxt)->buffer.byteIndex += len; \ 453 (pctxt)->lastChar = (pctxt)->buffer.data[(pctxt)->buffer.byteIndex-1]; } \ 454 else return LOG_RTERRNEW (pctxt, RTERR_BUFOVFLW); \ 457 #define OSRTSAFEMEMCPY1(pctxt,bdata,len,stat) \ 459 if (rtxCheckOutputBuffer (pctxt, len) == 0) { \ 460 OSCRTLMEMCPY (&(pctxt)->buffer.data[(pctxt)->buffer.byteIndex], bdata, len); \ 461 (pctxt)->buffer.byteIndex += len; \ 462 (pctxt)->lastChar = (pctxt)->buffer.data[(pctxt)->buffer.byteIndex-1]; \ 464 else stat = RTERR_BUFOVFLW; \ 467 #define OSRTGETBUFUTF8LEN(pctxt) \ 468 rtxCalcUTF8Len (OSRTBUFPTR (pctxt), OSRTBUFSIZE (pctxt)) 470 #define OSRTCHKBUFUTF8LEN(pctxt,lower,upper,stat) \ 471 do { size_t nchars = OSRTGETBUFUTF8LEN (pctxt); \ 472 stat = (nchars >= lower && nchars <= upper) ? 0 : RTERR_CONSVIO; } while(0) 474 #define OSRTENDOFBUF(pctxt) ((pctxt)->buffer.byteIndex >= (pctxt)->buffer.size) 476 #define OSRTByteAlign(pctxt) \ 477 if ((pctxt)->buffer.bitOffset != 8) { \ 478 (pctxt)->buffer.byteIndex++; \ 479 (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)
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 rtxDecrBufferByteIndex(OSCTXT *pctxt, OSSIZE nbytes)
int rtxCheckOutputBuffer(OSCTXT *pctxt, OSSIZE nbytes)
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)