00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _PREFIX_H_
00029 #define _PREFIX_H_
00030
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #undef BR_NAMESPACE
00047 #define BR_NAMESPACE(funcName) gaim_ ## funcName
00048
00049
00050 #ifdef ENABLE_BINRELOC
00051
00052 #define br_thread_local_store BR_NAMESPACE(br_thread_local_store)
00053 #define br_locate BR_NAMESPACE(br_locate)
00054 #define br_locate_prefix BR_NAMESPACE(br_locate_prefix)
00055 #define br_prepend_prefix BR_NAMESPACE(br_prepend_prefix)
00056
00057 #ifndef BR_NO_MACROS
00058
00059
00060 #undef SELFPATH
00061 #undef PREFIX
00062 #undef PREFIXDIR
00063 #undef BINDIR
00064 #undef SBINDIR
00065 #undef DATADIR
00066 #undef LIBDIR
00067 #undef LIBEXECDIR
00068 #undef ETCDIR
00069 #undef SYSCONFDIR
00070 #undef CONFDIR
00071 #undef LOCALEDIR
00072
00073 #define SELFPATH (br_thread_local_store (br_locate ((void *) "")))
00074 #define PREFIX (br_thread_local_store (br_locate_prefix ((void *) "")))
00075 #define PREFIXDIR (br_thread_local_store (br_locate_prefix ((void *) "")))
00076 #define BINDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/bin")))
00077 #define SBINDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/sbin")))
00078 #define DATADIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/share")))
00079 #define LIBDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/lib/gaim")))
00080 #define LIBEXECDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/libexec")))
00081 #define ETCDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/etc")))
00082 #define SYSCONFDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/etc")))
00083 #define CONFDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/etc")))
00084 #define LOCALEDIR (br_thread_local_store (br_prepend_prefix ((void *) "", "/share/locale")))
00085 #endif
00086
00087
00088
00089
00090
00091 char *br_locate (void *symbol);
00092 char *br_locate_prefix (void *symbol);
00093 char *br_prepend_prefix (void *symbol, char *path);
00094
00095 #endif
00096
00097 const char *br_thread_local_store (char *str);
00098
00099
00100
00101
00102
00103
00104 #define br_strcat BR_NAMESPACE(br_strcat)
00105 #define br_extract_dir BR_NAMESPACE(br_extract_dir)
00106 #define br_extract_prefix BR_NAMESPACE(br_extract_prefix)
00107 #define br_set_locate_fallback_func BR_NAMESPACE(br_set_locate_fallback_func)
00108
00109 #ifndef BR_NO_MACROS
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 #define BR_SELFPATH(suffix) (br_thread_local_store (br_strcat (SELFPATH, suffix)))
00120 #define BR_PREFIX(suffix) (br_thread_local_store (br_strcat (PREFIX, suffix)))
00121 #define BR_PREFIXDIR(suffix) (br_thread_local_store (br_strcat (BR_PREFIX, suffix)))
00122 #define BR_BINDIR(suffix) (br_thread_local_store (br_strcat (BINDIR, suffix)))
00123 #define BR_SBINDIR(suffix) (br_thread_local_store (br_strcat (SBINDIR, suffix)))
00124 #define BR_DATADIR(suffix) (br_thread_local_store (br_strcat (DATADIR, suffix)))
00125 #define BR_LIBDIR(suffix) (br_thread_local_store (br_strcat (LIBDIR, suffix)))
00126 #define BR_LIBEXECDIR(suffix) (br_thread_local_store (br_strcat (LIBEXECDIR, suffix)))
00127 #define BR_ETCDIR(suffix) (br_thread_local_store (br_strcat (ETCDIR, suffix)))
00128 #define BR_SYSCONFDIR(suffix) (br_thread_local_store (br_strcat (SYSCONFDIR, suffix)))
00129 #define BR_CONFDIR(suffix) (br_thread_local_store (br_strcat (CONFDIR, suffix)))
00130 #define BR_LOCALEDIR(suffix) (br_thread_local_store (br_strcat (LOCALEDIR, suffix)))
00131 #endif
00132
00133 char *br_strcat (const char *str1, const char *str2);
00134 char *br_extract_dir (const char *path);
00135 char *br_extract_prefix(const char *path);
00136 typedef char *(*br_locate_fallback_func) (void *symbol, void *data);
00137 void br_set_locate_fallback_func (br_locate_fallback_func func, void *data);
00138
00139
00140 #ifdef __cplusplus
00141 }
00142 #endif
00143
00144 #endif