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

Comparing ray/src/hd/rholo.c (file contents):
Revision 3.80 by greg, Fri Oct 5 19:19:16 2018 UTC vs.
Revision 3.86 by greg, Thu Jun 5 19:10:31 2025 UTC

# Line 36 | Line 36 | int    NVARS = NRHVARS;                /* total number of variables */
36  
37   VARIABLE        vv[] = RHVINIT;         /* variable-value pairs */
38  
39 char    *progname;              /* our program name */
39   char    *hdkfile;               /* holodeck file name */
40   char    froot[256];             /* root file name */
41  
# Line 90 | Line 89 | main(
89   {
90          int     i;
91  
92 <        progname = argv[0];                     /* get arguments */
92 >        fixargv0(argv[0]);                      /* get arguments */
93          for (i = 1; i < argc && argv[i][0] == '-'; i++)
94                  switch (argv[i][1]) {
95                  case 'w':                       /* turn off warnings */
# Line 229 | Line 228 | resfmode(              /* restrict open file access mode */
228   static void
229   initrholo(void)                 /* get our holodeck running */
230   {
232        extern int      global_packet();
231          int     i;
232                                                  /* close holodeck on exec() */
233          fcntl(hdlist[0]->fd, F_SETFD, FD_CLOEXEC);
# Line 394 | Line 392 | setdefaults(                   /* set default values */
392          HDGRID  *gp
393   )
394   {
397        extern char     *atos();
395          int     i;
396          int     n;
397          double  len[3], d;
# Line 458 | Line 455 | creatholo(                     /* create a holodeck output file */
455          int     fd;
456          FILE    *fp;
457                                          /* open & truncate file */
458 <        if ((fp = fopen(hdkfile, "w+")) == NULL) {
458 >        if ((fp = fopen(hdkfile, "wb+")) == NULL) {
459                  sprintf(errmsg, "cannot open \"%s\" for writing", hdkfile);
460                  error(SYSTEM, errmsg);
461          }
462                                          /* write information header */
463          newheader("RADIANCE", fp);
464          fprintf(fp, "SOFTWARE= %s\n", VersionID);
465 +        fputnow(fp);
466          printvars(fp);
467 +        fputendian(fp);
468          fputformat(HOLOFMT, fp);
469          fputc('\n', fp);
470          putw(HOLOMAGIC, fp);            /* put magic number */
# Line 525 | Line 524 | loadholo(void)                 /* start loading a holodeck from fnam
524          off_t   nextloc;
525          
526          if ((ncprocs > 0) & (force >= 0))
527 <                fp = fopen(hdkfile, "r+");
527 >                fp = fopen(hdkfile, "rb+");
528          else
529                  fp = NULL;
530          if (fp == NULL) {
531 <                if ((fp = fopen(hdkfile, "r")) == NULL) {
531 >                if ((fp = fopen(hdkfile, "rb")) == NULL) {
532                          sprintf(errmsg, "cannot open \"%s\"", hdkfile);
533                          error(SYSTEM, errmsg);
534                  }
# Line 631 | Line 630 | badvalue(                      /* report bad variable value and exit */
630  
631  
632   void
633 < eputs(s)                        /* put error message to stderr */
635 < char  *s;
633 > eputs(const char *s)            /* put error message to stderr */
634   {
635          static int  midline = 0;
636  
# Line 651 | Line 649 | char  *s;
649  
650  
651   void
652 < quit(ec)                        /* exit program gracefully */
655 < int     ec;
652 > quit(int ec)                    /* exit program gracefully */
653   {
654          int     status = 0;
655  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines