home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / unix / uw_shar.sit / uw-42-part2.shar < prev    next >
Text File  |  1989-09-14  |  57KB  |  1,711 lines

  1. #Date: Wed, 2 Mar 88 10:00:18 PST
  2. #From: rothberg@polya.stanford.edu (Edward Rothberg)
  3. #Subject: UW 4.2 part 2 of 8
  4. : This is a shar archive.  Extract with sh, not csh.
  5. if test ! -d doc; then
  6.     echo mkdir doc
  7.     mkdir doc
  8. fi
  9. echo x - doc/uwlib.ms
  10. sed -e 's/^X//' > doc/uwlib.ms << '!EOF!doc/uwlib.ms!'
  11. X.\" This file should be processed by nroff or troff with the -ms macro set
  12. X.ds uw \s-2UW\s0
  13. X.DA September 30, 1986
  14. X.TL
  15. XThe UW Programmer's Library
  16. X.AU
  17. XJohn D. Bruner
  18. X.SH
  19. XIntroduction
  20. X.PP
  21. X\*(uw is a multiple-window Macintosh interface to a 4.2BSD UNIX\**.
  22. X.FS
  23. XMacintosh is a trademark of McIntosh Laboratories which
  24. Xis licensed to Apple Computer, Inc.
  25. XUNIX is a registered trademark of Bell Laboratories.
  26. X.FE
  27. X\*(uw version 3 comprises a server,
  28. Xa set of utility programs,
  29. Xand an program-level interface.
  30. XThis manual describes the services which are available
  31. Xin the \*(uw programmer's library.
  32. XThis library allow programs to create,
  33. Xcommunicate with,
  34. Xand perform some control operations upon
  35. Xwindows on the Macintosh.
  36. X.SH
  37. XBackground
  38. X.PP
  39. XBefore the library routines themselves can be discussed,
  40. Xit is necessary to consider some aspects of the \*(uw
  41. Xserver.
  42. XThe server which was distributed with \*(uw versions 1.6 and 2.10
  43. Xcommunicated with the Macintosh using a protocol which
  44. Xis referred to as the ``original protocol.''
  45. XThe version 3 server is capable of communicating in this protocol;
  46. Xhowever,
  47. Xit also supports an ``extended protocol.''
  48. XFor convenience,
  49. Xthese protocols are assigned numbers:
  50. Xprotocol 1 is the original protocol
  51. Xand protocol 2 is the extended protocol.
  52. X.PP
  53. XProtocol 1 provides a mechanism for
  54. Xthe creation and destruction of windows
  55. Xas well as a means to multiplex a single
  56. Xcommunications line among several windows.
  57. XIt provides a mechanism for transmitting
  58. Xcontrol and ``meta'' characters,
  59. Xand it also provides two ``maintenance functions''
  60. Xwhich are used for startup and shutdown.
  61. X.PP
  62. XProtocol 2 provides two significant enhancements
  63. Xrelative to protocol 1.
  64. XFirst,
  65. Xwindow creation messages specify the window emulation type
  66. X(\fIe.g.\fP adm-31, vt52).
  67. XSecond,
  68. Xadditional information about windows,
  69. Xcalled ``window options,''
  70. Xis transmitted between the Macintosh client and the
  71. Xserver on the host.
  72. X.PP
  73. XWindow options are an ``out-of-band'' channel of
  74. Xinformation between the Macintosh and the host.
  75. XThere are two types:
  76. Xgeneric
  77. X(common to all window types)
  78. Xand emulation-specific.
  79. XThe following are generic:
  80. X.DS
  81. Xwindow visibility
  82. Xwindow type
  83. Xwindow position (pixel address of top left corner)
  84. Xwindow title
  85. Xwindow size in pixels
  86. X.DE
  87. XThe following window options are specific to
  88. Xcursor-addressible terminal emulations:
  89. X.DS
  90. Xterminal size (number of rows and columns)
  91. Xfont size index (small=0, large=1)
  92. Xmouse handling (clipboard or encoded send-to-host)
  93. Xbell characteristics (audible, visible)
  94. Xcursor appearance (block or underscore)
  95. X.DE
  96. X.PP
  97. XThe server distinguishes between two window classes \(em
  98. Xinternal and external.
  99. XInternal windows are handled entirely by the server.
  100. XThey are always terminal emulations and are always
  101. Xassociated with a pseudo-terminal device.
  102. X.PP
  103. XBy contrast,
  104. Xan external window always involves some outside process.
  105. XThe server communicates with this process through one
  106. Xor two Internet domain network connections.
  107. XThere is always a ``data'' connection,
  108. Xthrough which the external process exchanges information
  109. X(indirectly, through the server)
  110. Xwith the Macintosh.
  111. XThere may also be a ``control'' connection
  112. Xthrough which the external process exchanges
  113. Xwindow option information
  114. X(again indirectly)
  115. Xwith the Macintosh.
  116. XThe server acts as a multiplexor and demultiplexor
  117. Xfor external windows.
  118. XIt also caches window option information;
  119. Xhowever,
  120. Xit does not perform host-end emulation-specific tasks.
  121. X.PP
  122. XInternal and external windows meet different needs.
  123. XTerminal emulation on the local host is best performed
  124. Xby internal windows,
  125. Xbecause fewer processes are involved
  126. X(and response time is better).
  127. XExternal windows are suitable for remote processes
  128. X(\fIi.e.\fP those on another Internet host)
  129. Xor for non-terminal tasks such as file transfer.
  130. XThe \*(uw application library contains routines
  131. Xto create and manipulate both classes of windows.
  132. X.SH
  133. XWindow ID's and Network Addresses
  134. X.PP
  135. XA unique 32-bit identification number is associated
  136. Xwith each window that a server manipulates.
  137. XSome operations
  138. X(described below)
  139. Xrequire the window number to be specified.
  140. XWhen the server creates a new internal window,
  141. Xit passes the window ID as the environment variable
  142. X``UW_ID''.
  143. X.PP
  144. XThe server creates two network sockets upon which to receive
  145. Xincoming messages.
  146. XOne socket receives UNIX-domain datagrams,
  147. Xthe other listens for Internet-domain stream connections.
  148. XThe addresses of these sockets are placed in the environment
  149. Xas the variables ``UW_UIPC''
  150. X(UNIX-domain)
  151. Xand ``UW_INET''
  152. X(Internet domain).
  153. X.SH
  154. XData Types and Data Structures
  155. X.PP
  156. XThe \*(uw programmer's library uses a number
  157. Xof simple and structured data types.
  158. X.IP uwid_t 1i
  159. XUnique window ID numbers are represented by the data type ``uwid_t''.
  160. X.IP UWIN
  161. XLibrary routines which operate upon external windows
  162. Xput a range of window information into a structure.
  163. XThe type ``UWIN'' is a pointer to the structure.
  164. XAn object of this datatype is referred to as a ``window descriptor.''
  165. XThis declaration is intended to be used as an abstract unit
  166. X(in the manner of the standard I/O library's ``FILE\ *'').
  167. X.IP uwtype_t
  168. XWindow emulation types have the data type ``uwtype_t''.
  169. XThe following emulation types are defined:
  170. X.DS
  171. X.ta 8n 24n 32n
  172. X#define    UWT_ADM31    0    /* ADM-31 cursor-addressible terminal */
  173. X#define    UWT_VT52    1    /* VT52 cursor-addressible terminal */
  174. X#define    UWT_ANSI    2    /* ANSI-compatible terminal */
  175. X#define    UWT_TEK4010    3    /* Tektronix 4010 graphics terminal */
  176. X#define    UWT_FTP    4    /* File transfer */
  177. X#define    UWT_PRINT    5    /* Output to Macintosh printer */
  178. X.DE
  179. X.IP uwopt_t
  180. XWindow options are assigned numbers whose type is ``uwopt_t''.
  181. XThe names of the options are:
  182. X.DS
  183. X.ta 8n 28n 32n
  184. X#define    UWOP_VIS    1    /* visibility */
  185. X#define    UWOP_TYPE    2    /* window type */
  186. X#define    UWOP_POS    3    /* window position */
  187. X#define    UWOP_TITLE    4    /* window title */
  188. X#define    UWOP_WSIZE    5    /* window size (in bits) */
  189. X#define    UWOP_TSIZE    8    /* terminal size (row,col) */
  190. X#define    UWOP_TFONTSZ    9    /* small/large font size */
  191. X#define    UWOP_TCLIPB    10    /* clipboard/mouse encoding */
  192. X#define    UWOP_TBELL    11    /* audible, visual bell */
  193. X#define    UWOP_TCURS    12    /* cursor shape */
  194. X.DE
  195. X.IP uwoptcmd_t
  196. XThe window option commands
  197. Xwhich are passed between the Macintosh and the host
  198. Xhave type ``uwoptcmd_t''.
  199. XThese commands are:
  200. X.DS
  201. X.ta 8n 24n 32n
  202. X#define    UWOC_SET    0        /* set value of option */
  203. X#define    UWOC_ASK    2        /* ask for value of option */
  204. X#define    UWOC_DO    4        /* report changes in value */
  205. X#define    UWOC_DONT    5        /* don't report changes */
  206. X#define    UWOC_WILL    6        /* will report changes */
  207. X#define    UWOC_WONT    7        /* won't report changes */
  208. X.DE
  209. X.IP "union uwoptval"
  210. XWhen a function requires a window option value as an argument,
  211. Xthe value of the window option is placed into a
  212. Xunion declared as ``union uwoptval''.
  213. XThe address of this union is passed to the function.
  214. XThis union is declared as follows:
  215. X.DS
  216. X.ta 8n 16n 24n
  217. Xunion uwoptval {
  218. X    unsigned char    uwov_1bit;
  219. X    unsigned char    uwov_2bit;
  220. X    unsigned char    uwov_6bit;
  221. X    unsigned short    uwov_12bit;
  222. X    struct {
  223. X        unsigned short v,h;
  224. X    }        uwov_point;
  225. X    char        uwov_string[256];
  226. X};
  227. X.DE
  228. XThe union member used for a particular option
  229. Xdepends upon the option number.
  230. XAt present,
  231. Xthe types of the window options and
  232. Xcorresponding union members are:
  233. X.DS
  234. X.ta 1i
  235. Xvisibility    uwov_1bit
  236. Xtype    uwov_6bit
  237. Xposition    uwov_point
  238. Xtitle        uwov_string (null terminated)
  239. Xbit size    uwov_point
  240. Xtty size    uwov_point
  241. Xfont size    uwov_1bit
  242. Xclipboard    uwov_1bit
  243. Xbell        uwov_2bit
  244. Xcursor type    uwov_1bit
  245. X.DE
  246. X.IP "uwerr_t"
  247. XWhen a library routine returns an error indication,
  248. Xfurther information about the type of error can be
  249. Xobtained from the global variable ``uwerrno''.
  250. X(Depending upon the type of error,
  251. Xthe external variable ``errno'' may also contain
  252. Xpertinent information.)
  253. X\*(uw error numbers have type ``uwerr_t'',
  254. Xand are defined as follows:
  255. X.DS
  256. X.ta 8n 24n 32n
  257. X#define    UWE_NONE    0    /* no error */
  258. X#define    UWE_ERRNO    1    /* system call error, consult errno */
  259. X#define    UWE_NXTYPE    2    /* nonexistent window type */
  260. X#define    UWE_DUPID    3    /* window ID duplicated (in use) */
  261. X#define    UWE_NOTIMPL    4    /* operation not implemented yet */
  262. X#define    UWE_NXSERV    5    /* non-existent server */
  263. X#define    UWE_NOMEM    6    /* unable to allocate required memory */
  264. X#define    UWE_INVAL    7    /* invalid argument to function */
  265. X#define    UWE_NOCTL    8    /* no control file descriptor */
  266. X.DE
  267. X.SH
  268. XInternal Window Interface
  269. X.PP
  270. XWhen an internal window is created by an external process,
  271. Xa UNIX-domain datagram is sent to the server.
  272. XThis datagram contains
  273. X(as ``access rights'')
  274. Xa file descriptor for the ``master'' side of a pseudo-terminal.
  275. XThe server assumes that the external process
  276. Xhas started some program on the ``slave'' side of the pseudo-terminal.
  277. XAfter sending the datagram,
  278. Xthe sender has no direct handle to manipulate
  279. Xthe window.
  280. XIt has,
  281. Xin effect,
  282. Xrelinquished all control.
  283. X(It should close the master side of the pseudo-terminal
  284. Xafter sending the datagram.)
  285. XTo provide some additional flexibility,
  286. Xit is possible to change the value of a window option
  287. Xfor any window
  288. X(even ``external'' windows)
  289. Xif the window's unique ID is known.
  290. XThe creator of the window has no special privileges
  291. Xin this regard.
  292. X.LP
  293. X[One thing which the internal window routines
  294. Xin the \*(uw library completely ignore
  295. Xis the fact that datagrams are not guaranteed to be reliable.
  296. XUNIX-domain datagrams almost always seem to work,
  297. Xbut they can fail.
  298. XIn the author's experience this has never been a problem,
  299. Xbut let the user beware.]
  300. X.LP
  301. XThe following routines are available:
  302. X.IP uw_fork 1i
  303. XThis routine is similar in concept to the system call ``fork''.
  304. XIt creates a new process
  305. Xand returns twice \(em
  306. Xonce in the parent and once in the child.
  307. XIn addition to creating a new process,
  308. X``uw_fork'' also arranges for the new process to be
  309. Xassociated with an internal window.
  310. XIt opens a pseudo-terminal,
  311. Xredirects the child's standard input,
  312. Xstandard output,
  313. Xand standard error,
  314. Xand sends a UNIX-domain datagram to the \*(uw server.
  315. XIt returns the unique ID associated with the window
  316. Xin the parent,
  317. Xand returns 0 in the child.
  318. X(\(mi1 is returned if the routine fails.)
  319. X.DS
  320. Xuwid_t uw_fork(uwtype_t wtype, int *pidp);
  321. X.DE
  322. XThe first argument specifies the type of the new window.
  323. XIf the second argument to ``uw_fork'' is a non-NULL pointer,
  324. Xthe process-ID of the child will be stored at that address
  325. Xin the parent process.
  326. X(In the child, ``*pidp'' will be zero.)
  327. X.IP uw_cmd
  328. XThis routine builds upon the functionality of the ``uw_fork'' routine.
  329. XIt creates a new window with ``uw_fork''
  330. Xand then executes a specified command.
  331. XIt takes the window type,
  332. Xthe name of an executable file,
  333. Xand an argument list
  334. Xas parameters;
  335. Xit uses these as arguments to ``uw_fork''
  336. Xand the C library routine ``execvp''.
  337. XIt returns the window ID number to its caller:
  338. X.DS
  339. Xuwid_t uw_cmd(uwtype_t wtype, char *file, char **argv);
  340. X.DE
  341. X(\(mi1 is returned if the routine fails.)
  342. X.IP uw_shell
  343. X``uw_shell'' is similar to ``uw_cmd'' except that it
  344. Xexecutes an arbitrary shell command:
  345. X.DS
  346. Xuwid_t uw_shell(uwtype_t wtype, char *cmd);
  347. X.DE
  348. X(\(mi1 is returned if the routine fails.)
  349. XBy default the Bourne shell is used;
  350. Xhowever,
  351. Xthe shell may be changed by patching the global variable ``uwshellname''.
  352. X.DS
  353. Xchar *uwshellname = "/bin/sh";
  354. X.DE
  355. X.IP uw_rsetopt
  356. XThis routine changes the value of a window option
  357. Xfor an existing window
  358. X(named as a window ID).
  359. XThe window may be either internal or external.
  360. XThe specified window option is set to a desired value.
  361. XZero is returned if the appropriate UNIX-domain message
  362. Xwas successfully sent;
  363. X\(mi1 is returned if the operation failed.
  364. X(Since ``uw_rsetopt'' does not receive a reply from the server,
  365. Xit is unable to determine whether or not the command ``succeeded''.
  366. XRather,
  367. Xit returns zero if the command was successfully transmitted.)
  368. X.DS
  369. Xint uw_rsetopt(uwid_t uwid, uwopt_t optnum, union uwoptval *optval);
  370. X.DE
  371. X``optval'' points to a ``union uwoptval'' structure
  372. X(described above)
  373. Xin which the member corresponding to ``optnum''
  374. Xhas been initialized.
  375. X.IP "uw_perror"
  376. XWhen an error is reported by a \*(uw library routine,
  377. Xthe cause of the error is saved in the external variable
  378. X``uwerrno''.
  379. XIf the error was UWE_ERRNO,
  380. Xthe standard external variable ``errno''
  381. Xwill also be meaningful.
  382. X(The routines which operate upon external windows,
  383. Xdescribed in the following section,
  384. Xalso save this information in the window descriptor.)
  385. XThe routine ``uw_perror'' may be used to decode and print
  386. Xerror messages:
  387. X.DS
  388. Xvoid uw_perror(char *usermesg, uwerr_t uwerr, int err)
  389. X.DE
  390. Xwhere ``usermesg'' is a pointer to a user-specified string,
  391. X``uwerr'' is the \*(uw error code
  392. X(usually ``uwerrno''),
  393. Xand ``err'' is the system call error code
  394. X(usually ``errno'').
  395. X[System call error numbers are defined in ``/usr/include/errno.h''.]
  396. X.sp
  397. XThe \*(uw error messages may also be accessed directly.
  398. XTwo external variables aid in user-formatted error messages:
  399. X.DS
  400. Xextern char *uwerrlist[];
  401. Xextern unsigned uwnerr;
  402. X.DE
  403. XIf the error number is greater than or equal to ``uwnerr'',
  404. Xno error message string exists.
  405. X(This ``cannot happen.'')
  406. XOtherwise,
  407. Xthe error message string is obtained by indexing into
  408. X``uwerrlist''.
  409. X.PP
  410. XThe preceeding routines are sufficient to implement
  411. Xa (simplified) version of the ``uwtool'' program,
  412. Xwhich creates a new
  413. X(internal)
  414. Xwindow running a specified command:
  415. X.DS
  416. X.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n
  417. X/*
  418. X *      uwtool
  419. X *
  420. X * Copyright 1986 by John D. Bruner.  All rights reserved.  Permission to
  421. X * copy this program is given provided that the copy is not sold and that
  422. X * this copyright notice is included.
  423. X */
  424. X#include <strings.h>
  425. X#include "uwlib.h"
  426. X
  427. Xmain(argc, argv)
  428. Xint argc;
  429. Xchar **argv;
  430. X{
  431. X        register uwid_t uwid;
  432. X        register char *fname, *term;
  433. X    register wtype_t wtype;
  434. X        char *av[2];
  435. X        union uwoptval optval;
  436. X        extern int errno;
  437. X        extern char *getenv();
  438. X
  439. X        /*
  440. X         * If called with no arguments, create a new window using the
  441. X         * current shell according to the SHELL environment variable
  442. X         * (or "/bin/sh" if that doesn't exist).  If called with
  443. X         * arguments, argv[1] through argv[argc\-1] are the arguments
  444. X         * to the command.
  445. X         */
  446. X        if (argc == 1) {
  447. X                if ((fname = getenv("SHELL")) == (char *)0)
  448. X                        fname = "/bin/sh";
  449. X                av[0] = fname;
  450. X                av[1] = (char *)0;
  451. X                argv = av;
  452. X        } else
  453. X                fname = *++argv;
  454. X    
  455. X    if ((term=getenv("TERM")) != (char *)0)
  456. X        wtype = uw_ttype(term);
  457. X    else
  458. X        wtype = UWT_ADM31;
  459. X        
  460. X        if ((uwid = uw_cmd(wtype, fname, argv)) < 0) {
  461. X                (void)strncpy(optval.uwov_string, fname,
  462. X                    sizeof optval.uwov_string);
  463. X                (void)uw_rsetopt(uwid, UWOP_TITLE, &optval);
  464. X                return(0);
  465. X        } else {
  466. X                uw_perror("uwtool", uwerrno, errno);
  467. X                return(1);
  468. X        }
  469. X}
  470. X.DE
  471. XAfter the first part of the function has massaged the argument list,
  472. Xthe ``uw_cmd'' routine creates a new window
  473. Xrunning the command ``fname'' with argument list ``argv''.
  474. XIf the window ID is positive,
  475. Xthe window creation succeeded.
  476. XAfter copying the name of the program into a ``union uwoptval'',
  477. Xthe program calls ``uw_rsetopt'' to set the window title
  478. Xto that string.
  479. XIf the window ID returned by ``uw_cmd'' was \(mi1,
  480. Xthe window creation failed.
  481. XIn this case,
  482. Xthe program calls ``uw_perror'' to report the error.
  483. X.SH
  484. XExternal Window Interface
  485. X.LP
  486. XThe remainder of the \*(uw library routines provide access to
  487. Xexternal windows.
  488. XIn contrast to internal windows,
  489. Xa client process creates an external window
  490. Xby establishing an Internet-domain stream connection
  491. Xto the server and sending the server a ``create window'' command.
  492. XThe server will establish a second stream connection
  493. Xback to the client.
  494. XData is passed between the client and the server on the first connection,
  495. Xwhile control information is passed through the second.
  496. X[Because the server and client communicate through one or
  497. Xtwo stream connection(s)
  498. Xinstead of by sending datagrams,
  499. Xthe unreliability problems noted above for internal windows
  500. Xdo not apply to external windows.]
  501. X.LP
  502. XThe \*(uw library provides mechanisms for creating external windows,
  503. Xkilling them,
  504. Xand manipulating window options.
  505. XWhen a window is created a window descriptor
  506. X(item of type UWIN)
  507. Xis returned;
  508. Xthis is used as an argument to all other external-window routines.
  509. X.LP
  510. XThe following routines are provided:
  511. X.IP "uw_new" 1i
  512. XThis function creates a new external window of the specified type.
  513. XThe calling sequence is:
  514. X.DS
  515. XUWIN uw_new(uwtype_t uwtype, struct sockaddr_in *server)
  516. X.DE
  517. Xwhere ``uwtype'' is the window type
  518. Xand ``server'' is a pointer to a structure specifying
  519. Xthe Internet address of the server.
  520. X(If ``server'' is a NULL pointer,
  521. Xthe server will be determined by examining the
  522. Xenvironment variable ``UW_INET''.)
  523. XIf the window creation succeeded,
  524. X``uw_new'' will return a non-NULL window descriptor;
  525. Xotherwise,
  526. Xit will return NULL, and
  527. Xthe global variables ``uwerrno'' and ``errno''
  528. Xmay be examined to determine the cause of the error.
  529. X.IP "uw_detach"
  530. XThis function ``detaches'' the window from the program
  531. Xso that it no longer is able to perform control operations
  532. Xupon the window.
  533. XThe data connection to the window remains open.
  534. XThis function should be used when the data connection to a window
  535. Xwill be handled by a different process
  536. Xthan the control connection,
  537. X.I e.g.
  538. Xin a child process after a ``fork''.
  539. XIt is strongly recommended that no more than one process
  540. Xhave control access to a window at any one time.
  541. XThe calling sequence is
  542. X.DS
  543. Xuw_detach(UWIN uwin);
  544. X.DE
  545. Xwhere ``uwin'' is the window descriptor.
  546. XZero is returned for success,
  547. Xwhile \(mi1 is returned for failure.
  548. XIf the routine fails,
  549. Xthe error status will be stored in the UWIN data item
  550. Xas well as in the global variables ``uwerrno'' and ``errno''.
  551. X.IP "uw_close"
  552. XThis function closes a window.
  553. XBoth the control and data connections to the window are closed.
  554. XIf multiple processes have access to a window
  555. X(\fIe.g.\fP because of a ``fork''),
  556. Xthen the window will be destroyed when the last connection
  557. Xto it is closed.
  558. XThe calling sequence is
  559. X.DS
  560. Xuw_close(UWIN uwin);
  561. X.DE
  562. Xwhere ``uwin'' is the window descriptor
  563. X.IP "uw_kill"
  564. XAt times it may be desirable for one process to destroy
  565. Xa window even if the window is in use by other processes.
  566. XThe ``uw_kill'' function performs this task.
  567. XThe caller must have control access to the window
  568. X(it must not be ``detached'').
  569. XThe syntax is:
  570. X.DS
  571. Xuw_kill(UWIN uwin);
  572. X.DE
  573. Xwhere ``uwin'' is the window descriptor.
  574. XWhen a window is killed
  575. X(either by ``uw_kill'' or upon command from the Macintosh)
  576. Xthe server closes its data channel.
  577. XAny further attempts to read or write to the window
  578. Xwill produce end-of-file or error conditions,
  579. Xrespectively.
  580. X.IP "uw_optfn"
  581. XIf a process has control access to a window,
  582. Xthen it will periodically receive
  583. Xwindow option messages from the Macintosh client
  584. X(through the server).
  585. XThe \*(uw library receives these messages by enabling
  586. Xasynchronous I/O notification on the control channel
  587. Xand providing a SIGIO signal handler.
  588. XSometimes it is desirable for an external process
  589. Xto field incoming option messages itself.
  590. XTo do so,
  591. Xit must notify the \*(uw library by calling the
  592. Xroutine ``uw_optfn'':
  593. X.DS
  594. Xvoid (*uw_optfn(UWIN uwin, uwopt_t optnum, void (*optfn)())();
  595. X.DE
  596. Xwhere ``uwin'' is the window descriptor,
  597. X``optnum'' is the desired window option,
  598. Xand ``optfn'' is a pointer to a function which
  599. Xwill be called when a message about window option ``optnum''
  600. Xis received.
  601. X``uw_optfn'' returns the previous function.
  602. XTo disable processing for a window option,
  603. Xspecify a NULL pointer for ``optfn''.
  604. XThe user-supplied ``optfn'' is called with the following arguments:
  605. X.DS
  606. X.ta 8n
  607. Xvoid (*optfn)(UWIN uwin, uwopt_t optnum, uwoptcmd_t optcmd,
  608. X    union uwoptval *optval);
  609. X.DE
  610. Xwhere ``uwin'' is the window descriptor,
  611. X``optnum'' is the window option number,
  612. X``optcmd'' is the window option command,
  613. Xand
  614. X(if ``optcmd'' is UWOC_SET)
  615. X``optval'' is a pointer to the new value of the window option.
  616. X.sp
  617. XBecause the \*(uw library provides a signal handler for SIGIO,
  618. Xif other portions of the program wish to catch SIGIO,
  619. Xthen some care must be taken
  620. Xto ensure that all signal handlers are called.
  621. XThe \*(uw library saves the return value from
  622. X``signal'' when it installs its handler.
  623. XIf this is not SIG_IGN,
  624. Xthen that routine will be called after \*(uw has
  625. Xcompleted its signal processing.
  626. XIn a similar fashion,
  627. Xif the calling program establishes a signal handler,
  628. Xit should save the previous value and call the indicated
  629. Xfunction
  630. X(if not SIG_IGN).
  631. XFor example,
  632. Xif the caller uses ``signal'':
  633. X.DS
  634. X.ta 8n 16n
  635. Xoldhandler = signal(SIGIO, myhandler);
  636. X\&...
  637. Xmyhandler(sig, code, scp)
  638. Xint sig, code;
  639. Xstruct sigcontext *scp;
  640. X{
  641. X    ... code to handle exception ...
  642. X    if (oldhandler != SIG_IGN)
  643. X        (*oldhandler)(sig, code, scp);
  644. X}
  645. X.DE
  646. XAlthough from time to time
  647. Xthe Macintosh may ask the server for the current
  648. Xvalue of a window option,
  649. Xthe \*(uw server caches the current value of each
  650. Xwindow option
  651. Xand responds to these inquiries directly.
  652. XTherefore,
  653. Xthe major reason for establishing a window option function
  654. Xwith ``uw_optfn'' is to process incoming UWOC_SET messages,
  655. X.I i.e.
  656. Xmessages from the Macintosh that the value of a window
  657. Xoption has changed.
  658. X.IP "uw_optcmd"
  659. XThis function allows a program with control access to a window
  660. Xto send window option commands.
  661. XThe calling sequence is
  662. X.DS
  663. X.ta 8n
  664. Xuw_optcmd(UWIN uwin, uwopt_t optnum, uwoptcmd_t optcmd,
  665. X    union uwoptval *optval);
  666. X.DE
  667. Xwhere ``uwin'' is the window descriptor,
  668. X``optnum'' is the window option number,
  669. X``optcmd'' is the command,
  670. Xand ``optval'' is a pointer to the option value.
  671. XOf the six window option messages,
  672. Xonly the UWOC_SET,
  673. XUWOC_DO,
  674. Xand UWOC_DONT
  675. Xmessages are very useful.
  676. XUWOC_SET changes the value of a window option
  677. X(``optval'' points to the new value).
  678. XUWOC_DO and UWOC_DONT instruct the Macintosh to
  679. Xreport or not report
  680. X(respectively)
  681. Xwhen a user action changes the value of a window option there.
  682. XWhen it creates a window,
  683. Xthe \*(uw server instructs the Macintosh to report all
  684. Xchanges to window options.
  685. XMost programs will probably not need to issue UWOC_DO or UWOC_DONT commands.
  686. X.IP uw_gvis
  687. XThis function fetches the current visibility
  688. Xstatus of a specified window:
  689. X.DS
  690. Xint uw_gvis(UWIN uwin, int *vp);
  691. X.DE
  692. X``vp'' is a pointer to an integer where the visibility status
  693. X(0 or 1 for invisible or visible, respectively)
  694. Xis returned.
  695. XZero is returned for success,
  696. Xwhile \(mi1 is returned for failure.
  697. X.IP uw_svis
  698. XThis function changes the visibility status of a specified window:
  699. X.DS
  700. Xint uw_svis(UWIN uwin, int v);
  701. X.DE
  702. XIf ``v'' is nonzero then the window ``uwin'' will be made visible;
  703. Xotherwise,
  704. Xthe specified window will be made invisible.
  705. XZero is returned for success,
  706. Xwhile \(mi1 is returned for failure.
  707. X.IP uw_gpos
  708. XThis function returns the current position on the screen
  709. Xof a specified window:
  710. X.DS
  711. X.ta 8n 20n 28n
  712. Xstruct uwpoint {
  713. X    unsigned    uwp_v;    /* vertical component */
  714. X    unsigned    uwp_h;    /* horizontal component */
  715. X};
  716. X
  717. Xint uw_gpos(UWIN uwin, struct uwpoint *pp);
  718. X.DE
  719. XZero is returned for success,
  720. Xwhile \(mi1 is returned for failure.
  721. X.IP uw_spos
  722. XThis function sets the position of a specified window to
  723. Xa desired location:
  724. X.DS
  725. Xint uw_spos(UWIN uwin, struct uwpoint *pp);
  726. X.DE
  727. XZero is returned for success,
  728. Xwhile \(mi1 is returned for failure.
  729. X.IP uw_gwsize
  730. XThis function returns the current size in pixels
  731. Xof a specified window.
  732. XThe size is expressed as a ``uwpoint'',
  733. Xas defined above.
  734. X.DS
  735. Xint uw_gwsize(UWIN uwin, struct uwpoint *pp);
  736. X.DE
  737. XZero is returned for success,
  738. Xwhile \(mi1 is returned for failure.
  739. X.IP uw_swsize
  740. XThis function sets a specified window to a new size:
  741. X.DS
  742. Xint uw_swsize(UWIN uwin, struct uwpoint *pp);
  743. X.DE
  744. X.IP uw_gtitle
  745. XThis function returns the title of a specified window.
  746. XThe title has type ``uwtitle_t'':
  747. X.DS
  748. Xtypedef char uwtitle_t[256];
  749. X
  750. Xint uw_gtitle(UWIN uwin, uwtitle_t ttl);
  751. X.DE
  752. XZero is returned for success,
  753. Xwhile \(mi1 is returned for failure.
  754. X.IP uw_stitle
  755. XThis function sets the title of a specified window:
  756. X.DS
  757. Xint uw_stitle(UWIN uwin, uwtitle_t ttl);
  758. X.DE
  759. X.IP uw_gtype
  760. XThis function returns the type of a specified window:
  761. X.DS
  762. Xint uw_gtype(UWIN uwin, uwtype_t *tp);
  763. X.DE
  764. X``tp'' points to a variable which receives the window type.
  765. XZero is returned for success,
  766. Xwhile \(mi1 is returned for failure.
  767. X.IP uw_stype
  768. XThis function sets the type of a specified window:
  769. X.DS
  770. Xint uw_stype(UWIN uwin, uwtype_t t);
  771. X.DE
  772. X``t'' is the new window type.
  773. XZero is returned for success,
  774. Xwhile \(mi1 is returned for failure.
  775. X.IP "UW_DATAFD"
  776. XThis macro extracts the file descriptor for the data connection
  777. Xfrom a window descriptor:
  778. X.DS
  779. Xint UW_DATAFD(UWIN uwin);
  780. X.DE
  781. X.IP "UW_ID"
  782. XThis macro returns the unique window ID associated with a
  783. Xwindow descriptor:
  784. X.DS
  785. Xuwid_t UW_ID(UWIN uwin);
  786. X.DE
  787. X.IP "UW_PERROR"
  788. XWhen the \*(uw library detects an error
  789. Xit always places the error information into the
  790. Xglobal variables ``uwerrno'' and ``errno''.
  791. XIf the error is associated with a valid window descriptor,
  792. Xit will also store the information in the window descriptor.
  793. XThe macro ``UW_PERROR'' is used to print an error message
  794. Xaccording to the error status in a window descriptor:
  795. X.DS
  796. Xvoid UW_PERROR(char *message, UWIN uwin);
  797. X.DE
  798. Xwhere ``message'' is any user-supplied message and
  799. X``uwin'' is a window descriptor.
  800. X.SH
  801. XCopyright
  802. X.LP
  803. XThis document copyright 1986 by John D. Bruner.
  804. XPermission to copy is given,
  805. Xprovided that the copies are not sold
  806. Xand that this copyright notice is included.
  807. !EOF!doc/uwlib.ms!
  808. echo x - doc/uwproto.ms
  809. sed -e 's/^X//' > doc/uwproto.ms << '!EOF!doc/uwproto.ms!'
  810. X.\" This file should be processed by nroff or troff with the -ms macro set
  811. X.ds uw "\s-2UW\s0
  812. X.de T=
  813. X.ie t .ta 8n 28n 36n 44n
  814. X.el .ta 8n 24n 32n 40n
  815. X..
  816. X.DA September 30, 1986
  817. X.TL
  818. XUW Protocol
  819. X.AU
  820. XJohn D. Bruner
  821. X.SH
  822. XIntroduction
  823. X.PP
  824. X\*(uw is a multiple-window interface to UNIX.\**
  825. X.FS
  826. XUNIX is a registered trademark of American Telephone and Telegraph.
  827. X.br
  828. XMacintosh is a trademark of McIntosh Laboratories,
  829. Xand is licensed to Apple Computer.
  830. X.br
  831. XADM-31 is a trademark of Lear Siegler, Inc.
  832. X.br
  833. XVT52 is a trademark of Digital Equipment Corporation.
  834. X.br
  835. XThe Tektronix 4010 is a graphics terminal manufactured
  836. Xby Tektronix, Inc.
  837. X.FE
  838. XIt comprises two parts:
  839. Xa program which runs on a Macintosh
  840. X(referred to hereafter as ``the client'')
  841. Xand a server program which runs on the UNIX system
  842. X(``the host'').
  843. XThese two programs exchange information by sending
  844. Xdata across a serial communications line.
  845. XThis information consists of data
  846. Xand control and status messages relating to its presentation.
  847. XThe structure of this information is defined by
  848. Xthe \*(uw protocol
  849. Xand is the subject matter of this document.
  850. X.PP
  851. X\*(uw version 3 actually defines three protocols.
  852. XInternally they are assigned numbered,
  853. Xwhile the user interface and documentation refer to them
  854. Xby name.
  855. XThe correspondence is as follows:
  856. X.IP 0
  857. XProtocol 0 is referred to as the ``serverless protocol''
  858. Xor ``single terminal emulator protocol,''
  859. Xbecause its use does not require a server on the host.
  860. X.IP 1
  861. XProtocol 1 is called the ``original \*(uw protocol,''
  862. Xbecause it was the only protocol supported by the first
  863. Xversions of \*(uw
  864. X(versions 1.6 and 2.10).
  865. X.IP 2
  866. XProtocol 2 is called the ``extended \*(uw protocol,''
  867. Xor (sometimes)
  868. Xthe ``\*(uw version 3 protocol.''
  869. X.SH
  870. XProtocol 0 \(em The Serverless Protocol
  871. X.PP
  872. XProtocol 0 is not really a \*(uw protocol at all.
  873. XThe client speaks protocol 0 when it is communicating
  874. Xdirectly with a host,
  875. Xrather than communicating through a server program
  876. Xrunning on the host.
  877. XProtocol 0 is simply 7-bit or 8-bit ASCII.
  878. XEvery byte transmitted in protocol 0 represents itself,
  879. Xwith the possible exception of the two flow-control characters
  880. XXON (control-Q)
  881. Xand
  882. XXOFF (control-S).
  883. XProtocol 0 does not specify whether these characters are
  884. Xto be used for flow-control purposes or for data transmission.
  885. XThe client program on the Macintosh and the host's terminal driver
  886. Xcan be configured to use or ignore flow-control.
  887. X.PP
  888. XProtocol 0 does not specify whether data is transmitted
  889. Xusing 8-bit ASCII or 7-bit ASCII.
  890. XThe user must choose the appropriate transmission format
  891. Xand is reponsible for configuring both the client and the host
  892. Xaccordingly.
  893. X.SH
  894. XProtocol 1 \(em The Original \*(uw Protocol
  895. X.PP
  896. XProtocol 1 was the only protocol which was used in
  897. Xthe first versions of \*(uw
  898. X(versions 1.6 and 2.10).
  899. XIt defines seven ``windows,''
  900. Xeach of which is an independent data stream.
  901. XThrough the transmission of appropriate commands,
  902. Xwindows may be created or destroyed,
  903. Xand data may be directed to a particular window.
  904. XData which is transmitted from the client to the host
  905. Xis referred to as ``input data,''
  906. Xwhile data transmitted from the host to the client
  907. Xis referred to as ``output data.''
  908. XIn each direction a ``current window'' specifies
  909. Xthe recipient of data bytes.
  910. X(For example,
  911. Xif the client wishes to send data to window 4,
  912. Xit first sends a ``select window 4 as input window''
  913. Xcommand and then sends the data.
  914. XUntil the client sends another ``select input window'' command,
  915. Xall further data that it transmits will be received
  916. Xas data for window 4.)
  917. XThe current input window and current output window may be different.
  918. X.PP
  919. XProtocol 1 encodes all information into 7-bit symbols;
  920. Xit does not depend upon the value of the most-significant bit
  921. X(sometimes used for parity purposes).
  922. XCommands are encoded into two bytes:
  923. Xa prefix byte (P1_IAC)
  924. Xand a command byte.
  925. XBit 7
  926. X(the second most-significant bit, octal 0100)
  927. Xspecifies whether the command was sent from the host to the client or
  928. X.I "vice versa:"
  929. X.DS
  930. X.T=
  931. X#define    P1_IAC    0001    /* intrepret following byte as a command */
  932. X#define    P1_DIR    0100    /* command direction: */
  933. X#define    P1_DIR_HTOM    0000    /*    from host to Mac (client) */
  934. X#define    P1_DIR_MTOH    0100    /*    from Mac (client) to host */
  935. X.DE
  936. XThe command's function is encoded into the next three bits.
  937. XThere are only seven commands:
  938. X.DS
  939. X.T=
  940. X#define    P1_FN    0070    /* function code: */
  941. X#define    P1_FN_NEWW    0000    /*    create new window */
  942. X#define    P1_FN_KILLW    0010    /*    kill (destroy) window */
  943. X#define    P1_FN_ISELW    0020    /*    select window for input data */
  944. X#define    P1_FN_OSELW    0030    /*    select window for output data */
  945. X#define    P1_FN_META    0050    /*    add META to next data character */
  946. X#define    P1_FN_CTLCH    0060    /*    send control character as data */
  947. X#define    P1_FN_MAINT    0070    /*    perform "maintenance function" */
  948. X.DE
  949. X(The client does not send the P1_FN_OSELW command;
  950. Xsimilarly,
  951. Xthe host does not send the P1_FN_ISELW command.)
  952. X.PP
  953. XThe least-significant three bits of the command byte
  954. Xspecify an argument to the function.
  955. XFor the ``new window'' (P1_FN_NEWW),
  956. X``kill window'' (P1_FN_KILLW),
  957. X``select input'' (P1_FN_ISELW),
  958. Xand
  959. X``select output'' (P1_FN_OSELW)
  960. Xcommands,
  961. Xthe low three bits specify a window number.
  962. XWindow number zero is not used.
  963. X.PP
  964. XThere are no arguments to the P1_FN_META command.
  965. XIt directs that the next data byte to be transmitted
  966. Xbe considered a ``meta'' character;
  967. X.I i.e.
  968. Xa byte with the most-significant bit
  969. X(octal 0200)
  970. Xset.
  971. X.PP
  972. XThe P1_FN_CTLCH command is used to encode three
  973. Xdata characters which cannot be transmitted directly as data.
  974. XThese are P1_IAC
  975. X(which,
  976. Xif encountered in a transmission,
  977. Xindicates the start of a two-character command),
  978. Xand the flow-control characters XON (021)
  979. Xand XOFF (023).
  980. XThe low-order three bits of the command byte specify the character:
  981. X.DS
  982. X.T=
  983. X#define    P1_CC    7    /* control character specifier: */
  984. X#define    P1_CC_IAC    1    /*    P1_IAC (001) */
  985. X#define    P1_CC_XON    2    /*    XON (021) */
  986. X#define    P1_CC_XOFF    3    /*    XOFF (023) */
  987. X.DE
  988. XA meta-control character is transmitted as a P1_FN_META
  989. Xcommand followed by the appropriate P1_FN_CTLCH command.
  990. XThus,
  991. Xthe octal character 0201 would be transmitted from the
  992. Xhost to the client as
  993. Xa four-byte sequence:
  994. X.DS
  995. X.T=
  996. X0001    (P1_IAC)
  997. X0050    (P1_DIR_HTOM|P1_FN_META)
  998. X0001    (P1_IAC)
  999. X0061    (P1_DIR_HTOM|P1_FN_CTLCH|P1_CC_IAC)
  1000. X.DE
  1001. XNote that since the host does not send P1_FN_OSELW commands
  1002. Xand the client sends commands with the 0100 bit set,
  1003. Xthe XON and XOFF control characters will never be sent as command bytes.
  1004. X.PP
  1005. X``Maintenance functions'' are defined for operations
  1006. Xwhich are performed infrequently.
  1007. XProtocol 1 defines two maintenance functions:
  1008. X.DS
  1009. X.T=
  1010. X#define    P1_MF    7    /* maintenance functions: */
  1011. X#define    P1_MF_ENTRY    0    /*    start up */
  1012. X#define    P1_MF_EXIT    7    /*    exit */
  1013. X.DE
  1014. XThe server sends the P1_MF_ENTRY command when it starts up.
  1015. XThe client responds to this by killing any windows that it
  1016. Xhas created
  1017. X(silently,
  1018. X.I i.e.
  1019. Xwithout sending P1_FN_KILLW messages to the host).
  1020. XEither the client or the server may send the P1_MF_EXIT command
  1021. Xto terminate the session.
  1022. XWhen the server on the host receives P1_MF_EXIT
  1023. Xit terminates;
  1024. Xwhen the client receives this command it will reset to a
  1025. Xsimple known state.
  1026. X.SH
  1027. XProtocol 2
  1028. X.PP
  1029. X\*(uw version 3 provides a number of capabilities
  1030. Xthat earlier versions of \*(uw did not.
  1031. XAmong these is an expansion of the host-client interaction.
  1032. XIn order to accomodate the increased flow of information
  1033. Xit was necessary to extend the \*(uw protocol.
  1034. XOne of the significant extensions in protocol 2
  1035. Xis support for a concept called ``window options.''
  1036. XWindow options are described in more detail in the next section.
  1037. X.PP
  1038. XProtocol 2 is very similar to protocol 1.
  1039. XLike protocol 1,
  1040. Xprotocol 2 multiplexes a single communications stream
  1041. Xamong a maximum of seven windows.
  1042. XCommand bytes in protocol 2 are encoded in the same
  1043. Xfashion as in protocol 1:
  1044. Xa prefix byte
  1045. X(P2_IAC)
  1046. Xfollowed by a command byte.
  1047. XHowever,
  1048. Xunlike protocol 1,
  1049. Xsome protocol 2 commands require more than one command byte.
  1050. X.PP
  1051. XThe protocol 2 functions are:
  1052. X.DS
  1053. X.T=
  1054. X#define    P2_FN    0070    /* function code: */
  1055. X#define    P2_FN_NEWW    0000    /*    create new window */
  1056. X#define    P2_FN_KILLW    0010    /*    kill (destroy) window */
  1057. X#define    P2_FN_ISELW    0020    /*    select window for input data */
  1058. X#define    P2_FN_OSELW    0030    /*    select window for output data */
  1059. X#define    P2_FN_WOPT    0040    /*    communicate window options */
  1060. X#define    P2_FN_META    0050    /*    add META to next data character */
  1061. X#define    P2_FN_CTLCH    0060    /*    send control character as data */
  1062. X#define    P2_FN_MAINT    0070    /*    perform "maintenance function" */
  1063. X.DE
  1064. XThe P2_FN_KILLW,
  1065. XP2_FN_ISELW,
  1066. XP2_FN_OSELW,
  1067. Xand P2_FN_CTLCH
  1068. Xcommands are identical to their counterparts in protocol 1.
  1069. X.PP
  1070. XThe low-order three bits of the P2_FN_META command
  1071. Xrepresent a control character.
  1072. X(The low-order three bits of the P1_FN_META command are ignored.)
  1073. XThe encoding is identical to the encoding
  1074. Xfor the P2_FN_CTLCH command:
  1075. X.DS
  1076. X.T=
  1077. X#define    P2_CC    7    /* control character specifier: */
  1078. X#define    P2_CC_IAC    1    /*    P2_IAC (001) */
  1079. X#define    P2_CC_XON    2    /*    XON (021) */
  1080. X#define    P2_CC_XOFF    3    /*    XOFF (023) */
  1081. X.DE
  1082. XIf the low-order three bits are zero,
  1083. Xthen the P2_FN_META command acts like the P1_FN_META command \(em
  1084. Xthe META bit is set in the next data byte.
  1085. XIf the low-order three bits are not all zero,
  1086. Xthe the P2_FN_META command specifies a META-control character.
  1087. XThus, the following are all equivalent:
  1088. X.DS
  1089. XP1_IAC\ \ P1_FN_META\ \ P1_IAC\ \ P1_FN_CTLCH|P1_CC_IAC
  1090. XP2_IAC\ \ P2_FN_META\ \ P2_IAC\ \ P2_FN_CTLCH|P2_CC_IAC
  1091. XP2_IAC\ \ P2_FN_META|P2_CC_IAC
  1092. X.DE
  1093. X.PP
  1094. XThe P2_FN_NEWW command differs from the P1_FN_NEWW command
  1095. Xin that the protocol 2 command includes an extra byte.
  1096. XThe byte following the command byte
  1097. Xspecifies the type of the window that is being created.
  1098. XThe numeric value of the window type is
  1099. Xadded to the ASCII value for a space (blank);
  1100. Xhence,
  1101. Xthe window type is always represented by a printable character.
  1102. XAs an example,
  1103. Xif the host wishes to create window 2
  1104. Xwith window type 1 (VT-52),
  1105. Xthe command sequence is:
  1106. X.DS
  1107. X.T=
  1108. X0001    (P2_IAC)
  1109. X0002    (P2_DIR_HTOM|P2_FN_NEWW|2)
  1110. X0041    (`!')
  1111. X.DE
  1112. X.PP
  1113. XThe following maintenance functions (P2_FN_MAINT) are defined:
  1114. X.DS
  1115. X.T=
  1116. X#define    P2_MF    7    /* maintenance functions: */
  1117. X#define    P2_MF_ENTRY    0    /*    start up */
  1118. X#define    P2_MF_ASKPCL    2    /*    request protocol negotiation */
  1119. X#define    P2_MF_CANPCL    3    /*    suggest protocol */
  1120. X#define    P2_MF_SETPCL    4    /*    set new protocol */
  1121. X#define    P2_MF_EXIT    7    /*    exit */
  1122. X.DE
  1123. XThe representations of
  1124. XP2_MF_ENTRY and P2_MF_EXIT are identical to those in protocol 1.
  1125. XThe definition of the ``entry'' function is extended
  1126. Xslightly in protocol 2.
  1127. XIn protocol 1,
  1128. Xthe P1_MF_ENTRY command is only sent by the server when it starts up.
  1129. XThe client recognizes this command and initializes itself.
  1130. XIn protocol 2,
  1131. Xthe client is permitted to send the P2_MF_ENTRY command
  1132. Xto the server.
  1133. XUpon receipt of this command,
  1134. Xthe server issues the sequence of P2_FN_NEWW commands
  1135. Xand P2_FN_WOPT commands
  1136. X(described below)
  1137. Xwhich will reconstruct all of the existing windows
  1138. Xon the client in their current state.
  1139. XThe client uses this command to ``restart'' itself after a crash
  1140. Xor other interruption on its end of the connection.
  1141. XThe three new maintenance functions are used for protocol negotiation.
  1142. XProtocol negotiation is described in detail below.
  1143. X.PP
  1144. XProtocol 2 defines the new command
  1145. XP2_FN_WOPT
  1146. Xto transmit window option information
  1147. Xbetween the client and server.
  1148. XThe P2_FN_WOPT command is followed by a variable-length
  1149. Xstring of bytes which encode the window options information.
  1150. XThe next section describes the meaning and encoding of
  1151. Xwindow option information.
  1152. X.SH
  1153. XWindow Options
  1154. X.PP
  1155. XWindow options are window attributes
  1156. X(the latter is a more meaningful name).
  1157. XFor each window,
  1158. Xa maximum of 31 window options may be defined.
  1159. XThese are divided into two categories:
  1160. Xgeneric and emulation-specific.
  1161. XGeneric window options are attributes which are common
  1162. Xto all window emulation types.
  1163. XEmulation-specific options are meaningful only for some
  1164. Xsubset of the available emulation types.
  1165. XThe following options are generic:
  1166. X.DS
  1167. X.T=
  1168. X#define    WOG_END    0    /* [used as an endmarker] */
  1169. X#define    WOG_VIS    1    /* visibility */
  1170. X#define    WOG_TYPE    2    /* window emulation type */
  1171. X#define    WOG_POS    3    /* window position on screen */
  1172. X#define    WOG_TITLE    4    /* window title */
  1173. X#define    WOG_SIZE    5    /* window size (in pixels) */
  1174. X#define    WOG_6    6    /* [unassigned, reserved] */
  1175. X#define    WOG_7    7    /* [unassigned, reserved] */
  1176. X.DE
  1177. XTerminal emulations define the following emulation-specific options:
  1178. X.DS
  1179. X.T=
  1180. X#define    WOTTY_SIZE    8    /* (row,col) terminal size */
  1181. X#define    WOTTY_FONTSZ    9    /* font size index */
  1182. X#define    WOTTY_MOUSE    10    /* mouse interpretation */
  1183. X#define    WOTTY_BELL    11    /* audible, visual bell */
  1184. X#define    WOTTY_CURSOR    12    /* cursor shape */
  1185. X.DE
  1186. XWindow option values are structured types composed
  1187. Xof the following primitive types:
  1188. X.DS
  1189. Xfixed-length character vectors
  1190. Xvariable-length character strings
  1191. Xspecified-width unsigned integer data
  1192. X.DE
  1193. X.PP
  1194. XThe host and client may exchange the following commands
  1195. Xregarding window options:
  1196. X.DS
  1197. X.T=
  1198. X#define    WOC_SET    0    /* change value of option */
  1199. X#define    WOC_INQUIRE    2    /* ask about current option value */
  1200. X#define    WOC_DO    4    /* do report changes to option */
  1201. X#define    WOC_DONT    5    /* don't report changes to option */
  1202. X#define    WOC_WILL    6    /* will report changes to option */
  1203. X#define    WOC_WONT    7    /* won't report changes to option */
  1204. X.DE
  1205. XThe ``set'' command is sent by either the client or the host
  1206. Xto specify the current value of a window option.
  1207. XThe ``inquire'' command is sent by either the client or the host
  1208. Xwhen it wishes to know the current value of an option.
  1209. XThe recipient of an ``inquire'' command responds with a
  1210. X``set'' command that specifies the current option value.
  1211. X.PP
  1212. XThe remaining four window option commands
  1213. Xare used by the host
  1214. Xto set up automatic reporting by the client
  1215. Xwhen the value of a window option changes.
  1216. XIf the host wishes to be informed
  1217. Xwhen the value of a window option changes
  1218. X(\fIe.g.\fP when a window is retitled),
  1219. Xit sends a ``do'' command to the client.
  1220. XThe client responds to the ``do'' command
  1221. Xwith a ``will'' command
  1222. Xfollowed immediately by a ``set'' command
  1223. X(reporting the current value of the option).
  1224. XThereafter,
  1225. Xwhenever the value of that option changes
  1226. Xthe client will send a ``set'' command with the new value
  1227. Xto the host.
  1228. XIf the host wishes the client to stop sending
  1229. Xthese ``set'' commands,
  1230. Xthe host sends the client a ``don't'' command.
  1231. XThe client responds with a ``won't'' message.
  1232. X.PP
  1233. XThe reporting status of generic window options is not affected
  1234. Xif the window emulation types changes;
  1235. Xhowever,
  1236. Xif the emulation type changes,
  1237. Xthen reporting for emulation-specific options is ended.
  1238. XIf the host wishes the client to continue
  1239. Xreporting changes in some emulation-specific window options,
  1240. Xit must send the appropriate ``do'' commands.
  1241. X.PP
  1242. XWindow option commands are grouped together and transmitted
  1243. Xcollectively as part of a P2_FN_WOPT command.
  1244. XThat is,
  1245. Xthe P2_IAC and P2_FN_WOPT command are immediately
  1246. Xfollowed by a variable-length string of bytes
  1247. Xwhich contain window option commands for one or
  1248. Xmore options.
  1249. XThe end of a sequence of window option (sub)commands
  1250. Xis indicated by a command which specifies window option zero
  1251. X(WOG_END).
  1252. X.PP
  1253. XAll window option commands begin with a one or two
  1254. Xbyte command specifier.
  1255. XThe one-byte form is called the ``short'' form,
  1256. Xwhile the two-byte form is the ``long'' form:
  1257. X.DS
  1258. X.ta 8n 32n 48n
  1259. X#define    WONUM_MIN    1    /* minimum option number */
  1260. X#define    WONUM_GENERIC    7    /* maximum generic option number */
  1261. X#define    WONUM_SHORT    14    /* maximum short option number */
  1262. X#define    WONUM_MAX    31    /* maximum option number */
  1263. X#define    WONUM_MASK    (017<<3)    /* mask for extraction */
  1264. X#define    WONUM_SENCODE(n)    (((n)&017)<<3)    /* short encoding function */
  1265. X#define    WONUM_SDECODE(b)    (((b)>>3)&017)    /* short decoding function */
  1266. X#define    WONUM_LPREFIX    (017<<3)    /*long encoding prefix */
  1267. X#define    WONUM_LENCODE(n)    ((n)+' ')    /* long encoding function */
  1268. X#define    WONUM_LDECODE(c)    (((c)&0177)-' ')    /* long decoding function */
  1269. X.DE
  1270. XCommands
  1271. Xspecifing options whose numbers are in the range WONUM_MIN to WONUM_SHORT
  1272. Xmay use the short form.
  1273. XIn this case,
  1274. Xthe window option number is encoded according to WONUM_SENCODE:
  1275. Xit is shifted left by three bits.
  1276. XThe command byte consists of a bitwise ``or'' of
  1277. Xthe window option command
  1278. X(\fIe.g.\fP WOC_INQUIRE)
  1279. Xand the encoded short option number.
  1280. X.PP
  1281. XCommands which specify options whose numbers are greater than WONUM_SHORT
  1282. Xmust use the long form.
  1283. X(The long form may be used for options whose numbers are less than WONUM_SHORT,
  1284. Xbut there is no reason to do so.)
  1285. XIn this case,
  1286. Xthe first byte contains a bitwise ``or'' of
  1287. Xthe window option command
  1288. X(\fIe.g.\fP WOC_INQUIRE)
  1289. Xand the special prefix WONUM_LPREFIX.
  1290. XThe second byte is encoded by WONUM_LENCODE:
  1291. Xthe window option number is added to the ASCII code for a space
  1292. X(thus this byte is always printable).
  1293. X.PP
  1294. XAll of the window option commands begin with the
  1295. Xone or two byte option command specifier.
  1296. XUnlike the other window option commands
  1297. X(which use no additional bytes),
  1298. Xthe WOC_SET command is followed by encoded data
  1299. X(the value of the option).
  1300. XOption values are constructed from three primitive
  1301. Xdata types
  1302. X(as noted above).
  1303. X.IP chars 8n
  1304. XThe simplest type of data is a fixed-length character vector.
  1305. XThis is represented directly.
  1306. XThe vector must consist of printable characters.
  1307. X[This restriction may be eliminated in the future.
  1308. XThe current implementation is able to process non-printable
  1309. Xcharacters
  1310. X(including XON and XOFF)
  1311. Xcorrectly.]
  1312. X.IP string
  1313. XLike character vectors,
  1314. Xstrings have a maximum length.
  1315. XHowever,
  1316. Xunlike character vectors,
  1317. Xstrings may contain non-printing characters.
  1318. XAlso,
  1319. Xwhile all characters in a character vector are sent,
  1320. Xa string may be shorter than its maximum length.
  1321. XIt is terminated by a null (000) byte.
  1322. X[Hence,
  1323. Xa string may not contain an embedded null byte.]
  1324. X.IP udata
  1325. XThe remaining data type is unsigned integer data.
  1326. XThis data has a fixed width measured in bits.
  1327. XThe value is encoded in ``little-endian'' fashion
  1328. Xinto the low six bits of successive characters.
  1329. XThe (octal) 0100 bit of each character is set.
  1330. XThe number of characters required to hold an integer
  1331. Xvaries from one
  1332. X(for data which is one to six bits wide)
  1333. Xto six
  1334. X(for data which is thirty-two bits wide).
  1335. X.PP
  1336. XThe window options defined above have arguments as follows
  1337. X(all integers are unsigned):
  1338. X.IP WOG_VIS 20n
  1339. XThis is a 1-bit integer
  1340. Xwhich is nonzero iff the window is visible.
  1341. X.IP WOG_POS
  1342. XThis consists of two 12-bit integers
  1343. Xwhich respectively specify the vertical and horizontal
  1344. Xoffsets of the window on the client's screen.
  1345. X.IP WOG_TITLE
  1346. XThis is a string of maximum length 256
  1347. Xwhich specifies the window's title.
  1348. X.IP WOG_SIZE
  1349. XThis consists of two 12-bit integers
  1350. Xwhich respectively specify the vertical and horizontal
  1351. Xsize of the window on the client's screen
  1352. X(in pixels).
  1353. X.IP WOTTY_SIZE
  1354. XThis consists of two 12-bit integers
  1355. Xwhich respectively specify the window size in rows and columns.
  1356. X.IP WOTTY_FONTSZ
  1357. XThis is a 6-bit integer which is a font size index.
  1358. XAt present,
  1359. Xit specifies a ``small'' font if zero
  1360. Xand a ``large'' font if nonzero.
  1361. X.IP WOTTY_MOUSE
  1362. XThis is a 1-bit integer
  1363. Xwhich is nonzero iff
  1364. Xmouse events are to be encoded and sent
  1365. Xas data to the host.
  1366. X.IP WOTTY_BELL
  1367. XThis is a 2-bit integer.
  1368. XThe low-order bit is set iff the window should
  1369. Xdisplay bells visually;
  1370. Xthe other bit is set iff the client should report
  1371. Xbells within this window audibly.
  1372. X.IP WOTTY_CURSOR
  1373. XThis is a 1-bit integer
  1374. Xwhich is zero if the window is using a block cursor
  1375. Xand nonzero if the window is using an underscore cursor.
  1376. X.PP
  1377. XOne design decision which the author now regrets
  1378. Xis an overloading of the WOTTY_SIZE option.
  1379. XIf the host can handle window size changes on pseudo-terminals
  1380. X(\fIe.g.\fP 4.3BSD can),
  1381. Xthen the client is capable of changing the view size of a window
  1382. Xor its actual size,
  1383. Xaccording to the user's preference.
  1384. XIf the host cannot handle window size changes,
  1385. Xthe client does not allow the view size to be changed.
  1386. XThe client assumes that the host can handle window size
  1387. Xchanges if it receives a WOC_DO command for the WOTTY_SIZE option.
  1388. X.SH
  1389. XProtocol Negotiation
  1390. X.PP
  1391. XIt is possible that at some time the versions of a \*(uw server
  1392. Xand client will not match;
  1393. X.I e.g.
  1394. Xa version 2.10 client will be used with a version 3.4 server.
  1395. XIt is desirable that such combinations will work ``correctly'' \(em
  1396. Xthat the server will communicate with the client using protocol 1
  1397. Xrather than trying to use protocol 2.
  1398. XIn order to accomplish this,
  1399. Xthree new maintenance functions
  1400. Xare defined by which the server and client
  1401. Xmay negotiate the protocol which is to be used.
  1402. XVersion 3 clients and servers recognize these maintenance
  1403. Xfunctions in both protocol 1 and protocol 2.
  1404. XOlder clients and servers do not recognize these functions
  1405. Xat all.
  1406. X.PP
  1407. XThe protocol negotiation maintenance functions were
  1408. Xdescribed above for protocol 2.
  1409. XThey are repeated here for protocol 1
  1410. X(the encodings are identical):
  1411. X.DS
  1412. X.T=
  1413. X#define    P1_MF_ASKPCL    2    /*    request protocol negotiation */
  1414. X#define    P1_MF_CANPCL    3    /*    suggest protocol */
  1415. X#define    P1_MF_SETPCL    4    /*    set new protocol */
  1416. X.DE
  1417. XP1_MF_ASKPCL is encoded in a single command byte
  1418. X(following P1_IAC).
  1419. XThe P1_MF_CANPCL and P1_MF_SETPCL command bytes are
  1420. Xfollowed by an additional byte which names a protocol.
  1421. XFor the purposes of protocol negotiation,
  1422. Xprotocols 1 and 2 are represented by the ASCII
  1423. Xcharacters space and exclamation-mark,
  1424. Xrespectively.
  1425. X.PP
  1426. XThe client and server always start operation in protocol 1.
  1427. X(The user may have instructed the client to use protocol 2;
  1428. Xnonetheless,
  1429. Xit will use protocol 1 until protocol negotiations are complete.)
  1430. XWhen the server is started
  1431. Xit will send a P1_MF_ENTRY maintenance command to the client.
  1432. XIf the client knows about protocol 2 and wishes to use it,
  1433. Xit will send a P1_MF_ASKPCL to the server.
  1434. XIf the client does not know about protocol 2,
  1435. Xit will not send P1_MF_ASKPCL,
  1436. Xprotocol negotiation will never be started,
  1437. Xand both sides will continue to use protocol 1.
  1438. X.PP
  1439. XIf the server can support something other than protocol 1
  1440. Xit will respond to the P1_MF_ASKPCL with a
  1441. XP1_MF_CANPCL which names the most extensive protocol that it can support.
  1442. X(At present,
  1443. Xthis will be protocol 2;
  1444. Xhowever,
  1445. Xin the future it might name some other protocol.)
  1446. XOld servers,
  1447. Xwhich do not recognize P1_MF_ASKPCL,
  1448. Xwill ignore the maintenance function.
  1449. XThe client will time out after five seconds
  1450. Xand retry several times
  1451. X(three in the present implementation);
  1452. Xif the server never responds
  1453. Xthe client will ``give up'' and will
  1454. Xcontinue to use protocol 1 indefinitely.
  1455. X.PP
  1456. XWhen the client receives P1_MF_CANPCL from the server,
  1457. Xit will examine the server's suggested protocol.
  1458. XIf this protocol is unacceptable to the client,
  1459. Xit will respond with its own P1_MF_CANPCL,
  1460. Xnaming the most extensive protocol that it can support.
  1461. XThe server,
  1462. Xupon receipt of this P1_MF_CANPCL,
  1463. Xwill examine the client's suggested protocol.
  1464. XIf it is unacceptable to the server,
  1465. Xit will name the second-most extensive protocol that it can support.
  1466. XEach time that the client or server receives a
  1467. XP1_MF_CANPCL that names a protocol it cannot support,
  1468. Xit will respond with a different,
  1469. Xless extensive suggestion of its own.
  1470. XSince the number of protocols is finite,
  1471. Xeventually someone will suggest protocol 1,
  1472. Xwhich both sides are required to support.
  1473. X.PP
  1474. XWhen the client or server receives a P1_MF_CANPCL
  1475. Xthat names a protocol that it
  1476. X.I can
  1477. Xsupport,
  1478. Xit will instruct its counterpart to start using that protocol
  1479. Xby sending a P1_MF_SETPCL that names that protocol.
  1480. XHenceforth,
  1481. Xthe new protocol will be used.
  1482. X.PP
  1483. XProtocol 2 allows the client to send a P2_MF_ENTRY
  1484. Xmaintenance command to the server.
  1485. X(This is encoded identically to a P1_MF_ENTRY command.)
  1486. XIf the server receives this maintenance command and
  1487. Xit is using a protocol other than protocol 1,
  1488. Xit will immediately respond with a P1_FN_SETPCL which
  1489. Xnames the protocol that it is using.
  1490. XIt will then proceed to send ``new window'' and
  1491. X(if applicable)
  1492. X``window option'' commands to the client
  1493. Xto reconstruct the client's current state.
  1494. X.SH
  1495. XPostscript
  1496. X.PP
  1497. XThere are a number of obvious problems with the mechanism
  1498. Xfor protocol negotiation.
  1499. XIt is possible for one party to send a SETPCL
  1500. Xcommand and begin listening for input in a new protocol
  1501. Xwhile it is still receiving buffered commands in the old protocol
  1502. Xfrom the other party.
  1503. XIt probably would have been better to have established
  1504. Xa ``current protocol'',
  1505. Xsimilar to the ``current window'' scheme used for data transfer.
  1506. XThis scheme was born out of the desire to allow
  1507. Xold servers and clients to work with new ones.
  1508. XIt ``works'' if things are relatively quiescent,
  1509. Xas they are when the server first starts up
  1510. X(before it creates its first window).
  1511. X.PP
  1512. XThis document is still incomplete.
  1513. XAt this time it is more useful as a conceptual guide
  1514. Xto the \*(uw protocol
  1515. Xthan a definitive reference.
  1516. X.SH
  1517. XCopyright
  1518. X.LP
  1519. XThis document copyright 1986 by John D. Bruner.
  1520. XPermission to copy is given,
  1521. Xprovided that the copies are not sold
  1522. Xand that this copyright notice is included.
  1523. !EOF!doc/uwproto.ms!
  1524. echo x - doc/uw.l
  1525. sed -e 's/^X//' > doc/uw.l << '!EOF!doc/uw.l!'
  1526. X.TH UW 1 "14 September 1986"
  1527. X.UC 4
  1528. X.SH NAME
  1529. Xuw \- multiple-window Macintosh interface to UNIX
  1530. X.SH SYNOPSIS
  1531. X.B uw [ 
  1532. X.BI \-f filename
  1533. X] [
  1534. X.B \-n
  1535. X] [
  1536. X.B \-s
  1537. X]
  1538. X.SH DESCRIPTION
  1539. X.I Uw
  1540. Xis a server program on UNIX that works with the program 
  1541. X.I uw
  1542. Xon the Macintosh.
  1543. XIt provides the Macintosh program with access to
  1544. Xa maximum of seven independent I/O sessions.
  1545. XAn I/O session may be directly associated with a pseudo-terminal
  1546. Xor may simply be a communications channel to an external
  1547. XUNIX process.
  1548. XThe host program multiplexes the input and output onto one RS\-232 line.
  1549. X.PP
  1550. XMost commonly,
  1551. Xsessions will be directly associated with pseudo-terminals.
  1552. XThe Macintosh program will emulate
  1553. Xa Lear Siegler ADM-31 terminal
  1554. X(tset adm31),
  1555. Xa DEC VT52,
  1556. Xan ANSI-compatible terminal
  1557. X(tset ansi or tset aaa-24),
  1558. Xand a Tektronix 4010.
  1559. XEach window
  1560. X(on the Macintosh)
  1561. Xhas its own terminal emulation and can be resized at will.
  1562. XWindow size changes on the Macintosh can be propagated to the host,
  1563. Xor the Macintosh may be directed to display the lower left portion
  1564. Xof a larger logical terminal size.
  1565. X.PP
  1566. XIf the file `.uwrc' exists in the user's home directory,
  1567. Xthen
  1568. X.I uw
  1569. Xwill execute it when starting up.
  1570. XIf `.uwrc' is an executable file,
  1571. Xit will be directly invoked;
  1572. Xotherwise,
  1573. Xa shell will be spawned to interpret it.
  1574. XAn alternate startup file may be specified using the
  1575. X`\-f' flag;
  1576. Xalternately,
  1577. Xthe `\-n' flag instructs
  1578. X.I uw
  1579. Xnot to execute any startup file.
  1580. X.PP
  1581. XThe `\-s' flag prevents
  1582. X.I uw
  1583. Xfrom listening for UNIX-domain datagrams.
  1584. XThus,
  1585. Xit prevents external processes from manipulating
  1586. Xwindows which they did not create.
  1587. XThis may be of value in an environment where
  1588. Xother users are considered `hostile.'
  1589. X.SH LIMITATIONS
  1590. X.I Uw 
  1591. Xis of no use on unix unless 
  1592. X.I uw
  1593. Xis being run on the Macintosh.  
  1594. X.br
  1595. XIf there is a stream of output in one window there will be lag in 
  1596. Xrecognizing characters typed in another.
  1597. X.SH SEE ALSO
  1598. Xuwtool(L), uwtitle(L), uwterm(L)
  1599. X.br
  1600. X.I uw
  1601. XMacintosh documentation
  1602. X(`UW \(em A Multiple-Window Interface to UNIX').
  1603. X.br
  1604. X`The UW Programmer's Library'
  1605. X.SH AUTHOR
  1606. XProgram written by John Bruner, Lawrence Livermore Laboratories 7/85,11/85,9/86
  1607. X.br
  1608. XThis document is based upon a document created by
  1609. Xby Chris Borton, UC San Diego 11/13/85,
  1610. Xedited 9/86 by John Bruner.
  1611. X.SH BUGS
  1612. XThe `\-s' flag greatly reduces the utility of a `.uwrc' file,
  1613. Xsince it prevents
  1614. X.I uwtool
  1615. Xand
  1616. X.I uwtitle
  1617. Xfrom working.
  1618. !EOF!doc/uw.l!
  1619. echo x - doc/uwplot.l
  1620. sed -e 's/^X//' > doc/uwplot.l << '!EOF!doc/uwplot.l!'
  1621. X.TH UWPLOT 1 "28 April 1987"
  1622. X.UC 4
  1623. X.SH NAME
  1624. Xuwplot \- plot filter for use with UW
  1625. X.SH SYNOPSIS
  1626. X.B uwplot
  1627. X[
  1628. X.BI \-t title
  1629. X] [
  1630. X.BI \-n serveraddr
  1631. X]
  1632. X.SH DESCRIPTION
  1633. X.I Uwplot
  1634. Xis a utility program for use with the
  1635. X.I uw
  1636. Xmultiple-window interface to UNIX.
  1637. XIt creates a window,
  1638. Xreads plotting instructions from the standard input,
  1639. Xand displays the result in the window.
  1640. X(The plotting commands are produced by programs
  1641. Xwhich use the standard UNIX
  1642. X.I plot
  1643. Xpackage.)
  1644. X.PP
  1645. XThe title of the newly-created window may be
  1646. Xspecified with the `\-t' option.
  1647. XIf this option is omitted,
  1648. Xthe title will be the name of the command
  1649. Xwhich created it
  1650. X(\fIi.e.\fP `uwplot').
  1651. X.PP
  1652. XNormally
  1653. X.I uwplot
  1654. Xwill examine the environment for the variable `UW_INET'
  1655. Xand will connect to the
  1656. X.I uw
  1657. Xserver with that address.
  1658. XThe `\-n' flag can be used to specify an alternate
  1659. Xserver network address.
  1660. XThe address should have the form `xxxxxxxx.ddd'
  1661. Xwhere `x' is a hexadecimal digit
  1662. Xand `d' is a decimal digit.
  1663. XThe hexadecimal number is the host's Internet address
  1664. Xand the decimal number is the port on which the
  1665. Xserver is listening for connections.
  1666. X.PP
  1667. X`linemod' commands in the plot file are
  1668. Xintended to select the color in which the
  1669. Xplot is drawn;
  1670. Xhowever, this feature is untested.
  1671. XThe old-model Quickdraw colors may be
  1672. Xspecified by name
  1673. X(all lower-case).
  1674. XThe standard plot linemod names are mapped to
  1675. Xcolors as follows:
  1676. X.sp
  1677. X.nf
  1678. X.ta 1i
  1679. Xblack    solid
  1680. Xred    shortdashed
  1681. Xgreen    dotdashed
  1682. Xblue    longdashed
  1683. Xyellow    dotted
  1684. X.fi
  1685. X.PP
  1686. XThe present implementation on the Macintosh
  1687. Xis a square window with vertical and horizontal
  1688. Xdimensions of 300 pixels.
  1689. XArcs are not drawn correctly when
  1690. Xthe vertical and horizontal scaling factors
  1691. Xare unequal.
  1692. X.SH LIMITATIONS
  1693. X.I Uwterm 
  1694. Xis of no use on unix unless 
  1695. Xthe server is running and
  1696. X.I uw
  1697. Xis being run on the Macintosh.
  1698. X.SH SEE ALSO
  1699. Xplot(1G), plot(3X), plot(5), uw(L)
  1700. X.br
  1701. X.I uw
  1702. XMacintosh documentation
  1703. X(`UW \(em A Multiple-Window Interface to UNIX')
  1704. X.br
  1705. X`The UW Programmer's Library'
  1706. X.SH AUTHOR
  1707. XJohn Bruner, Lawrence Livermore National Laboratory, 10/86.
  1708. !EOF!doc/uwplot.l!
  1709. exit 0
  1710. : end of shell archive
  1711.