/usr/include/wv2/zcodec.hxx is in libwv2-dev 0.4.2.dfsg.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | /*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: zcodec.hxx,v $
*
* $Revision: 1.4 $
*
* last change: $Author: tuubaaku $ $Date: 2009/02/14 02:51:13 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
************************************************************************/
#ifndef _ZCODEC_HXX
#define _ZCODEC_HXX
//#ifndef INCLUDED_TOOLSDLLAPI_H
//#include "tools/toolsdllapi.h"
//#endif
//#ifndef _SOLAR_H
//#include <tools/solar.h>
//#endif
#include "global.h" //for U8
#include <vector> //for std::vector
// -----------
// - Defines -
// -----------
#define DEFAULT_IN_BUFSIZE (0x00008000UL)
#define DEFAULT_OUT_BUFSIZE (0x00008000UL)
#define MAX_MEM_USAGE 8
//
// memory requirement using compress:
// [ INBUFFER ] + [ OUTBUFFER ] + 128KB + 1 << (MEM_USAGE+9)
//
// memory requirement using decompress:
// [ INBUFFER ] + [ OUTBUFFER ] + 32KB
//
#define ZCODEC_NO_COMPRESSION (0x00000000UL)
#define ZCODEC_BEST_SPEED (0x00000001UL)
#define ZCODEC_DEFAULT_COMPRESSION (0x00000006UL)
#define ZCODEC_BEST_COMPRESSION (0x00000009UL)
#define ZCODEC_DEFAULT_STRATEGY (0x00000000UL)
#define ZCODEC_ZFILTERED (0x00000100UL)
#define ZCODEC_ZHUFFMAN_ONLY (0x00000200UL)
#define ZCODEC_UPDATE_CRC (0x00010000UL)
#define ZCODEC_GZ_LIB (0x00020000UL)
#define ZCODEC_PNG_DEFAULT ( ZCODEC_NO_COMPRESSION | ZCODEC_DEFAULT_STRATEGY | ZCODEC_UPDATE_CRC )
#define ZCODEC_DEFAULT ( ZCODEC_DEFAULT_COMPRESSION | ZCODEC_DEFAULT_STRATEGY )
// ----------
// - ZCodec -
// ----------
//class OLEStreamReader;
//class OLEStreamWriter;
using namespace wvWare;
typedef unsigned long ULONG;
typedef bool BOOL;
typedef U8 BYTE;
class ZCodec
{
private:
ULONG mbInit;
BOOL mbStatus; //status good or bad
BOOL mbFinish; //are we finished yet?
ULONG mnMemUsage; //total memory we can use?
OLEStreamReader* mpIStm; //in-stream
BYTE* mpInBuf; //in-buffer
ULONG mnInBufSize; //size of the in-buffer
ULONG mnInToRead; //how many bytes overall we still want to read
OLEStreamWriter* mpOStm; //out-stream
BYTE* mpOutBuf; //out-buffer
ULONG mnOutBufSize; //size of the out-buffer
ULONG mnCRC;
ULONG mnCompressMethod;
void* mpsC_Stream;
void ImplInitBuf( BOOL nIOFlag );
void ImplWriteBack( std::vector<U8>* outBuffer );
public:
ZCodec( ULONG nInBuf, ULONG nOutBuf, ULONG nMemUsage = MAX_MEM_USAGE );
ZCodec( void );
virtual ~ZCodec();
virtual void BeginCompression( ULONG nCompressMethod = ZCODEC_DEFAULT );
virtual long EndCompression(std::vector<U8>* outBuffer);
BOOL IsFinished () const { return mbFinish; }
long Compress( OLEStreamReader& rIStm, OLEStreamWriter& rOStm );
long Decompress( OLEStreamReader& rIStm, std::vector<U8>* outBuffer );
//long Write( OLEStreamWriter& rOStm, const BYTE* pData, ULONG nSize );
//long Read( OLEStreamReader& rIStm, BYTE* pData, ULONG nSize );
//long ReadAsynchron( OLEStreamReader& rIStm, BYTE* pData, ULONG nSize );
void SetBreak( ULONG );
//ULONG GetBreak( void );
//void SetCRC( ULONG nCurrentCRC );
//ULONG UpdateCRC( ULONG nLatestCRC, ULONG nSource );
//ULONG UpdateCRC( ULONG nLatestCRC, BYTE* pSource, long nDatSize );
//ULONG GetCRC();
};
class GZCodec : public ZCodec
{
public:
GZCodec(){};
~GZCodec(){};
virtual void BeginCompression( ULONG nCompressMethod = ZCODEC_DEFAULT );
};
#endif // _ZCODEC_HXX
|