def SetCTypesForLibrary(libname, fn_table):
 libpath = ctypes.util.find_library(libname)
 if (not libpath):
  raise ErrorLibNotFound(('Library %s not found' % libname))
 lib = ctypes.cdll.LoadLibrary(libpath)
 for (function, args, result) in fn_table:
  f = getattr(lib, function)
  f.argtypes = args
  f.restype = result
 return lib

def SetCTypesForLibrary ( libname , fn_table ) : libpath = ctypes . util . find_library ( libname ) if ( not libpath ) : raise ErrorLibNotFound ( ( 'Library %s not found' % libname ) ) lib = ctypes . cdll . LoadLibrary ( libpath ) for ( function , args , result ) in fn_table : f = getattr ( lib , function ) f . argtypes = args f . restype = result return lib
set function argument types and return types for an objc library .