1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/brdbootldr/ubootldr/inc/unzip.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,73 @@
1.4 +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// bootldr\inc\unzip.h
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __UNZIP_H__
1.22 +#define __UNZIP_H__
1.23 +#include <e32cmn.h>
1.24 +#include <f32file.h>
1.25 +
1.26 +#ifdef __KERNEL_MODE__
1.27 +#define MALLOC(x) Kern::Alloc(x)
1.28 +#define FREE(x) Kern::Free(x)
1.29 +#define WAIT_FOR_ANY_REQUEST() Kern::WaitForAnyRequest()
1.30 +#else
1.31 +#include <e32std.h>
1.32 +#define MALLOC(x) User::Alloc(x)
1.33 +#define FREE(x) User::Free(x)
1.34 +#define WAIT_FOR_ANY_REQUEST() User::WaitForAnyRequest()
1.35 +#define WAIT_FOR_REQUEST(x) User::WaitForRequest(x)
1.36 +#define DELAY(x) User::After(x)
1.37 +#endif
1.38 +
1.39 +const TInt KZipLocalHeaderLen=30;
1.40 +const TInt KZipExtHeaderLen=16;
1.41 +const TUint KZipSignature=0x04034b50u;
1.42 +const TInt KZipWindowSize=0x8000;
1.43 +
1.44 +class TZipInfo
1.45 + {
1.46 +public:
1.47 + TInt iFlags;
1.48 + TInt iMethod;
1.49 + TUint iCrc;
1.50 + TInt iCompressedSize;
1.51 + TInt iUncompressedSize;
1.52 + TInt iFileNameLength;
1.53 + TInt iExtraLength;
1.54 + TInt iNameOffset;
1.55 + TInt iDataOffset;
1.56 + TBuf<128> iName;
1.57 + TUint iInBufSize; // must be a power of 2
1.58 + volatile TUint iFileBufW;
1.59 + volatile TUint iFileBufR;
1.60 + TUint iFileBufSize; // must be a power of 2 and a multiple of iInBufSize
1.61 + TUint8* iFileBuf;
1.62 + TRequestStatus iProcessedHeader;
1.63 + volatile TInt iHeaderDone;
1.64 + TUint8* iOutBuf;
1.65 + TInt iRemain;
1.66 + TInt iThreadHandle;
1.67 + TRequestStatus iThreadStatus;
1.68 + };
1.69 +
1.70 +GLREF_C void AcceptUnzippedBlock(TZipInfo& aInfo, TUint8*& aOutPtr, TInt aError);
1.71 +GLREF_C TInt InitInfo(TZipInfo& a);
1.72 +GLREF_C TInt UnzipThread(TAny* aInfo);
1.73 +GLREF_C TInt ReadBlockToBuffer(TZipInfo& a, RFile &aBootFile);
1.74 +GLREF_C TInt ReadInputData(TUint8* aDest, TInt& aLength);
1.75 +GLREF_C TInt UnzipComplete(TZipInfo& a, TUint8* aOutPtr, TInt aError);
1.76 +#endif