gobject-introspection r571 - trunk/girepository



Author: walters
Date: Mon Sep  1 18:52:34 2008
New Revision: 571
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=571&view=rev

Log:
Look in c:type to determine pointer nature

	* girepository/girparser.c: Look at c:type to determine
	whether or not an item is a pointer.


Modified:
   trunk/girepository/girparser.c

Modified: trunk/girepository/girparser.c
==============================================================================
--- trunk/girepository/girparser.c	(original)
+++ trunk/girepository/girparser.c	Mon Sep  1 18:52:34 2008
@@ -330,11 +330,6 @@
       type->is_pointer = basic->pointer;
 
       str += strlen(basic->str);
-      if (*str == '*' && !type->is_pointer)
-	{
-	  type->is_pointer = TRUE;
-	  (str)++;
-	}
     }
   else if (in_glib)
     {
@@ -484,12 +479,6 @@
 	(str)++;
 
       type->interface = g_strndup (start, str - start);
-
-      if (*str == '*')
-	{
-	  type->is_pointer = TRUE;
-	  (str)++;
-	}
     }
   
   if (g_str_has_prefix (str, "["))
@@ -1552,6 +1541,9 @@
 	    GError             **error)
 {
   const gchar *name;
+  const gchar *ctype;
+  gboolean is_pointer;
+  GIrNodeType *typenode;
 
   if (strcmp (element_name, "type") != 0)
     return FALSE;
@@ -1593,31 +1585,41 @@
 
   if (name == NULL)
     MISSING_ATTRIBUTE (context, error, element_name, "name");
-  
+
+  ctype = find_attribute ("c:type", attribute_names, attribute_values);
+  if (ctype != NULL && strchr (ctype, '*'))
+    is_pointer = TRUE;
+  else
+    is_pointer = FALSE;
+
+  typenode = parse_type (ctx, name);
+  if (is_pointer)
+    typenode->is_pointer = is_pointer;
+	
   switch (ctx->current_typed->type)
     {
     case G_IR_NODE_PARAM:
       {
 	GIrNodeParam *param = (GIrNodeParam *)ctx->current_typed;
-	param->type = parse_type (ctx, name);
+	param->type = typenode;
       }
       break;
     case G_IR_NODE_FIELD:
       {
 	GIrNodeField *field = (GIrNodeField *)ctx->current_typed;
-	field->type = parse_type (ctx, name);
+	field->type = typenode;
       }
       break;
     case G_IR_NODE_PROPERTY:
       {
 	GIrNodeProperty *property = (GIrNodeProperty *) ctx->current_typed;
-	property->type = parse_type (ctx, name);
+	property->type = typenode;
       }
       break;
     case G_IR_NODE_CONSTANT:
       {
 	GIrNodeConstant *constant = (GIrNodeConstant *)ctx->current_typed;
-	constant->type = parse_type (ctx, name);
+	constant->type = typenode;
       }
       break;
     default:
@@ -1625,6 +1627,7 @@
       g_assert_not_reached ();
     }
 
+
   ctx->current_typed = NULL;
   return TRUE;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]