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

Comparing ray/src/util/wrapBSDF.c (file contents):
Revision 2.16 by greg, Fri May 29 07:45:48 2015 UTC vs.
Revision 2.19 by greg, Wed Feb 3 00:22:55 2016 UTC

# Line 9 | Line 9 | static const char RCSid[] = "$Id$";
9  
10   #include <ctype.h>
11   #include "rtio.h"
12 < #include "rtprocess.h"
12 > #include "paths.h"
13   #include "ezxml.h"
14   #include "bsdf.h"
15   #include "bsdf_m.h"
# Line 82 | Line 82 | struct s_dfile {
82  
83   int             ndataf = 0;             /* number of data files */
84  
85 + int             unlink_datafiles = 0;   /* unlink data files when done */
86 +
87   const char      *spectr_file[MAXFILES]; /* custom spectral curve input */
88  
89   const char      top_level_name[] = "WindowElement";
# Line 604 | Line 606 | writeBSDF(const char *caller, ezxml_t fl)
606          fputs(xml+ei, stdout);                  /* write trailer */
607          free(xml);                              /* free string */
608          fputc('\n', stdout);
609 <        return (fflush(stdout) == 0);
609 >        if (fflush(stdout) != 0)
610 >                return 0;
611 >                                                /* unlink data files if req. */
612 >        for (i = ndataf*(unlink_datafiles != 0); i--; )
613 >                if (data_file[i].fname != stdin_name &&
614 >                                data_file[i].fname[0] != '!')
615 >                        unlink(data_file[i].fname);
616 >        if (unlink_datafiles > 1 && mgf_geometry != NULL &&
617 >                        mgf_geometry != stdin_name &&
618 >                        mgf_geometry[0] != '!')
619 >                unlink(mgf_geometry);
620 >        return 1;
621   }
622  
623   /* Insert BSDF data into XML wrapper */
# Line 767 | Line 780 | main(int argc, char *argv[])
780                                  return 1;
781                          }
782                          attr_unit = argv[i];
783 +                        continue;
784 +                case 'U':               /* unlink data files when done */
785 +                        unlink_datafiles = 1 + (argv[i][2] == 'U');
786                          continue;
787                  case 'a':               /* angle basis */
788                          if (++i >= argc)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines