2008-08-16 15:05:59 +04:00
|
|
|
/*
|
2009-04-03 13:02:44 +04:00
|
|
|
* Copyright 2002-2009, Haiku Inc. All Rights Reserved.
|
2008-08-16 15:05:59 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-08-12 11:24:02 +04:00
|
|
|
#ifndef _FIND_DIRECTORY_H
|
|
|
|
#define _FIND_DIRECTORY_H
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
|
2008-08-16 15:05:59 +04:00
|
|
|
#include <SupportDefs.h>
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
2008-11-11 02:50:42 +03:00
|
|
|
/* Per volume directories */
|
2009-11-10 17:26:42 +03:00
|
|
|
B_DESKTOP_DIRECTORY = 0,
|
2002-07-09 16:24:59 +04:00
|
|
|
B_TRASH_DIRECTORY,
|
|
|
|
|
2008-11-11 02:50:42 +03:00
|
|
|
/* System directories */
|
2009-11-10 17:26:42 +03:00
|
|
|
B_SYSTEM_DIRECTORY = 1000,
|
|
|
|
B_SYSTEM_ADDONS_DIRECTORY = 1002,
|
2009-04-03 13:02:44 +04:00
|
|
|
B_SYSTEM_BOOT_DIRECTORY,
|
|
|
|
B_SYSTEM_FONTS_DIRECTORY,
|
|
|
|
B_SYSTEM_LIB_DIRECTORY,
|
|
|
|
B_SYSTEM_SERVERS_DIRECTORY,
|
|
|
|
B_SYSTEM_APPS_DIRECTORY,
|
|
|
|
B_SYSTEM_BIN_DIRECTORY,
|
2009-11-10 17:26:42 +03:00
|
|
|
B_SYSTEM_DOCUMENTATION_DIRECTORY = 1010,
|
2009-04-03 13:02:44 +04:00
|
|
|
B_SYSTEM_PREFERENCES_DIRECTORY,
|
|
|
|
B_SYSTEM_TRANSLATORS_DIRECTORY,
|
|
|
|
B_SYSTEM_MEDIA_NODES_DIRECTORY,
|
|
|
|
B_SYSTEM_SOUNDS_DIRECTORY,
|
|
|
|
B_SYSTEM_DATA_DIRECTORY,
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2008-11-11 02:50:42 +03:00
|
|
|
/* Common directories, shared among all users. */
|
2009-11-10 17:26:42 +03:00
|
|
|
B_COMMON_DIRECTORY = 2000,
|
2002-07-09 16:24:59 +04:00
|
|
|
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,
|
2008-08-16 15:05:59 +04:00
|
|
|
B_COMMON_DATA_DIRECTORY,
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2008-11-11 02:50:42 +03:00
|
|
|
/* User directories. These are interpreted in the context
|
|
|
|
of the user making the find_directory call. */
|
2009-11-10 17:26:42 +03:00
|
|
|
B_USER_DIRECTORY = 3000,
|
2002-07-09 16:24:59 +04:00
|
|
|
B_USER_CONFIG_DIRECTORY,
|
|
|
|
B_USER_ADDONS_DIRECTORY,
|
|
|
|
B_USER_BOOT_DIRECTORY,
|
|
|
|
B_USER_FONTS_DIRECTORY,
|
|
|
|
B_USER_LIB_DIRECTORY,
|
|
|
|
B_USER_SETTINGS_DIRECTORY,
|
|
|
|
B_USER_DESKBAR_DIRECTORY,
|
|
|
|
B_USER_PRINTERS_DIRECTORY,
|
|
|
|
B_USER_TRANSLATORS_DIRECTORY,
|
|
|
|
B_USER_MEDIA_NODES_DIRECTORY,
|
|
|
|
B_USER_SOUNDS_DIRECTORY,
|
2008-08-16 15:05:59 +04:00
|
|
|
B_USER_DATA_DIRECTORY,
|
|
|
|
B_USER_CACHE_DIRECTORY,
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2008-11-11 02:50:42 +03:00
|
|
|
/* Global directories. */
|
2009-11-10 17:26:42 +03:00
|
|
|
B_APPS_DIRECTORY = 4000,
|
2002-07-09 16:24:59 +04:00
|
|
|
B_PREFERENCES_DIRECTORY,
|
2009-04-03 13:02:44 +04:00
|
|
|
B_UTILITIES_DIRECTORY,
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2009-04-03 13:02:44 +04:00
|
|
|
/* Obsolete: Legacy BeOS definition to be phased out */
|
2009-11-10 17:26:42 +03:00
|
|
|
B_BEOS_DIRECTORY = 1000,
|
2009-04-03 13:02:44 +04:00
|
|
|
B_BEOS_SYSTEM_DIRECTORY,
|
|
|
|
B_BEOS_ADDONS_DIRECTORY,
|
|
|
|
B_BEOS_BOOT_DIRECTORY,
|
|
|
|
B_BEOS_FONTS_DIRECTORY,
|
|
|
|
B_BEOS_LIB_DIRECTORY,
|
|
|
|
B_BEOS_SERVERS_DIRECTORY,
|
|
|
|
B_BEOS_APPS_DIRECTORY,
|
|
|
|
B_BEOS_BIN_DIRECTORY,
|
|
|
|
B_BEOS_ETC_DIRECTORY,
|
|
|
|
B_BEOS_DOCUMENTATION_DIRECTORY,
|
|
|
|
B_BEOS_PREFERENCES_DIRECTORY,
|
|
|
|
B_BEOS_TRANSLATORS_DIRECTORY,
|
|
|
|
B_BEOS_MEDIA_NODES_DIRECTORY,
|
|
|
|
B_BEOS_SOUNDS_DIRECTORY,
|
|
|
|
B_BEOS_DATA_DIRECTORY,
|
2002-07-09 16:24:59 +04:00
|
|
|
} directory_which;
|
|
|
|
|
2008-08-16 15:05:59 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2008-11-11 02:50:42 +03:00
|
|
|
/* C interface */
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
status_t find_directory(directory_which which, dev_t volume, bool createIt,
|
2008-08-16 15:05:59 +04:00
|
|
|
char* pathString, int32 length);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
|
2008-11-11 02:50:42 +03:00
|
|
|
/* C++ interface */
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
class BVolume;
|
|
|
|
class BPath;
|
|
|
|
|
2008-08-16 15:05:59 +04:00
|
|
|
status_t find_directory(directory_which which, BPath* path,
|
|
|
|
bool createIt = false, BVolume* volume = NULL);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2008-11-11 02:50:42 +03:00
|
|
|
#endif /* __cplusplus */
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2008-11-11 02:50:42 +03:00
|
|
|
#endif /* _FIND_DIRECTORY_H */
|