Remove B_COMMON*_DIRECTORY and kCommon*Directory constants

* This does intentionally break source compatibility, so that a review
  of concerned code is forced.
* Binary compatibility should be maintained in most cases. The values
  of the constants for the writable directories are now used for the
  writable system directories. The values for the non-writable
  directories are mapped to "/boot/system/data/empty/...", an empty or
  non-existent directory, so that they will simply be skipped in search
  paths. Only code that explicitly expects to find something in a
  B_COMMON_* directory, will fail.
This commit is contained in:
Ingo Weinhold 2013-10-04 02:30:30 +02:00
parent 8f83a0f831
commit 38fa81bf8f
40 changed files with 211 additions and 288 deletions

View File

@ -33,32 +33,15 @@ typedef enum {
B_SYSTEM_PACKAGES_DIRECTORY,
B_SYSTEM_HEADERS_DIRECTORY,
/* Common directories, shared among all users. */
B_COMMON_DIRECTORY = 2000,
B_COMMON_SYSTEM_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_COMMON_BOOT_DIRECTORY,
B_COMMON_FONTS_DIRECTORY,
B_COMMON_LIB_DIRECTORY,
B_COMMON_SERVERS_DIRECTORY,
B_COMMON_BIN_DIRECTORY,
B_SYSTEM_ETC_DIRECTORY,
B_COMMON_DOCUMENTATION_DIRECTORY,
B_SYSTEM_SETTINGS_DIRECTORY,
B_COMMON_DEVELOP_DIRECTORY,
B_SYSTEM_LOG_DIRECTORY,
B_SYSTEM_ETC_DIRECTORY = 2008,
B_SYSTEM_SETTINGS_DIRECTORY = 2010,
B_SYSTEM_LOG_DIRECTORY = 2012,
B_SYSTEM_SPOOL_DIRECTORY,
B_SYSTEM_TEMP_DIRECTORY,
B_SYSTEM_VAR_DIRECTORY,
B_COMMON_TRANSLATORS_DIRECTORY,
B_COMMON_MEDIA_NODES_DIRECTORY,
B_COMMON_SOUNDS_DIRECTORY,
B_COMMON_DATA_DIRECTORY,
B_SYSTEM_CACHE_DIRECTORY,
B_COMMON_PACKAGES_DIRECTORY,
B_COMMON_HEADERS_DIRECTORY,
B_SYSTEM_CACHE_DIRECTORY = 2020,
B_SYSTEM_NONPACKAGED_DIRECTORY,
B_SYSTEM_NONPACKAGED_DIRECTORY = 2023,
B_SYSTEM_NONPACKAGED_ADDONS_DIRECTORY,
B_SYSTEM_NONPACKAGED_TRANSLATORS_DIRECTORY,
B_SYSTEM_NONPACKAGED_MEDIA_NODES_DIRECTORY,

View File

@ -39,20 +39,13 @@
#define kSystemPreferencesDirectory "/boot/system/preferences"
#define kSystemServersDirectory "/boot/system/servers"
#define kCommonDirectory "/boot/system"
#define kCommonAddonsDirectory "/boot/system/add-ons"
#define kCommonBinDirectory "/boot/system/bin"
#define kCommonDevelopToolsBinDirectory "/boot/system/develop/tools/current/bin"
#define kCommonEtcDirectory "/boot/system/settings/etc"
#define kCommonLibDirectory "/boot/system/lib"
#define kCommonPackagesDirectory "/boot/system/packages"
#define kCommonSettingsDirectory "/boot/system/settings"
#define kCommonTempDirectory "/boot/system/cache/tmp"
#define kCommonVarDirectory "/boot/system/var"
#define kCommonLogDirectory "/boot/system/var/log"
#define kCommonNonpackagedAddonsDirectory "/boot/system/non-packaged/add-ons"
#define kCommonNonpackagedBinDirectory "/boot/system/non-packaged/bin"
#define kCommonNonpackagedLibDirectory "/boot/system/non-packaged/lib"
#define kSystemEtcDirectory "/boot/system/settings/etc"
#define kSystemTempDirectory "/boot/system/cache/tmp"
#define kSystemVarDirectory "/boot/system/var"
#define kSystemLogDirectory "/boot/system/var/log"
#define kSystemNonpackagedAddonsDirectory "/boot/system/non-packaged/add-ons"
#define kSystemNonpackagedBinDirectory "/boot/system/non-packaged/bin"
#define kSystemNonpackagedLibDirectory "/boot/system/non-packaged/lib"
#define kUserDirectory "/boot/home"
#define kUserConfigDirectory "/boot/home/config"

View File

@ -260,17 +260,28 @@ KeyCommandMap::MessageReceived(BMessage* msg)
BString command;
if (msg.FindString("command", &command) == B_OK) {
BPath path;
if (find_directory(B_SYSTEM_ADDONS_DIRECTORY, &path) == B_OK) {
if (find_directory(B_SYSTEM_ADDONS_DIRECTORY, &path)
== B_OK) {
path.Append("Tracker/");
if (command.FindFirst(path.Path()) != B_ERROR)
continue;
}
if (find_directory(B_COMMON_ADDONS_DIRECTORY, &path) == B_OK) {
if (find_directory(
B_SYSTEM_NONPACKAGED_ADDONS_DIRECTORY,
&path) == B_OK) {
path.Append("Tracker/");
if (command.FindFirst(path.Path()) != B_ERROR)
continue;
}
if (find_directory(B_USER_ADDONS_DIRECTORY, &path) == B_OK) {
if (find_directory(B_USER_ADDONS_DIRECTORY, &path)
== B_OK) {
path.Append("Tracker/");
if (command.FindFirst(path.Path()) != B_ERROR)
continue;
}
if (find_directory(
B_USER_NONPACKAGED_ADDONS_DIRECTORY, &path)
== B_OK) {
path.Append("Tracker/");
if (command.FindFirst(path.Path()) != B_ERROR)
continue;

View File

@ -44,7 +44,7 @@
#if DEBUG > 0
static const char *logfile = kCommonLogDirectory "/auich.log";
static const char *logfile = kSystemLogDirectory "/auich.log";
static sem_id loglock;
#endif

View File

@ -44,7 +44,7 @@
#if DEBUG > 0
static const char *logfile = kCommonLogDirectory "/auvia.log";
static const char *logfile = kSystemLogDirectory "/auvia.log";
static sem_id loglock;
#endif

View File

@ -25,7 +25,7 @@
#if DEBUG > 0
static const char *logfile = kCommonLogDirectory "/es1370.log";
static const char *logfile = kSystemLogDirectory "/es1370.log";
static sem_id loglock;
#endif

View File

@ -54,7 +54,7 @@ void debug_printf(const char *text,...)
#if DEBUG > 0
static const char *logfile = kCommonLogDirectory "/ich_ac97.log";
static const char *logfile = kSystemLogDirectory "/ich_ac97.log";
static sem_id loglock;

View File

@ -43,7 +43,7 @@
#if DEBUG > 0
static const char *logfile = kCommonLogDirectory "/" DRIVER_NAME ".log";
static const char *logfile = kSystemLogDirectory "/" DRIVER_NAME ".log";
static sem_id loglock;
#endif

View File

@ -44,7 +44,7 @@
#if DEBUG > 0
static const char *logfile = kCommonLogDirectory "/emuxki.log";
static const char *logfile = kSystemLogDirectory "/emuxki.log";
static sem_id loglock;
#endif

View File

@ -64,7 +64,7 @@ bug(const char *format, ...)
int i;
int file;
if ((file = open(kCommonLogDirectory "/sis900-driver.log",
if ((file = open(kSystemLogDirectory "/sis900-driver.log",
O_RDWR | O_APPEND | O_CREAT)) >= 0) {
// time_t timer = time(NULL);
// strftime(c, 2048, "%H:%M:S: ", localtime(&timer));

View File

@ -27,7 +27,7 @@ bool gLogFunctionCalls = false;
bool gLogFunctionReturns = false;
bool gLogFunctionResults = false;
static const char *sLogFilePath = kCommonLogDirectory "/" DRIVER_NAME ".log";
static const char *sLogFilePath = kSystemLogDirectory "/" DRIVER_NAME ".log";
static sem_id sLogLock;

View File

@ -28,7 +28,7 @@ bool gLogFunctionCalls = true;
bool gLogFunctionReturns = true;
bool gLogFunctionResults = true;
static const char *sLogFilePath = kCommonLogDirectory "/" DRIVER_NAME ".log";
static const char *sLogFilePath = kSystemLogDirectory "/" DRIVER_NAME ".log";
static sem_id sLogLock;

View File

@ -32,7 +32,7 @@ bool b_log_funcres = false;
bool b_log_settings_loaded = false;
static const char *private_log_path
= kCommonLogDirectory "/" DRIVER_NAME ".log";
= kSystemLogDirectory "/" DRIVER_NAME ".log";
static sem_id loglock;
void load_setting(void){

View File

@ -58,7 +58,7 @@ void debug_printf(const char *text,...)
#if DEBUG > 0
static const char *logfile = kCommonLogDirectory "/mpu401.log";
static const char *logfile = kSystemLogDirectory "/mpu401.log";
static sem_id loglock;

View File

@ -287,7 +287,9 @@ AGMSBayesianSpamFilter::_CheckForSpamServer()
BPath path;
entry_ref ref;
directory_which places[] = {B_COMMON_BIN_DIRECTORY,B_BEOS_BIN_DIRECTORY};
directory_which places[] = {
B_SYSTEM_NONPACKAGED_BIN_DIRECTORY,
B_SYSTEM_BIN_DIRECTORY};
for (int32 i = 0; i < 2; i++) {
find_directory(places[i],&path);
path.Append("spamdbm");

View File

@ -386,7 +386,10 @@ AGMSBayesianSpamFilterConfig::ShowSpamServerConfigurationWindow () {
if (errorCode != B_OK) {
BPath path;
entry_ref ref;
directory_which places[] = {B_COMMON_BIN_DIRECTORY,B_BEOS_BIN_DIRECTORY};
directory_which places[] = {
B_SYSTEM_NONPACKAGED_BIN_DIRECTORY,
B_SYSTEM_BIN_DIRECTORY
};
for (int32 i = 0; i < 2; i++) {
find_directory(places[i],&path);
path.Append("spamdbm");

View File

@ -25,7 +25,7 @@ VSTAddOn::VSTAddOn(image_id image)
BPath addons_dir;
fPluginsList.MakeEmpty();
find_directory(B_COMMON_ADDONS_DIRECTORY, &addons_dir);
find_directory(B_USER_NONPACKAGED_ADDONS_DIRECTORY, &addons_dir);
addons_dir.Append(vst_subdir);
ScanPluginsFolders(addons_dir.Path(), true);
@ -33,7 +33,11 @@ VSTAddOn::VSTAddOn(image_id image)
addons_dir.Append(vst_subdir);
ScanPluginsFolders(addons_dir.Path() ,true);
find_directory(B_BEOS_ADDONS_DIRECTORY, &addons_dir);
find_directory(B_SYSTEM_NONPACKAGED_ADDONS_DIRECTORY, &addons_dir);
addons_dir.Append(vst_subdir);
ScanPluginsFolders(addons_dir.Path());
find_directory(B_SYSTEM_ADDONS_DIRECTORY, &addons_dir);
addons_dir.Append(vst_subdir);
ScanPluginsFolders(addons_dir.Path());
}

View File

@ -212,9 +212,10 @@ Fonts::CollectFonts()
BPath path;
directory_which * which_dir;
directory_which lookup_dirs[] = {
B_BEOS_FONTS_DIRECTORY,
// B_COMMON_FONTS_DIRECTORY, // seem to be the same directory than B_USER_FONTS_DIRECTORY!!!
B_SYSTEM_FONTS_DIRECTORY,
B_SYSTEM_NONPACKAGED_FONTS_DIRECTORY,
B_USER_FONTS_DIRECTORY,
B_USER_NONPACKAGED_FONTS_DIRECTORY,
(directory_which) -1
};

View File

@ -1723,8 +1723,9 @@ status_t
AboutView::_GetLicensePath(const char* license, BPath& path)
{
static const directory_which directoryConstants[] = {
B_USER_NONPACKAGED_DATA_DIRECTORY,
B_USER_DATA_DIRECTORY,
B_COMMON_DATA_DIRECTORY,
B_SYSTEM_NONPACKAGED_DATA_DIRECTORY,
B_SYSTEM_DATA_DIRECTORY
};
static const int dirCount = 3;

View File

@ -2748,8 +2748,12 @@ status_t
DwarfFile::_GetDebugInfoPath(const char* debugFileName,
BString& _infoPath) const
{
const directory_which dirLocations[] = { B_USER_CONFIG_DIRECTORY,
B_COMMON_DIRECTORY, B_SYSTEM_DIRECTORY };
const directory_which dirLocations[] = {
B_USER_NONPACKAGED_DEVELOP_DIRECTORY,
B_USER_DEVELOP_DIRECTORY,
B_SYSTEM_NONPACKAGED_DEVELOP_DIRECTORY,
B_SYSTEM_DEVELOP_DIRECTORY
};
// first, see if we have a relative match to our local directory
BPath basePath;
@ -2780,7 +2784,7 @@ DwarfFile::_GetDebugInfoPath(const char* debugFileName,
return result;
if (strncmp(fName, basePath.Path(), strlen(basePath.Path())) == 0) {
_infoPath.SetToFormat("%s/develop/debug/%s", basePath.Path(),
_infoPath.SetToFormat("%s/debug/%s", basePath.Path(),
debugFileName);
entry.SetTo(_infoPath.String());
result = entry.InitCheck();

View File

@ -2693,7 +2693,7 @@ TMailWindow::TrainMessageAs(const char *CommandWord)
BPath path;
entry_ref ref;
directory_which places[]
= {B_COMMON_BIN_DIRECTORY, B_BEOS_BIN_DIRECTORY};
= {B_SYSTEM_NONPACKAGED_BIN_DIRECTORY, B_SYSTEM_BIN_DIRECTORY};
for (int32 i = 0; i < 2; i++) {
find_directory(places[i],&path);
path.Append("spamdbm");

View File

@ -51,30 +51,14 @@ directoryType directoryTypes[] = {
KEYVALUE_PAIR(B_SYSTEM_PACKAGES_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_HEADERS_DIRECTORY),
// Common directories
KEYVALUE_PAIR(B_COMMON_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_SYSTEM_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_ADDONS_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_BOOT_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_FONTS_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_LIB_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_SERVERS_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_BIN_DIRECTORY),
// Writable system directories
KEYVALUE_PAIR(B_SYSTEM_ETC_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_DOCUMENTATION_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_SETTINGS_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_DEVELOP_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_LOG_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_SPOOL_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_TEMP_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_VAR_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_TRANSLATORS_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_MEDIA_NODES_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_SOUNDS_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_DATA_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_CACHE_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_PACKAGES_DIRECTORY),
KEYVALUE_PAIR(B_COMMON_HEADERS_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_NONPACKAGED_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_NONPACKAGED_ADDONS_DIRECTORY),
KEYVALUE_PAIR(B_SYSTEM_NONPACKAGED_TRANSLATORS_DIRECTORY),

View File

@ -90,8 +90,9 @@ DefaultCatalog::DefaultCatalog(const entry_ref &catalogOwner, const char *langua
// search in data folders
directory_which which[] = {
B_USER_NONPACKAGED_DATA_DIRECTORY,
B_USER_DATA_DIRECTORY,
B_COMMON_DATA_DIRECTORY,
B_SYSTEM_NONPACKAGED_DATA_DIRECTORY,
B_SYSTEM_DATA_DIRECTORY
};
@ -581,8 +582,9 @@ default_catalog_get_available_languages(BMessage* availableLanguages,
// search in data folders
directory_which which[] = {
B_USER_NONPACKAGED_DATA_DIRECTORY,
B_USER_DATA_DIRECTORY,
B_COMMON_DATA_DIRECTORY,
B_SYSTEM_NONPACKAGED_DATA_DIRECTORY,
B_SYSTEM_DATA_DIRECTORY
};

View File

@ -330,8 +330,9 @@ LocaleRosterData::_InitializeCatalogAddOns()
fCatalogAddOnInfos.AddItem((void*)defaultCatalogAddOnInfo);
directory_which folders[] = {
B_USER_NONPACKAGED_ADDONS_DIRECTORY,
B_USER_ADDONS_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_SYSTEM_NONPACKAGED_ADDONS_DIRECTORY,
B_SYSTEM_ADDONS_DIRECTORY,
};
BPath addOnPath;

View File

@ -159,7 +159,7 @@ sv_rewind(struct irs_sv *sv)
}
char path[PATH_MAX];
if (find_directory(B_COMMON_DATA_DIRECTORY, -1, false, path, sizeof(path))
if (find_directory(B_SYSTEM_DATA_DIRECTORY, -1, false, path, sizeof(path))
== B_OK) {
strlcat(path, "/network/services", sizeof(path));

View File

@ -326,9 +326,10 @@ get_named_icon(const char* name, uint8** _data, size_t* _size, type_code* _type)
return B_BAD_VALUE;
directory_which kWhich[] = {
B_USER_NONPACKAGED_DATA_DIRECTORY,
B_USER_DATA_DIRECTORY,
B_COMMON_DATA_DIRECTORY,
B_BEOS_DATA_DIRECTORY,
B_SYSTEM_NONPACKAGED_DATA_DIRECTORY,
B_SYSTEM_DATA_DIRECTORY,
};
status_t status = B_ENTRY_NOT_FOUND;

View File

@ -630,7 +630,6 @@ ConfirmChangeIfWellKnownDirectory(const BEntry* entry,
return false;
if (!DirectoryMatchesOrContains(entry, B_SYSTEM_DIRECTORY)
&& !DirectoryMatchesOrContains(entry, B_COMMON_DIRECTORY)
&& !DirectoryMatchesOrContains(entry, B_USER_DIRECTORY))
// quick way out
return true;
@ -645,12 +644,6 @@ ConfirmChangeIfWellKnownDirectory(const BEntry* entry,
"you want to do this?\n\nTo %toDoAction the system folder or its "
"contents anyway, hold down the Shift key and click "
"\"%toConfirmAction\"."));
} else if (DirectoryMatches(entry, B_COMMON_DIRECTORY)) {
warning.SetTo(
B_TRANSLATE("If you %ifYouDoAction the common folder, %osName "
"may not behave properly!\n\nAre you sure you want to do this?"
"\n\nTo %toDoAction the common folder anyway, hold down the "
"Shift key and click \"%toConfirmAction\"."));
} else if (DirectoryMatches(entry, B_USER_DIRECTORY)) {
warning .SetTo(
B_TRANSLATE("If you %ifYouDoAction the home folder, %osName "
@ -3925,7 +3918,6 @@ WellKnowEntryList::WellKnowEntryList()
AddOne(B_USER_DIRECTORY, "home");
AddOne(B_BEOS_FONTS_DIRECTORY, "fonts");
AddOne(B_COMMON_FONTS_DIRECTORY, "fonts");
AddOne(B_USER_FONTS_DIRECTORY, "fonts");
AddOne(B_BEOS_APPS_DIRECTORY, "apps");
@ -3944,7 +3936,7 @@ WellKnowEntryList::WellKnowEntryList()
AddOne((directory_which)B_USER_QUERIES_DIRECTORY, B_USER_DIRECTORY,
"queries", "queries");
AddOne(B_COMMON_DEVELOP_DIRECTORY, "develop");
AddOne(B_SYSTEM_DEVELOP_DIRECTORY, "develop");
AddOne((directory_which)B_USER_DESKBAR_DEVELOP_DIRECTORY,
B_USER_DESKBAR_DIRECTORY, "Development", "develop");

View File

@ -680,9 +680,10 @@ IconCache::GetWellKnownIcon(AutoLock<SimpleIconCache>*,
resid = R_HomeDirIcon;
break;
case B_BEOS_FONTS_DIRECTORY:
case B_COMMON_FONTS_DIRECTORY:
case B_SYSTEM_FONTS_DIRECTORY:
case B_SYSTEM_NONPACKAGED_FONTS_DIRECTORY:
case B_USER_FONTS_DIRECTORY:
case B_USER_NONPACKAGED_FONTS_DIRECTORY:
resid = R_FontDirIcon;
break;
@ -706,7 +707,8 @@ IconCache::GetWellKnownIcon(AutoLock<SimpleIconCache>*,
resid = R_QueryDirIcon;
break;
case B_COMMON_DEVELOP_DIRECTORY:
case B_SYSTEM_DEVELOP_DIRECTORY:
case B_SYSTEM_NONPACKAGED_DEVELOP_DIRECTORY:
case B_USER_DESKBAR_DEVELOP_DIRECTORY:
resid = R_DevelopDirIcon;
break;

View File

@ -2,8 +2,7 @@
B_TRANSLATE_MARK_ALL("apps", "B_APPS_DIRECTORY", "");
B_TRANSLATE_MARK_ALL("common", "B_COMMON_DIRECTORY", "");
B_TRANSLATE_MARK_ALL("develop", "B_COMMON_DEVELOP_DIRECTORY", "");
B_TRANSLATE_MARK_ALL("develop", "B_SYSTEM_DEVELOP_DIRECTORY", "");
B_TRANSLATE_MARK_ALL("preferences", "B_PREFERENCES_DIRECTORY", "");
B_TRANSLATE_MARK_ALL("system", "B_SYSTEM_DIRECTORY", "");

View File

@ -558,9 +558,10 @@ void
KeymapWindow::_AddKeyboardLayouts(BMenu* menu)
{
directory_which dataDirectories[] = {
B_USER_NONPACKAGED_DATA_DIRECTORY,
B_USER_DATA_DIRECTORY,
B_COMMON_DATA_DIRECTORY,
B_BEOS_DATA_DIRECTORY
B_SYSTEM_NONPACKAGED_DATA_DIRECTORY,
B_SYSTEM_DATA_DIRECTORY,
};
for (uint32 i = 0;

View File

@ -331,73 +331,40 @@ HWindow::SetupMenuField()
menu->AddItem(new BMenuItem(path.Leaf(), msg), 0);
}
BPath path;
BDirectory dir;
BEntry entry;
BPath item_path;
directory_which whichDirectories[] = {
B_SYSTEM_SOUNDS_DIRECTORY,
B_SYSTEM_NONPACKAGED_SOUNDS_DIRECTORY,
B_USER_SOUNDS_DIRECTORY,
B_USER_NONPACKAGED_SOUNDS_DIRECTORY,
};
status_t err = find_directory(B_BEOS_SOUNDS_DIRECTORY, &path);
if (err == B_OK)
err = dir.SetTo(path.Path());
while (err == B_OK) {
err = dir.GetNextEntry(&entry, true);
if (entry.InitCheck() != B_NO_ERROR)
break;
for (size_t i = 0;
i < sizeof(whichDirectories) / sizeof(whichDirectories[0]); i++) {
BPath path;
BDirectory dir;
BEntry entry;
BPath item_path;
entry.GetPath(&item_path);
status_t err = find_directory(whichDirectories[i], &path);
if (err == B_OK)
err = dir.SetTo(path.Path());
while (err == B_OK) {
err = dir.GetNextEntry(&entry, true);
if (entry.InitCheck() != B_NO_ERROR)
break;
if (menu->FindItem(item_path.Leaf()))
continue;
entry.GetPath(&item_path);
BMessage* msg = new BMessage(M_ITEM_MESSAGE);
entry_ref ref;
::get_ref_for_path(item_path.Path(), &ref);
msg->AddRef("refs", &ref);
menu->AddItem(new BMenuItem(item_path.Leaf(), msg), 0);
if (menu->FindItem(item_path.Leaf()))
continue;
BMessage* msg = new BMessage(M_ITEM_MESSAGE);
entry_ref ref;
::get_ref_for_path(item_path.Path(), &ref);
msg->AddRef("refs", &ref);
menu->AddItem(new BMenuItem(item_path.Leaf(), msg), 0);
}
}
err = find_directory(B_USER_SOUNDS_DIRECTORY, &path);
if (err == B_OK)
err = dir.SetTo(path.Path());
while (err == B_OK) {
err = dir.GetNextEntry(&entry, true);
if (entry.InitCheck() != B_NO_ERROR)
break;
entry.GetPath(&item_path);
if (menu->FindItem(item_path.Leaf()))
continue;
BMessage* msg = new BMessage(M_ITEM_MESSAGE);
entry_ref ref;
::get_ref_for_path(item_path.Path(), &ref);
msg->AddRef("refs", &ref);
menu->AddItem(new BMenuItem(item_path.Leaf(), msg), 0);
}
err = find_directory(B_COMMON_SOUNDS_DIRECTORY, &path);
if (err == B_OK)
err = dir.SetTo(path.Path());
while (err == B_OK) {
err = dir.GetNextEntry(&entry, true);
if (entry.InitCheck() != B_NO_ERROR)
break;
entry.GetPath(&item_path);
if (menu->FindItem(item_path.Leaf()))
continue;
BMessage* msg = new BMessage(M_ITEM_MESSAGE);
entry_ref ref;
::get_ref_for_path(item_path.Path(), &ref);
msg->AddRef("refs", &ref);
menu->AddItem(new BMenuItem(item_path.Leaf(), msg), 0);
}
}

View File

@ -528,12 +528,12 @@ void
FontManager::_AddSystemPaths()
{
BPath path;
if (find_directory(B_BEOS_FONTS_DIRECTORY, &path, true) == B_OK)
if (find_directory(B_SYSTEM_FONTS_DIRECTORY, &path, true) == B_OK)
_AddPath(path.Path());
// We don't scan these in test mode to help shave off some startup time
#if !TEST_MODE
if (find_directory(B_COMMON_FONTS_DIRECTORY, &path, true) == B_OK)
if (find_directory(B_SYSTEM_NONPACKAGED_FONTS_DIRECTORY, &path, true) == B_OK)
_AddPath(path.Path());
#endif
}

View File

@ -48,9 +48,9 @@ static struct {
} sPredefinedLinks[] = {
{ kGlobalSystemDirectory, kSystemDirectory },
{ kGlobalBinDirectory, kSystemBinDirectory },
{ kGlobalEtcDirectory, kCommonEtcDirectory },
{ kGlobalTempDirectory, kCommonTempDirectory },
{ kGlobalVarDirectory, kCommonVarDirectory },
{ kGlobalEtcDirectory, kSystemEtcDirectory },
{ kGlobalTempDirectory, kSystemTempDirectory },
{ kGlobalVarDirectory, kSystemVarDirectory },
{ kGlobalPackageLinksDirectory, kSystemPackageLinksDirectory },
{NULL}
};

View File

@ -39,9 +39,36 @@
*/
#define SYSTEM "system"
#define COMMON SYSTEM
#define COMMON "system/data/empty"
#define NON_PACKAGED "/non-packaged"
enum {
// obsolete common directories
B_COMMON_DIRECTORY = 2000,
B_COMMON_SYSTEM_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_COMMON_BOOT_DIRECTORY,
B_COMMON_FONTS_DIRECTORY,
B_COMMON_LIB_DIRECTORY,
B_COMMON_SERVERS_DIRECTORY,
B_COMMON_BIN_DIRECTORY,
_B_COMMON_ETC_DIRECTORY,
B_COMMON_DOCUMENTATION_DIRECTORY,
_B_COMMON_SETTINGS_DIRECTORY,
B_COMMON_DEVELOP_DIRECTORY,
_B_COMMON_LOG_DIRECTORY,
_B_COMMON_SPOOL_DIRECTORY,
_B_COMMON_TEMP_DIRECTORY,
_B_COMMON_VAR_DIRECTORY,
B_COMMON_TRANSLATORS_DIRECTORY,
B_COMMON_MEDIA_NODES_DIRECTORY,
B_COMMON_SOUNDS_DIRECTORY,
B_COMMON_DATA_DIRECTORY,
_B_COMMON_CACHE_DIRECTORY,
B_COMMON_PACKAGES_DIRECTORY,
B_COMMON_HEADERS_DIRECTORY,
};
/* Haiku system directories */
@ -55,7 +82,7 @@ static const char *kSystemDirectories[] = {
SYSTEM "/servers",
SYSTEM "/apps",
SYSTEM "/bin",
COMMON "/settings/etc",
SYSTEM "/settings/etc",
SYSTEM "/documentation",
SYSTEM "/preferences",
SYSTEM "/add-ons/Translators",
@ -78,33 +105,33 @@ static const char *kCommonDirectories[] = {
COMMON "/lib",
COMMON "/servers",
COMMON "/bin",
COMMON "/settings/etc",
SYSTEM "/settings/etc", // B_SYSTEM_ETC_DIRECTORY
COMMON "/documentation",
COMMON "/settings",
COMMON "/develop", // B_COMMON_DEVELOP_DIRECTORY
COMMON "/var/log", // B_SYSTEM_LOG_DIRECTORY
COMMON "/var/spool", // B_SYSTEM_SPOOL_DIRECTORY
COMMON "/cache/tmp", // B_SYSTEM_TEMP_DIRECTORY
COMMON "/var", // B_SYSTEM_VAR_DIRECTORY
SYSTEM "/settings", // B_SYSTEM_SETTINGS_DIRECTORY
COMMON "/develop",
SYSTEM "/var/log", // B_SYSTEM_LOG_DIRECTORY
SYSTEM "/var/spool", // B_SYSTEM_SPOOL_DIRECTORY
SYSTEM "/cache/tmp", // B_SYSTEM_TEMP_DIRECTORY
SYSTEM "/var", // B_SYSTEM_VAR_DIRECTORY
COMMON "/add-ons/Translators",
COMMON "/add-ons/media",
COMMON "/data/sounds",
COMMON "/data",
COMMON "/cache", // B_SYSTEM_CACHE_DIRECTORY
SYSTEM "/cache", // B_SYSTEM_CACHE_DIRECTORY
COMMON "/packages",
COMMON "/develop/headers",
COMMON NON_PACKAGED,
COMMON NON_PACKAGED "/add-ons",
COMMON NON_PACKAGED "/add-ons/Translators",
COMMON NON_PACKAGED "/add-ons/media",
COMMON NON_PACKAGED "/bin",
COMMON NON_PACKAGED "/data",
COMMON NON_PACKAGED "/data/fonts",
COMMON NON_PACKAGED "/data/sounds",
COMMON NON_PACKAGED "/documentation",
COMMON NON_PACKAGED "/lib",
COMMON NON_PACKAGED "/develop/headers",
COMMON NON_PACKAGED "/develop",
SYSTEM NON_PACKAGED,
SYSTEM NON_PACKAGED "/add-ons",
SYSTEM NON_PACKAGED "/add-ons/Translators",
SYSTEM NON_PACKAGED "/add-ons/media",
SYSTEM NON_PACKAGED "/bin",
SYSTEM NON_PACKAGED "/data",
SYSTEM NON_PACKAGED "/data/fonts",
SYSTEM NON_PACKAGED "/data/sounds",
SYSTEM NON_PACKAGED "/documentation",
SYSTEM NON_PACKAGED "/lib",
SYSTEM NON_PACKAGED "/develop/headers",
SYSTEM NON_PACKAGED "/develop",
};
/* User directories */
@ -274,7 +301,7 @@ find_directory(directory_which which, dev_t device, bool createIt,
templatePath = kSystemDirectories[which - B_SYSTEM_DIRECTORY];
break;
/* Common directories, shared among users */
/* Obsolete common directories and writable system directories */
case B_COMMON_DIRECTORY:
case B_COMMON_SYSTEM_DIRECTORY:
case B_COMMON_ADDONS_DIRECTORY:
@ -349,10 +376,10 @@ find_directory(directory_which which, dev_t device, bool createIt,
/* Global directories */
case B_APPS_DIRECTORY:
templatePath = COMMON "/apps";
templatePath = SYSTEM "/apps";
break;
case B_PREFERENCES_DIRECTORY:
templatePath = COMMON "/preferences";
templatePath = SYSTEM "/preferences";
break;
case B_UTILITIES_DIRECTORY:
templatePath = "utilities";

View File

@ -387,8 +387,8 @@ confstr(int name, char *buffer, size_t length)
switch (name) {
case _CS_PATH:
string = kGlobalBinDirectory ":" kSystemAppsDirectory ":"
kCommonBinDirectory ":" kCommonDevelopToolsBinDirectory;
string = kSystemNonpackagedBinDirectory ":" kGlobalBinDirectory ":"
kSystemAppsDirectory ":" kSystemPreferencesDirectory;
break;
default:
__set_errno(EINVAL);

View File

@ -30,6 +30,9 @@ search_path_for_type(image_type type)
{
const char *path = NULL;
// TODO: The *PATH variables should not include the standard system paths.
// Instead those paths should always be used after the directories specified
// via the variables.
switch (type) {
case B_APP_IMAGE:
path = getenv("PATH");
@ -53,25 +56,23 @@ search_path_for_type(image_type type)
// Since the kernel does not set any variables, this is also needed
// to start the root shell.
// TODO: The user specific paths should not be used by default.
switch (type) {
case B_APP_IMAGE:
return kUserBinDirectory
return kUserNonpackagedBinDirectory
":" kUserBinDirectory
// TODO: Remove!
":" kCommonBinDirectory
":" kSystemNonpackagedBinDirectory
":" kGlobalBinDirectory
":" kAppsDirectory
":" kPreferencesDirectory
":" kSystemAppsDirectory
":" kSystemPreferencesDirectory
":" kCommonDevelopToolsBinDirectory;
":" kSystemPreferencesDirectory;
case B_LIBRARY_IMAGE:
return kAppLocalLibDirectory
":" kUserNonpackagedLibDirectory
":" kUserLibDirectory
// TODO: Remove!
":" kCommonNonpackagedLibDirectory
":" kCommonLibDirectory
":" kSystemNonpackagedLibDirectory
":" kSystemLibDirectory;
case B_ADD_ON_IMAGE:
@ -79,7 +80,7 @@ search_path_for_type(image_type type)
":" kUserNonpackagedAddonsDirectory
":" kUserAddonsDirectory
// TODO: Remove!
":" kCommonNonpackagedAddonsDirectory
":" kSystemNonpackagedAddonsDirectory
":" kSystemAddonsDirectory;
default:

View File

@ -39,7 +39,7 @@ bool addUserToGroup(char *user, char *group)
{
char userPath[B_PATH_NAME_LENGTH], groupPath[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, userPath, sizeof(userPath));
find_directory(B_SYSTEM_DIRECTORY, 0, false, userPath, sizeof(userPath));
strcpy(groupPath, userPath);
strcat(userPath, "/domains/default/users/");
strcat(userPath, user);
@ -68,7 +68,7 @@ bool removeUserFromGroup(char *user, char *group)
if (strcmp(group, "everyone") == 0)
return false;
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, userPath, sizeof(userPath));
find_directory(B_SYSTEM_DIRECTORY, 0, false, userPath, sizeof(userPath));
strcat(userPath, "/domains/default/groups/");
strcat(userPath, group);
strcat(userPath, "/");
@ -86,7 +86,7 @@ bool isUserInGroup(char *user, char *group)
strlwr(user);
strlwr(group);
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, userPath, sizeof(userPath));
find_directory(B_SYSTEM_DIRECTORY, 0, false, userPath, sizeof(userPath));
strcat(userPath, "/domains/default/groups/");
strcat(userPath, group);
strcat(userPath, "/");
@ -103,7 +103,7 @@ bool createUser(char *user, char *password)
// All usernames are saved in lowercase.
strlwr(user);
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
@ -131,7 +131,7 @@ bool createGroup(char *group)
// All usernames are saved in lowercase.
strlwr(group);
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/groups/");
strcat(path, group);
@ -156,7 +156,7 @@ bool removeUser(char *user)
// All usernames are saved in lowercase.
strlwr(user);
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
@ -165,7 +165,7 @@ bool removeUser(char *user)
// Now remove all instances of this user from any groups to which
// it belonged.
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/groups");
// Scan the list of groups. For each group, use removeFiles() to remove
@ -190,7 +190,7 @@ bool removeGroup(char *group)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/groups/");
strcat(path, group);
strlwr(path);
@ -205,7 +205,7 @@ bool setUserFullName(char *user, char *fullName)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -217,7 +217,7 @@ bool setUserDesc(char *user, char *desc)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -232,7 +232,7 @@ bool setUserPassword(char *user, char *password)
// Encrypt the password using MD5.
md5EncodeString(password, code);
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -244,7 +244,7 @@ bool setUserFlags(char *user, uint32 flags)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -256,7 +256,7 @@ bool setUserDaysToExpire(char *user, uint32 days)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -268,7 +268,7 @@ bool setUserHome(char *user, char *home)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -283,7 +283,7 @@ bool setUserGroup(char *user, char *group)
if (!addUserToGroup(user, group))
return false;
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -295,7 +295,7 @@ bool setGroupDesc(char *group, char *desc)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/groups/");
strcat(path, group);
strcat(path, "/.attrib");
@ -308,7 +308,7 @@ bool getUserFullName(char *user, char *fullName, int bufSize)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -320,7 +320,7 @@ bool getUserDesc(char *user, char *desc, int bufSize)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -332,7 +332,7 @@ bool getUserPassword(char *user, char *password, int bufSize)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -344,7 +344,7 @@ bool getUserFlags(char *user, uint32 *flags)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -358,7 +358,7 @@ bool getUserDaysToExpire(char *user, uint32 *days)
days = 0;
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -370,7 +370,7 @@ bool getUserHome(char *user, char *home, int bufSize)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -382,7 +382,7 @@ bool getUserGroup(char *user, char *group, int bufSize)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users/");
strcat(path, user);
strlwr(path);
@ -397,7 +397,7 @@ bool getGroupDesc(char *group, char *desc, int bufSize)
// All usernames are saved in lowercase.
strlwr(group);
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/groups/");
strcat(path, group);
strcat(path, "/.attrib");
@ -471,7 +471,7 @@ DIR *OpenUsers()
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/users");
return opendir(path);
@ -507,7 +507,7 @@ DIR *OpenGroups()
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/groups");
return opendir(path);
@ -543,7 +543,7 @@ DIR *OpenGroup(char *group)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/groups/");
strcat(path, group);
@ -581,7 +581,7 @@ bool isServerRecordingLogins(char *server)
char path[B_PATH_NAME_LENGTH];
char buffer[20];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/servers/");
strcat(path, server);
strlwr(path);
@ -596,7 +596,7 @@ bool setServerRecordingLogins(char *server, bool recording)
{
char path[B_PATH_NAME_LENGTH];
find_directory(B_COMMON_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
find_directory(B_SYSTEM_DIRECTORY, 0, false, path, sizeof(path));
strcat(path, "/domains/default/servers/");
strcat(path, server);
strlwr(path);

View File

@ -32,7 +32,6 @@
#define WSTAT_CRTIME 0x0040
#define B_SYSTEM_SETTINGS_DIRECTORY ".\\"
#define B_COMMON_SYSTEM_DIRECTORY ".\\"
#define ENOTSUP 1

View File

@ -32,7 +32,6 @@
#define WSTAT_CRTIME 0x0040
#define B_SYSTEM_SETTINGS_DIRECTORY ".\\"
#define B_COMMON_SYSTEM_DIRECTORY ".\\"
#define ENOTSUP 1

View File

@ -34,26 +34,12 @@ const directory_which directories[] = {
B_BEOS_TRANSLATORS_DIRECTORY,
B_BEOS_MEDIA_NODES_DIRECTORY,
B_BEOS_SOUNDS_DIRECTORY,
// Common directories, shared among all users.
B_COMMON_DIRECTORY,
B_COMMON_SYSTEM_DIRECTORY,
B_COMMON_ADDONS_DIRECTORY,
B_COMMON_BOOT_DIRECTORY,
B_COMMON_FONTS_DIRECTORY,
B_COMMON_LIB_DIRECTORY,
B_COMMON_SERVERS_DIRECTORY,
B_COMMON_BIN_DIRECTORY,
B_SYSTEM_ETC_DIRECTORY,
B_COMMON_DOCUMENTATION_DIRECTORY,
B_SYSTEM_SETTINGS_DIRECTORY,
B_COMMON_DEVELOP_DIRECTORY,
B_SYSTEM_LOG_DIRECTORY,
B_SYSTEM_SPOOL_DIRECTORY,
B_SYSTEM_TEMP_DIRECTORY,
B_SYSTEM_VAR_DIRECTORY,
B_COMMON_TRANSLATORS_DIRECTORY,
B_COMMON_MEDIA_NODES_DIRECTORY,
B_COMMON_SOUNDS_DIRECTORY,
// User directories. These are interpreted in the context
// of the user making the find_directory call.
B_USER_DIRECTORY,
@ -224,43 +210,12 @@ test_find_directory(directory_which dir, BPath &path, dev_t device)
case B_BEOS_SOUNDS_DIRECTORY:
error = path.SetTo("/boot/beos/etc/sounds");
break;
// Common directories, shared among all users.
case B_COMMON_DIRECTORY:
error = path.SetTo("/boot/home");
break;
case B_COMMON_SYSTEM_DIRECTORY:
error = path.SetTo("/boot/home/config");
break;
case B_COMMON_ADDONS_DIRECTORY:
error = path.SetTo("/boot/home/config/add-ons");
break;
case B_COMMON_BOOT_DIRECTORY:
error = path.SetTo("/boot/home/config/boot");
break;
case B_COMMON_FONTS_DIRECTORY:
error = path.SetTo("/boot/home/config/fonts");
break;
case B_COMMON_LIB_DIRECTORY:
error = path.SetTo("/boot/home/config/lib");
break;
case B_COMMON_SERVERS_DIRECTORY:
error = path.SetTo("/boot/home/config/servers");
break;
case B_COMMON_BIN_DIRECTORY:
error = path.SetTo("/boot/home/config/bin");
break;
case B_SYSTEM_ETC_DIRECTORY:
error = path.SetTo("/boot/home/config/etc");
break;
case B_COMMON_DOCUMENTATION_DIRECTORY:
error = path.SetTo("/boot/home/config/documentation");
break;
case B_SYSTEM_SETTINGS_DIRECTORY:
error = path.SetTo("/boot/home/config/settings");
break;
case B_COMMON_DEVELOP_DIRECTORY:
error = path.SetTo("/boot/develop");
break;
case B_SYSTEM_LOG_DIRECTORY:
error = path.SetTo("/boot/var/log");
break;
@ -273,15 +228,6 @@ test_find_directory(directory_which dir, BPath &path, dev_t device)
case B_SYSTEM_VAR_DIRECTORY:
error = path.SetTo("/boot/var");
break;
case B_COMMON_TRANSLATORS_DIRECTORY:
error = path.SetTo("/boot/home/config/add-ons/Translators");
break;
case B_COMMON_MEDIA_NODES_DIRECTORY:
error = path.SetTo("/boot/home/config/add-ons/media");
break;
case B_COMMON_SOUNDS_DIRECTORY:
error = path.SetTo("/boot/home/config/sounds");
break;
// User directories. These are interpreted in the context
// of the user making the find_directory call.
case B_USER_DIRECTORY: