os/ossrv/glib/glibbackend/src/glibbackend_wsd.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/glib/glibbackend/src/glibbackend_wsd.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,64 @@
     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 +#include <e32std.h>
    1.24 +#include "glibbackend_wsd.h"
    1.25 +#include "glibbackendinternal.h"
    1.26 +
    1.27 +#if EMULATOR
    1.28 +#include "pls.h" // For emulator WSD API 
    1.29 +const TUid KGlibbackendUid3 = {0x10282414};     // This is the UID of the library
    1.30 +
    1.31 +int InitializeWsd(struct global_struct* g)
    1.32 +{
    1.33 +	g->VARIABLE_NAME(key_once,lowmem) = PTHREAD_ONCE_INIT;
    1.34 +	InitGLIBHeap(g->_iPrivateHeap);
    1.35 +	return KErrNone;
    1.36 +}
    1.37 +
    1.38 +struct global_struct *Glibbackend_ImpurePtr()
    1.39 +{
    1.40 +#if defined(__WINSCW__) || defined(__WINS__)
    1.41 +
    1.42 +	// Access the PLS of this process
    1.43 +	struct global_struct* p  = Pls<struct global_struct>(KGlibbackendUid3, &InitializeWsd);
    1.44 +    return p;
    1.45 +
    1.46 +#else
    1.47 +		
    1.48 +	return NULL;
    1.49 +
    1.50 +#endif
    1.51 +
    1.52 +}
    1.53 +
    1.54 +//Implementation of private heap for glib
    1.55 +#ifdef __WINSCW__
    1.56 +RHeap* PrivateHeap()
    1.57 +	{
    1.58 +	return (Glibbackend_ImpurePtr()->_iPrivateHeap);
    1.59 +	}
    1.60 +#define iPrivateHeap	(PrivateHeap())
    1.61 +#else
    1.62 +RHeap* 			iPrivateHeap;
    1.63 +#endif // WINSCW
    1.64 +
    1.65 +
    1.66 +#endif /* EMULATOR */ 
    1.67 +