! . */
| 12779 | |
| 12780 | /*! . */ |
| 12781 | GMT_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 | /*! . */ |
| 12796 | GMT_LOCAL void * gmtapi_get_module_func (struct GMTAPI_CTRL *API, const char *module, unsigned int lib_no) { |
no test coverage detected