Bindings: add support for time_t to bindings, add support for 'string' type for list in java binding
This commit is contained in:
parent
7142d50d16
commit
b77c9cf2e8
|
@ -108,7 +108,7 @@ def is_collection(type):
|
|||
return type in ('const GList*','GList*','GHashTable*')
|
||||
|
||||
def is_string_type(type):
|
||||
return type in ['char*', 'const char*', 'gchar*', 'const gchar*']
|
||||
return type in ['string', 'char*', 'const char*', 'gchar*', 'const gchar*']
|
||||
|
||||
class Binding:
|
||||
def __init__(self, binding_data):
|
||||
|
@ -538,7 +538,7 @@ protected static native void destroy(long cptr);
|
|||
print >> fd, ' if (%s)' % arg_name
|
||||
print >> fd, ' g_free(%s);' % arg_name
|
||||
elif arg_type == 'GList*' or arg_type == 'const GList*':
|
||||
if arg_options.get('element-type') == 'char*':
|
||||
if is_string_type(arg_options.get('element-type')):
|
||||
print >> fd, ' free_glist(&%s, (GFunc)free);' % arg_name
|
||||
elif is_object(element_type(arg)):
|
||||
print >> fd, ' free_glist(&%s, (GFunc)g_object_unref);' % arg_name
|
||||
|
|
|
@ -267,7 +267,7 @@ PHP_MSHUTDOWN_FUNCTION(lasso)
|
|||
print >> self.fd, ' %s %s = NULL;' % ('char*', arg_name)
|
||||
print >> self.fd, ' %s %s_str = NULL;' % ('char*', arg_name)
|
||||
print >> self.fd, ' %s %s_len = 0;' % ('int', arg_name)
|
||||
elif arg_type in ['int', 'gint', 'GType', 'gboolean', 'const gboolean'] + self.binding_data.enums:
|
||||
elif arg_type in ['time_t', 'int', 'gint', 'GType', 'gboolean', 'const gboolean'] + self.binding_data.enums:
|
||||
parse_tuple_format.append('l')
|
||||
parse_tuple_args.append('&%s' % arg_name)
|
||||
print >> self.fd, ' %s %s;' % ('long', arg_name)
|
||||
|
|
|
@ -819,7 +819,7 @@ register_constants(PyObject *d)
|
|||
parse_tuple_format.append('s')
|
||||
parse_tuple_args.append('&%s' % arg_name)
|
||||
arg_def = ' %s %s = NULL;' % (arg[0], arg[1])
|
||||
elif arg_type in ['GType', 'int', 'gint', 'gboolean', 'const gboolean'] + self.binding_data.enums:
|
||||
elif arg_type in ['GType', 'int', 'gint', 'gboolean', 'const gboolean', 'time_t'] + self.binding_data.enums:
|
||||
parse_tuple_format.append('i')
|
||||
parse_tuple_args.append('&%s' % arg_name)
|
||||
if arg_options.get('default'):
|
||||
|
|
|
@ -197,7 +197,7 @@ def is_int(arg, binding_data):
|
|||
return arg_type(arg) in [ 'int', 'gint', 'long', 'glong'] + binding_data.enums
|
||||
|
||||
def is_time_t_pointer(arg):
|
||||
return re.match(r'\btime_t*', unconstify(arg_type(arg)))
|
||||
return re.match(r'\btime_t\*', unconstify(arg_type(arg)))
|
||||
|
||||
def is_transfer_full(arg):
|
||||
transfer = arg[2].get('transfer')
|
||||
|
|
Loading…
Reference in New Issue