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

Comparing ray/src/common/process.c (file contents):
Revision 2.9 by greg, Fri Feb 28 05:18:49 2020 UTC vs.
Revision 2.13 by greg, Tue Oct 29 00:35:06 2024 UTC

# Line 4 | Line 4 | static const char      RCSid[] = "$Id$";
4   /*
5   * Routines to communicate with separate process via dual pipes
6   *
7 < * External symbols declared in standard.h
7 > * External symbols declared in rtprocess.h
8   */
9  
10   #include "copyright.h"
# Line 24 | Line 24 | The functions open_process() and close_process() exist
24   int
25   process(                /* process data through pd */
26          SUBPROC *pd,
27 <        char    *recvbuf, char *sendbuf,
27 >        void    *recvbuf, void *sendbuf,
28          int     nbr, int nbs
29   )
30   {
31        if (nbs > PIPE_BUF)
32                return(-1);
31          if (!(pd->flags & PF_RUNNING))
32                  return(-1);
33          if (writebuf(pd->w, sendbuf, nbs) < nbs)
# Line 39 | Line 37 | process(               /* process data through pd */
37  
38  
39  
40 < int
40 > ssize_t
41   readbuf(                /* read all of requested buffer */
42          int     fd,
43 <        char    *bpos,
44 <        int     siz
43 >        void    *buf,
44 >        ssize_t siz
45   )
46   {
47 <        int     cc = 0, nrem = siz;
47 >        char    *bpos = (char *)buf;
48 >        ssize_t cc = 0, nrem = siz;
49   retry:
50          while (nrem > 0 && (cc = read(fd, bpos, nrem)) > 0) {
51                  bpos += cc;
# Line 63 | Line 62 | retry:
62   }
63  
64  
65 < int
65 > ssize_t
66   writebuf(               /* write all of requested buffer */
67   int     fd,
68 < char    *bpos,
69 < int     siz
68 > const void      *buf,
69 > ssize_t siz
70   )
71   {
72 <        int     cc = 0, nrem = siz;
72 >        const char      *bpos = (const char *)buf;
73 >        ssize_t         cc = 0, nrem = siz;
74   retry:
75          while (nrem > 0 && (cc = write(fd, bpos, nrem)) > 0) {
76                  bpos += cc;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines