(( Last edit: 1 dec 89 )) Microcomputer C header files assumptions ======================================== To avoid having my C programs looking like a tangle of macroes and ifdefs, I've started canonizing the header files for the different C compilers I use. My starting point is the draft ANSI C standard, with generous influence from Borlands Turbo-C 2.0 and Microsoft C 5.1. Below is what my programs assume about the standard header files. If your compiler has trouble compiling a program written or supported by me, the assumptions below should help you a long way towards successful compilation. (( If you don't want to hack the standard headers supplied with your compiler, you may create an extra header named "gh.h" or something, put everything in it, and include that. )) DOS.H ===== * There should exist a header named dos.h, which should contain macro definitions, function declarations and type definitions for the operating system functions. * Dos.h is supplied with Turbo C and Microsoft C. AZTEC users should copy (or rename) IO.H to DOS.H. * Dos.h should define symbolic names for the file system attribute flags. For MS-DOS, this should look like: #ifdef __MSDOS__ #define _A_NORMAL 0x00 /* Normal (r/w) file */ #define _A_RDONLY 0x01 /* Read only attribute */ #define _A_HIDDEN 0x02 /* Hidden file */ #define _A_SYSTEM 0x04 /* System file */ #define _A_LABEL 0x08 /* Volume label */ #define _A_DIREC 0x10 /* Directory */ #define _A_ARCH 0x20 /* Archive */ #endif STDIO.H ======= * Stdio.h should define symbolic names for standard file descriptors (see ref. 1, sec. 8.1, p. 160) as follows: #define STDIN (0) #define STDOUT (1) #define STDERR (2) References ---------- 1) Brian W. Kernighan and Dennis M. Ritchie (1st edition): The C Programming Language; Prentice-Hall, New Jersey, 1978. 2) Richard Relph: Preparing for ANSI C; Dr. Dobb's Journal, vol. 12, issue 7, p. 16-23, M&T Publishing, Redwood City, August 1987. 3) ISO/TC97/SC22/WG14-C, N369; Programming Language C (Final Working Draft), ISO, August 1987. -gisle h Comments, suggestions or flames to: smail: Gisle Hannemyr, Brageveien 3A, N-0452 Oslo, Norway. EAN: gisle@nr.uninett Inet: gisle@ifi.uio.no UUCP: ..!mcvax!ifi!gisle BBS: a number of Oslo based BBS's ..EOF