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