diff options
author | Armin Weatherwax | 2010-06-14 12:04:49 +0200 |
---|---|---|
committer | Armin Weatherwax | 2010-09-23 15:38:25 +0200 |
commit | 35df5441d3e2789663532c948731aff3a1e04728 (patch) | |
tree | ac7674289784a5f96106ea507637055a8dada78a /linden/indra/llvfs | |
parent | Changed version to Experimental 2010.09.18 (diff) | |
download | meta-impy-35df5441d3e2789663532c948731aff3a1e04728.zip meta-impy-35df5441d3e2789663532c948731aff3a1e04728.tar.gz meta-impy-35df5441d3e2789663532c948731aff3a1e04728.tar.bz2 meta-impy-35df5441d3e2789663532c948731aff3a1e04728.tar.xz |
llmediaplugins first step
Diffstat (limited to 'linden/indra/llvfs')
-rw-r--r-- | linden/indra/llvfs/CMakeLists.txt | 2 | ||||
-rw-r--r-- | linden/indra/llvfs/lldir.cpp | 6 | ||||
-rw-r--r-- | linden/indra/llvfs/lldir.h | 6 | ||||
-rw-r--r-- | linden/indra/llvfs/lldir_linux.cpp | 43 | ||||
-rw-r--r-- | linden/indra/llvfs/lldir_linux.h | 3 | ||||
-rw-r--r-- | linden/indra/llvfs/lldir_mac.cpp | 15 | ||||
-rw-r--r-- | linden/indra/llvfs/lldir_mac.h | 3 | ||||
-rw-r--r-- | linden/indra/llvfs/lldir_solaris.cpp | 2 | ||||
-rw-r--r-- | linden/indra/llvfs/lldir_win32.cpp | 15 | ||||
-rw-r--r-- | linden/indra/llvfs/lldir_win32.h | 3 |
10 files changed, 93 insertions, 5 deletions
diff --git a/linden/indra/llvfs/CMakeLists.txt b/linden/indra/llvfs/CMakeLists.txt index cc0297e..d6a0bbc 100644 --- a/linden/indra/llvfs/CMakeLists.txt +++ b/linden/indra/llvfs/CMakeLists.txt | |||
@@ -4,7 +4,6 @@ project(llvfs) | |||
4 | 4 | ||
5 | include(00-Common) | 5 | include(00-Common) |
6 | include(LLCommon) | 6 | include(LLCommon) |
7 | include(UnixInstall) | ||
8 | 7 | ||
9 | include_directories( | 8 | include_directories( |
10 | ${LLCOMMON_INCLUDE_DIRS} | 9 | ${LLCOMMON_INCLUDE_DIRS} |
@@ -58,6 +57,7 @@ set_source_files_properties(${llvfs_HEADER_FILES} | |||
58 | list(APPEND llvfs_SOURCE_FILES ${llvfs_HEADER_FILES}) | 57 | list(APPEND llvfs_SOURCE_FILES ${llvfs_HEADER_FILES}) |
59 | 58 | ||
60 | add_library (llvfs ${llvfs_SOURCE_FILES}) | 59 | add_library (llvfs ${llvfs_SOURCE_FILES}) |
60 | add_dependencies(llvfs prepare) | ||
61 | 61 | ||
62 | if (DARWIN) | 62 | if (DARWIN) |
63 | include(CMakeFindFrameworks) | 63 | include(CMakeFindFrameworks) |
diff --git a/linden/indra/llvfs/lldir.cpp b/linden/indra/llvfs/lldir.cpp index af55593..5567fdd 100644 --- a/linden/indra/llvfs/lldir.cpp +++ b/linden/indra/llvfs/lldir.cpp | |||
@@ -294,6 +294,10 @@ const std::string LLDir::getSkinBaseDir() const | |||
294 | return dir; | 294 | return dir; |
295 | } | 295 | } |
296 | 296 | ||
297 | const std::string &LLDir::getLLPluginDir() const | ||
298 | { | ||
299 | return mLLPluginDir; | ||
300 | } | ||
297 | 301 | ||
298 | std::string LLDir::getExpandedFilename(ELLPath location, const std::string& filename) const | 302 | std::string LLDir::getExpandedFilename(ELLPath location, const std::string& filename) const |
299 | { | 303 | { |
@@ -465,6 +469,8 @@ std::string LLDir::getDirName(const std::string& filepath) const | |||
465 | 469 | ||
466 | std::string LLDir::getExtension(const std::string& filepath) const | 470 | std::string LLDir::getExtension(const std::string& filepath) const |
467 | { | 471 | { |
472 | if (filepath.empty()) | ||
473 | return std::string(); | ||
468 | std::string basename = getBaseFileName(filepath, false); | 474 | std::string basename = getBaseFileName(filepath, false); |
469 | std::size_t offset = basename.find_last_of('.'); | 475 | std::size_t offset = basename.find_last_of('.'); |
470 | std::string exten = (offset == std::string::npos || offset == 0) ? "" : basename.substr(offset+1); | 476 | std::string exten = (offset == std::string::npos || offset == 0) ? "" : basename.substr(offset+1); |
diff --git a/linden/indra/llvfs/lldir.h b/linden/indra/llvfs/lldir.h index 21dcf5b..55574d6 100644 --- a/linden/indra/llvfs/lldir.h +++ b/linden/indra/llvfs/lldir.h | |||
@@ -80,6 +80,10 @@ class LLDir | |||
80 | virtual BOOL fileExists(const std::string &filename) const = 0; | 80 | virtual BOOL fileExists(const std::string &filename) const = 0; |
81 | 81 | ||
82 | const std::string findFile(const std::string &filename, const std::string searchPath1 = "", const std::string searchPath2 = "", const std::string searchPath3 = "") const; | 82 | const std::string findFile(const std::string &filename, const std::string searchPath1 = "", const std::string searchPath2 = "", const std::string searchPath3 = "") const; |
83 | |||
84 | virtual std::string getLLPluginLauncher() = 0; // full path and name for the plugin shell | ||
85 | virtual std::string getLLPluginFilename(std::string base_name) = 0; // full path and name to the plugin DSO for this base_name (i.e. 'FOO' -> '/bar/baz/libFOO.so') | ||
86 | |||
83 | const std::string &getExecutablePathAndName() const; // Full pathname of the executable | 87 | const std::string &getExecutablePathAndName() const; // Full pathname of the executable |
84 | const std::string &getAppName() const; // install directory under progams/ ie "SecondLife" | 88 | const std::string &getAppName() const; // install directory under progams/ ie "SecondLife" |
85 | const std::string &getExecutableDir() const; // Directory where the executable is located | 89 | const std::string &getExecutableDir() const; // Directory where the executable is located |
@@ -100,6 +104,7 @@ class LLDir | |||
100 | const std::string &getUserSkinDir() const; // User-specified skin folder with user modifications. e.g. c:\documents and settings\username\application data\second life\skins\curskin | 104 | const std::string &getUserSkinDir() const; // User-specified skin folder with user modifications. e.g. c:\documents and settings\username\application data\second life\skins\curskin |
101 | const std::string &getDefaultSkinDir() const; // folder for default skin. e.g. c:\program files\second life\skins\default | 105 | const std::string &getDefaultSkinDir() const; // folder for default skin. e.g. c:\program files\second life\skins\default |
102 | const std::string getSkinBaseDir() const; // folder that contains all installed skins (not user modifications). e.g. c:\program files\second life\skins | 106 | const std::string getSkinBaseDir() const; // folder that contains all installed skins (not user modifications). e.g. c:\program files\second life\skins |
107 | const std::string &getLLPluginDir() const; // Directory containing plugins and plugin shell | ||
103 | 108 | ||
104 | // Expanded filename | 109 | // Expanded filename |
105 | std::string getExpandedFilename(ELLPath location, const std::string &filename) const; | 110 | std::string getExpandedFilename(ELLPath location, const std::string &filename) const; |
@@ -156,6 +161,7 @@ protected: | |||
156 | std::string mSkinDir; // Location for current skin info. | 161 | std::string mSkinDir; // Location for current skin info. |
157 | std::string mDefaultSkinDir; // Location for default skin info. | 162 | std::string mDefaultSkinDir; // Location for default skin info. |
158 | std::string mUserSkinDir; // Location for user-modified skin info. | 163 | std::string mUserSkinDir; // Location for user-modified skin info. |
164 | std::string mLLPluginDir; // Location for plugins and plugin shell | ||
159 | }; | 165 | }; |
160 | 166 | ||
161 | void dir_exists_or_crash(const std::string &dir_name); | 167 | void dir_exists_or_crash(const std::string &dir_name); |
diff --git a/linden/indra/llvfs/lldir_linux.cpp b/linden/indra/llvfs/lldir_linux.cpp index 8ff8c5d..ec0a4f4 100644 --- a/linden/indra/llvfs/lldir_linux.cpp +++ b/linden/indra/llvfs/lldir_linux.cpp | |||
@@ -94,11 +94,7 @@ LLDir_Linux::LLDir_Linux() | |||
94 | mExecutablePathAndName = ""; | 94 | mExecutablePathAndName = ""; |
95 | mExecutableDir = tmp_str; | 95 | mExecutableDir = tmp_str; |
96 | mWorkingDir = tmp_str; | 96 | mWorkingDir = tmp_str; |
97 | #ifdef APP_RO_DATA_DIR | ||
98 | mAppRODataDir = APP_RO_DATA_DIR; | ||
99 | #else | ||
100 | mAppRODataDir = tmp_str; | 97 | mAppRODataDir = tmp_str; |
101 | #endif | ||
102 | mOSUserDir = getCurrentUserHome(tmp_str); | 98 | mOSUserDir = getCurrentUserHome(tmp_str); |
103 | mOSUserAppDir = ""; | 99 | mOSUserAppDir = ""; |
104 | mLindenUserDir = tmp_str; | 100 | mLindenUserDir = tmp_str; |
@@ -128,6 +124,33 @@ LLDir_Linux::LLDir_Linux() | |||
128 | } | 124 | } |
129 | } | 125 | } |
130 | 126 | ||
127 | mLLPluginDir = mExecutableDir + mDirDelimiter + "llplugin"; | ||
128 | |||
129 | #ifdef APP_RO_DATA_DIR | ||
130 | const char* appRODataDir = APP_RO_DATA_DIR; | ||
131 | if(appRODataDir[0] == '/') | ||
132 | { | ||
133 | // We have a full path to the data directory. | ||
134 | mAppRODataDir = appRODataDir; | ||
135 | } | ||
136 | else if(appRODataDir[0] != '\0') | ||
137 | { | ||
138 | // We have a relative path to the data directory. Search | ||
139 | // for it in each potential install prefix containing the | ||
140 | // executable. | ||
141 | for(std::string prefix = getDirName(mExecutableDir); | ||
142 | !prefix.empty(); prefix = getDirName(prefix)) | ||
143 | { | ||
144 | std::string dir = prefix + "/" + appRODataDir; | ||
145 | if(fileExists(dir + "/app_settings")) | ||
146 | { | ||
147 | mAppRODataDir = dir; | ||
148 | break; | ||
149 | } | ||
150 | } | ||
151 | } | ||
152 | #endif | ||
153 | |||
131 | // *TODO: don't use /tmp, use $HOME/.secondlife/tmp or something. | 154 | // *TODO: don't use /tmp, use $HOME/.secondlife/tmp or something. |
132 | mTempDir = "/tmp"; | 155 | mTempDir = "/tmp"; |
133 | } | 156 | } |
@@ -370,3 +393,15 @@ BOOL LLDir_Linux::fileExists(const std::string &filename) const | |||
370 | } | 393 | } |
371 | } | 394 | } |
372 | 395 | ||
396 | |||
397 | /*virtual*/ std::string LLDir_Linux::getLLPluginLauncher() | ||
398 | { | ||
399 | return gDirUtilp->getExecutableDir() + gDirUtilp->getDirDelimiter() + | ||
400 | "SLPlugin"; | ||
401 | } | ||
402 | |||
403 | /*virtual*/ std::string LLDir_Linux::getLLPluginFilename(std::string base_name) | ||
404 | { | ||
405 | return gDirUtilp->getLLPluginDir() + gDirUtilp->getDirDelimiter() + | ||
406 | "lib" + base_name + ".so"; | ||
407 | } | ||
diff --git a/linden/indra/llvfs/lldir_linux.h b/linden/indra/llvfs/lldir_linux.h index 20b408f..8e94fb1 100644 --- a/linden/indra/llvfs/lldir_linux.h +++ b/linden/indra/llvfs/lldir_linux.h | |||
@@ -52,6 +52,9 @@ public: | |||
52 | virtual void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname); | 52 | virtual void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname); |
53 | /*virtual*/ BOOL fileExists(const std::string &filename) const; | 53 | /*virtual*/ BOOL fileExists(const std::string &filename) const; |
54 | 54 | ||
55 | /*virtual*/ std::string getLLPluginLauncher(); | ||
56 | /*virtual*/ std::string getLLPluginFilename(std::string base_name); | ||
57 | |||
55 | private: | 58 | private: |
56 | DIR *mDirp; | 59 | DIR *mDirp; |
57 | int mCurrentDirIndex; | 60 | int mCurrentDirIndex; |
diff --git a/linden/indra/llvfs/lldir_mac.cpp b/linden/indra/llvfs/lldir_mac.cpp index 6d5dcf3..a45c1ed 100644 --- a/linden/indra/llvfs/lldir_mac.cpp +++ b/linden/indra/llvfs/lldir_mac.cpp | |||
@@ -190,6 +190,8 @@ LLDir_Mac::LLDir_Mac() | |||
190 | } | 190 | } |
191 | 191 | ||
192 | mWorkingDir = getCurPath(); | 192 | mWorkingDir = getCurPath(); |
193 | |||
194 | mLLPluginDir = mAppRODataDir + mDirDelimiter + "llplugin"; | ||
193 | 195 | ||
194 | CFRelease(executableURLRef); | 196 | CFRelease(executableURLRef); |
195 | executableURLRef = NULL; | 197 | executableURLRef = NULL; |
@@ -388,4 +390,17 @@ BOOL LLDir_Mac::fileExists(const std::string &filename) const | |||
388 | } | 390 | } |
389 | 391 | ||
390 | 392 | ||
393 | /*virtual*/ std::string LLDir_Mac::getLLPluginLauncher() | ||
394 | { | ||
395 | return gDirUtilp->getAppRODataDir() + gDirUtilp->getDirDelimiter() + | ||
396 | "SLPlugin"; | ||
397 | } | ||
398 | |||
399 | /*virtual*/ std::string LLDir_Mac::getLLPluginFilename(std::string base_name) | ||
400 | { | ||
401 | return gDirUtilp->getLLPluginDir() + gDirUtilp->getDirDelimiter() + | ||
402 | base_name + ".dylib"; | ||
403 | } | ||
404 | |||
405 | |||
391 | #endif // LL_DARWIN | 406 | #endif // LL_DARWIN |
diff --git a/linden/indra/llvfs/lldir_mac.h b/linden/indra/llvfs/lldir_mac.h index 28d48a0..8be5d03 100644 --- a/linden/indra/llvfs/lldir_mac.h +++ b/linden/indra/llvfs/lldir_mac.h | |||
@@ -52,6 +52,9 @@ public: | |||
52 | virtual void getRandomFileInDir(const std::string &dirname, const std::string &ask, std::string &fname); | 52 | virtual void getRandomFileInDir(const std::string &dirname, const std::string &ask, std::string &fname); |
53 | virtual BOOL fileExists(const std::string &filename) const; | 53 | virtual BOOL fileExists(const std::string &filename) const; |
54 | 54 | ||
55 | /*virtual*/ std::string getLLPluginLauncher(); | ||
56 | /*virtual*/ std::string getLLPluginFilename(std::string base_name); | ||
57 | |||
55 | private: | 58 | private: |
56 | int mCurrentDirIndex; | 59 | int mCurrentDirIndex; |
57 | int mCurrentDirCount; | 60 | int mCurrentDirCount; |
diff --git a/linden/indra/llvfs/lldir_solaris.cpp b/linden/indra/llvfs/lldir_solaris.cpp index 9553d92..c647e2b 100644 --- a/linden/indra/llvfs/lldir_solaris.cpp +++ b/linden/indra/llvfs/lldir_solaris.cpp | |||
@@ -161,6 +161,8 @@ LLDir_Solaris::LLDir_Solaris() | |||
161 | } | 161 | } |
162 | } | 162 | } |
163 | 163 | ||
164 | mLLPluginDir = mExecutableDir + mDirDelimiter + "llplugin"; | ||
165 | |||
164 | // *TODO: don't use /tmp, use $HOME/.secondlife/tmp or something. | 166 | // *TODO: don't use /tmp, use $HOME/.secondlife/tmp or something. |
165 | mTempDir = "/tmp"; | 167 | mTempDir = "/tmp"; |
166 | } | 168 | } |
diff --git a/linden/indra/llvfs/lldir_win32.cpp b/linden/indra/llvfs/lldir_win32.cpp index 19b9bcc..9d4c5ec 100644 --- a/linden/indra/llvfs/lldir_win32.cpp +++ b/linden/indra/llvfs/lldir_win32.cpp | |||
@@ -143,6 +143,8 @@ LLDir_Win32::LLDir_Win32() | |||
143 | llwarns << "Couldn't create LL_PATH_CACHE dir " << mDefaultCacheDir << llendl; | 143 | llwarns << "Couldn't create LL_PATH_CACHE dir " << mDefaultCacheDir << llendl; |
144 | } | 144 | } |
145 | } | 145 | } |
146 | |||
147 | mLLPluginDir = mExecutableDir + mDirDelimiter + "llplugin"; | ||
146 | } | 148 | } |
147 | 149 | ||
148 | LLDir_Win32::~LLDir_Win32() | 150 | LLDir_Win32::~LLDir_Win32() |
@@ -378,6 +380,19 @@ BOOL LLDir_Win32::fileExists(const std::string &filename) const | |||
378 | } | 380 | } |
379 | 381 | ||
380 | 382 | ||
383 | /*virtual*/ std::string LLDir_Win32::getLLPluginLauncher() | ||
384 | { | ||
385 | return gDirUtilp->getExecutableDir() + gDirUtilp->getDirDelimiter() + | ||
386 | "SLPlugin.exe"; | ||
387 | } | ||
388 | |||
389 | /*virtual*/ std::string LLDir_Win32::getLLPluginFilename(std::string base_name) | ||
390 | { | ||
391 | return gDirUtilp->getLLPluginDir() + gDirUtilp->getDirDelimiter() + | ||
392 | base_name + ".dll"; | ||
393 | } | ||
394 | |||
395 | |||
381 | #if 0 | 396 | #if 0 |
382 | // Utility function to get version number of a DLL | 397 | // Utility function to get version number of a DLL |
383 | 398 | ||
diff --git a/linden/indra/llvfs/lldir_win32.h b/linden/indra/llvfs/lldir_win32.h index 8710ca5..9ef4d30 100644 --- a/linden/indra/llvfs/lldir_win32.h +++ b/linden/indra/llvfs/lldir_win32.h | |||
@@ -49,6 +49,9 @@ public: | |||
49 | /*virtual*/ void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname); | 49 | /*virtual*/ void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname); |
50 | /*virtual*/ BOOL fileExists(const std::string &filename) const; | 50 | /*virtual*/ BOOL fileExists(const std::string &filename) const; |
51 | 51 | ||
52 | /*virtual*/ std::string getLLPluginLauncher(); | ||
53 | /*virtual*/ std::string getLLPluginFilename(std::string base_name); | ||
54 | |||
52 | private: | 55 | private: |
53 | BOOL LLDir_Win32::getNextFileInDir(const llutf16string &dirname, const std::string &mask, std::string &fname, BOOL wrap); | 56 | BOOL LLDir_Win32::getNextFileInDir(const llutf16string &dirname, const std::string &mask, std::string &fname, BOOL wrap); |
54 | 57 | ||