Lines Matching defs:pStrBuf

641  * @param   pStrBuf             The buffer structure to initialize.
644 static void vbcppStrBufInit(PVBCPPSTRBUF pStrBuf, PVBCPP pThis)
646 pStrBuf->pThis = pThis;
647 pStrBuf->cchBuf = 0;
648 pStrBuf->cbBufAllocated = 0;
649 pStrBuf->pszBuf = NULL;
656 * @param pStrBuf Pointer to the string buffer.
658 static void vbcppStrBufDelete(PVBCPPSTRBUF pStrBuf)
660 RTMemFree(pStrBuf->pszBuf);
661 pStrBuf->pszBuf = NULL;
670 * @param pStrBuf Pointer to the string buffer.
673 static RTEXITCODE vbcppStrBufGrow(PVBCPPSTRBUF pStrBuf, size_t cbMin)
675 if (pStrBuf->cbBufAllocated >= cbMin)
678 size_t cbNew = pStrBuf->cbBufAllocated * 2;
681 void *pv = RTMemRealloc(pStrBuf->pszBuf, cbNew);
683 return vbcppError(pStrBuf->pThis, "out of memory (%zu bytes)", cbNew);
685 pStrBuf->pszBuf = (char *)pv;
686 pStrBuf->cbBufAllocated = cbNew;
695 * @param pStrBuf Pointer to the string buffer.
699 static RTEXITCODE vbcppStrBufAppendN(PVBCPPSTRBUF pStrBuf, const char *pchSrc, size_t cchSrc)
701 size_t cchBuf = pStrBuf->cchBuf;
702 if (cchBuf + cchSrc + 1 > pStrBuf->cbBufAllocated)
704 RTEXITCODE rcExit = vbcppStrBufGrow(pStrBuf, cchBuf + cchSrc + 1);
709 memcpy(&pStrBuf->pszBuf[cchBuf], pchSrc, cchSrc);
711 pStrBuf->pszBuf[cchBuf] = '\0';
712 pStrBuf->cchBuf = cchBuf;
722 * @param pStrBuf Pointer to the string buffer.
725 static RTEXITCODE vbcppStrBufAppendCh(PVBCPPSTRBUF pStrBuf, char ch)
727 size_t cchBuf = pStrBuf->cchBuf;
728 if (cchBuf + 2 > pStrBuf->cbBufAllocated)
730 RTEXITCODE rcExit = vbcppStrBufGrow(pStrBuf, cchBuf + 2);
735 pStrBuf->pszBuf[cchBuf++] = ch;
736 pStrBuf->pszBuf[cchBuf] = '\0';
737 pStrBuf->cchBuf = cchBuf;
747 * @param pStrBuf Pointer to the string buffer.
750 static RTEXITCODE vbcppStrBufAppend(PVBCPPSTRBUF pStrBuf, const char *psz)
752 return vbcppStrBufAppendN(pStrBuf, psz, strlen(psz));
760 * @param pStrBuf Pointer to the string buffer.
762 static char vbcppStrBufLastCh(PVBCPPSTRBUF pStrBuf)
764 if (!pStrBuf->cchBuf)
766 return pStrBuf->pszBuf[pStrBuf->cchBuf - 1];
2037 * @param pStrBuf String buffer containing the result. The caller
2041 PVBCPPSTRBUF pStrBuf)
2090 rcExit = vbcppStrBufAppendN(pStrBuf, pszSrcSeq, pszSrc - pszSrcSeq);
2106 rcExit = vbcppStrBufAppendN(pStrBuf, pszSrcSeq, pszSrc - pszSrcSeq);
2116 rcExit = vbcppStrBufAppendN(pStrBuf, pszSrcSeq, pszSrc - pszSrcSeq);
2121 if (RT_C_IS_SPACE(vbcppStrBufLastCh(pStrBuf)))
2123 rcExit = vbcppStrBufAppendCh(pStrBuf, ch);
2141 rcExit = vbcppStrBufAppend(pStrBuf, pExp->papszArgs[iArg]);
2143 rcExit = vbcppStrBufAppendCh(pStrBuf, ' ');
2152 rcExit = vbcppStrBufAppend(pStrBuf, pExp->papszArgs[iArg]);
2158 rcExit = vbcppStrBufAppendCh(pStrBuf, ',');
2164 rcExit = vbcppStrBufAppendCh(pStrBuf, ' ');
2169 rcExit = vbcppStrBufAppendN(pStrBuf, pszSrcSeq, cchDefine);
2173 rcExit = vbcppStrBufAppendCh(pStrBuf, ch);
4308 static RTEXITCODE vbcppExtractQuotedString(PVBCPP pThis, PSCMSTREAM pStrmInput, PVBCPPSTRBUF pStrBuf,
4314 RTEXITCODE rcExit = vbcppStrBufAppendCh(pStrBuf, chOpen);
4326 rcExit = vbcppStrBufAppendCh(pStrBuf, '\\');
4328 rcExit = vbcppStrBufAppendCh(pStrBuf, ch);
4334 rcExit = vbcppStrBufAppendCh(pStrBuf, ch);
4355 * @param pStrBuf Where to store the extracted line. Caller must
4361 static RTEXITCODE vbcppExtractDirectiveLine(PVBCPP pThis, PSCMSTREAM pStrmInput, PVBCPPSTRBUF pStrBuf, size_t *poffComment)
4384 rcExit = vbcppStrBufAppendCh(pStrBuf, '/');
4389 rcExit = vbcppExtractQuotedString(pThis, pStrmInput, pStrBuf, '\'', '\'');
4394 rcExit = vbcppExtractQuotedString(pThis, pStrmInput, pStrBuf, '"', '"');
4399 && ( RT_C_IS_SPACE(vbcppStrBufLastCh(pStrBuf))
4400 || vbcppStrBufLastCh(pStrBuf) == '\0') )
4421 rcExit = vbcppStrBufAppendCh(pStrBuf, ch);