xref: /haiku/headers/os/storage/FindDirectory.h (revision 93aeb8c3bc3f13cb1f282e3e749258a23790d947)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //---------------------------------------------------------------------
5 /*!
6 	\file FindDirectory.h
7 	Declarations of find_directory() functions and associated types.
8 */
9 
10 #ifndef _FIND_DIRECTORY_H
11 #define _FIND_DIRECTORY_H
12 
13 #include <SupportDefs.h>
14 
15 #ifdef USE_OPENBEOS_NAMESPACE
16 namespace OpenBeOS {
17 #endif
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 typedef enum {
24 	/* ---
25 		Per volume directories.  When asking for these
26 		directories, a volume must be specified, or the call will assume
27 		the boot volume.
28 	--- */
29 
30 	B_DESKTOP_DIRECTORY				= 0,
31 	B_TRASH_DIRECTORY,
32 
33 	/* ---
34 		BeOS directories.  These are mostly accessed read-only.
35 	--- */
36 
37 	B_BEOS_DIRECTORY				= 1000,
38 	B_BEOS_SYSTEM_DIRECTORY,
39 	B_BEOS_ADDONS_DIRECTORY,
40 	B_BEOS_BOOT_DIRECTORY,
41 	B_BEOS_FONTS_DIRECTORY,
42 	B_BEOS_LIB_DIRECTORY,
43  	B_BEOS_SERVERS_DIRECTORY,
44 	B_BEOS_APPS_DIRECTORY,
45 	B_BEOS_BIN_DIRECTORY,
46 	B_BEOS_ETC_DIRECTORY,
47 	B_BEOS_DOCUMENTATION_DIRECTORY,
48 	B_BEOS_PREFERENCES_DIRECTORY,
49 	B_BEOS_TRANSLATORS_DIRECTORY,
50 	B_BEOS_MEDIA_NODES_DIRECTORY,
51 	B_BEOS_SOUNDS_DIRECTORY,
52 
53 	/* ---
54 		Common directories, shared among all users.
55 	--- */
56 
57 	B_COMMON_DIRECTORY				= 2000,
58 	B_COMMON_SYSTEM_DIRECTORY,
59 	B_COMMON_ADDONS_DIRECTORY,
60 	B_COMMON_BOOT_DIRECTORY,
61 	B_COMMON_FONTS_DIRECTORY,
62 	B_COMMON_LIB_DIRECTORY,
63 	B_COMMON_SERVERS_DIRECTORY,
64 	B_COMMON_BIN_DIRECTORY,
65 	B_COMMON_ETC_DIRECTORY,
66 	B_COMMON_DOCUMENTATION_DIRECTORY,
67 	B_COMMON_SETTINGS_DIRECTORY,
68 	B_COMMON_DEVELOP_DIRECTORY,
69 	B_COMMON_LOG_DIRECTORY,
70 	B_COMMON_SPOOL_DIRECTORY,
71 	B_COMMON_TEMP_DIRECTORY,
72 	B_COMMON_VAR_DIRECTORY,
73 	B_COMMON_TRANSLATORS_DIRECTORY,
74 	B_COMMON_MEDIA_NODES_DIRECTORY,
75 	B_COMMON_SOUNDS_DIRECTORY,
76 
77 
78 	/* ---
79 		User directories.  These are interpreted in the context
80 		of the user making the find_directory call.
81 	--- */
82 
83 	B_USER_DIRECTORY				= 3000,
84 	B_USER_CONFIG_DIRECTORY,
85 	B_USER_ADDONS_DIRECTORY,
86 	B_USER_BOOT_DIRECTORY,
87 	B_USER_FONTS_DIRECTORY,
88 	B_USER_LIB_DIRECTORY,
89 	B_USER_SETTINGS_DIRECTORY,
90 	B_USER_DESKBAR_DIRECTORY,
91 	B_USER_PRINTERS_DIRECTORY,
92 	B_USER_TRANSLATORS_DIRECTORY,
93 	B_USER_MEDIA_NODES_DIRECTORY,
94 	B_USER_SOUNDS_DIRECTORY,
95 
96 	/* ---
97 		Global directories.
98 	--- */
99 
100 	B_APPS_DIRECTORY				= 4000,
101 	B_PREFERENCES_DIRECTORY,
102 	B_UTILITIES_DIRECTORY
103 
104 } directory_which;
105 
106 /* ---
107 	The C interface
108 --- */
109 
110 status_t find_directory(directory_which which, dev_t volume, bool createIt,
111 						char *pathString, int32 length);
112 
113 #ifdef __cplusplus
114 }
115 #endif
116 
117 #ifdef __cplusplus
118 
119 class BVolume;
120 class BPath;
121 
122 /* ---
123 	C++ interface
124 --- */
125 
126 status_t find_directory(directory_which which, BPath *path,
127 						bool createIt = false, BVolume *volume = NULL);
128 
129 #endif
130 
131 #ifdef USE_OPENBEOS_NAMESPACE
132 };		// namespace OpenBeOS
133 #endif
134 
135 #endif	// _FIND_DIRECTORY_H
136 
137 
138