123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444 |
- #ifndef __globals_h
- #define __globals_h
- #ifdef USE_ZLIB
- # include "zlib.h"
- # ifdef zlib_version
- # undef zlib_version
- # endif
- #endif
- #ifdef USE_BZIP2
- # include "bzlib.h"
- #endif
- typedef struct Globals {
- #ifdef DLL
- zvoid *callerglobs;
- #endif
-
- UzpOpts UzO;
- #ifndef FUNZIP
-
- #ifdef MORE
- int M_flag;
- #endif
-
- #ifdef MORE
- int height;
- int lines;
- # if (defined(SCREENWIDTH) && defined(SCREENLWRAP))
- int width;
- int chars;
- # endif
- #endif
- #if (defined(IZ_CHECK_TZ) && defined(USE_EF_UT_TIME))
- int tz_is_valid;
- #endif
- int noargs;
- unsigned filespecs;
- unsigned xfilespecs;
- int process_all_files;
- int overwrite_mode;
- int create_dirs;
- int extract_flag;
- int newzip;
- zoff_t real_ecrec_offset;
- zoff_t expect_ecrec_offset;
- zoff_t csize;
- zoff_t used_csize;
- #ifdef DLL
- int fValidate;
- int filenotfound;
- int redirect_data;
- int redirect_text;
- # ifndef NO_SLIDE_REDIR
- int redirect_slide;
- # if (defined(USE_DEFLATE64) && defined(INT_16BIT))
- ulg _wsize;
- # else
- unsigned _wsize;
- # endif
- # endif
- ulg redirect_size;
- uch *redirect_buffer;
- uch *redirect_pointer;
- # ifndef NO_SLIDE_REDIR
- uch *redirect_sldptr;
- # endif
- # ifdef OS2DLL
- cbList(processExternally);
- # endif
- #endif
- char **pfnames;
- char **pxnames;
- char sig[4];
- char answerbuf[10];
- min_info info[DIR_BLKSIZ];
- min_info *pInfo;
- #endif
- union work area;
- #if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB))
- ZCONST ulg near *crc_32_tab;
- #else
- ZCONST ulg Far *crc_32_tab;
- #endif
- ulg crc32val;
- #ifdef FUNZIP
- FILE *in;
- #endif
- uch *inbuf;
- uch *inptr;
- int incnt;
- #ifndef FUNZIP
- ulg bitbuf;
- int bits_left;
- int zipeof;
- char *argv0;
- char *wildzipfn;
- char *zipfn;
- #ifdef USE_STRM_INPUT
- FILE *zipfd;
- #else
- int zipfd;
- #endif
- zoff_t ziplen;
- zoff_t cur_zipfile_bufstart;
- zoff_t extra_bytes;
- uch *extra_field;
- uch *hold;
- local_file_hdr lrec;
- cdir_file_hdr crec;
- ecdir_rec ecrec;
- z_stat statbuf;
- int mem_mode;
- uch *outbufptr;
- ulg outsize;
- int reported_backslash;
- int disk_full;
- int newfile;
- int didCRlast;
- ulg numlines;
- int sol;
- int no_ecrec;
- #ifdef SYMLINKS
- int symlnk;
- slinkentry *slink_head;
- slinkentry *slink_last;
- #endif
- #ifdef NOVELL_BUG_FAILSAFE
- int dne;
- #endif
- FILE *outfile;
- uch *outbuf;
- uch *realbuf;
- #ifndef VMS
- uch *outbuf2;
- #endif
- #endif
- uch *outptr;
- ulg outcnt;
- #ifndef FUNZIP
- char filename[FILNAMSIZ];
- #ifdef UNICODE_SUPPORT
- char *filename_full;
- extent fnfull_bufsize;
- int unicode_escape_all;
- int unicode_mismatch;
- #ifdef UTF8_MAYBE_NATIVE
- int native_is_utf8;
- #endif
- int unipath_version;
- ulg unipath_checksum;
- char *unipath_filename;
- #endif
- #ifdef CMS_MVS
- char *tempfn;
- #endif
- char *key;
- int nopwd;
- #endif
- z_uint4 keys[3];
- #if (!defined(DOS_FLX_H68_NLM_OS2_W32) && !defined(AMIGA) && !defined(RISCOS))
- #if (!defined(MACOS) && !defined(ATARI) && !defined(VMS))
- int echofd;
- #endif
- #endif
- unsigned hufts;
- #ifdef USE_ZLIB
- int inflInit;
- z_stream dstrm;
- #else
- struct huft *fixed_tl;
- struct huft *fixed_td;
- unsigned fixed_bl, fixed_bd;
- #ifdef USE_DEFLATE64
- struct huft *fixed_tl64;
- struct huft *fixed_td64;
- unsigned fixed_bl64, fixed_bd64;
- struct huft *fixed_tl32;
- struct huft *fixed_td32;
- unsigned fixed_bl32, fixed_bd32;
- ZCONST ush *cplens;
- ZCONST uch *cplext;
- ZCONST uch *cpdext;
- #endif
- unsigned wp;
- ulg bb;
- unsigned bk;
- #endif
- #ifndef FUNZIP
-
- char fzofft_buf[FZOFFT_NUM][FZOFFT_LEN];
- int fzofft_index;
- #ifdef SMALL_MEM
- char rgchBigBuffer[512];
- char rgchSmallBuffer[96];
- char rgchSmallBuffer2[160];
- #endif
- MsgFn *message;
- InputFn *input;
- PauseFn *mpause;
- PasswdFn *decr_passwd;
- StatCBFn *statreportcb;
- #ifdef WINDLL
- LPUSERFUNCTIONS lpUserFunctions;
- #endif
- int incnt_leftover;
- uch *inptr_leftover;
- #ifdef VMS_TEXT_CONV
- unsigned VMS_line_length;
- int VMS_line_state;
- int VMS_line_pad;
- #endif
- #if (defined(SFX) && defined(CHEAP_SFX_AUTORUN))
- char autorun_command[FILNAMSIZ];
- #endif
- #endif
- #ifdef SYSTEM_SPECIFIC_GLOBALS
- SYSTEM_SPECIFIC_GLOBALS
- #endif
- } Uz_Globs;
- #define CRC_32_TAB G.crc_32_tab
- Uz_Globs *globalsCtor OF((void));
- extern char local_hdr_sig[4];
- extern char central_hdr_sig[4];
- extern char end_central_sig[4];
- extern char end_central32_sig[4];
- extern char end_central64_sig[4];
- extern char end_centloc64_sig[4];
- #ifdef REENTRANT
- # define G (*(Uz_Globs *)pG)
- # define __G pG
- # define __G__ pG,
- # define __GPRO Uz_Globs *pG
- # define __GPRO__ Uz_Globs *pG,
- # define __GDEF Uz_Globs *pG;
- # ifdef USETHREADID
- extern int lastScan;
- void deregisterGlobalPointer OF((__GPRO));
- Uz_Globs *getGlobalPointer OF((void));
- # define GETGLOBALS() Uz_Globs *pG = getGlobalPointer()
- # define DESTROYGLOBALS() do {free_G_buffers(pG); \
- deregisterGlobalPointer(pG);} while (0)
- # else
- extern Uz_Globs *GG;
- # define GETGLOBALS() Uz_Globs *pG = GG
- # define DESTROYGLOBALS() do {free_G_buffers(pG); free(pG);} while (0)
- # endif
- # define CONSTRUCTGLOBALS() Uz_Globs *pG = globalsCtor()
- #else
- extern Uz_Globs G;
- # define __G
- # define __G__
- # define __GPRO void
- # define __GPRO__
- # define __GDEF
- # define GETGLOBALS()
- # define CONSTRUCTGLOBALS() globalsCtor()
- # define DESTROYGLOBALS()
- #endif
- #define uO G.UzO
- #endif
|