%! %%Pages: (atend) %%DocumentFonts: (atend) %%EndComments % % Frame Maker PostScript Prolog 1.11, for use with Maker 1.11 % Copyright (c) 1986,87 by Frame Technology, Inc. All rights reserved. % % Known Problems: % Due to bugs in Transcript, the 'PS-Adobe-' is omitted from line 1 /FMversion (1.11) def /FrameDict 120 dict def % The readline in 23.0 doesn't recognize cr's as nl's on AppleTalk FrameDict /tmprangecheck errordict /rangecheck get put errordict /rangecheck {FrameDict /bug true put} put FrameDict /bug false put mark % Some PS machines read past the CR, so keep the following 3 lines together! currentfile 5 string readline 00 0000000000 cleartomark errordict /rangecheck FrameDict /tmprangecheck get put FrameDict /bug get { /readline { /gstring exch def /gfile exch def /gindex 0 def { gfile read pop dup 10 eq {exit} if dup 13 eq {exit} if gstring exch gindex exch put /gindex gindex 1 add def } loop pop gstring 0 gindex getinterval true } def } if /FMVERSION { FMversion ne { /Times-Roman findfont 18 scalefont setfont 100 100 moveto (Maker version does not match postscript_prolog!) dup = show showpage } if } def /FMLOCAL { FrameDict begin 0 def end } def /landscape FMLOCAL /docheight FMLOCAL /docwidth FMLOCAL /yscale FMLOCAL /xscale FMLOCAL /orgxfer FMLOCAL /orgproc FMLOCAL /organgle FMLOCAL /orgfreq FMLOCAL /FMDOCUMENT { /#copies exch def FrameDict begin 0 ne /landscape exch def /docheight exch def /docwidth exch def /yscale exch def /xscale exch def currenttransfer cvlit /orgxfer exch def currentscreen cvlit /orgproc exch def /organgle exch def /orgfreq exch def end } def /pagesave FMLOCAL /orgmatrix FMLOCAL /FMBEGINPAGE { FrameDict begin /pagesave save def 2 setlinecap xscale yscale scale landscape { 90 rotate 0 docheight neg translate } if /orgmatrix matrix def gsave } def /FMENDPAGE { grestore pagesave restore end showpage } def /fontname FMLOCAL /fontscale FMLOCAL /fontnum FMLOCAL /fontdict FMLOCAL /FMDEFINEFONT { FrameDict begin /fontname exch def /fontscale exch def /fontnum exch def /fontdict fontname findfont fontscale scalefont def fontdict /Encoding get StandardEncoding eq { fontdict DiacriticEncode /fontdict exch def } { fontdict NonDiacriticEncode /fontdict exch def } ifelse FMfonts fontnum fontnum fontdict definefont put end } def /FMLINEWIDTHS { FrameDict begin dup array /FMlinewidths exch def 1 sub -1 0 {exch FMlinewidths 3 1 roll lnormalize put} for end } def FrameDict begin /savematrix { orgmatrix currentmatrix pop } bind def /restorematrix { orgmatrix setmatrix } bind def /dmatrix matrix def /dpi 72 0 dmatrix defaultmatrix dtransform dup mul exch dup mul add sqrt def /max {2 copy lt {exch} if pop} bind def /min {2 copy gt {exch} if pop} bind def /DiacriticEncoding [ /.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 /quotesingle /parenleft /parenright /asterisk /plus /comma /hyphen /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 /grave /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 /Adieresis /Aring /Ccedilla /Eacute /Ntilde /Odieresis /Udieresis /aacute /agrave /acircumflex /adieresis /atilde /aring /ccedilla /eacute /egrave /ecircumflex /edieresis /iacute /igrave /icircumflex /idieresis /ntilde /oacute /ograve /ocircumflex /odieresis /otilde /uacute /ugrave /ucircumflex /udieresis /dagger /.notdef /cent /sterling /section /bullet /paragraph /germandbls /registered /copyright /trademark /acute /dieresis /.notdef /AE /Oslash /.notdef /.notdef /.notdef /.notdef /yen /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /ordfeminine /ordmasculine /.notdef /ae /oslash /questiondown /exclamdown /logicalnot /.notdef /florin /.notdef /.notdef /guillemotleft /guillemotright /ellipsis /.notdef /Agrave /Atilde /Otilde /OE /oe /endash /emdash /quotedblleft /quotedblright /quoteleft /quoteright /.notdef /.notdef /ydieresis /Ydieresis /fraction /currency /guilsinglleft /guilsinglright /fi /fl /daggerdbl /periodcentered /quotesinglbase /quotedblbase /perthousand /Acircumflex /Ecircumflex /Aacute /Edieresis /Egrave /Iacute /Icircumflex /Idieresis /Igrave /Oacute /Ocircumflex /.notdef /Ograve /Uacute /Ucircumflex /Ugrave /dotlessi /circumflex /tilde /macron /breve /dotaccent /ring /cedilla /hungarumlaut /ogonek /caron ] def /FMfonts 255 array def /basefontdict FMLOCAL /newfontdict FMLOCAL /DiacriticEncode { /basefontdict exch def /newfontdict basefontdict maxlength dict def basefontdict {exch dup /FID ne {dup /Encoding eq {exch pop DiacriticEncoding} {exch} ifelse newfontdict 3 1 roll put } {pop pop} ifelse } forall newfontdict } bind def /NonDiacriticEncode { /basefontdict exch def /newfontdict basefontdict maxlength dict def basefontdict {exch dup /FID ne {exch newfontdict 3 1 roll put} {pop pop} ifelse } forall newfontdict } bind def /freq FMLOCAL /bwidth FMLOCAL /bpside FMLOCAL /bstring FMLOCAL /onbits FMLOCAL /offbits FMLOCAL /xindex FMLOCAL /yindex FMLOCAL /x FMLOCAL /y FMLOCAL /setpattern { /freq exch def /bwidth exch def /bpside exch def /bstring exch def /onbits 0 def /offbits 0 def freq 0 {/y exch def /x exch def /xindex x 1 add 2 div bpside mul cvi def /yindex y 1 add 2 div bpside mul cvi def bstring yindex bwidth mul xindex 8 idiv add get 1 7 xindex 8 mod sub bitshift and 0 ne {/onbits onbits 1 add def 1} {/offbits offbits 1 add def 0} ifelse } setscreen {} settransfer offbits offbits onbits add div setgray } bind def /grayness { setgray orgxfer cvx settransfer orgfreq organgle orgproc cvx setscreen } bind def /normalize { transform cvi exch cvi exch itransform } bind def /dnormalize { dtransform cvi exch cvi exch idtransform } bind def /lnormalize { 0 dtransform exch cvi 2 idiv 2 mul 1 add exch idtransform pop } bind def /fillprocs [{0.00 grayness} {0.10 grayness} {0.30 grayness} {0.50 grayness} {0.70 grayness} {0.90 grayness} {0.97 grayness} {1.00 grayness} {<0F1E3C78F0E1C387> 8 1 dpi 16 div setpattern} {<0F87C3E1F0783C1E> 8 1 dpi 16 div setpattern} { 8 1 dpi 16 div setpattern} { 8 1 dpi 16 div setpattern} {<8142241818244281> 8 1 dpi 16 div setpattern} {<03060C183060C081> 8 1 dpi 16 div setpattern} {<8040201008040201> 8 1 dpi 16 div setpattern} {} {1.00 grayness} {0.90 grayness} {0.70 grayness} {0.50 grayness} {0.30 grayness} {0.10 grayness} {0.03 grayness} {0.00 grayness} { 8 1 dpi 16 div setpattern} { 8 1 dpi 16 div setpattern} {<3333333333333333> 8 1 dpi 16 div setpattern} {<0000FFFF0000FFFF> 8 1 dpi 16 div setpattern} {<7EBDDBE7E7DBBD7E> 8 1 dpi 16 div setpattern} { 8 1 dpi 16 div setpattern} {<7FBFDFEFF7FBFDFE> 8 1 dpi 16 div setpattern} {} ] def /H { FMlinewidths exch get setlinewidth } bind def /X { fillprocs exch get exec } bind def /V { gsave eofill grestore } bind def /N { gsave stroke grestore } bind def /M {moveto} bind def /E {lineto} bind def /D {curveto} bind def /O {closepath} bind def /n FMLOCAL /L { /n exch def newpath normalize moveto 2 1 n {pop normalize lineto} for } bind def /Y { L closepath } bind def /K { /n exch def newpath moveto 3 1 n {pop curveto} for } bind def /J { /n exch def newpath moveto 1 1 n {pop curveto} for } bind def /x1 FMLOCAL /x2 FMLOCAL /y1 FMLOCAL /y2 FMLOCAL /R { /y2 exch def /x2 exch def /y1 exch def /x1 exch def x1 y1 x2 y1 x2 y2 x1 y2 4 Y } bind def /C { grestore gsave R clip } bind def /U { grestore gsave } bind def /F { FMfonts exch get setfont } bind def /T { moveto show } bind def /P { moveto 0 32 3 2 roll widthshow } bind def /S { moveto 0 exch ashow } bind def /B { moveto 0 32 4 2 roll 0 exch awidthshow } bind def /Q { moveto gsave show grestore } bind def /x FMLOCAL /y FMLOCAL /dx FMLOCAL /dy FMLOCAL /dl FMLOCAL /t FMLOCAL /t2 FMLOCAL /Cos FMLOCAL /Sin FMLOCAL /r FMLOCAL /W { dnormalize /dy exch def /dx exch def normalize /y exch def /x exch def /dl dx dx mul dy dy mul add sqrt def dl 0.0 gt { /t currentlinewidth def savematrix /Cos dx dl div def /Sin dy dl div def /r [Cos Sin Sin neg Cos 0.0 0.0] def /t2 t 2.5 mul 3.5 max def newpath x y translate r concat 0.0 0.0 moveto dl t 2.7 mul sub 0.0 rlineto stroke restorematrix x dx add y dy add translate r concat t 0.67 mul setlinewidth t 1.61 mul neg 0.0 translate 0.0 0.0 moveto t2 1.7 mul neg t2 2.0 div moveto 0.0 0.0 lineto t2 1.7 mul neg t2 2.0 div neg lineto stroke t setlinewidth restorematrix } if } bind def /G { gsave newpath normalize translate 0.0 0.0 moveto dnormalize scale 0.0 0.0 1.0 5 3 roll arc closepath eofill grestore } bind def /x FMLOCAL /y FMLOCAL /w FMLOCAL /h FMLOCAL /xx FMLOCAL /yy FMLOCAL /ww FMLOCAL /hh FMLOCAL /A { /y exch def /x exch def /h exch def /w exch def x y normalize /yy exch def /xx exch def w h dnormalize /hh exch def /ww exch def ww abs hh abs xx ww add yy hh sub gsave savematrix newpath translate scale 0.0 0.0 1.0 5 3 roll arc 0 setlinecap restorematrix stroke grestore } bind def /FMsaveobject FMLOCAL /FMoptop FMLOCAL /FMdicttop FMLOCAL /BEGINPRINTCODE { /FMdicttop countdictstack 1 add def /FMoptop count 6 sub def /FMsaveobject save def userdict begin /showpage {} def newpath translate 0.0 0.0 moveto } bind def /ENDPRINTCODE { count -1 FMoptop {pop pop} for countdictstack -1 FMdicttop {pop end} for FMsaveobject restore } bind def /gn { 0 { 46 mul cf read pop 32 sub dup 46 lt {exit} if 46 sub add } loop add } bind def /str FMLOCAL /cfs { /str sl string def 0 1 sl 1 sub {str exch val put} for str def } bind def /ic [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0223 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0223 0 {0 hx} {1 hx} {2 hx} {3 hx} {4 hx} {5 hx} {6 hx} {7 hx} {8 hx} {9 hx} {10 hx} {11 hx} {12 hx} {13 hx} {14 hx} {15 hx} {16 hx} {17 hx} {18 hx} {19 hx} {gn hx} {0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16} {17} {18} {19} {gn} {0 wh} {1 wh} {2 wh} {3 wh} {4 wh} {5 wh} {6 wh} {7 wh} {8 wh} {9 wh} {10 wh} {11 wh} {12 wh} {13 wh} {14 wh} {gn wh} {0 bl} {1 bl} {2 bl} {3 bl} {4 bl} {5 bl} {6 bl} {7 bl} {8 bl} {9 bl} {10 bl} {11 bl} {12 bl} {13 bl} {14 bl} {gn bl} {0 fl} {1 fl} {2 fl} {3 fl} {4 fl} {5 fl} {6 fl} {7 fl} {8 fl} {9 fl} {10 fl} {11 fl} {12 fl} {13 fl} {14 fl} {gn fl} ] def /sl FMLOCAL /val FMLOCAL /ws FMLOCAL /im FMLOCAL /bs FMLOCAL /cs FMLOCAL /len FMLOCAL /pos FMLOCAL /ms { /sl exch def /val 255 def /ws cfs /im cfs /val 0 def /bs cfs /cs cfs } bind def 400 ms /ip { is 0 cf cs readline pop { ic exch get exec add } forall pop } bind def /wh { /len exch def /pos exch def ws 0 len getinterval im pos len getinterval copy pop pos len } bind def /bl { /len exch def /pos exch def bs 0 len getinterval im pos len getinterval copy pop pos len } bind def /s1 1 string def /fl { /len exch def /pos exch def /val cf s1 readhexstring pop 0 get def pos 1 pos len add 1 sub {im exch val put} for pos len } bind def /hx { 3 copy getinterval cf exch readhexstring pop pop } bind def /h FMLOCAL /w FMLOCAL /lb FMLOCAL /bitmapsave FMLOCAL /is FMLOCAL /cf FMLOCAL /BEGINBITMAP { gsave translate scale /h exch def /w exch def /lb w 7 add 8 idiv def sl lb lt {lb ms} if /bitmapsave save def /is im 0 lb getinterval def ws 0 lb getinterval is copy pop /cf currentfile def w h 1 [w 0 0 h neg 0 h] {ip} image bitmapsave restore grestore } bind def /ENDBITMAP { } bind def end %%EndProlog %%BeginSetup (1.11) FMVERSION 1. 1. 612. 792. 0 1 FMDOCUMENT 0 12. /Times-Roman FMDEFINEFONT 1 18. /Times-Bold FMDEFINEFONT 2 14. /Times-Bold FMDEFINEFONT 3 14. /Times-Roman FMDEFINEFONT 4 12. /Courier FMDEFINEFONT 5 12. /Times-Italic FMDEFINEFONT 6 12. /Times-Bold FMDEFINEFONT 7 12. /Courier-Bold FMDEFINEFONT 0.5 1. 3. 4. 4 FMLINEWIDTHS %%EndSetup %%Page: "1" 1 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 380.33 36. T (A-1) 72. 36. T 1 F (Appendix A) 72. 706. T (Sample Programs) 215. 706. T 2 F (A.1) 72. 663. T (Overview) 215. 663. T 0 F (The easiest way to learn about a new software resource is to ) 217. 644. T (look at some simple, straightforward working code. Kernighan ) 217. 631. T (and Ritchie\325s C tutorial begins with a program that types ) 217. 618. T 3 F (\322) 217. 604. T 0 F (Hello, world.) 223.22 604. T 3 F (\323) 286.88 604. T 0 F (The term ) 217. 585. T 3 F (\322) 263.66 585. T 0 F (hello-world program) 269.87 585. T 3 F (\323) 369.52 585. T 0 F ( has come to mean a sample or ) 375.74 585. T (demo program that helps new users take the first few steps on ) 217. 571. T (a new system without resorting to trial and error.) 217. 558. T (Here we offer hello-world programs for C, FORTRAN, Pascal, ) 217. 541. T (Lisp, Modula-2, SunView, NeWS, Core, CGI, GKS,and PHIGS. ) 217. 528. T (Each section gives one or more sample programs, with instruc-) 217. 515. T (tions on how to compile and execute the code.) 217. 502. T (We assume that the sample programs are stored in files with ) 217. 485. T (specific names. The name of each program file is surrounded by ) 217. 472. T (asterisks, before each listing.) 217. 459. T 2 F (A.2) 72. 434. T (C) 217. 434. T 4 F (/***********) 144. 403. T ( * hello.c *) 144. 389. T ( ***********/) 144. 375. T ( * C program to print "Hello, world.") 144. 361. T ( *) 144. 347. T ( */) 144. 333. T (main\050\051) 144. 319. T ({) 144. 305. T (printf\050"Hello, world.\134n"\051;) 180. 291. T (}) 144. 277. T 0 F (This is a simple C program above that prints out ) 217. 241. T 3 F (\322) 451.66 241. T 0 F (Hello, world.) 457.88 241. T 3 F (\323) 521.54 241. T 0 F (There is one function, called) 217. 223. T 5 F ( main) 353.97 223. T 0 F (. The empty parentheses after ) 380.97 223. T (the name indicate that ) 217. 210. T 5 F (main) 325.65 210. T 0 F ( has no input parameters. \050Input ) 349.65 210. T (values to the main routine are the parameters the user types on ) 217. 197. T (the command line when invoking the program. For more infor-) 217. 184. T (mation see ) 217. 171. T 5 F (The C Programming Language) 271.66 171. T 0 F ( \050in the index under ) 422. 171. T 5 F (argc) 217. 158. T 0 F ( and ) 239. 158. T 5 F (argv) 262.32 158. T 0 F (\051 by Brian W. Kernighan and Dennis M. Ritchie, ) 284.32 158. T (Prentice-Hall, 1978.\051) 217. 145. T (The body of ) 217. 128. T 5 F (main) 278.66 128. T 0 F ( is contained between braces. There is one ) 302.66 128. T (command: a call to ) 217. 115. T 5 F (printf) 311.66 115. T 0 F (, terminated by a semicolon. For more ) 338.33 115. T (information on ) 217. 102. T 5 F (printf) 291.66 102. T 0 F (, see the ) 318.34 102. T 5 F (Sun UNIX Interface Reference ) 360.33 102. T (Manual) 217. 89. T 0 F (, Section 3S. That section describes the standard I/O ) 254.33 89. T (library, and if you\325re just getting started with C, we recommend ) 217. 76. T FMENDPAGE %%Page: "2" 2 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 72. 36. T (A-2) 521.34 36. T (that you also study the entries for ) 217. 711. T 5 F (fopen) 379.98 711. T 0 F (, ) 406.65 711. T 5 F (fclose) 412.65 711. T 0 F (, ) 440.64 711. T 5 F (getc) 446.64 711. T 0 F (, ) 466.64 711. T 5 F (gets) 472.64 711. T 0 F (, ) 491.97 711. T 5 F (putc) 497.97 711. T 0 F (, ) 518.63 711. T (and ) 217. 698. T 5 F (puts) 237.33 698. T 0 F (.) 257.33 698. T (To compile the program, type:) 217. 678. T 4 F (% cc hello.c -o hello) 144. 656. T 0 F (The C compiler is called cc. C source filenames must end with ) 217. 631. T 5 F (.c) 217. 618. T 0 F (. Typically the object name is the source filename but without ) 225.33 618. T (using the ) 217. 605. T 5 F (-o) 263.67 605. T 0 F ( compiler option the object name is ) 273.66 605. T 5 F (a.out) 445.98 605. T 0 F (. The ) 470.32 605. T 5 F (-o) 497.98 605. T 0 F ( ) 507.98 605. T (compiler option is followed by a string that is the object name. ) 217. 592. T (For more information on the C compiler, refer to the Sun ) 217. 575. T 5 F (UNIX ) 493.64 575. T (Interface Reference Manual) 217. 562. T 0 F (, Section 1, under ) 351.63 562. T 5 F (cc) 438.95 562. T 0 F (. For additional ) 449.61 562. T (information on compiling programs with more than one source ) 217. 549. T (file, refer to Section 1 under ) 217. 536. T 5 F (make) 355.3 536. T 0 F (.) 380.62 536. T 2 F (A.3) 72. 509. T (FORTRAN) 217. 509. T 4 F (C ********************) 144. 478. T (C * fortran_sample.f *) 144. 464. T (C ********************) 144. 450. T (program sample) 180. 436. T (C This is a comment line.) 144. 422. T (print *, \325Greetings from a FORTRAN program.\325) 180. 408. T (end) 180. 394. T 0 F (This simple FORTRAN program above that types out ) 217. 369. T 3 F (\322) 217. 355. T 0 F (Greetings from a FORTRAN program.) 223.22 355. T 3 F (\323) 410.19 355. T 0 F (The program consists of four lines: the program declaration, ) 217. 337. T (a comment, the print command, and the ) 217. 323. T 3 F (\322) 410.64 323. T 0 F (end) 416.86 323. T 3 F (\323) 434.19 323. T 0 F ( line. ) 440.4 323. T (To compile the program, type:) 217. 305. T 4 F (% f77 fortran_sample.f -o fortran_sample) 144. 283. T 0 F (The compiler is called ) 217. 258. T 5 F (f77) 326.98 258. T 0 F (. FORTRAN source filenames must ) 342.32 258. T (end with the) 217. 245. T 5 F ( .f ) 276.33 245. T 0 F (suffix. The default object name is ) 288.66 245. T 5 F (a.out) 455.97 245. T 0 F (, but the) 480.3 245. T ( ) 217. 231. T 5 F (-o) 220. 231. T 0 F ( option overrides that with the name following ) 230. 231. T 3 F (\322) 455.98 231. T 0 F (-o) 462.2 231. T 3 F (\323) 472.19 231. T 0 F ( For ) 478.41 231. T (more information on the FORTRAN compiler, see the ) 217. 217. T 5 F (Sun ) 480.64 217. T (UNIX Interface Reference Manual) 217. 204. T 0 F (, Section 1, under ) 382.62 204. T 5 F (f77) 469.95 204. T 0 F (.) 485.28 204. T (For more information on FORTRAN in the Sun environment, ) 217. 187. T (please see Sun\325s ) 217. 174. T 5 F (FORTRAN Programmer\325s Guide.) 298.65 174. T FMENDPAGE %%Page: "3" 3 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 380.33 36. T (A-3) 72. 36. T 2 F (A.4) 72. 709. T (Pascal) 217. 709. T 4 F (/******************) 144. 678. T ( *pascal_sample.p *) 144. 664. T ( ******************/) 144. 650. T (program sample\050output\051;) 144. 636. T (begin) 144. 622. T (writeln\050\325Greetings from a Pascal program.\325\051) 180. 608. T (end.) 144. 594. T 0 F (This simple Pascal program types out ) 217. 576. T 3 F (\322) 403.32 576. T 0 F (Greetings from a Pas-) 409.54 576. T (cal program.) 217. 561. T 3 F (\323) 277.65 561. T 0 F (The program consists of four lines: the program declaration, the ) 217. 543. T (program\325s begin line, the command that writes the message, ) 217. 530. T (and the program\325s end line.) 217. 517. T (To compile the program, type:) 217. 497. T 4 F (% pc pascal_sample.p -o pascal_sample) 144. 475. T 0 F (The compiler is called pc. Pascal source filenames must end ) 217. 450. T (with the ) 217. 437. T 5 F (.p) 259. 437. T 0 F ( suffix. The default object name is ) 268. 437. T 5 F (ahe) 438.3 437. T 0 F (. The ) 455.63 437. T 5 F (-o) 483.29 437. T 0 F ( option ) 493.29 437. T (overrides that with the name following ) 217. 424. T 5 F (-o) 406.31 424. T 0 F (. For more information ) 416.31 424. T (on the Pascal compiler, see the ) 217. 411. T 5 F (Sun UNIX Interface Reference ) 367.97 411. T (Manual) 217. 398. T 0 F (, Section 1, under ) 254.33 398. T 5 F (pc) 341.66 398. T 0 F (. For general information on Pascal ) 352.98 398. T (in the Sun environment, please see ) 217. 385. T 5 F (Pascal Programmer\325s Guide) 386.64 385. T 0 F (.) 525.29 385. T 2 F (A.5) 72. 358. T (Modula-2) 217. 358. T 4 F (\050*************************) 144. 327. T ( * modula-2_sample.mod *) 144. 313. T ( *************************\051) 144. 299. T (MODULE hello;) 144. 285. T (FROM InOut IMPORT WriteString, WriteLn;) 144. 271. T (BEGIN) 144. 257. T (WriteString \050"Hello, World!"\051;) 180. 243. T (WriteLn) 180. 229. T (END hello.) 144. 215. T 0 F (The simple Modula-2 program types out ) 217. 197. T 3 F (\322) 414.32 197. T 0 F (Hello, World) 420.53 197. T 3 F (!\323) 483.86 197. T 0 F ( The ) 494.73 197. T (program consists of six lines: the program declaration, declara-) 217. 183. T (tion of output primitive, BEGIN statement, printing of the ) 217. 170. T (string, a linefeed, and the END statement.) 217. 157. T (To compile the program, type:) 217. 137. T 4 F (% m2c -e modula-2_sample modula-2_sample.mod) 144. 115. T 0 F (The compiler is called ) 217. 90. T 5 F (m2c) 326.98 90. T 0 F (. Modula-2 source filenames end with ) 346.97 90. T (a ) 217. 77. T 5 F (.mod) 225.33 77. T 0 F ( suffix. For simple programs such as this example, the ) 248.99 77. T FMENDPAGE %%Page: "4" 4 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 72. 36. T (A-4) 521.34 36. T (compile and link steps may be combined. For more information ) 217. 711. T (on the Modula-2 compiler, see the) 217. 698. T 5 F ( Sun UNIX Interface Refer-) 381.64 698. T (ence Manual) 217. 685. T 0 F (, Section 1, under ) 279.32 685. T 5 F (m2c) 366.64 685. T 0 F (. For general information on ) 386.63 685. T (Modula-2 in the Sun environment, please see ) 217. 672. T 5 F (Using Modula-2 ) 439.97 672. T (on the Sun Workstation) 217. 659. T 0 F (. ) 329.33 659. T 2 F (A.6) 72. 632. T (Assembly Languages) 217. 632. T 0 F (It is generally not a good practice to program at this level ) 217. 610. T (because it severely restricts portability. Also, Sun\325s compilers ) 217. 597. T (can efficiently generate optimized code at different levels, elimi-) 217. 584. T (nating the need for assembly language programming. However, ) 217. 571. T (for those who still like to program in assembly, Sun supports ) 217. 558. T (calling between assembly and other high-level languages. ) 217. 545. T (Between Sun\325s different systems, there are three instruction ) 217. 532. T (sets: Motorola 680X0, Intel 80386 for the new Sun386) 217. 519. T 5 F (i) 479.98 519. T 0 F (, and ) 483.32 519. T (Sun\325s SPARC. In the following examples, a high-level language ) 217. 506. T (calls an assembly routine that increments the value of a vari-) 217. 493. T (able by one that is passed to it.) 217. 480. T 2 F (A.6.1) 72. 445. T (Motorola 68020; Pascal Calls Assembly ) 216. 445. T 6 F (main.p:) 144. 423. T 4 F (program main\050input, output\051;) 180. 410. T (var) 180. 396. T (x:integer;) 215. 382. T (procedure assfunc\050var x:integer\051;) 180. 368. T (* declare the assembly routine *\051) 180. 354. T (external c;) 180. 340. T (begin) 180. 326. T (x := 1000;) 215. 298. T (writeln\050\325x before call = \325, x\051;) 215. 284. T (ssfunc\050x\051;) 215. 270. T (writeln\050\325x after call = \325, x\051;) 215. 256. T (end.) 180. 242. T 6 F (assfunc.s:) 144. 213. T 4 F (.globl _assfunc) 180. 200. T (_assfunc:) 180. 186. T (link) 215. 172. T (a6, #0) 252. 172. T (movl) 215. 158. T (a6@\0508\051, a0) 252. 158. T (movl) 215. 144. T (a0@, d0) 252. 144. T (ovl) 215. 130. T (d0, a0@) 252. 130. T (unlk) 215. 116. T (a6) 252. 116. T (rts) 215. 102. T FMENDPAGE %%Page: "5" 5 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 380.33 36. T (A-5) 72. 36. T (To compile this example, type:) 217. 711. T 4 F (% pc main.p assfunc.s -o executable) 144. 689. T 2 F (A.6.2) 72. 662. T (Intel 80386; C Calls Assembly) 216. 662. T 6 F (main.c:) 144. 640. T 4 F (include ) 180. 626. T (main\050\051) 180. 612. T ({) 180. 598. T (int x;) 215. 584. T (x = 1000;) 215. 556. T (printf\050"x before call = %d\134n", x\051;) 215. 542. T (assfunc\050&x\051;) 215. 528. T (printf\050"x after call = %d\134n", x\051;) 215. 514. T (}) 180. 500. T 6 F (assfunc.s:) 144. 471. T 4 F (.file "assfunc.s") 180. 457. T (.globl assfunc) 180. 443. T (assfunc:) 180. 429. T (pushl) 215. 415. T (%ebp) 252. 415. T (movl) 215. 401. T (%esp, %ebp) 252. 401. T (movl) 215. 387. T (8\050%esp\051, %eax) 252. 387. T (incl) 215. 373. T (\050%eax\051) 252. 373. T (leave) 215. 359. T (ret) 215. 345. T 2 F (A.6.3) 72. 318. T (SPARC; FORTRAN Calls Assembly) 216. 318. T 0 F (To compile this program, type:) 217. 291. T 4 F (% cc main.c assfunc.s -o executable) 144. 269. T 6 F (main.f:) 144. 240. T 4 F (program main) 180. 227. T (integer x) 180. 213. T (x = 1000) 180. 199. T (print *, \325x before call = \325, x) 180. 185. T (call assfunc\050x\051) 180. 171. T (print *, \325x after call = \325, x) 180. 157. T (stop) 180. 143. T (end) 180. 129. T FMENDPAGE %%Page: "6" 6 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 72. 36. T (A-6) 521.34 36. T 7 F (assfunc.s:) 144. 711. T 4 F (.global) 180. 698. T (_assfunc_) 230.4 698. T (_assfunc_:) 180. 684. T (ld) 180. 670. T ([%o0], %o1) 215. 670. T (inc) 180. 656. T (%o1) 215. 656. T (st) 180. 642. T (%o1, [%o0]) 215. 642. T (retl) 180. 628. T (add) 180. 614. T (%g0,0,%o0) 215. 614. T 0 F (To compile this program, type:) 217. 589. T 4 F (% f77 main.f assfunc.s) 144. 567. T 2 F (A.7) 72. 542. T (Sockets) 217. 542. T 4 F (/*************************) 144. 511. T (* socketsample_server.c *) 144. 497. T (*************************/) 144. 483. T (}) 144. 469. T (/* ) 72. 455. T ( Server.c) 72. 427. T ( opens a socket in the internet domain \050AF_INET\051 and ) 72. 399. T (binds to a port \050IPPORT_RESERVED + 100\051. It then listens on that ) 72. 385. T (port. Once a connection is requested and made, the server and ) 72. 371. T (client communicate with regular "read" and "write" system calls) 72. 357. T (*/ ) 72. 331. T (#include ) 72. 305. T (#include ) 72. 291. T (#include ) 72. 277. T (#include ) 72. 263. T (void sighandler\050\051;) 72. 237. T (main\050\051 ) 72. 223. T ({ ) 72. 209. T (int sd, ns; ) 130. 183. T (char inbuf[256], outbuf[256]; ) 130. 169. T (struct sockaddr_in sockaddr, from; ) 130. 155. T (int fromlen, rt; ) 130. 141. T (sockaddr.sin_port = IPPORT_RESERVED + 100; ) 130. 127. T (sd = socket\050AF_INET, SOCK_STREAM, 0\051; ) 130. 113. T (if \050bind\050sd, \050char *\051&sockaddr, sizeof\050sockaddr\051\051 < 0\051 ) 130. 99. T ({ ) 130. 85. T FMENDPAGE %%Page: "7" 7 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 380.33 36. T (A-7) 72. 36. T 4 F (printf\050"bind failed.\134n"\051; ) 187. 712. T (perror\050"bind"\051; ) 187. 698. T (exit\0501\051; ) 187. 684. T (} ) 130. 670. T (listen\050sd, 1\051; ) 130. 656. T (fromlen = sizeof\050from\051; ) 130. 642. T (ns = accept\050sd, &from, &fromlen\051; ) 130. 628. T (close\050sd\051; ) 130. 614. T (printf\050"Waiting for message ......\134n"\051; ) 130. 600. T (while\0501\051 ) 130. 586. T ({ ) 130. 572. T (if \050\050rt = read\050ns, inbuf, sizeof\050inbuf\051\051\051 == 0\051 ) 187. 558. T (continue; ) 72. 544. T (inbuf[rt] = \325\1340\325; ) 187. 530. T (printf\050"Server read: %s\134n", inbuf\051; ) 187. 516. T (printf\050"type in your message: "\051; ) 187. 502. T (gets\050outbuf\051; ) 187. 488. T (write\050ns, outbuf, strlen\050outbuf\051\051; ) 187. 474. T (printf\050"Wait for message ......\134n"\051; ) 187. 460. T (} ) 130. 446. T (} ) 72. 432. T (/*************************) 180. 418. T ( * socketsample_client.c *) 144. 404. T ( *************************/) 144. 390. T (/*) 144. 376. T (/*) 72. 348. T ( Client.c) 72. 320. T ( opens a socket in the internet domain \050AF_INET\051 and ) 72. 292. T (connects to port \050IPPORT_RESERVED + 100\051 on a remote host, in ) 72. 278. T (this example "soorya". Once this connection is established, the) 72. 264. T (client and thre remote host communicate via regular "read" and ) 72. 250. T ("write" system calls ) 72. 236. T (*/) 72. 210. T (#include ) 72. 196. T (#include ) 72. 182. T (#include ) 72. 168. T (#include ) 72. 154. T (#include ) 72. 140. T (main\050\051 ) 72. 114. T ({ ) 72. 100. T FMENDPAGE %%Page: "8" 8 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 72. 36. T (A-8) 521.34 36. T 4 F (int sd, rt; ) 130. 712. T (char outbuf[256], inbuf[256]; ) 130. 698. T (struct sockaddr_in sockaddr; ) 130. 684. T (struct hostent *hp; ) 130. 670. T (if \050\050hp = gethostbyname\050"soorya"\051\051 == NULL\051 ) 130. 656. T ({ ) 130. 642. T (printf\050"unknown host\134n"\051; ) 187. 628. T (exit\0501\051; ) 187. 614. T (} ) 130. 600. T (bzero\050\050char *\051&sockaddr, sizeof\050sockaddr\051\051; ) 130. 586. T (bcopy\050hp->h_addr, \050char *\051&sockaddr.sin_addr, hp-) 130. 572. T (>h_length\051; ) 72. 558. T (sockaddr.sin_family = AF_INET; ) 130. 544. T (sockaddr.sin_port = IPPORT_RESERVED + 100; ) 130. 530. T (sd = socket\050AF_INET, SOCK_STREAM, 0\051; ) 130. 516. T (if \050connect\050sd, &sockaddr, sizeof\050sockaddr\051\051 == -1\051 ) 130. 502. T ({ ) 130. 488. T (printf\050"Connect failed.\134n"\051; ) 187. 474. T (perror\050"connect"\051; ) 187. 460. T (exit\0501\051; ) 187. 446. T (} ) 130. 432. T (for \050;;\051 ) 130. 418. T ({ ) 130. 404. T (printf\050"type in your message: "\051; ) 187. 390. T (gets\050outbuf\051; ) 187. 376. T (write\050sd, outbuf, strlen\050outbuf\051\051; ) 187. 362. T (printf\050"Waiting for message ......\134n"\051; ) 187. 348. T (while \0501\051 ) 187. 334. T ({ ) 187. 320. T (if \050\050rt = read\050sd, inbuf, sizeof\050inbuf\051\051\051 ) 245. 306. T (== 0\051 ) 72. 292. T (continue; ) 245. 278. T (inbuf[rt] = \325\1340\325; ) 245. 264. T (printf\050"Client read: %s\134n", inbuf\051; ) 245. 250. T (break; ) 245. 236. T (} ) 187. 222. T (} ) 130. 208. T (} ) 72. 194. T 0 F (These two programs illustrate above how two processes can ) 217. 150. T (communicate via a socket. The first program, socketsam-) 217. 137. T (ple_server.c, listens for input on the socket and echoes to the ) 217. 124. T (screen whatever characters come in. The second program, ) 217. 111. T (socketsample_client.c, prompts the user to type in a message; ) 217. 98. T (this message is sent to the server via the socket.) 217. 85. T FMENDPAGE %%Page: "9" 9 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 380.33 36. T (A-9) 72. 36. T (To compile the programs, type the following two lines:) 217. 711. T 4 F (% cc socketsample_server.c -o socketsample_server) 144. 689. T (% cc socketsample_client.c -o socketsample_client) 144. 675. T 0 F (To execute the programs, first run the server in background:) 217. 650. T 4 F (% socketsample_server &) 144. 628. T 0 F (Then run the client:) 217. 603. T 4 F (% socketsample_client) 144. 581. T 0 F (The client will prompt you for messages to be sent to the serv-) 217. 556. T (er. When you are finished, type ) 217. 543. T 4 F (Control-C) 370.96 543. T 0 F ( at the Type in your ) 435.76 543. T (message: prompt.) 217. 529. T 2 F (A.8) 72. 502. T (Remote Procedure Calls \050RPC\051) 217. 502. T 4 F (/**********************) 144. 471. T ( * rpcsample_server.c *) 144. 457. T ( **********************) 144. 443. T (#include ) 144. 415. T (char *add_one\050\051;) 144. 387. T (main\050\051) 144. 373. T ({) 144. 359. T (/* Register the "add_one" routine */) 180. 345. T 5.4 (registerrpc\0500x20000100, 1, 1, add_one, xdr_int,) 180. 331. P (xdr_int\051;) 144. 317. T (/* Run forever */) 180. 289. T (svc_run\050\051;) 180. 275. T (}) 144. 261. T (char *add_one\050input_value\051) 144. 233. T (char *input_value;) 144. 219. T ({) 144. 205. T (int return_me;) 180. 177. T (/* Think of input_value as a pointer to an */) 180. 149. T (/* integer; take what it points to, and add 1. */) 180. 135. T (return_me = *\050int *\051input_value + 1;) 180. 121. T (/* Return a pointer to return_me, cast as a */) 180. 93. T (/* pointer to a char instead of an int because */) 180. 79. T FMENDPAGE %%Page: "10" 10 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 72. 36. T (A-10) 515.34 36. T 4 F (/* that\325s what XDR expects. */) 180. 712. T (return\050\050char *\051&return_me\051;) 180. 698. T (}) 144. 684. T (/**********************) 180. 656. T ( * rpcsample_client.c *) 180. 642. T ( **********************/) 180. 628. T (#include ) 144. 600. T (main\050argc, argv\051) 144. 572. T (int argc;) 144. 558. T (char *argv[];) 144. 544. T ({) 144. 530. T (int argument, result;) 180. 516. T 2.4 (/* Check that there are command-line parameters.) 180. 488. P (*/) 144. 474. T (if \050argc != 3\051 {) 180. 460. T 43.7 (printf\050"Usage: %s server_hostname) 215. 446. P (input_value\134n",) 144. 432. T ( argv[0]\051;) 215. 418. T (exit\0501\051;) 215. 404. T (}) 180. 390. T 4.8 (/* Convert command-line parameter string to an) 180. 376. P (integer. */) 144. 362. T (argument = atoi\050argv[2]\051;) 180. 348. T (/* Make the rpc call. */) 180. 334. T (callrpc\050argv[1], 0x20000100, 1, 1, ) 180. 320. T (xdr_int, &argument,xdr_int, &result\051;) 252. 306. T (/* Print result. */) 180. 292. T (printf\050"Result = %d\134n", result\051;) 180. 278. T (}) 144. 264. T 0 F (These two programs above show how to implement a simple ) 217. 233. T (RPC client/server pair.) 217. 220. T (The server registers a routine called add_one, which takes an ) 217. 203. T (integer input, adds one, and returns the integer result. This ) 217. 190. T (routine is registered with program number = 0x20000100, ver-) 217. 177. T (sion number = 1, and procedure number = 1. ) 217. 164. T (To compile the server, type:) 217. 144. T 4 F (% cc rpcsample_server.c -o rpcsample_server) 144. 122. T FMENDPAGE %%Page: "11" 11 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 380.33 36. T (A-11) 72. 36. T (To compile the client, type:) 217. 711. T 4 F (% cc rpcsample_client.c -o rpcsample_client) 144. 689. T 0 F (To execute the programs, first run the server on the host of your ) 217. 664. T (choice \050it could be the one you are sitting at or any other one on ) 217. 651. T (the network.\051 To run the client, type ) 217. 638. T 4 F (rpcsample_client) 396.3 638. T 0 F (, fol-) 511.5 638. T (lowed by the name of the machine which is running the server ) 217. 624. T (program, followed by an integer. For example, if your server ) 217. 611. T (program is running on a machine named terrapin and you want ) 217. 598. T (to know what the next number after 11 is, type:) 217. 585. T 4 F (% rpcsample_client terrapin 11) 144. 563. T 0 F (The client program will send 11 to terrapin as a parameter of the ) 217. 538. T (add_one function. Terrapin will add 1 to 11 and return the ) 217. 525. T (result to the local machine, which will output:) 217. 512. T 4 F (Result = 12) 144. 490. T 0 F (For more information on RPC, please refer to the ) 217. 465. T 5 F (Sun Network ) 456.3 465. T (Programming Manual) 217. 452. T 0 F (. For more sophisticated RPC program-) 327.66 452. T (ming, Sun provides a code-generation tool named rpcgen. This ) 217. 439. T (tool is also described in the ) 217. 426. T 5 F (Network Programming Manual) 350.99 426. T 0 F (.) 505.32 426. T FMENDPAGE %%Page: "12" 12 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 72. 36. T (A-12) 515.34 36. T 2 F (A.9) 72. 709. T (External Data Representation \050XDR\051) 217. 709. T 4 F (/*********************\134) 180. 678. T ( * xdrsample_server.c *) 180. 664. T (\134**********************/) 180. 650. T (#include ) 144. 622. T (struct int_and_char_struct {) 144. 594. T (int i;) 180. 580. T (char c;) 180. 566. T (};) 144. 552. T (xdr_int_and_char\050xdrsp, int_and_char_struct_ptr\051) 144. 524. T (XDR *xdrsp;) 144. 510. T (struct int_and_char_struct *int_and_char_struct_ptr;) 144. 496. T ({) 144. 482. T (if \050!xdr_int\050xdrsp, &int_and_char_struct_ptr->i\051\051) 180. 468. T (return\050FALSE\051;) 215. 454. T (if \050!xdr_char\050xdrsp, &int_and_char_struct_ptr->c\051\051) 180. 440. T (return\050FALSE\051;) 215. 426. T (return\050TRUE\051;) 180. 412. T (}) 144. 398. T (char *add_one\050\051;) 144. 370. T (main\050\051) 144. 342. T ({) 144. 328. T (/* Register the "add_one" routine */) 180. 314. T (registerrpc\0500x20000101, 1, 1, ) 180. 300. T (add_one, xdr_int_and_char, xdr_int_and_char\051;) 215. 286. T (/* Run forever */) 180. 258. T (svc_run\050\051;) 180. 244. T (}) 144. 230. T (char *add_one\050input_value\051) 144. 202. T (char *input_value;) 144. 188. T ({) 144. 174. T (struct int_and_char_struct return_me;) 180. 160. T (struct int_and_char_struct *input_ptr;) 180. 146. T (input_ptr = \050struct int_and_char_struct *\051) 180. 118. T (input_value;) 215. 104. T (return_me.i = input_ptr->i + 1;) 180. 90. T (return_me.c = input_ptr->c + 1;) 180. 76. T FMENDPAGE %%Page: "13" 13 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 380.33 36. T (A-13) 72. 36. T 4 F (return\050\050char *\051&return_me\051;) 180. 712. T 72. 72. 540. 720. R 7 X V 0 X (}) 144. 712. T (/*********************) 180. 684. T (* xdrsample_client.c *) 180. 670. T (\134*********************/) 180. 656. T (#include ) 144. 642. T (struct int_and_char_struct {) 144. 614. T (int i;) 180. 600. T (char c;) 180. 586. T (};) 144. 572. T (static struct int_and_char_struct arguments, results;) 144. 544. T (xdr_int_and_char\050xdrsp, int_and_char_struct_ptr\051) 144. 516. T (XDR *xdrsp;) 144. 502. T (struct int_and_char_struct *int_and_char_struct_ptr;) 144. 488. T ({) 144. 474. T (if \050!xdr_int\050xdrsp, &int_and_char_struct_ptr->i\051\051) 180. 460. T (return\050FALSE\051;) 215. 446. T (if \050!xdr_char\050xdrsp, &int_and_char_struct_ptr->c\051\051) 180. 432. T (return\050FALSE\051;) 215. 418. T (return\050TRUE\051;) 180. 404. T (}) 144. 390. T (main\050argc, argv\051) 144. 362. T (int argc;) 144. 348. T (char *argv[];) 144. 334. T ({) 144. 320. T 2.4 (/* Check that there are command-line parameters.) 180. 306. P (*/) 144. 292. T (if \050argc != 4\051 {) 180. 278. T 19.53 (printf\050"Usage: %s server_hostname int) 215. 264. P (char\134n", argv[0]\051;) 144. 250. T (exit\0501\051;) 215. 236. T (}) 180. 222. T (/* Store command-line parameters in struct. */) 180. 208. T (arguments.i = atoi\050argv[2]\051;) 180. 194. T (arguments.c = argv[3][0];) 180. 180. T (/* Make the rpc call. */) 180. 166. T (callrpc\050argv[1], 0x20000101, 1, 1,) 180. 152. T (xdr_int_and_char, &arguments,) 180. 138. T (xdr_int_and_char, &results\051;) 180. 124. T (/* Print results. */) 180. 110. T (printf\050"Result = %d %c\134n", results.i, results.c\051;) 180. 96. T (}) 144. 82. T FMENDPAGE %%Page: "14" 14 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 72. 36. T (A-14) 515.34 36. T (These programs above illustrate the user-defined XDR facility ) 217. 694. T (of Remote Procedure Calls \050RPCs\051.) 217. 681. T (Simple RPC calls, as illustrated in the last section, pass single ) 217. 664. T (parameters and return values. However, it is sometimes desir-) 217. 651. T (able to pass more complicated values, such as strings or ) 217. 638. T (structs. To do this, a programmer must concoct a custom XDR ) 217. 625. T (call out of the standard building blocks.) 217. 612. T (In our example, we pass a struct called an int_and_char_struct, ) 217. 595. T (which consists of one integer and one character. The client ini-) 217. 582. T (tializes this struct from the user\325s command line and passes it ) 217. 569. T (to the server. The server increments both fields of its input ) 217. 556. T (struct and returns the results in another int_and_char_struct.) 217. 543. T (Both the server and the client contain the routine ) 217. 526. T (xdr_int_and_char\050\051, which handles translation between ) 217. 513. T (int_and_char_structs and XDR. The xdr_int_and_char\050\051 routine ) 217. 500. T (just calls xdr_int\050\051 and xdr_char\050\051 in turn, since the struct con-) 217. 487. T (sists of an int followed by a char.) 217. 474. T (Correct programming style calls for the definition of the ) 217. 457. T (int_and_char_struct structure to be in a *.h header file, and for ) 217. 444. T (xdr_int_and_char\050\051 to be in its own module, which is linked with ) 217. 431. T (the server and client programs. This ensures that there is only ) 217. 418. T (one version of the struct definition and the xdr routine. We ) 217. 405. T (have neglected good style in this case to make the example ) 217. 392. T (more clear, but we need to emphasize that you should not do ) 217. 379. T (this.) 217. 366. T (To compile the programs, type:) 217. 346. T 4 F (% cc xdrsample_server.c -o xdrsample_server) 144. 324. T (% cc xdrsample_client.c -o xdrsample_client) 144. 310. T 0 F (To execute the programs, first run the server on some host, ) 217. 285. T (preferably in background:) 217. 272. T 4 F (% xdrsample_server &) 144. 250. T 0 F (Then run the client, with three parameters: the name of the host ) 217. 225. T (on which the server is running, an integer, and a character. The ) 217. 212. T (client passes the integer and the character to the server, and ) 217. 199. T (displays the results. For example, if you run the server on a ) 217. 186. T (machine named terrapin and you type:) 217. 173. T 4 F (% xdrsample_client terrapin 4 w) 144. 151. T 0 F (Then you would see:) 217. 126. T 4 F (% Result = 5 x) 144. 104. T FMENDPAGE %%Page: "15" 15 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 380.33 36. T (A-15) 72. 36. T 2 F (A.10) 72. 709. T (Lisp) 217. 709. T 0 F (The following code uses Lisp to print out ) 217. 684. T 3 F (\322) 418.32 684. T 0 F (Hello World.) 424.54 684. T 3 F (\323) 487.86 684. T 0 F ( ) 494.08 684. T (Because Lisp is interpreted, all you have to do is simply type:) 217. 670. T 4 F (\050defun hello-world \050\051) 144. 648. T ( \050format t "Hello World ~%"\051\051) 144. 634. T 0 F (This defines the function to the Lisp interpreter. To evaluate ) 217. 609. T (the function \050i.e., run the program\051 type:) 217. 596. T 4 F (\050hello-world\051) 144. 574. T 0 F (For complete details on Sun\325s Lisp implementation, please ) 217. 549. T (refer to the ) 217. 536. T 5 F (Sun Common LISP User\325s Guide ) 272.64 536. T 0 F (and the ) 434.3 536. T 5 F (Sun Com-) 472.29 536. T (mon Lisp Reference Manual) 217. 523. T 0 F (.) 352.65 523. T 2 F (A.11) 72. 490. T (SunView) 217. 490. T 4 F (/******************) 180. 459. T ( * sunview_hello.c *) 180. 445. T ( ******************/ ) 180. 431. T (#include /* Sunview header file */) 144. 403. T (#include /* Canvas header file */) 144. 389. T (Frame my_frame;) 144. 361. T (Canvas my_canvas;) 144. 347. T (Pixwin *my_pw;) 144. 333. T (main\050\051) 144. 305. T ({) 144. 291. T (my_frame = window_create\050NULL, FRAME,) 180. 277. T (FRAME_LABEL, "Hello, world.",) 215. 263. T (0\051;) 215. 249. T (my_canvas = window_create\050my_frame, CANVAS, 0\051;) 180. 221. T (my_pw = canvas_pixwin\050my_canvas\051;) 180. 207. T (pw_vector\050my_pw, 0, 0, 200, 200, PIX_SET, 0\051;) 180. 193. T (window_main_loop\050my_frame\051;) 180. 165. T (}) 144. 151. T 0 F (This simple SunView program creates a frame, puts a canvas in ) 217. 120. T (the frame, opens a pixwin on the canvas, and draws a vector.) 217. 107. T FMENDPAGE %%Page: "16" 16 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 72. 36. T (A-16) 515.34 36. T (To compile it, type:) 217. 711. T 4 F 4.11 (% cc sv_hello.c -o sv_hello -lsuntool -lsunwindow -) 144. 689. P (lpixrect) 144. 675. T 0 F (You must be in the SunView window system to execute sun-) 217. 658. T (view_hello. The tool that sunview_hello creates stays on your ) 217. 645. T (screen until it is destroyed, which can be done in one of two ) 217. 632. T (ways. First, with the mouse in the shelltool window from which ) 217. 619. T (you invoked sunview_hello, type Control-C. Or, you can point ) 217. 606. T (to the tool\325s black border with the mouse, hold down the right ) 217. 593. T (button to bring up a menu, and select Quit.) 217. 580. T 2 F (A.12) 72. 553. T (NeWS) 217. 553. T 4 F (/************) 144. 522. T ( * hello.ps *) 144. 508. T ( ************/) 144. 494. T (/hello_world {% x,y => - \050 print "Hello World" at x,y\051) 144. 466. T (moveto) 180. 452. T (/Times-Roman findfont) 180. 438. T (15 scalefont) 180. 424. T (setfont) 180. 410. T (\050Hello World\051 show) 180. 396. T (showpage) 180. 382. T (} def) 144. 368. T (/makewin {% - => - \050builds a test window\051) 144. 340. T (/win framebuffer /new DefaultWindow send def) 180. 326. T (%) 496.8 326. T (cliche) 144. 312. T ({) 180. 298. T (% draw after damage) 215. 298. T (/PaintClient {10 10 hello_world} def) 215. 284. T (/FrameLabel \050NeWS Demo\051 def) 215. 270. T (% label window) 409.4 270. T (} win send) 180. 256. T (% execute contents of) 319. 256. T (% {} in win\325s context) 319. 242. T (/reshapefromuser win send % select size/position) 180. 214. T (/map win send) 180. 200. T ( % make visible) 319. 200. T (} def) 144. 186. T (makewin) 144. 158. T (% run the program) 319. 158. T 0 F (This is a sample NeWS program that draws a window on the ) 217. 133. T (screen and writes ) 217. 119. T 3 F (\322) 303.3 119. T 0 F (Hello World) 309.52 119. T 3 F (\323) 369.84 119. T 0 F ( in the window. Since the ) 376.06 119. T (PostScript is interpreted rather than compiled, it is not neces-) 217. 105. T (sary to compile the program. ) 217. 92. T FMENDPAGE %%Page: "17" 17 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 380.33 36. T (A-17) 72. 36. T ( In a terminal emulator window in the NeWS environment, type:) 217. 711. T 4 F (% psh hello.ps) 144. 689. T 0 F (For more information on NeWS, please refer to the ) 217. 664. T 5 F (Sun NeWS ) 465.62 664. T (1.1 Manual) 217. 651. T 0 F (. To learn about PostScript, the two standard texts ) 272.33 651. T (are the ) 217. 638. T 5 F (PostScript Language Reference Manual) 252.32 638. T 0 F ( and the ) 444.63 638. T 5 F (PostScript Language Tutorial and Cookbook) 217. 625. T 0 F (, both written by ) 433.01 625. T (Adobe Systems and published by Addison-Wesley. ) 217. 612. T 2 F (A.13) 72. 587. T (SunCore) 217. 587. T 4 F (/****************) 144. 556. T ( * core_glass.c *) 144. 542. T ( ****************/) 144. 528. T (#include ) 144. 500. T (static float glassdx[] = {-10.0, 9.0, 0.0, -14.0, 30.0,) 144. 472. T (-14.0, 0.0, 9.0, -10.0};) 180. 458. T (static float glassdy[] = {0, 1, 19, 15, 0, -15,) 144. 444. T (-19, -1, 0};) 180. 430. T (int pixwindd\050\051;) 144. 416. T (struct vwsurf vwsurf = DEFAULT_VWSURF\050pixwindd\051;) 144. 402. T (main\050\051) 144. 374. T ({) 144. 360. T (initialize_core\050BASIC, NOINPUT, TWOD\051;) 180. 346. T (initialize_view_surface\050&vwsurf, FALSE\051;) 180. 332. T (select_view_surface\050&vwsurf\051;) 180. 318. T (set_viewport_2\0500.125, 0.875, 0.125, 0.75\051;) 180. 304. T (set_window\050-50.0, 50.0, -10.0, 80.0\051;) 180. 290. T (create_temporary_segment\050\051;) 180. 276. T (move_abs_2\0500.0, 0.0\051;) 180. 262. T (polyline_rel_2\050glassdx, glassdy, 9\051;) 180. 248. T (move_rel_2\050-12.0, 33.0\051;) 180. 234. T (line_rel_2\05024.0, 0.0\051;) 180. 220. T (close_temporary_segment\050\051;) 180. 206. T (sleep\05010\051;) 180. 178. T (deselect_view_surface\050&vwsurf\051;) 180. 164. T (terminate_core\050\051;) 180. 150. T (}) 144. 136. T 0 F (This sample program above shows how to use SunCore in a ) 217. 105. T (SunView tool. The program creates a tool with a control panel ) 217. 92. T (and a canvas subwindow. Pushing the Draw button in the panel ) 217. 79. T FMENDPAGE %%Page: "18" 18 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 72. 36. T (A-18) 515.34 36. T (causes Core to draw a martini in the canvas.) 217. 711. T (The tricky part about getting SunCore and SunView to ) 217. 694. T (cooperate is telling the window system about where Core ) 217. 681. T (should draw. The window system expects programs to have ) 217. 668. T (an environment variable, called ) 217. 655. T 5 F (WINDOW_GFX) 371.3 655. T 0 F (, which con-) 449.94 655. T (tains the name of the window device upon which graphics are ) 217. 642. T (to be drawn. \050To see this for yourself, type pri) 217. 629. T 4 F (ntenv ) 440.96 629. T (WINDOW_GFX) 217. 615. T 0 F ( in a tty window; the response will be some-) 289. 615. T (thing like /dev/win18.\051) 217. 601. T (Three lines in the sample program set the ) 217. 584. T 5 F (WINDOW_GFX) 418.3 584. T 0 F ( ) 496.95 584. T (environment variable to the appropriate value. These lines are:) 217. 571. T 4 F (canvasfd = \050int\051window_get\050canvas, WIN_FD, 0\051;) 144. 549. T (win_fdtoname\050canvasfd, window_dev_name\051;) 144. 535. T (we_setgfxwindow\050window_dev_name\051;) 144. 521. T 0 F (The first line uses window_get\050\051 to get the file descriptor ) 217. 496. T (that corresponds to the canvas. The second line uses ) 217. 483. T (win_fdtoname\050\051 to convert the file descriptor \050which is an ) 217. 470. T (integer, e.g. 18\051 to a device name string \050e.g. /dev/win18\051. ) 217. 457. T (The third line sets the ) 217. 444. T 5 F (WINDOW_GFX ) 323.99 444. T 0 F (environment variable to ) 405.64 444. T (the device name string, using the we_setgfxwindow\050\051 function.) 217. 431. T (To compile the program, type:) 217. 411. T 4 F 3.09 (% cc core_glass.c -o core_glass -lcore -lsunwindow -) 144. 389. P (lpixrect -lm) 144. 375. T 0 F (To execute, type ) 217. 350. T 4 F (core_glass) 299.64 350. T 0 F ( in a terminal-emulator or ) 371.64 350. T (graphics window, in the SunView environment.) 217. 336. T 2 F (A.14) 72. 311. T (SunCGI) 217. 311. T 4 F (/****************) 144. 280. T ( * cgi_sample.c *) 144. 266. T ( ****************/) 144. 252. T (#include /* Sunview header file */) 144. 238. T (#include ) 144. 224. T (#include /* Canvas header file */) 144. 210. T (#include ) 144. 196. T (Frame frame;) 144. 168. T (/* SunView frame */) 252. 168. T (Panel panel;) 144. 154. T (/* Control Panel */) 252. 154. T (Panel_item draw_pi;) 144. 140. T (Canvas canvas;) 144. 126. T (/* SunView canvas */) 244.8 126. T (Ccgiwin vpw;) 144. 112. T (/* Window struct for CGI */) 230.4 112. T (int drawbox_notify\050\051;) 144. 84. T FMENDPAGE %%Page: "19" 19 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 380.33 36. T (A-19) 72. 36. T 4 F (main\050\051) 144. 698. T ({) 144. 684. T (int name;) 180. 670. T (frame = window_create\050NULL, FRAME, 0\051;) 180. 642. T 5.4 (panel = window_create\050frame, PANEL, WIN_HEIGHT,) 180. 628. P (60, 0\051;) 144. 614. T (draw_pi = panel_create_item\050panel, PANEL_BUTTON,) 180. 600. T (PANEL_LABEL_IMAGE,) 215. 586. T ( ) 215. 572. T (panel_button_image\050panel, "Draw", 0, 0\051,) 252. 572. T (PANEL_NOTIFY_PROC, drawbox_notify,) 215. 558. T (0\051;) 215. 544. T (canvas = window_create\050frame, CANVAS,0\051;) 180. 530. T (open_pw_cgi\050\051;) 180. 502. T (open_cgi_canvas\050canvas, &vpw, &name\051;) 180. 488. T (window_main_loop\050frame\051;) 180. 460. T (}) 144. 446. T (drawbox_notify\050\051) 144. 418. T ({) 144. 404. T (Ccoor lr, ul;) 180. 390. T (Ccoorlist coorlist;) 180. 376. T ( ) 144. 362. T (ul.x = 100;) 180. 348. T (ul.y = 100;) 180. 334. T (lr.x = 150;) 180. 320. T (lr.y = 150;) 180. 306. T (cgipw_rectangle\050&vpw, &lr, &ul\051;) 180. 292. T (}) 144. 278. T 0 F (This is a sample program of CGI running in a tool.) 217. 261. T (For more information on SunCGI, please refer to the ) 217. 244. T (Appendixes D and E of ) 217. 231. T 5 F ( SunCGI Reference Manual) 332.64 231. T 0 F (. It ) 465.62 231. T (contains some more sample programs, and discusses using ) 217. 218. T (SunCGI in windows.) 217. 205. T (To compile the program, type:) 217. 188. T 4 F 7.2 (% cc cgi.c -o cgi -lcgi -lsuntool -lsunwindow -) 144. 166. P (lpixrect -lm) 144. 152. T 0 F (To run, type ) 217. 127. T 4 F (cgi_sample) 278.99 127. T 0 F ( into a terminal window while in the ) 350.99 127. T (SunView window system. A new tool is created, with a panel ) 217. 113. T (at the top and a canvas at the bottom. ) 217. 100. T FMENDPAGE %%Page: "20" 20 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 72. 36. T (A-20) 515.34 36. T (When you activate the Draw button in the panel \050by pointing to ) 217. 711. T (it with the mouse cursor and clicking the left mouse button\051, ) 217. 698. T (CGI will draw a square in the canvas.) 217. 685. T 2 F (A.15) 72. 660. T (SunGKS) 217. 660. T 4 F (/****************) 144. 629. T ( * gks_sample.c *) 144. 615. T ( *****************/) 144. 601. T (#include ) 144. 573. T (#include ) 144. 559. T (#include ) 144. 545. T (#include ) 144. 531. T (Gwpoint square[5] = { 0.2,0.2 ,) 144. 503. T ( 0.2,0.3 ,) 144. 489. T ( 0.3,0.3 ,) 144. 475. T ( 0.3,0.2 ,) 144. 461. T ( 0.2,0.2 };) 144. 447. T (Frame frame;) 144. 433. T (Canvas canvas;) 144. 419. T (Panel panel;) 144. 405. T (Panel_item draw_box_pi;) 144. 391. T (int draw_box\050\051;) 144. 363. T (main\050\051) 144. 335. T ({) 144. 321. T (Gws ws = 1;) 180. 307. T (Gks_ws_config config;) 180. 293. T (frame = window_create\050NULL, FRAME, 0\051;) 180. 265. T (panel = window_create\050frame, PANEL,) 180. 251. T (WIN_WIDTH, 500,) 215. 237. T (WIN_HEIGHT, 28,) 215. 223. T (WIN_X, 0,) 215. 209. T (WIN_Y, 0,) 215. 195. T (0\051;) 215. 181. T (canvas = window_create\050frame, CANVAS,) 180. 153. T (CANVAS_RETAINED, FALSE,) 215. 139. T (WIN_WIDTH, 500,) 215. 125. T (WIN_HEIGHT, 462,) 215. 111. T (WIN_X, 0,) 215. 97. T (WIN_Y, 33,) 215. 83. T FMENDPAGE %%Page: "21" 21 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 380.33 36. T (A-21) 72. 36. T 4 F (WIN_BELOW, panel,) 215. 712. T (0\051;) 215. 698. T (window_fit\050frame\051;) 180. 670. T 16.8 (draw_box_pi = panel_create_item\050panel, PAN-) 180. 656. P (EL_BUTTON,) 144. 642. T (PANEL_LABEL_IMAGE,panel_button_image\050panel,) 215. 628. T ("Draw a box", 0,0\051,) 215. 614. T (PANEL_NOTIFY_PROC, draw_box,) 215. 600. T (0\051;) 215. 586. T (if \050gopengks\050stdout, GMEMORY\051\051) 180. 558. T (exit\0502\051;) 215. 544. T (config = gks_ws_config_get_installed\050"sun_canvas"\051;) 180. 530. T (gks_ws_config_set\050config,) 180. 516. T (GKS_GP_USAGE, GKS_USE_NONE,) 215. 502. T (GKS_TEXTSW, GKS_CREATE,) 215. 488. T (0\051;) 215. 474. T (gks_ws_config_install\050config\051;) 180. 460. T (gks_ws_config_destroy\050config\051;) 180. 446. T (gopenws\050ws, canvas, "sun_canvas"\051;) 180. 432. T (gactivatews\050ws\051;) 180. 418. T (window_main_loop\050frame\051;) 180. 390. T (gdeactivatews\050ws\051;) 180. 362. T (gclosews\050ws\051;) 180. 348. T (gclosegks\050\051;) 180. 334. T (}) 144. 320. T (draw_box\050\051) 144. 306. T ({) 144. 292. T (Gseg seg = 1;) 180. 278. T (gcreateseg\050seg\051;) 180. 250. T (gpolyline\0505, square\051;) 180. 236. T (gcloseseg\050\051;) 180. 222. T (}) 144. 208. T 0 F (This program illustrates GKS running in a SunView tool.) 217. 174. T (To compile the program, type:) 217. 157. T 4 F (% cc -o gks_sample gks_sample.c) 144. 135. T (-lgks -lsuntool -lsunwindow -lpixrect -lm ) 180. 121. T 0 F (All SunGKS programs expect the environment variable GKS-) 217. 96. T (DIR to indicate the location of the GKS library subdirectory. ) 217. 83. T FMENDPAGE %%Page: "22" 22 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 72. 36. T (A-22) 515.34 36. T (For example, if your GKS software is in a directory called ) 217. 711. T (/usr/unbundled/gks2.1, then the GKSDIR variable should be set ) 217. 698. T (to /usr/unbundled/gks2.1/lib/gks. To verify this, type:) 217. 685. T 4 F (% printenv GKSDIR) 144. 663. T 0 F (The response should be \050in this example\051:) 217. 638. T 4 F (GKSDIR=/usr/unbundled/gks2.1/lib/gks) 144. 616. T 0 F (If the response from the system is incorrect or blank, you need ) 217. 591. T (to set the environment variable by typing:) 217. 578. T 4 F (% setenv GKSDIR /usr/unbundled/gks2.1/lib/gks) 144. 556. T 0 F (You can do this as needed, or you can edit the command into ) 217. 531. T (your .login file so that it will be executed automatically whenev-) 217. 518. T (er you sign onto your workstation. For more information on ) 217. 505. T (GKSDIR, please refer to the ) 217. 492. T 5 F (SunGKS Reference Manual) 356.3 492. T 0 F (.) 488.27 492. T (Once the environment is correct, you can run the program by ) 217. 475. T (typing:) 217. 462. T 4 F (% gks_sample) 144. 440. T 0 F (into any terminal-emulator window. The tool has two subwin-) 217. 415. T (dows: a control panel and a canvas. Pushing the single button ) 217. 402. T (in the panel \050its label says ) 217. 388. T 3 F (\322) 344.32 388. T 0 F (Draw a box) 350.54 388. T 3 F (\323) 406.52 388. T 0 F (\051 causes GKS to draw ) 412.73 388. T (a box in the canvas.) 217. 374. T (For more example programs, please refer to Appendix G of the ) 217. 357. T 5 F (SunGKS Reference Manual) 217. 344. T 0 F (.) 348.98 344. T 2 F (A.16) 72. 317. T (SunPHIGS) 217. 317. T 4 F (/*****************) 144. 286. T ( * phigs_hello.c *) 144. 272. T ( *****************) 144. 258. T (#include ) 144. 230. T (#include ) 144. 216. T (#include ) 144. 202. T (#include ) 144. 188. T (#define WS) 144. 160. T (1) 252. 160. T (#define ST) 144. 146. T (1) 252. 146. T (int go_notify\050\051;) 144. 118. T (main\050\051) 144. 90. T ({) 144. 76. T (Pwstype canvaswst;) 180. 62. T FMENDPAGE %%Page: "23" 23 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 380.33 36. T (A-23) 72. 36. T 4 F (Frame frame;) 180. 712. T (Canvas canvas;) 180. 698. T (Panel panel;) 180. 684. T (Panel_item go_pi;) 180. 670. T (frame = window_create\050NULL, FRAME, 0\051;) 180. 642. T 5.4 (panel = window_create\050frame, PANEL, WIN_HEIGHT,) 180. 628. P (100, 0\051;) 144. 614. T (go_pi = panel_create_item\050panel, PANEL_BUTTON,) 180. 600. T (PANEL_LABEL_IMAGE,) 215. 586. T (panel_button_image\050panel,"GO",0,0\051,) 215. 572. T (PANEL_NOTIFY_PROC, go_notify,) 215. 558. T (0\051;) 215. 544. T 10.8 (canvas=window_create\050frame, CANVAS, WIN_HEIGHT,) 180. 530. P (600, 0\051;) 144. 516. T (popenphigs\050\050Pchar *\051NULL, PDEFAULT_MEM_SIZE\051;) 180. 502. T 280.8 (canvaswst =) 180. 488. P (phigs_ws_type_create\050phigs_ws_type_sun_canvas, 0\051;) 144. 474. T (popenws\050WS, \050Pconnid\051canvas, canvaswst\051;) 180. 460. T (window_main_loop\050frame\051;) 180. 432. T (pclosews\050WS\051;) 180. 404. T (pclosephigs\050\051;) 180. 390. T (}) 144. 376. T (go_notify\050\051) 144. 362. T ({) 144. 348. T (static Ppoint textpts = {0.1, 0.5}; ) 180. 334. T (popenstruct\050psetcharheight\050.02\051; ) 180. 306. T (ptext\050&textpts, "Hello world."\051; ) 180. 292. T (ppoststruct\050WS, ST, 0.\051; ) 180. 278. T (pclosestruct\050\051; ) 180. 264. T (}) 144. 250. T 0 F (This program shows how to use SunPHIGS to write some text ) 217. 219. T (in a SunView canvas. A frame is created with a control panel ) 217. 206. T (and a canvas. The canvas is made to be a PHIGS workstation, ) 217. 193. T (and window_main_loop\050\051 is executed. When the GO pushbut-) 217. 180. T (ton in the panel is activated, a struct is opened, text is written ) 217. 167. T (in it, it is posted to the workstation, and then it is closed.) 217. 154. T (To compile the program, type:) 217. 134. T 4 F 3.09 (% cc phigs_hello.c -o phigs_hello -llphigs -lphigs -) 144. 112. P (lsuntool -lsunwindow -lpixrect -lm) 144. 98. T FMENDPAGE %%Page: "24" 24 FMBEGINPAGE 0 F 0 X (Sun Microsystems Porting Guide) 72. 36. T (A-24) 515.34 36. T (To execute the program, type: ) 217. 711. T 4 F (% phigs_hello) 144. 687. T 0 F (into a terminal-emulator window within the SunView window ) 217. 660. T (system.) 217. 647. T (T) 217. 630. T (he SunPHIGS distribution tape contains a wealth of sample ) 224.33 630. T (code in /usr/lib/phigs1.0/examples. Sources for these programs ) 217. 617. T (can be found in the appendixes of Getting Started with Sun-) 217. 604. T (PHIGS. For further information on SunPHIGS, please refer to ) 217. 591. T (the SunPHIGS Reference Manual and the SunPHIGS Software ) 217. 578. T (Installation Guide.) 217. 565. T FMENDPAGE %%Trailer %%Pages: 24 1 %%DocumentFonts: Times-Roman %%+ Times-Bold %%+ Courier %%+ Times-Italic %%+ Courier-Bold