Tizen 2.1 base
[platform/upstream/glib2.0.git] / gobject / gvaluecollector.h
index 163e7c7..6d5190e 100644 (file)
@@ -21,7 +21,6 @@
 /**
  * SECTION:value_collection
  * @Short_description: Converting varargs to generic values
- * @See_also:#GValueTable
  * @Title: Varargs Value Collection
  * 
  * The macros in this section provide the varargs parsing support needed
@@ -51,10 +50,15 @@ enum        /*< skip >*/
 };
 
 
-/* vararg union holding actuall values collected
+/* vararg union holding actual values collected
  */
 /**
  * GTypeCValue:
+ * @v_int: the field for holding integer values
+ * @v_long: the field for holding long integer values
+ * @v_int64: the field for holding 64 bit integer values
+ * @v_double: the field for holding floating point values
+ * @v_pointer: the field for holding pointers
  * 
  * A union holding one collected value.
  */
@@ -154,6 +158,36 @@ G_STMT_START {                                                                             \
   G_VALUE_COLLECT_INIT(value, _value_type, var_args, flags, __error);                  \
 } G_STMT_END
 
+#define G_VALUE_COLLECT_SKIP(_value_type, var_args)                                    \
+G_STMT_START {                                                                         \
+  GTypeValueTable *_vtable = g_type_value_table_peek (_value_type);                    \
+  gchar *_collect_format = _vtable->collect_format;                                    \
+                                                                                        \
+  while (*_collect_format)                                                             \
+    {                                                                                  \
+      switch (*_collect_format++)                                                      \
+       {                                                                               \
+       case G_VALUE_COLLECT_INT:                                                       \
+         va_arg ((var_args), gint);                                                    \
+         break;                                                                        \
+       case G_VALUE_COLLECT_LONG:                                                      \
+         va_arg ((var_args), glong);                                                   \
+         break;                                                                        \
+       case G_VALUE_COLLECT_INT64:                                                     \
+         va_arg ((var_args), gint64);                                                  \
+         break;                                                                        \
+       case G_VALUE_COLLECT_DOUBLE:                                                    \
+         va_arg ((var_args), gdouble);                                                 \
+         break;                                                                        \
+       case G_VALUE_COLLECT_POINTER:                                                   \
+         va_arg ((var_args), gpointer);                                                \
+         break;                                                                        \
+       default:                                                                        \
+         g_assert_not_reached ();                                                      \
+       }                                                                               \
+    }                                                                                  \
+} G_STMT_END
+
 /**
  * G_VALUE_LCOPY:
  * @value: a #GValue return location. @value is supposed to be initialized