summaryrefslogtreecommitdiff
path: root/girepository/girparser.c
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2011-05-13 12:20:05 -0400
committerDavid Zeuthen <davidz@redhat.com>2011-05-13 14:18:48 -0400
commit9c6797e0478b5025c3f2f37b1331c1328cf34f4d (patch)
tree21efe4e901211a20bf52037da529a8a490d27ab7 /girepository/girparser.c
parentb29b3ec7c9f4f9f6d979aff1bfc3dc6cb05970d2 (diff)
downloadgobject-introspection-9c6797e0478b5025c3f2f37b1331c1328cf34f4d.tar.gz
Add support for the (skip) annotation on parameters or return values
This was discussed in bug 649657. https://bugzilla.gnome.org/show_bug.cgi?id=649657 Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'girepository/girparser.c')
-rw-r--r--girepository/girparser.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c
index f7269b92..02c04427 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -1030,6 +1030,7 @@ start_parameter (GMarkupParseContext *context,
const gchar *scope;
const gchar *closure;
const gchar *destroy;
+ const gchar *skip;
GIrNodeParam *param;
if (!(strcmp (element_name, "parameter") == 0 &&
@@ -1046,6 +1047,7 @@ start_parameter (GMarkupParseContext *context,
scope = find_attribute ("scope", attribute_names, attribute_values);
closure = find_attribute ("closure", attribute_names, attribute_values);
destroy = find_attribute ("destroy", attribute_names, attribute_values);
+ skip = find_attribute ("skip", attribute_names, attribute_values);
if (name == NULL)
name = "unknown";
@@ -1095,6 +1097,11 @@ start_parameter (GMarkupParseContext *context,
else
param->allow_none = FALSE;
+ if (skip && strcmp (skip, "1") == 0)
+ param->skip = TRUE;
+ else
+ param->skip = FALSE;
+
if (!parse_param_transfer (param, transfer, name, error))
return FALSE;
@@ -2200,6 +2207,7 @@ start_return_value (GMarkupParseContext *context,
{
GIrNodeParam *param;
const gchar *transfer;
+ const gchar *skip;
if (!(strcmp (element_name, "return-value") == 0 &&
ctx->state == STATE_FUNCTION))
@@ -2215,6 +2223,12 @@ start_return_value (GMarkupParseContext *context,
state_switch (ctx, STATE_FUNCTION_RETURN);
+ skip = find_attribute ("skip", attribute_names, attribute_values);
+ if (skip && strcmp (skip, "1") == 0)
+ param->skip = TRUE;
+ else
+ param->skip = FALSE;
+
transfer = find_attribute ("transfer-ownership", attribute_names, attribute_values);
if (!parse_param_transfer (param, transfer, NULL, error))
return FALSE;