diff options
author | Timothy Pearson <[email protected]> | 2014-12-27 08:13:20 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2014-12-27 08:13:20 -0600 |
commit | 9b92536e6c51b66406d593745a938975e226f95e (patch) | |
tree | a40b0066dc774827f602f5e372c2f53656007553 /src/libr-link.h | |
download | libr-9b92536e6c51b66406d593745a938975e226f95e.tar.gz libr-9b92536e6c51b66406d593745a938975e226f95e.zip |
Initial import
Diffstat (limited to 'src/libr-link.h')
-rw-r--r-- | src/libr-link.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/libr-link.h b/src/libr-link.h new file mode 100644 index 0000000..b1bdb54 --- /dev/null +++ b/src/libr-link.h @@ -0,0 +1,26 @@ +#ifndef __LIBR_LINK_H +#define __LIBR_LINK_H + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +typedef struct { + void **symbol; + char *name; +} symbol_table; + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +#define SYMBOL_TABLE(tbl, ...) \ +const symbol_table tbl[] = { \ + __VA_ARGS__ \ + {NULL, NULL} \ +} + +#define OVERRIDE_SYMBOL(a) FN_##a +#define SYMBOL(sym) {(void **)&FN_##sym, #sym} +#define DEFINE_SYMBOL(ret, fn, ...) ret (*OVERRIDE_SYMBOL(fn))(__VA_ARGS__) +#define LOAD_SYMBOLS(lib, tbl) load_symbols(lib, tbl, sizeof(tbl)/sizeof(symbol_table)) + +int load_symbols(const char *library, const symbol_table *table, int entries); + +#endif /* __LIBR_LINK_H */ |