Tizen 2.1 base
[external/enchant.git] / src / prefix.h
1 /*
2  * BinReloc - a library for creating relocatable executables
3  * Written by: Hongli Lai <h.lai@chello.nl>
4  * http://autopackage.org/
5  *
6  * This source code is public domain. You can relicense this code
7  * under whatever license you want.
8  *
9  * See http://autopackage.org/docs/binreloc/ for
10  * more information and how to use this.
11  */
12
13 #ifndef __BINRELOC_H__
14 #define __BINRELOC_H__
15
16 #include <glib.h>
17
18 G_BEGIN_DECLS
19
20
21 /** These error codes can be returned by br_init(), br_init_lib(), gbr_init() or gbr_init_lib(). */
22 typedef enum {
23         /** Cannot allocate memory. */
24         GBR_INIT_ERROR_NOMEM,
25         /** Unable to open /proc/self/maps; see errno for details. */
26         GBR_INIT_ERROR_OPEN_MAPS,
27         /** Unable to read from /proc/self/maps; see errno for details. */
28         GBR_INIT_ERROR_READ_MAPS,
29         /** The file format of /proc/self/maps is invalid; kernel bug? */
30         GBR_INIT_ERROR_INVALID_MAPS,
31         /** BinReloc is disabled (the ENABLE_BINRELOC macro is not defined). */
32         GBR_INIT_ERROR_DISABLED
33 } GbrInitError;
34
35
36 #ifndef BINRELOC_RUNNING_DOXYGEN
37 /* Mangle symbol names to avoid symbol collisions with other ELF objects. */
38         #define gbr_find_exe         qYFU3719188448765_gbr_find_exe
39         #define gbr_find_exe_dir     qYFU3719188448765_gbr_find_exe_dir
40         #define gbr_find_prefix      qYFU3719188448765_gbr_find_prefix
41         #define gbr_find_bin_dir     qYFU3719188448765_gbr_find_bin_dir
42         #define gbr_find_sbin_dir    qYFU3719188448765_gbr_find_sbin_dir
43         #define gbr_find_data_dir    qYFU3719188448765_gbr_find_data_dir
44         #define gbr_find_locale_dir  qYFU3719188448765_gbr_find_locale_dir
45         #define gbr_find_lib_dir     qYFU3719188448765_gbr_find_lib_dir
46         #define gbr_find_libexec_dir qYFU3719188448765_gbr_find_libexec_dir
47         #define gbr_find_etc_dir     qYFU3719188448765_gbr_find_etc_dir
48
49
50 #endif
51 gboolean gbr_init             (GError **error);
52 gboolean gbr_init_lib         (GError **error);
53
54 gchar   *gbr_find_exe         (const gchar *default_exe);
55 gchar   *gbr_find_exe_dir     (const gchar *default_dir);
56 gchar   *gbr_find_prefix      (const gchar *default_prefix);
57 gchar   *gbr_find_bin_dir     (const gchar *default_bin_dir);
58 gchar   *gbr_find_sbin_dir    (const gchar *default_sbin_dir);
59 gchar   *gbr_find_data_dir    (const gchar *default_data_dir);
60 gchar   *gbr_find_locale_dir  (const gchar *default_locale_dir);
61 gchar   *gbr_find_lib_dir     (const gchar *default_lib_dir);
62 gchar   *gbr_find_libexec_dir (const gchar *default_libexec_dir);
63 gchar   *gbr_find_etc_dir     (const gchar *default_etc_dir);
64
65
66 G_END_DECLS
67
68 #endif /* __BINRELOC_H__ */