]> wirehaze git hosting - MS-DOS.git/blob - v4.0/src/CMD/FC/TOOLS.H

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / CMD / FC / TOOLS.H
1 /*
2 * tools.h - Header file for accessing TOOLS.LIB routines
3 * includes stdio.h and ctype.h
4 *
5 * 4/14/86 dl added U_* flags for upd return values
6 *
7 * 31-Jul-1986 mz Add Connect definitions
8 */
9
10 #define TRUE -1
11 #define FALSE 0
12
13 #if MSDOS
14 #define PSEPSTR "\\"
15 #define PSEPCHR '\\'
16 #else
17 #define PSEPSTR "/"
18 #define PSEPCHR '/'
19 #endif
20
21 typedef char flagType;
22 typedef long ptrType;
23
24 #define SETFLAG(l,f) ((l) |= (f))
25 #define TESTFLAG(v,f) (((v)&(f))!=0)
26 #define RSETFLAG(l,f) ((l) &= ~(f))
27
28 #define SHIFT(c,v) {c--; v++;}
29
30 #define LOW(w) ((int)(w)&0xFF)
31 #define HIGH(w) LOW((int)(w)>>8)
32 #define WORD(h,l) ((LOW((h))<<8)|LOW((l)))
33 #define POINTER(seg,off) ((((long)(seg))<<4)+ (long)(off))
34
35 #define FNADDR(f) (f)
36
37 #define SELECT if(FALSE){
38 #define CASE(x) }else if((x)){
39 #define OTHERWISE }else{
40 #define ENDSELECT }
41
42 /* buffer description for findfirst and findnext */
43
44 struct findType {
45 char reserved[21]; /* reserved for start up */
46 char attr; /* attribute found */
47 unsigned time; /* time of last modify */
48 unsigned date; /* date of last modify */
49 long length; /* file size */
50 char name[13]; /* asciz file name */
51 };
52
53 /* attributes */
54 #define A_RO 1 /* read only */
55 #define A_H 2 /* hidden */
56 #define A_S 4 /* system */
57 #define A_V 8 /* volume id */
58 #define A_D 16 /* directory */
59 #define A_A 32 /* archive */
60
61 #define A_MOD (A_RO+A_H+A_S+A_A) /* changeable attributes */
62
63 #define HASATTR(a,v) TESTFLAG(a,v) /* true if a has attribute v */
64
65 extern char XLTab[], XUTab[];
66
67 #define MAXARG 128
68 #define MAXPATHLEN 128
69
70 #include "ttypes.h"
71
72 struct vectorType {
73 int max; /* max the vector can hold */
74 int count; /* count of elements in vector */
75 unsigned elem[1]; /* elements in vector */
76 };
77
78 /* return flags for upd */
79 #define U_DRIVE 0x8
80 #define U_PATH 0x4
81 #define U_NAME 0x2
82 #define U_EXT 0x1
83
84 /* Connect definitions */
85
86 #define REALDRIVE 0x8000
87 #define ISTMPDRIVE(x) (((x)&REALDRIVE)==0)
88 #define TOKTODRV(x) ((x)&~REALDRIVE)
89
90 /* Heap Checking return codes */
91
92 #define HEAPOK 0
93 #define HEAPBADBEGIN -1
94 #define HEAPBADNODE -2