home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip22.zip / globals.c < prev    next >
C/C++ Source or Header  |  1997-08-17  |  4KB  |  90 lines

  1. /*
  2.  
  3.  Copyright (C) 1990-1997 Mark Adler, Richard B. Wales, Jean-loup Gailly,
  4.  Kai Uwe Rommel, Onno van der Linden and Igor Mandrichenko.
  5.  Permission is granted to any individual or institution to use, copy, or
  6.  redistribute this software so long as all of the original files are included,
  7.  that it is not sold for profit, and that this copyright notice is retained.
  8.  
  9. */
  10.  
  11. /*
  12.  *  globals.c by Mark Adler.
  13.  */
  14.  
  15. #define GLOBALS         /* include definition of errors[] in zip.h */
  16. #ifndef UTIL
  17. #define UTIL            /* do not declare the read_buf variable */
  18. #endif
  19.  
  20. #include "zip.h"
  21.  
  22.  
  23. /* Handy place to build error messages */
  24. char errbuf[FNMAX+81];
  25.  
  26. /* Argument processing globals */
  27. int recurse = 0;        /* 1=recurse into directories encountered */
  28. int dispose = 0;        /* 1=remove files after put in zip file */
  29. int pathput = 1;        /* 1=store path with name */
  30. #ifdef RISCOS
  31. int scanimage = 1;      /* 1=scan through image files */
  32. #endif
  33. int method = BEST;      /* one of BEST, DEFLATE (only), or STORE (only) */
  34. int dosify = 0;         /* 1=make new entries look like MSDOS */
  35. int verbose = 0;        /* 1=report oddities in zip file structure */
  36. int fix = 0;            /* 1=fix the zip file */
  37. int adjust = 0;         /* 1=adjust offsets for sfx'd file (keep preamble) */
  38. int level = 6;          /* 0=fastest compression, 9=best compression */
  39. int translate_eol = 0;  /* Translate end-of-line LF -> CR LF */
  40. #ifdef VMS
  41.    int vmsver = 0;      /* 1=append VMS version number to file names */
  42.    int vms_native = 0;  /* 1=store in VMS format */
  43. #endif /* VMS */
  44. #if defined(OS2) || defined(WIN32)
  45.    int use_longname_ea = 0; /* 1=use the .LONGNAME EA as the file's name */
  46. #endif
  47. int hidden_files = 0;   /* process hidden and system files */
  48. int volume_label = 0;   /* add volume label */
  49. int dirnames = 1;       /* include directory entries by default */
  50. int linkput = 0;        /* 1=store symbolic links as such */
  51. int noisy = 1;          /* 0=quiet operation */
  52. int extra_fields = 1;   /* 0=do not create extra fields */
  53. #ifdef WIN32
  54.     int use_privileges = 0; /* 1=use security privilege overrides */
  55. #endif
  56. #ifndef RISCOS
  57. #ifndef QDOS
  58. char *special = ".Z:.zip:.zoo:.arc:.lzh:.arj"; /* List of special suffixes */
  59. #else
  60. char *special = "_Z:_zip:_zoo:_arc:_lzh:_arj"; /* List of special suffixes */
  61. #endif
  62. #else /* RISCOS */
  63. char *special = "DDC:D96:68E";
  64. #endif /* ?RISCOS */
  65. char *key = NULL;       /* Scramble password if scrambling */
  66. char *tempath = NULL;   /* Path for temporary files */
  67. FILE *mesg;             /* stdout by default, stderr for piping */
  68.  
  69. /* Zip file globals */
  70. char *zipfile;          /* New or existing zip archive (zip file) */
  71. ulg zipbeg;             /* Starting offset of zip structures */
  72. ulg cenbeg;             /* Starting offset of central directory */
  73. struct zlist far *zfiles = NULL;  /* Pointer to list of files in zip file */
  74. extent zcount;          /* Number of files in zip file */
  75. extent zcomlen;         /* Length of zip file comment */
  76. char *zcomment = NULL;  /* Zip file comment (not zero-terminated) */
  77. struct zlist far **zsort;       /* List of files sorted by name */
  78. ulg tempzn;             /* Count of bytes written to output zip file */
  79.  
  80. /* Files to operate on that are not in zip file */
  81. struct flist far *found = NULL; /* List of names found */
  82. struct flist far * far *fnxt = &found;
  83.                         /* Where to put next name in found list */
  84. extent fcount;          /* Count of files in list */
  85.  
  86. /* Patterns to be matched */
  87. struct plist *patterns = NULL; /* List of patterns to be matched */
  88. int pcount = 0;                /* number of patterns */
  89. int icount = 0;                /* number of include only patterns */
  90.