| 117 | } |
| 118 | |
| 119 | struct hc_dlib *hc_dlib_init(struct hc_dlib *lib, const char *path) { |
| 120 | lib->handle = dlopen(path, RTLD_NOW); |
| 121 | |
| 122 | if (!lib->handle) { |
| 123 | hc_throw("Error opening dynamic library '%s': %s", path, dlerror()); |
| 124 | } |
| 125 | |
| 126 | return lib; |
| 127 | } |
| 128 | |
| 129 | struct hc_dlib *hc_dlib_deinit(struct hc_dlib *lib) { |
| 130 | if (dlclose(lib->handle) != 0) { |
no outgoing calls