telepathygabble/src/gabble-media-stream-signals-marshal.c
changeset 10 59927b2d3b75
parent 0 d0f3a028347a
equal deleted inserted replaced
0:d0f3a028347a 10:59927b2d3b75
     1 /*
       
     2  * gabble-media-stream-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:STRING,BOXED (gabble-media-stream-signals-marshal.list:1) */
       
    71 void
       
    72 gabble_media_stream_marshal_VOID__STRING_BOXED (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__STRING_BOXED) (gpointer     data1,
       
    80                                                    gpointer     arg_1,
       
    81                                                    gpointer     arg_2,
       
    82                                                    gpointer     data2);
       
    83   register GMarshalFunc_VOID__STRING_BOXED callback;
       
    84   register GCClosure *cc = (GCClosure*) closure;
       
    85   register gpointer data1, data2;
       
    86 
       
    87   g_return_if_fail (n_param_values == 3);
       
    88 
       
    89   if (G_CCLOSURE_SWAP_DATA (closure))
       
    90     {
       
    91       data1 = closure->data;
       
    92       data2 = g_value_peek_pointer (param_values + 0);
       
    93     }
       
    94   else
       
    95     {
       
    96       data1 = g_value_peek_pointer (param_values + 0);
       
    97       data2 = closure->data;
       
    98     }
       
    99   callback = (GMarshalFunc_VOID__STRING_BOXED) (marshal_data ? marshal_data : cc->callback);
       
   100 
       
   101   callback (data1,
       
   102             g_marshal_value_peek_string (param_values + 1),
       
   103             g_marshal_value_peek_boxed (param_values + 2),
       
   104             data2);
       
   105 }
       
   106 
       
   107 /* VOID:STRING,STRING (gabble-media-stream-signals-marshal.list:2) */
       
   108 void
       
   109 gabble_media_stream_marshal_VOID__STRING_STRING (GClosure     *closure,
       
   110                                                  GValue       *return_value,
       
   111                                                  guint         n_param_values,
       
   112                                                  const GValue *param_values,
       
   113                                                  gpointer      invocation_hint,
       
   114                                                  gpointer      marshal_data)
       
   115 {
       
   116   typedef void (*GMarshalFunc_VOID__STRING_STRING) (gpointer     data1,
       
   117                                                     gpointer     arg_1,
       
   118                                                     gpointer     arg_2,
       
   119                                                     gpointer     data2);
       
   120   register GMarshalFunc_VOID__STRING_STRING callback;
       
   121   register GCClosure *cc = (GCClosure*) closure;
       
   122   register gpointer data1, data2;
       
   123 
       
   124   g_return_if_fail (n_param_values == 3);
       
   125 
       
   126   if (G_CCLOSURE_SWAP_DATA (closure))
       
   127     {
       
   128       data1 = closure->data;
       
   129       data2 = g_value_peek_pointer (param_values + 0);
       
   130     }
       
   131   else
       
   132     {
       
   133       data1 = g_value_peek_pointer (param_values + 0);
       
   134       data2 = closure->data;
       
   135     }
       
   136   callback = (GMarshalFunc_VOID__STRING_STRING) (marshal_data ? marshal_data : cc->callback);
       
   137 
       
   138   callback (data1,
       
   139             g_marshal_value_peek_string (param_values + 1),
       
   140             g_marshal_value_peek_string (param_values + 2),
       
   141             data2);
       
   142 }
       
   143 
       
   144 /* VOID:UINT,STRING (gabble-media-stream-signals-marshal.list:3) */
       
   145 void
       
   146 gabble_media_stream_marshal_VOID__UINT_STRING (GClosure     *closure,
       
   147                                                GValue       *return_value,
       
   148                                                guint         n_param_values,
       
   149                                                const GValue *param_values,
       
   150                                                gpointer      invocation_hint,
       
   151                                                gpointer      marshal_data)
       
   152 {
       
   153   typedef void (*GMarshalFunc_VOID__UINT_STRING) (gpointer     data1,
       
   154                                                   guint        arg_1,
       
   155                                                   gpointer     arg_2,
       
   156                                                   gpointer     data2);
       
   157   register GMarshalFunc_VOID__UINT_STRING callback;
       
   158   register GCClosure *cc = (GCClosure*) closure;
       
   159   register gpointer data1, data2;
       
   160 
       
   161   g_return_if_fail (n_param_values == 3);
       
   162 
       
   163   if (G_CCLOSURE_SWAP_DATA (closure))
       
   164     {
       
   165       data1 = closure->data;
       
   166       data2 = g_value_peek_pointer (param_values + 0);
       
   167     }
       
   168   else
       
   169     {
       
   170       data1 = g_value_peek_pointer (param_values + 0);
       
   171       data2 = closure->data;
       
   172     }
       
   173   callback = (GMarshalFunc_VOID__UINT_STRING) (marshal_data ? marshal_data : cc->callback);
       
   174 
       
   175   callback (data1,
       
   176             g_marshal_value_peek_uint (param_values + 1),
       
   177             g_marshal_value_peek_string (param_values + 2),
       
   178             data2);
       
   179 }
       
   180