path.cpp revision bfee11c6b01adfe2c06fd1145b3d8d51c7adfecb
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * innotek Portable Runtime - Path Manipulation.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Copyright (C) 2006-2007 innotek GmbH
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * available from http://www.virtualbox.org. This file is free software;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * you can redistribute it and/or modify it under the terms of the GNU
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * General Public License (GPL) as published by the Free Software
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * The contents of this file may alternatively be used under the terms
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * of the Common Development and Distribution License Version 1.0
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * VirtualBox OSE distribution, in which case the provisions of the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * CDDL are applicable instead of those of the GPL.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * You may elect to license modified versions of this file under the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * terms and conditions of either the GPL or the CDDL or both.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*******************************************************************************
f78b12e570284aa8291f4ca1add24937fd107403vboxsync* Header Files *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync*******************************************************************************/
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Strips the filename from a path.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * @param pszPath Path which filename should be extracted from.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /* handle separators. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /* the end */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /* will never get here */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Strips the extension from a path.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * @param pszPath Path which extension should be stripped.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /* handle separators. */
if (pszDot)
for (;; psz++)
switch (*psz)
if (*pszLastComp)
return (char *)(void *)pszLastComp;
return NULL;
return NULL;
switch (*pszEnd)
for (;; psz++)
switch (*psz)
if (pszExt)
return (char *)(void *)pszExt;
return NULL;
return NULL;
if (!pszPath1)
if (!pszPath2)
int iDiff = 0;
iDiff = 0;
if (!uc1)
puszTmpPath1++;
puszTmpPath2++;
return iDiff;
if (!fLimit)
return NULL;
return NULL;
/* This isn't quite right when looking at the above stuff, but it works assuming that '//' does not mean UNC. */
RTDECL(int) RTPathAbsEx(const char *pszBase, const char *pszPath, char *pszAbsPath, unsigned cchAbsPath)
#if defined(RT_OS_WINDOWS)
return VERR_INVALID_NAME;
return VERR_FILENAME_TOO_LONG;
if (fRootSpec)
return NULL;
#ifndef VBOX_SHARED_RUNTIME
char *pszUtf8Path;
int rc;
return rc;
char *pszUtf8Path;
int rc;
return rc;
* a common global directory where ld.so can found them.
char *pszUtf8Path;
int rc;
return rc;
char *pszUtf8Path;
int rc;
return rc;