1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081 |
- #ifndef __zip_h
- #define __zip_h 1
- #define ZIP
- #define local static
- typedef unsigned char uch;
- typedef unsigned short ush;
- typedef unsigned long ulg;
- #include "tailor.h"
- #ifdef USE_ZLIB
- # include "zlib.h"
- #endif
- #if defined(UTIL) && !defined(UNICODE_SUPPORT)
- # define CRC_TABLE_ONLY
- #endif
- #define MIN_MATCH 3
- #define MAX_MATCH 258
- #ifndef WSIZE
- # define WSIZE (0x8000)
- #endif
- #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
- #define MAX_DIST (WSIZE-MIN_LOOKAHEAD)
- #ifdef DOS
- # define FNMAX 256
- #else
- # define FNMAX 1024
- #endif
- #ifndef MATCH
- # define MATCH shmatch
- #endif
- typedef struct iztimes {
- time_t atime;
- time_t mtime;
- time_t ctime;
- } iztimes;
- #define LOCHEAD 26
- #define CENHEAD 42
- #define ENDHEAD 18
- #define EC64LOC 16
- #define EC64REC 52
- struct zlist {
-
-
-
- ush vem, ver, flg, how;
- ulg tim, crc;
- uzoff_t siz, len;
-
- ush nam, ext, cext, com;
- ulg dsk;
- ush att, lflg;
- uzoff_t off;
- ulg atx;
- char *name;
- char *extra;
- char *cextra;
- char *comment;
- char *iname;
- char *zname;
- char *oname;
- #ifdef UNICODE_SUPPORT
-
- char *uname;
-
- char *zuname;
- char *ouname;
- # ifdef WIN32
- char *wuname;
- wchar_t *namew;
- wchar_t *inamew;
- wchar_t *znamew;
- # endif
- #endif
- int mark;
- int trash;
- int current;
- int dosflag;
- struct zlist far *nxt;
- };
- struct flist {
- char *name;
- char *iname;
- char *zname;
- char *oname;
- #ifdef UNICODE_SUPPORT
- char *uname;
- # ifdef WIN32
- wchar_t *namew;
- wchar_t *inamew;
- wchar_t *znamew;
- # endif
- #endif
- int dosflag;
- uzoff_t usize;
- struct flist far *far *lst;
- struct flist far *nxt;
- };
- struct plist {
- char *zname;
- int select;
- };
- #define UNKNOWN (-1)
- #define BINARY 0
- #define ASCII 1
- #define __EBCDIC 2
- #define EF_VMCMS 0x4704
- #define EF_MVS 0x470f
- #define EF_IZUNIX 0x5855
- #define EF_IZUNIX2 0x7855
- #define EF_TIME 0x5455
- #define EF_OS2EA 0x0009
- #define EF_ACL 0x4C41
- #define EF_NTSD 0x4453
- #define EF_BEOS 0x6542
- #define EF_ATHEOS 0x7441
- #define EF_QDOS 0xfb4a
- #define EF_AOSVS 0x5356
- #define EF_SPARK 0x4341
- #define EF_THEOS 0x6854
- #define EF_TANDEM 0x4154
- #define EF_SIZE_MAX ((unsigned)0xFFFF)
- #define EB_HEADSIZE 4
- #define EB_ID 0
- #define EB_LEN 2
- #define EB_MEMCMPR_HSIZ 6
- #define EB_DEFLAT_EXTRA 10
- #define EB_UX_MINLEN 8
- #define EB_UX_ATIME 0
- #define EB_UX_MTIME 4
- #define EB_UX_FULLSIZE 12
- #define EB_UX_UID 8
- #define EB_UX_GID 10
- #define EB_UT_MINLEN 1
- #define EB_UT_FLAGS 0
- #define EB_UT_TIME1 1
- #define EB_UT_FL_MTIME (1 << 0)
- #define EB_UT_FL_ATIME (1 << 1)
- #define EB_UT_FL_CTIME (1 << 2)
- #define EB_UT_LEN(n) (EB_UT_MINLEN + 4 * (n))
- #define EB_UX2_MINLEN 4
- #define EB_UX2_UID 0
- #define EB_UX2_GID 2
- #define EB_UX2_VALID (1 << 8)
- #define LF 10
- #define CR 13
- #define CTRLZ 26
- #define IZ_PW_ENTERED 0
- #define IZ_PW_CANCEL -1
- #define IZ_PW_CANCELALL -2
- #define IZ_PW_ERROR 5
- #define IZ_PW_SKIPVERIFY IZ_PW_CANCEL
- #define ZP_PW_ENTER 0
- #define ZP_PW_VERIFY 1
- #include "ziperr.h"
- #if 0
- # define CRCVAL_INITIAL crc32(0L, (uch *)NULL, 0)
- # if 00
- # define ADLERVAL_INITIAL adler16(0U, (uch *)NULL, 0)
- # endif
- #else
- # define CRCVAL_INITIAL 0L
- # if 00
- # define ADLERVAL_INITIAL 1
- # endif
- #endif
- #define DOSTIME_MINIMUM ((ulg)0x00210000L)
- #define DOSTIME_2038_01_18 ((ulg)0x74320000L)
- extern uch upper[256];
- extern uch lower[256];
- #ifdef EBCDIC
- extern ZCONST uch ascii[256];
- extern ZCONST uch ebcdic[256];
- #endif
- #if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB))
- extern ZCONST ulg near *crc_32_tab;
- #else
- extern ZCONST ulg Far *crc_32_tab;
- #endif
- #ifdef IZ_ISO2OEM_ARRAY
- extern ZCONST uch Far iso2oem[128];
- #endif
- #ifdef IZ_OEM2ISO_ARRAY
- extern ZCONST uch Far oem2iso[128];
- #endif
- extern char errbuf[FNMAX+4081];
- extern int recurse;
- extern int dispose;
- extern int pathput;
- #ifdef RISCOS
- extern int scanimage;
- #endif
- #define BEST -1
- #define STORE 0
- #define DEFLATE 8
- #define BZIP2 12
- #ifdef BZIP2_SUPPORT
- #define LAST_KNOWN_COMPMETHOD BZIP2
- #else
- #define LAST_KNOWN_COMPMETHOD DEFLATE
- #endif
- extern int method;
- extern ulg skip_this_disk;
- extern int des_good;
- extern ulg des_crc;
- extern uzoff_t des_csize;
- extern uzoff_t des_usize;
- extern int dosify;
- extern char *special;
- extern int verbose;
- extern int fix;
- extern int filesync;
- extern int adjust;
- extern int level;
- extern int translate_eol;
- #ifdef VMS
- extern int vmsver;
- extern int vms_native;
- extern int vms_case_2;
- extern int vms_case_5;
- # define cma$tis_errno_get_addr CMA$TIS_ERRNO_GET_ADDR
- # define lib$establish LIB$ESTABLISH
- # define lib$get_foreign LIB$GET_FOREIGN
- # define lib$get_input LIB$GET_INPUT
- # define lib$sig_to_ret LIB$SIG_TO_RET
- # define ots$cvt_tu_l OTS$CVT_TU_L
- # define str$concat STR$CONCAT
- # define str$find_first_substring STR$FIND_FIRST_SUBSTRING
- # define str$free1_dx STR$FREE1_DX
- # define sys$asctim SYS$ASCTIM
- # define sys$assign SYS$ASSIGN
- # define sys$bintim SYS$BINTIM
- # define sys$close SYS$CLOSE
- # define sys$connect SYS$CONNECT
- # define sys$dassgn SYS$DASSGN
- # define sys$display SYS$DISPLAY
- # define sys$getjpiw SYS$GETJPIW
- # define sys$open SYS$OPEN
- # define sys$parse SYS$PARSE
- # define sys$qiow SYS$QIOW
- # define sys$read SYS$READ
- # define sys$search SYS$SEARCH
- #endif
- #if defined(OS2) || defined(WIN32)
- extern int use_longname_ea;
- #endif
- #if defined (QDOS) || defined(QLZIP)
- extern short qlflag;
- #endif
- extern int no_wild;
- extern int allow_regex;
- extern int wild_stop_at_dir;
- #ifdef UNICODE_SUPPORT
- extern int using_utf8;
- # ifdef WIN32
- extern int no_win32_wide;
- # endif
- #endif
- extern zoff_t dot_size;
- extern zoff_t dot_count;
- extern int display_counts;
- extern int display_bytes;
- extern int display_globaldots;
- extern int display_volume;
- extern int display_usize;
- extern ulg files_so_far;
- extern ulg bad_files_so_far;
- extern ulg files_total;
- extern uzoff_t bytes_so_far;
- extern uzoff_t good_bytes_so_far;
- extern uzoff_t bad_bytes_so_far;
- extern uzoff_t bytes_total;
- extern int logall;
- extern FILE *logfile;
- extern int logfile_append;
- extern char *logfile_path;
- #ifdef WIN32
- extern int nonlocal_name;
- extern int nonlocal_path;
- #endif
- #ifdef UNICODE_SUPPORT
- extern int use_wide_to_mb_default;
- #endif
- extern int hidden_files;
- extern int volume_label;
- extern int dirnames;
- extern int filter_match_case;
- extern int diff_mode;
- #if defined(WIN32)
- extern int only_archive_set;
- extern int clear_archive_bits;
- #endif
- extern int linkput;
- extern int noisy;
- extern int extra_fields;
- #ifdef NTSD_EAS
- extern int use_privileges;
- #endif
- extern int use_descriptors;
- extern int allow_empty_archive;
- extern int copy_only;
- extern int zip_to_stdout;
- extern int output_seekable;
- #ifdef ZIP64_SUPPORT
- extern int force_zip64;
- extern int zip64_entry;
- extern int zip64_archive;
- #endif
- extern int allow_fifo;
- extern int show_files;
- extern char *tempzip;
- extern FILE *y;
- #ifdef UNICODE_SUPPORT
- extern int utf8_force;
- #endif
- extern int unicode_escape_all;
- extern int unicode_mismatch;
- extern time_t scan_delay;
- extern time_t scan_dot_time;
- extern time_t scan_start;
- extern time_t scan_last;
- extern int scan_started;
- extern uzoff_t scan_count;
- extern ulg before;
- extern ulg after;
- extern ulg total_disks;
- extern ulg current_in_disk;
- extern uzoff_t current_in_offset;
- extern ulg skip_current_disk;
- extern ulg current_local_disk;
- extern ulg current_disk;
- extern ulg cd_start_disk;
- extern uzoff_t cd_start_offset;
- extern uzoff_t cd_entries_this_disk;
- extern uzoff_t total_cd_entries;
- extern ulg zip64_eocd_disk;
- extern uzoff_t zip64_eocd_offset;
- extern char *current_local_tempname;
- extern FILE *current_local_file;
- extern uzoff_t current_local_offset;
- extern uzoff_t bytes_this_split;
- extern int read_split_archive;
- extern int split_method;
- extern uzoff_t split_size;
- extern int split_bell;
- extern uzoff_t bytes_prev_splits;
- extern uzoff_t bytes_this_entry;
- extern int noisy_splits;
- extern int mesg_line_started;
- extern int logfile_line_started;
- extern char *key;
- extern char *tempath;
- extern FILE *mesg;
- extern char *zipfile;
- extern FILE *in_file;
- extern char *in_path;
- extern char *in_split_path;
- extern char *out_path;
- extern int zip_attributes;
- extern uzoff_t zipbeg;
- extern uzoff_t cenbeg;
- extern uzoff_t tempzn;
- extern struct zlist far *zfiles;
- extern extent zcount;
- extern int zipfile_exists;
- extern ush zcomlen;
- extern char *zcomment;
- extern struct flist far **fsort;
- extern struct zlist far **zsort;
- #ifdef UNICODE_SUPPORT
- extern struct zlist far **zusort;
- #endif
- extern struct flist far *found;
- extern struct flist far *far *fnxt;
- extern extent fcount;
- extern struct plist *patterns;
- extern unsigned pcount;
- extern unsigned icount;
- extern unsigned Rcount;
- #ifdef IZ_CHECK_TZ
- extern int zp_tz_is_valid;
- #endif
- #if (defined(MACOS) || defined(WINDLL))
- extern int zipstate;
- #endif
- #ifdef DEBUG
- # ifdef MSDOS
- # undef stderr
- # define stderr stdout
- # endif
- # define diag(where) fprintf(stderr, "zip diagnostic: %s\n", where)
- # define Assert(cond,msg) {if(!(cond)) error(msg);}
- # ifdef THEOS
- # define Trace(x) _fprintf x
- # define Tracev(x) {if (verbose) _fprintf x ;}
- # define Tracevv(x) {if (verbose>1) _fprintf x ;}
- # define Tracec(c,x) {if (verbose && (c)) _fprintf x ;}
- # define Tracecv(c,x) {if (verbose>1 && (c)) _fprintf x ;}
- # else
- # define Trace(x) fprintf x
- # define Tracev(x) {if (verbose) fprintf x ;}
- # define Tracevv(x) {if (verbose>1) fprintf x ;}
- # define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
- # define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
- # endif
- #else
- # define diag(where)
- # define Assert(cond,msg)
- # define Trace(x)
- # define Tracev(x)
- # define Tracevv(x)
- # define Tracec(c,x)
- # define Tracecv(c,x)
- #endif
- #ifdef DEBUGNAMES
- # define free(x) { int *v;Free(x); v=x;*v=0xdeadbeef;x=(void *)0xdeadbeef; }
- #endif
- #ifndef UTIL
- #ifdef USE_ZIPMAIN
- int zipmain OF((int, char **));
- #else
- int main OF((int, char **));
- #endif
- #endif
- #ifdef EBCDIC
- extern int aflag;
- #endif
- #ifdef CMS_MVS
- extern int bflag;
- #endif
- void zipmessage_nl OF((ZCONST char *, int));
- void zipmessage OF((ZCONST char *, ZCONST char *));
- void zipwarn OF((ZCONST char *, ZCONST char *));
- void ziperr OF((int, ZCONST char *));
- #ifdef UTIL
- # define error(msg) ziperr(ZE_LOGIC, msg)
- #else
- void error OF((ZCONST char *));
- # ifdef VMSCLI
- void help OF((void));
- # endif
- int encr_passwd OF((int, char *, int, ZCONST char *));
- #endif
-
- #ifndef UTIL
-
- int percent OF((uzoff_t, uzoff_t));
- int zipup OF((struct zlist far *));
- # ifdef USE_ZLIB
- void zl_deflate_free OF((void));
- # else
- void flush_outbuf OF((char *, unsigned *));
- int seekable OF((void));
- extern unsigned (*read_buf) OF((char *, unsigned int));
- # endif
- # ifdef ZP_NEED_MEMCOMPR
- ulg memcompress OF((char *, ulg, char *, ulg));
- # endif
- # ifdef BZIP2_SUPPORT
- void bz_compress_free OF((void));
- # endif
- #endif
-
- #ifndef UTIL
- struct zlist far *zsearch OF((ZCONST char *));
- # ifdef USE_EF_UT_TIME
- int get_ef_ut_ztime OF((struct zlist far *, iztimes *));
- # endif
- int trash OF((void));
- #endif
- char *ziptyp OF((char *));
- int readzipfile OF((void));
- int putlocal OF((struct zlist far *, int));
- int putextended OF((struct zlist far *));
- int putcentral OF((struct zlist far *));
- int putend OF((uzoff_t, uzoff_t, uzoff_t, extent, char *));
- int is_seekable OF((FILE *));
- int zipcopy OF((struct zlist far *));
- int readlocal OF((struct zlist far **, struct zlist far *));
- char *get_extra_field OF((ush, char *, unsigned));
- char *copy_nondup_extra_fields OF((char *, unsigned, char *, unsigned, unsigned *));
-
- #ifndef UTIL
- char *getnam OF((FILE *));
- struct flist far *fexpel OF((struct flist far *));
- char *last OF((char *, int));
- # ifdef UNICODE_SUPPORT
- wchar_t *lastw OF((wchar_t *, wchar_t));
- # endif
- char *msname OF((char *));
- # ifdef UNICODE_SUPPORT
- wchar_t *msnamew OF((wchar_t *));
- # endif
- int check_dup OF((void));
- int filter OF((char *, int));
- int newname OF((char *, int, int));
- # ifdef UNICODE_SUPPORT
- # ifdef WIN32
- int newnamew OF((wchar_t *, int, int));
- # endif
- # endif
-
- int proc_archive_name OF((char *, int));
- #endif
- #if (!defined(UTIL) || defined(W32_STATROOT_FIX))
- time_t dos2unixtime OF((ulg));
- #endif
- #ifndef UTIL
- ulg dostime OF((int, int, int, int, int, int));
- ulg unix2dostime OF((time_t *));
- int issymlnk OF((ulg a));
- # ifdef S_IFLNK
- # define rdsymlnk(p,b,n) readlink(p,b,n)
- # else
- # define rdsymlnk(p,b,n) (0)
- # endif
- #endif
- int destroy OF((char *));
- int replace OF((char *, char *));
- int getfileattr OF((char *));
- int setfileattr OF((char *, int));
- char *tempname OF((char *));
- int close_split OF((ulg, FILE *, char *));
- int ask_for_split_read_path OF((ulg));
- int ask_for_split_write_path OF((ulg));
- char *get_in_split_path OF((char *, ulg));
- char *find_in_split_path OF((char *, ulg));
- char *get_out_split_path OF((char *, ulg));
- int rename_split OF((char *, char *));
- int set_filetype OF((char *));
- int bfcopy OF((uzoff_t));
- int fcopy OF((FILE *, FILE *, uzoff_t));
- #ifdef ZMEM
- char *memset OF((char *, int, unsigned int));
- char *memcpy OF((char *, char *, unsigned int));
- int memcmp OF((char *, char *, unsigned int));
- #endif
-
- #ifndef UTIL
- # ifdef PROCNAME
- int wild OF((char *));
- # endif
- char *in2ex OF((char *));
- char *ex2in OF((char *, int, int *));
- #if defined(UNICODE_SUPPORT) && defined(WIN32)
- int has_win32_wide OF((void));
- wchar_t *in2exw OF((wchar_t *));
- wchar_t *ex2inw OF((wchar_t *, int, int *));
- int procnamew OF((wchar_t *, int));
- #endif
- int procname OF((char *, int));
- void stamp OF((char *, ulg));
- ulg filetime OF((char *, ulg *, zoff_t *, iztimes *));
-
- # ifdef UNICODE_SUPPORT
- # ifdef WIN32
- ulg filetimew OF((wchar_t *, ulg *, zoff_t *, iztimes *));
- char *get_win32_utf8path OF((char *));
- wchar_t *local_to_wchar_string OF ((char *));
- # endif
- # endif
- # if !(defined(VMS) && defined(VMS_PK_EXTRA))
- int set_extra_field OF((struct zlist far *, iztimes *));
- # endif
- int deletedir OF((char *));
- # ifdef MY_ZCALLOC
- zvoid far *zcalloc OF((unsigned int, unsigned int));
- zvoid zcfree OF((zvoid far *));
- # endif
- #endif
- void version_local OF((void));
-
- #ifndef UTIL
- int fseekable OF((FILE *));
- char *isshexp OF((char *));
- #ifdef UNICODE_SUPPORT
- # ifdef WIN32
- wchar_t *isshexpw OF((wchar_t *));
- int dosmatchw OF((ZCONST wchar_t *, ZCONST wchar_t *, int));
- # endif
- #endif
- int shmatch OF((ZCONST char *, ZCONST char *, int));
- # if defined(DOS) || defined(WIN32)
- int dosmatch OF((ZCONST char *, ZCONST char *, int));
- # endif
- #endif
- char *zip_fuzofft OF((uzoff_t, char *, char*));
- char *zip_fzofft OF((zoff_t, char *, char*));
- int DisplayNumString OF ((FILE *file, uzoff_t i));
- int WriteNumString OF((uzoff_t num, char *outstring));
- uzoff_t ReadNumString OF((char *numstring));
- int abbrevmatch OF((char *, char *, int, int));
- void init_upper OF((void));
- int namecmp OF((ZCONST char *string1, ZCONST char *string2));
- #ifdef EBCDIC
- char *strtoasc OF((char *str1, ZCONST char *str2));
- char *strtoebc OF((char *str1, ZCONST char *str2));
- char *memtoasc OF((char *mem1, ZCONST char *mem2, unsigned len));
- char *memtoebc OF((char *mem1, ZCONST char *mem2, unsigned len));
- #endif
- #ifdef IZ_ISO2OEM_ARRAY
- char *str_iso_to_oem OF((char *dst, ZCONST char *src));
- #endif
- #ifdef IZ_OEM2ISO_ARRAY
- char *str_oem_to_iso OF((char *dst, ZCONST char *src));
- #endif
- zvoid far **search OF((ZCONST zvoid *, ZCONST zvoid far **, extent,
- int (*)(ZCONST zvoid *, ZCONST zvoid far *)));
- void envargs OF((int *, char ***, char *, char *));
- void expand_args OF((int *, char ***));
- int is_text_buf OF((ZCONST char *buf_ptr, unsigned buf_size));
-
- #ifndef UTIL
- #ifndef USE_ZLIB
-
- void lm_init OF((int, ush *));
- void lm_free OF((void));
- uzoff_t deflate OF((void));
-
- void ct_init OF((ush *, int *));
- int ct_tally OF((int, int));
- uzoff_t flush_block OF((char far *, ulg, int));
- void bi_init OF((char *, unsigned int, int));
- #endif
- #endif
-
- #if defined(ASMV) && defined(RISCOS)
- void send_bits OF((int, int));
- unsigned bi_reverse OF((unsigned int, int));
- #endif
- #ifdef VMS
- int vms_stat OF((char *, stat_t *));
- void vms_exit OF((int));
- #ifndef UTIL
- #ifdef VMSCLI
- ulg vms_zip_cmdline OF((int *, char ***));
- void VMSCLI_help OF((void));
- #endif
- #endif
- #endif
- #ifdef WIN32
- int ZipIsWinNT OF((void));
- int ClearArchiveBit OF((char *));
- # ifdef UNICODE_SUPPORT
- int ClearArchiveBitW OF((wchar_t *));
- # endif
- #endif
- #if (defined(WINDLL) || defined(DLL_ZIPAPI))
- #include "api.h"
- #endif
-
- #ifdef WIN32
-
- char *oem_to_local_string OF((char *, char *));
- #endif
- #ifdef WIN32
-
- char *local_to_oem_string OF((char *, char *));
- #endif
- #ifdef UNICODE_SUPPORT
-
- # define zwchar_to_wchar_t_default_char '_'
-
- # define wide_to_mb_default_string "_"
-
- typedef unsigned long zwchar;
-
- int is_ascii_string OF((char *));
- #ifdef WIN32
- int is_ascii_stringw OF((wchar_t *));
- zwchar *wchar_to_wide_string OF((wchar_t *));
- #endif
-
- char *utf8_to_local_string OF((char *));
- char *utf8_to_escape_string OF((char *));
-
- zwchar *utf8_to_wide_string OF((char *));
-
- char *wide_to_local_string OF((zwchar *));
- char *wide_to_escape_string OF((zwchar *));
- char *local_to_escape_string OF((char *));
- #ifdef WIN32
-
- wchar_t *utf8_to_wchar_string OF ((char *));
- char *wchar_to_local_string OF((wchar_t *));
- #endif
-
- char *local_to_display_string OF((char *));
-
- char *wide_char_to_escape_string OF((unsigned long));
- #if 0
-
- unsigned long escape_string_to_wide OF((char *));
- #endif
-
- char *local_to_utf8_string OF ((char *));
-
- zwchar *local_to_wide_string OF ((char *));
-
- char *wide_to_utf8_string OF((zwchar *));
- #ifdef WIN32
- char *wchar_to_utf8_string OF((wchar_t *));
- #endif
- #endif
- #define BFWRITE_DATA 0
- #define BFWRITE_LOCALHEADER 1
- #define BFWRITE_CENTRALHEADER 2
- #define BFWRITE_HEADER 3
- size_t bfwrite OF((ZCONST void *buffer, size_t size, size_t count,
- int));
- #define PUTLOCAL_WRITE 0
- #define PUTLOCAL_REWRITE 1
- #define o_NO_VALUE 0
- #define o_REQUIRED_VALUE 1
- #define o_OPTIONAL_VALUE 2
- #define o_VALUE_LIST 3
- #define o_ONE_CHAR_VALUE 4
- #define o_NUMBER_VALUE 5
- #define o_NOT_NEGATABLE 0
- #define o_NEGATABLE 1
- #define o_NO_OPTION_MATCH -1
- #define o_NON_OPTION_ARG ((unsigned long) 0xFFFF)
- #define o_ARG_FILE_ERR ((unsigned long) 0xFFFE)
- struct option_struct {
- char *shortopt;
- char Far *longopt;
- int value_type;
- int negatable;
- unsigned long option_ID;
- char Far *name;
- };
- extern struct option_struct far options[];
-
- #ifdef _MBCS
- # ifndef MULTIBYTE_GETOPTNS
- # define MULTIBYTE_GETOPTNS
- # endif
- #endif
- #ifdef MULTIBYTE_GETOPTNS
- int mb_clen OF((ZCONST char *));
- # define MB_CLEN(ptr) mb_clen(ptr)
- # define MB_NEXTCHAR(ptr) ((ptr) += MB_CLEN(ptr))
- #else
-
- # define MB_CLEN(ptr) (1)
- # define MB_NEXTCHAR(ptr) ((ptr)++)
- #endif
- unsigned long get_option OF((char ***pargs, int *argc, int *argnum, int *optchar,
- char **value, int *negated, int *first_nonopt_arg,
- int *option_num, int recursion_depth));
- char **copy_args OF((char **args, int max_args));
- int free_args OF ((char **args));
- int insert_arg OF ((char ***args, ZCONST char *arg, int insert_at,
- int free_args));
- #endif
|