pygmt.clib.Session.get_libgmt_func
- Session.get_libgmt_func(name, argtypes=None, restype=None)[source]
Get a ctypes function from the libgmt shared library.
Assigns the argument and return type conversions for the function.
Use this method to access a C function from libgmt.
- Parameters:
- Return type:
- Returns:
function – The GMT API function.
Examples
>>> from ctypes import c_void_p, c_int >>> with Session() as lib: ... func = lib.get_libgmt_func( ... "GMT_Destroy_Session", argtypes=[c_void_p], restype=c_int ... ) >>> type(func) <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>