1 /* ------------------------------------------------------------------------ */
2 /* LHa for UNIX Archiver Driver */
4 /* Modified Nobutaka Watazaki */
6 /* Ver. 1.14 Soruce All chagned 1995.01.14 N.Watazaki */
7 /* Ver. 1.14i Modified and bug fixed 2000.10.06 t.okamoto */
8 /* ------------------------------------------------------------------------ */
11 lharc.h interface.h slidehuf.h
21 #include <sys/types.h>
28 # define va_init(a,b) va_start(a,b)
31 # define va_init(a,b) va_start(a)
48 #include "lha_macro.h"
50 struct encode_option {
51 #if defined(__STDC__) || defined(AIX)
53 void (*encode_start) ();
54 void (*encode_end) ();
57 int (*encode_start) ();
62 struct decode_option {
63 unsigned short (*decode_c) ();
64 unsigned short (*decode_p) ();
65 #if defined(__STDC__) || defined(AIX)
66 void (*decode_start) ();
68 int (*decode_start) ();
72 /* ------------------------------------------------------------------------ */
73 /* LHa File Type Definition */
74 /* ------------------------------------------------------------------------ */
82 typedef struct LzHeader {
83 unsigned char header_size;
84 char method[METHOD_TYPE_STRAGE];
87 long last_modified_stamp;
88 unsigned char attribute;
89 unsigned char header_level;
93 unsigned char extend_type;
94 unsigned char minor_version;
96 /* extend_type == EXTEND_UNIX and convert from other type. */
97 time_t unix_last_modified_stamp;
98 unsigned short unix_mode;
99 unsigned short unix_uid;
100 unsigned short unix_gid;
108 unsigned long original;
109 unsigned long packed;
115 /* ------------------------------------------------------------------------ */
116 /* Option switch variable */
117 /* ------------------------------------------------------------------------ */
118 /* command line options (common options) */
119 EXTERN boolean quiet;
120 EXTERN boolean text_mode;
121 EXTERN boolean verbose;
122 EXTERN boolean noexec; /* debugging option */
123 EXTERN boolean force;
125 EXTERN boolean delete_after_append;
126 EXTERN int compress_method;
127 EXTERN int header_level;
128 /* EXTERN int quiet_mode; */ /* 1996.8.13 t.okamoto */
130 EXTERN boolean euc_mode;
133 /* list command flags */
134 EXTERN boolean verbose_listing;
136 /* extract/print command flags */
137 EXTERN boolean output_to_stdout;
139 /* add/update/delete command flags */
140 EXTERN boolean new_archive;
141 EXTERN boolean update_if_newer;
142 EXTERN boolean generic_format;
144 EXTERN boolean remove_temporary_at_error;
145 EXTERN boolean recover_archive_when_interrupt;
146 EXTERN boolean remove_extracting_file_when_interrupt;
147 EXTERN boolean get_filename_from_stdin;
148 EXTERN boolean ignore_directory;
149 EXTERN boolean verify_mode;
152 EXTERN int quiet_mode;
154 /* ------------------------------------------------------------------------ */
155 /* Globale Variable */
156 /* ------------------------------------------------------------------------ */
157 EXTERN char **cmd_filev;
158 EXTERN int cmd_filec;
160 EXTERN char *archive_name;
161 EXTERN char temporary_name[FILENAME_LENGTH];
162 EXTERN char backup_archive_name[FILENAME_LENGTH];
164 extern char *extract_directory;
165 EXTERN char *reading_filename, *writting_filename;
167 /* 1996.8.13 t.okamoto */
169 EXTERN boolean remove_temporary_at_error;
170 EXTERN boolean recover_archive_when_interrupt;
171 EXTERN boolean remove_extracting_file_when_interrupt;
174 EXTERN int archive_file_mode;
175 EXTERN int archive_file_gid;
177 EXTERN struct interfacing interface;
179 /* EXTERN unsigned short crc; */ /* 1996.8.13 t.okamoto */
181 EXTERN int noconvertcase; /* 2000.10.6 */
184 EXTERN int unpackable;
185 EXTERN unsigned long origsize, compsize;
186 EXTERN unsigned short dicbit;
187 EXTERN unsigned short maxmatch;
188 EXTERN unsigned long count;
189 EXTERN unsigned long loc; /* short -> long .. Changed N.Watazaki */
190 EXTERN unsigned char *text;
191 EXTERN int prev_char;
194 #ifndef LHA_MAIN_SRC /* t.okamoto 96/2/20 */
195 EXTERN unsigned short left[], right[];
196 EXTERN unsigned char c_len[], pt_len[];
197 EXTERN unsigned short c_freq[], c_table[], c_code[];
198 EXTERN unsigned short p_freq[], pt_table[], pt_code[], t_freq[];
202 #ifdef NEED_INCREMENTAL_INDICATOR
203 EXTERN long indicator_count;
204 EXTERN long indicator_threshold;
208 EXTERN FILE *infile, *outfile;
209 EXTERN unsigned short crc, bitbuf;
211 EXTERN long reading_size;
214 EXTERN unsigned int n_max;
217 EXTERN int temporary_fd;
219 /* ------------------------------------------------------------------------ */
221 /* ------------------------------------------------------------------------ */
222 #include "prototypes.h"
224 /* Local Variables: */
228 /* vi: set tabstop=4: */