File: zutils.h

package info (click to toggle)
afbackup 3.3.6pl4-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,872 kB
  • ctags: 3,143
  • sloc: ansic: 44,316; tcl: 4,189; sh: 2,263; csh: 2,077; makefile: 566; sed: 93; perl: 80
file content (64 lines) | stat: -rw-r--r-- 1,558 bytes parent folder | download
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
/****************** Start of $RCSfile: zutils.h,v $  ****************
*
* $Source: /home/alb/afbackup/afbackup-3.3.6/RCS/zutils.h,v $
* $Id: zutils.h,v 1.1 2001/11/02 10:37:28 alb Exp alb $
* $Date: 2001/11/02 10:37:28 $
* $Author: alb $
*
*
******* description ***********************************************
*
*
*
*******************************************************************/

#ifndef	__ZUTILS_H
#define	__ZUTILS_H	__ZUTILS_H

#ifdef	USE_ZLIB

#include <zlib.h>

#define	Z_UNINITIALIZED		0
#define	Z_INIT_FOR_INFLATE	1
#define	Z_INIT_FOR_DEFLATE	2

typedef	struct ZFile_s	{
  Int8		initialized;
  Int32		level;
  Int32		maxblock;
  int		fd;
  Flag		compr_done;
  Flag		file_exh;
  Int32		numblock;
  z_stream	z_stream;
  UChar		filebuf[0x2000];
} ZFile;

#define	ZFILE_INIT	{			\
			Z_UNINITIALIZED,	\
			(Int32) 0,		\
			(Int32) 0,		\
			(int) -1,		\
			NO,			\
			NO,			\
			(Int32) 0,		\
			}

#define	zfile_init(zf)	{ ZFile zfile_i = ZFILE_INIT;	\
			  memset(&(zfile_i.z_stream), 0, sizeof(z_stream)); \
			  memset(&(zfile_i.filebuf), 0, sizeof(zfile_i.filebuf)); \
			  memcpy((zf), &zfile_i, sizeof(zfile_i)); }

extern	Int32	reset_zfile(ZFile *);
extern	Int32	open_file_zip(ZFile *, int, Int32, Int32);
extern	Int32	open_file_unzip(ZFile *, int);
extern	Int32	read_file_zip(ZFile *, UChar *, Int32,
					Int32 (*)(int, UChar *, Int32));
extern	Int32	write_file_unzip(ZFile *, UChar *, Int32, Flag,
					Int32 (*)(int, UChar *, Int32));
extern	void	close_file_zip(ZFile *);

#endif	/* defined(USE_ZLIB) */

#endif	/* !defined(__ZUTILS_H) */