home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / hp / 15256 < prev    next >
Encoding:
Text File  |  1993-01-24  |  114.7 KB  |  3,154 lines

  1. Newsgroups: comp.sys.hp
  2. Path: sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!maxwell.uwaterloo.ca!gordon
  3. From: gordon@maxwell.uwaterloo.ca (Gordon R. Strachan)
  4. Subject: XControl program and terminal emulator 4/4
  5. Message-ID: <C1CAnL.FMp@watserv2.uwaterloo.ca>
  6. Sender: news@watserv2.uwaterloo.ca
  7. Reply-To: gordon@maxwell.uwaterloo.ca (Gordon R. Strachan)
  8. Organization: University of Waterloo
  9. Date: Sun, 24 Jan 1993 03:50:09 GMT
  10. Lines: 3142
  11.  
  12.  
  13. # This is a shell archive.  Remove anything before this line,
  14. # then unpack it by saving it in a file and typing "sh file".
  15. #
  16. # Wrapped by Gordon R. Strachan <gordon@maxwell> on Sat Jan 23 22:18:43 1993
  17. #
  18. # This archive contains:
  19. #    GenTerm/translators    GenTerm/xterm.par    
  20. #    xcontrol/Command.c    xcontrol/XControl.c    
  21. #    xcontrol/XControl.h    xcontrol/XControl.man    
  22. #    xcontrol/XVi.ad        MANIFEST        
  23. #
  24. # Error checking via wc(1) will be performed.
  25.  
  26. LANG=""; export LANG
  27. PATH=/bin:/usr/bin:$PATH; export PATH
  28.  
  29. echo x - GenTerm/translators
  30. cat >GenTerm/translators <<'@EOF'
  31. # Valid Special parsers
  32. #
  33. # <Digits(def,sep,n)> : Matches a list of 0 or more digits.  def is the
  34. #                       default value to return if no digits are encountered.
  35. #                       sep is the single character which each integer in its
  36. #                       list.  n is the optional length of each character
  37. # <Int(n)>            : Matches an integer n digits long (if no arg arbitrary
  38. #                       length)
  39. # <Select(c1,c2...cn) : Matches either c1 or c2 or ... cn where c1 etc are
  40. #                       single characters
  41. # <String(n)>         : Matches an arbitrary string of n characters long
  42. # <Upto(c)>           : Matches an arbitrary string upto character c
  43. #
  44. # Valid Translators
  45. # CarriageReturn()             : Move cursor to leftmost column
  46. # CheckModifiers(m,which,p)    : Query the information in the modifier returned
  47. #                                by GetLastButtonEvent.  m is the modifier
  48. #                                value,  which is either "Shift" "Meta" or
  49. #                                "Control".   If the modifier is set, argument
  50. #                                p is set to one, otherwise it is set to 0
  51. # ClearDisplay(top,bottom)     : Clear the display from row top to bottom
  52. # ClearLine(flag)              : Clear line flag=0 clears entire line flag=1
  53. #                                clears from cursor to end of line flag=2
  54. #                                clears from start of line to the cursor
  55. # ClearMemory(which)           : Clears the off screen memory.  which=0, clears
  56. #                                allmemory, which=1 clears memory below the
  57. #                                screen, which=2 clears the memory above the
  58. #                                screen
  59. # ConvertPosition(x,y,r,c)     : The row and columns number which correspond
  60. #                                to the given x and y position are returned in
  61. #                                position r and c.
  62. # DefinePen(n,fr,fg,fb,
  63. #           br,bg,bb)          : Defines the foreground and background colour
  64. #                                of the given pen.  N is the pen number.  fr,
  65. #                                fg,fb are floating point numbers between 0
  66. #                                and 1 which specify the rgb (or hsl)
  67. #                                components of the desired foreground pen.  br,
  68. #                                bg,bb define the colour of the background.
  69. # DeleteCharacters(n)          : Delete the next n characters on the line
  70. # DeleteLines(n)               : This function deletes n lines starting at the
  71. #                                current cursor position
  72. # DownLine(n,wrap)             : Move cursor down n lines.  Screen will be
  73. #                                scrolled up if wrap = 0 if wrap = 1 the cursor
  74. #                                will wrap around to the top.  If wrap = 2
  75. #                                the cursor will stick at the bottom.
  76. # Emit(s1,s2,...)              : Invokes the keybd Callback with the given
  77. #                                arguements as the data
  78. # EscapeCallback(s1,s2...)     : Invoke the esc callback with the given
  79. #                                arguments as the data
  80. # ExecuteFunctionKey(n)        : Causes the terminal to execute the specified
  81. #                                functionkey.
  82. # Fetch(a,b)                   : Get the global variable a and return it in
  83. #                                argument number b
  84. # GetArg(a,b)                  : Get the value of argument number a and return
  85. #                                it in arg b.  i.e. implement and indirect
  86. #                                reference to $a
  87. # GetBottomText(arg)           : Find the last row which has data on it and
  88. #                                return the row number in argument number arg
  89. # GetFont(f)                   : Returns the current font (0 or 1) in argument
  90. #                                number f
  91. # GetLine(r,c,where)           : Get the text on the screen starting at
  92. #                                position (r,c) and put the result in argument
  93. #                                where
  94. # GetLastButtonEvent(b,x,y,m)  : Get information on the last button press
  95. #                 event.  The button number is placed in
  96. #                                position b.  The x and y position is put in
  97. #                                positions x and y.  Finally, the modifiers are
  98. #                                put in position m.
  99. # GetPen(p)                    : Get the number of the current pen and put it
  100. #                                in argument number p
  101. # GetPosition(r,c)             : Get the current cursor position and return the
  102. #                                row number in argument number r and the
  103. #                                column number in argument number c
  104. # GetResource(name,pos)        : Get the value of resource "name" and return
  105. #                                it in argument number pos
  106. # GetScreenSize(r,c)           : Get the current size of the screen and put the
  107. #                                number of rows in paramter r and the number of
  108. #                     columns in parameter c
  109. # GetStringLen(s,p)            : Gets the length of string s and returns it
  110. #                                in parameter p
  111. # GetSubString(s,start,end,p)  : Gets the context of string s from positions
  112. #                                start to end inclusive and returns the result
  113. #                                in parameter p.
  114. # GetTop(arg)                     : Get the number of the line at the top of the
  115. #                                screen and returns it in argument number arg
  116. # GetTopOfScrollRegion(n,a)    : Finds the top of scroll region n and returns
  117. #                                the result in argument a.  If the scroll
  118. #                                region does not exist then row zero is
  119. #                                returned 
  120. # If(c1,cond,c2,label)         : If the expression c1 cond c2 is true then
  121. #                                branch to the function whose label is label.
  122. # Ignore()                     : do nothing
  123. # InsertLines(n,where)         : Insert n lines.  If where=1 inserts after
  124. #                                current row where=0 inserts before current row
  125. # IntToString(n,len,s)         : Performs an explicit integer to string
  126. #                                conversion.  n is the integer value, len is
  127. #                                the number of digits the final result should
  128. #                                contain.  The number will be truncated or
  129. #                                padded with zeros if needed.  s is the
  130. #                                argument number to return the result in.
  131. # LoadAttribute(r,c)              : Set the current attribute to the attribute of
  132. #                                position r and c.  If the position is invalid
  133. #                                load the default attribute
  134. # LoadMapTable(n)              : Changes the current output character mapping
  135. #                                table to the table whose number is given by
  136. #                                n.
  137. # LoadParseTable(name)         : Change the current parse table to the one
  138. #                                specified by name.
  139. # Math(o1,op,o2,r)             : Perform the math operation o1 "op" o2 and put
  140. #                                the result in argument number r.  Valid op's
  141. #                                are "+","-","*", "/" and '%'.  If an error
  142. #                                occures, the result is 0
  143. # MoveCursor(r,c)              : Move cursor to row r and column c
  144. # MoveLeft(n,wrap,roll)        : Move cursor left n columns. Cursor stays at
  145. #                                column zero if wrap = 0 otherwise wraps around
  146. #                                to previous row. If roll=0 the cursor moves
  147. #                                the upper left to the lower right, otherwise
  148. #                                the screen is rolled
  149. # MoveRight(m,wrap,roll)       : Move cursor right n columns.
  150. # NewLine()                    : Move cursor down one line possibly performing
  151. #                                a scroll
  152. # NextTab()                    : Move cursor to next tab stop
  153. # OutputString(s1,s2...)       : Outputs the passed string on the terminal
  154. #                                widget.  The strings are run through the
  155. #                                parser prior to printing.  The input stack
  156. #                                is not re-entrant so this function can cause
  157. #                                confusion on the input stack.
  158. # PreviousTab()                : Moves the cursor to the previous tab stop
  159. # ProgramKey(t,n,lab,str)      : Program a function key.  t is the type of
  160. #                                function to be implemented t=0 is a normal
  161. #                                function, t=1 is a function whose string is
  162. #                                sent to the terminal only and t=2 is a
  163. #                                function whose string is sent but not echoed.
  164. #                                n is the number of the function key. lab is
  165. #                                the label string to be assigned to the key
  166. #                                and str is the string to which the function is
  167. #                                evaluated to
  168. # ProgramMapTable(n,s,e,sp,ep) : Program map table n.  The values in the
  169. #                                range s to e and set to the values sp to ep
  170. # Quit()                       : Cause the parser to quit executing translators
  171. #                                and continue parsing
  172. # Reject()                     : Cause the parser to reject the matched
  173. #                                characters
  174. # SetBlinkMode(flag)           : If flag=1 then the blink attribute is set. 
  175. #                                If it is zero then it is turned off
  176. # SetField(a)                  : Sets the attributes for the current field. The
  177. #                                argument specifies the type of field and can
  178. #                                be 0,1,2 or, 3
  179. # SetFlow(flag)                : If flag is 0 flow control is turned off on
  180. #                                the input file descriptor, otherwise it is
  181. #                                turned on.
  182. # SetFont(arg)                 : Set font to base font if arg=0 and alternate
  183. #                                font if arg = 1
  184. # SetHalfBrightMode(flag)      : Turns on halfbright mode if arg=1, turns off
  185. #                                if flag=1
  186. # SetInsertMode(flag)          : If flag=1, turn on intersert mode.  If flag=0,
  187. #                                turn it off
  188. # SetInverseVideo(flag)        : If flag = 1, reverse foreground and background
  189. #                                colour.  If flag = 0 then set normal
  190. # SetKeyTable(name)            : Change the current key translation table to
  191. #                                the one specified by name.
  192. # SetParseTable(name)          : Change the current parse table to the one
  193. #                                specified by name.
  194. # SetPen(num)                  : Sets the pen number
  195. # SetResource(name,val)        : Set the X resource whose name is "name" to the
  196. #                                value given by val.  Currently only integer
  197. #                                and boolean variables can be set
  198. # SetScrollRegion(s,e,n)       : Set the scroll region.  S and E are the
  199. #                                starting and ending row numbers of the scroll
  200. #                                region. N is the number for the scroll region
  201. # SetUnderLineMode(flag)       : if flag=1 underlining mode is turned on.  If
  202. #                                flag=0, it is turned off
  203. # SetTab(col)                  : Set a tab stop at column col
  204. # SetTop(n)                    : Sets the top of the screen to line n
  205. # SoundBell()                  : Perform a Beep
  206. # Store(a,b)                   : Store argument a as a global storage variable
  207. #                                at position b
  208. # ToAscii(n,s)                 : Returns the ascii character in parameter s
  209. #                                that corresponds to number n
  210. # UpLine(m,wrap)               : Move cursor up n lines.  Screen will be
  211. #                                scrolled up if wrap = 0.  If wrap = 1, the
  212. #                                cursor will wrap around to the bottom.  If
  213. #                                wrap = 2, the cursor will stick to the top.
  214. # UnSetTab(col)                : Unset the tab stop at column col.  If col=-1
  215. #                                all tabs are removed.
  216. @EOF
  217. set `wc -lwc <GenTerm/translators`
  218. if test $1$2$3 != 186158412543
  219. then
  220.     echo ERROR: wc results of GenTerm/translators are $* should be 186 1584 12543
  221. fi
  222.  
  223. chmod 644 GenTerm/translators
  224.  
  225.  
  226. rm -f /tmp/uud$$
  227. (echo "begin 666 /tmp/uud$$\n#;VL*n#6%@x\n \nend" | uudecode) >/dev/null 2>&1
  228. if [ X"`cat /tmp/uud$$ 2>&1`" = Xok ]
  229. then
  230.     unpacker=uudecode
  231. else
  232.     echo Compiling unpacker for non-ascii files
  233.     pwd=`pwd`; cd /tmp
  234.     cat >unpack$$.c <<'EOF'
  235. #include <stdio.h>
  236. #define C (*p++ - ' ' & 077)
  237. main()
  238. {
  239.     int n;
  240.     char buf[128], *p, a,b;
  241.  
  242.     scanf("begin %o ", &n);
  243.     gets(buf);
  244.  
  245.     if (freopen(buf, "w", stdout) == NULL) {
  246.         perror(buf);
  247.         exit(1);
  248.     }
  249.  
  250.     while (gets(p=buf) && (n=C)) {
  251.         while (n>0) {
  252.             a = C;
  253.             if (n-- > 0) putchar(a << 2 | (b=C) >> 4);
  254.             if (n-- > 0) putchar(b << 4 | (a=C) >> 2);
  255.             if (n-- > 0) putchar(a << 6 | C);
  256.         }
  257.     }
  258.     exit(0);
  259. }
  260. EOF
  261.     cc -o unpack$$ unpack$$.c
  262.     rm unpack$$.c
  263.     cd $pwd
  264.     unpacker=/tmp/unpack$$
  265. fi
  266. rm -f /tmp/uud$$
  267.  
  268. echo x - GenTerm/xterm.par '[non-ascii]'
  269. $unpacker <<'@eof'
  270. begin 644 GenTerm/xterm.par
  271. M(R!4:&ES(&ES('1H92!P87)S92!T86)L92!F;W(@=&AE('AT97)M(&5M=6QAX
  272. M=&]R"B,O*B!(:7-T;W)Y.B @(" @(" @(" @(" @(" @(" @(" @(" @(" @X
  273. M(" @("HO"B,O*B @(" @(" @(%=R:71T96X@8GD@1RX@4BX@4W1R86-H86X@X
  274. M,3DY,B J+PHC"B,O*B @0V]P>7)I9VAT($=O<F1O;B!2+B!3=')A8VAA;B QX
  275. M.3DR("HO"B,O*B @5&AI<R!C;V1E(&ES('!R;W9I9&5D(&%S(&ES+"!N96ETX
  276. M:&5R('1H92!5;FEV97)S:71Y(&]F(%=A=&5R;&]O(&YO<B J+PHC+RH@('1HX
  277. M92!A=71H;W(@:7,@;&EA8FQE(&9O<B!A;GD@9&%M86=E(&-A=7-E9"!B>2!TX
  278. M:&4@=7-E(&]R(&UI<W5S92!O9B!T:&ES("HO"B,O*B @8V]D92X@("HO(PHCX
  279. M"B,O*B!097)M:7-S:6]N(&ES(&=R86YT960@=&\@8V]P>2P@=7-E(&%N9"!MX
  280. M;V1I9GD@=&AI<R!C;V1E('!R;W9I9&5D(&ET(&ES("HO"B,O*B!N;W0@<V]LX
  281. M9"!F;W(@<')O9FET(&%N9"!T:&4@86)O=F4@8V]P>7)I9VAT(')E;6%I;G,@X
  282. M:6YT86-T+B J+PH*(PHC($=L;V)A;"!V87)I86)L92!D969I;FET:6]N<PHCX
  283. M(#$Z($-U<G)E;G0@1S @;6%P<&EN9R!T86)L90HC(#(Z($-U<G)E;G0@1S$@X
  284. M;6%P<&EN9R!T86)L90HC(#,Z($-U<G)E;G0@1S(@;6%P<&EN9R!T86)L90HCX
  285. M(#0Z($-U<G)E;G0@1S,@;6%P<&EN9R!T86)L90HC(#4Z($-U<G)E;G1L>2!LX
  286. M;V%D960@;6%P<&EN9R!T86)L90HC(#8Z(%-A=F5D(&-U<G-O<B!P;W-I=&EOX
  287. M;B!R;W<*(R W.B!3879E9"!C=7)S;W(@<&]S:71I;VX@8V]L=6UN"B,@.#H@X
  288. M0W5R<F5N="!+97EC;V1E('1A8FQE"B,@.3H@1FQA9R!I9B Q,S(@8V]L=6UNX
  289. M(&UO9&4@:7,@86QL;W=E9 HC(#$P.B!&;&%G(&EF(&EN(&]R:6=I;B!M;V1EX
  290. M"B,@,3$Z($-U<G)E;G0@<F]W(&]R:6=I;@HC(#$R.B!-87AI;75M(')O=R!EX
  291. M>'1E;G0@:6X@;W)I9VEN(&UO9&4*(R Q,SH@1FQA9R!I9B!8,3 @;6]U<V4@X
  292. M=')A8VMI;F<@96YA8FQE9 HC"@HC(&9I<G-T(&-O;65S('1H92!K97EC;V1EX
  293. M(&1E9FEN:71I;VYS"@I+97E486)L92A$969A=6QT*3T*>PI5<"Q)+%Y;6T$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$^0WM)9B@D,2PB(3TB+"TQ+#$IX
  325. M.TUA=&@H)#$L(BLB+#(L,2D[36]V95)I9VAT*"0Q+# I+#%]"EY;6SQ$:6=IX
  326. M=',H+3$L(CLB*2PQ/D1[268H)#$L(B$](BPM,2PQ*3M-871H*"0Q+"(K(BPRX
  327. M+#$I.TUO=F5,969T*"0Q+# I+#%]"EY'>U-O=6YD0F5L;"@I?0I>2'M-;W9EX
  328. M3&5F="@Q+# I?0I>27M.97AT5&%B*"E]"EY+>TYE=TQI;F4H*7T*7DQ[3F5WX
  329. M3&EN92@I?0I>3GM&971C:"@R+#$I.TQO861-87!486)L92@D,2D[4W1O<F4HX
  330. M,2PU*7T*7D][1F5T8V@H,2PQ*3M,;V%D36%P5&%B;&4H)#$I.U-T;W)E*# LX
  331. M-2E]"EY3>TEG;F]R92@I?0I>47M)9VYO<F4H*7T*7ELC.'M)9VYO<F4H*7T*X
  332. M(R!3970@=&AE($<P(&UA<'!I;F<@=&%B;&4@86YD(&EF(&ET(&ES(&-U<G)EX
  333. M;G1L>2!L;V%D960L(')E;&]A9"!I= I>6R@P>U-T;W)E*#(L,2D[1F5T8V@HX
  334. M-2PQ*3M)9B@D,2PB(3TB+# L,2D[3&]A9$UA<%1A8FQE*#(I.TEG;F]R92@IX
  335. M+#%]"EY;*$%[4W1O<F4H,RPQ*3M&971C:"@U+#$I.TEF*"0Q+"(A/2(L,"PQX
  336. M*3M,;V%D36%P5&%B;&4H,RD[26=N;W)E*"DL,7T*7ELH0GM3=&]R92@Q+#$IX
  337. M.T9E=&-H*#4L,2D[268H)#$L(B$](BPP+#$I.TQO861-87!486)L92@Q*3M)X
  338. M9VYO<F4H*2PQ?0HC('-A;64@9F]R($<Q"EY;*3![4W1O<F4H,BPR*3M&971CX
  339. M:"@U+#$I.TEF*"0Q+"(A/2(L,2PQ*3M,;V%D36%P5&%B;&4H,BD[26=N;W)EX
  340. M*"DL,7T*7ELI07M3=&]R92@S+#(I.T9E=&-H*#4L,2D[268H)#$L(B$](BPQX
  341. M+#$I.TQO861-87!486)L92@S*3M)9VYO<F4H*2PQ?0I>6RE">U-T;W)E*#$LX
  342. M,BD[1F5T8V@H-2PQ*3M)9B@D,2PB(3TB+#$L,2D[3&]A9$UA<%1A8FQE*#$IX
  343. M.TEG;F]R92@I+#%]"B,@1S(*7ELJ,'M3=&]R92@R+#,I.T9E=&-H*#4L,2D[X
  344. M268H)#$L(B$](BPR+#$I.TQO861-87!486)L92@R*3M)9VYO<F4H*2PQ?0I>X
  345. M6RI!>U-T;W)E*#,L,RD[1F5T8V@H-2PQ*3M)9B@D,2PB(3TB+#(L,2D[3&]AX
  346. M9$UA<%1A8FQE*#,I.TEG;F]R92@I+#%]"EY;*D)[4W1O<F4H,2PS*3M&971CX
  347. M:"@U+#$I.TEF*"0Q+"(A/2(L,BPQ*3M,;V%D36%P5&%B;&4H,2D[26=N;W)EX
  348. M*"DL,7T*(R!',PI>6RLP>U-T;W)E*#(L-"D[1F5T8V@H-2PQ*3M)9B@D,2PBX
  349. M(3TB+#,L,2D[3&]A9$UA<%1A8FQE*#(I.TEG;F]R92@I+#%]"EY;*T%[4W1OX
  350. M<F4H,RPT*3M&971C:"@U+#$I.TEF*"0Q+"(A/2(L,RPQ*3M,;V%D36%P5&%BX
  351. M;&4H,RD[26=N;W)E*"DL,7T*7ELK0GM3=&]R92@Q+#0I.T9E=&-H*#4L,2D[X
  352. M268H)#$L(B$](BPS+#$I.TQO861-87!486)L92@Q*3M)9VYO<F4H*2PQ?0I>X
  353. M6S=[1V5T4&]S:71I;VXH,2PR*3M3=&]R92@D,2PV*3M3=&]R92@D,BPW*7T*X
  354. M7ELX>T9E=&-H*#8L,2D[1F5T8V@H-RPR*3M-;W9E0W5R<V]R*"0Q+"0R*7T*X
  355. M7EL]>T9E=&-H*#@L,2D[268H)#$L(B$](BPP+#$I.UP*"5-E=$ME>51A8FQEX
  356. M*")!<'!+97E0860B*3M3=&]R92@R+#@I.U%U:70H*3M<"@E)9B@D,2PB(3TBX
  357. M+#$L,BDL,3M3971+97E486)L92@B07!P0W5R2V5Y4&%D(BD[4W1O<F4H,RPXX
  358. M*3M<"@E1=6ET*"DL,GT*7EL^>T9E=&-H*#@L,2D[268H)#$L(CTB+#,L,2D[X
  359. M7 H)4V5T2V5Y5&%B;&4H(D1E9F%U;'0B*3M3=&]R92@P+#@I.U%U:70H*3M<X
  360. M"@E3971+97E486)L92@B07!P0W5R2V5Y(BDL,3M3=&]R92@Q+#@I?0I>6T1[X
  361. M3F5W3&EN92@I?0I>6T5[3F5W3&EN92@I.T-A<G)I86=E4F5T=7)N*"E]"EY;X
  362. M2'M'9710;W-I=&EO;B@Q+#(I.U-E=%1A8B@D,BE]"EY;37M'9710;W-I=&EOX
  363. M;B@Q+#(I.TEF*"0Q+"(A/2(L,"PQ*3M);G-E<G1,:6YE<R@Q+# I.U%U:70HX
  364. M*3M5<$QI;F4H,2PP*2PQ?0I>6TX\4W1R:6YG*#$I+#$^>T9E=&-H*#,L,BD[X
  365. M3&]A9$UA<%1A8FQE*"0R*3M/=71P=713=')I;F<H)#$I.T9E=&-H*#4L,BD[X
  366. M7 H)3&]A9$UA<%1A8FQE*"0R*7T*7EM//%-T<FEN9R@Q*2PQ/GM&971C:"@TX
  367. M+#(I.TQO861-87!486)L92@D,BD[3W5T<'5T4W1R:6YG*"0Q*3M&971C:"@UX
  368. M+#(I.UP*"4QO861-87!486)L92@D,BE]"EY;4#Q5<'1O*")>6R(I+#$^7%Q[X
  369. M26=N;W)E*"E]"EY;6GM%;6ET*")>6S\Q.S)C(BE]"EY;6SQ$:6=I=',H+3$LX
  370. M(CLB*2PQ/D![268H)#$L(B$](BPM,2PR*3M-871H*"0Q+"(K(BPR+#$I.UP*X
  371. M"4=E=%)E<V]U<F-E*")I;G-E<G1-;V1E(BPR*2PR.U-E=%)E<V]U<F-E*")IX
  372. M;G-E<G1-;V1E(BPQ*3M<"@E'9710;W-I=&EO;B@S+#0I.UP*"4]U='!U=%-TX
  373. M<FEN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IX
  405. M=&EO;B@R+#,I.U5N4V5T5&%B*"0S*3M1=6ET*"D[7 H)268H)#$L(B$](BPSX
  406. M+#,I+#([56Y3971486(H+3$I.T=E=%-C<F5E;E-I>F4H,BPS*3M3971486(HX
  407. M-SDI.U%U:70H*3M<"@E1=6ET*"DL,WT*7EM;/$1I9VET<R@M,2PB.R(I+#$^X
  408. M:'M-871H*# L(BLB+#$L,3 I.UP*"4=E=$%R9R@D,3 L,3$I+#$[268H)#$QX
  409. M+"(](BPM,2PR*3M<"@E)9B@D,3$L(B$](BPT+#,I.U-E=%)E<V]U<F-E*")IX
  410. M;G-E<G1-;V1E(BPQ*3M<"@E)9B@D,3$L(B$](BPR,"PT*2PS.U-E=%)E<V]UX
  411. M<F-E*")A=71O3&EN95=R87 B+#$I.UP*"4UA=&@H)#$P+"(K(BPQ+#$P*2PTX
  412. M.TEF*"0Q,"PB/"(L,3 L,2D[7 H)475I="@I+#)]"EY;6SQ$:6=I=',H+3$LX
  413. M(CLB*2PQ/FQ[36%T:"@P+"(K(BPQ+#$P*3M<"@E'971!<F<H)#$P+#$Q*2PQX
  414. M.TEF*"0Q,2PB/2(L+3$L,BD[7 H)268H)#$Q+"(A/2(L-"PS*3M3971297-OX
  415. M=7)C92@B:6YS97)T36]D92(L,"D[7 H)268H)#$Q+"(A/2(L,C L-"DL,SM3X
  416. M971297-O=7)C92@B875T;TQI;F57<F%P(BPP*3M<"@E-871H*"0Q,"PB*R(LX
  417. M,2PQ,"DL-#M)9B@D,3 L(CPB+#$P+#$I.UP*"5%U:70H*2PR?0I>6UL\1&EGX
  418. M:71S*"TQ+"([(BDL,3YM>TUA=&@H,"PB*R(L,2PQ,"D[7 H)1V5T07)G*"0QX
  419. M,"PQ,2DL,3M)9B@D,3$L(CTB+"TQ+#(I.UP*"4EF*"0Q,2PB(3TB+# L,RD[X
  420. M4V5T1F]N="@P*3M39715;F1E<DQI;F5-;V1E*# I.U-E=$)L:6YK36]D92@PX
  421. M*3M<"@D)4V5T26YV97)S959I9&5O*# I.UP*"4EF*"0Q,2PB(3TB+#$L-"DLX
  422. M,SM3971&;VYT*#$I.UP*"4EF*"0Q,2PB(3TB+#0L-2DL-#M39715;F1E<DQIX
  423. M;F5-;V1E*#$I.UP*"4EF*"0Q,2PB(3TB+#4L-BDL-3M3971";&EN:TUO9&4HX
  424. M,2D[7 H)268H)#$Q+"(A/2(L-RPW*2PV.U-E=$EN=F5R<V56:61E;R@Q*3M<X
  425. M"@E-871H*"0Q,"PB*R(L,2PQ,"DL-SM)9B@D,3 L(CPB+#$P+#$I.UP*"4EFX
  426. M*"0Q,"PB(3TB+#$L,3 I+#([7 H)4V5T1F]N="@P*3M39715;F1E<DQI;F5-X
  427. M;V1E*# I.U-E=$)L:6YK36]D92@P*3M3971);G9E<G-E5FED96\H,"D[7 H)X
  428. M475I="@I+#$P?0I>6UL\1&EG:71S*"TQ+"([(BDL,3YN>TEF*"0Q+"(A/2(LX
  429. M-2PQ*3M/=71P=713=')I;F<H(EY;6S!N(BD[475I="@I.UP*"4EF*"0Q+"(AX
  430. M/2(L-BPR*2PQ.T=E=%!O<VET:6]N*#(L,RD[7 H)"4]U='!U=%-T<FEN9R@BX
  431. M7ELB+"0R+"([(BPD,RPB4B(I.U%U:70H*3M<"@E1=6ET*"DL,GT*7EM;/$1IX
  432. M9VET<R@M,2PB.R(I+#$^<GM'97138W)E96Y3:7IE*#,L-"D[268H)#$L(B$]X
  433. M(BPM,2PQ*3M<"@E)9B@D,BPB(3TB+"TQ+#,I.TUA=&@H)#,L(BTB+#$L,RD[X
  434. M4V5T4V-R;VQL4F5G:6]N*# L)#,L,"D[7 H)"4UO=F5#=7)S;W(H,"PP*3M&X
  435. M971C:"@Q,"PU*3M)9B@D-2PB/3TB+# L-"D[7 H)"5-T;W)E*# L,3$I.U-TX
  436. M;W)E*"0S+#$R*3M1=6ET*"DL-#M<"@E-871H*# L(BLB+#$L,2DL,SM<"@E-X
  437. M871H*"0Q+"(M(BPQ+#$I+#$[268H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"0S+"0R*3M<"B!1=6ETX
  533. M*"DL,GT*?0H*4&%R<V5486)L92A"=71T;VY296QE87-E5')A;G-L871O<BD]X
  534. M"GL*>T9E=&-H*#$S+#$I.TEF*"0Q+"(A/2(L,BPQ*3M<"@E'971,87-T0G5TX
  535. M=&]N179E;G0H,2PR+#,L-"D[36%T:"@S+"(K(BPP+#$I.UP*"4-H96-K36]DX
  536. M:69I97)S*"0T+")3:&EF="(L-2D[0VAE8VM-;V1I9FEE<G,H)#0L(DUO9#$BX
  537. M+#8I.UP*"4-H96-K36]D:69I97)S*"0T+")#;VYT<F]L(BPW*3M-871H*"0UX
  538. M+"(\/"(L,RPU*3M-871H*"0V+"(\/"(L-"PV*3M<"@E-871H*"0W+"(\/"(LX
  539. M-2PW*3M-871H*"0Q+"(K(BPD-2PQ*3M-871H*"0Q+"(K(BPD-BPQ*3M<"@E-X
  540. M871H*"0Q+"(K(BPD-RPQ*3M-871H*"0Q+"(K(BPS,BPQ*3M4;T%S8VEI*"0QX
  541. M+#$I.UP*"4-O;G9E<G10;W-I=&EO;B@D,BPD,RPU+#8I.TUA=&@H)#4L(BLBX
  542. M+#,S+#4I.TUA=&@H)#8L(BLB+#,S+#8I.UP*"51O07-C:6DH)#4L,BD[5&]!X
  543. M<V-I:2@D-BPS*3M%;6ET*")>6UM-(BPD,2PD,RPD,BD[7 H@475I="@I+#%]X
  544. ""GUI                                                        X
  545.                                                              X
  546. end
  547. @eof
  548. set `wc -lwc <GenTerm/xterm.par`
  549. if test $1$2$3 != 38757112287
  550. then
  551.     echo ERROR: wc results of GenTerm/xterm.par are $* should be 387 571 12287
  552. fi
  553.  
  554. chmod 644 GenTerm/xterm.par
  555.  
  556. echo x - xcontrol/Command.c
  557. cat >xcontrol/Command.c <<'@EOF'
  558. /* Command.c : This function contains the command execution code */
  559. /* History:                                 */
  560. /*         Written by G. R. Strachan 1992 */
  561.  
  562. /*  Copyright Gordon R. Strachan 1992 */
  563. /*  This code is provided as is, neither the University of Waterloo nor */
  564. /*  the author is liable for any damage caused by the use or misuse of this */
  565. /*  code.  */
  566.  
  567. /* Permission is granted to copy, use and modify this code provided it is */
  568. /* not sold for profit and the above copyright remains intact. */
  569.  
  570. #include <stdio.h>
  571. #include <unistd.h>
  572. #include <sys/wait.h>
  573. #include <signal.h>
  574. #include <X11/X.h>
  575. #include <X11/Intrinsic.h>
  576. #include <Xm/Xm.h>
  577. #include "../GenTerm/Pty.h"
  578. #include "XControl.h"
  579.  
  580. extern void TimeOutCB();
  581. extern struct CallStruct *BuildCallStruct();
  582. extern struct CommandList *ParseString();
  583.  
  584. /* ExecuteCommandList:  This function executes the list of commands */
  585.  
  586. ExecuteCommandList(XControl,Commands)
  587.  
  588. struct XControl *XControl;
  589. struct CommandList *Commands;
  590.  
  591. {
  592.  struct CommandList *temp;
  593.  int val;
  594.  
  595.  temp = Commands;
  596.  
  597.  while(temp != NULL)
  598.   {
  599.    val = (temp->Command)(XControl,temp->Args,temp->NumberArguments);
  600.    
  601.    if(val == XCERROR)
  602.     break;
  603.    temp = temp->Next;
  604.   }
  605. }
  606.  
  607. /* ArgToInt:  This function locates and returns an integer value from the */
  608. /*  argument list.  If the argument is not in the list then the default */
  609. /*  value is returned. */
  610.  
  611. ArgToInt(XControl,Args,NumArgs,Position,Default)
  612.  
  613. struct XControl *XControl;
  614. struct Argument *Args;
  615. int Position;
  616. int Default;
  617.  
  618. {
  619.  int Value;
  620.  
  621.  if(Position > NumArgs)
  622.   Value = Default;
  623.  else
  624.   {
  625.    Position--;
  626.    switch(Args[Position].Type)
  627.     {
  628.    case INTEGERARG:
  629.      Value = Args[Position].Value;
  630.      break;
  631.    case STRINGARG:
  632.      Value = atoi(Args[Position].String);
  633.      break;
  634.    case POSITIONARG:
  635.      Value = GetInt(XControl,Args[Position].Value);
  636.      break;
  637.     }
  638.   }
  639.  return(Value);
  640. }
  641.  
  642. /* ArgToString:  This function locates and returns a string value from the */
  643. /*  argument list.  If the argument is not in the list then the default value*/
  644. /*  is returned. */
  645.  
  646. ArgToString(XControl,Args,NumArgs,Position,String,Len,Default)
  647.  
  648. struct XControl *XControl;
  649. struct Argument *Args;
  650. int NumArgs;
  651. int Position;
  652. char *String;
  653. int Len;
  654. char *Default;
  655.  
  656. {
  657.  char buffer[1024];
  658.  
  659.  if(Position > NumArgs)
  660.   {
  661.    strncpy(String,Default,Len-1);
  662.   }
  663.  else
  664.   {
  665.    Position--;
  666.    switch(Args[Position].Type)
  667.     {
  668.    case STRINGARG:
  669.      strncpy(String,Args[Position].String,Len-1);
  670.      break;
  671.    case INTEGERARG:
  672.      sprintf(buffer,"%d",Args[Position].Value);
  673.      strncpy(String,buffer,Len-1);
  674.      break;
  675.    case POSITIONARG:
  676.      GetString(XControl,Args[Position].Value,String,Len);
  677.      break;
  678.     }
  679.   }
  680.  String[Len-1] = NULL;
  681. }
  682.  
  683. /* StoreInt:  This function stores an integer into the positional argument */
  684. /*  list. */
  685.  
  686. StoreInt(XControl,Position,Value)
  687.  
  688. struct XControl *XControl;
  689. int Position;
  690. int Value;
  691.  
  692. {
  693.  char buffer[1024];
  694.  int i;
  695.  
  696.  if(Position > XControl->NumberPositions)
  697.   {
  698.    XControl->PositionalArgs = (char **) XtRealloc(XControl->PositionalArgs,
  699.                          sizeof(char *)*Position);
  700.    for(i = XControl->NumberPositions; i < Position; i++)
  701.     XControl->PositionalArgs[i] = NULL;
  702.    XControl->NumberPositions = Position;
  703.   }
  704.  Position--;
  705.  sprintf(buffer,"%d",Value);
  706.  
  707.  if(Position < -0)
  708.   Warning(XControl,"Attempt to access a negative positional argument\n");
  709.  else
  710.   {
  711.    XControl->PositionalArgs[Position] = 
  712.     (char *)XtRealloc(XControl->PositionalArgs[Position],strlen(buffer)+1);
  713.    strcpy(XControl->PositionalArgs[Position],buffer);
  714.   }
  715. }
  716.  
  717. /* StoreString:  This function stores a string into the positional argument */
  718.  
  719. StoreString(XControl,Position,Value)
  720.  
  721. struct XControl *XControl;
  722. int Position;
  723. char *Value;
  724.  
  725. {
  726.  int i;
  727.  
  728.  if(Position > XControl->NumberPositions)
  729.   {
  730.    XControl->PositionalArgs = (char **)XtRealloc(XControl->PositionalArgs,
  731.                          sizeof(char *)*Position);
  732.    for(i = XControl->NumberPositions; i < Position; i++)
  733.     XControl->PositionalArgs[i] = NULL;
  734.    XControl->NumberPositions = Position;
  735.   }
  736.  Position--;
  737.  
  738.  if(Position < 0)
  739.   Warning(XControl,"Attempt to access a negative positional argument\n");
  740.  else
  741.   {
  742.    XControl->PositionalArgs[Position] =
  743.     (char *)XtRealloc(XControl->PositionalArgs[Position],strlen(Value)+1);
  744.    strcpy(XControl->PositionalArgs[Position],Value);
  745.   }
  746. }
  747.  
  748. /* GetInt:  This function gets an integer from the positional argument list */
  749.  
  750. GetInt(XControl,Position)
  751.  
  752. struct XControl *XControl;
  753. int Position;
  754.  
  755. {
  756.  if((Position > XControl->NumberPositions) || (Position < 1))
  757.   return(0);
  758.  else
  759.   return(atoi(XControl->PositionalArgs[Position-1]));
  760. }
  761.  
  762. /* GetString:  This function gets a character string from the positional */
  763. /*  argument list */
  764.  
  765. GetString(XControl,Position,String,Len)
  766.  
  767. struct XControl *XControl;
  768. int Position;
  769. char *String;
  770. int Len;
  771.  
  772. {
  773.  if((Position > XControl->NumberPositions) || (Position < 1))
  774.   String[0] = NULL;
  775.  else
  776.   strncpy(String,XControl->PositionalArgs[Position-1],Len-1);
  777.  String[Len-1] = NULL;
  778. }
  779.  
  780. /* Reap:  This function reaps a child process and returns the pid number in */
  781. /*  specified argument.  If no child was reaped, the returned pid is 0 */
  782.  
  783. int ReapCommand(XControl,Args,NumArgs)
  784.  
  785. struct XControl *XControl;
  786. struct Argument *Args;
  787. int NumArgs;
  788.  
  789. {
  790.  int Pos = ArgToInt(XControl,Args,NumArgs,1,1);
  791.  int child;
  792.  
  793.  child = waitpid(-1,NULL,WNOHANG | WUNTRACED);
  794.  
  795.  if(child >= 0)
  796.   {
  797.    StoreInt(XControl,Pos,child);
  798.    return(XCOKAY);
  799.   }
  800.  else
  801.   return(XCERROR);
  802. }
  803.  
  804.  
  805. /* QuitCommand:  This function causes the XControl program to exit.  It does */
  806. /*  not return.  It takes as a argument, the exist status of the program */
  807.  
  808. QuitCommand(XControl,Args,NumArgs)
  809.  
  810. struct XControl *XControl;
  811. struct Argument *Args;
  812. int NumArgs;
  813.  
  814. {
  815.  int status = ArgToInt(XControl,Args,NumArgs,1,0);
  816.  
  817.  exit(status);
  818. }
  819.  
  820. /* WriteCommand:  This function writes the passed arguments to the child */
  821. /*  process. */
  822.  
  823. WriteCommand(XControl,Args,NumArgs)
  824.  
  825. struct XControl *XControl;
  826. struct Argument *Args;
  827. int NumArgs;
  828.  
  829. {
  830.  int i;
  831.  char buffer[1024];
  832.  
  833.  for(i = 1; i <= NumArgs; i++)
  834.   {
  835.    ArgToString(XControl,Args,NumArgs,i,buffer,1024,"");
  836.    PtyWrite(XControl->Terminal,buffer,strlen(buffer));
  837.   }
  838.  return(XCOKAY);
  839. }
  840.  
  841. /* SignalCommand:  This function sends a signal to the process group attached*/
  842. /*  to the slave side of the pty. */
  843.  
  844. SignalCommand(XControl,Args,NumArgs)
  845.  
  846. struct XControl *XControl;
  847. struct Argument *Args;
  848. int NumArgs;
  849.  
  850. {
  851.  int Sig = ArgToInt(XControl,Args,NumArgs,1,-1);
  852.  
  853.  if((Sig < 0) || (Sig >NSIG))
  854.   return(XCERROR);
  855.  else
  856.   PtySignal(XControl->Terminal,Sig);
  857.  return(XCOKAY);
  858. }
  859.  
  860. /* PromptCommand:  This command puts up a message dialog to ask the user */
  861. /*  a question.  The user can hit 3 buttons, yes, no or cancel.  The */
  862. /*  arguments for the command are as follows:                        */
  863. /*  Prompt(Title,Prompt,Yes,No,Cancel,YesCommand,NoCommand,CancelCommand) */
  864. /*  Title is the character string to appear in the title bar of the dialog. */
  865. /*  Prompt is the message to be displayed.  Yes,No and Cancel are the */
  866. /*  strings to be placed in the three buttons.  The YesCommand, NoCommand */
  867. /*  and CancelCommands are the commands to be executed when any of the */
  868. /*  buttons are hit. */
  869.  
  870. PromptCommand(XControl,Args,NumArgs)
  871.  
  872. struct XControl *XControl;
  873. struct Argument *Args;
  874. int NumArgs;
  875.  
  876. {
  877.  int n = 0;
  878.  Arg XArgs[20];
  879.  char Title[40];
  880.  char Prompt[40];
  881.  char Affirm[40];
  882.  char Neg[40];
  883.  char Cancel[40];
  884.  char Commands[1024];
  885.  
  886.  if(XControl->PromptYesCommands != NULL)
  887.   DestroyCommandList(XControl,XControl->PromptYesCommands);
  888.  if(XControl->PromptNoCommands != NULL)
  889.   DestroyCommandList(XControl,XControl->PromptNoCommands);
  890.  if(XControl->PromptCancelCommands != NULL)
  891.   DestroyCommandList(XControl,XControl->PromptCancelCommands);
  892.  
  893.  ArgToString(XControl,Args,NumArgs,1,Title,40,"Prompt");
  894.  ArgToString(XControl,Args,NumArgs,2,Prompt,40,"Yes or no?");
  895.  ArgToString(XControl,Args,NumArgs,3,Affirm,40,"Yes");
  896.  ArgToString(XControl,Args,NumArgs,4,Neg,40,"No");
  897.  ArgToString(XControl,Args,NumArgs,5,Cancel,40,"Cancel");
  898.  
  899.  ArgToString(XControl,Args,NumArgs,6,Commands,1024,"");
  900.  XControl->PromptYesCommands = ParseString(XControl,Commands);
  901.  
  902.  ArgToString(XControl,Args,NumArgs,7,Commands,1024,"");
  903.  XControl->PromptNoCommands = ParseString(XControl,Commands);
  904.  
  905.  ArgToString(XControl,Args,NumArgs,8,Commands,1024,"");
  906.  XControl->PromptCancelCommands = ParseString(XControl,Commands);
  907.  
  908.  XtSetArg(XArgs[n],XmNdialogTitle,
  909.       XmStringCreateLtoR(Title,XmSTRING_DEFAULT_CHARSET)); n++;
  910.  XtSetArg(XArgs[n],XmNmessageString,
  911.       XmStringCreateLtoR(Prompt,XmSTRING_DEFAULT_CHARSET));n++;
  912.  XtSetArg(XArgs[n],XmNcancelLabelString,
  913.        XmStringCreateLtoR(Cancel,XmSTRING_DEFAULT_CHARSET)); n++;
  914.  XtSetArg(XArgs[n],XmNhelpLabelString,
  915.        XmStringCreateLtoR(Neg,XmSTRING_DEFAULT_CHARSET)); n++;
  916.  XtSetArg(XArgs[n],XmNokLabelString,
  917.        XmStringCreateLtoR(Affirm,XmSTRING_DEFAULT_CHARSET)); n++;
  918.  XtSetArg(XArgs[n],XmNmessageAlignment,XmALIGNMENT_CENTER); n++;
  919.  XtSetValues(XControl->Message,XArgs,n);
  920.  XtManageChild(XControl->Message);
  921.  
  922.  return(XCOKAY);
  923. }
  924.  
  925. /* TimeOutCommand:  This command will cause a set of commands to be */
  926. /*  executed after a set period of time has been elapsed.  The timeout can */
  927. /*  be removed with the RemoveTimeOutCommand.  The first argument is the */
  928. /*  duration of the timeout (in milliseconds), the second argument is where */
  929. /*  timeout id is to be stored and the third argument is the command string */
  930. /*  to execute when the timeout expires. */
  931.  
  932. TimeOutCommand(XControl,Args,NumArgs)
  933.  
  934. struct XControl *XControl;
  935. struct Argument *Args;
  936. int NumArgs;
  937.  
  938. {
  939.  int Duration = ArgToInt(XControl,Args,NumArgs,1,1000);
  940.  int Pos = ArgToInt(XControl,Args,NumArgs,2,1);
  941.  char buffer[1024];
  942.  XtIntervalId Id;
  943.  struct CommandList *Commands;
  944.  
  945.  ArgToString(XControl,Args,NumArgs,3,buffer,1024,"");
  946.  Commands = ParseString(XControl,buffer);
  947.  
  948.  Id = XtAppAddTimeOut(XControl->App,(unsigned long)Duration,TimeOutCB,
  949.               BuildCallStruct(XControl,Commands,True,True));
  950.  StoreInt(XControl,Pos,(int)Id);
  951.  return(XCOKAY);
  952. }
  953.  
  954. /* RemoveTimeOutCommand:  This function cancels a pending timeout.  The */
  955. /*  argument is the timeout id number that was saved by the TimeOut command. */
  956. /*  Note that this function can not find the memory allocated by the */
  957. /*  TimeOut command to store the command string in and so we have a small */
  958. /*  memory leak here. */
  959.  
  960. RemoveTimeOutCommand(XControl,Args,NumArgs)
  961.  
  962. struct XControl *XControl;
  963. struct Argument *Args;
  964. int NumArgs;
  965.  
  966. {
  967.  XtIntervalId Id = (XtIntervalId) ArgToInt(XControl,Args,NumArgs,1,0);
  968.  
  969.  XtRemoveTimeOut(Id);
  970.  return(XCOKAY);
  971. }
  972.  
  973. /* SleepCommand:  This function causes the application to sleep for certain */
  974. /*  amount of seconds.  The first argument is the number of seconds to sleep*/
  975. /*  for. */
  976.  
  977. SleepCommand(XControl,Args,NumArgs)
  978.  
  979. struct XControl *XControl;
  980. struct Argument *Args;
  981. int NumArgs;
  982.  
  983. {
  984.  int Interval = ArgToInt(XControl,Args,NumArgs,1,1);
  985.  
  986.  sleep(Interval);
  987.  
  988.  return(XCOKAY);
  989. }
  990.  
  991. /* AbortCommand:  This function causes the currently executing command */
  992. /*  string to be aborted. */
  993.  
  994. AbortCommand(XControl,Args,NumArgs)
  995.  
  996. struct XControl *XControl;
  997. struct Argument *Args;
  998. int NumArgs;
  999.  
  1000. {
  1001.  return(XCABORT);
  1002. }
  1003.  
  1004. /* GetEnvCommand: This function gets an environment variable and returns */
  1005. /*  the result in a variable.  The first argument is the name of the */
  1006. /*  variable to return and the second argument is the position to store it */
  1007. /*  in. */
  1008.  
  1009. GetEnvCommand(XControl,Args,NumArgs)
  1010.  
  1011. struct XControl *XControl;
  1012. struct Argument *Args;
  1013. int NumArgs;
  1014.  
  1015. {
  1016.  char Name[1024];
  1017.  char *Value;
  1018.  int Pos = ArgToInt(XControl,Args,NumArgs,2,1);
  1019.  
  1020.  ArgToString(XControl,Args,NumArgs,1,Name,1024,"");
  1021.  
  1022.  Value = (char *) getenv(Name);
  1023.  
  1024.  StoreString(XControl,Pos,Value);
  1025.  
  1026.  return(XCOKAY);
  1027. }
  1028.  
  1029. /* SetEnvCommand:  This function sets an environment variable for the current*/
  1030. /*  process.  If performed prior to forking the child process, it will be */
  1031. /*  inherited by the child. The first argument is the name of the variable */
  1032. /*  to set and the second argument is its value. */
  1033.  
  1034. SetEnvCommand(XControl,Args,NumArgs)
  1035.  
  1036. struct XControl *XControl;
  1037. struct Argument *Args;
  1038. int NumArgs;
  1039.  
  1040. {
  1041.  char Name[80];
  1042.  char Value[256];
  1043.  char *buffer;
  1044.  
  1045.  ArgToString(XControl,Args,NumArgs,1,Name,80,"");
  1046.  ArgToString(XControl,Args,NumArgs,2,Value,256,"");
  1047.  
  1048.  buffer = XtMalloc(strlen(Name) + strlen(Value) + 2);
  1049.  strcpy(buffer,Name);
  1050.  strcat(buffer,"=");
  1051.  strcat(buffer,Value);
  1052.  
  1053.  putenv(buffer);
  1054.  
  1055.  return(XCOKAY);
  1056. }
  1057.  
  1058. /* IfCommand:  This function implements a structure if statement. The first */
  1059. /*  third arguments are the operands to test.  The second argument is the */
  1060. /*  is the boolean operation to perform.  The fourth argument is the command */
  1061. /*  list to execute if the boolean expression is true and the fifth argument */
  1062. /*  to execute if the boolean expression is false. */
  1063.  
  1064. IfCommand(XControl,Args,NumArgs)
  1065.  
  1066. struct XControl *XControl;
  1067. struct Argument *Args;
  1068. int NumArgs;
  1069.  
  1070. {
  1071.  int op1,op2;
  1072.  char Operation[3];
  1073.  char Arg1[256],Arg2[256];
  1074.  int result = 0;
  1075.  char buffer[1024];
  1076.  struct CommandList *Commands;
  1077.  
  1078.  op1 = ArgToInt(XControl,Args,NumArgs,1,0);
  1079.  op2 = ArgToInt(XControl,Args,NumArgs,3,0);
  1080.  ArgToString(XControl,Args,NumArgs,2,Operation,3,"");
  1081.  
  1082.  if(strcmp(Operation,"==") == 0)
  1083.   result = op1 == op2;
  1084.  else if(strcmp(Operation,"!=") == 0)
  1085.   result = op1 != op2;
  1086.  else if(strcmp(Operation,">=") == 0)
  1087.   result = op1 >= op2;
  1088.  else if(strcmp(Operation,"<=") == 0)
  1089.   result = op1 <= op2;
  1090.  else if(strcmp(Operation,"<") == 0)
  1091.   result = op1 < op2;
  1092.  else if(strcmp(Operation,">") == 0)
  1093.   result = op1 > op2;
  1094.  else if(strcmp(Operation,"%") == 0)
  1095.   {
  1096.    ArgToString(XControl,Args,NumArgs,1,Arg1,256,"");
  1097.    ArgToString(XControl,Args,NumArgs,3,Arg2,256,"");
  1098.    result = (strcmp(Arg1,Arg2) == 0);
  1099.   }
  1100.  else if(strcmp(Operation,"!%") == 0)
  1101.   {
  1102.    ArgToString(XControl,Args,NumArgs,1,Arg1,256,"");
  1103.    ArgToString(XControl,Args,NumArgs,3,Arg2,256,"");
  1104.    result = (strcmp(Arg1,Arg2) != 0);
  1105.   }
  1106.  else
  1107.   return(XCERROR);
  1108.  
  1109.  if(result)
  1110.   ArgToString(XControl,Args,NumArgs,4,buffer,1024,"");
  1111.  else
  1112.   ArgToString(XControl,Args,NumArgs,5,buffer,1024,"");
  1113.  
  1114.  Commands = ParseString(XControl,buffer);
  1115.  ExecuteCommandList(XControl,Commands);
  1116.  DestroyCommandList(XControl,Commands);
  1117.  
  1118.  return(XCOKAY);
  1119. }
  1120.  
  1121. /* GetChildPidCommand:  This function returns the process id of the child */
  1122. /*  process it launched.  The argument is the number of the positional */
  1123. /*  agument to put the pid into. */
  1124.  
  1125. GetChildPidCommand(XControl,Args,NumArgs)
  1126.  
  1127. struct XControl *XControl;
  1128. struct Argument *Args;
  1129. int NumArgs;
  1130.  
  1131. {
  1132.  int Pos = ArgToInt(XControl,Args,NumArgs,1,1);
  1133.  
  1134.  StoreInt(XControl,Pos,XControl->ChildPid);
  1135.  
  1136.  return(XCOKAY);
  1137. }
  1138.  
  1139. /* GetPidCommand:  This function returns the process id of this process. */
  1140. /*  The argument is the number of the positional argument to put the pid */
  1141. /*  into. */
  1142.  
  1143. GetPidCommand(XControl,Args,NumArgs)
  1144.  
  1145. struct XControl *XControl;
  1146. struct Argument *Args;
  1147. int NumArgs;
  1148.  
  1149. {
  1150.  int Pos = ArgToInt(XControl,Args,NumArgs,1,1);
  1151.  
  1152.  StoreInt(XControl,Pos,getpid());
  1153.  
  1154.  return(XCOKAY);
  1155. }
  1156.  
  1157. /* MathCommand:  This function performs a mathematical operation on the */
  1158. /*  passed arguments.  The first and third arguments are the operands while */
  1159. /*  the second argument is the operation.  The fourth argument is the number */
  1160. /*  of the positional argument to store the result in. */
  1161.  
  1162. MathCommand(XControl,Args,NumArgs)
  1163.  
  1164. struct XControl *XControl;
  1165. struct Argument *Args;
  1166. int NumArgs;
  1167.  
  1168. {
  1169.  int Op1 = ArgToInt(XControl,Args,NumArgs,1,0);
  1170.  int Op2 = ArgToInt(XControl,Args,NumArgs,3,0);
  1171.  int Pos = ArgToInt(XControl,Args,NumArgs,4,1);
  1172.  int result;
  1173.  char Operation[2];
  1174.  
  1175.  ArgToString(XControl,Args,NumArgs,2,Operation,2,"");
  1176.  
  1177.  switch(Operation[0])
  1178.   {
  1179.  case '+':
  1180.   result = Op1 + Op2;
  1181.   break;
  1182.  case '-':
  1183.   result = Op1 - Op2;
  1184.   break;
  1185.  case '*':
  1186.   result = Op1 * Op2;
  1187.   break;
  1188.  case '/':
  1189.   result = Op1 / Op2;
  1190.   break;
  1191.  case '%':
  1192.   result = Op1 % Op2;
  1193.   break;
  1194.  case '&':
  1195.   result = Op1 & Op2;
  1196.   break;
  1197.  case '|':
  1198.   result = Op1 | Op2;
  1199.   break;
  1200.  default:
  1201.   return(XCERROR);
  1202.  }
  1203.  
  1204.  StoreInt(XControl,Pos,result);
  1205.  return(XCOKAY);
  1206. }
  1207.  
  1208. /* StoreStringCommand:  This function takes the first argument and stores */
  1209. /*  it in the positional argument given by the second argument. */
  1210.  
  1211. StoreStringCommand(XControl,Args,NumArgs)
  1212.  
  1213. struct XControl *XControl;
  1214. struct Argument *Args;
  1215. int NumArgs;
  1216.  
  1217. {
  1218.  char StringVal[1024];
  1219.  int Pos;
  1220.  
  1221.  ArgToString(XControl,Args,NumArgs,1,StringVal,1024,"");
  1222.  Pos = ArgToInt(XControl,Args,NumArgs,2,1);
  1223.  
  1224.  StoreString(XControl,Pos,StringVal);
  1225.  
  1226.  return(XCOKAY);
  1227. }
  1228.  
  1229. /* StringCatCommand:  This function concatenates the first two arguments */
  1230. /*  and returns the result in the positional argument specified by the third */
  1231. /*  argument. */
  1232.  
  1233. StringCatCommand(XControl,Args,NumArgs)
  1234.  
  1235. struct XControl *XControl;
  1236. struct Argument *Args;
  1237. int NumArgs;
  1238.  
  1239. {
  1240.  char String1[1024];
  1241.  char String2[512];
  1242.  int Pos;
  1243.  
  1244.  ArgToString(XControl,Args,NumArgs,1,String1,512,"");
  1245.  ArgToString(XControl,Args,NumArgs,2,String2,512,"");
  1246.  Pos = ArgToInt(XControl,Args,NumArgs,3,1);
  1247.  
  1248.  strcat(String1,String2);
  1249.  
  1250.  StoreString(XControl,Pos,String1);
  1251.  
  1252.  return(XCOKAY);
  1253. }
  1254.  
  1255. /* SaveSessionCommand:  This function save the current program state into */
  1256. /*  the session file.  It is used so that the session manager can restart */
  1257. /*  us at a later date. It takes no arguments. */
  1258.  
  1259. SaveSessionCommand(XControl,Args,NumArgs)
  1260.  
  1261. struct XControl *XControl;
  1262. struct Argument *Args;
  1263. int NumArgs;
  1264.  
  1265. {
  1266.  char *SessionFileName;
  1267.  char *SessionPathName;
  1268.  FILE *SaveFile;
  1269.  char *NewArgv[3];
  1270.  int NewArgc;
  1271.  int Value = XCOKAY;
  1272.  int i;
  1273.  
  1274.  if(!XvSessionSavePath(XControl->Top,&SessionFileName,&SessionPathName))
  1275.   Value = XCERROR;
  1276.  else
  1277.   {
  1278.    if((SaveFile = fopen(SessionFileName,"w")) == NULL)
  1279.     Value = XCERROR;
  1280.    else
  1281.     {
  1282.      fprintf(SaveFile,"%s\n",SESSION_HEADER);
  1283.      fprintf(SaveFile,"%d\n$%s\n",strlen(XControl->TerminalType),
  1284.          XControl->TerminalType);
  1285.      fprintf(SaveFile,"%d\n$%s\n",strlen(XControl->ChildCommand),
  1286.          XControl->ChildCommand);
  1287.      fprintf(SaveFile,"%d\n$%s\n",strlen(XControl->ChildCommandArguments),
  1288.          XControl->ChildCommandArguments);
  1289.      DumpCommandList(XControl,XControl->StartCommands,SaveFile);
  1290.      for(i = 0; i < NSIG; i++)
  1291.       DumpCommandList(XControl,XControl->SignalCommands[i],SaveFile);
  1292.      DumpCommandList(XControl,XControl->CloseWindowCommands,SaveFile);
  1293.      DumpCommandList(XControl,XControl->SaveCommands,SaveFile);
  1294.      DumpCommandList(XControl,XControl->EscapeCommands,SaveFile);
  1295.      DumpCommandList(XControl,XControl->TopCommands,SaveFile);
  1296.      DumpCommandList(XControl,XControl->ResizeCommands,SaveFile);
  1297.      DumpCommandList(XControl,XControl->WakeUpCommands,SaveFile);
  1298.      DumpCommandList(XControl,XControl->FlowCommands,SaveFile);
  1299.      DumpCommandList(XControl,XControl->ParentForkCommands,SaveFile);
  1300.      DumpCommandList(XControl,XControl->ChildForkCommands,SaveFile);
  1301.      DumpCommandList(XControl,XControl->DropCommands,SaveFile);
  1302.      DumpCommandList(XControl,XControl->PromptYesCommands,SaveFile);
  1303.      DumpCommandList(XControl,XControl->PromptNoCommands,SaveFile);
  1304.      DumpCommandList(XControl,XControl->PromptCancelCommands,SaveFile);
  1305.      fclose(SaveFile);
  1306.     }
  1307.   }
  1308.  
  1309.  if(Value == XCOKAY)
  1310.   {
  1311.    NewArgv[0] = XControl->ProgramName;
  1312.    NewArgv[1] = "-session";
  1313.    NewArgv[2] = SessionFileName;
  1314.    NewArgc = 3;
  1315.   }
  1316.  else
  1317.   {
  1318.    NewArgv[0] = XControl->ProgramName;
  1319.    NewArgc = 1;
  1320.   }
  1321.  XSetCommand(XtDisplay(XControl->Top),XtWindow(XControl->Top),NewArgv,NewArgc);
  1322.  
  1323.  return(XCOKAY);
  1324. }
  1325.  
  1326. /* WarningCommand:  This function puts up a warning dialog on the screen. */
  1327. /*  Note that this function returns and the command list continues executing*/
  1328. /*  while the dialog is still on the screen.  It does not wait until the */
  1329. /*  the dialog is acknowledged. */
  1330.  
  1331. WarningCommand(XControl,Args,NumArgs)
  1332.  
  1333. struct XControl *XControl;
  1334. struct Arguments *Args;
  1335. int NumArgs;
  1336.  
  1337. {
  1338.  char buffer[1024];
  1339.  
  1340.  ArgToString(XControl,Args,NumArgs,1,buffer,1024,"");
  1341.  XWarning(XControl,buffer);
  1342.  
  1343.  return(XCOKAY);
  1344. }
  1345.  
  1346.  
  1347. /* GetDropNumberCommand:  This function gets the number of file types and */
  1348. /*  files that was dropped onto us last.  The first argument is the position */
  1349. /*  to return the number for file types and the second argument is the */
  1350. /*  position to return the file argument. */
  1351.  
  1352. GetDropNumberCommand(XControl,Args,NumArgs)
  1353.  
  1354. struct XControl *XControl;
  1355. struct Arguments *Args;
  1356. int NumArgs;
  1357.  
  1358. {
  1359.  int TypePosition = ArgToInt(XControl,Args,NumArgs,1,1);
  1360.  int FilePosition = ArgToInt(XControl,Args,NumArgs,2,2);
  1361.  
  1362.  StoreInt(XControl,TypePosition,XControl->NumberTypesDropped);
  1363.  StoreInt(XControl,FilePosition,XControl->NumberFilesDropped);
  1364.  
  1365.  return(XCOKAY);
  1366. }
  1367.  
  1368. /* GetDropHost:  This function gets the name of the host that the last drop */
  1369. /*  came from and puts it into the argument given by the first argument */
  1370.  
  1371. GetDropHostCommand(XControl,Args,NumArgs)
  1372.  
  1373. struct XControl *XControl;
  1374. struct Arguments *Args;
  1375. int NumArgs;
  1376.  
  1377. {
  1378.  int Pos = ArgToInt(XControl,Args,NumArgs,1,1);
  1379.  
  1380.  StoreString(XControl,Pos,XControl->DropFiles[0]);
  1381.  
  1382.  return(XCOKAY);
  1383. }
  1384.  
  1385. /* GetDropType: This function returns the type of specific entry in the last */
  1386. /*  drop.  The first argument is the number of the entry to return and the */
  1387. /*  second argument is the position to return the value in. */
  1388.  
  1389. GetDropTypeCommand(XControl,Args,NumArgs)
  1390.  
  1391. struct XControl *XControl;
  1392. struct Arguments *Args;
  1393. int NumArgs;
  1394. {
  1395.  int Which = ArgToInt(XControl,Args,NumArgs,1,1);
  1396.  int Pos = ArgToInt(XControl,Args,NumArgs,2,1);
  1397.  
  1398.  if((Which > XControl->NumberTypesDropped) || (Which <= 0))
  1399.   return(XCERROR);
  1400.  
  1401.  StoreString(XControl,Pos,XControl->DropTypes[Which - 1]);
  1402.  return(XCOKAY);
  1403. }
  1404.  
  1405. /* GetDropDirectory:  This function returns the name of the directory that */
  1406. /*  drop to place from, if it was specified or a zero length string if not. */
  1407. /*  The first argument is the position to put the directory name. */
  1408.  
  1409. GetDropDirectoryCommand(XControl,Args,NumArgs)
  1410.  
  1411. struct XControl *XControl;
  1412. struct Arguments *Args;
  1413. int NumArgs;
  1414.  
  1415. {
  1416.  int Pos = ArgToInt(XControl,Args,NumArgs,1,1);
  1417.  
  1418.  if(strcmp(XControl->DropFiles[1],"-") == 0)
  1419.   StoreString(XControl,Pos,"");
  1420.  else
  1421.   StoreString(XControl,Pos,XControl->DropFiles[1]);
  1422.  
  1423.  return(XCOKAY);
  1424. }
  1425.  
  1426. /* GetDropFile:  This function returns the spefied drop file from the last */
  1427. /*  drop.  The first argument is the particular file to return.  The second */
  1428. /*  argument is the position to return the result in. */
  1429.  
  1430. GetDropFileCommand(XControl,Args,NumArgs)
  1431.  
  1432. struct XControl *XControl;
  1433. struct Arguments *Args;
  1434. int NumArgs;
  1435.  
  1436. {
  1437.  int Which = ArgToInt(XControl,Args,NumArgs,1,1);
  1438.  int Pos = ArgToInt(XControl,Args,NumArgs,2,1);
  1439.  
  1440.  if((Which > XControl->NumberFilesDropped) || (Which < 0))
  1441.   return(XCERROR);
  1442.  else
  1443.   StoreString(XControl,Pos,XControl->DropFiles[Which+1]);
  1444.  return(XCOKAY);
  1445. }
  1446.  
  1447. /* GetTerminalType:  This function returns the name of the type of terminal */
  1448. /*  that is being used.  The first argument is the number of the positional */
  1449. /*  where the result is stored. */
  1450.  
  1451. GetTerminalTypeCommand(XControl,Args,NumArgs)
  1452.  
  1453. struct XControl *XControl;
  1454. struct Arguments *Args;
  1455. int NumArgs;
  1456.  
  1457. {
  1458.  int Pos = ArgToInt(XControl,Args,NumArgs,1,1);
  1459.  
  1460.  StoreString(XControl,Pos,XControl->TerminalType);
  1461.  
  1462.  return(XCOKAY);
  1463. }
  1464.  
  1465. /* GetWindowSize:  This function returns the size of the pty widget in */
  1466. /*  rows and columns.  The first argument is the position to store the */
  1467. /*  row number in and the second is the position for the column. */
  1468.  
  1469. GetWindowSizeCommand(XControl,Args,NumArgs)
  1470.  
  1471. struct XControl *XControl;
  1472. struct Arguments *Args;
  1473. int NumArgs;
  1474.  
  1475. {
  1476.  int RowPosition = ArgToInt(XControl,Args,NumArgs,1,1);
  1477.  int ColPosition = ArgToInt(XControl,Args,NumArgs,2,2);
  1478.  int rows,cols;
  1479.  Arg XArgs[10];
  1480.  int n = 0;
  1481.  
  1482.  XtSetArg(XArgs[n],XtNrows,&rows); n++;
  1483.  XtSetArg(XArgs[n],XtNcolumns,&cols); n++;
  1484.  XtGetValues(XControl->Terminal,XArgs,n);
  1485.  
  1486.  StoreInt(XControl,RowPosition,rows);
  1487.  StoreInt(XControl,ColPosition,cols);
  1488.  
  1489.  return(XCOKAY);
  1490. }
  1491. @EOF
  1492. set `wc -lwc <xcontrol/Command.c`
  1493. if test $1$2$3 != 933250923854
  1494. then
  1495.     echo ERROR: wc results of xcontrol/Command.c are $* should be 933 2509 23854
  1496. fi
  1497.  
  1498. chmod 644 xcontrol/Command.c
  1499.  
  1500. echo x - xcontrol/XControl.c
  1501. cat >xcontrol/XControl.c <<'@EOF'
  1502. /* XControl.c : This file contains the XControl program.  It is X window */
  1503. /*  client which is designed to control window dumb program.  It is like */
  1504. /*  an hpterm in slave mode only much more intelligent. */
  1505. /* History:                                 */
  1506. /*         Written by G. R. Strachan 1992 */
  1507.  
  1508. /*  Copyright Gordon R. Strachan 1992 */
  1509. /*  This code is provided as is, neither the University of Waterloo nor */
  1510. /*  the author is liable for any damage caused by the use or misuse of this */
  1511. /*  code.  */
  1512.  
  1513. /* Permission is granted to copy, use and modify this code provided it is */
  1514. /* not sold for profit and the above copyright remains intact. */
  1515.  
  1516. #include <stdio.h>
  1517. #include <varargs.h>
  1518. #include <fcntl.h>
  1519. #include <unistd.h>
  1520. #include <sys/types.h>
  1521. #include <signal.h>
  1522. #include <X11/X.h>
  1523. #include <X11/Intrinsic.h>
  1524. #include <X11/StringDefs.h>
  1525. #include <Xm/Xm.h>
  1526. #include <X11/Protocols.h>
  1527.  
  1528. #include "XControl.h"
  1529. #include "Pty.h"
  1530.  
  1531. #define XCCommands "CommandList"
  1532. #define SigResource(a,b,c,d) a,b,XCCommands,sizeof(struct CommandList *),\
  1533. XtOffset(XControlPtr,SignalCommands[(c)]),XtRString,d
  1534.  
  1535. extern ReapCommand();
  1536. extern QuitCommand();
  1537. extern WriteCommand();
  1538. extern SignalCommand();
  1539. extern PromptCommand();
  1540. extern TimeOutCommand();
  1541. extern RemoveTimeOutCommand();
  1542. extern SleepCommand();
  1543. extern AbortCommand();
  1544. extern GetEnvCommand();
  1545. extern SetEnvCommand();
  1546. extern IfCommand();
  1547. extern GetChildPidCommand();
  1548. extern GetPidCommand();
  1549. extern MathCommand();
  1550. extern StoreStringCommand();
  1551. extern StringCatCommand();
  1552. extern SaveSessionCommand();
  1553. extern WarningCommand();
  1554. extern GetDropNumberCommand();
  1555. extern GetDropHostCommand();
  1556. extern GetDropTypeCommand();
  1557. extern GetDropDirectoryCommand();
  1558. extern GetDropFileCommand();
  1559. extern GetTerminalTypeCommand();
  1560. extern GetWindowSizeCommand();
  1561.  
  1562. extern struct CommandList *LoadCommandList();
  1563.  
  1564. XtPointer BuildCallStruct();
  1565. char **BuildArgList();
  1566. void PtyCB();
  1567. void KeyCB();
  1568. void SignalCB();
  1569. void SignalHandler();
  1570. void CommandCB();
  1571. void PopDownCB();
  1572. void TimeOutCB();
  1573. char *LoadString();
  1574. void ActionCB();
  1575. void DropCB();
  1576. void ResizeCB();
  1577. void RequestCB();
  1578.  
  1579. CommandListConverter();
  1580.  
  1581. typedef struct XControl *XControlPtr;
  1582. extern int errno;
  1583.  
  1584. struct FunctionList Functions[]=
  1585. {
  1586.  {"Reap",ReapCommand},
  1587.  {"Quit",QuitCommand},
  1588.  {"Write",WriteCommand},
  1589.  {"Signal",SignalCommand},
  1590.  {"Prompt",PromptCommand},
  1591.  {"TimeOut",TimeOutCommand},
  1592.  {"RemoveTimeOut",RemoveTimeOutCommand},
  1593.  {"Sleep",SleepCommand},
  1594.  {"Abort",AbortCommand},
  1595.  {"GetEnv",GetEnvCommand},
  1596.  {"SetEnv",SetEnvCommand},
  1597.  {"If",IfCommand},
  1598.  {"GetChildPid",GetChildPidCommand},
  1599.  {"GetPid",GetPidCommand},
  1600.  {"Math",MathCommand},
  1601.  {"StoreString",StoreStringCommand},
  1602.  {"StringCat",StringCatCommand},
  1603.  {"SaveSession",SaveSessionCommand},
  1604.  {"Warning",WarningCommand},
  1605.  {"GetDropNumber",GetDropNumberCommand},
  1606.  {"GetDropHost",GetDropHostCommand},
  1607.  {"GetDropType",GetDropTypeCommand},
  1608.  {"GetDropDirectory",GetDropDirectoryCommand},
  1609.  {"GetDropFile",GetDropFileCommand},
  1610.  {"GetTerminalType",GetTerminalTypeCommand},
  1611.  {"GetWindowSize",GetWindowSizeCommand},
  1612.  {NULL,NULL},
  1613. };
  1614.  
  1615. static XtResource resources[] = 
  1616. {
  1617.  {"startCommands","StartCommands",XCCommands,sizeof(struct CommandList *),
  1618.    XtOffset(XControlPtr,StartCommands),XtRString,NULL},
  1619.  {"terminalType","TerminalType",XtRString,sizeof(char *),
  1620.    XtOffset(XControlPtr,TerminalType),XtRString,"hpterm"},
  1621.  {"childCommand","ChildCommand",XtRString,sizeof(char *),
  1622.    XtOffset(XControlPtr,ChildCommand),XtRString,"/bin/csh"},
  1623.  {"childArguments","ChildArguments",XtRString,sizeof(char *),
  1624.    XtOffset(XControlPtr,ChildCommandArguments),XtRString,NULL},
  1625.  {SigResource("SigHangUpCommands","SigHangUpCommands",SIGHUP,NULL)},
  1626.  {SigResource("sigInterruptCommands","SigInterruptCommands",SIGINT,NULL)},
  1627.  {SigResource("sigQuitCommmands","SigQuitCommands",SIGQUIT,NULL)},
  1628.  {SigResource("sigPipeCommands","SigPipeCommands",SIGPIPE,NULL)},
  1629.  {SigResource("sigAlarmCommands","SigAlarmCommands",SIGALRM,NULL)},
  1630.  {SigResource("sigTermCommands","SigTermCommands",SIGTERM,NULL)},
  1631.  {SigResource("sigUsr1Commands","SigUsr1Commands",SIGUSR1,NULL)},
  1632.  {SigResource("sigUsr2Commands","SigUsr2Commands",SIGUSR2,NULL)},
  1633.  {SigResource("sigChildCommands","SigChildCommands",SIGCHLD,
  1634.           "Reap(1);Quit(1)")},
  1635.  {SigResource("sigIOCommands","SigIOCommands",SIGIO,NULL)},
  1636.  {SigResource("sigWindowCommands","SigWindowCommands",SIGWINDOW,NULL)},
  1637.  {SigResource("sigStopCommands","SigStopCommands",SIGSTOP,NULL)},
  1638.  {SigResource("sigContinueCommands","SigContinueCommands",SIGCONT,NULL)},
  1639.  {SigResource("sigUrgentCommands","SigUrgentCommands",SIGURG,NULL)},
  1640.  {"closeWindowCommands","CloseWindowCommands",XCCommands,
  1641.    sizeof(struct CommandList *),XtOffset(XControlPtr,CloseWindowCommands),
  1642.     XtRString,"Quit(0)"},
  1643.  {"saveCommands","SaveCommands",XCCommands,
  1644.    sizeof(struct CommandList *),XtOffset(XControlPtr,SaveCommands),
  1645.    XtRString,"SaveSession()"},
  1646.  {"topCommands","TopCommands",XCCommands,sizeof(struct CommandList*),
  1647.    XtOffset(XControlPtr,TopCommands),XtRString,NULL},
  1648.  {"escapeCommands","EscapeCommands",XCCommands,sizeof(struct CommandList *),
  1649.    XtOffset(XControlPtr,EscapeCommands),XtRString,NULL},
  1650.  {"resizeCommands","ResizeCommands",XCCommands,sizeof(struct CommandList *),
  1651.    XtOffset(XControlPtr,ResizeCommands),XtRString,NULL},
  1652.  {"wakeUpCommands","WakeUpCommands",XCCommands,sizeof(struct CommandList *),
  1653.    XtOffset(XControlPtr,WakeUpCommands),XtRString,NULL},
  1654.  {"flowCommands","FlowCommands",XCCommands,sizeof(struct CommandList *),
  1655.    XtOffset(XControlPtr,FlowCommands),XtRString,NULL},
  1656.  {"parentForkCommands","ParentForkCommands",XCCommands,
  1657.    sizeof(struct CommandList *),XtOffset(XControlPtr,ParentForkCommands),
  1658.    XtRString,NULL},
  1659.  {"childForkCommands","ChildForkCommands",XCCommands,
  1660.    sizeof(struct CommandList *),XtOffset(XControlPtr,ChildForkCommands),
  1661.    XtRString,NULL},
  1662.  {"dropCommands","DropCommands",XCCommands,sizeof(struct CommandList *),
  1663.    XtOffset(XControlPtr,DropCommands),XtRString,NULL},
  1664.  {"sessionFile","SessionFile",XtRString,sizeof(char *),
  1665.    XtOffset(XControlPtr,SessionFile),XtRString,NULL},
  1666.  {"dropZoneType","DropZoneType",XtRString,sizeof(char *),
  1667.    XtOffset(XControlPtr,DropZoneType),XtRString,"FileEdit"},
  1668.  {"remoteDropsAllowed","RemoteDropsAllowed",XtRBoolean,sizeof(Boolean),
  1669.    XtOffset(XControlPtr,RemoteDropsAllowed),XtRImmediate,False},
  1670. };
  1671.  
  1672. static XrmOptionDescRec options[] =
  1673. {
  1674.  {"-hpterm","*terminalType",XrmoptionNoArg,"hpterm"},
  1675.  {"+hpterm","*terminalType",XrmoptionNoArg,"xterm"},
  1676.  {"-xterm","*terminalType",XrmoptionNoArg,"xterm"},
  1677.  {"-command","*childCommand",XrmoptionSepArg,NULL},
  1678.  {"-arguments","*childArguments",XrmoptionSepArg,NULL},
  1679.  {"-session","*sessionFile",XrmoptionSepArg,NULL},
  1680. };
  1681.  
  1682. char Syntax[] =
  1683. "-hpterm\n\
  1684. +hpterm\n\
  1685. -xterm\n\
  1686. -command command_path\n\
  1687. -arguments \"child command arguments\"\n\
  1688. -session sessionfile\n\
  1689. ";
  1690.  
  1691. static XtConvertArgRec CvtArgs[] =
  1692. {
  1693.  {XtAddress,(XtPointer) NULL,sizeof(struct XControl *)},
  1694. };
  1695.  
  1696. static XtActionsRec Actions[]=
  1697. {
  1698.  {"execute_command",ActionCB},
  1699. };
  1700.  
  1701. int SigSink;     /* the pipeline signals are written into */
  1702. struct XControl XControl;
  1703.  
  1704. main(argc,argv)
  1705.  
  1706. int argc;
  1707. char **argv;
  1708.  
  1709. {
  1710.  Widget MainWindow;
  1711.  Widget Terminal;
  1712.  Widget button;
  1713.  Arg args[20];
  1714.  int n = 0;
  1715.  int i;
  1716.  Atom DeleteWindow;
  1717.  Atom SaveAtom;
  1718.  
  1719.  CvtArgs[0].address_id = (XtPointer) &XControl;
  1720.  
  1721.  XControl.ProgramName = argv[0];
  1722.  XControl.Functions = Functions;
  1723.  XControl.NumberPositions = 0;
  1724.  XControl.PositionalArgs = NULL;
  1725.  
  1726.  
  1727.  i = strlen(argv[0]);
  1728.  while((--i >= 0) && (argv[0][i] != '/'));
  1729.  XControl.Top = XtAppInitialize(&(XControl.App),&argv[0][i+1],options,
  1730.                    XtNumber(options),&argc,argv,NULL,0,0);
  1731.  if(argc != 1)  /* if left over options then there is a mistake */
  1732.   {
  1733.    Warning(&XControl,"Invalid option %s\n",argv[1]);
  1734.    Warning(&XControl,"%s accepts all normal Xt options plus:\n%s",argv[0],
  1735.        Syntax);
  1736.    exit(1);
  1737.   }
  1738.  
  1739.  XtAppAddActions(XControl.App,Actions,XtNumber(Actions));
  1740.  
  1741.  XvAppInit(XControl.App,XtDisplay(XControl.Top),argv[0]);
  1742.  XvRegisterDropCallback(DropCB);
  1743.  XtSetTypeConverter(XtRString,"CommandList",CommandListConverter,&CvtArgs,
  1744.             1,XtCacheAll,NULL);
  1745.  XtGetApplicationResources(XControl.Top,&XControl,resources,
  1746.                XtNumber(resources),NULL,0);
  1747.  
  1748.  if(XControl.SessionFile != NULL)
  1749.   LoadSession(&XControl);
  1750.  
  1751.  BuildChildCommand(&XControl);
  1752.  
  1753.  SetUpSignals(&XControl,XControl.App);
  1754.  
  1755.  
  1756.  MainWindow = XmCreateMainWindow(XControl.Top,"main",args,n);
  1757.  XtManageChild(MainWindow);
  1758.  
  1759.  Terminal = XtCreateWidget(XControl.TerminalType,ptyWidgetClass,MainWindow,
  1760.                args,n);
  1761.  XtManageChild(Terminal);
  1762.  XtAddCallback(Terminal,XtNptyCallback,PtyCB,(XtPointer)&XControl);
  1763.  XtAddCallback(Terminal,XtNkbdCallback,KeyCB,(XtPointer)&XControl);
  1764.  XtAddCallback(Terminal,XtNresizeCallback,ResizeCB,(XtPointer)&XControl);
  1765.  XControl.Terminal = Terminal;
  1766.  
  1767.  n = 0;
  1768.  XControl.Message = XmCreateMessageDialog(MainWindow,"message",args,n);
  1769.  XtAddCallback(XControl.Message,XmNokCallback,CommandCB,
  1770.            BuildCallStruct(&XControl,&XControl.PromptYesCommands,False,
  1771.                    True));
  1772.  XtAddCallback(XControl.Message,XmNcancelCallback,CommandCB,
  1773.            BuildCallStruct(&XControl,&XControl.PromptCancelCommands,
  1774.                    False,True));
  1775.  XtAddCallback(XControl.Message,XmNhelpCallback,CommandCB,
  1776.            BuildCallStruct(&XControl,&XControl.PromptNoCommands,False,
  1777.                    True));
  1778.  XtAddCallback(XControl.Message,XmNhelpCallback,PopDownCB,XControl.Message);
  1779.  
  1780.  n = 0;
  1781.  XtSetArg(args[n],XmNtitle,"Warning!"); n++;
  1782.  XControl.Warning = XmCreateWarningDialog(MainWindow,"Error",args,n);
  1783.  button = XmMessageBoxGetChild(XControl.Warning,XmDIALOG_CANCEL_BUTTON);
  1784.  XtUnmanageChild(button);
  1785.  button = XmMessageBoxGetChild(XControl.Warning,XmDIALOG_HELP_BUTTON);
  1786.  XtUnmanageChild(button);
  1787.  
  1788.  XtRealizeWidget(XControl.Top);
  1789.  
  1790. /* we now add call backs to handle any of the functions that have commands */
  1791. /* bound to them. */
  1792.  
  1793.  if(XControl.CloseWindowCommands != NULL)
  1794.   {
  1795.    DeleteWindow = XmInternAtom(XtDisplay(XControl.Top),"WM_DELETE_WINDOW",
  1796.                    False);
  1797.    XmAddWMProtocolCallback(XControl.Top,DeleteWindow,CommandCB,
  1798.                BuildCallStruct(&XControl,
  1799.                        XControl.CloseWindowCommands,
  1800.                        True,False));
  1801.   }
  1802.  if(XControl.SaveCommands != NULL)
  1803.   {
  1804.    SaveAtom = XmInternAtom(XtDisplay(XControl.Top),"WM_SAVE_YOURSELF",False);
  1805.    XmAddWMProtocolCallback(XControl.Top,SaveAtom,CommandCB,
  1806.                BuildCallStruct(&XControl,
  1807.                        XControl.SaveCommands,
  1808.                        True,False));
  1809.   }
  1810.  if(XControl.ResizeCommands != NULL)
  1811.   XtAddCallback(Terminal,XtNresizeCallback,CommandCB,
  1812.         BuildCallStruct(&XControl,XControl.ResizeCommands,
  1813.                 True,False));
  1814.  if(XControl.EscapeCommands != NULL)
  1815.   XtAddCallback(Terminal,XtNescCallback,CommandCB,
  1816.         BuildCallStruct(&XControl,XControl.EscapeCommands,
  1817.                 True,False));
  1818.  if(XControl.WakeUpCommands != NULL)
  1819.   XtAddCallback(Terminal,XtNwakeUpCallback,CommandCB,
  1820.         BuildCallStruct(&XControl,XControl.WakeUpCommands,
  1821.                 True,False));
  1822.  if(XControl.FlowCommands != NULL)
  1823.   XtAddCallback(Terminal,XtNflowCallback,CommandCB,
  1824.         BuildCallStruct(&XControl,XControl.FlowCommands,True,False));
  1825.  if(XControl.TopCommands != NULL)
  1826.   XtAddCallback(Terminal,XtNtopCallback,CommandCB,
  1827.         BuildCallStruct(&XControl,XControl.TopCommands,True,False));
  1828.  
  1829.  if(XControl.CloseWindowCommands != NULL) 
  1830.   {   /* these commands will handle the close*/
  1831.    n = 0;
  1832.    XtSetArg(args[n],XmNdeleteResponse,XmDO_NOTHING); n++;
  1833.    XtSetValues(XControl.Top,args,n);
  1834.   }
  1835.  
  1836.  XtAppMainLoop(XControl.App);
  1837. }
  1838.  
  1839. Error(va_alist)
  1840.  
  1841. va_dcl
  1842. {
  1843.  va_list args;
  1844.  struct XControl *XControl;
  1845.  char *format;
  1846.  
  1847.  va_start(args);
  1848.  XControl = va_arg(args,struct XControl *);
  1849.  format = va_arg(args,char *);
  1850.  vfprintf(stderr,format,args);
  1851.  va_end(args);
  1852.  exit(1);
  1853. }
  1854.  
  1855.  
  1856. Warning(va_alist)
  1857.  
  1858. va_dcl
  1859. {
  1860.  va_list args;
  1861.  struct XControl *XControl;
  1862.  char *format;
  1863.  
  1864.  va_start(args);
  1865.  XControl = va_arg(args,struct XControl *);
  1866.  format = va_arg(args,char *);
  1867.  vfprintf(stderr,format,args);
  1868.  va_end(args);
  1869. }
  1870.  
  1871. /* BuildCallStruct:  This function returns a call structure which contains */
  1872. /*  all the information a callback routine will need. */
  1873.  
  1874. XtPointer BuildCallStruct(XControl,Commands,Direct,Dynamic)
  1875.  
  1876. struct XControl *XControl;
  1877. struct CommandList *Commands;
  1878. int Direct;
  1879. int Dynamic;
  1880.  
  1881. {
  1882.  struct CallStruct *new;
  1883.  
  1884.  new = (struct CallStruct *) XtMalloc(sizeof(struct CallStruct));
  1885.  
  1886.  new->XControl = XControl;
  1887.  new->Commands = Commands;
  1888.  new->Direct = Direct;
  1889.  new->Dynamic = Dynamic;
  1890.  
  1891.  return(new);
  1892. }
  1893.  
  1894. /* BuildChildCommand:  This function takes the ChildCommand and the */
  1895. /*  ChildCommandArguments and generates the argument list that will be passed*/
  1896. /*  to exec to launch the child. */
  1897.  
  1898. BuildChildCommand(XControl)
  1899.  
  1900.  
  1901. struct XControl *XControl;
  1902.  
  1903. {
  1904.  int i,k;
  1905.  int nargs = 1;
  1906.  char *buffer;
  1907.  char *p;
  1908.  char **args;
  1909.  int len;
  1910.  
  1911.  len = strlen(XControl->ChildCommand);
  1912.  buffer = (char *) XtMalloc(sizeof(char) * (len + 1));
  1913.  strcpy(buffer,XControl->ChildCommand);
  1914.  
  1915.  i = len;
  1916.  while((--i >= 0) && (buffer[i] != '/'));
  1917.  XControl->ChildArgv = (char**)XtMalloc(sizeof(char *));
  1918.  XControl->ChildArgv[0] = &buffer[i+1];
  1919.  
  1920.  len = strlen(XControl->ChildCommandArguments) + 1;
  1921.  buffer = (char *) XtMalloc(sizeof(char) * (len + 1));
  1922.  
  1923.  args = BuildArgList(XControl,XControl->ChildCommandArguments,&nargs);
  1924.  XControl->ChildArgv = (char **)XtRealloc(XControl->ChildArgv,
  1925.                       sizeof(char *) * (nargs + 1));
  1926.  for(i = 0; i < nargs; i++)
  1927.   XControl->ChildArgv[i+1] = args[i];
  1928. }
  1929.  
  1930. /* BuildArgList:  This function takes a character string and builds an */
  1931. /*  arglist (array of character strings) from it.  The individual pieces */
  1932. /*  in the string are delimited by spaces unless they are imbedded in quotes */
  1933.  
  1934. char **BuildArgList(XControl,string,nargs)
  1935.  
  1936. struct XControl *XControl;
  1937. char *string;
  1938. int *nargs;
  1939. {
  1940.  int i,k;
  1941.  char *p;
  1942.  char *buffer;
  1943.  char **args = NULL;
  1944.  
  1945.  *nargs = 0;
  1946.  i = 0;
  1947.  p = string;
  1948.  buffer = XtMalloc(strlen(string) + 1);
  1949.  
  1950.  while(*p != NULL)
  1951.   {
  1952.    k = 0;
  1953.    while((*p == ' ') &&  (*p != NULL))
  1954.     *p++;
  1955.    while((*p != ' ') && (*p != NULL))
  1956.     {
  1957.      if(*p == '\\')
  1958.       buffer[k++] = *++p;
  1959.      else if(*p == '\"')
  1960.       {
  1961.        while((*++p != '\"') && (*p != NULL))
  1962.     {
  1963.      if(*p == '\\')
  1964.       buffer[k++] = *++p;
  1965.      else
  1966.       buffer[k++] = *p;
  1967.     }
  1968.       }
  1969.      else
  1970.       buffer[k++] = *p;
  1971.      p++;
  1972.     }
  1973.    buffer[k] = NULL;
  1974.    if(k != 0)
  1975.     {
  1976.      (*nargs)++;
  1977.      args = (char **)XtRealloc(args,sizeof(char *) * (*nargs));
  1978.      args[*nargs-1] = (char *) XtMalloc(sizeof(char) * strlen(buffer) + 1);
  1979.      strcpy(args[*nargs-1],buffer);
  1980.     }
  1981.   }
  1982.  (*nargs)++;
  1983.  args = (char **) XtRealloc(args,  sizeof(char *) * (*nargs));
  1984.  args[*nargs-1] = NULL;
  1985.  XtFree(buffer);
  1986.  return(args);
  1987. }
  1988.  
  1989. /* SetUpSignals:  This function sets up the signal handler routines for the */
  1990. /*  program.  Since X is not safe for signals, we us a pipe to store the */
  1991. /*  signals in.  When ever a signal occures, the signal handler simply writes*/
  1992. /*  the number of the signal into the pipe.  An input handler will then be */
  1993. /*  called to read in the signal number and it will be properly handled */
  1994. /*  there. */
  1995.  
  1996. SetUpSignals(XControl,App)
  1997.  
  1998. struct XControl *XControl;
  1999. XtAppContext App;
  2000. {
  2001.  int pipeline[2];
  2002.  XtInputId SigInputId;
  2003.  struct sigvec Sig;
  2004.  
  2005.  pipe(pipeline);
  2006.  XControl->SignalPipeline = pipeline[0];
  2007.  SigSink = pipeline[1];
  2008.  
  2009.  SigInputId = XtAppAddInput(App,pipeline[0],XtInputReadMask,SignalCB,
  2010.                 (XtPointer)XControl);
  2011.  
  2012.  Sig.sv_handler = SignalHandler;
  2013.  Sig.sv_mask = 0;
  2014.  Sig.sv_flags = SV_RESETHAND;
  2015.  
  2016.  sigvector(SIGHUP,&Sig,NULL);
  2017.  sigvector(SIGINT,&Sig,NULL);
  2018.  sigvector(SIGQUIT,&Sig,NULL);
  2019.  /*sigvector(SIGPIPE,&Sig,NULL);*/
  2020.  sigvector(SIGALRM,&Sig,NULL);
  2021.  sigvector(SIGUSR1,&Sig,NULL);
  2022.  sigvector(SIGUSR2,&Sig,NULL);
  2023.  sigvector(SIGCHLD,&Sig,NULL);
  2024.  sigvector(SIGIO,&Sig,NULL);
  2025.  sigvector(SIGWINDOW,&Sig,NULL);
  2026.  sigvector(SIGSTOP,&Sig,NULL);
  2027.  sigvector(SIGCONT,&Sig,NULL);
  2028.  sigvector(SIGURG,&Sig,NULL);
  2029. }
  2030.  
  2031. /* SignalHandler:  This is the signal handler routine.  It simply writes the */
  2032. /*  signal number into the signal pipeline.  The XtInput handler will do the */
  2033. /*  rest of the work. */
  2034.  
  2035. void SignalHandler(sig)
  2036.  
  2037. int sig;
  2038.  
  2039. {
  2040.  write(SigSink,&sig,sizeof(int));
  2041. }
  2042.  
  2043. /* SignalCB:  This is the signal callback routine.  It is called whenever */
  2044. /*  there is a signal waiting to be read from the signal pipeline.  It reads */
  2045. /*  in the signal number and then executes whatever command list is bound */
  2046. /*  to the signal.  */
  2047.  
  2048. void SignalCB(client,source,id)
  2049.  
  2050. XtPointer client;
  2051. int *source;
  2052. XtInputId *id;
  2053.  
  2054. {
  2055.  struct XControl *XControl = (struct XControl *) client;
  2056.  struct sigvec Sigv;
  2057.  int Sig;
  2058.  
  2059.  read(XControl->SignalPipeline,&Sig,sizeof(int));
  2060.  
  2061.  if(Sig < NSIG)
  2062.   {
  2063.    ExecuteCommandList(XControl,XControl->SignalCommands[Sig]);
  2064.    Sigv.sv_handler = SignalHandler;
  2065.    Sigv.sv_mask = 0;
  2066.    Sigv.sv_flags = SV_RESETHAND;
  2067.    sigvector(Sig,&Sigv,NULL);
  2068.   }
  2069.  else
  2070.   Warning(XControl,"Caught a funny Signal %d\n",Sig);
  2071. }
  2072.  
  2073. /* CommandListConverter:  This is the XtResource converter for the */
  2074. /*  CommandList.  It takes a character string and builds the command list */
  2075. /*  from it. */
  2076.  
  2077. CommandListConverter(display,args,num_args,from,to,converter_data)
  2078.  
  2079. Display *display;
  2080. XrmValue *args;
  2081. Cardinal *num_args;
  2082. XrmValue *from;
  2083. XrmValue *to;
  2084. XrmValue *converter_data;
  2085.  
  2086. {
  2087.  struct XControl *XControl = (struct XControl *)args->addr;
  2088.  struct CommandList *temp;
  2089.  struct CommandList **position;
  2090.  
  2091.  temp = ParseString(XControl,from->addr);
  2092.  position = (struct CommandList **)to->addr;
  2093.  *position = temp;
  2094.  to->size = sizeof(struct CommandList *);
  2095.  
  2096.  return(True);
  2097. }
  2098.  
  2099. /* PtyCB:  This is the Pty callback handler.  When called with a reason */
  2100. /*  reason of open it launches the child process and then installs our  */
  2101. /*  Vue drop callback handler. */
  2102.  
  2103. void PtyCB(w,XControl,reason)
  2104.  
  2105. Widget w;
  2106. struct XControl *XControl;
  2107. PtyCallback *reason;
  2108.  
  2109. {
  2110.  Arg args[10];
  2111.  int n = 0;
  2112.  char *name;
  2113.  
  2114.  if(reason->reason == PTY_OPEN)
  2115.   {
  2116.    XtSetArg(args[n],XtNslavePtyName,&name); n++;
  2117.    XtGetValues(w,args,n);
  2118.  
  2119.    LaunchChild(w,XControl,reason,name);
  2120.  
  2121.    SetDragWindow(XControl);
  2122.   }
  2123. }
  2124.  
  2125. /* SetDragWindow:  This function registers the terminal widget window as a */
  2126. /*  valid drop window with the drag controller.  Drops will be allowed in */
  2127. /*  the entire window. */
  2128.  
  2129. SetDragWindow(XControl)
  2130.  
  2131. struct XControl *XControl;
  2132.  
  2133. {
  2134.  Arg args[10];
  2135.  int n = 0;
  2136.  char buffer[256];
  2137.  char *string;
  2138.  Pixel top,bottom;
  2139.  Dimension width,height;
  2140.  
  2141.  XSync(XtDisplay(XControl->Terminal),False);
  2142.  n = 0;
  2143.  XtSetArg(args[n],XmNtopShadowColor,&top); n++;
  2144.  XtSetArg(args[n],XmNbottomShadowColor,&bottom); n++;
  2145.  XtSetArg(args[n],XmNwidth,&width); n++;
  2146.  XtSetArg(args[n],XmNheight,&height); n++;
  2147.  XtGetValues(XControl->Terminal,args,n);
  2148.  
  2149.  sprintf(buffer,"=%dx%d+1+1-%s",width-2,height-2,XControl->DropZoneType);
  2150.  errno = 0;
  2151.  XvRegisterDragWindow(XtDisplay(XControl->Terminal),
  2152.               XtWindow(XControl->Terminal),1,top,bottom,buffer,buffer,
  2153.               (XtPointer)XControl);
  2154.  if(errno != 0)
  2155.   perror("XvRegisterDragWindow");
  2156.  XvFlushBatchRequests();
  2157.  /*XeSendRequest("FILEMGR"," REMOVE_TRASH",NULL,
  2158.            "maxwell:/users/gordon/general/xcontrol/core",NULL);
  2159.  string = buffer;
  2160.  n = 256;
  2161.  XeAddMsgCallback(RequestCB,"* * R XCONTROL * * * ",
  2162.           "blah2",NULL);*/
  2163.  /*XeSendRequest("XCONTROL","TEST",NULL," ",NULL);*/
  2164. }
  2165.  
  2166. /* LaunchChild:  This function launches the child process.  It first executes*/
  2167. /*  any commands bound to the StartCommands resource.  It then forks and */
  2168. /*  sets up the child environment and executes any command bound to the */
  2169. /*  PreLaunch resource.  Finally, it exec's the child process. */
  2170.  
  2171. LaunchChild(w,XControl,reason,SlaveName)
  2172.  
  2173. Widget w;
  2174. struct XControl *XControl;
  2175. PtyCallback *reason;
  2176. char *SlaveName;
  2177.  
  2178.  
  2179. {
  2180.  int fd;
  2181.  int i;
  2182.  int tblsize;
  2183.  
  2184. /* first execute the startup commands (if any) */
  2185.  
  2186.  ExecuteCommandList(XControl,XControl->StartCommands);
  2187.  
  2188.  close(reason->SlavePtyDescriptor);
  2189.  
  2190.  if((XControl->ChildPid = fork()) == 0)
  2191.   {   /* child process */
  2192.    tblsize = sysconf(_SC_OPEN_MAX);
  2193.    for(i = 0; i < tblsize; i++)
  2194.     close(i);
  2195.  
  2196.    setsid();
  2197.    
  2198.    fd = open(SlaveName,O_RDWR);
  2199.    dup(fd);
  2200.    dup(fd); 
  2201.  
  2202.    ExecuteCommandList(XControl,XControl->ChildForkCommands);
  2203.  
  2204.    execv(XControl->ChildCommand,XControl->ChildArgv);
  2205.    exit(999);  /* we only get here if execl fails */
  2206.   }
  2207.  else
  2208.   { /* parent process */
  2209.    if(XControl->ChildPid < 0)
  2210.     Error(XControl,"Can't fork!\n");
  2211.    ExecuteCommandList(XControl,XControl->ParentForkCommands);
  2212.   }
  2213. }
  2214.  
  2215. /* KeyCB:  This is the Keyboard call back handler.  It is called whenever */
  2216. /*  the user types in a key.  It simply sends it to the pty for processing */
  2217.  
  2218. void KeyCB(w,XControl,reason)
  2219.  
  2220. Widget w;
  2221. struct XControl *XControl;
  2222. GenTermEmCallback *reason;
  2223.  
  2224. {
  2225.  PtyWrite(w,reason->string,reason->len);
  2226. }
  2227.  
  2228. /* CommandCB:  This is the command callback handler.  It is called when a */
  2229. /* specific event has happened which has had a command list bound to it. */
  2230.  
  2231. void CommandCB(w,CallData,reason)
  2232.  
  2233. Widget w;
  2234. struct CallStruct *CallData;
  2235. XtPointer reason;
  2236.  
  2237. {
  2238.  struct CommandList *Commands;
  2239.  
  2240.  CallData->XControl->CallbackReason = reason;
  2241.  
  2242.  if(CallData->Direct == True)
  2243.   Commands = CallData->Commands;
  2244.  else
  2245.   Commands = *((struct CommandList **)CallData->Commands);
  2246.  
  2247.  ExecuteCommandList(CallData->XControl,Commands);
  2248.  
  2249.  if(CallData->Dynamic == True)
  2250.   {
  2251.    DestroyCommandList(CallData->XControl,Commands);
  2252.    if(CallData->Direct == False)
  2253.     *((struct CommandList **)CallData->Commands) = NULL;
  2254.   }
  2255.  
  2256. }
  2257.  
  2258. /* TimeOutCB:  This is the timeout callback handler.  It simply calls the */
  2259. /*  command callback function to perform all the work and then frees up the */
  2260. /*  mempry associated with the calling structure. */
  2261.  
  2262. void TimeOutCB(CallData,reason)
  2263.  
  2264. struct CallStruct *CallData;
  2265. XtPointer reason;
  2266.  
  2267. {
  2268.  CommandCB(NULL,CallData,reason);
  2269.  XtFree(CallData);
  2270. }
  2271.  
  2272. /* ActionCB:  This is the action handler routine.  It takes the action */
  2273. /*  string can compiles it into a command sequence.  It then executes the */
  2274. /*  command list and then returns. */
  2275.  
  2276. void ActionCB(w,event,CommandString,NString)
  2277.  
  2278. Widget w;
  2279. XEvent *event;
  2280. String *CommandString;
  2281. Cardinal *NString;
  2282.  
  2283. {
  2284.  struct CommandList *Commands;
  2285.  int i;
  2286.  
  2287.  XControl.CallbackReason = event;
  2288.  
  2289.  for(i = 0; i < *NString; i++)
  2290.   {
  2291.    Commands = ParseString(&XControl,CommandString[i]);
  2292.    ExecuteCommandList(&XControl,Commands);
  2293.    DestroyCommandList(&XControl,Commands);
  2294.   }
  2295. }
  2296.  
  2297. /* PopDownCB:  This callback unmanages a dialog.  It is called from the */
  2298. /*  the help callback on the MessageDialog. */
  2299.  
  2300. void PopDownCB(w,Calldata,reason)
  2301.  
  2302. Widget w;
  2303. Widget Calldata;
  2304. XtPointer reason;
  2305.  
  2306. {
  2307.  XtUnmanageChild(w);
  2308. }
  2309.  
  2310. /* LoadSession:  This function reads in a previously saved session file. */
  2311. /*  It is used to restart a session that was saved by the session manager. */
  2312.  
  2313. LoadSession(XControl)
  2314.  
  2315. struct XControl *XControl;
  2316.  
  2317. {
  2318.  FILE *SaveFile;
  2319.  char buffer[1024];
  2320.  int i;
  2321.  
  2322.  if((SaveFile = fopen(XControl->SessionFile,"r")) == NULL)
  2323.   Error(XControl,"Can't open session file %s\n",XControl->SessionFile);
  2324.  
  2325.  fgets(buffer,1024,SaveFile);
  2326.  buffer[strlen(buffer)-1] = NULL;  /* get rid of newline */
  2327.  if(strcmp(buffer,SESSION_HEADER) != 0)
  2328.   {
  2329.    Warning(XControl,"Session file contains invalid data, ignoring\n");
  2330.    return(0);
  2331.   }
  2332.  
  2333.  XtFree(XControl->TerminalType);
  2334.  XControl->TerminalType = LoadString(XControl,SaveFile);
  2335.  XtFree(XControl->ChildCommand);
  2336.  XControl->ChildCommand = LoadString(XControl,SaveFile);
  2337.  XtFree(XControl->ChildCommandArguments);
  2338.  XControl->ChildCommandArguments = LoadString(XControl,SaveFile);
  2339.  
  2340.  DestroyCommandList(XControl,XControl->StartCommands);
  2341.  XControl->StartCommands = LoadCommandList(XControl,SaveFile);
  2342.  
  2343.  for(i = 0; i < NSIG; i++)
  2344.   {
  2345.    DestroyCommandList(XControl,XControl->SignalCommands[i]);
  2346.    XControl->SignalCommands[i] = LoadCommandList(XControl,SaveFile);
  2347.   }
  2348.  DestroyCommandList(XControl,XControl->CloseWindowCommands);
  2349.  XControl->CloseWindowCommands = LoadCommandList(XControl,SaveFile);
  2350.  DestroyCommandList(XControl,XControl->SaveCommands);
  2351.  XControl->SaveCommands = LoadCommandList(XControl,SaveFile);
  2352.  DestroyCommandList(XControl,XControl->EscapeCommands);
  2353.  XControl->EscapeCommands = LoadCommandList(XControl,SaveFile);
  2354.  DestroyCommandList(XControl,XControl->TopCommands);
  2355.  XControl->TopCommands = LoadCommandList(XControl,SaveFile);
  2356.  DestroyCommandList(XControl,XControl->ResizeCommands);
  2357.  XControl->ResizeCommands = LoadCommandList(XControl,SaveFile);
  2358.  DestroyCommandList(XControl,XControl->WakeUpCommands);
  2359.  XControl->WakeUpCommands = LoadCommandList(XControl,SaveFile);
  2360.  DestroyCommandList(XControl,XControl->FlowCommands);
  2361.  XControl->FlowCommands = LoadCommandList(XControl,SaveFile);
  2362.  DestroyCommandList(XControl,XControl->ParentForkCommands);
  2363.  XControl->ParentForkCommands = LoadCommandList(XControl,SaveFile);
  2364.  DestroyCommandList(XControl,XControl->ChildForkCommands);
  2365.  XControl->ChildForkCommands = LoadCommandList(XControl,SaveFile);
  2366.  DestroyCommandList(XControl,XControl->DropCommands);
  2367.  XControl->DropCommands = LoadCommandList(XControl,SaveFile);
  2368.  DestroyCommandList(XControl,XControl->PromptYesCommands);
  2369.  XControl->PromptYesCommands = LoadCommandList(XControl,SaveFile);
  2370.  DestroyCommandList(XControl,XControl->PromptNoCommands);
  2371.  XControl->PromptNoCommands = LoadCommandList(XControl,SaveFile);
  2372.  DestroyCommandList(XControl,XControl->PromptCancelCommands);
  2373.  XControl->PromptCancelCommands = LoadCommandList(XControl,SaveFile);
  2374.  
  2375.  fclose(SaveFile);
  2376. }
  2377.  
  2378. /* LoadString:  This function reads a string from the session file. */
  2379.  
  2380. char *LoadString(XControl,File)
  2381.  
  2382. struct XControl *XControl;
  2383. FILE *File;
  2384.  
  2385. {
  2386.  int n,i;
  2387.  char *string;
  2388.  
  2389.  if(fscanf(File,"%d\n",&n) != 1)
  2390.   Error(XControl,"Can't find string length is session file!\n");
  2391.  
  2392.  if(n < 0)
  2393.   return(NULL);
  2394.  fgetc(File);  /* first character is dummy to stop scanf from going to far */
  2395.  if(n == 0)
  2396.   return(NULL);
  2397.  
  2398.  string = XtMalloc(sizeof(char) * (n+1));
  2399.  
  2400.  for(i = 0; i < n; i++)
  2401.   string[i] = fgetc(File);
  2402.  fgetc(File);  /* read trailing newline */
  2403.  string[n] = NULL;
  2404.  
  2405.  return(string);
  2406. }
  2407.  
  2408. /* DropCB:  This is the Vue drop callback handler.  It is called whenever */
  2409. /*  an icon is dropped on our window.  It stores the required drop */
  2410. /*  information and executes any command associated with the action. */
  2411.  
  2412. void DropCB(display,win,x,y,root,root_x,root_y,mods,types,objects,XControl)
  2413.  
  2414. Display *display;
  2415. Window win;
  2416. Position x,y;
  2417. Window root;
  2418. Position root_x,root_y;
  2419. unsigned int mods;
  2420. char *types;
  2421. char *objects;
  2422. struct XControl *XControl;
  2423.  
  2424. {
  2425.  int i;
  2426.  char Name[256];
  2427.  
  2428.  for(i = 0; i < strlen(types); i++)
  2429.   if(types[i] == ',')
  2430.    types[i] = ' ';
  2431.  XControl->DropTypes = BuildArgList(XControl,types,
  2432.                     &XControl->NumberTypesDropped);
  2433.  XControl->DropTypes -= 1;
  2434.  XControl->DropFiles = BuildArgList(XControl,objects,
  2435.                     &XControl->NumberFilesDropped);
  2436.  XControl->NumberFilesDropped -= 3;
  2437.  
  2438.  gethostname(Name,256);
  2439.  
  2440.  if((strcmp(Name,XControl->DropFiles[0]) != 0) && 
  2441.     (XControl->RemoteDropsAllowed == False))
  2442.   {
  2443.    XWarning(XControl,"Error!!\nCan not accept a drop from a remote host");
  2444.   }
  2445.  else
  2446.   ExecuteCommandList(XControl,XControl->DropCommands);
  2447. }
  2448.  
  2449. /* XWarning:  This function pops up a warning dialog with the given text */
  2450. /*  as its message. */
  2451.  
  2452. XWarning(XControl,Message)
  2453.  
  2454. struct XControl *XControl;
  2455. char *Message;
  2456.  
  2457. {
  2458.  int n = 0;
  2459.  Arg args[10];
  2460.  
  2461.  XtSetArg(args[n],XmNmessageString,
  2462.       XmStringCreateLtoR(Message,XmSTRING_DEFAULT_CHARSET)); n++;
  2463.  XtSetValues(XControl->Warning,args,n);
  2464.  XtManageChild(XControl->Warning);
  2465. }
  2466.  
  2467.  
  2468. void ResizeCB(w,XControl,reason)
  2469.  
  2470. Widget w;
  2471. struct XControl *XControl;
  2472. XtPointer reason;
  2473.  
  2474. {
  2475.  SetDragWindow(XControl);
  2476. }
  2477.  
  2478. void RequestCB(c1,c2,c3,c4,c5,c6,c7,c8)
  2479.  
  2480. char *c1,*c2,*c3,*c4,*c5,*c6,*c7,*c8;
  2481.  
  2482. {
  2483.  fprintf(stderr,"Got a callback!\n%s\n",c6);
  2484.  XeSendSuccessNotification("XCONTROL",NULL,"TEST",NULL,"blah4","blah5");
  2485. }
  2486. @EOF
  2487. set `wc -lwc <xcontrol/XControl.c`
  2488. if test $1$2$3 != 984234927562
  2489. then
  2490.     echo ERROR: wc results of xcontrol/XControl.c are $* should be 984 2349 27562
  2491. fi
  2492.  
  2493. chmod 644 xcontrol/XControl.c
  2494.  
  2495. echo x - xcontrol/XControl.h
  2496. cat >xcontrol/XControl.h <<'@EOF'
  2497. /* XControl.h  This is the include file for the XControl program */
  2498. /* History:                                 */
  2499. /*         Written by G. R. Strachan 1992 */
  2500.  
  2501. /*  Copyright Gordon R. Strachan 1992 */
  2502. /*  This code is provided as is, neither the University of Waterloo nor */
  2503. /*  the author is liable for any damage caused by the use or misuse of this */
  2504. /*  code.  */
  2505.  
  2506. /* Permission is granted to copy, use and modify this code provided it is */
  2507. /* not sold for profit and the above copyright remains intact. */
  2508.  
  2509. #define SESSION_HEADER "XControl version 1.0 Session File"
  2510.  
  2511. struct CommandList
  2512. {
  2513.  int (*Command)();
  2514.  struct Argument *Args;
  2515.  int NumberArguments;
  2516.  struct CommandList *Next;
  2517. };
  2518.  
  2519. struct Argument
  2520. {
  2521.  char *String;
  2522.  int Type;
  2523.  int Value;
  2524. };
  2525.  
  2526. struct FunctionList
  2527. {
  2528.  char *Name;
  2529.  int (*Function)();
  2530. };
  2531.  
  2532. struct CallStruct
  2533.  
  2534. {
  2535.  struct XControl *XControl;
  2536.  struct CommandList *Commands;
  2537.  int Direct;
  2538.  int Dynamic;
  2539. };
  2540.  
  2541. struct XControl
  2542. {
  2543.  char *ProgramName;
  2544.  XtAppContext App;
  2545.  struct FunctionList *Functions;
  2546.  int ChildPid;
  2547.  char *TerminalType;
  2548.  char *ChildCommand;
  2549.  char *ChildCommandArguments;
  2550.  char **ChildArgv;
  2551.  int SignalPipeline;
  2552.  char **PositionalArgs;
  2553.  int NumberPositions;
  2554.  char *SessionFile;
  2555.  struct CommandList *StartCommands;
  2556.  struct CommandList *SignalCommands[NSIG];
  2557.  struct CommandList *CloseWindowCommands;
  2558.  struct CommandList *SaveCommands;
  2559.  struct CommandList *EscapeCommands;
  2560.  struct CommandList *TopCommands;
  2561.  struct CommandList *ResizeCommands;
  2562.  struct CommandList *WakeUpCommands;
  2563.  struct CommandList *FlowCommands;
  2564.  struct CommandList *ParentForkCommands;
  2565.  struct CommandList *ChildForkCommands;
  2566.  struct CommandList *DropCommands;
  2567.  struct CommandList *PromptYesCommands;
  2568.  struct CommandList *PromptNoCommands;
  2569.  struct CommandList *PromptCancelCommands;
  2570.  caddr_t CallbackReason;
  2571.  Widget Top;
  2572.  Widget Terminal;
  2573.  Widget Message;
  2574.  Widget Warning;
  2575.  char **DropTypes;
  2576.  char **DropFiles;
  2577.  char *DropZoneType;
  2578.  int NumberFilesDropped;
  2579.  int NumberTypesDropped;
  2580.  Boolean RemoteDropsAllowed;
  2581. };
  2582.  
  2583. #define STRINGARG   1
  2584. #define POSITIONARG 2
  2585. #define INTEGERARG  3
  2586.  
  2587. #define XCOKAY  1
  2588. #define XCERROR 0
  2589. #define XCABORT 2
  2590. @EOF
  2591. set `wc -lwc <xcontrol/XControl.h`
  2592. if test $1$2$3 != 932582132
  2593. then
  2594.     echo ERROR: wc results of xcontrol/XControl.h are $* should be 93 258 2132
  2595. fi
  2596.  
  2597. chmod 644 xcontrol/XControl.h
  2598.  
  2599. echo x - xcontrol/XControl.man '[non-ascii]'
  2600. $unpacker <<'@eof'
  2601. begin 644 xcontrol/XControl.man
  2602. M+EPB($UA;B!P86=E(&9O<B!T:&4@6$-O;G1R;VP@<')O9W)A;2 M*BUN<F]FX
  2603. M9BTJ+0HN7"(*+EPB(%=R:71T96X@8GD@1RX@4W1R86-H86X@,3DY,@HN7"(*X
  2604. M+EPB($%D9"!S:6UP;&4@:V5E<',@=&\@34%.(&UA8W)O<R!S;R N5%,O+E1%X
  2605. M('=I;&P@=V]R:PHN7"(*+F1E($M3("!<(B @(" @($ME97 @<W1A<G0*+F)RX
  2606. M"BYI;B P"BYD:2!+4 HN+@HN9&4@2T4@(%PB(" @(" @2V5E<"!E;F0*+F)RX
  2607. M"BYD:0HN;F4@7%QN*&1N=0HN;G(@9DD@7%QN*"YU"BYN9@HN2U *+FEF(%Q<X
  2608. M;BAF22 N9FD*+FEN"BXN"BY42"!80T].5%)/3" Q6 HN4T@@3D%-10I80V]NX
  2609. M=')O;" M($%N(%@@8VQI96YT('5S960@=&\@;6%N86=E(&%N9"!C;VYT<F]LX
  2610. M('=I;F1O=R!D=6UB('!R;V=R86US"BYS<" Q"BY32"!364Y/4%-)4PHN0B!8X
  2611. M0V]N=')O; I;+71O;VQK:71O<'1I;VY=("U;;W!T:6]N70HN<W @,0HN4T@@X
  2612. M1$530U))4%1)3TX*5&AE(%QF25A#;VYT<F]L7&90('!R;V=R86T@:7,@9&5SX
  2613. M:6=N960@86QL;W<@<')O9W)A;7,@=VAI8V@@9&\@;F]T"FEN=&5R86-T('=IX
  2614. M=&@@=&AE(%@@5VEN9&]W('-Y<W1E;2!T;R!O<&5R871E(&5F9F5C=&EV96QYX
  2615. M('=I=&AI;B!T:&4@6 IE;G9I<F]N;65N="X@($EN(&]R9&5R('1O(&]P97)AX
  2616. M=&4@82!W:6YD;W<@9'5M8B!P<F]G<F%M(&9R;VT@=VET:&EN"G1H92!8(&5NX
  2617. M=FER;VYM96YT+"!A;B!8(&-L:65N="!I<R!R97%U:7)E9"!T;R!P<F]V:61EX
  2618. M('1H870@<')O9W)A;0IW:71H(&$@;6EN:6UU;2!O9B!8('-E<G9I8V5S+B @X
  2619. M5'EP:6-A;&QY+"!N;VX@6"!7:6YD;W<@<')O9W)A;7,@87)E"G)U;B!F<F]MX
  2620. M('=I=&@@:6X@82!T97)M:6YA;"!E;75L871O<B!P<F]G<F%M('-U8V@@87,@X
  2621. M7&9):'!T97)M7&90(&]R"EQF27AT97)M7&90+B @5&AI<R!P<F]V:61E<R!TX
  2622. M:&4@<')O9W)A;2!W:71H(&UE86YS(&]F(&1I<W!L87EI;F<@=&5X= IO;B!TX
  2623. M:&4@9&ES<&QA>2!A;F0@<F5C96EV:6YG(&ME>6)O87)D(&EN<'5T+B @2&]WX
  2624. M979E<BP@=&AE<V4@87)E('1H90IO;FQY('-E<G9I8V5S('1H92!T97)M:6YAX
  2625. M;"!E;75L871O<G,@<')O=FED92!T;R!T:&4@<')O9W)A;2X@(%1H97)E"F%RX
  2626. M92!M86YY(&]T:&5R(%@@979E;G1S('=H:6-H('1H92!U;F1E<FQY:6YG('!RX
  2627. M;V=R86T@:&%S('1O(')E86-T('1O"F)U="!A<F4@;F]T(&AA;F1L960@8GD@X
  2628. M=&AE('1E<FUI;F%L(&5M=6QA=&]R+B @06X@97AA;7!L92!O9B!T:&ES(&ESX
  2629. M"G=I;F1O=R!C;&]S=7)E+B @5VAE;B!T:&4@=&5R;6EN86P@96UU;&%T;W(@X
  2630. M=VEN9&]W(&ES(&-L;W-E9"P@:70*<VEM<&QY(&MI;&QS('1H92!P<F]G<F%MX
  2631. M(&ET(&ES(&-O;G1R;VQL:6YG(')A=&AE<B!T:&%N(&EN9F]R;6EN9R!I= ITX
  2632. M:&%T('1H92!W:6YD;W<@:&%S(&)E96X@8VQO<V5D(&%N9"!A;&QO=VEN9R!IX
  2633. M="!T;R!T86ME('=H870@979E<@IA8W1I;VYS(&YE8V5S<V%R>2X@(%QF25A#X
  2634. M;VYT<F]L7&90(&ES(&1E<VEG;F5D('1O('!R;W9I9&4@86QL('1H90IS97)VX
  2635. M:6-E<R!O9B!T:&4@=&5R;6EN86P@96UU;&%T;W(@<&QU<R!C;VYT<F]L<R!FX
  2636. M;W(@;W1H97(@6"!E=F5N=',N"E1H92!P<F]G<F%M(&-O;G-I<W1S(&]F(&$@X
  2637. M<V5R:65S(&]F(&-O;6UA;F1S('1O('!E<F9O<FT@;VX@=&AE"G5N9&5R;'EIX
  2638. M;F<@<')O8V5S<R!P;'5S(&$@<V5T(&]F('1R:6=G97)S('1O(&5N=F]K92!TX
  2639. M:&5S92!C;VUM86YD<RX*26X@861D:71I;VXL(&ET(&EN=&5R86-T<R!W:71HX
  2640. M('1H92!6544@96YV:7)O;FUE;G0@=&\@<')O=FED92!S=7!P;W)T"F9O<B!RX
  2641. M97-T87)T:6YG('-E<W-I;VYS(&%N9"!F;W(@9')A9R!A;F0@9')O<"X*+G-PX
  2642. M(#$*+E-(($]05$E/3E,*5&AE(%QF25A#;VYT<F]L7&90('!R;V=R86T@86-CX
  2643. M97!T<R!A;&P@;V8@=&AE('-T86YD87)D(%@@5&]O;&MI= IC;VUM86YD(&QIX
  2644. M;F4@;W!T:6]N<R!P;'5S('1H92!F;VQL;W=I;F<Z"BY44" X"BY"22!<+6APX
  2645. M=&5R;0I4:&ES(&]P=&EO;B!S<&5C:69I97,@=&AA="!T:&4@7&9)6$-O;G1RX
  2646. M;VQ<9E @<')O9W)A;2!S:&]U;&0@96UU;&%T92!A"G1E<FTP('1E<FUI;F%LX
  2647. M+B @07-S;V-I871E9"!R97-O=7)C93H@7&9"*G1E<FUI;F%L5'EP95QF4 HNX
  2648. M5% @. HN0DD@7"MH<'1E<FT*5&AI<R!O<'1I;VX@<W!E8VEF:65S('1H870@X
  2649. M=&AE(%QF25A#;VYT<F]L7&90('!R;V=R86T@<VAO=6QD(&5M=6QA=&4@80IVX
  2650. M=#$P,"!T97)M:6YA;"X@($%S<V]C:6%T960@<F5S;W5R8V4Z(%QF0BIT97)MX
  2651. M:6YA;%1Y<&5<9E *+E10(#@*+D))(%PM>'1E<FT*5&AI<R!O<'1I;VX@<W!EX
  2652. M8VEF:65S('1H870@=&AE(%QF25A#;VYT<F]L7&90('!R;V=R86T@<VAO=6QDX
  2653. M(&5M=6QA=&4@80IV=#$P,"!T97)M:6YA;"X@($%S<V]C:6%T960@<F5S;W5RX
  2654. M8V4Z(%QF0BIT97)M:6YA;%1Y<&5<9E *+E10(#@*+D))(%PM8V]M;6%N9" BX
  2655. M($-O;6UA;F1.86UE(@I4:&ES(&]P=&EO;B!S<&5C:69I97,@=&AE(&YA;64@X
  2656. M;V8@=&AE('!R;V=R86T@=&\@;6%N86=E+@I<9DE#;VUM86YD3F%M95QF4"!IX
  2657. M<R!T:&4@<&%T:&YA;64@;V8@=&AE('!R;V=R86TN("!!<W-O8VEA=&5D"G)EX
  2658. M<V]U<F-E.B!<9D(J8VAI;&1#;VUM86YD7&90"BY44" X"BY"22!<+6%R9W5MX
  2659. M96YT<R B($-H:6QD07)G=6UE;G1S(@I4:&ES(&]P=&EO;B!S<&5C:69I97,@X
  2660. M=&AE(&%R9W5M96YT<R!T;R!P87-S('1O('1H92!C:&EL9"!P<F]C97-S('=HX
  2661. M96X*:70@:7,@9F]R:V5D+B @7&9)0VAI;&1!<F=U;65N='-<9E @<VAO=6QDX
  2662. M(&)E(&5M8F5D9&5D(&EN('%U;W1E<R!T;PIP<F5V96YT(&EN=&5R<')E=&%TX
  2663. M:6]N(&)Y('1H92!S:&5L;"X@($%S<V]C:6%T960@<F5S;W5R8V4Z"EQF0BICX
  2664. M:&EL9$%R9W5M96YT<UQF4 HN5% @. HN0DD@7"US97-S:6]N("(@4V5S<VEOX
  2665. M;D9I;&4B"E1H:7,@;W!T:6]N(&ES('!R;W9I9&5D(&9O<B!I;G1E<F%C=&EOX
  2666. M;B!W:71H('1H92!6=64@<V5S<VEO;B!M86YA9V5R+@I<9DE397-S:6]N1FELX
  2667. M95QF4"!I<R!T:&4@;F%M92!O9B!T:&4@9FEL92!I;B!W:&EC:"!T:&4@<')EX
  2668. M=FEO=7,*<V5S<VEO;B!W87,@<V%V960N("!)=',@8V]N=&5N=',@87)E(')EX
  2669. M860@=&\@<F5L;V%D('1H92!P<F5V:6]U<PIS97-S:6]N)W,@<F5S;W5R8V5SX
  2670. M+B @07-S;V-I871E9"!R97-O=7)C93H@7&9"*G-E<W-I;VY&:6QE7&90"BYSX
  2671. M<" Q"BY32"!215-/55)#15,*5&AE"BY)(%A#;VYT<F]L"G!R;V=R86T@8V]NX
  2672. M<VES=',@;V8@82!<9DE0='E7:61G971<9E @:6YS:61E(&]F(&%N(%QF25AMX
  2673. M36%I;E=I;F1O=UQF4 IW:61G970N("!297-O=7)C92!S<&5C:69I8R!T;R!TX
  2674. M:&4@7&9)6$-O;G1R;VQ<9E @<')O9W)A;2!A<F4Z"BYS<" Q"BY+4PHN<W @X
  2675. M,0HN5%,*8V5N=&5R.PIC0B!S<W,*;$(@;$(@;$(@;$(*;&QL;"X*6$-O;G1RX
  2676. M;VP@4F5S;W5R8V4@4V5T"DYA;64)0VQA<W,)5'EP90E$969A=6QT"E\*8VAIX
  2677. M;&1!<F=U;65N=',)0VAI;&1!<F=U;65N=',)4W1R:6YG"4Y53$P*8VAI;&1#X
  2678. M;VUM86YD"4-H:6QD0V]M;6%N9 E3=')I;F<)+V)I;B]C<V@*8VAI;&1&;W)KX
  2679. M0V]M;6%N9',)0VAI;&1&;W)K0V]M;6%N9',)0V]M;6%N9$QI<W0)3E5,3 ICX
  2680. M;&]S95=I;F1O=T-O;6UA;F1S"4-L;W-E5VEN9&]W0V]M;6%N9',)0V]M;6%NX
  2681. M9$QI<W0)475I="@P*0ID<F]P0V]M;6%N9',)1')O<$-O;6UA;F1S"4-O;6UAX
  2682. M;F1,:7-T"4Y53$P*9')O<%IO;F54>7!E"41R;W!:;VYE5'EP90E3=')I;F<)X
  2683. M1FEL945D:70*97-C87!E0V]M;6%N9',)17-C87!E0V]M;6%N9',)0V]M;6%NX
  2684. M9$QI<W0)3E5,3 IF;&]W0V]M;6%N9',)1FQO=T-O;6UA;F1S"4-O;6UA;F1,X
  2685. M:7-T"4Y53$P*<&%R96YT1F]R:T-O;6UA;F1S"5!A<F5N=$9O<FM#;VUM86YDX
  2686. M<PE#;VUM86YD3&ES= E.54Q,"G)E;6]T941R;W!S06QL;W=E9 E296UO=&5$X
  2687. M<F]P<T%L;&]W960)0F]O;&5A;@E&86QS90IR97-I>F5#;VUM86YD<PE297-IX
  2688. M>F5#;VUM86YD<PE#;VUM86YD3&ES= E.54Q,"G-A=F5#;VUM86YD<PE3879EX
  2689. M0V]M;6%N9',)0V]M;6%N9$QI<W0)4V%V95-E<W-I;VXH*0IS97-S:6]N1FELX
  2690. M90E397-S:6]N1FEL90E3=')I;F<)3E5,3 IS:6=!;&%R;4-O;6UA;F1S"5-IX
  2691. M9T%L87)M0V]M;6%N9',)0V]M;6%N9$QI<W0)3E5,3 IS:6=#:&EL9$-O;6UAX
  2692. M;F1S"5-I9T-H:6QD0V]M;6%N9',)0V]M;6%N9$QI<W0)4F5A<"@Q*3M1=6ETX
  2693. M*#$I"G-I9T-O;G1I;G5E0V]M;6%N9',)4VEG0V]N=&EN=65#;VUM86YD<PE#X
  2694. M;VUM86YD3&ES= E.54Q,"G-I9TAA;F=5<$-O;6UA;F1S"5-I9TAA;F=5<$-OX
  2695. M;6UA;F1S"4-O;6UA;F1,:7-T"4Y53$P*<VEG26YT97)R=7!T0V]M;6%N9',)X
  2696. M4VEG26YT97)R=7!T0V]M;6%N9',)0V]M;6%N9$QI<W0)3E5,3 IS:6=)3T-OX
  2697. M;6UA;F1S"5-I9TE/0V]M;6%N9',)0V]M;6%N9$QI<W0)3E5,3 IS:6=0:7!EX
  2698. M0V]M;6%N9',)4VEG4&EP94-O;6UA;F1S"4-O;6UA;F1,:7-T"4Y53$P*<VEGX
  2699. M475I=$-O;6UA;F1S"5-I9U%U:71#;VUM86YD<PE#;VUM86YD3&ES= E.54Q,X
  2700. M"G-I9U-T;W!#;VUM86YD<PE3:6=3=&]P0V]M;6%N9',)0V]M;6%N9$QI<W0)X
  2701. M3E5,3 IS:6=497)M0V]M;6%N9',)4VEG5&5R;4-O;6UA;F1S"4-O;6UA;F1,X
  2702. M:7-T"4Y53$P*<VEG57)G96YT0V]M;6%N9',)4VEG57)G96YT0V]M;6%N9',)X
  2703. M0V]M;6%N9$QI<W0)3E5,3 IS:6=5<W(Q0V]M;6%N9',)4VEG57-R,4-O;6UAX
  2704. M;F1S"4-O;6UA;F1,:7-T"4Y53$P*<VEG57-R,D-O;6UA;F1S"5-I9U5S<C)#X
  2705. M;VUM86YD<PE#;VUM86YD3&ES= E.54Q,"G-I9U=I;F1O=T-O;6UA;F1S"5-IX
  2706. M9U=I;F1O=T-O;6UA;F1S"4Y53$P*<W1A<G1#;VUM86YD<PE3=&%R=$-O;6UAX
  2707. M;F1S"4-O;6UA;F1,:7-T"4Y53$P*=&5R;6EN86Q4>7!E"51E<FUI;F%L5'EPX
  2708. M90E3=')I;F<):'!T97)M"G1O<$-O;6UA;F1S"51O<$-O;6UA;F1S"4-O;6UAX
  2709. M;F1,:7-T"4Y53$P*=V%K955P0V]M;6%N9',)5V%K955P0V]M;6%N9',)0V]MX
  2710. M;6%N9$QI<W0)3E5,3 HN5$4*+G-P(#$*+DM%"BYS<" Q"BY)4" B7&9"8VAIX
  2711. M;&1!<F=U;65N='-<9E B"E1H:7,@<F5S;W5R8V4@9&5F:6YE<R!T:&4@87)GX
  2712. M=6UE;G1S('1H870@87)E('!A<W-E9"!T;R!T:&4@8VAI;&0@<')O8V5S<RX*X
  2713. M+DE0(")<9D)C:&EL9$-O;6UA;F1<9E B"E1H:7,@<F5S;W5R8V4@<W!E8VEFX
  2714. M:65S('1H92!C;VUP;&5T92!P871H;F%M92!O9B!T:&4@<')O9W)A;2!I="!IX
  2715. M<R!T;PIM86YA9V4@87,@:71S(&-H:6QD('!R;V-E<W,N"BY)4" B7&9"8VAIX
  2716. M;&1&;W)K0V]M;6%N9'-<9E B"E1H:7,@<F5S;W5R8V4@<W!E8VEF:65S('1HX
  2717. M92!C;VUM86YD<R!T:&%T(&%R92!T;R!B92!E>&5C=71E9"!B>2!T:&4*8VAIX
  2718. M;&0@<')O8V5S<R!I;6UE9&EA=&5L>2!B969O<F4@:70@97AE8R=S('1H92!PX
  2719. M<F]G<F%M(&ET(&ES('1O;PIM86YA9V4N("!7:&5N('1H97-E(&-O;6UA;F1SX
  2720. M(&%R92!E>&5C=71E9"P@86QL('1H92!P87)E;G0@9FEL97,@:&%V90IA;')EX
  2721. M861Y(&)E96X@8VQO<V5D(&EN8VQU9&4@=&AE(&-O;FYE8W1I;VX@=&\@=&AEX
  2722. M(%@@4V5R=F5R+@HN25 @(EQF0F-L;W-E5VEN9&]W0V]M;6%N9'-<9E B"E1HX
  2723. M:7,@<F5S;W5R8V4@<W!E8VEF:65S('1H92!C;VUM86YD<R!T;R!E>&5C=71EX
  2724. M('=H96X@=&AE('=I;F1O=PIM86YA9V5R(&ES(&%T=&5M<'1I;F<@=&\@8VQOX
  2725. M<V4@;W5R('=I;F1O=RX@(%QF25A#;VYT<F]L7&90('=I;&P@;F]T"F-L;W-EX
  2726. M('1H92!W:6YD;W<@=6YT:6P@=&AE(%QF25%U:70H*5QF4"!C;VUM86YD(&AAX
  2727. M<R!B965N(&5X96-U=&5D+@HN25 @(EQF0F1R;W!#;VUM86YD<UQF4"(*5&AIX
  2728. M<R!R97-O=7)C92!S<&5C:69I97,@=&AE(&-O;6UA;F1S('1O(&)E(&5X96-UX
  2729. M=&5D('=H96X@=&AE('5S97(*9')O<',@86X@:6-O;B!O;B!O=7(@=VEN9&]WX
  2730. M+@HN25 @(EQF0F1R;W!:;VYE5'EP95QF4"(*5&AI<R!R97-O=7)C92!S<&5CX
  2731. M:69I97,@=&AE('1Y<&4@;V8@9')O<"!Z;VYE(&ET('-H;W5L9"!I;G-T86QLX
  2732. M+B @5&AI<PID969I;F5S('1H92!T>7!E(&]F(&9I;&5S('1H870@=V4@87)EX
  2733. M('=I;&QI;F<@=&\@86-C97!T+B @270@<VAO=6QD"F%G<F5E('=I=&@@;VYEX
  2734. M(&]F('1H92!D<F]P('IO;F4@='EP97,@9V5N97)A=&5D(&)Y('1H92!F:6QEX
  2735. M(&UA;F%G97(N"BY)4" B7&9"97-C87!E0V]M;6%N9'-<9E B"E1H:7,@<F5SX
  2736. M;W5R8V4@<W!E8VEF:65S('1H92!C;VUM86YD<R!T;R!B92!E>&5C=71E9"!WX
  2737. M:&5N('1H92!0='D*=VED9V5T(&%S<V5R=',@86X@17-C87!E($-A;&QB86-KX
  2738. M+@HN25 @(EQF0F9L;W=#;VUM86YD<UQF4"(*5&AI<R!R97-O=7)C92!S<&5CX
  2739. M:69I97,@=&AE(&-O;6UA;F1S('1O(&)E(&5X96-U=&5D('=H96X@=&AE(%!TX
  2740. M>2!W:61G970*87-S97)T<R!A($9L;W<@0V%L;&)A8VLN"BY)4" B7&9"<&%RX
  2741. M96YT1F]R:T-O;6UA;F1S7&90(@I4:&ES(')E<V]U<F-E('-P96-I9FEE<R!TX
  2742. M:&4@8V]M;6%N9',@=&\@8F4@97AE8W5T960@8GD@=&AE('!A<F5N= IP<F]CX
  2743. M97-S(&EM;65D:6%T96QY(&%F=&5R(&ET(&9O<FMS('1H92!C:&EL9"!P<F]CX
  2744. M97-S+@HN25 @(EQF0G)E;6]T941R;W!S06QL;W=E9%QF4"(*5&AI<R!R97-OX
  2745. M=7)C92!S<&5C:69I97,@=VAE=&AE<B!T:&4@<')O9W)A;2!S:&]U;&0@86QLX
  2746. M;W<@:6-O;G,@=&\@8F4*9')O<'!E9"!F<F]M('!R;V=R86US(')U;FYI;F<@X
  2747. M;VX@86YO=&AE<B!H;W-T+B @5&AI<R!S:&]U;&0@;VYL>2!B90IS970@=&\@X
  2748. M5')U92!I9B!T:&4@=6YD97)L>6EN9R!A<'!L:6-A=&EO;B!E:71H97(@9&]EX
  2749. M<VXG="!C87)E(&]R(&-A;@IH86YD;&4@<F5C96EV:6YG(&1A=&$@9G)O;2!RX
  2750. M96UO=&4@87!P;&EC871I;VYS+@HN25 @(EQF0G)E<VEZ94-O;6UA;F1S7&90X
  2751. M(@I4:&ES(')E<V]U<F-E('-P96-I9FEE<R!T:&4@8V]M;6%N9',@=&\@8F4@X
  2752. M97AE8W5T960@=VAE;B!T:&4@=VEN9&]W"FUA;F%G97(@<F5S:7IE<R!T:&4@X
  2753. M=VEN9&]W+@HN25 @(EQF0G-A=F5#;VUM86YD<UQF4"(*5&AI<R!R97-O=7)CX
  2754. M92!S<&5C:69I97,@=&AE(&-O;6UA;F1S('1O(&)E(&5X96-U=&5D('=H96X@X
  2755. M=&AE('-E<W-I;VX*;6%N86=E<B!R97%U97-T<R!T:&%T('1H92!P<F]G<F%MX
  2756. M('-A=F4@:71S('-T871E+B @26X@;W)D97(@=&\@<')E=F5N= IT:&4@<V5SX
  2757. M<VEO;B!M86YA9V5R(&9R;VT@:&%N9VEN9RP@;VYE(&]F('1H92!C;VUM86YDX
  2758. M<R!S:&]U;&0@8F4*7&9)4V%V95-E<W-I;VXH*5QF4"X*+DE0(")<9D)S97-SX
  2759. M:6]N1FEL95QF4"(*5&AI<R!R97-O=7)C92!S<&5C:69I97,@=&AE(&YA;64@X
  2760. M;V8@=&AE('-E<W-I;VX@9FEL92!T;R!L;V%D+B @270@:7,*=7-E9"!W:&5NX
  2761. M(')E<W1O<FEN9R!A('!R979I;W5S;'D@<V%V960@<V5S<VEO;BX*+DE0(")<X
  2762. M9D)S:6=!;&%R;4-O;6UA;F1S7&90(@I4:&ES(')E<V]U<F-E('-P96-I9FEEX
  2763. M<R!T:&4@8V]M;6%N9',@=&\@97AE8W5T92!W:&5N('1H92!P<F]G<F%M"G)EX
  2764. M8V5I=F5S(&$@4TE'04Q-('-I9VYA;"X*+DE0(")<9D)S:6=#:&EL9$-O;6UAX
  2765. M;F1S7&90(@I4:&ES(')E<V]U<F-E('-P96-I9FEE<R!T:&4@8V]M;6%N9',@X
  2766. M=&\@97AE8W5T92!W:&5N('1H92!P<F]G<F%M"G)E8V5I=F5S(&$@4TE'0TA,X
  2767. M1"!S:6=N86PN"BY)4" B7&9"<VEG0V]N=&EN=65#;VUM86YD<UQF4"(*5&AIX
  2768. M<R!R97-O=7)C92!S<&5C:69I97,@=&AE(&-O;6UA;F1S('1O(&5X96-U=&4@X
  2769. M=VAE;B!T:&4@<')O9W)A;0IR96-E:79E<R!A(%-)1T-/3E0@<VEG;F%L+@HNX
  2770. M25 @(EQF0G-I9TAA;F=5<$-O;6UA;F1S7&90(@I4:&ES(')E<V]U<F-E('-PX
  2771. M96-I9FEE<R!T:&4@8V]M;6%N9',@=&\@97AE8W5T92!W:&5N('1H92!P<F]GX
  2772. M<F%M"G)E8V5I=F5S(&$@4TE'2%50('-I9VYA;"X*+DE0(")<9D)S:6=);G1EX
  2773. M<G)U<'1#;VUM86YD<UQF4"(*5&AI<R!R97-O=7)C92!S<&5C:69I97,@=&AEX
  2774. M(&-O;6UA;F1S('1O(&5X96-U=&4@=VAE;B!T:&4@<')O9W)A;0IR96-E:79EX
  2775. M<R!A(%-)1TE.5"!S:6=N86PN"BY)4" B7&9"<VEG24]#;VUM86YD<UQF4"(*X
  2776. M5&AI<R!R97-O=7)C92!S<&5C:69I97,@=&AE(&-O;6UA;F1S('1O(&5X96-UX
  2777. M=&4@=VAE;B!T:&4@<')O9W)A;0IR96-E:79E<R!A(%-)1TE/('-I9VYA;"X*X
  2778. M+DE0(")<9D)S:6=0:7!E0V]M;6%N9'-<9E B"E1H:7,@<F5S;W5R8V4@<W!EX
  2779. M8VEF:65S('1H92!C;VUM86YD<R!T;R!E>&5C=71E('=H96X@=&AE('!R;V=RX
  2780. M86T*<F5C96EV97,@82!324=025!%('-I9VYA;"X*+DE0(")<9D)S:6=1=6ETX
  2781. M0V]M;6%N9'-<9E B"E1H:7,@<F5S;W5R8V4@<W!E8VEF:65S('1H92!C;VUMX
  2782. M86YD<R!T;R!E>&5C=71E('=H96X@=&AE('!R;V=R86T*<F5C96EV97,@82!3X
  2783. M24=154E4('-I9VYA;"X*+DE0(")<9D)S:6=3=&]P0V]M;6%N9'-<9E B"E1HX
  2784. M:7,@<F5S;W5R8V4@<W!E8VEF:65S('1H92!C;VUM86YD<R!T;R!E>&5C=71EX
  2785. M('=H96X@=&AE('!R;V=R86T*<F5C96EV97,@82!324=35$]0('-I9VYA;"X*X
  2786. M+DE0(")<9D)S:6=497)M0V]M;6%N9'-<9E B"E1H:7,@<F5S;W5R8V4@<W!EX
  2787. M8VEF:65S('1H92!C;VUM86YD<R!T;R!E>&5C=71E('=H96X@=&AE('!R;V=RX
  2788. M86T*<F5C96EV97,@82!324=415)-('-I9VYA;"X*+DE0(")<9D)S:6=5<F=EX
  2789. M;G1#;VUM86YD<UQF4"(*5&AI<R!R97-O=7)C92!S<&5C:69I97,@=&AE(&-OX
  2790. M;6UA;F1S('1O(&5X96-U=&4@=VAE;B!T:&4@<')O9W)A;0IR96-E:79E<R!AX
  2791. M(%-)1U521TY4('-I9VYA;"X*+DE0(")<9D)S:6=5<W(Q0V]M;6%N9'-<9E BX
  2792. M"E1H:7,@<F5S;W5R8V4@<W!E8VEF:65S('1H92!C;VUM86YD<R!T;R!E>&5CX
  2793. M=71E('=H96X@=&AE('!R;V=R86T*<F5C96EV97,@82!324=54U(Q('-I9VYAX
  2794. M;"X*+DE0(")<9D)S:6=5<W(R0V]M;6%N9'-<9E B"E1H:7,@<F5S;W5R8V4@X
  2795. M<W!E8VEF:65S('1H92!C;VUM86YD<R!T;R!E>&5C=71E('=H96X@=&AE('!RX
  2796. M;V=R86T*<F5C96EV97,@82!324=54U(R('-I9VYA;"X*+DE0(")<9D)S:6=7X
  2797. M:6YD;W=#;VUM86YD<UQF4"(*5&AI<R!R97-O=7)C92!S<&5C:69I97,@=&AEX
  2798. M(&-O;6UA;F1S('1O(&5X96-U=&4@=VAE;B!T:&4@<')O9W)A;0IR96-E:79EX
  2799. M<R!A(%-)1U=)3D-(('-I9VYA;"X*+DE0(")<9D)S=&%R=$-O;6UA;F1S7&90X
  2800. M(@I4:&ES(')E<V]U<F-E('-P96-I9FEE<R!T:&4@8V]M;6%N9',@=&\@97AEX
  2801. M8W5T92!A9G1E<B!T:&4@=VEN9&]W(&AA<PIB965N(&]P96YE9"!B=70@8F5FX
  2802. M;W)E('1H92!C:&EL9"!P<F]C97-S(&AA<R!B965N(&9O<FME9"X*+DE0(")<X
  2803. M9D)T97)M:6YA;%1Y<&5<9E B"E1H:7,@<F5S;W5R8V4@<W!E8VEF:65S('1HX
  2804. M92!T>7!E(&]F('1E<FUI;F%L('1H92!0='D@5VED9V5T('-H;W5L9 IE;75LX
  2805. M871E+@HN25 @(EQF0G1O<$-O;6UA;F1S7&90(@I4:&ES(')E<V]U<F-E('-PX
  2806. M96-I9FEE<R!T:&4@8V]M;6%N9',@=&\@97AE8W5T92!W:&5N('1H92!0='D@X
  2807. M5VED9V5T"F%S<V5R=',@=&AE(%1O<"!#86QL8F%C:RX*+DE0(")<9D)W86MEX
  2808. M57!#;VUM86YD<UQF4"(*5&AI<R!R97-O=7)C92!S<&5C:69I97,@=&AE(&-OX
  2809. M;6UA;F1S('1O(&5X96-U=&4@=VAE;B!T:&4@4'1Y(%=I9&=E= IA<W-E<G1SX
  2810. M('1H92!786ME57 @0V%L;&)A8VLN"BYS<" Q"BY32"!#3TU-04Y$4PI#;VUMX
  2811. M86YD<R!A<F4@82!S97)I97,@;V8@86-T:6]N<R!T:&%T(&%R92!T;R!B92!PX
  2812. M97)F;W)M960@:6X@<F5S<&]N<V4*=&\@82!C97)T86EN(&5V96YT+B @5&AEX
  2813. M(&-O;6UA;F1S(&UA;FEP=6QA=&4@=&AE('-T871E(&]F('1H92!P<F]G<F%MX
  2814. M"F%N9"!S96YD(')E<75E<W1S('1O('1H92!M86YA9V5D(&-H:6QD('!R;V-EX
  2815. M<W,N("!);B!T:&ES('=A>2P*7&9)6$-O;G1R;VQ<9E @:6YF;W)M<R!T:&4@X
  2816. M8VAI;&0@<')O8V5S<R!O9B!T:&4@6"!E=F5N="!A;F0@:6YS=')U8W1S"FETX
  2817. M(&]N(&AO=R!I="!S:&]U;&0@<F5S<&]N9"X@($$@7&9"0V]M;6%N9$QI<W1<X
  2818. M9E @:7,@82!S97)I97,@;V8@;VYE"F]R(&UO<F4@8V]M;6%N9',@<V5P97)AX
  2819. M=&5D(&)Y(&$@(EQF23M<9E B+@I!(&-O;6UA;F0@:7,@;V8@=&AE(&9O<FTZX
  2820. M"BYS<" Q"BYC90I<9D)#;VUM86YD3F%M92A!<F=,:7-T*5QF4 HN<W @,0I7X
  2821. M:&5R92!<9DE!<F=,:7-T7&90(&ES(&$@;&ES="!O9B!O;F4@;W(@;6]R92!<X
  2822. M9DE!<F=U;65N='-<9E @<V5P97)A=&5D"F)Y(&$@(EQF22Q<9E B+B @06X@X
  2823. M7&9)07)G=6UE;G1<9E @:7,@86X@:6YT96=E<BP@82 B)"(@9F]L;&]W960@X
  2824. M8GD@86X*:6YT96=E<B!O<B!A(&-H87)A8W1E<B!S=')I;F<@96YC;&]S960@X
  2825. M:6X@<VEN9VQE(&]R(&1O=6)L92!Q=6]T97,N"D%R9W5M96YT<R!O9B!T:&4@X
  2826. M9F]R;2!<9DDD;EQF4"P@=VAE<F4@;B!I<R!A;B!I;G1E9V5R+"!R97!R97-EX
  2827. M;G0@80IP;W-I=&EO;F%L(&%R9W5M96YT+B @5VAE;B!T:&4@8V]M;6%N9"!IX
  2828. M<R!E>&5C=71E9"P@=&AE(&%R9W5M96YT(&ES"G-U8G-T:71U=&5D(&9O<B!TX
  2829. M:&4@=F%L=64@<W1O<F5D(&EN('1H870@<&]S:71I;VYA;"!A<F=U;6YT+B @X
  2830. M00IP;W-I=&EO;F%L(&%R9W5M96YT(&-A;B!S=&]R92!B;W1H(&EN=&5G97)SX
  2831. M(&%N9"!C:&%R86-T97(@<W1R:6YG<RX@($EF"F%N(&%R9W5M96YT(&ES(&YOX
  2832. M="!O9B!T:&4@<FEG:'0@='EP92P@=&AE(&-O;6UA;F0@=VEL;"!A=71O;6%TX
  2833. M:6-A;&QY"F-O;G9E<G0@:70@=&\@=&AE(&-O<G)E8W0@='EP92P@979E;B!IX
  2834. M9B!T:&ES(&-O;G9E<G-I;VX@9&]E<R!N;W0@;6%K90IS96YS92X@($9O<B!EX
  2835. M>&%M<&QE+"!A;F0@:6YT96=E<B!W:6QL(&)E(&-O;G9E<G1E9"!T;R!I=',@X
  2836. M8VAA<F%C=&5R"G-T<FEN9R!R97!R97-E;G1A=&EO;BX@($AO=V5V97(L(&ETX
  2837. M(&UA>2!N;W0@86QW87ES(&)E('!O<W-I8FQE('1O"F-O;G9E<G0@82!C:&%RX
  2838. M86-T97(@<W1R:6YG('1O(&%N(&EN=&5G97(N("!);B!T:&ES(&-A<V4L(&$@X
  2839. M=F%L=64@;V8@, IW;W5L9"!B92!U<V5D+@I.;W)M86QL>2!A(&-O;6UA;F0@X
  2840. M;&ES="!I<R!E>&5C=71E9"!L969T('1O(')I9VAT+B @268@86YY(&]F('1HX
  2841. M90IC;VUM86YD<R!R971U<FYS(&%N(&5R<F]R('9A;'5E('1H96X@=&AE(')EX
  2842. M;6%I;F1E<B!O9B!T:&4@8V]M;6%N9"!L:7-T"FES(&%B;W)T960N"BY,4 I4X
  2843. M:&4@=F%L:60@8V]M;6%N9',@87)E.@HN25 @(EQF0D%B;W)T*"E<9E B"E1HX
  2844. M:7,@8V]M;6%N9"!C875S97,@=&AE('!R;V=R86T@=&\@<W1O<"!E>&5C=71IX
  2845. M;F<@82!C;VUM86YD(&QI<W0N"DEF('1H92!C=7)R96YT(&-O;6UA;F0@;&ESX
  2846. M="!I<R!N97-T960@:6YS:61E(&%N;W1H97(@8V]M;6%N9"!L:7-T+ IS=6-HX
  2847. M(&%S(&EN('1H92!<9D))9EQF4"!C;VUM86YD+"!T:&5N('1H92!P<F]G<F%MX
  2848. M('=I;&P@<W1O<"!E>&5C=71I;F<*=&AE(&-U<G)E;G0@8V]M;6%N9"!L:7-TX
  2849. M(&%N9"!R971U<FX@=&\@=&AE('!R979I;W5S(&]N92X*+DE0(")<9D)'971#X
  2850. M:&EL9%!I9"A0;W-I=&EO;BE<9E B"E1H:7,@8V]M;6%N9"!G971S('1H92!PX
  2851. M<F]C97-S(&ED(&YU;6)E<B!O9B!T:&4@8VAI;&0@<')O8V5S<R!A;F0*<W1OX
  2852. M<F5S(&ET(&EN('1H92!P;W-I=&EO;F%L(&%R9W5M96YT('-P96-I9FEE9"!BX
  2853. M>2!<9DE0;W-I=&EO;EQF4"X@($EF"G1H:7,@8V]M;6%N9"!I<R!E>&5C=71EX
  2854. M9"!P<FEO<B!T;R!T:&4@8W)E871I;VX@;V8@=&AE(&-H:6QD('!R;V-E<W,*X
  2855. M=&AE;B!A(# @:7,@<F5T=7)N960N"BY)4" B7&9"1V5T1')O<$AO<W0H4&]SX
  2856. M:71I;VXI7&90(@I4:&ES(&-O;6UA;F0@;V)T86EN<R!T:&4@;F%M92!O9B!TX
  2857. M:&4@:&]S="!T:&%T('1H92!L87-T(&1R86<@86YD(&1R;W *;V-C=7)E9"!FX
  2858. M<F]M+B @7&9)4&]S:71I;VY<9E @:7,@=&AE(&YU;6)E<B!O9B!T:&4@<&]SX
  2859. M:71I;VYA;"!A<F=U;65N= IT;R!S=&]R92!T:&4@:&]S="!N86UE(&EN+@HNX
  2860. M25 @(EQF0D=E=$1R;W!.=6UB97(H5'EP92Q&:6QE*5QF4"(*5&AI<R!C;VUMX
  2861. M86YD(&]B=&%I;G,@=&AE(&YU;6)E<B!O9B!F:6QE<R!T:&%T('=E<F4@9')OX
  2862. M<'!E9"!D=7)I;F<@=&AE"FQA<W0@9')A9R!A;F0@9')O<"!E>&-H86YG92X@X
  2863. M(%QF251Y<&5<9E @:7,@=&AE(&YU;6)E<B!O9B!T:&4*<&]S:71I;VYA;"!AX
  2864. M<F=U;65N="!T;R!R971U<FX@=&AE(&YU;6)E<B!O9B!F:6QE('1Y<&5S(&1RX
  2865. M;W!P960N"EQF249I;&5<9E @:7,@=&AE(&YU;6)E<B!O9B!T:&4@<&]S:71IX
  2866. M;VYA;"!A<F=U;65N="!T;R!R971U<FX@=&AE"FYU;6)E<B!O9B!F:6QE(&YAX
  2867. M;65S(&1R;W!P960N("!)9B!N;R!D<F]P(&AA<R!O8V-U<F5D('1H96X@82!VX
  2868. M86QU92!O9@IZ97)O(&ES(')E='5N960N"BY)4" B7&9"1V5T1')O<$1I<F5CX
  2869. M=&]R>2A0;W-I=&EO;BE<9E B"E1H:7,@8V]M;6%N9"!R971U<FYS('1H92!NX
  2870. M86UE(&]F('1H92!D:7)E8W1O<GD@=&AE(&QA<W0@9')O<"!O8V-U<F5D"F9RX
  2871. M;VTN("!)9B!N;R!D:7)E8W1O<GD@=V%S('-P96-I9FEE9"!T:&5N(&$@3E5,X
  2872. M3"!S=')I;F<@:7,@<F5T=7)N960N"EQF25!O<VET:6]N7&90(&ES('1H92!NX
  2873. M=6UB97(@;V8@=&AE('!O<VET:6]N86P@87)G=6UE;G0@=&\@<F5T=7)N('1HX
  2874. M90IR97-U;'0@:6XN"BY)4" B7&9"1V5T1')O<%1Y<&4H5VAI8V@L4&]S:71IX
  2875. M;VXI7&90(@I4:&ES(&-O;6UA;F0@<F5T=7)N<R!T:&4@='EP92!O9B!A('-PX
  2876. M96-I9FEC(&9I;&4@=&AA="!W87,@9')O<'!E9"X*7&9)5VAI8VA<9E @:7,@X
  2877. M=&AE(&YU;6)E<B!O9B!T:&4@9')O<'!E9"!F:6QE('=H:6-H(&ES('1O(&)EX
  2878. M(')E='5R;F5D+@I<9DE0;W-I=&EO;EQF4"!I<R!T:&4@;G5M8F5R(&]F('1HX
  2879. M92!P;W-I=&EO;F%L(&%R9W5M96YT('1O('-T;W)E('1H90IF:6QE('1Y<&4@X
  2880. M:6XN"BY)4" B7&9"1V5T1')O<$9I;&4H5VAI8V@L4&]S:71I;VXI7&90(@I4X
  2881. M:&ES(&-O;6UA;F0@<F5T=7)N<R!T:&4@;F%M92!O9B!A('-P96-I9FEC(&9IX
  2882. M;&4@=&AA="!W87,@9')O<'!E9"!O;@IT:&4@=VEN9&]W+B @7&9)5VAI8VA<X
  2883. M9E @:7,@=&AE(&YU;6)E<B!O9B!T:&4@9')O<'!E9"!F:6QE('=H:6-H(&ESX
  2884. M('1O"F)E(')E='5R;F5D+B @7&9)4&]S:71I;VY<9E @:7,@=&AE(&YU;6)EX
  2885. M<B!O9B!T:&4@<&]S:71I;VYA;"!A<F=U;65N= IT;R!S=&]R92!T:&4@9FELX
  2886. M92!T>7!E(&EN+@HN25 @(EQF0D=E=$5N=BA.86UE+%!O<VET:6]N*5QF4"(*X
  2887. M5&AI<R!C;VUM86YD(&]B=&%I;B!T:&4@8W5R<F5N="!V86QU92!O9B!A;B!EX
  2888. M;G9I<F]N;65N="!V87)I86)L92X*7&9)3F%M95QF4"!I<R!T:&4@;F%M92!OX
  2889. M9B!T:&4@=F%R:6%B;&4@=&\@;V)T86EN+B @7&9)4&]S:71I;VY<9E @:7,*X
  2890. M=&AE(&YU;6)E<B!O9B!T:&4@<&]S:71I;VYA;"!A<F=U;65N="!T;R!S=&]RX
  2891. M92!T:&4@<F5S=6QT(&EN+@HN25 @(EQF0D=E=%!I9"A0;W-I=&EO;BE<9E BX
  2892. M"E1H:7,@8V]M;6%N9"!G971S('1H92!P<F]C97-S(&ED(&]F('1H92!P<F]GX
  2893. M<F%M(&%N9"!S=&]R97,@:70@:6X@=&AE"G!O<VET:6]N86P@87)G=6UE;G0@X
  2894. M<W!E8VEF:65D(&)Y(%QF25!O<VET:6]N7&90+@HN25 @(EQF0D=E=%=I;F1OX
  2895. M=U-I>F4H4F]W+$-O;"E<9E B"E1H:7,@8V]M;6%N9"!R971U<FYS('1H92!SX
  2896. M:7IE(&]F('1H92!W:6YD;W<@:6X@=&5R;7,@;V8@<F]W<R!A;F0*8V]L=6UNX
  2897. M<RX@(%QF25)O=UQF4"!I<R!T:&4@;G5M8F5R(&]F('1H92!P;W-I=&EO;F%LX
  2898. M(&%R9W5M96YT('1O('-T;W)E"G1H92!N=6UB97(@;V8@<F]W<R!I;BX@(%QFX
  2899. M24-O;%QF4"!I<R!T:&4@;G5M8F5R(&]F('1H92!P;W-I=&EO;F%L"F%R9W5MX
  2900. M96YT('1O('-T;W)E('1H92!N=6UB97(@;V8@8V]L=6UN<R!I;BX*+DE0(")<X
  2901. M9D))9BA/<&5R86YD,2Q#;VYD:71I;VYA;$5X<')E<W-I;VXL3W!E<F%N9#(LX
  2902. M5')U94-O;6UA;F1S+$9A;'-E0V]M;6%N9',I7&90(@I4:&ES(&-O;6UA;F0@X
  2903. M:6UP;&5M96YT<R!A;B!I9B!E>'!R97-S:6]N+B @7&9)3W!E<F%N9#%<9E @X
  2904. M86YD"EQF24]P97)A;F0R7&90(&%R92!T:&4@='=O('9A<FEA8FQE<R!T;R!PX
  2905. M97)F;W)M('1H92!C;VYD:71I;VYA; IO<&5R871I;VX@;VXN("!<9DE#;VYDX
  2906. M:71I;VYA;$5X<')E<W-I;VY<9E @:7,@82!S=')I;F<@<F5P<F5S96YT:6YGX
  2907. M"G1H92!O<&5R871I;VX@=&\@<&5R9F]R;2X@(%9A;&ED(&5X<')E<W-I;VYSX
  2908. M(&%R93H@7&9"/3U<9E L(%QF0B$]7&90+ I<9D(^/5QF4"P@7&9"/#U<9E LX
  2909. M(%QF0CQ<9E L(%QF0CY<9E L(%QF0B5<9E @86YD(%QF0B$E7&90+B @36]SX
  2910. M= IE>'!R97-S:6]N(&-O;W)E<V]N9"!T;R!T:&5I<B!<9DE#7&90(&5Q=6EVX
  2911. M86QE;G0@=VET:"!T:&4@97AC97!T:6]N(&]F"EQF0B5<9E @86YD(%QF0B$EX
  2912. M7&90('=H:6-H('1E<W0@:68@='=O('-T<FEN9W,@87)E(&5Q=6%L(&]R(&YOX
  2913. M="!E<75A; IT;R!E86-H(&]T:&5R(')E<W!E8W1I=F5L>2X@(%QF251R=65#X
  2914. M;VUM86YD<UQF4"!I<R!A(&-O;6UA;F0@;&ES="!T;PIC;VUP:6QE(&%N9"!EX
  2915. M>&5C=71E(&EF('1H92!B;V]L96%N(&5X<')E<W-I;VX@979A;'5T97,@=&\@X
  2916. M=')U92X*3W1H97)W:7-E+"!T:&4@8V]M;6%N9"!L:7-T(&=I=F5N(&)Y(%QFX
  2917. M249A;'-E0V]M;6%N9'-<9E @87)E(&-O;7!I;&5D"F%N9"!E>&5C=71E9"X@X
  2918. M($]N8V4@=&AE('!R;W!E<B!C;VUM86YD(&QI<W0@:&%S(&)E96X@97AE8W5TX
  2919. M960L(&-O;G1R;VP*<F5T=7)N<R!T;R!T:&4@8W5R<F5N=&QY(&5X96-U=&ENX
  2920. M9R!C;VUM86YD(&QI<W0N"BY)4" B7&9"36%T:"A/<&5R86YD,2Q/<&5R871IX
  2921. M;VXL3W!E<F%N9#(L4F5S=6QT*5QF4"(*5&AI<R!C;VUM86YD('!E<F9O<FUSX
  2922. M(&$@;6%T:&5M871I8V%L(&]P97)A=&EO;BX@(%QF24]P97)A;F0Q7&90(&%NX
  2923. M9 I<9DE/<&5R86YD,EQF4"!A<F4@=&AE('1W;R!O<&5R86YD<R!U<&]N('=HX
  2924. M:6-H('1H92!M871H(&9U;F-T:6]N(&ES('1O"F)E('!E<F9O<FUE9"X@(%QFX
  2925. M24]P97)A=&EO;EQF4"!I<R!A(&-H87)A8W1E<B!S=')I;F<@<F5P<F5S96YTX
  2926. M:6YG('1H90IM871H96UA=&EC86P@;W!E<F%T:6]N('1O(&)E('!E<F9O<FUEX
  2927. M9"X@(%9A;&ED(&]P97)A=&EO;G,@87)E.@I<9D(K7&90+"!<9D(M7&90+"!<X
  2928. M9D(J7&90+"!<9D(O7&90+"!<9D(E7&90+"!<9D(F7&90(&%N9"!<9D)\7&90X
  2929. M+B @06QL"F]P97)A=&EO;G,@:&%V92!T:&4@<V%M92!M96%N:6YG(&%S('1HX
  2930. M96ER($,@;&%N9W5A9V4@97%U:79A;&5N="X*7&9)4F5S=6QT7&90(&ES('1HX
  2931. M92!N=6UB97(@;V8@=&AE('!O<VET:6]N86P@87)G=6UE;G0@<V\@<W1O<F4@X
  2932. M=&AE"G)E<W5L="!O9B!T:&4@;W!E<F%T:6]N(&EN+@HN25 @(EQF0E!R;VUPX
  2933. M="A4:71L92Q1=65S=&EO;BQ997,L3F\L0V%N8V5L+%EE<T-O;6UA;F1S+$YOX
  2934. M0V]M;6%N9',L0V%N8V5L0V]M;6%N9',I7&90(@I4:&ES(&-O;6UA;F0@<'5TX
  2935. M<R!U<"!A(&1I86QO9R!B;W@@=&\@86QL;W<@=&AE('5S97(@=&\@<V5L96-TX
  2936. M(&%N"F%C=&EO;B!T;R!T86ME+B @7&9)5&ET;&5<9E @:7,@=&AE('-T<FENX
  2937. M9R!T;R!P=70@:6X@=&AE('1I=&QE(&]F('1H90IP<F]M<'0@9&EA;&]G+B @X
  2938. M7&9)475E<W1I;VY<9E @:7,@=&5X="!T;R!P=70@:6X@=&AE(&1I86QO9RX*X
  2939. M7&9)665S7&90(&ES('1H92!S=')I;F<@=&\@<'5T(&EN('1H92!A9F9I<FUAX
  2940. M=&EV92!B=71T;VXN("!<9DE.;UQF4"!I<PIT:&4@8VAA<F%C=&5R('-T<FENX
  2941. M9R!I<R!P=70@:6X@=&AE(&YE9V%T:79E(&)U='1O;B!W:&EL92!<9DE#86YCX
  2942. M96Q<9E *:7,@=&AE('1E>'0@=&\@<&QA8V4@:6X@=&AE(&-A;F-E;"!B=71TX
  2943. M;VXN("!<9DE997-#;VUM86YD<UQF4"!I<R!A"F-O;6UA;F0@;&ES="!T:&%TX
  2944. M(&ES(&-O;7!I;&5D(&%N9"!E>&5C=71E9"!W:&5N('1H92!U<V5R('!R97-SX
  2945. M97,@=&AE"F%F9FER;6%T:79E(&)U='1O;BX@(%-I;6EL87)L>2P@=&AE(%QFX
  2946. M24YO0V]M;6%N9'-<9E @86YD"EQF24-A;F-E;$-O;6UA;F1S7&90(&%R92!TX
  2947. M:&4@8V]M;6%N9"!L:7-T<R!T;R!B92!E>&5C=71E9"!W:&5N('1H90IU<V5RX
  2948. M(&%C=&EV871E<R!T:&4@;F5G871I=F4@;W(@8V%N8V5L(&)U='1O;G,N("!.X
  2949. M;W1E('1H870@=&AE"EQF0E!R;VUP=%QF4"!C;VUM86YD(&1O97,@;F]T('=AX
  2950. M:70@9F]R('1H92!U<V5R('1O('-E;&5C="!O;F4@;V8@=&AE"F)U='1O;G,@X
  2951. M:6X@=&AE(&1I86QO9RX@(%)A=&AE<BP@=&AE(')E;6%I;FEN9R!F=6YC=&EOX
  2952. M;G,@:6X@=&AE(&-O;6UA;F0*;&ES="!A<F4@97AE8W5T960L('5S=6%L;'D@X
  2953. M<')I;W(@=&\@=&AE('!R;VUP="!D:6%L;V<@8F5I;F<@<F5A;&EZ960N"BY)X
  2954. M4" B7&9"475I="A3=&%T=7,I7&90(@I4:&ES(&-O;6UA;F0@8V%U<V4@=&AEX
  2955. M('!R;V=R86T@=&\@97AI="X@(%QF25-T871U<UQF4"!I<R!T:&4@:6YT96=EX
  2956. M<@IV86QU92!T;R!P87-S('1O('1H92!<9DEE>&ET*"E<9E @9G5N8W1I;VXNX
  2957. M"BY)4" B7&9"4F5A<"AN*5QF4"(*5&AI<R!C;VUM86YD(&-A=7-E<R!T:&4@X
  2958. M<')O9W)A;2!A8W%U:7)E('1H92!E>&ET('-T871U<R!O9B!O;F4@;V8@:71SX
  2959. M"F-H:6QD<F5N+B @7&9);EQF4"!I<R!T:&4@;G5M8F5R(&]F('1H92!P;W-IX
  2960. M=&EO;F%L(&%R9W5M96YT('=H97)E('1H90IP<F]C97-S(&ED(&]F('1H92!RX
  2961. M96%P960@8VAI;&0@<VAO=6QD(&)E('-T;W)E9"X@($EF(&YO(&-H:6QD('!RX
  2962. M;V-E<W,*=V%S(&9O=6YD('1H96X@82!V86QU92!O9B P(&ES('-T;W)E9"X*X
  2963. M+DE0(")<9D)296UO=F54:6UE3W5T*%1I;65/=71)9"E<9E B"E1H:7,@8V]MX
  2964. M;6%N9"!R96UO=F5S(&$@<')E=FEO=7-L>2!S=&%R=&5D('1I;64@;W5T+B @X
  2965. M7&9)5&EM94]U=$ED7&90"FES('1H92!V86QU92!R971U<FYE9"!F<F]M('1HX
  2966. M92!<9D)4:6UE3W5T7&90(&-O;6UA;F0N"BY)4" B7&9"4V%V95-E<W-I;VXHX
  2967. M*5QF4"(*5&AI<R!C;VUM86YD(&-A=7-E<R!T:&4@<')O9W)A;2!T;R!G96YEX
  2968. M<F%T92!A('-E<W-I;VX@9FEL92!I;B!W:&EC: IA;&P@=&AE(&-U<G)E;G0@X
  2969. M<W1A=&4@:6YF;W)M871I;VX@:7,@<V%V960N("!4:&ES(&9I;&4@8V%N('1HX
  2970. M96X@8F4*=7-E9"!T;R!R97-T87)T('1H92!P<F]G<F%M(&%T(&$@;&%T97(@X
  2971. M9&%T92!W:71H('1H92!<9DDM<V5S<VEO;EQF4"!O<'1I;VXN"BY)4" B7&9"X
  2972. M4V5T16YV*$YA;64L5F%L=64I7&90(@I4:&ES(&-O;6UA;F0@<V5T<R!A;B!EX
  2973. M;G9I<F]N;65N="!V87)I86)L92!I;B!T:&4@<')O9W)A;2X@(%QF24YA;65<X
  2974. M9E *:7,@=&AE(&YA;64@;V8@=&AE('9A<FEA8FQE('1O('-E="X@(%QF259AX
  2975. M;'5E7&90(&ES('1H92!V86QU92!T;R!S970*:70@=&\N"BY)4" B7&9"4VEGX
  2976. M;F%L*&XI7&90(@I4:&ES(&-O;6UA;F1S('-E;F1S(&$@<VEG;F%L('1O('1HX
  2977. M92!P<F]C97-S(&=R;W5P('=H:6-H(&ES(&%S<V]C:6%T960*=VET:"!T:&4@X
  2978. M<VQA=F4@<VED92!O9B!T:&4@<'1Y+B @7&9);EQF4"!I<R!T:&4@;G5M8F5RX
  2979. M(&]F('1H92!S:6=N86P*=&\@<V5N9"X@($EF('1H92!N=6UB97(@:7,@:6YVX
  2980. M86QI9"!T:&5N('1H92!C;VUM86YD(')E='5R;G,@86X@97)R;W(N"BY)4" BX
  2981. M7&9"4VQE97 H;BE<9E B"E1H:7,@8V]M;6%N9"!C875S97,@=&AE('!R;V=RX
  2982. M86T@=&\@<W5S<&5N9"!E>&5C=71I;VX@9F]R(&$@8V5R=&%I;@IA;6]U;G0@X
  2983. M;V8@=&EM92X@(%QF26Y<9E @:7,@=&AE(&YU;6)E<B!O9B!S96-O;F1S('1OX
  2984. M('-L965P(&9O<BX*1'5R:6YG('1H:7,@<VQE97 @:6YT97)V86PL('1H92!PX
  2985. M<F]G<F%M(&1O97,@;F]T(')E<W!O;F0@=&\@86YY(%@*979E;G1S('-O(&ETX
  2986. M(&ES(&YO="!A(&=O;V0@:61E82!T;R!S<&5C:69Y('1O;R!L87)G92!O9B!DX
  2987. M=7)A=&EO;BX*+DE0(")<9D)3=&]R95-T<FEN9RA3=')I;F<L4&]S:71I;VXIX
  2988. M7&90(@I4:&ES(&-O;6UA;F0@<W1O<F5S(&$@=F%L=64@:6YT;R!A('!O<VETX
  2989. M:6]N86P@87)G=6UE;G0N("!<9DE3=')I;F=<9E *:7,@=&AE('9A;'5E('1OX
  2990. M('-T;W)E(&%N9"!<9DE0;W-I=&EO;EQF4"!I<R!T:&4@;G5M8F5R(&]F('1HX
  2991. M90IP;W-I=&EO;F%L(&%R9W5M96YT('1O('-T;W)E('1H92!S=')I;F<@:6XNX
  2992. M"BY)4" B7&9"4W1R:6YG0V%T*%-T<FEN9S$L4W1R:6YG,BQ297-U;'0I7&90X
  2993. M(@I4:&ES(&-O;6UA;F1S(&-O;F-A=&EN871E<R!T=V\@<W1R:6YG<R!T;V=EX
  2994. M=&AE<B!T;R!F;W)M(&$@=&AI<F0*<W1R:6YG+B @7&9)4W1R:6YG,5QF4"!IX
  2995. M<R!T:&4@9FER<W0@<W1R:6YG(&%N9"!<9DE3=')I;F<R7&90(&ES('1H90ISX
  2996. M96-O;F0@<W1R:6YG+B @7&9)4F5S=6QT7&90(&ES('1H92!N=6UB97(@;V8@X
  2997. M=&AE('!O<VET:6]N86P@87)G=6UE;G0*=&\@<W1O<F4@=&AE(')E<W5L="!IX
  2998. M;BX*+DE0(")<9D)4:6UE3W5T*$1U<F%T:6]N+%!O<VET:6]N+$-O;6UA;F1SX
  2999. M*5QF4"(*5&AI<R!C;VUM86YD(&EN<W1A;&QS(&$@=&EM96]U="!C86QL8F%CX
  3000. M:R!I;B!T:&4@<')O9W)A;2X*7&9)1'5R871I;VY<9E @:7,@=&AE(&%M;W5NX
  3001. M="!O9B!T:6UE+"!I;B!M:6QL:7-E8V]N9',L('1H870@87)E"F%L;&]W960@X
  3002. M=&\@96QL87!S92!B969O<F4@=&AE('1I;65O=70@:7,@=')I9V=E<F5D+B @X
  3003. M7&9)4&]S=&EO;EQF4"!I<PIT:&4@;G5M8F5R(&]F('1H92!P;W-I=&EO;F%LX
  3004. M(&%R9W5M96YT('=H97)E('1H92!T:6UE;W5T(&ED(&ES('-T;W)E9"X*5&AIX
  3005. M<R!I<R!N965D960@<V\@=&AA="!T:&4@=&EM96]U="!C86X@8F4@<F5M;W9EX
  3006. M9"!A="!A(&QA=&5R('1I;64N"EQF24-O;6UA;F1S7&90(&ES('1H92!C;VUMX
  3007. M86YD(&QI<W0@=&\@8V]M<&EL92!A;F0@97AE8W5T92!W:&5N('1H90IT:6UEX
  3008. M;W5T(&5X<&ER97,N"BY)4" B7&9"5V%R;FEN9RA497AT*5QF4"(*5&AI<R!CX
  3009. M;VUM86YD(&-A=7-E<R!A('=A<FYI;F<@9&EA;&]G('1O('!U="!U<"!O;B!TX
  3010. M:&4@<V-R965N+@I<9DE497AT7&90(&ES('1H92!M97-S86=E('1O(&1I<W!LX
  3011. M87D@:6X@=&AE('=A<FYI;F<@9&EA;&]G+B @5&AE"F1I86QO9R!W:6QL('-TX
  3012. M87D@=7 @=6YT:6P@9&ES;6ES<V5D(&)Y('1H92!U<V5R+B @3F]T92!T:&%TX
  3013. M('1H90IC;VUM86YD(&QI<W0@8V]N=&EN=65S('1O(&5X96-U=&4@869T97(@X
  3014. M=&AI<R!F=6YC=&EO;B!H87,@8V]M<&QE=&5D+@I4:&%T(&ES('1O('-A>2P@X
  3015. M=&AE('!R;V=R86T@9&]E<R!N;W0@=V%I="!F;W(@=&AE('5S97(@=&\@9&ESX
  3016. M;6ES<R!T:&4*=V%R;FEN9R!D:6%L;V<@8F5F;W)E(&-O;G1I;G5I;F<@=&AEX
  3017. M(&-O;6UA;F0@;&ES="X*+DE0(")<9D)7<FET92A3=')I;F<Q+%-T<FEN9S(LX
  3018. M+BXN*5QF4"(*5&AI<R!C;VUM86YD('-E;F1S('1H92!A<F=U;65N="!S=')IX
  3019. M;F=S('1O('1H92!C:&EL9"!P<F]C97-S(&%S(&EF"G1H97D@=V5R92!T>7!EX
  3020. M9"!I;B!A="!T:&4@:V5Y8F]A<F0N("!!;GD@;G5M8F5R(&]F(&%R9W5M96YTX
  3021. M<R!C86X@8F4*<W!E8VEF:65D+@HN<W @,0HN4T@@(E-%12!!3%-/(@I<9D)HX
  3022. M<'1E<FTH,2DL('AT97)M*#$I+"!0='DH,U@I+"!'96Y497)M16TH,W@I+" *X
  3023. .1V5N5&5R;2@S6"E<9E!M                                        X
  3024.                                                              X
  3025. end
  3026. @eof
  3027. set `wc -lwc <xcontrol/XControl.man`
  3028. if test $1$2$3 != 409279618959
  3029. then
  3030.     echo ERROR: wc results of xcontrol/XControl.man are $* should be 409 2796 18959
  3031. fi
  3032.  
  3033. chmod 644 xcontrol/XControl.man
  3034.  
  3035. echo x - xcontrol/XVi.ad
  3036. cat >xcontrol/XVi.ad <<'@EOF'
  3037. *Pty*literalMode:    False
  3038. *Pty*autoLineWrap:    True
  3039. *Pty*saveLines:        48
  3040. *Pty*destructiveTab:    False
  3041. *Pty*ttyMode:        rows 24 columns 80 \
  3042. 9600 susp ^z dsusp ^z intr ^c quit ^\\ erase ^H kill ^u swtch ^@ eof ^d \
  3043. eol ^@ stop ^s start ^q -parenb -parodd cs8 -cstopb hupcl cread -clocal \
  3044. -loblk -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr \
  3045. icrnl -iuclc ixon -ixany ixoff -ienqak isig icanon iexten -xcase echo echoe \
  3046. echok -echonl -noflsh opost -olcuc onlcr -ocrnl -onocr -onlret -ofill \
  3047. -ofdel -tostop tab3
  3048. *Pty*ignoreNull:    True
  3049. *hpterm*parseFile:    PARSEDIR/hpterm.par
  3050. *hpterm*fieldAttributes: True
  3051. *hpterm*saveScrollRegion:    True
  3052. *hpterm*penColors:    Default:Default:red:Default:green:Default:yellow:\
  3053. Default:blue:Default:magenta:Default:cyan:Default:black:yellow"
  3054. *xterm*parseFile:    PARSEDIR/xterm.par
  3055. *xterm*fieldAttributes:    False
  3056. *xterm*saveScrollRegion:    True
  3057. *xterm*scrollOnOutput:    True
  3058. *xterm*numberMapTables:    4
  3059. *xterm*cursorFloats:    False
  3060. *xterm*scrollDownClear:    True
  3061. *xterm*fullScroll:    False
  3062. *xterm*cursorKeyScrollRegion:    True
  3063. *xterm*eolStick:    True
  3064. *xterm*translations:    #override\n\
  3065. <ButtonPress>:invokeTranslation(ButtonTranslator)\n\
  3066. <ButtonRelease>:invokeTranslation(ButtonReleaseTranslator)\n
  3067. !
  3068. *childCommand:        /usr/bin/vi
  3069. *closeWindowCommands:    Prompt("Closing...","Save File Before Closing Window?"\
  3070. ,"Yes^JSave File","No^JDon't Save File","Cancel Close",\
  3071. "TimeOut(100000,11,\\"Signal(9);Quit(0)\\");Signal(2);\
  3072. Write(\\":w!^J\\",\\":q^J\\")",\
  3073. "TimeOut(100000,11,\\"Signal(9);Quit(0)\\");Signal(2);Write(\\":q!^J\\")",\
  3074. "Abort()")
  3075. *remoteDropsAllowed:    True
  3076. !*dropCommands:        GetDropNumber(1,2);GetDropHost(3);GetDropDirectory(4);\
  3077. !GetDropType(1,5);GetDropFile(1,6);\
  3078. !Write("T=",$1," F=",$2," Host ",$3," Dir ",$4," Type ",$5," Name ",$6);
  3079. *dropZoneType:        FileEdit
  3080. *sigChildCommands:    Reap(1);GetChildPid(2);If($1,"==",$2,"Quit(0)",\
  3081. "Abort()")
  3082. *childForkCommands:    GetTerminalType(2);SetEnv("TERM",$2);
  3083. *saveSessionCommands:    Signal(2);Write(":w^J");SaveSession();
  3084. *dropCommands:        GetDropNumber(1,2);GetDropFile(1,3);\
  3085. GetDropDirectory(4);StringCat($4,$3,3);\
  3086. StoreString("Signal(2);Write(\\":e \\",$3,\\"^J\\");",5);\
  3087. StoreString("Signal(2);Write(\\":w!^J\\");",6);\
  3088. StringCat($6,$5,7);\
  3089. StoreString("Prompt(\\"New File\\",\\"Save Old File?\\",\\"Yes^JSave Files\\",\
  3090. \\"No^JDon't Save File\\",\\"Cancel\\",$7,$5,\\"Abort()\\");",8);\
  3091. If($2,"!=",1,"Warning(\\"Too many files dropped\\")",$8)
  3092. *startupCommands:    GetWindowSize(1,2);SetEnv("LINES",$1);\
  3093. SetEnv("COLUMNS",$2);
  3094. @EOF
  3095. set `wc -lwc <xcontrol/XVi.ad`
  3096. if test $1$2$3 != 571822493
  3097. then
  3098.     echo ERROR: wc results of xcontrol/XVi.ad are $* should be 57 182 2493
  3099. fi
  3100.  
  3101. chmod 644 xcontrol/XVi.ad
  3102.  
  3103. echo x - MANIFEST
  3104. cat >MANIFEST <<'@EOF'
  3105. File Name                 Kit Number
  3106. --------------            ----------
  3107. GenTerm/GenTerm.c            1
  3108. GenTerm/GenTerm.h            1
  3109. GenTerm/GenTerm.man          2
  3110. GenTerm/GenTermEm.c          2
  3111. GenTerm/GenTermEm.h          1
  3112. GenTerm/GenTermEm.man        2
  3113. GenTerm/GenTermEmP.h         1
  3114. GenTerm/GenTermP.h           1
  3115. GenTerm/LoadParser.c         2
  3116. GenTerm/Makefile             2
  3117. GenTerm/Parse.c              3
  3118. GenTerm/Parser.h             2
  3119. GenTerm/Pty.c                3
  3120. GenTerm/Pty.h                2
  3121. GenTerm/Pty.man              3
  3122. GenTerm/PtyP.h               2
  3123. GenTerm/TAGS                 3
  3124. GenTerm/Xmu.h                2
  3125. GenTerm/ctest.c              3
  3126. GenTerm/hpterm.par           3
  3127. GenTerm/test.c               3
  3128. GenTerm/translators          4
  3129. GenTerm/xterm.par            4
  3130. MANIFEST                     4
  3131. Makefile                     1
  3132. README                       1
  3133. xcontrol/Command.c           4
  3134. xcontrol/Makefile            2
  3135. xcontrol/ParseString.c       3
  3136. xcontrol/TAGS                3
  3137. xcontrol/XControl.ad         3
  3138. xcontrol/XControl.c          4
  3139. xcontrol/XControl.h          4
  3140. xcontrol/XControl.man        4
  3141. xcontrol/XVi.ad              4
  3142. @EOF
  3143. set `wc -lwc <MANIFEST`
  3144. if test $1$2$3 != 37761159
  3145. then
  3146.     echo ERROR: wc results of MANIFEST are $* should be 37 76 1159
  3147. fi
  3148.  
  3149. chmod 644 MANIFEST
  3150.  
  3151. rm -f /tmp/unpack$$
  3152. exit 0
  3153.