From 264b3adc76f3dcb7407fbe98c2f8bb7ecd00f0f1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 13 May 2005 17:31:10 +0000 Subject: [PATCH] Update testcases. 2005-05-13 Matthias Clasen * tests/*: Update testcases. * src/generate.c (write_callable_info): Don't forget to write transfer and null-ok attributes for return types and parameters. * src/girepository.h: * src/ginfo.c (g_callable_info_may_return_null): New function to find out if a function may return NULL. --- girepository/src/generate.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/girepository/src/generate.c b/girepository/src/generate.c index 2a9ffd630..0f87a973c 100644 --- a/girepository/src/generate.c +++ b/girepository/src/generate.c @@ -214,7 +214,9 @@ write_callable_info (const gchar *namespace, g_assert_not_reached (); } } - + if (g_callable_info_may_return_null (info)) + g_fprintf (file, "null-ok=\"1\""); + g_fprintf (file, " />\n"); if (g_callable_info_get_n_args (info) > 0) @@ -229,9 +231,27 @@ write_callable_info (const gchar *namespace, type = g_arg_info_get_type (arg); write_type_info (namespace, type, file); - g_base_info_unref ((GIBaseInfo *)type); g_fprintf (file, "\""); + if (g_type_info_is_pointer (type)) + { + switch (g_arg_info_get_ownership_transfer (arg)) + { + case GI_TRANSFER_NOTHING: + g_fprintf (file, " transfer=\"none\""); + break; + case GI_TRANSFER_CONTAINER: + g_fprintf (file, " transfer=\"shallow\""); + break; + case GI_TRANSFER_EVERYTHING: + g_fprintf (file, " transfer=\"full\""); + break; + default: + g_assert_not_reached (); + } + } + g_base_info_unref ((GIBaseInfo *)type); + g_fprintf (file, " direction=\""); switch (g_arg_info_get_direction (arg)) {