os/ossrv/ofdbus/dbus-glib/dbus/libdbus_glib_wsd.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18  
    19 
    20 
    21 #include <e32std.h> 
    22 #include "libdbus_glib_wsd_solution.h"
    23 #include <pls.h> // For emulator WSD API 
    24 
    25 const TUid KLibGlibDbusUid3 = {0x20010156};     // This is the UID of the library
    26 
    27 struct libdbus_glib_global_struct *libdbus_glib_ImpurePtr()
    28 {
    29 	  
    30 #if defined(__WINSCW__) || defined(__WINS__)
    31 
    32 	// Access the PLS of this process
    33 	struct libdbus_glib_global_struct* p  = Pls<struct libdbus_glib_global_struct>(KLibGlibDbusUid3, &libdbus_glib_Init);
    34 	return p;
    35 
    36 #else
    37 
    38 	return NULL;	
    39 
    40 #endif
    41 
    42 }
    43 
    44 int libdbus_glib_Init(libdbus_glib_global_struct *g)
    45 {
    46 	  if(g)
    47 	  {
    48 	      g->GET_DBUS_WSD_VAR_NAME(server_slot,dbus_gmain,s)= -1;
    49 		  g->GET_DBUS_WSD_VAR_NAME(specialized_containers,dbus_gtype_specialized,s)= NULL;
    50 		  g->GET_DBUS_WSD_VAR_NAME(marshal_table,dbus_gobject,s)= NULL;
    51 		  g->GET_DBUS_WSD_VAR_NAME(error_metadata,dbus_gobject,s)= NULL;
    52 		
    53 		 // g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s) = G_STATIC_RW_LOCK_INIT;
    54 		   g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).mutex.runtime_mutex =NULL; ///*G_STATIC_MUTEX_INIT*/ {NULL,{-3,NULL,0}};
    55           g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).mutex.static_mutex.iState = _ENeedsNormalInit;
    56           g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).mutex.static_mutex.iPtr = NULL;
    57           g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).mutex.static_mutex.iReentry = 0;
    58            g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).read_cond=NULL;
    59             g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).write_cond=NULL;
    60              g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).read_counter=0;
    61               g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).have_writer=FALSE;
    62                g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).want_to_read=0;
    63                 g->GET_DBUS_WSD_VAR_NAME(globals_lock,dbus_gobject,s).want_to_write=0;
    64           
    65          
    66 		  
    67 		  g->GET_DBUS_WSD_VAR_NAME(g_proxy_manager_slot,dbus_gproxy,s)=-1;
    68           g->GET_DBUS_WSD_VAR_NAME(parent_class,dbus_gproxy,s)=NULL;
    69           
    70           memset(&(g->GET_DBUS_WSD_VAR_NAME(signals,dbus_gproxy,s)),0,2*sizeof(guint));	  	  	
    71           g->GET_DBUS_WSD_VAR_NAME(connection_g_proxy_lock,dbus_gproxy,s).runtime_mutex =NULL; ///*G_STATIC_MUTEX_INIT*/ {NULL,{-3,NULL,0}};
    72           g->GET_DBUS_WSD_VAR_NAME(connection_g_proxy_lock,dbus_gproxy,s).static_mutex.iState = _ENeedsNormalInit;
    73           g->GET_DBUS_WSD_VAR_NAME(connection_g_proxy_lock,dbus_gproxy,s).static_mutex.iPtr = NULL;
    74           g->GET_DBUS_WSD_VAR_NAME(connection_g_proxy_lock,dbus_gproxy,s).static_mutex.iReentry = 0;
    75          
    76           g->GET_DBUS_WSD_VAR_NAME(_dbus_gmain_connection_slot,dbus_gmain,g)= -1;
    77           
    78           
    79           g->GET_DBUS_WSD_VAR_NAME(quark,dbus_gtype_specialized,s)=0;
    80           g->GET_DBUS_WSD_VAR_NAME(quark,dbus_glib,s)=0;
    81           g->GET_DBUS_WSD_VAR_NAME(our_type,dbus_glib,p)=0;
    82           g->GET_DBUS_WSD_VAR_NAME(our_type,dbus_glib,q)=0;
    83           g->GET_DBUS_WSD_VAR_NAME(our_type,dbus_glib,r)=0;
    84           g->GET_DBUS_WSD_VAR_NAME(our_type,dbus_glib,s)=0;
    85           g->GET_DBUS_WSD_VAR_NAME(quark,dbus_gobject,s)=0;
    86           g->GET_DBUS_WSD_VAR_NAME(object_type,dbus_gproxy,s)= 0;
    87           g->GET_DBUS_WSD_VAR_NAME(quark,dbus_gvalue,s)= 0;
    88           g->GET_DBUS_WSD_VAR_NAME(types_initialized,dbus_gvalue,s)=0;
    89           g->GET_DBUS_WSD_VAR_NAME(type_id,dbus_gvalue,s)=0;
    90 		  g->GET_DBUS_WSD_VAR_NAME(our_type,dbus_gidl,s)=0;
    91          
    92 			return 0;	
    93 	  }
    94 	  return 1;
    95 }