MCPcopy Create free account
hub / github.com/GenericMappingTools/gmt / gmtapi_get_shared_module_func

Function gmtapi_get_shared_module_func

src/gmt_api.c:12781–12793  ·  view source on GitHub ↗

! . */

Source from the content-addressed store, hash-verified

12779
12780/*! . */
12781GMT_LOCAL void * gmtapi_get_shared_module_func (struct GMTAPI_CTRL *API, const char *module, unsigned int lib_no) {
12782 /* Function that returns a pointer to the function named module in specified shared library lib_no, or NULL if not found */
12783 void *p_func = NULL; /* function pointer */
12784 if (API->lib[lib_no].skip) return (NULL); /* Tried to open this shared library before and it was not available */
12785 if (API->lib[lib_no].handle == NULL && (API->lib[lib_no].handle = dlopen (API->lib[lib_no].path, RTLD_LAZY)) == NULL) { /* Not opened this shared library yet */
12786 GMT_Report (API, GMT_MSG_ERROR, "Unable to open GMT shared %s library: %s\n", API->lib[lib_no].name, dlerror());
12787 API->lib[lib_no].skip = true; /* Not bother the next time... */
12788 return (NULL); /* ...and obviously no function would be found */
12789 }
12790 /* Here the library handle is available; try to get pointer to specified module */
12791 *(void **) (&p_func) = dlsym (API->lib[lib_no].handle, module);
12792 return (p_func);
12793}
12794
12795/*! . */
12796GMT_LOCAL void * gmtapi_get_module_func (struct GMTAPI_CTRL *API, const char *module, unsigned int lib_no) {

Callers 1

gmtapi_get_module_funcFunction · 0.85

Calls 4

dlopenFunction · 0.85
GMT_ReportFunction · 0.85
dlerrorFunction · 0.85
dlsymFunction · 0.85

Tested by

no test coverage detected