os/ossrv/ofdbus/dbus-glib/dbus/dbus-gmarshal.c
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ofdbus/dbus-glib/dbus/dbus-gmarshal.c	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,105 @@
     1.4 +/*
     1.5 +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +#include "dbus-gmarshal.h"
    1.21 +
    1.22 +#include	<glib-object.h>
    1.23 +
    1.24 +
    1.25 +#ifdef G_ENABLE_DEBUG
    1.26 +#define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v)
    1.27 +#define g_marshal_value_peek_char(v)     g_value_get_char (v)
    1.28 +#define g_marshal_value_peek_uchar(v)    g_value_get_uchar (v)
    1.29 +#define g_marshal_value_peek_int(v)      g_value_get_int (v)
    1.30 +#define g_marshal_value_peek_uint(v)     g_value_get_uint (v)
    1.31 +#define g_marshal_value_peek_long(v)     g_value_get_long (v)
    1.32 +#define g_marshal_value_peek_ulong(v)    g_value_get_ulong (v)
    1.33 +#define g_marshal_value_peek_int64(v)    g_value_get_int64 (v)
    1.34 +#define g_marshal_value_peek_uint64(v)   g_value_get_uint64 (v)
    1.35 +#define g_marshal_value_peek_enum(v)     g_value_get_enum (v)
    1.36 +#define g_marshal_value_peek_flags(v)    g_value_get_flags (v)
    1.37 +#define g_marshal_value_peek_float(v)    g_value_get_float (v)
    1.38 +#define g_marshal_value_peek_double(v)   g_value_get_double (v)
    1.39 +#define g_marshal_value_peek_string(v)   (char*) g_value_get_string (v)
    1.40 +#define g_marshal_value_peek_param(v)    g_value_get_param (v)
    1.41 +#define g_marshal_value_peek_boxed(v)    g_value_get_boxed (v)
    1.42 +#define g_marshal_value_peek_pointer(v)  g_value_get_pointer (v)
    1.43 +#define g_marshal_value_peek_object(v)   g_value_get_object (v)
    1.44 +#else /* !G_ENABLE_DEBUG */
    1.45 +/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
    1.46 + *          Do not access GValues directly in your code. Instead, use the
    1.47 + *          g_value_get_*() functions
    1.48 + */
    1.49 +#define g_marshal_value_peek_boolean(v)  (v)->data[0].v_int
    1.50 +#define g_marshal_value_peek_char(v)     (v)->data[0].v_int
    1.51 +#define g_marshal_value_peek_uchar(v)    (v)->data[0].v_uint
    1.52 +#define g_marshal_value_peek_int(v)      (v)->data[0].v_int
    1.53 +#define g_marshal_value_peek_uint(v)     (v)->data[0].v_uint
    1.54 +#define g_marshal_value_peek_long(v)     (v)->data[0].v_long
    1.55 +#define g_marshal_value_peek_ulong(v)    (v)->data[0].v_ulong
    1.56 +#define g_marshal_value_peek_int64(v)    (v)->data[0].v_int64
    1.57 +#define g_marshal_value_peek_uint64(v)   (v)->data[0].v_uint64
    1.58 +#define g_marshal_value_peek_enum(v)     (v)->data[0].v_long
    1.59 +#define g_marshal_value_peek_flags(v)    (v)->data[0].v_ulong
    1.60 +#define g_marshal_value_peek_float(v)    (v)->data[0].v_float
    1.61 +#define g_marshal_value_peek_double(v)   (v)->data[0].v_double
    1.62 +#define g_marshal_value_peek_string(v)   (v)->data[0].v_pointer
    1.63 +#define g_marshal_value_peek_param(v)    (v)->data[0].v_pointer
    1.64 +#define g_marshal_value_peek_boxed(v)    (v)->data[0].v_pointer
    1.65 +#define g_marshal_value_peek_pointer(v)  (v)->data[0].v_pointer
    1.66 +#define g_marshal_value_peek_object(v)   (v)->data[0].v_pointer
    1.67 +#endif /* !G_ENABLE_DEBUG */
    1.68 +
    1.69 +
    1.70 +/* NONE:STRING,STRING,STRING (dbus-gmarshal.list:1) */
    1.71 +void
    1.72 +_dbus_g_marshal_VOID__STRING_STRING_STRING (GClosure     *closure,
    1.73 +                                            GValue       *return_value,
    1.74 +                                            guint         n_param_values,
    1.75 +                                            const GValue *param_values,
    1.76 +                                            gpointer      invocation_hint,
    1.77 +                                            gpointer      marshal_data)
    1.78 +{
    1.79 +  typedef void (*GMarshalFunc_VOID__STRING_STRING_STRING) (gpointer     data1,
    1.80 +                                                           gpointer     arg_1,
    1.81 +                                                           gpointer     arg_2,
    1.82 +                                                           gpointer     arg_3,
    1.83 +                                                           gpointer     data2);
    1.84 +  register GMarshalFunc_VOID__STRING_STRING_STRING callback;
    1.85 +  register GCClosure *cc = (GCClosure*) closure;
    1.86 +  register gpointer data1, data2;
    1.87 +
    1.88 +  g_return_if_fail (n_param_values == 4);
    1.89 +
    1.90 +  if (G_CCLOSURE_SWAP_DATA (closure))
    1.91 +    {
    1.92 +      data1 = closure->data;
    1.93 +      data2 = g_value_peek_pointer (param_values + 0);
    1.94 +    }
    1.95 +  else
    1.96 +    {
    1.97 +      data1 = g_value_peek_pointer (param_values + 0);
    1.98 +      data2 = closure->data;
    1.99 +    }
   1.100 +  callback = (GMarshalFunc_VOID__STRING_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
   1.101 +
   1.102 +  callback (data1,
   1.103 +            g_marshal_value_peek_string (param_values + 1),
   1.104 +            g_marshal_value_peek_string (param_values + 2),
   1.105 +            g_marshal_value_peek_string (param_values + 3),
   1.106 +            data2);
   1.107 +}
   1.108 +