home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / pep21.arc / HEADER.TXT < prev    next >
Text File  |  1989-12-29  |  3KB  |  83 lines

  1. (( Last edit: 1 dec 89 ))
  2.  
  3.  
  4.             Microcomputer C header files assumptions
  5.             ========================================
  6.  
  7. To avoid having my C programs looking like a  tangle  of  macroes
  8. and ifdefs,  I've started canonizing  the  header  files  for the
  9. different C compilers I use.  My starting point is the draft ANSI
  10. C standard,  with generous influence  from  Borlands  Turbo-C 2.0
  11. and Microsoft C 5.1.
  12.  
  13. Below is what my programs assume about the standard header files.
  14. If your compiler has  trouble  compiling  a  program  written  or
  15. supported by me, the assumptions below should help you a long way
  16. towards successful compilation.
  17.  
  18. (( If you don't want to hack the standard headers  supplied  with
  19. your compiler,  you may create an extra  header named  "gh.h"  or
  20. something, put everything in it, and include that. ))
  21.  
  22.  
  23. DOS.H
  24. =====
  25.  
  26. * There should exist a header named dos.h, which  should  contain
  27.   macro definitions,  function declarations and  type definitions
  28.   for the operating system functions.
  29.  
  30. * Dos.h is supplied with Turbo C and  Microsoft  C.  AZTEC  users
  31.   should copy (or rename) IO.H to DOS.H.
  32.  
  33. * Dos.h  should  define  symbolic  names  for  the  file   system
  34.   attribute flags.
  35.  
  36.   For MS-DOS, this should look like:
  37.  
  38.   #ifdef __MSDOS__
  39.   #define _A_NORMAL 0x00 /* Normal (r/w) file         */
  40.   #define _A_RDONLY 0x01 /* Read only attribute       */
  41.   #define _A_HIDDEN 0x02 /* Hidden file               */
  42.   #define _A_SYSTEM 0x04 /* System file               */
  43.   #define _A_LABEL  0x08 /* Volume label              */
  44.   #define _A_DIREC  0x10 /* Directory                 */
  45.   #define _A_ARCH   0x20 /* Archive                   */
  46.   #endif
  47.  
  48.  
  49. STDIO.H
  50. =======
  51.  
  52. * Stdio.h  should  define  symbolic  names  for   standard   file
  53.   descriptors (see ref. 1, sec. 8.1, p. 160) as follows:
  54.  
  55.   #define STDIN  (0)
  56.   #define STDOUT (1)
  57.   #define STDERR (2)
  58.  
  59.  
  60. References
  61. ----------
  62.  
  63. 1) Brian W. Kernighan and Dennis M. Ritchie (1st edition):  The C
  64.    Programming Language; Prentice-Hall, New Jersey, 1978.
  65.  
  66. 2) Richard Relph:  Preparing for ANSI C; Dr. Dobb's Journal, vol.
  67.    12, issue 7,  p. 16-23, M&T Publishing,  Redwood City,  August
  68.    1987.
  69.  
  70. 3) ISO/TC97/SC22/WG14-C, N369;   Programming  Language  C  (Final
  71.    Working Draft), ISO, August 1987.
  72.  
  73.                                                          -gisle h
  74.  
  75. Comments, suggestions or flames to:
  76.    smail: Gisle Hannemyr, Brageveien 3A, N-0452 Oslo, Norway.
  77.    EAN:      gisle@nr.uninett
  78.    Inet:  gisle@ifi.uio.no
  79.    UUCP:  ..!mcvax!ifi!gisle
  80.    BBS:      a number of Oslo based BBS's
  81.  
  82. ..EOF
  83.