gobject-introspection r166 - in trunk: . giscanner



Author: johan
Date: Tue Mar 25 21:58:43 2008
New Revision: 166
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=166&view=rev

Log:
2008-03-25  Johan Dahlin  <johan gnome org>

        * giscanner/__init__.py:
        * giscanner/giscannermodule.c:
        * giscanner/sourcescanner.c:
        * giscanner/sourcescanner.h:
        Add constants and wrap a few more SymbolType fields



Modified:
   trunk/ChangeLog
   trunk/giscanner/__init__.py
   trunk/giscanner/giscannermodule.c
   trunk/giscanner/sourcescanner.c
   trunk/giscanner/sourcescanner.h

Modified: trunk/giscanner/__init__.py
==============================================================================
--- trunk/giscanner/__init__.py	(original)
+++ trunk/giscanner/__init__.py	Tue Mar 25 21:58:43 2008
@@ -1 +1,43 @@
 from _giscanner import *
+
+(CSYMBOL_TYPE_INVALID,
+ CSYMBOL_TYPE_CONST,
+ CSYMBOL_TYPE_OBJECT,
+ CSYMBOL_TYPE_FUNCTION,
+ CSYMBOL_TYPE_STRUCT,
+ CSYMBOL_TYPE_UNION,
+ CSYMBOL_TYPE_ENUM,
+ CSYMBOL_TYPE_TYPEDEF) = range(8)
+
+(CTYPE_INVALID,
+ CTYPE_VOID,
+ CTYPE_BASIC_TYPE,
+ CTYPE_TYPEDEF,
+ CTYPE_STRUCT,
+ CTYPE_UNION,
+ CTYPE_ENUM,
+ CTYPE_POINTER,
+ CTYPE_ARRAY,
+ CTYPE_FUNCTION) = range(10)
+
+STORAGE_CLASS_NONE = 0
+STORAGE_CLASS_TYPEDEF = 1 << 1
+STORAGE_CLASS_EXTERN = 1 << 2
+STORAGE_CLASS_STATIC = 1 << 3
+STORAGE_CLASS_AUTO = 1 << 4
+STORAGE_CLASS_REGISTER = 1 << 5
+
+TYPE_QUALIFIER_NONE = 0
+TYPE_QUALIFIER_CONST = 1 << 1
+TYPE_QUALIFIER_RESTRICT = 1 << 2
+TYPE_QUALIFIER_VOLATILE = 1 << 3
+
+FUNCTION_NONE = 0
+FUNCTION_INLINE = 1 << 1
+
+UNARY_ADDRESS_OF
+UNARY_POINTER_INDIRECTION
+UNARY_PLUS
+UNARY_MINUS
+UNARY_BITWISE_COMPLEMENT
+UNARY_LOGICAL_NEGATION

Modified: trunk/giscanner/giscannermodule.c
==============================================================================
--- trunk/giscanner/giscannermodule.c	(original)
+++ trunk/giscanner/giscannermodule.c	Tue Mar 25 21:58:43 2008
@@ -100,9 +100,15 @@
 }
 
 static PyGetSetDef _PyGISourceSymbol_getsets[] = {
+  /* int ref_count; */
   { "type", (getter)symbol_get_type, NULL, NULL},
+  /* int id; */
   { "ident", (getter)symbol_get_ident, NULL, NULL},
   { "base_type", (getter)symbol_get_base_type, NULL, NULL},
+  /* gboolean const_int_set; */
+  /* int const_int; */
+  /* char *const_string; */
+  /* GSList *directives; */
   { 0 }
 };
 
@@ -118,6 +124,27 @@
 }
 
 static PyObject *
+type_get_storage_class_specifier(PyGISourceType *self,
+				 void           *context)
+{
+  return PyInt_FromLong(self->type->storage_class_specifier);
+}
+
+static PyObject *
+type_get_type_qualifier(PyGISourceType *self,
+			void           *context)
+{
+  return PyInt_FromLong(self->type->type_qualifier);
+}
+
+static PyObject *
+type_get_function_specifier(PyGISourceType *self,
+			    void           *context)
+{
+  return PyInt_FromLong(self->type->function_specifier);
+}
+
+static PyObject *
 type_get_name(PyGISourceType *self,
 	      void           *context)
 {
@@ -130,9 +157,25 @@
   return PyString_FromString(self->type->name);
 }
 
+static PyObject *
+type_get_base_type(PyGISourceType *self,
+		   void             *context)
+{
+  PyGISourceType *item;
+  item = (PyGISourceType *)PyObject_GC_New(PyGISourceType,
+					   &PyGISourceType_Type);
+  item->type = self->type->base_type;
+  return (PyObject*)item;
+}
+
 static PyGetSetDef _PyGISourceType_getsets[] = {
   { "type", (getter)type_get_type, NULL, NULL},
+  { "storage_class_specifier", (getter)type_get_storage_class_specifier, NULL, NULL},
+  { "type_qualifier", (getter)type_get_type_qualifier, NULL, NULL},
+  { "function_specifier", (getter)type_get_function_specifier, NULL, NULL},
   { "name", (getter)type_get_name, NULL, NULL},
+  { "base_type", (getter)type_get_base_type, NULL, NULL},
+  /* { "child_list", (getter)type_get_child_list, NULL, NULL}, */
   { 0 }
 };
 

Modified: trunk/giscanner/sourcescanner.c
==============================================================================
--- trunk/giscanner/sourcescanner.c	(original)
+++ trunk/giscanner/sourcescanner.c	Tue Mar 25 21:58:43 2008
@@ -1,4 +1,4 @@
-/* GObject introspectaion: public scanner api
+/* GObject introspection: public scanner api
  *
  * Copyright (C) 2007 JÃrg Billeter
  * Copyright (C) 2008 Johan Dahlin

Modified: trunk/giscanner/sourcescanner.h
==============================================================================
--- trunk/giscanner/sourcescanner.h	(original)
+++ trunk/giscanner/sourcescanner.h	Tue Mar 25 21:58:43 2008
@@ -1,4 +1,4 @@
-/* GObject introspectaion: public scanner api
+/* GObject introspection: public scanner api
  *
  * Copyright (C) 2007 JÃrg Billeter
  * Copyright (C) 2008 Johan Dahlin



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