comparison src/prefix.c @ 10257:b98f856e2e5e

[gaim-migrate @ 11398] Oops, this moves some stuff around so it compiles fine with binreloc disabled. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Wed, 24 Nov 2004 02:16:36 +0000
parents 645eb9804040
children 7f487c725a90
comparison
equal deleted inserted replaced
10256:db39c909d467 10257:b98f856e2e5e
54 #else 54 #else
55 #define br_return_val_if_fail(expr,val) if (!(expr)) return val 55 #define br_return_val_if_fail(expr,val) if (!(expr)) return val
56 #endif /* __GNUC__ */ 56 #endif /* __GNUC__ */
57 57
58 58
59 static br_locate_fallback_func fallback_func = NULL;
60 static void *fallback_data = NULL;
61
62
59 #ifdef ENABLE_BINRELOC 63 #ifdef ENABLE_BINRELOC
60 #include <sys/types.h> 64 #include <sys/types.h>
61 #include <sys/stat.h> 65 #include <sys/stat.h>
62 #include <sys/param.h> 66 #include <sys/param.h>
63 #include <unistd.h> 67 #include <unistd.h>
64
65
66 static br_locate_fallback_func fallback_func = NULL;
67 static void *fallback_data = NULL;
68 /**
69 * br_set_fallback_function:
70 * func: A function to call to find the binary.
71 * data: User data to pass to func.
72 *
73 * Sets a function to call to find the path to the binary, in
74 * case "/proc/self/maps" can't be opened. The function set should
75 * return a string that is safe to free with free().
76 */
77 void
78 br_set_locate_fallback_func (br_locate_fallback_func func, void *data)
79 {
80 fallback_func = func;
81 fallback_data = data;
82 }
83 68
84 69
85 /** 70 /**
86 * br_locate: 71 * br_locate:
87 * symbol: A symbol that belongs to the app/library you want to locate. 72 * symbol: A symbol that belongs to the app/library you want to locate.
463 448
464 return result; 449 return result;
465 } 450 }
466 451
467 452
453 /**
454 * br_set_fallback_function:
455 * func: A function to call to find the binary.
456 * data: User data to pass to func.
457 *
458 * Sets a function to call to find the path to the binary, in
459 * case "/proc/self/maps" can't be opened. The function set should
460 * return a string that is safe to free with free().
461 */
462 void
463 br_set_locate_fallback_func (br_locate_fallback_func func, void *data)
464 {
465 fallback_func = func;
466 fallback_data = data;
467 }
468
469
468 #ifdef __cplusplus 470 #ifdef __cplusplus
469 } 471 }
470 #endif /* __cplusplus */ 472 #endif /* __cplusplus */
471 473
472 #endif /* _PREFIX_C */ 474 #endif /* _PREFIX_C */