Hex Artifact Content
Not logged in

Artifact 0e4ade7e463ae2bf1595d615a949d2cc14a2a5b4:

File src/makeheaders.html part of check-in [dbda8d6ce9] - Initial check-in of m1 sources. by drh on 2007-07-21 14:10:57.

0000: 3c 68 74 6d 6c 3e 0a 3c 68 65 61 64 3e 3c 74 69  <html>.<head><ti
0010: 74 6c 65 3e 54 68 65 20 4d 61 6b 65 68 65 61 64  tle>The Makehead
0020: 65 72 73 20 50 72 6f 67 72 61 6d 3c 2f 74 69 74  ers Program</tit
0030: 6c 65 3e 3c 2f 68 65 61 64 3e 0a 3c 62 6f 64 79  le></head>.<body
0040: 20 62 67 63 6f 6c 6f 72 3d 77 68 69 74 65 3e 0a   bgcolor=white>.
0050: 3c 68 31 20 61 6c 69 67 6e 3d 63 65 6e 74 65 72  <h1 align=center
0060: 3e 54 68 65 20 4d 61 6b 65 68 65 61 64 65 72 73  >The Makeheaders
0070: 20 50 72 6f 67 72 61 6d 3c 2f 68 31 3e 0a 0a 0a   Program</h1>...
0080: 3c 70 3e 0a 54 68 69 73 20 64 6f 63 75 6d 65 6e  <p>.This documen
0090: 74 20 64 65 73 63 72 69 62 65 73 20 3c 65 6d 3e  t describes <em>
00a0: 6d 61 6b 65 68 65 61 64 65 72 73 3c 2f 65 6d 3e  makeheaders</em>
00b0: 2c 0a 61 20 74 6f 6f 6c 20 74 68 61 74 20 61 75  ,.a tool that au
00c0: 74 6f 6d 61 74 69 63 61 6c 6c 79 20 67 65 6e 65  tomatically gene
00d0: 72 61 74 65 73 20 60 60 3c 63 6f 64 65 3e 2e 68  rates ``<code>.h
00e0: 3c 2f 63 6f 64 65 3e 27 27 0a 66 69 6c 65 73 20  </code>''.files 
00f0: 66 6f 72 20 61 20 43 20 6f 72 20 43 2b 2b 20 70  for a C or C++ p
0100: 72 6f 67 72 61 6d 6d 69 6e 67 20 70 72 6f 6a 65  rogramming proje
0110: 63 74 2e 0a 3c 2f 70 3e 0a 0a 0a 3c 68 32 3e 54  ct..</p>...<h2>T
0120: 61 62 6c 65 20 4f 66 20 43 6f 6e 74 65 6e 74 73  able Of Contents
0130: 3c 2f 68 32 3e 0a 0a 3c 75 6c 3e 0a 3c 6c 69 3e  </h2>..<ul>.<li>
0140: 3c 61 20 68 72 65 66 3d 6d 61 6b 65 68 65 61 64  <a href=makehead
0150: 65 72 73 2e 68 74 6d 6c 23 48 30 30 30 32 3e 31  ers.html#H0002>1
0160: 2c 30 20 42 61 63 6b 67 72 6f 75 6e 64 3c 2f 61  ,0 Background</a
0170: 3e 0a 3c 75 6c 3e 0a 3c 6c 69 3e 3c 61 20 68 72  >.<ul>.<li><a hr
0180: 65 66 3d 6d 61 6b 65 68 65 61 64 65 72 73 2e 68  ef=makeheaders.h
0190: 74 6d 6c 23 48 30 30 30 33 3e 31 2e 31 20 50 72  tml#H0003>1.1 Pr
01a0: 6f 62 6c 65 6d 73 20 57 69 74 68 20 54 68 65 20  oblems With The 
01b0: 54 72 61 64 69 74 69 6f 6e 61 6c 20 41 70 70 72  Traditional Appr
01c0: 6f 61 63 68 3c 2f 61 3e 0a 0a 3c 6c 69 3e 3c 61  oach</a>..<li><a
01d0: 20 68 72 65 66 3d 6d 61 6b 65 68 65 61 64 65 72   href=makeheader
01e0: 73 2e 68 74 6d 6c 23 48 30 30 30 34 3e 31 2e 32  s.html#H0004>1.2
01f0: 20 54 68 65 20 4d 61 6b 65 68 65 61 64 65 72 73   The Makeheaders
0200: 20 53 6f 6c 75 74 69 6f 6e 3c 2f 61 3e 0a 3c 2f   Solution</a>.</
0210: 75 6c 3e 0a 3c 6c 69 3e 3c 61 20 68 72 65 66 3d  ul>.<li><a href=
0220: 6d 61 6b 65 68 65 61 64 65 72 73 2e 68 74 6d 6c  makeheaders.html
0230: 23 48 30 30 30 35 3e 32 2e 30 20 52 75 6e 6e 69  #H0005>2.0 Runni
0240: 6e 67 20 54 68 65 20 4d 61 6b 65 68 65 61 64 65  ng The Makeheade
0250: 72 73 20 50 72 6f 67 72 61 6d 3c 2f 61 3e 0a 0a  rs Program</a>..
0260: 3c 6c 69 3e 3c 61 20 68 72 65 66 3d 6d 61 6b 65  <li><a href=make
0270: 68 65 61 64 65 72 73 2e 68 74 6d 6c 23 48 30 30  headers.html#H00
0280: 30 36 3e 33 2e 30 20 50 72 65 70 61 72 69 6e 67  06>3.0 Preparing
0290: 20 53 6f 75 72 63 65 20 46 69 6c 65 73 20 46 6f   Source Files Fo
02a0: 72 20 55 73 65 20 57 69 74 68 20 4d 61 6b 65 68  r Use With Makeh
02b0: 65 61 64 65 72 73 3c 2f 61 3e 0a 3c 75 6c 3e 0a  eaders</a>.<ul>.
02c0: 3c 6c 69 3e 3c 61 20 68 72 65 66 3d 6d 61 6b 65  <li><a href=make
02d0: 68 65 61 64 65 72 73 2e 68 74 6d 6c 23 48 30 30  headers.html#H00
02e0: 30 37 3e 33 2e 31 20 54 68 65 20 42 61 73 69 63  07>3.1 The Basic
02f0: 20 53 65 74 75 70 3c 2f 61 3e 0a 0a 3c 6c 69 3e   Setup</a>..<li>
0300: 3c 61 20 68 72 65 66 3d 6d 61 6b 65 68 65 61 64  <a href=makehead
0310: 65 72 73 2e 68 74 6d 6c 23 48 30 30 30 38 3e 33  ers.html#H0008>3
0320: 2e 32 20 57 68 61 74 20 44 65 63 6c 61 72 61 74  .2 What Declarat
0330: 69 6f 6e 73 20 47 65 74 20 43 6f 70 69 65 64 3c  ions Get Copied<
0340: 2f 61 3e 0a 0a 3c 6c 69 3e 3c 61 20 68 72 65 66  /a>..<li><a href
0350: 3d 6d 61 6b 65 68 65 61 64 65 72 73 2e 68 74 6d  =makeheaders.htm
0360: 6c 23 48 30 30 30 39 3e 33 2e 33 20 48 6f 77 20  l#H0009>3.3 How 
0370: 54 6f 20 41 76 6f 69 64 20 48 61 76 69 6e 67 20  To Avoid Having 
0380: 54 6f 20 57 72 69 74 65 20 41 6e 79 20 48 65 61  To Write Any Hea
0390: 64 65 72 20 46 69 6c 65 73 3c 2f 61 3e 0a 0a 3c  der Files</a>..<
03a0: 6c 69 3e 3c 61 20 68 72 65 66 3d 6d 61 6b 65 68  li><a href=makeh
03b0: 65 61 64 65 72 73 2e 68 74 6d 6c 23 48 30 30 31  eaders.html#H001
03c0: 30 3e 33 2e 34 20 44 65 73 69 67 6e 61 74 69 6e  0>3.4 Designatin
03d0: 67 20 44 65 63 6c 61 72 61 74 69 6f 6e 73 20 46  g Declarations F
03e0: 6f 72 20 45 78 70 6f 72 74 3c 2f 61 3e 0a 0a 3c  or Export</a>..<
03f0: 6c 69 3e 3c 61 20 68 72 65 66 3d 6d 61 6b 65 68  li><a href=makeh
0400: 65 61 64 65 72 73 2e 68 74 6d 6c 23 48 30 30 31  eaders.html#H001
0410: 31 3e 33 2e 35 20 4c 6f 63 61 6c 20 64 65 63 6c  1>3.5 Local decl
0420: 61 72 61 74 69 6f 6e 73 20 70 72 6f 63 65 73 73  arations process
0430: 65 64 20 62 79 20 6d 61 6b 65 68 65 61 64 65 72  ed by makeheader
0440: 73 3c 2f 61 3e 0a 0a 3c 6c 69 3e 3c 61 20 68 72  s</a>..<li><a hr
0450: 65 66 3d 6d 61 6b 65 68 65 61 64 65 72 73 2e 68  ef=makeheaders.h
0460: 74 6d 6c 23 48 30 30 31 32 3e 33 2e 36 20 55 73  tml#H0012>3.6 Us
0470: 69 6e 67 20 4d 61 6b 65 68 65 61 64 65 72 73 20  ing Makeheaders 
0480: 57 69 74 68 20 43 2b 2b 20 43 6f 64 65 3c 2f 61  With C++ Code</a
0490: 3e 0a 0a 3c 6c 69 3e 3c 61 20 68 72 65 66 3d 6d  >..<li><a href=m
04a0: 61 6b 65 68 65 61 64 65 72 73 2e 68 74 6d 6c 23  akeheaders.html#
04b0: 48 30 30 31 33 3e 33 2e 37 20 43 6f 6e 64 69 74  H0013>3.7 Condit
04c0: 69 6f 6e 61 6c 20 43 6f 6d 70 69 6c 61 74 69 6f  ional Compilatio
04d0: 6e 3c 2f 61 3e 0a 0a 3c 6c 69 3e 3c 61 20 68 72  n</a>..<li><a hr
04e0: 65 66 3d 6d 61 6b 65 68 65 61 64 65 72 73 2e 68  ef=makeheaders.h
04f0: 74 6d 6c 23 48 30 30 31 34 3e 33 2e 38 20 43 61  tml#H0014>3.8 Ca
0500: 76 65 61 74 73 3c 2f 61 3e 0a 3c 2f 75 6c 3e 0a  veats</a>.</ul>.
0510: 3c 6c 69 3e 3c 61 20 68 72 65 66 3d 6d 61 6b 65  <li><a href=make
0520: 68 65 61 64 65 72 73 2e 68 74 6d 6c 23 48 30 30  headers.html#H00
0530: 31 35 3e 34 2e 30 20 55 73 69 6e 67 20 4d 61 6b  15>4.0 Using Mak
0540: 65 68 65 61 64 65 72 73 20 54 6f 20 47 65 6e 65  eheaders To Gene
0550: 72 61 74 65 20 44 6f 63 75 6d 65 6e 74 61 74 69  rate Documentati
0560: 6f 6e 3c 2f 61 3e 0a 0a 3c 6c 69 3e 3c 61 20 68  on</a>..<li><a h
0570: 72 65 66 3d 6d 61 6b 65 68 65 61 64 65 72 73 2e  ref=makeheaders.
0580: 68 74 6d 6c 23 48 30 30 31 36 3e 35 2e 30 20 43  html#H0016>5.0 C
0590: 6f 6d 70 69 6c 69 6e 67 20 54 68 65 20 4d 61 6b  ompiling The Mak
05a0: 65 68 65 61 64 65 72 73 20 50 72 6f 67 72 61 6d  eheaders Program
05b0: 3c 2f 61 3e 0a 0a 3c 6c 69 3e 3c 61 20 68 72 65  </a>..<li><a hre
05c0: 66 3d 6d 61 6b 65 68 65 61 64 65 72 73 2e 68 74  f=makeheaders.ht
05d0: 6d 6c 23 48 30 30 31 37 3e 36 2e 30 20 53 75 6d  ml#H0017>6.0 Sum
05e0: 6d 61 72 79 20 41 6e 64 20 43 6f 6e 63 6c 75 73  mary And Conclus
05f0: 69 6f 6e 3c 2f 61 3e 0a 3c 2f 75 6c 3e 3c 61 20  ion</a>.</ul><a 
0600: 6e 61 6d 65 3d 48 30 30 30 32 3e 0a 3c 68 32 3e  name=H0002>.<h2>
0610: 31 2e 30 20 42 61 63 6b 67 72 6f 75 6e 64 3c 2f  1.0 Background</
0620: 68 32 3e 0a 0a 3c 70 3e 0a 41 20 70 69 65 63 65  h2>..<p>.A piece
0630: 20 6f 66 20 43 20 73 6f 75 72 63 65 20 63 6f 64   of C source cod
0640: 65 20 63 61 6e 20 62 65 20 6f 6e 65 20 6f 66 20  e can be one of 
0650: 74 77 6f 20 74 68 69 6e 67 73 3a 0a 61 20 3c 65  two things:.a <e
0660: 6d 3e 64 65 63 6c 61 72 61 74 69 6f 6e 3c 2f 65  m>declaration</e
0670: 6d 3e 20 6f 72 20 61 20 3c 65 6d 3e 64 65 66 69  m> or a <em>defi
0680: 6e 69 74 69 6f 6e 3c 2f 65 6d 3e 2e 0a 41 20 64  nition</em>..A d
0690: 65 63 6c 61 72 61 74 69 6f 6e 20 69 73 20 73 6f  eclaration is so
06a0: 75 72 63 65 20 74 65 78 74 20 74 68 61 74 20 67  urce text that g
06b0: 69 76 65 73 20 69 6e 66 6f 72 6d 61 74 69 6f 6e  ives information
06c0: 20 74 6f 20 74 68 65 0a 63 6f 6d 70 69 6c 65 72   to the.compiler
06d0: 20 62 75 74 20 64 6f 65 73 6e 27 74 20 64 69 72   but doesn't dir
06e0: 65 63 74 6c 79 20 72 65 73 75 6c 74 20 69 6e 20  ectly result in 
06f0: 61 6e 79 20 63 6f 64 65 20 62 65 69 6e 67 20 67  any code being g
0700: 65 6e 65 72 61 74 65 64 2e 0a 41 20 64 65 66 69  enerated..A defi
0710: 6e 69 74 69 6f 6e 20 69 73 20 73 6f 75 72 63 65  nition is source
0720: 20 74 65 78 74 20 74 68 61 74 20 72 65 73 75 6c   text that resul
0730: 74 73 20 69 6e 20 65 78 65 63 75 74 61 62 6c 65  ts in executable
0740: 20 6d 61 63 68 69 6e 65 0a 69 6e 73 74 72 75 63   machine.instruc
0750: 74 69 6f 6e 73 20 6f 72 20 69 6e 69 74 69 61 6c  tions or initial
0760: 69 7a 61 74 69 6f 6e 20 64 61 74 61 2e 0a 28 54  ization data..(T
0770: 68 65 73 65 20 74 77 6f 20 74 65 72 6d 73 20 61  hese two terms a
0780: 72 65 20 73 6f 6d 65 74 69 6d 65 73 20 75 73 65  re sometimes use
0790: 64 20 69 6e 63 6f 6e 73 69 73 74 65 6e 74 6c 79  d inconsistently
07a0: 20 62 79 20 6f 74 68 65 72 20 61 75 74 68 6f 72   by other author
07b0: 73 2e 0a 49 6e 20 70 61 72 74 69 63 75 6c 61 72  s..In particular
07c0: 2c 20 6d 61 6e 79 20 70 65 6f 70 6c 65 20 72 65  , many people re
07d0: 76 65 72 73 65 20 74 68 65 20 6d 65 61 6e 69 6e  verse the meanin
07e0: 67 73 20 6f 66 20 74 68 65 73 65 20 77 6f 72 64  gs of these word
07f0: 73 20 77 68 65 6e 0a 64 69 73 63 75 73 73 69 6e  s when.discussin
0800: 67 20 50 61 73 63 61 6c 20 6f 72 20 41 64 61 20  g Pascal or Ada 
0810: 63 6f 64 65 2e 0a 54 68 65 20 6d 65 61 6e 69 6e  code..The meanin
0820: 67 73 20 64 65 73 63 72 69 62 65 64 20 68 65 72  gs described her
0830: 65 20 61 72 65 20 74 68 65 20 73 61 6d 65 20 61  e are the same a
0840: 73 20 75 73 65 64 20 69 6e 20 74 68 65 20 41 4e  s used in the AN
0850: 53 49 2d 43 0a 73 74 61 6e 64 61 72 64 73 20 64  SI-C.standards d
0860: 6f 63 75 6d 65 6e 74 2e 29 0a 3c 2f 70 3e 0a 0a  ocument.).</p>..
0870: 3c 70 3e 0a 44 65 63 6c 61 72 61 74 69 6f 6e 73  <p>.Declarations
0880: 20 69 6e 20 43 20 69 6e 63 6c 75 64 65 20 74 68   in C include th
0890: 69 6e 67 73 20 73 75 63 68 20 61 73 20 74 68 65  ings such as the
08a0: 20 66 6f 6c 6c 6f 77 69 6e 67 3a 0a 3c 75 6c 3e   following:.<ul>
08b0: 0a 3c 6c 69 3e 20 54 79 70 65 64 65 66 73 2e 0a  .<li> Typedefs..
08c0: 3c 6c 69 3e 20 53 74 72 75 63 74 75 72 65 2c 20  <li> Structure, 
08d0: 75 6e 69 6f 6e 20 61 6e 64 20 65 6e 75 6d 65 72  union and enumer
08e0: 61 74 69 6f 6e 20 64 65 63 6c 61 72 61 74 69 6f  ation declaratio
08f0: 6e 73 2e 0a 3c 6c 69 3e 20 46 75 6e 63 74 69 6f  ns..<li> Functio
0900: 6e 20 61 6e 64 20 70 72 6f 63 65 64 75 72 65 20  n and procedure 
0910: 70 72 6f 74 6f 74 79 70 65 73 2e 0a 3c 6c 69 3e  prototypes..<li>
0920: 20 50 72 65 70 72 6f 63 65 73 73 6f 72 20 6d 61   Preprocessor ma
0930: 63 72 6f 73 20 61 6e 64 20 23 64 65 66 69 6e 65  cros and #define
0940: 73 2e 0a 3c 6c 69 3e 20 60 60 65 78 74 65 72 6e  s..<li> ``extern
0950: 27 27 20 76 61 72 69 61 62 6c 65 20 64 65 63 6c  '' variable decl
0960: 61 72 61 74 69 6f 6e 73 2e 0a 3c 2f 75 6c 3e 0a  arations..</ul>.
0970: 3c 2f 70 3e 0a 0a 3c 70 3e 0a 44 65 66 69 6e 69  </p>..<p>.Defini
0980: 74 69 6f 6e 73 20 69 6e 20 43 2c 20 6f 6e 20 74  tions in C, on t
0990: 68 65 20 6f 74 68 65 72 20 68 61 6e 64 2c 20 69  he other hand, i
09a0: 6e 63 6c 75 64 65 20 74 68 65 73 65 20 6b 69 6e  nclude these kin
09b0: 64 73 20 6f 66 20 74 68 69 6e 67 73 3a 0a 3c 75  ds of things:.<u
09c0: 6c 3e 0a 3c 6c 69 3e 20 56 61 72 69 61 62 6c 65  l>.<li> Variable
09d0: 20 64 65 66 69 6e 69 74 69 6f 6e 73 2e 0a 3c 6c   definitions..<l
09e0: 69 3e 20 54 68 65 20 62 6f 64 69 65 73 20 6f 66  i> The bodies of
09f0: 20 66 75 6e 63 74 69 6f 6e 73 20 61 6e 64 20 70   functions and p
0a00: 72 6f 63 65 64 75 72 65 73 2e 0a 3c 6c 69 3e 20  rocedures..<li> 
0a10: 49 6e 69 74 69 61 6c 69 7a 61 74 69 6f 6e 20 64  Initialization d
0a20: 61 74 61 2e 0a 3c 2f 75 6c 3e 0a 3c 2f 70 3e 0a  ata..</ul>.</p>.
0a30: 0a 3c 70 3e 0a 54 68 65 20 64 69 73 74 69 6e 63  .<p>.The distinc
0a40: 74 69 6f 6e 20 62 65 74 77 65 65 6e 20 61 20 64  tion between a d
0a50: 65 63 6c 61 72 61 74 69 6f 6e 20 61 6e 64 20 61  eclaration and a
0a60: 20 64 65 66 69 6e 69 74 69 6f 6e 20 69 73 20 63   definition is c
0a70: 6f 6d 6d 6f 6e 20 69 6e 0a 6d 6f 64 65 72 6e 20  ommon in.modern 
0a80: 73 6f 66 74 77 61 72 65 20 65 6e 67 69 6e 65 65  software enginee
0a90: 72 69 6e 67 2e 0a 41 6e 6f 74 68 65 72 20 77 61  ring..Another wa
0aa0: 79 20 6f 66 20 6c 6f 6f 6b 69 6e 67 20 61 74 20  y of looking at 
0ab0: 74 68 65 20 64 69 66 66 65 72 65 6e 63 65 20 69  the difference i
0ac0: 73 20 74 68 61 74 20 74 68 65 20 64 65 63 6c 61  s that the decla
0ad0: 72 61 74 69 6f 6e 0a 69 73 20 74 68 65 20 3c 65  ration.is the <e
0ae0: 6d 3e 69 6e 74 65 72 66 61 63 65 3c 2f 65 6d 3e  m>interface</em>
0af0: 20 61 6e 64 20 74 68 65 20 64 65 66 69 6e 69 74   and the definit
0b00: 69 6f 6e 20 69 73 20 74 68 65 20 3c 65 6d 3e 69  ion is the <em>i
0b10: 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 3c 2f 65  mplementation</e
0b20: 6d 3e 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 49 6e  m>..</p>..<p>.In
0b30: 20 43 20 70 72 6f 67 72 61 6d 73 2c 20 69 74 20   C programs, it 
0b40: 68 61 73 20 61 6c 77 61 79 73 20 62 65 65 6e 20  has always been 
0b50: 74 68 65 20 74 72 61 64 69 74 69 6f 6e 20 74 68  the tradition th
0b60: 61 74 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 20  at declarations 
0b70: 61 72 65 0a 70 75 74 20 69 6e 20 66 69 6c 65 73  are.put in files
0b80: 20 77 69 74 68 20 74 68 65 20 60 60 3c 63 6f 64   with the ``<cod
0b90: 65 3e 2e 68 3c 2f 63 6f 64 65 3e 27 27 20 73 75  e>.h</code>'' su
0ba0: 66 66 69 78 20 61 6e 64 20 64 65 66 69 6e 69 74  ffix and definit
0bb0: 69 6f 6e 73 20 61 72 65 0a 70 6c 61 63 65 64 20  ions are.placed 
0bc0: 69 6e 20 60 60 3c 63 6f 64 65 3e 2e 63 3c 2f 63  in ``<code>.c</c
0bd0: 6f 64 65 3e 27 27 20 66 69 6c 65 73 2e 0a 54 68  ode>'' files..Th
0be0: 65 20 2e 63 20 66 69 6c 65 73 20 63 6f 6e 74 61  e .c files conta
0bf0: 69 6e 20 60 60 3c 63 6f 64 65 3e 23 69 6e 63 6c  in ``<code>#incl
0c00: 75 64 65 3c 2f 63 6f 64 65 3e 27 27 20 70 72 65  ude</code>'' pre
0c10: 70 72 6f 63 65 73 73 6f 72 20 73 74 61 74 65 6d  processor statem
0c20: 65 6e 74 73 0a 74 68 61 74 20 63 61 75 73 65 20  ents.that cause 
0c30: 74 68 65 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20  the contents of 
0c40: 2e 68 20 66 69 6c 65 73 20 74 6f 20 62 65 20 69  .h files to be i
0c50: 6e 63 6c 75 64 65 64 20 61 73 20 70 61 72 74 20  ncluded as part 
0c60: 6f 66 20 74 68 65 0a 73 6f 75 72 63 65 20 63 6f  of the.source co
0c70: 64 65 20 77 68 65 6e 20 74 68 65 20 2e 63 20 66  de when the .c f
0c80: 69 6c 65 20 69 73 20 63 6f 6d 70 69 6c 65 64 2e  ile is compiled.
0c90: 0a 49 6e 20 74 68 69 73 20 77 61 79 2c 20 74 68  .In this way, th
0ca0: 65 20 2e 68 20 66 69 6c 65 73 20 64 65 66 69 6e  e .h files defin
0cb0: 65 20 74 68 65 20 69 6e 74 65 72 66 61 63 65 20  e the interface 
0cc0: 74 6f 20 61 20 73 75 62 73 79 73 74 65 6d 20 61  to a subsystem a
0cd0: 6e 64 0a 74 68 65 20 2e 63 20 66 69 6c 65 73 20  nd.the .c files 
0ce0: 64 65 66 69 6e 65 20 68 6f 77 20 74 68 65 20 73  define how the s
0cf0: 75 62 73 79 73 74 65 6d 20 69 73 20 69 6d 70 6c  ubsystem is impl
0d00: 65 6d 65 6e 74 65 64 2e 0a 3c 2f 70 3e 0a 0a 3c  emented..</p>..<
0d10: 61 20 6e 61 6d 65 3d 48 30 30 30 33 3e 0a 3c 68  a name=H0003>.<h
0d20: 33 3e 31 2e 31 20 50 72 6f 62 6c 65 6d 73 20 57  3>1.1 Problems W
0d30: 69 74 68 20 54 68 65 20 54 72 61 64 69 74 69 6f  ith The Traditio
0d40: 6e 61 6c 20 41 70 70 72 6f 61 63 68 3c 2f 68 33  nal Approach</h3
0d50: 3e 0a 0a 3c 70 3e 0a 41 73 20 74 68 65 20 61 72  >..<p>.As the ar
0d60: 74 20 6f 66 20 63 6f 6d 70 75 74 65 72 20 70 72  t of computer pr
0d70: 6f 67 72 61 6d 6d 69 6e 67 20 63 6f 6e 74 69 6e  ogramming contin
0d80: 75 65 73 20 74 6f 20 61 64 76 61 6e 63 65 2c 20  ues to advance, 
0d90: 61 6e 64 20 74 68 65 20 73 69 7a 65 0a 61 6e 64  and the size.and
0da0: 20 63 6f 6d 70 6c 65 78 69 74 79 20 6f 66 20 70   complexity of p
0db0: 72 6f 67 72 61 6d 73 20 63 6f 6e 74 69 6e 75 65  rograms continue
0dc0: 73 20 74 6f 20 73 77 65 6c 6c 2c 20 74 68 65 20  s to swell, the 
0dd0: 74 72 61 64 69 74 69 6f 6e 61 6c 20 43 0a 61 70  traditional C.ap
0de0: 70 72 6f 61 63 68 20 6f 66 20 70 6c 61 63 69 6e  proach of placin
0df0: 67 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 20 61  g declarations a
0e00: 6e 64 20 64 65 66 69 6e 69 74 69 6f 6e 73 20 69  nd definitions i
0e10: 6e 20 73 65 70 61 72 61 74 65 20 66 69 6c 65 73  n separate files
0e20: 20 62 65 67 69 6e 73 0a 74 6f 20 70 72 65 73 65   begins.to prese
0e30: 6e 74 20 74 68 65 20 70 72 6f 67 72 61 6d 6d 65  nt the programme
0e40: 72 20 77 69 74 68 20 6c 6f 67 69 73 74 69 63 73  r with logistics
0e50: 20 61 6e 64 0a 6d 61 69 6e 74 65 6e 61 6e 63 65   and.maintenance
0e60: 20 70 72 6f 62 6c 65 6d 73 2e 0a 54 6f 20 77 69   problems..To wi
0e70: 74 3a 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 3c 6f 6c  t:.</p>..<p>.<ol
0e80: 3e 0a 3c 70 3e 3c 6c 69 3e 0a 49 6e 20 6c 61 72  >.<p><li>.In lar
0e90: 67 65 20 63 6f 64 65 73 20 77 69 74 68 20 6d 61  ge codes with ma
0ea0: 6e 79 20 73 6f 75 72 63 65 20 66 69 6c 65 73 2c  ny source files,
0eb0: 20 69 74 20 62 65 63 6f 6d 65 73 20 64 69 66 66   it becomes diff
0ec0: 69 63 75 6c 74 20 74 6f 20 64 65 74 65 72 6d 69  icult to determi
0ed0: 6e 65 0a 77 68 69 63 68 20 2e 68 20 66 69 6c 65  ne.which .h file
0ee0: 73 20 73 68 6f 75 6c 64 20 62 65 20 69 6e 63 6c  s should be incl
0ef0: 75 64 65 64 20 69 6e 20 77 68 69 63 68 20 2e 63  uded in which .c
0f00: 20 66 69 6c 65 73 2e 0a 3c 70 3e 3c 6c 69 3e 0a   files..<p><li>.
0f10: 49 74 20 69 73 20 74 79 70 69 63 61 6c 6c 79 20  It is typically 
0f20: 74 68 65 20 63 61 73 65 20 74 68 65 20 61 20 2e  the case the a .
0f30: 68 20 66 69 6c 65 20 77 69 6c 6c 20 62 65 20 66  h file will be f
0f40: 6f 72 63 65 64 20 74 6f 20 69 6e 63 6c 75 64 65  orced to include
0f50: 0a 61 6e 6f 74 68 65 72 20 2e 68 20 66 69 6c 65  .another .h file
0f60: 73 2c 20 77 68 69 63 68 20 69 6e 20 74 75 72 6e  s, which in turn
0f70: 20 6d 69 67 68 74 20 69 6e 63 6c 75 64 65 20 6f   might include o
0f80: 74 68 65 72 20 2e 68 20 66 69 6c 65 73 2c 0a 61  ther .h files,.a
0f90: 6e 64 20 73 6f 20 66 6f 72 74 68 2e 0a 54 68 65  nd so forth..The
0fa0: 20 2e 63 20 66 69 6c 65 20 6d 75 73 74 20 62 65   .c file must be
0fb0: 20 72 65 63 6f 6d 70 69 6c 65 64 20 77 68 65 6e   recompiled when
0fc0: 20 61 6e 79 20 6f 66 20 74 68 65 20 2e 68 20 66   any of the .h f
0fd0: 69 6c 65 73 20 69 6e 20 74 68 69 73 20 63 68 61  iles in this cha
0fe0: 69 6e 0a 61 72 65 20 61 6c 74 65 72 65 64 2c 20  in.are altered, 
0ff0: 62 75 74 20 69 74 20 63 61 6e 20 62 65 20 64 69  but it can be di
1000: 66 66 69 63 75 6c 74 20 74 6f 20 64 65 74 65 72  fficult to deter
1010: 6d 69 6e 65 20 77 68 61 74 20 2e 68 20 66 69 6c  mine what .h fil
1020: 65 73 20 61 72 65 20 66 6f 75 6e 64 0a 69 6e 20  es are found.in 
1030: 74 68 65 20 69 6e 63 6c 75 64 65 20 63 68 61 69  the include chai
1040: 6e 2e 0a 41 20 66 72 65 71 75 65 6e 74 20 4d 61  n..A frequent Ma
1050: 6b 65 66 69 6c 65 20 65 72 72 6f 72 20 69 73 20  kefile error is 
1060: 74 6f 20 6f 6d 69 74 20 73 6f 6d 65 20 2e 68 20  to omit some .h 
1070: 66 69 6c 65 73 20 66 72 6f 6d 20 61 20 64 65 70  files from a dep
1080: 65 6e 64 65 6e 63 79 0a 6c 69 73 74 20 65 76 65  endency.list eve
1090: 6e 20 74 68 6f 75 67 68 20 74 68 6f 73 65 20 66  n though those f
10a0: 69 6c 65 73 20 61 72 65 20 6f 6e 20 74 68 65 20  iles are on the 
10b0: 69 6e 63 6c 75 64 65 20 66 69 6c 65 20 63 68 61  include file cha
10c0: 69 6e 2e 0a 3c 70 3e 3c 6c 69 3e 0a 53 6f 6d 65  in..<p><li>.Some
10d0: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 69 73 20   information is 
10e0: 63 6f 6d 6d 6f 6e 20 74 6f 20 62 6f 74 68 20 74  common to both t
10f0: 68 65 20 64 65 63 6c 61 72 61 74 69 6f 6e 20 61  he declaration a
1100: 6e 64 20 74 68 65 20 64 65 66 69 6e 69 74 69 6f  nd the definitio
1110: 6e 20 6f 66 0a 61 6e 20 6f 62 6a 65 63 74 20 69  n of.an object i
1120: 6e 20 43 2c 20 61 6e 64 20 73 6f 20 6d 75 73 74  n C, and so must
1130: 20 62 65 20 72 65 70 65 61 74 65 64 20 69 6e 20   be repeated in 
1140: 62 6f 74 68 20 74 68 65 20 2e 68 20 61 6e 64 20  both the .h and 
1150: 74 68 65 20 2e 63 20 66 69 6c 65 73 0a 66 6f 72  the .c files.for
1160: 20 74 68 61 74 20 6f 62 6a 65 63 74 2e 0a 49 6e   that object..In
1170: 20 61 20 6c 61 72 67 65 20 70 72 6f 6a 65 63 74   a large project
1180: 2c 20 69 74 20 63 61 6e 20 62 65 63 6f 6d 65 20  , it can become 
1190: 69 6e 63 72 65 61 73 69 6e 67 6c 79 20 64 69 66  increasingly dif
11a0: 66 69 63 75 6c 74 20 74 6f 20 6b 65 65 70 20 74  ficult to keep t
11b0: 68 65 20 74 77 6f 0a 66 69 6c 65 73 20 69 6e 20  he two.files in 
11c0: 73 79 6e 63 2e 0a 3c 70 3e 3c 6c 69 3e 0a 57 68  sync..<p><li>.Wh
11d0: 65 6e 20 61 20 2e 63 20 66 69 6c 65 20 69 6e 63  en a .c file inc
11e0: 6c 75 64 65 73 20 61 20 2e 68 20 66 69 6c 65 20  ludes a .h file 
11f0: 61 6e 64 20 74 68 65 20 2e 68 20 66 69 6c 65 73  and the .h files
1200: 20 63 68 61 6e 67 65 73 2c 20 74 68 65 20 2e 63   changes, the .c
1210: 20 66 69 6c 65 0a 6d 75 73 74 20 62 65 20 72 65   file.must be re
1220: 63 6f 6d 70 69 6c 65 64 2c 20 65 76 65 6e 20 69  compiled, even i
1230: 66 20 74 68 65 20 70 61 72 74 20 6f 66 20 74 68  f the part of th
1240: 65 20 2e 68 20 66 69 6c 65 20 74 68 61 74 20 63  e .h file that c
1250: 68 61 6e 67 65 64 20 69 73 20 6e 6f 74 0a 61 63  hanged is not.ac
1260: 74 75 61 6c 6c 79 20 75 73 65 64 20 62 79 20 74  tually used by t
1270: 68 65 20 2e 63 20 66 69 6c 65 2e 0a 49 6e 20 61  he .c file..In a
1280: 20 6c 61 72 67 65 20 70 72 6f 67 72 61 6d 2c 20   large program, 
1290: 69 74 20 69 73 20 67 65 6e 65 72 61 6c 6c 79 20  it is generally 
12a0: 74 68 65 20 63 61 73 65 20 74 68 61 74 20 61 6c  the case that al
12b0: 6d 6f 73 74 20 65 76 65 72 79 20 2e 63 20 66 69  most every .c fi
12c0: 6c 65 20 65 6e 64 73 20 75 70 0a 64 65 70 65 6e  le ends up.depen
12d0: 64 69 6e 67 20 6f 6e 20 6f 6e 65 20 6f 72 20 74  ding on one or t
12e0: 77 6f 20 6f 66 20 74 68 65 20 6d 6f 72 65 20 69  wo of the more i
12f0: 6d 70 6f 72 74 61 6e 74 20 2e 68 20 66 69 6c 65  mportant .h file
1300: 73 2c 20 61 6e 64 20 73 6f 20 77 68 65 6e 20 74  s, and so when t
1310: 68 6f 73 65 20 2e 68 0a 66 69 6c 65 73 20 63 68  hose .h.files ch
1320: 61 6e 67 65 2c 20 74 68 65 20 65 6e 74 69 72 65  ange, the entire
1330: 20 70 72 6f 67 72 61 6d 20 6d 75 73 74 20 62 65   program must be
1340: 20 72 65 63 6f 6d 70 69 6c 65 64 2e 0a 49 74 20   recompiled..It 
1350: 61 6c 73 6f 20 68 61 70 70 65 6e 73 20 74 68 61  also happens tha
1360: 74 20 74 68 6f 73 65 20 69 6d 70 6f 72 74 61 6e  t those importan
1370: 74 20 2e 68 20 66 69 6c 65 73 20 74 65 6e 64 20  t .h files tend 
1380: 74 6f 20 62 65 20 74 68 65 20 6f 6e 65 73 20 74  to be the ones t
1390: 68 61 74 0a 63 68 61 6e 67 65 20 6d 6f 73 74 20  hat.change most 
13a0: 66 72 65 71 75 65 6e 74 6c 79 2e 0a 54 68 69 73  frequently..This
13b0: 20 6d 65 61 6e 73 20 74 68 61 74 20 74 68 65 20   means that the 
13c0: 65 6e 74 69 72 65 20 70 72 6f 67 72 61 6d 20 6d  entire program m
13d0: 75 73 74 20 62 65 20 72 65 63 6f 6d 70 69 6c 65  ust be recompile
13e0: 64 20 66 72 65 71 75 65 6e 74 6c 79 2c 0a 6c 65  d frequently,.le
13f0: 61 64 69 6e 67 20 74 6f 20 61 20 6c 65 6e 67 74  ading to a lengt
1400: 68 79 20 6d 6f 64 69 66 79 2d 63 6f 6d 70 69 6c  hy modify-compil
1410: 65 2d 74 65 73 74 20 63 79 63 6c 65 20 61 6e 64  e-test cycle and
1420: 20 61 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67   a corresponding
1430: 0a 64 65 63 72 65 61 73 65 20 69 6e 20 70 72 6f  .decrease in pro
1440: 67 72 61 6d 6d 65 72 20 70 72 6f 64 75 63 74 69  grammer producti
1450: 76 69 74 79 2e 0a 3c 70 3e 3c 6c 69 3e 0a 54 68  vity..<p><li>.Th
1460: 65 20 43 20 70 72 6f 67 72 61 6d 6d 69 6e 67 20  e C programming 
1470: 6c 61 6e 67 75 61 67 65 20 72 65 71 75 69 72 65  language require
1480: 73 20 74 68 61 74 20 64 65 63 6c 61 72 61 74 69  s that declarati
1490: 6f 6e 73 20 64 65 70 65 6e 64 69 6e 67 20 75 70  ons depending up
14a0: 6f 6e 20 0a 65 61 63 68 20 6f 74 68 65 72 20 6d  on .each other m
14b0: 75 73 74 20 6f 63 63 75 72 20 69 6e 20 61 20 70  ust occur in a p
14c0: 61 72 74 69 63 75 6c 61 72 20 6f 72 64 65 72 2e  articular order.
14d0: 0a 49 6e 20 61 20 70 72 6f 67 72 61 6d 20 77 69  .In a program wi
14e0: 74 68 20 63 6f 6d 70 6c 65 78 2c 20 69 6e 74 65  th complex, inte
14f0: 72 77 6f 76 65 6e 20 64 61 74 61 20 73 74 72 75  rwoven data stru
1500: 63 74 75 72 65 73 2c 20 74 68 65 20 63 6f 72 72  ctures, the corr
1510: 65 63 74 0a 64 65 63 6c 61 72 61 74 69 6f 6e 20  ect.declaration 
1520: 6f 72 64 65 72 20 63 61 6e 20 62 65 63 6f 6d 65  order can become
1530: 20 76 65 72 79 20 64 69 66 66 69 63 75 6c 74 20   very difficult 
1540: 74 6f 20 64 65 74 65 72 6d 69 6e 65 20 6d 61 6e  to determine man
1550: 75 61 6c 6c 79 2c 20 0a 65 73 70 65 63 69 61 6c  ually, .especial
1560: 6c 79 20 77 68 65 6e 20 74 68 65 20 64 65 63 6c  ly when the decl
1570: 61 72 61 74 69 6f 6e 73 20 69 6e 76 6f 6c 76 65  arations involve
1580: 64 20 61 72 65 20 73 70 72 65 61 64 20 6f 75 74  d are spread out
1590: 20 6f 76 65 72 20 73 65 76 65 72 61 6c 0a 66 69   over several.fi
15a0: 6c 65 73 2e 0a 3c 2f 6f 6c 3e 0a 3c 2f 70 3e 0a  les..</ol>.</p>.
15b0: 0a 3c 61 20 6e 61 6d 65 3d 48 30 30 30 34 3e 0a  .<a name=H0004>.
15c0: 3c 68 33 3e 31 2e 32 20 54 68 65 20 4d 61 6b 65  <h3>1.2 The Make
15d0: 68 65 61 64 65 72 73 20 53 6f 6c 75 74 69 6f 6e  headers Solution
15e0: 3c 2f 68 33 3e 0a 0a 3c 70 3e 0a 54 68 65 20 6d  </h3>..<p>.The m
15f0: 61 6b 65 68 65 61 64 65 72 73 20 70 72 6f 67 72  akeheaders progr
1600: 61 6d 20 69 73 20 64 65 73 69 67 6e 65 64 20 74  am is designed t
1610: 6f 20 61 6d 65 6c 69 6f 72 61 74 65 20 74 68 65  o ameliorate the
1620: 20 70 72 6f 62 6c 65 6d 73 20 61 73 73 6f 63 69   problems associ
1630: 61 74 65 64 0a 77 69 74 68 20 74 68 65 20 74 72  ated.with the tr
1640: 61 64 69 74 69 6f 6e 61 6c 20 43 20 70 72 6f 67  aditional C prog
1650: 72 61 6d 6d 69 6e 67 20 6d 6f 64 65 6c 20 62 79  ramming model by
1660: 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 67   automatically g
1670: 65 6e 65 72 61 74 69 6e 67 0a 74 68 65 20 69 6e  enerating.the in
1680: 74 65 72 66 61 63 65 20 69 6e 66 6f 72 6d 61 74  terface informat
1690: 69 6f 6e 20 69 6e 20 74 68 65 20 2e 68 20 66 69  ion in the .h fi
16a0: 6c 65 73 20 66 72 6f 6d 20 0a 69 6e 74 65 72 66  les from .interf
16b0: 61 63 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20  ace information 
16c0: 63 6f 6e 74 61 69 6e 65 64 20 69 6e 20 6f 74 68  contained in oth
16d0: 65 72 20 2e 68 20 66 69 6c 65 73 20 61 6e 64 0a  er .h files and.
16e0: 66 72 6f 6d 20 69 6d 70 6c 65 6d 65 6e 74 61 74  from implementat
16f0: 69 6f 6e 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20  ion information 
1700: 69 6e 20 74 68 65 20 2e 63 20 66 69 6c 65 73 2e  in the .c files.
1710: 0a 57 68 65 6e 20 74 68 65 20 6d 61 6b 65 68 65  .When the makehe
1720: 61 64 65 72 73 20 70 72 6f 67 72 61 6d 20 69 73  aders program is
1730: 20 72 75 6e 2c 20 69 74 20 73 63 61 6e 73 20 74   run, it scans t
1740: 68 65 20 73 6f 75 72 63 65 0a 66 69 6c 65 73 20  he source.files 
1750: 66 6f 72 20 61 20 70 72 6f 6a 65 63 74 2c 0a 74  for a project,.t
1760: 68 65 6e 20 67 65 6e 65 72 61 74 65 73 20 61 20  hen generates a 
1770: 73 65 72 69 65 73 20 6f 66 20 6e 65 77 20 2e 68  series of new .h
1780: 20 66 69 6c 65 73 2c 20 6f 6e 65 20 66 6f 72 20   files, one for 
1790: 65 61 63 68 20 2e 63 20 66 69 6c 65 2e 0a 54 68  each .c file..Th
17a0: 65 20 67 65 6e 65 72 61 74 65 64 20 2e 68 20 66  e generated .h f
17b0: 69 6c 65 73 20 63 6f 6e 74 61 69 6e 20 65 78 61  iles contain exa
17c0: 63 74 6c 79 20 74 68 6f 73 65 20 64 65 63 6c 61  ctly those decla
17d0: 72 61 74 69 6f 6e 73 20 72 65 71 75 69 72 65 64  rations required
17e0: 20 62 79 20 74 68 65 0a 63 6f 72 72 65 73 70 6f   by the.correspo
17f0: 6e 64 69 6e 67 20 2e 63 20 66 69 6c 65 73 2c 20  nding .c files, 
1800: 6e 6f 20 6d 6f 72 65 20 61 6e 64 20 6e 6f 20 6c  no more and no l
1810: 65 73 73 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 54  ess..</p>..<p>.T
1820: 68 65 20 6d 61 6b 65 68 65 61 64 65 72 73 20 70  he makeheaders p
1830: 72 6f 67 72 61 6d 6d 69 6e 67 20 6d 6f 64 65 6c  rogramming model
1840: 20 6f 76 65 72 63 6f 6d 65 73 20 61 6c 6c 20 6f   overcomes all o
1850: 66 20 74 68 65 20 6f 62 6a 65 63 74 69 6f 6e 73  f the objections
1860: 20 74 6f 20 74 68 65 0a 74 72 61 64 69 74 69 6f   to the.traditio
1870: 6e 61 6c 20 43 20 70 72 6f 67 72 61 6d 6d 69 6e  nal C programmin
1880: 67 20 6d 6f 64 65 6c 2e 0a 3c 6f 6c 3e 0a 3c 70  g model..<ol>.<p
1890: 3e 3c 6c 69 3e 0a 42 65 63 61 75 73 65 20 61 6c  ><li>.Because al
18a0: 6c 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 20 6e  l declarations n
18b0: 65 65 64 65 64 20 62 79 20 61 20 2e 63 20 66 69  eeded by a .c fi
18c0: 6c 65 20 61 72 65 20 63 6f 6e 74 61 69 6e 65 64  le are contained
18d0: 20 69 6e 20 61 0a 73 69 6e 67 6c 65 20 2e 68 20   in a.single .h 
18e0: 66 69 6c 65 2c 20 74 68 65 72 65 20 69 73 20 6e  file, there is n
18f0: 65 76 65 72 20 61 6e 79 20 71 75 65 73 74 69 6f  ever any questio
1900: 6e 20 61 62 6f 75 74 20 77 68 61 74 20 2e 68 20  n about what .h 
1910: 66 69 6c 65 73 0a 61 20 2e 63 20 77 69 6c 6c 20  files.a .c will 
1920: 6e 65 65 64 20 74 6f 20 69 6e 63 6c 75 64 65 2e  need to include.
1930: 20 20 49 66 20 74 68 65 20 2e 63 20 66 69 6c 65    If the .c file
1940: 20 69 73 20 6e 61 6d 65 64 0a 3c 63 6f 64 65 3e   is named.<code>
1950: 61 6c 70 68 61 2e 63 3c 2f 63 6f 64 65 3e 20 74  alpha.c</code> t
1960: 68 65 6e 20 69 74 20 6d 75 73 74 20 69 6e 63 6c  hen it must incl
1970: 75 64 65 20 6f 6e 6c 79 20 74 68 65 20 73 69 6e  ude only the sin
1980: 67 6c 65 20 2e 68 20 66 69 6c 65 0a 6e 61 6d 65  gle .h file.name
1990: 64 20 3c 63 6f 64 65 3e 61 6c 70 68 61 2e 68 3c  d <code>alpha.h<
19a0: 2f 63 6f 64 65 3e 2e 0a 28 54 68 65 20 2e 63 20  /code>..(The .c 
19b0: 66 69 6c 65 20 6d 69 67 68 74 20 61 6c 73 6f 20  file might also 
19c0: 75 73 65 20 73 6f 6d 65 20 69 6e 63 6c 75 64 65  use some include
19d0: 20 66 69 6c 65 73 20 66 72 6f 6d 20 74 68 65 20   files from the 
19e0: 73 74 61 6e 64 61 72 64 0a 6c 69 62 72 61 72 79  standard.library
19f0: 2c 20 73 75 63 68 20 61 73 20 3c 63 6f 64 65 3e  , such as <code>
1a00: 26 6c 74 3b 73 74 64 69 6f 2e 68 26 67 74 3c 2f  &lt;stdio.h&gt</
1a10: 63 6f 64 65 3e 2c 20 62 75 74 20 74 68 61 74 20  code>, but that 
1a20: 69 73 20 61 6e 6f 74 68 65 72 20 6d 61 74 74 65  is another matte
1a30: 72 2e 29 0a 3c 70 3e 3c 6c 69 3e 0a 54 68 65 20  r.).<p><li>.The 
1a40: 67 65 6e 65 72 61 74 65 64 20 2e 68 20 66 69 6c  generated .h fil
1a50: 65 73 20 64 6f 20 6e 6f 74 20 69 6e 63 6c 75 64  es do not includ
1a60: 65 20 6f 74 68 65 72 20 2e 68 20 66 69 6c 65 73  e other .h files
1a70: 2c 20 61 6e 64 20 73 6f 20 74 68 65 72 65 0a 61  , and so there.a
1a80: 72 65 20 6e 6f 20 69 6e 63 6c 75 64 65 20 63 68  re no include ch
1a90: 61 69 6e 73 20 74 6f 20 77 6f 72 72 79 20 61 62  ains to worry ab
1aa0: 6f 75 74 2e 0a 54 68 65 20 66 69 6c 65 20 3c 63  out..The file <c
1ab0: 6f 64 65 3e 61 6c 70 68 61 2e 63 3c 2f 63 6f 64  ode>alpha.c</cod
1ac0: 65 3e 20 64 65 70 65 6e 64 73 20 6f 6e 20 3c 63  e> depends on <c
1ad0: 6f 64 65 3e 61 6c 70 68 61 2e 68 3c 2f 63 6f 64  ode>alpha.h</cod
1ae0: 65 3e 20 61 6e 64 0a 6e 6f 74 68 69 6e 67 20 6d  e> and.nothing m
1af0: 6f 72 65 2e 0a 3c 70 3e 3c 6c 69 3e 0a 54 68 65  ore..<p><li>.The
1b00: 72 65 20 69 73 20 73 74 69 6c 6c 20 64 75 70 6c  re is still dupl
1b10: 69 63 61 74 69 6f 6e 20 69 6e 20 74 68 65 20 2e  ication in the .
1b20: 68 20 61 6e 64 20 74 68 65 20 2e 63 20 66 69 6c  h and the .c fil
1b30: 65 2c 20 62 75 74 20 62 65 63 61 75 73 65 0a 74  e, but because.t
1b40: 68 65 20 64 75 70 6c 69 63 61 74 65 20 69 6e 66  he duplicate inf
1b50: 6f 72 6d 61 74 69 6f 6e 20 69 73 20 61 75 74 6f  ormation is auto
1b60: 6d 61 74 69 63 61 6c 6c 79 20 67 65 6e 65 72 61  matically genera
1b70: 74 65 64 2c 20 69 74 20 69 73 20 6e 6f 20 6c 6f  ted, it is no lo
1b80: 6e 67 65 72 0a 61 20 70 72 6f 62 6c 65 6d 2e 0a  nger.a problem..
1b90: 53 69 6d 70 6c 79 20 72 65 72 75 6e 20 6d 61 6b  Simply rerun mak
1ba0: 65 68 65 61 64 65 72 73 20 74 6f 20 72 65 73 79  eheaders to resy
1bb0: 6e 63 68 72 6f 6e 69 7a 65 20 65 76 65 72 79 74  nchronize everyt
1bc0: 68 69 6e 67 2e 0a 3c 70 3e 3c 6c 69 3e 0a 54 68  hing..<p><li>.Th
1bd0: 65 20 67 65 6e 65 72 61 74 65 64 20 2e 68 20 66  e generated .h f
1be0: 69 6c 65 20 63 6f 6e 74 61 69 6e 73 20 74 68 65  ile contains the
1bf0: 20 6d 69 6e 69 6d 61 6c 20 73 65 74 20 6f 66 20   minimal set of 
1c00: 64 65 63 6c 61 72 61 74 69 6f 6e 73 20 6e 65 65  declarations nee
1c10: 64 65 64 0a 62 79 20 74 68 65 20 2e 63 20 66 69  ded.by the .c fi
1c20: 6c 65 2e 0a 54 68 69 73 20 6d 65 61 6e 73 20 74  le..This means t
1c30: 68 61 74 20 77 68 65 6e 20 73 6f 6d 65 74 68 69  hat when somethi
1c40: 6e 67 20 63 68 61 6e 67 65 73 2c 20 61 20 6d 69  ng changes, a mi
1c50: 6e 69 6d 61 6c 20 61 6d 6f 75 6e 74 20 6f 66 20  nimal amount of 
1c60: 72 65 63 6f 6d 70 69 6c 61 74 69 6f 6e 0a 69 73  recompilation.is
1c70: 20 72 65 71 75 69 72 65 64 20 74 6f 20 70 72 6f   required to pro
1c80: 64 75 63 65 20 61 6e 20 75 70 64 61 74 65 64 20  duce an updated 
1c90: 65 78 65 63 75 74 61 62 6c 65 2e 0a 45 78 70 65  executable..Expe
1ca0: 72 69 65 6e 63 65 20 68 61 73 20 73 68 6f 77 6e  rience has shown
1cb0: 20 74 68 61 74 20 74 68 69 73 20 67 69 76 65 73   that this gives
1cc0: 20 61 20 64 72 61 6d 61 74 69 63 20 69 6d 70 72   a dramatic impr
1cd0: 6f 76 65 6d 65 6e 74 20 0a 69 6e 20 70 72 6f 67  ovement .in prog
1ce0: 72 61 6d 6d 65 72 20 70 72 6f 64 75 63 74 69 76  rammer productiv
1cf0: 69 74 79 20 62 79 20 66 61 63 69 6c 69 74 61 74  ity by facilitat
1d00: 69 6e 67 20 61 20 72 61 70 69 64 20 6d 6f 64 69  ing a rapid modi
1d10: 66 79 2d 63 6f 6d 70 69 6c 65 2d 74 65 73 74 0a  fy-compile-test.
1d20: 63 79 63 6c 65 20 64 75 72 69 6e 67 20 64 65 76  cycle during dev
1d30: 65 6c 6f 70 6d 65 6e 74 2e 0a 3c 70 3e 3c 6c 69  elopment..<p><li
1d40: 3e 0a 54 68 65 20 6d 61 6b 65 68 65 61 64 65 72  >.The makeheader
1d50: 73 20 70 72 6f 67 72 61 6d 20 61 75 74 6f 6d 61  s program automa
1d60: 74 69 63 61 6c 6c 79 20 73 6f 72 74 73 20 64 65  tically sorts de
1d70: 63 6c 61 72 61 74 69 6f 6e 73 20 69 6e 74 6f 20  clarations into 
1d80: 74 68 65 0a 63 6f 72 72 65 63 74 20 6f 72 64 65  the.correct orde
1d90: 72 2c 20 63 6f 6d 70 6c 65 74 65 6c 79 20 65 6c  r, completely el
1da0: 69 6d 69 6e 61 74 69 6e 67 20 74 68 65 20 77 65  iminating the we
1db0: 61 72 69 73 6f 6d 65 20 61 6e 64 20 65 72 72 6f  arisome and erro
1dc0: 72 2d 70 72 6f 6e 65 0a 74 61 73 6b 20 6f 66 20  r-prone.task of 
1dd0: 73 6f 72 74 69 6e 67 20 64 65 63 6c 61 72 61 74  sorting declarat
1de0: 69 6f 6e 73 20 62 79 20 68 61 6e 64 2e 0a 3c 2f  ions by hand..</
1df0: 6f 6c 3e 0a 3c 70 3e 0a 0a 3c 70 3e 0a 49 6e 20  ol>.<p>..<p>.In 
1e00: 61 64 64 69 74 69 6f 6e 2c 20 74 68 65 20 6d 61  addition, the ma
1e10: 6b 65 68 65 61 64 65 72 73 20 70 72 6f 67 72 61  keheaders progra
1e20: 6d 20 69 73 20 66 61 73 74 20 61 6e 64 20 75 6e  m is fast and un
1e30: 69 6e 74 72 75 73 69 76 65 2e 0a 49 74 20 69 73  intrusive..It is
1e40: 20 61 20 73 69 6d 70 6c 65 20 6d 61 74 74 65 72   a simple matter
1e50: 20 74 6f 20 69 6e 63 6f 72 70 6f 72 61 74 65 20   to incorporate 
1e60: 6d 61 6b 65 68 65 61 64 65 72 73 20 69 6e 74 6f  makeheaders into
1e70: 20 61 20 4d 61 6b 65 66 69 6c 65 0a 73 6f 20 74   a Makefile.so t
1e80: 68 61 74 20 6d 61 6b 65 68 65 61 64 65 72 73 20  hat makeheaders 
1e90: 77 69 6c 6c 20 62 65 20 72 75 6e 20 61 75 74 6f  will be run auto
1ea0: 6d 61 74 69 63 61 6c 6c 79 20 77 68 65 6e 65 76  matically whenev
1eb0: 65 72 20 74 68 65 20 70 72 6f 6a 65 63 74 0a 69  er the project.i
1ec0: 73 20 72 65 62 75 69 6c 74 2e 0a 41 6e 64 20 74  s rebuilt..And t
1ed0: 68 65 20 62 75 72 64 65 6e 20 6f 66 20 72 75 6e  he burden of run
1ee0: 6e 69 6e 67 20 6d 61 6b 65 68 65 61 64 65 72 73  ning makeheaders
1ef0: 20 69 73 20 6c 69 67 68 74 2e 0a 49 74 20 77 69   is light..It wi
1f00: 6c 6c 20 65 61 73 69 6c 79 20 70 72 6f 63 65 73  ll easily proces
1f10: 73 20 74 65 6e 73 20 6f 66 20 74 68 6f 75 73 61  s tens of thousa
1f20: 6e 64 73 20 6f 66 20 6c 69 6e 65 73 20 6f 66 20  nds of lines of 
1f30: 73 6f 75 72 63 65 0a 63 6f 64 65 20 70 65 72 20  source.code per 
1f40: 73 65 63 6f 6e 64 2e 0a 3c 2f 70 3e 0a 0a 3c 61  second..</p>..<a
1f50: 20 6e 61 6d 65 3d 48 30 30 30 35 3e 0a 3c 68 32   name=H0005>.<h2
1f60: 3e 32 2e 30 20 52 75 6e 6e 69 6e 67 20 54 68 65  >2.0 Running The
1f70: 20 4d 61 6b 65 68 65 61 64 65 72 73 20 50 72 6f   Makeheaders Pro
1f80: 67 72 61 6d 3c 2f 68 32 3e 0a 0a 3c 70 3e 0a 54  gram</h2>..<p>.T
1f90: 68 65 20 6d 61 6b 65 68 65 61 64 65 72 73 20 70  he makeheaders p
1fa0: 72 6f 67 72 61 6d 20 69 73 20 76 65 72 79 20 65  rogram is very e
1fb0: 61 73 79 20 74 6f 20 72 75 6e 2e 0a 49 66 20 79  asy to run..If y
1fc0: 6f 75 20 68 61 76 65 20 61 20 63 6f 6c 6c 65 63  ou have a collec
1fd0: 74 69 6f 6e 20 6f 66 20 43 20 73 6f 75 72 63 65  tion of C source
1fe0: 20 63 6f 64 65 20 61 6e 64 20 69 6e 63 6c 75 64   code and includ
1ff0: 65 20 66 69 6c 65 73 20 69 6e 20 74 68 65 20 77  e files in the w
2000: 6f 72 6b 69 6e 67 0a 64 69 72 65 63 74 6f 72 79  orking.directory
2010: 2c 20 74 68 65 6e 20 79 6f 75 20 63 61 6e 20 72  , then you can r
2020: 75 6e 20 6d 61 6b 65 68 65 61 64 65 72 73 20 74  un makeheaders t
2030: 6f 20 67 65 6e 65 72 61 74 65 20 61 70 70 72 6f  o generate appro
2040: 70 72 69 61 74 65 20 2e 68 0a 66 69 6c 65 73 20  priate .h.files 
2050: 75 73 69 6e 67 20 74 68 65 20 66 6f 6c 6c 6f 77  using the follow
2060: 69 6e 67 20 63 6f 6d 6d 61 6e 64 3a 0a 3c 70 72  ing command:.<pr
2070: 65 3e 0a 20 20 20 6d 61 6b 65 68 65 61 64 65 72  e>.   makeheader
2080: 73 20 2a 2e 5b 63 68 5d 0a 3c 2f 70 72 65 3e 0a  s *.[ch].</pre>.
2090: 54 68 61 74 27 73 20 72 65 61 6c 6c 79 20 61 6c  That's really al
20a0: 6c 20 74 68 65 72 65 20 69 73 20 74 6f 20 69 74  l there is to it
20b0: 21 0a 54 68 69 73 20 63 6f 6d 6d 61 6e 64 20 77  !.This command w
20c0: 69 6c 6c 20 67 65 6e 65 72 61 74 65 20 6f 6e 65  ill generate one
20d0: 20 2e 68 20 66 69 6c 65 20 66 6f 72 20 65 76 65   .h file for eve
20e0: 72 79 20 2e 63 20 66 69 6c 65 2e 0a 41 6e 79 20  ry .c file..Any 
20f0: 2e 68 20 66 69 6c 65 73 20 74 68 61 74 20 77 65  .h files that we
2100: 72 65 20 67 65 6e 65 72 61 74 65 64 20 62 79 20  re generated by 
2110: 61 20 70 72 69 6f 72 20 72 75 6e 20 6f 66 20 6d  a prior run of m
2120: 61 6b 65 68 65 61 64 65 72 73 0a 61 72 65 20 69  akeheaders.are i
2130: 67 6e 6f 72 65 64 2c 0a 62 75 74 20 6d 61 6e 75  gnored,.but manu
2140: 61 6c 6c 79 20 65 6e 74 65 72 65 64 20 2e 68 20  ally entered .h 
2150: 66 69 6c 65 73 0a 74 68 61 74 20 63 6f 6e 74 61  files.that conta
2160: 69 6e 20 73 74 72 75 63 74 75 72 65 20 64 65 63  in structure dec
2170: 6c 61 72 61 74 69 6f 6e 73 20 61 6e 64 20 73 6f  larations and so
2180: 20 66 6f 72 74 68 20 77 69 6c 6c 20 62 65 20 73   forth will be s
2190: 63 61 6e 6e 65 64 20 61 6e 64 0a 74 68 65 20 64  canned and.the d
21a0: 65 63 6c 61 72 61 74 69 6f 6e 73 20 77 69 6c 6c  eclarations will
21b0: 20 62 65 20 63 6f 70 69 65 64 20 69 6e 74 6f 20   be copied into 
21c0: 74 68 65 20 67 65 6e 65 72 61 74 65 64 20 2e 68  the generated .h
21d0: 20 66 69 6c 65 73 20 61 73 0a 61 70 70 72 6f 70   files as.approp
21e0: 72 69 61 74 65 2e 0a 42 75 74 20 69 66 20 6d 61  riate..But if ma
21f0: 6b 65 68 65 61 64 65 72 73 20 73 65 65 73 20 74  keheaders sees t
2200: 68 61 74 20 74 68 65 20 2e 68 20 66 69 6c 65 20  hat the .h file 
2210: 74 68 61 74 20 69 74 20 68 61 73 20 67 65 6e 65  that it has gene
2220: 72 61 74 65 64 20 69 73 20 6e 6f 0a 64 69 66 66  rated is no.diff
2230: 65 72 65 6e 74 20 66 72 6f 6d 20 74 68 65 20 2e  erent from the .
2240: 68 20 66 69 6c 65 20 69 74 20 67 65 6e 65 72 61  h file it genera
2250: 74 65 64 20 6c 61 73 74 20 74 69 6d 65 2c 20 69  ted last time, i
2260: 74 20 64 6f 65 73 6e 27 74 20 75 70 64 61 74 65  t doesn't update
2270: 0a 74 68 65 20 66 69 6c 65 2e 0a 54 68 69 73 20  .the file..This 
2280: 70 72 65 76 65 6e 74 73 20 74 68 65 20 63 6f 72  prevents the cor
2290: 72 65 73 70 6f 6e 64 69 6e 67 20 2e 63 20 66 69  responding .c fi
22a0: 6c 65 73 20 66 72 6f 6d 20 68 61 76 69 6e 67 20  les from having 
22b0: 74 6f 20 0a 62 65 20 6e 65 65 64 6c 65 73 73 6c  to .be needlessl
22c0: 79 20 72 65 63 6f 6d 70 69 6c 65 64 2e 0a 3c 2f  y recompiled..</
22d0: 70 3e 0a 0a 3c 70 3e 0a 54 68 65 72 65 20 61 72  p>..<p>.There ar
22e0: 65 20 73 65 76 65 72 61 6c 20 6f 70 74 69 6f 6e  e several option
22f0: 73 20 74 6f 20 74 68 65 20 6d 61 6b 65 68 65 61  s to the makehea
2300: 64 65 72 73 20 70 72 6f 67 72 61 6d 20 74 68 61  ders program tha
2310: 74 20 63 61 6e 0a 62 65 20 75 73 65 64 20 74 6f  t can.be used to
2320: 20 61 6c 74 65 72 20 69 74 73 20 62 65 68 61 76   alter its behav
2330: 69 6f 72 2e 0a 54 68 65 20 64 65 66 61 75 6c 74  ior..The default
2340: 20 62 65 68 61 76 69 6f 72 20 69 73 20 74 6f 20   behavior is to 
2350: 77 72 69 74 65 20 61 20 73 69 6e 67 6c 65 20 2e  write a single .
2360: 68 20 66 69 6c 65 20 66 6f 72 20 65 61 63 68 20  h file for each 
2370: 2e 63 20 66 69 6c 65 20 61 6e 64 0a 74 6f 20 67  .c file and.to g
2380: 69 76 65 20 74 68 65 20 2e 68 20 66 69 6c 65 20  ive the .h file 
2390: 74 68 65 20 73 61 6d 65 20 62 61 73 65 20 6e 61  the same base na
23a0: 6d 65 20 61 73 20 74 68 65 20 2e 63 20 66 69 6c  me as the .c fil
23b0: 65 2e 0a 49 6e 73 74 65 61 64 20 6f 66 20 67 65  e..Instead of ge
23c0: 6e 65 72 61 74 69 6e 67 20 61 20 77 68 6f 6c 65  nerating a whole
23d0: 20 6d 65 73 73 20 6f 66 20 2e 68 20 66 69 6c 65   mess of .h file
23e0: 73 2c 20 79 6f 75 20 63 61 6e 2c 20 69 66 20 79  s, you can, if y
23f0: 6f 75 20 63 68 6f 6f 73 65 2c 0a 67 65 6e 65 72  ou choose,.gener
2400: 61 74 65 20 61 20 73 69 6e 67 6c 65 20 62 69 67  ate a single big
2410: 20 2e 68 20 66 69 6c 65 20 74 68 61 74 20 63 6f   .h file that co
2420: 6e 74 61 69 6e 73 20 61 6c 6c 20 64 65 63 6c 61  ntains all decla
2430: 72 61 74 69 6f 6e 73 20 6e 65 65 64 65 64 0a 62  rations needed.b
2440: 79 20 61 6c 6c 20 74 68 65 20 2e 63 20 66 69 6c  y all the .c fil
2450: 65 73 2e 20 20 44 6f 20 74 68 69 73 20 75 73 69  es.  Do this usi
2460: 6e 67 20 74 68 65 20 2d 68 20 6f 70 74 69 6f 6e  ng the -h option
2470: 20 74 6f 20 6d 61 6b 65 68 65 61 64 65 72 73 2e   to makeheaders.
2480: 0a 41 73 20 66 6f 6c 6c 6f 77 73 3a 0a 3c 70 72  .As follows:.<pr
2490: 65 3e 0a 20 20 20 6d 61 6b 65 68 65 61 64 65 72  e>.   makeheader
24a0: 73 20 2d 68 20 2a 2e 5b 63 68 5d 20 3e 63 6f 6d  s -h *.[ch] >com
24b0: 6d 6f 6e 2e 68 0a 3c 2f 70 72 65 3e 0a 57 69 74  mon.h.</pre>.Wit
24c0: 68 20 74 68 65 20 2d 68 20 6f 70 74 69 6f 6e 2c  h the -h option,
24d0: 20 74 68 65 20 2e 68 20 66 69 6c 65 20 69 73 20   the .h file is 
24e0: 6e 6f 74 20 61 63 74 75 61 6c 6c 79 20 77 72 69  not actually wri
24f0: 74 74 65 6e 20 74 6f 20 61 20 64 69 73 6b 20 66  tten to a disk f
2500: 69 6c 65 20 62 75 74 0a 69 6e 73 74 65 61 64 20  ile but.instead 
2510: 61 70 70 65 61 72 73 20 6f 6e 20 73 74 61 6e 64  appears on stand
2520: 61 72 64 20 6f 75 74 70 75 74 2c 20 77 68 65 72  ard output, wher
2530: 65 20 79 6f 75 20 61 72 65 20 66 72 65 65 20 74  e you are free t
2540: 6f 20 72 65 64 69 72 65 63 74 20 69 74 0a 69 6e  o redirect it.in
2550: 74 6f 20 74 68 65 20 66 69 6c 65 20 6f 66 20 79  to the file of y
2560: 6f 75 72 20 63 68 6f 69 63 65 2e 0a 3c 2f 70 3e  our choice..</p>
2570: 0a 0a 3c 70 3e 0a 41 20 73 69 6d 69 6c 61 72 20  ..<p>.A similar 
2580: 6f 70 74 69 6f 6e 20 69 73 20 2d 48 2e 20 20 4c  option is -H.  L
2590: 69 6b 65 20 74 68 65 20 6c 6f 77 65 72 2d 63 61  ike the lower-ca
25a0: 73 65 20 2d 68 20 6f 70 74 69 6f 6e 2c 20 62 69  se -h option, bi
25b0: 67 20 2d 48 0a 67 65 6e 65 72 61 74 65 73 20 61  g -H.generates a
25c0: 20 73 69 6e 67 6c 65 20 69 6e 63 6c 75 64 65 20   single include 
25d0: 66 69 6c 65 20 6f 6e 20 73 74 61 6e 64 61 72 64  file on standard
25e0: 20 6f 75 74 70 75 74 2e 20 20 42 75 74 20 75 6e   output.  But un
25f0: 6c 69 6b 65 0a 73 6d 61 6c 6c 20 2d 68 2c 20 74  like.small -h, t
2600: 68 65 20 62 69 67 20 2d 48 20 6f 6e 6c 79 20 65  he big -H only e
2610: 6d 69 74 73 20 70 72 6f 74 6f 74 79 70 65 73 20  mits prototypes 
2620: 61 6e 64 20 64 65 63 6c 61 72 61 74 69 6f 6e 73  and declarations
2630: 20 74 68 61 74 0a 68 61 76 65 20 62 65 65 6e 20   that.have been 
2640: 64 65 73 69 67 6e 61 74 65 64 20 61 73 20 60 60  designated as ``
2650: 65 78 70 6f 72 74 61 62 6c 65 27 27 2e 0a 54 68  exportable''..Th
2660: 65 20 69 64 65 61 20 69 73 20 74 68 61 74 20 2d  e idea is that -
2670: 48 20 77 69 6c 6c 20 67 65 6e 65 72 61 74 65 20  H will generate 
2680: 61 6e 20 69 6e 63 6c 75 64 65 20 66 69 6c 65 20  an include file 
2690: 74 68 61 74 20 64 65 66 69 6e 65 73 0a 74 68 65  that defines.the
26a0: 20 69 6e 74 65 72 66 61 63 65 20 74 6f 20 61 20   interface to a 
26b0: 6c 69 62 72 61 72 79 2e 0a 4d 6f 72 65 20 77 69  library..More wi
26c0: 6c 6c 20 62 65 20 73 61 69 64 20 61 62 6f 75 74  ll be said about
26d0: 20 74 68 69 73 20 69 6e 20 73 65 63 74 69 6f 6e   this in section
26e0: 20 33 2e 34 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a   3.4..</p>..<p>.
26f0: 53 6f 6d 65 74 69 6d 65 73 20 79 6f 75 20 77 61  Sometimes you wa
2700: 6e 74 20 74 68 65 20 62 61 73 65 20 6e 61 6d 65  nt the base name
2710: 20 6f 66 20 74 68 65 20 2e 63 20 66 69 6c 65 20   of the .c file 
2720: 61 6e 64 20 74 68 65 20 2e 68 20 66 69 6c 65 20  and the .h file 
2730: 74 6f 0a 62 65 20 64 69 66 66 65 72 65 6e 74 2e  to.be different.
2740: 0a 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 73 75  .For example, su
2750: 70 70 6f 73 65 20 79 6f 75 20 77 61 6e 74 20 74  ppose you want t
2760: 68 65 20 69 6e 63 6c 75 64 65 20 66 69 6c 65 20  he include file 
2770: 66 6f 72 20 3c 63 6f 64 65 3e 61 6c 70 68 61 2e  for <code>alpha.
2780: 63 3c 2f 63 6f 64 65 3e 0a 74 6f 20 62 65 20 63  c</code>.to be c
2790: 61 6c 6c 65 64 20 3c 63 6f 64 65 3e 62 65 74 61  alled <code>beta
27a0: 2e 68 3c 2f 63 6f 64 65 3e 2e 0a 49 6e 20 74 68  .h</code>..In th
27b0: 69 73 20 63 61 73 65 2c 20 79 6f 75 20 77 6f 75  is case, you wou
27c0: 6c 64 20 69 6e 76 6f 6b 65 20 6d 61 6b 65 68 65  ld invoke makehe
27d0: 61 64 65 72 73 20 61 73 20 66 6f 6c 6c 6f 77 73  aders as follows
27e0: 3a 0a 3c 70 72 65 3e 0a 20 20 20 6d 61 6b 65 68  :.<pre>.   makeh
27f0: 65 61 64 65 72 73 20 61 6c 70 68 61 2e 63 3a 62  eaders alpha.c:b
2800: 65 74 61 2e 68 0a 3c 2f 70 72 65 3e 0a 41 6e 79  eta.h.</pre>.Any
2810: 20 74 69 6d 65 20 61 20 66 69 6c 65 6e 61 6d 65   time a filename
2820: 20 61 72 67 75 6d 65 6e 74 20 63 6f 6e 74 61 69   argument contai
2830: 6e 73 20 61 20 63 6f 6c 6f 6e 2c 20 74 68 65 20  ns a colon, the 
2840: 6e 61 6d 65 20 62 65 66 6f 72 65 20 74 68 65 0a  name before the.
2850: 63 6f 6c 6f 6e 20 69 73 20 74 61 6b 65 6e 20 74  colon is taken t
2860: 6f 20 62 65 20 74 68 65 20 6e 61 6d 65 20 6f 66  o be the name of
2870: 20 74 68 65 20 2e 63 20 66 69 6c 65 20 61 6e 64   the .c file and
2880: 20 74 68 65 20 6e 61 6d 65 20 61 66 74 65 72 20   the name after 
2890: 74 68 65 0a 63 6f 6c 6f 6e 20 69 73 20 74 61 6b  the.colon is tak
28a0: 65 6e 20 74 6f 20 62 65 20 74 68 65 20 6e 61 6d  en to be the nam
28b0: 65 20 6f 66 20 74 68 65 20 2e 68 20 66 69 6c 65  e of the .h file
28c0: 2e 0a 59 6f 75 20 63 61 6e 27 74 20 75 73 65 20  ..You can't use 
28d0: 74 68 65 20 73 68 65 6c 6c 27 73 20 77 69 6c 64  the shell's wild
28e0: 63 61 72 64 20 6d 65 63 68 61 6e 69 73 6d 20 77  card mechanism w
28f0: 69 74 68 20 74 68 69 73 20 61 70 70 72 6f 61 63  ith this approac
2900: 68 2c 20 62 75 74 20 74 68 61 74 0a 6e 6f 72 6d  h, but that.norm
2910: 61 6c 6c 79 20 69 73 6e 27 74 20 61 20 70 72 6f  ally isn't a pro
2920: 62 6c 65 6d 20 69 6e 20 4d 61 6b 65 66 69 6c 65  blem in Makefile
2930: 73 2c 20 77 68 69 63 68 20 69 73 20 77 68 65 72  s, which is wher
2940: 65 20 74 68 69 73 20 73 74 75 66 66 0a 63 6f 6d  e this stuff.com
2950: 65 73 20 69 6e 20 68 61 6e 64 79 2e 0a 3c 2f 70  es in handy..</p
2960: 3e 0a 0a 3c 70 3e 0a 49 66 20 79 6f 75 20 77 61  >..<p>.If you wa
2970: 6e 74 20 61 20 70 61 72 74 69 63 75 6c 61 72 20  nt a particular 
2980: 66 69 6c 65 20 74 6f 20 62 65 20 73 63 61 6e 6e  file to be scann
2990: 65 64 20 62 79 20 6d 61 6b 65 68 65 61 64 65 72  ed by makeheader
29a0: 73 20 62 75 74 20 79 6f 75 0a 64 6f 6e 27 74 20  s but you.don't 
29b0: 77 61 6e 74 20 6d 61 6b 65 68 65 61 64 65 72 73  want makeheaders
29c0: 20 74 6f 20 67 65 6e 65 72 61 74 65 20 61 20 68   to generate a h
29d0: 65 61 64 65 72 20 66 69 6c 65 20 66 6f 72 20 74  eader file for t
29e0: 68 61 74 20 66 69 6c 65 2c 0a 74 68 65 6e 20 79  hat file,.then y
29f0: 6f 75 20 63 61 6e 20 73 75 70 70 6c 79 20 61 6e  ou can supply an
2a00: 20 65 6d 70 74 79 20 68 65 61 64 65 72 20 66 69   empty header fi
2a10: 6c 65 6e 61 6d 65 2c 20 6c 69 6b 65 20 74 68 69  lename, like thi
2a20: 73 3a 0a 3c 70 72 65 3e 0a 20 20 20 6d 61 6b 65  s:.<pre>.   make
2a30: 68 65 61 64 65 72 73 20 61 6c 70 68 61 2e 63 20  headers alpha.c 
2a40: 62 65 74 61 2e 63 20 67 61 6d 6d 61 2e 63 3a 0a  beta.c gamma.c:.
2a50: 3c 2f 70 72 65 3e 0a 49 6e 20 74 68 69 73 20 65  </pre>.In this e
2a60: 78 61 6d 70 6c 65 2c 20 6d 61 6b 65 68 65 61 64  xample, makehead
2a70: 65 72 73 20 77 69 6c 6c 20 73 63 61 6e 20 74 68  ers will scan th
2a80: 65 20 74 68 72 65 65 20 66 69 6c 65 73 20 6e 61  e three files na
2a90: 6d 65 64 0a 60 60 61 6c 70 68 61 2e 63 27 27 2c  med.``alpha.c'',
2aa0: 0a 60 60 62 65 74 61 2e 63 27 27 20 61 6e 64 0a  .``beta.c'' and.
2ab0: 60 60 67 61 6d 6d 61 2e 63 27 27 0a 62 75 74 20  ``gamma.c''.but 
2ac0: 62 65 63 61 75 73 65 20 6f 66 20 74 68 65 20 63  because of the c
2ad0: 6f 6c 6f 6e 20 6f 6e 20 74 68 65 20 65 6e 64 20  olon on the end 
2ae0: 6f 66 20 74 68 69 72 64 20 66 69 6c 65 6e 61 6d  of third filenam
2af0: 65 0a 69 74 20 77 69 6c 6c 20 6f 6e 6c 79 20 67  e.it will only g
2b00: 65 6e 65 72 61 74 65 20 68 65 61 64 65 72 73 20  enerate headers 
2b10: 66 6f 72 20 74 68 65 20 66 69 72 73 74 20 74 77  for the first tw
2b20: 6f 20 66 69 6c 65 73 2e 0a 55 6e 66 6f 72 74 75  o files..Unfortu
2b30: 6e 61 74 65 6c 79 2c 0a 69 74 20 69 73 20 6e 6f  nately,.it is no
2b40: 74 20 70 6f 73 73 69 62 6c 65 20 74 6f 20 67 65  t possible to ge
2b50: 74 20 6d 61 6b 65 68 65 61 64 65 72 73 20 74 6f  t makeheaders to
2b60: 20 70 72 6f 63 65 73 73 20 61 6e 79 20 66 69 6c   process any fil
2b70: 65 20 77 68 6f 73 65 20 0a 6e 61 6d 65 20 63 6f  e whose .name co
2b80: 6e 74 61 69 6e 73 20 61 20 63 6f 6c 6f 6e 2e 0a  ntains a colon..
2b90: 3c 2f 70 3e 0a 0a 3c 70 3e 0a 49 6e 20 61 20 6c  </p>..<p>.In a l
2ba0: 61 72 67 65 20 70 72 6f 6a 65 63 74 2c 20 74 68  arge project, th
2bb0: 65 20 6c 65 6e 67 74 68 20 6f 66 20 74 68 65 20  e length of the 
2bc0: 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 66 6f 72  command line for
2bd0: 20 6d 61 6b 65 68 65 61 64 65 72 73 0a 63 61 6e   makeheaders.can
2be0: 20 62 65 63 6f 6d 65 20 76 65 72 79 20 6c 6f 6e   become very lon
2bf0: 67 2e 0a 49 66 20 74 68 65 20 6f 70 65 72 61 74  g..If the operat
2c00: 69 6e 67 20 73 79 73 74 65 6d 20 64 6f 65 73 6e  ing system doesn
2c10: 27 74 20 73 75 70 70 6f 72 74 20 6c 6f 6e 67 20  't support long 
2c20: 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 73 0a 28 65  command lines.(e
2c30: 78 61 6d 70 6c 65 3a 20 44 4f 53 20 61 6e 64 20  xample: DOS and 
2c40: 57 69 6e 33 32 29 20 79 6f 75 20 6d 61 79 20 6e  Win32) you may n
2c50: 6f 74 20 62 65 20 61 62 6c 65 20 74 6f 20 6c 69  ot be able to li
2c60: 73 74 20 61 6c 6c 20 6f 66 20 74 68 65 0a 69 6e  st all of the.in
2c70: 70 75 74 20 66 69 6c 65 73 20 69 6e 20 74 68 65  put files in the
2c80: 20 73 70 61 63 65 20 61 76 61 69 6c 61 62 6c 65   space available
2c90: 2e 0a 49 6e 20 74 68 61 74 20 63 61 73 65 2c 20  ..In that case, 
2ca0: 79 6f 75 20 63 61 6e 20 75 73 65 20 74 68 65 20  you can use the 
2cb0: 60 60 2d 66 27 27 20 6f 70 74 69 6f 6e 20 66 6f  ``-f'' option fo
2cc0: 6c 6c 6f 77 65 64 0a 62 79 20 74 68 65 20 6e 61  llowed.by the na
2cd0: 6d 65 20 6f 66 20 61 20 66 69 6c 65 20 74 6f 20  me of a file to 
2ce0: 63 61 75 73 65 20 6d 61 6b 65 68 65 61 64 65 72  cause makeheader
2cf0: 73 20 74 6f 20 72 65 61 64 20 63 6f 6d 6d 61 6e  s to read comman
2d00: 64 20 6c 69 6e 65 0a 6f 70 74 69 6f 6e 73 20 61  d line.options a
2d10: 6e 64 20 66 69 6c 65 6e 61 6d 65 20 66 72 6f 6d  nd filename from
2d20: 20 74 68 65 20 66 69 6c 65 20 69 6e 73 74 65 61   the file instea
2d30: 64 20 6f 66 20 66 72 6f 6d 20 74 68 65 20 63 6f  d of from the co
2d40: 6d 6d 61 6e 64 20 6c 69 6e 65 2e 0a 46 6f 72 20  mmand line..For 
2d50: 65 78 61 6d 70 6c 65 2c 20 79 6f 75 20 6d 69 67  example, you mig
2d60: 68 74 20 70 72 65 70 61 72 65 20 61 20 66 69 6c  ht prepare a fil
2d70: 65 20 6e 61 6d 65 64 20 60 60 6d 6b 68 64 72 2e  e named ``mkhdr.
2d80: 64 61 74 27 27 0a 74 68 61 74 20 63 6f 6e 74 61  dat''.that conta
2d90: 69 6e 73 20 74 65 78 74 20 6c 69 6b 65 20 74 68  ins text like th
2da0: 69 73 3a 0a 3c 70 72 65 3e 0a 20 20 73 72 63 2f  is:.<pre>.  src/
2db0: 61 6c 70 68 61 2e 63 3a 68 64 72 2f 61 6c 70 68  alpha.c:hdr/alph
2dc0: 61 2e 68 0a 20 20 73 72 63 2f 62 65 74 61 2e 63  a.h.  src/beta.c
2dd0: 3a 68 64 72 2f 62 65 74 61 2e 68 0a 20 20 73 72  :hdr/beta.h.  sr
2de0: 63 2f 67 61 6d 6d 61 2e 63 3a 68 64 72 2f 67 61  c/gamma.c:hdr/ga
2df0: 6d 6d 61 2e 68 0a 20 20 2e 2e 2e 0a 3c 2f 70 72  mma.h.  ....</pr
2e00: 65 3e 0a 54 68 65 6e 20 69 6e 76 6f 6b 65 20 6d  e>.Then invoke m
2e10: 61 6b 65 68 65 61 64 65 72 73 20 61 73 20 66 6f  akeheaders as fo
2e20: 6c 6c 6f 77 73 3a 0a 3c 70 72 65 3e 0a 20 20 6d  llows:.<pre>.  m
2e30: 61 6b 65 68 65 61 64 65 72 73 20 2d 66 20 6d 6b  akeheaders -f mk
2e40: 68 64 72 2e 64 61 74 0a 3c 2f 70 72 65 3e 0a 3c  hdr.dat.</pre>.<
2e50: 2f 70 3e 0a 0a 3c 70 3e 0a 54 68 65 20 60 60 2d  /p>..<p>.The ``-
2e60: 6c 6f 63 61 6c 27 27 20 6f 70 74 69 6f 6e 20 63  local'' option c
2e70: 61 75 73 65 73 20 6d 61 6b 65 68 65 61 64 65 72  auses makeheader
2e80: 73 20 74 6f 0a 67 65 6e 65 72 61 74 65 20 6f 66  s to.generate of
2e90: 20 70 72 6f 74 6f 74 79 70 65 73 20 66 6f 72 20   prototypes for 
2ea0: 60 60 73 74 61 74 69 63 27 27 20 66 75 6e 63 74  ``static'' funct
2eb0: 69 6f 6e 73 20 61 6e 64 0a 70 72 6f 63 65 64 75  ions and.procedu
2ec0: 72 65 73 2e 0a 53 75 63 68 20 70 72 6f 74 6f 74  res..Such protot
2ed0: 79 70 65 73 20 61 72 65 20 6e 6f 72 6d 61 6c 6c  ypes are normall
2ee0: 79 20 6f 6d 69 74 74 65 64 2e 0a 3c 2f 70 3e 0a  y omitted..</p>.
2ef0: 0a 3c 70 3e 0a 46 69 6e 61 6c 6c 79 2c 20 6d 61  .<p>.Finally, ma
2f00: 6b 65 68 65 61 64 65 72 73 20 61 6c 73 6f 20 69  keheaders also i
2f10: 6e 63 6c 75 64 65 73 20 61 20 60 60 2d 64 6f 63  ncludes a ``-doc
2f20: 27 27 20 6f 70 74 69 6f 6e 2e 0a 54 68 69 73 20  '' option..This 
2f30: 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 6f 70 74  command line opt
2f40: 69 6f 6e 20 70 72 65 76 65 6e 74 73 20 6d 61 6b  ion prevents mak
2f50: 65 68 65 61 64 65 72 73 20 66 72 6f 6d 20 67 65  eheaders from ge
2f60: 6e 65 72 61 74 69 6e 67 20 61 6e 79 0a 68 65 61  nerating any.hea
2f70: 64 65 72 73 20 61 74 20 61 6c 6c 2e 0a 49 6e 73  ders at all..Ins
2f80: 74 65 61 64 2c 20 6d 61 6b 65 68 65 61 64 65 72  tead, makeheader
2f90: 73 20 77 69 6c 6c 20 77 72 69 74 65 20 74 6f 20  s will write to 
2fa0: 73 74 61 6e 64 61 72 64 20 6f 75 74 70 75 74 20  standard output 
2fb0: 0a 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f  .information abo
2fc0: 75 74 20 65 76 65 72 79 20 64 65 66 69 6e 69 74  ut every definit
2fd0: 69 6f 6e 20 61 6e 64 20 64 65 63 6c 61 72 61 74  ion and declarat
2fe0: 69 6f 6e 20 74 68 61 74 20 69 74 20 65 6e 63 6f  ion that it enco
2ff0: 75 6e 74 65 72 73 0a 69 6e 20 69 74 73 20 73 63  unters.in its sc
3000: 61 6e 20 6f 66 20 73 6f 75 72 63 65 20 66 69 6c  an of source fil
3010: 65 73 2e 0a 54 68 65 20 69 6e 66 6f 72 6d 61 74  es..The informat
3020: 69 6f 6e 20 6f 75 74 70 75 74 20 69 6e 63 6c 75  ion output inclu
3030: 64 65 73 20 74 68 65 20 74 79 70 65 20 6f 66 20  des the type of 
3040: 74 68 65 20 64 65 66 69 6e 69 74 69 6f 6e 20 6f  the definition o
3050: 72 0a 64 65 63 6c 61 72 61 74 69 6f 6e 20 61 6e  r.declaration an
3060: 64 20 61 6e 79 20 63 6f 6d 6d 65 6e 74 20 74 68  d any comment th
3070: 61 74 20 70 72 65 63 65 65 64 73 20 74 68 65 20  at preceeds the 
3080: 64 65 66 69 6e 69 74 69 6f 6e 20 6f 72 0a 64 65  definition or.de
3090: 63 6c 61 72 61 74 69 6f 6e 2e 0a 54 68 65 20 6f  claration..The o
30a0: 75 74 70 75 74 20 69 73 20 69 6e 20 61 20 66 6f  utput is in a fo
30b0: 72 6d 61 74 20 74 68 61 74 20 63 61 6e 20 62 65  rmat that can be
30c0: 20 65 61 73 69 6c 79 20 70 61 72 73 65 64 2c 20   easily parsed, 
30d0: 61 6e 64 20 69 73 0a 69 6e 74 65 6e 64 65 64 20  and is.intended 
30e0: 74 6f 20 62 65 20 72 65 61 64 20 62 79 20 61 6e  to be read by an
30f0: 6f 74 68 65 72 20 70 72 6f 67 72 61 6d 20 74 68  other program th
3100: 61 74 20 77 69 6c 6c 20 67 65 6e 65 72 61 74 65  at will generate
3110: 0a 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 61  .documentation a
3120: 62 6f 75 74 20 74 68 65 20 70 72 6f 67 72 61 6d  bout the program
3130: 2e 0a 57 65 27 6c 6c 20 74 61 6c 6b 20 6d 6f 72  ..We'll talk mor
3140: 65 20 61 62 6f 75 74 20 74 68 69 73 20 66 65 61  e about this fea
3150: 74 75 72 65 20 6c 61 74 65 72 2e 0a 3c 2f 70 3e  ture later..</p>
3160: 0a 0a 3c 70 3e 0a 49 66 20 79 6f 75 20 66 6f 72  ..<p>.If you for
3170: 67 65 74 20 77 68 61 74 20 63 6f 6d 6d 61 6e 64  get what command
3180: 20 6c 69 6e 65 20 6f 70 74 69 6f 6e 73 20 61 72   line options ar
3190: 65 20 61 76 61 69 6c 61 62 6c 65 2c 20 6f 72 20  e available, or 
31a0: 66 6f 72 67 65 74 0a 74 68 65 69 72 20 65 78 61  forget.their exa
31b0: 63 74 20 6e 61 6d 65 2c 20 79 6f 75 20 63 61 6e  ct name, you can
31c0: 20 69 6e 76 6f 6b 65 20 6d 61 6b 65 68 65 61 64   invoke makehead
31d0: 65 72 73 20 75 73 69 6e 67 20 61 6e 20 75 6e 6b  ers using an unk
31e0: 6e 6f 77 6e 0a 63 6f 6d 6d 61 6e 64 20 6c 69 6e  nown.command lin
31f0: 65 20 6f 70 74 69 6f 6e 20 28 6c 69 6b 65 20 60  e option (like `
3200: 60 2d 2d 68 65 6c 70 27 27 20 6f 72 20 60 60 2d  `--help'' or ``-
3210: 3f 27 27 29 0a 61 6e 64 20 69 74 20 77 69 6c 6c  ?'').and it will
3220: 20 70 72 69 6e 74 20 61 20 73 75 6d 6d 61 72 79   print a summary
3230: 20 6f 66 20 74 68 65 20 61 76 61 69 6c 61 62 6c   of the availabl
3240: 65 20 6f 70 74 69 6f 6e 73 20 6f 6e 20 73 74 61  e options on sta
3250: 6e 64 61 72 64 0a 65 72 72 6f 72 2e 0a 49 66 20  ndard.error..If 
3260: 79 6f 75 20 6e 65 65 64 20 74 6f 20 70 72 6f 63  you need to proc
3270: 65 73 73 20 61 20 66 69 6c 65 20 77 68 6f 73 65  ess a file whose
3280: 20 6e 61 6d 65 20 62 65 67 69 6e 73 20 77 69 74   name begins wit
3290: 68 20 60 60 2d 27 27 2c 0a 79 6f 75 20 63 61 6e  h ``-'',.you can
32a0: 20 70 72 65 70 65 6e 64 20 61 20 60 60 2e 2f 27   prepend a ``./'
32b0: 27 20 74 6f 20 69 74 73 20 6e 61 6d 65 20 69 6e  ' to its name in
32c0: 20 6f 72 64 65 72 20 74 6f 20 67 65 74 20 69 74   order to get it
32d0: 0a 61 63 63 65 70 74 65 64 20 62 79 20 74 68 65  .accepted by the
32e0: 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 70 61   command line pa
32f0: 72 73 65 72 2e 0a 4f 72 2c 20 79 6f 75 20 63 61  rser..Or, you ca
3300: 6e 20 69 6e 73 65 72 74 20 74 68 65 20 73 70 65  n insert the spe
3310: 63 69 61 6c 20 6f 70 74 69 6f 6e 20 60 60 2d 2d  cial option ``--
3320: 27 27 20 6f 6e 20 74 68 65 20 63 6f 6d 6d 61 6e  '' on the comman
3330: 64 0a 6c 69 6e 65 20 74 6f 20 63 61 75 73 65 20  d.line to cause 
3340: 61 6c 6c 20 73 75 62 73 65 71 75 65 6e 74 20 63  all subsequent c
3350: 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 61 72 67 75  ommand line argu
3360: 6d 65 6e 74 73 20 74 6f 20 62 65 20 74 72 65 61  ments to be trea
3370: 74 65 64 20 61 73 0a 66 69 6c 65 6e 61 6d 65 73  ted as.filenames
3380: 20 65 76 65 6e 20 69 66 20 74 68 65 69 72 20 6e   even if their n
3390: 61 6d 65 73 20 62 65 67 69 6e 6e 20 77 69 74 68  ames beginn with
33a0: 20 60 60 2d 27 27 2e 0a 3c 2f 70 3e 0a 0a 3c 61   ``-''..</p>..<a
33b0: 20 6e 61 6d 65 3d 48 30 30 30 36 3e 0a 3c 68 32   name=H0006>.<h2
33c0: 3e 33 2e 30 20 50 72 65 70 61 72 69 6e 67 20 53  >3.0 Preparing S
33d0: 6f 75 72 63 65 20 46 69 6c 65 73 20 46 6f 72 20  ource Files For 
33e0: 55 73 65 20 57 69 74 68 20 4d 61 6b 65 68 65 61  Use With Makehea
33f0: 64 65 72 73 3c 2f 68 32 3e 0a 0a 3c 70 3e 0a 56  ders</h2>..<p>.V
3400: 65 72 79 20 6c 69 74 74 6c 65 20 68 61 73 20 74  ery little has t
3410: 6f 20 62 65 20 64 6f 6e 65 20 74 6f 20 70 72 65  o be done to pre
3420: 70 61 72 65 20 73 6f 75 72 63 65 20 66 69 6c 65  pare source file
3430: 73 20 66 6f 72 20 75 73 65 20 77 69 74 68 0a 6d  s for use with.m
3440: 61 6b 65 68 65 61 64 65 72 73 20 73 69 6e 63 65  akeheaders since
3450: 20 6d 61 6b 65 68 65 61 64 65 72 73 20 77 69 6c   makeheaders wil
3460: 6c 20 72 65 61 64 20 61 6e 64 20 75 6e 64 65 72  l read and under
3470: 73 74 61 6e 64 20 6f 72 64 69 6e 61 72 79 0a 43  stand ordinary.C
3480: 20 63 6f 64 65 2e 0a 42 75 74 20 69 74 20 69 73   code..But it is
3490: 20 69 6d 70 6f 72 74 61 6e 74 20 74 68 61 74 20   important that 
34a0: 79 6f 75 20 73 74 72 75 63 74 75 72 65 20 79 6f  you structure yo
34b0: 75 72 20 66 69 6c 65 73 20 69 6e 20 61 20 77 61  ur files in a wa
34c0: 79 20 74 68 61 74 0a 6d 61 6b 65 73 20 73 65 6e  y that.makes sen
34d0: 73 65 20 69 6e 20 74 68 65 20 6d 61 6b 65 68 65  se in the makehe
34e0: 61 64 65 72 73 20 63 6f 6e 74 65 78 74 2e 0a 54  aders context..T
34f0: 68 69 73 20 73 65 63 74 69 6f 6e 20 77 69 6c 6c  his section will
3500: 20 64 65 73 63 72 69 62 65 20 73 65 76 65 72 61   describe severa
3510: 6c 20 74 79 70 69 63 61 6c 20 75 73 65 73 20 6f  l typical uses o
3520: 66 20 6d 61 6b 65 68 65 61 64 65 72 73 2e 0a 3c  f makeheaders..<
3530: 2f 70 3e 0a 0a 3c 61 20 6e 61 6d 65 3d 48 30 30  /p>..<a name=H00
3540: 30 37 3e 0a 3c 68 33 3e 33 2e 31 20 54 68 65 20  07>.<h3>3.1 The 
3550: 42 61 73 69 63 20 53 65 74 75 70 3c 2f 68 33 3e  Basic Setup</h3>
3560: 0a 0a 3c 70 3e 0a 54 68 65 20 73 69 6d 70 6c 69  ..<p>.The simpli
3570: 65 73 74 20 77 61 79 20 74 6f 20 75 73 65 20 6d  est way to use m
3580: 61 6b 65 68 65 61 64 65 72 73 20 69 73 20 74 6f  akeheaders is to
3590: 20 70 75 74 20 61 6c 6c 20 64 65 66 69 6e 69 74   put all definit
35a0: 69 6f 6e 73 20 69 6e 0a 6f 6e 65 20 6f 72 20 6d  ions in.one or m
35b0: 6f 72 65 20 2e 63 20 66 69 6c 65 73 20 61 6e 64  ore .c files and
35c0: 20 61 6c 6c 20 73 74 72 75 63 74 75 72 65 20 61   all structure a
35d0: 6e 64 20 74 79 70 65 20 64 65 63 6c 61 72 61 74  nd type declarat
35e0: 69 6f 6e 73 20 69 6e 0a 73 65 70 61 72 61 74 65  ions in.separate
35f0: 20 2e 68 20 66 69 6c 65 73 2e 0a 54 68 65 20 6f   .h files..The o
3600: 6e 6c 79 20 72 65 73 74 72 69 63 74 69 6f 6e 20  nly restriction 
3610: 69 73 20 74 68 61 74 20 79 6f 75 20 73 68 6f 75  is that you shou
3620: 6c 64 20 74 61 6b 65 20 63 61 72 65 20 74 6f 20  ld take care to 
3630: 63 68 6f 73 65 20 62 61 73 65 6e 61 6d 65 73 20  chose basenames 
3640: 0a 66 6f 72 20 79 6f 75 72 20 2e 68 20 66 69 6c  .for your .h fil
3650: 65 73 20 74 68 61 74 20 61 72 65 20 64 69 66 66  es that are diff
3660: 65 72 65 6e 74 20 66 72 6f 6d 20 74 68 65 20 62  erent from the b
3670: 61 73 65 6e 61 6d 65 73 20 66 6f 72 20 79 6f 75  asenames for you
3680: 0a 2e 63 20 66 69 6c 65 73 2e 0a 52 65 63 61 6c  ..c files..Recal
3690: 6c 20 74 68 61 74 20 69 66 20 79 6f 75 72 20 2e  l that if your .
36a0: 63 20 66 69 6c 65 20 69 73 20 6e 61 6d 65 64 20  c file is named 
36b0: 28 66 6f 72 20 65 78 61 6d 70 6c 65 29 20 60 60  (for example) ``
36c0: 61 6c 70 68 61 2e 63 27 27 0a 6d 61 6b 65 68 65  alpha.c''.makehe
36d0: 61 64 65 72 73 20 77 69 6c 6c 20 61 74 74 65 6d  aders will attem
36e0: 70 74 20 74 6f 20 67 65 6e 65 72 61 74 65 20 61  pt to generate a
36f0: 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 68   corresponding h
3700: 65 61 64 65 72 20 66 69 6c 65 0a 6e 61 6d 65 64  eader file.named
3710: 20 60 60 61 6c 70 68 61 2e 68 27 27 2e 0a 46 6f   ``alpha.h''..Fo
3720: 72 20 74 68 61 74 20 72 65 61 73 6f 6e 2c 20 79  r that reason, y
3730: 6f 75 20 64 6f 6e 27 74 20 77 61 6e 74 20 74 6f  ou don't want to
3740: 20 75 73 65 20 74 68 61 74 20 6e 61 6d 65 20 66   use that name f
3750: 6f 72 0a 61 6e 79 20 6f 66 20 74 68 65 20 2e 68  or.any of the .h
3760: 20 66 69 6c 65 73 20 79 6f 75 20 77 72 69 74 65   files you write
3770: 20 73 69 6e 63 65 20 74 68 61 74 20 77 69 6c 6c   since that will
3780: 20 70 72 65 76 65 6e 74 20 6d 61 6b 65 68 65 61   prevent makehea
3790: 64 65 72 73 0a 66 72 6f 6d 20 67 65 6e 65 72 61  ders.from genera
37a0: 74 69 6e 67 20 74 68 65 20 2e 68 20 66 69 6c 65  ting the .h file
37b0: 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 2e 0a   automatically..
37c0: 3c 2f 70 3e 0a 0a 3c 70 3e 0a 54 68 65 20 73 74  </p>..<p>.The st
37d0: 72 75 63 74 75 72 65 20 6f 66 20 61 20 2e 63 20  ructure of a .c 
37e0: 66 69 6c 65 20 69 6e 74 65 6e 74 65 64 20 66 6f  file intented fo
37f0: 72 20 75 73 65 20 77 69 74 68 20 6d 61 6b 65 68  r use with makeh
3800: 65 61 64 65 72 73 20 69 73 20 76 65 72 79 0a 73  eaders is very.s
3810: 69 6d 70 6c 65 2e 0a 41 6c 6c 20 79 6f 75 20 68  imple..All you h
3820: 61 76 65 20 74 6f 20 64 6f 20 69 73 20 61 64 64  ave to do is add
3830: 20 61 20 73 69 6e 67 6c 65 20 60 60 23 69 6e 63   a single ``#inc
3840: 6c 75 64 65 27 27 20 74 6f 20 74 68 65 20 74 6f  lude'' to the to
3850: 70 0a 6f 66 20 74 68 65 20 66 69 6c 65 20 74 68  p.of the file th
3860: 61 74 20 73 6f 75 72 63 65 73 20 74 68 65 20 68  at sources the h
3870: 65 61 64 65 72 20 66 69 6c 65 20 74 68 61 74 20  eader file that 
3880: 6d 61 6b 65 68 65 61 64 65 72 73 20 77 69 6c 6c  makeheaders will
3890: 20 67 65 6e 65 72 61 74 65 2e 0a 48 65 6e 63 65   generate..Hence
38a0: 2c 20 74 68 65 20 62 65 67 69 6e 6e 69 6e 67 20  , the beginning 
38b0: 6f 66 20 61 20 73 6f 75 72 63 65 20 66 69 6c 65  of a source file
38c0: 20 6e 61 6d 65 64 20 60 60 61 6c 70 68 61 2e 63   named ``alpha.c
38d0: 27 27 0a 6d 69 67 68 74 20 6c 6f 6f 6b 20 73 6f  ''.might look so
38e0: 6d 65 74 68 69 6e 67 20 6c 69 6b 65 20 74 68 69  mething like thi
38f0: 73 3a 0a 3c 2f 70 3e 0a 0a 3c 70 72 65 3e 0a 20  s:.</p>..<pre>. 
3900: 20 20 2f 2a 0a 20 20 20 20 2a 20 49 6e 74 72 6f    /*.    * Intro
3910: 64 75 63 74 6f 72 79 20 63 6f 6d 6d 65 6e 74 2e  ductory comment.
3920: 2e 2e 0a 20 20 20 20 2a 2f 0a 20 20 20 23 69 6e  ...    */.   #in
3930: 63 6c 75 64 65 20 22 61 6c 70 68 61 2e 68 22 0a  clude "alpha.h".
3940: 0a 20 20 20 2f 2a 20 54 68 65 20 72 65 73 74 20  .   /* The rest 
3950: 6f 66 20 79 6f 75 72 20 63 6f 64 65 2e 2e 2e 20  of your code... 
3960: 2a 2f 0a 3c 2f 70 72 65 3e 0a 0a 3c 70 3e 0a 59  */.</pre>..<p>.Y
3970: 6f 75 72 20 6d 61 6e 75 61 6c 6c 79 20 67 65 6e  our manually gen
3980: 65 72 61 74 65 64 20 68 65 61 64 65 72 20 66 69  erated header fi
3990: 6c 65 73 20 72 65 71 75 69 72 65 20 6e 6f 20 73  les require no s
39a0: 70 65 63 69 61 6c 20 61 74 74 65 6e 74 69 6f 6e  pecial attention
39b0: 20 61 74 20 61 6c 6c 2e 0a 43 6f 64 65 20 74 68   at all..Code th
39c0: 65 6d 20 61 73 20 79 6f 75 20 6e 6f 72 6d 61 6c  em as you normal
39d0: 6c 79 20 77 6f 75 6c 64 2e 0a 48 6f 77 65 76 65  ly would..Howeve
39e0: 72 2c 20 6d 61 6b 65 68 65 61 64 65 72 73 20 77  r, makeheaders w
39f0: 69 6c 6c 20 77 6f 72 6b 20 62 65 74 74 65 72 20  ill work better 
3a00: 69 66 20 79 6f 75 20 6f 6d 69 74 20 74 68 65 0a  if you omit the.
3a10: 60 60 23 69 66 27 27 20 73 74 61 74 65 6d 65 6e  ``#if'' statemen
3a20: 74 73 20 70 65 6f 70 6c 65 20 6f 66 74 65 6e 20  ts people often 
3a30: 70 75 74 20 61 72 6f 75 6e 64 20 74 68 65 20 6f  put around the o
3a40: 75 74 73 69 64 65 20 6f 66 0a 68 65 61 64 65 72  utside of.header
3a50: 20 66 69 6c 65 73 20 74 68 61 74 20 70 72 65 76   files that prev
3a60: 65 6e 74 20 74 68 65 20 66 69 6c 65 73 20 66 72  ent the files fr
3a70: 6f 6d 20 62 65 69 6e 67 20 69 6e 63 6c 75 64 65  om being include
3a80: 64 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 63 65  d more than once
3a90: 2e 0a 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 74  ..For example, t
3aa0: 6f 20 63 72 65 61 74 65 20 61 20 68 65 61 64 65  o create a heade
3ab0: 72 20 66 69 6c 65 20 6e 61 6d 65 64 20 60 60 62  r file named ``b
3ac0: 65 74 61 2e 68 27 27 2c 20 6d 61 6e 79 0a 70 65  eta.h'', many.pe
3ad0: 6f 70 6c 65 20 77 69 6c 6c 20 68 61 62 69 74 75  ople will habitu
3ae0: 61 6c 6c 79 20 77 72 69 74 65 20 74 68 65 20 66  ally write the f
3af0: 6f 6c 6c 6f 77 69 6e 67 3a 0a 0a 3c 70 72 65 3e  ollowing:..<pre>
3b00: 0a 20 20 20 23 69 66 6e 64 65 66 20 42 45 54 41  .   #ifndef BETA
3b10: 5f 48 0a 20 20 20 23 64 65 66 69 6e 65 20 42 45  _H.   #define BE
3b20: 54 41 5f 48 0a 0a 20 20 20 2f 2a 20 64 65 63 6c  TA_H..   /* decl
3b30: 61 72 61 74 69 6f 6e 73 20 66 6f 72 20 62 65 74  arations for bet
3b40: 61 2e 68 20 67 6f 20 68 65 72 65 20 2a 2f 0a 0a  a.h go here */..
3b50: 20 20 20 23 65 6e 64 69 66 0a 3c 2f 70 72 65 3e     #endif.</pre>
3b60: 0a 0a 59 6f 75 20 63 61 6e 20 66 6f 72 65 67 6f  ..You can forego
3b70: 20 74 68 69 73 20 63 6c 65 76 65 72 6e 65 73 73   this cleverness
3b80: 20 77 69 74 68 20 6d 61 6b 65 68 65 61 64 65 72   with makeheader
3b90: 73 2e 0a 52 65 6d 65 6d 62 65 72 20 74 68 61 74  s..Remember that
3ba0: 20 74 68 65 20 68 65 61 64 65 72 20 66 69 6c 65   the header file
3bb0: 73 20 79 6f 75 20 77 72 69 74 65 20 77 69 6c 6c  s you write will
3bc0: 20 6e 65 76 65 72 20 72 65 61 6c 6c 79 20 62 65   never really be
3bd0: 0a 69 6e 63 6c 75 64 65 64 20 62 79 20 61 6e 79  .included by any
3be0: 20 43 20 63 6f 64 65 2e 0a 49 6e 73 74 65 61 64   C code..Instead
3bf0: 2c 20 6d 61 6b 65 68 65 61 64 65 72 73 20 77 69  , makeheaders wi
3c00: 6c 6c 20 73 63 61 6e 20 79 6f 75 72 20 68 65 61  ll scan your hea
3c10: 64 65 72 20 66 69 6c 65 73 20 74 6f 20 65 78 74  der files to ext
3c20: 72 61 63 74 20 6f 6e 6c 79 0a 74 68 6f 73 65 20  ract only.those 
3c30: 64 65 63 6c 61 72 61 74 69 6f 6e 73 20 74 68 61  declarations tha
3c40: 74 20 61 72 65 20 6e 65 65 64 65 64 20 62 79 20  t are needed by 
3c50: 69 6e 64 69 76 69 64 75 61 6c 20 2e 63 20 66 69  individual .c fi
3c60: 6c 65 73 20 61 6e 64 20 74 68 65 6e 0a 63 6f 70  les and then.cop
3c70: 79 20 74 68 6f 73 65 20 64 65 63 6c 61 72 61 74  y those declarat
3c80: 69 6f 6e 73 20 74 6f 20 74 68 65 20 2e 68 20 66  ions to the .h f
3c90: 69 6c 65 73 20 63 6f 72 72 65 73 70 6f 6e 64 69  iles correspondi
3ca0: 6e 67 20 74 6f 20 74 68 65 20 2e 63 20 66 69 6c  ng to the .c fil
3cb0: 65 73 2e 0a 48 65 6e 63 65 2c 20 74 68 65 20 60  es..Hence, the `
3cc0: 60 23 69 66 27 27 20 77 72 61 70 70 65 72 20 73  `#if'' wrapper s
3cd0: 65 72 76 65 73 20 6e 6f 20 75 73 65 66 75 6c 20  erves no useful 
3ce0: 70 75 72 70 6f 73 65 2e 0a 42 75 74 20 69 74 20  purpose..But it 
3cf0: 64 6f 65 73 20 6d 61 6b 65 20 6d 61 6b 65 68 65  does make makehe
3d00: 61 64 65 72 73 20 77 6f 72 6b 20 68 61 72 64 65  aders work harde
3d10: 72 2c 20 66 6f 72 63 69 6e 67 20 69 74 20 74 6f  r, forcing it to
3d20: 20 70 75 74 0a 74 68 65 20 73 74 61 74 65 6d 65   put.the stateme
3d30: 6e 74 73 0a 0a 3c 70 72 65 3e 0a 20 20 20 23 69  nts..<pre>.   #i
3d40: 66 20 21 64 65 66 69 6e 65 64 28 42 45 54 41 5f  f !defined(BETA_
3d50: 48 29 0a 20 20 20 23 65 6e 64 69 66 0a 3c 2f 70  H).   #endif.</p
3d60: 72 65 3e 0a 0a 61 72 6f 75 6e 64 20 65 76 65 72  re>..around ever
3d70: 79 20 64 65 63 6c 61 72 61 74 69 6f 6e 20 74 68  y declaration th
3d80: 61 74 20 69 74 20 63 6f 70 69 65 73 20 6f 75 74  at it copies out
3d90: 20 6f 66 20 79 6f 75 72 20 68 65 61 64 65 72 20   of your header 
3da0: 66 69 6c 65 2e 0a 4e 6f 20 69 6c 6c 20 65 66 66  file..No ill eff
3db0: 65 63 74 20 73 68 6f 75 6c 64 20 63 6f 6d 65 20  ect should come 
3dc0: 6f 66 20 74 68 69 73 2c 20 62 75 74 20 6e 65 69  of this, but nei
3dd0: 74 68 65 72 20 69 73 20 74 68 65 72 65 20 61 6e  ther is there an
3de0: 79 20 62 65 6e 65 66 69 74 2e 0a 3c 2f 70 3e 0a  y benefit..</p>.
3df0: 0a 3c 70 3e 0a 48 61 76 69 6e 67 20 70 72 65 70  .<p>.Having prep
3e00: 61 72 65 64 20 79 6f 75 72 20 2e 63 20 61 6e 64  ared your .c and
3e10: 20 2e 68 20 66 69 6c 65 73 20 61 73 20 64 65 73   .h files as des
3e20: 63 72 69 62 65 64 20 61 62 6f 76 65 2c 20 79 6f  cribed above, yo
3e30: 75 20 63 61 6e 0a 63 61 75 73 65 20 6d 61 6b 65  u can.cause make
3e40: 68 65 61 64 65 72 73 20 74 6f 20 67 65 6e 65 72  headers to gener
3e50: 61 74 65 20 69 74 73 20 2e 68 20 66 69 6c 65 73  ate its .h files
3e60: 20 75 73 69 6e 67 20 74 68 65 20 66 6f 6c 6c 6f   using the follo
3e70: 77 69 6e 67 20 73 69 6d 70 6c 65 0a 63 6f 6d 6d  wing simple.comm
3e80: 61 6e 64 3a 0a 0a 3c 70 72 65 3e 0a 20 20 20 6d  and:..<pre>.   m
3e90: 61 6b 65 68 65 61 64 65 72 73 20 2a 2e 5b 63 68  akeheaders *.[ch
3ea0: 5d 0a 3c 2f 70 72 65 3e 0a 0a 54 68 65 20 6d 61  ].</pre>..The ma
3eb0: 6b 65 68 65 61 64 65 72 73 20 70 72 6f 67 72 61  keheaders progra
3ec0: 6d 20 77 69 6c 6c 20 73 63 61 6e 20 61 6c 6c 20  m will scan all 
3ed0: 6f 66 20 74 68 65 20 2e 63 20 66 69 6c 65 73 20  of the .c files 
3ee0: 61 6e 64 20 61 6c 6c 20 6f 66 20 74 68 65 0a 6d  and all of the.m
3ef0: 61 6e 75 61 6c 6c 79 20 77 72 69 74 74 65 6e 20  anually written 
3f00: 2e 68 20 66 69 6c 65 73 20 61 6e 64 20 74 68 65  .h files and the
3f10: 6e 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20  n automatically 
3f20: 67 65 6e 65 72 61 74 65 20 2e 68 20 66 69 6c 65  generate .h file
3f30: 73 0a 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20  s.corresponding 
3f40: 74 6f 20 61 6c 6c 20 2e 63 20 66 69 6c 65 73 2e  to all .c files.
3f50: 20 20 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 4e 6f 74    .</p>..<p>.Not
3f60: 65 20 74 68 61 74 0a 74 68 65 20 77 69 6c 64 63  e that.the wildc
3f70: 61 72 64 20 65 78 70 72 65 73 73 69 6f 6e 20 75  ard expression u
3f80: 73 65 64 20 69 6e 20 74 68 65 20 61 62 6f 76 65  sed in the above
3f90: 20 65 78 61 6d 70 6c 65 2c 20 0a 60 60 3c 63 6f   example, .``<co
3fa0: 64 65 3e 2a 2e 5b 63 68 5d 3c 2f 63 6f 64 65 3e  de>*.[ch]</code>
3fb0: 27 27 2c 0a 77 69 6c 6c 20 65 78 70 61 6e 64 20  '',.will expand 
3fc0: 74 6f 20 69 6e 63 6c 75 64 65 20 61 6c 6c 20 2e  to include all .
3fd0: 68 20 66 69 6c 65 73 20 69 6e 20 74 68 65 20 63  h files in the c
3fe0: 75 72 72 65 6e 74 20 64 69 72 65 63 74 6f 72 79  urrent directory
3ff0: 2c 20 62 6f 74 68 0a 74 68 6f 73 65 20 65 6e 74  , both.those ent
4000: 65 72 65 64 20 6d 61 6e 75 61 6c 6c 79 20 62 65  ered manually be
4010: 20 74 68 65 20 70 72 6f 67 72 61 6d 6d 65 72 20   the programmer 
4020: 61 6e 64 20 6f 74 68 65 72 73 20 67 65 6e 65 72  and others gener
4030: 61 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 6c  ated automatical
4040: 6c 79 0a 62 79 20 61 20 70 72 69 6f 72 20 72 75  ly.by a prior ru
4050: 6e 20 6f 66 20 6d 61 6b 65 68 65 61 64 65 72 73  n of makeheaders
4060: 2e 0a 42 75 74 20 74 68 61 74 20 69 73 20 6e 6f  ..But that is no
4070: 74 20 61 20 70 72 6f 62 6c 65 6d 2e 0a 54 68 65  t a problem..The
4080: 20 6d 61 6b 65 68 65 61 64 65 72 73 20 70 72 6f   makeheaders pro
4090: 67 72 61 6d 20 77 69 6c 6c 20 72 65 63 6f 67 6e  gram will recogn
40a0: 69 7a 65 20 61 6e 64 20 69 67 6e 6f 72 65 20 61  ize and ignore a
40b0: 6e 79 20 66 69 6c 65 73 20 69 74 20 0a 68 61 73  ny files it .has
40c0: 20 70 72 65 76 69 6f 75 73 6c 79 20 67 65 6e 65   previously gene
40d0: 72 61 74 65 64 20 74 68 61 74 20 73 68 6f 77 20  rated that show 
40e0: 75 70 20 6f 6e 20 69 74 73 20 69 6e 70 75 74 20  up on its input 
40f0: 6c 69 73 74 2e 0a 3c 2f 70 3e 0a 0a 3c 61 20 6e  list..</p>..<a n
4100: 61 6d 65 3d 48 30 30 30 38 3e 0a 3c 68 33 3e 33  ame=H0008>.<h3>3
4110: 2e 32 20 57 68 61 74 20 44 65 63 6c 61 72 61 74  .2 What Declarat
4120: 69 6f 6e 73 20 47 65 74 20 43 6f 70 69 65 64 3c  ions Get Copied<
4130: 2f 68 33 3e 0a 0a 3c 70 3e 0a 54 68 65 20 66 6f  /h3>..<p>.The fo
4140: 6c 6c 6f 77 69 6e 67 20 6c 69 73 74 20 64 65 74  llowing list det
4150: 61 69 6c 73 20 61 6c 6c 20 6f 66 20 74 68 65 20  ails all of the 
4160: 63 6f 64 65 20 63 6f 6e 73 74 72 75 63 74 73 20  code constructs 
4170: 74 68 61 74 20 6d 61 6b 65 68 65 61 64 65 72 73  that makeheaders
4180: 0a 77 69 6c 6c 20 65 78 74 72 61 63 74 20 61 6e  .will extract an
4190: 64 20 70 6c 61 63 65 20 69 6e 0a 74 68 65 20 61  d place in.the a
41a0: 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 67 65 6e  utomatically gen
41b0: 65 72 61 74 65 64 20 2e 68 20 66 69 6c 65 73 3a  erated .h files:
41c0: 0a 3c 2f 70 3e 0a 0a 3c 75 6c 3e 0a 3c 70 3e 3c  .</p>..<ul>.<p><
41d0: 6c 69 3e 0a 57 68 65 6e 20 61 20 66 75 6e 63 74  li>.When a funct
41e0: 69 6f 6e 20 69 73 20 64 65 66 69 6e 65 64 20 69  ion is defined i
41f0: 6e 20 61 6e 79 20 2e 63 20 66 69 6c 65 2c 20 61  n any .c file, a
4200: 20 70 72 6f 74 6f 74 79 70 65 20 6f 66 20 74 68   prototype of th
4210: 61 74 20 66 75 6e 63 74 69 6f 6e 0a 69 73 20 70  at function.is p
4220: 6c 61 63 65 64 20 69 6e 20 74 68 65 20 67 65 6e  laced in the gen
4230: 65 72 61 74 65 64 20 2e 68 20 66 69 6c 65 20 6f  erated .h file o
4240: 66 20 65 76 65 72 79 20 2e 63 20 66 69 6c 65 20  f every .c file 
4250: 74 68 61 74 0a 63 61 6c 6c 73 20 74 68 65 20 66  that.calls the f
4260: 75 6e 63 74 69 6f 6e 2e 3c 2f 70 3e 0a 0a 3c 50  unction.</p>..<P
4270: 3e 49 66 20 74 68 65 20 60 60 73 74 61 74 69 63  >If the ``static
4280: 27 27 20 6b 65 79 77 6f 72 64 20 6f 66 20 43 20  '' keyword of C 
4290: 61 70 70 65 61 72 73 20 61 74 20 74 68 65 20 62  appears at the b
42a0: 65 67 69 6e 6e 69 6e 67 0a 6f 66 20 74 68 65 20  eginning.of the 
42b0: 66 75 6e 63 74 69 6f 6e 20 64 65 66 69 6e 69 74  function definit
42c0: 69 6f 6e 2c 20 74 68 65 20 70 72 6f 74 6f 74 79  ion, the prototy
42d0: 70 65 20 69 73 20 73 75 70 70 72 65 73 73 65 64  pe is suppressed
42e0: 2e 0a 49 66 20 79 6f 75 20 75 73 65 20 74 68 65  ..If you use the
42f0: 20 60 60 4c 4f 43 41 4c 27 27 20 6b 65 79 77 6f   ``LOCAL'' keywo
4300: 72 64 20 77 68 65 72 65 20 79 6f 75 20 77 6f 75  rd where you wou
4310: 6c 64 20 6e 6f 72 6d 61 6c 6c 79 0a 73 61 79 20  ld normally.say 
4320: 60 60 73 74 61 74 69 63 27 27 2c 20 74 68 65 6e  ``static'', then
4330: 20 61 20 70 72 6f 74 6f 74 79 70 65 20 69 73 20   a prototype is 
4340: 67 65 6e 65 72 61 74 65 64 2c 20 62 75 74 20 69  generated, but i
4350: 74 0a 77 69 6c 6c 20 6f 6e 6c 79 20 61 70 70 65  t.will only appe
4360: 61 72 20 69 6e 20 74 68 65 20 73 69 6e 67 6c 65  ar in the single
4370: 20 68 65 61 64 65 72 20 66 69 6c 65 20 74 68 61   header file tha
4380: 74 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f  t corresponds to
4390: 20 74 68 65 0a 73 6f 75 72 63 65 20 66 69 6c 65   the.source file
43a0: 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20   containing the 
43b0: 66 75 6e 63 74 69 6f 6e 2e 20 20 46 6f 72 20 65  function.  For e
43c0: 78 61 6d 70 6c 65 2c 20 69 66 20 74 68 65 20 66  xample, if the f
43d0: 69 6c 65 0a 3c 63 6f 64 65 3e 61 6c 70 68 61 2e  ile.<code>alpha.
43e0: 63 3c 2f 63 6f 64 65 3e 20 63 6f 6e 74 61 69 6e  c</code> contain
43f0: 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 3a  s the following:
4400: 0a 3c 70 72 65 3e 0a 20 20 4c 4f 43 41 4c 20 69  .<pre>.  LOCAL i
4410: 6e 74 20 74 65 73 74 46 75 6e 63 28 76 6f 69 64  nt testFunc(void
4420: 29 7b 0a 20 20 20 20 72 65 74 75 72 6e 20 30 3b  ){.    return 0;
4430: 0a 20 20 7d 0a 3c 2f 70 72 65 3e 0a 54 68 65 6e  .  }.</pre>.Then
4440: 20 74 68 65 20 68 65 61 64 65 72 20 66 69 6c 65   the header file
4450: 20 3c 63 6f 64 65 3e 61 6c 70 68 61 2e 68 3c 2f   <code>alpha.h</
4460: 63 6f 64 65 3e 20 77 69 6c 6c 20 63 6f 6e 74 61  code> will conta
4470: 69 6e 0a 3c 70 72 65 3e 0a 20 20 23 64 65 66 69  in.<pre>.  #defi
4480: 6e 65 20 4c 4f 43 41 4c 20 73 74 61 74 69 63 0a  ne LOCAL static.
4490: 20 20 4c 4f 43 41 4c 20 69 6e 74 20 74 65 73 74    LOCAL int test
44a0: 46 75 6e 63 28 76 6f 69 64 29 3b 0a 3c 2f 70 72  Func(void);.</pr
44b0: 65 3e 0a 48 6f 77 65 76 65 72 2c 20 6e 6f 20 6f  e>.However, no o
44c0: 74 68 65 72 20 67 65 6e 65 72 61 74 65 64 20 68  ther generated h
44d0: 65 61 64 65 72 20 66 69 6c 65 73 20 77 69 6c 6c  eader files will
44e0: 20 63 6f 6e 74 61 69 6e 20 61 20 70 72 6f 74 6f   contain a proto
44f0: 74 79 70 65 20 66 6f 72 0a 3c 63 6f 64 65 3e 74  type for.<code>t
4500: 65 73 74 46 75 6e 63 28 29 3c 2f 63 6f 64 65 3e  estFunc()</code>
4510: 20 73 69 6e 63 65 20 74 68 65 20 66 75 6e 63 74   since the funct
4520: 69 6f 6e 20 68 61 73 20 6f 6e 6c 79 20 66 69 6c  ion has only fil
4530: 65 20 73 63 6f 70 65 2e 3c 2f 70 3e 0a 0a 3c 70  e scope.</p>..<p
4540: 3e 57 68 65 6e 20 74 68 65 20 60 60 4c 4f 43 41  >When the ``LOCA
4550: 4c 27 27 20 6b 65 79 77 6f 72 64 20 69 73 20 75  L'' keyword is u
4560: 73 65 64 2c 20 6d 61 6b 65 68 65 61 64 65 72 73  sed, makeheaders
4570: 20 77 69 6c 6c 20 61 6c 73 6f 0a 67 65 6e 65 72   will also.gener
4580: 61 74 65 20 61 20 23 64 65 66 69 6e 65 20 66 6f  ate a #define fo
4590: 72 20 4c 4f 43 41 4c 2c 20 6c 69 6b 65 20 74 68  r LOCAL, like th
45a0: 69 73 3a 0a 3c 70 72 65 3e 0a 20 20 20 23 64 65  is:.<pre>.   #de
45b0: 66 69 6e 65 20 4c 4f 43 41 4c 20 73 74 61 74 69  fine LOCAL stati
45c0: 63 0a 3c 2f 70 72 65 3e 0a 73 6f 20 74 68 61 74  c.</pre>.so that
45d0: 20 74 68 65 20 43 20 63 6f 6d 70 69 6c 65 72 20   the C compiler 
45e0: 77 69 6c 6c 20 6b 6e 6f 77 20 77 68 61 74 20 69  will know what i
45f0: 74 20 6d 65 61 6e 73 2e 3c 2f 70 3e 0a 0a 3c 70  t means.</p>..<p
4600: 3e 49 66 20 79 6f 75 20 69 6e 76 6f 6b 65 20 6d  >If you invoke m
4610: 61 6b 65 68 65 61 64 65 72 73 20 77 69 74 68 20  akeheaders with 
4620: 61 20 60 60 2d 6c 6f 63 61 6c 27 27 20 63 6f 6d  a ``-local'' com
4630: 6d 61 6e 64 2d 6c 69 6e 65 0a 6f 70 74 69 6f 6e  mand-line.option
4640: 2c 20 74 68 65 6e 20 69 74 20 74 72 65 61 74 73  , then it treats
4650: 20 74 68 65 20 60 60 73 74 61 74 69 63 27 27 20   the ``static'' 
4660: 6b 65 79 77 6f 72 64 20 6c 69 6b 65 0a 60 60 4c  keyword like.``L
4670: 4f 43 41 4c 27 27 20 61 6e 64 20 67 65 6e 65 72  OCAL'' and gener
4680: 61 74 65 73 20 70 72 6f 74 6f 74 79 70 65 73 20  ates prototypes 
4690: 69 6e 20 74 68 65 20 68 65 61 64 65 72 20 66 69  in the header fi
46a0: 6c 65 0a 74 68 61 74 20 63 6f 72 72 65 73 70 6f  le.that correspo
46b0: 6e 64 73 20 74 6f 20 74 68 65 20 73 6f 75 72 63  nds to the sourc
46c0: 65 20 66 69 6c 65 20 63 6f 6e 74 61 69 6e 69 6e  e file containin
46d0: 67 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20 64  g the function d
46e0: 65 66 69 6e 74 69 69 6f 6e 2e 3c 2f 70 3e 0a 0a  efintiion.</p>..
46f0: 3c 70 3e 3c 6c 69 3e 0a 57 68 65 6e 20 61 20 67  <p><li>.When a g
4700: 6c 6f 62 61 6c 20 76 61 72 69 61 62 6c 65 20 69  lobal variable i
4710: 73 20 64 65 66 69 6e 65 64 20 69 6e 20 61 20 2e  s defined in a .
4720: 63 20 66 69 6c 65 2c 20 61 6e 20 60 60 65 78 74  c file, an ``ext
4730: 65 72 6e 27 27 0a 64 65 63 6c 61 72 61 74 69 6f  ern''.declaratio
4740: 6e 20 6f 66 20 74 68 61 74 20 76 61 72 69 61 62  n of that variab
4750: 6c 65 20 69 73 20 70 6c 61 63 65 64 20 69 6e 20  le is placed in 
4760: 74 68 65 20 68 65 61 64 65 72 20 6f 66 20 65 76  the header of ev
4770: 65 72 79 0a 2e 63 20 66 69 6c 65 20 74 68 61 74  ery..c file that
4780: 20 75 73 65 73 20 74 68 65 20 76 61 72 69 61 62   uses the variab
4790: 6c 65 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 3c 6c 69  le..</p>..<p><li
47a0: 3e 0a 57 68 65 6e 20 61 20 73 74 72 75 63 74 75  >.When a structu
47b0: 72 65 2c 20 75 6e 69 6f 6e 20 6f 72 20 65 6e 75  re, union or enu
47c0: 6d 65 72 61 74 69 6f 6e 20 64 65 63 6c 61 72 61  meration declara
47d0: 74 69 6f 6e 20 6f 72 20 61 0a 66 75 6e 63 74 69  tion or a.functi
47e0: 6f 6e 20 70 72 6f 74 6f 74 79 70 65 20 6f 72 20  on prototype or 
47f0: 61 20 43 2b 2b 20 63 6c 61 73 73 20 64 65 63 6c  a C++ class decl
4800: 61 72 61 74 69 6f 6e 20 61 70 70 65 61 72 73 20  aration appears 
4810: 69 6e 20 61 0a 6d 61 6e 75 61 6c 6c 79 20 70 72  in a.manually pr
4820: 6f 64 75 63 65 64 20 2e 68 20 66 69 6c 65 2c 20  oduced .h file, 
4830: 74 68 61 74 20 64 65 63 6c 61 72 61 74 69 6f 6e  that declaration
4840: 20 69 73 20 63 6f 70 69 65 64 20 69 6e 74 6f 20   is copied into 
4850: 74 68 65 20 0a 61 75 74 6f 6d 61 74 69 63 61 6c  the .automatical
4860: 6c 79 20 67 65 6e 65 72 61 74 65 64 0a 2e 68 20  ly generated..h 
4870: 66 69 6c 65 73 20 6f 66 20 61 6c 6c 20 2e 63 20  files of all .c 
4880: 66 69 6c 65 73 20 74 68 61 74 20 75 73 65 20 74  files that use t
4890: 68 65 20 73 74 72 75 63 74 75 72 65 2c 20 75 6e  he structure, un
48a0: 69 6f 6e 2c 20 65 6e 75 6d 65 72 61 74 69 6f 6e  ion, enumeration
48b0: 2c 0a 66 75 6e 63 74 69 6f 6e 20 6f 72 20 63 6c  ,.function or cl
48c0: 61 73 73 2e 0a 42 75 74 20 64 65 63 6c 61 72 61  ass..But declara
48d0: 74 69 6f 6e 73 20 74 68 61 74 20 61 70 70 65 61  tions that appea
48e0: 72 20 69 6e 20 61 0a 2e 63 20 66 69 6c 65 20 61  r in a..c file a
48f0: 72 65 20 63 6f 6e 73 69 64 65 72 65 64 20 70 72  re considered pr
4900: 69 76 61 74 65 20 74 6f 20 74 68 61 74 20 2e 63  ivate to that .c
4910: 20 66 69 6c 65 20 61 6e 64 20 61 72 65 20 6e 6f   file and are no
4920: 74 20 63 6f 70 69 65 64 20 69 6e 74 6f 0a 61 6e  t copied into.an
4930: 79 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20  y automatically 
4940: 67 65 6e 65 72 61 74 65 64 20 66 69 6c 65 73 2e  generated files.
4950: 0a 3c 2f 70 3e 0a 0a 3c 70 3e 3c 6c 69 3e 0a 41  .</p>..<p><li>.A
4960: 6c 6c 20 23 64 65 66 69 6e 65 73 20 61 6e 64 20  ll #defines and 
4970: 74 79 70 65 64 65 66 73 20 74 68 61 74 20 61 70  typedefs that ap
4980: 70 65 61 72 20 69 6e 20 6d 61 6e 75 61 6c 6c 79  pear in manually
4990: 20 70 72 6f 64 75 63 65 64 20 2e 68 20 66 69 6c   produced .h fil
49a0: 65 73 0a 61 72 65 20 63 6f 70 69 65 64 20 69 6e  es.are copied in
49b0: 74 6f 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79  to automatically
49c0: 20 67 65 6e 65 72 61 74 65 64 20 2e 68 20 66 69   generated .h fi
49d0: 6c 65 73 20 61 73 20 6e 65 65 64 65 64 2e 0a 53  les as needed..S
49e0: 69 6d 69 6c 61 72 20 63 6f 6e 73 74 72 75 63 74  imilar construct
49f0: 73 20 74 68 61 74 20 61 70 70 65 61 72 20 69 6e  s that appear in
4a00: 20 2e 63 20 66 69 6c 65 73 20 61 72 65 20 63 6f   .c files are co
4a10: 6e 73 69 64 65 72 65 64 20 70 72 69 76 61 74 65  nsidered private
4a20: 20 74 6f 0a 74 68 6f 73 65 20 66 69 6c 65 73 20   to.those files 
4a30: 61 6e 64 20 61 72 65 20 6e 6f 74 20 63 6f 70 69  and are not copi
4a40: 65 64 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 3c 6c 69  ed..</p>..<p><li
4a50: 3e 0a 57 68 65 6e 20 61 20 73 74 72 75 63 74 75  >.When a structu
4a60: 72 65 2c 20 75 6e 69 6f 6e 20 6f 72 20 65 6e 75  re, union or enu
4a70: 6d 65 72 61 74 69 6f 6e 20 64 65 63 6c 61 72 61  meration declara
4a80: 74 69 6f 6e 20 61 70 70 65 61 72 73 20 69 6e 20  tion appears in 
4a90: 61 20 2e 68 0a 66 69 6c 65 2c 20 6d 61 6b 65 68  a .h.file, makeh
4aa0: 65 61 64 65 72 73 20 77 69 6c 6c 20 61 75 74 6f  eaders will auto
4ab0: 6d 61 74 69 63 61 6c 6c 79 0a 67 65 6e 65 72 61  matically.genera
4ac0: 74 65 20 61 20 74 79 70 65 64 65 66 20 74 68 61  te a typedef tha
4ad0: 74 20 61 6c 6c 6f 77 73 20 74 68 65 20 64 65 63  t allows the dec
4ae0: 6c 61 72 61 74 69 6f 6e 20 74 6f 20 62 65 20 72  laration to be r
4af0: 65 66 65 72 65 6e 63 65 64 20 77 69 74 68 6f 75  eferenced withou
4b00: 74 0a 74 68 65 20 60 60 73 74 72 75 63 74 27 27  t.the ``struct''
4b10: 2c 20 60 60 75 6e 69 6f 6e 27 27 20 6f 72 20 60  , ``union'' or `
4b20: 60 65 6e 75 6d 27 27 0a 71 75 61 6c 69 66 69 65  `enum''.qualifie
4b30: 72 2e 0a 49 6e 20 6f 74 68 65 72 20 77 6f 72 64  r..In other word
4b40: 73 2c 20 69 66 20 6d 61 6b 65 68 65 61 64 65 72  s, if makeheader
4b50: 73 20 73 65 65 73 20 74 68 65 20 63 6f 64 65 3a  s sees the code:
4b60: 0a 3c 70 72 65 3e 0a 20 20 73 74 72 75 63 74 20  .<pre>.  struct 
4b70: 45 78 61 6d 70 20 7b 20 2f 2a 20 2e 2e 2e 20 2a  Examp { /* ... *
4b80: 2f 20 7d 3b 0a 3c 2f 70 72 65 3e 0a 69 74 20 77  / };.</pre>.it w
4b90: 69 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c  ill automaticall
4ba0: 79 20 67 65 6e 65 72 61 74 65 20 61 20 63 6f 72  y generate a cor
4bb0: 72 65 73 70 6f 6e 64 69 6e 67 20 74 79 70 65 64  responding typed
4bc0: 65 66 20 6c 69 6b 65 20 74 68 69 73 3a 0a 3c 70  ef like this:.<p
4bd0: 72 65 3e 0a 20 20 74 79 70 65 64 65 66 20 73 74  re>.  typedef st
4be0: 72 75 63 74 20 45 78 61 6d 70 20 45 78 61 6d 70  ruct Examp Examp
4bf0: 3b 0a 3c 2f 70 72 65 3e 0a 3c 2f 70 3e 0a 0a 3c  ;.</pre>.</p>..<
4c00: 70 3e 3c 6c 69 3e 0a 4d 61 6b 65 68 65 61 64 65  p><li>.Makeheade
4c10: 72 73 20 67 65 6e 65 72 61 74 65 73 20 61 6e 20  rs generates an 
4c20: 65 72 72 6f 72 20 6d 65 73 73 61 67 65 20 69 66  error message if
4c30: 20 69 74 20 65 6e 63 6f 75 6e 74 65 72 73 20 61   it encounters a
4c40: 20 66 75 6e 63 74 69 6f 6e 20 6f 72 0a 76 61 72   function or.var
4c50: 69 61 62 6c 65 20 64 65 66 69 6e 69 74 69 6f 6e  iable definition
4c60: 20 77 69 74 68 69 6e 20 61 20 2e 68 20 66 69 6c   within a .h fil
4c70: 65 2e 0a 54 68 65 20 2e 68 20 66 69 6c 65 73 20  e..The .h files 
4c80: 61 72 65 20 73 75 70 70 6f 73 65 20 74 6f 20 63  are suppose to c
4c90: 6f 6e 74 61 69 6e 20 6f 6e 6c 79 20 69 6e 74 65  ontain only inte
4ca0: 72 66 61 63 65 2c 20 6e 6f 74 20 69 6d 70 6c 65  rface, not imple
4cb0: 6d 65 6e 74 61 74 69 6f 6e 2e 0a 43 20 63 6f 6d  mentation..C com
4cc0: 70 69 6c 65 72 73 20 77 69 6c 6c 20 6e 6f 74 20  pilers will not 
4cd0: 65 6e 66 6f 72 63 65 20 74 68 69 73 20 63 6f 6e  enforce this con
4ce0: 76 65 6e 74 69 6f 6e 2c 20 62 75 74 20 6d 61 6b  vention, but mak
4cf0: 65 68 65 61 64 65 72 73 20 64 6f 65 73 2e 0a 3c  eheaders does..<
4d00: 2f 75 6c 3e 0a 0a 3c 70 3e 0a 41 73 20 61 20 66  /ul>..<p>.As a f
4d10: 69 6e 61 6c 20 6e 6f 74 65 2c 20 77 65 20 6f 62  inal note, we ob
4d20: 73 65 72 76 65 20 74 68 61 74 20 61 75 74 6f 6d  serve that autom
4d30: 61 74 69 63 61 6c 6c 79 20 67 65 6e 65 72 61 74  atically generat
4d40: 65 64 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 0a  ed declarations.
4d50: 61 72 65 20 6f 72 64 65 72 65 64 20 61 73 20 72  are ordered as r
4d60: 65 71 75 69 72 65 64 20 62 79 20 74 68 65 20 41  equired by the A
4d70: 4e 53 49 2d 43 20 70 72 6f 67 72 61 6d 6d 69 6e  NSI-C programmin
4d80: 67 20 6c 61 6e 67 75 61 67 65 2e 0a 49 66 20 74  g language..If t
4d90: 68 65 20 64 65 63 6c 61 72 61 74 69 6f 6e 20 6f  he declaration o
4da0: 66 20 73 6f 6d 65 20 73 74 72 75 63 74 75 72 65  f some structure
4db0: 20 60 60 58 27 27 20 72 65 71 75 69 72 65 73 20   ``X'' requires 
4dc0: 61 20 70 72 69 6f 72 0a 64 65 63 6c 61 72 61 74  a prior.declarat
4dd0: 69 6f 6e 20 6f 66 20 61 6e 6f 74 68 65 72 20 73  ion of another s
4de0: 74 72 75 63 74 75 72 65 20 60 60 59 27 27 2c 20  tructure ``Y'', 
4df0: 74 68 65 6e 20 59 20 77 69 6c 6c 20 61 70 70 65  then Y will appe
4e00: 61 72 0a 66 69 72 73 74 20 69 6e 20 74 68 65 20  ar.first in the 
4e10: 67 65 6e 65 72 61 74 65 64 20 68 65 61 64 65 72  generated header
4e20: 73 2e 0a 3c 2f 70 3e 0a 0a 3c 61 20 6e 61 6d 65  s..</p>..<a name
4e30: 3d 48 30 30 30 39 3e 0a 3c 68 33 3e 33 2e 33 20  =H0009>.<h3>3.3 
4e40: 48 6f 77 20 54 6f 20 41 76 6f 69 64 20 48 61 76  How To Avoid Hav
4e50: 69 6e 67 20 54 6f 20 57 72 69 74 65 20 41 6e 79  ing To Write Any
4e60: 20 48 65 61 64 65 72 20 46 69 6c 65 73 3c 2f 68   Header Files</h
4e70: 33 3e 0a 0a 3c 70 3e 0a 49 6e 20 6d 79 20 65 78  3>..<p>.In my ex
4e80: 70 65 72 69 65 6e 63 65 2c 20 6c 61 72 67 65 20  perience, large 
4e90: 70 72 6f 6a 65 63 74 73 20 77 6f 72 6b 20 62 65  projects work be
4ea0: 74 74 65 72 20 69 66 20 61 6c 6c 20 6f 66 20 74  tter if all of t
4eb0: 68 65 20 6d 61 6e 75 61 6c 6c 79 0a 77 72 69 74  he manually.writ
4ec0: 74 65 6e 20 63 6f 64 65 20 69 73 20 70 6c 61 63  ten code is plac
4ed0: 65 64 20 69 6e 20 2e 63 20 66 69 6c 65 73 20 61  ed in .c files a
4ee0: 6e 64 20 61 6c 6c 20 2e 68 20 66 69 6c 65 73 20  nd all .h files 
4ef0: 61 72 65 20 67 65 6e 65 72 61 74 65 64 0a 61 75  are generated.au
4f00: 74 6f 6d 61 74 69 63 61 6c 6c 79 2e 0a 54 68 69  tomatically..Thi
4f10: 73 20 69 73 20 73 6c 69 67 68 74 6c 79 20 64 69  s is slightly di
4f20: 66 66 65 72 65 6e 74 20 66 6f 72 20 74 68 65 20  fferent for the 
4f30: 74 72 61 64 69 74 69 6f 6e 61 6c 20 43 20 6d 65  traditional C me
4f40: 74 68 6f 64 20 6f 66 20 70 6c 61 63 69 6e 67 0a  thod of placing.
4f50: 74 68 65 20 69 6e 74 65 72 66 61 63 65 20 69 6e  the interface in
4f60: 20 2e 68 20 66 69 6c 65 73 20 61 6e 64 20 74 68   .h files and th
4f70: 65 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e  e implementation
4f80: 20 69 6e 20 2e 63 20 66 69 6c 65 73 2c 20 62 75   in .c files, bu
4f90: 74 0a 69 74 20 69 73 20 61 20 72 65 66 72 65 73  t.it is a refres
4fa0: 68 69 6e 67 20 63 68 61 6e 67 65 20 74 68 61 74  hing change that
4fb0: 20 62 72 69 6e 67 73 20 61 20 6e 6f 74 69 63 61   brings a notica
4fc0: 62 6c 65 20 69 6d 70 72 6f 76 65 6d 65 6e 74 20  ble improvement 
4fd0: 74 6f 20 74 68 65 0a 63 6f 64 69 6e 67 20 65 78  to the.coding ex
4fe0: 70 65 72 69 65 6e 63 65 2e 0a 4f 74 68 65 72 73  perience..Others
4ff0: 2c 20 49 20 62 65 6c 69 65 76 65 2c 20 73 68 61  , I believe, sha
5000: 72 65 20 74 68 69 73 20 76 69 65 77 20 73 69 6e  re this view sin
5010: 63 65 20 49 27 76 65 0a 6e 6f 74 69 63 65 64 20  ce I've.noticed 
5020: 72 65 63 65 6e 74 20 6c 61 6e 67 75 61 67 65 73  recent languages
5030: 20 28 65 78 3a 20 6a 61 76 61 2c 20 74 63 6c 2c   (ex: java, tcl,
5040: 20 70 65 72 6c 2c 20 61 77 6b 29 20 74 65 6e 64   perl, awk) tend
5050: 20 74 6f 0a 73 75 70 70 6f 72 74 20 74 68 65 20   to.support the 
5060: 6f 6e 65 2d 66 69 6c 65 20 61 70 70 72 6f 61 63  one-file approac
5070: 68 20 74 6f 20 63 6f 64 69 6e 67 20 61 73 20 74  h to coding as t
5080: 68 65 20 6f 6e 6c 79 20 6f 70 74 69 6f 6e 2e 0a  he only option..
5090: 3c 2f 70 3e 0a 0a 3c 70 3e 0a 54 68 65 20 6d 61  </p>..<p>.The ma
50a0: 6b 65 68 65 61 64 65 72 73 20 70 72 6f 67 72 61  keheaders progra
50b0: 6d 20 73 75 70 70 6f 72 74 73 20 70 75 74 74 69  m supports putti
50c0: 6e 67 20 62 6f 74 68 0a 69 6e 74 65 72 66 61 63  ng both.interfac
50d0: 65 20 61 6e 64 20 69 6d 70 6c 65 6d 65 6e 74 61  e and implementa
50e0: 74 69 6f 6e 20 69 6e 74 6f 20 74 68 65 20 73 61  tion into the sa
50f0: 6d 65 20 73 6f 75 72 63 65 20 66 69 6c 65 2e 0a  me source file..
5100: 42 75 74 20 79 6f 75 20 64 6f 20 68 61 76 65 20  But you do have 
5110: 74 6f 20 74 65 6c 6c 20 6d 61 6b 65 68 65 61 64  to tell makehead
5120: 65 72 73 20 77 68 69 63 68 20 70 61 72 74 20 6f  ers which part o
5130: 66 20 74 68 65 20 73 6f 75 72 63 65 20 66 69 6c  f the source fil
5140: 65 20 69 73 20 74 68 65 0a 69 6e 74 65 72 66 61  e is the.interfa
5150: 63 65 20 61 6e 64 20 77 68 69 63 68 20 70 61 72  ce and which par
5160: 74 20 69 73 20 74 68 65 20 69 6d 70 6c 65 6d 65  t is the impleme
5170: 6e 74 61 74 69 6f 6e 2e 0a 4d 61 6b 65 68 65 61  ntation..Makehea
5180: 64 65 72 73 20 68 61 73 20 74 6f 20 6b 6e 6f 77  ders has to know
5190: 20 74 68 69 73 20 69 6e 20 6f 72 64 65 72 20 74   this in order t
51a0: 6f 20 62 65 20 61 62 6c 65 20 74 6f 20 66 69 67  o be able to fig
51b0: 75 72 65 20 6f 75 74 20 77 68 65 74 68 65 72 20  ure out whether 
51c0: 6f 72 0a 6e 6f 74 20 73 74 72 75 63 74 75 72 65  or.not structure
51d0: 73 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 2c 20  s declarations, 
51e0: 74 79 70 65 64 65 66 73 2c 20 23 64 65 66 69 6e  typedefs, #defin
51f0: 65 73 20 61 6e 64 20 73 6f 20 66 6f 72 74 68 20  es and so forth 
5200: 73 68 6f 75 6c 64 0a 62 65 20 63 6f 70 69 65 64  should.be copied
5210: 20 69 6e 74 6f 20 74 68 65 20 67 65 6e 65 72 61   into the genera
5220: 74 65 64 20 68 65 61 64 65 72 73 20 6f 66 20 6f  ted headers of o
5230: 74 68 65 72 20 73 6f 75 72 63 65 20 66 69 6c 65  ther source file
5240: 73 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 59 6f 75  s..</p>..<p>.You
5250: 20 63 61 6e 20 69 6e 73 74 72 75 63 74 20 6d 61   can instruct ma
5260: 6b 65 68 65 61 64 65 72 73 20 74 6f 20 74 72 65  keheaders to tre
5270: 61 74 20 61 6e 79 20 70 61 72 74 20 6f 66 20 61  at any part of a
5280: 20 2e 63 20 66 69 6c 65 20 61 73 20 69 66 0a 69   .c file as if.i
5290: 74 20 77 65 72 65 20 61 20 2e 68 20 66 69 6c 65  t were a .h file
52a0: 20 62 79 20 65 6e 63 6c 6f 73 69 6e 67 20 74 68   by enclosing th
52b0: 61 74 20 70 61 72 74 20 6f 66 20 74 68 65 20 2e  at part of the .
52c0: 63 20 66 69 6c 65 20 77 69 74 68 69 6e 3a 0a 3c  c file within:.<
52d0: 70 72 65 3e 0a 20 20 20 23 69 66 20 49 4e 54 45  pre>.   #if INTE
52e0: 52 46 41 43 45 0a 20 20 20 23 65 6e 64 69 66 0a  RFACE.   #endif.
52f0: 3c 2f 70 72 65 3e 0a 54 68 75 73 20 61 6e 79 20  </pre>.Thus any 
5300: 73 74 72 75 63 74 75 72 65 20 64 65 66 69 6e 69  structure defini
5310: 74 69 6f 6e 73 20 74 68 61 74 20 61 70 70 65 61  tions that appea
5320: 72 20 61 66 74 65 72 20 74 68 65 20 0a 60 60 23  r after the .``#
5330: 69 66 20 49 4e 54 45 52 46 41 43 45 27 27 20 62  if INTERFACE'' b
5340: 75 74 20 62 65 66 6f 72 65 20 74 68 65 20 63 6f  ut before the co
5350: 72 72 65 73 70 6f 6e 64 69 6e 67 20 0a 60 60 23  rresponding .``#
5360: 65 6e 64 69 66 27 27 20 61 72 65 20 65 6c 69 67  endif'' are elig
5370: 61 62 6c 65 20 74 6f 20 62 65 20 63 6f 70 69 65  able to be copie
5380: 64 20 69 6e 74 6f 20 74 68 65 20 0a 61 75 74 6f  d into the .auto
5390: 6d 61 74 69 63 61 6c 6c 79 20 67 65 6e 65 72 61  matically genera
53a0: 74 65 64 0a 2e 68 20 66 69 6c 65 73 20 6f 66 20  ted..h files of 
53b0: 6f 74 68 65 72 20 2e 63 20 66 69 6c 65 73 2e 0a  other .c files..
53c0: 3c 2f 70 3e 0a 0a 3c 70 3e 0a 49 66 20 79 6f 75  </p>..<p>.If you
53d0: 20 75 73 65 20 74 68 65 20 60 60 23 69 66 20 49   use the ``#if I
53e0: 4e 54 45 52 46 41 43 45 27 27 20 6d 65 63 68 61  NTERFACE'' mecha
53f0: 6e 69 73 6d 20 69 6e 20 61 20 2e 63 20 66 69 6c  nism in a .c fil
5400: 65 2c 0a 74 68 65 6e 20 74 68 65 20 67 65 6e 65  e,.then the gene
5410: 72 61 74 65 64 20 68 65 61 64 65 72 20 66 6f 72  rated header for
5420: 20 74 68 61 74 20 2e 63 20 66 69 6c 65 20 77 69   that .c file wi
5430: 6c 6c 20 63 6f 6e 74 61 69 6e 20 61 20 6c 69 6e  ll contain a lin
5440: 65 0a 6c 69 6b 65 20 74 68 69 73 3a 0a 3c 70 72  e.like this:.<pr
5450: 65 3e 0a 20 20 20 23 64 65 66 69 6e 65 20 49 4e  e>.   #define IN
5460: 54 45 52 46 41 43 45 20 30 0a 3c 2f 70 72 65 3e  TERFACE 0.</pre>
5470: 0a 49 6e 20 6f 74 68 65 72 20 77 6f 72 64 73 2c  .In other words,
5480: 20 74 68 65 20 43 20 63 6f 6d 70 69 6c 65 72 20   the C compiler 
5490: 77 69 6c 6c 20 6e 65 76 65 72 20 73 65 65 20 61  will never see a
54a0: 6e 79 20 6f 66 20 74 68 65 20 74 65 78 74 20 74  ny of the text t
54b0: 68 61 74 0a 64 65 66 69 6e 65 73 20 74 68 65 20  hat.defines the 
54c0: 69 6e 74 65 72 66 61 63 65 2e 0a 42 75 74 20 6d  interface..But m
54d0: 61 6b 65 68 65 61 64 65 72 73 20 77 69 6c 6c 20  akeheaders will 
54e0: 63 6f 70 79 20 61 6c 6c 20 6e 65 63 65 73 73 61  copy all necessa
54f0: 72 79 20 64 65 66 69 6e 69 74 69 6f 6e 73 20 61  ry definitions a
5500: 6e 64 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 0a  nd declarations.
5510: 69 6e 74 6f 20 74 68 65 20 2e 68 20 66 69 6c 65  into the .h file
5520: 20 69 74 20 67 65 6e 65 72 61 74 65 73 2c 20 73   it generates, s
5530: 6f 20 2e 63 20 66 69 6c 65 73 20 77 69 6c 6c 20  o .c files will 
5540: 63 6f 6d 70 69 6c 65 20 61 73 20 69 66 20 74 68  compile as if th
5550: 65 0a 64 65 63 6c 61 72 61 74 69 6f 6e 73 20 77  e.declarations w
5560: 65 72 65 20 72 65 61 6c 6c 79 20 74 68 65 72 65  ere really there
5570: 2e 0a 54 68 69 73 20 61 70 70 72 6f 61 63 68 20  ..This approach 
5580: 68 61 73 20 74 68 65 20 61 64 76 61 6e 74 61 67  has the advantag
5590: 65 20 74 68 61 74 20 79 6f 75 20 64 6f 6e 27 74  e that you don't
55a0: 20 68 61 76 65 20 74 6f 20 77 6f 72 72 79 20 77   have to worry w
55b0: 69 74 68 0a 70 75 74 74 69 6e 67 20 74 68 65 20  ith.putting the 
55c0: 64 65 63 6c 61 72 61 74 69 6f 6e 73 20 69 6e 20  declarations in 
55d0: 74 68 65 20 63 6f 72 72 65 63 74 20 41 4e 53 49  the correct ANSI
55e0: 2d 43 20 6f 72 64 65 72 20 2d 2d 20 6d 61 6b 65  -C order -- make
55f0: 68 65 61 64 65 72 73 0a 77 69 6c 6c 20 64 6f 20  headers.will do 
5600: 74 68 61 74 20 66 6f 72 20 79 6f 75 20 61 75 74  that for you aut
5610: 6f 6d 61 74 69 63 61 6c 6c 79 2e 0a 3c 2f 70 3e  omatically..</p>
5620: 0a 0a 3c 70 3e 0a 4e 6f 74 65 20 74 68 61 74 20  ..<p>.Note that 
5630: 79 6f 75 20 64 6f 6e 27 74 20 68 61 76 65 20 74  you don't have t
5640: 6f 20 75 73 65 20 74 68 69 73 20 61 70 70 72 6f  o use this appro
5650: 61 63 68 20 65 78 63 6c 75 73 69 76 65 6c 79 2e  ach exclusively.
5660: 0a 59 6f 75 20 63 61 6e 20 70 75 74 20 73 6f 6d  .You can put som
5670: 65 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 20 69  e declarations i
5680: 6e 20 2e 68 20 66 69 6c 65 73 20 61 6e 64 20 6f  n .h files and o
5690: 74 68 65 72 73 20 77 69 74 68 69 6e 20 74 68 65  thers within the
56a0: 0a 60 60 23 69 66 20 49 4e 54 45 52 46 41 43 45  .``#if INTERFACE
56b0: 27 27 20 72 65 67 69 6f 6e 73 20 6f 66 20 2e 63  '' regions of .c
56c0: 20 66 69 6c 65 73 2e 0a 4d 61 6b 65 68 65 61 64   files..Makehead
56d0: 65 72 73 20 74 72 65 61 74 73 20 61 6c 6c 20 64  ers treats all d
56e0: 65 63 6c 61 72 61 74 69 6f 6e 73 20 61 6c 69 6b  eclarations alik
56f0: 65 2c 20 6e 6f 20 6d 61 74 74 65 72 20 77 68 65  e, no matter whe
5700: 72 65 20 74 68 65 79 0a 63 6f 6d 65 20 66 72 6f  re they.come fro
5710: 6d 2e 0a 59 6f 75 20 73 68 6f 75 6c 64 20 61 6c  m..You should al
5720: 73 6f 20 6e 6f 74 65 20 74 68 61 74 20 61 20 73  so note that a s
5730: 69 6e 67 6c 65 20 2e 63 20 66 69 6c 65 20 63 61  ingle .c file ca
5740: 6e 20 63 6f 6e 74 61 69 6e 20 61 73 20 6d 61 6e  n contain as man
5750: 79 0a 60 60 23 69 66 20 49 4e 54 45 52 46 41 43  y.``#if INTERFAC
5760: 45 27 27 20 72 65 67 69 6f 6e 73 20 61 73 20 64  E'' regions as d
5770: 65 73 69 72 65 64 2e 0a 3c 2f 70 3e 0a 0a 3c 61  esired..</p>..<a
5780: 20 6e 61 6d 65 3d 48 30 30 31 30 3e 0a 3c 68 33   name=H0010>.<h3
5790: 3e 33 2e 34 20 44 65 73 69 67 6e 61 74 69 6e 67  >3.4 Designating
57a0: 20 44 65 63 6c 61 72 61 74 69 6f 6e 73 20 46 6f   Declarations Fo
57b0: 72 20 45 78 70 6f 72 74 3c 2f 68 33 3e 0a 0a 3c  r Export</h3>..<
57c0: 70 3e 0a 49 6e 20 61 20 6c 61 72 67 65 20 70 72  p>.In a large pr
57d0: 6f 6a 65 63 74 2c 20 6f 6e 65 20 77 69 6c 6c 20  oject, one will 
57e0: 6f 66 74 65 6e 20 63 6f 6e 73 74 72 75 63 74 20  often construct 
57f0: 61 20 68 69 65 72 61 72 63 68 79 20 6f 66 0a 69  a hierarchy of.i
5800: 6e 74 65 72 66 61 63 65 73 2e 0a 46 6f 72 20 65  nterfaces..For e
5810: 78 61 6d 70 6c 65 2c 20 79 6f 75 20 6d 61 79 20  xample, you may 
5820: 68 61 76 65 20 61 20 67 72 6f 75 70 20 6f 66 20  have a group of 
5830: 32 30 20 6f 72 20 73 6f 20 66 69 6c 65 73 20 74  20 or so files t
5840: 68 61 74 20 66 6f 72 6d 0a 61 20 6c 69 62 72 61  hat form.a libra
5850: 72 79 20 75 73 65 64 20 69 6e 20 73 65 76 65 72  ry used in sever
5860: 61 6c 20 6f 74 68 65 72 20 70 61 72 74 73 20 6f  al other parts o
5870: 66 20 74 68 65 20 73 79 73 74 65 6d 2e 0a 45 61  f the system..Ea
5880: 63 68 20 66 69 6c 65 20 69 6e 20 74 68 69 73 20  ch file in this 
5890: 6c 69 62 72 61 72 79 20 77 69 6c 6c 20 70 72 65  library will pre
58a0: 73 65 6e 74 20 74 77 6f 20 69 6e 74 65 72 66 61  sent two interfa
58b0: 63 65 73 2e 0a 4f 6e 65 20 69 6e 74 65 72 66 61  ces..One interfa
58c0: 63 65 20 77 69 6c 6c 20 62 65 20 74 68 65 20 72  ce will be the r
58d0: 6f 75 74 69 6e 65 73 20 61 6e 64 20 64 61 74 61  outines and data
58e0: 20 73 74 72 75 63 74 75 72 65 73 20 69 74 20 69   structures it i
58f0: 73 0a 77 69 6c 6c 69 6e 67 20 74 6f 20 73 68 61  s.willing to sha
5900: 72 65 20 77 69 74 68 20 6f 74 68 65 72 20 66 69  re with other fi
5910: 6c 65 73 20 69 6e 20 74 68 65 20 73 61 6d 65 20  les in the same 
5920: 6c 69 62 72 61 72 79 2c 20 61 6e 64 20 74 68 65  library, and the
5930: 0a 73 65 63 6f 6e 64 20 69 6e 74 65 72 66 61 63  .second interfac
5940: 65 20 69 73 20 74 68 6f 73 65 20 72 6f 75 74 69  e is those routi
5950: 6e 65 73 20 61 6e 64 20 64 61 74 61 20 73 74 72  nes and data str
5960: 75 63 74 75 72 65 73 20 69 74 20 77 69 73 68 65  uctures it wishe
5970: 73 0a 74 6f 20 6d 61 6b 65 20 61 76 61 69 6c 61  s.to make availa
5980: 62 6c 65 20 74 6f 20 6f 74 68 65 72 20 73 75 62  ble to other sub
5990: 73 79 73 74 65 6d 73 2e 0a 28 54 68 65 20 73 65  systems..(The se
59a0: 63 6f 6e 64 20 69 6e 74 65 72 66 61 63 65 20 69  cond interface i
59b0: 73 20 6e 6f 72 6d 61 6c 6c 79 20 61 20 73 75 62  s normally a sub
59c0: 73 65 74 20 6f 66 20 74 68 65 20 66 69 72 73 74  set of the first
59d0: 2e 29 0a 4f 72 64 69 6e 61 72 79 20 43 20 64 6f  .).Ordinary C do
59e0: 65 73 20 6e 6f 74 20 70 72 6f 76 69 64 65 20 73  es not provide s
59f0: 75 70 70 6f 72 74 20 66 6f 72 20 61 20 74 69 65  upport for a tie
5a00: 72 65 64 20 69 6e 74 65 72 66 61 63 65 0a 6c 69  red interface.li
5a10: 6b 65 20 74 68 69 73 2c 20 62 75 74 20 6d 61 6b  ke this, but mak
5a20: 65 68 65 61 64 65 72 73 20 64 6f 65 73 2e 0a 3c  eheaders does..<
5a30: 2f 70 3e 0a 0a 3c 70 3e 0a 55 73 69 6e 67 20 6d  /p>..<p>.Using m
5a40: 61 6b 65 68 65 61 64 65 72 73 2c 20 69 74 20 69  akeheaders, it i
5a50: 73 20 70 6f 73 73 69 62 6c 65 20 74 6f 20 64 65  s possible to de
5a60: 73 69 67 6e 61 74 65 20 72 6f 75 74 69 6e 65 73  signate routines
5a70: 20 61 6e 64 20 64 61 74 61 0a 73 74 72 75 63 74   and data.struct
5a80: 75 72 65 73 20 61 73 20 62 65 69 6e 67 20 66 6f  ures as being fo
5a90: 72 20 60 60 65 78 70 6f 72 74 27 27 2e 0a 45 78  r ``export''..Ex
5aa0: 70 6f 72 74 65 64 20 6f 62 6a 65 63 74 73 20 61  ported objects a
5ab0: 72 65 20 76 69 73 69 62 6c 65 20 6e 6f 74 20 6f  re visible not o
5ac0: 6e 6c 79 20 74 6f 20 6f 74 68 65 72 20 66 69 6c  nly to other fil
5ad0: 65 73 20 77 69 74 68 69 6e 20 74 68 65 0a 73 61  es within the.sa
5ae0: 6d 65 20 6c 69 62 72 61 72 79 20 6f 72 20 73 75  me library or su
5af0: 62 61 73 73 65 6d 62 6c 79 20 62 75 74 20 61 6c  bassembly but al
5b00: 73 6f 20 74 6f 20 6f 74 68 65 72 0a 6c 69 62 72  so to other.libr
5b10: 61 72 69 65 73 20 61 6e 64 20 73 75 62 61 73 73  aries and subass
5b20: 65 6d 62 6c 69 65 73 20 69 6e 20 74 68 65 20 6c  emblies in the l
5b30: 61 72 67 65 72 20 70 72 6f 67 72 61 6d 2e 0a 42  arger program..B
5b40: 79 20 64 65 66 61 75 6c 74 2c 20 6d 61 6b 65 68  y default, makeh
5b50: 65 61 64 65 72 73 20 6f 6e 6c 79 20 6d 61 6b 65  eaders only make
5b60: 73 20 6f 62 6a 65 63 74 73 20 76 69 73 69 62 6c  s objects visibl
5b70: 65 20 74 6f 20 6f 74 68 65 72 20 6d 65 6d 62 65  e to other membe
5b80: 72 73 0a 6f 66 20 74 68 65 20 73 61 6d 65 20 6c  rs.of the same l
5b90: 69 62 72 61 72 79 2e 0a 3c 2f 70 3e 0a 0a 3c 70  ibrary..</p>..<p
5ba0: 3e 0a 54 68 61 74 20 69 73 6e 27 74 20 74 68 65  >.That isn't the
5bb0: 20 63 6f 6d 70 6c 65 74 65 20 74 72 75 74 68 2c   complete truth,
5bc0: 20 61 63 74 75 61 6c 6c 79 2e 0a 54 68 65 20 73   actually..The s
5bd0: 65 6d 61 6e 74 69 63 73 20 6f 66 20 43 20 61 72  emantics of C ar
5be0: 65 20 73 75 63 68 20 74 68 61 74 20 6f 6e 63 65  e such that once
5bf0: 20 61 6e 20 6f 62 6a 65 63 74 20 62 65 63 6f 6d   an object becom
5c00: 65 73 20 76 69 73 69 62 6c 65 0a 6f 75 74 73 69  es visible.outsi
5c10: 64 65 20 6f 66 20 61 20 73 69 6e 67 6c 65 20 73  de of a single s
5c20: 6f 75 72 63 65 20 66 69 6c 65 2c 20 69 74 20 69  ource file, it i
5c30: 73 20 61 6c 73 6f 20 76 69 73 69 62 6c 65 20 74  s also visible t
5c40: 6f 20 61 6e 79 20 75 73 65 72 0a 6f 66 20 74 68  o any user.of th
5c50: 65 20 6c 69 62 72 61 72 79 20 74 68 61 74 20 69  e library that i
5c60: 73 20 6d 61 64 65 20 66 72 6f 6d 20 74 68 65 20  s made from the 
5c70: 73 6f 75 72 63 65 20 66 69 6c 65 2e 0a 4d 61 6b  source file..Mak
5c80: 65 68 65 61 64 65 72 73 20 63 61 6e 20 6e 6f 74  eheaders can not
5c90: 20 70 72 65 76 65 6e 74 20 6f 75 74 73 69 64 65   prevent outside
5ca0: 72 73 20 66 6f 72 20 75 73 69 6e 67 20 6e 6f 6e  rs for using non
5cb0: 2d 65 78 70 6f 72 74 65 64 20 72 65 73 6f 75 72  -exported resour
5cc0: 63 65 73 2c 0a 62 75 74 20 69 74 20 63 61 6e 20  ces,.but it can 
5cd0: 64 69 73 63 6f 75 72 61 67 65 20 74 68 65 20 70  discourage the p
5ce0: 72 61 63 74 69 63 65 20 62 79 20 72 65 66 75 73  ractice by refus
5cf0: 69 6e 67 20 74 6f 20 70 72 6f 76 69 64 65 20 70  ing to provide p
5d00: 72 6f 74 6f 74 79 70 65 73 0a 61 6e 64 20 64 65  rototypes.and de
5d10: 63 6c 61 72 61 74 69 6f 6e 73 20 66 6f 72 20 74  clarations for t
5d20: 68 65 20 73 65 72 76 69 63 65 73 20 69 74 20 64  he services it d
5d30: 6f 65 73 20 6e 6f 74 20 77 61 6e 74 20 74 6f 20  oes not want to 
5d40: 65 78 70 6f 72 74 2e 0a 54 68 75 73 20 74 68 65  export..Thus the
5d50: 20 6f 6e 6c 79 20 72 65 61 6c 20 65 66 66 65 63   only real effec
5d60: 74 20 6f 66 20 74 68 65 20 6d 61 6b 69 6e 67 20  t of the making 
5d70: 61 6e 20 6f 62 6a 65 63 74 20 65 78 70 6f 72 74  an object export
5d80: 61 62 6c 65 20 69 73 0a 74 6f 20 69 6e 63 6c 75  able is.to inclu
5d90: 64 65 20 69 74 20 69 6e 20 74 68 65 20 6f 75 74  de it in the out
5da0: 70 75 74 20 6d 61 6b 65 68 65 61 64 65 72 73 20  put makeheaders 
5db0: 67 65 6e 65 72 61 74 65 73 20 77 68 65 6e 20 69  generates when i
5dc0: 74 20 69 73 20 72 75 6e 0a 75 73 69 6e 67 20 74  t is run.using t
5dd0: 68 65 20 2d 48 20 63 6f 6d 6d 61 6e 64 20 6c 69  he -H command li
5de0: 6e 65 20 6f 70 74 69 6f 6e 2e 0a 54 68 69 73 20  ne option..This 
5df0: 69 73 20 6e 6f 74 20 61 20 70 65 72 66 65 63 74  is not a perfect
5e00: 20 73 6f 6c 75 74 69 6f 6e 2c 20 62 75 74 20 69   solution, but i
5e10: 74 20 77 6f 72 6b 73 20 77 65 6c 6c 20 69 6e 20  t works well in 
5e20: 70 72 61 63 74 69 63 65 2e 0a 3c 2f 70 3e 0a 0a  practice..</p>..
5e30: 3c 70 3e 0a 42 75 74 20 74 72 6f 75 62 6c 65 20  <p>.But trouble 
5e40: 71 75 69 63 6b 6c 79 20 61 72 69 73 65 73 20 77  quickly arises w
5e50: 68 65 6e 20 77 65 20 61 74 74 65 6d 70 74 20 74  hen we attempt t
5e60: 6f 20 64 65 76 69 73 65 20 61 20 6d 65 63 68 61  o devise a mecha
5e70: 6e 69 73 6d 20 66 6f 72 0a 74 65 6c 6c 69 6e 67  nism for.telling
5e80: 20 6d 61 6b 65 68 65 61 64 65 72 73 20 77 68 69   makeheaders whi
5e90: 63 68 20 70 72 6f 74 6f 74 79 70 65 73 20 69 74  ch prototypes it
5ea0: 20 73 68 6f 75 6c 64 20 65 78 70 6f 72 74 20 61   should export a
5eb0: 6e 64 20 77 68 69 63 68 20 69 74 20 73 68 6f 75  nd which it shou
5ec0: 6c 64 0a 6b 65 65 70 20 6c 6f 63 61 6c 2e 0a 54  ld.keep local..T
5ed0: 68 65 20 62 75 69 6c 74 2d 69 6e 20 60 60 73 74  he built-in ``st
5ee0: 61 74 69 63 27 27 20 6b 65 79 77 6f 72 64 20 6f  atic'' keyword o
5ef0: 66 20 43 20 77 6f 72 6b 73 20 77 65 6c 6c 20 66  f C works well f
5f00: 6f 72 20 70 72 6f 68 69 62 69 74 69 6e 67 0a 70  or prohibiting.p
5f10: 72 6f 74 6f 74 79 70 65 73 20 66 72 6f 6d 20 6c  rototypes from l
5f20: 65 61 76 69 6e 67 20 61 20 73 69 6e 67 6c 65 20  eaving a single 
5f30: 73 6f 75 72 63 65 20 66 69 6c 65 2c 20 62 75 74  source file, but
5f40: 20 62 65 63 61 75 73 65 20 43 20 64 6f 65 73 6e   because C doesn
5f50: 27 74 0a 73 75 70 70 6f 72 74 20 61 20 6c 69 6e  't.support a lin
5f60: 6b 61 67 65 20 68 69 65 72 61 72 63 68 79 2c 20  kage hierarchy, 
5f70: 74 68 65 72 65 20 69 73 20 6e 6f 74 68 69 6e 67  there is nothing
5f80: 20 69 6e 20 74 68 65 20 43 20 6c 61 6e 67 75 61   in the C langua
5f90: 67 65 20 74 6f 20 68 65 6c 70 20 75 73 2e 0a 57  ge to help us..W
5fa0: 65 27 6c 6c 20 68 61 76 65 20 74 6f 20 69 6e 76  e'll have to inv
5fb0: 69 74 65 20 6f 75 72 20 6f 77 6e 20 6b 65 79 77  ite our own keyw
5fc0: 6f 72 64 3a 20 60 60 45 58 50 4f 52 54 27 27 0a  ord: ``EXPORT''.
5fd0: 3c 2f 70 3e 0a 0a 3c 70 3e 0a 4d 61 6b 65 68 65  </p>..<p>.Makehe
5fe0: 61 64 65 72 73 20 61 6c 6c 6f 77 73 20 74 68 65  aders allows the
5ff0: 20 45 58 50 4f 52 54 20 6b 65 79 77 6f 72 64 20   EXPORT keyword 
6000: 74 6f 20 70 72 65 63 65 64 65 20 61 6e 79 20 66  to precede any f
6010: 75 6e 63 74 69 6f 6e 20 6f 72 0a 70 72 6f 63 65  unction or.proce
6020: 64 75 72 65 20 64 65 66 69 6e 69 74 69 6f 6e 2e  dure definition.
6030: 0a 54 68 65 20 72 6f 75 74 69 6e 65 20 66 6f 6c  .The routine fol
6040: 6c 6f 77 69 6e 67 20 74 68 65 20 45 58 50 4f 52  lowing the EXPOR
6050: 54 20 6b 65 79 77 6f 72 64 20 69 73 20 74 68 65  T keyword is the
6060: 6e 20 65 6c 69 67 61 62 6c 65 20 74 6f 20 61 70  n eligable to ap
6070: 70 65 61 72 0a 69 6e 20 74 68 65 20 68 65 61 64  pear.in the head
6080: 65 72 20 66 69 6c 65 20 67 65 6e 65 72 61 74 65  er file generate
6090: 64 20 75 73 69 6e 67 20 74 68 65 20 2d 48 20 63  d using the -H c
60a0: 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 6f 70 74 69  ommand line opti
60b0: 6f 6e 2e 0a 4e 6f 74 65 20 74 68 61 74 20 69 66  on..Note that if
60c0: 20 61 20 2e 63 20 66 69 6c 65 20 63 6f 6e 74 61   a .c file conta
60d0: 69 6e 73 20 74 68 65 20 45 58 50 4f 52 54 20 6b  ins the EXPORT k
60e0: 65 79 77 6f 72 64 2c 20 6d 61 6b 65 68 65 61 64  eyword, makehead
60f0: 65 72 73 20 77 69 6c 6c 0a 70 75 74 20 74 68 65  ers will.put the
6100: 20 6d 61 63 72 6f 0a 3c 70 72 65 3e 0a 20 20 20   macro.<pre>.   
6110: 23 64 65 66 69 6e 65 20 45 58 50 4f 52 54 0a 3c  #define EXPORT.<
6120: 2f 70 72 65 3e 0a 69 6e 20 74 68 65 20 68 65 61  /pre>.in the hea
6130: 64 65 72 20 66 69 6c 65 20 69 74 20 67 65 6e 65  der file it gene
6140: 72 61 74 65 73 20 66 6f 72 20 74 68 65 20 2e 63  rates for the .c
6150: 20 66 69 6c 65 20 73 6f 20 74 68 61 74 20 74 68   file so that th
6160: 65 20 45 58 50 4f 52 54 20 6b 65 79 77 6f 72 64  e EXPORT keyword
6170: 0a 77 69 6c 6c 20 6e 65 76 65 72 20 62 65 20 73  .will never be s
6180: 65 65 6e 20 62 79 20 74 68 65 20 43 20 63 6f 6d  een by the C com
6190: 70 69 6c 65 72 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e  piler..</p>..<p>
61a0: 0a 42 75 74 20 74 68 65 20 45 58 50 4f 52 54 20  .But the EXPORT 
61b0: 6b 65 79 77 6f 72 64 20 6f 6e 6c 79 20 77 6f 72  keyword only wor
61c0: 6b 73 20 66 6f 72 20 66 75 6e 63 74 69 6f 6e 20  ks for function 
61d0: 61 6e 64 20 70 72 6f 63 65 64 75 72 65 20 64 65  and procedure de
61e0: 66 69 6e 69 74 69 6f 6e 73 2e 0a 46 6f 72 20 73  finitions..For s
61f0: 74 72 75 63 74 75 72 65 2c 20 75 6e 69 6f 6e 20  tructure, union 
6200: 61 6e 64 20 65 6e 75 6d 20 64 65 66 69 6e 69 74  and enum definit
6210: 69 6f 6e 73 2c 20 74 79 70 65 64 65 66 73 2c 20  ions, typedefs, 
6220: 23 64 65 66 69 6e 65 73 20 61 6e 64 0a 63 6c 61  #defines and.cla
6230: 73 73 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 2c  ss declarations,
6240: 20 61 20 73 65 63 6f 6e 64 20 6d 65 63 68 61 6e   a second mechan
6250: 69 73 6d 20 69 73 20 75 73 65 64 2e 0a 4a 75 73  ism is used..Jus
6260: 74 20 61 73 20 61 6e 79 20 64 65 63 6c 61 72 61  t as any declara
6270: 74 69 6f 6e 73 20 6f 72 20 64 65 66 69 6e 69 74  tions or definit
6280: 69 6f 6e 20 63 6f 6e 74 61 69 6e 65 64 20 77 69  ion contained wi
6290: 74 68 69 6e 0a 3c 70 72 65 3e 0a 20 20 20 23 69  thin.<pre>.   #i
62a0: 66 20 49 4e 54 45 52 46 41 43 45 0a 20 20 20 23  f INTERFACE.   #
62b0: 65 6e 64 69 66 0a 3c 2f 70 72 65 3e 0a 61 72 65  endif.</pre>.are
62c0: 20 76 69 73 69 62 6c 65 20 74 6f 20 61 6c 6c 20   visible to all 
62d0: 66 69 6c 65 73 20 77 69 74 68 69 6e 20 74 68 65  files within the
62e0: 20 6c 69 62 72 61 72 79 2c 20 61 6e 79 20 64 65   library, any de
62f0: 63 6c 61 72 61 74 69 6f 6e 73 0a 6f 72 20 64 65  clarations.or de
6300: 66 69 6e 69 74 69 6f 6e 73 20 77 69 74 68 69 6e  finitions within
6310: 0a 3c 70 72 65 3e 0a 20 20 20 23 69 66 20 45 58  .<pre>.   #if EX
6320: 50 4f 52 54 5f 49 4e 54 45 52 46 41 43 45 0a 20  PORT_INTERFACE. 
6330: 20 20 23 65 6e 64 69 66 0a 3c 2f 70 72 65 3e 0a    #endif.</pre>.
6340: 77 69 6c 6c 20 62 65 63 6f 6d 65 20 70 61 72 74  will become part
6350: 20 6f 66 20 74 68 65 20 65 78 70 6f 72 74 65 64   of the exported
6360: 20 69 6e 74 65 72 66 61 63 65 2e 0a 54 68 65 20   interface..The 
6370: 60 60 23 69 66 20 45 58 50 4f 52 54 5f 49 4e 54  ``#if EXPORT_INT
6380: 45 52 46 41 43 45 27 27 20 6d 65 63 68 61 6e 69  ERFACE'' mechani
6390: 73 6d 20 63 61 6e 20 62 65 20 75 73 65 64 20 69  sm can be used i
63a0: 6e 20 65 69 74 68 65 72 0a 2e 63 20 6f 72 20 2e  n either..c or .
63b0: 68 20 66 69 6c 65 73 2e 0a 28 54 68 65 20 60 60  h files..(The ``
63c0: 23 69 66 20 49 4e 54 45 52 46 41 43 45 27 27 20  #if INTERFACE'' 
63d0: 63 61 6e 20 61 6c 73 6f 20 62 65 20 75 73 65 64  can also be used
63e0: 20 69 6e 20 62 6f 74 68 20 2e 68 20 61 6e 64 20   in both .h and 
63f0: 2e 63 20 66 69 6c 65 73 2c 20 0a 62 75 74 20 73  .c files, .but s
6400: 69 6e 63 65 20 69 74 27 73 20 75 73 65 20 69 6e  ince it's use in
6410: 20 61 20 2e 68 20 66 69 6c 65 20 77 6f 75 6c 64   a .h file would
6420: 20 62 65 20 72 65 64 75 6e 64 61 6e 74 2c 20 77   be redundant, w
6430: 65 20 68 61 76 65 6e 27 74 20 6d 65 6e 74 69 6f  e haven't mentio
6440: 6e 65 64 0a 69 74 20 62 65 66 6f 72 65 2e 29 0a  ned.it before.).
6450: 3c 2f 70 3e 0a 0a 3c 61 20 6e 61 6d 65 3d 48 30  </p>..<a name=H0
6460: 30 31 31 3e 0a 3c 68 33 3e 33 2e 35 20 4c 6f 63  011>.<h3>3.5 Loc
6470: 61 6c 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 20  al declarations 
6480: 70 72 6f 63 65 73 73 65 64 20 62 79 20 6d 61 6b  processed by mak
6490: 65 68 65 61 64 65 72 73 3c 2f 68 33 3e 0a 0a 3c  eheaders</h3>..<
64a0: 70 3e 0a 53 74 72 75 63 74 75 72 65 20 64 65 63  p>.Structure dec
64b0: 6c 61 72 61 74 69 6f 6e 73 20 61 6e 64 20 74 79  larations and ty
64c0: 70 65 64 65 66 73 20 74 68 61 74 20 61 70 70 65  pedefs that appe
64d0: 61 72 20 69 6e 20 2e 63 20 66 69 6c 65 73 20 61  ar in .c files a
64e0: 72 65 20 6e 6f 72 6d 61 6c 6c 79 0a 69 67 6e 6f  re normally.igno
64f0: 72 65 64 20 62 79 20 6d 61 6b 65 68 65 61 64 65  red by makeheade
6500: 72 73 2e 0a 53 75 63 68 20 64 65 63 6c 61 72 61  rs..Such declara
6510: 74 69 6f 6e 73 20 61 72 65 20 6f 6e 6c 79 20 69  tions are only i
6520: 6e 74 65 6e 64 65 64 20 66 6f 72 20 75 73 65 20  ntended for use 
6530: 62 79 20 74 68 65 20 73 6f 75 72 63 65 20 66 69  by the source fi
6540: 6c 65 20 69 6e 20 77 68 69 63 68 0a 74 68 65 79  le in which.they
6550: 20 61 70 70 65 61 72 20 61 6e 64 20 73 6f 20 6d   appear and so m
6560: 61 6b 65 68 65 61 64 65 72 73 20 64 6f 65 73 6e  akeheaders doesn
6570: 27 74 20 6e 65 65 64 20 74 6f 20 63 6f 70 79 20  't need to copy 
6580: 74 68 65 6d 20 69 6e 74 6f 20 61 6e 79 0a 67 65  them into any.ge
6590: 6e 65 72 61 74 65 64 20 68 65 61 64 65 72 20 66  nerated header f
65a0: 69 6c 65 73 2e 0a 57 65 20 63 61 6c 6c 20 73 75  iles..We call su
65b0: 63 68 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 20  ch declarations 
65c0: 60 60 70 72 69 76 61 74 65 27 27 2e 0a 3c 2f 70  ``private''..</p
65d0: 3e 0a 0a 3c 70 3e 0a 53 6f 6d 65 74 69 6d 65 73  >..<p>.Sometimes
65e0: 20 69 74 20 69 73 20 63 6f 6e 76 65 6e 69 65 6e   it is convenien
65f0: 74 20 74 6f 20 68 61 76 65 20 6d 61 6b 65 68 65  t to have makehe
6600: 61 64 65 72 73 20 73 6f 72 74 20 61 20 73 65 71  aders sort a seq
6610: 75 65 6e 63 65 0a 6f 66 20 70 72 69 76 61 74 65  uence.of private
6620: 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 20 69 6e   declarations in
6630: 74 6f 20 74 68 65 20 63 6f 72 72 65 63 74 20 6f  to the correct o
6640: 72 64 65 72 20 66 6f 72 20 75 73 20 61 75 74 6f  rder for us auto
6650: 6d 61 74 69 63 61 6c 6c 79 2e 0a 4f 72 2c 20 77  matically..Or, w
6660: 65 20 63 6f 75 6c 64 20 68 61 76 65 20 73 74 61  e could have sta
6670: 74 69 63 20 66 75 6e 63 74 69 6f 6e 73 20 61 6e  tic functions an
6680: 64 20 70 72 6f 63 65 64 75 72 65 73 20 66 6f 72  d procedures for
6690: 20 77 68 69 63 68 20 77 65 20 77 6f 75 6c 64 20   which we would 
66a0: 6c 69 6b 65 0a 6d 61 6b 65 68 65 61 64 65 72 73  like.makeheaders
66b0: 20 74 6f 20 67 65 6e 65 72 61 74 65 20 70 72 6f   to generate pro
66c0: 74 6f 74 79 70 65 73 2c 20 62 75 74 20 74 68 65  totypes, but the
66d0: 20 61 72 67 75 6d 65 6e 74 73 20 74 6f 20 74 68   arguments to th
66e0: 65 73 65 0a 66 75 6e 63 74 69 6f 6e 73 20 61 6e  ese.functions an
66f0: 64 20 70 72 6f 63 65 64 75 72 65 73 20 75 73 65  d procedures use
6700: 73 20 70 72 69 76 61 74 65 20 64 65 63 6c 61 72  s private declar
6710: 61 74 69 6f 6e 73 2e 0a 49 6e 20 62 6f 74 68 20  ations..In both 
6720: 6f 66 20 74 68 65 73 65 20 63 61 73 65 73 2c 20  of these cases, 
6730: 77 65 20 77 61 6e 74 20 6d 61 6b 65 68 65 61 64  we want makehead
6740: 65 72 73 20 74 6f 20 62 65 20 61 77 61 72 65 20  ers to be aware 
6750: 6f 66 20 74 68 65 20 0a 70 72 69 76 61 74 65 20  of the .private 
6760: 64 65 63 6c 61 72 61 74 69 6f 6e 73 20 61 6e 64  declarations and
6770: 20 63 6f 70 79 20 74 68 65 6d 20 69 6e 74 6f 20   copy them into 
6780: 74 68 65 20 6c 6f 63 61 6c 20 68 65 61 64 65 72  the local header
6790: 20 66 69 6c 65 2c 0a 62 75 74 20 77 65 20 64 6f   file,.but we do
67a0: 6e 27 74 20 77 61 6e 74 20 6d 61 6b 65 68 65 61  n't want makehea
67b0: 64 65 72 73 20 74 6f 20 70 72 6f 70 61 67 61 74  ders to propagat
67c0: 65 20 74 68 65 0a 64 65 63 6c 61 72 61 74 69 6f  e the.declaratio
67d0: 6e 73 20 6f 75 74 73 69 64 65 20 6f 66 20 74 68  ns outside of th
67e0: 65 20 66 69 6c 65 20 69 6e 20 77 68 69 63 68 20  e file in which 
67f0: 74 68 65 79 20 61 72 65 20 64 65 63 6c 61 72 65  they are declare
6800: 64 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 57 68 65  d..</p>..<p>.Whe
6810: 6e 20 74 68 69 73 20 73 69 74 75 61 74 69 6f 6e  n this situation
6820: 20 61 72 69 73 65 73 2c 20 65 6e 63 6c 6f 73 65   arises, enclose
6830: 20 74 68 65 20 70 72 69 76 61 74 65 20 64 65 63   the private dec
6840: 6c 61 72 61 74 69 6f 6e 73 0a 77 69 74 68 69 6e  larations.within
6850: 0a 3c 70 72 65 3e 0a 20 20 23 69 66 20 4c 4f 43  .<pre>.  #if LOC
6860: 41 4c 5f 49 4e 54 45 52 46 41 43 45 0a 20 20 23  AL_INTERFACE.  #
6870: 65 6e 64 69 66 0a 3c 2f 70 72 65 3e 0a 41 20 60  endif.</pre>.A `
6880: 60 4c 4f 43 41 4c 5f 49 4e 54 45 52 46 41 43 45  `LOCAL_INTERFACE
6890: 27 27 20 62 6c 6f 63 6b 20 77 6f 72 6b 73 20 76  '' block works v
68a0: 65 72 79 20 6d 75 63 68 20 6c 69 6b 65 20 74 68  ery much like th
68b0: 65 0a 60 60 49 4e 54 45 52 46 41 43 45 27 27 20  e.``INTERFACE'' 
68c0: 61 6e 64 20 60 60 45 58 50 4f 52 54 5f 49 4e 54  and ``EXPORT_INT
68d0: 45 52 46 41 43 45 27 27 0a 62 6c 6f 63 6b 73 20  ERFACE''.blocks 
68e0: 64 65 73 63 72 69 62 65 64 20 61 62 6f 76 65 2c  described above,
68f0: 20 65 78 63 65 70 74 20 74 68 61 74 20 6d 61 6b   except that mak
6900: 65 68 65 61 64 65 72 73 20 69 6e 73 75 72 65 73  eheaders insures
6910: 20 74 68 61 74 20 74 68 65 0a 6f 62 6a 65 63 74   that the.object
6920: 73 20 64 65 63 6c 61 72 65 64 20 69 6e 20 61 20  s declared in a 
6930: 4c 4f 43 41 4c 5f 49 4e 54 45 52 46 41 43 45 20  LOCAL_INTERFACE 
6940: 61 72 65 20 6f 6e 6c 79 20 76 69 73 69 62 6c 65  are only visible
6950: 20 74 6f 20 74 68 65 0a 66 69 6c 65 20 63 6f 6e   to the.file con
6960: 74 61 69 6e 69 6e 67 20 74 68 65 20 4c 4f 43 41  taining the LOCA
6970: 4c 5f 49 4e 54 45 52 46 41 43 45 2e 0a 3c 2f 70  L_INTERFACE..</p
6980: 3e 0a 0a 3c 61 20 6e 61 6d 65 3d 48 30 30 31 32  >..<a name=H0012
6990: 3e 0a 3c 68 33 3e 33 2e 36 20 55 73 69 6e 67 20  >.<h3>3.6 Using 
69a0: 4d 61 6b 65 68 65 61 64 65 72 73 20 57 69 74 68  Makeheaders With
69b0: 20 43 2b 2b 20 43 6f 64 65 3c 2f 68 33 3e 0a 0a   C++ Code</h3>..
69c0: 3c 70 3e 0a 59 6f 75 20 63 61 6e 20 75 73 65 20  <p>.You can use 
69d0: 6d 61 6b 65 68 65 61 64 65 72 73 20 74 6f 20 67  makeheaders to g
69e0: 65 6e 65 72 61 74 65 20 68 65 61 64 65 72 20 66  enerate header f
69f0: 69 6c 65 73 20 66 6f 72 20 43 2b 2b 20 63 6f 64  iles for C++ cod
6a00: 65 2c 20 69 6e 0a 61 64 64 69 74 69 6f 6e 20 74  e, in.addition t
6a10: 6f 20 43 2e 0a 4d 61 6b 65 68 65 61 64 65 72 73  o C..Makeheaders
6a20: 20 77 69 6c 6c 20 72 65 63 6f 67 6e 69 7a 65 20   will recognize 
6a30: 61 6e 64 20 63 6f 70 79 20 62 6f 74 68 20 60 60  and copy both ``
6a40: 63 6c 61 73 73 27 27 20 64 65 63 6c 61 72 61 74  class'' declarat
6a50: 69 6f 6e 73 0a 61 6e 64 20 69 6e 6c 69 6e 65 20  ions.and inline 
6a60: 66 75 6e 63 74 69 6f 6e 20 64 65 66 69 6e 69 74  function definit
6a70: 69 6f 6e 73 2c 20 61 6e 64 20 69 74 20 6b 6e 6f  ions, and it kno
6a80: 77 73 20 6e 6f 74 20 74 6f 20 74 72 79 20 74 6f  ws not to try to
6a90: 20 67 65 6e 65 72 61 74 65 0a 70 72 6f 74 6f 74   generate.protot
6aa0: 79 70 65 73 20 66 6f 72 20 6d 65 74 68 6f 64 73  ypes for methods
6ab0: 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 49 6e 20 66  ..</p>..<p>.In f
6ac0: 61 63 74 2c 20 6d 61 6b 65 68 65 61 64 65 72 73  act, makeheaders
6ad0: 20 69 73 20 73 6d 61 72 74 20 65 6e 6f 75 67 68   is smart enough
6ae0: 20 74 6f 20 62 65 20 75 73 65 64 20 69 6e 20 70   to be used in p
6af0: 72 6f 6a 65 63 74 73 20 74 68 61 74 20 65 6d 70  rojects that emp
6b00: 6c 6f 79 0a 61 20 6d 69 78 74 75 72 65 20 6f 66  loy.a mixture of
6b10: 20 43 20 61 6e 64 20 43 2b 2b 2e 0a 46 6f 72 20   C and C++..For 
6b20: 65 78 61 6d 70 6c 65 2c 20 69 66 20 61 20 43 20  example, if a C 
6b30: 66 75 6e 63 74 69 6f 6e 20 69 73 20 63 61 6c 6c  function is call
6b40: 65 64 20 66 72 6f 6d 20 77 69 74 68 69 6e 20 61  ed from within a
6b50: 20 43 2b 2b 20 63 6f 64 65 20 6d 6f 64 75 6c 65   C++ code module
6b60: 2c 0a 6d 61 6b 65 68 65 61 64 65 72 73 20 77 69  ,.makeheaders wi
6b70: 6c 6c 20 6b 6e 6f 77 20 74 6f 20 70 72 65 70 65  ll know to prepe
6b80: 6e 64 20 74 68 65 20 74 65 78 74 0a 3c 70 72 65  nd the text.<pre
6b90: 3e 0a 20 20 20 65 78 74 65 72 6e 20 22 43 22 0a  >.   extern "C".
6ba0: 3c 2f 70 72 65 3e 0a 74 6f 20 74 68 65 20 70 72  </pre>.to the pr
6bb0: 6f 74 6f 74 79 70 65 20 66 6f 72 20 74 68 61 74  ototype for that
6bc0: 20 66 75 6e 63 74 69 6f 6e 20 69 6e 20 74 68 65   function in the
6bd0: 20 43 2b 2b 20 68 65 61 64 65 72 20 66 69 6c 65   C++ header file
6be0: 2e 0a 47 6f 69 6e 67 20 74 68 65 20 6f 74 68 65  ..Going the othe
6bf0: 72 20 77 61 79 2c 0a 69 66 20 79 6f 75 20 74 72  r way,.if you tr
6c00: 79 20 74 6f 20 63 61 6c 6c 20 61 20 43 2b 2b 20  y to call a C++ 
6c10: 66 75 6e 63 74 69 6f 6e 20 66 72 6f 6d 20 77 69  function from wi
6c20: 74 68 69 6e 20 43 2c 20 61 6e 0a 61 70 70 72 6f  thin C, an.appro
6c30: 70 72 69 61 74 65 20 65 72 72 6f 72 20 6d 65 73  priate error mes
6c40: 73 61 67 65 20 69 73 20 69 73 73 75 65 64 2c 20  sage is issued, 
6c50: 73 69 6e 63 65 20 43 2b 2b 20 72 6f 75 74 69 6e  since C++ routin
6c60: 65 73 20 63 61 6e 20 6e 6f 74 0a 6e 6f 72 6d 61  es can not.norma
6c70: 6c 6c 79 20 62 65 20 63 61 6c 6c 65 64 20 62 79  lly be called by
6c80: 20 43 20 63 6f 64 65 20 28 64 75 65 20 74 6f 20   C code (due to 
6c90: 66 61 63 74 20 74 68 61 74 20 6d 6f 73 74 20 43  fact that most C
6ca0: 2b 2b 20 63 6f 6d 70 69 6c 65 72 73 0a 75 73 65  ++ compilers.use
6cb0: 20 6e 61 6d 65 20 6d 61 6e 67 6c 69 6e 67 20 74   name mangling t
6cc0: 6f 20 66 61 63 69 6c 69 74 61 74 65 20 74 79 70  o facilitate typ
6cd0: 65 2d 73 61 66 65 20 6c 69 6e 6b 61 67 65 2e 29  e-safe linkage.)
6ce0: 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 4e 6f 20 73 70  .</p>..<p>.No sp
6cf0: 65 63 69 61 6c 20 63 6f 6d 6d 61 6e 64 2d 6c 69  ecial command-li
6d00: 6e 65 20 6f 70 74 69 6f 6e 73 20 61 72 65 20 72  ne options are r
6d10: 65 71 75 69 72 65 64 20 74 6f 20 75 73 65 20 6d  equired to use m
6d20: 61 6b 65 68 65 61 64 65 72 73 20 77 69 74 68 0a  akeheaders with.
6d30: 43 2b 2b 20 69 6e 70 75 74 2e 20 20 4d 61 6b 65  C++ input.  Make
6d40: 68 65 61 64 65 72 73 20 77 69 6c 6c 20 72 65 63  headers will rec
6d50: 6f 67 6e 69 7a 65 20 74 68 61 74 20 69 74 73 20  ognize that its 
6d60: 73 6f 75 72 63 65 20 63 6f 64 65 20 69 73 20 43  source code is C
6d70: 2b 2b 0a 62 79 20 74 68 65 20 73 75 66 66 69 78  ++.by the suffix
6d80: 20 6f 6e 20 74 68 65 20 73 6f 75 72 63 65 20 63   on the source c
6d90: 6f 64 65 20 66 69 6c 65 6e 61 6d 65 2e 20 20 53  ode filename.  S
6da0: 69 6d 70 6c 65 20 22 2e 63 22 20 6f 72 20 22 2e  imple ".c" or ".
6db0: 68 22 20 73 75 66 66 69 78 65 73 0a 61 72 65 20  h" suffixes.are 
6dc0: 61 73 73 75 6d 65 64 20 74 6f 20 62 65 20 41 4e  assumed to be AN
6dd0: 53 49 2d 43 2e 20 20 41 6e 79 74 68 69 6e 67 20  SI-C.  Anything 
6de0: 65 6c 73 65 2c 20 69 6e 63 6c 75 64 69 6e 67 20  else, including 
6df0: 22 2e 63 63 22 2c 20 22 2e 43 22 20 61 6e 64 0a  ".cc", ".C" and.
6e00: 22 2e 63 70 70 22 20 69 73 20 61 73 73 75 6d 65  ".cpp" is assume
6e10: 64 20 74 6f 20 62 65 20 43 2b 2b 2e 0a 54 68 65  d to be C++..The
6e20: 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 68 65 61   name of the hea
6e30: 64 65 72 20 66 69 6c 65 20 67 65 6e 65 72 61 74  der file generat
6e40: 65 64 20 62 79 20 6d 61 6b 65 68 65 61 64 65 72  ed by makeheader
6e50: 73 20 69 73 20 64 65 72 69 76 65 64 20 66 72 6f  s is derived fro
6e60: 6d 0a 62 79 20 74 68 65 20 6e 61 6d 65 20 6f 66  m.by the name of
6e70: 20 74 68 65 20 73 6f 75 72 63 65 20 66 69 6c 65   the source file
6e80: 20 62 79 20 63 6f 6e 76 65 72 74 69 6e 67 20 65   by converting e
6e90: 76 65 72 79 20 22 63 22 20 74 6f 20 22 68 22 20  very "c" to "h" 
6ea0: 61 6e 64 0a 65 76 65 72 79 20 22 43 22 20 74 6f  and.every "C" to
6eb0: 20 22 48 22 20 69 6e 20 74 68 65 20 73 75 66 66   "H" in the suff
6ec0: 69 78 20 6f 66 20 74 68 65 20 66 69 6c 65 6e 61  ix of the filena
6ed0: 6d 65 2e 0a 54 68 75 73 20 74 68 65 20 43 2b 2b  me..Thus the C++
6ee0: 20 73 6f 75 72 63 65 0a 66 69 6c 65 20 60 60 61   source.file ``a
6ef0: 6c 70 68 61 2e 63 70 70 27 27 20 77 69 6c 6c 20  lpha.cpp'' will 
6f00: 69 6e 64 75 63 65 20 6d 61 6b 65 68 65 61 64 65  induce makeheade
6f10: 72 73 20 74 6f 0a 67 65 6e 65 72 61 74 65 20 61  rs to.generate a
6f20: 20 68 65 61 64 65 72 20 66 69 6c 65 20 6e 61 6d   header file nam
6f30: 65 64 20 60 60 61 6c 70 68 61 2e 68 70 70 27 27  ed ``alpha.hpp''
6f40: 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 4d 61 6b 65  ..</p>..<p>.Make
6f50: 68 65 61 64 65 72 73 20 61 75 67 6d 65 6e 74 73  headers augments
6f60: 20 63 6c 61 73 73 20 64 65 66 69 6e 69 74 69 6f   class definitio
6f70: 6e 73 20 62 79 20 69 6e 73 65 72 74 69 6e 67 20  ns by inserting 
6f80: 70 72 6f 74 6f 74 79 70 65 73 20 74 6f 0a 6d 65  prototypes to.me
6f90: 74 68 6f 64 73 20 77 65 72 65 20 61 70 70 72 6f  thods were appro
6fa0: 70 72 69 61 74 65 2e 20 20 49 66 20 61 20 6d 65  priate.  If a me
6fb0: 74 68 6f 64 20 64 65 66 69 6e 69 74 69 6f 6e 20  thod definition 
6fc0: 62 65 67 69 6e 73 20 77 69 74 68 20 6f 6e 65 0a  begins with one.
6fd0: 6f 66 20 74 68 65 20 73 70 65 63 69 61 6c 20 6b  of the special k
6fe0: 65 79 77 6f 72 64 73 20 3c 62 3e 50 55 42 4c 49  eywords <b>PUBLI
6ff0: 43 3c 2f 62 3e 2c 20 3c 62 3e 50 52 4f 54 45 43  C</b>, <b>PROTEC
7000: 54 45 44 3c 2f 62 3e 2c 20 6f 72 20 0a 3c 62 3e  TED</b>, or .<b>
7010: 50 52 49 56 41 54 45 3c 2f 62 3e 20 28 69 6e 20  PRIVATE</b> (in 
7020: 75 70 70 65 72 2d 63 61 73 65 20 74 6f 20 64 69  upper-case to di
7030: 73 74 69 6e 67 75 69 73 68 20 74 68 65 6d 20 66  stinguish them f
7040: 72 6f 6d 20 74 68 65 20 72 65 67 75 6c 61 72 0a  rom the regular.
7050: 43 2b 2b 20 6b 65 79 77 6f 72 64 73 20 77 69 74  C++ keywords wit
7060: 68 20 74 68 65 20 73 61 6d 65 20 6d 65 61 6e 69  h the same meani
7070: 6e 67 29 20 74 68 65 6e 20 61 20 70 72 6f 74 6f  ng) then a proto
7080: 74 79 70 65 20 66 6f 72 20 74 68 61 74 0a 6d 65  type for that.me
7090: 74 68 6f 64 20 77 69 6c 6c 20 62 65 20 69 6e 73  thod will be ins
70a0: 65 72 74 65 64 20 69 6e 74 6f 20 74 68 65 20 63  erted into the c
70b0: 6c 61 73 73 20 64 65 66 69 6e 69 74 69 6f 6e 2e  lass definition.
70c0: 20 20 49 66 20 6e 6f 6e 65 20 6f 66 0a 74 68 65    If none of.the
70d0: 73 65 20 6b 65 79 77 6f 72 64 73 20 61 70 70 65  se keywords appe
70e0: 61 72 2c 20 74 68 65 6e 20 74 68 65 20 70 72 6f  ar, then the pro
70f0: 74 6f 74 79 70 65 20 69 73 20 6e 6f 74 20 69 6e  totype is not in
7100: 73 65 72 74 65 64 2e 20 20 46 6f 72 0a 65 78 61  serted.  For.exa
7110: 6d 70 6c 65 2c 20 69 6e 20 74 68 65 20 66 6f 6c  mple, in the fol
7120: 6c 6f 77 69 6e 67 20 63 6f 64 65 2c 20 74 68 65  lowing code, the
7130: 20 63 6f 6e 73 74 72 75 63 74 6f 72 20 69 73 20   constructor is 
7140: 6e 6f 74 20 65 78 70 6c 69 63 69 74 6c 79 0a 64  not explicitly.d
7150: 65 63 6c 61 72 65 64 20 69 6e 20 74 68 65 20 63  eclared in the c
7160: 6c 61 73 73 20 64 65 66 69 6e 69 74 69 6f 6e 20  lass definition 
7170: 62 75 74 20 6d 61 6b 65 68 65 61 64 65 72 73 20  but makeheaders 
7180: 77 69 6c 6c 20 61 64 64 20 69 74 20 74 68 65 72  will add it ther
7190: 65 0a 62 65 63 61 75 73 65 20 6f 66 20 74 68 65  e.because of the
71a0: 20 50 55 42 4c 49 43 20 6b 65 79 77 6f 72 64 20   PUBLIC keyword 
71b0: 74 68 61 74 20 61 70 70 65 61 72 73 20 62 65 66  that appears bef
71c0: 6f 72 65 20 74 68 65 20 63 6f 6e 73 74 72 75 63  ore the construc
71d0: 74 6f 72 0a 64 65 66 69 6e 69 74 69 6f 6e 2e 0a  tor.definition..
71e0: 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63 6b 71 75 6f 74  </p>..<blockquot
71f0: 65 3e 3c 70 72 65 3e 0a 23 69 66 20 49 4e 54 45  e><pre>.#if INTE
7200: 52 46 41 43 45 0a 63 6c 61 73 73 20 45 78 61 6d  RFACE.class Exam
7210: 70 6c 65 31 20 7b 0a 70 72 69 76 61 74 65 3a 0a  ple1 {.private:.
7220: 20 20 69 6e 74 20 76 31 3b 0a 7d 3b 0a 23 65 6e    int v1;.};.#en
7230: 64 69 66 0a 50 55 42 4c 49 43 20 45 78 61 6d 70  dif.PUBLIC Examp
7240: 6c 65 31 3a 3a 45 78 61 6d 70 6c 65 31 28 29 7b  le1::Example1(){
7250: 0a 20 20 76 31 20 3d 20 30 3b 0a 7d 0a 3c 2f 70  .  v1 = 0;.}.</p
7260: 72 65 3e 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e  re></blockquote>
7270: 0a 0a 3c 70 3e 0a 54 68 65 20 63 6f 64 65 20 61  ..<p>.The code a
7280: 62 6f 76 65 20 69 73 20 65 71 75 69 76 61 6c 65  bove is equivale
7290: 6e 74 20 74 6f 20 74 68 65 20 66 6f 6c 6c 6f 77  nt to the follow
72a0: 69 6e 67 3a 0a 3c 2f 70 3e 0a 0a 3c 62 6c 6f 63  ing:.</p>..<bloc
72b0: 6b 71 75 6f 74 65 3e 3c 70 72 65 3e 0a 23 69 66  kquote><pre>.#if
72c0: 20 49 4e 54 45 52 46 41 43 45 0a 63 6c 61 73 73   INTERFACE.class
72d0: 20 45 78 61 6d 70 6c 65 31 20 7b 0a 70 72 69 76   Example1 {.priv
72e0: 61 74 65 3a 0a 20 20 69 6e 74 20 76 31 3b 0a 70  ate:.  int v1;.p
72f0: 75 62 6c 69 63 3a 0a 20 20 45 78 61 6d 70 6c 65  ublic:.  Example
7300: 31 28 29 3b 0a 7d 3b 0a 23 65 6e 64 69 66 0a 45  1();.};.#endif.E
7310: 78 61 6d 70 6c 65 31 3a 3a 45 78 61 6d 70 6c 65  xample1::Example
7320: 31 28 29 7b 0a 20 20 76 31 20 3d 20 30 3b 0a 7d  1(){.  v1 = 0;.}
7330: 0a 3c 2f 70 72 65 3e 3c 2f 62 6c 6f 63 6b 71 75  .</pre></blockqu
7340: 6f 74 65 3e 0a 0a 3c 70 3e 0a 54 68 65 20 66 69  ote>..<p>.The fi
7350: 72 73 74 20 66 6f 72 6d 20 69 73 20 70 72 65 66  rst form is pref
7360: 65 72 72 65 64 20 62 65 63 61 75 73 65 20 6f 6e  erred because on
7370: 6c 79 20 61 20 73 69 6e 67 6c 65 20 64 65 63 6c  ly a single decl
7380: 61 72 61 74 69 6f 6e 20 6f 66 0a 74 68 65 20 63  aration of.the c
7390: 6f 6e 73 74 72 75 63 74 6f 72 20 69 73 20 72 65  onstructor is re
73a0: 71 75 69 72 65 64 2e 20 20 54 68 65 20 73 65 63  quired.  The sec
73b0: 6f 6e 64 20 66 6f 72 6d 20 72 65 71 75 69 72 65  ond form require
73c0: 73 20 74 77 6f 20 64 65 63 6c 61 72 61 74 69 6f  s two declaratio
73d0: 6e 73 2c 0a 6f 6e 65 20 69 6e 20 74 68 65 20 63  ns,.one in the c
73e0: 6c 61 73 73 20 64 65 66 69 6e 69 74 69 6f 6e 20  lass definition 
73f0: 61 6e 64 20 6f 6e 65 20 6f 6e 20 74 68 65 20 64  and one on the d
7400: 65 66 69 6e 74 69 6f 6e 20 6f 66 20 74 68 65 20  efintion of the 
7410: 63 6f 6e 73 74 72 75 63 74 6f 72 2e 0a 3c 2f 70  constructor..</p
7420: 3e 0a 0a 3c 68 34 3e 33 2e 36 2e 31 20 43 2b 2b  >..<h4>3.6.1 C++
7430: 20 4c 69 6d 69 74 61 74 69 6f 6e 73 3c 2f 68 34   Limitations</h4
7440: 3e 0a 0a 3c 70 3e 0a 4d 61 6b 65 68 65 61 64 65  >..<p>.Makeheade
7450: 72 73 20 64 6f 65 73 20 6e 6f 74 20 75 6e 64 65  rs does not unde
7460: 72 73 74 61 6e 64 20 6d 6f 72 65 20 72 65 63 65  rstand more rece
7470: 6e 74 0a 43 2b 2b 20 73 79 6e 74 61 78 20 73 75  nt.C++ syntax su
7480: 63 68 20 61 73 20 74 65 6d 70 6c 61 74 65 73 20  ch as templates 
7490: 61 6e 64 20 6e 61 6d 65 73 70 61 63 65 73 2e 0a  and namespaces..
74a0: 50 65 72 68 61 70 73 20 74 68 65 73 65 20 69 73  Perhaps these is
74b0: 73 75 65 64 20 77 69 6c 6c 20 62 65 20 61 64 64  sued will be add
74c0: 72 65 73 73 65 64 20 69 6e 20 66 75 74 75 72 65  ressed in future
74d0: 20 72 65 76 69 73 69 6f 6e 73 2e 0a 3c 2f 70 3e   revisions..</p>
74e0: 0a 0a 3c 61 20 6e 61 6d 65 3d 48 30 30 31 33 3e  ..<a name=H0013>
74f0: 0a 3c 68 33 3e 33 2e 37 20 43 6f 6e 64 69 74 69  .<h3>3.7 Conditi
7500: 6f 6e 61 6c 20 43 6f 6d 70 69 6c 61 74 69 6f 6e  onal Compilation
7510: 3c 2f 68 33 3e 0a 0a 3c 70 3e 0a 54 68 65 20 6d  </h3>..<p>.The m
7520: 61 6b 65 68 65 61 64 65 72 73 20 70 72 6f 67 72  akeheaders progr
7530: 61 6d 20 75 6e 64 65 72 73 74 61 6e 64 73 20 61  am understands a
7540: 6e 64 20 74 72 61 63 6b 73 20 74 68 65 20 63 6f  nd tracks the co
7550: 6e 64 69 74 69 6f 6e 61 6c 20 0a 63 6f 6d 70 69  nditional .compi
7560: 6c 61 74 69 6f 6e 20 63 6f 6e 73 74 72 75 63 74  lation construct
7570: 73 20 69 6e 20 74 68 65 20 73 6f 75 72 63 65 20  s in the source 
7580: 63 6f 64 65 20 66 69 6c 65 73 20 69 74 20 73 63  code files it sc
7590: 61 6e 73 2e 0a 48 65 6e 63 65 2c 20 69 66 20 74  ans..Hence, if t
75a0: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63 6f 64  he following cod
75b0: 65 20 61 70 70 65 61 72 73 20 69 6e 20 61 20 73  e appears in a s
75c0: 6f 75 72 63 65 20 66 69 6c 65 0a 3c 70 72 65 3e  ource file.<pre>
75d0: 0a 20 20 23 69 66 64 65 66 20 55 4e 49 58 0a 20  .  #ifdef UNIX. 
75e0: 20 23 20 20 64 65 66 69 6e 65 20 57 4f 52 4b 53   #  define WORKS
75f0: 5f 57 45 4c 4c 20 20 31 0a 20 20 23 65 6c 73 65  _WELL  1.  #else
7600: 0a 20 20 23 20 20 64 65 66 69 6e 65 20 57 4f 52  .  #  define WOR
7610: 4b 53 5f 57 45 4c 4c 20 20 30 0a 20 20 23 65 6e  KS_WELL  0.  #en
7620: 64 69 66 0a 3c 2f 70 72 65 3e 0a 74 68 65 6e 20  dif.</pre>.then 
7630: 74 68 65 20 6e 65 78 74 20 70 61 74 63 68 20 6f  the next patch o
7640: 66 20 63 6f 64 65 20 77 69 6c 6c 20 61 70 70 65  f code will appe
7650: 61 72 20 69 6e 20 74 68 65 20 67 65 6e 65 72 61  ar in the genera
7660: 74 65 64 20 68 65 61 64 65 72 20 66 6f 72 0a 65  ted header for.e
7670: 76 65 72 79 20 2e 63 20 66 69 6c 65 20 74 68 61  very .c file tha
7680: 74 20 75 73 65 73 20 74 68 65 20 57 4f 52 4b 53  t uses the WORKS
7690: 5f 57 45 4c 4c 20 63 6f 6e 73 74 61 6e 74 3a 0a  _WELL constant:.
76a0: 3c 70 72 65 3e 0a 20 20 23 69 66 20 64 65 66 69  <pre>.  #if defi
76b0: 6e 65 64 28 55 4e 49 58 29 0a 20 20 23 20 20 64  ned(UNIX).  #  d
76c0: 65 66 69 6e 65 20 57 4f 52 4b 53 5f 57 45 4c 4c  efine WORKS_WELL
76d0: 20 31 0a 20 20 23 65 6e 64 69 66 0a 20 20 23 69   1.  #endif.  #i
76e0: 66 20 21 64 65 66 69 6e 65 64 28 55 4e 49 58 29  f !defined(UNIX)
76f0: 0a 20 20 23 20 20 64 65 66 69 6e 65 20 57 4f 52  .  #  define WOR
7700: 4b 53 5f 57 45 4c 4c 20 30 0a 20 20 23 65 6e 64  KS_WELL 0.  #end
7710: 69 66 0a 3c 2f 70 72 65 3e 0a 54 68 65 20 63 6f  if.</pre>.The co
7720: 6e 64 69 74 69 6f 6e 61 6c 20 63 6f 6d 70 69 6c  nditional compil
7730: 61 74 69 6f 6e 20 63 6f 6e 73 74 72 75 63 74 73  ation constructs
7740: 20 63 61 6e 20 62 65 20 6e 65 73 74 65 64 20 74   can be nested t
7750: 6f 20 61 6e 79 20 64 65 70 74 68 2e 0a 4d 61 6b  o any depth..Mak
7760: 65 68 65 61 64 65 72 73 20 61 6c 73 6f 20 72 65  eheaders also re
7770: 63 6f 67 6e 69 7a 65 73 20 74 68 65 20 73 70 65  cognizes the spe
7780: 63 69 61 6c 20 63 61 73 65 20 6f 66 0a 3c 70 72  cial case of.<pr
7790: 65 3e 0a 20 20 23 69 66 20 30 0a 20 20 23 65 6e  e>.  #if 0.  #en
77a0: 64 69 66 0a 3c 2f 70 72 65 3e 0a 61 6e 64 20 74  dif.</pre>.and t
77b0: 72 65 61 74 73 20 74 68 65 20 65 6e 63 6c 6f 73  reats the enclos
77c0: 65 64 20 74 65 78 74 20 61 73 20 61 20 63 6f 6d  ed text as a com
77d0: 6d 65 6e 74 2e 0a 3c 2f 70 3e 0a 0a 3c 61 20 6e  ment..</p>..<a n
77e0: 61 6d 65 3d 48 30 30 31 34 3e 0a 3c 68 33 3e 33  ame=H0014>.<h3>3
77f0: 2e 38 20 43 61 76 65 61 74 73 3c 2f 68 33 3e 0a  .8 Caveats</h3>.
7800: 0a 3c 70 3e 0a 54 68 65 20 6d 61 6b 65 68 65 61  .<p>.The makehea
7810: 64 65 72 73 20 73 79 73 74 65 6d 20 69 73 20 64  ders system is d
7820: 65 73 69 67 6e 65 64 20 74 6f 20 62 65 20 72 6f  esigned to be ro
7830: 62 75 73 74 0a 62 75 74 20 69 74 20 69 73 20 70  bust.but it is p
7840: 6f 73 73 69 62 6c 65 20 66 6f 72 20 61 20 64 65  ossible for a de
7850: 76 69 6f 75 73 20 70 72 6f 67 72 61 6d 6d 65 72  vious programmer
7860: 20 74 6f 20 66 6f 6f 6c 20 74 68 65 20 73 79 73   to fool the sys
7870: 74 65 6d 2c 0a 75 73 75 61 6c 6c 79 20 77 69 74  tem,.usually wit
7880: 68 20 75 6e 68 65 6c 70 66 75 6c 20 63 6f 6e 73  h unhelpful cons
7890: 65 71 75 65 6e 63 65 73 2e 0a 54 68 69 73 20 73  equences..This s
78a0: 75 62 73 65 63 74 69 6f 6e 20 69 73 20 61 20 67  ubsection is a g
78b0: 75 69 64 65 20 74 6f 20 68 65 6c 70 69 6e 67 20  uide to helping 
78c0: 79 6f 75 20 61 76 6f 69 64 20 74 72 6f 75 62 6c  you avoid troubl
78d0: 65 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 4d 61 6b  e..</p>..<p>.Mak
78e0: 65 68 65 61 64 65 72 73 20 64 6f 65 73 20 6e 6f  eheaders does no
78f0: 74 20 75 6e 64 65 72 73 74 61 6e 64 20 74 68 65  t understand the
7900: 20 6f 6c 64 20 4b 26 61 6d 70 3b 52 20 73 74 79   old K&amp;R sty
7910: 6c 65 20 6f 66 20 66 75 6e 63 74 69 6f 6e 0a 61  le of function.a
7920: 6e 64 20 70 72 6f 63 65 64 75 72 65 20 64 65 66  nd procedure def
7930: 69 6e 69 74 69 6f 6e 73 2e 0a 49 74 20 6f 6e 6c  initions..It onl
7940: 79 20 75 6e 64 65 72 73 74 61 6e 64 73 20 74 68  y understands th
7950: 65 20 6d 6f 64 65 72 6e 20 41 4e 53 49 2d 43 20  e modern ANSI-C 
7960: 73 74 79 6c 65 2c 20 61 6e 64 20 77 69 6c 6c 20  style, and will 
7970: 70 72 6f 62 61 62 6c 79 0a 62 65 63 6f 6d 65 20  probably.become 
7980: 76 65 72 79 20 63 6f 6e 66 75 73 65 64 20 69 66  very confused if
7990: 20 69 74 20 65 6e 63 6f 75 6e 74 65 72 73 20 61   it encounters a
79a0: 6e 20 6f 6c 64 20 4b 26 61 6d 70 3b 52 20 66 75  n old K&amp;R fu
79b0: 6e 63 74 69 6f 6e 2e 0a 59 6f 75 20 73 68 6f 75  nction..You shou
79c0: 6c 64 20 74 61 6b 65 20 63 61 72 65 20 74 6f 20  ld take care to 
79d0: 61 76 6f 69 64 20 70 75 74 74 69 6e 67 20 4b 26  avoid putting K&
79e0: 61 6d 70 3b 52 20 66 75 6e 63 74 69 6f 6e 20 64  amp;R function d
79f0: 65 66 69 6e 74 69 6f 6e 73 0a 69 6e 20 79 6f 75  efintions.in you
7a00: 72 20 63 6f 64 65 2c 20 74 68 65 72 65 66 6f 72  r code, therefor
7a10: 65 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 4d 61 6b  e..</p>..<p>.Mak
7a20: 65 68 65 61 64 65 72 73 20 64 6f 65 73 20 6e 6f  eheaders does no
7a30: 74 20 75 6e 64 65 72 73 74 61 6e 64 20 77 68 65  t understand whe
7a40: 6e 20 79 6f 75 20 64 65 66 69 6e 65 20 6d 6f 72  n you define mor
7a50: 65 20 74 68 61 6e 20 6f 6e 65 0a 67 6c 6f 62 61  e than one.globa
7a60: 6c 20 76 61 72 69 61 62 6c 65 20 77 69 74 68 20  l variable with 
7a70: 74 68 65 20 73 61 6d 65 20 74 79 70 65 20 73 65  the same type se
7a80: 70 61 72 61 74 65 64 20 62 79 20 61 20 63 6f 6d  parated by a com
7a90: 6d 61 2e 0a 49 6e 20 6f 74 68 65 72 20 77 6f 72  ma..In other wor
7aa0: 64 73 2c 20 6d 61 6b 65 68 65 61 64 65 72 73 20  ds, makeheaders 
7ab0: 64 6f 65 73 20 6e 6f 74 20 75 6e 64 65 72 73 74  does not underst
7ac0: 61 6e 64 20 74 68 69 73 3a 0a 3c 70 72 65 3e 0a  and this:.<pre>.
7ad0: 20 20 20 69 6e 74 20 61 20 3d 20 34 2c 20 62 20     int a = 4, b 
7ae0: 3d 20 35 3b 0a 3c 2f 70 72 65 3e 0a 54 68 65 20  = 5;.</pre>.The 
7af0: 6d 61 6b 65 68 65 61 64 65 72 73 20 70 72 6f 67  makeheaders prog
7b00: 72 61 6d 20 77 61 6e 74 73 20 65 76 65 72 79 20  ram wants every 
7b10: 76 61 72 69 61 62 6c 65 20 74 6f 20 68 61 76 65  variable to have
7b20: 20 69 74 73 20 6f 77 6e 0a 64 65 66 69 6e 69 74   its own.definit
7b30: 69 6f 6e 2e 20 20 4c 69 6b 65 20 74 68 69 73 3a  ion.  Like this:
7b40: 0a 3c 70 72 65 3e 0a 20 20 20 69 6e 74 20 61 20  .<pre>.   int a 
7b50: 3d 20 34 3b 0a 20 20 20 69 6e 74 20 62 20 3d 20  = 4;.   int b = 
7b60: 35 3b 0a 3c 2f 70 72 65 3e 0a 4e 6f 74 69 63 65  5;.</pre>.Notice
7b70: 20 74 68 61 74 20 74 68 69 73 20 61 70 70 6c 69   that this appli
7b80: 65 73 20 74 6f 20 67 6c 6f 62 61 6c 20 76 61 72  es to global var
7b90: 69 61 62 6c 65 73 20 6f 6e 6c 79 2c 20 6e 6f 74  iables only, not
7ba0: 20 74 6f 20 76 61 72 69 61 62 6c 65 73 0a 79 6f   to variables.yo
7bb0: 75 20 64 65 63 6c 61 72 65 20 69 6e 73 69 64 65  u declare inside
7bc0: 20 79 6f 75 72 20 66 75 6e 63 74 69 6f 6e 73 2e   your functions.
7bd0: 0a 53 69 6e 63 65 20 67 6c 6f 62 61 6c 20 76 61  .Since global va
7be0: 72 69 61 62 6c 65 73 20 6f 75 67 68 74 20 74 6f  riables ought to
7bf0: 20 62 65 20 65 78 63 65 65 64 69 6e 67 6c 79 20   be exceedingly 
7c00: 72 61 72 65 2c 20 61 6e 64 20 73 69 6e 63 65 20  rare, and since 
7c10: 69 74 20 69 73 0a 67 6f 6f 64 20 73 74 79 6c 65  it is.good style
7c20: 20 74 6f 20 64 65 63 6c 61 72 65 20 74 68 65 6d   to declare them
7c30: 20 73 65 70 61 72 61 74 65 6c 79 20 61 6e 79 68   separately anyh
7c40: 6f 77 2c 20 74 68 69 73 20 72 65 73 74 72 69 63  ow, this restric
7c50: 74 69 6f 6e 20 69 73 0a 6e 6f 74 20 73 65 65 6e  tion is.not seen
7c60: 20 61 73 20 61 20 74 65 72 72 69 62 6c 65 20 68   as a terrible h
7c70: 61 72 64 73 68 69 70 2e 0a 3c 2f 70 3e 0a 0a 3c  ardship..</p>..<
7c80: 70 3e 0a 54 68 65 20 6d 61 6b 65 68 65 61 64 65  p>.The makeheade
7c90: 72 73 20 70 72 6f 67 72 61 6d 20 70 72 6f 63 65  rs program proce
7ca0: 73 73 65 73 20 69 74 73 20 73 6f 75 72 63 65 20  sses its source 
7cb0: 66 69 6c 65 20 70 72 69 6f 72 20 74 6f 20 73 65  file prior to se
7cc0: 6e 64 69 6e 67 0a 74 68 6f 73 65 20 66 69 6c 65  nding.those file
7cd0: 73 20 74 68 72 6f 75 67 68 20 74 68 65 20 43 20  s through the C 
7ce0: 70 72 65 70 72 6f 63 65 73 73 6f 72 2e 0a 48 65  preprocessor..He
7cf0: 6e 63 65 2c 20 69 66 20 79 6f 75 20 68 69 64 65  nce, if you hide
7d00: 20 69 6d 70 6f 72 74 61 6e 74 20 73 74 72 75 63   important struc
7d10: 74 75 72 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e  ture information
7d20: 20 69 6e 20 70 72 65 70 72 6f 63 65 73 73 6f 72   in preprocessor
7d30: 20 64 65 66 69 6e 65 73 2c 0a 6d 61 6b 65 68 65   defines,.makehe
7d40: 61 64 65 72 73 20 6d 69 67 68 74 20 6e 6f 74 20  aders might not 
7d50: 62 65 20 61 62 6c 65 20 74 6f 20 73 75 63 63 65  be able to succe
7d60: 73 73 66 75 6c 6c 79 20 65 78 74 72 61 63 74 20  ssfully extract 
7d70: 74 68 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 0a  the information.
7d80: 69 74 20 6e 65 65 64 73 20 66 72 6f 6d 20 76 61  it needs from va
7d90: 72 69 61 62 6c 65 73 2c 20 66 75 6e 63 74 69 6f  riables, functio
7da0: 6e 73 20 61 6e 64 20 70 72 6f 63 65 64 75 72 65  ns and procedure
7db0: 20 64 65 66 69 6e 69 74 69 6f 6e 73 2e 0a 46 6f   definitions..Fo
7dc0: 72 20 65 78 61 6d 70 6c 65 2c 20 69 66 20 79 6f  r example, if yo
7dd0: 75 20 77 72 69 74 65 20 74 68 69 73 3a 0a 3c 70  u write this:.<p
7de0: 72 65 3e 0a 20 20 23 64 65 66 69 6e 65 20 42 45  re>.  #define BE
7df0: 47 49 4e 20 7b 0a 20 20 23 64 65 66 69 6e 65 20  GIN {.  #define 
7e00: 45 4e 44 20 7d 0a 3c 2f 70 72 65 3e 0a 61 74 20  END }.</pre>.at 
7e10: 74 68 65 20 62 65 67 69 6e 6e 69 6e 67 20 6f 66  the beginning of
7e20: 20 79 6f 75 72 20 73 6f 75 72 63 65 20 66 69 6c   your source fil
7e30: 65 2c 20 61 6e 64 20 74 68 65 6e 20 74 72 79 20  e, and then try 
7e40: 74 6f 20 63 72 65 61 74 65 20 61 20 66 75 6e 63  to create a func
7e50: 74 69 6f 6e 0a 64 65 66 69 6e 69 74 69 6f 6e 20  tion.definition 
7e60: 6c 69 6b 65 20 74 68 69 73 3a 0a 3c 70 72 65 3e  like this:.<pre>
7e70: 0a 20 20 63 68 61 72 20 2a 53 74 72 44 75 70 28  .  char *StrDup(
7e80: 63 6f 6e 73 74 20 63 68 61 72 20 2a 7a 53 72 63  const char *zSrc
7e90: 29 0a 20 20 20 20 42 45 47 49 4e 0a 20 20 20 20  ).    BEGIN.    
7ea0: 20 20 2f 2a 20 43 6f 64 65 20 68 65 72 65 20 2a    /* Code here *
7eb0: 2f 0a 20 20 20 20 45 4e 44 0a 3c 2f 70 72 65 3e  /.    END.</pre>
7ec0: 0a 74 68 65 6e 20 6d 61 6b 65 68 65 61 64 65 72  .then makeheader
7ed0: 73 20 77 6f 6e 27 74 20 62 65 20 61 62 6c 65 20  s won't be able 
7ee0: 74 6f 20 66 69 6e 64 20 74 68 65 20 65 6e 64 20  to find the end 
7ef0: 6f 66 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20  of the function 
7f00: 64 65 66 69 6e 69 74 69 6f 6e 0a 61 6e 64 20 62  definition.and b
7f10: 61 64 20 74 68 69 6e 67 73 20 61 72 65 20 6c 69  ad things are li
7f20: 6b 65 6c 79 20 74 6f 20 68 61 70 70 65 6e 2e 0a  kely to happen..
7f30: 3c 2f 70 3e 0a 0a 3c 70 3e 0a 46 6f 72 20 6d 6f  </p>..<p>.For mo
7f40: 73 74 20 70 72 6f 6a 65 63 74 73 20 74 68 65 20  st projects the 
7f50: 63 6f 64 65 20 63 6f 6e 73 74 72 75 63 74 73 20  code constructs 
7f60: 74 68 61 74 20 6d 61 6b 65 68 65 61 64 65 72 73  that makeheaders
7f70: 20 63 61 6e 6e 6f 74 0a 68 61 6e 64 6c 65 20 61   cannot.handle a
7f80: 72 65 20 76 65 72 79 20 72 61 72 65 2e 0a 41 73  re very rare..As
7f90: 20 6c 6f 6e 67 20 61 73 20 79 6f 75 20 61 76 6f   long as you avo
7fa0: 69 64 20 65 78 63 65 73 73 69 76 65 20 63 6c 65  id excessive cle
7fb0: 76 65 72 6e 65 73 73 2c 20 6d 61 6b 65 68 65 61  verness, makehea
7fc0: 64 65 72 73 20 77 69 6c 6c 0a 70 72 6f 62 61 62  ders will.probab
7fd0: 6c 79 20 62 65 20 61 62 6c 65 20 74 6f 20 66 69  ly be able to fi
7fe0: 67 75 72 65 20 6f 75 74 20 77 68 61 74 20 79 6f  gure out what yo
7ff0: 75 20 77 61 6e 74 20 61 6e 64 20 77 69 6c 6c 20  u want and will 
8000: 64 6f 20 74 68 65 20 72 69 67 68 74 0a 74 68 69  do the right.thi
8010: 6e 67 2e 0a 3c 2f 70 3e 0a 0a 3c 61 20 6e 61 6d  ng..</p>..<a nam
8020: 65 3d 48 30 30 31 35 3e 0a 3c 68 32 3e 34 2e 30  e=H0015>.<h2>4.0
8030: 20 55 73 69 6e 67 20 4d 61 6b 65 68 65 61 64 65   Using Makeheade
8040: 72 73 20 54 6f 20 47 65 6e 65 72 61 74 65 20 44  rs To Generate D
8050: 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 3c 2f 68 32  ocumentation</h2
8060: 3e 0a 0a 3c 70 3e 0a 4d 61 6e 79 20 70 65 6f 70  >..<p>.Many peop
8070: 6c 65 20 68 61 76 65 20 6f 62 73 65 72 76 65 64  le have observed
8080: 20 74 68 65 20 61 64 76 61 6e 74 61 67 65 73 20   the advantages 
8090: 6f 66 20 67 65 6e 65 72 61 74 69 6e 67 20 70 72  of generating pr
80a0: 6f 67 72 61 6d 0a 64 6f 63 75 6d 65 6e 74 61 74  ogram.documentat
80b0: 69 6f 6e 20 64 69 72 65 63 74 6c 79 20 66 72 6f  ion directly fro
80c0: 6d 20 74 68 65 20 73 6f 75 72 63 65 20 63 6f 64  m the source cod
80d0: 65 3a 0a 3c 75 6c 3e 0a 3c 6c 69 3e 20 4c 65 73  e:.<ul>.<li> Les
80e0: 73 20 65 66 66 6f 72 74 20 69 73 20 69 6e 76 6f  s effort is invo
80f0: 6c 76 65 64 2e 20 20 49 74 20 69 73 20 65 61 73  lved.  It is eas
8100: 69 65 72 20 74 6f 20 77 72 69 74 65 20 61 20 70  ier to write a p
8110: 72 6f 67 72 61 6d 20 74 68 61 6e 0a 20 20 20 20  rogram than.    
8120: 20 69 74 20 69 73 20 74 6f 20 77 72 69 74 65 20   it is to write 
8130: 61 20 70 72 6f 67 72 61 6d 20 61 6e 64 20 61 20  a program and a 
8140: 64 6f 63 75 6d 65 6e 74 2e 0a 3c 6c 69 3e 20 54  document..<li> T
8150: 68 65 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e  he documentation
8160: 20 69 73 20 6d 6f 72 65 20 6c 69 6b 65 6c 79 20   is more likely 
8170: 74 6f 20 61 67 72 65 65 20 77 69 74 68 20 74 68  to agree with th
8180: 65 20 63 6f 64 65 2e 0a 20 20 20 20 20 57 68 65  e code..     Whe
8190: 6e 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20  n documentation 
81a0: 69 73 20 64 65 72 69 76 65 64 20 64 69 72 65 63  is derived direc
81b0: 74 6c 79 20 66 72 6f 6d 20 74 68 65 20 63 6f 64  tly from the cod
81c0: 65 2c 20 6f 72 20 69 73 0a 20 20 20 20 20 63 6f  e, or is.     co
81d0: 6e 74 61 69 6e 65 64 20 69 6e 20 63 6f 6d 6d 65  ntained in comme
81e0: 6e 74 73 20 69 6d 6d 65 64 69 61 74 65 6c 79 20  nts immediately 
81f0: 61 64 6a 61 63 65 6e 74 20 74 6f 20 74 68 65 20  adjacent to the 
8200: 63 6f 64 65 2c 20 69 74 20 69 73 20 6d 75 63 68  code, it is much
8210: 0a 20 20 20 20 20 6d 6f 72 65 20 6c 69 6b 65 6c  .     more likel
8220: 79 20 74 6f 20 62 65 20 63 6f 72 72 65 63 74 20  y to be correct 
8230: 74 68 61 6e 20 69 66 20 69 74 20 69 73 20 63 6f  than if it is co
8240: 6e 74 61 69 6e 65 64 20 69 6e 20 61 20 73 65 70  ntained in a sep
8250: 61 72 61 74 65 0a 20 20 20 20 20 75 6e 72 65 6c  arate.     unrel
8260: 61 74 65 64 20 66 69 6c 65 20 69 6e 20 61 20 64  ated file in a d
8270: 69 66 66 65 72 65 6e 74 20 70 61 72 74 20 6f 66  ifferent part of
8280: 20 74 68 65 20 73 6f 75 72 63 65 20 74 72 65 65   the source tree
8290: 2e 0a 3c 6c 69 3e 20 49 6e 66 6f 72 6d 61 74 69  ..<li> Informati
82a0: 6f 6e 20 69 73 20 6b 65 70 74 20 69 6e 20 6f 6e  on is kept in on
82b0: 6c 79 20 6f 6e 65 20 70 6c 61 63 65 2e 20 20 57  ly one place.  W
82c0: 68 65 6e 20 61 20 63 68 61 6e 67 65 20 6f 63 63  hen a change occ
82d0: 75 72 73 0a 20 20 20 20 20 69 6e 20 74 68 65 20  urs.     in the 
82e0: 63 6f 64 65 2c 20 69 74 20 69 73 20 6e 6f 74 20  code, it is not 
82f0: 6e 65 63 65 73 73 61 72 79 20 74 6f 20 6d 61 6b  necessary to mak
8300: 65 20 61 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e  e a correspondin
8310: 67 20 63 68 61 6e 67 65 0a 20 20 20 20 20 69 6e  g change.     in
8320: 20 61 20 73 65 70 61 72 61 74 65 20 64 6f 63 75   a separate docu
8330: 6d 65 6e 74 2e 20 20 4a 75 73 74 20 72 65 72 75  ment.  Just reru
8340: 6e 20 74 68 65 20 64 6f 63 75 6d 65 6e 74 61 74  n the documentat
8350: 69 6f 6e 20 67 65 6e 65 72 61 74 6f 72 2e 0a 3c  ion generator..<
8360: 2f 75 6c 3e 0a 54 68 65 20 6d 61 6b 65 68 65 61  /ul>.The makehea
8370: 64 65 72 73 20 70 72 6f 67 72 61 6d 20 64 6f 65  ders program doe
8380: 73 20 6e 6f 74 20 67 65 6e 65 72 61 74 65 20 70  s not generate p
8390: 72 6f 67 72 61 6d 20 64 6f 63 75 6d 65 6e 74 61  rogram documenta
83a0: 74 69 6f 6e 20 69 74 73 65 6c 66 2e 0a 42 75 74  tion itself..But
83b0: 20 79 6f 75 20 63 61 6e 20 75 73 65 20 6d 61 6b   you can use mak
83c0: 65 68 65 61 64 65 72 73 20 74 6f 20 70 61 72 73  eheaders to pars
83d0: 65 20 74 68 65 20 70 72 6f 67 72 61 6d 20 73 6f  e the program so
83e0: 75 72 63 65 20 63 6f 64 65 2c 20 65 78 74 72 61  urce code, extra
83f0: 63 74 0a 74 68 65 20 69 6e 66 6f 72 6d 61 74 69  ct.the informati
8400: 6f 6e 20 74 68 61 74 20 69 73 20 72 65 6c 61 76  on that is relav
8410: 61 6e 74 20 74 6f 20 74 68 65 20 64 6f 63 75 6d  ant to the docum
8420: 65 6e 74 61 74 69 6f 6e 20 61 6e 64 20 74 6f 20  entation and to 
8430: 70 61 73 73 20 74 68 69 73 0a 69 6e 66 6f 72 6d  pass this.inform
8440: 61 74 69 6f 6e 20 74 6f 20 61 6e 6f 74 68 65 72  ation to another
8450: 20 74 6f 6f 6c 20 74 6f 20 64 6f 20 74 68 65 20   tool to do the 
8460: 61 63 74 75 61 6c 20 64 6f 63 75 6d 65 6e 74 61  actual documenta
8470: 74 69 6f 6e 20 70 72 65 70 61 72 61 74 69 6f 6e  tion preparation
8480: 2e 0a 3c 2f 70 3e 0a 0a 3c 70 3e 0a 57 68 65 6e  ..</p>..<p>.When
8490: 20 6d 61 6b 65 68 65 61 64 65 72 73 20 69 73 20   makeheaders is 
84a0: 72 75 6e 20 77 69 74 68 20 74 68 65 20 60 60 2d  run with the ``-
84b0: 64 6f 63 27 27 20 6f 70 74 69 6f 6e 2c 20 69 74  doc'' option, it
84c0: 20 65 6d 69 74 73 0a 6e 6f 20 68 65 61 64 65 72   emits.no header
84d0: 20 66 69 6c 65 73 20 61 74 20 61 6c 6c 2e 0a 49   files at all..I
84e0: 6e 73 74 65 61 64 2c 20 69 74 20 64 6f 65 73 20  nstead, it does 
84f0: 61 20 63 6f 6d 70 6c 65 74 65 20 64 75 6d 70 20  a complete dump 
8500: 6f 66 20 69 74 73 20 69 6e 74 65 72 6e 61 6c 20  of its internal 
8510: 74 61 62 6c 65 73 20 74 6f 20 73 74 61 6e 64 61  tables to standa
8520: 72 64 0a 6f 75 74 70 75 74 73 20 69 6e 20 61 20  rd.outputs in a 
8530: 66 6f 72 6d 20 74 68 61 74 20 69 73 20 65 61 73  form that is eas
8540: 69 6c 79 20 70 61 72 73 65 64 2e 0a 54 68 69 73  ily parsed..This
8550: 20 6f 75 74 70 75 74 20 63 61 6e 20 74 68 65 6e   output can then
8560: 20 62 65 20 75 73 65 64 20 62 79 20 61 6e 6f 74   be used by anot
8570: 68 65 72 20 70 72 6f 67 72 61 6d 20 28 74 68 65  her program (the
8580: 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 0a   implementation.
8590: 6f 66 20 77 68 69 63 68 20 69 73 20 6c 65 66 74  of which is left
85a0: 20 61 73 20 61 6e 20 65 78 65 72 63 69 73 65 20   as an exercise 
85b0: 74 6f 20 74 68 65 20 72 65 61 64 65 72 29 20 74  to the reader) t
85c0: 68 61 74 20 77 69 6c 6c 20 75 73 65 20 74 68 65  hat will use the
85d0: 0a 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 74 6f 20  .information to 
85e0: 70 72 65 70 61 72 65 20 73 75 69 74 61 62 6c 65  prepare suitable
85f0: 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 2e 0a   documentation..
8600: 3c 2f 70 3e 0a 0a 3c 70 3e 0a 54 68 65 20 60 60  </p>..<p>.The ``
8610: 2d 64 6f 63 27 27 20 6f 70 74 69 6f 6e 20 63 61  -doc'' option ca
8620: 75 73 65 73 20 6d 61 6b 65 68 65 61 64 65 72 73  uses makeheaders
8630: 20 74 6f 20 70 72 69 6e 74 20 69 6e 66 6f 72 6d   to print inform
8640: 61 74 69 6f 6e 0a 74 6f 20 73 74 61 6e 64 61 72  ation.to standar
8650: 64 20 6f 75 74 70 75 74 20 61 62 6f 75 74 20 61  d output about a
8660: 6c 6c 20 6f 66 20 74 68 65 20 66 6f 6c 6c 6f 77  ll of the follow
8670: 69 6e 67 20 6f 62 6a 65 63 74 73 3a 0a 3c 75 6c  ing objects:.<ul
8680: 3e 0a 3c 6c 69 3e 20 43 2b 2b 20 43 6c 61 73 73  >.<li> C++ Class
8690: 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 0a 3c 6c   declarations.<l
86a0: 69 3e 20 53 74 72 75 63 74 75 72 65 20 61 6e 64  i> Structure and
86b0: 20 75 6e 69 6f 6e 20 64 65 63 6c 61 72 61 74 69   union declarati
86c0: 6f 6e 73 0a 3c 6c 69 3e 20 45 6e 75 6d 65 72 61  ons.<li> Enumera
86d0: 74 69 6f 6e 73 0a 3c 6c 69 3e 20 54 79 70 65 64  tions.<li> Typed
86e0: 65 66 73 0a 3c 6c 69 3e 20 50 72 6f 63 65 64 75  efs.<li> Procedu
86f0: 72 65 20 61 6e 64 20 66 75 6e 63 74 69 6f 6e 20  re and function 
8700: 64 65 66 69 6e 69 74 69 6f 6e 73 0a 3c 6c 69 3e  definitions.<li>
8710: 20 47 6c 6f 62 61 6c 20 76 61 72 69 61 62 6c 65   Global variable
8720: 73 0a 3c 6c 69 3e 20 50 72 65 70 72 6f 63 65 73  s.<li> Preproces
8730: 73 6f 72 20 6d 61 63 72 6f 73 20 28 65 78 3a 20  sor macros (ex: 
8740: 60 60 23 64 65 66 69 6e 65 27 27 29 0a 3c 2f 75  ``#define'').</u
8750: 6c 3e 0a 46 6f 72 20 65 61 63 68 20 6f 66 20 74  l>.For each of t
8760: 68 65 73 65 20 6f 62 6a 65 63 74 73 2c 20 74 68  hese objects, th
8770: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 69 6e 66 6f  e following info
8780: 72 6d 61 74 69 6f 6e 20 69 73 20 6f 75 74 70 75  rmation is outpu
8790: 74 3a 0a 3c 75 6c 3e 0a 3c 6c 69 3e 20 54 68 65  t:.<ul>.<li> The
87a0: 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 6f 62 6a   name of the obj
87b0: 65 63 74 2e 0a 3c 6c 69 3e 20 54 68 65 20 74 79  ect..<li> The ty
87c0: 70 65 20 6f 66 20 74 68 65 20 6f 62 6a 65 63 74  pe of the object
87d0: 2e 20 20 28 53 74 72 75 63 74 75 72 65 2c 20 74  .  (Structure, t
87e0: 79 70 65 64 65 66 2c 20 6d 61 63 72 6f 2c 20 65  ypedef, macro, e
87f0: 74 63 2e 29 0a 3c 6c 69 3e 20 46 6c 61 67 73 20  tc.).<li> Flags 
8800: 74 6f 20 69 6e 64 69 63 61 74 65 20 69 66 20 74  to indicate if t
8810: 68 65 20 64 65 63 6c 61 72 61 74 69 6f 6e 20 69  he declaration i
8820: 73 20 65 78 70 6f 72 74 65 64 20 28 63 6f 6e 74  s exported (cont
8830: 61 69 6e 65 64 20 77 69 74 68 69 6e 0a 20 20 20  ained within.   
8840: 20 20 61 6e 20 45 58 50 4f 52 54 5f 49 4e 54 45    an EXPORT_INTE
8850: 52 46 41 43 45 20 62 6c 6f 63 6b 29 20 6f 72 20  RFACE block) or 
8860: 6c 6f 63 61 6c 20 28 63 6f 6e 74 61 69 6e 65 64  local (contained
8870: 20 77 69 74 68 20 4c 4f 43 41 4c 5f 49 4e 54 45   with LOCAL_INTE
8880: 52 46 41 43 45 29 2e 0a 3c 6c 69 3e 20 41 20 66  RFACE)..<li> A f
8890: 6c 61 67 20 74 6f 20 69 6e 64 69 63 61 74 65 20  lag to indicate 
88a0: 69 66 20 74 68 65 20 6f 62 6a 65 63 74 20 69 73  if the object is
88b0: 20 64 65 63 6c 61 72 65 64 20 69 6e 20 61 20 43   declared in a C
88c0: 2b 2b 20 66 69 6c 65 2e 0a 3c 6c 69 3e 20 54 68  ++ file..<li> Th
88d0: 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 66 69  e name of the fi
88e0: 6c 65 20 69 6e 20 77 68 69 63 68 20 74 68 65 20  le in which the 
88f0: 6f 62 6a 65 63 74 20 77 61 73 20 64 65 63 6c 61  object was decla
8900: 72 65 64 2e 0a 3c 6c 69 3e 20 54 68 65 20 63 6f  red..<li> The co
8910: 6d 70 6c 65 74 65 20 74 65 78 74 20 6f 66 20 61  mplete text of a
8920: 6e 79 20 62 6c 6f 63 6b 20 63 6f 6d 6d 65 6e 74  ny block comment
8930: 20 74 68 61 74 20 70 72 65 63 65 65 64 73 20 74   that preceeds t
8940: 68 65 20 64 65 63 6c 61 72 61 74 69 6f 6e 73 2e  he declarations.
8950: 0a 3c 6c 69 3e 20 49 66 20 74 68 65 20 64 65 63  .<li> If the dec
8960: 6c 61 72 61 74 69 6f 6e 20 6f 63 63 75 72 72 65  laration occurre
8970: 64 20 69 6e 73 69 64 65 20 61 20 70 72 65 70 72  d inside a prepr
8980: 6f 63 65 73 73 6f 72 20 63 6f 6e 64 69 74 69 6f  ocessor conditio
8990: 6e 61 6c 0a 20 20 20 20 20 28 60 60 23 69 66 27  nal.     (``#if'
89a0: 27 29 20 74 68 65 6e 20 74 68 65 20 74 65 78 74  ') then the text
89b0: 20 6f 66 20 74 68 61 74 20 63 6f 6e 64 69 74 69   of that conditi
89c0: 6f 6e 61 6c 20 69 73 20 70 72 6f 76 69 64 65 64  onal is provided
89d0: 2e 0a 3c 6c 69 3e 20 54 68 65 20 63 6f 6d 70 6c  ..<li> The compl
89e0: 65 74 65 20 74 65 78 74 20 6f 66 20 61 20 64 65  ete text of a de
89f0: 63 6c 61 72 61 74 69 6f 6e 20 66 6f 72 20 74 68  claration for th
8a00: 65 20 6f 62 6a 65 63 74 2e 0a 3c 2f 75 6c 3e 0a  e object..</ul>.
8a10: 54 68 65 20 65 78 61 63 74 20 6f 75 74 70 75 74  The exact output
8a20: 20 66 6f 72 6d 61 74 20 77 69 6c 6c 20 6e 6f 74   format will not
8a30: 20 62 65 20 64 65 73 63 72 69 62 65 64 20 68 65   be described he
8a40: 72 65 2e 0a 49 74 20 69 73 20 73 69 6d 70 6c 65  re..It is simple
8a50: 20 74 6f 20 75 6e 64 65 72 73 74 61 6e 64 20 61   to understand a
8a60: 6e 64 20 70 61 72 73 65 20 61 6e 64 20 73 68 6f  nd parse and sho
8a70: 75 6c 64 20 62 65 20 6f 62 76 69 6f 75 73 20 74  uld be obvious t
8a80: 6f 0a 61 6e 79 6f 6e 65 20 77 68 6f 20 69 6e 73  o.anyone who ins
8a90: 70 65 63 74 73 20 73 6f 6d 65 20 73 61 6d 70 6c  pects some sampl
8aa0: 65 20 6f 75 74 70 75 74 2e 0a 3c 2f 70 3e 0a 0a  e output..</p>..
8ab0: 3c 61 20 6e 61 6d 65 3d 48 30 30 31 36 3e 0a 3c  <a name=H0016>.<
8ac0: 68 32 3e 35 2e 30 20 43 6f 6d 70 69 6c 69 6e 67  h2>5.0 Compiling
8ad0: 20 54 68 65 20 4d 61 6b 65 68 65 61 64 65 72 73   The Makeheaders
8ae0: 20 50 72 6f 67 72 61 6d 3c 2f 68 32 3e 0a 0a 3c   Program</h2>..<
8af0: 70 3e 0a 54 68 65 20 73 6f 75 72 63 65 20 63 6f  p>.The source co
8b00: 64 65 20 66 6f 72 20 6d 61 6b 65 68 65 61 64 65  de for makeheade
8b10: 72 73 20 69 73 20 61 20 73 69 6e 67 6c 65 20 66  rs is a single f
8b20: 69 6c 65 20 6f 66 20 41 4e 53 49 2d 43 20 63 6f  ile of ANSI-C co
8b30: 64 65 2c 0a 6c 65 73 73 20 74 68 61 6e 20 33 30  de,.less than 30
8b40: 30 30 20 6c 69 6e 65 73 20 69 6e 20 6c 65 6e 67  00 lines in leng
8b50: 74 68 2e 0a 54 68 65 20 70 72 6f 67 72 61 6d 20  th..The program 
8b60: 6d 61 6b 65 73 20 6f 6e 6c 79 20 6d 6f 64 65 73  makes only modes
8b70: 74 20 64 65 6d 61 6e 64 73 20 6f 66 20 74 68 65  t demands of the
8b80: 20 73 79 73 74 65 6d 20 61 6e 64 20 43 20 6c 69   system and C li
8b90: 62 72 61 72 79 0a 61 6e 64 20 73 68 6f 75 6c 64  brary.and should
8ba0: 20 63 6f 6d 70 69 6c 65 20 77 69 74 68 6f 75 74   compile without
8bb0: 20 61 6c 74 65 72 61 74 69 6f 6e 20 6f 6e 20 6d   alteration on m
8bc0: 6f 73 74 20 41 4e 53 49 20 43 20 63 6f 6d 70 69  ost ANSI C compi
8bd0: 6c 65 72 73 0a 61 6e 64 20 6f 6e 20 6d 6f 73 74  lers.and on most
8be0: 20 6f 70 65 72 61 74 69 6e 67 20 73 79 73 74 65   operating syste
8bf0: 6d 73 2e 0a 49 74 20 69 73 20 6b 6e 6f 77 6e 20  ms..It is known 
8c00: 74 6f 20 63 6f 6d 70 69 6c 65 20 75 73 69 6e 67  to compile using
8c10: 20 73 65 76 65 72 61 6c 20 76 61 72 69 61 74 69   several variati
8c20: 6f 6e 73 20 6f 66 20 47 43 43 20 66 6f 72 20 55  ons of GCC for U
8c30: 6e 69 78 0a 61 73 20 77 65 6c 6c 20 61 73 20 43  nix.as well as C
8c40: 79 67 77 69 6e 33 32 20 61 6e 64 20 4d 53 56 43  ygwin32 and MSVC
8c50: 20 35 2e 30 20 66 6f 72 20 57 69 6e 33 32 2e 0a   5.0 for Win32..
8c60: 3c 2f 70 3e 0a 0a 3c 61 20 6e 61 6d 65 3d 48 30  </p>..<a name=H0
8c70: 30 31 37 3e 0a 3c 68 32 3e 36 2e 30 20 53 75 6d  017>.<h2>6.0 Sum
8c80: 6d 61 72 79 20 41 6e 64 20 43 6f 6e 63 6c 75 73  mary And Conclus
8c90: 69 6f 6e 3c 2f 68 32 3e 0a 0a 3c 70 3e 0a 54 68  ion</h2>..<p>.Th
8ca0: 65 20 6d 61 6b 65 68 65 61 64 65 72 73 20 70 72  e makeheaders pr
8cb0: 6f 67 72 61 6d 20 77 69 6c 6c 20 61 75 74 6f 6d  ogram will autom
8cc0: 61 74 69 63 61 6c 6c 79 20 67 65 6e 65 72 61 74  atically generat
8cd0: 65 20 61 20 6d 69 6e 69 6d 61 6c 20 68 65 61 64  e a minimal head
8ce0: 65 72 20 66 69 6c 65 20 0a 66 6f 72 20 65 61 63  er file .for eac
8cf0: 68 20 6f 66 20 61 20 73 65 74 20 6f 66 20 43 20  h of a set of C 
8d00: 73 6f 75 72 63 65 20 61 6e 64 20 68 65 61 64 65  source and heade
8d10: 72 20 66 69 6c 65 73 2c 20 61 6e 64 20 77 69 6c  r files, and wil
8d20: 6c 0a 67 65 6e 65 72 61 74 65 20 61 20 63 6f 6d  l.generate a com
8d30: 70 6f 73 69 74 65 20 68 65 61 64 65 72 20 66 69  posite header fi
8d40: 6c 65 20 66 6f 72 20 74 68 65 20 65 6e 74 69 72  le for the entir
8d50: 65 20 73 6f 75 72 63 65 20 66 69 6c 65 20 73 75  e source file su
8d60: 69 74 65 2c 0a 66 6f 72 20 65 69 74 68 65 72 20  ite,.for either 
8d70: 69 6e 74 65 72 6e 61 6c 20 6f 72 20 65 78 74 65  internal or exte
8d80: 72 6e 61 6c 20 75 73 65 2e 0a 49 74 20 63 61 6e  rnal use..It can
8d90: 20 61 6c 73 6f 20 62 65 20 75 73 65 64 20 61 73   also be used as
8da0: 20 74 68 65 20 70 61 72 73 65 72 20 69 6e 20 61   the parser in a
8db0: 6e 20 61 75 74 6f 6d 61 74 65 64 20 70 72 6f 67  n automated prog
8dc0: 72 61 6d 0a 64 6f 63 75 6d 65 6e 74 61 74 69 6f  ram.documentatio
8dd0: 6e 20 73 79 73 74 65 6d 2e 0a 3c 2f 70 3e 0a 0a  n system..</p>..
8de0: 3c 70 3e 0a 54 68 65 20 6d 61 6b 65 68 65 61 64  <p>.The makehead
8df0: 65 72 73 20 70 72 6f 67 72 61 6d 20 68 61 73 20  ers program has 
8e00: 62 65 65 6e 20 69 6e 20 75 73 65 20 73 69 6e 63  been in use sinc
8e10: 65 20 31 39 39 34 2c 0a 69 6e 20 61 20 77 69 64  e 1994,.in a wid
8e20: 65 20 76 61 72 69 65 74 79 20 6f 66 20 70 72 6f  e variety of pro
8e30: 6a 65 63 74 73 20 75 6e 64 65 72 20 62 6f 74 68  jects under both
8e40: 20 55 4e 49 58 20 61 6e 64 20 57 69 6e 33 32 2e   UNIX and Win32.
8e50: 0a 49 6e 20 65 76 65 72 79 20 70 72 6f 6a 65 63  .In every projec
8e60: 74 20 77 68 65 72 65 20 69 74 20 68 61 73 20 62  t where it has b
8e70: 65 65 6e 20 75 73 65 64 2c 20 6d 61 6b 65 68 65  een used, makehe
8e80: 61 64 65 72 73 20 68 61 73 20 70 72 6f 76 65 6e  aders has proven
8e90: 0a 74 6f 20 62 65 20 61 20 76 65 72 79 20 68 65  .to be a very he
8ea0: 6c 70 66 75 6c 20 61 69 64 0a 69 6e 20 74 68 65  lpful aid.in the
8eb0: 20 63 6f 6e 73 74 72 75 63 74 69 6f 6e 20 61 6e   construction an
8ec0: 64 20 6d 61 69 6e 74 65 6e 61 6e 63 65 20 6f 66  d maintenance of
8ed0: 20 6c 61 72 67 65 20 43 20 63 6f 64 65 73 2e 0a   large C codes..
8ee0: 49 6e 20 61 74 20 6c 65 61 73 74 20 74 77 6f 20  In at least two 
8ef0: 63 61 73 65 73 2c 20 6d 61 6b 65 68 65 61 64 65  cases, makeheade
8f00: 72 73 20 68 61 73 20 66 61 63 69 6c 69 74 61 74  rs has facilitat
8f10: 65 64 20 64 65 76 65 6c 6f 70 6d 65 6e 74 0a 6f  ed development.o
8f20: 66 20 70 72 6f 67 72 61 6d 73 20 74 68 61 74 20  f programs that 
8f30: 77 6f 75 6c 64 20 68 61 76 65 20 6f 74 68 65 72  would have other
8f40: 77 69 73 65 20 62 65 65 6e 20 61 6c 6c 20 62 75  wise been all bu
8f50: 74 20 69 6d 70 6f 73 73 69 62 6c 65 0a 64 75 65  t impossible.due
8f60: 20 74 6f 20 74 68 65 69 72 20 73 69 7a 65 20 61   to their size a
8f70: 6e 64 20 63 6f 6d 70 6c 65 78 69 74 79 2e 0a 3c  nd complexity..<
8f80: 2f 70 3e 0a 3c 2f 62 6f 64 79 3e 0a              /p>.</body>.