| 1 |
< |
/* Copyright (c) 1993 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1994 Regents of the University of California */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
| 11 |
|
#include "standard.h" |
| 12 |
|
#include "paths.h" |
| 13 |
|
#include <ctype.h> |
| 14 |
+ |
#include <sys/types.h> |
| 15 |
|
|
| 16 |
|
|
| 17 |
|
typedef struct { |
| 102 |
|
char overfile[] = "/dev/null"; |
| 103 |
|
#endif |
| 104 |
|
|
| 105 |
< |
extern unsigned long fdate(), time(); |
| 105 |
> |
extern time_t fdate(), time(); |
| 106 |
|
|
| 107 |
< |
unsigned long scenedate; /* date of latest scene or object file */ |
| 108 |
< |
unsigned long octreedate; /* date of octree */ |
| 109 |
< |
unsigned long matdate; /* date of latest material file */ |
| 110 |
< |
unsigned long illumdate; /* date of last illum file */ |
| 107 |
> |
time_t scenedate; /* date of latest scene or object file */ |
| 108 |
> |
time_t octreedate; /* date of octree */ |
| 109 |
> |
time_t matdate; /* date of latest material file */ |
| 110 |
> |
time_t illumdate; /* date of last illum file */ |
| 111 |
|
|
| 112 |
|
char *oct0name; /* name of pre-mkillum octree */ |
| 113 |
< |
unsigned long oct0date; /* date of pre-mkillum octree */ |
| 113 |
> |
time_t oct0date; /* date of pre-mkillum octree */ |
| 114 |
|
char *oct1name; /* name of post-mkillum octree */ |
| 115 |
< |
unsigned long oct1date; /* date of post-mkillum octree (>= matdate) */ |
| 115 |
> |
time_t oct1date; /* date of post-mkillum octree (>= matdate) */ |
| 116 |
|
|
| 117 |
+ |
int nowarn = 0; /* no warnings */ |
| 118 |
|
int explicate = 0; /* explicate variables */ |
| 119 |
|
int silent = 0; /* do work silently */ |
| 120 |
|
int noaction = 0; /* don't do anything */ |
| 159 |
|
case 'v': |
| 160 |
|
viewselect = argv[++i]; |
| 161 |
|
break; |
| 162 |
+ |
case 'w': |
| 163 |
+ |
nowarn++; |
| 164 |
+ |
break; |
| 165 |
|
default: |
| 166 |
|
goto userr; |
| 167 |
|
} |
| 277 |
|
for (n = strlen(ass); n > 0; n--) |
| 278 |
|
if (!isspace(ass[n-1])) |
| 279 |
|
break; |
| 280 |
< |
if (!n) { |
| 280 |
> |
if (!n && !nowarn) { |
| 281 |
|
fprintf(stderr, "%s: warning - missing value for variable '%s'\n", |
| 282 |
|
progname, varname); |
| 283 |
|
return; |
| 363 |
|
{ |
| 364 |
|
if (vp->nass < 2) |
| 365 |
|
return; |
| 366 |
< |
fprintf(stderr, "%s: warning - multiple assignment of variable '%s'\n", |
| 366 |
> |
if (!nowarn) |
| 367 |
> |
fprintf(stderr, |
| 368 |
> |
"%s: warning - multiple assignment of variable '%s'\n", |
| 369 |
|
progname, vp->name); |
| 370 |
|
do |
| 371 |
|
vp->value += strlen(vp->value)+1; |
| 466 |
|
} |
| 467 |
|
|
| 468 |
|
|
| 469 |
< |
unsigned long |
| 469 |
> |
time_t |
| 470 |
|
checklast(fnames) /* check files and find most recent */ |
| 471 |
|
register char *fnames; |
| 472 |
|
{ |
| 473 |
|
char thisfile[MAXPATH]; |
| 474 |
< |
unsigned long thisdate, lastdate = 0; |
| 474 |
> |
time_t thisdate, lastdate = 0; |
| 475 |
|
register char *cp; |
| 476 |
|
|
| 477 |
|
if (fnames == NULL) |
| 519 |
|
|
| 520 |
|
checkfiles() /* check for existence and modified times */ |
| 521 |
|
{ |
| 522 |
< |
unsigned long objdate; |
| 522 |
> |
time_t objdate; |
| 523 |
|
|
| 524 |
|
if (!vdef(OCTREE)) { |
| 525 |
|
if ((vval(OCTREE) = bmalloc(strlen(radname)+5)) == NULL) |
| 647 |
|
|
| 648 |
|
printvals() /* print variable values */ |
| 649 |
|
{ |
| 650 |
< |
register int i, j; |
| 650 |
> |
int i, j, clipline; |
| 651 |
> |
register char *cp; |
| 652 |
> |
register int k; |
| 653 |
|
|
| 654 |
< |
for (i = 0; i < NVARS; i++) |
| 655 |
< |
for (j = 0; j < vdef(i); j++) |
| 656 |
< |
printf("%s= %s\n", vnam(i), nvalue(vv+i, j)); |
| 654 |
> |
for (i = 0; i < NVARS; i++) /* print each variable */ |
| 655 |
> |
for (j = 0; j < vdef(i); j++) { /* print each assignment */ |
| 656 |
> |
fputs(vnam(i), stdout); |
| 657 |
> |
fputs("= ", stdout); |
| 658 |
> |
k = clipline = ( vv[i].fixval == catvalues ? 64 : 320 ) |
| 659 |
> |
- strlen(vnam(i)) ; |
| 660 |
> |
cp = nvalue(vv+i, j); |
| 661 |
> |
while (*cp) { |
| 662 |
> |
putchar(*cp++); |
| 663 |
> |
if (--k <= 0) { /* line too long */ |
| 664 |
> |
while (*cp && !isspace(*cp)) |
| 665 |
> |
putchar(*cp++); /* finish this word */ |
| 666 |
> |
if (*cp) { /* start new line */ |
| 667 |
> |
putchar('\n'); |
| 668 |
> |
fputs(vnam(i), stdout); |
| 669 |
> |
putchar('='); |
| 670 |
> |
k = clipline; |
| 671 |
> |
} |
| 672 |
> |
} |
| 673 |
> |
} |
| 674 |
> |
putchar('\n'); |
| 675 |
> |
} |
| 676 |
|
fflush(stdout); |
| 677 |
|
} |
| 678 |
|
|
| 699 |
|
unlink(vval(OCTREE)); |
| 700 |
|
exit(1); |
| 701 |
|
} |
| 702 |
< |
octreedate = time(0); |
| 702 |
> |
octreedate = time((time_t *)NULL); |
| 703 |
|
} |
| 704 |
|
if (oct1name == vval(OCTREE)) /* no mkillum? */ |
| 705 |
|
oct1date = octreedate > matdate ? octreedate : matdate; |
| 725 |
|
unlink(oct0name); |
| 726 |
|
exit(1); |
| 727 |
|
} |
| 728 |
< |
oct0date = time(0); |
| 728 |
> |
oct0date = time((time_t *)NULL); |
| 729 |
|
} |
| 730 |
|
mkillumopts(mkopts); /* build mkillum command */ |
| 731 |
|
mktemp(illumtmp); |
| 753 |
|
unlink(oct1name); |
| 754 |
|
exit(1); |
| 755 |
|
} |
| 756 |
< |
oct1date = time(0); |
| 756 |
> |
oct1date = time((time_t *)NULL); |
| 757 |
|
rmfile(illumtmp); |
| 758 |
|
} |
| 759 |
|
|
| 793 |
|
|
| 794 |
|
checkambfile() /* check date on ambient file */ |
| 795 |
|
{ |
| 796 |
< |
unsigned long afdate; |
| 796 |
> |
time_t afdate; |
| 797 |
|
|
| 798 |
|
if (!vdef(AMBFILE)) |
| 799 |
|
return; |