home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / unix / uw_shar.sit / uw-42-part2.shar.bin < prev    next >
MacBinary  |  1989-09-14  |  56.0 KB  |  [TEXT/TEXT]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
1% dexvert Debian floppy split (archive/debianFloppySplit) ext Unsupported
1% dexvert Sound Images sound sample (audio/soundImagesSoundSample) ext Unsupported
1% dexvert DESI-III drawing (image/desiIIIDrawing) ext Unsupported
1% dexvert MS-DOS PMODE extender executable (executable/msdosPMODEExtenderExecutable) ext Unsupported
1% dexvert Alien Trilogytextures (other/alienTrilogyTextures) ext Unsupported
1% dexvert APT cache data (other/aptCacheData) ext Unsupported
1% dexvert CorelTRACE configuration (other/corelTRACEConfiguration) ext Unsupported
1% dexvert Dreamcast Disc (other/dreamcastDisc) ext Unsupported
1% dexvert EST flat binary (other/estFlatBinary) ext Unsupported
1% dexvert Finale Enigma Binary Format (other/finaleEnigmaBinaryFormat) ext Unsupported
1% dexvert Sega Genesis/Megadrive/32x ROM (other/genesisROM) ext Unsupported
1% dexvert Myth: The Fallen Lords game archive (other/mythTheFallenLordsGameArchive) ext Unsupported
1% dexvert Sound Images Sound Driver (other/soundImagesSoundDriver) ext Unsupported
1% dexvert Symantec/Norton Config (other/symantecNortonConfig) ext Unsupported
1% dexvert Vectrex ROM (other/vectrexROM) ext Unsupported
1% dexvert BIS raP encoded format (other/bisraPEncoded) ext Unsupported
1% dexvert Pascal Script binary (other/pascalScriptBinary) ext Unsupported
1% dexvert 7th Level game data archive (other/seventhLevelGameDataArchive) ext Unsupported
1% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Binary Text (image/binaryText) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary, Wed Jun 21 15:19:44 1989, modified Wed Jun 21 15:19:44 1989, creator 'TEXT', type ASCII, 57163 bytes "uw-42-part2.shar" default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 1 default (weak)
100% lsar MacBinary default
100% gt2 MAC Bilddatei default (weak)


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[TEXT]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 10 75 77 2d 34 32 2d | 70 61 72 74 32 2e 73 68 |..uw-42-|part2.sh|
|00000010| 61 72 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |ar......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 54 45 58 | 54 00 00 00 00 00 00 00 |.TEXTTEX|T.......|
|00000050| 00 00 00 00 00 df 4b 00 | 00 00 00 a0 c5 9a d0 a0 |......K.|........|
|00000060| c5 9a d0 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000080| 23 44 61 74 65 3a 20 57 | 65 64 2c 20 32 20 4d 61 |#Date: W|ed, 2 Ma|
|00000090| 72 20 38 38 20 31 30 3a | 30 30 3a 31 38 20 50 53 |r 88 10:|00:18 PS|
|000000a0| 54 0d 23 46 72 6f 6d 3a | 20 72 6f 74 68 62 65 72 |T.#From:| rothber|
|000000b0| 67 40 70 6f 6c 79 61 2e | 73 74 61 6e 66 6f 72 64 |g@polya.|stanford|
|000000c0| 2e 65 64 75 20 28 45 64 | 77 61 72 64 20 52 6f 74 |.edu (Ed|ward Rot|
|000000d0| 68 62 65 72 67 29 0d 23 | 53 75 62 6a 65 63 74 3a |hberg).#|Subject:|
|000000e0| 20 55 57 20 34 2e 32 20 | 70 61 72 74 20 32 20 6f | UW 4.2 |part 2 o|
|000000f0| 66 20 38 0d 3a 20 54 68 | 69 73 20 69 73 20 61 20 |f 8.: Th|is is a |
|00000100| 73 68 61 72 20 61 72 63 | 68 69 76 65 2e 20 20 45 |shar arc|hive. E|
|00000110| 78 74 72 61 63 74 20 77 | 69 74 68 20 73 68 2c 20 |xtract w|ith sh, |
|00000120| 6e 6f 74 20 63 73 68 2e | 0d 69 66 20 74 65 73 74 |not csh.|.if test|
|00000130| 20 21 20 2d 64 20 64 6f | 63 3b 20 74 68 65 6e 0d | ! -d do|c; then.|
|00000140| 09 65 63 68 6f 20 6d 6b | 64 69 72 20 64 6f 63 0d |.echo mk|dir doc.|
|00000150| 09 6d 6b 64 69 72 20 64 | 6f 63 0d 66 69 0d 65 63 |.mkdir d|oc.fi.ec|
|00000160| 68 6f 20 78 20 2d 20 64 | 6f 63 2f 75 77 6c 69 62 |ho x - d|oc/uwlib|
|00000170| 2e 6d 73 0d 73 65 64 20 | 2d 65 20 27 73 2f 5e 58 |.ms.sed |-e 's/^X|
|00000180| 2f 2f 27 20 3e 20 64 6f | 63 2f 75 77 6c 69 62 2e |//' > do|c/uwlib.|
|00000190| 6d 73 20 3c 3c 20 27 21 | 45 4f 46 21 64 6f 63 2f |ms << '!|EOF!doc/|
|000001a0| 75 77 6c 69 62 2e 6d 73 | 21 27 0d 58 2e 5c 22 20 |uwlib.ms|!'.X.\" |
|000001b0| 54 68 69 73 20 66 69 6c | 65 20 73 68 6f 75 6c 64 |This fil|e should|
|000001c0| 20 62 65 20 70 72 6f 63 | 65 73 73 65 64 20 62 79 | be proc|essed by|
|000001d0| 20 6e 72 6f 66 66 20 6f | 72 20 74 72 6f 66 66 20 | nroff o|r troff |
|000001e0| 77 69 74 68 20 74 68 65 | 20 2d 6d 73 20 6d 61 63 |with the| -ms mac|
|000001f0| 72 6f 20 73 65 74 0d 58 | 2e 64 73 20 75 77 20 5c |ro set.X|.ds uw \|
|00000200| 73 2d 32 55 57 5c 73 30 | 0d 58 2e 44 41 20 53 65 |s-2UW\s0|.X.DA Se|
|00000210| 70 74 65 6d 62 65 72 20 | 33 30 2c 20 31 39 38 36 |ptember |30, 1986|
|00000220| 0d 58 2e 54 4c 0d 58 54 | 68 65 20 55 57 20 50 72 |.X.TL.XT|he UW Pr|
|00000230| 6f 67 72 61 6d 6d 65 72 | 27 73 20 4c 69 62 72 61 |ogrammer|'s Libra|
|00000240| 72 79 0d 58 2e 41 55 0d | 58 4a 6f 68 6e 20 44 2e |ry.X.AU.|XJohn D.|
|00000250| 20 42 72 75 6e 65 72 0d | 58 2e 53 48 0d 58 49 6e | Bruner.|X.SH.XIn|
|00000260| 74 72 6f 64 75 63 74 69 | 6f 6e 0d 58 2e 50 50 0d |troducti|on.X.PP.|
|00000270| 58 5c 2a 28 75 77 20 69 | 73 20 61 20 6d 75 6c 74 |X\*(uw i|s a mult|
|00000280| 69 70 6c 65 2d 77 69 6e | 64 6f 77 20 4d 61 63 69 |iple-win|dow Maci|
|00000290| 6e 74 6f 73 68 20 69 6e | 74 65 72 66 61 63 65 20 |ntosh in|terface |
|000002a0| 74 6f 20 61 20 34 2e 32 | 42 53 44 20 55 4e 49 58 |to a 4.2|BSD UNIX|
|000002b0| 5c 2a 2a 2e 0d 58 2e 46 | 53 0d 58 4d 61 63 69 6e |\**..X.F|S.XMacin|
|000002c0| 74 6f 73 68 20 69 73 20 | 61 20 74 72 61 64 65 6d |tosh is |a tradem|
|000002d0| 61 72 6b 20 6f 66 20 4d | 63 49 6e 74 6f 73 68 20 |ark of M|cIntosh |
|000002e0| 4c 61 62 6f 72 61 74 6f | 72 69 65 73 20 77 68 69 |Laborato|ries whi|
|000002f0| 63 68 0d 58 69 73 20 6c | 69 63 65 6e 73 65 64 20 |ch.Xis l|icensed |
|00000300| 74 6f 20 41 70 70 6c 65 | 20 43 6f 6d 70 75 74 65 |to Apple| Compute|
|00000310| 72 2c 20 49 6e 63 2e 0d | 58 55 4e 49 58 20 69 73 |r, Inc..|XUNIX is|
|00000320| 20 61 20 72 65 67 69 73 | 74 65 72 65 64 20 74 72 | a regis|tered tr|
|00000330| 61 64 65 6d 61 72 6b 20 | 6f 66 20 42 65 6c 6c 20 |ademark |of Bell |
|00000340| 4c 61 62 6f 72 61 74 6f | 72 69 65 73 2e 0d 58 2e |Laborato|ries..X.|
|00000350| 46 45 0d 58 5c 2a 28 75 | 77 20 76 65 72 73 69 6f |FE.X\*(u|w versio|
|00000360| 6e 20 33 20 63 6f 6d 70 | 72 69 73 65 73 20 61 20 |n 3 comp|rises a |
|00000370| 73 65 72 76 65 72 2c 0d | 58 61 20 73 65 74 20 6f |server,.|Xa set o|
|00000380| 66 20 75 74 69 6c 69 74 | 79 20 70 72 6f 67 72 61 |f utilit|y progra|
|00000390| 6d 73 2c 0d 58 61 6e 64 | 20 61 6e 20 70 72 6f 67 |ms,.Xand| an prog|
|000003a0| 72 61 6d 2d 6c 65 76 65 | 6c 20 69 6e 74 65 72 66 |ram-leve|l interf|
|000003b0| 61 63 65 2e 0d 58 54 68 | 69 73 20 6d 61 6e 75 61 |ace..XTh|is manua|
|000003c0| 6c 20 64 65 73 63 72 69 | 62 65 73 20 74 68 65 20 |l descri|bes the |
|000003d0| 73 65 72 76 69 63 65 73 | 20 77 68 69 63 68 20 61 |services| which a|
|000003e0| 72 65 20 61 76 61 69 6c | 61 62 6c 65 0d 58 69 6e |re avail|able.Xin|
|000003f0| 20 74 68 65 20 5c 2a 28 | 75 77 20 70 72 6f 67 72 | the \*(|uw progr|
|00000400| 61 6d 6d 65 72 27 73 20 | 6c 69 62 72 61 72 79 2e |ammer's |library.|
|00000410| 0d 58 54 68 69 73 20 6c | 69 62 72 61 72 79 20 61 |.XThis l|ibrary a|
|00000420| 6c 6c 6f 77 20 70 72 6f | 67 72 61 6d 73 20 74 6f |llow pro|grams to|
|00000430| 20 63 72 65 61 74 65 2c | 0d 58 63 6f 6d 6d 75 6e | create,|.Xcommun|
|00000440| 69 63 61 74 65 20 77 69 | 74 68 2c 0d 58 61 6e 64 |icate wi|th,.Xand|
|00000450| 20 70 65 72 66 6f 72 6d | 20 73 6f 6d 65 20 63 6f | perform| some co|
|00000460| 6e 74 72 6f 6c 20 6f 70 | 65 72 61 74 69 6f 6e 73 |ntrol op|erations|
|00000470| 20 75 70 6f 6e 0d 58 77 | 69 6e 64 6f 77 73 20 6f | upon.Xw|indows o|
|00000480| 6e 20 74 68 65 20 4d 61 | 63 69 6e 74 6f 73 68 2e |n the Ma|cintosh.|
|00000490| 0d 58 2e 53 48 0d 58 42 | 61 63 6b 67 72 6f 75 6e |.X.SH.XB|ackgroun|
|000004a0| 64 0d 58 2e 50 50 0d 58 | 42 65 66 6f 72 65 20 74 |d.X.PP.X|Before t|
|000004b0| 68 65 20 6c 69 62 72 61 | 72 79 20 72 6f 75 74 69 |he libra|ry routi|
|000004c0| 6e 65 73 20 74 68 65 6d | 73 65 6c 76 65 73 20 63 |nes them|selves c|
|000004d0| 61 6e 20 62 65 20 64 69 | 73 63 75 73 73 65 64 2c |an be di|scussed,|
|000004e0| 0d 58 69 74 20 69 73 20 | 6e 65 63 65 73 73 61 72 |.Xit is |necessar|
|000004f0| 79 20 74 6f 20 63 6f 6e | 73 69 64 65 72 20 73 6f |y to con|sider so|
|00000500| 6d 65 20 61 73 70 65 63 | 74 73 20 6f 66 20 74 68 |me aspec|ts of th|
|00000510| 65 20 5c 2a 28 75 77 0d | 58 73 65 72 76 65 72 2e |e \*(uw.|Xserver.|
|00000520| 0d 58 54 68 65 20 73 65 | 72 76 65 72 20 77 68 69 |.XThe se|rver whi|
|00000530| 63 68 20 77 61 73 20 64 | 69 73 74 72 69 62 75 74 |ch was d|istribut|
|00000540| 65 64 20 77 69 74 68 20 | 5c 2a 28 75 77 20 76 65 |ed with |\*(uw ve|
|00000550| 72 73 69 6f 6e 73 20 31 | 2e 36 20 61 6e 64 20 32 |rsions 1|.6 and 2|
|00000560| 2e 31 30 0d 58 63 6f 6d | 6d 75 6e 69 63 61 74 65 |.10.Xcom|municate|
|00000570| 64 20 77 69 74 68 20 74 | 68 65 20 4d 61 63 69 6e |d with t|he Macin|
|00000580| 74 6f 73 68 20 75 73 69 | 6e 67 20 61 20 70 72 6f |tosh usi|ng a pro|
|00000590| 74 6f 63 6f 6c 20 77 68 | 69 63 68 0d 58 69 73 20 |tocol wh|ich.Xis |
|000005a0| 72 65 66 65 72 72 65 64 | 20 74 6f 20 61 73 20 74 |referred| to as t|
|000005b0| 68 65 20 60 60 6f 72 69 | 67 69 6e 61 6c 20 70 72 |he ``ori|ginal pr|
|000005c0| 6f 74 6f 63 6f 6c 2e 27 | 27 0d 58 54 68 65 20 76 |otocol.'|'.XThe v|
|000005d0| 65 72 73 69 6f 6e 20 33 | 20 73 65 72 76 65 72 20 |ersion 3| server |
|000005e0| 69 73 20 63 61 70 61 62 | 6c 65 20 6f 66 20 63 6f |is capab|le of co|
|000005f0| 6d 6d 75 6e 69 63 61 74 | 69 6e 67 20 69 6e 20 74 |mmunicat|ing in t|
|00000600| 68 69 73 20 70 72 6f 74 | 6f 63 6f 6c 3b 0d 58 68 |his prot|ocol;.Xh|
|00000610| 6f 77 65 76 65 72 2c 0d | 58 69 74 20 61 6c 73 6f |owever,.|Xit also|
|00000620| 20 73 75 70 70 6f 72 74 | 73 20 61 6e 20 60 60 65 | support|s an ``e|
|00000630| 78 74 65 6e 64 65 64 20 | 70 72 6f 74 6f 63 6f 6c |xtended |protocol|
|00000640| 2e 27 27 0d 58 46 6f 72 | 20 63 6f 6e 76 65 6e 69 |.''.XFor| conveni|
|00000650| 65 6e 63 65 2c 0d 58 74 | 68 65 73 65 20 70 72 6f |ence,.Xt|hese pro|
|00000660| 74 6f 63 6f 6c 73 20 61 | 72 65 20 61 73 73 69 67 |tocols a|re assig|
|00000670| 6e 65 64 20 6e 75 6d 62 | 65 72 73 3a 0d 58 70 72 |ned numb|ers:.Xpr|
|00000680| 6f 74 6f 63 6f 6c 20 31 | 20 69 73 20 74 68 65 20 |otocol 1| is the |
|00000690| 6f 72 69 67 69 6e 61 6c | 20 70 72 6f 74 6f 63 6f |original| protoco|
|000006a0| 6c 0d 58 61 6e 64 20 70 | 72 6f 74 6f 63 6f 6c 20 |l.Xand p|rotocol |
|000006b0| 32 20 69 73 20 74 68 65 | 20 65 78 74 65 6e 64 65 |2 is the| extende|
|000006c0| 64 20 70 72 6f 74 6f 63 | 6f 6c 2e 0d 58 2e 50 50 |d protoc|ol..X.PP|
|000006d0| 0d 58 50 72 6f 74 6f 63 | 6f 6c 20 31 20 70 72 6f |.XProtoc|ol 1 pro|
|000006e0| 76 69 64 65 73 20 61 20 | 6d 65 63 68 61 6e 69 73 |vides a |mechanis|
|000006f0| 6d 20 66 6f 72 0d 58 74 | 68 65 20 63 72 65 61 74 |m for.Xt|he creat|
|00000700| 69 6f 6e 20 61 6e 64 20 | 64 65 73 74 72 75 63 74 |ion and |destruct|
|00000710| 69 6f 6e 20 6f 66 20 77 | 69 6e 64 6f 77 73 0d 58 |ion of w|indows.X|
|00000720| 61 73 20 77 65 6c 6c 20 | 61 73 20 61 20 6d 65 61 |as well |as a mea|
|00000730| 6e 73 20 74 6f 20 6d 75 | 6c 74 69 70 6c 65 78 20 |ns to mu|ltiplex |
|00000740| 61 20 73 69 6e 67 6c 65 | 0d 58 63 6f 6d 6d 75 6e |a single|.Xcommun|
|00000750| 69 63 61 74 69 6f 6e 73 | 20 6c 69 6e 65 20 61 6d |ications| line am|
|00000760| 6f 6e 67 20 73 65 76 65 | 72 61 6c 20 77 69 6e 64 |ong seve|ral wind|
|00000770| 6f 77 73 2e 0d 58 49 74 | 20 70 72 6f 76 69 64 65 |ows..XIt| provide|
|00000780| 73 20 61 20 6d 65 63 68 | 61 6e 69 73 6d 20 66 6f |s a mech|anism fo|
|00000790| 72 20 74 72 61 6e 73 6d | 69 74 74 69 6e 67 0d 58 |r transm|itting.X|
|000007a0| 63 6f 6e 74 72 6f 6c 20 | 61 6e 64 20 60 60 6d 65 |control |and ``me|
|000007b0| 74 61 27 27 20 63 68 61 | 72 61 63 74 65 72 73 2c |ta'' cha|racters,|
|000007c0| 0d 58 61 6e 64 20 69 74 | 20 61 6c 73 6f 20 70 72 |.Xand it| also pr|
|000007d0| 6f 76 69 64 65 73 20 74 | 77 6f 20 60 60 6d 61 69 |ovides t|wo ``mai|
|000007e0| 6e 74 65 6e 61 6e 63 65 | 20 66 75 6e 63 74 69 6f |ntenance| functio|
|000007f0| 6e 73 27 27 0d 58 77 68 | 69 63 68 20 61 72 65 20 |ns''.Xwh|ich are |
|00000800| 75 73 65 64 20 66 6f 72 | 20 73 74 61 72 74 75 70 |used for| startup|
|00000810| 20 61 6e 64 20 73 68 75 | 74 64 6f 77 6e 2e 0d 58 | and shu|tdown..X|
|00000820| 2e 50 50 0d 58 50 72 6f | 74 6f 63 6f 6c 20 32 20 |.PP.XPro|tocol 2 |
|00000830| 70 72 6f 76 69 64 65 73 | 20 74 77 6f 20 73 69 67 |provides| two sig|
|00000840| 6e 69 66 69 63 61 6e 74 | 20 65 6e 68 61 6e 63 65 |nificant| enhance|
|00000850| 6d 65 6e 74 73 0d 58 72 | 65 6c 61 74 69 76 65 20 |ments.Xr|elative |
|00000860| 74 6f 20 70 72 6f 74 6f | 63 6f 6c 20 31 2e 0d 58 |to proto|col 1..X|
|00000870| 46 69 72 73 74 2c 0d 58 | 77 69 6e 64 6f 77 20 63 |First,.X|window c|
|00000880| 72 65 61 74 69 6f 6e 20 | 6d 65 73 73 61 67 65 73 |reation |messages|
|00000890| 20 73 70 65 63 69 66 79 | 20 74 68 65 20 77 69 6e | specify| the win|
|000008a0| 64 6f 77 20 65 6d 75 6c | 61 74 69 6f 6e 20 74 79 |dow emul|ation ty|
|000008b0| 70 65 0d 58 28 5c 66 49 | 65 2e 67 2e 5c 66 50 20 |pe.X(\fI|e.g.\fP |
|000008c0| 61 64 6d 2d 33 31 2c 20 | 76 74 35 32 29 2e 0d 58 |adm-31, |vt52)..X|
|000008d0| 53 65 63 6f 6e 64 2c 0d | 58 61 64 64 69 74 69 6f |Second,.|Xadditio|
|000008e0| 6e 61 6c 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |nal info|rmation |
|000008f0| 61 62 6f 75 74 20 77 69 | 6e 64 6f 77 73 2c 0d 58 |about wi|ndows,.X|
|00000900| 63 61 6c 6c 65 64 20 60 | 60 77 69 6e 64 6f 77 20 |called `|`window |
|00000910| 6f 70 74 69 6f 6e 73 2c | 27 27 0d 58 69 73 20 74 |options,|''.Xis t|
|00000920| 72 61 6e 73 6d 69 74 74 | 65 64 20 62 65 74 77 65 |ransmitt|ed betwe|
|00000930| 65 6e 20 74 68 65 20 4d | 61 63 69 6e 74 6f 73 68 |en the M|acintosh|
|00000940| 20 63 6c 69 65 6e 74 20 | 61 6e 64 20 74 68 65 0d | client |and the.|
|00000950| 58 73 65 72 76 65 72 20 | 6f 6e 20 74 68 65 20 68 |Xserver |on the h|
|00000960| 6f 73 74 2e 0d 58 2e 50 | 50 0d 58 57 69 6e 64 6f |ost..X.P|P.XWindo|
|00000970| 77 20 6f 70 74 69 6f 6e | 73 20 61 72 65 20 61 6e |w option|s are an|
|00000980| 20 60 60 6f 75 74 2d 6f | 66 2d 62 61 6e 64 27 27 | ``out-o|f-band''|
|00000990| 20 63 68 61 6e 6e 65 6c | 20 6f 66 0d 58 69 6e 66 | channel| of.Xinf|
|000009a0| 6f 72 6d 61 74 69 6f 6e | 20 62 65 74 77 65 65 6e |ormation| between|
|000009b0| 20 74 68 65 20 4d 61 63 | 69 6e 74 6f 73 68 20 61 | the Mac|intosh a|
|000009c0| 6e 64 20 74 68 65 20 68 | 6f 73 74 2e 0d 58 54 68 |nd the h|ost..XTh|
|000009d0| 65 72 65 20 61 72 65 20 | 74 77 6f 20 74 79 70 65 |ere are |two type|
|000009e0| 73 3a 0d 58 67 65 6e 65 | 72 69 63 0d 58 28 63 6f |s:.Xgene|ric.X(co|
|000009f0| 6d 6d 6f 6e 20 74 6f 20 | 61 6c 6c 20 77 69 6e 64 |mmon to |all wind|
|00000a00| 6f 77 20 74 79 70 65 73 | 29 0d 58 61 6e 64 20 65 |ow types|).Xand e|
|00000a10| 6d 75 6c 61 74 69 6f 6e | 2d 73 70 65 63 69 66 69 |mulation|-specifi|
|00000a20| 63 2e 0d 58 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |c..XThe |followin|
|00000a30| 67 20 61 72 65 20 67 65 | 6e 65 72 69 63 3a 0d 58 |g are ge|neric:.X|
|00000a40| 2e 44 53 0d 58 77 69 6e | 64 6f 77 20 76 69 73 69 |.DS.Xwin|dow visi|
|00000a50| 62 69 6c 69 74 79 0d 58 | 77 69 6e 64 6f 77 20 74 |bility.X|window t|
|00000a60| 79 70 65 0d 58 77 69 6e | 64 6f 77 20 70 6f 73 69 |ype.Xwin|dow posi|
|00000a70| 74 69 6f 6e 20 28 70 69 | 78 65 6c 20 61 64 64 72 |tion (pi|xel addr|
|00000a80| 65 73 73 20 6f 66 20 74 | 6f 70 20 6c 65 66 74 20 |ess of t|op left |
|00000a90| 63 6f 72 6e 65 72 29 0d | 58 77 69 6e 64 6f 77 20 |corner).|Xwindow |
|00000aa0| 74 69 74 6c 65 0d 58 77 | 69 6e 64 6f 77 20 73 69 |title.Xw|indow si|
|00000ab0| 7a 65 20 69 6e 20 70 69 | 78 65 6c 73 0d 58 2e 44 |ze in pi|xels.X.D|
|00000ac0| 45 0d 58 54 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |E.XThe f|ollowing|
|00000ad0| 20 77 69 6e 64 6f 77 20 | 6f 70 74 69 6f 6e 73 20 | window |options |
|00000ae0| 61 72 65 20 73 70 65 63 | 69 66 69 63 20 74 6f 0d |are spec|ific to.|
|00000af0| 58 63 75 72 73 6f 72 2d | 61 64 64 72 65 73 73 69 |Xcursor-|addressi|
|00000b00| 62 6c 65 20 74 65 72 6d | 69 6e 61 6c 20 65 6d 75 |ble term|inal emu|
|00000b10| 6c 61 74 69 6f 6e 73 3a | 0d 58 2e 44 53 0d 58 74 |lations:|.X.DS.Xt|
|00000b20| 65 72 6d 69 6e 61 6c 20 | 73 69 7a 65 20 28 6e 75 |erminal |size (nu|
|00000b30| 6d 62 65 72 20 6f 66 20 | 72 6f 77 73 20 61 6e 64 |mber of |rows and|
|00000b40| 20 63 6f 6c 75 6d 6e 73 | 29 0d 58 66 6f 6e 74 20 | columns|).Xfont |
|00000b50| 73 69 7a 65 20 69 6e 64 | 65 78 20 28 73 6d 61 6c |size ind|ex (smal|
|00000b60| 6c 3d 30 2c 20 6c 61 72 | 67 65 3d 31 29 0d 58 6d |l=0, lar|ge=1).Xm|
|00000b70| 6f 75 73 65 20 68 61 6e | 64 6c 69 6e 67 20 28 63 |ouse han|dling (c|
|00000b80| 6c 69 70 62 6f 61 72 64 | 20 6f 72 20 65 6e 63 6f |lipboard| or enco|
|00000b90| 64 65 64 20 73 65 6e 64 | 2d 74 6f 2d 68 6f 73 74 |ded send|-to-host|
|00000ba0| 29 0d 58 62 65 6c 6c 20 | 63 68 61 72 61 63 74 65 |).Xbell |characte|
|00000bb0| 72 69 73 74 69 63 73 20 | 28 61 75 64 69 62 6c 65 |ristics |(audible|
|00000bc0| 2c 20 76 69 73 69 62 6c | 65 29 0d 58 63 75 72 73 |, visibl|e).Xcurs|
|00000bd0| 6f 72 20 61 70 70 65 61 | 72 61 6e 63 65 20 28 62 |or appea|rance (b|
|00000be0| 6c 6f 63 6b 20 6f 72 20 | 75 6e 64 65 72 73 63 6f |lock or |undersco|
|00000bf0| 72 65 29 0d 58 2e 44 45 | 0d 58 2e 50 50 0d 58 54 |re).X.DE|.X.PP.XT|
|00000c00| 68 65 20 73 65 72 76 65 | 72 20 64 69 73 74 69 6e |he serve|r distin|
|00000c10| 67 75 69 73 68 65 73 20 | 62 65 74 77 65 65 6e 20 |guishes |between |
|00000c20| 74 77 6f 20 77 69 6e 64 | 6f 77 20 63 6c 61 73 73 |two wind|ow class|
|00000c30| 65 73 20 5c 28 65 6d 0d | 58 69 6e 74 65 72 6e 61 |es \(em.|Xinterna|
|00000c40| 6c 20 61 6e 64 20 65 78 | 74 65 72 6e 61 6c 2e 0d |l and ex|ternal..|
|00000c50| 58 49 6e 74 65 72 6e 61 | 6c 20 77 69 6e 64 6f 77 |XInterna|l window|
|00000c60| 73 20 61 72 65 20 68 61 | 6e 64 6c 65 64 20 65 6e |s are ha|ndled en|
|00000c70| 74 69 72 65 6c 79 20 62 | 79 20 74 68 65 20 73 65 |tirely b|y the se|
|00000c80| 72 76 65 72 2e 0d 58 54 | 68 65 79 20 61 72 65 20 |rver..XT|hey are |
|00000c90| 61 6c 77 61 79 73 20 74 | 65 72 6d 69 6e 61 6c 20 |always t|erminal |
|00000ca0| 65 6d 75 6c 61 74 69 6f | 6e 73 20 61 6e 64 20 61 |emulatio|ns and a|
|00000cb0| 72 65 20 61 6c 77 61 79 | 73 0d 58 61 73 73 6f 63 |re alway|s.Xassoc|
|00000cc0| 69 61 74 65 64 20 77 69 | 74 68 20 61 20 70 73 65 |iated wi|th a pse|
|00000cd0| 75 64 6f 2d 74 65 72 6d | 69 6e 61 6c 20 64 65 76 |udo-term|inal dev|
|00000ce0| 69 63 65 2e 0d 58 2e 50 | 50 0d 58 42 79 20 63 6f |ice..X.P|P.XBy co|
|00000cf0| 6e 74 72 61 73 74 2c 0d | 58 61 6e 20 65 78 74 65 |ntrast,.|Xan exte|
|00000d00| 72 6e 61 6c 20 77 69 6e | 64 6f 77 20 61 6c 77 61 |rnal win|dow alwa|
|00000d10| 79 73 20 69 6e 76 6f 6c | 76 65 73 20 73 6f 6d 65 |ys invol|ves some|
|00000d20| 20 6f 75 74 73 69 64 65 | 20 70 72 6f 63 65 73 73 | outside| process|
|00000d30| 2e 0d 58 54 68 65 20 73 | 65 72 76 65 72 20 63 6f |..XThe s|erver co|
|00000d40| 6d 6d 75 6e 69 63 61 74 | 65 73 20 77 69 74 68 20 |mmunicat|es with |
|00000d50| 74 68 69 73 20 70 72 6f | 63 65 73 73 20 74 68 72 |this pro|cess thr|
|00000d60| 6f 75 67 68 20 6f 6e 65 | 0d 58 6f 72 20 74 77 6f |ough one|.Xor two|
|00000d70| 20 49 6e 74 65 72 6e 65 | 74 20 64 6f 6d 61 69 6e | Interne|t domain|
|00000d80| 20 6e 65 74 77 6f 72 6b | 20 63 6f 6e 6e 65 63 74 | network| connect|
|00000d90| 69 6f 6e 73 2e 0d 58 54 | 68 65 72 65 20 69 73 20 |ions..XT|here is |
|00000da0| 61 6c 77 61 79 73 20 61 | 20 60 60 64 61 74 61 27 |always a| ``data'|
|00000db0| 27 20 63 6f 6e 6e 65 63 | 74 69 6f 6e 2c 0d 58 74 |' connec|tion,.Xt|
|00000dc0| 68 72 6f 75 67 68 20 77 | 68 69 63 68 20 74 68 65 |hrough w|hich the|
|00000dd0| 20 65 78 74 65 72 6e 61 | 6c 20 70 72 6f 63 65 73 | externa|l proces|
|00000de0| 73 20 65 78 63 68 61 6e | 67 65 73 20 69 6e 66 6f |s exchan|ges info|
|00000df0| 72 6d 61 74 69 6f 6e 0d | 58 28 69 6e 64 69 72 65 |rmation.|X(indire|
|00000e00| 63 74 6c 79 2c 20 74 68 | 72 6f 75 67 68 20 74 68 |ctly, th|rough th|
|00000e10| 65 20 73 65 72 76 65 72 | 29 0d 58 77 69 74 68 20 |e server|).Xwith |
|00000e20| 74 68 65 20 4d 61 63 69 | 6e 74 6f 73 68 2e 0d 58 |the Maci|ntosh..X|
|00000e30| 54 68 65 72 65 20 6d 61 | 79 20 61 6c 73 6f 20 62 |There ma|y also b|
|00000e40| 65 20 61 20 60 60 63 6f | 6e 74 72 6f 6c 27 27 20 |e a ``co|ntrol'' |
|00000e50| 63 6f 6e 6e 65 63 74 69 | 6f 6e 0d 58 74 68 72 6f |connecti|on.Xthro|
|00000e60| 75 67 68 20 77 68 69 63 | 68 20 74 68 65 20 65 78 |ugh whic|h the ex|
|00000e70| 74 65 72 6e 61 6c 20 70 | 72 6f 63 65 73 73 20 65 |ternal p|rocess e|
|00000e80| 78 63 68 61 6e 67 65 73 | 0d 58 77 69 6e 64 6f 77 |xchanges|.Xwindow|
|00000e90| 20 6f 70 74 69 6f 6e 20 | 69 6e 66 6f 72 6d 61 74 | option |informat|
|00000ea0| 69 6f 6e 0d 58 28 61 67 | 61 69 6e 20 69 6e 64 69 |ion.X(ag|ain indi|
|00000eb0| 72 65 63 74 6c 79 29 0d | 58 77 69 74 68 20 74 68 |rectly).|Xwith th|
|00000ec0| 65 20 4d 61 63 69 6e 74 | 6f 73 68 2e 0d 58 54 68 |e Macint|osh..XTh|
|00000ed0| 65 20 73 65 72 76 65 72 | 20 61 63 74 73 20 61 73 |e server| acts as|
|00000ee0| 20 61 20 6d 75 6c 74 69 | 70 6c 65 78 6f 72 20 61 | a multi|plexor a|
|00000ef0| 6e 64 20 64 65 6d 75 6c | 74 69 70 6c 65 78 6f 72 |nd demul|tiplexor|
|00000f00| 0d 58 66 6f 72 20 65 78 | 74 65 72 6e 61 6c 20 77 |.Xfor ex|ternal w|
|00000f10| 69 6e 64 6f 77 73 2e 0d | 58 49 74 20 61 6c 73 6f |indows..|XIt also|
|00000f20| 20 63 61 63 68 65 73 20 | 77 69 6e 64 6f 77 20 6f | caches |window o|
|00000f30| 70 74 69 6f 6e 20 69 6e | 66 6f 72 6d 61 74 69 6f |ption in|formatio|
|00000f40| 6e 3b 0d 58 68 6f 77 65 | 76 65 72 2c 0d 58 69 74 |n;.Xhowe|ver,.Xit|
|00000f50| 20 64 6f 65 73 20 6e 6f | 74 20 70 65 72 66 6f 72 | does no|t perfor|
|00000f60| 6d 20 68 6f 73 74 2d 65 | 6e 64 20 65 6d 75 6c 61 |m host-e|nd emula|
|00000f70| 74 69 6f 6e 2d 73 70 65 | 63 69 66 69 63 20 74 61 |tion-spe|cific ta|
|00000f80| 73 6b 73 2e 0d 58 2e 50 | 50 0d 58 49 6e 74 65 72 |sks..X.P|P.XInter|
|00000f90| 6e 61 6c 20 61 6e 64 20 | 65 78 74 65 72 6e 61 6c |nal and |external|
|00000fa0| 20 77 69 6e 64 6f 77 73 | 20 6d 65 65 74 20 64 69 | windows| meet di|
|00000fb0| 66 66 65 72 65 6e 74 20 | 6e 65 65 64 73 2e 0d 58 |fferent |needs..X|
|00000fc0| 54 65 72 6d 69 6e 61 6c | 20 65 6d 75 6c 61 74 69 |Terminal| emulati|
|00000fd0| 6f 6e 20 6f 6e 20 74 68 | 65 20 6c 6f 63 61 6c 20 |on on th|e local |
|00000fe0| 68 6f 73 74 20 69 73 20 | 62 65 73 74 20 70 65 72 |host is |best per|
|00000ff0| 66 6f 72 6d 65 64 0d 58 | 62 79 20 69 6e 74 65 72 |formed.X|by inter|
|00001000| 6e 61 6c 20 77 69 6e 64 | 6f 77 73 2c 0d 58 62 65 |nal wind|ows,.Xbe|
|00001010| 63 61 75 73 65 20 66 65 | 77 65 72 20 70 72 6f 63 |cause fe|wer proc|
|00001020| 65 73 73 65 73 20 61 72 | 65 20 69 6e 76 6f 6c 76 |esses ar|e involv|
|00001030| 65 64 0d 58 28 61 6e 64 | 20 72 65 73 70 6f 6e 73 |ed.X(and| respons|
|00001040| 65 20 74 69 6d 65 20 69 | 73 20 62 65 74 74 65 72 |e time i|s better|
|00001050| 29 2e 0d 58 45 78 74 65 | 72 6e 61 6c 20 77 69 6e |)..XExte|rnal win|
|00001060| 64 6f 77 73 20 61 72 65 | 20 73 75 69 74 61 62 6c |dows are| suitabl|
|00001070| 65 20 66 6f 72 20 72 65 | 6d 6f 74 65 20 70 72 6f |e for re|mote pro|
|00001080| 63 65 73 73 65 73 0d 58 | 28 5c 66 49 69 2e 65 2e |cesses.X|(\fIi.e.|
|00001090| 5c 66 50 20 74 68 6f 73 | 65 20 6f 6e 20 61 6e 6f |\fP thos|e on ano|
|000010a0| 74 68 65 72 20 49 6e 74 | 65 72 6e 65 74 20 68 6f |ther Int|ernet ho|
|000010b0| 73 74 29 0d 58 6f 72 20 | 66 6f 72 20 6e 6f 6e 2d |st).Xor |for non-|
|000010c0| 74 65 72 6d 69 6e 61 6c | 20 74 61 73 6b 73 20 73 |terminal| tasks s|
|000010d0| 75 63 68 20 61 73 20 66 | 69 6c 65 20 74 72 61 6e |uch as f|ile tran|
|000010e0| 73 66 65 72 2e 0d 58 54 | 68 65 20 5c 2a 28 75 77 |sfer..XT|he \*(uw|
|000010f0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 6c 69 62 | applica|tion lib|
|00001100| 72 61 72 79 20 63 6f 6e | 74 61 69 6e 73 20 72 6f |rary con|tains ro|
|00001110| 75 74 69 6e 65 73 0d 58 | 74 6f 20 63 72 65 61 74 |utines.X|to creat|
|00001120| 65 20 61 6e 64 20 6d 61 | 6e 69 70 75 6c 61 74 65 |e and ma|nipulate|
|00001130| 20 62 6f 74 68 20 63 6c | 61 73 73 65 73 20 6f 66 | both cl|asses of|
|00001140| 20 77 69 6e 64 6f 77 73 | 2e 0d 58 2e 53 48 0d 58 | windows|..X.SH.X|
|00001150| 57 69 6e 64 6f 77 20 49 | 44 27 73 20 61 6e 64 20 |Window I|D's and |
|00001160| 4e 65 74 77 6f 72 6b 20 | 41 64 64 72 65 73 73 65 |Network |Addresse|
|00001170| 73 0d 58 2e 50 50 0d 58 | 41 20 75 6e 69 71 75 65 |s.X.PP.X|A unique|
|00001180| 20 33 32 2d 62 69 74 20 | 69 64 65 6e 74 69 66 69 | 32-bit |identifi|
|00001190| 63 61 74 69 6f 6e 20 6e | 75 6d 62 65 72 20 69 73 |cation n|umber is|
|000011a0| 20 61 73 73 6f 63 69 61 | 74 65 64 0d 58 77 69 74 | associa|ted.Xwit|
|000011b0| 68 20 65 61 63 68 20 77 | 69 6e 64 6f 77 20 74 68 |h each w|indow th|
|000011c0| 61 74 20 61 20 73 65 72 | 76 65 72 20 6d 61 6e 69 |at a ser|ver mani|
|000011d0| 70 75 6c 61 74 65 73 2e | 0d 58 53 6f 6d 65 20 6f |pulates.|.XSome o|
|000011e0| 70 65 72 61 74 69 6f 6e | 73 0d 58 28 64 65 73 63 |peration|s.X(desc|
|000011f0| 72 69 62 65 64 20 62 65 | 6c 6f 77 29 0d 58 72 65 |ribed be|low).Xre|
|00001200| 71 75 69 72 65 20 74 68 | 65 20 77 69 6e 64 6f 77 |quire th|e window|
|00001210| 20 6e 75 6d 62 65 72 20 | 74 6f 20 62 65 20 73 70 | number |to be sp|
|00001220| 65 63 69 66 69 65 64 2e | 0d 58 57 68 65 6e 20 74 |ecified.|.XWhen t|
|00001230| 68 65 20 73 65 72 76 65 | 72 20 63 72 65 61 74 65 |he serve|r create|
|00001240| 73 20 61 20 6e 65 77 20 | 69 6e 74 65 72 6e 61 6c |s a new |internal|
|00001250| 20 77 69 6e 64 6f 77 2c | 0d 58 69 74 20 70 61 73 | window,|.Xit pas|
|00001260| 73 65 73 20 74 68 65 20 | 77 69 6e 64 6f 77 20 49 |ses the |window I|
|00001270| 44 20 61 73 20 74 68 65 | 20 65 6e 76 69 72 6f 6e |D as the| environ|
|00001280| 6d 65 6e 74 20 76 61 72 | 69 61 62 6c 65 0d 58 60 |ment var|iable.X`|
|00001290| 60 55 57 5f 49 44 27 27 | 2e 0d 58 2e 50 50 0d 58 |`UW_ID''|..X.PP.X|
|000012a0| 54 68 65 20 73 65 72 76 | 65 72 20 63 72 65 61 74 |The serv|er creat|
|000012b0| 65 73 20 74 77 6f 20 6e | 65 74 77 6f 72 6b 20 73 |es two n|etwork s|
|000012c0| 6f 63 6b 65 74 73 20 75 | 70 6f 6e 20 77 68 69 63 |ockets u|pon whic|
|000012d0| 68 20 74 6f 20 72 65 63 | 65 69 76 65 0d 58 69 6e |h to rec|eive.Xin|
|000012e0| 63 6f 6d 69 6e 67 20 6d | 65 73 73 61 67 65 73 2e |coming m|essages.|
|000012f0| 0d 58 4f 6e 65 20 73 6f | 63 6b 65 74 20 72 65 63 |.XOne so|cket rec|
|00001300| 65 69 76 65 73 20 55 4e | 49 58 2d 64 6f 6d 61 69 |eives UN|IX-domai|
|00001310| 6e 20 64 61 74 61 67 72 | 61 6d 73 2c 0d 58 74 68 |n datagr|ams,.Xth|
|00001320| 65 20 6f 74 68 65 72 20 | 6c 69 73 74 65 6e 73 20 |e other |listens |
|00001330| 66 6f 72 20 49 6e 74 65 | 72 6e 65 74 2d 64 6f 6d |for Inte|rnet-dom|
|00001340| 61 69 6e 20 73 74 72 65 | 61 6d 20 63 6f 6e 6e 65 |ain stre|am conne|
|00001350| 63 74 69 6f 6e 73 2e 0d | 58 54 68 65 20 61 64 64 |ctions..|XThe add|
|00001360| 72 65 73 73 65 73 20 6f | 66 20 74 68 65 73 65 20 |resses o|f these |
|00001370| 73 6f 63 6b 65 74 73 20 | 61 72 65 20 70 6c 61 63 |sockets |are plac|
|00001380| 65 64 20 69 6e 20 74 68 | 65 20 65 6e 76 69 72 6f |ed in th|e enviro|
|00001390| 6e 6d 65 6e 74 0d 58 61 | 73 20 74 68 65 20 76 61 |nment.Xa|s the va|
|000013a0| 72 69 61 62 6c 65 73 20 | 60 60 55 57 5f 55 49 50 |riables |``UW_UIP|
|000013b0| 43 27 27 0d 58 28 55 4e | 49 58 2d 64 6f 6d 61 69 |C''.X(UN|IX-domai|
|000013c0| 6e 29 0d 58 61 6e 64 20 | 60 60 55 57 5f 49 4e 45 |n).Xand |``UW_INE|
|000013d0| 54 27 27 0d 58 28 49 6e | 74 65 72 6e 65 74 20 64 |T''.X(In|ternet d|
|000013e0| 6f 6d 61 69 6e 29 2e 0d | 58 2e 53 48 0d 58 44 61 |omain)..|X.SH.XDa|
|000013f0| 74 61 20 54 79 70 65 73 | 20 61 6e 64 20 44 61 74 |ta Types| and Dat|
|00001400| 61 20 53 74 72 75 63 74 | 75 72 65 73 0d 58 2e 50 |a Struct|ures.X.P|
|00001410| 50 0d 58 54 68 65 20 5c | 2a 28 75 77 20 70 72 6f |P.XThe \|*(uw pro|
|00001420| 67 72 61 6d 6d 65 72 27 | 73 20 6c 69 62 72 61 72 |grammer'|s librar|
|00001430| 79 20 75 73 65 73 20 61 | 20 6e 75 6d 62 65 72 0d |y uses a| number.|
|00001440| 58 6f 66 20 73 69 6d 70 | 6c 65 20 61 6e 64 20 73 |Xof simp|le and s|
|00001450| 74 72 75 63 74 75 72 65 | 64 20 64 61 74 61 20 74 |tructure|d data t|
|00001460| 79 70 65 73 2e 0d 58 2e | 49 50 20 75 77 69 64 5f |ypes..X.|IP uwid_|
|00001470| 74 20 31 69 0d 58 55 6e | 69 71 75 65 20 77 69 6e |t 1i.XUn|ique win|
|00001480| 64 6f 77 20 49 44 20 6e | 75 6d 62 65 72 73 20 61 |dow ID n|umbers a|
|00001490| 72 65 20 72 65 70 72 65 | 73 65 6e 74 65 64 20 62 |re repre|sented b|
|000014a0| 79 20 74 68 65 20 64 61 | 74 61 20 74 79 70 65 20 |y the da|ta type |
|000014b0| 60 60 75 77 69 64 5f 74 | 27 27 2e 0d 58 2e 49 50 |``uwid_t|''..X.IP|
|000014c0| 20 55 57 49 4e 0d 58 4c | 69 62 72 61 72 79 20 72 | UWIN.XL|ibrary r|
|000014d0| 6f 75 74 69 6e 65 73 20 | 77 68 69 63 68 20 6f 70 |outines |which op|
|000014e0| 65 72 61 74 65 20 75 70 | 6f 6e 20 65 78 74 65 72 |erate up|on exter|
|000014f0| 6e 61 6c 20 77 69 6e 64 | 6f 77 73 0d 58 70 75 74 |nal wind|ows.Xput|
|00001500| 20 61 20 72 61 6e 67 65 | 20 6f 66 20 77 69 6e 64 | a range| of wind|
|00001510| 6f 77 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 69 |ow infor|mation i|
|00001520| 6e 74 6f 20 61 20 73 74 | 72 75 63 74 75 72 65 2e |nto a st|ructure.|
|00001530| 0d 58 54 68 65 20 74 79 | 70 65 20 60 60 55 57 49 |.XThe ty|pe ``UWI|
|00001540| 4e 27 27 20 69 73 20 61 | 20 70 6f 69 6e 74 65 72 |N'' is a| pointer|
|00001550| 20 74 6f 20 74 68 65 20 | 73 74 72 75 63 74 75 72 | to the |structur|
|00001560| 65 2e 0d 58 41 6e 20 6f | 62 6a 65 63 74 20 6f 66 |e..XAn o|bject of|
|00001570| 20 74 68 69 73 20 64 61 | 74 61 74 79 70 65 20 69 | this da|tatype i|
|00001580| 73 20 72 65 66 65 72 72 | 65 64 20 74 6f 20 61 73 |s referr|ed to as|
|00001590| 20 61 20 60 60 77 69 6e | 64 6f 77 20 64 65 73 63 | a ``win|dow desc|
|000015a0| 72 69 70 74 6f 72 2e 27 | 27 0d 58 54 68 69 73 20 |riptor.'|'.XThis |
|000015b0| 64 65 63 6c 61 72 61 74 | 69 6f 6e 20 69 73 20 69 |declarat|ion is i|
|000015c0| 6e 74 65 6e 64 65 64 20 | 74 6f 20 62 65 20 75 73 |ntended |to be us|
|000015d0| 65 64 20 61 73 20 61 6e | 20 61 62 73 74 72 61 63 |ed as an| abstrac|
|000015e0| 74 20 75 6e 69 74 0d 58 | 28 69 6e 20 74 68 65 20 |t unit.X|(in the |
|000015f0| 6d 61 6e 6e 65 72 20 6f | 66 20 74 68 65 20 73 74 |manner o|f the st|
|00001600| 61 6e 64 61 72 64 20 49 | 2f 4f 20 6c 69 62 72 61 |andard I|/O libra|
|00001610| 72 79 27 73 20 60 60 46 | 49 4c 45 5c 20 2a 27 27 |ry's ``F|ILE\ *''|
|00001620| 29 2e 0d 58 2e 49 50 20 | 75 77 74 79 70 65 5f 74 |)..X.IP |uwtype_t|
|00001630| 0d 58 57 69 6e 64 6f 77 | 20 65 6d 75 6c 61 74 69 |.XWindow| emulati|
|00001640| 6f 6e 20 74 79 70 65 73 | 20 68 61 76 65 20 74 68 |on types| have th|
|00001650| 65 20 64 61 74 61 20 74 | 79 70 65 20 60 60 75 77 |e data t|ype ``uw|
|00001660| 74 79 70 65 5f 74 27 27 | 2e 0d 58 54 68 65 20 66 |type_t''|..XThe f|
|00001670| 6f 6c 6c 6f 77 69 6e 67 | 20 65 6d 75 6c 61 74 69 |ollowing| emulati|
|00001680| 6f 6e 20 74 79 70 65 73 | 20 61 72 65 20 64 65 66 |on types| are def|
|00001690| 69 6e 65 64 3a 0d 58 2e | 44 53 0d 58 2e 74 61 20 |ined:.X.|DS.X.ta |
|000016a0| 38 6e 20 32 34 6e 20 33 | 32 6e 0d 58 23 64 65 66 |8n 24n 3|2n.X#def|
|000016b0| 69 6e 65 09 55 57 54 5f | 41 44 4d 33 31 09 30 09 |ine.UWT_|ADM31.0.|
|000016c0| 2f 2a 20 41 44 4d 2d 33 | 31 20 63 75 72 73 6f 72 |/* ADM-3|1 cursor|
|000016d0| 2d 61 64 64 72 65 73 73 | 69 62 6c 65 20 74 65 72 |-address|ible ter|
|000016e0| 6d 69 6e 61 6c 20 2a 2f | 0d 58 23 64 65 66 69 6e |minal */|.X#defin|
|000016f0| 65 09 55 57 54 5f 56 54 | 35 32 09 31 09 2f 2a 20 |e.UWT_VT|52.1./* |
|00001700| 56 54 35 32 20 63 75 72 | 73 6f 72 2d 61 64 64 72 |VT52 cur|sor-addr|
|00001710| 65 73 73 69 62 6c 65 20 | 74 65 72 6d 69 6e 61 6c |essible |terminal|
|00001720| 20 2a 2f 0d 58 23 64 65 | 66 69 6e 65 09 55 57 54 | */.X#de|fine.UWT|
|00001730| 5f 41 4e 53 49 09 32 09 | 2f 2a 20 41 4e 53 49 2d |_ANSI.2.|/* ANSI-|
|00001740| 63 6f 6d 70 61 74 69 62 | 6c 65 20 74 65 72 6d 69 |compatib|le termi|
|00001750| 6e 61 6c 20 2a 2f 0d 58 | 23 64 65 66 69 6e 65 09 |nal */.X|#define.|
|00001760| 55 57 54 5f 54 45 4b 34 | 30 31 30 09 33 09 2f 2a |UWT_TEK4|010.3./*|
|00001770| 20 54 65 6b 74 72 6f 6e | 69 78 20 34 30 31 30 20 | Tektron|ix 4010 |
|00001780| 67 72 61 70 68 69 63 73 | 20 74 65 72 6d 69 6e 61 |graphics| termina|
|00001790| 6c 20 2a 2f 0d 58 23 64 | 65 66 69 6e 65 09 55 57 |l */.X#d|efine.UW|
|000017a0| 54 5f 46 54 50 09 34 09 | 2f 2a 20 46 69 6c 65 20 |T_FTP.4.|/* File |
|000017b0| 74 72 61 6e 73 66 65 72 | 20 2a 2f 0d 58 23 64 65 |transfer| */.X#de|
|000017c0| 66 69 6e 65 09 55 57 54 | 5f 50 52 49 4e 54 09 35 |fine.UWT|_PRINT.5|
|000017d0| 09 2f 2a 20 4f 75 74 70 | 75 74 20 74 6f 20 4d 61 |./* Outp|ut to Ma|
|000017e0| 63 69 6e 74 6f 73 68 20 | 70 72 69 6e 74 65 72 20 |cintosh |printer |
|000017f0| 2a 2f 0d 58 2e 44 45 0d | 58 2e 49 50 20 75 77 6f |*/.X.DE.|X.IP uwo|
|00001800| 70 74 5f 74 0d 58 57 69 | 6e 64 6f 77 20 6f 70 74 |pt_t.XWi|ndow opt|
|00001810| 69 6f 6e 73 20 61 72 65 | 20 61 73 73 69 67 6e 65 |ions are| assigne|
|00001820| 64 20 6e 75 6d 62 65 72 | 73 20 77 68 6f 73 65 20 |d number|s whose |
|00001830| 74 79 70 65 20 69 73 20 | 60 60 75 77 6f 70 74 5f |type is |``uwopt_|
|00001840| 74 27 27 2e 0d 58 54 68 | 65 20 6e 61 6d 65 73 20 |t''..XTh|e names |
|00001850| 6f 66 20 74 68 65 20 6f | 70 74 69 6f 6e 73 20 61 |of the o|ptions a|
|00001860| 72 65 3a 0d 58 2e 44 53 | 0d 58 2e 74 61 20 38 6e |re:.X.DS|.X.ta 8n|
|00001870| 20 32 38 6e 20 33 32 6e | 0d 58 23 64 65 66 69 6e | 28n 32n|.X#defin|
|00001880| 65 09 55 57 4f 50 5f 56 | 49 53 09 31 09 2f 2a 20 |e.UWOP_V|IS.1./* |
|00001890| 76 69 73 69 62 69 6c 69 | 74 79 20 2a 2f 0d 58 23 |visibili|ty */.X#|
|000018a0| 64 65 66 69 6e 65 09 55 | 57 4f 50 5f 54 59 50 45 |define.U|WOP_TYPE|
|000018b0| 09 32 09 2f 2a 20 77 69 | 6e 64 6f 77 20 74 79 70 |.2./* wi|ndow typ|
|000018c0| 65 20 2a 2f 0d 58 23 64 | 65 66 69 6e 65 09 55 57 |e */.X#d|efine.UW|
|000018d0| 4f 50 5f 50 4f 53 09 33 | 09 2f 2a 20 77 69 6e 64 |OP_POS.3|./* wind|
|000018e0| 6f 77 20 70 6f 73 69 74 | 69 6f 6e 20 2a 2f 0d 58 |ow posit|ion */.X|
|000018f0| 23 64 65 66 69 6e 65 09 | 55 57 4f 50 5f 54 49 54 |#define.|UWOP_TIT|
|00001900| 4c 45 09 34 09 2f 2a 20 | 77 69 6e 64 6f 77 20 74 |LE.4./* |window t|
|00001910| 69 74 6c 65 20 2a 2f 0d | 58 23 64 65 66 69 6e 65 |itle */.|X#define|
|00001920| 09 55 57 4f 50 5f 57 53 | 49 5a 45 09 35 09 2f 2a |.UWOP_WS|IZE.5./*|
|00001930| 20 77 69 6e 64 6f 77 20 | 73 69 7a 65 20 28 69 6e | window |size (in|
|00001940| 20 62 69 74 73 29 20 2a | 2f 0d 58 23 64 65 66 69 | bits) *|/.X#defi|
|00001950| 6e 65 09 55 57 4f 50 5f | 54 53 49 5a 45 09 38 09 |ne.UWOP_|TSIZE.8.|
|00001960| 2f 2a 20 74 65 72 6d 69 | 6e 61 6c 20 73 69 7a 65 |/* termi|nal size|
|00001970| 20 28 72 6f 77 2c 63 6f | 6c 29 20 2a 2f 0d 58 23 | (row,co|l) */.X#|
|00001980| 64 65 66 69 6e 65 09 55 | 57 4f 50 5f 54 46 4f 4e |define.U|WOP_TFON|
|00001990| 54 53 5a 09 39 09 2f 2a | 20 73 6d 61 6c 6c 2f 6c |TSZ.9./*| small/l|
|000019a0| 61 72 67 65 20 66 6f 6e | 74 20 73 69 7a 65 20 2a |arge fon|t size *|
|000019b0| 2f 0d 58 23 64 65 66 69 | 6e 65 09 55 57 4f 50 5f |/.X#defi|ne.UWOP_|
|000019c0| 54 43 4c 49 50 42 09 31 | 30 09 2f 2a 20 63 6c 69 |TCLIPB.1|0./* cli|
|000019d0| 70 62 6f 61 72 64 2f 6d | 6f 75 73 65 20 65 6e 63 |pboard/m|ouse enc|
|000019e0| 6f 64 69 6e 67 20 2a 2f | 0d 58 23 64 65 66 69 6e |oding */|.X#defin|
|000019f0| 65 09 55 57 4f 50 5f 54 | 42 45 4c 4c 09 31 31 09 |e.UWOP_T|BELL.11.|
|00001a00| 2f 2a 20 61 75 64 69 62 | 6c 65 2c 20 76 69 73 75 |/* audib|le, visu|
|00001a10| 61 6c 20 62 65 6c 6c 20 | 2a 2f 0d 58 23 64 65 66 |al bell |*/.X#def|
|00001a20| 69 6e 65 09 55 57 4f 50 | 5f 54 43 55 52 53 09 31 |ine.UWOP|_TCURS.1|
|00001a30| 32 09 2f 2a 20 63 75 72 | 73 6f 72 20 73 68 61 70 |2./* cur|sor shap|
|00001a40| 65 20 2a 2f 0d 58 2e 44 | 45 0d 58 2e 49 50 20 75 |e */.X.D|E.X.IP u|
|00001a50| 77 6f 70 74 63 6d 64 5f | 74 0d 58 54 68 65 20 77 |woptcmd_|t.XThe w|
|00001a60| 69 6e 64 6f 77 20 6f 70 | 74 69 6f 6e 20 63 6f 6d |indow op|tion com|
|00001a70| 6d 61 6e 64 73 0d 58 77 | 68 69 63 68 20 61 72 65 |mands.Xw|hich are|
|00001a80| 20 70 61 73 73 65 64 20 | 62 65 74 77 65 65 6e 20 | passed |between |
|00001a90| 74 68 65 20 4d 61 63 69 | 6e 74 6f 73 68 20 61 6e |the Maci|ntosh an|
|00001aa0| 64 20 74 68 65 20 68 6f | 73 74 0d 58 68 61 76 65 |d the ho|st.Xhave|
|00001ab0| 20 74 79 70 65 20 60 60 | 75 77 6f 70 74 63 6d 64 | type ``|uwoptcmd|
|00001ac0| 5f 74 27 27 2e 0d 58 54 | 68 65 73 65 20 63 6f 6d |_t''..XT|hese com|
|00001ad0| 6d 61 6e 64 73 20 61 72 | 65 3a 0d 58 2e 44 53 0d |mands ar|e:.X.DS.|
|00001ae0| 58 2e 74 61 20 38 6e 20 | 32 34 6e 20 33 32 6e 0d |X.ta 8n |24n 32n.|
|00001af0| 58 23 64 65 66 69 6e 65 | 09 55 57 4f 43 5f 53 45 |X#define|.UWOC_SE|
|00001b00| 54 09 30 09 09 2f 2a 20 | 73 65 74 20 76 61 6c 75 |T.0../* |set valu|
|00001b10| 65 20 6f 66 20 6f 70 74 | 69 6f 6e 20 2a 2f 0d 58 |e of opt|ion */.X|
|00001b20| 23 64 65 66 69 6e 65 09 | 55 57 4f 43 5f 41 53 4b |#define.|UWOC_ASK|
|00001b30| 09 32 09 09 2f 2a 20 61 | 73 6b 20 66 6f 72 20 76 |.2../* a|sk for v|
|00001b40| 61 6c 75 65 20 6f 66 20 | 6f 70 74 69 6f 6e 20 2a |alue of |option *|
|00001b50| 2f 0d 58 23 64 65 66 69 | 6e 65 09 55 57 4f 43 5f |/.X#defi|ne.UWOC_|
|00001b60| 44 4f 09 34 09 09 2f 2a | 20 72 65 70 6f 72 74 20 |DO.4../*| report |
|00001b70| 63 68 61 6e 67 65 73 20 | 69 6e 20 76 61 6c 75 65 |changes |in value|
|00001b80| 20 2a 2f 0d 58 23 64 65 | 66 69 6e 65 09 55 57 4f | */.X#de|fine.UWO|
|00001b90| 43 5f 44 4f 4e 54 09 35 | 09 09 2f 2a 20 64 6f 6e |C_DONT.5|../* don|
|00001ba0| 27 74 20 72 65 70 6f 72 | 74 20 63 68 61 6e 67 65 |'t repor|t change|
|00001bb0| 73 20 2a 2f 0d 58 23 64 | 65 66 69 6e 65 09 55 57 |s */.X#d|efine.UW|
|00001bc0| 4f 43 5f 57 49 4c 4c 09 | 36 09 09 2f 2a 20 77 69 |OC_WILL.|6../* wi|
|00001bd0| 6c 6c 20 72 65 70 6f 72 | 74 20 63 68 61 6e 67 65 |ll repor|t change|
|00001be0| 73 20 2a 2f 0d 58 23 64 | 65 66 69 6e 65 09 55 57 |s */.X#d|efine.UW|
|00001bf0| 4f 43 5f 57 4f 4e 54 09 | 37 09 09 2f 2a 20 77 6f |OC_WONT.|7../* wo|
|00001c00| 6e 27 74 20 72 65 70 6f | 72 74 20 63 68 61 6e 67 |n't repo|rt chang|
|00001c10| 65 73 20 2a 2f 0d 58 2e | 44 45 0d 58 2e 49 50 20 |es */.X.|DE.X.IP |
|00001c20| 22 75 6e 69 6f 6e 20 75 | 77 6f 70 74 76 61 6c 22 |"union u|woptval"|
|00001c30| 0d 58 57 68 65 6e 20 61 | 20 66 75 6e 63 74 69 6f |.XWhen a| functio|
|00001c40| 6e 20 72 65 71 75 69 72 | 65 73 20 61 20 77 69 6e |n requir|es a win|
|00001c50| 64 6f 77 20 6f 70 74 69 | 6f 6e 20 76 61 6c 75 65 |dow opti|on value|
|00001c60| 20 61 73 20 61 6e 20 61 | 72 67 75 6d 65 6e 74 2c | as an a|rgument,|
|00001c70| 0d 58 74 68 65 20 76 61 | 6c 75 65 20 6f 66 20 74 |.Xthe va|lue of t|
|00001c80| 68 65 20 77 69 6e 64 6f | 77 20 6f 70 74 69 6f 6e |he windo|w option|
|00001c90| 20 69 73 20 70 6c 61 63 | 65 64 20 69 6e 74 6f 20 | is plac|ed into |
|00001ca0| 61 0d 58 75 6e 69 6f 6e | 20 64 65 63 6c 61 72 65 |a.Xunion| declare|
|00001cb0| 64 20 61 73 20 60 60 75 | 6e 69 6f 6e 20 75 77 6f |d as ``u|nion uwo|
|00001cc0| 70 74 76 61 6c 27 27 2e | 0d 58 54 68 65 20 61 64 |ptval''.|.XThe ad|
|00001cd0| 64 72 65 73 73 20 6f 66 | 20 74 68 69 73 20 75 6e |dress of| this un|
|00001ce0| 69 6f 6e 20 69 73 20 70 | 61 73 73 65 64 20 74 6f |ion is p|assed to|
|00001cf0| 20 74 68 65 20 66 75 6e | 63 74 69 6f 6e 2e 0d 58 | the fun|ction..X|
|00001d00| 54 68 69 73 20 75 6e 69 | 6f 6e 20 69 73 20 64 65 |This uni|on is de|
|00001d10| 63 6c 61 72 65 64 20 61 | 73 20 66 6f 6c 6c 6f 77 |clared a|s follow|
|00001d20| 73 3a 0d 58 2e 44 53 0d | 58 2e 74 61 20 38 6e 20 |s:.X.DS.|X.ta 8n |
|00001d30| 31 36 6e 20 32 34 6e 0d | 58 75 6e 69 6f 6e 20 75 |16n 24n.|Xunion u|
|00001d40| 77 6f 70 74 76 61 6c 20 | 7b 0d 58 09 75 6e 73 69 |woptval |{.X.unsi|
|00001d50| 67 6e 65 64 20 63 68 61 | 72 09 75 77 6f 76 5f 31 |gned cha|r.uwov_1|
|00001d60| 62 69 74 3b 0d 58 09 75 | 6e 73 69 67 6e 65 64 20 |bit;.X.u|nsigned |
|00001d70| 63 68 61 72 09 75 77 6f | 76 5f 32 62 69 74 3b 0d |char.uwo|v_2bit;.|
|00001d80| 58 09 75 6e 73 69 67 6e | 65 64 20 63 68 61 72 09 |X.unsign|ed char.|
|00001d90| 75 77 6f 76 5f 36 62 69 | 74 3b 0d 58 09 75 6e 73 |uwov_6bi|t;.X.uns|
|00001da0| 69 67 6e 65 64 20 73 68 | 6f 72 74 09 75 77 6f 76 |igned sh|ort.uwov|
|00001db0| 5f 31 32 62 69 74 3b 0d | 58 09 73 74 72 75 63 74 |_12bit;.|X.struct|
|00001dc0| 20 7b 0d 58 09 09 75 6e | 73 69 67 6e 65 64 20 73 | {.X..un|signed s|
|00001dd0| 68 6f 72 74 20 76 2c 68 | 3b 0d 58 09 7d 09 09 75 |hort v,h|;.X.}..u|
|00001de0| 77 6f 76 5f 70 6f 69 6e | 74 3b 0d 58 09 63 68 61 |wov_poin|t;.X.cha|
|00001df0| 72 09 09 75 77 6f 76 5f | 73 74 72 69 6e 67 5b 32 |r..uwov_|string[2|
|00001e00| 35 36 5d 3b 0d 58 7d 3b | 0d 58 2e 44 45 0d 58 54 |56];.X};|.X.DE.XT|
|00001e10| 68 65 20 75 6e 69 6f 6e | 20 6d 65 6d 62 65 72 20 |he union| member |
|00001e20| 75 73 65 64 20 66 6f 72 | 20 61 20 70 61 72 74 69 |used for| a parti|
|00001e30| 63 75 6c 61 72 20 6f 70 | 74 69 6f 6e 0d 58 64 65 |cular op|tion.Xde|
|00001e40| 70 65 6e 64 73 20 75 70 | 6f 6e 20 74 68 65 20 6f |pends up|on the o|
|00001e50| 70 74 69 6f 6e 20 6e 75 | 6d 62 65 72 2e 0d 58 41 |ption nu|mber..XA|
|00001e60| 74 20 70 72 65 73 65 6e | 74 2c 0d 58 74 68 65 20 |t presen|t,.Xthe |
|00001e70| 74 79 70 65 73 20 6f 66 | 20 74 68 65 20 77 69 6e |types of| the win|
|00001e80| 64 6f 77 20 6f 70 74 69 | 6f 6e 73 20 61 6e 64 0d |dow opti|ons and.|
|00001e90| 58 63 6f 72 72 65 73 70 | 6f 6e 64 69 6e 67 20 75 |Xcorresp|onding u|
|00001ea0| 6e 69 6f 6e 20 6d 65 6d | 62 65 72 73 20 61 72 65 |nion mem|bers are|
|00001eb0| 3a 0d 58 2e 44 53 0d 58 | 2e 74 61 20 31 69 0d 58 |:.X.DS.X|.ta 1i.X|
|00001ec0| 76 69 73 69 62 69 6c 69 | 74 79 09 75 77 6f 76 5f |visibili|ty.uwov_|
|00001ed0| 31 62 69 74 0d 58 74 79 | 70 65 09 75 77 6f 76 5f |1bit.Xty|pe.uwov_|
|00001ee0| 36 62 69 74 0d 58 70 6f | 73 69 74 69 6f 6e 09 75 |6bit.Xpo|sition.u|
|00001ef0| 77 6f 76 5f 70 6f 69 6e | 74 0d 58 74 69 74 6c 65 |wov_poin|t.Xtitle|
|00001f00| 09 09 75 77 6f 76 5f 73 | 74 72 69 6e 67 20 28 6e |..uwov_s|tring (n|
|00001f10| 75 6c 6c 20 74 65 72 6d | 69 6e 61 74 65 64 29 0d |ull term|inated).|
|00001f20| 58 62 69 74 20 73 69 7a | 65 09 75 77 6f 76 5f 70 |Xbit siz|e.uwov_p|
|00001f30| 6f 69 6e 74 0d 58 74 74 | 79 20 73 69 7a 65 09 75 |oint.Xtt|y size.u|
|00001f40| 77 6f 76 5f 70 6f 69 6e | 74 0d 58 66 6f 6e 74 20 |wov_poin|t.Xfont |
|00001f50| 73 69 7a 65 09 75 77 6f | 76 5f 31 62 69 74 0d 58 |size.uwo|v_1bit.X|
|00001f60| 63 6c 69 70 62 6f 61 72 | 64 09 75 77 6f 76 5f 31 |clipboar|d.uwov_1|
|00001f70| 62 69 74 0d 58 62 65 6c | 6c 09 09 75 77 6f 76 5f |bit.Xbel|l..uwov_|
|00001f80| 32 62 69 74 0d 58 63 75 | 72 73 6f 72 20 74 79 70 |2bit.Xcu|rsor typ|
|00001f90| 65 09 75 77 6f 76 5f 31 | 62 69 74 0d 58 2e 44 45 |e.uwov_1|bit.X.DE|
|00001fa0| 0d 58 2e 49 50 20 22 75 | 77 65 72 72 5f 74 22 0d |.X.IP "u|werr_t".|
|00001fb0| 58 57 68 65 6e 20 61 20 | 6c 69 62 72 61 72 79 20 |XWhen a |library |
|00001fc0| 72 6f 75 74 69 6e 65 20 | 72 65 74 75 72 6e 73 20 |routine |returns |
|00001fd0| 61 6e 20 65 72 72 6f 72 | 20 69 6e 64 69 63 61 74 |an error| indicat|
|00001fe0| 69 6f 6e 2c 0d 58 66 75 | 72 74 68 65 72 20 69 6e |ion,.Xfu|rther in|
|00001ff0| 66 6f 72 6d 61 74 69 6f | 6e 20 61 62 6f 75 74 20 |formatio|n about |
|00002000| 74 68 65 20 74 79 70 65 | 20 6f 66 20 65 72 72 6f |the type| of erro|
|00002010| 72 20 63 61 6e 20 62 65 | 0d 58 6f 62 74 61 69 6e |r can be|.Xobtain|
|00002020| 65 64 20 66 72 6f 6d 20 | 74 68 65 20 67 6c 6f 62 |ed from |the glob|
|00002030| 61 6c 20 76 61 72 69 61 | 62 6c 65 20 60 60 75 77 |al varia|ble ``uw|
|00002040| 65 72 72 6e 6f 27 27 2e | 0d 58 28 44 65 70 65 6e |errno''.|.X(Depen|
|00002050| 64 69 6e 67 20 75 70 6f | 6e 20 74 68 65 20 74 79 |ding upo|n the ty|
|00002060| 70 65 20 6f 66 20 65 72 | 72 6f 72 2c 0d 58 74 68 |pe of er|ror,.Xth|
|00002070| 65 20 65 78 74 65 72 6e | 61 6c 20 76 61 72 69 61 |e extern|al varia|
|00002080| 62 6c 65 20 60 60 65 72 | 72 6e 6f 27 27 20 6d 61 |ble ``er|rno'' ma|
|00002090| 79 20 61 6c 73 6f 20 63 | 6f 6e 74 61 69 6e 0d 58 |y also c|ontain.X|
|000020a0| 70 65 72 74 69 6e 65 6e | 74 20 69 6e 66 6f 72 6d |pertinen|t inform|
|000020b0| 61 74 69 6f 6e 2e 29 0d | 58 5c 2a 28 75 77 20 65 |ation.).|X\*(uw e|
|000020c0| 72 72 6f 72 20 6e 75 6d | 62 65 72 73 20 68 61 76 |rror num|bers hav|
|000020d0| 65 20 74 79 70 65 20 60 | 60 75 77 65 72 72 5f 74 |e type `|`uwerr_t|
|000020e0| 27 27 2c 0d 58 61 6e 64 | 20 61 72 65 20 64 65 66 |'',.Xand| are def|
|000020f0| 69 6e 65 64 20 61 73 20 | 66 6f 6c 6c 6f 77 73 3a |ined as |follows:|
|00002100| 0d 58 2e 44 53 0d 58 2e | 74 61 20 38 6e 20 32 34 |.X.DS.X.|ta 8n 24|
|00002110| 6e 20 33 32 6e 0d 58 23 | 64 65 66 69 6e 65 09 55 |n 32n.X#|define.U|
|00002120| 57 45 5f 4e 4f 4e 45 09 | 30 09 2f 2a 20 6e 6f 20 |WE_NONE.|0./* no |
|00002130| 65 72 72 6f 72 20 2a 2f | 0d 58 23 64 65 66 69 6e |error */|.X#defin|
|00002140| 65 09 55 57 45 5f 45 52 | 52 4e 4f 09 31 09 2f 2a |e.UWE_ER|RNO.1./*|
|00002150| 20 73 79 73 74 65 6d 20 | 63 61 6c 6c 20 65 72 72 | system |call err|
|00002160| 6f 72 2c 20 63 6f 6e 73 | 75 6c 74 20 65 72 72 6e |or, cons|ult errn|
|00002170| 6f 20 2a 2f 0d 58 23 64 | 65 66 69 6e 65 09 55 57 |o */.X#d|efine.UW|
|00002180| 45 5f 4e 58 54 59 50 45 | 09 32 09 2f 2a 20 6e 6f |E_NXTYPE|.2./* no|
|00002190| 6e 65 78 69 73 74 65 6e | 74 20 77 69 6e 64 6f 77 |nexisten|t window|
|000021a0| 20 74 79 70 65 20 2a 2f | 0d 58 23 64 65 66 69 6e | type */|.X#defin|
|000021b0| 65 09 55 57 45 5f 44 55 | 50 49 44 09 33 09 2f 2a |e.UWE_DU|PID.3./*|
|000021c0| 20 77 69 6e 64 6f 77 20 | 49 44 20 64 75 70 6c 69 | window |ID dupli|
|000021d0| 63 61 74 65 64 20 28 69 | 6e 20 75 73 65 29 20 2a |cated (i|n use) *|
|000021e0| 2f 0d 58 23 64 65 66 69 | 6e 65 09 55 57 45 5f 4e |/.X#defi|ne.UWE_N|
|000021f0| 4f 54 49 4d 50 4c 09 34 | 09 2f 2a 20 6f 70 65 72 |OTIMPL.4|./* oper|
|00002200| 61 74 69 6f 6e 20 6e 6f | 74 20 69 6d 70 6c 65 6d |ation no|t implem|
|00002210| 65 6e 74 65 64 20 79 65 | 74 20 2a 2f 0d 58 23 64 |ented ye|t */.X#d|
|00002220| 65 66 69 6e 65 09 55 57 | 45 5f 4e 58 53 45 52 56 |efine.UW|E_NXSERV|
|00002230| 09 35 09 2f 2a 20 6e 6f | 6e 2d 65 78 69 73 74 65 |.5./* no|n-existe|
|00002240| 6e 74 20 73 65 72 76 65 | 72 20 2a 2f 0d 58 23 64 |nt serve|r */.X#d|
|00002250| 65 66 69 6e 65 09 55 57 | 45 5f 4e 4f 4d 45 4d 09 |efine.UW|E_NOMEM.|
|00002260| 36 09 2f 2a 20 75 6e 61 | 62 6c 65 20 74 6f 20 61 |6./* una|ble to a|
|00002270| 6c 6c 6f 63 61 74 65 20 | 72 65 71 75 69 72 65 64 |llocate |required|
|00002280| 20 6d 65 6d 6f 72 79 20 | 2a 2f 0d 58 23 64 65 66 | memory |*/.X#def|
|00002290| 69 6e 65 09 55 57 45 5f | 49 4e 56 41 4c 09 37 09 |ine.UWE_|INVAL.7.|
|000022a0| 2f 2a 20 69 6e 76 61 6c | 69 64 20 61 72 67 75 6d |/* inval|id argum|
|000022b0| 65 6e 74 20 74 6f 20 66 | 75 6e 63 74 69 6f 6e 20 |ent to f|unction |
|000022c0| 2a 2f 0d 58 23 64 65 66 | 69 6e 65 09 55 57 45 5f |*/.X#def|ine.UWE_|
|000022d0| 4e 4f 43 54 4c 09 38 09 | 2f 2a 20 6e 6f 20 63 6f |NOCTL.8.|/* no co|
|000022e0| 6e 74 72 6f 6c 20 66 69 | 6c 65 20 64 65 73 63 72 |ntrol fi|le descr|
|000022f0| 69 70 74 6f 72 20 2a 2f | 0d 58 2e 44 45 0d 58 2e |iptor */|.X.DE.X.|
|00002300| 53 48 0d 58 49 6e 74 65 | 72 6e 61 6c 20 57 69 6e |SH.XInte|rnal Win|
|00002310| 64 6f 77 20 49 6e 74 65 | 72 66 61 63 65 0d 58 2e |dow Inte|rface.X.|
|00002320| 50 50 0d 58 57 68 65 6e | 20 61 6e 20 69 6e 74 65 |PP.XWhen| an inte|
|00002330| 72 6e 61 6c 20 77 69 6e | 64 6f 77 20 69 73 20 63 |rnal win|dow is c|
|00002340| 72 65 61 74 65 64 20 62 | 79 20 61 6e 20 65 78 74 |reated b|y an ext|
|00002350| 65 72 6e 61 6c 20 70 72 | 6f 63 65 73 73 2c 0d 58 |ernal pr|ocess,.X|
|00002360| 61 20 55 4e 49 58 2d 64 | 6f 6d 61 69 6e 20 64 61 |a UNIX-d|omain da|
|00002370| 74 61 67 72 61 6d 20 69 | 73 20 73 65 6e 74 20 74 |tagram i|s sent t|
|00002380| 6f 20 74 68 65 20 73 65 | 72 76 65 72 2e 0d 58 54 |o the se|rver..XT|
|00002390| 68 69 73 20 64 61 74 61 | 67 72 61 6d 20 63 6f 6e |his data|gram con|
|000023a0| 74 61 69 6e 73 0d 58 28 | 61 73 20 60 60 61 63 63 |tains.X(|as ``acc|
|000023b0| 65 73 73 20 72 69 67 68 | 74 73 27 27 29 0d 58 61 |ess righ|ts'').Xa|
|000023c0| 20 66 69 6c 65 20 64 65 | 73 63 72 69 70 74 6f 72 | file de|scriptor|
|000023d0| 20 66 6f 72 20 74 68 65 | 20 60 60 6d 61 73 74 65 | for the| ``maste|
|000023e0| 72 27 27 20 73 69 64 65 | 20 6f 66 20 61 20 70 73 |r'' side| of a ps|
|000023f0| 65 75 64 6f 2d 74 65 72 | 6d 69 6e 61 6c 2e 0d 58 |eudo-ter|minal..X|
|00002400| 54 68 65 20 73 65 72 76 | 65 72 20 61 73 73 75 6d |The serv|er assum|
|00002410| 65 73 20 74 68 61 74 20 | 74 68 65 20 65 78 74 65 |es that |the exte|
|00002420| 72 6e 61 6c 20 70 72 6f | 63 65 73 73 0d 58 68 61 |rnal pro|cess.Xha|
|00002430| 73 20 73 74 61 72 74 65 | 64 20 73 6f 6d 65 20 70 |s starte|d some p|
|00002440| 72 6f 67 72 61 6d 20 6f | 6e 20 74 68 65 20 60 60 |rogram o|n the ``|
|00002450| 73 6c 61 76 65 27 27 20 | 73 69 64 65 20 6f 66 20 |slave'' |side of |
|00002460| 74 68 65 20 70 73 65 75 | 64 6f 2d 74 65 72 6d 69 |the pseu|do-termi|
|00002470| 6e 61 6c 2e 0d 58 41 66 | 74 65 72 20 73 65 6e 64 |nal..XAf|ter send|
|00002480| 69 6e 67 20 74 68 65 20 | 64 61 74 61 67 72 61 6d |ing the |datagram|
|00002490| 2c 0d 58 74 68 65 20 73 | 65 6e 64 65 72 20 68 61 |,.Xthe s|ender ha|
|000024a0| 73 20 6e 6f 20 64 69 72 | 65 63 74 20 68 61 6e 64 |s no dir|ect hand|
|000024b0| 6c 65 20 74 6f 20 6d 61 | 6e 69 70 75 6c 61 74 65 |le to ma|nipulate|
|000024c0| 0d 58 74 68 65 20 77 69 | 6e 64 6f 77 2e 0d 58 49 |.Xthe wi|ndow..XI|
|000024d0| 74 20 68 61 73 2c 0d 58 | 69 6e 20 65 66 66 65 63 |t has,.X|in effec|
|000024e0| 74 2c 0d 58 72 65 6c 69 | 6e 71 75 69 73 68 65 64 |t,.Xreli|nquished|
|000024f0| 20 61 6c 6c 20 63 6f 6e | 74 72 6f 6c 2e 0d 58 28 | all con|trol..X(|
|00002500| 49 74 20 73 68 6f 75 6c | 64 20 63 6c 6f 73 65 20 |It shoul|d close |
|00002510| 74 68 65 20 6d 61 73 74 | 65 72 20 73 69 64 65 20 |the mast|er side |
|00002520| 6f 66 20 74 68 65 20 70 | 73 65 75 64 6f 2d 74 65 |of the p|seudo-te|
|00002530| 72 6d 69 6e 61 6c 0d 58 | 61 66 74 65 72 20 73 65 |rminal.X|after se|
|00002540| 6e 64 69 6e 67 20 74 68 | 65 20 64 61 74 61 67 72 |nding th|e datagr|
|00002550| 61 6d 2e 29 0d 58 54 6f | 20 70 72 6f 76 69 64 65 |am.).XTo| provide|
|00002560| 20 73 6f 6d 65 20 61 64 | 64 69 74 69 6f 6e 61 6c | some ad|ditional|
|00002570| 20 66 6c 65 78 69 62 69 | 6c 69 74 79 2c 0d 58 69 | flexibi|lity,.Xi|
|00002580| 74 20 69 73 20 70 6f 73 | 73 69 62 6c 65 20 74 6f |t is pos|sible to|
|00002590| 20 63 68 61 6e 67 65 20 | 74 68 65 20 76 61 6c 75 | change |the valu|
|000025a0| 65 20 6f 66 20 61 20 77 | 69 6e 64 6f 77 20 6f 70 |e of a w|indow op|
|000025b0| 74 69 6f 6e 0d 58 66 6f | 72 20 61 6e 79 20 77 69 |tion.Xfo|r any wi|
|000025c0| 6e 64 6f 77 0d 58 28 65 | 76 65 6e 20 60 60 65 78 |ndow.X(e|ven ``ex|
|000025d0| 74 65 72 6e 61 6c 27 27 | 20 77 69 6e 64 6f 77 73 |ternal''| windows|
|000025e0| 29 0d 58 69 66 20 74 68 | 65 20 77 69 6e 64 6f 77 |).Xif th|e window|
|000025f0| 27 73 20 75 6e 69 71 75 | 65 20 49 44 20 69 73 20 |'s uniqu|e ID is |
|00002600| 6b 6e 6f 77 6e 2e 0d 58 | 54 68 65 20 63 72 65 61 |known..X|The crea|
|00002610| 74 6f 72 20 6f 66 20 74 | 68 65 20 77 69 6e 64 6f |tor of t|he windo|
|00002620| 77 20 68 61 73 20 6e 6f | 20 73 70 65 63 69 61 6c |w has no| special|
|00002630| 20 70 72 69 76 69 6c 65 | 67 65 73 0d 58 69 6e 20 | privile|ges.Xin |
|00002640| 74 68 69 73 20 72 65 67 | 61 72 64 2e 0d 58 2e 4c |this reg|ard..X.L|
|00002650| 50 0d 58 5b 4f 6e 65 20 | 74 68 69 6e 67 20 77 68 |P.X[One |thing wh|
|00002660| 69 63 68 20 74 68 65 20 | 69 6e 74 65 72 6e 61 6c |ich the |internal|
|00002670| 20 77 69 6e 64 6f 77 20 | 72 6f 75 74 69 6e 65 73 | window |routines|
|00002680| 0d 58 69 6e 20 74 68 65 | 20 5c 2a 28 75 77 20 6c |.Xin the| \*(uw l|
|00002690| 69 62 72 61 72 79 20 63 | 6f 6d 70 6c 65 74 65 6c |ibrary c|ompletel|
|000026a0| 79 20 69 67 6e 6f 72 65 | 0d 58 69 73 20 74 68 65 |y ignore|.Xis the|
|000026b0| 20 66 61 63 74 20 74 68 | 61 74 20 64 61 74 61 67 | fact th|at datag|
|000026c0| 72 61 6d 73 20 61 72 65 | 20 6e 6f 74 20 67 75 61 |rams are| not gua|
|000026d0| 72 61 6e 74 65 65 64 20 | 74 6f 20 62 65 20 72 65 |ranteed |to be re|
|000026e0| 6c 69 61 62 6c 65 2e 0d | 58 55 4e 49 58 2d 64 6f |liable..|XUNIX-do|
|000026f0| 6d 61 69 6e 20 64 61 74 | 61 67 72 61 6d 73 20 61 |main dat|agrams a|
|00002700| 6c 6d 6f 73 74 20 61 6c | 77 61 79 73 20 73 65 65 |lmost al|ways see|
|00002710| 6d 20 74 6f 20 77 6f 72 | 6b 2c 0d 58 62 75 74 20 |m to wor|k,.Xbut |
|00002720| 74 68 65 79 20 63 61 6e | 20 66 61 69 6c 2e 0d 58 |they can| fail..X|
|00002730| 49 6e 20 74 68 65 20 61 | 75 74 68 6f 72 27 73 20 |In the a|uthor's |
|00002740| 65 78 70 65 72 69 65 6e | 63 65 20 74 68 69 73 20 |experien|ce this |
|00002750| 68 61 73 20 6e 65 76 65 | 72 20 62 65 65 6e 20 61 |has neve|r been a|
|00002760| 20 70 72 6f 62 6c 65 6d | 2c 0d 58 62 75 74 20 6c | problem|,.Xbut l|
|00002770| 65 74 20 74 68 65 20 75 | 73 65 72 20 62 65 77 61 |et the u|ser bewa|
|00002780| 72 65 2e 5d 0d 58 2e 4c | 50 0d 58 54 68 65 20 66 |re.].X.L|P.XThe f|
|00002790| 6f 6c 6c 6f 77 69 6e 67 | 20 72 6f 75 74 69 6e 65 |ollowing| routine|
|000027a0| 73 20 61 72 65 20 61 76 | 61 69 6c 61 62 6c 65 3a |s are av|ailable:|
|000027b0| 0d 58 2e 49 50 20 75 77 | 5f 66 6f 72 6b 20 31 69 |.X.IP uw|_fork 1i|
|000027c0| 0d 58 54 68 69 73 20 72 | 6f 75 74 69 6e 65 20 69 |.XThis r|outine i|
|000027d0| 73 20 73 69 6d 69 6c 61 | 72 20 69 6e 20 63 6f 6e |s simila|r in con|
|000027e0| 63 65 70 74 20 74 6f 20 | 74 68 65 20 73 79 73 74 |cept to |the syst|
|000027f0| 65 6d 20 63 61 6c 6c 20 | 60 60 66 6f 72 6b 27 27 |em call |``fork''|
|00002800| 2e 0d 58 49 74 20 63 72 | 65 61 74 65 73 20 61 20 |..XIt cr|eates a |
|00002810| 6e 65 77 20 70 72 6f 63 | 65 73 73 0d 58 61 6e 64 |new proc|ess.Xand|
|00002820| 20 72 65 74 75 72 6e 73 | 20 74 77 69 63 65 20 5c | returns| twice \|
|00002830| 28 65 6d 0d 58 6f 6e 63 | 65 20 69 6e 20 74 68 65 |(em.Xonc|e in the|
|00002840| 20 70 61 72 65 6e 74 20 | 61 6e 64 20 6f 6e 63 65 | parent |and once|
|00002850| 20 69 6e 20 74 68 65 20 | 63 68 69 6c 64 2e 0d 58 | in the |child..X|
|00002860| 49 6e 20 61 64 64 69 74 | 69 6f 6e 20 74 6f 20 63 |In addit|ion to c|
|00002870| 72 65 61 74 69 6e 67 20 | 61 20 6e 65 77 20 70 72 |reating |a new pr|
|00002880| 6f 63 65 73 73 2c 0d 58 | 60 60 75 77 5f 66 6f 72 |ocess,.X|``uw_for|
|00002890| 6b 27 27 20 61 6c 73 6f | 20 61 72 72 61 6e 67 65 |k'' also| arrange|
|000028a0| 73 20 66 6f 72 20 74 68 | 65 20 6e 65 77 20 70 72 |s for th|e new pr|
|000028b0| 6f 63 65 73 73 20 74 6f | 20 62 65 0d 58 61 73 73 |ocess to| be.Xass|
|000028c0| 6f 63 69 61 74 65 64 20 | 77 69 74 68 20 61 6e 20 |ociated |with an |
|000028d0| 69 6e 74 65 72 6e 61 6c | 20 77 69 6e 64 6f 77 2e |internal| window.|
|000028e0| 0d 58 49 74 20 6f 70 65 | 6e 73 20 61 20 70 73 65 |.XIt ope|ns a pse|
|000028f0| 75 64 6f 2d 74 65 72 6d | 69 6e 61 6c 2c 0d 58 72 |udo-term|inal,.Xr|
|00002900| 65 64 69 72 65 63 74 73 | 20 74 68 65 20 63 68 69 |edirects| the chi|
|00002910| 6c 64 27 73 20 73 74 61 | 6e 64 61 72 64 20 69 6e |ld's sta|ndard in|
|00002920| 70 75 74 2c 0d 58 73 74 | 61 6e 64 61 72 64 20 6f |put,.Xst|andard o|
|00002930| 75 74 70 75 74 2c 0d 58 | 61 6e 64 20 73 74 61 6e |utput,.X|and stan|
|00002940| 64 61 72 64 20 65 72 72 | 6f 72 2c 0d 58 61 6e 64 |dard err|or,.Xand|
|00002950| 20 73 65 6e 64 73 20 61 | 20 55 4e 49 58 2d 64 6f | sends a| UNIX-do|
|00002960| 6d 61 69 6e 20 64 61 74 | 61 67 72 61 6d 20 74 6f |main dat|agram to|
|00002970| 20 74 68 65 20 5c 2a 28 | 75 77 20 73 65 72 76 65 | the \*(|uw serve|
|00002980| 72 2e 0d 58 49 74 20 72 | 65 74 75 72 6e 73 20 74 |r..XIt r|eturns t|
|00002990| 68 65 20 75 6e 69 71 75 | 65 20 49 44 20 61 73 73 |he uniqu|e ID ass|
|000029a0| 6f 63 69 61 74 65 64 20 | 77 69 74 68 20 74 68 65 |ociated |with the|
|000029b0| 20 77 69 6e 64 6f 77 0d | 58 69 6e 20 74 68 65 20 | window.|Xin the |
|000029c0| 70 61 72 65 6e 74 2c 0d | 58 61 6e 64 20 72 65 74 |parent,.|Xand ret|
|000029d0| 75 72 6e 73 20 30 20 69 | 6e 20 74 68 65 20 63 68 |urns 0 i|n the ch|
|000029e0| 69 6c 64 2e 0d 58 28 5c | 28 6d 69 31 20 69 73 20 |ild..X(\|(mi1 is |
|000029f0| 72 65 74 75 72 6e 65 64 | 20 69 66 20 74 68 65 20 |returned| if the |
|00002a00| 72 6f 75 74 69 6e 65 20 | 66 61 69 6c 73 2e 29 0d |routine |fails.).|
|00002a10| 58 2e 44 53 0d 58 75 77 | 69 64 5f 74 20 75 77 5f |X.DS.Xuw|id_t uw_|
|00002a20| 66 6f 72 6b 28 75 77 74 | 79 70 65 5f 74 20 77 74 |fork(uwt|ype_t wt|
|00002a30| 79 70 65 2c 20 69 6e 74 | 20 2a 70 69 64 70 29 3b |ype, int| *pidp);|
|00002a40| 0d 58 2e 44 45 0d 58 54 | 68 65 20 66 69 72 73 74 |.X.DE.XT|he first|
|00002a50| 20 61 72 67 75 6d 65 6e | 74 20 73 70 65 63 69 66 | argumen|t specif|
|00002a60| 69 65 73 20 74 68 65 20 | 74 79 70 65 20 6f 66 20 |ies the |type of |
|00002a70| 74 68 65 20 6e 65 77 20 | 77 69 6e 64 6f 77 2e 0d |the new |window..|
|00002a80| 58 49 66 20 74 68 65 20 | 73 65 63 6f 6e 64 20 61 |XIf the |second a|
|00002a90| 72 67 75 6d 65 6e 74 20 | 74 6f 20 60 60 75 77 5f |rgument |to ``uw_|
|00002aa0| 66 6f 72 6b 27 27 20 69 | 73 20 61 20 6e 6f 6e 2d |fork'' i|s a non-|
|00002ab0| 4e 55 4c 4c 20 70 6f 69 | 6e 74 65 72 2c 0d 58 74 |NULL poi|nter,.Xt|
|00002ac0| 68 65 20 70 72 6f 63 65 | 73 73 2d 49 44 20 6f 66 |he proce|ss-ID of|
|00002ad0| 20 74 68 65 20 63 68 69 | 6c 64 20 77 69 6c 6c 20 | the chi|ld will |
|00002ae0| 62 65 20 73 74 6f 72 65 | 64 20 61 74 20 74 68 61 |be store|d at tha|
|00002af0| 74 20 61 64 64 72 65 73 | 73 0d 58 69 6e 20 74 68 |t addres|s.Xin th|
|00002b00| 65 20 70 61 72 65 6e 74 | 20 70 72 6f 63 65 73 73 |e parent| process|
|00002b10| 2e 0d 58 28 49 6e 20 74 | 68 65 20 63 68 69 6c 64 |..X(In t|he child|
|00002b20| 2c 20 60 60 2a 70 69 64 | 70 27 27 20 77 69 6c 6c |, ``*pid|p'' will|
|00002b30| 20 62 65 20 7a 65 72 6f | 2e 29 0d 58 2e 49 50 20 | be zero|.).X.IP |
|00002b40| 75 77 5f 63 6d 64 0d 58 | 54 68 69 73 20 72 6f 75 |uw_cmd.X|This rou|
|00002b50| 74 69 6e 65 20 62 75 69 | 6c 64 73 20 75 70 6f 6e |tine bui|lds upon|
|00002b60| 20 74 68 65 20 66 75 6e | 63 74 69 6f 6e 61 6c 69 | the fun|ctionali|
|00002b70| 74 79 20 6f 66 20 74 68 | 65 20 60 60 75 77 5f 66 |ty of th|e ``uw_f|
|00002b80| 6f 72 6b 27 27 20 72 6f | 75 74 69 6e 65 2e 0d 58 |ork'' ro|utine..X|
|00002b90| 49 74 20 63 72 65 61 74 | 65 73 20 61 20 6e 65 77 |It creat|es a new|
|00002ba0| 20 77 69 6e 64 6f 77 20 | 77 69 74 68 20 60 60 75 | window |with ``u|
|00002bb0| 77 5f 66 6f 72 6b 27 27 | 0d 58 61 6e 64 20 74 68 |w_fork''|.Xand th|
|00002bc0| 65 6e 20 65 78 65 63 75 | 74 65 73 20 61 20 73 70 |en execu|tes a sp|
|00002bd0| 65 63 69 66 69 65 64 20 | 63 6f 6d 6d 61 6e 64 2e |ecified |command.|
|00002be0| 0d 58 49 74 20 74 61 6b | 65 73 20 74 68 65 20 77 |.XIt tak|es the w|
|00002bf0| 69 6e 64 6f 77 20 74 79 | 70 65 2c 0d 58 74 68 65 |indow ty|pe,.Xthe|
|00002c00| 20 6e 61 6d 65 20 6f 66 | 20 61 6e 20 65 78 65 63 | name of| an exec|
|00002c10| 75 74 61 62 6c 65 20 66 | 69 6c 65 2c 0d 58 61 6e |utable f|ile,.Xan|
|00002c20| 64 20 61 6e 20 61 72 67 | 75 6d 65 6e 74 20 6c 69 |d an arg|ument li|
|00002c30| 73 74 0d 58 61 73 20 70 | 61 72 61 6d 65 74 65 72 |st.Xas p|arameter|
|00002c40| 73 3b 0d 58 69 74 20 75 | 73 65 73 20 74 68 65 73 |s;.Xit u|ses thes|
|00002c50| 65 20 61 73 20 61 72 67 | 75 6d 65 6e 74 73 20 74 |e as arg|uments t|
|00002c60| 6f 20 60 60 75 77 5f 66 | 6f 72 6b 27 27 0d 58 61 |o ``uw_f|ork''.Xa|
|00002c70| 6e 64 20 74 68 65 20 43 | 20 6c 69 62 72 61 72 79 |nd the C| library|
|00002c80| 20 72 6f 75 74 69 6e 65 | 20 60 60 65 78 65 63 76 | routine| ``execv|
|00002c90| 70 27 27 2e 0d 58 49 74 | 20 72 65 74 75 72 6e 73 |p''..XIt| returns|
|00002ca0| 20 74 68 65 20 77 69 6e | 64 6f 77 20 49 44 20 6e | the win|dow ID n|
|00002cb0| 75 6d 62 65 72 20 74 6f | 20 69 74 73 20 63 61 6c |umber to| its cal|
|00002cc0| 6c 65 72 3a 0d 58 2e 44 | 53 0d 58 75 77 69 64 5f |ler:.X.D|S.Xuwid_|
|00002cd0| 74 20 75 77 5f 63 6d 64 | 28 75 77 74 79 70 65 5f |t uw_cmd|(uwtype_|
|00002ce0| 74 20 77 74 79 70 65 2c | 20 63 68 61 72 20 2a 66 |t wtype,| char *f|
|00002cf0| 69 6c 65 2c 20 63 68 61 | 72 20 2a 2a 61 72 67 76 |ile, cha|r **argv|
|00002d00| 29 3b 0d 58 2e 44 45 0d | 58 28 5c 28 6d 69 31 20 |);.X.DE.|X(\(mi1 |
|00002d10| 69 73 20 72 65 74 75 72 | 6e 65 64 20 69 66 20 74 |is retur|ned if t|
|00002d20| 68 65 20 72 6f 75 74 69 | 6e 65 20 66 61 69 6c 73 |he routi|ne fails|
|00002d30| 2e 29 0d 58 2e 49 50 20 | 75 77 5f 73 68 65 6c 6c |.).X.IP |uw_shell|
|00002d40| 0d 58 60 60 75 77 5f 73 | 68 65 6c 6c 27 27 20 69 |.X``uw_s|hell'' i|
|00002d50| 73 20 73 69 6d 69 6c 61 | 72 20 74 6f 20 60 60 75 |s simila|r to ``u|
|00002d60| 77 5f 63 6d 64 27 27 20 | 65 78 63 65 70 74 20 74 |w_cmd'' |except t|
|00002d70| 68 61 74 20 69 74 0d 58 | 65 78 65 63 75 74 65 73 |hat it.X|executes|
|00002d80| 20 61 6e 20 61 72 62 69 | 74 72 61 72 79 20 73 68 | an arbi|trary sh|
|00002d90| 65 6c 6c 20 63 6f 6d 6d | 61 6e 64 3a 0d 58 2e 44 |ell comm|and:.X.D|
|00002da0| 53 0d 58 75 77 69 64 5f | 74 20 75 77 5f 73 68 65 |S.Xuwid_|t uw_she|
|00002db0| 6c 6c 28 75 77 74 79 70 | 65 5f 74 20 77 74 79 70 |ll(uwtyp|e_t wtyp|
|00002dc0| 65 2c 20 63 68 61 72 20 | 2a 63 6d 64 29 3b 0d 58 |e, char |*cmd);.X|
|00002dd0| 2e 44 45 0d 58 28 5c 28 | 6d 69 31 20 69 73 20 72 |.DE.X(\(|mi1 is r|
|00002de0| 65 74 75 72 6e 65 64 20 | 69 66 20 74 68 65 20 72 |eturned |if the r|
|00002df0| 6f 75 74 69 6e 65 20 66 | 61 69 6c 73 2e 29 0d 58 |outine f|ails.).X|
|00002e00| 42 79 20 64 65 66 61 75 | 6c 74 20 74 68 65 20 42 |By defau|lt the B|
|00002e10| 6f 75 72 6e 65 20 73 68 | 65 6c 6c 20 69 73 20 75 |ourne sh|ell is u|
|00002e20| 73 65 64 3b 0d 58 68 6f | 77 65 76 65 72 2c 0d 58 |sed;.Xho|wever,.X|
|00002e30| 74 68 65 20 73 68 65 6c | 6c 20 6d 61 79 20 62 65 |the shel|l may be|
|00002e40| 20 63 68 61 6e 67 65 64 | 20 62 79 20 70 61 74 63 | changed| by patc|
|00002e50| 68 69 6e 67 20 74 68 65 | 20 67 6c 6f 62 61 6c 20 |hing the| global |
|00002e60| 76 61 72 69 61 62 6c 65 | 20 60 60 75 77 73 68 65 |variable| ``uwshe|
|00002e70| 6c 6c 6e 61 6d 65 27 27 | 2e 0d 58 2e 44 53 0d 58 |llname''|..X.DS.X|
|00002e80| 63 68 61 72 20 2a 75 77 | 73 68 65 6c 6c 6e 61 6d |char *uw|shellnam|
|00002e90| 65 20 3d 20 22 2f 62 69 | 6e 2f 73 68 22 3b 0d 58 |e = "/bi|n/sh";.X|
|00002ea0| 2e 44 45 0d 58 2e 49 50 | 20 75 77 5f 72 73 65 74 |.DE.X.IP| uw_rset|
|00002eb0| 6f 70 74 0d 58 54 68 69 | 73 20 72 6f 75 74 69 6e |opt.XThi|s routin|
|00002ec0| 65 20 63 68 61 6e 67 65 | 73 20 74 68 65 20 76 61 |e change|s the va|
|00002ed0| 6c 75 65 20 6f 66 20 61 | 20 77 69 6e 64 6f 77 20 |lue of a| window |
|00002ee0| 6f 70 74 69 6f 6e 0d 58 | 66 6f 72 20 61 6e 20 65 |option.X|for an e|
|00002ef0| 78 69 73 74 69 6e 67 20 | 77 69 6e 64 6f 77 0d 58 |xisting |window.X|
|00002f00| 28 6e 61 6d 65 64 20 61 | 73 20 61 20 77 69 6e 64 |(named a|s a wind|
|00002f10| 6f 77 20 49 44 29 2e 0d | 58 54 68 65 20 77 69 6e |ow ID)..|XThe win|
|00002f20| 64 6f 77 20 6d 61 79 20 | 62 65 20 65 69 74 68 65 |dow may |be eithe|
|00002f30| 72 20 69 6e 74 65 72 6e | 61 6c 20 6f 72 20 65 78 |r intern|al or ex|
|00002f40| 74 65 72 6e 61 6c 2e 0d | 58 54 68 65 20 73 70 65 |ternal..|XThe spe|
|00002f50| 63 69 66 69 65 64 20 77 | 69 6e 64 6f 77 20 6f 70 |cified w|indow op|
|00002f60| 74 69 6f 6e 20 69 73 20 | 73 65 74 20 74 6f 20 61 |tion is |set to a|
|00002f70| 20 64 65 73 69 72 65 64 | 20 76 61 6c 75 65 2e 0d | desired| value..|
|00002f80| 58 5a 65 72 6f 20 69 73 | 20 72 65 74 75 72 6e 65 |XZero is| returne|
|00002f90| 64 20 69 66 20 74 68 65 | 20 61 70 70 72 6f 70 72 |d if the| appropr|
|00002fa0| 69 61 74 65 20 55 4e 49 | 58 2d 64 6f 6d 61 69 6e |iate UNI|X-domain|
|00002fb0| 20 6d 65 73 73 61 67 65 | 0d 58 77 61 73 20 73 75 | message|.Xwas su|
|00002fc0| 63 63 65 73 73 66 75 6c | 6c 79 20 73 65 6e 74 3b |ccessful|ly sent;|
|00002fd0| 0d 58 5c 28 6d 69 31 20 | 69 73 20 72 65 74 75 72 |.X\(mi1 |is retur|
|00002fe0| 6e 65 64 20 69 66 20 74 | 68 65 20 6f 70 65 72 61 |ned if t|he opera|
|00002ff0| 74 69 6f 6e 20 66 61 69 | 6c 65 64 2e 0d 58 28 53 |tion fai|led..X(S|
|00003000| 69 6e 63 65 20 60 60 75 | 77 5f 72 73 65 74 6f 70 |ince ``u|w_rsetop|
|00003010| 74 27 27 20 64 6f 65 73 | 20 6e 6f 74 20 72 65 63 |t'' does| not rec|
|00003020| 65 69 76 65 20 61 20 72 | 65 70 6c 79 20 66 72 6f |eive a r|eply fro|
|00003030| 6d 20 74 68 65 20 73 65 | 72 76 65 72 2c 0d 58 69 |m the se|rver,.Xi|
|00003040| 74 20 69 73 20 75 6e 61 | 62 6c 65 20 74 6f 20 64 |t is una|ble to d|
|00003050| 65 74 65 72 6d 69 6e 65 | 20 77 68 65 74 68 65 72 |etermine| whether|
|00003060| 20 6f 72 20 6e 6f 74 20 | 74 68 65 20 63 6f 6d 6d | or not |the comm|
|00003070| 61 6e 64 20 60 60 73 75 | 63 63 65 65 64 65 64 27 |and ``su|cceeded'|
|00003080| 27 2e 0d 58 52 61 74 68 | 65 72 2c 0d 58 69 74 20 |'..XRath|er,.Xit |
|00003090| 72 65 74 75 72 6e 73 20 | 7a 65 72 6f 20 69 66 20 |returns |zero if |
|000030a0| 74 68 65 20 63 6f 6d 6d | 61 6e 64 20 77 61 73 20 |the comm|and was |
|000030b0| 73 75 63 63 65 73 73 66 | 75 6c 6c 79 20 74 72 61 |successf|ully tra|
|000030c0| 6e 73 6d 69 74 74 65 64 | 2e 29 0d 58 2e 44 53 0d |nsmitted|.).X.DS.|
|000030d0| 58 69 6e 74 20 75 77 5f | 72 73 65 74 6f 70 74 28 |Xint uw_|rsetopt(|
|000030e0| 75 77 69 64 5f 74 20 75 | 77 69 64 2c 20 75 77 6f |uwid_t u|wid, uwo|
|000030f0| 70 74 5f 74 20 6f 70 74 | 6e 75 6d 2c 20 75 6e 69 |pt_t opt|num, uni|
|00003100| 6f 6e 20 75 77 6f 70 74 | 76 61 6c 20 2a 6f 70 74 |on uwopt|val *opt|
|00003110| 76 61 6c 29 3b 0d 58 2e | 44 45 0d 58 60 60 6f 70 |val);.X.|DE.X``op|
|00003120| 74 76 61 6c 27 27 20 70 | 6f 69 6e 74 73 20 74 6f |tval'' p|oints to|
|00003130| 20 61 20 60 60 75 6e 69 | 6f 6e 20 75 77 6f 70 74 | a ``uni|on uwopt|
|00003140| 76 61 6c 27 27 20 73 74 | 72 75 63 74 75 72 65 0d |val'' st|ructure.|
|00003150| 58 28 64 65 73 63 72 69 | 62 65 64 20 61 62 6f 76 |X(descri|bed abov|
|00003160| 65 29 0d 58 69 6e 20 77 | 68 69 63 68 20 74 68 65 |e).Xin w|hich the|
|00003170| 20 6d 65 6d 62 65 72 20 | 63 6f 72 72 65 73 70 6f | member |correspo|
|00003180| 6e 64 69 6e 67 20 74 6f | 20 60 60 6f 70 74 6e 75 |nding to| ``optnu|
|00003190| 6d 27 27 0d 58 68 61 73 | 20 62 65 65 6e 20 69 6e |m''.Xhas| been in|
|000031a0| 69 74 69 61 6c 69 7a 65 | 64 2e 0d 58 2e 49 50 20 |itialize|d..X.IP |
|000031b0| 22 75 77 5f 70 65 72 72 | 6f 72 22 0d 58 57 68 65 |"uw_perr|or".XWhe|
|000031c0| 6e 20 61 6e 20 65 72 72 | 6f 72 20 69 73 20 72 65 |n an err|or is re|
|000031d0| 70 6f 72 74 65 64 20 62 | 79 20 61 20 5c 2a 28 75 |ported b|y a \*(u|
|000031e0| 77 20 6c 69 62 72 61 72 | 79 20 72 6f 75 74 69 6e |w librar|y routin|
|000031f0| 65 2c 0d 58 74 68 65 20 | 63 61 75 73 65 20 6f 66 |e,.Xthe |cause of|
|00003200| 20 74 68 65 20 65 72 72 | 6f 72 20 69 73 20 73 61 | the err|or is sa|
|00003210| 76 65 64 20 69 6e 20 74 | 68 65 20 65 78 74 65 72 |ved in t|he exter|
|00003220| 6e 61 6c 20 76 61 72 69 | 61 62 6c 65 0d 58 60 60 |nal vari|able.X``|
|00003230| 75 77 65 72 72 6e 6f 27 | 27 2e 0d 58 49 66 20 74 |uwerrno'|'..XIf t|
|00003240| 68 65 20 65 72 72 6f 72 | 20 77 61 73 20 55 57 45 |he error| was UWE|
|00003250| 5f 45 52 52 4e 4f 2c 0d | 58 74 68 65 20 73 74 61 |_ERRNO,.|Xthe sta|
|00003260| 6e 64 61 72 64 20 65 78 | 74 65 72 6e 61 6c 20 76 |ndard ex|ternal v|
|00003270| 61 72 69 61 62 6c 65 20 | 60 60 65 72 72 6e 6f 27 |ariable |``errno'|
|00003280| 27 0d 58 77 69 6c 6c 20 | 61 6c 73 6f 20 62 65 20 |'.Xwill |also be |
|00003290| 6d 65 61 6e 69 6e 67 66 | 75 6c 2e 0d 58 28 54 68 |meaningf|ul..X(Th|
|000032a0| 65 20 72 6f 75 74 69 6e | 65 73 20 77 68 69 63 68 |e routin|es which|
|000032b0| 20 6f 70 65 72 61 74 65 | 20 75 70 6f 6e 20 65 78 | operate| upon ex|
|000032c0| 74 65 72 6e 61 6c 20 77 | 69 6e 64 6f 77 73 2c 0d |ternal w|indows,.|
|000032d0| 58 64 65 73 63 72 69 62 | 65 64 20 69 6e 20 74 68 |Xdescrib|ed in th|
|000032e0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 73 65 63 74 |e follow|ing sect|
|000032f0| 69 6f 6e 2c 0d 58 61 6c | 73 6f 20 73 61 76 65 20 |ion,.Xal|so save |
|00003300| 74 68 69 73 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |this inf|ormation|
|00003310| 20 69 6e 20 74 68 65 20 | 77 69 6e 64 6f 77 20 64 | in the |window d|
|00003320| 65 73 63 72 69 70 74 6f | 72 2e 29 0d 58 54 68 65 |escripto|r.).XThe|
|00003330| 20 72 6f 75 74 69 6e 65 | 20 60 60 75 77 5f 70 65 | routine| ``uw_pe|
|00003340| 72 72 6f 72 27 27 20 6d | 61 79 20 62 65 20 75 73 |rror'' m|ay be us|
|00003350| 65 64 20 74 6f 20 64 65 | 63 6f 64 65 20 61 6e 64 |ed to de|code and|
|00003360| 20 70 72 69 6e 74 0d 58 | 65 72 72 6f 72 20 6d 65 | print.X|error me|
|00003370| 73 73 61 67 65 73 3a 0d | 58 2e 44 53 0d 58 76 6f |ssages:.|X.DS.Xvo|
|00003380| 69 64 20 75 77 5f 70 65 | 72 72 6f 72 28 63 68 61 |id uw_pe|rror(cha|
|00003390| 72 20 2a 75 73 65 72 6d | 65 73 67 2c 20 75 77 65 |r *userm|esg, uwe|
|000033a0| 72 72 5f 74 20 75 77 65 | 72 72 2c 20 69 6e 74 20 |rr_t uwe|rr, int |
|000033b0| 65 72 72 29 0d 58 2e 44 | 45 0d 58 77 68 65 72 65 |err).X.D|E.Xwhere|
|000033c0| 20 60 60 75 73 65 72 6d | 65 73 67 27 27 20 69 73 | ``userm|esg'' is|
|000033d0| 20 61 20 70 6f 69 6e 74 | 65 72 20 74 6f 20 61 20 | a point|er to a |
|000033e0| 75 73 65 72 2d 73 70 65 | 63 69 66 69 65 64 20 73 |user-spe|cified s|
|000033f0| 74 72 69 6e 67 2c 0d 58 | 60 60 75 77 65 72 72 27 |tring,.X|``uwerr'|
|00003400| 27 20 69 73 20 74 68 65 | 20 5c 2a 28 75 77 20 65 |' is the| \*(uw e|
|00003410| 72 72 6f 72 20 63 6f 64 | 65 0d 58 28 75 73 75 61 |rror cod|e.X(usua|
|00003420| 6c 6c 79 20 60 60 75 77 | 65 72 72 6e 6f 27 27 29 |lly ``uw|errno'')|
|00003430| 2c 0d 58 61 6e 64 20 60 | 60 65 72 72 27 27 20 69 |,.Xand `|`err'' i|
|00003440| 73 20 74 68 65 20 73 79 | 73 74 65 6d 20 63 61 6c |s the sy|stem cal|
|00003450| 6c 20 65 72 72 6f 72 20 | 63 6f 64 65 0d 58 28 75 |l error |code.X(u|
|00003460| 73 75 61 6c 6c 79 20 60 | 60 65 72 72 6e 6f 27 27 |sually `|`errno''|
|00003470| 29 2e 0d 58 5b 53 79 73 | 74 65 6d 20 63 61 6c 6c |)..X[Sys|tem call|
|00003480| 20 65 72 72 6f 72 20 6e | 75 6d 62 65 72 73 20 61 | error n|umbers a|
|00003490| 72 65 20 64 65 66 69 6e | 65 64 20 69 6e 20 60 60 |re defin|ed in ``|
|000034a0| 2f 75 73 72 2f 69 6e 63 | 6c 75 64 65 2f 65 72 72 |/usr/inc|lude/err|
|000034b0| 6e 6f 2e 68 27 27 2e 5d | 0d 58 2e 73 70 0d 58 54 |no.h''.]|.X.sp.XT|
|000034c0| 68 65 20 5c 2a 28 75 77 | 20 65 72 72 6f 72 20 6d |he \*(uw| error m|
|000034d0| 65 73 73 61 67 65 73 20 | 6d 61 79 20 61 6c 73 6f |essages |may also|
|000034e0| 20 62 65 20 61 63 63 65 | 73 73 65 64 20 64 69 72 | be acce|ssed dir|
|000034f0| 65 63 74 6c 79 2e 0d 58 | 54 77 6f 20 65 78 74 65 |ectly..X|Two exte|
|00003500| 72 6e 61 6c 20 76 61 72 | 69 61 62 6c 65 73 20 61 |rnal var|iables a|
|00003510| 69 64 20 69 6e 20 75 73 | 65 72 2d 66 6f 72 6d 61 |id in us|er-forma|
|00003520| 74 74 65 64 20 65 72 72 | 6f 72 20 6d 65 73 73 61 |tted err|or messa|
|00003530| 67 65 73 3a 0d 58 2e 44 | 53 0d 58 65 78 74 65 72 |ges:.X.D|S.Xexter|
|00003540| 6e 20 63 68 61 72 20 2a | 75 77 65 72 72 6c 69 73 |n char *|uwerrlis|
|00003550| 74 5b 5d 3b 0d 58 65 78 | 74 65 72 6e 20 75 6e 73 |t[];.Xex|tern uns|
|00003560| 69 67 6e 65 64 20 75 77 | 6e 65 72 72 3b 0d 58 2e |igned uw|nerr;.X.|
|00003570| 44 45 0d 58 49 66 20 74 | 68 65 20 65 72 72 6f 72 |DE.XIf t|he error|
|00003580| 20 6e 75 6d 62 65 72 20 | 69 73 20 67 72 65 61 74 | number |is great|
|00003590| 65 72 20 74 68 61 6e 20 | 6f 72 20 65 71 75 61 6c |er than |or equal|
|000035a0| 20 74 6f 20 60 60 75 77 | 6e 65 72 72 27 27 2c 0d | to ``uw|nerr'',.|
|000035b0| 58 6e 6f 20 65 72 72 6f | 72 20 6d 65 73 73 61 67 |Xno erro|r messag|
|000035c0| 65 20 73 74 72 69 6e 67 | 20 65 78 69 73 74 73 2e |e string| exists.|
|000035d0| 0d 58 28 54 68 69 73 20 | 60 60 63 61 6e 6e 6f 74 |.X(This |``cannot|
|000035e0| 20 68 61 70 70 65 6e 2e | 27 27 29 0d 58 4f 74 68 | happen.|'').XOth|
|000035f0| 65 72 77 69 73 65 2c 0d | 58 74 68 65 20 65 72 72 |erwise,.|Xthe err|
|00003600| 6f 72 20 6d 65 73 73 61 | 67 65 20 73 74 72 69 6e |or messa|ge strin|
|00003610| 67 20 69 73 20 6f 62 74 | 61 69 6e 65 64 20 62 79 |g is obt|ained by|
|00003620| 20 69 6e 64 65 78 69 6e | 67 20 69 6e 74 6f 0d 58 | indexin|g into.X|
|00003630| 60 60 75 77 65 72 72 6c | 69 73 74 27 27 2e 0d 58 |``uwerrl|ist''..X|
|00003640| 2e 50 50 0d 58 54 68 65 | 20 70 72 65 63 65 65 64 |.PP.XThe| preceed|
|00003650| 69 6e 67 20 72 6f 75 74 | 69 6e 65 73 20 61 72 65 |ing rout|ines are|
|00003660| 20 73 75 66 66 69 63 69 | 65 6e 74 20 74 6f 20 69 | suffici|ent to i|
|00003670| 6d 70 6c 65 6d 65 6e 74 | 0d 58 61 20 28 73 69 6d |mplement|.Xa (sim|
|00003680| 70 6c 69 66 69 65 64 29 | 20 76 65 72 73 69 6f 6e |plified)| version|
|00003690| 20 6f 66 20 74 68 65 20 | 60 60 75 77 74 6f 6f 6c | of the |``uwtool|
|000036a0| 27 27 20 70 72 6f 67 72 | 61 6d 2c 0d 58 77 68 69 |'' progr|am,.Xwhi|
|000036b0| 63 68 20 63 72 65 61 74 | 65 73 20 61 20 6e 65 77 |ch creat|es a new|
|000036c0| 0d 58 28 69 6e 74 65 72 | 6e 61 6c 29 0d 58 77 69 |.X(inter|nal).Xwi|
|000036d0| 6e 64 6f 77 20 72 75 6e | 6e 69 6e 67 20 61 20 73 |ndow run|ning a s|
|000036e0| 70 65 63 69 66 69 65 64 | 20 63 6f 6d 6d 61 6e 64 |pecified| command|
|000036f0| 3a 0d 58 2e 44 53 0d 58 | 2e 74 61 20 38 6e 20 31 |:.X.DS.X|.ta 8n 1|
|00003700| 36 6e 20 32 34 6e 20 33 | 32 6e 20 34 30 6e 20 34 |6n 24n 3|2n 40n 4|
|00003710| 38 6e 20 35 36 6e 20 36 | 34 6e 20 37 32 6e 0d 58 |8n 56n 6|4n 72n.X|
|00003720| 2f 2a 0d 58 20 2a 20 20 | 20 20 20 20 75 77 74 6f |/*.X * | uwto|
|00003730| 6f 6c 0d 58 20 2a 0d 58 | 20 2a 20 43 6f 70 79 72 |ol.X *.X| * Copyr|
|00003740| 69 67 68 74 20 31 39 38 | 36 20 62 79 20 4a 6f 68 |ight 198|6 by Joh|
|00003750| 6e 20 44 2e 20 42 72 75 | 6e 65 72 2e 20 20 41 6c |n D. Bru|ner. Al|
|00003760| 6c 20 72 69 67 68 74 73 | 20 72 65 73 65 72 76 65 |l rights| reserve|
|00003770| 64 2e 20 20 50 65 72 6d | 69 73 73 69 6f 6e 20 74 |d. Perm|ission t|
|00003780| 6f 0d 58 20 2a 20 63 6f | 70 79 20 74 68 69 73 20 |o.X * co|py this |
|00003790| 70 72 6f 67 72 61 6d 20 | 69 73 20 67 69 76 65 6e |program |is given|
|000037a0| 20 70 72 6f 76 69 64 65 | 64 20 74 68 61 74 20 74 | provide|d that t|
|000037b0| 68 65 20 63 6f 70 79 20 | 69 73 20 6e 6f 74 20 73 |he copy |is not s|
|000037c0| 6f 6c 64 20 61 6e 64 20 | 74 68 61 74 0d 58 20 2a |old and |that.X *|
|000037d0| 20 74 68 69 73 20 63 6f | 70 79 72 69 67 68 74 20 | this co|pyright |
|000037e0| 6e 6f 74 69 63 65 20 69 | 73 20 69 6e 63 6c 75 64 |notice i|s includ|
|000037f0| 65 64 2e 0d 58 20 2a 2f | 0d 58 23 69 6e 63 6c 75 |ed..X */|.X#inclu|
|00003800| 64 65 20 3c 73 74 72 69 | 6e 67 73 2e 68 3e 0d 58 |de <stri|ngs.h>.X|
|00003810| 23 69 6e 63 6c 75 64 65 | 20 22 75 77 6c 69 62 2e |#include| "uwlib.|
|00003820| 68 22 0d 58 0d 58 6d 61 | 69 6e 28 61 72 67 63 2c |h".X.Xma|in(argc,|
|00003830| 20 61 72 67 76 29 0d 58 | 69 6e 74 20 61 72 67 63 | argv).X|int argc|
|00003840| 3b 0d 58 63 68 61 72 20 | 2a 2a 61 72 67 76 3b 0d |;.Xchar |**argv;.|
|00003850| 58 7b 0d 58 20 20 20 20 | 20 20 20 20 72 65 67 69 |X{.X | regi|
|00003860| 73 74 65 72 20 75 77 69 | 64 5f 74 20 75 77 69 64 |ster uwi|d_t uwid|
|00003870| 3b 0d 58 20 20 20 20 20 | 20 20 20 72 65 67 69 73 |;.X | regis|
|00003880| 74 65 72 20 63 68 61 72 | 20 2a 66 6e 61 6d 65 2c |ter char| *fname,|
|00003890| 20 2a 74 65 72 6d 3b 0d | 58 09 72 65 67 69 73 74 | *term;.|X.regist|
|000038a0| 65 72 20 77 74 79 70 65 | 5f 74 20 77 74 79 70 65 |er wtype|_t wtype|
|000038b0| 3b 0d 58 20 20 20 20 20 | 20 20 20 63 68 61 72 20 |;.X | char |
|000038c0| 2a 61 76 5b 32 5d 3b 0d | 58 20 20 20 20 20 20 20 |*av[2];.|X |
|000038d0| 20 75 6e 69 6f 6e 20 75 | 77 6f 70 74 76 61 6c 20 | union u|woptval |
|000038e0| 6f 70 74 76 61 6c 3b 0d | 58 20 20 20 20 20 20 20 |optval;.|X |
|000038f0| 20 65 78 74 65 72 6e 20 | 69 6e 74 20 65 72 72 6e | extern |int errn|
|00003900| 6f 3b 0d 58 20 20 20 20 | 20 20 20 20 65 78 74 65 |o;.X | exte|
|00003910| 72 6e 20 63 68 61 72 20 | 2a 67 65 74 65 6e 76 28 |rn char |*getenv(|
|00003920| 29 3b 0d 58 0d 58 20 20 | 20 20 20 20 20 20 2f 2a |);.X.X | /*|
|00003930| 0d 58 20 20 20 20 20 20 | 20 20 20 2a 20 49 66 20 |.X | * If |
|00003940| 63 61 6c 6c 65 64 20 77 | 69 74 68 20 6e 6f 20 61 |called w|ith no a|
|00003950| 72 67 75 6d 65 6e 74 73 | 2c 20 63 72 65 61 74 65 |rguments|, create|
|00003960| 20 61 20 6e 65 77 20 77 | 69 6e 64 6f 77 20 75 73 | a new w|indow us|
|00003970| 69 6e 67 20 74 68 65 0d | 58 20 20 20 20 20 20 20 |ing the.|X |
|00003980| 20 20 2a 20 63 75 72 72 | 65 6e 74 20 73 68 65 6c | * curr|ent shel|
|00003990| 6c 20 61 63 63 6f 72 64 | 69 6e 67 20 74 6f 20 74 |l accord|ing to t|
|000039a0| 68 65 20 53 48 45 4c 4c | 20 65 6e 76 69 72 6f 6e |he SHELL| environ|
|000039b0| 6d 65 6e 74 20 76 61 72 | 69 61 62 6c 65 0d 58 20 |ment var|iable.X |
|000039c0| 20 20 20 20 20 20 20 20 | 2a 20 28 6f 72 20 22 2f | |* (or "/|
|000039d0| 62 69 6e 2f 73 68 22 20 | 69 66 20 74 68 61 74 20 |bin/sh" |if that |
|000039e0| 64 6f 65 73 6e 27 74 20 | 65 78 69 73 74 29 2e 20 |doesn't |exist). |
|000039f0| 20 49 66 20 63 61 6c 6c | 65 64 20 77 69 74 68 0d | If call|ed with.|
|00003a00| 58 20 20 20 20 20 20 20 | 20 20 2a 20 61 72 67 75 |X | * argu|
|00003a10| 6d 65 6e 74 73 2c 20 61 | 72 67 76 5b 31 5d 20 74 |ments, a|rgv[1] t|
|00003a20| 68 72 6f 75 67 68 20 61 | 72 67 76 5b 61 72 67 63 |hrough a|rgv[argc|
|00003a30| 5c 2d 31 5d 20 61 72 65 | 20 74 68 65 20 61 72 67 |\-1] are| the arg|
|00003a40| 75 6d 65 6e 74 73 0d 58 | 20 20 20 20 20 20 20 20 |uments.X| |
|00003a50| 20 2a 20 74 6f 20 74 68 | 65 20 63 6f 6d 6d 61 6e | * to th|e comman|
|00003a60| 64 2e 0d 58 20 20 20 20 | 20 20 20 20 20 2a 2f 0d |d..X | */.|
|00003a70| 58 20 20 20 20 20 20 20 | 20 69 66 20 28 61 72 67 |X | if (arg|
|00003a80| 63 20 3d 3d 20 31 29 20 | 7b 0d 58 20 20 20 20 20 |c == 1) |{.X |
|00003a90| 20 20 20 20 20 20 20 20 | 20 20 20 69 66 20 28 28 | | if ((|
|00003aa0| 66 6e 61 6d 65 20 3d 20 | 67 65 74 65 6e 76 28 22 |fname = |getenv("|
|00003ab0| 53 48 45 4c 4c 22 29 29 | 20 3d 3d 20 28 63 68 61 |SHELL"))| == (cha|
|00003ac0| 72 20 2a 29 30 29 0d 58 | 20 20 20 20 20 20 20 20 |r *)0).X| |
|00003ad0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003ae0| 66 6e 61 6d 65 20 3d 20 | 22 2f 62 69 6e 2f 73 68 |fname = |"/bin/sh|
|00003af0| 22 3b 0d 58 20 20 20 20 | 20 20 20 20 20 20 20 20 |";.X | |
|00003b00| 20 20 20 20 61 76 5b 30 | 5d 20 3d 20 66 6e 61 6d | av[0|] = fnam|
|00003b10| 65 3b 0d 58 20 20 20 20 | 20 20 20 20 20 20 20 20 |e;.X | |
|00003b20| 20 20 20 20 61 76 5b 31 | 5d 20 3d 20 28 63 68 61 | av[1|] = (cha|
|00003b30| 72 20 2a 29 30 3b 0d 58 | 20 20 20 20 20 20 20 20 |r *)0;.X| |
|00003b40| 20 20 20 20 20 20 20 20 | 61 72 67 76 20 3d 20 61 | |argv = a|
|00003b50| 76 3b 0d 58 20 20 20 20 | 20 20 20 20 7d 20 65 6c |v;.X | } el|
|00003b60| 73 65 0d 58 20 20 20 20 | 20 20 20 20 20 20 20 20 |se.X | |
|00003b70| 20 20 20 20 66 6e 61 6d | 65 20 3d 20 2a 2b 2b 61 | fnam|e = *++a|
|00003b80| 72 67 76 3b 0d 58 09 0d | 58 09 69 66 20 28 28 74 |rgv;.X..|X.if ((t|
|00003b90| 65 72 6d 3d 67 65 74 65 | 6e 76 28 22 54 45 52 4d |erm=gete|nv("TERM|
|00003ba0| 22 29 29 20 21 3d 20 28 | 63 68 61 72 20 2a 29 30 |")) != (|char *)0|
|00003bb0| 29 0d 58 09 09 77 74 79 | 70 65 20 3d 20 75 77 5f |).X..wty|pe = uw_|
|00003bc0| 74 74 79 70 65 28 74 65 | 72 6d 29 3b 0d 58 09 65 |ttype(te|rm);.X.e|
|00003bd0| 6c 73 65 0d 58 09 09 77 | 74 79 70 65 20 3d 20 55 |lse.X..w|type = U|
|00003be0| 57 54 5f 41 44 4d 33 31 | 3b 0d 58 20 20 20 20 20 |WT_ADM31|;.X |
|00003bf0| 20 20 20 0d 58 20 20 20 | 20 20 20 20 20 69 66 20 | .X | if |
|00003c00| 28 28 75 77 69 64 20 3d | 20 75 77 5f 63 6d 64 28 |((uwid =| uw_cmd(|
|00003c10| 77 74 79 70 65 2c 20 66 | 6e 61 6d 65 2c 20 61 72 |wtype, f|name, ar|
|00003c20| 67 76 29 29 20 3c 20 30 | 29 20 7b 0d 58 20 20 20 |gv)) < 0|) {.X |
|00003c30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 28 76 6f | | (vo|
|00003c40| 69 64 29 73 74 72 6e 63 | 70 79 28 6f 70 74 76 61 |id)strnc|py(optva|
|00003c50| 6c 2e 75 77 6f 76 5f 73 | 74 72 69 6e 67 2c 20 66 |l.uwov_s|tring, f|
|00003c60| 6e 61 6d 65 2c 0d 58 20 | 20 20 20 20 20 20 20 20 |name,.X | |
|00003c70| 20 20 20 20 20 20 20 20 | 20 20 20 73 69 7a 65 6f | | sizeo|
|00003c80| 66 20 6f 70 74 76 61 6c | 2e 75 77 6f 76 5f 73 74 |f optval|.uwov_st|
|00003c90| 72 69 6e 67 29 3b 0d 58 | 20 20 20 20 20 20 20 20 |ring);.X| |
|00003ca0| 20 20 20 20 20 20 20 20 | 28 76 6f 69 64 29 75 77 | |(void)uw|
|00003cb0| 5f 72 73 65 74 6f 70 74 | 28 75 77 69 64 2c 20 55 |_rsetopt|(uwid, U|
|00003cc0| 57 4f 50 5f 54 49 54 4c | 45 2c 20 26 6f 70 74 76 |WOP_TITL|E, &optv|
|00003cd0| 61 6c 29 3b 0d 58 20 20 | 20 20 20 20 20 20 20 20 |al);.X | |
|00003ce0| 20 20 20 20 20 20 72 65 | 74 75 72 6e 28 30 29 3b | re|turn(0);|
|00003cf0| 0d 58 20 20 20 20 20 20 | 20 20 7d 20 65 6c 73 65 |.X | } else|
|00003d00| 20 7b 0d 58 20 20 20 20 | 20 20 20 20 20 20 20 20 | {.X | |
|00003d10| 20 20 20 20 75 77 5f 70 | 65 72 72 6f 72 28 22 75 | uw_p|error("u|
|00003d20| 77 74 6f 6f 6c 22 2c 20 | 75 77 65 72 72 6e 6f 2c |wtool", |uwerrno,|
|00003d30| 20 65 72 72 6e 6f 29 3b | 0d 58 20 20 20 20 20 20 | errno);|.X |
|00003d40| 20 20 20 20 20 20 20 20 | 20 20 72 65 74 75 72 6e | | return|
|00003d50| 28 31 29 3b 0d 58 20 20 | 20 20 20 20 20 20 7d 0d |(1);.X | }.|
|00003d60| 58 7d 0d 58 2e 44 45 0d | 58 41 66 74 65 72 20 74 |X}.X.DE.|XAfter t|
|00003d70| 68 65 20 66 69 72 73 74 | 20 70 61 72 74 20 6f 66 |he first| part of|
|00003d80| 20 74 68 65 20 66 75 6e | 63 74 69 6f 6e 20 68 61 | the fun|ction ha|
|00003d90| 73 20 6d 61 73 73 61 67 | 65 64 20 74 68 65 20 61 |s massag|ed the a|
|00003da0| 72 67 75 6d 65 6e 74 20 | 6c 69 73 74 2c 0d 58 74 |rgument |list,.Xt|
|00003db0| 68 65 20 60 60 75 77 5f | 63 6d 64 27 27 20 72 6f |he ``uw_|cmd'' ro|
|00003dc0| 75 74 69 6e 65 20 63 72 | 65 61 74 65 73 20 61 20 |utine cr|eates a |
|00003dd0| 6e 65 77 20 77 69 6e 64 | 6f 77 0d 58 72 75 6e 6e |new wind|ow.Xrunn|
|00003de0| 69 6e 67 20 74 68 65 20 | 63 6f 6d 6d 61 6e 64 20 |ing the |command |
|00003df0| 60 60 66 6e 61 6d 65 27 | 27 20 77 69 74 68 20 61 |``fname'|' with a|
|00003e00| 72 67 75 6d 65 6e 74 20 | 6c 69 73 74 20 60 60 61 |rgument |list ``a|
|00003e10| 72 67 76 27 27 2e 0d 58 | 49 66 20 74 68 65 20 77 |rgv''..X|If the w|
|00003e20| 69 6e 64 6f 77 20 49 44 | 20 69 73 20 70 6f 73 69 |indow ID| is posi|
|00003e30| 74 69 76 65 2c 0d 58 74 | 68 65 20 77 69 6e 64 6f |tive,.Xt|he windo|
|00003e40| 77 20 63 72 65 61 74 69 | 6f 6e 20 73 75 63 63 65 |w creati|on succe|
|00003e50| 65 64 65 64 2e 0d 58 41 | 66 74 65 72 20 63 6f 70 |eded..XA|fter cop|
|00003e60| 79 69 6e 67 20 74 68 65 | 20 6e 61 6d 65 20 6f 66 |ying the| name of|
|00003e70| 20 74 68 65 20 70 72 6f | 67 72 61 6d 20 69 6e 74 | the pro|gram int|
|00003e80| 6f 20 61 20 60 60 75 6e | 69 6f 6e 20 75 77 6f 70 |o a ``un|ion uwop|
|00003e90| 74 76 61 6c 27 27 2c 0d | 58 74 68 65 20 70 72 6f |tval'',.|Xthe pro|
|00003ea0| 67 72 61 6d 20 63 61 6c | 6c 73 20 60 60 75 77 5f |gram cal|ls ``uw_|
|00003eb0| 72 73 65 74 6f 70 74 27 | 27 20 74 6f 20 73 65 74 |rsetopt'|' to set|
|00003ec0| 20 74 68 65 20 77 69 6e | 64 6f 77 20 74 69 74 6c | the win|dow titl|
|00003ed0| 65 0d 58 74 6f 20 74 68 | 61 74 20 73 74 72 69 6e |e.Xto th|at strin|
|00003ee0| 67 2e 0d 58 49 66 20 74 | 68 65 20 77 69 6e 64 6f |g..XIf t|he windo|
|00003ef0| 77 20 49 44 20 72 65 74 | 75 72 6e 65 64 20 62 79 |w ID ret|urned by|
|00003f00| 20 60 60 75 77 5f 63 6d | 64 27 27 20 77 61 73 20 | ``uw_cm|d'' was |
|00003f10| 5c 28 6d 69 31 2c 0d 58 | 74 68 65 20 77 69 6e 64 |\(mi1,.X|the wind|
|00003f20| 6f 77 20 63 72 65 61 74 | 69 6f 6e 20 66 61 69 6c |ow creat|ion fail|
|00003f30| 65 64 2e 0d 58 49 6e 20 | 74 68 69 73 20 63 61 73 |ed..XIn |this cas|
|00003f40| 65 2c 0d 58 74 68 65 20 | 70 72 6f 67 72 61 6d 20 |e,.Xthe |program |
|00003f50| 63 61 6c 6c 73 20 60 60 | 75 77 5f 70 65 72 72 6f |calls ``|uw_perro|
|00003f60| 72 27 27 20 74 6f 20 72 | 65 70 6f 72 74 20 74 68 |r'' to r|eport th|
|00003f70| 65 20 65 72 72 6f 72 2e | 0d 58 2e 53 48 0d 58 45 |e error.|.X.SH.XE|
|00003f80| 78 74 65 72 6e 61 6c 20 | 57 69 6e 64 6f 77 20 49 |xternal |Window I|
|00003f90| 6e 74 65 72 66 61 63 65 | 0d 58 2e 4c 50 0d 58 54 |nterface|.X.LP.XT|
|00003fa0| 68 65 20 72 65 6d 61 69 | 6e 64 65 72 20 6f 66 20 |he remai|nder of |
|00003fb0| 74 68 65 20 5c 2a 28 75 | 77 20 6c 69 62 72 61 72 |the \*(u|w librar|
|00003fc0| 79 20 72 6f 75 74 69 6e | 65 73 20 70 72 6f 76 69 |y routin|es provi|
|00003fd0| 64 65 20 61 63 63 65 73 | 73 20 74 6f 0d 58 65 78 |de acces|s to.Xex|
|00003fe0| 74 65 72 6e 61 6c 20 77 | 69 6e 64 6f 77 73 2e 0d |ternal w|indows..|
|00003ff0| 58 49 6e 20 63 6f 6e 74 | 72 61 73 74 20 74 6f 20 |XIn cont|rast to |
|00004000| 69 6e 74 65 72 6e 61 6c | 20 77 69 6e 64 6f 77 73 |internal| windows|
|00004010| 2c 0d 58 61 20 63 6c 69 | 65 6e 74 20 70 72 6f 63 |,.Xa cli|ent proc|
|00004020| 65 73 73 20 63 72 65 61 | 74 65 73 20 61 6e 20 65 |ess crea|tes an e|
|00004030| 78 74 65 72 6e 61 6c 20 | 77 69 6e 64 6f 77 0d 58 |xternal |window.X|
|00004040| 62 79 20 65 73 74 61 62 | 6c 69 73 68 69 6e 67 20 |by estab|lishing |
|00004050| 61 6e 20 49 6e 74 65 72 | 6e 65 74 2d 64 6f 6d 61 |an Inter|net-doma|
|00004060| 69 6e 20 73 74 72 65 61 | 6d 20 63 6f 6e 6e 65 63 |in strea|m connec|
|00004070| 74 69 6f 6e 0d 58 74 6f | 20 74 68 65 20 73 65 72 |tion.Xto| the ser|
|00004080| 76 65 72 20 61 6e 64 20 | 73 65 6e 64 69 6e 67 20 |ver and |sending |
|00004090| 74 68 65 20 73 65 72 76 | 65 72 20 61 20 60 60 63 |the serv|er a ``c|
|000040a0| 72 65 61 74 65 20 77 69 | 6e 64 6f 77 27 27 20 63 |reate wi|ndow'' c|
|000040b0| 6f 6d 6d 61 6e 64 2e 0d | 58 54 68 65 20 73 65 72 |ommand..|XThe ser|
|000040c0| 76 65 72 20 77 69 6c 6c | 20 65 73 74 61 62 6c 69 |ver will| establi|
|000040d0| 73 68 20 61 20 73 65 63 | 6f 6e 64 20 73 74 72 65 |sh a sec|ond stre|
|000040e0| 61 6d 20 63 6f 6e 6e 65 | 63 74 69 6f 6e 0d 58 62 |am conne|ction.Xb|
|000040f0| 61 63 6b 20 74 6f 20 74 | 68 65 20 63 6c 69 65 6e |ack to t|he clien|
|00004100| 74 2e 0d 58 44 61 74 61 | 20 69 73 20 70 61 73 73 |t..XData| is pass|
|00004110| 65 64 20 62 65 74 77 65 | 65 6e 20 74 68 65 20 63 |ed betwe|en the c|
|00004120| 6c 69 65 6e 74 20 61 6e | 64 20 74 68 65 20 73 65 |lient an|d the se|
|00004130| 72 76 65 72 20 6f 6e 20 | 74 68 65 20 66 69 72 73 |rver on |the firs|
|00004140| 74 20 63 6f 6e 6e 65 63 | 74 69 6f 6e 2c 0d 58 77 |t connec|tion,.Xw|
|00004150| 68 69 6c 65 20 63 6f 6e | 74 72 6f 6c 20 69 6e 66 |hile con|trol inf|
|00004160| 6f 72 6d 61 74 69 6f 6e | 20 69 73 20 70 61 73 73 |ormation| is pass|
|00004170| 65 64 20 74 68 72 6f 75 | 67 68 20 74 68 65 20 73 |ed throu|gh the s|
|00004180| 65 63 6f 6e 64 2e 0d 58 | 5b 42 65 63 61 75 73 65 |econd..X|[Because|
|00004190| 20 74 68 65 20 73 65 72 | 76 65 72 20 61 6e 64 20 | the ser|ver and |
|000041a0| 63 6c 69 65 6e 74 20 63 | 6f 6d 6d 75 6e 69 63 61 |client c|ommunica|
|000041b0| 74 65 20 74 68 72 6f 75 | 67 68 20 6f 6e 65 20 6f |te throu|gh one o|
|000041c0| 72 0d 58 74 77 6f 20 73 | 74 72 65 61 6d 20 63 6f |r.Xtwo s|tream co|
|000041d0| 6e 6e 65 63 74 69 6f 6e | 28 73 29 0d 58 69 6e 73 |nnection|(s).Xins|
|000041e0| 74 65 61 64 20 6f 66 20 | 62 79 20 73 65 6e 64 69 |tead of |by sendi|
|000041f0| 6e 67 20 64 61 74 61 67 | 72 61 6d 73 2c 0d 58 74 |ng datag|rams,.Xt|
|00004200| 68 65 20 75 6e 72 65 6c | 69 61 62 69 6c 69 74 79 |he unrel|iability|
|00004210| 20 70 72 6f 62 6c 65 6d | 73 20 6e 6f 74 65 64 20 | problem|s noted |
|00004220| 61 62 6f 76 65 20 66 6f | 72 20 69 6e 74 65 72 6e |above fo|r intern|
|00004230| 61 6c 20 77 69 6e 64 6f | 77 73 0d 58 64 6f 20 6e |al windo|ws.Xdo n|
|00004240| 6f 74 20 61 70 70 6c 79 | 20 74 6f 20 65 78 74 65 |ot apply| to exte|
|00004250| 72 6e 61 6c 20 77 69 6e | 64 6f 77 73 2e 5d 0d 58 |rnal win|dows.].X|
|00004260| 2e 4c 50 0d 58 54 68 65 | 20 5c 2a 28 75 77 20 6c |.LP.XThe| \*(uw l|
|00004270| 69 62 72 61 72 79 20 70 | 72 6f 76 69 64 65 73 20 |ibrary p|rovides |
|00004280| 6d 65 63 68 61 6e 69 73 | 6d 73 20 66 6f 72 20 63 |mechanis|ms for c|
|00004290| 72 65 61 74 69 6e 67 20 | 65 78 74 65 72 6e 61 6c |reating |external|
|000042a0| 20 77 69 6e 64 6f 77 73 | 2c 0d 58 6b 69 6c 6c 69 | windows|,.Xkilli|
|000042b0| 6e 67 20 74 68 65 6d 2c | 0d 58 61 6e 64 20 6d 61 |ng them,|.Xand ma|
|000042c0| 6e 69 70 75 6c 61 74 69 | 6e 67 20 77 69 6e 64 6f |nipulati|ng windo|
|000042d0| 77 20 6f 70 74 69 6f 6e | 73 2e 0d 58 57 68 65 6e |w option|s..XWhen|
|000042e0| 20 61 20 77 69 6e 64 6f | 77 20 69 73 20 63 72 65 | a windo|w is cre|
|000042f0| 61 74 65 64 20 61 20 77 | 69 6e 64 6f 77 20 64 65 |ated a w|indow de|
|00004300| 73 63 72 69 70 74 6f 72 | 0d 58 28 69 74 65 6d 20 |scriptor|.X(item |
|00004310| 6f 66 20 74 79 70 65 20 | 55 57 49 4e 29 0d 58 69 |of type |UWIN).Xi|
|00004320| 73 20 72 65 74 75 72 6e | 65 64 3b 0d 58 74 68 69 |s return|ed;.Xthi|
|00004330| 73 20 69 73 20 75 73 65 | 64 20 61 73 20 61 6e 20 |s is use|d as an |
|00004340| 61 72 67 75 6d 65 6e 74 | 20 74 6f 20 61 6c 6c 20 |argument| to all |
|00004350| 6f 74 68 65 72 20 65 78 | 74 65 72 6e 61 6c 2d 77 |other ex|ternal-w|
|00004360| 69 6e 64 6f 77 20 72 6f | 75 74 69 6e 65 73 2e 0d |indow ro|utines..|
|00004370| 58 2e 4c 50 0d 58 54 68 | 65 20 66 6f 6c 6c 6f 77 |X.LP.XTh|e follow|
|00004380| 69 6e 67 20 72 6f 75 74 | 69 6e 65 73 20 61 72 65 |ing rout|ines are|
|00004390| 20 70 72 6f 76 69 64 65 | 64 3a 0d 58 2e 49 50 20 | provide|d:.X.IP |
|000043a0| 22 75 77 5f 6e 65 77 22 | 20 31 69 0d 58 54 68 69 |"uw_new"| 1i.XThi|
|000043b0| 73 20 66 75 6e 63 74 69 | 6f 6e 20 63 72 65 61 74 |s functi|on creat|
|000043c0| 65 73 20 61 20 6e 65 77 | 20 65 78 74 65 72 6e 61 |es a new| externa|
|000043d0| 6c 20 77 69 6e 64 6f 77 | 20 6f 66 20 74 68 65 20 |l window| of the |
|000043e0| 73 70 65 63 69 66 69 65 | 64 20 74 79 70 65 2e 0d |specifie|d type..|
|000043f0| 58 54 68 65 20 63 61 6c | 6c 69 6e 67 20 73 65 71 |XThe cal|ling seq|
|00004400| 75 65 6e 63 65 20 69 73 | 3a 0d 58 2e 44 53 0d 58 |uence is|:.X.DS.X|
|00004410| 55 57 49 4e 20 75 77 5f | 6e 65 77 28 75 77 74 79 |UWIN uw_|new(uwty|
|00004420| 70 65 5f 74 20 75 77 74 | 79 70 65 2c 20 73 74 72 |pe_t uwt|ype, str|
|00004430| 75 63 74 20 73 6f 63 6b | 61 64 64 72 5f 69 6e 20 |uct sock|addr_in |
|00004440| 2a 73 65 72 76 65 72 29 | 0d 58 2e 44 45 0d 58 77 |*server)|.X.DE.Xw|
|00004450| 68 65 72 65 20 60 60 75 | 77 74 79 70 65 27 27 20 |here ``u|wtype'' |
|00004460| 69 73 20 74 68 65 20 77 | 69 6e 64 6f 77 20 74 79 |is the w|indow ty|
|00004470| 70 65 0d 58 61 6e 64 20 | 60 60 73 65 72 76 65 72 |pe.Xand |``server|
|00004480| 27 27 20 69 73 20 61 20 | 70 6f 69 6e 74 65 72 20 |'' is a |pointer |
|00004490| 74 6f 20 61 20 73 74 72 | 75 63 74 75 72 65 20 73 |to a str|ucture s|
|000044a0| 70 65 63 69 66 79 69 6e | 67 0d 58 74 68 65 20 49 |pecifyin|g.Xthe I|
|000044b0| 6e 74 65 72 6e 65 74 20 | 61 64 64 72 65 73 73 20 |nternet |address |
|000044c0| 6f 66 20 74 68 65 20 73 | 65 72 76 65 72 2e 0d 58 |of the s|erver..X|
|000044d0| 28 49 66 20 60 60 73 65 | 72 76 65 72 27 27 20 69 |(If ``se|rver'' i|
|000044e0| 73 20 61 20 4e 55 4c 4c | 20 70 6f 69 6e 74 65 72 |s a NULL| pointer|
|000044f0| 2c 0d 58 74 68 65 20 73 | 65 72 76 65 72 20 77 69 |,.Xthe s|erver wi|
|00004500| 6c 6c 20 62 65 20 64 65 | 74 65 72 6d 69 6e 65 64 |ll be de|termined|
|00004510| 20 62 79 20 65 78 61 6d | 69 6e 69 6e 67 20 74 68 | by exam|ining th|
|00004520| 65 0d 58 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 20 76 |e.Xenvir|onment v|
|00004530| 61 72 69 61 62 6c 65 20 | 60 60 55 57 5f 49 4e 45 |ariable |``UW_INE|
|00004540| 54 27 27 2e 29 0d 58 49 | 66 20 74 68 65 20 77 69 |T''.).XI|f the wi|
|00004550| 6e 64 6f 77 20 63 72 65 | 61 74 69 6f 6e 20 73 75 |ndow cre|ation su|
|00004560| 63 63 65 65 64 65 64 2c | 0d 58 60 60 75 77 5f 6e |cceeded,|.X``uw_n|
|00004570| 65 77 27 27 20 77 69 6c | 6c 20 72 65 74 75 72 6e |ew'' wil|l return|
|00004580| 20 61 20 6e 6f 6e 2d 4e | 55 4c 4c 20 77 69 6e 64 | a non-N|ULL wind|
|00004590| 6f 77 20 64 65 73 63 72 | 69 70 74 6f 72 3b 0d 58 |ow descr|iptor;.X|
|000045a0| 6f 74 68 65 72 77 69 73 | 65 2c 0d 58 69 74 20 77 |otherwis|e,.Xit w|
|000045b0| 69 6c 6c 20 72 65 74 75 | 72 6e 20 4e 55 4c 4c 2c |ill retu|rn NULL,|
|000045c0| 20 61 6e 64 0d 58 74 68 | 65 20 67 6c 6f 62 61 6c | and.Xth|e global|
|000045d0| 20 76 61 72 69 61 62 6c | 65 73 20 60 60 75 77 65 | variabl|es ``uwe|
|000045e0| 72 72 6e 6f 27 27 20 61 | 6e 64 20 60 60 65 72 72 |rrno'' a|nd ``err|
|000045f0| 6e 6f 27 27 0d 58 6d 61 | 79 20 62 65 20 65 78 61 |no''.Xma|y be exa|
|00004600| 6d 69 6e 65 64 20 74 6f | 20 64 65 74 65 72 6d 69 |mined to| determi|
|00004610| 6e 65 20 74 68 65 20 63 | 61 75 73 65 20 6f 66 20 |ne the c|ause of |
|00004620| 74 68 65 20 65 72 72 6f | 72 2e 0d 58 2e 49 50 20 |the erro|r..X.IP |
|00004630| 22 75 77 5f 64 65 74 61 | 63 68 22 0d 58 54 68 69 |"uw_deta|ch".XThi|
|00004640| 73 20 66 75 6e 63 74 69 | 6f 6e 20 60 60 64 65 74 |s functi|on ``det|
|00004650| 61 63 68 65 73 27 27 20 | 74 68 65 20 77 69 6e 64 |aches'' |the wind|
|00004660| 6f 77 20 66 72 6f 6d 20 | 74 68 65 20 70 72 6f 67 |ow from |the prog|
|00004670| 72 61 6d 0d 58 73 6f 20 | 74 68 61 74 20 69 74 20 |ram.Xso |that it |
|00004680| 6e 6f 20 6c 6f 6e 67 65 | 72 20 69 73 20 61 62 6c |no longe|r is abl|
|00004690| 65 20 74 6f 20 70 65 72 | 66 6f 72 6d 20 63 6f 6e |e to per|form con|
|000046a0| 74 72 6f 6c 20 6f 70 65 | 72 61 74 69 6f 6e 73 0d |trol ope|rations.|
|000046b0| 58 75 70 6f 6e 20 74 68 | 65 20 77 69 6e 64 6f 77 |Xupon th|e window|
|000046c0| 2e 0d 58 54 68 65 20 64 | 61 74 61 20 63 6f 6e 6e |..XThe d|ata conn|
|000046d0| 65 63 74 69 6f 6e 20 74 | 6f 20 74 68 65 20 77 69 |ection t|o the wi|
|000046e0| 6e 64 6f 77 20 72 65 6d | 61 69 6e 73 20 6f 70 65 |ndow rem|ains ope|
|000046f0| 6e 2e 0d 58 54 68 69 73 | 20 66 75 6e 63 74 69 6f |n..XThis| functio|
|00004700| 6e 20 73 68 6f 75 6c 64 | 20 62 65 20 75 73 65 64 |n should| be used|
|00004710| 20 77 68 65 6e 20 74 68 | 65 20 64 61 74 61 20 63 | when th|e data c|
|00004720| 6f 6e 6e 65 63 74 69 6f | 6e 20 74 6f 20 61 20 77 |onnectio|n to a w|
|00004730| 69 6e 64 6f 77 0d 58 77 | 69 6c 6c 20 62 65 20 68 |indow.Xw|ill be h|
|00004740| 61 6e 64 6c 65 64 20 62 | 79 20 61 20 64 69 66 66 |andled b|y a diff|
|00004750| 65 72 65 6e 74 20 70 72 | 6f 63 65 73 73 0d 58 74 |erent pr|ocess.Xt|
|00004760| 68 61 6e 20 74 68 65 20 | 63 6f 6e 74 72 6f 6c 20 |han the |control |
|00004770| 63 6f 6e 6e 65 63 74 69 | 6f 6e 2c 0d 58 2e 49 20 |connecti|on,.X.I |
|00004780| 65 2e 67 2e 0d 58 69 6e | 20 61 20 63 68 69 6c 64 |e.g..Xin| a child|
|00004790| 20 70 72 6f 63 65 73 73 | 20 61 66 74 65 72 20 61 | process| after a|
|000047a0| 20 60 60 66 6f 72 6b 27 | 27 2e 0d 58 49 74 20 69 | ``fork'|'..XIt i|
|000047b0| 73 20 73 74 72 6f 6e 67 | 6c 79 20 72 65 63 6f 6d |s strong|ly recom|
|000047c0| 6d 65 6e 64 65 64 20 74 | 68 61 74 20 6e 6f 20 6d |mended t|hat no m|
|000047d0| 6f 72 65 20 74 68 61 6e | 20 6f 6e 65 20 70 72 6f |ore than| one pro|
|000047e0| 63 65 73 73 0d 58 68 61 | 76 65 20 63 6f 6e 74 72 |cess.Xha|ve contr|
|000047f0| 6f 6c 20 61 63 63 65 73 | 73 20 74 6f 20 61 20 77 |ol acces|s to a w|
|00004800| 69 6e 64 6f 77 20 61 74 | 20 61 6e 79 20 6f 6e 65 |indow at| any one|
|00004810| 20 74 69 6d 65 2e 0d 58 | 54 68 65 20 63 61 6c 6c | time..X|The call|
|00004820| 69 6e 67 20 73 65 71 75 | 65 6e 63 65 20 69 73 0d |ing sequ|ence is.|
|00004830| 58 2e 44 53 0d 58 75 77 | 5f 64 65 74 61 63 68 28 |X.DS.Xuw|_detach(|
|00004840| 55 57 49 4e 20 75 77 69 | 6e 29 3b 0d 58 2e 44 45 |UWIN uwi|n);.X.DE|
|00004850| 0d 58 77 68 65 72 65 20 | 60 60 75 77 69 6e 27 27 |.Xwhere |``uwin''|
|00004860| 20 69 73 20 74 68 65 20 | 77 69 6e 64 6f 77 20 64 | is the |window d|
|00004870| 65 73 63 72 69 70 74 6f | 72 2e 0d 58 5a 65 72 6f |escripto|r..XZero|
|00004880| 20 69 73 20 72 65 74 75 | 72 6e 65 64 20 66 6f 72 | is retu|rned for|
|00004890| 20 73 75 63 63 65 73 73 | 2c 0d 58 77 68 69 6c 65 | success|,.Xwhile|
|000048a0| 20 5c 28 6d 69 31 20 69 | 73 20 72 65 74 75 72 6e | \(mi1 i|s return|
|000048b0| 65 64 20 66 6f 72 20 66 | 61 69 6c 75 72 65 2e 0d |ed for f|ailure..|
|000048c0| 58 49 66 20 74 68 65 20 | 72 6f 75 74 69 6e 65 20 |XIf the |routine |
|000048d0| 66 61 69 6c 73 2c 0d 58 | 74 68 65 20 65 72 72 6f |fails,.X|the erro|
|000048e0| 72 20 73 74 61 74 75 73 | 20 77 69 6c 6c 20 62 65 |r status| will be|
|000048f0| 20 73 74 6f 72 65 64 20 | 69 6e 20 74 68 65 20 55 | stored |in the U|
|00004900| 57 49 4e 20 64 61 74 61 | 20 69 74 65 6d 0d 58 61 |WIN data| item.Xa|
|00004910| 73 20 77 65 6c 6c 20 61 | 73 20 69 6e 20 74 68 65 |s well a|s in the|
|00004920| 20 67 6c 6f 62 61 6c 20 | 76 61 72 69 61 62 6c 65 | global |variable|
|00004930| 73 20 60 60 75 77 65 72 | 72 6e 6f 27 27 20 61 6e |s ``uwer|rno'' an|
|00004940| 64 20 60 60 65 72 72 6e | 6f 27 27 2e 0d 58 2e 49 |d ``errn|o''..X.I|
|00004950| 50 20 22 75 77 5f 63 6c | 6f 73 65 22 0d 58 54 68 |P "uw_cl|ose".XTh|
|00004960| 69 73 20 66 75 6e 63 74 | 69 6f 6e 20 63 6c 6f 73 |is funct|ion clos|
|00004970| 65 73 20 61 20 77 69 6e | 64 6f 77 2e 0d 58 42 6f |es a win|dow..XBo|
|00004980| 74 68 20 74 68 65 20 63 | 6f 6e 74 72 6f 6c 20 61 |th the c|ontrol a|
|00004990| 6e 64 20 64 61 74 61 20 | 63 6f 6e 6e 65 63 74 69 |nd data |connecti|
|000049a0| 6f 6e 73 20 74 6f 20 74 | 68 65 20 77 69 6e 64 6f |ons to t|he windo|
|000049b0| 77 20 61 72 65 20 63 6c | 6f 73 65 64 2e 0d 58 49 |w are cl|osed..XI|
|000049c0| 66 20 6d 75 6c 74 69 70 | 6c 65 20 70 72 6f 63 65 |f multip|le proce|
|000049d0| 73 73 65 73 20 68 61 76 | 65 20 61 63 63 65 73 73 |sses hav|e access|
|000049e0| 20 74 6f 20 61 20 77 69 | 6e 64 6f 77 0d 58 28 5c | to a wi|ndow.X(\|
|000049f0| 66 49 65 2e 67 2e 5c 66 | 50 20 62 65 63 61 75 73 |fIe.g.\f|P becaus|
|00004a00| 65 20 6f 66 20 61 20 60 | 60 66 6f 72 6b 27 27 29 |e of a `|`fork'')|
|00004a10| 2c 0d 58 74 68 65 6e 20 | 74 68 65 20 77 69 6e 64 |,.Xthen |the wind|
|00004a20| 6f 77 20 77 69 6c 6c 20 | 62 65 20 64 65 73 74 72 |ow will |be destr|
|00004a30| 6f 79 65 64 20 77 68 65 | 6e 20 74 68 65 20 6c 61 |oyed whe|n the la|
|00004a40| 73 74 20 63 6f 6e 6e 65 | 63 74 69 6f 6e 0d 58 74 |st conne|ction.Xt|
|00004a50| 6f 20 69 74 20 69 73 20 | 63 6c 6f 73 65 64 2e 0d |o it is |closed..|
|00004a60| 58 54 68 65 20 63 61 6c | 6c 69 6e 67 20 73 65 71 |XThe cal|ling seq|
|00004a70| 75 65 6e 63 65 20 69 73 | 0d 58 2e 44 53 0d 58 75 |uence is|.X.DS.Xu|
|00004a80| 77 5f 63 6c 6f 73 65 28 | 55 57 49 4e 20 75 77 69 |w_close(|UWIN uwi|
|00004a90| 6e 29 3b 0d 58 2e 44 45 | 0d 58 77 68 65 72 65 20 |n);.X.DE|.Xwhere |
|00004aa0| 60 60 75 77 69 6e 27 27 | 20 69 73 20 74 68 65 20 |``uwin''| is the |
|00004ab0| 77 69 6e 64 6f 77 20 64 | 65 73 63 72 69 70 74 6f |window d|escripto|
|00004ac0| 72 0d 58 2e 49 50 20 22 | 75 77 5f 6b 69 6c 6c 22 |r.X.IP "|uw_kill"|
|00004ad0| 0d 58 41 74 20 74 69 6d | 65 73 20 69 74 20 6d 61 |.XAt tim|es it ma|
|00004ae0| 79 20 62 65 20 64 65 73 | 69 72 61 62 6c 65 20 66 |y be des|irable f|
|00004af0| 6f 72 20 6f 6e 65 20 70 | 72 6f 63 65 73 73 20 74 |or one p|rocess t|
|00004b00| 6f 20 64 65 73 74 72 6f | 79 0d 58 61 20 77 69 6e |o destro|y.Xa win|
|00004b10| 64 6f 77 20 65 76 65 6e | 20 69 66 20 74 68 65 20 |dow even| if the |
|00004b20| 77 69 6e 64 6f 77 20 69 | 73 20 69 6e 20 75 73 65 |window i|s in use|
|00004b30| 20 62 79 20 6f 74 68 65 | 72 20 70 72 6f 63 65 73 | by othe|r proces|
|00004b40| 73 65 73 2e 0d 58 54 68 | 65 20 60 60 75 77 5f 6b |ses..XTh|e ``uw_k|
|00004b50| 69 6c 6c 27 27 20 66 75 | 6e 63 74 69 6f 6e 20 70 |ill'' fu|nction p|
|00004b60| 65 72 66 6f 72 6d 73 20 | 74 68 69 73 20 74 61 73 |erforms |this tas|
|00004b70| 6b 2e 0d 58 54 68 65 20 | 63 61 6c 6c 65 72 20 6d |k..XThe |caller m|
|00004b80| 75 73 74 20 68 61 76 65 | 20 63 6f 6e 74 72 6f 6c |ust have| control|
|00004b90| 20 61 63 63 65 73 73 20 | 74 6f 20 74 68 65 20 77 | access |to the w|
|00004ba0| 69 6e 64 6f 77 0d 58 28 | 69 74 20 6d 75 73 74 20 |indow.X(|it must |
|00004bb0| 6e 6f 74 20 62 65 20 60 | 60 64 65 74 61 63 68 65 |not be `|`detache|
|00004bc0| 64 27 27 29 2e 0d 58 54 | 68 65 20 73 79 6e 74 61 |d'')..XT|he synta|
|00004bd0| 78 20 69 73 3a 0d 58 2e | 44 53 0d 58 75 77 5f 6b |x is:.X.|DS.Xuw_k|
|00004be0| 69 6c 6c 28 55 57 49 4e | 20 75 77 69 6e 29 3b 0d |ill(UWIN| uwin);.|
|00004bf0| 58 2e 44 45 0d 58 77 68 | 65 72 65 20 60 60 75 77 |X.DE.Xwh|ere ``uw|
|00004c00| 69 6e 27 27 20 69 73 20 | 74 68 65 20 77 69 6e 64 |in'' is |the wind|
|00004c10| 6f 77 20 64 65 73 63 72 | 69 70 74 6f 72 2e 0d 58 |ow descr|iptor..X|
|00004c20| 57 68 65 6e 20 61 20 77 | 69 6e 64 6f 77 20 69 73 |When a w|indow is|
|00004c30| 20 6b 69 6c 6c 65 64 0d | 58 28 65 69 74 68 65 72 | killed.|X(either|
|00004c40| 20 62 79 20 60 60 75 77 | 5f 6b 69 6c 6c 27 27 20 | by ``uw|_kill'' |
|00004c50| 6f 72 20 75 70 6f 6e 20 | 63 6f 6d 6d 61 6e 64 20 |or upon |command |
|00004c60| 66 72 6f 6d 20 74 68 65 | 20 4d 61 63 69 6e 74 6f |from the| Macinto|
|00004c70| 73 68 29 0d 58 74 68 65 | 20 73 65 72 76 65 72 20 |sh).Xthe| server |
|00004c80| 63 6c 6f 73 65 73 20 69 | 74 73 20 64 61 74 61 20 |closes i|ts data |
|00004c90| 63 68 61 6e 6e 65 6c 2e | 0d 58 41 6e 79 20 66 75 |channel.|.XAny fu|
|00004ca0| 72 74 68 65 72 20 61 74 | 74 65 6d 70 74 73 20 74 |rther at|tempts t|
|00004cb0| 6f 20 72 65 61 64 20 6f | 72 20 77 72 69 74 65 20 |o read o|r write |
|00004cc0| 74 6f 20 74 68 65 20 77 | 69 6e 64 6f 77 0d 58 77 |to the w|indow.Xw|
|00004cd0| 69 6c 6c 20 70 72 6f 64 | 75 63 65 20 65 6e 64 2d |ill prod|uce end-|
|00004ce0| 6f 66 2d 66 69 6c 65 20 | 6f 72 20 65 72 72 6f 72 |of-file |or error|
|00004cf0| 20 63 6f 6e 64 69 74 69 | 6f 6e 73 2c 0d 58 72 65 | conditi|ons,.Xre|
|00004d00| 73 70 65 63 74 69 76 65 | 6c 79 2e 0d 58 2e 49 50 |spective|ly..X.IP|
|00004d10| 20 22 75 77 5f 6f 70 74 | 66 6e 22 0d 58 49 66 20 | "uw_opt|fn".XIf |
|00004d20| 61 20 70 72 6f 63 65 73 | 73 20 68 61 73 20 63 6f |a proces|s has co|
|00004d30| 6e 74 72 6f 6c 20 61 63 | 63 65 73 73 20 74 6f 20 |ntrol ac|cess to |
|00004d40| 61 20 77 69 6e 64 6f 77 | 2c 0d 58 74 68 65 6e 20 |a window|,.Xthen |
|00004d50| 69 74 20 77 69 6c 6c 20 | 70 65 72 69 6f 64 69 63 |it will |periodic|
|00004d60| 61 6c 6c 79 20 72 65 63 | 65 69 76 65 0d 58 77 69 |ally rec|eive.Xwi|
|00004d70| 6e 64 6f 77 20 6f 70 74 | 69 6f 6e 20 6d 65 73 73 |ndow opt|ion mess|
|00004d80| 61 67 65 73 20 66 72 6f | 6d 20 74 68 65 20 4d 61 |ages fro|m the Ma|
|00004d90| 63 69 6e 74 6f 73 68 20 | 63 6c 69 65 6e 74 0d 58 |cintosh |client.X|
|00004da0| 28 74 68 72 6f 75 67 68 | 20 74 68 65 20 73 65 72 |(through| the ser|
|00004db0| 76 65 72 29 2e 0d 58 54 | 68 65 20 5c 2a 28 75 77 |ver)..XT|he \*(uw|
|00004dc0| 20 6c 69 62 72 61 72 79 | 20 72 65 63 65 69 76 65 | library| receive|
|00004dd0| 73 20 74 68 65 73 65 20 | 6d 65 73 73 61 67 65 73 |s these |messages|
|00004de0| 20 62 79 20 65 6e 61 62 | 6c 69 6e 67 0d 58 61 73 | by enab|ling.Xas|
|00004df0| 79 6e 63 68 72 6f 6e 6f | 75 73 20 49 2f 4f 20 6e |ynchrono|us I/O n|
|00004e00| 6f 74 69 66 69 63 61 74 | 69 6f 6e 20 6f 6e 20 74 |otificat|ion on t|
|00004e10| 68 65 20 63 6f 6e 74 72 | 6f 6c 20 63 68 61 6e 6e |he contr|ol chann|
|00004e20| 65 6c 0d 58 61 6e 64 20 | 70 72 6f 76 69 64 69 6e |el.Xand |providin|
|00004e30| 67 20 61 20 53 49 47 49 | 4f 20 73 69 67 6e 61 6c |g a SIGI|O signal|
|00004e40| 20 68 61 6e 64 6c 65 72 | 2e 0d 58 53 6f 6d 65 74 | handler|..XSomet|
|00004e50| 69 6d 65 73 20 69 74 20 | 69 73 20 64 65 73 69 72 |imes it |is desir|
|00004e60| 61 62 6c 65 20 66 6f 72 | 20 61 6e 20 65 78 74 65 |able for| an exte|
|00004e70| 72 6e 61 6c 20 70 72 6f | 63 65 73 73 0d 58 74 6f |rnal pro|cess.Xto|
|00004e80| 20 66 69 65 6c 64 20 69 | 6e 63 6f 6d 69 6e 67 20 | field i|ncoming |
|00004e90| 6f 70 74 69 6f 6e 20 6d | 65 73 73 61 67 65 73 20 |option m|essages |
|00004ea0| 69 74 73 65 6c 66 2e 0d | 58 54 6f 20 64 6f 20 73 |itself..|XTo do s|
|00004eb0| 6f 2c 0d 58 69 74 20 6d | 75 73 74 20 6e 6f 74 69 |o,.Xit m|ust noti|
|00004ec0| 66 79 20 74 68 65 20 5c | 2a 28 75 77 20 6c 69 62 |fy the \|*(uw lib|
|00004ed0| 72 61 72 79 20 62 79 20 | 63 61 6c 6c 69 6e 67 20 |rary by |calling |
|00004ee0| 74 68 65 0d 58 72 6f 75 | 74 69 6e 65 20 60 60 75 |the.Xrou|tine ``u|
|00004ef0| 77 5f 6f 70 74 66 6e 27 | 27 3a 0d 58 2e 44 53 0d |w_optfn'|':.X.DS.|
|00004f00| 58 76 6f 69 64 20 28 2a | 75 77 5f 6f 70 74 66 6e |Xvoid (*|uw_optfn|
|00004f10| 28 55 57 49 4e 20 75 77 | 69 6e 2c 20 75 77 6f 70 |(UWIN uw|in, uwop|
|00004f20| 74 5f 74 20 6f 70 74 6e | 75 6d 2c 20 76 6f 69 64 |t_t optn|um, void|
|00004f30| 20 28 2a 6f 70 74 66 6e | 29 28 29 29 28 29 3b 0d | (*optfn|)())();.|
|00004f40| 58 2e 44 45 0d 58 77 68 | 65 72 65 20 60 60 75 77 |X.DE.Xwh|ere ``uw|
|00004f50| 69 6e 27 27 20 69 73 20 | 74 68 65 20 77 69 6e 64 |in'' is |the wind|
|00004f60| 6f 77 20 64 65 73 63 72 | 69 70 74 6f 72 2c 0d 58 |ow descr|iptor,.X|
|00004f70| 60 60 6f 70 74 6e 75 6d | 27 27 20 69 73 20 74 68 |``optnum|'' is th|
|00004f80| 65 20 64 65 73 69 72 65 | 64 20 77 69 6e 64 6f 77 |e desire|d window|
|00004f90| 20 6f 70 74 69 6f 6e 2c | 0d 58 61 6e 64 20 60 60 | option,|.Xand ``|
|00004fa0| 6f 70 74 66 6e 27 27 20 | 69 73 20 61 20 70 6f 69 |optfn'' |is a poi|
|00004fb0| 6e 74 65 72 20 74 6f 20 | 61 20 66 75 6e 63 74 69 |nter to |a functi|
|00004fc0| 6f 6e 20 77 68 69 63 68 | 0d 58 77 69 6c 6c 20 62 |on which|.Xwill b|
|00004fd0| 65 20 63 61 6c 6c 65 64 | 20 77 68 65 6e 20 61 20 |e called| when a |
|00004fe0| 6d 65 73 73 61 67 65 20 | 61 62 6f 75 74 20 77 69 |message |about wi|
|00004ff0| 6e 64 6f 77 20 6f 70 74 | 69 6f 6e 20 60 60 6f 70 |ndow opt|ion ``op|
|00005000| 74 6e 75 6d 27 27 0d 58 | 69 73 20 72 65 63 65 69 |tnum''.X|is recei|
|00005010| 76 65 64 2e 0d 58 60 60 | 75 77 5f 6f 70 74 66 6e |ved..X``|uw_optfn|
|00005020| 27 27 20 72 65 74 75 72 | 6e 73 20 74 68 65 20 70 |'' retur|ns the p|
|00005030| 72 65 76 69 6f 75 73 20 | 66 75 6e 63 74 69 6f 6e |revious |function|
|00005040| 2e 0d 58 54 6f 20 64 69 | 73 61 62 6c 65 20 70 72 |..XTo di|sable pr|
|00005050| 6f 63 65 73 73 69 6e 67 | 20 66 6f 72 20 61 20 77 |ocessing| for a w|
|00005060| 69 6e 64 6f 77 20 6f 70 | 74 69 6f 6e 2c 0d 58 73 |indow op|tion,.Xs|
|00005070| 70 65 63 69 66 79 20 61 | 20 4e 55 4c 4c 20 70 6f |pecify a| NULL po|
|00005080| 69 6e 74 65 72 20 66 6f | 72 20 60 60 6f 70 74 66 |inter fo|r ``optf|
|00005090| 6e 27 27 2e 0d 58 54 68 | 65 20 75 73 65 72 2d 73 |n''..XTh|e user-s|
|000050a0| 75 70 70 6c 69 65 64 20 | 60 60 6f 70 74 66 6e 27 |upplied |``optfn'|
|000050b0| 27 20 69 73 20 63 61 6c | 6c 65 64 20 77 69 74 68 |' is cal|led with|
|000050c0| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 61 | the fol|lowing a|
|000050d0| 72 67 75 6d 65 6e 74 73 | 3a 0d 58 2e 44 53 0d 58 |rguments|:.X.DS.X|
|000050e0| 2e 74 61 20 38 6e 0d 58 | 76 6f 69 64 20 28 2a 6f |.ta 8n.X|void (*o|
|000050f0| 70 74 66 6e 29 28 55 57 | 49 4e 20 75 77 69 6e 2c |ptfn)(UW|IN uwin,|
|00005100| 20 75 77 6f 70 74 5f 74 | 20 6f 70 74 6e 75 6d 2c | uwopt_t| optnum,|
|00005110| 20 75 77 6f 70 74 63 6d | 64 5f 74 20 6f 70 74 63 | uwoptcm|d_t optc|
|00005120| 6d 64 2c 0d 58 09 75 6e | 69 6f 6e 20 75 77 6f 70 |md,.X.un|ion uwop|
|00005130| 74 76 61 6c 20 2a 6f 70 | 74 76 61 6c 29 3b 0d 58 |tval *op|tval);.X|
|00005140| 2e 44 45 0d 58 77 68 65 | 72 65 20 60 60 75 77 69 |.DE.Xwhe|re ``uwi|
|00005150| 6e 27 27 20 69 73 20 74 | 68 65 20 77 69 6e 64 6f |n'' is t|he windo|
|00005160| 77 20 64 65 73 63 72 69 | 70 74 6f 72 2c 0d 58 60 |w descri|ptor,.X`|
|00005170| 60 6f 70 74 6e 75 6d 27 | 27 20 69 73 20 74 68 65 |`optnum'|' is the|
|00005180| 20 77 69 6e 64 6f 77 20 | 6f 70 74 69 6f 6e 20 6e | window |option n|
|00005190| 75 6d 62 65 72 2c 0d 58 | 60 60 6f 70 74 63 6d 64 |umber,.X|``optcmd|
|000051a0| 27 27 20 69 73 20 74 68 | 65 20 77 69 6e 64 6f 77 |'' is th|e window|
|000051b0| 20 6f 70 74 69 6f 6e 20 | 63 6f 6d 6d 61 6e 64 2c | option |command,|
|000051c0| 0d 58 61 6e 64 0d 58 28 | 69 66 20 60 60 6f 70 74 |.Xand.X(|if ``opt|
|000051d0| 63 6d 64 27 27 20 69 73 | 20 55 57 4f 43 5f 53 45 |cmd'' is| UWOC_SE|
|000051e0| 54 29 0d 58 60 60 6f 70 | 74 76 61 6c 27 27 20 69 |T).X``op|tval'' i|
|000051f0| 73 20 61 20 70 6f 69 6e | 74 65 72 20 74 6f 20 74 |s a poin|ter to t|
|00005200| 68 65 20 6e 65 77 20 76 | 61 6c 75 65 20 6f 66 20 |he new v|alue of |
|00005210| 74 68 65 20 77 69 6e 64 | 6f 77 20 6f 70 74 69 6f |the wind|ow optio|
|00005220| 6e 2e 0d 58 2e 73 70 0d | 58 42 65 63 61 75 73 65 |n..X.sp.|XBecause|
|00005230| 20 74 68 65 20 5c 2a 28 | 75 77 20 6c 69 62 72 61 | the \*(|uw libra|
|00005240| 72 79 20 70 72 6f 76 69 | 64 65 73 20 61 20 73 69 |ry provi|des a si|
|00005250| 67 6e 61 6c 20 68 61 6e | 64 6c 65 72 20 66 6f 72 |gnal han|dler for|
|00005260| 20 53 49 47 49 4f 2c 0d | 58 69 66 20 6f 74 68 65 | SIGIO,.|Xif othe|
|00005270| 72 20 70 6f 72 74 69 6f | 6e 73 20 6f 66 20 74 68 |r portio|ns of th|
|00005280| 65 20 70 72 6f 67 72 61 | 6d 20 77 69 73 68 20 74 |e progra|m wish t|
|00005290| 6f 20 63 61 74 63 68 20 | 53 49 47 49 4f 2c 0d 58 |o catch |SIGIO,.X|
|000052a0| 74 68 65 6e 20 73 6f 6d | 65 20 63 61 72 65 20 6d |then som|e care m|
|000052b0| 75 73 74 20 62 65 20 74 | 61 6b 65 6e 0d 58 74 6f |ust be t|aken.Xto|
|000052c0| 20 65 6e 73 75 72 65 20 | 74 68 61 74 20 61 6c 6c | ensure |that all|
|000052d0| 20 73 69 67 6e 61 6c 20 | 68 61 6e 64 6c 65 72 73 | signal |handlers|
|000052e0| 20 61 72 65 20 63 61 6c | 6c 65 64 2e 0d 58 54 68 | are cal|led..XTh|
|000052f0| 65 20 5c 2a 28 75 77 20 | 6c 69 62 72 61 72 79 20 |e \*(uw |library |
|00005300| 73 61 76 65 73 20 74 68 | 65 20 72 65 74 75 72 6e |saves th|e return|
|00005310| 20 76 61 6c 75 65 20 66 | 72 6f 6d 0d 58 60 60 73 | value f|rom.X``s|
|00005320| 69 67 6e 61 6c 27 27 20 | 77 68 65 6e 20 69 74 20 |ignal'' |when it |
|00005330| 69 6e 73 74 61 6c 6c 73 | 20 69 74 73 20 68 61 6e |installs| its han|
|00005340| 64 6c 65 72 2e 0d 58 49 | 66 20 74 68 69 73 20 69 |dler..XI|f this i|
|00005350| 73 20 6e 6f 74 20 53 49 | 47 5f 49 47 4e 2c 0d 58 |s not SI|G_IGN,.X|
|00005360| 74 68 65 6e 20 74 68 61 | 74 20 72 6f 75 74 69 6e |then tha|t routin|
|00005370| 65 20 77 69 6c 6c 20 62 | 65 20 63 61 6c 6c 65 64 |e will b|e called|
|00005380| 20 61 66 74 65 72 20 5c | 2a 28 75 77 20 68 61 73 | after \|*(uw has|
|00005390| 0d 58 63 6f 6d 70 6c 65 | 74 65 64 20 69 74 73 20 |.Xcomple|ted its |
|000053a0| 73 69 67 6e 61 6c 20 70 | 72 6f 63 65 73 73 69 6e |signal p|rocessin|
|000053b0| 67 2e 0d 58 49 6e 20 61 | 20 73 69 6d 69 6c 61 72 |g..XIn a| similar|
|000053c0| 20 66 61 73 68 69 6f 6e | 2c 0d 58 69 66 20 74 68 | fashion|,.Xif th|
|000053d0| 65 20 63 61 6c 6c 69 6e | 67 20 70 72 6f 67 72 61 |e callin|g progra|
|000053e0| 6d 20 65 73 74 61 62 6c | 69 73 68 65 73 20 61 20 |m establ|ishes a |
|000053f0| 73 69 67 6e 61 6c 20 68 | 61 6e 64 6c 65 72 2c 0d |signal h|andler,.|
|00005400| 58 69 74 20 73 68 6f 75 | 6c 64 20 73 61 76 65 20 |Xit shou|ld save |
|00005410| 74 68 65 20 70 72 65 76 | 69 6f 75 73 20 76 61 6c |the prev|ious val|
|00005420| 75 65 20 61 6e 64 20 63 | 61 6c 6c 20 74 68 65 20 |ue and c|all the |
|00005430| 69 6e 64 69 63 61 74 65 | 64 0d 58 66 75 6e 63 74 |indicate|d.Xfunct|
|00005440| 69 6f 6e 0d 58 28 69 66 | 20 6e 6f 74 20 53 49 47 |ion.X(if| not SIG|
|00005450| 5f 49 47 4e 29 2e 0d 58 | 46 6f 72 20 65 78 61 6d |_IGN)..X|For exam|
|00005460| 70 6c 65 2c 0d 58 69 66 | 20 74 68 65 20 63 61 6c |ple,.Xif| the cal|
|00005470| 6c 65 72 20 75 73 65 73 | 20 60 60 73 69 67 6e 61 |ler uses| ``signa|
|00005480| 6c 27 27 3a 0d 58 2e 44 | 53 0d 58 2e 74 61 20 38 |l'':.X.D|S.X.ta 8|
|00005490| 6e 20 31 36 6e 0d 58 6f | 6c 64 68 61 6e 64 6c 65 |n 16n.Xo|ldhandle|
|000054a0| 72 20 3d 20 73 69 67 6e | 61 6c 28 53 49 47 49 4f |r = sign|al(SIGIO|
|000054b0| 2c 20 6d 79 68 61 6e 64 | 6c 65 72 29 3b 0d 58 5c |, myhand|ler);.X\|
|000054c0| 26 2e 2e 2e 0d 58 6d 79 | 68 61 6e 64 6c 65 72 28 |&....Xmy|handler(|
|000054d0| 73 69 67 2c 20 63 6f 64 | 65 2c 20 73 63 70 29 0d |sig, cod|e, scp).|
|000054e0| 58 69 6e 74 20 73 69 67 | 2c 20 63 6f 64 65 3b 0d |Xint sig|, code;.|
|000054f0| 58 73 74 72 75 63 74 20 | 73 69 67 63 6f 6e 74 65 |Xstruct |sigconte|
|00005500| 78 74 20 2a 73 63 70 3b | 0d 58 7b 0d 58 09 2e 2e |xt *scp;|.X{.X...|
|00005510| 2e 20 63 6f 64 65 20 74 | 6f 20 68 61 6e 64 6c 65 |. code t|o handle|
|00005520| 20 65 78 63 65 70 74 69 | 6f 6e 20 2e 2e 2e 0d 58 | excepti|on ....X|
|00005530| 09 69 66 20 28 6f 6c 64 | 68 61 6e 64 6c 65 72 20 |.if (old|handler |
|00005540| 21 3d 20 53 49 47 5f 49 | 47 4e 29 0d 58 09 09 28 |!= SIG_I|GN).X..(|
|00005550| 2a 6f 6c 64 68 61 6e 64 | 6c 65 72 29 28 73 69 67 |*oldhand|ler)(sig|
|00005560| 2c 20 63 6f 64 65 2c 20 | 73 63 70 29 3b 0d 58 7d |, code, |scp);.X}|
|00005570| 0d 58 2e 44 45 0d 58 41 | 6c 74 68 6f 75 67 68 20 |.X.DE.XA|lthough |
|00005580| 66 72 6f 6d 20 74 69 6d | 65 20 74 6f 20 74 69 6d |from tim|e to tim|
|00005590| 65 0d 58 74 68 65 20 4d | 61 63 69 6e 74 6f 73 68 |e.Xthe M|acintosh|
|000055a0| 20 6d 61 79 20 61 73 6b | 20 74 68 65 20 73 65 72 | may ask| the ser|
|000055b0| 76 65 72 20 66 6f 72 20 | 74 68 65 20 63 75 72 72 |ver for |the curr|
|000055c0| 65 6e 74 0d 58 76 61 6c | 75 65 20 6f 66 20 61 20 |ent.Xval|ue of a |
|000055d0| 77 69 6e 64 6f 77 20 6f | 70 74 69 6f 6e 2c 0d 58 |window o|ption,.X|
|000055e0| 74 68 65 20 5c 2a 28 75 | 77 20 73 65 72 76 65 72 |the \*(u|w server|
|000055f0| 20 63 61 63 68 65 73 20 | 74 68 65 20 63 75 72 72 | caches |the curr|
|00005600| 65 6e 74 20 76 61 6c 75 | 65 20 6f 66 20 65 61 63 |ent valu|e of eac|
|00005610| 68 0d 58 77 69 6e 64 6f | 77 20 6f 70 74 69 6f 6e |h.Xwindo|w option|
|00005620| 0d 58 61 6e 64 20 72 65 | 73 70 6f 6e 64 73 20 74 |.Xand re|sponds t|
|00005630| 6f 20 74 68 65 73 65 20 | 69 6e 71 75 69 72 69 65 |o these |inquirie|
|00005640| 73 20 64 69 72 65 63 74 | 6c 79 2e 0d 58 54 68 65 |s direct|ly..XThe|
|00005650| 72 65 66 6f 72 65 2c 0d | 58 74 68 65 20 6d 61 6a |refore,.|Xthe maj|
|00005660| 6f 72 20 72 65 61 73 6f | 6e 20 66 6f 72 20 65 73 |or reaso|n for es|
|00005670| 74 61 62 6c 69 73 68 69 | 6e 67 20 61 20 77 69 6e |tablishi|ng a win|
|00005680| 64 6f 77 20 6f 70 74 69 | 6f 6e 20 66 75 6e 63 74 |dow opti|on funct|
|00005690| 69 6f 6e 0d 58 77 69 74 | 68 20 60 60 75 77 5f 6f |ion.Xwit|h ``uw_o|
|000056a0| 70 74 66 6e 27 27 20 69 | 73 20 74 6f 20 70 72 6f |ptfn'' i|s to pro|
|000056b0| 63 65 73 73 20 69 6e 63 | 6f 6d 69 6e 67 20 55 57 |cess inc|oming UW|
|000056c0| 4f 43 5f 53 45 54 20 6d | 65 73 73 61 67 65 73 2c |OC_SET m|essages,|
|000056d0| 0d 58 2e 49 20 69 2e 65 | 2e 0d 58 6d 65 73 73 61 |.X.I i.e|..Xmessa|
|000056e0| 67 65 73 20 66 72 6f 6d | 20 74 68 65 20 4d 61 63 |ges from| the Mac|
|000056f0| 69 6e 74 6f 73 68 20 74 | 68 61 74 20 74 68 65 20 |intosh t|hat the |
|00005700| 76 61 6c 75 65 20 6f 66 | 20 61 20 77 69 6e 64 6f |value of| a windo|
|00005710| 77 0d 58 6f 70 74 69 6f | 6e 20 68 61 73 20 63 68 |w.Xoptio|n has ch|
|00005720| 61 6e 67 65 64 2e 0d 58 | 2e 49 50 20 22 75 77 5f |anged..X|.IP "uw_|
|00005730| 6f 70 74 63 6d 64 22 0d | 58 54 68 69 73 20 66 75 |optcmd".|XThis fu|
|00005740| 6e 63 74 69 6f 6e 20 61 | 6c 6c 6f 77 73 20 61 20 |nction a|llows a |
|00005750| 70 72 6f 67 72 61 6d 20 | 77 69 74 68 20 63 6f 6e |program |with con|
|00005760| 74 72 6f 6c 20 61 63 63 | 65 73 73 20 74 6f 20 61 |trol acc|ess to a|
|00005770| 20 77 69 6e 64 6f 77 0d | 58 74 6f 20 73 65 6e 64 | window.|Xto send|
|00005780| 20 77 69 6e 64 6f 77 20 | 6f 70 74 69 6f 6e 20 63 | window |option c|
|00005790| 6f 6d 6d 61 6e 64 73 2e | 0d 58 54 68 65 20 63 61 |ommands.|.XThe ca|
|000057a0| 6c 6c 69 6e 67 20 73 65 | 71 75 65 6e 63 65 20 69 |lling se|quence i|
|000057b0| 73 0d 58 2e 44 53 0d 58 | 2e 74 61 20 38 6e 0d 58 |s.X.DS.X|.ta 8n.X|
|000057c0| 75 77 5f 6f 70 74 63 6d | 64 28 55 57 49 4e 20 75 |uw_optcm|d(UWIN u|
|000057d0| 77 69 6e 2c 20 75 77 6f | 70 74 5f 74 20 6f 70 74 |win, uwo|pt_t opt|
|000057e0| 6e 75 6d 2c 20 75 77 6f | 70 74 63 6d 64 5f 74 20 |num, uwo|ptcmd_t |
|000057f0| 6f 70 74 63 6d 64 2c 0d | 58 09 75 6e 69 6f 6e 20 |optcmd,.|X.union |
|00005800| 75 77 6f 70 74 76 61 6c | 20 2a 6f 70 74 76 61 6c |uwoptval| *optval|
|00005810| 29 3b 0d 58 2e 44 45 0d | 58 77 68 65 72 65 20 60 |);.X.DE.|Xwhere `|
|00005820| 60 75 77 69 6e 27 27 20 | 69 73 20 74 68 65 20 77 |`uwin'' |is the w|
|00005830| 69 6e 64 6f 77 20 64 65 | 73 63 72 69 70 74 6f 72 |indow de|scriptor|
|00005840| 2c 0d 58 60 60 6f 70 74 | 6e 75 6d 27 27 20 69 73 |,.X``opt|num'' is|
|00005850| 20 74 68 65 20 77 69 6e | 64 6f 77 20 6f 70 74 69 | the win|dow opti|
|00005860| 6f 6e 20 6e 75 6d 62 65 | 72 2c 0d 58 60 60 6f 70 |on numbe|r,.X``op|
|00005870| 74 63 6d 64 27 27 20 69 | 73 20 74 68 65 20 63 6f |tcmd'' i|s the co|
|00005880| 6d 6d 61 6e 64 2c 0d 58 | 61 6e 64 20 60 60 6f 70 |mmand,.X|and ``op|
|00005890| 74 76 61 6c 27 27 20 69 | 73 20 61 20 70 6f 69 6e |tval'' i|s a poin|
|000058a0| 74 65 72 20 74 6f 20 74 | 68 65 20 6f 70 74 69 6f |ter to t|he optio|
|000058b0| 6e 20 76 61 6c 75 65 2e | 0d 58 4f 66 20 74 68 65 |n value.|.XOf the|
|000058c0| 20 73 69 78 20 77 69 6e | 64 6f 77 20 6f 70 74 69 | six win|dow opti|
|000058d0| 6f 6e 20 6d 65 73 73 61 | 67 65 73 2c 0d 58 6f 6e |on messa|ges,.Xon|
|000058e0| 6c 79 20 74 68 65 20 55 | 57 4f 43 5f 53 45 54 2c |ly the U|WOC_SET,|
|000058f0| 0d 58 55 57 4f 43 5f 44 | 4f 2c 0d 58 61 6e 64 20 |.XUWOC_D|O,.Xand |
|00005900| 55 57 4f 43 5f 44 4f 4e | 54 0d 58 6d 65 73 73 61 |UWOC_DON|T.Xmessa|
|00005910| 67 65 73 20 61 72 65 20 | 76 65 72 79 20 75 73 65 |ges are |very use|
|00005920| 66 75 6c 2e 0d 58 55 57 | 4f 43 5f 53 45 54 20 63 |ful..XUW|OC_SET c|
|00005930| 68 61 6e 67 65 73 20 74 | 68 65 20 76 61 6c 75 65 |hanges t|he value|
|00005940| 20 6f 66 20 61 20 77 69 | 6e 64 6f 77 20 6f 70 74 | of a wi|ndow opt|
|00005950| 69 6f 6e 0d 58 28 60 60 | 6f 70 74 76 61 6c 27 27 |ion.X(``|optval''|
|00005960| 20 70 6f 69 6e 74 73 20 | 74 6f 20 74 68 65 20 6e | points |to the n|
|00005970| 65 77 20 76 61 6c 75 65 | 29 2e 0d 58 55 57 4f 43 |ew value|)..XUWOC|
|00005980| 5f 44 4f 20 61 6e 64 20 | 55 57 4f 43 5f 44 4f 4e |_DO and |UWOC_DON|
|00005990| 54 20 69 6e 73 74 72 75 | 63 74 20 74 68 65 20 4d |T instru|ct the M|
|000059a0| 61 63 69 6e 74 6f 73 68 | 20 74 6f 0d 58 72 65 70 |acintosh| to.Xrep|
|000059b0| 6f 72 74 20 6f 72 20 6e | 6f 74 20 72 65 70 6f 72 |ort or n|ot repor|
|000059c0| 74 0d 58 28 72 65 73 70 | 65 63 74 69 76 65 6c 79 |t.X(resp|ectively|
|000059d0| 29 0d 58 77 68 65 6e 20 | 61 20 75 73 65 72 20 61 |).Xwhen |a user a|
|000059e0| 63 74 69 6f 6e 20 63 68 | 61 6e 67 65 73 20 74 68 |ction ch|anges th|
|000059f0| 65 20 76 61 6c 75 65 20 | 6f 66 20 61 20 77 69 6e |e value |of a win|
|00005a00| 64 6f 77 20 6f 70 74 69 | 6f 6e 20 74 68 65 72 65 |dow opti|on there|
|00005a10| 2e 0d 58 57 68 65 6e 20 | 69 74 20 63 72 65 61 74 |..XWhen |it creat|
|00005a20| 65 73 20 61 20 77 69 6e | 64 6f 77 2c 0d 58 74 68 |es a win|dow,.Xth|
|00005a30| 65 20 5c 2a 28 75 77 20 | 73 65 72 76 65 72 20 69 |e \*(uw |server i|
|00005a40| 6e 73 74 72 75 63 74 73 | 20 74 68 65 20 4d 61 63 |nstructs| the Mac|
|00005a50| 69 6e 74 6f 73 68 20 74 | 6f 20 72 65 70 6f 72 74 |intosh t|o report|
|00005a60| 20 61 6c 6c 0d 58 63 68 | 61 6e 67 65 73 20 74 6f | all.Xch|anges to|
|00005a70| 20 77 69 6e 64 6f 77 20 | 6f 70 74 69 6f 6e 73 2e | window |options.|
|00005a80| 0d 58 4d 6f 73 74 20 70 | 72 6f 67 72 61 6d 73 20 |.XMost p|rograms |
|00005a90| 77 69 6c 6c 20 70 72 6f | 62 61 62 6c 79 20 6e 6f |will pro|bably no|
|00005aa0| 74 20 6e 65 65 64 20 74 | 6f 20 69 73 73 75 65 20 |t need t|o issue |
|00005ab0| 55 57 4f 43 5f 44 4f 20 | 6f 72 20 55 57 4f 43 5f |UWOC_DO |or UWOC_|
|00005ac0| 44 4f 4e 54 20 63 6f 6d | 6d 61 6e 64 73 2e 0d 58 |DONT com|mands..X|
|00005ad0| 2e 49 50 20 75 77 5f 67 | 76 69 73 0d 58 54 68 69 |.IP uw_g|vis.XThi|
|00005ae0| 73 20 66 75 6e 63 74 69 | 6f 6e 20 66 65 74 63 68 |s functi|on fetch|
|00005af0| 65 73 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 76 |es the c|urrent v|
|00005b00| 69 73 69 62 69 6c 69 74 | 79 0d 58 73 74 61 74 75 |isibilit|y.Xstatu|
|00005b10| 73 20 6f 66 20 61 20 73 | 70 65 63 69 66 69 65 64 |s of a s|pecified|
|00005b20| 20 77 69 6e 64 6f 77 3a | 0d 58 2e 44 53 0d 58 69 | window:|.X.DS.Xi|
|00005b30| 6e 74 20 75 77 5f 67 76 | 69 73 28 55 57 49 4e 20 |nt uw_gv|is(UWIN |
|00005b40| 75 77 69 6e 2c 20 69 6e | 74 20 2a 76 70 29 3b 0d |uwin, in|t *vp);.|
|00005b50| 58 2e 44 45 0d 58 60 60 | 76 70 27 27 20 69 73 20 |X.DE.X``|vp'' is |
|00005b60| 61 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 61 6e 20 |a pointe|r to an |
|00005b70| 69 6e 74 65 67 65 72 20 | 77 68 65 72 65 20 74 68 |integer |where th|
|00005b80| 65 20 76 69 73 69 62 69 | 6c 69 74 79 20 73 74 61 |e visibi|lity sta|
|00005b90| 74 75 73 0d 58 28 30 20 | 6f 72 20 31 20 66 6f 72 |tus.X(0 |or 1 for|
|00005ba0| 20 69 6e 76 69 73 69 62 | 6c 65 20 6f 72 20 76 69 | invisib|le or vi|
|00005bb0| 73 69 62 6c 65 2c 20 72 | 65 73 70 65 63 74 69 76 |sible, r|espectiv|
|00005bc0| 65 6c 79 29 0d 58 69 73 | 20 72 65 74 75 72 6e 65 |ely).Xis| returne|
|00005bd0| 64 2e 0d 58 5a 65 72 6f | 20 69 73 20 72 65 74 75 |d..XZero| is retu|
|00005be0| 72 6e 65 64 20 66 6f 72 | 20 73 75 63 63 65 73 73 |rned for| success|
|00005bf0| 2c 0d 58 77 68 69 6c 65 | 20 5c 28 6d 69 31 20 69 |,.Xwhile| \(mi1 i|
|00005c00| 73 20 72 65 74 75 72 6e | 65 64 20 66 6f 72 20 66 |s return|ed for f|
|00005c10| 61 69 6c 75 72 65 2e 0d | 58 2e 49 50 20 75 77 5f |ailure..|X.IP uw_|
|00005c20| 73 76 69 73 0d 58 54 68 | 69 73 20 66 75 6e 63 74 |svis.XTh|is funct|
|00005c30| 69 6f 6e 20 63 68 61 6e | 67 65 73 20 74 68 65 20 |ion chan|ges the |
|00005c40| 76 69 73 69 62 69 6c 69 | 74 79 20 73 74 61 74 75 |visibili|ty statu|
|00005c50| 73 20 6f 66 20 61 20 73 | 70 65 63 69 66 69 65 64 |s of a s|pecified|
|00005c60| 20 77 69 6e 64 6f 77 3a | 0d 58 2e 44 53 0d 58 69 | window:|.X.DS.Xi|
|00005c70| 6e 74 20 75 77 5f 73 76 | 69 73 28 55 57 49 4e 20 |nt uw_sv|is(UWIN |
|00005c80| 75 77 69 6e 2c 20 69 6e | 74 20 76 29 3b 0d 58 2e |uwin, in|t v);.X.|
|00005c90| 44 45 0d 58 49 66 20 60 | 60 76 27 27 20 69 73 20 |DE.XIf `|`v'' is |
|00005ca0| 6e 6f 6e 7a 65 72 6f 20 | 74 68 65 6e 20 74 68 65 |nonzero |then the|
|00005cb0| 20 77 69 6e 64 6f 77 20 | 60 60 75 77 69 6e 27 27 | window |``uwin''|
|00005cc0| 20 77 69 6c 6c 20 62 65 | 20 6d 61 64 65 20 76 69 | will be| made vi|
|00005cd0| 73 69 62 6c 65 3b 0d 58 | 6f 74 68 65 72 77 69 73 |sible;.X|otherwis|
|00005ce0| 65 2c 0d 58 74 68 65 20 | 73 70 65 63 69 66 69 65 |e,.Xthe |specifie|
|00005cf0| 64 20 77 69 6e 64 6f 77 | 20 77 69 6c 6c 20 62 65 |d window| will be|
|00005d00| 20 6d 61 64 65 20 69 6e | 76 69 73 69 62 6c 65 2e | made in|visible.|
|00005d10| 0d 58 5a 65 72 6f 20 69 | 73 20 72 65 74 75 72 6e |.XZero i|s return|
|00005d20| 65 64 20 66 6f 72 20 73 | 75 63 63 65 73 73 2c 0d |ed for s|uccess,.|
|00005d30| 58 77 68 69 6c 65 20 5c | 28 6d 69 31 20 69 73 20 |Xwhile \|(mi1 is |
|00005d40| 72 65 74 75 72 6e 65 64 | 20 66 6f 72 20 66 61 69 |returned| for fai|
|00005d50| 6c 75 72 65 2e 0d 58 2e | 49 50 20 75 77 5f 67 70 |lure..X.|IP uw_gp|
|00005d60| 6f 73 0d 58 54 68 69 73 | 20 66 75 6e 63 74 69 6f |os.XThis| functio|
|00005d70| 6e 20 72 65 74 75 72 6e | 73 20 74 68 65 20 63 75 |n return|s the cu|
|00005d80| 72 72 65 6e 74 20 70 6f | 73 69 74 69 6f 6e 20 6f |rrent po|sition o|
|00005d90| 6e 20 74 68 65 20 73 63 | 72 65 65 6e 0d 58 6f 66 |n the sc|reen.Xof|
|00005da0| 20 61 20 73 70 65 63 69 | 66 69 65 64 20 77 69 6e | a speci|fied win|
|00005db0| 64 6f 77 3a 0d 58 2e 44 | 53 0d 58 2e 74 61 20 38 |dow:.X.D|S.X.ta 8|
|00005dc0| 6e 20 32 30 6e 20 32 38 | 6e 0d 58 73 74 72 75 63 |n 20n 28|n.Xstruc|
|00005dd0| 74 20 75 77 70 6f 69 6e | 74 20 7b 0d 58 09 75 6e |t uwpoin|t {.X.un|
|00005de0| 73 69 67 6e 65 64 09 75 | 77 70 5f 76 3b 09 2f 2a |signed.u|wp_v;./*|
|00005df0| 20 76 65 72 74 69 63 61 | 6c 20 63 6f 6d 70 6f 6e | vertica|l compon|
|00005e00| 65 6e 74 20 2a 2f 0d 58 | 09 75 6e 73 69 67 6e 65 |ent */.X|.unsigne|
|00005e10| 64 09 75 77 70 5f 68 3b | 09 2f 2a 20 68 6f 72 69 |d.uwp_h;|./* hori|
|00005e20| 7a 6f 6e 74 61 6c 20 63 | 6f 6d 70 6f 6e 65 6e 74 |zontal c|omponent|
|00005e30| 20 2a 2f 0d 58 7d 3b 0d | 58 0d 58 69 6e 74 20 75 | */.X};.|X.Xint u|
|00005e40| 77 5f 67 70 6f 73 28 55 | 57 49 4e 20 75 77 69 6e |w_gpos(U|WIN uwin|
|00005e50| 2c 20 73 74 72 75 63 74 | 20 75 77 70 6f 69 6e 74 |, struct| uwpoint|
|00005e60| 20 2a 70 70 29 3b 0d 58 | 2e 44 45 0d 58 5a 65 72 | *pp);.X|.DE.XZer|
|00005e70| 6f 20 69 73 20 72 65 74 | 75 72 6e 65 64 20 66 6f |o is ret|urned fo|
|00005e80| 72 20 73 75 63 63 65 73 | 73 2c 0d 58 77 68 69 6c |r succes|s,.Xwhil|
|00005e90| 65 20 5c 28 6d 69 31 20 | 69 73 20 72 65 74 75 72 |e \(mi1 |is retur|
|00005ea0| 6e 65 64 20 66 6f 72 20 | 66 61 69 6c 75 72 65 2e |ned for |failure.|
|00005eb0| 0d 58 2e 49 50 20 75 77 | 5f 73 70 6f 73 0d 58 54 |.X.IP uw|_spos.XT|
|00005ec0| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 73 65 74 |his func|tion set|
|00005ed0| 73 20 74 68 65 20 70 6f | 73 69 74 69 6f 6e 20 6f |s the po|sition o|
|00005ee0| 66 20 61 20 73 70 65 63 | 69 66 69 65 64 20 77 69 |f a spec|ified wi|
|00005ef0| 6e 64 6f 77 20 74 6f 0d | 58 61 20 64 65 73 69 72 |ndow to.|Xa desir|
|00005f00| 65 64 20 6c 6f 63 61 74 | 69 6f 6e 3a 0d 58 2e 44 |ed locat|ion:.X.D|
|00005f10| 53 0d 58 69 6e 74 20 75 | 77 5f 73 70 6f 73 28 55 |S.Xint u|w_spos(U|
|00005f20| 57 49 4e 20 75 77 69 6e | 2c 20 73 74 72 75 63 74 |WIN uwin|, struct|
|00005f30| 20 75 77 70 6f 69 6e 74 | 20 2a 70 70 29 3b 0d 58 | uwpoint| *pp);.X|
|00005f40| 2e 44 45 0d 58 5a 65 72 | 6f 20 69 73 20 72 65 74 |.DE.XZer|o is ret|
|00005f50| 75 72 6e 65 64 20 66 6f | 72 20 73 75 63 63 65 73 |urned fo|r succes|
|00005f60| 73 2c 0d 58 77 68 69 6c | 65 20 5c 28 6d 69 31 20 |s,.Xwhil|e \(mi1 |
|00005f70| 69 73 20 72 65 74 75 72 | 6e 65 64 20 66 6f 72 20 |is retur|ned for |
|00005f80| 66 61 69 6c 75 72 65 2e | 0d 58 2e 49 50 20 75 77 |failure.|.X.IP uw|
|00005f90| 5f 67 77 73 69 7a 65 0d | 58 54 68 69 73 20 66 75 |_gwsize.|XThis fu|
|00005fa0| 6e 63 74 69 6f 6e 20 72 | 65 74 75 72 6e 73 20 74 |nction r|eturns t|
|00005fb0| 68 65 20 63 75 72 72 65 | 6e 74 20 73 69 7a 65 20 |he curre|nt size |
|00005fc0| 69 6e 20 70 69 78 65 6c | 73 0d 58 6f 66 20 61 20 |in pixel|s.Xof a |
|00005fd0| 73 70 65 63 69 66 69 65 | 64 20 77 69 6e 64 6f 77 |specifie|d window|
|00005fe0| 2e 0d 58 54 68 65 20 73 | 69 7a 65 20 69 73 20 65 |..XThe s|ize is e|
|00005ff0| 78 70 72 65 73 73 65 64 | 20 61 73 20 61 20 60 60 |xpressed| as a ``|
|00006000| 75 77 70 6f 69 6e 74 27 | 27 2c 0d 58 61 73 20 64 |uwpoint'|',.Xas d|
|00006010| 65 66 69 6e 65 64 20 61 | 62 6f 76 65 2e 0d 58 2e |efined a|bove..X.|
|00006020| 44 53 0d 58 69 6e 74 20 | 75 77 5f 67 77 73 69 7a |DS.Xint |uw_gwsiz|
|00006030| 65 28 55 57 49 4e 20 75 | 77 69 6e 2c 20 73 74 72 |e(UWIN u|win, str|
|00006040| 75 63 74 20 75 77 70 6f | 69 6e 74 20 2a 70 70 29 |uct uwpo|int *pp)|
|00006050| 3b 0d 58 2e 44 45 0d 58 | 5a 65 72 6f 20 69 73 20 |;.X.DE.X|Zero is |
|00006060| 72 65 74 75 72 6e 65 64 | 20 66 6f 72 20 73 75 63 |returned| for suc|
|00006070| 63 65 73 73 2c 0d 58 77 | 68 69 6c 65 20 5c 28 6d |cess,.Xw|hile \(m|
|00006080| 69 31 20 69 73 20 72 65 | 74 75 72 6e 65 64 20 66 |i1 is re|turned f|
|00006090| 6f 72 20 66 61 69 6c 75 | 72 65 2e 0d 58 2e 49 50 |or failu|re..X.IP|
|000060a0| 20 75 77 5f 73 77 73 69 | 7a 65 0d 58 54 68 69 73 | uw_swsi|ze.XThis|
|000060b0| 20 66 75 6e 63 74 69 6f | 6e 20 73 65 74 73 20 61 | functio|n sets a|
|000060c0| 20 73 70 65 63 69 66 69 | 65 64 20 77 69 6e 64 6f | specifi|ed windo|
|000060d0| 77 20 74 6f 20 61 20 6e | 65 77 20 73 69 7a 65 3a |w to a n|ew size:|
|000060e0| 0d 58 2e 44 53 0d 58 69 | 6e 74 20 75 77 5f 73 77 |.X.DS.Xi|nt uw_sw|
|000060f0| 73 69 7a 65 28 55 57 49 | 4e 20 75 77 69 6e 2c 20 |size(UWI|N uwin, |
|00006100| 73 74 72 75 63 74 20 75 | 77 70 6f 69 6e 74 20 2a |struct u|wpoint *|
|00006110| 70 70 29 3b 0d 58 2e 44 | 45 0d 58 2e 49 50 20 75 |pp);.X.D|E.X.IP u|
|00006120| 77 5f 67 74 69 74 6c 65 | 0d 58 54 68 69 73 20 66 |w_gtitle|.XThis f|
|00006130| 75 6e 63 74 69 6f 6e 20 | 72 65 74 75 72 6e 73 20 |unction |returns |
|00006140| 74 68 65 20 74 69 74 6c | 65 20 6f 66 20 61 20 73 |the titl|e of a s|
|00006150| 70 65 63 69 66 69 65 64 | 20 77 69 6e 64 6f 77 2e |pecified| window.|
|00006160| 0d 58 54 68 65 20 74 69 | 74 6c 65 20 68 61 73 20 |.XThe ti|tle has |
|00006170| 74 79 70 65 20 60 60 75 | 77 74 69 74 6c 65 5f 74 |type ``u|wtitle_t|
|00006180| 27 27 3a 0d 58 2e 44 53 | 0d 58 74 79 70 65 64 65 |'':.X.DS|.Xtypede|
|00006190| 66 20 63 68 61 72 20 75 | 77 74 69 74 6c 65 5f 74 |f char u|wtitle_t|
|000061a0| 5b 32 35 36 5d 3b 0d 58 | 0d 58 69 6e 74 20 75 77 |[256];.X|.Xint uw|
|000061b0| 5f 67 74 69 74 6c 65 28 | 55 57 49 4e 20 75 77 69 |_gtitle(|UWIN uwi|
|000061c0| 6e 2c 20 75 77 74 69 74 | 6c 65 5f 74 20 74 74 6c |n, uwtit|le_t ttl|
|000061d0| 29 3b 0d 58 2e 44 45 0d | 58 5a 65 72 6f 20 69 73 |);.X.DE.|XZero is|
|000061e0| 20 72 65 74 75 72 6e 65 | 64 20 66 6f 72 20 73 75 | returne|d for su|
|000061f0| 63 63 65 73 73 2c 0d 58 | 77 68 69 6c 65 20 5c 28 |ccess,.X|while \(|
|00006200| 6d 69 31 20 69 73 20 72 | 65 74 75 72 6e 65 64 20 |mi1 is r|eturned |
|00006210| 66 6f 72 20 66 61 69 6c | 75 72 65 2e 0d 58 2e 49 |for fail|ure..X.I|
|00006220| 50 20 75 77 5f 73 74 69 | 74 6c 65 0d 58 54 68 69 |P uw_sti|tle.XThi|
|00006230| 73 20 66 75 6e 63 74 69 | 6f 6e 20 73 65 74 73 20 |s functi|on sets |
|00006240| 74 68 65 20 74 69 74 6c | 65 20 6f 66 20 61 20 73 |the titl|e of a s|
|00006250| 70 65 63 69 66 69 65 64 | 20 77 69 6e 64 6f 77 3a |pecified| window:|
|00006260| 0d 58 2e 44 53 0d 58 69 | 6e 74 20 75 77 5f 73 74 |.X.DS.Xi|nt uw_st|
|00006270| 69 74 6c 65 28 55 57 49 | 4e 20 75 77 69 6e 2c 20 |itle(UWI|N uwin, |
|00006280| 75 77 74 69 74 6c 65 5f | 74 20 74 74 6c 29 3b 0d |uwtitle_|t ttl);.|
|00006290| 58 2e 44 45 0d 58 2e 49 | 50 20 75 77 5f 67 74 79 |X.DE.X.I|P uw_gty|
|000062a0| 70 65 0d 58 54 68 69 73 | 20 66 75 6e 63 74 69 6f |pe.XThis| functio|
|000062b0| 6e 20 72 65 74 75 72 6e | 73 20 74 68 65 20 74 79 |n return|s the ty|
|000062c0| 70 65 20 6f 66 20 61 20 | 73 70 65 63 69 66 69 65 |pe of a |specifie|
|000062d0| 64 20 77 69 6e 64 6f 77 | 3a 0d 58 2e 44 53 0d 58 |d window|:.X.DS.X|
|000062e0| 69 6e 74 20 75 77 5f 67 | 74 79 70 65 28 55 57 49 |int uw_g|type(UWI|
|000062f0| 4e 20 75 77 69 6e 2c 20 | 75 77 74 79 70 65 5f 74 |N uwin, |uwtype_t|
|00006300| 20 2a 74 70 29 3b 0d 58 | 2e 44 45 0d 58 60 60 74 | *tp);.X|.DE.X``t|
|00006310| 70 27 27 20 70 6f 69 6e | 74 73 20 74 6f 20 61 20 |p'' poin|ts to a |
|00006320| 76 61 72 69 61 62 6c 65 | 20 77 68 69 63 68 20 72 |variable| which r|
|00006330| 65 63 65 69 76 65 73 20 | 74 68 65 20 77 69 6e 64 |eceives |the wind|
|00006340| 6f 77 20 74 79 70 65 2e | 0d 58 5a 65 72 6f 20 69 |ow type.|.XZero i|
|00006350| 73 20 72 65 74 75 72 6e | 65 64 20 66 6f 72 20 73 |s return|ed for s|
|00006360| 75 63 63 65 73 73 2c 0d | 58 77 68 69 6c 65 20 5c |uccess,.|Xwhile \|
|00006370| 28 6d 69 31 20 69 73 20 | 72 65 74 75 72 6e 65 64 |(mi1 is |returned|
|00006380| 20 66 6f 72 20 66 61 69 | 6c 75 72 65 2e 0d 58 2e | for fai|lure..X.|
|00006390| 49 50 20 75 77 5f 73 74 | 79 70 65 0d 58 54 68 69 |IP uw_st|ype.XThi|
|000063a0| 73 20 66 75 6e 63 74 69 | 6f 6e 20 73 65 74 73 20 |s functi|on sets |
|000063b0| 74 68 65 20 74 79 70 65 | 20 6f 66 20 61 20 73 70 |the type| of a sp|
|000063c0| 65 63 69 66 69 65 64 20 | 77 69 6e 64 6f 77 3a 0d |ecified |window:.|
|000063d0| 58 2e 44 53 0d 58 69 6e | 74 20 75 77 5f 73 74 79 |X.DS.Xin|t uw_sty|
|000063e0| 70 65 28 55 57 49 4e 20 | 75 77 69 6e 2c 20 75 77 |pe(UWIN |uwin, uw|
|000063f0| 74 79 70 65 5f 74 20 74 | 29 3b 0d 58 2e 44 45 0d |type_t t|);.X.DE.|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.