def ptr_getter(field): if field == b'context': ptr = lib.hexchat_list_str(lib.ph, list_, field) ctx = ffi.cast('hexchat_context*', ptr) return Context(ctx) return None
def string_getter(field): string = lib.hexchat_list_str(lib.ph, list_, field) if string != ffi.NULL: return __decode(ffi.string(string)) return ''