1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ofdbus/dbus-glib/dbus/libdbus_glib_wsd.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,95 @@
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 +
1.21 +
1.22 +
1.23 +
1.24 +#include <e32std.h>
1.25 +#include "libdbus_glib_wsd_solution.h"
1.26 +#include <pls.h> // For emulator WSD API
1.27 +
1.28 +const TUid KLibGlibDbusUid3 = {0x20010156}; // This is the UID of the library
1.29 +
1.30 +struct libdbus_glib_global_struct *libdbus_glib_ImpurePtr()
1.31 +{
1.32 +
1.33 +#if defined(__WINSCW__) || defined(__WINS__)
1.34 +
1.35 + // Access the PLS of this process
1.36 + struct libdbus_glib_global_struct* p = Pls<struct libdbus_glib_global_struct>(KLibGlibDbusUid3, &libdbus_glib_Init);
1.37 + return p;
1.38 +
1.39 +#else
1.40 +
1.41 + return NULL;
1.42 +
1.43 +#endif
1.44 +
1.45 +}
1.46 +
1.47 +int libdbus_glib_Init(libdbus_glib_global_struct *g)
1.48 +{
1.49 + if(g)
1.50 + {
1.51 + g->GET_DBUS_WSD_VAR_NAME(server_slot,dbus_gmain,s)= -1;
1.52 + g->GET_DBUS_WSD_VAR_NAME(specialized_containers,dbus_gtype_specialized,s)= NULL;
1.53 + g->GET_DBUS_WSD_VAR_NAME(marshal_table,dbus_gobject,s)= NULL;
1.54 + g->GET_DBUS_WSD_VAR_NAME(error_metadata,dbus_gobject,s)= NULL;
1.55 +
1.56 + // g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s) = G_STATIC_RW_LOCK_INIT;
1.57 + g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).mutex.runtime_mutex =NULL; ///*G_STATIC_MUTEX_INIT*/ {NULL,{-3,NULL,0}};
1.58 + g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).mutex.static_mutex.iState = _ENeedsNormalInit;
1.59 + g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).mutex.static_mutex.iPtr = NULL;
1.60 + g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).mutex.static_mutex.iReentry = 0;
1.61 + g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).read_cond=NULL;
1.62 + g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).write_cond=NULL;
1.63 + g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).read_counter=0;
1.64 + g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).have_writer=FALSE;
1.65 + g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).want_to_read=0;
1.66 + g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).want_to_write=0;
1.67 +
1.68 +
1.69 +
1.70 + g->GET_DBUS_WSD_VAR_NAME(g_proxy_manager_slot,dbus_gproxy,s)=-1;
1.71 + g->GET_DBUS_WSD_VAR_NAME(parent_class,dbus_gproxy,s)=NULL;
1.72 +
1.73 + memset(&(g->GET_DBUS_WSD_VAR_NAME(signals,dbus_gproxy,s)),0,2*sizeof(guint));
1.74 + g->GET_DBUS_WSD_VAR_NAME(connection_g_proxy_lock,dbus_gproxy,s).runtime_mutex =NULL; ///*G_STATIC_MUTEX_INIT*/ {NULL,{-3,NULL,0}};
1.75 + g->GET_DBUS_WSD_VAR_NAME(connection_g_proxy_lock,dbus_gproxy,s).static_mutex.iState = _ENeedsNormalInit;
1.76 + g->GET_DBUS_WSD_VAR_NAME(connection_g_proxy_lock,dbus_gproxy,s).static_mutex.iPtr = NULL;
1.77 + g->GET_DBUS_WSD_VAR_NAME(connection_g_proxy_lock,dbus_gproxy,s).static_mutex.iReentry = 0;
1.78 +
1.79 + g->GET_DBUS_WSD_VAR_NAME(_dbus_gmain_connection_slot,dbus_gmain,g)= -1;
1.80 +
1.81 +
1.82 + g->GET_DBUS_WSD_VAR_NAME(quark,dbus_gtype_specialized,s)=0;
1.83 + g->GET_DBUS_WSD_VAR_NAME(quark,dbus_glib,s)=0;
1.84 + g->GET_DBUS_WSD_VAR_NAME(our_type,dbus_glib,p)=0;
1.85 + g->GET_DBUS_WSD_VAR_NAME(our_type,dbus_glib,q)=0;
1.86 + g->GET_DBUS_WSD_VAR_NAME(our_type,dbus_glib,r)=0;
1.87 + g->GET_DBUS_WSD_VAR_NAME(our_type,dbus_glib,s)=0;
1.88 + g->GET_DBUS_WSD_VAR_NAME(quark,dbus_gobject,s)=0;
1.89 + g->GET_DBUS_WSD_VAR_NAME(object_type,dbus_gproxy,s)= 0;
1.90 + g->GET_DBUS_WSD_VAR_NAME(quark,dbus_gvalue,s)= 0;
1.91 + g->GET_DBUS_WSD_VAR_NAME(types_initialized,dbus_gvalue,s)=0;
1.92 + g->GET_DBUS_WSD_VAR_NAME(type_id,dbus_gvalue,s)=0;
1.93 + g->GET_DBUS_WSD_VAR_NAME(our_type,dbus_gidl,s)=0;
1.94 +
1.95 + return 0;
1.96 + }
1.97 + return 1;
1.98 +}