2 * tools.h - Header file for accessing TOOLS.LIB routines
3 * includes stdio.h and ctype.h
5 * 4/14/86 dl added U_* flags for upd return values
7 * 31-Jul-1986 mz Add Connect definitions
21 typedef char flagType;
24 #define SETFLAG(l,f) ((l) |= (f))
25 #define TESTFLAG(v,f) (((v)&(f))!=0)
26 #define RSETFLAG(l,f) ((l) &= ~(f))
28 #define SHIFT(c,v) {c--; v++;}
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))
37 #define SELECT if(FALSE){
38 #define CASE(x) }else if((x)){
39 #define OTHERWISE }else{
42 /* buffer description for findfirst and findnext */
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 */
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 */
61 #define A_MOD (A_RO+A_H+A_S+A_A) /* changeable attributes */
63 #define HASATTR(a,v) TESTFLAG(a,v) /* true if a has attribute v */
65 extern char XLTab[], XUTab[];
68 #define MAXPATHLEN 128
73 int max; /* max the vector can hold */
74 int count; /* count of elements in vector */
75 unsigned elem[1]; /* elements in vector */
78 /* return flags for upd */
84 /* Connect definitions */
86 #define REALDRIVE 0x8000
87 #define ISTMPDRIVE(x) (((x)&REALDRIVE)==0)
88 #define TOKTODRV(x) ((x)&~REALDRIVE)
90 /* Heap Checking return codes */
93 #define HEAPBADBEGIN -1
94 #define HEAPBADNODE -2