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

Comparing ray/src/util/rfluxmtx.c (file contents):
Revision 2.33 by greg, Tue Feb 2 01:43:24 2016 UTC vs.
Revision 2.34 by greg, Tue Feb 2 18:02:32 2016 UTC

# Line 11 | Line 11 | static const char RCSid[] = "$Id$";
11   #include <stdlib.h>
12   #include "rtio.h"
13   #include "rtmath.h"
14 < #include "rtprocess.h"
14 > #include "paths.h"
15   #include "bsdf.h"
16   #include "bsdf_m.h"
17   #include "random.h"
# Line 23 | Line 23 | static const char RCSid[] = "$Id$";
23   #define getc    getc_unlocked
24   #endif
25  
26 #ifdef _WIN32
27 #define SPECIALS        " \t\"$*?"
28 #define QUOTCHAR        '"'
29 #else
30 #define SPECIALS        " \t\n'\"()${}*?[];|&"
31 #define QUOTCHAR        '\''
32 #define ALTQUOT         '"'
33 #endif
34
26   #define MAXRCARG        512
27  
28   char            *progname;              /* global argv[0] */
# Line 142 | Line 133 | surf_type(const char *otype)
133          return(ST_NONE);
134   }
135  
145 /* Check if any of the characters in str2 are found in str1 */
146 static int
147 matchany(const char *str1, const char *str2)
148 {
149        while (*str1) {
150                const char      *cp = str2;
151                while (*cp)
152                        if (*cp++ == *str1)
153                                return(*str1);
154                ++str1;
155        }
156        return(0);
157 }
158
136   /* Add arguments to oconv command */
137   static char *
138   oconv_command(int ac, char *av[])
# Line 190 | Line 167 | overrun:
167          fputs(progname, stderr);
168          fputs(": too many file arguments!\n", stderr);
169          exit(1);
193 }
194
195 /* Convert a set of arguments into a command line for pipe() or system() */
196 static char *
197 convert_commandline(char *cmd, const int len, char *av[])
198 {
199        int     match;
200        char    *cp;
201
202        for (cp = cmd; *av != NULL; av++) {
203                const int       n = strlen(*av);
204                if (cp+n >= cmd+(len-3))
205                        return(NULL);
206                if (matchany(*av, SPECIALS)) {
207                        const int       quote =
208 #ifdef ALTQUOT
209                                strchr(*av, QUOTCHAR) ? ALTQUOT :
210 #endif
211                                        QUOTCHAR;
212                        *cp++ = quote;
213                        strcpy(cp, *av);
214                        cp += n;
215                        *cp++ = quote;
216                } else {
217                        strcpy(cp, *av);
218                        cp += n;
219                }
220                *cp++ = ' ';
221        }
222        if (cp <= cmd)
223                return(NULL);
224        *--cp = '\0';
225        return(cmd);
170   }
171  
172   /* Open a pipe to/from a command given as an argument list */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines