VirtualBox

source: vbox/trunk/src/VBox/Runtime/include/internal/path.h@ 2981

Last change on this file since 2981 was 2981, checked in by vboxsync, 17 years ago

InnoTek -> innotek: all the headers and comments.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1/* $Id: path.h 2981 2007-06-01 16:01:28Z vboxsync $ */
2/** @file
3 * innotek Portable Runtime - RTPath Internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2007 innotek GmbH
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License as published by the Free Software Foundation,
13 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14 * distribution. VirtualBox OSE is distributed in the hope that it will
15 * be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * If you received this file as part of a commercial VirtualBox
18 * distribution, then only the terms of your commercial VirtualBox
19 * license agreement apply instead of the previous paragraph.
20 */
21
22#ifndef __path_h__
23#define __path_h__
24
25#include <iprt/cdefs.h>
26#include <iprt/param.h>
27
28__BEGIN_DECLS
29extern char g_szrtProgramPath[RTPATH_MAX];
30
31#if defined(__OS2__) || defined(__WIN__)
32# define HAVE_UNC 1
33# define HAVE_DRIVE 1
34#endif
35
36
37int rtPathPosixRename(const char *pszSrc, const char *pszDst, unsigned fRename, RTFMODE fFileType);
38int rtPathWin32MoveRename(const char *pszSrc, const char *pszDst, uint32_t fFlags, RTFMODE fFileType);
39
40
41/**
42 * Converts a path from IPRT to native representation.
43 *
44 * This may involve querying filesystems what codeset they
45 * speak and so forth.
46 *
47 * @returns IPRT status code.
48 * @param ppszNativePath Where to store the pointer to the native path.
49 * Free by calling rtPathFreeHost(). NULL on failure.
50 * @param pszPath The path to convert.
51 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
52 */
53int rtPathToNative(char **ppszNativePath, const char *pszPath);
54
55/**
56 * Converts a path from IPRT to native representation.
57 *
58 * This may involve querying filesystems what codeset they
59 * speak and so forth.
60 *
61 * @returns IPRT status code.
62 * @param ppszNativePath Where to store the pointer to the native path.
63 * Free by calling rtPathFreeHost(). NULL on failure.
64 * @param pszPath The path to convert.
65 * @param pszBasePath What pszPath is relative to. If NULL the function behaves like rtPathToNative().
66 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
67 */
68int rtPathToNativeEx(char **ppszNativePath, const char *pszPath, const char *pszBasePath);
69
70/**
71 * Frees a native path returned by rtPathToNative() or rtPathToNativeEx().
72 *
73 * @param pszNativePath The host path to free. NULL allowed.
74 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
75 */
76void rtPathFreeNative(char *pszNativePath);
77
78/**
79 * Converts a path from the native to the IPRT representation.
80 *
81 * @returns IPRT status code.
82 * @param ppszPath Where to store the pointer to the IPRT path.
83 * Free by calling RTStrFree(). NULL on failure.
84 * @param pszNativePath The native path to convert.
85 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
86 */
87int rtPathFromNative(char **ppszPath, const char *pszNativePath);
88
89/**
90 * Converts a path from the native to the IPRT representation.
91 *
92 * @returns IPRT status code.
93 * @param ppszPath Where to store the pointer to the IPRT path.
94 * Free by calling RTStrFree(). NULL on failure.
95 * @param pszNativePath The native path to convert.
96 * @param pszBasePath What pszHostPath is relative to - in IPRT representation.
97 * If NULL the function behaves like rtPathFromNative().
98 * @remark This function is not available on hosts using something else than byte seqences as names. (eg win32)
99 */
100int rtPathFromNativeEx(char **ppszPath, const char *pszNativePath, const char *pszBasePath);
101
102
103__END_DECLS
104
105#endif
106
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette