Changeset 35218 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Dec 17, 2010 12:45:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/path.cpp
r33454 r35218 39 39 40 40 41 #ifdef RT_OS_SOLARIS 42 /** 43 * Hack to strip of the architecture subdirectory from the exec dir. 44 * 45 * @returns See RTPathExecDir. 46 * @param pszPath See RTPathExecDir. 47 * @param cchPath See RTPathExecDir. 48 */ 49 static int rtPathSolarisArchHack(char *pszPath, size_t cchPath) 50 { 51 int rc = RTPathExecDir(pszPath, cchPath); 52 if (RT_SUCCESS(rc)) 53 { 54 const char *pszLast = RTPathFilename(pszPath); 55 if ( !strcmp(pszLast, "amd64") 56 || !strcmp(pszLast, "i386")) 57 RTPathStripFilename(pszPath); 58 } 59 return rc; 60 } 61 #endif 62 63 41 64 RTDECL(int) RTPathExecDir(char *pszPath, size_t cchPath) 42 65 { … … 59 82 60 83 61 /**62 * Gets the directory for architecture-independent application data, for63 * example NLS files, module sources, ...64 *65 * Linux: /usr/shared/@<application@>66 * Windows: @<program files directory@>/@<application@>67 * Old path: same as RTPathExecDir()68 *69 */70 84 RTDECL(int) RTPathAppPrivateNoArch(char *pszPath, size_t cchPath) 71 85 { 72 86 #if !defined(RT_OS_WINDOWS) && defined(RTPATH_APP_PRIVATE) 73 87 return RTStrCopy(pszPath, cchPath, RTPATH_APP_PRIVATE); 88 #elif defined(RT_OS_SOLARIS) && 0 /// @todo fix this 89 return rtPathSolarisArchHack(pszPath, cchPath); 74 90 #else 75 91 return RTPathExecDir(pszPath, cchPath); … … 78 94 79 95 80 /**81 * Gets the directory for architecture-dependent application data, for82 * example modules which can be loaded at runtime.83 *84 * Linux: /usr/lib/@<application@>85 * Windows: @<program files directory@>/@<application@>86 * Old path: same as RTPathExecDir()87 *88 * @returns iprt status code.89 * @param pszPath Buffer where to store the path.90 * @param cchPath Buffer size in bytes.91 */92 96 RTDECL(int) RTPathAppPrivateArch(char *pszPath, size_t cchPath) 93 97 { … … 100 104 101 105 102 /** 103 * Gets the directory of shared libraries. This is not the same as 104 * RTPathAppPrivateArch() as Linux depends all shared libraries in 105 * a common global directory where ld.so can found them. 106 * 107 * Linux: /usr/lib 108 * Windows: @<program files directory@>/@<application@> 109 * Old path: same as RTPathExecDir() 110 * 111 * @returns iprt status code. 112 * @param pszPath Buffer where to store the path. 113 * @param cchPath Buffer size in bytes. 114 */ 106 RTDECL(int) RTPathAppPrivateArchTop(char *pszPath, size_t cchPath) 107 { 108 #if !defined(RT_OS_WINDOWS) && defined(RTPATH_APP_PRIVATE_ARCH) 109 return RTStrCopy(pszPath, cchPath, RTPATH_APP_PRIVATE_ARCH); 110 #elif defined(RT_OS_SOLARIS) 111 return rtPathSolarisArchHack(pszPath, cchPath); 112 #else 113 return RTPathExecDir(pszPath, cchPath); 114 #endif 115 } 116 117 115 118 RTDECL(int) RTPathSharedLibs(char *pszPath, size_t cchPath) 116 119 { … … 123 126 124 127 125 /**126 * Gets the directory for documentation.127 *128 * Linux: /usr/share/doc/@<application@>129 * Windows: @<program files directory@>/@<application@>130 * Old path: same as RTPathExecDir()131 *132 * @returns iprt status code.133 * @param pszPath Buffer where to store the path.134 * @param cchPath Buffer size in bytes.135 */136 128 RTDECL(int) RTPathAppDocs(char *pszPath, size_t cchPath) 137 129 { 138 130 #if !defined(RT_OS_WINDOWS) && defined(RTPATH_APP_DOCS) 139 131 return RTStrCopy(pszPath, cchPath, RTPATH_APP_DOCS); 132 #elif defined(RT_OS_SOLARIS) 133 return rtPathSolarisArchHack(pszPath, cchPath); 140 134 #else 141 135 return RTPathExecDir(pszPath, cchPath); … … 144 138 145 139 146 /**147 * Gets the temporary directory path.148 *149 * @returns iprt status code.150 *151 * @param pszPath Buffer where to store the path.152 * @param cchPath Buffer size in bytes.153 */154 140 RTDECL(int) RTPathTemp(char *pszPath, size_t cchPath) 155 141 {
Note:
See TracChangeset
for help on using the changeset viewer.