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

Comparing ray/src/rt/x10.c (file contents):
Revision 2.5 by greg, Tue Sep 20 15:50:00 1994 UTC vs.
Revision 2.6 by gregl, Tue Nov 11 20:03:02 1997 UTC

# Line 10 | Line 10 | static char SCCSid[] = "$SunId$ LBL";
10   *     5/7/87
11   */
12  
13 < #include  <stdio.h>
14 < #include  <math.h>
13 > #include  "standard.h"
14  
15   #include  <X/Xlib.h>
16   #include  <X/cursors/bcross.cursor>
# Line 80 | Line 79 | char  *name, *id;
79  
80          ourdisplay = XOpenDisplay(NULL);
81          if (ourdisplay == NULL) {
82 <                stderr_v("cannot open X-windows; DISPLAY variable set?\n");
82 >                eputs("cannot open X-windows; DISPLAY variable set?\n");
83                  return(NULL);
84          }
85          if (DisplayPlanes() < 4) {
86 <                stderr_v("not enough colors\n");
86 >                eputs("not enough colors\n");
87                  return(NULL);
88          }
89                                  /* make color map */
# Line 105 | Line 104 | char  *name, *id;
104          gwind = XCreate("X10 display driver", progname, NULL, defgeom,
105                          &mainframe, MINWIDTH, MINHEIGHT+COMHEIGHT);
106          if (gwind == 0) {
107 <                stderr_v("can't create window\n");
107 >                eputs("can't create window\n");
108                  return(NULL);
109          }
110          XStoreName(gwind, id);
# Line 116 | Line 115 | char  *name, *id;
115          x_driver.xsiz = gwidth < MINWIDTH ? MINWIDTH : gwidth;
116          x_driver.ysiz = gheight < MINHEIGHT ? MINHEIGHT : gheight;
117          x_driver.inpready = 0;
118 <        cmdvec = x_comout;                      /* set error vectors */
119 <        if (wrnvec != NULL)
120 <                wrnvec = x_errout;
118 >        erract[COMMAND].pf = x_comout;          /* set error vectors */
119 >        if (erract[WARNING].pf != NULL)
120 >                erract[WARNING].pf = x_errout;
121          return(&x_driver);
122   }
123  
# Line 126 | Line 125 | char  *name, *id;
125   static
126   x_close()                       /* close our display */
127   {
128 <        cmdvec = NULL;                          /* reset error vectors */
129 <        if (wrnvec != NULL)
130 <                wrnvec = stderr_v;
128 >        erract[COMMAND].pf = NULL;              /* reset error vectors */
129 >        if (erract[WARNING].pf != NULL)
130 >                erract[WARNING].pf = wputs;
131          if (ourdisplay == NULL)
132                  return;
133          if (comline != NULL) {
# Line 158 | Line 157 | int  xres, yres;
157                  XClear(gwind);
158                                                  /* reinitialize color table */
159          if (getpixels() == 0)
160 <                stderr_v("cannot allocate colors\n");
160 >                eputs("cannot allocate colors\n");
161          else
162                  new_ctab(ncolors);
163                                                  /* open new command line */
# Line 166 | Line 165 | int  xres, yres;
165                  xt_close(comline);
166          comline = xt_open(gwind, 0, yres, xres, COMHEIGHT, 0, COMFN);
167          if (comline == NULL) {
168 <                stderr_v("Cannot open command line window\n");
168 >                eputs("Cannot open command line window\n");
169                  quit(1);
170          }
171          XMapWindow(gwind);                      /* make sure it's mapped */
# Line 233 | Line 232 | static
232   x_errout(msg)                   /* output an error message */
233   char  *msg;
234   {
235 <        stderr_v(msg);          /* send to stderr also! */
235 >        eputs(msg);             /* send to stderr also! */
236          x_comout(msg);
237   }
238  
# Line 369 | Line 368 | register XExposeEvent  *eexp;
368          }
369                                          /* remap colors */
370          if (getpixels() == 0) {
371 <                stderr_v("cannot allocate colors\n");
371 >                eputs("cannot allocate colors\n");
372                  return;
373          }
374          new_ctab(ncolors);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines