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) 69 #define OSMBAPPENDSTR(pmb,str) if (0 != str) \ 70 rtxMemBufAppend(pmb,(OSOCTET*)str,OSCRTLSTRLEN(str)) 72 #define OSMBAPPENDSTRL(pmb,str) \ 73 rtxMemBufAppend(pmb,(OSOCTET*)str,OSCRTLSTRLEN(str)) 75 #define OSMBAPPENDUTF8(pmb,str) if (0 != str) \ 76 rtxMemBufAppend(pmb,(OSOCTET*)str,rtxUTF8LenBytes(str)) 79 #define OSMBAPPENDSTRZ(pmb,str) \ 80 rtxMemBufAppend(pmb,(OSOCTET*)str,OSCRTLSTRLEN(str)+1) 103 (OSRTMEMBUF* pMemBuf,
const OSOCTET* pdata, OSSIZE nbytes);
120 (OSRTMEMBUF* pMemBuf, OSSIZE fromOffset, OSSIZE nbytes);
139 EXTERNRT OSOCTET*
rtxMemBufGetData (
const OSRTMEMBUF* pMemBuf,
int* length);
152 (
const OSRTMEMBUF* pMemBuf, OSSIZE* length);
175 (
OSCTXT* pCtxt, OSRTMEMBUF* pMemBuf, OSSIZE segsize);
197 OSOCTET* buf, OSSIZE bufsize,
233 EXTERNRT
int rtxMemBufSet (OSRTMEMBUF* pMemBuf, OSOCTET value, OSSIZE nbytes);
247 (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.