-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnudefs.h
198 lines (170 loc) · 5.42 KB
/
nudefs.h
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/*
* nudefs.h - system-dependent typdefs, and global #defines and variables.
*
* NuLib v3.2 March 1992 Freeware (distribute, don't sell)
* By Andy McFadden (fadden@uts.amdahl.com)
*/
/*
* IMPORTANT: This file must be first on the list of #includes, since some
* include files will be processed based on these #defines
*/
/* SYSTEM DEPENDENCIES */
#include <bits/types.h>
#if __WORDSIZE == 64
typedef unsigned char onebyt;
typedef unsigned short int twobyt;
typedef unsigned int fourbyt;
#else
typedef unsigned char onebyt;
typedef unsigned short twobyt;
typedef unsigned long fourbyt;
#endif
/* byte ordering; TRUE if high byte is first (68xxx), else FALSE (65xxx) */
extern int HiLo; /* actually part of numain.c */
/* Setup for LINUX machines */
#define UNIX
#define SYSV
#define NO_RENAME
/* Setup for Apple //gs APW */
/* [ "APW" is automatically defined by the compiler ] */
/* Setup for MS-DOS machines (80xxx based: IBM PC) */
/* #ifndef MSDOS */
/* #define MSDOS */
/* #endif */
/* Setup for AIX */
/* #define SYSV */
/* #define BSD_INCLUDES */
/* Setup for BSD UNIX systems */
/*#define UNIX*/
/*#define BSD43*/
/* Setup for the NeXT */
/* #define UNIX */
/* #define BSD43 */
/* #define NeXT */ /* (is this defined automatically?) */
/* Setup for XENIX/386 */
/* NOTE: if you get error messages about readdir() and opendir() during */
/* linking, remove the leading '#' from the line "#CLIBS= -lx" in */
/* "Makefile" */
/* #define XENIX386 */
/* #define UNIX */
/* #define SYSV */
/* #define NO_RENAME */ /* no rename() call in C library */
/* Setup for Amdahl UTS 2.1; also works on the AT&T 3B2 */
/* #define UNIX */
/* #define SYSV */
/* #define NO_RENAME */
/* (UTS only:) */
/* #define HAS_EFT */ /*(don't forget to add "-eft" flag in Makefile for
UTS 2.1)*/
/* Setup for AOS/VS @ DG */
/* #define UNIX */
/* #define DATAGENERAL */
/* #define AOSVS */
/* Setup for AViiONs */
/* #define UNIX */
/* #define SYSV */
/* #define HAS_EFT */
/* Setup for other UNIX systems */
/* #define UNIX */
/* #define SYSV (or whatever) */
/* use table lookups to get CRCs */
#define CRC_TAB
/* don't include Binary II */
/* #define NO_BLU */
/* don't include UNIX compress */
/* #define NO_UCOMP */
#ifdef UNIX
/* (the #include setup for NuLib is pretty screwed up at this point...) */
#include <sys/types.h> /* need off_t, if it exists */
/*
* With EFT, off_t is a longlong (8 bytes) and mode_t is four bytes (ulong).
* They affect lseek() and open() calls. Without EFT, off_t is usually
* four bytes, and mode_t is a short or an int.
*
* I'm not sure which systems don't have off_t or mode_t. BSD seems to have
* off_t, but not mode_t; this'll have to be handled on a case-by-case basis.
* Unfortunately #ifdefs don't pick up typedefs on all compilers...
*/
#ifndef HAS_EFT
/*typedef long off_t;*/
/*typedef unsigned short mode_t;*/
#endif
#else
#ifndef HAS_EFT
/* APW and MS-DOS should be the same */
typedef long off_t;
typedef unsigned int mode_t;
#endif
#endif
extern off_t lseek(); /*VERY important if lseek() doesn't return int*/
/*
* The rest of this stuff shouldn't need to be changed
*/
/*
* Some global defs
*/
/* errno wasn't defined in <errno.h> on some systems... */
#ifndef MSDOS
extern int errno;
#endif
/* Maximum file name length that we intend to handle (watch stack size!) */
#define MAXFILENAME 1024
/* file operations */
#define S_ABS 0 /* seek absolute */
#define S_REL 1 /* seek relative */
#define S_END 2 /* seek from end */
#ifdef UNIX /* stuff for open() */
#define WPERMS 0644 /* read/write for owner, read only for others */
#define FREAD_STR "r"
#define FWRITE_STR "w"
#define O_BINARY 0 /* for non-UNIX open(); easier than #ifdefs */
#else
#ifdef APW
#define WPERMS 0666 /* read/write for all; this may not work for some */
#define FREAD_STR "rb"
#define FWRITE_STR "wb"
#endif
#ifdef MSDOS
#define S_IREAD 0000400 /* read permission, owner */
#define S_IWRITE 0000200 /* write permission, owner */
#define WPERMS S_IREAD | S_IWRITE
#define FREAD_STR "rb"
#define FWRITE_STR "wb"
#endif
#ifndef WPERMS /* other system */
#define WPERMS 0666 /* +PORT+ */
#define FREAD_STR "rb"
#define FWRITE_STR "wb"
#endif
#endif /*UNIX*/
/* Time structure; same as TimeRec from misctool.h */
/* one-byte entries should not have alignment problems... */
typedef struct {
onebyt second;
onebyt minute;
onebyt hour;
onebyt year;
onebyt day;
onebyt month;
onebyt extra;
onebyt weekDay;
} Time;
/*
* global to entire program
*/
extern int HiLo; /* byte ordering; FALSE on low-first (65816) */
extern int verbose; /* BOOLEAN: print verbose? */
extern int interact; /* BOOLEAN: interactive when overwriting? */
extern int dopack; /* BOOLEAN: do we want to pack/unpack? */
extern int doSubdir; /* BOOLEAN: expand subdirectories? */
extern int doExpand; /* BOOLEAN: expand archived filenames? */
extern int doMessages; /* BOOLEAN: do comments instead of data? */
extern int transfrom; /* how to do CR<->LF translation? (-1 = none) */
extern int transto;
extern int packMethod; /* how to pack a file (thread_format) */
extern int diskData; /* BOOLEAN: store files as disk images */
extern fourbyt defFileType; /* default file type */
extern fourbyt defAuxType; /* default aux type */
extern onebyt *pakbuf; /* used by compression routines; created once to */
/* eliminate overhead involved in malloc()ing a 64K buffer */
extern char *prgName; /* for errors; don't like argv[0] */