#include #include #include #include extern "C" { nix_err nix_register_plugin(nix_c_context * context, char * plugin) { // DEBUG: TODO if (context) context->last_err_code = NIX_OK; if (plugin == nullptr) { // TODO: should this be `NIX_ERR_RECOVERABLE` or `NIX_ERR_UNKNOWN`? return nix_set_err_msg(context, NIX_ERR_UNKNOWN, "Plugin is null"); } void * handle = dlopen("libnixmainc.so", RTLD_LAZY | RTLD_GLOBAL); if (!handle) { return nix_set_err_msg(context, NIX_ERR_UNKNOWN, dlerror()); } void * sym_addr = dlsym(handle, "pluginSettings"); try { } NIXC_CATCH_ERRS } }