… | |
… | |
15 | */ |
15 | */ |
16 | |
16 | |
17 | #ifndef __UUDEVIEW_H__ |
17 | #ifndef __UUDEVIEW_H__ |
18 | #define __UUDEVIEW_H__ |
18 | #define __UUDEVIEW_H__ |
19 | |
19 | |
|
|
20 | #include <stdint.h> |
|
|
21 | |
20 | /* |
22 | /* |
21 | * This include file features all the definitions that should |
23 | * This include file features all the definitions that should |
22 | * be externally visible. This isn't much. |
24 | * be externally visible. This isn't much. |
23 | * |
25 | * |
24 | * $Id: uudeview.h,v 1.1.2.4 2003/11/06 13:08:23 root Exp $ |
26 | * $Id: uudeview.h,v 1.11 2020/12/12 10:48:39 root Exp $ |
25 | */ |
27 | */ |
26 | |
28 | |
27 | #ifndef _ANSI_ARGS_ |
29 | #ifndef _ANSI_ARGS_ |
28 | #ifdef PROTOTYPES |
30 | #ifdef PROTOTYPES |
29 | #define _ANSI_ARGS_(c) c |
31 | #define _ANSI_ARGS_(c) c |
… | |
… | |
86 | |
88 | |
87 | /* |
89 | /* |
88 | * Option indices for GetOption / SetOption |
90 | * Option indices for GetOption / SetOption |
89 | */ |
91 | */ |
90 | |
92 | |
|
|
93 | #define UUOPT_RBUF (90) /* file read I/O buffer size */ |
|
|
94 | #define UUOPT_WBUF (91) /* file write I/O buffer size */ |
91 | #define UUOPT_VERSION (0) /* version number MAJOR.MINORplPATCH (ro) */ |
95 | #define UUOPT_VERSION (0) /* version number MAJOR.MINORplPATCH (ro) */ |
92 | #define UUOPT_FAST (1) /* assumes only one part per file */ |
96 | #define UUOPT_FAST (1) /* assumes only one part per file */ |
93 | #define UUOPT_DUMBNESS (2) /* switch off the program's intelligence */ |
97 | #define UUOPT_DUMBNESS (2) /* switch off the program's intelligence */ |
94 | #define UUOPT_BRACKPOL (3) /* give numbers in [] higher precendence */ |
98 | #define UUOPT_BRACKPOL (3) /* give numbers in [] higher precendence */ |
95 | #define UUOPT_VERBOSE (4) /* generate informative messages */ |
99 | #define UUOPT_VERBOSE (4) /* generate informative messages */ |
… | |
… | |
105 | #define UUOPT_PREAMB (17) /* handle Mime preambles/epilogues */ |
109 | #define UUOPT_PREAMB (17) /* handle Mime preambles/epilogues */ |
106 | #define UUOPT_TINYB64 (18) /* detect short B64 outside of Mime */ |
110 | #define UUOPT_TINYB64 (18) /* detect short B64 outside of Mime */ |
107 | #define UUOPT_ENCEXT (19) /* extension for single-part encoded files */ |
111 | #define UUOPT_ENCEXT (19) /* extension for single-part encoded files */ |
108 | #define UUOPT_REMOVE (20) /* remove input files after decoding */ |
112 | #define UUOPT_REMOVE (20) /* remove input files after decoding */ |
109 | #define UUOPT_MOREMIME (21) /* strict MIME adherence */ |
113 | #define UUOPT_MOREMIME (21) /* strict MIME adherence */ |
|
|
114 | #define UUOPT_DOTDOT (22) /* .. unescaping has not yet been done on input files */ |
|
|
115 | #define UUOPT_AUTOCHECK (23) /* call checkgloballist after every part */ |
110 | |
116 | |
111 | /* |
117 | /* |
112 | * Code for the "action" in the progress structure |
118 | * Code for the "action" in the progress structure |
113 | */ |
119 | */ |
114 | |
120 | |
… | |
… | |
130 | * After inserting a bunch of files, UUCheckGlobalList must be called |
136 | * After inserting a bunch of files, UUCheckGlobalList must be called |
131 | * to update the states. |
137 | * to update the states. |
132 | */ |
138 | */ |
133 | |
139 | |
134 | typedef struct _uulist { |
140 | typedef struct _uulist { |
|
|
141 | struct _uulist *NEXT; /* next item of the list */ |
|
|
142 | struct _uulist *PREV; /* previous item of the list */ |
|
|
143 | |
135 | short state; /* Status as described by the macros above */ |
144 | uint8_t state; /* Status as described by the macros above */ |
136 | short mode; /* file mode as found on begin line */ |
|
|
137 | |
145 | |
138 | int begin; /* part number where begin was detected */ |
146 | int begin; /* part number where begin was detected */ |
139 | int end; /* part number where end was detected */ |
147 | int end; /* part number where end was detected */ |
140 | |
148 | |
|
|
149 | uint32_t filename_hash; /* hash of filename for faster comparisons */ |
|
|
150 | uint32_t mimeid_hash; /* hash of filename for faster comparisons */ |
|
|
151 | |
141 | short uudet; /* Encoding type (see macros above) */ |
152 | uint8_t uudet; /* Encoding type (see macros above) */ |
142 | int flags; /* flags, especially for single-part files */ |
153 | uint8_t flags; /* flags, especially for single-part files */ |
143 | |
154 | |
144 | long size; /* approximate size of resulting file */ |
|
|
145 | char *filename; /* malloc'ed file name */ |
155 | char *filename; /* malloc'ed file name */ |
146 | char *subfname; /* malloc'ed ID from subject line */ |
156 | char *subfname; /* malloc'ed ID from subject line */ |
147 | char *mimeid; /* malloc'ed MIME-ID, if available */ |
157 | char *mimeid; /* malloc'ed MIME-ID, if available */ |
148 | char *mimetype; /* malloc'ed Content-Type, if available */ |
158 | char *mimetype; /* malloc'ed Content-Type, if available */ |
149 | |
159 | |
150 | char *binfile; /* name of temp file, if already decoded */ |
160 | char *binfile; /* name of temp file, if already decoded */ |
|
|
161 | long size; /* approximate size of resulting file */ |
151 | |
162 | |
152 | struct _uufile *thisfile; /* linked list of this file's parts */ |
163 | struct _uufile *thisfile; /* linked list of this file's parts */ |
153 | |
164 | |
154 | int *haveparts; /* the parts we have (max. 256 are listed) */ |
165 | int *haveparts; /* the parts we have (max. 256 are listed) */ |
155 | int *misparts; /* list of missing parts (max. 256) */ |
166 | int *misparts; /* list of missing parts (max. 256) */ |
156 | |
167 | |
157 | struct _uulist *NEXT; /* next item of the list */ |
168 | uint16_t mode; /* file mode as found on begin line */ |
158 | struct _uulist *PREV; /* previous item of the list */ |
|
|
159 | } uulist; |
169 | } uulist; |
160 | |
170 | |
161 | /* |
171 | /* |
162 | * The "progress" structure which is passed to the Busy Callback |
172 | * The "progress" structure which is passed to the Busy Callback |
163 | */ |
173 | */ |
… | |
… | |
170 | long fsize; /* size of the current file */ |
180 | long fsize; /* size of the current file */ |
171 | int percent; /* % of _current part_ */ |
181 | int percent; /* % of _current part_ */ |
172 | long foffset; /* file offset -- internal use only */ |
182 | long foffset; /* file offset -- internal use only */ |
173 | long totsize; /* file total size -- internal use only */ |
183 | long totsize; /* file total size -- internal use only */ |
174 | } uuprogress; |
184 | } uuprogress; |
175 | |
185 | |
176 | |
186 | |
177 | /* |
187 | /* |
178 | * Externally visible Functions |
188 | * Externally visible Functions |
179 | */ |
189 | */ |
180 | |
190 | |
… | |
… | |
189 | int UUEXPORT UUInitialize _ANSI_ARGS_((void)); |
199 | int UUEXPORT UUInitialize _ANSI_ARGS_((void)); |
190 | int UUEXPORT UUGetOption _ANSI_ARGS_((int, int *, char *, int)); |
200 | int UUEXPORT UUGetOption _ANSI_ARGS_((int, int *, char *, int)); |
191 | int UUEXPORT UUSetOption _ANSI_ARGS_((int, int, char *)); |
201 | int UUEXPORT UUSetOption _ANSI_ARGS_((int, int, char *)); |
192 | char * UUEXPORT UUstrerror _ANSI_ARGS_((int)); |
202 | char * UUEXPORT UUstrerror _ANSI_ARGS_((int)); |
193 | int UUEXPORT UUSetMsgCallback _ANSI_ARGS_((void *, |
203 | int UUEXPORT UUSetMsgCallback _ANSI_ARGS_((void *, |
194 | void (*) (void *, |
204 | void (*) (void *, |
195 | char *, |
205 | char *, |
196 | int))); |
206 | int))); |
197 | int UUEXPORT UUSetBusyCallback _ANSI_ARGS_((void *, |
207 | int UUEXPORT UUSetBusyCallback _ANSI_ARGS_((void *, |
198 | int (*) (void *, |
208 | int (*) (void *, |
199 | uuprogress *), |
209 | uuprogress *), |
… | |
… | |
202 | int (*) (void *, char *, |
212 | int (*) (void *, char *, |
203 | char *, int))); |
213 | char *, int))); |
204 | int UUEXPORT UUSetFNameFilter _ANSI_ARGS_((void *, |
214 | int UUEXPORT UUSetFNameFilter _ANSI_ARGS_((void *, |
205 | char * (*) (void *, |
215 | char * (*) (void *, |
206 | char *))); |
216 | char *))); |
|
|
217 | int UUEXPORT UUSetFileNameCallback _ANSI_ARGS_((void *, |
|
|
218 | char * (*) (void *, |
|
|
219 | char *, char *))); |
207 | char * UUEXPORT UUFNameFilter _ANSI_ARGS_((char *)); |
220 | char * UUEXPORT UUFNameFilter _ANSI_ARGS_((char *)); |
208 | int UUEXPORT UULoadFile _ANSI_ARGS_((char *, char *, int)); |
221 | int UUEXPORT UULoadFile _ANSI_ARGS_((char *, char *, int, int *)); |
209 | int UUEXPORT UULoadFileWithPartNo _ANSI_ARGS_((char *, char *, int, int)); |
222 | int UUEXPORT UULoadFileWithPartNo _ANSI_ARGS_((char *, char *, int, int, int *)); |
210 | uulist *UUEXPORT UUGetFileListItem _ANSI_ARGS_((int)); |
223 | uulist *UUEXPORT UUGetFileListItem _ANSI_ARGS_((int)); |
211 | int UUEXPORT UURenameFile _ANSI_ARGS_((uulist *, char *)); |
224 | int UUEXPORT UURenameFile _ANSI_ARGS_((uulist *, char *)); |
212 | int UUEXPORT UUDecodeToTemp _ANSI_ARGS_((uulist *)); |
225 | int UUEXPORT UUDecodeToTemp _ANSI_ARGS_((uulist *)); |
213 | int UUEXPORT UURemoveTemp _ANSI_ARGS_((uulist *)); |
226 | int UUEXPORT UURemoveTemp _ANSI_ARGS_((uulist *)); |
214 | int UUEXPORT UUDecodeFile _ANSI_ARGS_((uulist *, char *)); |
227 | int UUEXPORT UUDecodeFile _ANSI_ARGS_((uulist *, char *)); |
215 | int UUEXPORT UUInfoFile _ANSI_ARGS_((uulist *, void *, |
228 | int UUEXPORT UUInfoFile _ANSI_ARGS_((uulist *, void *, |
216 | int (*) (void *, |
229 | int (*) (void *, |
217 | char *))); |
230 | char *))); |
218 | int UUEXPORT UUSmerge _ANSI_ARGS_((int)); |
231 | int UUEXPORT UUSmerge _ANSI_ARGS_((int)); |
219 | int UUEXPORT UUCleanUp _ANSI_ARGS_((void)); |
232 | int UUEXPORT UUCleanUp _ANSI_ARGS_((void)); |
220 | |
233 | |
221 | int UUEXPORT UUQuickDecode _ANSI_ARGS_((FILE *, FILE *, |
234 | int UUEXPORT UUQuickDecode _ANSI_ARGS_((FILE *, FILE *, |
… | |
… | |
226 | char *, char *, int)); |
239 | char *, char *, int)); |
227 | int UUEXPORT UUEncodePartial _ANSI_ARGS_((FILE *, FILE *, |
240 | int UUEXPORT UUEncodePartial _ANSI_ARGS_((FILE *, FILE *, |
228 | char *, int, |
241 | char *, int, |
229 | char *, char *, |
242 | char *, char *, |
230 | int, int, long, |
243 | int, int, long, |
231 | unsigned long*)); |
244 | unsigned int *)); |
232 | int UUEXPORT UUEncodeToStream _ANSI_ARGS_((FILE *, FILE *, |
245 | int UUEXPORT UUEncodeToStream _ANSI_ARGS_((FILE *, FILE *, |
233 | char *, int, |
246 | char *, int, |
234 | char *, int)); |
247 | char *, int)); |
235 | int UUEXPORT UUEncodeToFile _ANSI_ARGS_((FILE *, char *, int, |
248 | int UUEXPORT UUEncodeToFile _ANSI_ARGS_((FILE *, char *, int, |
236 | char *, char *, long)); |
249 | char *, char *, long)); |
… | |
… | |
255 | char *, int, |
268 | char *, int, |
256 | char *, int, |
269 | char *, int, |
257 | int, long, long, char *, |
270 | int, long, long, char *, |
258 | char *, char *, char *, |
271 | char *, char *, char *, |
259 | int)); |
272 | int)); |
|
|
273 | void UUEXPORT UUCheckGlobalList (void); |
260 | #ifdef __cplusplus |
274 | #ifdef __cplusplus |
261 | } |
275 | } |
262 | #endif |
276 | #endif |
263 | #endif |
277 | #endif |