1 | #ifndef FERESOURCE_H |
---|
2 | #define FERESOURCE_H |
---|
3 | |
---|
4 | #include <sys/param.h> |
---|
5 | |
---|
6 | #define DIR_SEP '/' |
---|
7 | #define DIR_SEPP "/" |
---|
8 | |
---|
9 | #ifndef MAXPATHLEN |
---|
10 | #define MAXPATHLEN 1024 |
---|
11 | #endif |
---|
12 | |
---|
13 | #ifdef __cplusplus |
---|
14 | /***************************************************************** |
---|
15 | * |
---|
16 | * Resource management (feResources.cc) |
---|
17 | * |
---|
18 | *****************************************************************/ |
---|
19 | // returns value of Resource as read-only string, or NULL |
---|
20 | // if Resource not found |
---|
21 | // issues warning, if explicitely requested (warn > 0), or |
---|
22 | // if warn < 0 and Resource is gotten for the first time |
---|
23 | // Always quiet if warn == 0 |
---|
24 | char* feResource(const char id, int warn = -1); |
---|
25 | char* feResource(const char* key, int warn = -1); |
---|
26 | |
---|
27 | char* feGetResource(const char id); |
---|
28 | |
---|
29 | // char* feResourceDefault(const char id); |
---|
30 | // char* feResourceDefault(const char* key); |
---|
31 | |
---|
32 | |
---|
33 | // This needs to be called before the first call to feResource |
---|
34 | // Initializes Resources, SearchPath, and extends PATH |
---|
35 | void feInitResources(const char* argv0 = NULL); |
---|
36 | // Re-inits resources, should be called after changing env. variables |
---|
37 | void feReInitResources(); |
---|
38 | // Prints resources into string with StringAppend, etc |
---|
39 | void feStringAppendResources(int warn = -1); |
---|
40 | #endif /* end ifdef __cplusplus */ |
---|
41 | |
---|
42 | extern char* feArgv0; |
---|
43 | |
---|
44 | const char fePathSep = |
---|
45 | /* not really cygwin, applies to all windows systems:*/ |
---|
46 | #if (defined(CYGWIN) || defined(ix86_Win)) |
---|
47 | ';' |
---|
48 | #else |
---|
49 | ':' |
---|
50 | #endif |
---|
51 | ; |
---|
52 | |
---|
53 | |
---|
54 | |
---|
55 | #endif |
---|