gobject-introspection r1066 - in trunk: . tests/everything



Author: johan
Date: Fri Jan 23 14:12:21 2009
New Revision: 1066
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=1066&view=rev

Log:
2009-01-23  Johan Dahlin  <jdahlin async com br>

    * tests/everything/everything.c (test_enum_param):
    * tests/everything/everything.h:

    Add an enum param test function



Modified:
   trunk/ChangeLog
   trunk/tests/everything/everything.c
   trunk/tests/everything/everything.h

Modified: trunk/tests/everything/everything.c
==============================================================================
--- trunk/tests/everything/everything.c	(original)
+++ trunk/tests/everything/everything.c	Fri Jan 23 14:12:21 2009
@@ -544,6 +544,20 @@
     return etype;
 }
 
+const gchar *
+test_enum_param(TestEnum e)
+{
+  GEnumValue *ev;
+  GEnumClass *ec;
+
+  ec = g_type_class_ref (test_enum_get_type ());  
+  ev = g_enum_get_value (ec, e);
+  g_type_class_unref (ec);
+
+  return ev->value_nick;
+  
+}
+
 /* structures */
 
 /**

Modified: trunk/tests/everything/everything.h
==============================================================================
--- trunk/tests/everything/everything.h	(original)
+++ trunk/tests/everything/everything.h	Fri Jan 23 14:12:21 2009
@@ -95,6 +95,8 @@
 GType test_flags_get_type (void) G_GNUC_CONST;
 #define TES_TYPE_FLAGS (test_flags_get_type ())
 
+const gchar * test_enum_param(TestEnum e);
+
 /* structures */
 typedef struct _TestStructA TestStructA;
 typedef struct _TestStructB TestStructB;



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