48 typedef struct OSRTMEMBUF {
62 #define OSMBDFLTSEGSIZE 1024 64 #define OSMEMBUFPTR(pmb) ((pmb)->buffer + (pmb)->startidx) 65 #define OSMEMBUFENDPTR(pmb) ((pmb)->buffer + (pmb)->startidx + (pmb)->usedcnt) 66 #define OSMEMBUFUSEDSIZE(pmb) ((OSSIZE)(pmb)->usedcnt) 68 #define OSMBAPPENDSTR(pmb,str) if (0 != str) \ 69 rtxMemBufAppend(pmb,(OSOCTET*)str,OSCRTLSTRLEN(str)) 71 #define OSMBAPPENDSTRL(pmb,str) \ 72 rtxMemBufAppend(pmb,(OSOCTET*)str,OSCRTLSTRLEN(str)) 74 #define OSMBAPPENDUTF8(pmb,str) if (0 != str) \ 75 rtxMemBufAppend(pmb,(OSOCTET*)str,rtxUTF8LenBytes(str)) 98 (OSRTMEMBUF* pMemBuf,
const OSOCTET* pdata, OSSIZE nbytes);
115 (OSRTMEMBUF* pMemBuf, OSSIZE fromOffset, OSSIZE nbytes);
134 EXTERNRT OSOCTET*
rtxMemBufGetData (
const OSRTMEMBUF* pMemBuf,
int* length);
147 (
const OSRTMEMBUF* pMemBuf, OSSIZE* length);
170 (
OSCTXT* pCtxt, OSRTMEMBUF* pMemBuf, OSSIZE segsize);
190 OSOCTET* buf, OSSIZE bufsize,
227 EXTERNRT
int rtxMemBufSet (OSRTMEMBUF* pMemBuf, OSOCTET value, OSSIZE nbytes);
241 (OSRTMEMBUF* pMemBuf, OSBOOL isExpandable);
EXTERNRT void rtxMemBufInitBuffer(OSCTXT *pCtxt, OSRTMEMBUF *pMemBuf, OSOCTET *buf, OSSIZE bufsize, OSSIZE segsize)
This function assigns a static buffer to the memory buffer structure.
EXTERNRT OSOCTET * rtxMemBufGetData(const OSRTMEMBUF *pMemBuf, int *length)
This function returns the pointer to the used part of a memory buffer.
EXTERNRT int rtxMemBufPreAllocate(OSRTMEMBUF *pMemBuf, OSSIZE nbytes)
This function allocates a buffer with a predetermined amount of space.
EXTERNRT OSOCTET * rtxMemBufGetDataExt(const OSRTMEMBUF *pMemBuf, OSSIZE *length)
This function returns the pointer to the used part of a memory buffer.
EXTERNRT int rtxMemBufCut(OSRTMEMBUF *pMemBuf, OSSIZE fromOffset, OSSIZE nbytes)
This function cuts off the part of memory buffer.
EXTERNRT OSSIZE rtxMemBufTrimW(OSRTMEMBUF *pMemBuf)
This function trims white space of the memory buffer.
Common run-time context definitions.
EXTERNRT OSSIZE rtxMemBufGetDataLen(const OSRTMEMBUF *pMemBuf)
This function returns the length of the used part of a memory buffer.
EXTERNRT void rtxMemBufInit(OSCTXT *pCtxt, OSRTMEMBUF *pMemBuf, OSSIZE segsize)
This function initializes a memory buffer structure.
EXTERNRT int rtxMemBufAppend(OSRTMEMBUF *pMemBuf, const OSOCTET *pdata, OSSIZE nbytes)
This function appends the data to the end of a memory buffer.
EXTERNRT void rtxMemBufFree(OSRTMEMBUF *pMemBuf)
This function frees the memory buffer.
EXTERNRT int rtxMemBufSet(OSRTMEMBUF *pMemBuf, OSOCTET value, OSSIZE nbytes)
This function sets part of a memory buffer to a specified octet value.
EXTERNRT void rtxMemBufReset(OSRTMEMBUF *pMemBuf)
This function resets the memory buffer structure.
Run-time context structure.
EXTERNRT OSBOOL rtxMemBufSetUseSysMem(OSRTMEMBUF *pMemBuf, OSBOOL value)
This function sets a flag to indicate that system memory management should be used instead of the cus...
EXTERNRT OSBOOL rtxMemBufSetExpandable(OSRTMEMBUF *pMemBuf, OSBOOL isExpandable)
This function sets "isExpandable" flag for the memory buffer object.