aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llvfs
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llvfs
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/llvfs')
-rw-r--r--linden/indra/llvfs/CMakeLists.txt58
-rwxr-xr-xlinden/indra/llvfs/files.linux.lst1
-rw-r--r--linden/indra/llvfs/files.lst5
-rw-r--r--linden/indra/llvfs/files.sunos5.lst1
-rwxr-xr-xlinden/indra/llvfs/files.win32.lst1
-rw-r--r--linden/indra/llvfs/lldir.cpp112
-rw-r--r--linden/indra/llvfs/lldir.h11
-rw-r--r--linden/indra/llvfs/lldir_linux.cpp22
-rw-r--r--linden/indra/llvfs/lldir_mac.cpp11
-rw-r--r--linden/indra/llvfs/lldir_solaris.cpp18
-rw-r--r--linden/indra/llvfs/lldir_win32.cpp18
-rw-r--r--linden/indra/llvfs/lllfsthread.cpp7
-rw-r--r--linden/indra/llvfs/lllfsthread.h10
-rw-r--r--linden/indra/llvfs/llvfs.cpp112
-rw-r--r--linden/indra/llvfs/llvfs.h10
-rw-r--r--linden/indra/llvfs/llvfs.vcproj203
-rw-r--r--linden/indra/llvfs/llvfs_vc8.vcproj295
-rw-r--r--linden/indra/llvfs/llvfs_vc9.vcproj296
-rw-r--r--linden/indra/llvfs/llvfsthread.cpp1
-rw-r--r--linden/indra/llvfs/llvfsthread.h6
20 files changed, 245 insertions, 953 deletions
diff --git a/linden/indra/llvfs/CMakeLists.txt b/linden/indra/llvfs/CMakeLists.txt
new file mode 100644
index 0000000..9f136f7
--- /dev/null
+++ b/linden/indra/llvfs/CMakeLists.txt
@@ -0,0 +1,58 @@
1# -*- cmake -*-
2
3project(llvfs)
4
5include(00-Common)
6include(LLCommon)
7include(UnixInstall)
8
9include_directories(
10 ${LLCOMMON_INCLUDE_DIRS}
11 )
12
13set(llvfs_SOURCE_FILES
14 lldir.cpp
15 lllfsthread.cpp
16 llvfile.cpp
17 llvfs.cpp
18 llvfsthread.cpp
19 )
20
21set(llvfs_HEADER_FILES
22 CMakeLists.txt
23
24 lldir.h
25 lllfsthread.h
26 llvfile.h
27 llvfs.h
28 llvfsthread.h
29 )
30
31if (DARWIN)
32 LIST(APPEND llvfs_SOURCE_FILES lldir_mac.cpp)
33 LIST(APPEND llvfs_HEADER_FILES lldir_mac.h)
34endif (DARWIN)
35
36if (LINUX)
37 LIST(APPEND llvfs_SOURCE_FILES lldir_linux.cpp)
38 LIST(APPEND llvfs_HEADER_FILES lldir_linux.h)
39
40 if (VIEWER AND INSTALL)
41 set_source_files_properties(lldir_linux.cpp
42 PROPERTIES COMPILE_FLAGS
43 "-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\""
44 )
45 endif (VIEWER AND INSTALL)
46endif (LINUX)
47
48if (WINDOWS)
49 LIST(APPEND llvfs_SOURCE_FILES lldir_win32.cpp)
50 LIST(APPEND llvfs_HEADER_FILES lldir_win32.h)
51endif (WINDOWS)
52
53set_source_files_properties(${llvfs_HEADER_FILES}
54 PROPERTIES HEADER_FILE_ONLY TRUE)
55
56list(APPEND llvfs_SOURCE_FILES ${llvfs_HEADER_FILES})
57
58add_library (llvfs ${llvfs_SOURCE_FILES})
diff --git a/linden/indra/llvfs/files.linux.lst b/linden/indra/llvfs/files.linux.lst
deleted file mode 100755
index 2c306eb..0000000
--- a/linden/indra/llvfs/files.linux.lst
+++ /dev/null
@@ -1 +0,0 @@
1llvfs/lldir_linux.cpp
diff --git a/linden/indra/llvfs/files.lst b/linden/indra/llvfs/files.lst
deleted file mode 100644
index 758ab48..0000000
--- a/linden/indra/llvfs/files.lst
+++ /dev/null
@@ -1,5 +0,0 @@
1llvfs/lldir.cpp
2llvfs/lllfsthread.cpp
3llvfs/llvfile.cpp
4llvfs/llvfs.cpp
5llvfs/llvfsthread.cpp
diff --git a/linden/indra/llvfs/files.sunos5.lst b/linden/indra/llvfs/files.sunos5.lst
deleted file mode 100644
index f1b74d8..0000000
--- a/linden/indra/llvfs/files.sunos5.lst
+++ /dev/null
@@ -1 +0,0 @@
1llvfs/lldir_solaris.cpp
diff --git a/linden/indra/llvfs/files.win32.lst b/linden/indra/llvfs/files.win32.lst
deleted file mode 100755
index 34920d1..0000000
--- a/linden/indra/llvfs/files.win32.lst
+++ /dev/null
@@ -1 +0,0 @@
1llvfs/lldir_win32.cpp
diff --git a/linden/indra/llvfs/lldir.cpp b/linden/indra/llvfs/lldir.cpp
index 246595a..6d6b7aa 100644
--- a/linden/indra/llvfs/lldir.cpp
+++ b/linden/indra/llvfs/lldir.cpp
@@ -59,8 +59,19 @@ LLDir_Linux gDirUtil;
59 59
60LLDir *gDirUtilp = (LLDir *)&gDirUtil; 60LLDir *gDirUtilp = (LLDir *)&gDirUtil;
61 61
62LLDir::LLDir() 62LLDir::LLDir()
63: mDirDelimiter("/") // fallback to forward slash if not overridden 63: mAppName(""),
64 mExecutablePathAndName(""),
65 mExecutableFilename(""),
66 mExecutableDir(""),
67 mAppRODataDir(""),
68 mOSUserDir(""),
69 mOSUserAppDir(""),
70 mLindenUserDir(""),
71 mOSCacheDir(""),
72 mCAFile(""),
73 mTempDir(""),
74 mDirDelimiter("/") // fallback to forward slash if not overridden
64{ 75{
65} 76}
66 77
@@ -90,7 +101,7 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)
90 S32 retry_count = 0; 101 S32 retry_count = 0;
91 while (retry_count < 5) 102 while (retry_count < 5)
92 { 103 {
93 if (0 != LLFile::remove(fullpath.c_str())) 104 if (0 != LLFile::remove(fullpath))
94 { 105 {
95 result = errno; 106 result = errno;
96 llwarns << "Problem removing " << fullpath << " - errorcode: " 107 llwarns << "Problem removing " << fullpath << " - errorcode: "
@@ -205,13 +216,20 @@ const std::string LLDir::getCacheDir(bool get_default) const
205 if (mCacheDir.empty() || get_default) 216 if (mCacheDir.empty() || get_default)
206 { 217 {
207 std::string res; 218 std::string res;
208 if (getOSUserAppDir().empty()) 219 if (getOSCacheDir().empty())
209 { 220 {
210 res = "data"; 221 if (getOSUserAppDir().empty())
222 {
223 res = "data";
224 }
225 else
226 {
227 res = getOSUserAppDir() + mDirDelimiter + "cache";
228 }
211 } 229 }
212 else 230 else
213 { 231 {
214 res = getOSUserAppDir() + mDirDelimiter + "cache"; 232 res = getOSCacheDir() + mDirDelimiter + "SecondLife";
215 } 233 }
216 return res; 234 return res;
217 } 235 }
@@ -221,6 +239,12 @@ const std::string LLDir::getCacheDir(bool get_default) const
221 } 239 }
222} 240}
223 241
242const std::string &LLDir::getOSCacheDir() const
243{
244 return mOSCacheDir;
245}
246
247
224const std::string &LLDir::getCAFile() const 248const std::string &LLDir::getCAFile() const
225{ 249{
226 return mCAFile; 250 return mCAFile;
@@ -350,6 +374,9 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd
350 prefix += mDirDelimiter; 374 prefix += mDirDelimiter;
351 prefix += "browser_profile"; 375 prefix += "browser_profile";
352 break; 376 break;
377
378 case LL_PATH_EXECUTABLE:
379 prefix = getExecutableDir();
353 380
354 default: 381 default:
355 llassert(0); 382 llassert(0);
@@ -395,6 +422,40 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd
395 return expanded_filename; 422 return expanded_filename;
396} 423}
397 424
425std::string LLDir::getBaseFileName(const std::string& filepath, bool strip_exten) const
426{
427 std::size_t offset = filepath.find_last_of(getDirDelimiter());
428 offset = (offset == std::string::npos) ? 0 : offset+1;
429 std::string res = filepath.substr(offset, std::string::npos);
430 if (strip_exten)
431 {
432 offset = res.find_last_of('.');
433 if (offset != std::string::npos &&
434 offset != 0) // if basename STARTS with '.', don't strip
435 {
436 res = res.substr(0, offset);
437 }
438 }
439 return res;
440}
441
442std::string LLDir::getDirName(const std::string& filepath) const
443{
444 std::size_t offset = filepath.find_last_of(getDirDelimiter());
445 S32 len = (offset == std::string::npos) ? 0 : offset;
446 std::string dirname = filepath.substr(0, len);
447 return dirname;
448}
449
450std::string LLDir::getExtension(const std::string& filepath) const
451{
452 std::string basename = getBaseFileName(filepath, false);
453 std::size_t offset = basename.find_last_of('.');
454 std::string exten = (offset == std::string::npos || offset == 0) ? "" : basename.substr(offset+1);
455 LLStringUtil::toLower(exten);
456 return exten;
457}
458
398std::string LLDir::findSkinnedFilename(const std::string &filename) const 459std::string LLDir::findSkinnedFilename(const std::string &filename) const
399{ 460{
400 return findSkinnedFilename("", "", filename); 461 return findSkinnedFilename("", "", filename);
@@ -419,11 +480,10 @@ std::string LLDir::findSkinnedFilename(const std::string &subdir1, const std::st
419 return found_file; 480 return found_file;
420} 481}
421 482
422
423std::string LLDir::getTempFilename() const 483std::string LLDir::getTempFilename() const
424{ 484{
425 LLUUID random_uuid; 485 LLUUID random_uuid;
426 char uuid_str[64]; /* Flawfinder: ignore */ 486 std::string uuid_str;
427 487
428 random_uuid.generate(); 488 random_uuid.generate();
429 random_uuid.toString(uuid_str); 489 random_uuid.toString(uuid_str);
@@ -443,15 +503,15 @@ void LLDir::setLindenUserDir(const std::string &first, const std::string &last)
443 { 503 {
444 // some platforms have case-sensitive filesystems, so be 504 // some platforms have case-sensitive filesystems, so be
445 // utterly consistent with our firstname/lastname case. 505 // utterly consistent with our firstname/lastname case.
446 LLString firstlower(first); 506 std::string firstlower(first);
447 LLString::toLower(firstlower); 507 LLStringUtil::toLower(firstlower);
448 LLString lastlower(last); 508 std::string lastlower(last);
449 LLString::toLower(lastlower); 509 LLStringUtil::toLower(lastlower);
450 mLindenUserDir = getOSUserAppDir(); 510 mLindenUserDir = getOSUserAppDir();
451 mLindenUserDir += mDirDelimiter; 511 mLindenUserDir += mDirDelimiter;
452 mLindenUserDir += firstlower.c_str(); 512 mLindenUserDir += firstlower;
453 mLindenUserDir += "_"; 513 mLindenUserDir += "_";
454 mLindenUserDir += lastlower.c_str(); 514 mLindenUserDir += lastlower;
455 } 515 }
456 else 516 else
457 { 517 {
@@ -480,15 +540,15 @@ void LLDir::setPerAccountChatLogsDir(const std::string &first, const std::string
480 { 540 {
481 // some platforms have case-sensitive filesystems, so be 541 // some platforms have case-sensitive filesystems, so be
482 // utterly consistent with our firstname/lastname case. 542 // utterly consistent with our firstname/lastname case.
483 LLString firstlower(first); 543 std::string firstlower(first);
484 LLString::toLower(firstlower); 544 LLStringUtil::toLower(firstlower);
485 LLString lastlower(last); 545 std::string lastlower(last);
486 LLString::toLower(lastlower); 546 LLStringUtil::toLower(lastlower);
487 mPerAccountChatLogsDir = getChatLogsDir(); 547 mPerAccountChatLogsDir = getChatLogsDir();
488 mPerAccountChatLogsDir += mDirDelimiter; 548 mPerAccountChatLogsDir += mDirDelimiter;
489 mPerAccountChatLogsDir += firstlower.c_str(); 549 mPerAccountChatLogsDir += firstlower;
490 mPerAccountChatLogsDir += "_"; 550 mPerAccountChatLogsDir += "_";
491 mPerAccountChatLogsDir += lastlower.c_str(); 551 mPerAccountChatLogsDir += lastlower;
492 } 552 }
493 else 553 else
494 { 554 {
@@ -531,13 +591,13 @@ bool LLDir::setCacheDir(const std::string &path)
531 } 591 }
532 else 592 else
533 { 593 {
534 LLFile::mkdir(path.c_str()); 594 LLFile::mkdir(path);
535 std::string tempname = path + mDirDelimiter + "temp"; 595 std::string tempname = path + mDirDelimiter + "temp";
536 LLFILE* file = LLFile::fopen(tempname.c_str(),"wt"); 596 LLFILE* file = LLFile::fopen(tempname,"wt");
537 if (file) 597 if (file)
538 { 598 {
539 fclose(file); 599 fclose(file);
540 LLFile::remove(tempname.c_str()); 600 LLFile::remove(tempname);
541 mCacheDir = path; 601 mCacheDir = path;
542 return true; 602 return true;
543 } 603 }
@@ -570,15 +630,15 @@ void dir_exists_or_crash(const std::string &dir_name)
570#if LL_WINDOWS 630#if LL_WINDOWS
571 // *FIX: lame - it doesn't do the same thing on windows. not so 631 // *FIX: lame - it doesn't do the same thing on windows. not so
572 // important since we don't deploy simulator to windows boxes. 632 // important since we don't deploy simulator to windows boxes.
573 LLFile::mkdir(dir_name.c_str(), 0700); 633 LLFile::mkdir(dir_name, 0700);
574#else 634#else
575 struct stat dir_stat; 635 struct stat dir_stat;
576 if(0 != LLFile::stat(dir_name.c_str(), &dir_stat)) 636 if(0 != LLFile::stat(dir_name, &dir_stat))
577 { 637 {
578 S32 stat_rv = errno; 638 S32 stat_rv = errno;
579 if(ENOENT == stat_rv) 639 if(ENOENT == stat_rv)
580 { 640 {
581 if(0 != LLFile::mkdir(dir_name.c_str(), 0700)) // octal 641 if(0 != LLFile::mkdir(dir_name, 0700)) // octal
582 { 642 {
583 llerrs << "Unable to create directory: " << dir_name << llendl; 643 llerrs << "Unable to create directory: " << dir_name << llendl;
584 } 644 }
diff --git a/linden/indra/llvfs/lldir.h b/linden/indra/llvfs/lldir.h
index 8734c44..dbddf7d 100644
--- a/linden/indra/llvfs/lldir.h
+++ b/linden/indra/llvfs/lldir.h
@@ -51,7 +51,8 @@ typedef enum ELLPath
51 LL_PATH_PER_ACCOUNT_CHAT_LOGS = 13, 51 LL_PATH_PER_ACCOUNT_CHAT_LOGS = 13,
52 LL_PATH_MOZILLA_PROFILE = 14, 52 LL_PATH_MOZILLA_PROFILE = 14,
53// LL_PATH_HTML = 15, 53// LL_PATH_HTML = 15,
54 LL_PATH_LAST = 16 54 LL_PATH_EXECUTABLE = 16,
55 LL_PATH_LAST
55} ELLPath; 56} ELLPath;
56 57
57 58
@@ -86,6 +87,7 @@ class LLDir
86 const std::string &getPerAccountChatLogsDir() const; // Location of the per account chat logs dir. 87 const std::string &getPerAccountChatLogsDir() const; // Location of the per account chat logs dir.
87 const std::string &getTempDir() const; // Common temporary directory 88 const std::string &getTempDir() const; // Common temporary directory
88 const std::string getCacheDir(bool get_default = false) const; // Location of the cache. 89 const std::string getCacheDir(bool get_default = false) const; // Location of the cache.
90 const std::string &getOSCacheDir() const; // location of OS-specific cache folder (may be empty string)
89 const std::string &getCAFile() const; // File containing TLS certificate authorities 91 const std::string &getCAFile() const; // File containing TLS certificate authorities
90 const std::string &getDirDelimiter() const; // directory separator for platform (ie. '\' or '/' or ':') 92 const std::string &getDirDelimiter() const; // directory separator for platform (ie. '\' or '/' or ':')
91 const std::string &getSkinDir() const; // User-specified skin folder. 93 const std::string &getSkinDir() const; // User-specified skin folder.
@@ -98,13 +100,17 @@ class LLDir
98 std::string getExpandedFilename(ELLPath location, const std::string &subdir, const std::string &filename) const; 100 std::string getExpandedFilename(ELLPath location, const std::string &subdir, const std::string &filename) const;
99 std::string getExpandedFilename(ELLPath location, const std::string &subdir1, const std::string &subdir2, const std::string &filename) const; 101 std::string getExpandedFilename(ELLPath location, const std::string &subdir1, const std::string &subdir2, const std::string &filename) const;
100 102
103 // Base and Directory name extraction
104 std::string getBaseFileName(const std::string& filepath, bool strip_exten = false) const;
105 std::string getDirName(const std::string& filepath) const;
106 std::string getExtension(const std::string& filepath) const; // Excludes '.', e.g getExtension("foo.wav") == "wav"
107
101 // these methods search the various skin paths for the specified file in the following order: 108 // these methods search the various skin paths for the specified file in the following order:
102 // getUserSkinDir(), getSkinDir(), getDefaultSkinDir() 109 // getUserSkinDir(), getSkinDir(), getDefaultSkinDir()
103 std::string findSkinnedFilename(const std::string &filename) const; 110 std::string findSkinnedFilename(const std::string &filename) const;
104 std::string findSkinnedFilename(const std::string &subdir, const std::string &filename) const; 111 std::string findSkinnedFilename(const std::string &subdir, const std::string &filename) const;
105 std::string findSkinnedFilename(const std::string &subdir1, const std::string &subdir2, const std::string &filename) const; 112 std::string findSkinnedFilename(const std::string &subdir1, const std::string &subdir2, const std::string &filename) const;
106 113
107
108 // random filename in common temporary directory 114 // random filename in common temporary directory
109 std::string getTempFilename() const; 115 std::string getTempFilename() const;
110 116
@@ -131,6 +137,7 @@ protected:
131 std::string mCAFile; // Location of the TLS certificate authority PEM file. 137 std::string mCAFile; // Location of the TLS certificate authority PEM file.
132 std::string mTempDir; 138 std::string mTempDir;
133 std::string mCacheDir; 139 std::string mCacheDir;
140 std::string mOSCacheDir;
134 std::string mDirDelimiter; 141 std::string mDirDelimiter;
135 std::string mSkinDir; // Location for current skin info. 142 std::string mSkinDir; // Location for current skin info.
136 std::string mDefaultSkinDir; // Location for default skin info. 143 std::string mDefaultSkinDir; // Location for default skin info.
diff --git a/linden/indra/llvfs/lldir_linux.cpp b/linden/indra/llvfs/lldir_linux.cpp
index 9aa4da3..481d23d 100644
--- a/linden/indra/llvfs/lldir_linux.cpp
+++ b/linden/indra/llvfs/lldir_linux.cpp
@@ -93,7 +93,11 @@ LLDir_Linux::LLDir_Linux()
93 mExecutablePathAndName = ""; 93 mExecutablePathAndName = "";
94 mExecutableDir = tmp_str; 94 mExecutableDir = tmp_str;
95 mWorkingDir = tmp_str; 95 mWorkingDir = tmp_str;
96#ifdef APP_RO_DATA_DIR
97 mAppRODataDir = APP_RO_DATA_DIR;
98#else
96 mAppRODataDir = tmp_str; 99 mAppRODataDir = tmp_str;
100#endif
97 mOSUserDir = getCurrentUserHome(tmp_str); 101 mOSUserDir = getCurrentUserHome(tmp_str);
98 mOSUserAppDir = ""; 102 mOSUserAppDir = "";
99 mLindenUserDir = tmp_str; 103 mLindenUserDir = tmp_str;
@@ -138,8 +142,8 @@ void LLDir_Linux::initAppDirs(const std::string &app_name)
138{ 142{
139 mAppName = app_name; 143 mAppName = app_name;
140 144
141 LLString upper_app_name(app_name); 145 std::string upper_app_name(app_name);
142 LLString::toUpper(upper_app_name); 146 LLStringUtil::toUpper(upper_app_name);
143 147
144 char* app_home_env = getenv((upper_app_name + "_USER_DIR").c_str()); /* Flawfinder: ignore */ 148 char* app_home_env = getenv((upper_app_name + "_USER_DIR").c_str()); /* Flawfinder: ignore */
145 if (app_home_env) 149 if (app_home_env)
@@ -153,14 +157,14 @@ void LLDir_Linux::initAppDirs(const std::string &app_name)
153 mOSUserAppDir = mOSUserDir; 157 mOSUserAppDir = mOSUserDir;
154 mOSUserAppDir += "/"; 158 mOSUserAppDir += "/";
155 mOSUserAppDir += "."; 159 mOSUserAppDir += ".";
156 LLString lower_app_name(app_name); 160 std::string lower_app_name(app_name);
157 LLString::toLower(lower_app_name); 161 LLStringUtil::toLower(lower_app_name);
158 mOSUserAppDir += lower_app_name; 162 mOSUserAppDir += lower_app_name;
159 } 163 }
160 164
161 // create any directories we expect to write to. 165 // create any directories we expect to write to.
162 166
163 int res = LLFile::mkdir(mOSUserAppDir.c_str()); 167 int res = LLFile::mkdir(mOSUserAppDir);
164 if (res == -1) 168 if (res == -1)
165 { 169 {
166 if (errno != EEXIST) 170 if (errno != EEXIST)
@@ -171,7 +175,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name)
171 } 175 }
172 } 176 }
173 177
174 res = LLFile::mkdir(getExpandedFilename(LL_PATH_LOGS,"").c_str()); 178 res = LLFile::mkdir(getExpandedFilename(LL_PATH_LOGS,""));
175 if (res == -1) 179 if (res == -1)
176 { 180 {
177 if (errno != EEXIST) 181 if (errno != EEXIST)
@@ -180,7 +184,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name)
180 } 184 }
181 } 185 }
182 186
183 res = LLFile::mkdir(getExpandedFilename(LL_PATH_USER_SETTINGS,"").c_str()); 187 res = LLFile::mkdir(getExpandedFilename(LL_PATH_USER_SETTINGS,""));
184 if (res == -1) 188 if (res == -1)
185 { 189 {
186 if (errno != EEXIST) 190 if (errno != EEXIST)
@@ -189,7 +193,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name)
189 } 193 }
190 } 194 }
191 195
192 res = LLFile::mkdir(getExpandedFilename(LL_PATH_CACHE,"").c_str()); 196 res = LLFile::mkdir(getExpandedFilename(LL_PATH_CACHE,""));
193 if (res == -1) 197 if (res == -1)
194 { 198 {
195 if (errno != EEXIST) 199 if (errno != EEXIST)
@@ -198,7 +202,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name)
198 } 202 }
199 } 203 }
200 204
201 res = LLFile::mkdir(getExpandedFilename(LL_PATH_MOZILLA_PROFILE,"").c_str()); 205 res = LLFile::mkdir(getExpandedFilename(LL_PATH_MOZILLA_PROFILE,""));
202 if (res == -1) 206 if (res == -1)
203 { 207 {
204 if (errno != EEXIST) 208 if (errno != EEXIST)
diff --git a/linden/indra/llvfs/lldir_mac.cpp b/linden/indra/llvfs/lldir_mac.cpp
index 8b1be53..fd8f087 100644
--- a/linden/indra/llvfs/lldir_mac.cpp
+++ b/linden/indra/llvfs/lldir_mac.cpp
@@ -159,13 +159,22 @@ LLDir_Mac::LLDir_Mac()
159 159
160 // Create our sub-dirs 160 // Create our sub-dirs
161 (void) CFCreateDirectory(&newFileRef, CFSTR("data"), NULL); 161 (void) CFCreateDirectory(&newFileRef, CFSTR("data"), NULL);
162 (void) CFCreateDirectory(&newFileRef, CFSTR("cache"), NULL); 162 //(void) CFCreateDirectory(&newFileRef, CFSTR("cache"), NULL);
163 (void) CFCreateDirectory(&newFileRef, CFSTR("logs"), NULL); 163 (void) CFCreateDirectory(&newFileRef, CFSTR("logs"), NULL);
164 (void) CFCreateDirectory(&newFileRef, CFSTR("user_settings"), NULL); 164 (void) CFCreateDirectory(&newFileRef, CFSTR("user_settings"), NULL);
165 (void) CFCreateDirectory(&newFileRef, CFSTR("browser_profile"), NULL); 165 (void) CFCreateDirectory(&newFileRef, CFSTR("browser_profile"), NULL);
166 } 166 }
167 } 167 }
168 168
169 //mOSCacheDir
170 FSRef cacheDirRef;
171 error = FSFindFolder(kUserDomain, kCachedDataFolderType, true, &cacheDirRef);
172 if (error == noErr)
173 {
174 FSRefToLLString(&cacheDirRef, mOSCacheDir);
175 (void)CFCreateDirectory(&cacheDirRef, CFSTR("SecondLife"),NULL);
176 }
177
169 // mOSUserAppDir 178 // mOSUserAppDir
170 mOSUserAppDir = mOSUserDir; 179 mOSUserAppDir = mOSUserDir;
171 180
diff --git a/linden/indra/llvfs/lldir_solaris.cpp b/linden/indra/llvfs/lldir_solaris.cpp
index 2143bb2..62c1eb7 100644
--- a/linden/indra/llvfs/lldir_solaris.cpp
+++ b/linden/indra/llvfs/lldir_solaris.cpp
@@ -152,8 +152,8 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name)
152{ 152{
153 mAppName = app_name; 153 mAppName = app_name;
154 154
155 LLString upper_app_name(app_name); 155 std::string upper_app_name(app_name);
156 LLString::toUpper(upper_app_name); 156 LLStringUtil::toUpper(upper_app_name);
157 157
158 char* app_home_env = getenv((upper_app_name + "_USER_DIR").c_str()); /* Flawfinder: ignore */ 158 char* app_home_env = getenv((upper_app_name + "_USER_DIR").c_str()); /* Flawfinder: ignore */
159 if (app_home_env) 159 if (app_home_env)
@@ -167,14 +167,14 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name)
167 mOSUserAppDir = mOSUserDir; 167 mOSUserAppDir = mOSUserDir;
168 mOSUserAppDir += "/"; 168 mOSUserAppDir += "/";
169 mOSUserAppDir += "."; 169 mOSUserAppDir += ".";
170 LLString lower_app_name(app_name); 170 std::string lower_app_name(app_name);
171 LLString::toLower(lower_app_name); 171 LLStringUtil::toLower(lower_app_name);
172 mOSUserAppDir += lower_app_name; 172 mOSUserAppDir += lower_app_name;
173 } 173 }
174 174
175 // create any directories we expect to write to. 175 // create any directories we expect to write to.
176 176
177 int res = LLFile::mkdir(mOSUserAppDir.c_str()); 177 int res = LLFile::mkdir(mOSUserAppDir);
178 if (res == -1) 178 if (res == -1)
179 { 179 {
180 if (errno != EEXIST) 180 if (errno != EEXIST)
@@ -185,7 +185,7 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name)
185 } 185 }
186 } 186 }
187 187
188 res = LLFile::mkdir(getExpandedFilename(LL_PATH_LOGS,"").c_str()); 188 res = LLFile::mkdir(getExpandedFilename(LL_PATH_LOGS,""));
189 if (res == -1) 189 if (res == -1)
190 { 190 {
191 if (errno != EEXIST) 191 if (errno != EEXIST)
@@ -194,7 +194,7 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name)
194 } 194 }
195 } 195 }
196 196
197 res = LLFile::mkdir(getExpandedFilename(LL_PATH_USER_SETTINGS,"").c_str()); 197 res = LLFile::mkdir(getExpandedFilename(LL_PATH_USER_SETTINGS,""));
198 if (res == -1) 198 if (res == -1)
199 { 199 {
200 if (errno != EEXIST) 200 if (errno != EEXIST)
@@ -203,7 +203,7 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name)
203 } 203 }
204 } 204 }
205 205
206 res = LLFile::mkdir(getExpandedFilename(LL_PATH_CACHE,"").c_str()); 206 res = LLFile::mkdir(getExpandedFilename(LL_PATH_CACHE,""));
207 if (res == -1) 207 if (res == -1)
208 { 208 {
209 if (errno != EEXIST) 209 if (errno != EEXIST)
@@ -212,7 +212,7 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name)
212 } 212 }
213 } 213 }
214 214
215 res = LLFile::mkdir(getExpandedFilename(LL_PATH_MOZILLA_PROFILE,"").c_str()); 215 res = LLFile::mkdir(getExpandedFilename(LL_PATH_MOZILLA_PROFILE,""));
216 if (res == -1) 216 if (res == -1)
217 { 217 {
218 if (errno != EEXIST) 218 if (errno != EEXIST)
diff --git a/linden/indra/llvfs/lldir_win32.cpp b/linden/indra/llvfs/lldir_win32.cpp
index 8904dff..99d5e18 100644
--- a/linden/indra/llvfs/lldir_win32.cpp
+++ b/linden/indra/llvfs/lldir_win32.cpp
@@ -116,10 +116,16 @@ LLDir_Win32::LLDir_Win32()
116 GetCurrentDirectory(MAX_PATH, w_str); 116 GetCurrentDirectory(MAX_PATH, w_str);
117 mExecutableDir = utf16str_to_utf8str(llutf16string(w_str)); 117 mExecutableDir = utf16str_to_utf8str(llutf16string(w_str));
118#endif 118#endif
119
120 mAppRODataDir = getCurPath();
121 // *FIX:Mani - The following is the old way we did things. I'm keeping this around
122 // in case there is some really good reason to make mAppRODataDir == mExecutableDir
123 /*
119 if (strstr(mExecutableDir.c_str(), "indra\\newview")) 124 if (strstr(mExecutableDir.c_str(), "indra\\newview"))
120 mAppRODataDir = getCurPath(); 125 mAppRODataDir = getCurPath();
121 else 126 else
122 mAppRODataDir = mExecutableDir; 127 mAppRODataDir = mExecutableDir;
128 */
123} 129}
124 130
125LLDir_Win32::~LLDir_Win32() 131LLDir_Win32::~LLDir_Win32()
@@ -135,7 +141,7 @@ void LLDir_Win32::initAppDirs(const std::string &app_name)
135 mOSUserAppDir += "\\"; 141 mOSUserAppDir += "\\";
136 mOSUserAppDir += app_name; 142 mOSUserAppDir += app_name;
137 143
138 int res = LLFile::mkdir(mOSUserAppDir.c_str()); 144 int res = LLFile::mkdir(mOSUserAppDir);
139 if (res == -1) 145 if (res == -1)
140 { 146 {
141 if (errno != EEXIST) 147 if (errno != EEXIST)
@@ -147,7 +153,7 @@ void LLDir_Win32::initAppDirs(const std::string &app_name)
147 } 153 }
148 //dumpCurrentDirectories(); 154 //dumpCurrentDirectories();
149 155
150 res = LLFile::mkdir(getExpandedFilename(LL_PATH_LOGS,"").c_str()); 156 res = LLFile::mkdir(getExpandedFilename(LL_PATH_LOGS,""));
151 if (res == -1) 157 if (res == -1)
152 { 158 {
153 if (errno != EEXIST) 159 if (errno != EEXIST)
@@ -156,7 +162,7 @@ void LLDir_Win32::initAppDirs(const std::string &app_name)
156 } 162 }
157 } 163 }
158 164
159 res = LLFile::mkdir(getExpandedFilename(LL_PATH_USER_SETTINGS,"").c_str()); 165 res = LLFile::mkdir(getExpandedFilename(LL_PATH_USER_SETTINGS,""));
160 if (res == -1) 166 if (res == -1)
161 { 167 {
162 if (errno != EEXIST) 168 if (errno != EEXIST)
@@ -165,7 +171,7 @@ void LLDir_Win32::initAppDirs(const std::string &app_name)
165 } 171 }
166 } 172 }
167 173
168 res = LLFile::mkdir(getExpandedFilename(LL_PATH_CACHE,"").c_str()); 174 res = LLFile::mkdir(getExpandedFilename(LL_PATH_CACHE,""));
169 if (res == -1) 175 if (res == -1)
170 { 176 {
171 if (errno != EEXIST) 177 if (errno != EEXIST)
@@ -174,7 +180,7 @@ void LLDir_Win32::initAppDirs(const std::string &app_name)
174 } 180 }
175 } 181 }
176 182
177 res = LLFile::mkdir(getExpandedFilename(LL_PATH_MOZILLA_PROFILE,"").c_str()); 183 res = LLFile::mkdir(getExpandedFilename(LL_PATH_MOZILLA_PROFILE,""));
178 if (res == -1) 184 if (res == -1)
179 { 185 {
180 if (errno != EEXIST) 186 if (errno != EEXIST)
@@ -343,7 +349,7 @@ BOOL LLDir_Win32::fileExists(const std::string &filename) const
343 llstat stat_data; 349 llstat stat_data;
344 // Check the age of the file 350 // Check the age of the file
345 // Now, we see if the files we've gathered are recent... 351 // Now, we see if the files we've gathered are recent...
346 int res = LLFile::stat(filename.c_str(), &stat_data); 352 int res = LLFile::stat(filename, &stat_data);
347 if (!res) 353 if (!res)
348 { 354 {
349 return TRUE; 355 return TRUE;
diff --git a/linden/indra/llvfs/lllfsthread.cpp b/linden/indra/llvfs/lllfsthread.cpp
index 4510392..7dce4d9 100644
--- a/linden/indra/llvfs/lllfsthread.cpp
+++ b/linden/indra/llvfs/lllfsthread.cpp
@@ -30,7 +30,6 @@
30 */ 30 */
31 31
32#include "linden_common.h" 32#include "linden_common.h"
33#include "llmath.h"
34#include "lllfsthread.h" 33#include "lllfsthread.h"
35#include "llstl.h" 34#include "llstl.h"
36#include "llapr.h" 35#include "llapr.h"
@@ -82,7 +81,7 @@ LLLFSThread::~LLLFSThread()
82 81
83//---------------------------------------------------------------------------- 82//----------------------------------------------------------------------------
84 83
85LLLFSThread::handle_t LLLFSThread::read(const LLString& filename, /* Flawfinder: ignore */ 84LLLFSThread::handle_t LLLFSThread::read(const std::string& filename, /* Flawfinder: ignore */
86 U8* buffer, S32 offset, S32 numbytes, 85 U8* buffer, S32 offset, S32 numbytes,
87 Responder* responder, U32 priority) 86 Responder* responder, U32 priority)
88{ 87{
@@ -105,7 +104,7 @@ LLLFSThread::handle_t LLLFSThread::read(const LLString& filename, /* Flawfinder:
105 return handle; 104 return handle;
106} 105}
107 106
108LLLFSThread::handle_t LLLFSThread::write(const LLString& filename, 107LLLFSThread::handle_t LLLFSThread::write(const std::string& filename,
109 U8* buffer, S32 offset, S32 numbytes, 108 U8* buffer, S32 offset, S32 numbytes,
110 Responder* responder, U32 priority) 109 Responder* responder, U32 priority)
111{ 110{
@@ -131,7 +130,7 @@ LLLFSThread::handle_t LLLFSThread::write(const LLString& filename,
131 130
132LLLFSThread::Request::Request(LLLFSThread* thread, 131LLLFSThread::Request::Request(LLLFSThread* thread,
133 handle_t handle, U32 priority, 132 handle_t handle, U32 priority,
134 operation_t op, const LLString& filename, 133 operation_t op, const std::string& filename,
135 U8* buffer, S32 offset, S32 numbytes, 134 U8* buffer, S32 offset, S32 numbytes,
136 Responder* responder) : 135 Responder* responder) :
137 QueuedRequest(handle, priority, FLAG_AUTO_COMPLETE), 136 QueuedRequest(handle, priority, FLAG_AUTO_COMPLETE),
diff --git a/linden/indra/llvfs/lllfsthread.h b/linden/indra/llvfs/lllfsthread.h
index b073422..eebec48 100644
--- a/linden/indra/llvfs/lllfsthread.h
+++ b/linden/indra/llvfs/lllfsthread.h
@@ -75,7 +75,7 @@ public:
75 public: 75 public:
76 Request(LLLFSThread* thread, 76 Request(LLLFSThread* thread,
77 handle_t handle, U32 priority, 77 handle_t handle, U32 priority,
78 operation_t op, const LLString& filename, 78 operation_t op, const std::string& filename,
79 U8* buffer, S32 offset, S32 numbytes, 79 U8* buffer, S32 offset, S32 numbytes,
80 Responder* responder); 80 Responder* responder);
81 81
@@ -95,7 +95,7 @@ public:
95 { 95 {
96 return mBuffer; 96 return mBuffer;
97 } 97 }
98 const LLString& getFilename() 98 const std::string& getFilename()
99 { 99 {
100 return mFileName; 100 return mFileName;
101 } 101 }
@@ -108,7 +108,7 @@ public:
108 LLLFSThread* mThread; 108 LLLFSThread* mThread;
109 operation_t mOperation; 109 operation_t mOperation;
110 110
111 LLString mFileName; 111 std::string mFileName;
112 112
113 U8* mBuffer; // dest for reads, source for writes, new UUID for rename 113 U8* mBuffer; // dest for reads, source for writes, new UUID for rename
114 S32 mOffset; // offset into file, -1 = append (WRITE only) 114 S32 mOffset; // offset into file, -1 = append (WRITE only)
@@ -124,10 +124,10 @@ public:
124 ~LLLFSThread(); 124 ~LLLFSThread();
125 125
126 // Return a Request handle 126 // Return a Request handle
127 handle_t read(const LLString& filename, /* Flawfinder: ignore */ 127 handle_t read(const std::string& filename, /* Flawfinder: ignore */
128 U8* buffer, S32 offset, S32 numbytes, 128 U8* buffer, S32 offset, S32 numbytes,
129 Responder* responder, U32 pri=0); 129 Responder* responder, U32 pri=0);
130 handle_t write(const LLString& filename, 130 handle_t write(const std::string& filename,
131 U8* buffer, S32 offset, S32 numbytes, 131 U8* buffer, S32 offset, S32 numbytes,
132 Responder* responder, U32 pri=0); 132 Responder* responder, U32 pri=0);
133 133
diff --git a/linden/indra/llvfs/llvfs.cpp b/linden/indra/llvfs/llvfs.cpp
index 7903e83..b3d02a5 100644
--- a/linden/indra/llvfs/llvfs.cpp
+++ b/linden/indra/llvfs/llvfs.cpp
@@ -232,7 +232,7 @@ struct LLVFSFileBlock_less
232const S32 LLVFSFileBlock::SERIAL_SIZE = 34; 232const S32 LLVFSFileBlock::SERIAL_SIZE = 34;
233 233
234 234
235LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL read_only, const U32 presize, const BOOL remove_after_crash) 235LLVFS::LLVFS(const std::string& index_filename, const std::string& data_filename, const BOOL read_only, const U32 presize, const BOOL remove_after_crash)
236: mRemoveAfterCrash(remove_after_crash) 236: mRemoveAfterCrash(remove_after_crash)
237{ 237{
238 mDataMutex = new LLMutex(0); 238 mDataMutex = new LLMutex(0);
@@ -244,15 +244,8 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
244 } 244 }
245 mValid = VFSVALID_OK; 245 mValid = VFSVALID_OK;
246 mReadOnly = read_only; 246 mReadOnly = read_only;
247 mIndexFilename = new char[strlen(index_filename) + 1]; /* Flawfinder: ignore */ 247 mIndexFilename = index_filename;
248 mDataFilename = new char[strlen(data_filename) + 1]; /* Flawfinder: ignore */ 248 mDataFilename = data_filename;
249 if (mIndexFilename == NULL || mDataFilename == NULL)
250 {
251 LL_ERRS("VFS") << "Memory Allocation Failure" << LL_ENDL;
252 return;
253 }
254 strcpy(mIndexFilename, index_filename); /* Flawfinder: ignore */
255 strcpy(mDataFilename, data_filename); /* Flawfinder: ignore */
256 249
257 const char *file_mode = mReadOnly ? "rb" : "r+b"; 250 const char *file_mode = mReadOnly ? "rb" : "r+b";
258 251
@@ -276,23 +269,13 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
276 { 269 {
277 LL_WARNS("VFS") << "Can't open VFS data file " << mDataFilename << " attempting to use alternate" << LL_ENDL; 270 LL_WARNS("VFS") << "Can't open VFS data file " << mDataFilename << " attempting to use alternate" << LL_ENDL;
278 271
279 char *temp_index = new char[strlen(mIndexFilename) + 10]; /* Flawfinder: ignore */ 272 std::string temp_index;
280 if (!temp_index) 273 std::string temp_data;
281 {
282 LL_ERRS("VFS") << "Out of the memory in LLVFS::LLVFS()" << LL_ENDL;
283 return;
284 }
285 char *temp_data = new char[strlen(mDataFilename) + 10]; /* Flawfinder: ignore */
286 if (!temp_data)
287 {
288 LL_ERRS("VFS") << "Out of the memory in LLVFS::LLVFS()" << LL_ENDL;
289 return;
290 }
291 274
292 for (U32 count = 0; count < 256; count++) 275 for (U32 count = 0; count < 256; count++)
293 { 276 {
294 sprintf(temp_index, "%s.%u", mIndexFilename, count); /* Flawfinder: ignore */ 277 temp_index = mIndexFilename + llformat(".%u",count);
295 sprintf(temp_data, "%s.%u", mDataFilename, count); /* Flawfinder: ignore */ 278 temp_data = mDataFilename + llformat(".%u", count);
296 279
297 // try just opening, then creating, each alternate 280 // try just opening, then creating, each alternate
298 if ((mDataFP = openAndLock(temp_data, "r+b", FALSE))) 281 if ((mDataFP = openAndLock(temp_data, "r+b", FALSE)))
@@ -312,14 +295,9 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
312 { 295 {
313 LL_WARNS("VFS") << "Couldn't open vfs data file after trying many alternates" << LL_ENDL; 296 LL_WARNS("VFS") << "Couldn't open vfs data file after trying many alternates" << LL_ENDL;
314 mValid = VFSVALID_BAD_CANNOT_CREATE; 297 mValid = VFSVALID_BAD_CANNOT_CREATE;
315 delete[] temp_index;
316 delete[] temp_data;
317 return; 298 return;
318 } 299 }
319 300
320 delete[] mIndexFilename;
321 delete[] mDataFilename;
322
323 mIndexFilename = temp_index; 301 mIndexFilename = temp_index;
324 mDataFilename = temp_data; 302 mDataFilename = temp_data;
325 } 303 }
@@ -335,13 +313,7 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
335 if (!mReadOnly && mRemoveAfterCrash) 313 if (!mReadOnly && mRemoveAfterCrash)
336 { 314 {
337 llstat marker_info; 315 llstat marker_info;
338 char* marker = new char[strlen(mDataFilename) + strlen(".open") + 1]; /* Flawfinder: ignore */ 316 std::string marker = mDataFilename + ".open";
339 if (!marker )
340 {
341 LL_ERRS("VFS") << "Out of memory in LLVFS::LLVFS()" << LL_ENDL;
342 return;
343 }
344 sprintf(marker, "%s.open", mDataFilename); /* Flawfinder: ignore */
345 if (!LLFile::stat(marker, &marker_info)) 317 if (!LLFile::stat(marker, &marker_info))
346 { 318 {
347 // marker exists, kill the lock and the VFS files 319 // marker exists, kill the lock and the VFS files
@@ -366,8 +338,6 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
366 presizeDataFile(presize); 338 presizeDataFile(presize);
367 } 339 }
368 } 340 }
369 delete [] marker;
370 marker = NULL;
371 } 341 }
372 342
373 // determine the real file size 343 // determine the real file size
@@ -590,21 +560,13 @@ LLVFS::LLVFS(const char *index_filename, const char *data_filename, const BOOL r
590 // Open marker file to look for bad shutdowns 560 // Open marker file to look for bad shutdowns
591 if (!mReadOnly && mRemoveAfterCrash) 561 if (!mReadOnly && mRemoveAfterCrash)
592 { 562 {
593 char* marker = new char[strlen(mDataFilename) + strlen(".open") + 1]; 563 std::string marker = mDataFilename + ".open";
594 if (!marker)
595 {
596 LL_ERRS("VFS") << "Out of memory in LLVFS::LLVFS()" << LL_ENDL;
597 return;
598 }
599 sprintf(marker, "%s.open", mDataFilename); /* Flawfinder: ignore */
600 LLFILE* marker_fp = LLFile::fopen(marker, "w"); /* Flawfinder: ignore */ 564 LLFILE* marker_fp = LLFile::fopen(marker, "w"); /* Flawfinder: ignore */
601 if (marker_fp) 565 if (marker_fp)
602 { 566 {
603 fclose(marker_fp); 567 fclose(marker_fp);
604 marker_fp = NULL; 568 marker_fp = NULL;
605 } 569 }
606 delete [] marker;
607 marker = NULL;
608 } 570 }
609 571
610 LL_WARNS("VFS") << "Using index file " << mIndexFilename << LL_ENDL; 572 LL_WARNS("VFS") << "Using index file " << mIndexFilename << LL_ENDL;
@@ -640,23 +602,10 @@ LLVFS::~LLVFS()
640 // Remove marker file 602 // Remove marker file
641 if (!mReadOnly && mRemoveAfterCrash) 603 if (!mReadOnly && mRemoveAfterCrash)
642 { 604 {
643 char* marker_file = new char[strlen(mDataFilename) + strlen(".open") + 1]; 605 std::string marker = mDataFilename + ".open";
644 if (marker_file == NULL) 606 LLFile::remove(marker);
645 {
646 LL_ERRS("VFS") << "Memory Allocation Failure" << LL_ENDL;
647 return;
648 }
649 sprintf(marker_file, "%s.open", mDataFilename); /* Flawfinder: ignore */
650 LLFile::remove(marker_file);
651 delete [] marker_file;
652 marker_file = NULL;
653 } 607 }
654 608
655 delete[] mIndexFilename;
656 mIndexFilename = NULL;
657 delete[] mDataFilename;
658 mDataFilename = NULL;
659
660 delete mDataMutex; 609 delete mDataMutex;
661} 610}
662 611
@@ -2042,31 +1991,30 @@ void LLVFS::dumpStatistics()
2042} 1991}
2043 1992
2044// Debug Only! 1993// Debug Only!
2045LLString get_extension(LLAssetType::EType type) 1994std::string get_extension(LLAssetType::EType type)
2046{ 1995{
2047 LLString extension; 1996 std::string extension;
2048 switch(type) 1997 switch(type)
2049 { 1998 {
2050 case LLAssetType::AT_TEXTURE: 1999 case LLAssetType::AT_TEXTURE:
2051 extension = ".j2c"; 2000 extension = ".jp2"; // formerly ".j2c"
2052 break; 2001 break;
2053 case LLAssetType::AT_SOUND: 2002 case LLAssetType::AT_SOUND:
2054 extension = ".ogg"; 2003 extension = ".ogg";
2055 break; 2004 break;
2056 case LLAssetType::AT_SOUND_WAV: 2005 case LLAssetType::AT_SOUND_WAV:
2057 extension = ".wav"; 2006 extension = ".wav";
2058 break; 2007 break;
2059 case LLAssetType::AT_TEXTURE_TGA: 2008 case LLAssetType::AT_TEXTURE_TGA:
2060 extension = ".tga"; 2009 extension = ".tga";
2061 break; 2010 break;
2062 case LLAssetType::AT_IMAGE_JPEG: 2011 case LLAssetType::AT_ANIMATION:
2063 extension = ".jpeg";
2064 break;
2065 case LLAssetType::AT_ANIMATION:
2066 extension = ".lla"; 2012 extension = ".lla";
2067 break; 2013 break;
2068 default: 2014 default:
2069 extension = ".data"; 2015 // Just use the asset server filename extension in most cases
2016 extension += ".";
2017 extension += LLAssetType::lookup(type);
2070 break; 2018 break;
2071 } 2019 }
2072 return extension; 2020 return extension;
@@ -2085,7 +2033,7 @@ void LLVFS::listFiles()
2085 if (length != BLOCK_LENGTH_INVALID && size > 0) 2033 if (length != BLOCK_LENGTH_INVALID && size > 0)
2086 { 2034 {
2087 LLUUID id = file_spec.mFileID; 2035 LLUUID id = file_spec.mFileID;
2088 LLString extension = get_extension(file_spec.mFileType); 2036 std::string extension = get_extension(file_spec.mFileType);
2089 llinfos << " File: " << id 2037 llinfos << " File: " << id
2090 << " Type: " << LLAssetType::getDesc(file_spec.mFileType) 2038 << " Type: " << LLAssetType::getDesc(file_spec.mFileType)
2091 << " Size: " << size 2039 << " Size: " << size
@@ -2101,6 +2049,7 @@ void LLVFS::dumpFiles()
2101{ 2049{
2102 lockData(); 2050 lockData();
2103 2051
2052 S32 files_extracted = 0;
2104 for (fileblock_map::iterator it = mFileBlocks.begin(); it != mFileBlocks.end(); ++it) 2053 for (fileblock_map::iterator it = mFileBlocks.begin(); it != mFileBlocks.end(); ++it)
2105 { 2054 {
2106 LLVFSFileSpecifier file_spec = it->first; 2055 LLVFSFileSpecifier file_spec = it->first;
@@ -2117,17 +2066,20 @@ void LLVFS::dumpFiles()
2117 getData(id, type, buffer, 0, size); 2066 getData(id, type, buffer, 0, size);
2118 lockData(); 2067 lockData();
2119 2068
2120 LLString extension = get_extension(type); 2069 std::string extension = get_extension(type);
2121 LLString filename = id.asString() + extension; 2070 std::string filename = id.asString() + extension;
2122 llinfos << " Writing " << filename << llendl; 2071 llinfos << " Writing " << filename << llendl;
2123 apr_file_t* file = ll_apr_file_open(filename, LL_APR_WB); 2072 apr_file_t* file = ll_apr_file_open(filename, LL_APR_WB);
2124 ll_apr_file_write(file, buffer, size); 2073 ll_apr_file_write(file, buffer, size);
2125 apr_file_close(file); 2074 apr_file_close(file);
2126 delete[] buffer; 2075 delete[] buffer;
2076 files_extracted++;
2127 } 2077 }
2128 } 2078 }
2129 2079
2130 unlockData(); 2080 unlockData();
2081
2082 llinfos << "Extracted " << files_extracted << " files out of " << mFileBlocks.size() << llendl;
2131} 2083}
2132 2084
2133//============================================================================ 2085//============================================================================
@@ -2135,7 +2087,7 @@ void LLVFS::dumpFiles()
2135//============================================================================ 2087//============================================================================
2136 2088
2137// static 2089// static
2138LLFILE *LLVFS::openAndLock(const char *filename, const char *mode, BOOL read_lock) 2090LLFILE *LLVFS::openAndLock(const std::string& filename, const char* mode, BOOL read_lock)
2139{ 2091{
2140#if LL_WINDOWS 2092#if LL_WINDOWS
2141 2093
@@ -2153,7 +2105,7 @@ LLFILE *LLVFS::openAndLock(const char *filename, const char *mode, BOOL read_loc
2153 fl.l_start = 0; 2105 fl.l_start = 0;
2154 fl.l_len = 1; 2106 fl.l_len = 1;
2155#else // !LL_SOLARIS 2107#else // !LL_SOLARIS
2156 if (strstr(mode, "w")) 2108 if (strchr(mode, 'w') != NULL)
2157 { 2109 {
2158 fp = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */ 2110 fp = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */
2159 if (fp) 2111 if (fp)
diff --git a/linden/indra/llvfs/llvfs.h b/linden/indra/llvfs/llvfs.h
index 7465bb4..06015b6 100644
--- a/linden/indra/llvfs/llvfs.h
+++ b/linden/indra/llvfs/llvfs.h
@@ -78,7 +78,7 @@ class LLVFS
78{ 78{
79public: 79public:
80 // Pass 0 to not presize 80 // Pass 0 to not presize
81 LLVFS(const char *index_filename, const char *data_filename, const BOOL read_only, const U32 presize, const BOOL remove_after_crash); 81 LLVFS(const std::string& index_filename, const std::string& data_filename, const BOOL read_only, const U32 presize, const BOOL remove_after_crash);
82 ~LLVFS(); 82 ~LLVFS();
83 83
84 BOOL isValid() const { return (VFSVALID_OK == mValid); } 84 BOOL isValid() const { return (VFSVALID_OK == mValid); }
@@ -131,8 +131,8 @@ protected:
131 void sync(LLVFSFileBlock *block, BOOL remove = FALSE); 131 void sync(LLVFSFileBlock *block, BOOL remove = FALSE);
132 void presizeDataFile(const U32 size); 132 void presizeDataFile(const U32 size);
133 133
134 static LLFILE *openAndLock(const char *filename, const char *mode, BOOL read_lock); 134 static LLFILE *openAndLock(const std::string& filename, const char* mode, BOOL read_lock);
135 static void unlockAndClose(LLFILE *fp); 135 static void unlockAndClose(FILE *fp);
136 136
137 // Can initiate LRU-based file removal to make space. 137 // Can initiate LRU-based file removal to make space.
138 // The immune file block will not be removed. 138 // The immune file block will not be removed.
@@ -158,8 +158,8 @@ protected:
158 158
159 std::deque<S32> mIndexHoles; 159 std::deque<S32> mIndexHoles;
160 160
161 char *mIndexFilename; 161 std::string mIndexFilename;
162 char *mDataFilename; 162 std::string mDataFilename;
163 BOOL mReadOnly; 163 BOOL mReadOnly;
164 164
165 EVFSValid mValid; 165 EVFSValid mValid;
diff --git a/linden/indra/llvfs/llvfs.vcproj b/linden/indra/llvfs/llvfs.vcproj
deleted file mode 100644
index 85f5617..0000000
--- a/linden/indra/llvfs/llvfs.vcproj
+++ /dev/null
@@ -1,203 +0,0 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="7.10"
5 Name="llvfs"
6 ProjectGUID="{D37774F4-253D-4760-BF64-372A943224A1}"
7 Keyword="Win32Proj">
8 <Platforms>
9 <Platform
10 Name="Win32"/>
11 </Platforms>
12 <Configurations>
13 <Configuration
14 Name="Debug|Win32"
15 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
16 IntermediateDirectory="Debug"
17 ConfigurationType="4"
18 CharacterSet="1">
19 <Tool
20 Name="VCCLCompilerTool"
21 Optimization="0"
22 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\;..\llcommon;..\llmath"
23 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;LL_DEBUG"
24 MinimalRebuild="TRUE"
25 BasicRuntimeChecks="3"
26 RuntimeLibrary="1"
27 StructMemberAlignment="4"
28 ForceConformanceInForLoopScope="TRUE"
29 UsePrecompiledHeader="0"
30 WarningLevel="3"
31 WarnAsError="TRUE"
32 Detect64BitPortabilityProblems="FALSE"
33 DebugInformationFormat="4"/>
34 <Tool
35 Name="VCCustomBuildTool"/>
36 <Tool
37 Name="VCLibrarianTool"
38 OutputFile="$(OutDir)/llvfs.lib"/>
39 <Tool
40 Name="VCMIDLTool"/>
41 <Tool
42 Name="VCPostBuildEventTool"/>
43 <Tool
44 Name="VCPreBuildEventTool"/>
45 <Tool
46 Name="VCPreLinkEventTool"/>
47 <Tool
48 Name="VCResourceCompilerTool"/>
49 <Tool
50 Name="VCWebServiceProxyGeneratorTool"/>
51 <Tool
52 Name="VCXMLDataGeneratorTool"/>
53 <Tool
54 Name="VCManagedWrapperGeneratorTool"/>
55 <Tool
56 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
57 </Configuration>
58 <Configuration
59 Name="Release|Win32"
60 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
61 IntermediateDirectory="Release"
62 ConfigurationType="4"
63 CharacterSet="1">
64 <Tool
65 Name="VCCLCompilerTool"
66 AdditionalOptions="/Oy-"
67 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\;..\llcommon;..\llmath"
68 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE"
69 RuntimeLibrary="0"
70 StructMemberAlignment="0"
71 ForceConformanceInForLoopScope="TRUE"
72 UsePrecompiledHeader="0"
73 WarningLevel="3"
74 WarnAsError="TRUE"
75 Detect64BitPortabilityProblems="FALSE"
76 DebugInformationFormat="3"/>
77 <Tool
78 Name="VCCustomBuildTool"/>
79 <Tool
80 Name="VCLibrarianTool"
81 OutputFile="$(OutDir)/llvfs.lib"/>
82 <Tool
83 Name="VCMIDLTool"/>
84 <Tool
85 Name="VCPostBuildEventTool"/>
86 <Tool
87 Name="VCPreBuildEventTool"/>
88 <Tool
89 Name="VCPreLinkEventTool"/>
90 <Tool
91 Name="VCResourceCompilerTool"/>
92 <Tool
93 Name="VCWebServiceProxyGeneratorTool"/>
94 <Tool
95 Name="VCXMLDataGeneratorTool"/>
96 <Tool
97 Name="VCManagedWrapperGeneratorTool"/>
98 <Tool
99 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
100 </Configuration>
101 <Configuration
102 Name="ReleaseNoOpt|Win32"
103 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
104 IntermediateDirectory="$(ConfigurationName)"
105 ConfigurationType="4"
106 CharacterSet="1">
107 <Tool
108 Name="VCCLCompilerTool"
109 AdditionalOptions="/Oy-"
110 Optimization="0"
111 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\;..\llcommon;..\llmath"
112 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE"
113 RuntimeLibrary="0"
114 StructMemberAlignment="0"
115 ForceConformanceInForLoopScope="TRUE"
116 UsePrecompiledHeader="0"
117 WarningLevel="3"
118 WarnAsError="TRUE"
119 Detect64BitPortabilityProblems="FALSE"
120 DebugInformationFormat="3"/>
121 <Tool
122 Name="VCCustomBuildTool"/>
123 <Tool
124 Name="VCLibrarianTool"
125 OutputFile="$(OutDir)/llvfs.lib"/>
126 <Tool
127 Name="VCMIDLTool"/>
128 <Tool
129 Name="VCPostBuildEventTool"/>
130 <Tool
131 Name="VCPreBuildEventTool"/>
132 <Tool
133 Name="VCPreLinkEventTool"/>
134 <Tool
135 Name="VCResourceCompilerTool"/>
136 <Tool
137 Name="VCWebServiceProxyGeneratorTool"/>
138 <Tool
139 Name="VCXMLDataGeneratorTool"/>
140 <Tool
141 Name="VCManagedWrapperGeneratorTool"/>
142 <Tool
143 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
144 </Configuration>
145 </Configurations>
146 <References>
147 </References>
148 <Files>
149 <Filter
150 Name="Source Files"
151 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
152 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
153 <File
154 RelativePath=".\lldir.cpp">
155 </File>
156 <File
157 RelativePath=".\lldir_win32.cpp">
158 </File>
159 <File
160 RelativePath=".\lllfsthread.cpp">
161 </File>
162 <File
163 RelativePath=".\llvfile.cpp">
164 </File>
165 <File
166 RelativePath=".\llvfs.cpp">
167 </File>
168 <File
169 RelativePath=".\llvfsthread.cpp">
170 </File>
171 </Filter>
172 <Filter
173 Name="Header Files"
174 Filter="h;hpp;hxx;hm;inl;inc;xsd"
175 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
176 <File
177 RelativePath=".\lldir.h">
178 </File>
179 <File
180 RelativePath=".\lldir_win32.h">
181 </File>
182 <File
183 RelativePath=".\lllfsthread.h">
184 </File>
185 <File
186 RelativePath=".\llvfile.h">
187 </File>
188 <File
189 RelativePath=".\llvfs.h">
190 </File>
191 <File
192 RelativePath=".\llvfsthread.h">
193 </File>
194 </Filter>
195 <Filter
196 Name="Resource Files"
197 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
198 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
199 </Filter>
200 </Files>
201 <Globals>
202 </Globals>
203</VisualStudioProject>
diff --git a/linden/indra/llvfs/llvfs_vc8.vcproj b/linden/indra/llvfs/llvfs_vc8.vcproj
deleted file mode 100644
index 20ed299..0000000
--- a/linden/indra/llvfs/llvfs_vc8.vcproj
+++ /dev/null
@@ -1,295 +0,0 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="llvfs"
6 ProjectGUID="{D37774F4-253D-4760-BF64-372A943224A1}"
7 RootNamespace="llvfs"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
21 IntermediateDirectory="Debug"
22 ConfigurationType="4"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="1"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\;..\llcommon;..\llmath"
45 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
46 MinimalRebuild="true"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="1"
49 StructMemberAlignment="4"
50 TreatWChar_tAsBuiltInType="false"
51 ForceConformanceInForLoopScope="true"
52 UsePrecompiledHeader="0"
53 WarningLevel="3"
54 WarnAsError="true"
55 Detect64BitPortabilityProblems="false"
56 DebugInformationFormat="4"
57 />
58 <Tool
59 Name="VCManagedResourceCompilerTool"
60 />
61 <Tool
62 Name="VCResourceCompilerTool"
63 />
64 <Tool
65 Name="VCPreLinkEventTool"
66 />
67 <Tool
68 Name="VCLibrarianTool"
69 OutputFile="$(OutDir)/llvfs.lib"
70 />
71 <Tool
72 Name="VCALinkTool"
73 />
74 <Tool
75 Name="VCXDCMakeTool"
76 />
77 <Tool
78 Name="VCBscMakeTool"
79 />
80 <Tool
81 Name="VCFxCopTool"
82 />
83 <Tool
84 Name="VCPostBuildEventTool"
85 />
86 </Configuration>
87 <Configuration
88 Name="Release|Win32"
89 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
90 IntermediateDirectory="Release"
91 ConfigurationType="4"
92 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
93 CharacterSet="1"
94 >
95 <Tool
96 Name="VCPreBuildEventTool"
97 />
98 <Tool
99 Name="VCCustomBuildTool"
100 />
101 <Tool
102 Name="VCXMLDataGeneratorTool"
103 />
104 <Tool
105 Name="VCWebServiceProxyGeneratorTool"
106 />
107 <Tool
108 Name="VCMIDLTool"
109 />
110 <Tool
111 Name="VCCLCompilerTool"
112 AdditionalOptions="/Oy-"
113 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\;..\llcommon;..\llmath"
114 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
115 RuntimeLibrary="0"
116 StructMemberAlignment="0"
117 TreatWChar_tAsBuiltInType="false"
118 ForceConformanceInForLoopScope="true"
119 UsePrecompiledHeader="0"
120 WarningLevel="3"
121 WarnAsError="true"
122 Detect64BitPortabilityProblems="false"
123 DebugInformationFormat="3"
124 />
125 <Tool
126 Name="VCManagedResourceCompilerTool"
127 />
128 <Tool
129 Name="VCResourceCompilerTool"
130 />
131 <Tool
132 Name="VCPreLinkEventTool"
133 />
134 <Tool
135 Name="VCLibrarianTool"
136 OutputFile="$(OutDir)/llvfs.lib"
137 />
138 <Tool
139 Name="VCALinkTool"
140 />
141 <Tool
142 Name="VCXDCMakeTool"
143 />
144 <Tool
145 Name="VCBscMakeTool"
146 />
147 <Tool
148 Name="VCFxCopTool"
149 />
150 <Tool
151 Name="VCPostBuildEventTool"
152 />
153 </Configuration>
154 <Configuration
155 Name="ReleaseNoOpt|Win32"
156 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
157 IntermediateDirectory="$(ConfigurationName)"
158 ConfigurationType="4"
159 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
160 CharacterSet="1"
161 >
162 <Tool
163 Name="VCPreBuildEventTool"
164 />
165 <Tool
166 Name="VCCustomBuildTool"
167 />
168 <Tool
169 Name="VCXMLDataGeneratorTool"
170 />
171 <Tool
172 Name="VCWebServiceProxyGeneratorTool"
173 />
174 <Tool
175 Name="VCMIDLTool"
176 />
177 <Tool
178 Name="VCCLCompilerTool"
179 AdditionalOptions="/Oy-"
180 Optimization="0"
181 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\;..\llcommon;..\llmath"
182 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
183 RuntimeLibrary="0"
184 StructMemberAlignment="0"
185 TreatWChar_tAsBuiltInType="false"
186 ForceConformanceInForLoopScope="true"
187 UsePrecompiledHeader="0"
188 WarningLevel="3"
189 WarnAsError="true"
190 Detect64BitPortabilityProblems="false"
191 DebugInformationFormat="3"
192 />
193 <Tool
194 Name="VCManagedResourceCompilerTool"
195 />
196 <Tool
197 Name="VCResourceCompilerTool"
198 />
199 <Tool
200 Name="VCPreLinkEventTool"
201 />
202 <Tool
203 Name="VCLibrarianTool"
204 OutputFile="$(OutDir)/llvfs.lib"
205 />
206 <Tool
207 Name="VCALinkTool"
208 />
209 <Tool
210 Name="VCXDCMakeTool"
211 />
212 <Tool
213 Name="VCBscMakeTool"
214 />
215 <Tool
216 Name="VCFxCopTool"
217 />
218 <Tool
219 Name="VCPostBuildEventTool"
220 />
221 </Configuration>
222 </Configurations>
223 <References>
224 </References>
225 <Files>
226 <Filter
227 Name="Source Files"
228 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
229 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
230 >
231 <File
232 RelativePath=".\lldir.cpp"
233 >
234 </File>
235 <File
236 RelativePath=".\lldir_win32.cpp"
237 >
238 </File>
239 <File
240 RelativePath=".\lllfsthread.cpp"
241 >
242 </File>
243 <File
244 RelativePath=".\llvfile.cpp"
245 >
246 </File>
247 <File
248 RelativePath=".\llvfs.cpp"
249 >
250 </File>
251 <File
252 RelativePath=".\llvfsthread.cpp"
253 >
254 </File>
255 </Filter>
256 <Filter
257 Name="Header Files"
258 Filter="h;hpp;hxx;hm;inl;inc;xsd"
259 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
260 >
261 <File
262 RelativePath=".\lldir.h"
263 >
264 </File>
265 <File
266 RelativePath=".\lldir_win32.h"
267 >
268 </File>
269 <File
270 RelativePath=".\lllfsthread.h"
271 >
272 </File>
273 <File
274 RelativePath=".\llvfile.h"
275 >
276 </File>
277 <File
278 RelativePath=".\llvfs.h"
279 >
280 </File>
281 <File
282 RelativePath=".\llvfsthread.h"
283 >
284 </File>
285 </Filter>
286 <Filter
287 Name="Resource Files"
288 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
289 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
290 >
291 </Filter>
292 </Files>
293 <Globals>
294 </Globals>
295</VisualStudioProject>
diff --git a/linden/indra/llvfs/llvfs_vc9.vcproj b/linden/indra/llvfs/llvfs_vc9.vcproj
deleted file mode 100644
index 97045e2..0000000
--- a/linden/indra/llvfs/llvfs_vc9.vcproj
+++ /dev/null
@@ -1,296 +0,0 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="9.00"
5 Name="llvfs"
6 ProjectGUID="{D37774F4-253D-4760-BF64-372A943224A1}"
7 RootNamespace="llvfs"
8 Keyword="Win32Proj"
9 TargetFrameworkVersion="131072"
10 >
11 <Platforms>
12 <Platform
13 Name="Win32"
14 />
15 </Platforms>
16 <ToolFiles>
17 </ToolFiles>
18 <Configurations>
19 <Configuration
20 Name="Debug|Win32"
21 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
22 IntermediateDirectory="Debug"
23 ConfigurationType="4"
24 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
25 CharacterSet="1"
26 >
27 <Tool
28 Name="VCPreBuildEventTool"
29 />
30 <Tool
31 Name="VCCustomBuildTool"
32 />
33 <Tool
34 Name="VCXMLDataGeneratorTool"
35 />
36 <Tool
37 Name="VCWebServiceProxyGeneratorTool"
38 />
39 <Tool
40 Name="VCMIDLTool"
41 />
42 <Tool
43 Name="VCCLCompilerTool"
44 Optimization="0"
45 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\;..\llcommon;..\llmath"
46 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
47 MinimalRebuild="true"
48 BasicRuntimeChecks="3"
49 RuntimeLibrary="1"
50 StructMemberAlignment="4"
51 TreatWChar_tAsBuiltInType="false"
52 ForceConformanceInForLoopScope="true"
53 UsePrecompiledHeader="0"
54 WarningLevel="3"
55 WarnAsError="true"
56 Detect64BitPortabilityProblems="false"
57 DebugInformationFormat="4"
58 />
59 <Tool
60 Name="VCManagedResourceCompilerTool"
61 />
62 <Tool
63 Name="VCResourceCompilerTool"
64 />
65 <Tool
66 Name="VCPreLinkEventTool"
67 />
68 <Tool
69 Name="VCLibrarianTool"
70 OutputFile="$(OutDir)/llvfs.lib"
71 />
72 <Tool
73 Name="VCALinkTool"
74 />
75 <Tool
76 Name="VCXDCMakeTool"
77 />
78 <Tool
79 Name="VCBscMakeTool"
80 />
81 <Tool
82 Name="VCFxCopTool"
83 />
84 <Tool
85 Name="VCPostBuildEventTool"
86 />
87 </Configuration>
88 <Configuration
89 Name="Release|Win32"
90 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
91 IntermediateDirectory="Release"
92 ConfigurationType="4"
93 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
94 CharacterSet="1"
95 >
96 <Tool
97 Name="VCPreBuildEventTool"
98 />
99 <Tool
100 Name="VCCustomBuildTool"
101 />
102 <Tool
103 Name="VCXMLDataGeneratorTool"
104 />
105 <Tool
106 Name="VCWebServiceProxyGeneratorTool"
107 />
108 <Tool
109 Name="VCMIDLTool"
110 />
111 <Tool
112 Name="VCCLCompilerTool"
113 AdditionalOptions="/Oy-"
114 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\;..\llcommon;..\llmath"
115 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
116 RuntimeLibrary="0"
117 StructMemberAlignment="0"
118 TreatWChar_tAsBuiltInType="false"
119 ForceConformanceInForLoopScope="true"
120 UsePrecompiledHeader="0"
121 WarningLevel="3"
122 WarnAsError="true"
123 Detect64BitPortabilityProblems="false"
124 DebugInformationFormat="3"
125 />
126 <Tool
127 Name="VCManagedResourceCompilerTool"
128 />
129 <Tool
130 Name="VCResourceCompilerTool"
131 />
132 <Tool
133 Name="VCPreLinkEventTool"
134 />
135 <Tool
136 Name="VCLibrarianTool"
137 OutputFile="$(OutDir)/llvfs.lib"
138 />
139 <Tool
140 Name="VCALinkTool"
141 />
142 <Tool
143 Name="VCXDCMakeTool"
144 />
145 <Tool
146 Name="VCBscMakeTool"
147 />
148 <Tool
149 Name="VCFxCopTool"
150 />
151 <Tool
152 Name="VCPostBuildEventTool"
153 />
154 </Configuration>
155 <Configuration
156 Name="ReleaseNoOpt|Win32"
157 OutputDirectory="../lib_$(ConfigurationName)/i686-win32"
158 IntermediateDirectory="$(ConfigurationName)"
159 ConfigurationType="4"
160 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
161 CharacterSet="1"
162 >
163 <Tool
164 Name="VCPreBuildEventTool"
165 />
166 <Tool
167 Name="VCCustomBuildTool"
168 />
169 <Tool
170 Name="VCXMLDataGeneratorTool"
171 />
172 <Tool
173 Name="VCWebServiceProxyGeneratorTool"
174 />
175 <Tool
176 Name="VCMIDLTool"
177 />
178 <Tool
179 Name="VCCLCompilerTool"
180 AdditionalOptions="/Oy-"
181 Optimization="0"
182 AdditionalIncludeDirectories="..\..\libraries\i686-win32\include;..\..\libraries\include\;..\llcommon;..\llmath"
183 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
184 RuntimeLibrary="0"
185 StructMemberAlignment="0"
186 TreatWChar_tAsBuiltInType="false"
187 ForceConformanceInForLoopScope="true"
188 UsePrecompiledHeader="0"
189 WarningLevel="3"
190 WarnAsError="true"
191 Detect64BitPortabilityProblems="false"
192 DebugInformationFormat="3"
193 />
194 <Tool
195 Name="VCManagedResourceCompilerTool"
196 />
197 <Tool
198 Name="VCResourceCompilerTool"
199 />
200 <Tool
201 Name="VCPreLinkEventTool"
202 />
203 <Tool
204 Name="VCLibrarianTool"
205 OutputFile="$(OutDir)/llvfs.lib"
206 />
207 <Tool
208 Name="VCALinkTool"
209 />
210 <Tool
211 Name="VCXDCMakeTool"
212 />
213 <Tool
214 Name="VCBscMakeTool"
215 />
216 <Tool
217 Name="VCFxCopTool"
218 />
219 <Tool
220 Name="VCPostBuildEventTool"
221 />
222 </Configuration>
223 </Configurations>
224 <References>
225 </References>
226 <Files>
227 <Filter
228 Name="Source Files"
229 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
230 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
231 >
232 <File
233 RelativePath=".\lldir.cpp"
234 >
235 </File>
236 <File
237 RelativePath=".\lldir_win32.cpp"
238 >
239 </File>
240 <File
241 RelativePath=".\lllfsthread.cpp"
242 >
243 </File>
244 <File
245 RelativePath=".\llvfile.cpp"
246 >
247 </File>
248 <File
249 RelativePath=".\llvfs.cpp"
250 >
251 </File>
252 <File
253 RelativePath=".\llvfsthread.cpp"
254 >
255 </File>
256 </Filter>
257 <Filter
258 Name="Header Files"
259 Filter="h;hpp;hxx;hm;inl;inc;xsd"
260 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
261 >
262 <File
263 RelativePath=".\lldir.h"
264 >
265 </File>
266 <File
267 RelativePath=".\lldir_win32.h"
268 >
269 </File>
270 <File
271 RelativePath=".\lllfsthread.h"
272 >
273 </File>
274 <File
275 RelativePath=".\llvfile.h"
276 >
277 </File>
278 <File
279 RelativePath=".\llvfs.h"
280 >
281 </File>
282 <File
283 RelativePath=".\llvfsthread.h"
284 >
285 </File>
286 </Filter>
287 <Filter
288 Name="Resource Files"
289 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
290 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
291 >
292 </Filter>
293 </Files>
294 <Globals>
295 </Globals>
296</VisualStudioProject>
diff --git a/linden/indra/llvfs/llvfsthread.cpp b/linden/indra/llvfs/llvfsthread.cpp
index 92bf3dd..ff27475 100644
--- a/linden/indra/llvfs/llvfsthread.cpp
+++ b/linden/indra/llvfs/llvfsthread.cpp
@@ -30,7 +30,6 @@
30 */ 30 */
31 31
32#include "linden_common.h" 32#include "linden_common.h"
33#include "llmath.h"
34#include "llvfsthread.h" 33#include "llvfsthread.h"
35#include "llstl.h" 34#include "llstl.h"
36 35
diff --git a/linden/indra/llvfs/llvfsthread.h b/linden/indra/llvfs/llvfsthread.h
index 0dc818a..5f1c6ac 100644
--- a/linden/indra/llvfs/llvfsthread.h
+++ b/linden/indra/llvfs/llvfsthread.h
@@ -87,9 +87,9 @@ public:
87 } 87 }
88 std::string getFilename() 88 std::string getFilename()
89 { 89 {
90 char tbuf[40]; /* Flawfinder: ignore */ 90 std::string tstring;
91 mFileID.toString(tbuf); 91 mFileID.toString(tstring);
92 return std::string(tbuf); 92 return tstring;
93 } 93 }
94 94
95 /*virtual*/ bool processRequest(); 95 /*virtual*/ bool processRequest();