pathhost-posix.cpp revision f7f8fe5e30e9ed90185f5d51deda15377d76c010
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * IPRT - Path Convertions, POSIX.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Copyright (C) 2006-2010 Oracle Corporation
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * available from http://www.virtualbox.org. This file is free software;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * you can redistribute it and/or modify it under the terms of the GNU
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * General Public License (GPL) as published by the Free Software
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * The contents of this file may alternatively be used under the terms
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * of the Common Development and Distribution License Version 1.0
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * VirtualBox OSE distribution, in which case the provisions of the
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * CDDL are applicable instead of those of the GPL.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * You may elect to license modified versions of this file under the
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * terms and conditions of either the GPL or the CDDL or both.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/*******************************************************************************
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync* Header Files *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync*******************************************************************************/
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/*******************************************************************************
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync* Global Variables *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync*******************************************************************************/
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/** Initialize once object. */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncstatic RTONCE g_OnceInitPathConv = RTONCE_INITIALIZER;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/** If set, then we can pass UTF-8 thru directly. */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncstatic bool g_fPassthruUtf8 = false;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/** The UTF-8 to FS iconv cache entry. */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncstatic RTSTRICONV g_enmUtf8ToFsIdx = RTSTRICONV_UTF8_TO_LOCALE;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/** The FS to UTF-8 iconv cache entry. */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncstatic RTSTRICONV g_enmFsToUtf8Idx = RTSTRICONV_LOCALE_TO_UTF8;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/** The codeset we're using. */
if (!ch1)
if (!pszCodeset)
const char *pszUpper;
const char *pszLower;
} const s_aUtf8Compatible[] =
return rc;
return VINF_SUCCESS;
return rc;
&& pszNativePath)
char *pszPath;
if (pszPath)
return rc;
&& !pszPath)
int rtPathFromNativeCopy(char *pszPath, size_t cbPath, const char *pszNativePath, const char *pszBasePath)
else if (cbPath)
return rc;