File: sysglobals.h

package info (click to toggle)
p2c 1.21alpha2-1
  • links: PTS
  • area: main
  • in suites: potato, woody
  • size: 1,996 kB
  • ctags: 3,399
  • sloc: ansic: 38,617; pascal: 2,499; makefile: 213; perl: 101
file content (315 lines) | stat: -rw-r--r-- 8,748 bytes parent folder | download | duplicates (5)
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
/* Header for module sysglobals, generated by p2c */
#ifndef SYSGLOBALS_H
#define SYSGLOBALS_H



#ifdef SYSGLOBALS_G
# define vextern
#else
# define vextern extern
#endif



typedef Char fsidctype[20];



#define fsidc           "Rev.  3.1  18-Jul-85"

/*20 CHARS: VERSION,DATE,TIME OF FILE SYS*/
#define mminint         (-32768L)

/*MINIMUM SHORT INTEGER VALUE*/
#define mmaxint         32767

/*MAXIMUM SHORT INTEGER VALUE*/
#define maxunit         50

/*MAXIMUM PHYSICAL UNIT NUMBER*/
#define passleng        16

/*NUMBER OF CHARS IN A PASSWORD*/
#define vidleng         16

/*NUMBER OF CHARS IN A VOLUME NAME*/
#define tidleng         16

/*NUMBER OF CHARS IN A FILE TITLE*/
#define fidleng         120

/*NUMBER OF CHARS IN FILE NAME*/
#define fblksize        512

/*STANDARD FILE BUFFER LENGTH*/
#define maxsc           63

/*LARGEST SELECT CODE */
#define minlevel        1

/*LOWEST INTERRUPT LEVEL*/
#define maxlevel        6
/* p2c: Note: Field width for FKIND assumes enum filekind has 16 elements (from sysglobals.imp, line 81) */



/*LARGEST MASKABLE INTERRUPT LEVEL*/
/*directory entry*/
/*bad blocks*/
/*executable or linkable*/
/*UCSD format text with editor environment*/
/*L.I.F. ASCII format text strings*/
/*file of  <data type, e.g. char, integer,etc.>*/
/*system (BOOT) file*/
/*reserved for future expansion*/
/*FILE INFORMATION*/
/*BUFFER VARIABLE...F^ */
/* LIST OF OPEN FILES */
/*declaration and type information*/
/* SIZE OF ONE LOGICAL RECORD */
/* EXTERNAL FILE TYPE */
/* FILE KIND */
/* FILE IS LINE FORMATTED */
/* HAS 512 BYTE BLOCK BUFFER */
/* FILE HAS NO NAME */
/* WAS CREATED THIS ASSOCIATION */
/* FILE ACCESS RIGHTS */
/*state information*/
/*F^ AND LOOKAHEAD STATES */
/* F^ IS AN END OF LINE */
/* TRIED TO READ PAST END OF FILE */
/* FILE HAS CHANGED SIZE */
/* BUFFER NEEDS TO BE WRITTEN */
/*file size and position*/
/* FILE POINTER, CURRENT FILE POSITION */
/*LOGICAL END OF FILE, CURRENT FILE SIZE */
/*PHYSICAL END OF FILE, MAXIMUM FILE SIZE */
/*buffering and low level formatting information*/
/* FILE POSITION OF BUFFER */
/* SPACE COMPRESSION COUNT */
/*BUFFER METHOD MODULE */
/*file association info*/
/*EXECUTION ADDRESS IN BOOT FILE */
/* VOLUME NAME */
/* FILE PASSWORD */
/* FILE NAME */
/* ADDITIONAL SYSTEM DEPENDENT INFORMATION */
/* TEMP FILE IDENTIFIER */
/* OPTIONAL STRING PARAM */
/*byte block transfer information*/
/* START BYTE OF FILE, OR OTHER IDENTIFICATION */
/* FOR FUTURE EXPANSION */
/*TRUE IF NO SRM TEMP FILE CREATED */
/*TRUE IF SRM SHOULD WAIT FOR LOCK */
/*TRUE IF OLD SRM LINK IS TO BE PURGED */
/*TRUE IF OPENED WITH OVERWRITE */
/*TRUE IF PATHID NOT UNIQUE TO FILEID */
/*TRUE IF FILE OPENED AS LOCKABLE */
/*TRUE IF FILE IS LOCKED */
/*TRUE IF DRIVER IS ACTIVE */
/*PHYSICAL UNIT NUMBER */
/*CALLED WHEN TRANSFER COMPLETES */
/* X POSITION FOR  GOTOXY */
/* Y POSITION FOR  GOTOXY */
/* FILEID FOR OLD SRM FILE ON REWRITE */
/*for future expansion*/
/*large miscellaneous fields sometimes present*/
/*minimal FIB ends here*/
/* FILE NAME, EXCEPT VOLUME AND SIZE */
/*FIB*/
/*unitable entry definition*/
/*directory access method*/
/*byte block transfer method*/
/*select code*/
/*bus address*/
/*disc unit*/
/*disc volume*/
/*physical starting byte of volume*/
/*identifier (Amigo identify sequence)*/
/*volume id*/
/*temp for driver use only; init to 0!*/
/*temp for driver use only; init to 0!*/
/*device specifier letter*/
/*unit absent or down flag*/
/*user can edit input*/
/*medium not changed since last access*/
/*volume name must be uppercased*/
/*fixed/removeable media flag*/
/*driver mode: report/ignore media change*/
/*   (bit not used yet)  */
/*blocked volume flag*/
/*volume size in bytes */
/*unitentry*/
/*0 NOT USED*/
/* *note* the ioresult enumerations have been partitioned into two */
/*               mutually-exclusive groups: those beginning with 'z' are reserved */
/*               for the low-level drivers , and those beginning */
/*               with 'i' are reserved for the higher-level routines.*/
/*end marker*/
/*isr information block*/
/*interrupt register address*/
/*interrupt register mask*/
/*interrupt register target value after masking*/
/*chaining flag*/
/*isr*/
/*pointer to next isrib in linked list*/
/*100 IS TEMP DISK FLAG*/
/*DAY OF MONTH*/
/*0 ==> DATE NOT MEANINGFUL*/

typedef enum {
    untypedfile, badfile, codefile, textfile, asciifile, datafile, sysfile,
    fkind7, fkind8, fkind9, fkind10, fkind11, fkind12, fkind13, fkind14,
    lastfkind
} filekind;

typedef Char window[];

typedef enum {
    readbytes, writebytes, flush, writeeol, readtoeol, clearunit, setcursor,
    getcursor, startread, startwrite, unitstatus, seekeof
} amrequesttype;

typedef struct fib {
    Char *fwindow;
    struct fib *flistptr;
    long frecsize;
    short feft;
    unsigned fkind : 4, fistextvar : 1, fbuffered : 1, fanonymous : 1,
	     fisnew : 1, freadable : 1, fwriteable : 1, freadmode : 1,
	     fbufvalid : 1, feoln : 1, feof_ : 1, fmodified : 1,
	     fbufchanged : 1;
    long fpos, fleof, fpeof, flastpos;
    short freptcnt;
    _PROCEDURE am;
    long fstartaddress;
    Char fvid[vidleng + 1];
    Char ffpw[passleng + 1];
    Char ftid[tidleng + 1];
    long pathid;
    short fanonctr;
    Char *foptstring;
    long fileid;
    unsigned fb0 : 1, fb1 : 1, fnosrmtemp : 1, fwaitonlock : 1,
	     fpurgeoldlink : 1, foverwritten : 1, fsavepathid : 1,
	     flockable : 1, flocked : 1, fbusy : 1, funit : 6;
    _PROCEDURE feot;
    long fxpos, fypos, foldfileid;
    long fextra[3];
    short fextra2;
    union {
	Char ftitle[fidleng + 1];
	Char fbuffer[fblksize];
    } UU;
} fib;

typedef enum {
    getvolumename, setvolumename, getvolumedate, setvolumedate, changename,
    purgename, openfile, createfile, overwritefile, closefile, purgefile,
    stretchit, makedirectory, crunch, opendirectory, closedirectory, catalog,
    stripname, setunitprefix, openvolume, duplicatelink, openparentdir,
    catpasswords, setpasswords, lockfile, unlockfile, openunit
} damrequesttype;

typedef struct unitentry {
    _PROCEDURE dam;
    _PROCEDURE tm;
    uchar sc, ba, du, dv;
    long byteoffset, devid;
    Char uvid[vidleng + 1];
    long dvrtemp;
    short dvrtemp2;
    Char letter;
    unsigned offline : 1, uisinteractive : 1, umediavalid : 1, uuppercase : 1,
	     uisfixed : 1, ureportchange : 1, pad : 1, uisblkd : 1;
    union {
	long umaxbytes;
    } UU;
} unitentry;

typedef unitentry unitabletype[maxunit + 1];

typedef _PROCEDURE amtabletype[16];

typedef Char suftabletype[16][6];

typedef short efttabletype[16];

typedef enum {
    inoerror, zbadblock, ibadunit, zbadmode, ztimeout, ilostunit, ilostfile,
    ibadtitle, inoroom, inounit, inofile, idupfile, inotclosed, inotopen,
    ibadformat, znosuchblk, znodevice, zinitfail, zprotected, zstrangei,
    zbadhardware, zcatchall, zbaddma, inotvalidsize, inotreadable,
    inotwriteable, inotdirect, idirfull, istrovfl, ibadclose, ieof,
    zuninitialized, znoblock, znotready, znomedium, inodirectory,
    ibadfiletype, ibadvalue, icantstretch, ibadrequest, inotlockable,
    ifilelocked, ifileunlocked, idirnotempty, itoomanyopen, inoaccess,
    ibadpass, ifilenotdir, inotondir, ineedtempdir, isrmcatchall,
    zmediumchanged, endioerrs
} iorsltwd;

typedef struct isrib {
    Char *intregaddr;
    uchar intregmask, intregvalue;
    unsigned chainflag : 1;
    _PROCEDURE proc;
    struct isrib *link;
} isrib;

typedef isrib *inttabletype[7];

typedef struct daterec {
    char year;
    unsigned day : 5, month : 4;
} daterec;

typedef struct timerec {
    unsigned hour : 5, minute : 6, centisecond : 13;
} timerec;

typedef struct datetimerec {
    daterec date;
    timerec time;
} datetimerec;



vextern short sysescapecode;
vextern Anyptr *openfileptr, *recoverblock, *heapmax, *heapbase;
vextern long sysioresult, hardwarestatus, locklevel;
vextern unitentry *unitable;
vextern inttabletype interrupttable;
vextern long endisrhook, actionspending;
vextern FILE **gfiles[6];
vextern _PROCEDURE *amtable;
vextern Char (*suffixtable)[6];
vextern short *efttable;
vextern long sysunit;
vextern Char syvid[vidleng + 1], dkvid[vidleng + 1];
vextern Char syslibrary[fidleng + 1];
vextern _PROCEDURE debugger;
vextern _PROCEDURE cleariohook;
vextern inttabletype perminttable;
vextern _PROCEDURE deferredaction[10];
vextern _PROCEDURE serialtextamhook;
vextern Char sysname[10];
vextern struct {
    unsigned reserved1 : 1, reserved2 : 1, nointhpib : 1, crtconfigreg : 1,
	     nokeyboard : 1, highlightsxorbiggraphics : 1, biggraphics : 1,
	     alpha50 : 1;
} sysflag;
vextern struct {
    char pad7to1;
    unsigned prompresent : 1;
} sysflag2;
vextern short endsysvars;



#undef vextern

#endif /*SYSGLOBALS_H*/

/* End. */