diff options
Diffstat (limited to 'v4.0/src/H/TYPES.H')
| -rw-r--r-- | v4.0/src/H/TYPES.H | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/v4.0/src/H/TYPES.H b/v4.0/src/H/TYPES.H new file mode 100644 index 0000000..446bc1f --- /dev/null +++ b/v4.0/src/H/TYPES.H | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | |||
| 2 | /* types.h - basic types | ||
| 3 | */ | ||
| 4 | |||
| 5 | #define NULL 0 | ||
| 6 | #define MAXPATHLEN 80 /* JOIN.C */ | ||
| 7 | #define MAXARG 80 /* ERRTST.C */ | ||
| 8 | #define CURDISK 0x19 /* ERRTST.C */ | ||
| 9 | #define GETVERS 0x30 /* MAIN.C */ | ||
| 10 | #define GETVARS 0x52 /* SYSVAR.C */ | ||
| 11 | #define IOCTL9 0x4409 /* ERRTST.C */ | ||
| 12 | #define SwitChr '/' /* JOIN.C & SUBST.C */ | ||
| 13 | #define PathChr '\\' /* SUBST.C */ | ||
| 14 | #define COLON ':' /* ERRTST.C */ | ||
| 15 | #define BACKSLASH '\\' /* ERRTST.C */ | ||
| 16 | #define ASCNULL '\0' /* ERRTST.C */ | ||
| 17 | |||
| 18 | |||
| 19 | #define IBMSPACE(c) ((c)==','||(c)==';'||(c)=='='||(c)==0x08||(c)==0x0a) | ||
| 20 | #define IBMBREAK(c) ((c) == '/' || CMDSPACE((c))) | ||
| 21 | #define CMDBREAK(c) IBMBREAK((c)) | ||
| 22 | #define CMDSPACE(c) (isspace((c)) || IBMSPACE((c))) | ||
| 23 | |||
| 24 | #define SHIFT(c,v) {c--; v++;} | ||
| 25 | |||
| 26 | /* The following structure is a UNIX file block that retains information | ||
| 27 | * about a file being accessed via the level 1 I/O functions. | ||
| 28 | */ | ||
| 29 | |||
| 30 | struct UFB | ||
| 31 | { | ||
| 32 | char ufbflg ; /* flags */ | ||
| 33 | char ufbtyp ; /* device type */ | ||
| 34 | int ufbfh ; /* file handle */ | ||
| 35 | }; | ||
| 36 | |||
| 37 | #define NUFBS 20 /* number of UFBs defined */ | ||
| 38 | |||
| 39 | /* UFB.ufbflg definitions */ | ||
| 40 | |||
| 41 | #define UFB_OP 0x80 /* file is open */ | ||
| 42 | #define UFB_RA 0x40 /* reading is allowed */ | ||
| 43 | #define UFB_WA 0x20 /* writing is allowed */ | ||
| 44 | #define UFB_NT 0x10 /* access file with no translation */ | ||
| 45 | #define UFB_AP 8 /* append mode flag */ | ||
| 46 | |||
| 47 | /* UFB.ufbtyp definitions */ | ||
| 48 | |||
| 49 | #define D_DISK 0 | ||
| 50 | #define D_CON 1 | ||
| 51 | #define D_PRN 2 | ||
| 52 | #define D_AUX 3 | ||
| 53 | #define D_NULL 4 | ||
| 54 | |||
| 55 | #define TRUE -1 | ||
| 56 | #define FALSE 0 | ||
| 57 | |||
| 58 | #define SETFLAG(l,f) ((l) |= (f)) | ||
| 59 | #define TESTFLAG(v,f) (((v)&(f))!=0) | ||
| 60 | #define RSETFLAG(l,f) ((l) &= ~(f)) | ||
| 61 | |||
| 62 | #define LOW(w) ((w)&0xFF) | ||
| 63 | #define HIGH(w) LOW((w)>>8) | ||
| 64 | #define WORD(h,l) ((LOW((h))<<8)|LOW((l))) | ||
| 65 | |||
| 66 | /* buffer description for findfirst and findnext */ | ||
| 67 | |||
| 68 | struct findType { | ||
| 69 | char reserved[21]; /* reserved for start up */ | ||
| 70 | char attr; /* attribute found */ | ||
| 71 | unsigned int time; /* time of last modify */ | ||
| 72 | unsigned int date; /* date of last modify */ | ||
| 73 | long length; /* file size */ | ||
| 74 | char name[13]; /* asciz file name */ | ||
| 75 | }; | ||
| 76 | |||
| 77 | /* attributes */ | ||
| 78 | #define A_RO 1 /* read only */ | ||
| 79 | #define A_H 2 /* hidden */ | ||
| 80 | #define A_S 4 /* system */ | ||
| 81 | #define A_V 8 /* volume id */ | ||
| 82 | #define A_D 16 /* directory */ | ||
| 83 | #define A_A 32 /* archive */ | ||
| 84 | |||
| 85 | #define A_MOD (A_RO+A_H+A_S+A_A) /* changeable attributes */ | ||
| 86 | |||
| 87 | #define HASATTR(a,v) TESTFLAG(a,v) /* true if a has attribute v */ | ||