def string_output(func, argtypes, offset=(-1), str_result=False):
 func.argtypes = argtypes
 if str_result:
  func.restype = gdal_char_p
 else:
  func.restype = c_int
 def _check_str(result, func, cargs):
  return check_string(result, func, cargs, offset=offset, str_result=str_result)
 func.errcheck = _check_str
 return func

def string_output ( func , argtypes , offset = ( - 1 ) , str_result = False ) : func . argtypes = argtypes if str_result : func . restype = gdal_char_p else : func . restype = c_int def _check_str ( result , func , cargs ) : return check_string ( result , func , cargs , offset = offset , str_result = str_result ) func . errcheck = _check_str return func
generates a ctypes prototype for the given function with the given argument types that returns a string from a gdal pointer .