%!PS %%Version: 3.3.2 %%DocumentFonts: (atend) %%Pages: (atend) %%EndComments % % Version 3.3.2 prologue for troff files. % /#copies 1 store /aspectratio 1 def /formsperpage 1 def /landscape false def /linewidth .3 def /magnification 1 def /margin 0 def /orientation 0 def /resolution 720 def /rotation 1 def /xoffset 0 def /yoffset 0 def /roundpage true def /useclippath true def /pagebbox [0 0 612 792] def /R /Times-Roman def /I /Times-Italic def /B /Times-Bold def /BI /Times-BoldItalic def /H /Helvetica def /HI /Helvetica-Oblique def /HB /Helvetica-Bold def /HX /Helvetica-BoldOblique def /CW /Courier def /CO /Courier def /CI /Courier-Oblique def /CB /Courier-Bold def /CX /Courier-BoldOblique def /PA /Palatino-Roman def /PI /Palatino-Italic def /PB /Palatino-Bold def /PX /Palatino-BoldItalic def /Hr /Helvetica-Narrow def /Hi /Helvetica-Narrow-Oblique def /Hb /Helvetica-Narrow-Bold def /Hx /Helvetica-Narrow-BoldOblique def /KR /Bookman-Light def /KI /Bookman-LightItalic def /KB /Bookman-Demi def /KX /Bookman-DemiItalic def /AR /AvantGarde-Book def /AI /AvantGarde-BookOblique def /AB /AvantGarde-Demi def /AX /AvantGarde-DemiOblique def /NR /NewCenturySchlbk-Roman def /NI /NewCenturySchlbk-Italic def /NB /NewCenturySchlbk-Bold def /NX /NewCenturySchlbk-BoldItalic def /ZD /ZapfDingbats def /ZI /ZapfChancery-MediumItalic def /S /S def /S1 /S1 def /GR /Symbol def /inch {72 mul} bind def /min {2 copy gt {exch} if pop} bind def /show {show} bind def % so later references don't bind /widthshow {widthshow} bind def /stringwidth {stringwidth} bind def /setup { counttomark 2 idiv {def} repeat pop landscape {/orientation 90 orientation add def} if /scaling 72 resolution div def linewidth setlinewidth 1 setlinecap pagedimensions xcenter ycenter translate orientation rotation mul rotate width 2 div neg height 2 div translate xoffset inch yoffset inch neg translate margin 2 div dup neg translate magnification dup aspectratio mul scale scaling scaling scale addmetrics 0 0 moveto } def /pagedimensions { useclippath userdict /gotpagebbox known not and { /pagebbox [clippath pathbbox newpath] def roundpage currentdict /roundpagebbox known and {roundpagebbox} if } if pagebbox aload pop 4 -1 roll exch 4 1 roll 4 copy landscape {4 2 roll} if sub /width exch def sub /height exch def add 2 div /xcenter exch def add 2 div /ycenter exch def userdict /gotpagebbox true put } def /addmetrics { /Symbol /S null Sdefs cf /Times-Roman /S1 StandardEncoding dup length array copy S1defs cf } def /pagesetup { /page exch def currentdict /pagedict known currentdict page known and { page load pagedict exch get cvx exec } if } def /decodingdefs [ {counttomark 2 idiv {y moveto show} repeat} {neg /y exch def counttomark 2 idiv {y moveto show} repeat} {neg moveto {2 index stringwidth pop sub exch div 0 32 4 -1 roll widthshow} repeat} {neg moveto {spacewidth sub 0.0 32 4 -1 roll widthshow} repeat} {counttomark 2 idiv {y moveto show} repeat} {neg setfunnytext} ] def /setdecoding {/t decodingdefs 3 -1 roll get bind def} bind def /w {neg moveto show} bind def /m {neg dup /y exch def moveto} bind def /done {/lastpage where {pop lastpage} if} def /f { dup /font exch def findfont exch dup /ptsize exch def scaling div dup /size exch def scalefont setfont linewidth ptsize mul scaling 10 mul div setlinewidth /spacewidth ( ) stringwidth pop def } bind def /changefont { /fontheight exch def /fontslant exch def currentfont [ 1 0 fontheight ptsize div fontslant sin mul fontslant cos div fontheight ptsize div 0 0 ] makefont setfont } bind def /sf {f} bind def /cf { dup length 2 idiv /entries exch def /chtab exch def /newencoding exch def /newfont exch def findfont dup length 1 add dict /newdict exch def {1 index /FID ne {newdict 3 1 roll put}{pop pop} ifelse} forall newencoding type /arraytype eq {newdict /Encoding newencoding put} if newdict /Metrics entries dict put newdict /Metrics get begin chtab aload pop 1 1 entries {pop def} for newfont newdict definefont pop end } bind def % % A few arrays used to adjust reference points and character widths in some % of the printer resident fonts. If square roots are too high try changing % the lines describing /radical and /radicalex to, % % /radical [0 -75 550 0] % /radicalex [-50 -75 500 0] % % Move braceleftbt a bit - default PostScript character is off a bit. % /Sdefs [ /bracketlefttp [201 500] /bracketleftbt [201 500] /bracketrighttp [-81 380] /bracketrightbt [-83 380] /braceleftbt [203 490] /bracketrightex [220 -125 500 0] /radical [0 0 550 0] /radicalex [-50 0 500 0] /parenleftex [-20 -170 0 0] /integral [100 -50 500 0] /infinity [10 -75 730 0] ] def /S1defs [ /underscore [0 80 500 0] /endash [7 90 650 0] ] def % % Tries to round clipping path dimensions, as stored in array pagebbox, so they % match one of the known sizes in the papersizes array. Lower left coordinates % are always set to 0. % /roundpagebbox { 7 dict begin /papersizes [8.5 inch 11 inch 14 inch 17 inch] def /mappapersize { /val exch def /slop .5 inch def /diff slop def /j 0 def 0 1 papersizes length 1 sub { /i exch def papersizes i get val sub abs dup diff le {/diff exch def /j i def} {pop} ifelse } for diff slop lt {papersizes j get} {val} ifelse } def pagebbox 0 0 put pagebbox 1 0 put pagebbox dup 2 get mappapersize 2 exch put pagebbox dup 3 get mappapersize 3 exch put end } bind def %%EndProlog %%BeginSetup mark /linewidth 0.5 def /#copies 1 store /landscape false def /resolution 720 def % % Encoding vector and redefinition of findfont for the ISO Latin1 standard. % The 18 characters missing from ROM based fonts on older printers are noted % below. % /ISOLatin1Encoding [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /minus /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /space /exclamdown /cent /sterling /currency /yen /brokenbar % missing /section /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree % missing /plusminus % missing /twosuperior % missing /threesuperior % missing /acute /mu % missing /paragraph /periodcentered /cedilla /onesuperior % missing /ordmasculine /guillemotright /onequarter % missing /onehalf % missing /threequarters % missing /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth % missing /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply % missing /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute % missing /Thorn % missing /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis /eth % missing /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide % missing /oslash /ugrave /uacute /ucircumflex /udieresis /yacute % missing /thorn % missing /ydieresis ] def /NewFontDirectory FontDirectory maxlength dict def % % Apparently no guarantee findfont is defined in systemdict so the obvious % % systemdict /findfont get exec % % can generate an error. So far the only exception is a VT600 (version 48.0). % userdict /@RealFindfont known not { userdict begin /@RealFindfont systemdict begin /findfont load end def end } if /findfont { dup NewFontDirectory exch known not { dup %dup systemdict /findfont get exec % not always in systemdict dup userdict /@RealFindfont get exec dup /Encoding get StandardEncoding eq { dup length dict begin {1 index /FID ne {def}{pop pop} ifelse} forall /Encoding ISOLatin1Encoding def currentdict end /DummyFontName exch definefont } if NewFontDirectory 3 1 roll put } if NewFontDirectory exch get } bind def setup 2 setdecoding %%EndSetup %%Page: 1 1 /saveobj save def mark 1 pagesetup 12 B f (How to Use the Plan 9 C Compiler)7 1763 1 1998 1220 t 10 I f (Rob Pike)1 363 1 2698 1480 t 10 B f (Introduction)720 2140 w 10 R f ( piece of software written)4 1043(The C compiler on Plan 9 is a wholly new program; in fact it was the first)16 3027 2 970 2296 t ( familiar with existing C compilers)5 1402( Programmers)1 589( would eventually become Plan 9 from Bell Labs.)8 1992(for what)1 337 4 720 2416 t ( Plan 9 compiler accepts and in how the compiler)9 1999(will find a number of differences in both the language the)10 2321 2 720 2536 t (is used.)1 300 1 720 2656 t ( one for each architecture)4 1080(The compiler is really a set of compilers,)7 1748 2 970 2812 t 10 S1 f (\320)3840 2812 w 10 R f (MIPS, SPARC, Motorola)2 1058 1 3982 2812 t (68020, Intel 386, etc.)3 876 1 720 2932 t 10 S1 f (\320)1630 2932 w 10 R f (that accept a dialect of ANSI C and efficiently produce fairly good code for the)14 3276 1 1764 2932 t ( the compiler that accepts strict ANSI C for a POSIX environment,)11 2707( is a packaging of)4 712( There)1 284(target machine.)1 617 4 720 3052 t ( focuses on the native Plan 9 environment, that in which all the system source and)15 3289(but this document instead)3 1031 2 720 3172 t (almost all the utilities are written.)5 1344 1 720 3292 t 10 B f (Source)720 3532 w 10 R f ( extensions, a)2 543(The language accepted by the compilers is the core ANSI C language with some modest)14 3527 2 970 3688 t ( smaller library that includes system calls and related facilities, and a com\255)12 2981(greatly simplified preprocessor, a)3 1339 2 720 3808 t (pletely different structure for include files.)5 1696 1 720 3928 t ( 9 compilers are)3 661(Official ANSI C accepts the old \(K&R\) style of declarations for functions; the Plan)13 3409 2 970 4084 t ( run\255time flag \()3 616( an explicit)2 452( Without)1 382(more demanding.)1 703 4 720 4204 t 10 CW f (\255B)2873 4204 w 10 R f (\) whose use is discouraged, the compilers insist on)8 2047 1 2993 4204 t ( function declarations in the)4 1123( The)1 207(new\255style function declarations, that is, prototypes for function arguments.)8 2990 3 720 4324 t ( C pro\255)2 303( For)1 199( compile time.)2 595(libraries' include files are all in the new style so the interfaces are checked at)14 3223 4 720 4444 t ( to function prototypes the clumsy syntax may seem repellent but the)11 2811(grammers who have not yet switched)5 1509 2 720 4564 t ( to import existing software to Plan 9 are urged to)10 2017( who wish)2 419( Those)1 298(payoff in stronger typing is substantial.)5 1586 4 720 4684 t (use the opportunity to update their code.)6 1612 1 720 4804 t (The compilers include an integrated preprocessor that accepts the familiar)9 2951 1 970 4960 t 10 CW f (#include)3947 4960 w 10 R f (,)4427 4960 w 10 CW f (#define)4478 4960 w 10 R f (for)4924 4960 w ( without arguments,)2 817(macros both with and)3 896 2 720 5080 t 10 CW f (#undef)2468 5080 w 10 R f (,)2828 5080 w 10 CW f (#line)2888 5080 w 10 R f (,)3188 5080 w 10 CW f (#ifdef)3248 5080 w 10 R f (,)3608 5080 w 10 CW f (#ifndef)3668 5080 w 10 R f (, and)1 204 1 4088 5080 t 10 CW f (#endif)4327 5080 w 10 R f ( sup\255)1 207(. It)1 146 2 4687 5080 t (ports neither)1 503 1 720 5200 t 10 CW f (#if)1249 5200 w 10 R f (nor)1455 5200 w 10 CW f (##)1614 5200 w 10 R f (and honors a single)3 777 1 1760 5200 t 10 CW f (#pragma)2563 5200 w 10 R f (. The)1 231 1 2983 5200 t 10 CW f (#if)3240 5200 w 10 R f (directive was omitted because it greatly)5 1593 1 3447 5200 t ( compilation in general)3 927( Conditional)1 524(complicates the preprocessor, is never necessary, and is usually abused.)9 2869 3 720 5320 t ( the compilers)2 602( because)1 357( Also,)1 281(makes code hard to understand; the Plan 9 source uses it very sparingly.)12 3080 4 720 5440 t ( regular)1 314(remove dead code,)2 766 2 720 5560 t 10 CW f (if)1832 5560 w 10 R f (statements with constant conditions are more readable equivalents to many)9 3056 1 1984 5560 t 10 CW f (#ifs)720 5680 w 10 R f ( compile imported code ineluctably fouled by)6 1886(. To)1 197 2 960 5680 t 10 CW f (#if)3079 5680 w 10 R f (there is a separate command,)4 1203 1 3295 5680 t 10 CW f (/bin/cpp)4535 5680 w 10 R f (,)5015 5680 w (that implements the complete ANSI C preprocessor specification.)7 2624 1 720 5800 t ( machine\255)1 421( The)1 230(Include files fall into two groups: machine\255dependent and machine\255independent.)8 3419 3 970 5956 t ( directory)1 387(independent files occupy the)3 1154 2 720 6076 t 10 CW f (/sys/include)2288 6076 w 10 R f (; the others are placed in a directory appropriate to)9 2032 1 3008 6076 t (the machine, such as)3 874 1 720 6196 t 10 CW f (/mips/include)1635 6196 w 10 R f ( first in the machine\255)4 900( compiler searches for include files)5 1479(. The)1 246 3 2415 6196 t ( the time of writing there are eigh\255)7 1414( At)1 156( in the machine\255independent directory.)4 1568(dependent directory and then)3 1182 4 720 6316 t ( files and three \(per machine\) machine\255dependent ones:)7 2360(teen machine\255independent include)2 1409 2 720 6436 t 10 CW f ()4535 6436 w 10 R f (,)5015 6436 w 10 CW f ()720 6556 w 10 R f (, and)1 200 1 1320 6556 t 10 CW f ()1551 6556 w 10 R f ( the system stack, for use by the)7 1311( first describes the layout of registers on)7 1642(. The)1 236 3 1851 6556 t ( third defines)2 531( The)1 207( functions.)1 424(debugger; the second, as in ANSI C, defines a portable way to declare variadic)13 3158 4 720 6676 t (some architecture\255dependent types such as)4 1741 1 720 6796 t 10 CW f (jmp_buf)2496 6796 w 10 R f (for)2951 6796 w 10 CW f (setjmp)3102 6796 w 10 R f (and also a set of)4 679 1 3497 6796 t 10 CW f (typedef)4210 6796 w 10 R f (abbrevia\255)4664 6796 w (tions for)1 336 1 720 6916 t 10 CW f (unsigned short)1 805 1 1081 6916 t 10 R f (and so on.)2 408 1 1911 6916 t (Here is an excerpt from)4 941 1 970 7072 t 10 CW f (/68020/include/u.h)1936 7072 w 10 R f (:)3016 7072 w cleartomark showpage saveobj restore %%EndPage: 1 1 %%Page: 2 2 /saveobj save def mark 2 pagesetup 10 R f (\255 2 \255)2 166 1 2797 480 t 9 CW f ( ushort;)1 486(typedef unsigned short)2 1188 2 1008 830 t ( uchar;)1 486(typedef unsigned char)2 1134 2 1008 940 t ( ulong;)1 486(typedef unsigned long)2 1134 2 1008 1050 t ( uint;)1 486(typedef unsigned int)2 1080 2 1008 1160 t ( schar;)1 486( char)1 270(typedef signed)1 864 3 1008 1270 t ( vlong;)1 972(typedef long)1 648 2 1008 1380 t ( jmp_buf[2];)1 810(typedef long)1 648 2 1008 1600 t ( 0)1 486(#define JMPBUFSP)1 864 2 1008 1710 t ( 1)1 486(#define JMPBUFPC)1 864 2 1008 1820 t ( 0)1 432(#define JMPBUFDPC)1 918 2 1008 1930 t 10 R f (The type)1 371 1 720 2110 t 10 CW f (vlong)1135 2110 w 10 R f ( The)1 225( it is a 64\255bit value.)5 872(is the largest integer type available; on some architectures)8 2464 3 1479 2110 t 10 CW f (#define)720 2230 w 10 R f ( of)1 142(constants permit an architecture\255independent \(but compiler\255dependent\) implementation)6 3698 2 1200 2230 t (stack\255switching using)1 869 1 720 2350 t 10 CW f (setjmp)1614 2350 w 10 R f (and)1999 2350 w 10 CW f (longjmp)2168 2350 w 10 R f (.)2588 2350 w (Every Plan 9 C program begins)5 1257 1 970 2506 t 9 CW f (#include )1 756 1 1008 2676 t 10 R f (because all the other installed header files use the)8 1973 1 720 2856 t 10 CW f (typedefs)2718 2856 w 10 R f (declared in)1 440 1 3223 2856 t 10 CW f ()3688 2856 w 10 R f (.)3988 2856 w ( to collect related functions in a single file: one for string)11 2338(In strict ANSI C, include files are grouped)7 1732 2 970 3012 t ( include file is protected)4 977( Each)1 252( system calls.)2 542(functions, one for memory functions, one for I/O, and none for)10 2549 4 720 3132 t (by an)1 221 1 720 3252 t 10 CW f (#ifdef)968 3252 w 10 R f ( takes a completely dif\255)4 949( 9)1 77( Plan)1 230(to guarantee its contents are seen by the compiler only once.)10 2429 4 1355 3252 t ( than a few include files that define external formats such as archives, the files in)15 3376( Other)1 287(ferent approach.)1 657 3 720 3372 t 10 CW f (/sys/include)720 3492 w 10 R f (correspond to)1 559 1 1478 3492 t 10 I f (libraries.)2075 3492 w 10 R f ( includes the corresponding)3 1143(If a program is using a library, it)7 1389 2 2508 3492 t ( library comprises string functions, memory functions, and so on, largely as in ANSI)13 3419( default C)2 402(header. The)1 499 3 720 3612 t ( use these functions, one)4 991( To)1 164( plus all the system calls and related functions.)8 1886(C, some formatted I/O routines,)4 1279 4 720 3732 t (must)720 3852 w 10 CW f (#include)944 3852 w 10 R f (the file)1 284 1 1453 3852 t 10 CW f ()1765 3852 w 10 R f (, which in turn must follow)5 1104 1 2245 3852 t 10 CW f ()3377 3852 w 10 R f (, to define their prototypes for the)6 1363 1 3677 3852 t ( is the complete source to the traditional first C program:)10 2270(compiler. Here)1 623 2 720 3972 t 9 CW f (#include )1 756 1 1008 4142 t (#include )1 918 1 1008 4252 t (void)1008 4472 w (main\(void\))1008 4582 w ({)1008 4692 w (print\("hello world\\n"\);)1 1242 1 1440 4802 t (exits\(0\);)1440 4912 w (})1008 5022 w 10 R f (The)720 5202 w 10 CW f (print)917 5202 w 10 R f (routine and its relatives)3 986 1 1259 5202 t 10 CW f (fprint)2288 5202 w 10 R f (and)2691 5202 w 10 CW f (sprint)2878 5202 w 10 R f (resemble the similarly\255named functions in)4 1759 1 3281 5202 t ( Plan 9)2 288( In)1 138(Standard I/O but are not attached to a specific I/O library.)10 2353 3 720 5322 t 10 CW f (main)3529 5322 w 10 R f ( should)1 296(is not integer\255valued; it)3 945 2 3799 5322 t (call)720 5442 w 10 CW f (exits)895 5442 w 10 R f ( a string \(or null; here ANSI C promotes the 0 to a)12 2093(, which takes)2 536 2 1195 5442 t 10 CW f (char*\))3856 5442 w 10 R f ( these)1 237(argument. All)1 587 2 4216 5442 t (functions are, of course, documented in the Programmer's Manual.)8 2675 1 720 5562 t (To use)1 269 1 970 5718 t 10 CW f (printf)1264 5718 w 10 R f (,)1624 5718 w 10 CW f ()1674 5718 w 10 R f (must be included to define the function prototype for)8 2114 1 2239 5718 t 10 CW f (printf)4378 5718 w 10 R f (:)4738 5718 w 9 CW f (#include )1 756 1 1008 5888 t (#include )1 918 1 1008 5998 t (#include )1 972 1 1008 6108 t (void)1008 6328 w (main\(int argc, char *argv[]\))3 1512 1 1008 6438 t ({)1008 6548 w (printf\("%s: hello world with %d arguments\\n", argv[0], argc\2551\);)7 3402 1 1440 6658 t (exits\(0\);)1440 6768 w (})1008 6878 w 10 R f ( libraries are discussed in a later section of this docu\255)10 2178( I/O)1 189( Plan 9.)2 315(In fact Standard I/O is not used much in)8 1638 4 720 7058 t (ment.)720 7178 w cleartomark showpage saveobj restore %%EndPage: 2 2 %%Page: 3 3 /saveobj save def mark 3 pagesetup 10 R f (\255 3 \255)2 166 1 2797 480 t ( windows, and so on, and each)6 1262(There are libraries for handling regular expressions, bitmap graphics,)8 2808 2 970 840 t ( files)1 200( The)1 208( manual for each library states which include files are needed.)10 2498( The)1 209(has an associated include file.)4 1205 5 720 960 t ( against multiple inclusion and themselves contain no nested)8 2517(are not protected)2 692 2 720 1080 t 10 CW f (#includes)3966 1080 w 10 R f ( the)1 159(. Instead)1 375 2 4506 1080 t ( out the requirements and to)5 1143(programmer is expected to sort)4 1266 2 720 1200 t 10 CW f (#include)3159 1200 w 10 R f (the necessary files once at the top)6 1371 1 3669 1200 t ( practice this is trivial: this way of handling include files is so straightforward that it)15 3416( In)1 137(of each source file.)3 767 3 720 1320 t (is rare for a source file to contain more than half a dozen)12 2260 1 720 1440 t 10 CW f (#includes)3005 1440 w 10 R f (.)3545 1440 w ( allocation so the)3 698(The compilers do their own register)5 1453 2 970 1596 t 10 CW f (register)3152 1596 w 10 R f ( different)1 374( For)1 195(keyword is ignored.)2 808 3 3663 1596 t (reasons,)720 1716 w 10 CW f (volatile)1069 1716 w 10 R f (and)1574 1716 w 10 CW f (const)1743 1716 w 10 R f (are also ignored.)2 662 1 2068 1716 t ( a version of the compiler,)5 1088(To make it easier to share code with other systems, Plan 9 has)12 2561 2 970 1872 t 10 CW f (pcc)4652 1872 w 10 R f (, that)1 208 1 4832 1872 t ( with POSIX extensions.)3 1001(provides the standard ANSI C preprocessor, headers, and libraries)8 2678 2 720 1992 t 10 CW f (Pcc)4453 1992 w 10 R f (is recom\255)1 378 1 4662 1992 t ( compiles slower, produces slower code \(it)6 1783( It)1 123(mended only when broad external portability is mandated.)7 2414 3 720 2112 t ( Plan 9 interface not related to)6 1221(takes extra work to simulate POSIX on Plan 9\), eliminates those parts of the)13 3099 2 720 2232 t (POSIX, and illustrates the clumsiness of an environment designed by committee.)10 3252 1 720 2352 t 10 CW f (Pcc)4023 2352 w 10 R f ( more)1 232(is described in)2 579 2 4229 2352 t (detail in)1 325 1 720 2472 t 10 I f (``APE)1070 2472 w 10 S1 f (\320)1319 2472 w 10 I f (The ANSI/POSIX Environment'',)2 1323 1 1419 2472 t 10 R f (by Howard Trickey.)2 806 1 2767 2472 t 10 B f (Process)720 2712 w 10 R f ( arbitrary, alphanumeric charac\255)3 1296(Each CPU architecture supported by Plan 9 is identified by a single,)11 2774 2 970 2868 t (ter:)720 2988 w 10 CW f (v)885 2988 w 10 R f (for MIPS,)1 406 1 976 2988 t 10 CW f (k)1413 2988 w 10 R f (for SPARC,)1 490 1 1504 2988 t 10 CW f (z)2025 2988 w 10 R f (for Hobbit,)1 450 1 2116 2988 t 10 CW f (2)2597 2988 w 10 R f (for Motorola 68020 and 68040,)4 1281 1 2688 2988 t 10 CW f (8)4000 2988 w 10 R f (for Intel 386, and)3 711 1 4091 2988 t 10 CW f (6)4833 2988 w 10 R f (for)4924 2988 w ( character labels the support tools and files for that architecture.)10 2601( The)1 211( list is sure to grow.\))5 852( \(This)1 267(Intel 960.)1 389 5 720 3108 t ( the 68020 the compiler is)5 1061(For instance, for)2 667 2 720 3228 t 10 CW f (2c)2477 3228 w 10 R f (, the assembler is)3 700 1 2597 3228 t 10 CW f (2a)3326 3228 w 10 R f (, the link editor/loader is)4 996 1 3446 3228 t 10 CW f (2l)4471 3228 w 10 R f (, the object)2 449 1 4591 3228 t (files are suffixed)2 670 1 720 3348 t 10 CW f (.2)1415 3348 w 10 R f (, and the default name for an executable file is)9 1845 1 1535 3348 t 10 CW f (2.out)3405 3348 w 10 R f ( we can use the compiler)5 989(. Before)1 346 2 3705 3348 t ( how this deci\255)3 603( next section explains)3 878( The)1 210(we therefore need to know which machine we are compiling for.)10 2629 4 720 3468 t ( the moment assume we are building 68020 binaries and make the mental substitution for)14 3639(sion is made; for)3 681 2 720 3588 t 10 CW f (2)720 3708 w 10 R f (appropriate to the machine you are actually using.)7 1996 1 805 3708 t ( run the compiler,)3 734( First)1 242( executable binary is a two\255step process.)6 1658(To convert source to an)4 970 4 970 3864 t 10 CW f (2c)4607 3864 w 10 R f (, on the)2 313 1 4727 3864 t (source, say)1 457 1 720 3984 t 10 CW f (file.c)1216 3984 w 10 R f (, to generate an object file)5 1106 1 1576 3984 t 10 CW f (file.2)2721 3984 w 10 R f ( run the loader,)3 646(. Then)1 294 2 3081 3984 t 10 CW f (2l)4060 3984 w 10 R f ( exe\255)1 209(, to generate an)3 651 2 4180 3984 t (cutable)720 4104 w 10 CW f (2.out)1033 4104 w 10 R f (that may be run \(on a 680X0 machine\):)7 1572 1 1358 4104 t 9 CW f (2c file.c)1 486 1 1008 4274 t (2l file.2)1 486 1 1008 4384 t (2.out)1008 4494 w 10 R f ( libraries the program needs, usually including the standard C)9 2494(The loader automatically links with whatever)5 1826 2 720 4674 t (library as defined by)3 826 1 720 4794 t 10 CW f ()1572 4794 w 10 R f ( and loader have lots of options, both familiar and)9 1992( course the compiler)3 815(. Of)1 181 3 2052 4794 t ( compiler does not generate an executable automatically; the output of)10 2836( The)1 208( for details.)2 458(new; see the manual)3 818 4 720 4914 t ( most compilation is done under the control of)8 1953( Since)1 285(the compiler must be given to the loader.)7 1728 3 720 5034 t 10 CW f (mk)4723 5034 w 10 R f (\(see)4880 5034 w (below\), this is rarely an inconvenience.)5 1566 1 720 5154 t ( pre\255)1 195( compiler integrates)2 811( The)1 214(The distribution of work between the compiler and loader is unusual.)10 2850 4 970 5310 t ( a)1 79( these tasks in)3 591( Combining)1 512(processing, parsing, register allocation, code generation and some assembly.)8 3138 4 720 5430 t ( loader does instruction selection,)4 1388( The)1 217( the compiler's efficiency.)3 1083(single program is part of the reason for)7 1632 4 720 5550 t ( is no separate C preprocessor)5 1204( There)1 284( instruction scheduling, and writes the final executable.)7 2219(branch folding,)1 613 4 720 5670 t ( the intermediate object file \(here)5 1332( Instead)1 339(and no assembler in the usual pipeline.)6 1557 3 720 5790 t 10 CW f (.2)3974 5790 w 10 R f ( type of binary)3 591(file\) is a)2 329 2 4120 5790 t ( The)1 225( form for quick I/O.)4 870(assembly language, similar to very regular assembly language but in binary)10 3225 3 720 5910 t ( example, on the 68020 the)5 1092( For)1 191( format are not exactly those in the machine.)8 1793(instructions in the intermediate)3 1244 4 720 6030 t ( loader will decide just which variant of the MOVE)9 2163(object file may specify a MOVE instruction but the)8 2157 2 720 6150 t (instruction)720 6270 w 10 S1 f (\320)1173 6270 w 10 R f (MOVE immediate, MOVE quick, MOVE address, etc.)6 2191 1 1298 6270 t 10 S1 f (\320)3514 6270 w 10 R f (is most efficient.)2 669 1 3639 6270 t (The assembler,)1 604 1 970 6426 t 10 CW f (2a)1599 6426 w 10 R f ( object file)2 429(, is just a translator between the textual and binary representations of the)12 2892 2 1719 6426 t ( has limited macro capabilities \(the same as the)8 1966( It)1 121( is not an assembler in the traditional sense.)8 1820(format. It)1 413 4 720 6546 t ( instance, the)2 554( For)1 204( the compiler\), clumsy syntax, and minimal error checking.)8 2486(integral C preprocessor in)3 1076 4 720 6666 t ( that the machine)3 712(assembler will accept an instruction \(such as memory\255to\255memory MOVE on the MIPS\))11 3608 2 720 6786 t ( when the output of the assembler is passed to the loader will the error be)15 3055(does not actually support; only)4 1265 2 720 6906 t ( as the machine\255dependent part of an)6 1522( assembler is intended only for writing things, such)8 2126(discovered. The)1 672 3 720 7026 t ( from C; very little code in Plan 9 is in assembly)11 1969(operating system, that need access to instructions invisible)7 2351 2 720 7146 t (language.)720 7266 w cleartomark showpage saveobj restore %%EndPage: 3 3 %%Page: 4 4 /saveobj save def mark 4 pagesetup 10 R f (\255 4 \255)2 166 1 2797 480 t (The compilers take an option)4 1165 1 970 840 t 10 CW f (\255S)2160 840 w 10 R f ( to print on their standard output the generated code)9 2075(that causes them)2 660 2 2305 840 t ( a formatting of the data in the)7 1254( is of course merely)4 815( This)1 235(in a format acceptable as input to the assemblers.)8 2016 4 720 960 t (object file; therefore the assembler is just an)7 1787 1 720 1080 t 8 R f (ASCII)2531 1080 w 10 R f ( the end of this)4 610( Near)1 247(\255to\255binary converter for this format.)4 1443 3 2740 1080 t ( than the specific instruc\255)4 1045( Other)1 286( the format of the assembly language.)6 1554(document is a brief introduction to)5 1435 4 720 1200 t (tions, the input to the assemblers is largely architecture\255independent.)8 2746 1 720 1320 t ( library header file contains a)5 1301( Each)1 276( compilation process.)2 906(The loader is an integral part of the)7 1587 4 970 1476 t 10 CW f (#pragma)720 1596 w 10 R f ( the name of the associated archive; it is not necessary to tell the loader which)15 3108(that tells the loader)3 766 2 1166 1596 t ( loader starts)2 530( The)1 215( C run\255time startup is found, by default, in the C library.)11 2353( The)1 214(libraries a program uses.)3 1008 5 720 1716 t (with an undefined symbol,)3 1072 1 720 1836 t 10 CW f (_main)1819 1836 w 10 R f ( startup code from the library.)5 1197(, that is resolved by pulling in the run\255time)8 1724 2 2119 1836 t (\(The loader undefines)2 875 1 720 1956 t 10 CW f (_mainp)1620 1956 w 10 R f (when profiling is enabled, to force loading of the profiling start\255up instead.\))11 3026 1 2005 1956 t ( This)1 238( optimize access.)2 699(Unlike its counterpart on other systems, the Plan 9 loader rearranges data to)12 3133 3 970 2112 t ( programs)1 408( Most)1 262( the source.)2 469(means the order of variables in the loaded program is unrelated to its order in)14 3181 4 720 2232 t (don't care, but some assume that, for example, the variables declared by)11 2882 1 720 2352 t 9 CW f (int a;)1 324 1 1008 2522 t (int b;)1 324 1 1008 2632 t 10 R f ( Plan 9, they won't.)4 783( On)1 172(will appear at adjacent addresses in memory.)6 1793 3 720 2812 t 10 B f (Heterogeneity)720 3052 w 10 R f ( a user logs in the environment is configured so the appropriate binaries are)13 3034(When the system starts or)4 1036 2 970 3208 t (available in)1 469 1 720 3328 t 10 CW f (/bin)1220 3328 w 10 R f ( variable,)1 376( configuration process is controlled by an environment)7 2225(. The)1 236 3 1460 3328 t 10 CW f ($cputype)4327 3328 w 10 R f (, with)1 233 1 4807 3328 t (value such as)2 538 1 720 3448 t 10 CW f (mips)1287 3448 w 10 R f (,)1527 3448 w 10 CW f (68020)1581 3448 w 10 R f (, or)1 137 1 1881 3448 t 10 CW f (sparc.)2047 3448 w 10 R f (For each architecture there is a directory in root, with the appro\255)11 2604 1 2436 3448 t ( Thus)1 261( and library files for that architecture.)6 1559(priate name, that holds the binary)5 1397 3 720 3568 t 10 CW f (/mips/lib)3973 3568 w 10 R f (contains the)1 491 1 4549 3568 t (object code libraries for MIPS programs,)5 1781 1 720 3688 t 10 CW f (/mips/include)2556 3688 w 10 R f (holds MIPS\255specific include files, and)4 1649 1 3391 3688 t 10 CW f (/mips/bin)720 3808 w 10 R f ( binaries are attached to)4 1051( These)1 314(has the MIPS binaries.)3 983 3 1312 3808 t 10 CW f (/bin)3711 3808 w 10 R f (at boot time by binding)4 1038 1 4002 3808 t 10 CW f (/$cputype/bin)720 3928 w 10 R f (to)1525 3928 w 10 CW f (/bin)1628 3928 w 10 R f (, so)1 139 1 1868 3928 t 10 CW f (/bin)2032 3928 w 10 R f (always contains the correct files.)4 1305 1 2297 3928 t (The MIPS compiler,)2 831 1 970 4084 t 10 CW f (vc)1832 4084 w 10 R f ( architecture, regardless of)3 1078(, by definition produces object files for the MIPS)8 2010 2 1952 4084 t ( of)1 116( is a version)3 507( There)1 291(the architecture of the machine on which the compiler is running.)10 2699 4 720 4204 t 10 CW f (vc)4366 4204 w 10 R f (compiled for)1 521 1 4519 4204 t (each architecture:)1 715 1 720 4324 t 10 CW f (/mips/bin/vc)1470 4324 w 10 R f (,)2190 4324 w 10 CW f (/68020/bin/vc)2251 4324 w 10 R f (,)3031 4324 w 10 CW f (/sparc/bin/vc)3092 4324 w 10 R f (, and so on, each capable of)6 1168 1 3872 4324 t ( running on a SPARC,)4 982( one is)2 305( If)1 138(producing MIPS object files regardless of the native instruction set.)9 2895 4 720 4444 t 10 CW f (/sparc/bin/vc)720 4564 w 10 R f ( the MIPS; if one is running on machine)8 1813(will compile programs for)3 1121 2 1550 4564 t 10 CW f ($cputype)4535 4564 w 10 R f (,)5015 4564 w 10 CW f (/$cputype/bin/vc)720 4684 w 10 R f (will compile programs for the MIPS.)5 1477 1 1705 4684 t (In Plan 9 the directory)4 909 1 970 4840 t 10 CW f (/$cputype/bin)1908 4840 w 10 R f (is bound to)2 453 1 2717 4840 t 10 CW f (/bin)3199 4840 w 10 R f ( com\255)1 235(so that the appropriate version of)5 1337 2 3468 4840 t (mands such as)2 595 1 720 4960 t 10 CW f (date)1349 4960 w 10 R f ( shell looks for)3 621(are found by the shell: the)5 1085 2 1623 4960 t 10 CW f (date)3362 4960 w 10 R f (in)3635 4960 w 10 CW f (/bin/date)3746 4960 w 10 R f (and automatically)1 721 1 4319 4960 t (finds the file)2 515 1 720 5080 t 10 CW f (/$cputype/bin/date)1265 5080 w 10 R f ( the MIPS compiler is known as just)7 1488(. Therefore)1 472 2 2345 5080 t 10 CW f (vc)4335 5080 w 10 R f (; the shell will)3 585 1 4455 5080 t (invoke)720 5200 w 10 CW f (/bin/vc)1040 5200 w 10 R f ( guaranteed to be the version of the MIPS compiler appropriate for the)12 3075(and that is)2 457 2 1508 5200 t ( of the architecture of the compiling machine,)7 1936( Regardless)1 504( command.)1 460(machine running the)2 851 4 720 5320 t 10 CW f (/bin/vc)4512 5320 w 10 R f (is)4973 5320 w 10 I f (always)720 5440 w 10 R f (the MIPS compiler.)2 786 1 1023 5440 t (Also, the output of)3 783 1 970 5596 t 10 CW f (vc)1789 5596 w 10 R f (and)1945 5596 w 10 CW f (vl)2125 5596 w 10 R f ( of)1 120(is completely independent)2 1071 2 2281 5596 t 10 CW f ($cputype)3509 5596 w 10 R f (:)3989 5596 w 10 CW f (.v)4054 5596 w 10 R f (files compiled \(with)2 829 1 4211 5596 t 10 CW f (vc)720 5716 w 10 R f (\) on a SPARC may be linked \(with)7 1439 1 840 5716 t 10 CW f (vl)2310 5716 w 10 R f ( resulting)1 380( \(The)1 243( a 386.)2 279(\) on)1 164 4 2430 5716 t 10 CW f (v.out)3526 5716 w 10 R f (will run, of course, only on a)6 1184 1 3856 5716 t ( the MIPS libraries in)4 905(MIPS.\) Similarly,)1 751 2 720 5836 t 10 CW f (/mips/lib)2412 5836 w 10 R f (are suitable for loading with)4 1174 1 2988 5836 t 10 CW f (vl)4199 5836 w 10 R f (on any machine;)2 684 1 4356 5836 t (there is only one set of MIPS libraries, not one set for each architecture that supports the MIPS compiler.)18 4320 1 720 5956 t (\(In other systems it is common for the intermediate format to be compiling\255machine\255dependent.\))12 3864 1 720 6076 t 10 B f (Heterogeneity and)1 785 1 720 6316 t 10 CW f (mk)1530 6316 w 10 R f ( control of)2 438(Most software on Plan 9 is compiled under the)8 1945 2 970 6472 t 10 CW f (mk)3389 6472 w 10 R f (, a descendant of)3 703 1 3509 6472 t 10 CW f (make)4248 6472 w 10 R f (that is docu\255)2 516 1 4524 6472 t ( convention used throughout the)4 1308( A)1 127(mented in the Programmer's Manual.)4 1515 3 720 6592 t 10 CW f (mkfiles)3700 6592 w 10 R f ( com\255)1 234(makes it easy to)3 656 2 4150 6592 t (pile the source into binary suitable for any architecture.)8 2209 1 720 6712 t (The variable)1 521 1 970 6868 t 10 CW f ($cputype)1536 6868 w 10 R f ( the current environment, and)4 1262(is advisory: it reports the architecture of)6 1717 2 2061 6868 t ( second variable,)2 675( A)1 123(should not be modified.)3 953 3 720 6988 t 10 CW f ($objtype)2497 6988 w 10 R f ( architecture is being)3 834(, is used to set which)5 838 2 2977 6988 t 10 I f (compiled)4674 6988 w 10 R f ( value of)2 349(for. The)1 346 2 720 7108 t 10 CW f ($objtype)1440 7108 w 10 R f (can be used by a)4 659 1 1945 7108 t 10 CW f (mkfile)2629 7108 w 10 R f (to configure the compilation environment.)4 1690 1 3014 7108 t (In each machine's root directory there is a short)8 1994 1 970 7264 t 10 CW f (mkfile)3000 7264 w 10 R f (that just defines a set of macros for the)8 1643 1 3397 7264 t cleartomark showpage saveobj restore %%EndPage: 4 4 %%Page: 5 5 /saveobj save def mark 5 pagesetup 10 R f (\255 5 \255)2 166 1 2797 480 t ( is)1 92( Here)1 243(compiler, loader, etc.)2 845 3 720 840 t 10 CW f (/mips/mkfile)1925 840 w 10 R f (:)2645 840 w 9 CW f (CC=vc)1008 1010 w (LD=vl)1008 1120 w (O=v)1008 1230 w (RL=rl)1008 1340 w (AS=va)1008 1450 w (OS=2kovz86)1008 1560 w (CPUS=mips 68020 sparc 386 hobbit)4 1728 1 1008 1670 t (CFLAGS=)1008 1780 w 10 CW f (CC)720 1960 w 10 R f (is obviously the compiler,)3 1054 1 870 1960 t 10 CW f (AS)1954 1960 w 10 R f (the assembler, and)2 750 1 2104 1960 t 10 CW f (LD)2884 1960 w 10 R f (the loader.)1 426 1 3034 1960 t 10 CW f (O)3515 1960 w 10 R f ( for the object files and)5 953(is the suffix)2 482 2 3605 1960 t 10 CW f (RL)720 2080 w 10 R f ( a library file \(a dreg, really; the program)8 1637(is the program that inserts a table of contents into)9 1982 2 866 2080 t 10 CW f (rl)4510 2080 w 10 R f (works for)1 385 1 4655 2080 t (all supported architectures\).)2 1111 1 720 2200 t 10 CW f (CPUS)1881 2200 w 10 R f (and)2146 2200 w 10 CW f (OS)2315 2200 w 10 R f (are used in special rules described below.)6 1654 1 2460 2200 t (Here is a)2 354 1 970 2356 t 10 CW f (mkfile)1349 2356 w 10 R f (to build the installed source for)5 1246 1 1734 2356 t 10 CW f (sam)3005 2356 w 10 R f (:)3185 2356 w 9 CW f ()2997 6580 w 10 R f ( It)1 119(, contains no buffered I/O package.)5 1444 2 3477 6580 t (does have several entry points for printing formatted text:)8 2454 1 720 6700 t 10 CW f (print)3218 6700 w 10 R f (outputs text to the standard output,)5 1479 1 3561 6700 t 10 CW f (fprint)720 6820 w 10 R f (outputs text to a specified integer file descriptor, and)8 2193 1 1116 6820 t 10 CW f (sprint)3345 6820 w 10 R f (places text in a character array.)5 1299 1 3741 6820 t (But to access library routines for buffered I/O, a program must explicitly mention an appropriate library.)15 4173 1 720 6940 t ( used by most Plan 9 utilities, is)7 1421(The recommended I/O library,)3 1279 2 970 7096 t 10 CW f (bio)3716 7096 w 10 R f (\(buffered I/O\), defined by)3 1098 1 3942 7096 t 10 CW f ()720 7216 w 10 R f (and accessed by appending)3 1122 1 1178 7216 t 10 CW f (\255lbio)2337 7216 w 10 R f ( also exists an)3 594( There)1 294(to the command line for the loader.)6 1478 3 2674 7216 t cleartomark showpage saveobj restore %%EndPage: 6 6 %%Page: 7 7 /saveobj save def mark 7 pagesetup 10 R f (\255 7 \255)2 166 1 2797 480 t (implementation of ANSI Standard I/O,)4 1557 1 720 840 t 10 CW f (stdio)2302 840 w 10 R f (.)2602 840 w 10 CW f (Bio)970 996 w 10 R f ( for)1 162( Even)1 275(is small and very efficient, particularly for buffer\255at\255a\255time or line\255at\255a\255time I/O.)10 3408 3 1195 996 t ( than the Standard I/O library,)5 1233(character\255at\255a\255time I/O, however, it is significantly faster)6 2325 2 720 1116 t 10 CW f (stdio)4310 1116 w 10 R f ( inter\255)1 248(. Its)1 182 2 4610 1116 t ( most noticeable is that one)5 1141( The)1 215( couple of conveniences.)3 1016(face is compact and regular, although it lacks a)8 1948 4 720 1236 t (must explicitly define buffers for standard input and output;)8 2448 1 720 1356 t 10 CW f (bio)3200 1356 w 10 R f ( is a pro\255)3 370( Here)1 250(does not predefine them.)3 1008 3 3412 1356 t (gram to copy input to output a character at a time using)11 2211 1 720 1476 t 10 CW f (bio)2956 1476 w 10 R f (:)3136 1476 w 9 CW f (#include )1 756 1 1008 1646 t (#include )1 918 1 1008 1756 t (#include )1 864 1 1008 1866 t (Biobuf bin;)1 648 1 1008 2086 t (Biobuf bout;)1 702 1 1008 2196 t (main\(void\))1008 2416 w ({)1008 2526 w (int c;)1 324 1 1440 2636 t (Binit\(&bin, 0, OREAD\);)2 1188 1 1440 2856 t (Binit\(&bout, 1, OWRITE\);)2 1296 1 1440 2966 t (while\(\(c=Bgetc\(&bin\)\) != Beof\))2 1620 1 1440 3186 t (Bputc\(&bout, c\);)1 864 1 1872 3296 t (exits\(0\);)1440 3406 w (})1008 3516 w 10 R f ( performance, we could replace)4 1261(For peak)1 353 2 720 3696 t 10 CW f (Bgetc)2361 3696 w 10 R f (and)2688 3696 w 10 CW f (Bputc)2859 3696 w 10 R f (by their equivalent in\255line macros)4 1356 1 3186 3696 t 10 CW f (BGETC)4569 3696 w 10 R f (and)4896 3696 w 10 CW f (BPUTC)720 3816 w 10 R f ( more information on)3 870( For)1 195( modest.)1 345(but the performance gain would be)5 1429 4 1052 3816 t 10 CW f (bio)3922 3816 w 10 R f (, see the Programmer's)3 938 1 4102 3816 t (Manual.)720 3936 w ( other systems' is that text is)6 1163(Perhaps the most dramatic difference in the I/O interface of Plan 9 from)12 2907 2 970 4092 t (not)720 4212 w 8 R f (ASCII.)876 4212 w 10 R f ( character set is)3 623( The)1 207( of 16\255bit characters.)3 831(The format for text in Plan 9 is a byte\255stream encoding)10 2221 4 1158 4212 t (based on Unicode and is backward compatible with)7 2067 1 720 4332 t 8 R f (ASCII:)2813 4332 w 10 R f ( 0 through 127 are the same)6 1121(characters with value)2 849 2 3070 4332 t ( 16\255bit characters, called)3 992( The)1 209(in both sets.)2 489 3 720 4452 t 10 I f (runes)2439 4452 w 10 R f ( representation called)2 859(in Plan 9, are encoded using a)6 1219 2 2690 4452 t 8 R f (UTF,)4796 4452 w 10 R f (a)4996 4452 w (encoding we proposed and expect to be accepted by X\255Open.)9 2461 1 720 4572 t 8 R f (UTF)3233 4572 w 10 R f ( represent)1 393(defines multibyte sequences to)3 1235 2 3412 4572 t ( In)1 142(character values from 0 to 65535.)5 1386 2 720 4692 t 8 R f (UTF,)2282 4692 w 10 R f (character values up to 127 decimal, 7F hexadecimal, represent)8 2552 1 2488 4692 t (themselves, so straight)2 916 1 720 4812 t 8 R f (ASCII)1666 4812 w 10 R f (files are also valid)3 744 1 1905 4812 t 8 R f (UTF.)2679 4812 w 10 R f (Also,)2906 4812 w 8 R f (UTF)3150 4812 w 10 R f (guarantees that bytes with values 0 to 127)7 1708 1 3332 4812 t ( inclusive\) will appear only when they represent themselves, so programs that read bytes)13 3707(\(NUL to DEL,)2 613 2 720 4932 t ( expects a one\255to\255one corre\255)4 1156( program that)2 558( Any)1 232(looking for plain ASCII characters will continue to work.)8 2374 4 720 5052 t ( example is parsing file)4 972( An)1 182(spondence between bytes and characters will, however, need to be modified.)10 3166 3 720 5172 t ( names, like all text, are in)6 1162(names. File)1 504 2 720 5292 t 8 R f (UTF,)2429 5292 w 10 R f ( search for a character in a string by)8 1580(so it is incorrect to)4 816 2 2644 5292 t 10 CW f (strchr\(filename, c\))1 1147 1 720 5412 t 10 R f ( correct method)2 638( The)1 211(because the character might have a multi\255byte encoding.)7 2292 3 1899 5412 t ( call)1 173(is to)1 173 2 720 5532 t 10 CW f (utfrune\(filename, c\))1 1204 1 1095 5532 t 10 R f (, defined in)2 460 1 2299 5532 t 10 I f (rune)2788 5532 w 10 R f (\(2\), which interprets the file name as a sequence of)9 2069 1 2971 5532 t ( byte that can)3 556( fact, even when you know the character is a single)10 2116( In)1 141(encoded characters rather than bytes.)4 1507 4 720 5652 t ( use)1 165(represent only itself, it is safer to)6 1348 2 720 5772 t 10 CW f (utfrune)2265 5772 w 10 R f (because that assumes nothing about the character set and)8 2323 1 2717 5772 t ( representation may change)3 1094( The)1 205(its representation.)1 710 3 720 5892 t 10 S1 f (\320)2729 5892 w 10 R f (Plan 9 has already changed it several times.)7 1741 1 2829 5892 t ( byte with)2 444( Any)1 244(The library defines several symbols relevant to the representation of characters.)10 3382 3 970 6048 t (unsigned value less than)3 986 1 720 6168 t 10 CW f (Runesync)1735 6168 w 10 R f ( appear in any multi\255byte encoding of a character.)8 2010(will not)1 313 2 2244 6168 t 10 CW f (Utfrune)4620 6168 w 10 R f (compares the character being searched against)5 1861 1 720 6288 t 10 CW f (Runesync)2609 6288 w 10 R f (to see if it is sufficient to call)7 1184 1 3117 6288 t 10 CW f (strchr)4329 6288 w 10 R f ( the)1 151(or if)1 172 2 4717 6288 t ( less than)2 372( byte with unsigned value)4 1031( Any)1 223(byte stream must be interpreted.)4 1288 4 720 6408 t 10 CW f (Runeself)3659 6408 w 10 R f (is represnted by a sin\255)4 876 1 4164 6408 t ( encoutered converting to runes from a byte stream,)8 2107( when errors are)3 659( Finally,)1 364(gle byte with the same value.)5 1190 4 720 6528 t (the library returns the rune value)5 1335 1 720 6648 t 10 CW f (Runeerror)2086 6648 w 10 R f ( permits programs to find)4 1036( This)1 234(and advances a single byte.)4 1113 3 2657 6648 t (runes embedded in binary data.)4 1250 1 720 6768 t 10 CW f (Bio)970 6924 w 10 R f (includes routines)1 683 1 1178 6924 t 10 CW f (Bgetrune)1889 6924 w 10 R f (and)2397 6924 w 10 CW f (Bputrune)2569 6924 w 10 R f (to transform the external byte stream)5 1487 1 3077 6924 t 8 R f (UTF)4593 6924 w 10 R f (format)4774 6924 w ( the)1 155( Also,)1 272(to and from internal 16\255bit runes.)5 1366 3 720 7044 t 10 CW f (%s)2546 7044 w 10 R f (format to)1 377 1 2699 7044 t 10 CW f (print)3109 7044 w 10 R f (accepts)3442 7044 w 8 R f (UTF;)3768 7044 w 10 CW f (%c)3974 7044 w 10 R f (prints a character after)3 914 1 4126 7044 t ( The)1 206(narrowing it to 8 bits.)4 868 2 720 7164 t 10 CW f (%S)1820 7164 w 10 R f (format prints a null\255terminated sequence of runes;)6 2002 1 1966 7164 t 10 CW f (%C)3994 7164 w 10 R f (prints a character after)3 899 1 4141 7164 t ( more information, see the Programmer's Manual, in particular)8 2664( For)1 208(narrowing it to 16 bits.)4 994 3 720 7284 t 10 I f (utf)4630 7284 w 10 R f (\(6\) and)1 304 1 4736 7284 t cleartomark showpage saveobj restore %%EndPage: 7 7 %%Page: 8 8 /saveobj save def mark 8 pagesetup 10 R f (\255 8 \255)2 166 1 2797 480 t 10 I f (rune)720 840 w 10 R f (\(2\); there is not room for the full story here.)9 1747 1 903 840 t ( the C source is in)5 734( First,)1 262( ways.)1 258(These issues affect the compiler in several)6 1702 4 970 996 t 8 R f (UTF.)3954 996 w 10 R f (Although C variables)2 861 1 4179 996 t (are formed from)2 665 1 720 1116 t 8 R f (ASCII)1416 1116 w 10 R f (alphanumerics, comments and literal strings may contain any characters encoded in)10 3385 1 1655 1116 t 8 R f (UTF.)720 1236 w 10 R f (The declaration)1 623 1 942 1236 t 9 CW f (char *cp = "abc\377";)3 972 1 1008 1406 t 10 R f (initializes the variable)2 908 1 720 1586 t 10 CW f (cp)1667 1586 w 10 R f (to point to an array of bytes holding the)8 1694 1 1826 1586 t 8 R f (UTF)3559 1586 w 10 R f (representation of the characters)3 1290 1 3750 1586 t 10 CW f (abc\377.)720 1706 w 10 R f (The type)1 356 1 1049 1706 t 10 CW f (Rune)1434 1706 w 10 R f ( in)1 106(is defined)1 395 2 1703 1706 t 10 CW f ()2232 1706 w 10 R f (to be)1 200 1 2560 1706 t 10 CW f (ushort)2788 1706 w 10 R f ( character' type in the)4 881( `wide)1 280(, which is also the)4 731 3 3148 1706 t ( the declaration)2 615(compiler. Therefore)1 822 2 720 1826 t 9 CW f (Rune *rp = L"abc\377";)3 1026 1 1008 1996 t 10 R f (initializes the variable)2 900 1 720 2176 t 10 CW f (rp)1654 2176 w 10 R f ( unsigned short integers holding the 16\255bit values of the)9 2319(to point to an array of)5 913 2 1808 2176 t (characters)720 2296 w 10 CW f (abc\377)1153 2296 w 10 R f ( that in both these declarations the characters in the source that represent)12 2953(. Note)1 274 2 1393 2296 t 10 CW f (abc\377)4650 2296 w 10 R f (are)4919 2296 w ( following)1 419( The)1 210( characters are represented in memory in the program.)8 2197(the same; what changes is how those)6 1494 4 720 2416 t (two lines:)1 392 1 720 2536 t 9 CW f (print\("%s\\n", "abc\377"\);)1 1188 1 1008 2706 t (print\("%S\\n", L"abc\377"\);)1 1242 1 1008 2816 t 10 R f (produce the same)2 708 1 720 2996 t 8 R f (UTF)1458 2996 w 10 R f ( the second by converting from)5 1275(string on their output, the first by copying the bytes,)9 2125 2 1640 2996 t (runes to bytes.)2 580 1 720 3116 t (In C, character constants are integers but narrowed through the)9 2528 1 970 3272 t 10 CW f (char)3525 3272 w 10 R f ( Unicode character)2 756(type. The)1 404 2 3792 3272 t 10 CW f (\377)4980 3272 w 10 R f (has value 255, so if the)5 946 1 720 3392 t 10 CW f (char)1696 3392 w 10 R f (type is signed, the constant)4 1100 1 1966 3392 t 10 CW f ('\377')3096 3392 w 10 R f (has value)1 379 1 3306 3392 t 10 S1 f (\261)3715 3392 w 10 R f ( On)1 176( EOF\).)1 276(1 \(which is equal to)4 808 3 3780 3392 t (the other hand,)2 596 1 720 3512 t 10 CW f (L'\377')1341 3512 w 10 R f (narrows through the wide character type,)5 1634 1 1606 3512 t 10 CW f (ushort)3265 3512 w 10 R f (, and therefore has value 255.)5 1177 1 3625 3512 t 10 B f (Arguments)720 3752 w 10 R f (Defined in)1 429 1 970 3908 t 10 CW f ()1429 3908 w 10 R f ( the arguments to)3 709(are some macros for parsing)4 1150 2 1939 3908 t 10 CW f (main\(\))3829 3908 w 10 R f ( are described)2 565(. They)1 286 2 4189 3908 t (in)720 4028 w 10 I f (ARG)836 4028 w 10 R f ( are four macros:)3 717( There)1 295(\(2\) but are fairly self\255explanatory.)4 1406 3 1030 4028 t 10 CW f (ARGBEGIN)3486 4028 w 10 R f (and)4004 4028 w 10 CW f (ARGEND)4186 4028 w 10 R f (are used to)2 456 1 4584 4028 t (bracket a hidden)2 675 1 720 4148 t 10 CW f (switch)1428 4148 w 10 R f (statement within which)2 949 1 1821 4148 t 10 CW f (ARGC)2803 4148 w 10 R f (returns the current option character \(rune\) being)6 1964 1 3076 4148 t (processed and)1 566 1 720 4268 t 10 CW f (ARGF)1314 4268 w 10 R f (returns the argument to the option, as in the loader option)10 2325 1 1582 4268 t 10 CW f (\255o file)1 388 1 3935 4268 t 10 R f ( for exam\255)2 421(. Here,)1 296 2 4323 4268 t (ple, is the beginning of)4 919 1 720 4388 t 10 CW f (main\(\))1664 4388 w 10 R f (in)2049 4388 w 10 CW f (mount.c)2152 4388 w 10 R f (\(see)2597 4388 w 10 I f (bind)2782 4388 w 10 R f (\(1\)\) that cracks its arguments:)4 1192 1 2960 4388 t cleartomark showpage saveobj restore %%EndPage: 8 8 %%Page: 9 9 /saveobj save def mark 9 pagesetup 10 R f (\255 9 \255)2 166 1 2797 480 t 9 CW f (void)1008 830 w (main\(int argc, char *argv[]\))3 1512 1 1008 940 t ({)1008 1050 w (char *spec, *srv;)2 918 1 1440 1160 t (ulong flag = 0;)3 810 1 1440 1270 t (srv = "";)2 486 1 1440 1490 t (ARGBEGIN{)1440 1600 w (case 'a':)1 486 1 1440 1710 t (flag |= MAFTER;)2 810 1 1872 1820 t (break;)1872 1930 w (case 'b':)1 486 1 1440 2040 t (flag |= MBEFORE;)2 864 1 1872 2150 t (break;)1872 2260 w (case 'c':)1 486 1 1440 2370 t (flag |= MCREATE;)2 864 1 1872 2480 t (break;)1872 2590 w (case 't':)1 486 1 1440 2700 t (srv = "any";)2 648 1 1872 2810 t (break;)1872 2920 w (case 's':)1 486 1 1440 3030 t (srv = ARGF\(\);)2 702 1 1872 3140 t (if\(srv == 0\))2 648 1 1872 3250 t (usage\(\);)2304 3360 w (break;)1872 3470 w (default:)1440 3580 w (usage\(\);)1872 3690 w (}ARGEND)1440 3800 w (if\(argc == 2\))2 702 1 1440 3910 t (spec = "";)2 540 1 1872 4020 t (else if\(argc == 3\))3 972 1 1440 4130 t (spec = argv[2];)2 810 1 1872 4240 t (else)1440 4350 w (usage\(\);)1872 4460 w 10 B f (Extensions)720 4760 w 10 R f (The compiler has several extensions to ANSI C, all of which are used extensively in the system)16 4070 1 970 4916 t (source. First,)1 545 1 720 5036 t 10 I f (structure displays)1 715 1 1291 5036 t 10 R f (permit)2032 5036 w 10 CW f (struct)2318 5036 w 10 R f ( these decla\255)2 498( Given)1 294(expressions to be formed dynamically.)4 1545 3 2703 5036 t (rations:)720 5156 w 9 CW f (typedef struct Point Point;)3 1458 1 1008 5326 t (typedef struct Rectangle Rectangle;)3 1890 1 1008 5436 t (struct Point)1 648 1 1008 5656 t ({)1008 5766 w (int x, y;)2 486 1 1440 5876 t (};)1008 5986 w (struct Rectangle)1 864 1 1008 6206 t ({)1008 6316 w (Point min, max;)2 810 1 1440 6426 t (};)1008 6536 w ( q, add\(Point, Point\);)3 1188(Point p,)1 540 2 1008 6756 t (Rectangle r;)1 648 1 1008 6866 t ( y;)1 162(int x,)1 540 2 1008 6976 t 10 R f (this assignment may appear anywhere an assignment is legal:)8 2452 1 720 7156 t cleartomark showpage saveobj restore %%EndPage: 9 9 %%Page: 10 10 /saveobj save def mark 10 pagesetup 10 R f (\255 10 \255)2 216 1 2772 480 t 9 CW f (r = \(Rectangle\){add\(p, q\), \(Point\){x, y+3}};)5 2376 1 1008 830 t 10 R f (The syntax is the same as for initializing a structure but with a leading cast.)14 3010 1 720 1010 t (If an)1 187 1 970 1166 t 10 I f (anonymous structure)1 844 1 1184 1166 t 10 R f (or)2056 1166 w 10 I f (union)2167 1166 w 10 R f (is declared within another structure or union, the members of the)10 2617 1 2423 1166 t ( the)1 150( feature eliminates)2 745( This)1 232(internal structure or union are addressable without prefix in the outer structure.)11 3193 4 720 1286 t ( example, after these declarations,)4 1357( For)1 189(clumsy naming of nested structures and, particularly, unions.)7 2436 3 720 1406 t 9 CW f (struct Lock)1 594 1 1008 1576 t ({)1008 1686 w (int locked;)1 810 1 1440 1796 t (};)1008 1906 w (struct Node)1 594 1 1008 2126 t ({)1008 2236 w (int type;)1 702 1 1440 2346 t (union{)1440 2456 w (double dval;)1 702 1 1872 2566 t (double fval;)1 702 1 1872 2676 t (long lval;)1 702 1 1872 2786 t (};)1440 2896 w ( anonymous structure */)3 1242( /*)1 324(struct Lock;)1 648 3 1440 3006 t (} *node;)1 432 1 1008 3116 t ( Lock*\);)1 432(void lock\(struct)1 1026 2 1008 3336 t 10 R f ( refer to)2 343(one may)1 354 2 720 3516 t 10 CW f (node\255>type)1456 3516 w 10 R f (,)2056 3516 w 10 CW f (node\255>dval)2120 3516 w 10 R f (,)2720 3516 w 10 CW f (node\255>fval)2784 3516 w 10 R f (,)3384 3516 w 10 CW f (node\255>lval)3448 3516 w 10 R f (, and)1 208 1 4048 3516 t 10 CW f (node\255>locked)4295 3516 w 10 R f (.)5015 3516 w (Moreover, the address of a)4 1126 1 720 3636 t 10 CW f (struct Node)1 640 1 1886 3636 t 10 R f ( that the address of a)5 893(may be used without a cast anywhere)6 1581 2 2566 3636 t 10 CW f (struct Lock)1 633 1 720 3756 t 10 R f ( the type and)3 540( compiler will automatically promote)4 1520( The)1 213(is used, such as in argument lists.)6 1381 4 1386 3756 t ( one may invoke)3 663( Thus)1 250(adjust the address.)2 735 3 720 3876 t 10 CW f (lock\(node\))2393 3876 w 10 R f (.)2993 3876 w ( be accessed by type name if \(and only if\) they are declared)12 2478(Anonymous structures and unions may)4 1592 2 970 4032 t (using a)1 286 1 720 4152 t 10 CW f (typedef)1031 4152 w 10 R f ( example, using the above declaration for)6 1649(name. For)1 430 2 1476 4152 t 10 CW f (Point)3580 4152 w 10 R f (, one may declare)3 703 1 3880 4152 t 9 CW f (struct)1008 4322 w ({)1008 4432 w (int type;)1 702 1 1440 4542 t (Point;)1440 4652 w (}p;)1008 4762 w 10 R f (and refer to)2 459 1 720 4942 t 10 CW f (p.Point)1204 4942 w 10 R f (.)1624 4942 w ( index for the ini\255)4 703(In the initialization of arrays, a number in square brackets before an element sets the)14 3367 2 970 5098 t ( initialize some elements in a table of function pointers indexed by)11 2661( example, to)2 493(tialization. For)1 615 3 720 5218 t 8 R f (ASCII)4514 5218 w 10 R f (charac\255)4748 5218 w (ter,)720 5338 w 9 CW f ( slash\(void\);)1 702(void percent\(void\),)1 1188 2 1008 5508 t ( =)1 108(void \(*func[128]\)\(void\))1 1404 2 1008 5728 t ({)1008 5838 w (['%'] percent,)1 864 1 1440 5948 t (['/'] slash,)1 756 1 1440 6058 t (};)1008 6168 w 10 R f (Finally, the declaration)2 924 1 970 6384 t 9 CW f (extern register reg;)2 1080 1 1008 6554 t 10 R f (\()720 6734 w 10 I f (this)753 6734 w 10 R f ( hold the variable)3 705(appearance of the register keyword is not ignored\) allocates a global register to)12 3177 2 925 6734 t 10 CW f (reg)4835 6734 w 10 R f (.)5015 6734 w ( carefully: they need to be declared in)7 1574(External registers must be used)4 1292 2 720 6854 t 10 I f (all)3621 6854 w 10 R f (source files and libraries in the)5 1278 1 3762 6854 t ( on machines)2 543( Especially)1 474( allocated temporarily for other purposes.)5 1692(program to guarantee the register is not)6 1611 4 720 6974 t ( already usurped the)3 830(with few registers, such as the i386, it is easy to link accidentally with code that has)16 3490 2 720 7094 t ( though, external registers are)4 1219( wisely,)1 319( Used)1 263(global registers and there is no diagnostic when this happens.)9 2519 4 720 7214 t cleartomark showpage saveobj restore %%EndPage: 10 10 %%Page: 11 11 /saveobj save def mark 11 pagesetup 10 R f (\255 11 \255)2 216 1 2772 480 t ( access per\255process and per\255machine data structures on)7 2198( Plan 9 operating system uses them to)7 1529(powerful. The)1 593 3 720 840 t ( storage class they provide is hard to create in other ways.)11 2306( The)1 205(a multiprocessor.)1 688 3 720 960 t 10 B f (The compile\255time environment)2 1315 1 720 1200 t 10 R f ( are placed in registers and)5 1106(The code generated by the compilers is `optimized' by default: variables)10 2964 2 970 1356 t ( compiler flag)2 568( The)1 209(peephole optimizations are performed.)3 1553 3 720 1476 t 10 CW f (\255N)3079 1476 w 10 R f ( Registerization)1 658( optimizations.)1 598(disables these)1 556 3 3228 1476 t ( locally rather than throughout a function: whether a variable occupies a register or the memory)15 4021(is done)1 299 2 720 1596 t ( the symbol table depends on the activity of the variable and may change throughout)14 3471(location identified in)2 849 2 720 1716 t ( The)1 213(the life of the variable.)4 938 2 720 1836 t 10 CW f (\255N)1904 1836 w 10 R f ( is no)2 235( There)1 291( rarely needed; its main use is to simplify debugging.)9 2202(flag is)1 255 4 2057 1836 t (information in the symbol table to identify the registerization of a variable, so)12 3129 1 720 1956 t 10 CW f (\255N)3876 1956 w 10 R f (guarantees the variable is)3 1017 1 4023 1956 t (always where the symbol table says it is.)7 1626 1 720 2076 t (Another flag,)1 537 1 970 2232 t 10 CW f (\255w)1537 2232 w 10 R f (, turns)1 255 1 1657 2232 t 10 I f (on)1942 2232 w 10 R f ( Most)1 262( problems detected in flow analysis.)5 1467(warnings about portability and)3 1239 3 2072 2232 t ( warnings enabled; these warnings plus the type checking offered by func\255)11 3023(code in Plan 9 is compiled with)6 1297 2 720 2352 t ( the Unix tool)3 577(tion prototypes provide most of the support of)7 1890 2 720 2472 t 10 CW f (lint)3220 2472 w 10 R f (more accurately and with less chatter.)5 1547 1 3493 2472 t ( set' and `set and not used', are almost always accurate but may be trig\255)14 2885(Two of the warnings, `used and not)6 1435 2 720 2592 t ( as in routines that call)5 917(gered spuriously by code with invisible control flow, such)8 2339 2 720 2712 t 10 CW f (longjmp)4004 2712 w 10 R f ( compiler)1 383(. The)1 233 2 4424 2712 t (statements)720 2832 w 9 CW f (SET\(v1\);)1008 3002 w (USED\(v2\);)1008 3112 w 10 R f ( statement accepts a comma\255separated list of vari\255)7 2055( Either)1 303( graph to silence the compiler.)5 1254(decorate the flow)2 708 4 720 3292 t ( them carefully; they may silence real errors.)7 1784(ables. Use)1 435 2 720 3412 t 10 B f (Debugging)720 3652 w 10 R f ( is)1 94(The debugger on Plan 9)4 958 2 970 3808 t 10 CW f (db)2049 3808 w 10 R f (, a revision of Unix)4 782 1 2169 3808 t 10 CW f (adb)2978 3808 w 10 R f (that supports multiple architectures in a single)6 1855 1 3185 3808 t ( compiler emits a symbol table with)6 1451( is room for a good source\255level debugger but until the)10 2220(program. There)1 649 3 720 3928 t (types)720 4048 w 10 CW f (db)956 4048 w 10 R f (will have to serve.)3 732 1 1101 4048 t 10 CW f (Db)970 4204 w 10 R f (has several improvements over)3 1239 1 1115 4204 t 10 CW f (adb)2380 4204 w 10 R f ( important is that it reports C source line numbers with)10 2198(. Most)1 282 2 2560 4204 t (the)720 4324 w 10 CW f (z)868 4324 w 10 R f ( it supports)2 445( Finally,)1 359( breakpointing, work well.)3 1057( and in particular conditional)4 1158(command. Breakpointing,)1 1067 5 954 4324 t (cross\255architecture debugging comfortably.)2 1693 1 720 4444 t (For simple debugging, however,)3 1296 1 970 4600 t 10 CW f (db)2291 4600 w 10 R f ( a program has crashed mysteriously:)5 1489( Imagine)1 377(is fine.)1 272 3 2436 4600 t 9 CW f (% X11/X)1 378 1 1008 4770 t (Fatal server bug!)2 918 1 1008 4880 t (failed to create default stipple)4 1728 1 1008 4990 t (X 106: suicide: sys: trap: fault read addr=0x0 pc=0x00060a82)8 3240 1 1008 5100 t (%)1008 5210 w 10 R f ( for debugging.)2 623(When a process dies on Plan 9 it hangs in the `broken' state)12 2433 2 720 5390 t 10 CW f (Db)3831 5390 w 10 R f (takes the process id of the)5 1059 1 3981 5390 t (broken process and reports the type of the binary, the last trap it executed, and the failing instruction:)17 4035 1 720 5510 t 9 CW f (% db 106)2 432 1 1008 5680 t (68020 binary)1 648 1 1008 5790 t (bus error)1 486 1 1008 5900 t ( #0\($0\))1 540( TSTL)1 1350(abort.c:8 abort+#2?)1 1026 3 1008 6010 t 10 R f (The)720 6190 w 10 CW f ($C)900 6190 w 10 R f (\(capital)1045 6190 w 10 CW f (C)1369 6190 w 10 R f (\) command to)2 555 1 1429 6190 t 10 CW f (db)2009 6190 w 10 R f (reports the stack traceback:)3 1088 1 2154 6190 t cleartomark showpage saveobj restore %%EndPage: 11 11 %%Page: 12 12 /saveobj save def mark 12 pagesetup 10 R f (\255 12 \255)2 216 1 2772 480 t 9 CW f ($C)1008 830 w (abort\(\) abort.c:4 called from FatalError+#4e misc.c:421)5 2970 1 1008 940 t (FatalError\(s9=#e02, s8=#4901d200, s7=#2, s6=#72701, s5=#1,)4 3132 1 1008 1050 t (s4=#7270d, s3=#6, s2=#12, s1=#ff37f1c, s0=#6, f=#7270f\))5 2970 1 1224 1160 t (misc.c:416 called from gnotscreeninit+#4ce gnot.c:792)4 2862 1 1224 1270 t (gnotscreeninit.buf/ #4901b300)1 1674 1 1440 1380 t (gnotscreeninit\(snum=#0, sc=#80db0\) gnot.c:766 called from)4 3078 1 1008 1490 t (AddScreen+#16e main.c:610)1 1350 1 1224 1600 t (AddScreen\(argv=#ff37fec, argc=#1, pfnInit=#23bc\) main.c:531)3 3186 1 1008 1710 t (called from InitOutput+#16 gnot.c:924)3 1998 1 1224 1820 t (AddScreen.i/ #0)1 1296 1 1440 1930 t (AddScreen.pScreen/ #80db0)1 1512 1 1440 2040 t (InitOutput\(argv=#ff37fec, argc=#1, si=#72cd4\) gnot.c:920)3 3024 1 1008 2150 t (called from main+#1e2 main.c:227)3 1728 1 1224 2260 t (main\(argc=#1, argv=#ff37fec\) main.c:137 called from _main+#1e)5 3294 1 1008 2370 t (plan968020/MAIN.s:8)1224 2480 w (main.alwaysCheckForInput/ #0)1 1836 1 1440 2590 t (main.i/ #80)1 810 1 1440 2700 t (_main\(inargv=#ff37ff6, inargc=#1\) plan968020/MAIN.s:1 called from #1)5 3672 1 1008 2810 t 10 R f (The command)1 574 1 720 2990 t 10 CW f ($c)1319 2990 w 10 R f (\(lower case)1 456 1 1464 2990 t 10 CW f (c)1945 2990 w 10 R f (\) omits the local variables.)4 1057 1 2005 2990 t ( place in the executable information describing the types of variables, but a)12 3141(The compiler does not)3 929 2 970 3146 t ( The)1 209(compile\255time flag provides crude support for symbolic debugging.)7 2686 2 720 3266 t 10 CW f (\255s)3643 3266 w 10 R f (flag to the compiler suppresses)4 1249 1 3791 3266 t ( on standard)2 494(code generation and identifies a structure or union in the program whose layout is to be printed)16 3826 2 720 3386 t ( command)1 426(output. The)1 493 2 720 3506 t 10 CW f (dbfmt)1671 3506 w 10 R f (translates this output into)3 1027 1 2003 3506 t 10 CW f (db)3061 3506 w 10 R f ( The)1 211(commands to display the data structure.)5 1617 2 3212 3506 t (easiest way to use this feature is to put a rule in the mkfile:)13 2350 1 720 3626 t 9 CW f (%.db: main.$O)1 810 1 1008 3796 t ($CC \255s$stem main.c | dbfmt > $stem.db)6 1998 1 1440 3906 t 10 R f (Making)720 4086 w 10 CW f (Dir.db)1062 4086 w 10 R f ( the contents)2 519(for example will produce a file by that name containing commands to print)12 3068 2 1453 4086 t (of a)1 159 1 720 4206 t 10 CW f (struct Dir)1 572 1 911 4206 t 10 R f (\(a type in)2 391 1 1515 4206 t 10 CW f ()1938 4206 w 10 R f (\). The)1 270 1 2418 4206 t 10 CW f ($<)2720 4206 w 10 R f (command of)1 509 1 2872 4206 t 10 CW f (db)3413 4206 w 10 R f ( For)1 195( file as commands.)3 767(will read the)2 513 3 3565 4206 t (example,)720 4326 w 9 CW f (main.dirbuf$