xref: /haiku/headers/os/storage/FindDirectory.h (revision cbed190f71b8aff814bf95539c39a1bcfb953ed8)
1 /*
2  * Copyright 2002-2009, Haiku Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _FIND_DIRECTORY_H
6 #define _FIND_DIRECTORY_H
7 
8 
9 #include <SupportDefs.h>
10 
11 
12 typedef enum {
13 	/* Per volume directories */
14 	B_DESKTOP_DIRECTORY					= 0,
15 	B_TRASH_DIRECTORY,
16 
17 	/* System directories */
18 	B_SYSTEM_DIRECTORY					= 1000,
19 	B_SYSTEM_ADDONS_DIRECTORY			= 1002,
20 	B_SYSTEM_BOOT_DIRECTORY,
21 	B_SYSTEM_FONTS_DIRECTORY,
22 	B_SYSTEM_LIB_DIRECTORY,
23  	B_SYSTEM_SERVERS_DIRECTORY,
24 	B_SYSTEM_APPS_DIRECTORY,
25 	B_SYSTEM_BIN_DIRECTORY,
26 	B_SYSTEM_DOCUMENTATION_DIRECTORY	= 1010,
27 	B_SYSTEM_PREFERENCES_DIRECTORY,
28 	B_SYSTEM_TRANSLATORS_DIRECTORY,
29 	B_SYSTEM_MEDIA_NODES_DIRECTORY,
30 	B_SYSTEM_SOUNDS_DIRECTORY,
31 	B_SYSTEM_DATA_DIRECTORY,
32 
33 	/* Common directories, shared among all users. */
34 	B_COMMON_DIRECTORY					= 2000,
35 	B_COMMON_SYSTEM_DIRECTORY,
36 	B_COMMON_ADDONS_DIRECTORY,
37 	B_COMMON_BOOT_DIRECTORY,
38 	B_COMMON_FONTS_DIRECTORY,
39 	B_COMMON_LIB_DIRECTORY,
40 	B_COMMON_SERVERS_DIRECTORY,
41 	B_COMMON_BIN_DIRECTORY,
42 	B_COMMON_ETC_DIRECTORY,
43 	B_COMMON_DOCUMENTATION_DIRECTORY,
44 	B_COMMON_SETTINGS_DIRECTORY,
45 	B_COMMON_DEVELOP_DIRECTORY,
46 	B_COMMON_LOG_DIRECTORY,
47 	B_COMMON_SPOOL_DIRECTORY,
48 	B_COMMON_TEMP_DIRECTORY,
49 	B_COMMON_VAR_DIRECTORY,
50 	B_COMMON_TRANSLATORS_DIRECTORY,
51 	B_COMMON_MEDIA_NODES_DIRECTORY,
52 	B_COMMON_SOUNDS_DIRECTORY,
53 	B_COMMON_DATA_DIRECTORY,
54 	B_COMMON_CACHE_DIRECTORY,
55 
56 	/* User directories. These are interpreted in the context
57 	   of the user making the find_directory call. */
58 	B_USER_DIRECTORY					= 3000,
59 	B_USER_CONFIG_DIRECTORY,
60 	B_USER_ADDONS_DIRECTORY,
61 	B_USER_BOOT_DIRECTORY,
62 	B_USER_FONTS_DIRECTORY,
63 	B_USER_LIB_DIRECTORY,
64 	B_USER_SETTINGS_DIRECTORY,
65 	B_USER_DESKBAR_DIRECTORY,
66 	B_USER_PRINTERS_DIRECTORY,
67 	B_USER_TRANSLATORS_DIRECTORY,
68 	B_USER_MEDIA_NODES_DIRECTORY,
69 	B_USER_SOUNDS_DIRECTORY,
70 	B_USER_DATA_DIRECTORY,
71 	B_USER_CACHE_DIRECTORY,
72 
73 	/* Global directories. */
74 	B_APPS_DIRECTORY					= 4000,
75 	B_PREFERENCES_DIRECTORY,
76 	B_UTILITIES_DIRECTORY,
77 
78 	/* Obsolete: Legacy BeOS definition to be phased out */
79 	B_BEOS_DIRECTORY					= 1000,
80 	B_BEOS_SYSTEM_DIRECTORY,
81 	B_BEOS_ADDONS_DIRECTORY,
82 	B_BEOS_BOOT_DIRECTORY,
83 	B_BEOS_FONTS_DIRECTORY,
84 	B_BEOS_LIB_DIRECTORY,
85  	B_BEOS_SERVERS_DIRECTORY,
86 	B_BEOS_APPS_DIRECTORY,
87 	B_BEOS_BIN_DIRECTORY,
88 	B_BEOS_ETC_DIRECTORY,
89 	B_BEOS_DOCUMENTATION_DIRECTORY,
90 	B_BEOS_PREFERENCES_DIRECTORY,
91 	B_BEOS_TRANSLATORS_DIRECTORY,
92 	B_BEOS_MEDIA_NODES_DIRECTORY,
93 	B_BEOS_SOUNDS_DIRECTORY,
94 	B_BEOS_DATA_DIRECTORY,
95 } directory_which;
96 
97 #ifdef __cplusplus
98 extern "C" {
99 #endif
100 
101 /* C interface */
102 
103 status_t find_directory(directory_which which, dev_t volume, bool createIt,
104 	char* pathString, int32 length);
105 
106 #ifdef __cplusplus
107 }
108 
109 /* C++ interface */
110 
111 class BVolume;
112 class BPath;
113 
114 status_t find_directory(directory_which which, BPath* path,
115 	bool createIt = false, BVolume* volume = NULL);
116 
117 #endif	/* __cplusplus */
118 
119 #endif	/* _FIND_DIRECTORY_H */
120