ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhdisp.h
Revision: 3.6
Committed: Mon Dec 8 18:51:16 1997 UTC (26 years, 3 months ago) by gregl
Content type: text/plain
Branch: MAIN
Changes since 3.5: +25 -0 lines
Log Message:
added command reading from server's stdin

File Contents

# User Rev Content
1 gregl 3.1 /* Copyright (c) 1997 Silicon Graphics, Inc. */
2    
3     /* SCCSid "$SunId$ SGI" */
4    
5     /*
6     * Header for holodeck display drivers.
7     */
8    
9     /* display requests */
10 gregl 3.4 #define DR_NOOP 0 /* to release from vain DR_ATTEN */
11 gregl 3.5 #define DR_BUNDLE 1 /* lone bundle request */
12 gregl 3.2 #define DR_ATTEN 2 /* request for attention */
13     #define DR_SHUTDOWN 3 /* shutdown request */
14     #define DR_NEWSET 4 /* new bundle set */
15 gregl 3.1 #define DR_ADDSET 5 /* add to current set */
16 gregl 3.5 #define DR_ADJSET 6 /* adjust set quantities */
17     #define DR_DELSET 7 /* delete from current set */
18 gregl 3.1
19     /* server responses */
20 gregl 3.5 #define DS_BUNDLE 8 /* computed bundle */
21     #define DS_ACKNOW 9 /* acknowledge request for attention */
22     #define DS_SHUTDOWN 10 /* end process and close connection */
23     #define DS_ADDHOLO 11 /* register new holodeck */
24     #define DS_STARTIMM 12 /* begin immediate bundle set */
25     #define DS_ENDIMM 13 /* end immediate bundle set */
26 gregl 3.1
27     /*
28     * Normally, the server channel has priority, with the display process
29     * checking it frequently for new data. However, when the display process
30     * makes a request for attention (DR_ATTEN), the server will finish its
31     * current operations and flush its buffers, sending an acknowledge
32     * message (DS_ACKNOW) when it's done. This then allows the
33     * display process to send a long request to the holodeck server.
34     * Priority returns to normal after the following request.
35     */
36    
37 gregl 3.3 #ifndef BIGREQSIZ
38     #define BIGREQSIZ 512 /* big request size (bytes) */
39     #endif
40    
41 gregl 3.1 typedef struct {
42     int2 type; /* message type */
43     int4 nbytes; /* number of additional bytes */
44     } MSGHEAD; /* message head */
45 gregl 3.6
46     /*
47     * The display process is started with three arguments. The first argument
48     * is the short name of the holodeck file, appropriate for window naming, etc.
49     * The second and third arguments are the file descriptor numbers assigned to
50     * the server's standard output and input, respectively. The stdin and stdout
51     * of the display process are used for normal communication with the server,
52     * and are connected to pipes going each way. It is entirely appropriate
53     * for the display process to borrow the server's stdin and stdout for reading
54     * and writing user commands from the following list. If the standard input
55     * is not available for reading, then a descriptor of -1 will be passed.
56     * The standard output will always be available for writing, though it
57     * may go to /dev/null.
58     */
59    
60     /* user commands */
61     #define DC_SETVIEW 0 /* set the view */
62     #define DC_GETVIEW 1 /* print the current view */
63     #define DC_PAUSE 2 /* pause the current calculation */
64     #define DC_RESUME 3 /* resume the calculation */
65     #define DC_QUIT 4 /* quit the program */
66    
67     #define DC_NCMDS 5 /* number of commands */
68    
69     #define DC_INIT {"VIEW=","where","pause","resume","quit"}