First public contribution.
1 // Copyright (c) 1998-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // bootldr\inc\unzip.h
23 #ifdef __KERNEL_MODE__
24 #define MALLOC(x) Kern::Alloc(x)
25 #define FREE(x) Kern::Free(x)
26 #define WAIT_FOR_ANY_REQUEST() Kern::WaitForAnyRequest()
29 #define MALLOC(x) User::Alloc(x)
30 #define FREE(x) User::Free(x)
31 #define WAIT_FOR_ANY_REQUEST() User::WaitForAnyRequest()
32 #define WAIT_FOR_REQUEST(x) User::WaitForRequest(x)
33 #define DELAY(x) User::After(x)
36 const TInt KZipLocalHeaderLen=30;
37 const TInt KZipExtHeaderLen=16;
38 const TUint KZipSignature=0x04034b50u;
39 const TInt KZipWindowSize=0x8000;
48 TInt iUncompressedSize;
54 TUint iInBufSize; // must be a power of 2
55 volatile TUint iFileBufW;
56 volatile TUint iFileBufR;
57 TUint iFileBufSize; // must be a power of 2 and a multiple of iInBufSize
59 TRequestStatus iProcessedHeader;
60 volatile TInt iHeaderDone;
64 TRequestStatus iThreadStatus;
67 GLREF_C void AcceptUnzippedBlock(TZipInfo& aInfo, TUint8*& aOutPtr, TInt aError);
68 GLREF_C TInt InitInfo(TZipInfo& a);
69 GLREF_C TInt UnzipThread(TAny* aInfo);
70 GLREF_C TInt ReadBlockToBuffer(TZipInfo& a, RFile &aBootFile);
71 GLREF_C TInt ReadInputData(TUint8* aDest, TInt& aLength);
72 GLREF_C TInt UnzipComplete(TZipInfo& a, TUint8* aOutPtr, TInt aError);