telepathygabble/src/gabble-presence-cache-signals-marshal.c
changeset 0 d0f3a028347a
equal deleted inserted replaced
-1:000000000000 0:d0f3a028347a
       
     1 /*
       
     2  * gabble-presence-cache-signals-marshal.c - Source for Gabble service discovery
       
     3  *
       
     4  * Copyright (C) 2006 Collabora Ltd.
       
     5  * 
       
     6  *
       
     7  * This library is free software; you can redistribute it and/or
       
     8  * modify it under the terms of the GNU Lesser General Public
       
     9  * License as published by the Free Software Foundation; either
       
    10  * version 2.1 of the License, or (at your option) any later version.
       
    11  *
       
    12  * This library is distributed in the hope that it will be useful,
       
    13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    15  * Lesser General Public License for more details.
       
    16  *
       
    17  * You should have received a copy of the GNU Lesser General Public
       
    18  * License along with this library; if not, write to the Free Software
       
    19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
       
    20  *
       
    21  */
       
    22 #include	<glib-object.h>
       
    23 
       
    24 
       
    25 #ifdef G_ENABLE_DEBUG
       
    26 #define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v)
       
    27 #define g_marshal_value_peek_char(v)     g_value_get_char (v)
       
    28 #define g_marshal_value_peek_uchar(v)    g_value_get_uchar (v)
       
    29 #define g_marshal_value_peek_int(v)      g_value_get_int (v)
       
    30 #define g_marshal_value_peek_uint(v)     g_value_get_uint (v)
       
    31 #define g_marshal_value_peek_long(v)     g_value_get_long (v)
       
    32 #define g_marshal_value_peek_ulong(v)    g_value_get_ulong (v)
       
    33 #define g_marshal_value_peek_int64(v)    g_value_get_int64 (v)
       
    34 #define g_marshal_value_peek_uint64(v)   g_value_get_uint64 (v)
       
    35 #define g_marshal_value_peek_enum(v)     g_value_get_enum (v)
       
    36 #define g_marshal_value_peek_flags(v)    g_value_get_flags (v)
       
    37 #define g_marshal_value_peek_float(v)    g_value_get_float (v)
       
    38 #define g_marshal_value_peek_double(v)   g_value_get_double (v)
       
    39 #define g_marshal_value_peek_string(v)   (char*) g_value_get_string (v)
       
    40 #define g_marshal_value_peek_param(v)    g_value_get_param (v)
       
    41 #define g_marshal_value_peek_boxed(v)    g_value_get_boxed (v)
       
    42 #define g_marshal_value_peek_pointer(v)  g_value_get_pointer (v)
       
    43 #define g_marshal_value_peek_object(v)   g_value_get_object (v)
       
    44 #else /* !G_ENABLE_DEBUG */
       
    45 /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
       
    46  *          Do not access GValues directly in your code. Instead, use the
       
    47  *          g_value_get_*() functions
       
    48  */
       
    49 #define g_marshal_value_peek_boolean(v)  (v)->data[0].v_int
       
    50 #define g_marshal_value_peek_char(v)     (v)->data[0].v_int
       
    51 #define g_marshal_value_peek_uchar(v)    (v)->data[0].v_uint
       
    52 #define g_marshal_value_peek_int(v)      (v)->data[0].v_int
       
    53 #define g_marshal_value_peek_uint(v)     (v)->data[0].v_uint
       
    54 #define g_marshal_value_peek_long(v)     (v)->data[0].v_long
       
    55 #define g_marshal_value_peek_ulong(v)    (v)->data[0].v_ulong
       
    56 #define g_marshal_value_peek_int64(v)    (v)->data[0].v_int64
       
    57 #define g_marshal_value_peek_uint64(v)   (v)->data[0].v_uint64
       
    58 #define g_marshal_value_peek_enum(v)     (v)->data[0].v_long
       
    59 #define g_marshal_value_peek_flags(v)    (v)->data[0].v_ulong
       
    60 #define g_marshal_value_peek_float(v)    (v)->data[0].v_float
       
    61 #define g_marshal_value_peek_double(v)   (v)->data[0].v_double
       
    62 #define g_marshal_value_peek_string(v)   (v)->data[0].v_pointer
       
    63 #define g_marshal_value_peek_param(v)    (v)->data[0].v_pointer
       
    64 #define g_marshal_value_peek_boxed(v)    (v)->data[0].v_pointer
       
    65 #define g_marshal_value_peek_pointer(v)  (v)->data[0].v_pointer
       
    66 #define g_marshal_value_peek_object(v)   (v)->data[0].v_pointer
       
    67 #endif /* !G_ENABLE_DEBUG */
       
    68 
       
    69 
       
    70 /* VOID:UINT,UINT,UINT (gabble-presence-cache-signals-marshal.list:1) */
       
    71 void
       
    72 gabble_presence_cache_marshal_VOID__UINT_UINT_UINT (GClosure     *closure,
       
    73                                                     GValue       *return_value,
       
    74                                                     guint         n_param_values,
       
    75                                                     const GValue *param_values,
       
    76                                                     gpointer      invocation_hint,
       
    77                                                     gpointer      marshal_data)
       
    78 {
       
    79   typedef void (*GMarshalFunc_VOID__UINT_UINT_UINT) (gpointer     data1,
       
    80                                                      guint        arg_1,
       
    81                                                      guint        arg_2,
       
    82                                                      guint        arg_3,
       
    83                                                      gpointer     data2);
       
    84   register GMarshalFunc_VOID__UINT_UINT_UINT callback;
       
    85   register GCClosure *cc = (GCClosure*) closure;
       
    86   register gpointer data1, data2;
       
    87 
       
    88   g_return_if_fail (n_param_values == 4);
       
    89 
       
    90   if (G_CCLOSURE_SWAP_DATA (closure))
       
    91     {
       
    92       data1 = closure->data;
       
    93       data2 = g_value_peek_pointer (param_values + 0);
       
    94     }
       
    95   else
       
    96     {
       
    97       data1 = g_value_peek_pointer (param_values + 0);
       
    98       data2 = closure->data;
       
    99     }
       
   100   callback = (GMarshalFunc_VOID__UINT_UINT_UINT) (marshal_data ? marshal_data : cc->callback);
       
   101 
       
   102   callback (data1,
       
   103             g_marshal_value_peek_uint (param_values + 1),
       
   104             g_marshal_value_peek_uint (param_values + 2),
       
   105             g_marshal_value_peek_uint (param_values + 3),
       
   106             data2);
       
   107 }
       
   108