gobject-introspection r624 - in trunk: girepository giscanner tests/scanner tools



Author: walters
Date: Tue Sep 23 18:20:25 2008
New Revision: 624
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=624&view=rev

Log:
Merge branch 'bug552566-timet/wip'


Modified:
   trunk/girepository/ginfo.c
   trunk/girepository/ginvoke.c
   trunk/girepository/girepository.c
   trunk/girepository/girepository.h
   trunk/girepository/girnode.c
   trunk/girepository/girparser.c
   trunk/giscanner/ast.py
   trunk/tests/scanner/foo-expected.gir
   trunk/tests/scanner/foo.c
   trunk/tests/scanner/foo.h
   trunk/tools/generate.c

Modified: trunk/girepository/ginfo.c
==============================================================================
--- trunk/girepository/ginfo.c	(original)
+++ trunk/girepository/ginfo.c	Tue Sep 23 18:20:25 2008
@@ -1720,6 +1720,9 @@
 	    case GI_TYPE_TAG_DOUBLE:
 	      value->v_double = *(gdouble*)&base->typelib->data[blob->offset];
 	      break;
+	    case GI_TYPE_TAG_TIME_T:
+	      value->v_long = *(long*)&base->typelib->data[blob->offset];
+	      break;
 	    case GI_TYPE_TAG_INT:
 	      value->v_int = *(gint*)&base->typelib->data[blob->offset];
 	      break;

Modified: trunk/girepository/ginvoke.c
==============================================================================
--- trunk/girepository/ginvoke.c	(original)
+++ trunk/girepository/ginvoke.c	Tue Sep 23 18:20:25 2008
@@ -89,6 +89,7 @@
 	rettype = &ffi_type_slong;
 	break;
       case GI_TYPE_TAG_SIZE: /* FIXME */
+      case GI_TYPE_TAG_TIME_T: /* May not be portable */
       case GI_TYPE_TAG_ULONG:
 	rettype = &ffi_type_ulong;
 	break;

Modified: trunk/girepository/girepository.c
==============================================================================
--- trunk/girepository/girepository.c	(original)
+++ trunk/girepository/girepository.c	Tue Sep 23 18:20:25 2008
@@ -748,6 +748,8 @@
       return "float";
     case GI_TYPE_TAG_DOUBLE:
       return "double";
+    case GI_TYPE_TAG_TIME_T:
+      return "time_t";
     case GI_TYPE_TAG_UTF8:
       return "utf8";
     case GI_TYPE_TAG_FILENAME:

Modified: trunk/girepository/girepository.h
==============================================================================
--- trunk/girepository/girepository.h	(original)
+++ trunk/girepository/girepository.h	Tue Sep 23 18:20:25 2008
@@ -285,14 +285,15 @@
   GI_TYPE_TAG_SIZE      = 15,
   GI_TYPE_TAG_FLOAT     = 16,
   GI_TYPE_TAG_DOUBLE    = 17,
-  GI_TYPE_TAG_UTF8      = 18,
-  GI_TYPE_TAG_FILENAME  = 19,
-  GI_TYPE_TAG_ARRAY     = 20,
-  GI_TYPE_TAG_INTERFACE = 21,
-  GI_TYPE_TAG_GLIST     = 22,
-  GI_TYPE_TAG_GSLIST    = 23,
-  GI_TYPE_TAG_GHASH     = 24,
-  GI_TYPE_TAG_ERROR     = 25
+  GI_TYPE_TAG_TIME_T    = 18,
+  GI_TYPE_TAG_UTF8      = 19,
+  GI_TYPE_TAG_FILENAME  = 20,
+  GI_TYPE_TAG_ARRAY     = 21,
+  GI_TYPE_TAG_INTERFACE = 22,
+  GI_TYPE_TAG_GLIST     = 23,
+  GI_TYPE_TAG_GSLIST    = 24,
+  GI_TYPE_TAG_GHASH     = 25,
+  GI_TYPE_TAG_ERROR     = 26
 } GITypeTag;
 
 const gchar*           g_type_tag_to_string            (GITypeTag   type);

Modified: trunk/girepository/girnode.c
==============================================================================
--- trunk/girepository/girnode.c	(original)
+++ trunk/girepository/girnode.c	Tue Sep 23 18:20:25 2008
@@ -2117,6 +2117,7 @@
 	    *(glong*)&data[blob->offset] = (glong) parse_int_value (constant->value);
 	    break;
 	  case GI_TYPE_TAG_SIZE: /* FIXME */
+	  case GI_TYPE_TAG_TIME_T: 
 	  case GI_TYPE_TAG_ULONG:
 	    blob->size = sizeof (gulong);
 	    *(gulong*)&data[blob->offset] = (gulong) parse_uint_value (constant->value);

Modified: trunk/girepository/girparser.c
==============================================================================
--- trunk/girepository/girparser.c	(original)
+++ trunk/girepository/girparser.c	Tue Sep 23 18:20:25 2008
@@ -252,6 +252,7 @@
     { "size",     GI_TYPE_TAG_SIZE,    0 },
     { "float",    GI_TYPE_TAG_FLOAT,   0 },
     { "double",   GI_TYPE_TAG_DOUBLE,  0 },
+    { "time_t",   GI_TYPE_TAG_TIME_T,  0 },
     { "utf8",     GI_TYPE_TAG_UTF8,    1 },  
     { "filename", GI_TYPE_TAG_FILENAME,1 },
 

Modified: trunk/giscanner/ast.py
==============================================================================
--- trunk/giscanner/ast.py	(original)
+++ trunk/giscanner/ast.py	Tue Sep 23 18:20:25 2008
@@ -47,6 +47,7 @@
 TYPE_ULONG = 'ulong'
 TYPE_SSIZET = 'ssize_t'
 TYPE_SIZET = 'size_t'
+TYPE_TIMET = 'time_t'
 TYPE_FLOAT = 'float'
 TYPE_DOUBLE = 'double'
 TYPE_STRING = 'string' # requires zero-terminated
@@ -56,7 +57,7 @@
                    TYPE_UINT16, TYPE_INT32, TYPE_UINT32, TYPE_INT64,
                    TYPE_UINT64, TYPE_INT, TYPE_UINT, TYPE_LONG,
                    TYPE_ULONG, TYPE_SSIZET, TYPE_SIZET, TYPE_FLOAT,
-                   TYPE_DOUBLE]
+                   TYPE_DOUBLE, TYPE_TIMET]
 GIR_TYPES = [TYPE_NONE, TYPE_ANY]
 GIR_TYPES.extend(BASIC_GIR_TYPES)
 GIR_TYPES.extend([TYPE_STRING, TYPE_FILENAME])
@@ -96,8 +97,7 @@
 type_names['void'] = TYPE_NONE
 type_names['size_t'] = TYPE_SIZET
 type_names['ssize_t'] = TYPE_SSIZET
-# FIXME - we should be evaluating these per-platform; maybe check glibconfig.h?
-type_names['time_t'] = TYPE_LONG
+# FIXME - can we make libraries use GPid?
 type_names['pid_t'] = TYPE_INT
 
 # Suppress some GLib names

Modified: trunk/tests/scanner/foo-expected.gir
==============================================================================
--- trunk/tests/scanner/foo-expected.gir	(original)
+++ trunk/tests/scanner/foo-expected.gir	Tue Sep 23 18:20:25 2008
@@ -103,6 +103,19 @@
           </parameter>
         </parameters>
       </method>
+      <method name="is_it_time_yet" c:identifier="foo_object_is_it_time_yet">
+        <return-value>
+          <type name="none" c:type="void"/>
+        </return-value>
+        <parameters>
+          <parameter name="object">
+            <type name="Object" c:type="FooObject*"/>
+          </parameter>
+          <parameter name="time">
+            <type name="time_t" c:type="time_t"/>
+          </parameter>
+        </parameters>
+      </method>
       <property name="string" writable="1">
         <type name="string" c:type="gchararray"/>
       </property>

Modified: trunk/tests/scanner/foo.c
==============================================================================
--- trunk/tests/scanner/foo.c	(original)
+++ trunk/tests/scanner/foo.c	Tue Sep 23 18:20:25 2008
@@ -144,6 +144,11 @@
 
 }
 
+void
+foo_object_is_it_time_yet (FooObject *object, time_t time)
+{
+}
+
 G_DEFINE_TYPE (FooSubobject, foo_subobject, FOO_TYPE_OBJECT);
 
 static void

Modified: trunk/tests/scanner/foo.h
==============================================================================
--- trunk/tests/scanner/foo.h	(original)
+++ trunk/tests/scanner/foo.h	Tue Sep 23 18:20:25 2008
@@ -62,6 +62,8 @@
 
 FooObjectCookie       foo_object_new_cookie        (FooObject *object, const char *target);
 
+void                  foo_object_is_it_time_yet    (FooObject *object, time_t time);
+
 struct _FooSubobject
 {
   FooObject parent_instance;

Modified: trunk/tools/generate.c
==============================================================================
--- trunk/tools/generate.c	(original)
+++ trunk/tools/generate.c	Tue Sep 23 18:20:25 2008
@@ -83,6 +83,7 @@
     "size",
     "float", 
     "double", 
+    "time_t", 
     "utf8",
     "filename"
   };



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