home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / telex1.sit / Telexƒ / Listen.c < prev    next >
MacBinary  |  1991-05-04  |  8.0 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

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

You can browse this item here: Listen.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sat May 4 04:43:04 1991, modified Sat May 4 04:43:04 1991, creator 'MPS ', type ASCII, 7498 bytes "Listen.c" , at 0x1dca 444 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 4c 69 73 74 65 6e | 2e 63 00 00 00 00 00 00 |..Listen|.c......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|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 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 1d 4a 00 | 00 01 bc a4 48 24 98 a4 |......J.|....H$..|
|00000060| 48 24 98 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |H$......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 96 5d 00 00 |........|.....]..|
|00000080| 09 09 09 09 09 09 09 2f | 2a 20 3d 3d 3d 3d 3d 3d |......./|* ======|
|00000090| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000a0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000b0| 20 2a 5c 0d 09 09 09 09 | 09 09 09 2a 2a 20 3d 3d | *\.....|...** ==|
|000000c0| 20 20 20 20 20 20 20 20 | 20 41 70 70 6c 65 54 61 | | AppleTa|
|000000d0| 6c 6b 20 20 54 65 6c 65 | 74 79 70 65 20 20 20 20 |lk Tele|type |
|000000e0| 20 20 3d 3d 20 2a 2a 0d | 09 09 09 09 09 09 09 2a | == **.|.......*|
|000000f0| 2a 20 3d 3d 20 20 20 20 | 20 20 20 20 20 20 20 20 |* == | |
|00000100| 4c 69 73 74 65 6e 65 72 | 20 63 6f 64 65 20 20 20 |Listener| code |
|00000110| 20 20 20 20 20 20 3d 3d | 20 2a 2a 0d 09 09 09 09 | ==| **.....|
|00000120| 09 09 09 2a 2a 20 3d 3d | 20 20 20 20 20 20 20 20 |...** ==| |
|00000130| 20 20 20 20 20 20 20 28 | 49 4e 49 54 29 20 20 20 | (|INIT) |
|00000140| 20 20 20 20 20 20 20 20 | 20 20 3d 3d 20 2a 2a 0d | | == **.|
|00000150| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2a 2a | | **|
|00000160| 20 3d 3d 20 43 6f 70 79 | 72 69 67 68 74 20 a9 20 | == Copy|right . |
|00000170| 47 61 6d 6d 61 20 53 6f | 66 74 77 61 72 65 2c 20 |Gamma So|ftware, |
|00000180| 31 39 39 30 20 3d 3d 20 | 2a 2a 0d 09 09 09 09 09 |1990 == |**......|
|00000190| 09 09 5c 2a 20 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |..\* ===|========|
|000001a0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000001b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 20 2a 2f 0d 0d |========|=== */..|
|000001c0| 2f 2a 0d 20 54 68 65 20 | 41 70 70 6c 65 54 61 6c |/*. The |AppleTal|
|000001d0| 6b 20 63 79 63 6c 65 3a | 0d 0d 2e 2e 20 2d 3e 20 |k cycle:|.... -> |
|000001e0| 47 65 74 52 65 71 75 65 | 73 74 28 6d 79 53 6f 63 |GetReque|st(mySoc|
|000001f0| 6b 65 74 29 0d 20 20 20 | 20 20 20 20 20 20 20 20 |ket). | |
|00000200| 20 7c 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 7c | |. | ||
|00000210| 20 69 6f 43 6f 6d 70 6c | 65 74 69 6f 6e 0d 20 20 | ioCompl|etion. |
|00000220| 20 20 20 20 20 20 20 20 | 20 20 56 0d 20 20 20 20 | | V. |
|00000230| 20 20 52 65 71 43 6f 6d | 70 6c 65 74 65 64 20 2d | ReqCom|pleted -|
|00000240| 3e 20 49 6e 73 65 72 74 | 4d 65 73 73 61 67 65 20 |> Insert|Message |
|00000250| 2d 3e 20 53 65 6e 64 52 | 65 73 70 6f 6e 73 65 28 |-> SendR|esponse(|
|00000260| 6d 79 53 6f 63 6b 65 74 | 29 0d 20 20 20 20 20 20 |mySocket|). |
|00000270| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000280| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000290| 20 20 20 20 7c 0d 20 20 | 20 20 20 20 20 20 20 20 | |. | |
|000002a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000002b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000002c0| 7c 20 69 6f 43 6f 6d 70 | 6c 65 74 69 6f 6e 0d 20 || ioComp|letion. |
|000002d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000002e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000002f0| 20 20 20 20 20 20 20 20 | 20 56 0d 20 20 20 20 20 | | V. |
|00000300| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000310| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000320| 20 20 52 65 73 70 43 6f | 6d 70 6c 65 74 65 64 20 | RespCo|mpleted |
|00000330| 2d 3e 20 47 65 74 52 65 | 71 75 65 73 74 28 6d 79 |-> GetRe|quest(my|
|00000340| 53 6f 63 6b 65 74 29 0d | 20 0d 20 54 68 65 20 6c |Socket).| . The l|
|00000350| 69 66 65 20 63 79 63 6c | 65 20 6f 66 20 6f 6e 65 |ife cycl|e of one|
|00000360| 20 65 6c 65 6d 65 6e 74 | 3a 0d 0d 20 49 6e 73 65 | element|:.. Inse|
|00000370| 72 74 4d 65 73 73 61 67 | 65 20 2d 3e 20 28 6c 6f |rtMessag|e -> (lo|
|00000380| 6f 6b 20 66 6f 72 20 6e | 6f 74 2d 62 75 73 79 20 |ok for n|ot-busy |
|00000390| 65 6c 65 6d 65 6e 74 29 | 20 2d 3e 0d 20 20 20 20 |element)| ->. |
|000003a0| 20 20 20 20 20 20 20 20 | 20 20 20 2d 3e 20 62 75 | | -> bu|
|000003b0| 73 79 3d 54 52 55 45 20 | 2d 3e 20 4e 4d 49 6e 73 |sy=TRUE |-> NMIns|
|000003c0| 74 61 6c 6c 28 74 68 65 | 45 6c 65 6d 29 0d 20 20 |tall(the|Elem). |
|000003d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000003e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000003f0| 7c 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 ||. | |
|00000400| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000410| 20 20 20 20 7c 20 69 6f | 43 6f 6d 70 6c 65 74 69 | | io|Completi|
|00000420| 6f 6e 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |on. | |
|00000430| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000440| 20 20 20 20 20 56 0d 20 | 20 20 20 20 20 20 20 20 | V. | |
|00000450| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000460| 20 20 20 20 20 20 4e 6f | 74 65 43 6f 6d 70 6c 65 | No|teComple|
|00000470| 74 65 64 20 2d 3e 20 4e | 4d 52 65 6d 6f 76 65 28 |ted -> N|MRemove(|
|00000480| 74 68 65 45 6c 65 6d 29 | 20 2d 3e 20 62 75 73 79 |theElem)| -> busy|
|00000490| 3d 46 41 4c 53 45 0d 20 | 0d 20 20 54 68 65 20 73 |=FALSE. |. The s|
|000004a0| 74 72 75 63 74 75 72 65 | 20 6f 66 20 54 65 6c 65 |tructure| of Tele|
|000004b0| 78 20 6d 65 73 73 61 67 | 65 73 3a 0d 20 20 2b 2d |x messag|es:. +-|
|000004c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000004d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2b 2d 2d 2d 2d |--------|---+----|
|000004e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000004f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2b 0d 20 20 7c 20 54 |--------|-+. | T|
|00000500| 65 6c 65 78 20 74 65 78 | 74 20 28 50 61 73 63 61 |elex tex|t (Pasca|
|00000510| 6c 20 73 74 72 69 6e 67 | 29 20 7c 20 53 65 6e 64 |l string|) | Send|
|00000520| 65 72 20 4e 61 6d 65 20 | 28 50 61 73 63 61 6c 20 |er Name |(Pascal |
|00000530| 53 74 72 69 6e 67 29 20 | 7c 0d 20 20 2b 2d 2d 2d |String) ||. +---|
|00000540| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000550| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2b 2d 2d 2d 2d 2d 2d |--------|-+------|
|00000560| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000570| 2d 2d 2d 2d 2d 2d 2d 2b | 0d 0d 20 2a 2f 0d 0d 0d |-------+|.. */...|
|00000580| 0d 0d 23 69 6e 63 6c 75 | 64 65 20 22 54 65 6c 65 |..#inclu|de "Tele|
|00000590| 78 44 65 66 22 0d 0d 20 | 20 73 74 61 74 69 63 20 |xDef".. | static |
|000005a0| 20 20 20 20 20 20 20 76 | 6f 69 64 20 20 52 65 71 | v|oid Req|
|000005b0| 43 6f 6d 70 6c 65 74 65 | 64 28 76 6f 69 64 29 3b |Complete|d(void);|
|000005c0| 20 20 20 2f 2a 20 41 70 | 70 6c 65 54 61 6c 6b 20 | /* Ap|pleTalk |
|000005d0| 63 79 63 6c 65 3a 20 52 | 65 71 20 20 72 65 63 65 |cycle: R|eq rece|
|000005e0| 69 76 65 64 20 2a 2f 0d | 20 20 73 74 61 74 69 63 |ived */.| static|
|000005f0| 20 20 20 20 20 20 20 20 | 76 6f 69 64 20 20 52 65 | |void Re|
|00000600| 73 70 43 6f 6d 70 6c 65 | 74 65 64 28 76 6f 69 64 |spComple|ted(void|
|00000610| 29 3b 20 20 2f 2a 20 41 | 70 70 6c 65 54 61 6c 6b |); /* A|ppleTalk|
|00000620| 20 63 79 63 6c 65 3a 20 | 52 65 73 70 20 73 65 6e | cycle: |Resp sen|
|00000630| 74 20 20 20 20 20 2a 2f | 0d 0d 20 20 73 74 61 74 |t */|.. stat|
|00000640| 69 63 20 20 20 20 20 20 | 20 20 76 6f 69 64 20 20 |ic | void |
|00000650| 43 68 65 63 6b 28 69 6e | 74 29 3b 20 20 20 20 20 |Check(in|t); |
|00000660| 20 20 20 20 20 20 2f 2a | 20 43 68 65 63 6b 20 4f | /*| Check O|
|00000670| 53 20 72 65 74 75 72 6e | 20 63 6f 64 65 73 20 20 |S return| codes |
|00000680| 20 20 20 20 20 20 20 20 | 2a 2f 0d 0d 20 20 73 74 | |*/.. st|
|00000690| 61 74 69 63 20 20 20 20 | 20 20 20 20 76 6f 69 64 |atic | void|
|000006a0| 20 20 53 74 61 72 74 52 | 65 71 28 53 74 6f 72 61 | StartR|eq(Stora|
|000006b0| 67 65 2a 29 3b 20 20 20 | 2f 2a 20 49 6e 69 74 69 |ge*); |/* Initi|
|000006c0| 61 74 69 6e 67 20 72 6f | 75 74 69 6e 65 20 20 20 |ating ro|utine |
|000006d0| 20 20 20 20 20 20 20 20 | 20 20 2a 2f 0d 0d 20 20 | | */.. |
|000006e0| 73 74 61 74 69 63 20 20 | 20 20 20 20 20 20 73 68 |static | sh|
|000006f0| 6f 72 74 20 49 6e 73 65 | 72 74 4d 65 73 73 61 67 |ort Inse|rtMessag|
|00000700| 65 28 53 74 6f 72 61 67 | 65 2a 29 3b 2f 2a 20 49 |e(Storag|e*);/* I|
|00000710| 6e 73 65 72 74 20 61 20 | 74 65 6c 65 78 20 69 6e |nsert a |telex in|
|00000720| 74 6f 20 4e 4d 20 71 75 | 65 75 65 20 2a 2f 0d 20 |to NM qu|eue */. |
|00000730| 20 73 74 61 74 69 63 20 | 70 61 73 63 61 6c 20 76 | static |pascal v|
|00000740| 6f 69 64 20 20 4e 6f 74 | 65 43 6f 6d 70 6c 65 74 |oid Not|eComplet|
|00000750| 65 64 28 4e 6f 74 65 42 | 75 66 2a 29 3b 2f 2a 20 |ed(NoteB|uf*);/* |
|00000760| 54 65 6c 65 78 20 69 73 | 20 73 68 6f 77 6e 3a 20 |Telex is| shown: |
|00000770| 72 65 6d 6f 76 65 20 69 | 74 20 20 20 20 2a 2f 0d |remove i|t */.|
|00000780| 0d 23 69 66 64 65 66 20 | 54 48 49 4e 4b 5f 43 0d |.#ifdef |THINK_C.|
|00000790| 20 20 20 73 74 61 74 69 | 63 20 76 6f 69 64 2a 20 | stati|c void* |
|000007a0| 20 20 47 65 74 41 30 28 | 76 6f 69 64 29 3b 0d 23 | GetA0(|void);.#|
|000007b0| 20 20 64 65 66 69 6e 65 | 20 53 61 76 65 44 33 28 | define| SaveD3(|
|000007c0| 29 20 20 61 73 6d 7b 5c | 0d 20 20 20 20 20 20 20 |) asm{\|. |
|000007d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 4d | | M|
|000007e0| 4f 56 45 2e 4c 20 44 33 | 2c 2d 28 41 37 29 5c 0d |OVE.L D3|,-(A7)\.|
|000007f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000800| 20 20 20 20 7d 0d 23 20 | 20 64 65 66 69 6e 65 20 | }.# | define |
|00000810| 52 65 73 74 44 33 28 29 | 20 20 61 73 6d 20 7b 5c |RestD3()| asm {\|
|00000820| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00000830| 20 20 20 20 20 20 20 4d | 4f 56 45 2e 4c 20 28 41 | M|OVE.L (A|
|00000840| 37 29 2b 2c 44 33 5c 0d | 20 20 20 20 20 20 20 20 |7)+,D3\.| |
|00000850| 20 20 20 20 20 20 20 20 | 20 20 20 20 7d 0d 23 65 | | }.#e|
|00000860| 6c 73 65 0d 20 20 73 74 | 61 74 69 63 20 76 6f 69 |lse. st|atic voi|
|00000870| 64 2a 20 20 20 20 47 65 | 74 41 30 20 28 76 6f 69 |d* Ge|tA0 (voi|
|00000880| 64 29 20 3d 20 30 78 32 | 30 30 38 3b 20 20 20 2f |d) = 0x2|008; /|
|00000890| 2a 20 4d 4f 56 45 2e 4c | 20 41 30 2c 44 30 20 20 |* MOVE.L| A0,D0 |
|000008a0| 20 20 2a 2f 0d 20 20 73 | 74 61 74 69 63 20 76 6f | */. s|tatic vo|
|000008b0| 69 64 20 20 20 20 20 53 | 61 76 65 44 33 28 76 6f |id S|aveD3(vo|
|000008c0| 69 64 29 20 3d 20 30 78 | 32 46 30 33 3b 20 20 20 |id) = 0x|2F03; |
|000008d0| 2f 2a 20 4d 4f 56 45 2e | 4c 20 44 33 2c 2d 28 41 |/* MOVE.|L D3,-(A|
|000008e0| 37 29 20 2a 2f 0d 20 20 | 73 74 61 74 69 63 20 76 |7) */. |static v|
|000008f0| 6f 69 64 20 20 20 20 20 | 52 65 73 74 44 33 28 76 |oid |RestD3(v|
|00000900| 6f 69 64 29 20 3d 20 30 | 78 32 36 31 46 3b 20 20 |oid) = 0|x261F; |
|00000910| 20 2f 2a 20 4d 4f 56 45 | 2e 4c 20 28 41 37 29 2b | /* MOVE|.L (A7)+|
|00000920| 2c 44 33 20 2a 2f 0d 23 | 65 6e 64 69 66 0d 0d 2f |,D3 */.#|endif../|
|00000930| 2a 0d 20 2a 20 53 74 61 | 72 74 20 6f 66 20 74 68 |*. * Sta|rt of th|
|00000940| 65 20 22 47 65 74 52 65 | 71 75 65 73 74 22 0d 20 |e "GetRe|quest". |
|00000950| 2a 20 54 68 69 73 20 72 | 6f 75 74 69 6e 65 20 4d |* This r|outine M|
|00000960| 55 53 54 20 42 45 20 54 | 48 45 20 46 49 52 53 54 |UST BE T|HE FIRST|
|00000970| 20 69 6e 20 74 68 65 20 | 63 6f 64 65 20 72 65 73 | in the |code res|
|00000980| 6f 75 72 63 65 20 69 66 | 20 4d 50 57 20 69 73 20 |ource if| MPW is |
|00000990| 75 73 65 64 3a 0d 20 2a | 20 69 74 20 69 73 20 73 |used:. *| it is s|
|000009a0| 74 61 72 74 65 64 20 66 | 72 6f 6d 20 74 68 65 20 |tarted f|rom the |
|000009b0| 49 4e 49 54 2d 63 6f 64 | 65 0d 20 2a 20 28 54 68 |INIT-cod|e. * (Th|
|000009c0| 69 6e 6b 20 61 64 64 73 | 20 69 74 73 20 6f 77 6e |ink adds| its own|
|000009d0| 20 73 74 61 72 74 65 72 | 20 63 6f 64 65 20 69 6e | starter| code in|
|000009e0| 74 6f 20 74 68 65 20 72 | 65 73 6f 75 72 63 65 20 |to the r|esource |
|000009f0| 68 65 61 64 65 72 29 0d | 20 2a 2f 0d 76 6f 69 64 |header).| */.void|
|00000a00| 20 6d 61 69 6e 28 53 74 | 6f 72 61 67 65 2a 20 74 | main(St|orage* t|
|00000a10| 68 65 44 61 74 61 29 20 | 7b 0d 20 20 53 74 61 72 |heData) |{. Star|
|00000a20| 74 52 65 71 28 74 68 65 | 44 61 74 61 29 3b 0d 7d |tReq(the|Data);.}|
|00000a30| 0d 0d 2f 2a 0d 20 2a 20 | 54 68 65 20 72 6f 75 74 |../*. * |The rout|
|00000a40| 69 6e 65 20 73 74 61 72 | 74 73 20 74 68 65 20 47 |ine star|ts the G|
|00000a50| 65 74 52 65 71 75 65 73 | 74 20 63 61 6c 6c 2e 0d |etReques|t call..|
|00000a60| 20 2a 20 49 74 27 73 20 | 63 61 6c 6c 65 64 20 66 | * It's |called f|
|00000a70| 72 6f 6d 20 74 68 65 20 | 49 6e 69 74 20 61 74 20 |rom the |Init at |
|00000a80| 73 74 61 72 74 75 70 20 | 74 69 6d 65 20 61 6e 64 |startup |time and|
|00000a90| 20 61 66 74 65 72 20 53 | 65 6e 64 52 65 73 70 6f | after S|endRespo|
|00000aa0| 6e 73 65 20 63 61 6c 6c | 0d 20 2a 20 52 65 71 75 |nse call|. * Requ|
|00000ab0| 65 73 74 73 20 61 72 65 | 20 72 65 63 65 69 76 65 |ests are| receive|
|00000ac0| 64 20 69 6e 74 6f 20 74 | 68 65 20 62 75 66 66 65 |d into t|he buffe|
|00000ad0| 72 20 69 6e 20 74 68 65 | 20 53 74 6f 72 61 67 65 |r in the| Storage|
|00000ae0| 20 73 74 72 75 63 74 75 | 72 65 0d 20 2a 2f 0d 76 | structu|re. */.v|
|00000af0| 6f 69 64 20 53 74 61 72 | 74 52 65 71 28 53 74 6f |oid Star|tReq(Sto|
|00000b00| 72 61 67 65 2a 20 74 68 | 65 44 61 74 61 29 20 7b |rage* th|eData) {|
|00000b10| 0d 09 74 68 65 44 61 74 | 61 2d 3e 52 65 71 42 6c |..theDat|a->ReqBl|
|00000b20| 6f 63 6b 2e 41 54 50 69 | 6f 43 6f 6d 70 6c 65 74 |ock.ATPi|oComplet|
|00000b30| 69 6f 6e 20 20 3d 20 28 | 50 72 6f 63 50 74 72 29 |ion = (|ProcPtr)|
|00000b40| 20 52 65 71 43 6f 6d 70 | 6c 65 74 65 64 3b 0d 09 | ReqComp|leted;..|
|00000b50| 74 68 65 44 61 74 61 2d | 3e 52 65 71 42 6c 6f 63 |theData-|>ReqBloc|
|00000b60| 6b 2e 41 54 50 63 73 43 | 6f 64 65 20 20 20 20 09 |k.ATPcsC|ode .|
|00000b70| 09 20 3d 20 74 41 54 50 | 47 65 74 52 65 71 75 65 |. = tATP|GetReque|
|00000b80| 73 74 3b 0d 09 74 68 65 | 44 61 74 61 2d 3e 52 65 |st;..the|Data->Re|
|00000b90| 71 42 6c 6f 63 6b 2e 41 | 54 50 61 74 70 53 6f 63 |qBlock.A|TPatpSoc|
|00000ba0| 6b 65 74 20 20 09 20 3d | 20 74 68 65 44 61 74 61 |ket . =| theData|
|00000bb0| 2d 3e 52 65 71 53 6f 63 | 6b 65 74 3b 0d 09 74 68 |->ReqSoc|ket;..th|
|00000bc0| 65 44 61 74 61 2d 3e 52 | 65 71 42 6c 6f 63 6b 2e |eData->R|eqBlock.|
|00000bd0| 41 54 50 72 65 71 50 6f | 69 6e 74 65 72 20 20 09 |ATPreqPo|inter .|
|00000be0| 20 3d 20 74 68 65 44 61 | 74 61 2d 3e 52 65 71 42 | = theDa|ta->ReqB|
|00000bf0| 75 66 66 3b 0d 09 74 68 | 65 44 61 74 61 2d 3e 52 |uff;..th|eData->R|
|00000c00| 65 71 42 6c 6f 63 6b 2e | 41 54 50 72 65 71 4c 65 |eqBlock.|ATPreqLe|
|00000c10| 6e 67 74 68 20 20 20 09 | 20 3d 20 73 69 7a 65 6f |ngth .| = sizeo|
|00000c20| 66 28 74 68 65 44 61 74 | 61 2d 3e 52 65 71 42 75 |f(theDat|a->ReqBu|
|00000c30| 66 66 29 3b 0d 0d 09 43 | 68 65 63 6b 28 50 47 65 |ff);...C|heck(PGe|
|00000c40| 74 52 65 71 75 65 73 74 | 28 26 74 68 65 44 61 74 |tRequest|(&theDat|
|00000c50| 61 2d 3e 52 65 71 42 6c | 6f 63 6b 2c 54 52 55 45 |a->ReqBl|ock,TRUE|
|00000c60| 29 29 3b 20 2f 2a 20 73 | 74 61 72 74 20 61 73 79 |)); /* s|tart asy|
|00000c70| 6e 63 20 47 65 74 52 65 | 71 75 65 73 74 20 20 20 |nc GetRe|quest |
|00000c80| 20 20 20 2a 2f 0d 7d 0d | 0d 2f 2a 0d 20 2a 20 45 | */.}.|./*. * E|
|00000c90| 6e 64 20 6f 66 20 74 68 | 65 20 22 47 65 74 52 65 |nd of th|e "GetRe|
|00000ca0| 71 75 65 73 74 22 20 6f | 70 65 72 61 74 69 6f 6e |quest" o|peration|
|00000cb0| 3a 0d 20 2a 20 69 6e 73 | 65 72 74 20 6d 65 73 73 |:. * ins|ert mess|
|00000cc0| 61 67 65 20 69 6e 20 22 | 4e 6f 74 69 66 69 63 61 |age in "|Notifica|
|00000cd0| 74 69 6f 6e 22 20 71 75 | 65 75 65 2c 20 73 74 61 |tion" qu|eue, sta|
|00000ce0| 72 74 20 22 52 65 73 70 | 6f 6e 73 65 22 0d 20 2a |rt "Resp|onse". *|
|00000cf0| 2f 0d 73 74 61 74 69 63 | 20 76 6f 69 64 20 52 65 |/.static| void Re|
|00000d00| 71 43 6f 6d 70 6c 65 74 | 65 64 28 29 20 7b 0d 20 |qComplet|ed() {. |
|00000d10| 20 53 74 6f 72 61 67 65 | 2a 20 74 68 65 44 61 74 | Storage|* theDat|
|00000d20| 61 3b 0d 20 20 53 61 76 | 65 44 33 28 29 3b 20 20 |a;. Sav|eD3(); |
|00000d30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000d40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000d50| 2f 2a 20 73 6f 6d 65 20 | 63 6f 6d 70 69 6c 65 72 |/* some |compiler|
|00000d60| 73 20 64 6f 6e 27 74 20 | 73 61 76 65 20 69 74 20 |s don't |save it |
|00000d70| 20 2a 2f 0d 20 20 74 68 | 65 44 61 74 61 20 3d 20 | */. th|eData = |
|00000d80| 20 28 53 74 6f 72 61 67 | 65 2a 29 47 65 74 41 30 | (Storag|e*)GetA0|
|00000d90| 28 29 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |(); | |
|00000da0| 20 2f 2a 20 41 30 20 3d | 20 41 54 62 6c 6f 63 6b | /* A0 =| ATblock|
|00000db0| 20 61 64 64 72 65 73 73 | 20 3d 20 53 74 6f 72 61 | address| = Stora|
|00000dc0| 67 65 2a 2f 0d 09 0d 09 | 69 66 28 74 68 65 44 61 |ge*/....|if(theDa|
|00000dd0| 74 61 2d 3e 52 65 71 42 | 6c 6f 63 6b 2e 41 54 50 |ta->ReqB|lock.ATP|
|00000de0| 69 6f 52 65 73 75 6c 74 | 20 3d 3d 20 30 29 20 7b |ioResult| == 0) {|
|00000df0| 20 20 20 2f 2a 20 77 65 | 20 72 65 63 65 69 76 65 | /* we| receive|
|00000e00| 64 20 61 20 6e 69 63 65 | 20 72 65 71 75 65 73 74 |d a nice| request|
|00000e10| 20 20 20 20 2a 2f 0d 20 | 20 20 20 74 68 65 44 61 | */. | theDa|
|00000e20| 74 61 2d 3e 52 65 71 42 | 6c 6f 63 6b 2e 41 54 50 |ta->ReqB|lock.ATP|
|00000e30| 69 6f 52 65 73 75 6c 74 | 20 20 20 20 20 20 3d 20 |ioResult| = |
|00000e40| 32 3b 20 20 2f 2a 20 6d | 61 72 6b 20 74 68 65 20 |2; /* m|ark the |
|00000e50| 72 65 63 76 20 62 6c 6f | 63 6b 20 61 73 20 22 66 |recv blo|ck as "f|
|00000e60| 72 65 65 22 20 2a 2f 0d | 09 09 74 68 65 44 61 74 |ree" */.|..theDat|
|00000e70| 61 2d 3e 52 65 73 70 57 | 6f 72 64 3d 49 6e 73 65 |a->RespW|ord=Inse|
|00000e80| 72 74 4d 65 73 73 61 67 | 65 28 74 68 65 44 61 74 |rtMessag|e(theDat|
|00000e90| 61 29 3b 2f 2a 20 69 6e | 73 65 72 74 20 72 65 63 |a);/* in|sert rec|
|00000ea0| 65 69 76 65 64 20 74 65 | 6c 65 78 20 69 6e 74 6f |eived te|lex into|
|00000eb0| 20 4e 4d 20 2a 2f 0d 0d | 20 20 20 20 2f 2a 20 6e | NM */..| /* n|
|00000ec0| 6f 77 20 70 72 65 70 61 | 72 65 20 64 61 74 61 20 |ow prepa|re data |
|00000ed0| 66 6f 72 20 74 68 65 20 | 52 65 73 70 6f 6e 73 65 |for the |Response|
|00000ee0| 20 2a 2f 0d 20 20 20 20 | 74 68 65 44 61 74 61 2d | */. |theData-|
|00000ef0| 3e 42 44 53 41 72 72 61 | 79 5b 30 5d 2e 62 75 66 |>BDSArra|y[0].buf|
|00000f00| 66 53 69 7a 65 20 3d 20 | 73 69 7a 65 6f 66 28 74 |fSize = |sizeof(t|
|00000f10| 68 65 44 61 74 61 2d 3e | 52 65 73 70 57 6f 72 64 |heData->|RespWord|
|00000f20| 29 3b 0d 20 20 09 74 68 | 65 44 61 74 61 2d 3e 42 |);. .th|eData->B|
|00000f30| 44 53 41 72 72 61 79 5b | 30 5d 2e 62 75 66 66 50 |DSArray[|0].buffP|
|00000f40| 74 72 20 20 3d 20 28 50 | 74 72 29 20 26 74 68 65 |tr = (P|tr) &the|
|00000f50| 44 61 74 61 2d 3e 52 65 | 73 70 57 6f 72 64 3b 0d |Data->Re|spWord;.|
|00000f60| 0d 09 20 20 74 68 65 44 | 61 74 61 2d 3e 52 65 73 |.. theD|ata->Res|
|00000f70| 70 42 6c 6f 63 6b 2e 41 | 54 50 69 6f 43 6f 6d 70 |pBlock.A|TPioComp|
|00000f80| 6c 65 74 69 6f 6e 20 3d | 20 28 50 72 6f 63 50 74 |letion =| (ProcPt|
|00000f90| 72 29 52 65 73 70 43 6f | 6d 70 6c 65 74 65 64 3b |r)RespCo|mpleted;|
|00000fa0| 0d 09 20 20 74 68 65 44 | 61 74 61 2d 3e 52 65 73 |.. theD|ata->Res|
|00000fb0| 70 42 6c 6f 63 6b 2e 41 | 54 50 61 74 70 53 6f 63 |pBlock.A|TPatpSoc|
|00000fc0| 6b 65 74 20 20 09 20 3d | 20 74 68 65 44 61 74 61 |ket . =| theData|
|00000fd0| 2d 3e 52 65 71 53 6f 63 | 6b 65 74 3b 0d 09 09 74 |->ReqSoc|ket;...t|
|00000fe0| 68 65 44 61 74 61 2d 3e | 52 65 73 70 42 6c 6f 63 |heData->|RespBloc|
|00000ff0| 6b 2e 41 54 50 63 73 43 | 6f 64 65 20 20 20 20 09 |k.ATPcsC|ode .|
|00001000| 20 3d 20 74 41 54 50 53 | 64 52 73 70 3b 0d 09 09 | = tATPS|dRsp;...|
|00001010| 74 68 65 44 61 74 61 2d | 3e 52 65 73 70 42 6c 6f |theData-|>RespBlo|
|00001020| 63 6b 2e 41 54 50 61 74 | 70 46 6c 61 67 73 20 20 |ck.ATPat|pFlags |
|00001030| 20 20 20 3d 20 61 74 70 | 58 4f 76 61 6c 75 65 3b | = atp|XOvalue;|
|00001040| 0d 09 09 74 68 65 44 61 | 74 61 2d 3e 52 65 73 70 |...theDa|ta->Resp|
|00001050| 42 6c 6f 63 6b 2e 41 54 | 50 61 64 64 72 42 6c 6f |Block.AT|PaddrBlo|
|00001060| 63 6b 20 20 20 20 3d 20 | 74 68 65 44 61 74 61 2d |ck = |theData-|
|00001070| 3e 52 65 71 42 6c 6f 63 | 6b 2e 41 54 50 61 64 64 |>ReqBloc|k.ATPadd|
|00001080| 72 42 6c 6f 63 6b 3b 0d | 09 09 74 68 65 44 61 74 |rBlock;.|..theDat|
|00001090| 61 2d 3e 52 65 73 70 42 | 6c 6f 63 6b 2e 41 54 50 |a->RespB|lock.ATP|
|000010a0| 62 64 73 50 6f 69 6e 74 | 65 72 20 20 20 3d 20 28 |bdsPoint|er = (|
|000010b0| 50 74 72 29 20 74 68 65 | 44 61 74 61 2d 3e 42 44 |Ptr) the|Data->BD|
|000010c0| 53 41 72 72 61 79 3b 0d | 09 09 74 68 65 44 61 74 |SArray;.|..theDat|
|000010d0| 61 2d 3e 52 65 73 70 42 | 6c 6f 63 6b 2e 41 54 50 |a->RespB|lock.ATP|
|000010e0| 6e 75 6d 4f 66 42 75 66 | 66 73 20 20 20 3d 20 31 |numOfBuf|fs = 1|
|000010f0| 3b 0d 09 09 74 68 65 44 | 61 74 61 2d 3e 52 65 73 |;...theD|ata->Res|
|00001100| 70 42 6c 6f 63 6b 2e 41 | 54 50 62 64 73 53 69 7a |pBlock.A|TPbdsSiz|
|00001110| 65 20 20 20 20 09 20 3d | 20 31 3b 0d 09 09 74 68 |e . =| 1;...th|
|00001120| 65 44 61 74 61 2d 3e 52 | 65 73 70 42 6c 6f 63 6b |eData->R|espBlock|
|00001130| 2e 41 54 50 74 72 61 6e | 73 49 44 20 20 20 20 20 |.ATPtran|sID |
|00001140| 20 3d 20 74 68 65 44 61 | 74 61 2d 3e 52 65 71 42 | = theDa|ta->ReqB|
|00001150| 6c 6f 63 6b 2e 41 54 50 | 74 72 61 6e 73 49 44 3b |lock.ATP|transID;|
|00001160| 0d 0d 09 20 20 43 68 65 | 63 6b 28 50 53 65 6e 64 |... Che|ck(PSend|
|00001170| 52 65 73 70 6f 6e 73 65 | 28 26 74 68 65 44 61 74 |Response|(&theDat|
|00001180| 61 2d 3e 52 65 73 70 42 | 6c 6f 63 6b 2c 54 52 55 |a->RespB|lock,TRU|
|00001190| 45 29 29 3b 20 2f 2a 20 | 73 74 61 72 74 20 61 73 |E)); /* |start as|
|000011a0| 79 6e 63 20 52 65 73 70 | 6f 6e 73 65 20 20 20 2a |ync Resp|onse *|
|000011b0| 2f 0d 0d 09 7d 20 65 6c | 73 65 20 7b 20 20 20 20 |/...} el|se { |
|000011c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000011d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|000011e0| 2a 20 47 65 74 52 65 71 | 75 65 73 74 20 6f 70 65 |* GetReq|uest ope|
|000011f0| 72 61 74 69 6f 6e 20 66 | 61 69 6c 65 64 20 20 20 |ration f|ailed |
|00001200| 2a 2f 0d 09 20 20 53 74 | 61 72 74 52 65 71 28 74 |*/.. St|artReq(t|
|00001210| 68 65 44 61 74 61 29 3b | 20 20 20 20 20 20 20 20 |heData);| |
|00001220| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00001230| 2a 20 2d 3e 20 72 65 73 | 74 61 72 74 20 74 68 65 |* -> res|tart the|
|00001240| 20 47 65 74 52 65 71 75 | 65 73 74 20 20 20 20 20 | GetRequ|est |
|00001250| 2a 2f 0d 09 7d 0d 0d 09 | 52 65 73 74 44 33 28 29 |*/..}...|RestD3()|
|00001260| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|00001270| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001280| 20 20 20 2f 2a 20 73 69 | 6e 63 65 20 6e 6f 74 20 | /* si|nce not |
|00001290| 61 6c 6c 20 63 6f 6d 70 | 69 6c 65 72 73 20 64 6f |all comp|ilers do|
|000012a0| 20 69 74 20 2a 2f 0d 7d | 0d 0d 2f 2a 0d 20 2a 20 | it */.}|../*. * |
|000012b0| 43 6f 6d 70 6c 65 74 69 | 6f 6e 20 6f 66 20 74 68 |Completi|on of th|
|000012c0| 65 20 22 52 65 73 70 6f | 6e 73 65 22 20 6f 70 65 |e "Respo|nse" ope|
|000012d0| 72 61 74 69 6f 6e 3a 0d | 20 2a 20 73 74 61 72 74 |ration:.| * start|
|000012e0| 20 6e 65 78 74 20 22 47 | 65 74 52 65 71 75 65 73 | next "G|etReques|
|000012f0| 74 22 20 6f 70 65 72 61 | 74 69 6f 6e 0d 20 2a 2f |t" opera|tion. */|
|00001300| 0d 73 74 61 74 69 63 20 | 76 6f 69 64 20 52 65 73 |.static |void Res|
|00001310| 70 43 6f 6d 70 6c 65 74 | 65 64 28 29 20 7b 0d 20 |pComplet|ed() {. |
|00001320| 20 53 74 6f 72 61 67 65 | 2a 20 74 68 65 44 61 74 | Storage|* theDat|
|00001330| 61 3b 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |a; | |
|00001340| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 41 | | /* A|
|00001350| 30 20 3d 20 61 64 64 72 | 20 6f 66 20 72 65 73 70 |0 = addr| of resp|
|00001360| 42 6c 6f 63 6b 20 20 20 | 20 20 20 20 20 2a 2f 0d |Block | */.|
|00001370| 20 20 53 61 76 65 44 33 | 28 29 3b 20 20 20 20 20 | SaveD3|(); |
|00001380| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001390| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | | /* |
|000013a0| 61 67 61 69 6e 2c 20 73 | 61 76 65 20 44 33 20 72 |again, s|ave D3 r|
|000013b0| 65 67 20 20 20 20 20 20 | 20 20 20 20 20 20 2a 2f |eg | */|
|000013c0| 0d 09 74 68 65 44 61 74 | 61 20 3d 20 28 53 74 6f |..theDat|a = (Sto|
|000013d0| 72 61 67 65 2a 29 28 28 | 63 68 61 72 2a 29 47 65 |rage*)((|char*)Ge|
|000013e0| 74 41 30 28 29 2d 73 69 | 7a 65 6f 66 28 41 54 50 |tA0()-si|zeof(ATP|
|000013f0| 50 61 72 61 6d 42 6c 6f | 63 6b 29 29 3b 0d 09 0d |ParamBlo|ck));...|
|00001400| 09 74 68 65 44 61 74 61 | 2d 3e 52 65 73 70 42 6c |.theData|->RespBl|
|00001410| 6f 63 6b 2e 41 54 50 69 | 6f 52 65 73 75 6c 74 20 |ock.ATPi|oResult |
|00001420| 3d 20 32 3b 20 20 20 20 | 20 20 20 20 2f 2a 20 72 |= 2; | /* r|
|00001430| 65 73 70 6f 6e 73 65 20 | 62 6c 6f 63 6b 20 69 73 |esponse |block is|
|00001440| 20 66 72 65 65 20 20 20 | 20 20 20 20 20 2a 2f 0d | free | */.|
|00001450| 09 53 74 61 72 74 52 65 | 71 28 74 68 65 44 61 74 |.StartRe|q(theDat|
|00001460| 61 29 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |a); | |
|00001470| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 73 | | /* s|
|00001480| 74 61 72 74 20 6e 65 77 | 20 47 65 74 52 65 71 75 |tart new| GetRequ|
|00001490| 65 73 74 20 20 20 20 20 | 20 20 20 20 20 2a 2f 0d |est | */.|
|000014a0| 09 52 65 73 74 44 33 28 | 29 3b 20 20 20 20 20 20 |.RestD3(|); |
|000014b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000014c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 61 | | /* a|
|000014d0| 67 61 69 6e 2c 20 72 65 | 73 74 6f 72 65 20 44 33 |gain, re|store D3|
|000014e0| 20 72 65 67 20 20 20 20 | 20 20 20 20 20 2a 2f 0d | reg | */.|
|000014f0| 7d 0d 0d 0d 2f 2a 0d 20 | 2a 20 49 6e 73 65 72 74 |}.../*. |* Insert|
|00001500| 20 74 68 65 20 74 65 6c | 65 78 20 6d 65 73 73 61 | the tel|ex messa|
|00001510| 67 65 20 72 65 63 65 69 | 76 65 64 20 69 6e 74 6f |ge recei|ved into|
|00001520| 20 74 68 65 20 22 4e 6f | 74 69 66 69 63 61 74 69 | the "No|tificati|
|00001530| 6f 6e 22 20 71 75 65 75 | 65 0d 20 2a 2f 0d 73 74 |on" queu|e. */.st|
|00001540| 61 74 69 63 20 73 68 6f | 72 74 20 49 6e 73 65 72 |atic sho|rt Inser|
|00001550| 74 4d 65 73 73 61 67 65 | 28 53 74 6f 72 61 67 65 |tMessage|(Storage|
|00001560| 2a 20 74 68 65 44 61 74 | 61 29 20 7b 0d 20 20 73 |* theDat|a) {. s|
|00001570| 68 6f 72 74 20 69 20 20 | 20 20 20 3d 20 20 4e 6e |hort i | = Nn|
|00001580| 6f 74 65 73 3b 0d 09 73 | 68 6f 72 74 20 65 72 72 |otes;..s|hort err|
|00001590| 6f 72 20 3d 20 2d 31 3b | 0d 09 0d 09 2f 2a 20 4c |or = -1;|..../* L|
|000015a0| 6f 6f 6b 20 66 6f 72 20 | 22 46 72 65 65 22 20 65 |ook for |"Free" e|
|000015b0| 6c 65 6d 65 6e 74 20 61 | 6d 6f 6e 67 20 4e 6f 74 |lement a|mong Not|
|000015c0| 65 42 6c 6f 63 6b 73 2a | 2f 0d 09 77 68 69 6c 65 |eBlocks*|/..while|
|000015d0| 28 2d 2d 69 3e 3d 30 20 | 26 26 20 74 68 65 44 61 |(--i>=0 |&& theDa|
|000015e0| 74 61 2d 3e 4e 6f 74 65 | 42 6c 6f 63 6b 73 5b 69 |ta->Note|Blocks[i|
|000015f0| 5d 2e 62 75 73 79 29 3b | 0d 0d 09 69 66 28 69 3e |].busy);|...if(i>|
|00001600| 3d 30 29 20 7b 09 09 09 | 09 09 09 09 09 09 09 09 |=0) {...|........|
|00001610| 09 09 09 20 20 20 20 20 | 2f 2a 20 22 66 72 65 65 |... |/* "free|
|00001620| 22 20 65 6c 65 6d 65 6e | 74 20 66 6f 75 6e 64 20 |" elemen|t found |
|00001630| 20 20 20 20 20 20 20 20 | 20 2a 2f 0d 09 20 20 4e | | */.. N|
|00001640| 6f 74 65 42 75 66 2a 20 | 74 68 65 4e 6f 74 65 20 |oteBuf* |theNote |
|00001650| 3d 20 26 74 68 65 44 61 | 74 61 2d 3e 4e 6f 74 65 |= &theDa|ta->Note|
|00001660| 42 6c 6f 63 6b 73 5b 69 | 5d 3b 0d 09 20 20 75 6e |Blocks[i|];.. un|
|00001670| 63 68 61 72 2a 20 20 74 | 68 65 4d 65 73 73 20 3d |char* t|heMess =|
|00001680| 20 20 74 68 65 4e 6f 74 | 65 2d 3e 6d 65 73 73 3b | theNot|e->mess;|
|00001690| 0d 09 09 75 6e 63 68 61 | 72 2a 20 20 74 68 65 42 |...uncha|r* theB|
|000016a0| 6f 64 79 20 3d 20 28 75 | 6e 63 68 61 72 2a 29 74 |ody = (u|nchar*)t|
|000016b0| 68 65 44 61 74 61 2d 3e | 52 65 71 42 75 66 66 3b |heData->|ReqBuff;|
|000016c0| 0d 09 09 75 6e 63 68 61 | 72 2a 20 20 74 68 65 55 |...uncha|r* theU|
|000016d0| 73 65 72 20 3d 20 74 68 | 65 42 6f 64 79 2b 20 2a |ser = th|eBody+ *|
|000016e0| 74 68 65 42 6f 64 79 20 | 2b 31 3b 20 2f 2a 20 61 |theBody |+1; /* a|
|000016f0| 64 64 72 65 73 73 20 6f | 66 20 74 68 65 20 53 65 |ddress o|f the Se|
|00001700| 6e 64 65 72 20 6e 61 6d | 65 20 20 20 20 2a 2f 0d |nder nam|e */.|
|00001710| 09 20 20 69 6e 74 20 20 | 20 20 20 20 73 68 69 66 |. int | shif|
|00001720| 74 20 3d 20 31 3b 0d 09 | 09 69 6e 74 20 20 20 20 |t = 1;..|.int |
|00001730| 20 20 6a 20 20 20 20 20 | 3d 20 30 3b 0d 09 0d 09 | j |= 0;....|
|00001740| 20 20 2f 2a 20 43 6f 70 | 79 20 54 65 6c 65 78 20 | /* Cop|y Telex |
|00001750| 48 65 61 64 65 72 20 66 | 72 6f 6d 20 74 68 65 20 |Header f|rom the |
|00001760| 53 74 6f 72 61 67 65 20 | 69 6e 74 6f 20 74 68 65 |Storage |into the|
|00001770| 20 45 6c 65 6d 65 6e 74 | 20 2a 2f 0d 09 09 77 68 | Element| */...wh|
|00001780| 69 6c 65 28 73 68 69 66 | 74 3c 4d 61 78 4d 65 73 |ile(shif|t<MaxMes|
|00001790| 73 53 69 7a 65 2d 31 20 | 26 26 20 6a 20 3c 20 2a |sSize-1 |&& j < *|
|000017a0| 74 68 65 44 61 74 61 2d | 3e 4d 65 73 73 48 65 61 |theData-|>MessHea|
|000017b0| 64 65 72 29 20 7b 0d 09 | 09 20 20 74 68 65 4d 65 |der) {..|. theMe|
|000017c0| 73 73 5b 73 68 69 66 74 | 2b 2b 5d 20 3d 20 74 68 |ss[shift|++] = th|
|000017d0| 65 44 61 74 61 2d 3e 4d | 65 73 73 48 65 61 64 65 |eData->M|essHeade|
|000017e0| 72 5b 2b 2b 6a 5d 3b 0d | 09 09 7d 0d 09 09 74 68 |r[++j];.|..}...th|
|000017f0| 65 4d 65 73 73 5b 73 68 | 69 66 74 2b 2b 5d 20 3d |eMess[sh|ift++] =|
|00001800| 20 27 20 27 3b 20 20 20 | 20 20 20 20 20 20 20 20 | ' '; | |
|00001810| 20 20 20 20 20 20 2f 2a | 20 61 20 73 70 61 63 65 | /*| a space|
|00001820| 20 61 66 74 65 72 20 74 | 68 65 20 68 65 61 64 65 | after t|he heade|
|00001830| 72 20 20 20 20 20 20 20 | 2a 2f 0d 0d 20 20 20 20 |r |*/.. |
|00001840| 2f 2a 20 43 6f 70 79 20 | 55 73 65 72 20 4e 61 6d |/* Copy |User Nam|
|00001850| 65 20 66 72 6f 6d 20 74 | 68 65 20 6d 65 73 73 61 |e from t|he messa|
|00001860| 67 65 20 69 6e 74 6f 20 | 74 68 65 20 45 6c 65 6d |ge into |the Elem|
|00001870| 65 6e 74 2a 2f 0d 09 09 | 6a 20 3d 20 30 3b 0d 09 |ent*/...|j = 0;..|
|00001880| 20 20 69 66 28 74 68 65 | 55 73 65 72 20 2b 20 2a | if(the|User + *|
|00001890| 74 68 65 55 73 65 72 20 | 3c 20 74 68 65 42 6f 64 |theUser |< theBod|
|000018a0| 79 2b 74 68 65 44 61 74 | 61 2d 3e 52 65 71 42 6c |y+theDat|a->ReqBl|
|000018b0| 6f 63 6b 2e 41 54 50 72 | 65 71 4c 65 6e 67 74 68 |ock.ATPr|eqLength|
|000018c0| 29 20 7b 0d 09 09 20 20 | 77 68 69 6c 65 28 73 68 |) {... |while(sh|
|000018d0| 69 66 74 3c 4d 61 78 4d | 65 73 73 53 69 7a 65 20 |ift<MaxM|essSize |
|000018e0| 26 26 20 6a 20 3c 20 2a | 74 68 65 55 73 65 72 29 |&& j < *|theUser)|
|000018f0| 20 7b 0d 09 09 20 20 20 | 20 74 68 65 4d 65 73 73 | {... | theMess|
|00001900| 5b 73 68 69 66 74 2b 2b | 5d 20 3d 20 74 68 65 55 |[shift++|] = theU|
|00001910| 73 65 72 5b 2b 2b 6a 5d | 3b 0d 09 09 20 20 7d 20 |ser[++j]|;... } |
|00001920| 20 20 0d 09 09 7d 0d 0d | 20 20 20 20 2f 2a 20 57 | ...}..| /* W|
|00001930| 72 69 74 65 20 74 68 65 | 20 73 65 70 61 72 61 74 |rite the| separat|
|00001940| 6f 72 20 2a 2f 0d 09 09 | 69 66 28 73 68 69 66 74 |or */...|if(shift|
|00001950| 3c 4d 61 78 4d 65 73 73 | 53 69 7a 65 2d 32 29 20 |<MaxMess|Size-2) |
|00001960| 7b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f |{ | /|
|00001970| 2a 20 69 66 20 74 68 65 | 72 65 20 69 73 20 65 6e |* if the|re is en|
|00001980| 6f 75 67 68 20 73 70 61 | 63 65 2c 20 64 72 61 77 |ough spa|ce, draw|
|00001990| 20 20 2a 2f 0d 09 20 20 | 09 74 68 65 4d 65 73 73 | */.. |.theMess|
|000019a0| 5b 73 68 69 66 74 2b 2b | 5d 20 3d 20 27 3a 27 3b |[shift++|] = ':';|
|000019b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|000019c0| 20 74 68 65 20 73 65 70 | 61 72 61 74 6f 72 3a 74 | the sep|arator:t|
|000019d0| 68 65 20 73 65 6d 69 63 | 6f 6c 6f 6e 20 73 69 67 |he semic|olon sig|
|000019e0| 6e 2a 2f 0d 20 20 09 09 | 74 68 65 4d 65 73 73 5b |n*/. ..|theMess[|
|000019f0| 73 68 69 66 74 2b 2b 5d | 20 3d 20 30 78 30 44 3b |shift++]| = 0x0D;|
|00001a00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | | /* |
|00001a10| 61 6e 64 20 74 68 65 20 | 52 65 74 75 72 6e 20 28 |and the |Return (|
|00001a20| 4e 65 77 20 4c 69 6e 65 | 29 20 73 69 67 6e 20 20 |New Line|) sign |
|00001a30| 2a 2f 0d 20 20 20 20 7d | 0d 0d 20 20 20 20 2f 2a |*/. }|.. /*|
|00001a40| 20 43 6f 70 79 20 54 65 | 6c 65 78 20 62 6f 64 79 | Copy Te|lex body|
|00001a50| 20 20 66 72 6f 6d 20 74 | 68 65 20 4d 65 73 73 61 | from t|he Messa|
|00001a60| 67 65 20 62 75 66 66 65 | 72 20 69 6e 74 6f 20 74 |ge buffe|r into t|
|00001a70| 68 65 20 45 6c 65 6d 65 | 6e 74 20 2a 2f 0d 20 20 |he Eleme|nt */. |
|00001a80| 20 20 6a 3d 30 3b 0d 09 | 09 77 68 69 6c 65 28 73 | j=0;..|.while(s|
|00001a90| 68 69 66 74 3c 4d 61 78 | 4d 65 73 73 53 69 7a 65 |hift<Max|MessSize|
|00001aa0| 20 26 26 20 6a 3c 2a 74 | 68 65 42 6f 64 79 29 20 | && j<*t|heBody) |
|00001ab0| 7b 0d 09 09 20 20 74 68 | 65 4d 65 73 73 5b 73 68 |{... th|eMess[sh|
|00001ac0| 69 66 74 2b 2b 5d 20 3d | 20 74 68 65 42 6f 64 79 |ift++] =| theBody|
|00001ad0| 5b 2b 2b 6a 5d 3b 0d 09 | 09 7d 0d 0d 09 09 2a 74 |[++j];..|.}....*t|
|00001ae0| 68 65 4d 65 73 73 20 3d | 20 28 75 6e 63 68 61 72 |heMess =| (unchar|
|00001af0| 29 20 28 73 68 69 66 74 | 2d 31 29 3b 20 20 20 20 |) (shift|-1); |
|00001b00| 20 20 20 20 2f 2a 20 73 | 74 6f 72 65 20 74 68 65 | /* s|tore the|
|00001b10| 20 6f 75 74 70 75 74 20 | 73 74 72 69 6e 67 20 6c | output |string l|
|00001b20| 65 6e 67 74 68 20 20 20 | 2a 2f 0d 0d 09 09 74 68 |ength |*/....th|
|00001b30| 65 4e 6f 74 65 2d 3e 62 | 75 73 79 20 20 20 20 20 |eNote->b|usy |
|00001b40| 3d 20 54 52 55 45 3b 20 | 20 20 20 20 20 20 20 20 |= TRUE; | |
|00001b50| 20 20 20 20 2f 2a 20 4d | 61 72 6b 20 74 68 65 20 | /* M|ark the |
|00001b60| 45 6c 65 6d 65 6e 74 20 | 61 73 20 22 62 75 73 79 |Element |as "busy|
|00001b70| 22 20 61 6e 64 20 20 20 | 2a 2f 0d 20 20 09 74 68 |" and |*/. .th|
|00001b80| 65 4e 6f 74 65 2d 3e 71 | 2e 6e 6d 52 65 73 70 20 |eNote->q|.nmResp |
|00001b90| 3d 20 28 50 72 6f 63 50 | 74 72 29 4e 6f 74 65 43 |= (ProcP|tr)NoteC|
|00001ba0| 6f 6d 70 6c 65 74 65 64 | 3b 20 2f 2a 20 69 6e 73 |ompleted|; /* ins|
|00001bb0| 65 72 74 20 69 74 20 69 | 6e 74 6f 20 74 68 65 20 |ert it i|nto the |
|00001bc0| 4e 4d 20 71 75 65 75 65 | 2a 2f 0d 0d 09 09 69 66 |NM queue|*/....if|
|00001bd0| 28 4e 4d 49 6e 73 74 61 | 6c 6c 28 28 51 45 6c 65 |(NMInsta|ll((QEle|
|00001be0| 6d 50 74 72 29 20 26 74 | 68 65 4e 6f 74 65 2d 3e |mPtr) &t|heNote->|
|00001bf0| 71 29 20 3d 3d 20 30 29 | 20 65 72 72 6f 72 20 3d |q) == 0)| error =|
|00001c00| 20 30 3b 0d 09 7d 0d 09 | 72 65 74 75 72 6e 28 65 | 0;..}..|return(e|
|00001c10| 72 72 6f 72 29 3b 0d 7d | 0d 0d 2f 2a 0d 20 2a 20 |rror);.}|../*. * |
|00001c20| 43 6f 6d 70 6c 65 74 69 | 6f 6e 20 6f 66 20 74 68 |Completi|on of th|
|00001c30| 65 20 22 4e 6f 74 69 66 | 69 63 61 74 69 6f 6e 22 |e "Notif|ication"|
|00001c40| 20 72 65 71 75 65 73 74 | 3a 0d 20 2a 20 72 65 6d | request|:. * rem|
|00001c50| 6f 76 65 20 66 72 6f 6d | 20 74 68 65 20 4e 4d 20 |ove from| the NM |
|00001c60| 71 75 65 75 65 2c 20 6d | 61 72 6b 20 22 46 72 65 |queue, m|ark "Fre|
|00001c70| 65 22 0d 20 2a 2f 0d 73 | 74 61 74 69 63 20 70 61 |e". */.s|tatic pa|
|00001c80| 73 63 61 6c 20 76 6f 69 | 64 20 20 4e 6f 74 65 43 |scal voi|d NoteC|
|00001c90| 6f 6d 70 6c 65 74 65 64 | 28 4e 6f 74 65 42 75 66 |ompleted|(NoteBuf|
|00001ca0| 2a 20 74 68 65 4e 6f 74 | 65 29 20 7b 0d 20 20 4e |* theNot|e) {. N|
|00001cb0| 4d 52 65 6d 6f 76 65 28 | 28 51 45 6c 65 6d 50 74 |MRemove(|(QElemPt|
|00001cc0| 72 29 20 26 74 68 65 4e | 6f 74 65 2d 3e 71 29 3b |r) &theN|ote->q);|
|00001cd0| 0d 09 74 68 65 4e 6f 74 | 65 2d 3e 62 75 73 79 20 |..theNot|e->busy |
|00001ce0| 3d 20 46 41 4c 53 45 3b | 0d 7d 0d 0d 2f 2a 0d 20 |= FALSE;|.}../*. |
|00001cf0| 2a 20 43 68 65 63 6b 20 | 4f 53 20 72 65 74 75 72 |* Check |OS retur|
|00001d00| 6e 20 63 6f 64 65 73 3a | 20 69 66 20 6e 6f 6e 2d |n codes:| if non-|
|00001d10| 7a 65 72 6f 2c 20 42 65 | 65 70 3a 20 77 65 20 63 |zero, Be|ep: we c|
|00001d20| 61 6e 27 74 20 64 6f 20 | 61 6e 79 74 68 69 6e 67 |an't do |anything|
|00001d30| 20 65 6c 73 65 20 68 65 | 72 65 0d 20 2a 2f 0d 73 | else he|re. */.s|
|00001d40| 74 61 74 69 63 20 76 6f | 69 64 20 43 68 65 63 6b |tatic vo|id Check|
|00001d50| 28 69 6e 74 20 72 65 74 | 63 6f 64 65 29 20 7b 0d |(int ret|code) {.|
|00001d60| 20 20 69 66 28 72 65 74 | 63 6f 64 65 20 21 3d 20 | if(ret|code != |
|00001d70| 30 29 20 53 79 73 42 65 | 65 70 28 31 29 3b 0d 7d |0) SysBe|ep(1);.}|
|00001d80| 0d 0d 0d 23 69 66 64 65 | 66 20 54 48 49 4e 4b 5f |...#ifde|f THINK_|
|00001d90| 43 0d 73 74 61 74 69 63 | 20 76 6f 69 64 2a 20 20 |C.static| void* |
|00001da0| 20 20 47 65 74 41 30 20 | 28 29 20 7b 61 73 6d 7b | GetA0 |() {asm{|
|00001db0| 0d 20 20 4d 4f 56 45 2e | 4c 20 41 30 2c 44 30 0d |. MOVE.|L A0,D0.|
|00001dc0| 7d 7d 0d 23 65 6e 64 69 | 66 0d 00 00 00 00 00 00 |}}.#endi|f.......|
|00001dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e00| 00 00 01 00 00 00 01 62 | 00 00 00 62 00 00 00 5a |.......b|...b...Z|
|00001e10| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 3c 51 75 69 |h>.#incl|ude <Qui|
|00001e20| 63 6b 44 72 61 77 2e 68 | 3e 0d 23 69 6e 63 6c 75 |ckDraw.h|>.#inclu|
|00001e30| 08 4c 69 73 74 65 6e 2e | 63 73 02 00 00 00 54 45 |.Listen.|cs....TE|
|00001e40| 58 54 4d 50 53 20 01 00 | 00 00 00 80 00 00 00 00 |XTMPS ..|........|
|00001e50| 00 00 54 45 58 54 4d 50 | 53 20 01 00 00 00 00 80 |..TEXTMP|S ......|
|00001e60| 00 00 52 c3 00 00 00 00 | 00 00 00 00 00 00 00 00 |..R.....|........|
|00001e70| 00 00 a2 cb f6 00 00 00 | 1d 4a 00 00 01 bc 75 64 |........|.J....ud|
|00001e80| 65 20 3c 4f 53 45 76 65 | 6e 74 73 2e 68 3e 0d 23 |e <OSEve|nts.h>.#|
|00001e90| 69 6e 63 6c 75 64 65 20 | 3c 4f 53 55 74 69 6c 73 |include |<OSUtils|
|00001ea0| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 4e 6f |.h>.#inc|lude <No|
|00001eb0| 74 69 66 69 63 61 74 69 | 6f 6e 2e 68 3e 0d 0d 6d |tificati|on.h>..m|
|00001ec0| 61 69 6e 20 28 29 20 7b | 0d 20 20 20 73 74 61 74 |ain () {|. stat|
|00001ed0| 69 63 20 4e 4d 52 65 63 | 20 20 4e 6f 74 65 31 2c |ic NMRec| Note1,|
|00001ee0| 4e 6f 74 65 32 3b 0d 20 | 20 20 73 74 61 74 69 63 |Note2;. | static|
|00001ef0| 20 63 68 61 72 20 20 20 | 6d 65 73 73 61 67 65 5b | char |message[|
|00001f00| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 5c 01 bd |...H..Mo|naco.\..|
|00001f10| 01 be 7f ff 00 d5 01 be | 01 bf 7f ff 00 fc 00 20 |........|....... |
|00001f20| 01 4a 7f ff 01 16 00 06 | 00 02 00 47 00 2c 01 4a |.J......|...G.,.J|
|00001f30| 01 e2 00 47 00 2c 01 4a | 01 e2 a2 d7 e0 00 00 00 |...G.,.J|........|
|00001f40| 09 d0 00 00 09 d0 00 00 | 07 a8 01 00 00 00 00 04 |........|........|
|00001f50| 00 06 00 02 00 00 00 0a | 00 09 06 4d 6f 6e 61 63 |........|...Monac|
|00001f60| 6f 34 00 00 01 00 00 00 | 01 62 00 00 00 62 00 00 |o4......|.b...b..|
|00001f70| 00 5a 00 15 f6 ae 04 6a | 00 00 00 1c 00 5a 00 02 |.Z.....j|.....Z..|
|00001f80| 4d 50 53 52 00 00 00 1a | 45 54 41 42 00 00 00 26 |MPSR....|ETAB...&|
|00001f90| 45 46 4e 54 00 00 00 32 | 03 ed ff ff 00 00 00 00 |EFNT...2|........|
|00001fa0| 00 00 00 00 03 ec ff ff | 00 00 00 4c 00 15 f6 32 |........|...L...2|
|00001fb0| 03 eb ff ff 00 00 00 54 | 00 15 f6 4a 00 00 00 00 |.......T|...J....|
|00001fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+