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