ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rholo4.c
(Generate patch)

Comparing ray/src/hd/rholo4.c (file contents):
Revision 3.5 by gregl, Mon Nov 10 18:07:15 1997 UTC vs.
Revision 3.9 by gregl, Wed Nov 26 21:34:28 1997 UTC

# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ SGI";
18  
19   static int      inp_flags;
20   static int      dpd[3];
21 static int      pipesiz;
21   static FILE     *dpout;
22  
23  
# Line 34 | Line 33 | char   *dname;
33          sprintf(dpath, "dev/%s%s", dname, HDSUF);
34   #endif
35          com[0] = dpath; com[1] = froot; com[2] = NULL;
36 <        pipesiz = open_process(dpd, com);
37 <        if (pipesiz <= 0)
36 >        i = open_process(dpd, com);
37 >        if (i <= 0)
38                  error(USER, "cannot start display process");
39          if ((dpout = fdopen(dup(dpd[1]), "w")) == NULL)
40                  error(SYSTEM, "cannot associate FILE with display pipe");
# Line 61 | Line 60 | int    block;
60          int     n;
61          char    *buf = NULL;
62  
63 <        if (pipesiz <= 0)
63 >        if (dpout == NULL)
64                  return(-1);
65                                          /* flush display output */
66          disp_flush();
# Line 109 | Line 108 | int    block;
108                  disp_result(DS_STARTIMM, 0, NULL);
109                  bundle_set(BS_ADD, (PACKHEAD *)buf, msg.nbytes/sizeof(PACKHEAD));
110                  disp_result(DS_ENDIMM, 0, NULL);
111 +                disp_check(0);          /* hack -- delete usu. follows add */
112 +                break;
113 +        case DR_ADJSET:
114 +                if (msg.nbytes % sizeof(PACKHEAD))
115 +                        error(INTERNAL, "bad DR_ADJSET from display process");
116 +                disp_result(DS_STARTIMM, 0, NULL);
117 +                bundle_set(BS_ADJ, (PACKHEAD *)buf, msg.nbytes/sizeof(PACKHEAD));
118 +                disp_result(DS_ENDIMM, 0, NULL);
119                  disp_flush();
120                  break;
121          case DR_DELSET:
# Line 126 | Line 133 | int    block;
133                  if (msg.nbytes)
134                          error(INTERNAL, "bad DR_SHUTDOWN from display process");
135                  return(0);              /* zero return signals shutdown */
136 +        case DR_NOOP:
137 +                break;
138          default:
139                  error(INTERNAL, "unrecognized request from display process");
140          }
# Line 144 | Line 153 | disp_close()                   /* close our display process */
153   {
154          int     rval;
155  
156 <        if (pipesiz <= 0)
156 >        if (dpout == NULL)
157                  return(-1);
158          disp_result(DS_SHUTDOWN, 0, NULL);
159          fclose(dpout);
160          dpout = NULL;
152        pipesiz = 0;
161          return(close_process(dpd));
162   }
163  
# Line 160 | Line 168 | char   *p;
168   {
169          MSGHEAD msg;
170  
171 +        if (dpout == NULL)
172 +                return;
173          msg.type = type;
174          msg.nbytes = nbytes;
175          fwrite((char *)&msg, sizeof(MSGHEAD), 1, dpout);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines