home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip540.zip / tandem / tandem.h < prev   
C/C++ Source or Header  |  1998-08-25  |  4KB  |  149 lines

  1. /*
  2.  
  3.  Copyright (C) 1990-1998 Mark Adler, Richard B. Wales, Jean-loup Gailly,
  4.  Kai Uwe Rommel, Onno van der Linden, George Petrov 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. #ifndef __tandem_h   /* prevent multiple inclusions */
  12. #define __tandem_h
  13.  
  14. #define TANDEM       /* better than __TANDEM */
  15.  
  16. #define LICENSED     /* object needs FUP LICENSE to allow timestamp update */
  17.  
  18. #define NO_UNISTD_H
  19.  
  20.  
  21. /* Include file for TANDEM */
  22.  
  23. #ifndef NULL
  24. #  define NULL 0
  25. #endif
  26.  
  27. #include <time.h>               /* the usual non-BSD time functions */
  28. #include <stdio.h>
  29. #include <sysstat.h>
  30. #include <unistd.h>
  31. #include <errno.h>
  32.  
  33. #define PASSWD_FROM_STDIN
  34.                   /* Kludge until we know how to open a non-echo tty channel */
  35.  
  36. #define TANDEM_BLOCKSIZE 4096
  37. #define MAXFILEPARTLEN 8
  38. #define MAXPATHLEN 128
  39. #define EXTENSION_MAX 3
  40. #define NO_RMDIR
  41. #define NO_MKTEMP
  42.  
  43. #ifdef UNZIP                    /* definitions for UNZIP */
  44. /* #define INBUFSIZ 8192       */
  45. /* #define USE_STRM_INPUT      */
  46. /* #define USE_FWRITE          */
  47. /* #define REALLY_SHORT_SYMS   */
  48. /* #define PATH_MAX 128        */
  49. #endif /* UNZIP */
  50.  
  51. #define EXIT zexit     /*  To stop creation of Abend files */
  52. #define RETURN zexit   /*  To stop creation of Abend files */
  53. #define fopen zipopen  /*  To allow us to set extent sizes */
  54. #define putc zputc     /*  To allow us to auto flush  */
  55.  
  56. void zexit (int);
  57.  
  58. FILE *zipopen(
  59. const char *,
  60. const char *
  61. );
  62.  
  63. int zputc(
  64. int,
  65. FILE *
  66. );
  67.  
  68. #define FOPR "rb"
  69. #define FOPM "r+"
  70. #define FOPW "wb"
  71. #define FOPWT "w"
  72.  
  73. #define CBSZ 0x10000  /* Was used for both fcopy and file_read.        */
  74.                       /* Created separate define (SBSZ) for file_read  */
  75.                       /* fcopy param is type size_t (unsigned long)    */
  76.                       /* For Guardian we choose a multiple of 4K       */
  77.  
  78. #define ZBSZ 0x10000  /* This is used in call to setvbuf, 64K seems to work  */
  79.                       /* in all memory models. Again it is an unsigned long  */
  80.                       /* For Guardian we choose a multiple of 4K             */
  81.  
  82. #ifndef __INT32
  83. #define SBSZ 0x04000  /* For STORE method we can use a maximum of int        */
  84.                       /* size.  In Large memory model this equates to 32767  */
  85.                       /* We use a multiple of 4k to match Guardian I/O       */
  86. #else
  87. #define SBSZ 0x10000  /* WIDE model so we can use 64K                        */
  88. #endif /* __INT32 */
  89.  
  90. /* For deflate.c,  need to look into BI_MEM and DYN_ALLOC defines */
  91.  
  92. /* <dirent.h> definitions */
  93.  
  94. #define NAMELEN FILENAME_MAX+1+EXTENSION_MAX   /* allow for space extension */
  95.  
  96. struct dirent {
  97.    struct dirent *d_next;
  98.    char   d_name[NAMELEN+1];
  99. };
  100.  
  101. typedef struct _DIR {
  102.    struct  dirent *D_list;
  103.    struct  dirent *D_curpos;
  104.    char            D_path[NAMELEN+1];
  105. } DIR;
  106.  
  107. DIR *          opendir(const char *dirname);
  108. struct dirent *readdir(DIR *dirp);
  109. void           rewinddir(DIR *dirp);
  110. int            closedir(DIR *dirp);
  111. char *         readd(DIR *dirp);
  112.  
  113. #define ALIAS_MASK  (unsigned int) 0x80
  114. #define SKIP_MASK   (unsigned int) 0x1F
  115. #define TTRLEN      3
  116. #define RECLEN      254
  117.  
  118. #define DISK_DEVICE         3
  119. #define SET_FILE_SECURITY   1
  120. #define SET_FILE_OWNER      2
  121. #define SET_FILE_BUFFERED   90
  122. #define SET_FILE_BUFFERSIZE 93
  123.  
  124. #define DOS_EXTENSION      '.'
  125. #define TANDEM_EXTENSION   ' '
  126. #define TANDEM_DELIMITER   '.'
  127. #define TANDEM_NODE        '\\'
  128. #define INTERNAL_DELIMITER '/'
  129. #define INTERNAL_NODE      '//'
  130. #define TANDEM_WILD_1      '*'
  131. #define TANDEM_WILD_2      '?'
  132.  
  133. #define DOS_EXTENSION_STR      "."
  134. #define TANDEM_EXTENSION_STR   " "
  135. #define TANDEM_DELIMITER_STR   "."
  136. #define TANDEM_NODE_STR        "\\"
  137. #define INTERNAL_DELIMITER_STR "/"
  138. #define INTERNAL_NODE_STR      "//"
  139.  
  140. typedef struct {
  141.    unsigned short int count;
  142.    char rest[RECLEN];
  143. } RECORD;
  144.  
  145. char    *endmark = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF";
  146.  
  147.  
  148. #endif /* !__tandem_h */
  149.