os/security/cryptoservices/certificateandkeymgmt/tcertstore/tcertstore.h
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) 1997-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 the License "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  @file 
    21  @internalTechnology
    22 */
    23  
    24 #ifndef __TNAMES_H
    25 #define __TNAMES_H
    26 
    27 //#include <e32test.h>
    28 #include <e32cons.h>
    29 
    30 // public
    31 LOCAL_D CConsoleBase* console; // write all your messages to this
    32 LOCAL_C void doExampleL(); // code this function for the real example
    33 // private
    34 LOCAL_C void callExampleL(); // initialize with cleanup stack, then do example
    35 
    36 GLDEF_C TInt E32Main() // main function called by E32
    37     {
    38 	__UHEAP_MARK;
    39 	CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack
    40 	TRAPD(error,callExampleL()); // more initialization, then do example
    41 
    42 	__ASSERT_ALWAYS(!error,User::Panic(_L("CERT"),error));
    43 	delete cleanup; // destroy clean-up stack
    44 	__UHEAP_MARKEND;
    45 	return 0; // and return
    46     }
    47 
    48 LOCAL_C void callExampleL() // initialize and call example code under cleanup stack
    49     {
    50 	console=Console::NewL(_L("Test code"),
    51 		TSize(KDefaultConsWidth,KDefaultConsHeight));
    52 	CleanupStack::PushL(console);
    53 	TRAPD(error,doExampleL()); // perform example function
    54 	if (error) console->Printf(_L("failed: leave code=%d"), error);
    55 	else console->Printf(_L("ok"));
    56 	console->Printf(_L(" [press any key]"));
    57 	console->Getch(); // get and ignore character
    58 	CleanupStack::PopAndDestroy(); // close console
    59     }
    60 
    61 #endif