gobject-introspection r275 - in trunk: . giscanner



Author: johan
Date: Sat May 31 14:13:18 2008
New Revision: 275
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=275&view=rev

Log:
2008-05-31  Johan Dahlin  <jdahlin async com br>

    * giscanner/sourcescanner.py (ctype_name): Add ctype_name,
    a function to convert a CTYPE symbol to a string



Modified:
   trunk/ChangeLog
   trunk/giscanner/sourcescanner.py

Modified: trunk/giscanner/sourcescanner.py
==============================================================================
--- trunk/giscanner/sourcescanner.py	(original)
+++ trunk/giscanner/sourcescanner.py	Sat May 31 14:13:18 2008
@@ -78,6 +78,20 @@
         CSYMBOL_TYPE_TYPEDEF: 'typedef'
         }.get(symbol_type)
 
+def ctype_name(ctype):
+    return {
+        CTYPE_INVALID: 'invalid',
+        CTYPE_VOID: 'void',
+        CTYPE_BASIC_TYPE: 'basic',
+        CTYPE_TYPEDEF: 'typedef',
+        CTYPE_STRUCT: 'struct',
+        CTYPE_UNION: 'union',
+        CTYPE_ENUM: 'enum',
+        CTYPE_POINTER: 'pointer',
+        CTYPE_ARRAY: 'array',
+        CTYPE_FUNCTION: 'function'
+        }.get(ctype)
+
 
 class SourceType(object):
     def __init__(self, scanner, stype):



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