Lines Matching refs:pPath

1100  * @param   pPath               The path parsing buffer.
1107 static char *rtVfsParsePathHandleDots(PRTVFSPARSEDPATH pPath, char *pszDst, bool fTheEnd, uint16_t *piRestartComp)
1114 pPath->cComponents--;
1115 pszDst = &pPath->szPath[pPath->aoffComponents[pPath->cComponents]];
1119 pPath->cComponents -= pPath->cComponents > 1 ? 2 : 1;
1120 pszDst = &pPath->szPath[pPath->aoffComponents[pPath->cComponents]];
1121 if (piRestartComp && *piRestartComp + 1 >= pPath->cComponents)
1122 *piRestartComp = pPath->cComponents > 0 ? pPath->cComponents - 1 : 0;
1130 if (fTheEnd && pPath->cComponents == 0)
1136 RTDECL(int) RTVfsParsePathAppend(PRTVFSPARSEDPATH pPath, const char *pszPath, uint16_t *piRestartComp)
1142 if (piRestartComp && *piRestartComp + 1 >= pPath->cComponents)
1143 *piRestartComp = pPath->cComponents > 0 ? pPath->cComponents - 1 : 0;
1148 char *pszDst = &pPath->szPath[pPath->cch];
1149 if (pPath->cComponents > 0)
1152 if (pszDst - &pPath->szPath[0] >= RTVFSPARSEDPATH_MAX)
1161 pPath->fDirSlash = false;
1169 pPath->aoffComponents[pPath->cComponents++] = pszDst - &pPath->szPath[0];
1178 pPath->fDirSlash = true;
1179 pszDst = rtVfsParsePathHandleDots(pPath, pszDst, pszSrc[0] == '\0', piRestartComp);
1184 if (pszDst - &pPath->szPath[0] >= RTVFSPARSEDPATH_MAX)
1188 pszDst = rtVfsParsePathHandleDots(pPath, pszDst, true /*fTheEnd*/, piRestartComp);
1193 pPath->cch = (uint16_t)(pszDst - &pPath->szPath[0]);
1194 pPath->aoffComponents[pPath->cComponents] = pPath->cch + 1;
1200 RTDECL(int) RTVfsParsePath(PRTVFSPARSEDPATH pPath, const char *pszPath, const char *pszCwd)
1207 int rc = RTVfsParsePath(pPath, pszCwd, NULL /*crash if pszCwd is not absolute*/);
1214 * Make pszPath relative, i.e. set up pPath for the root and skip
1217 pPath->cch = 1;
1218 pPath->cComponents = 0;
1219 pPath->fDirSlash = false;
1220 pPath->aoffComponents[0] = 1;
1221 pPath->aoffComponents[1] = 2;
1222 pPath->szPath[0] = '/';
1223 pPath->szPath[1] = '\0';
1224 pPath->szPath[2] = '\0';
1230 return RTVfsParsePathAppend(pPath, pszPath, NULL);
1241 PRTVFSPARSEDPATH pPath = (PRTVFSPARSEDPATH)RTMemTmpAlloc(sizeof(RTVFSPARSEDPATH));
1242 if (pPath)
1244 rc = RTVfsParsePath(pPath, pszPath, pszCwd);
1247 RTMemTmpFree(pPath);
1248 pPath = NULL;
1253 *ppPath = pPath; /* always set it */
1258 RTDECL(void) RTVfsParsePathFree(PRTVFSPARSEDPATH pPath)
1260 if (pPath)
1262 pPath->cch = UINT16_MAX;
1263 pPath->cComponents = UINT16_MAX;
1264 pPath->aoffComponents[0] = UINT16_MAX;
1265 pPath->aoffComponents[1] = UINT16_MAX;
1266 RTMemTmpFree(pPath);
1275 * @param pPath The parsed path to update.
1279 static int rtVfsTraverseHandleSymlink(PRTVFSPARSEDPATH pPath, uint16_t *piComponent, RTVFSSYMLINK hSymlink)
1294 rc = RTVfsParsePath(pPath, szPath, NULL);
1309 if (iComponent + 1 < pPath->cComponents)
1310 rc = RTPathAppend(szPath, sizeof(szPath), &pPath->szPath[pPath->aoffComponents[iComponent + 1]]);
1313 pPath->cch = pPath->aoffComponents[iComponent] - (iComponent > 0);
1314 pPath->aoffComponents[iComponent + 1] = pPath->cch + 1;
1315 pPath->szPath[pPath->cch] = '\0';
1316 pPath->szPath[pPath->cch + 1] = '\0';
1318 rc = RTVfsParsePathAppend(pPath, szPath, &iComponent);
1336 * @param pPath The parsed path. This may be changed as symbolic
1343 static int rtVfsTraverseToParent(RTVFSINTERNAL *pThis, PRTVFSPARSEDPATH pPath, bool fFollowSymlink,
1352 AssertPtr(pPath);
1355 AssertReturn(pPath->cComponents > 0, VERR_INTERNAL_ERROR_3);
1379 bool fFinal = iComponent + 1 >= pPath->cComponents;
1389 const char *pszEntry = &pPath->szPath[pPath->aoffComponents[iComponent]];
1390 char *pszEntryEnd = &pPath->szPath[pPath->aoffComponents[iComponent + 1] - 1];
1458 rc = rtVfsTraverseHandleSymlink(pPath, &iRestartComp, hSymlink);
2447 PRTVFSPARSEDPATH pPath;
2448 rc = RTVfsParsePathA(pszFilename, "/", &pPath);
2451 if (!pPath->fDirSlash)
2458 rc = rtVfsTraverseToParent(pThis, pPath, true /*fFollowSymlink*/, &pVfsParentDir);
2461 const char *pszEntryName = &pPath->szPath[pPath->aoffComponents[pPath->cComponents - 1]];
2479 RTVfsParsePathFree(pPath);