File: ar.h

package info (click to toggle)
zoo 2.10-21
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 852 kB
  • ctags: 1,258
  • sloc: ansic: 8,944; asm: 793; makefile: 179
file content (128 lines) | stat: -rw-r--r-- 3,097 bytes parent folder | download | duplicates (6)
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
/*$Source: /usr/home/dhesi/zoo/RCS/ar.h,v $*/
/*$Id: ar.h,v 1.17 91/07/09 01:39:50 dhesi Exp $*/
/***********************************************************
	ar.h

Adapted from "ar" archiver written by Haruhiko Okumura.
***********************************************************/

#include <stdio.h>

#ifdef ANSI_HDRS
# include <limits.h>
#endif

/* uchar should be 8 bits or more */
/* typedef unsigned char  uchar;   -- already in zoo.h */

typedef unsigned int   uint;    /* 16 bits or more */
typedef unsigned short ushort;  /* 16 bits or more */
typedef unsigned long  ulong;   /* 32 bits or more */

/* T_UINT16 must be #defined in options.h to be 
a 16-bit unsigned integer type */

#ifndef T_UINT16
# include "T_UINT16 not defined"
#endif

typedef T_UINT16		  t_uint16;	/* exactly 16 bits */

#ifndef SEEK_SET
# define SEEK_SET 0
#endif
#ifndef SEEK_CUR
# define SEEK_CUR 1
#endif
#ifndef SEEK_END
# define SEEK_END 2
#endif
#ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
#endif
#ifndef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif

/* ar.c */

extern int unpackable;
extern ulong origsize, compsize;

/* all the prototypes follow here for all files */

/* standard library functions */
#ifndef ANSI_HDRS
 extern void exit();
 extern long ftell();
 extern int fseek();
 extern int strlen();
 extern char *strchr();
 extern char *strpbrk();
 extern int strcmp();
 extern char *strcpy();
 extern int memcmp();
 extern VOIDPTR malloc();
 extern VOIDPTR memcpy();
#endif /* ANSI_HDRS */

/* AR.C */
int get_line PARMS((char *s , int n ));
void exitfunc PARMS((int code));
void dlog PARMS((char *fmt, ...));
void d1log PARMS((char *fmt, ...));
void outcf PARMS((FILE *stream, char *buf, int n));
void c1log PARMS((char *buf, int n));

/* DECODE.C */
void decode_start PARMS((void ));
int decode PARMS((uint count , uchar buffer []));

/* ENCODE.C */
void encode PARMS((FILE *, FILE *));

/* HUF.C */
void output PARMS((uint c , uint p ));
void huf_encode_start PARMS((void ));
void huf_encode_end PARMS((void ));
uint decode_c PARMS((void ));
uint decode_p PARMS((void ));
void huf_decode_start PARMS((void ));

/* IO.C */
void make_crctable PARMS((void ));
void fillbuf PARMS((int n ));
uint getbits PARMS((int n ));
void putbits PARMS((int n , uint x ));
int fread_crc PARMS((uchar *p , int n , FILE *f ));
void fwrite_crc PARMS((uchar *p , int n , FILE *f ));
void init_getbits PARMS((void ));
void init_putbits PARMS((void ));

/* MAKETBL.C */
void make_table
	PARMS((int nchar, uchar bitlen[], int tablebits, ushort table[]));

/* MAKETREE.C */
int make_tree
	PARMS((int nparm, ushort freqparm [], uchar lenparm [], ushort codeparm []));

/* delete */

#ifdef NEED_MEMMOVE
# define MOVE_LEFT move_left
  void move_left();
#else
# define MOVE_LEFT memmove
 extern VOIDPTR memmove();
#endif

#if 0
/* global crc variable stuff for use by various routines */
extern t_uint16 crc;
#define INIT_CRC  0  /* CCITT: 0xFFFF */
#endif

/* for lzh modules and also for ar.c to use in defining buffer size */
#define DICBIT    13    /* 12(-lh4-) or 13(-lh5-) */
#define DICSIZ ((unsigned) 1 << DICBIT)