Skip to content

A libdl wrapper library that hashes function pointers to a hash table

License

Notifications You must be signed in to change notification settings

gonnux/libfastdl

Repository files navigation

libfastdl

Build StatusDocumentation

About

A libdl wrapper library that hashes function pointers to a hash table

Usage

#include <dlfcn.h>
#include <fastdl.h>
int main() {
    struct fastdl_Handle handle; // fastdl handle
    fastdl_open(&handle, "libfastdl_test_lib.so", RTLD_LAZY | RTLD_GLOBAL); // returns 0 on success, -1 on error.
    int (*multiply)(int, int);
    fastdl_sym(&handle, "multiply", (void**)&multiply); // returns 0, 1 on success(fp is not hashed, hashed), -1 on error.
    // fastdl_sym(&handle, "multiply", (void**)&multiply);
    multiply(2, 4) // returns 8
    fastdl_close(&handle); // returns 0 on success, non-zero(same as dlclose() returns) on error.
    return 0;
}

Performance

Dependencies

libdl, libgenc

License

Mozilla Public License 2.0