author | sl@SLION-WIN7.fritz.box |
Fri, 15 Jun 2012 03:10:57 +0200 | |
changeset 0 | bde4ae8d615e |
permissions | -rw-r--r-- |
sl@0 | 1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
sl@0 | 2 |
// All rights reserved. |
sl@0 | 3 |
// This component and the accompanying materials are made available |
sl@0 | 4 |
// under the terms of the License "Eclipse Public License v1.0" |
sl@0 | 5 |
// which accompanies this distribution, and is available |
sl@0 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
sl@0 | 7 |
// |
sl@0 | 8 |
// Initial Contributors: |
sl@0 | 9 |
// Nokia Corporation - initial contribution. |
sl@0 | 10 |
// |
sl@0 | 11 |
// Contributors: |
sl@0 | 12 |
// |
sl@0 | 13 |
// Description: |
sl@0 | 14 |
// f32\sfile\sf_ldr.h |
sl@0 | 15 |
// |
sl@0 | 16 |
// |
sl@0 | 17 |
|
sl@0 | 18 |
#ifndef __SF_LDR_H__ |
sl@0 | 19 |
#define __SF_LDR_H__ |
sl@0 | 20 |
|
sl@0 | 21 |
class TLoaderDeletedList |
sl@0 | 22 |
{ |
sl@0 | 23 |
public: |
sl@0 | 24 |
TLoaderDeletedList* iNext; |
sl@0 | 25 |
TInt iDriveNumber; |
sl@0 | 26 |
TInt64 iStartBlock; |
sl@0 | 27 |
HBufC* iFileName; |
sl@0 | 28 |
}; |
sl@0 | 29 |
|
sl@0 | 30 |
|
sl@0 | 31 |
NONSHARABLE_CLASS(CReaperCleanupTimer): public CTimer |
sl@0 | 32 |
{ |
sl@0 | 33 |
public: |
sl@0 | 34 |
CReaperCleanupTimer(); |
sl@0 | 35 |
static TInt New(); |
sl@0 | 36 |
static void Complete(); |
sl@0 | 37 |
private: |
sl@0 | 38 |
~CReaperCleanupTimer(); |
sl@0 | 39 |
void RunL(); |
sl@0 | 40 |
void Start(); |
sl@0 | 41 |
static CReaperCleanupTimer* Timer; |
sl@0 | 42 |
}; |
sl@0 | 43 |
|
sl@0 | 44 |
NONSHARABLE_CLASS(CActiveReaper) : public CActive |
sl@0 | 45 |
{ |
sl@0 | 46 |
public: |
sl@0 | 47 |
static CActiveReaper* New(); |
sl@0 | 48 |
~CActiveReaper(); |
sl@0 | 49 |
void StartReaper(); |
sl@0 | 50 |
|
sl@0 | 51 |
void AddDeleted(TLoaderDeletedList* aLink); |
sl@0 | 52 |
void InitDelDir(); |
sl@0 | 53 |
private: |
sl@0 | 54 |
CActiveReaper(); |
sl@0 | 55 |
|
sl@0 | 56 |
void Construct(); |
sl@0 | 57 |
virtual void RunL(); |
sl@0 | 58 |
virtual void DoCancel(); |
sl@0 | 59 |
|
sl@0 | 60 |
TLoaderDeletedList* iLoaderDeletedList; |
sl@0 | 61 |
}; |
sl@0 | 62 |
|
sl@0 | 63 |
NONSHARABLE_CLASS(CSlottedChunkAllocator) : public CBase |
sl@0 | 64 |
{ |
sl@0 | 65 |
public: |
sl@0 | 66 |
TInt Construct(); |
sl@0 | 67 |
TAny* Alloc(TUint aSize); |
sl@0 | 68 |
void Free(TAny* aPtr); |
sl@0 | 69 |
|
sl@0 | 70 |
private: |
sl@0 | 71 |
// slot size must be multiple of page size |
sl@0 | 72 |
enum { KSlots=2, KSlotSize=16777216 }; |
sl@0 | 73 |
TUint iUsed[KSlots]; |
sl@0 | 74 |
RChunk iChunk; |
sl@0 | 75 |
TUint8* iBase; |
sl@0 | 76 |
}; |
sl@0 | 77 |
|
sl@0 | 78 |
extern CSlottedChunkAllocator gFileDataAllocator; |
sl@0 | 79 |
|
sl@0 | 80 |
|
sl@0 | 81 |
//#define TRACE_CHECK_FAILURES |
sl@0 | 82 |
//#define TRACE_ON |
sl@0 | 83 |
|
sl@0 | 84 |
|
sl@0 | 85 |
#ifdef TRACE_CHECK_FAILURES |
sl@0 | 86 |
static TInt CheckFail(const char* aFile,TUint aLine) |
sl@0 | 87 |
{ |
sl@0 | 88 |
RDebug::Printf("\nLoader check failure: %s line %d\n",aFile,aLine); |
sl@0 | 89 |
return 0; |
sl@0 | 90 |
} |
sl@0 | 91 |
#define CHECK_FAIL CheckFail(__FILE__,__LINE__) |
sl@0 | 92 |
#define CHECK_FAILURE(_r) (void)(_r==0 || CHECK_FAIL) |
sl@0 | 93 |
#else |
sl@0 | 94 |
#define CHECK_FAIL ((void)0) |
sl@0 | 95 |
#define CHECK_FAILURE(_r) ((void)0) |
sl@0 | 96 |
#endif |
sl@0 | 97 |
|
sl@0 | 98 |
#define RETURN_FAILURE(_r) return (CHECK_FAIL,_r) |
sl@0 | 99 |
#define LEAVE_FAILURE(_r) User::Leave((CHECK_FAIL,_r)) |
sl@0 | 100 |
|
sl@0 | 101 |
#ifdef TRACE_ON |
sl@0 | 102 |
#define TRACE(_t) RDebug::Printf _t |
sl@0 | 103 |
#else |
sl@0 | 104 |
#define TRACE(_t) ((void)0) |
sl@0 | 105 |
#endif |
sl@0 | 106 |
#define E32IMAGEHEADER_TRACE TRACE |
sl@0 | 107 |
|
sl@0 | 108 |
|
sl@0 | 109 |
|
sl@0 | 110 |
#endif |