os/kernelhwsrv/userlibandfileserver/fileserver/etshell/ts_main.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 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // f32\etshell\ts_main.cpp
    15 // 
    16 //
    17 
    18 #include "ts_std.h"
    19 
    20 GLDEF_C void Panic(TShellPanic anErrorCode)
    21 //
    22 // Report a fault in the shell.
    23 //
    24 	{
    25 
    26 	User::Panic(_L("SHELL"),anErrorCode);
    27 	}
    28 
    29 TInt E32Main()
    30 //
    31 // Run Shell
    32 //
    33 	{
    34 	__UHEAP_MARK;
    35 	CTrapCleanup* trapHandler=CTrapCleanup::New();
    36 	if (trapHandler==NULL)
    37 		return(KErrNoMemory);
    38 
    39     TInt r=KErrNone;
    40 	TRAP(r,ShellFunction::TheShell=CShell::NewL());
    41 	if (r!=KErrNone)
    42         {
    43         delete trapHandler;
    44         __UHEAP_MARKEND;
    45 		return(r);
    46         }
    47     TRAP(r,ShellFunction::TheShell->RunL());
    48 	if (r!=KErrNone)
    49         {
    50         delete ShellFunction::TheShell;
    51         delete trapHandler;
    52         __UHEAP_MARKEND;
    53 		return(r);
    54         }
    55 
    56 	delete ShellFunction::TheShell;
    57 	delete trapHandler;
    58 	__UHEAP_MARKEND;
    59 	return(KErrNone);
    60 	}