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.29 by greg, Thu May 21 05:54:54 2015 UTC vs.
Revision 2.60 by greg, Tue Jun 3 21:31:51 2025 UTC

# Line 18 | Line 18 | static const char RCSid[] = "$Id$";
18   #include "triangulate.h"
19   #include "platform.h"
20  
21 < #ifdef getc_unlocked            /* avoid horrendous overhead of flockfile */
22 < #undef getc
23 < #define getc    getc_unlocked
21 > #ifndef MAXRCARG
22 > #define MAXRCARG        10000
23   #endif
24  
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
35 #define MAXRCARG        512
36
37 char            *progname;              /* global argv[0] */
38
25   int             verbose = 0;            /* verbose mode (< 0 no warnings) */
26  
27   char            *rcarg[MAXRCARG+1] = {"rcontrib", "-fo+"};
# Line 53 | Line 39 | char           *shirchiufn = "disk2square.cal";
39   char            *kfullfn = "klems_full.cal";
40   char            *khalffn = "klems_half.cal";
41   char            *kquarterfn = "klems_quarter.cal";
42 + char            *ciefn = "cieskyscan.cal";
43  
44                                          /* string indicating parameters */
45   const char      PARAMSTART[] = "@rfluxmtx";
# Line 78 | Line 65 | typedef struct {
65          FVECT   uva[2];                 /* tangent axes */
66          int     ntris;                  /* number of triangles */
67          struct ptri {
68 <                float   afrac;                  /* fraction of total area */
68 >                double  afrac;                  /* fraction of total area */
69                  short   vndx[3];                /* vertex indices */
70          }       tri[1];                 /* triangle array (extends struct) */
71   } POLYTRIS;                     /* triangulated polygon */
# Line 152 | Line 139 | oconv_command(int ac, char *av[])
139          
140          if (ac-- <= 0)
141                  return(NULL);
142 <        while (ac-- > 0) {
143 <                strcpy(cp, *av++);
144 <                while (*cp) cp++;
158 <                *cp++ = ' ';
159 <                if (cp >= oconvbuf+(sizeof(oconvbuf)-32)) {
160 <                        fputs(progname, stderr);
161 <                        fputs(": too many file arguments!\n", stderr);
162 <                        exit(1);
163 <                }
142 >        if (verbose < 0) {      /* turn off warnings */
143 >                strcpy(cp, "-w ");
144 >                cp += 3;
145          }
146 <        strcpy(cp, recv);       /* receiver goes last */
147 <        return(oconvbuf);
148 < }
149 <
150 < /* Check if any of the characters in str2 are found in str1 */
151 < static int
152 < matchany(const char *str1, const char *str2)
153 < {
154 <        while (*str1) {
174 <                const char      *cp = str2;
175 <                while (*cp)
176 <                        if (*cp++ == *str1)
177 <                                return(*str1);
178 <                ++str1;
179 <        }
180 <        return(0);
181 < }
182 <
183 <
184 < /* Convert a set of arguments into a command line for pipe() or system() */
185 < static char *
186 < convert_commandline(char *cmd, const int len, char *av[])
187 < {
188 <        int     match;
189 <        char    *cp;
190 <
191 <        for (cp = cmd; *av != NULL; av++) {
192 <                const int       n = strlen(*av);
193 <                if (cp+n >= cmd+(len-3)) {
194 <                        fputs(progname, stderr);
195 <                        return(NULL);
196 <                }
197 <                if ((match = matchany(*av, SPECIALS))) {
198 <                        const int       quote =
199 < #ifdef ALTQUOT
200 <                                (match == QUOTCHAR) ? ALTQUOT :
201 < #endif
202 <                                        QUOTCHAR;
203 <                        *cp++ = quote;
204 <                        strcpy(cp, *av);
205 <                        cp += n;
206 <                        *cp++ = quote;
146 >        while (ac-- > 0) {      /* copy each argument */
147 >                int     len = strlen(*av);
148 >                if (cp+len+4 >= oconvbuf+sizeof(oconvbuf))
149 >                        goto overrun;
150 >                if (matchany(*av, SPECIALS)) {
151 >                        *cp++ = QUOTCHAR;
152 >                        strcpy(cp, *av++);
153 >                        cp += len;
154 >                        *cp++ = QUOTCHAR;
155                  } else {
156 <                        strcpy(cp, *av);
157 <                        cp += n;
156 >                        strcpy(cp, *av++);
157 >                        cp += len;
158                  }
159                  *cp++ = ' ';
160          }
161 <        if (cp <= cmd)
162 <                return(NULL);
163 <        *--cp = '\0';
164 <        return(cmd);
161 >                                /* receiver goes last */
162 >        if (matchany(recv, SPECIALS)) {
163 >                *cp++ = QUOTCHAR;
164 >                while (*recv) {
165 >                        if (cp >= oconvbuf+(sizeof(oconvbuf)-3))
166 >                                goto overrun;
167 >                        *cp++ = *recv++;
168 >                }
169 >                *cp++ = QUOTCHAR;
170 >                *cp = '\0';
171 >        } else
172 >                strcpy(cp, recv);
173 >        return(oconvbuf);
174 > overrun:
175 >        fputs(progname, stderr);
176 >        fputs(": too many file arguments!\n", stderr);
177 >        exit(1);
178   }
179  
180 + #if defined(_WIN32) || defined(_WIN64)
181 +
182   /* Open a pipe to/from a command given as an argument list */
183   static FILE *
184   popen_arglist(char *av[], char *mode)
# Line 233 | Line 196 | popen_arglist(char *av[], char *mode)
196          return(popen(cmd, mode));
197   }
198  
199 < #ifdef _WIN32
199 > #define pclose_al       pclose
200 >
201   /* Execute system command (Windows version) */
202   static int
203   my_exec(char *av[])
# Line 249 | Line 213 | my_exec(char *av[])
213                  fprintf(stderr, "%s: running: %s\n", progname, cmd);
214          return(system(cmd));
215   }
216 < #else
216 >
217 > #else   /* UNIX */
218 >
219 > static SUBPROC  rt_proc = SP_INACTIVE;  /* we only support one of these */
220 >
221 > /* Open a pipe to a command using an argument list */
222 > static FILE *
223 > popen_arglist(char *av[], char *mode)
224 > {
225 >        int     fd;
226 >
227 >        if (rt_proc.pid > 0) {
228 >                fprintf(stderr, "%s: only one i/o pipe at a time!\n", progname);
229 >                return(NULL);
230 >        }
231 >        if (verbose > 0) {
232 >                char    cmd[4096];
233 >                if (!convert_commandline(cmd, sizeof(cmd), av))
234 >                        strcpy(cmd, "COMMAND TOO LONG TO SHOW");
235 >                fprintf(stderr, "%s: opening pipe %s: %s\n",
236 >                                progname, (*mode=='w') ? "to" : "from", cmd);
237 >        }
238 >        if (*mode == 'w') {
239 >                fd = rt_proc.w = dup(fileno(stdout));
240 >                rt_proc.flags |= PF_FILT_OUT;
241 >        } else if (*mode == 'r') {
242 >                fd = rt_proc.r = dup(fileno(stdin));
243 >                rt_proc.flags |= PF_FILT_INP;
244 >        }
245 >        if (fd < 0 || open_process(&rt_proc, av) <= 0) {
246 >                perror(av[0]);
247 >                return(NULL);
248 >        }
249 >        return(fdopen(fd, mode));
250 > }
251 >
252 > /* Close command pipe (returns -1 on error to match pclose) */
253 > static int
254 > pclose_al(FILE *fp)
255 > {
256 >        int     prob = (fclose(fp) == EOF);
257 >
258 >        if (rt_proc.pid <= 0)
259 >                return(-1);
260 >
261 >        prob |= (close_process(&rt_proc) != 0);
262 >
263 >        return(-prob);
264 > }
265 >
266   /* Execute system command in our stead (Unix version) */
267   static int
268   my_exec(char *av[])
# Line 270 | Line 283 | my_exec(char *av[])
283          perror(compath);
284          return(1);
285   }
286 +
287   #endif
288  
289   /* Get normalized direction vector from string specification */
# Line 318 | Line 332 | parse_params(PARAMS *p, char *pargs)
332   {
333          char    *cp = pargs;
334          int     nparams = 0;
335 +        int     quot;
336          int     i;
337  
338          for ( ; ; ) {
# Line 354 | Line 369 | parse_params(PARAMS *p, char *pargs)
369                  case 'o':
370                          if (*cp++ != '=')
371                                  break;
372 +                        quot = 0;
373 +                        if ((*cp == '"') | (*cp == '\''))
374 +                                quot = *cp++;
375                          i = 0;
376 <                        while (*cp && !isspace(*cp++))
377 <                                i++;
376 >                        while (*cp && (quot ? (*cp != quot) : !isspace(*cp))) {
377 >                                i++; cp++;
378 >                        }
379                          if (!i)
380                                  break;
381 <                        *--cp = '\0';
381 >                        if (!*cp) {
382 >                                if (quot)
383 >                                        break;
384 >                                cp[1] = '\0';
385 >                        }
386 >                        *cp = '\0';
387                          p->outfn = savqstr(cp-i);
388 <                        *cp++ = ' ';
388 >                        *cp++ = quot ? quot : ' ';
389                          ++nparams;
390                          continue;
391                  case ' ':
# Line 421 | Line 445 | finish_receiver(void)
445                          curparams.vup[1] = 1;
446          }
447                                          /* determine sample type/bin */
448 <        if (tolower(curparams.hemis[0]) == 'u' | curparams.hemis[0] == '1') {
448 >        if ((tolower(curparams.hemis[0]) == 'u') | (curparams.hemis[0] == '1')) {
449                  sprintf(sbuf, "if(-Dx*%g-Dy*%g-Dz*%g,0,-1)",
450                          curparams.nrm[0], curparams.nrm[1], curparams.nrm[2]);
451                  binv = savqstr(sbuf);
# Line 474 | Line 498 | finish_receiver(void)
498                  calfn = kquarterfn; kquarterfn = NULL;
499                  binf = "kqbin";
500                  nbins = "Nkqbins";
501 +        } else if (!strcasecmp(curparams.hemis, "cie")) {
502 +                calfn = ciefn; ciefn = NULL;
503 +                sprintf(sbuf, "rNx=%g,rNy=%g,rNz=%g,Ux=%g,Uy=%g,Uz=%g,RHS=%c1",
504 +                        curparams.nrm[0], curparams.nrm[1], curparams.nrm[2],
505 +                        curparams.vup[0], curparams.vup[1], curparams.vup[2],
506 +                        curparams.sign);
507 +                binv = "cbin";
508 +                nbins = "Ncbins";
509          } else {
510                  fprintf(stderr, "%s: unrecognized hemisphere sampling: h=%s\n",
511                                  progname, curparams.hemis);
# Line 483 | Line 515 | finish_receiver(void)
515                  sprintf(sbuf, "RHS=%c1", curparams.sign);
516                  params = savqstr(sbuf);
517          }
518 <        if (!uniform & (curparams.slist->styp == ST_SOURCE)) {
518 >        if (!uniform) {
519                  SURF    *sp;
520                  for (sp = curparams.slist; sp != NULL; sp = sp->next)
521 <                        if (fabs(sp->area - PI) > 1e-3) {
521 >                        if (sp->styp == ST_SOURCE && fabs(sp->area - PI) > 1e-3) {
522                                  fprintf(stderr, "%s: source '%s' must be 180-degrees\n",
523                                                  progname, sp->sname);
524                                  exit(1);
# Line 644 | Line 676 | ssamp_poly(FVECT orig, SURF *sp, double x)
676                  sp->priv = (void *)ptp;
677          }
678                                          /* pick triangle by partial area */
679 <        for (i = 0; i < ptp->ntris && x > ptp->tri[i].afrac; i++)
679 >        for (i = 0; i < ptp->ntris-1 && x > ptp->tri[i].afrac; i++)
680                  x -= ptp->tri[i].afrac;
681          SDmultiSamp(samp2, 2, x/ptp->tri[i].afrac);
682          samp2[0] *= samp2[1] = sqrt(samp2[1]);
# Line 674 | Line 706 | sample_origin(PARAMS *p, FVECT orig, const FVECT rdir,
706                                          /* special case for lone surface */
707          if (p->nsurfs == 1) {
708                  sp = p->slist;
709 <                if (DOT(sp->snrm, rdir) >= -FTINY) {
709 >                if (DOT(sp->snrm, rdir) >= FTINY) {
710                          fprintf(stderr,
711                                  "%s: internal - sample behind sender '%s'\n",
712                                          progname, sp->sname);
# Line 685 | Line 717 | sample_origin(PARAMS *p, FVECT orig, const FVECT rdir,
717          if (p->nsurfs > nall) {         /* (re)allocate surface area cache */
718                  if (projsa) free(projsa);
719                  projsa = (double *)malloc(sizeof(double)*p->nsurfs);
720 <                if (!projsa) return(0);
720 >                if (projsa == NULL) {
721 >                        fputs(progname, stderr);
722 >                        fputs(": out of memory in sample_origin!\n", stderr);
723 >                        exit(1);
724 >                }
725                  nall = p->nsurfs;
726          }
727                                          /* compute projected areas */
728          for (i = 0, sp = p->slist; sp != NULL; i++, sp = sp->next) {
729                  projsa[i] = -DOT(sp->snrm, rdir) * sp->area;
730 <                tarea += projsa[i] *= (double)(projsa[i] > FTINY);
730 >                tarea += projsa[i] *= (double)(projsa[i] > 0);
731          }
732 <        if (tarea <= FTINY) {           /* wrong side of sender? */
732 >        if (tarea < FTINY*FTINY) {      /* wrong side of sender? */
733                  fputs(progname, stderr);
734                  fputs(": internal - sample behind all sender elements!\n",
735                                  stderr);
# Line 711 | Line 747 | sample_uniform(PARAMS *p, int b, FILE *fp)
747   {
748          int     n = sampcnt;
749          double  samp3[3];
750 <        double  duvw[3];
715 <        FVECT   orig_dir[2];
750 >        FVECT   duvw, orig_dir[2];
751          int     i;
752  
753          if (fp == NULL)                 /* just requesting number of bins? */
# Line 720 | Line 755 | sample_uniform(PARAMS *p, int b, FILE *fp)
755  
756          while (n--) {                   /* stratified hemisphere sampling */
757                  SDmultiSamp(samp3, 3, (n+frandom())/sampcnt);
758 <                SDsquare2disk(duvw, samp3[1], samp3[2]);
758 >                square2disk(duvw, samp3[1], samp3[2]);
759                  duvw[2] = -sqrt(1. - duvw[0]*duvw[0] - duvw[1]*duvw[1]);
760                  for (i = 3; i--; )
761                          orig_dir[1][i] = duvw[0]*p->udir[i] +
# Line 728 | Line 763 | sample_uniform(PARAMS *p, int b, FILE *fp)
763                                                  duvw[2]*p->nrm[i] ;
764                  if (!sample_origin(p, orig_dir[0], orig_dir[1], samp3[0]))
765                          return(0);
766 <                if (fwrite(orig_dir, sizeof(FVECT), 2, fp) != 2)
766 >                if (putbinary(orig_dir, sizeof(FVECT), 2, fp) != 2)
767                          return(0);
768          }
769          return(1);
# Line 740 | Line 775 | sample_shirchiu(PARAMS *p, int b, FILE *fp)
775   {
776          int     n = sampcnt;
777          double  samp3[3];
778 <        double  duvw[3];
744 <        FVECT   orig_dir[2];
778 >        FVECT   duvw, orig_dir[2];
779          int     i;
780  
781          if (fp == NULL)                 /* just requesting number of bins? */
# Line 749 | Line 783 | sample_shirchiu(PARAMS *p, int b, FILE *fp)
783  
784          while (n--) {                   /* stratified sampling */
785                  SDmultiSamp(samp3, 3, (n+frandom())/sampcnt);
786 <                SDsquare2disk(duvw, (b/p->hsiz + samp3[1])/curparams.hsiz,
786 >                square2disk(duvw, (b/p->hsiz + samp3[1])/curparams.hsiz,
787                                  (b%p->hsiz + samp3[2])/curparams.hsiz);
788                  duvw[2] = sqrt(1. - duvw[0]*duvw[0] - duvw[1]*duvw[1]);
789                  for (i = 3; i--; )
# Line 758 | Line 792 | sample_shirchiu(PARAMS *p, int b, FILE *fp)
792                                                  duvw[2]*p->nrm[i] ;
793                  if (!sample_origin(p, orig_dir[0], orig_dir[1], samp3[0]))
794                          return(0);
795 <                if (fwrite(orig_dir, sizeof(FVECT), 2, fp) != 2)
795 >                if (putbinary(orig_dir, sizeof(FVECT), 2, fp) != 2)
796                          return(0);
797          }
798          return(1);
# Line 794 | Line 828 | sample_reinhart(PARAMS *p, int b, FILE *fp)
828          }
829          while (n--) {                   /* stratified sampling */
830                  SDmultiSamp(samp3, 3, (n+frandom())/sampcnt);
831 +                if (row >= RowMax-1)    /* avoid crowding at zenith */
832 +                        samp3[1] *= samp3[1];
833                  alt = (row+samp3[1])*RAH;
834                  azi = (2.*PI)*(col+samp3[2]-.5)/rnaz(row);
835                  duvw[2] = cos(alt);     /* measured from horizon */
836                  duvw[0] = tsin(azi)*duvw[2];
837 <                duvw[1] = tcos(azi)*duvw[2];
837 >                duvw[1] = -tcos(azi)*duvw[2];
838                  duvw[2] = sqrt(1. - duvw[2]*duvw[2]);
839                  for (i = 3; i--; )
840                          orig_dir[1][i] = -duvw[0]*p->udir[i] -
# Line 806 | Line 842 | sample_reinhart(PARAMS *p, int b, FILE *fp)
842                                                  duvw[2]*p->nrm[i] ;
843                  if (!sample_origin(p, orig_dir[0], orig_dir[1], samp3[0]))
844                          return(0);
845 <                if (fwrite(orig_dir, sizeof(FVECT), 2, fp) != 2)
845 >                if (putbinary(orig_dir, sizeof(FVECT), 2, fp) != 2)
846                          return(0);
847          }
848          return(1);
# Line 857 | Line 893 | sample_klems(PARAMS *p, int b, FILE *fp)
893                                                  duvw[2]*p->nrm[i] ;
894                  if (!sample_origin(p, orig_dir[0], orig_dir[1], samp2[0]))
895                          return(0);
896 <                if (fwrite(orig_dir, sizeof(FVECT), 2, fp) != 2)
896 >                if (putbinary(orig_dir, sizeof(FVECT), 2, fp) != 2)
897                          return(0);
898          }
899          return(1);
# Line 905 | Line 941 | prepare_sampler(void)
941                  curparams.udir[1] *= -1.;
942                  curparams.udir[2] *= -1.;
943          }
944 <        if (tolower(curparams.hemis[0]) == 'u' | curparams.hemis[0] == '1')
944 >        if ((tolower(curparams.hemis[0]) == 'u') | (curparams.hemis[0] == '1'))
945                  curparams.sample_basis = sample_uniform;
946          else if (tolower(curparams.hemis[0]) == 's' &&
947                                  tolower(curparams.hemis[1]) == 'c')
# Line 966 | Line 1002 | finish_polygon(SURF *p)
1002                  VCOPY(e1, e2);
1003          }
1004          p->area = normalize(p->snrm)*0.5;
1005 <        return(p->area > FTINY);
1005 >        return(p->area > FTINY*FTINY);
1006   }
1007  
1008   /* Add a surface to our current parameters */
# Line 984 | Line 1020 | add_surface(int st, const char *oname, FILE *fp)
1020          snew = (SURF *)malloc(sizeof(SURF) + sizeof(double)*(n-1));
1021          if (snew == NULL) {
1022                  fputs(progname, stderr);
1023 <                fputs(": out of memory!\n", stderr);
1023 >                fputs(": out of memory in add_surface!\n", stderr);
1024                  exit(1);
1025          }
1026          strncpy(snew->sname, oname, sizeof(snew->sname)-1);
# Line 1029 | Line 1065 | add_surface(int st, const char *oname, FILE *fp)
1065                  snew->area *= PI*snew->area;
1066                  break;
1067          }
1068 <        if ((snew->area <= FTINY) & (verbose >= 0)) {
1068 >        if ((snew->area <= FTINY*FTINY) & (verbose >= 0)) {
1069                  fprintf(stderr, "%s: warning - zero area for surface '%s'\n",
1070                                  progname, oname);
1071                  free(snew);
# Line 1066 | Line 1102 | add_recv_object(FILE *fp)
1102          }
1103                                          /* is it a new receiver? */
1104          if ((st = surf_type(otype)) != ST_NONE) {
1069                if (curparams.slist != NULL && (st == ST_SOURCE) ^
1070                                (curparams.slist->styp == ST_SOURCE)) {
1071                        fputs(progname, stderr);
1072                        fputs(": cannot mix source/non-source receivers!\n", stderr);
1073                        return(-1);
1074                }
1105                  if (strcmp(thismod, curmod)) {
1106                          if (curmod[0]) {        /* output last receiver? */
1107                                  finish_receiver();
# Line 1207 | Line 1237 | main(int argc, char *argv[])
1237          FILE    *rcfp;
1238          int     nsbins;
1239          int     a, i;
1240 +                                        /* set global progname */
1241 +        fixargv0(argv[0]);
1242                                          /* screen rcontrib options */
1211        progname = argv[0];
1243          for (a = 1; a < argc-2; a++) {
1244                  int     na;
1245                                          /* check for argument expansion */
# Line 1254 | Line 1285 | main(int argc, char *argv[])
1285                          yrs = argv[++a];
1286                          na = 0;
1287                          continue;
1288 <                case 'c':               /* number of samples */
1289 <                        sampcnt = atoi(argv[++a]);
1290 <                        if (sampcnt <= 0)
1291 <                                goto userr;
1292 <                        na = 0;         /* we re-add this later */
1293 <                        continue;
1288 >                case 'c':               /* spectral sampling or count */
1289 >                        switch (argv[a][2]) {
1290 >                        case 's':
1291 >                                na = 2;
1292 >                                break;
1293 >                        case 'w':
1294 >                                na = 3;
1295 >                                break;
1296 >                        case '\0':
1297 >                                sampcnt = atoi(argv[++a]);
1298 >                                if (sampcnt <= 0)
1299 >                                        goto userr;
1300 >                                na = 0;         /* we re-add this later */
1301 >                                continue;
1302 >                        }
1303 >                        break;
1304                  case 'I':               /* only for pass-through mode */
1305                  case 'i':
1306                          iropt = argv[a];
1307                          na = 0;
1308                          continue;
1309                  case 'w':               /* options without arguments */
1310 <                        if (argv[a][2] != '+') verbose = -1;
1310 >                        if (!argv[a][2] || strchr("+1tTyY", argv[a][2]) == NULL)
1311 >                                verbose = -1;
1312 >                        break;
1313                  case 'V':
1314                  case 'u':
1315                  case 'h':
# Line 1275 | Line 1318 | main(int argc, char *argv[])
1318                  case 'n':               /* options with 1 argument */
1319                  case 's':
1320                  case 'o':
1321 +                case 't':
1322                          na = 2;
1323                          break;
1324                  case 'b':               /* special case */
# Line 1343 | Line 1387 | main(int argc, char *argv[])
1387                          fputs(": -i, -I supported for pass-through only\n", stderr);
1388                          return(1);
1389                  }
1390 <                fmtopt[2] = (sizeof(RREAL)==sizeof(double)) ? 'd' : 'f';
1390 > #ifdef SMLFLT
1391 >                fmtopt[2] = 'f';
1392 > #else
1393 >                fmtopt[2] = 'd';
1394 > #endif
1395                  if (sampcnt <= 0) sampcnt = 10000;
1396          }
1397          sprintf(sampcntbuf, "%d", sampcnt);
# Line 1390 | Line 1438 | main(int argc, char *argv[])
1438          for (i = 0; i < nsbins; i++)    /* send rcontrib ray samples */
1439                  if (!(*curparams.sample_basis)(&curparams, i, rcfp))
1440                          return(1);
1441 <        return(pclose(rcfp) < 0);       /* all finished! */
1441 >        return(pclose_al(rcfp) < 0);    /* all finished! */
1442   userr:
1443          if (a < argc-2)
1444                  fprintf(stderr, "%s: unsupported option '%s'", progname, argv[a]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines