Lines Matching defs:cchDefine

524 static PVBCPPMACRO  vbcppMacroLookup(PVBCPP pThis, const char *pszDefine, size_t cchDefine);
1554 size_t cchDefine;
1555 const char *pchDefine = ScmStreamCGetWordM1(pStrmInput, &cchDefine);
1561 PVBCPPMACRO pMacro = vbcppMacroLookup(pThis, pchDefine, cchDefine);
1578 rcExit = vbcppStrBufAppendN(&ExpCtx.StrBuf, pchDefine, cchDefine);
1580 rcExit = vbcppMacroExpandIt(pThis, &ExpCtx, 0 /* offset */, pMacro, cchDefine);
1607 int rc = ScmStreamWrite(&pThis->StrmOutput, pchDefine, cchDefine);
1642 * @param cchDefine The length of the name. RTSTR_MAX is ok.
1644 static bool vbcppMacroExists(PVBCPP pThis, const char *pszDefine, size_t cchDefine)
1646 return cchDefine > 0
1648 && RTStrSpaceGetN(&pThis->StrSpace, pszDefine, cchDefine) != NULL;
1659 * @param cchDefine The length of the name. RTSTR_MAX is ok.
1661 static PVBCPPMACRO vbcppMacroLookup(PVBCPP pThis, const char *pszDefine, size_t cchDefine)
1663 if (!cchDefine)
1667 return (PVBCPPMACRO)RTStrSpaceGetN(&pThis->StrSpace, pszDefine, cchDefine);
2132 size_t cchDefine = pszSrc - pszSrcSeq;
2135 && (iArg = vbcppMacroLookupArg(pMacro, pszSrcSeq, cchDefine)) != UINT32_MAX)
2169 rcExit = vbcppStrBufAppendN(pStrBuf, pszSrcSeq, cchDefine);
2346 size_t const cchDefine = *poff - offDefine;
2362 const char *pszResult = vbcppMacroExists(pThis, &pExp->StrBuf.pszBuf[offDefine], cchDefine)
2435 size_t cchDefine = off - offDefine;
2437 PVBCPPMACRO pMacro = vbcppMacroLookup(pThis, &pExp->StrBuf.pszBuf[offDefine], cchDefine);
2449 && cchDefine == sizeof("defined") - 1
2450 && !strncmp(&pExp->StrBuf.pszBuf[offDefine], "defined", cchDefine))
2453 off = offDefine + cchDefine;
2523 * @param cchDefine The length of the name. RTSTR_MAX is ok.
2527 static RTEXITCODE vbcppMacroUndef(PVBCPP pThis, const char *pszDefine, size_t cchDefine, bool fExplicitUndef)
2529 PRTSTRSPACECORE pHit = RTStrSpaceGetN(&pThis->StrSpace, pszDefine, cchDefine);
2538 if (cchDefine == RTSTR_MAX)
2539 cchDefine = strlen(pszDefine);
2541 PRTSTRSPACECORE pStr = (PRTSTRSPACECORE)RTMemAlloc(sizeof(*pStr) + cchDefine + 1);
2546 memcpy(pszDst, pszDefine, cchDefine);
2547 pszDst[cchDefine] = '\0';
2627 * @param cchDefine The length of the name.
2631 * @param cchDefine The length of the value.
2634 static RTEXITCODE vbcppMacroAddFn(PVBCPP pThis, const char *pszDefine, size_t cchDefine,
2640 Assert(RTStrNLen(pszDefine, cchDefine) == cchDefine);
2684 size_t cbDef = RT_OFFSETOF(VBCPPMACRO, szValue[cchValue + 1 + cchDefine + 1 + cchArgNames])
2693 memcpy(pszDst, pszDefine, cchDefine);
2694 pszDst += cchDefine;
2752 * @param cchDefine The length of the name. RTSTR_MAX is ok.
2754 * @param cchDefine The length of the value. RTSTR_MAX is ok.
2757 static RTEXITCODE vbcppMacroAdd(PVBCPP pThis, const char *pszDefine, size_t cchDefine,
2763 if (cchDefine == RTSTR_MAX)
2764 cchDefine = strlen(pszDefine);
2765 while (cchDefine > 0 && RT_C_IS_SPACE(*pszDefine))
2766 pszDefine++, cchDefine--;
2767 while (cchDefine > 0 && RT_C_IS_SPACE(pszDefine[cchDefine - 1]))
2768 cchDefine--;
2769 if (!cchDefine)
2782 const char *pszParams = (const char *)memchr(pszDefine, '(', cchDefine);
2785 size_t cchParams = pszDefine + cchDefine - pszParams;
2786 cchDefine -= cchParams;
2787 if (!vbcppValidateCIdentifier(pThis, pszDefine, cchDefine))
2793 return vbcppMacroAddFn(pThis, pszDefine, cchDefine, pszParams, cchParams, pszValue, cchValue, fCmdLine);
2799 if (!vbcppValidateCIdentifier(pThis, pszDefine, cchDefine))
2802 PVBCPPMACRO pMacro = (PVBCPPMACRO)RTMemAlloc(RT_OFFSETOF(VBCPPMACRO, szValue[cchValue + 1 + cchDefine + 1]));
2807 memcpy((char *)pMacro->Core.pszString, pszDefine, cchDefine);
2808 ((char *)pMacro->Core.pszString)[cchDefine] = '\0';
2980 size_t cchDefine;
2981 const char *pchDefine = ScmStreamCGetWord(pStrmInput, &cchDefine);
3042 rcExit = vbcppMacroAddFn(pThis, pchDefine, cchDefine, pchParams, cchParams, pchValue, cchValue, false);
3044 rcExit = vbcppMacroAdd(pThis, pchDefine, cchDefine, pchValue, cchValue, false);
3056 cchIndent, "", cchDefine, pchDefine, cchParams, pchParams);
3059 cchIndent, "", cchDefine, pchDefine);
3067 rcExit = vbcppMacroTryConvertToInlineD(pThis, vbcppMacroLookup(pThis, pchDefine, cchDefine));
3094 size_t cchDefine;
3095 const char *pchDefine = ScmStreamCGetWord(pStrmInput, &cchDefine);
3105 PVBCPPMACRO pMacro = vbcppMacroLookup(pThis, pchDefine, cchDefine);
3123 cchIndent, "", cchDefine, pchDefine);
4575 size_t cchDefine;
4576 const char *pchDefine = ScmStreamCGetWord(pStrmInput, &cchDefine);
4586 if (vbcppMacroExists(pThis, pchDefine, cchDefine))
4589 || RTStrSpaceGetN(&pThis->UndefStrSpace, pchDefine, cchDefine) != NULL)
4594 pchDefine, cchDefine);
4621 size_t cchDefine;
4622 const char *pchDefine = ScmStreamCGetWord(pStrmInput, &cchDefine);
4632 if (vbcppMacroExists(pThis, pchDefine, cchDefine))
4635 || RTStrSpaceGetN(&pThis->UndefStrSpace, pchDefine, cchDefine) != NULL)
4640 pchDefine, cchDefine);