MCPcopy Create free account
hub / github.com/Singular/Singular / binary_module_function

Function binary_module_function

Singular/iplib.cc:1395–1415  ·  view source on GitHub ↗

loads a dynamic module from the binary path and returns a named function returns NULL, if something fails

Source from the content-addressed store, hash-verified

1393// loads a dynamic module from the binary path and returns a named function
1394// returns NULL, if something fails
1395void* binary_module_function(const char* newlib, const char* funcname)
1396{
1397 void* result = NULL;
1398
1399 const char* bin_dir = feGetResource('b');
1400 if (!bin_dir) { return NULL; }
1401
1402 char path_name[MAXPATHLEN];
1403 snprintf(path_name,MAXPATHLEN, "%s%s%s.%s", bin_dir, DIR_SEPP, newlib, MODULE_SUFFIX_STRING);
1404
1405 void* openlib = dynl_open(path_name);
1406 if(!openlib)
1407 {
1408 Werror("dynl_open of %s failed:%s", path_name, dynl_error());
1409 return NULL;
1410 }
1411 result = dynl_sym(openlib, funcname);
1412 if (!result) Werror("%s: %s\n", funcname, dynl_error());
1413
1414 return result;
1415}
1416#endif
1417
1418/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

Callers

nothing calls this directly

Calls 5

feGetResourceFunction · 0.85
dynl_openFunction · 0.85
WerrorFunction · 0.85
dynl_errorFunction · 0.85
dynl_symFunction · 0.85

Tested by

no test coverage detected