sl@0: sl@0: #include sl@0: sl@0: sl@0: #ifdef G_ENABLE_DEBUG sl@0: #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) sl@0: #define g_marshal_value_peek_char(v) g_value_get_char (v) sl@0: #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) sl@0: #define g_marshal_value_peek_int(v) g_value_get_int (v) sl@0: #define g_marshal_value_peek_uint(v) g_value_get_uint (v) sl@0: #define g_marshal_value_peek_long(v) g_value_get_long (v) sl@0: #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) sl@0: #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) sl@0: #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) sl@0: #define g_marshal_value_peek_enum(v) g_value_get_enum (v) sl@0: #define g_marshal_value_peek_flags(v) g_value_get_flags (v) sl@0: #define g_marshal_value_peek_float(v) g_value_get_float (v) sl@0: #define g_marshal_value_peek_double(v) g_value_get_double (v) sl@0: #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) sl@0: #define g_marshal_value_peek_param(v) g_value_get_param (v) sl@0: #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) sl@0: #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) sl@0: #define g_marshal_value_peek_object(v) g_value_get_object (v) sl@0: #else /* !G_ENABLE_DEBUG */ sl@0: /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. sl@0: * Do not access GValues directly in your code. Instead, use the sl@0: * g_value_get_*() functions sl@0: */ sl@0: #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int sl@0: #define g_marshal_value_peek_char(v) (v)->data[0].v_int sl@0: #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint sl@0: #define g_marshal_value_peek_int(v) (v)->data[0].v_int sl@0: #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint sl@0: #define g_marshal_value_peek_long(v) (v)->data[0].v_long sl@0: #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong sl@0: #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 sl@0: #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 sl@0: #define g_marshal_value_peek_enum(v) (v)->data[0].v_long sl@0: #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong sl@0: #define g_marshal_value_peek_float(v) (v)->data[0].v_float sl@0: #define g_marshal_value_peek_double(v) (v)->data[0].v_double sl@0: #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer sl@0: #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer sl@0: #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer sl@0: #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer sl@0: #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer sl@0: #endif /* !G_ENABLE_DEBUG */ sl@0: sl@0: sl@0: /* BOOLEAN:INT (./testmarshal.list:2) */ sl@0: void sl@0: test_marshal_BOOLEAN__INT (GClosure *closure, sl@0: GValue *return_value G_GNUC_UNUSED, sl@0: guint n_param_values, sl@0: const GValue *param_values, sl@0: gpointer invocation_hint G_GNUC_UNUSED, sl@0: gpointer marshal_data) sl@0: { sl@0: typedef gboolean (*GMarshalFunc_BOOLEAN__INT) (gpointer data1, sl@0: gint arg_1, sl@0: gpointer data2); sl@0: register GMarshalFunc_BOOLEAN__INT callback; sl@0: register GCClosure *cc = (GCClosure*) closure; sl@0: register gpointer data1, data2; sl@0: gboolean v_return; sl@0: sl@0: g_return_if_fail (return_value != NULL); sl@0: g_return_if_fail (n_param_values == 2); sl@0: sl@0: if (G_CCLOSURE_SWAP_DATA (closure)) sl@0: { sl@0: data1 = closure->data; sl@0: data2 = g_value_peek_pointer (param_values + 0); sl@0: } sl@0: else sl@0: { sl@0: data1 = g_value_peek_pointer (param_values + 0); sl@0: data2 = closure->data; sl@0: } sl@0: callback = (GMarshalFunc_BOOLEAN__INT) (marshal_data ? marshal_data : cc->callback); sl@0: sl@0: v_return = callback (data1, sl@0: g_marshal_value_peek_int (param_values + 1), sl@0: data2); sl@0: sl@0: g_value_set_boolean (return_value, v_return); sl@0: } sl@0: sl@0: /* STRING:INT (./testmarshal.list:3) */ sl@0: void sl@0: test_marshal_STRING__INT (GClosure *closure, sl@0: GValue *return_value G_GNUC_UNUSED, sl@0: guint n_param_values, sl@0: const GValue *param_values, sl@0: gpointer invocation_hint G_GNUC_UNUSED, sl@0: gpointer marshal_data) sl@0: { sl@0: typedef gchar* (*GMarshalFunc_STRING__INT) (gpointer data1, sl@0: gint arg_1, sl@0: gpointer data2); sl@0: register GMarshalFunc_STRING__INT callback; sl@0: register GCClosure *cc = (GCClosure*) closure; sl@0: register gpointer data1, data2; sl@0: gchar* v_return; sl@0: sl@0: g_return_if_fail (return_value != NULL); sl@0: g_return_if_fail (n_param_values == 2); sl@0: sl@0: if (G_CCLOSURE_SWAP_DATA (closure)) sl@0: { sl@0: data1 = closure->data; sl@0: data2 = g_value_peek_pointer (param_values + 0); sl@0: } sl@0: else sl@0: { sl@0: data1 = g_value_peek_pointer (param_values + 0); sl@0: data2 = closure->data; sl@0: } sl@0: callback = (GMarshalFunc_STRING__INT) (marshal_data ? marshal_data : cc->callback); sl@0: sl@0: v_return = callback (data1, sl@0: g_marshal_value_peek_int (param_values + 1), sl@0: data2); sl@0: sl@0: g_value_take_string (return_value, v_return); sl@0: } sl@0: