Lines Matching defs:pLeaf

83 static void cfgmR3RemoveLeaf(PCFGMNODE pNode, PCFGMLEAF pLeaf);
84 static void cfgmR3FreeValue(PVM pVM, PCFGMLEAF pLeaf);
584 for (PCFGMLEAF pLeaf = pNode->pFirstLeaf; pLeaf; pLeaf = pLeaf->pNext)
591 if ( cch == pLeaf->cchName
592 && !memcmp(psz, pLeaf->szName, cch))
602 AssertMsgFailed(("Couldn't find '%s' in the valid values\n", pLeaf->szName));
622 PCFGMLEAF pLeaf;
623 int rc = cfgmR3ResolveLeaf(pNode, pszName, &pLeaf);
638 PCFGMLEAF pLeaf;
639 int rc = cfgmR3ResolveLeaf(pNode, pszName, &pLeaf);
643 *penmType = pLeaf->enmType;
660 PCFGMLEAF pLeaf;
661 int rc = cfgmR3ResolveLeaf(pNode, pszName, &pLeaf);
664 switch (pLeaf->enmType)
667 *pcb = sizeof(pLeaf->Value.Integer.u64);
671 *pcb = pLeaf->Value.String.cb;
675 *pcb = pLeaf->Value.Bytes.cb;
680 AssertMsgFailed(("Invalid value type %d\n", pLeaf->enmType));
698 PCFGMLEAF pLeaf;
699 int rc = cfgmR3ResolveLeaf(pNode, pszName, &pLeaf);
702 if (pLeaf->enmType == CFGMVALUETYPE_INTEGER)
703 *pu64 = pLeaf->Value.Integer.u64;
722 PCFGMLEAF pLeaf;
723 int rc = cfgmR3ResolveLeaf(pNode, pszName, &pLeaf);
726 if (pLeaf->enmType == CFGMVALUETYPE_INTEGER)
727 *pu64 = pLeaf->Value.Integer.u64;
754 PCFGMLEAF pLeaf;
755 int rc = cfgmR3ResolveLeaf(pNode, pszName, &pLeaf);
758 if (pLeaf->enmType == CFGMVALUETYPE_STRING)
760 size_t cbSrc = pLeaf->Value.String.cb;
763 memcpy(pszString, pLeaf->Value.String.psz, cbSrc);
788 PCFGMLEAF pLeaf;
789 int rc = cfgmR3ResolveLeaf(pNode, pszName, &pLeaf);
792 if (pLeaf->enmType == CFGMVALUETYPE_STRING)
794 size_t cbSrc = pLeaf->Value.String.cb;
797 memcpy(pszString, pLeaf->Value.String.psz, cbSrc);
836 PCFGMLEAF pLeaf;
837 int rc = cfgmR3ResolveLeaf(pNode, pszName, &pLeaf);
840 if (pLeaf->enmType == CFGMVALUETYPE_BYTES)
842 if (cbData >= pLeaf->Value.Bytes.cb)
844 memcpy(pvData, pLeaf->Value.Bytes.pau8, pLeaf->Value.Bytes.cb);
845 memset((char *)pvData + pLeaf->Value.Bytes.cb, 0, cbData - pLeaf->Value.Bytes.cb);
897 for (PCFGMLEAF pLeaf = pNode->pFirstLeaf; pLeaf; pLeaf = pLeaf->pNext)
900 pLeaf->szName, pLeaf->cchName,
904 pszWho, uInstance, pszNode, pLeaf->szName, pszValidValues));
907 pszNode, pLeaf->szName, pszWho, uInstance);
1274 PCFGMLEAF pLeaf = pNode->pFirstLeaf;
1275 while (pLeaf)
1277 if (cchName == pLeaf->cchName)
1279 int iDiff = memcmp(pszName, pLeaf->szName, cchName);
1284 *ppLeaf = pLeaf;
1290 pLeaf = pLeaf->pNext;
1375 for (PCFGMLEAF pLeaf = pSrcCur->pFirstLeaf; pLeaf && RT_SUCCESS(rc); pLeaf = pLeaf->pNext)
1376 rc = CFGMR3InsertValue(pDstCur, pLeaf);
1975 * @param pLeaf Leaf to remove.
1977 static void cfgmR3RemoveLeaf(PCFGMNODE pNode, PCFGMLEAF pLeaf)
1979 if (pNode && pLeaf)
1984 if (pLeaf->pPrev)
1985 pLeaf->pPrev->pNext = pLeaf->pNext;
1987 pNode->pFirstLeaf = pLeaf->pNext;
1988 if (pLeaf->pNext)
1989 pLeaf->pNext->pPrev = pLeaf->pPrev;
1994 cfgmR3FreeValue(pNode->pVM, pLeaf);
1995 pLeaf->pNext = NULL;
1996 pLeaf->pPrev = NULL;
1997 cfgmR3MemFree(pNode->pVM, pLeaf);
2009 * @param pLeaf Pointer to the leaf which value should be free.
2011 static void cfgmR3FreeValue(PVM pVM, PCFGMLEAF pLeaf)
2013 if (pLeaf)
2015 switch (pLeaf->enmType)
2018 cfgmR3MemFree(pVM, pLeaf->Value.Bytes.pau8);
2019 pLeaf->Value.Bytes.pau8 = NULL;
2020 pLeaf->Value.Bytes.cb = 0;
2024 cfgmR3StrFree(pVM, pLeaf->Value.String.psz);
2025 pLeaf->Value.String.psz = NULL;
2026 pLeaf->Value.String.cb = 0;
2032 pLeaf->enmType = (CFGMVALUETYPE)0;
2064 PCFGMLEAF pLeaf;
2065 int rc = cfgmR3InsertLeaf(pNode, pszName, &pLeaf);
2068 pLeaf->enmType = CFGMVALUETYPE_INTEGER;
2069 pLeaf->Value.Integer.u64 = u64Integer;
2105 PCFGMLEAF pLeaf;
2106 rc = cfgmR3InsertLeaf(pNode, pszName, &pLeaf);
2109 pLeaf->enmType = CFGMVALUETYPE_STRING;
2110 pLeaf->Value.String.psz = pszStringCopy;
2111 pLeaf->Value.String.cb = cchString + 1;
2169 PCFGMLEAF pLeaf;
2170 rc = cfgmR3InsertLeaf(pNode, pszName, &pLeaf);
2173 pLeaf->enmType = CFGMVALUETYPE_STRING;
2174 pLeaf->Value.String.psz = pszString;
2175 pLeaf->Value.String.cb = strlen(pszString) + 1;
2258 PCFGMLEAF pLeaf;
2259 rc = cfgmR3InsertLeaf(pNode, pszName, &pLeaf);
2262 pLeaf->enmType = CFGMVALUETYPE_BYTES;
2263 pLeaf->Value.Bytes.cb = cbBytes;
2264 pLeaf->Value.Bytes.pau8 = (uint8_t *)pvCopy;
2324 PCFGMLEAF pLeaf;
2325 int rc = cfgmR3ResolveLeaf(pNode, pszName, &pLeaf);
2327 cfgmR3RemoveLeaf(pNode, pLeaf);
3094 PCFGMLEAF pLeaf;
3095 int rc = cfgmR3ResolveLeaf(pNode, pszName, &pLeaf);
3098 if (pLeaf->enmType == CFGMVALUETYPE_STRING)
3100 size_t const cbSrc = pLeaf->Value.String.cb;
3104 memcpy(pszString, pLeaf->Value.String.psz, cbSrc);
3205 PCFGMLEAF pLeaf;
3207 for (pLeaf = CFGMR3GetFirstValue(pRoot); pLeaf; pLeaf = CFGMR3GetNextValue(pLeaf))
3208 cchMax = RT_MAX(cchMax, pLeaf->cchName);
3209 for (pLeaf = CFGMR3GetFirstValue(pRoot); pLeaf; pLeaf = CFGMR3GetNextValue(pLeaf))
3211 switch (CFGMR3GetValueType(pLeaf))
3215 pHlp->pfnPrintf(pHlp, " %-*s <integer> = %#018llx (%'lld", (int)cchMax, pLeaf->szName, pLeaf->Value.Integer.u64, pLeaf->Value.Integer.u64);
3216 if ( ( pLeaf->cchName >= 4
3217 && !RTStrCmp(&pLeaf->szName[pLeaf->cchName - 4], "Size"))
3218 || ( pLeaf->cchName >= 2
3219 && !RTStrNCmp(pLeaf->szName, "cb", 2)) )
3221 if (pLeaf->Value.Integer.u64 > _2G)
3222 pHlp->pfnPrintf(pHlp, ", %'lld GB", pLeaf->Value.Integer.u64 / _1G);
3223 else if (pLeaf->Value.Integer.u64 > _2M)
3224 pHlp->pfnPrintf(pHlp, ", %'lld MB", pLeaf->Value.Integer.u64 / _1M);
3225 else if (pLeaf->Value.Integer.u64 > _2K)
3226 pHlp->pfnPrintf(pHlp, ", %'lld KB", pLeaf->Value.Integer.u64 / _1K);
3233 pHlp->pfnPrintf(pHlp, " %-*s <string> = \"%s\" (cb=%zu)\n", (int)cchMax, pLeaf->szName, pLeaf->Value.String.psz, pLeaf->Value.String.cb);
3237 pHlp->pfnPrintf(pHlp, " %-*s <bytes> = \"%.*Rhxs\" (cb=%zu)\n", (int)cchMax, pLeaf->szName, pLeaf->Value.Bytes.cb, pLeaf->Value.Bytes.pau8, pLeaf->Value.Bytes.cb);