home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip22.zip / tandem / tandem.h < prev    next >
C/C++ Source or Header  |  1997-10-06  |  4KB  |  144 lines

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