File: tandem.h

package info (click to toggle)
unzip 5.40-1
  • links: PTS
  • area: non-free
  • in suites: potato
  • size: 4,120 kB
  • ctags: 5,900
  • sloc: ansic: 40,977; cpp: 3,778; makefile: 1,384; asm: 1,228; sh: 133
file content (148 lines) | stat: -rw-r--r-- 4,108 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*

 Copyright (C) 1990-1998 Mark Adler, Richard B. Wales, Jean-loup Gailly,
 Kai Uwe Rommel, Onno van der Linden, George Petrov and Igor Mandrichenko.
 Permission is granted to any individual or institution to use, copy, or
 redistribute this software so long as all of the original files are included,
 that it is not sold for profit, and that this copyright notice is retained.

*/

#ifndef __tandem_h   /* prevent multiple inclusions */
#define __tandem_h

#define TANDEM       /* better than __TANDEM */

#define LICENSED     /* object needs FUP LICENSE to allow timestamp update */

#define NO_UNISTD_H


/* Include file for TANDEM */

#ifndef NULL
#  define NULL 0
#endif

#include <time.h>               /* the usual non-BSD time functions */
#include <stdio.h>
#include <sysstat.h>
#include <unistd.h>
#include <errno.h>

#define PASSWD_FROM_STDIN
                  /* Kludge until we know how to open a non-echo tty channel */

#define TANDEM_BLOCKSIZE 4096
#define MAXFILEPARTLEN 8
#define MAXPATHLEN 128
#define EXTENSION_MAX 3
#define NO_RMDIR
#define NO_MKTEMP

#ifdef UNZIP                    /* definitions for UNZIP */
/* #define INBUFSIZ 8192       */
/* #define USE_STRM_INPUT      */
/* #define USE_FWRITE          */
/* #define REALLY_SHORT_SYMS   */
/* #define PATH_MAX 128        */
#endif /* UNZIP */

#define EXIT zexit     /*  To stop creation of Abend files */
#define RETURN zexit   /*  To stop creation of Abend files */
#define fopen zipopen  /*  To allow us to set extent sizes */
#define putc zputc     /*  To allow us to auto flush  */

void zexit (int);

FILE *zipopen(
const char *,
const char *
);

int zputc(
int,
FILE *
);

#define FOPR "rb"
#define FOPM "r+"
#define FOPW "wb"
#define FOPWT "w"

#define CBSZ 0x10000  /* Was used for both fcopy and file_read.        */
                      /* Created separate define (SBSZ) for file_read  */
                      /* fcopy param is type size_t (unsigned long)    */
                      /* For Guardian we choose a multiple of 4K       */

#define ZBSZ 0x10000  /* This is used in call to setvbuf, 64K seems to work  */
                      /* in all memory models. Again it is an unsigned long  */
                      /* For Guardian we choose a multiple of 4K             */

#ifndef __INT32
#define SBSZ 0x04000  /* For STORE method we can use a maximum of int        */
                      /* size.  In Large memory model this equates to 32767  */
                      /* We use a multiple of 4k to match Guardian I/O       */
#else
#define SBSZ 0x10000  /* WIDE model so we can use 64K                        */
#endif /* __INT32 */

/* For deflate.c,  need to look into BI_MEM and DYN_ALLOC defines */

/* <dirent.h> definitions */

#define NAMELEN FILENAME_MAX+1+EXTENSION_MAX   /* allow for space extension */

struct dirent {
   struct dirent *d_next;
   char   d_name[NAMELEN+1];
};

typedef struct _DIR {
   struct  dirent *D_list;
   struct  dirent *D_curpos;
   char            D_path[NAMELEN+1];
} DIR;

DIR *          opendir(const char *dirname);
struct dirent *readdir(DIR *dirp);
void           rewinddir(DIR *dirp);
int            closedir(DIR *dirp);
char *         readd(DIR *dirp);

#define ALIAS_MASK  (unsigned int) 0x80
#define SKIP_MASK   (unsigned int) 0x1F
#define TTRLEN      3
#define RECLEN      254

#define DISK_DEVICE         3
#define SET_FILE_SECURITY   1
#define SET_FILE_OWNER      2
#define SET_FILE_BUFFERED   90
#define SET_FILE_BUFFERSIZE 93

#define DOS_EXTENSION      '.'
#define TANDEM_EXTENSION   ' '
#define TANDEM_DELIMITER   '.'
#define TANDEM_NODE        '\\'
#define INTERNAL_DELIMITER '/'
#define INTERNAL_NODE      '//'
#define TANDEM_WILD_1      '*'
#define TANDEM_WILD_2      '?'

#define DOS_EXTENSION_STR      "."
#define TANDEM_EXTENSION_STR   " "
#define TANDEM_DELIMITER_STR   "."
#define TANDEM_NODE_STR        "\\"
#define INTERNAL_DELIMITER_STR "/"
#define INTERNAL_NODE_STR      "//"

typedef struct {
   unsigned short int count;
   char rest[RECLEN];
} RECORD;

char    *endmark = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF";


#endif /* !__tandem_h */