91 lines
3.5 KiB
C
91 lines
3.5 KiB
C
/****************************************************************************
|
|
|
|
|
| (C) Copyright 1985, 1991, 1993, 1996-1999 Novell, Inc.
|
|
| All Rights Reserved.
|
|
|
|
|
| This program is free software; you can redistribute it and/or
|
|
| modify it under the terms of version 2 of the GNU General Public
|
|
| License as published by the Free Software Foundation.
|
|
|
|
|
| This program 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 General Public License for more details.
|
|
|
|
|
| You should have received a copy of the GNU General Public License
|
|
| along with this program; if not, contact Novell, Inc.
|
|
|
|
|
| To contact Novell about this file by physical or electronic mail,
|
|
| you may find current contact information at www.novell.com
|
|
|
|
|
|***************************************************************************
|
|
|
|
|
| Netware file compression algorithm ported to NSS
|
|
|
|
|
|---------------------------------------------------------------------------
|
|
|
|
|
| $Author: taysom $
|
|
| $Date: 2004-12-31 01:10:58 +0530 (Fri, 31 Dec 2004) $
|
|
|
|
|
| $RCSfile$
|
|
| $Revision: 465 $
|
|
|
|
|
|---------------------------------------------------------------------------
|
|
| Module Description:
|
|
|
|
|
+-------------------------------------------------------------------------*/
|
|
#ifndef _CDNETWAR_H_
|
|
#define _CDNETWAR_H_
|
|
|
|
#define CD_SYSTEM_CACHE_BUFFER_SHIFT 12
|
|
#define CD_SYSTEM_CACHE_BUFFER_SIZE (1 << CD_SYSTEM_CACHE_BUFFER_SHIFT)
|
|
#define CD_SYSTEM_CACHE_BUFFER_LONGS (1 << (CD_SYSTEM_CACHE_BUFFER_SHIFT - 2))
|
|
#define CD_SYSTEM_CACHE_BUFFER_MASK (CD_SYSTEM_CACHE_BUFFER_SIZE - 1)
|
|
|
|
#define CD_SYSTEM_SECTOR_SHIFT 9
|
|
#define CD_SYSTEM_SECTOR_SIZE (1 << CD_SYSTEM_SECTOR_SHIFT)
|
|
#define CD_SYSTEM_SECTORS_PER_BUFFER \
|
|
(1 << (CD_SYSTEM_CACHE_BUFFER_SHIFT - CD_SYSTEM_SECTOR_SHIFT))
|
|
|
|
/* we need something to put a hole here unless the pre allocated FAT chain
|
|
will automatically jump over holes */
|
|
|
|
/****************************************************************************/
|
|
/* BEGIN routines for compression/decompression */
|
|
|
|
LONG NSSCCDDecompressBuildFile( IoHandle_t outHandle, LONG offset, LONG size,
|
|
LONG prevSize, LONG nextSize );
|
|
|
|
LONG NSSCCDReturnWriteCacheBlock( LONG CacheHandle , IoHandle_t fileHandle,
|
|
LONG NumberOfSectors, LONG NoFlushFlag );
|
|
|
|
void NSSCCDReturnReadCacheBlock(IoHandle_t fileHandle, LONG CacheHandle);
|
|
|
|
LONG NSSCCDGetWriteCacheBlock( IoHandle_t fileHandle, LONG CacheBlockNumber,
|
|
LONG NoFlushFlag, BYTE **CacheBlock, LONG *CacheHandle );
|
|
|
|
LONG NSSCCDGetReadCacheBlock(IoHandle_t fileHandle, LONG CacheBlockNumber,
|
|
LONG *RealBytesRead, BYTE **CacheBlock, LONG *CacheHandle,
|
|
LONG *HoleFlag);
|
|
|
|
LONG NSSCCDPrepareForRead(IoHandle_t fileHandle, LONG FileSize,
|
|
readCache_tpp ReadCacheHandleReturn);
|
|
|
|
#define NSSCCDStartReadAhead(_fh, _fs, _readcache_handle_return, _ra_window) \
|
|
NSSCCDPrepareForRead(_fh, _fs, _readcache_handle_return)
|
|
|
|
LONG NSSCCDStopReadAhead(readCache_tp cacheHandle);
|
|
|
|
LONG NSSCCDFreeReadAheadBuffer( readCache_tp readCacheHandle );
|
|
|
|
LONG NSSCCDGetReadAheadBuffer(readCache_tp readCache, BYTE **cachePointer,
|
|
LONG *validBytes, LONG *holeFlag );
|
|
|
|
/* END routines for compression/decompression */
|
|
/****************************************************************************/
|
|
|
|
#endif /* _CD_NETWAR_H_ */
|
|
|
|
/****************************************************************************/
|
|
/****************************************************************************/
|