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

Comparing ray/src/rt/raypcalls.c (file contents):
Revision 2.5 by schorsch, Sun Jul 27 22:12:03 2003 UTC vs.
Revision 2.6 by schorsch, Tue Mar 30 16:13:01 2004 UTC

# Line 124 | Line 124 | static const char      RCSid[] = "$Id$";
124   *  but otherwise your process should not be compromised.
125   */
126  
127 < #include  "ray.h"
127 > #include <stdio.h>
128 > #include <sys/types.h>
129 > #include <sys/wait.h> /* XXX platform */
130  
131 + #include  "rtprocess.h"
132 + #include  "ray.h"
133 + #include  "ambient.h"
134   #include  "selcall.h"
135  
136   #ifndef RAYQLEN
# Line 160 | Line 165 | static int     r_recv_next;            /* next receive ray placement
165  
166   #define sendq_full()    (r_send_next >= RAYQLEN)
167  
168 + static int ray_pflush(void);
169 + static void ray_pchild(int      fd_in, int      fd_out);
170  
171 < void
172 < ray_pinit(otnm, nproc)          /* initialize ray-tracing processes */
173 < char    *otnm;
174 < int     nproc;
171 >
172 > extern void
173 > ray_pinit(              /* initialize ray-tracing processes */
174 >        char    *otnm,
175 >        int     nproc
176 > )
177   {
178          if (nobjects > 0)               /* close old calculation */
179                  ray_pdone(0);
# Line 185 | Line 194 | int    nproc;
194  
195  
196   static int
197 < ray_pflush()                    /* send queued rays to idle children */
197 > ray_pflush(void)                        /* send queued rays to idle children */
198   {
199          int     nc, n, nw, i, sfirst;
200  
# Line 219 | Line 228 | ray_pflush()                   /* send queued rays to idle children */
228   }
229  
230  
231 < void
232 < ray_psend(r)                    /* add a ray to our send queue */
233 < RAY     *r;
231 > extern void
232 > ray_psend(                      /* add a ray to our send queue */
233 >        RAY     *r
234 > )
235   {
236          if (r == NULL)
237                  return;
# Line 234 | Line 244 | RAY    *r;
244   }
245  
246  
247 < int
248 < ray_pqueue(r)                   /* queue a ray for computation */
249 < RAY     *r;
247 > extern int
248 > ray_pqueue(                     /* queue a ray for computation */
249 >        RAY     *r
250 > )
251   {
252          if (r == NULL)
253                  return(0);
# Line 265 | Line 276 | RAY    *r;
276   }
277  
278  
279 < int
280 < ray_presult(r, poll)            /* check for a completed ray */
281 < RAY     *r;
282 < int     poll;
279 > extern int
280 > ray_presult(            /* check for a completed ray */
281 >        RAY     *r,
282 >        int     poll
283 > )
284   {
285          static struct timeval   tpoll;  /* zero timeval struct */
286          static fd_set   readset, errset;
# Line 360 | Line 372 | getready:                              /* any children waiting for us? */
372   }
373  
374  
375 < void
376 < ray_pdone(freall)               /* reap children and free data */
377 < int     freall;
375 > extern void
376 > ray_pdone(              /* reap children and free data */
377 >        int     freall
378 > )
379   {
380          ray_pclose(0);                  /* close child processes */
381  
# Line 375 | Line 388 | int    freall;
388  
389  
390   static void
391 < ray_pchild(fd_in, fd_out)       /* process rays (never returns) */
392 < int     fd_in;
393 < int     fd_out;
391 > ray_pchild(     /* process rays (never returns) */
392 >        int     fd_in,
393 >        int     fd_out
394 > )
395   {
396          int     n;
397          register int    i;
# Line 421 | Line 435 | int    fd_out;
435   }
436  
437  
438 < void
439 < ray_popen(nadd)                 /* open the specified # processes */
440 < int     nadd;
438 > extern void
439 > ray_popen(                      /* open the specified # processes */
440 >        int     nadd
441 > )
442   {
443                                          /* check if our table has room */
444          if (ray_pnprocs + nadd > MAX_NPROCS)
# Line 458 | Line 473 | int    nadd;
473   }
474  
475  
476 < void
477 < ray_pclose(nsub)                /* close one or more child processes */
478 < int     nsub;
476 > extern void
477 > ray_pclose(             /* close one or more child processes */
478 >        int     nsub
479 > )
480   {
481          static int      inclose = 0;
482          RAY     res;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines