home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / testzp13.zip / testzip.h < prev    next >
Text File  |  1997-02-28  |  5KB  |  128 lines

  1. /*****************************************************************
  2.  * Testzip version 1.13                                          *
  3.  * Test zip file integrity, Nuke Bad Zips                        *
  4.  * Also prints a list of what it deleted in badfiles.txt         *
  5.  *                                                               *
  6.  * Programmer: Madman, with suggestions from Pantera             *
  7.  * Date: 12/6/96     Version 1.0                                 *
  8.  *                                                               *
  9.  * Modified by: Jeff Hamilton, hjeffrey@wam.umd.edu              *
  10.  * Date: 12/8/96     Version 1.01                                *
  11.  * Date: 12/12/96    Version 1.02                                *
  12.  * Date: 12/13/96    Version 1.03                                *
  13.  * Date: 12/15/96    Version 1.04                                *
  14.  * Date: 1/5/97      Version 1.1                                 *
  15.  *                                                               *
  16.  * See the readme.txt included with this source code for more    *
  17.  * information, and instructions for compiling and using this    *
  18.  * program.                                                      *
  19.  *                                                               *
  20.  * Disclaimer:   DISCLAIM THIS!!!!                               *
  21.  * This program and source code are distributed as is.  There is *
  22.  * NO guarantee that it will work on all systems.  Please test   *
  23.  * it out before using.  The programmers take no responsibilty   *
  24.  * for lost or damaged files, or any other problems that use of  *
  25.  * this software might cause.  USE AT YOUR OWN RISK!!!           *
  26.  *                                                               *
  27.  * Bug Reports:                                                  *
  28.  * If you find a bug, please e-mail a description of your        *
  29.  * operating system, what the bug does, and how to reproduce it  *
  30.  * to hjeffrey@wam.umd.edu  I will make every effort to find and *
  31.  * correct the bug.                                              *
  32.  *****************************************************************/
  33.  
  34. /*  Use default configuration if config file is not found.  Set to FALSE  */
  35. /*  to cause testzip to exit if config is not found.                      */
  36.  
  37. #define CONFIG_DEFAULTS TRUE
  38.  
  39. /*  If testzip can't open the logfile, it will exit.  Set this to true to */
  40. /*  cause it to continue, but disable all logging.                        */
  41.  
  42. #define READONLY_LOG FALSE
  43.  
  44. /*  It is not recommended that you modify any of these values, however,   */
  45. /*  if you know what you are doing, you can customize these to meet your  */
  46. /*  and your system's needs.                                              */
  47.  
  48. #define MAX_LINE_LEN 125
  49. #define MAX_EXTENSION 7
  50. #define MAX_ARCHIVER_NAME 20
  51. #define MAX_TEST_COMMAND 50
  52. #define MAX_ARCHIVERS 10
  53. #define MAX_DIR_LEN 100
  54. #define MAX_CONFIG_NAME 15
  55. #define MAX_LOG_NAME 25
  56.  
  57. /*  Operating System specific settings.  DO NOT change 'STATUS1'.  If you */
  58. /*  do, testzip will not be able to properly test files.                  */
  59.  
  60. #if defined(OS2)
  61.    #define STATUS1 255
  62.    #define CONFIG_NAME "testzip.cfg"
  63. #elif defined(UNIX)
  64.    #define STATUS1 256
  65.    #define CONFIG_PATH "/usr/local/lib"
  66.    #define CONFIG_NAME ".testzipcfg"
  67. #else
  68.    #error No Operating system specified.
  69. #endif
  70.  
  71.  
  72. /**************************************************************************/
  73. /*  DO NOT Modify anything below this line.  Doing so will cause testzip  */
  74. /*  to work improperly, and possibly not work at all.                     */
  75. /**************************************************************************/
  76.  
  77. #define TRUE 1
  78. #define FALSE 0
  79.  
  80. /*  Testzip Version Number  */
  81.  
  82. #define TZ_VERSION "1.13"
  83.  
  84. /*  Type definitions of Boolean type, and configuration structs.      */
  85.  
  86. typedef short int Bool;
  87.  
  88. typedef struct {
  89.    char name[MAX_ARCHIVER_NAME+1];
  90.    char extension[MAX_EXTENSION+1];
  91.    char option;
  92.    char command[MAX_TEST_COMMAND+1];
  93.    short int total_tested;
  94. } archiver;
  95.  
  96. typedef struct {
  97.    Bool do_delete;
  98.    char dir[MAX_DIR_LEN+1];
  99.    char logname[MAX_LOG_NAME+1];
  100.    short int loglevel;
  101.    Bool overwrite;
  102.    Bool append;
  103.    archiver archive[MAX_ARCHIVERS];
  104.    short int default_num;
  105.    short int num_archivers;
  106.    Bool do_all;
  107.    Bool recursive;
  108.    short int total_good;
  109.    short int total_bad;
  110.    short int total_tested;
  111.    short int total_del;
  112. } config;
  113.  
  114. /*  Function Prototypes  */
  115.  
  116. void recursive_check();
  117. void single_check();
  118. void do_archive_test(char filename[]);
  119. void open_log();
  120. void print_totals();
  121. void read_options(int *argc, char *argv[]);
  122. void strtoupper(char *string);
  123. void check_dir(char *string);
  124. void load_config_defaults();
  125. void print_config();
  126. void read_config();
  127. void check_a_command();
  128.