[bindings] add a default parameter to is_transfer_full whose default is False

This commit is contained in:
Benjamin Dauvergne 2012-05-05 22:55:57 +02:00
parent b35fc7fffb
commit ec23b23455
1 changed files with 5 additions and 4 deletions

View File

@ -258,14 +258,15 @@ def is_int(arg, binding_data):
def is_time_t_pointer(arg):
return re.match(r'\btime_t\*', unconstify(arg_type(arg)))
def is_transfer_full(arg):
def is_transfer_full(arg, default=False):
if not isinstance(arg, tuple):
return False
return default
transfer = arg[2].get('transfer')
if transfer:
return transfer == 'full'
else:
return is_out(arg) or is_object(arg)
if is_cstring(arg) and is_const(arg):
return False
return default or is_out(arg) or is_object(arg)
_not_objects = ( 'GHashTable', 'GList', 'GType' )