2 * BinReloc - a library for creating relocatable executables
3 * Written by: Hongli Lai <h.lai@chello.nl>
4 * http://autopackage.org/
6 * This source code is public domain. You can relicense this code
7 * under whatever license you want.
9 * See http://autopackage.org/docs/binreloc/ for
10 * more information and how to use this.
13 #ifndef __BINRELOC_H__
14 #define __BINRELOC_H__
21 /** These error codes can be returned by br_init(), br_init_lib(), gbr_init() or gbr_init_lib(). */
23 /** Cannot allocate memory. */
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
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
51 gboolean gbr_init (GError **error);
52 gboolean gbr_init_lib (GError **error);
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);
68 #endif /* __BINRELOC_H__ */