1 |
|
#ifndef lint |
2 |
< |
static const char RCSid[] = "$Id$"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
4 |
|
/* |
5 |
|
* Radiance animation control program |
13 |
|
* See the ranimate(1) man page for further details. |
14 |
|
*/ |
15 |
|
|
16 |
< |
/* ==================================================================== |
17 |
< |
* The Radiance Software License, Version 1.0 |
18 |
< |
* |
19 |
< |
* Copyright (c) 1990 - 2002 The Regents of the University of California, |
20 |
< |
* through Lawrence Berkeley National Laboratory. All rights reserved. |
21 |
< |
* |
22 |
< |
* Redistribution and use in source and binary forms, with or without |
23 |
< |
* modification, are permitted provided that the following conditions |
24 |
< |
* are met: |
25 |
< |
* |
26 |
< |
* 1. Redistributions of source code must retain the above copyright |
27 |
< |
* notice, this list of conditions and the following disclaimer. |
28 |
< |
* |
29 |
< |
* 2. Redistributions in binary form must reproduce the above copyright |
30 |
< |
* notice, this list of conditions and the following disclaimer in |
31 |
< |
* the documentation and/or other materials provided with the |
32 |
< |
* distribution. |
33 |
< |
* |
34 |
< |
* 3. The end-user documentation included with the redistribution, |
35 |
< |
* if any, must include the following acknowledgment: |
36 |
< |
* "This product includes Radiance software |
37 |
< |
* (http://radsite.lbl.gov/) |
38 |
< |
* developed by the Lawrence Berkeley National Laboratory |
39 |
< |
* (http://www.lbl.gov/)." |
40 |
< |
* Alternately, this acknowledgment may appear in the software itself, |
41 |
< |
* if and wherever such third-party acknowledgments normally appear. |
42 |
< |
* |
43 |
< |
* 4. The names "Radiance," "Lawrence Berkeley National Laboratory" |
44 |
< |
* and "The Regents of the University of California" must |
45 |
< |
* not be used to endorse or promote products derived from this |
46 |
< |
* software without prior written permission. For written |
47 |
< |
* permission, please contact [email protected]. |
48 |
< |
* |
49 |
< |
* 5. Products derived from this software may not be called "Radiance", |
50 |
< |
* nor may "Radiance" appear in their name, without prior written |
51 |
< |
* permission of Lawrence Berkeley National Laboratory. |
52 |
< |
* |
53 |
< |
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
54 |
< |
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
55 |
< |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
56 |
< |
* DISCLAIMED. IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR |
57 |
< |
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
58 |
< |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
59 |
< |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
60 |
< |
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
61 |
< |
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
62 |
< |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
63 |
< |
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
64 |
< |
* SUCH DAMAGE. |
65 |
< |
* ==================================================================== |
66 |
< |
* |
67 |
< |
* This software consists of voluntary contributions made by many |
68 |
< |
* individuals on behalf of Lawrence Berkeley National Laboratory. For more |
69 |
< |
* information on Lawrence Berkeley National Laboratory, please see |
70 |
< |
* <http://www.lbl.gov/>. |
71 |
< |
*/ |
16 |
> |
#include "copyright.h" |
17 |
|
|
18 |
< |
#include "standard.h" |
18 |
> |
#include <stdio.h> |
19 |
|
#include <ctype.h> |
20 |
|
#include <sys/stat.h> |
21 |
+ |
#include <time.h> |
22 |
+ |
|
23 |
+ |
/*#include "standard.h"*/ |
24 |
+ |
#include "platform.h" |
25 |
+ |
#include "paths.h" |
26 |
+ |
#include "rtio.h" |
27 |
+ |
#include "rterror.h" |
28 |
|
#include "view.h" |
29 |
|
#include "vars.h" |
30 |
|
#include "netproc.h" |
33 |
|
#define DEF_NBLUR 5 |
34 |
|
#endif |
35 |
|
/* default remote shell */ |
84 |
– |
#ifdef _AUX_SOURCE |
85 |
– |
#define REMSH "remsh" |
86 |
– |
#else |
36 |
|
#define REMSH "rsh" |
88 |
– |
#endif |
37 |
|
/* input variables (alphabetical by name) */ |
38 |
|
#define ANIMATE 0 /* animation command */ |
39 |
|
#define ARCHIVE 1 /* archiving command */ |
122 |
|
int npslots; /* number of process slots */ |
123 |
|
|
124 |
|
#define phostname(ps) ((ps)->hostname[0] ? (ps)->hostname : astat.host) |
177 |
– |
|
178 |
– |
struct pslot *findpslot(); |
179 |
– |
|
125 |
|
PSERVER *lastpserver; /* last process server with error */ |
126 |
|
|
127 |
< |
VIEW *getview(); |
128 |
< |
char *getexp(), *dirfile(); |
129 |
< |
int getblur(); |
127 |
> |
static struct pslot * findpslot(int pid); |
128 |
> |
static void checkdir(void); |
129 |
> |
static VIEW * getview(int n); |
130 |
|
|
131 |
< |
extern time_t time(); |
131 |
> |
static char * dirfile(char *df, register char *path); |
132 |
> |
static char * getexp(int n); |
133 |
> |
static int getblur(double *bf); |
134 |
> |
static int getastat(void); |
135 |
> |
static void getradfile(char *rfargs); |
136 |
> |
static void badvalue(int vc); |
137 |
> |
static int rmfile(char *fn); |
138 |
> |
static int runcom(char *cs); |
139 |
> |
static int pruncom(char *com, char *ppins, int maxcopies); |
140 |
> |
static void bwait(int ncoms); |
141 |
> |
static int bruncom(char *com, int fout, int (*rf)()); |
142 |
> |
static int serverdown(void); |
143 |
> |
static int donecom(PSERVER *ps, int pn, int status); |
144 |
> |
static int countviews(void); |
145 |
> |
static int dofilt(int frame, int rvr); |
146 |
> |
static void archive(void); |
147 |
> |
static int frecover(int frame); |
148 |
> |
static int recover(int frame); |
149 |
> |
static void sethosts(void); |
150 |
> |
static void walkwait(int first, int last, char *vfn); |
151 |
> |
static void animrend(int frame, VIEW *vp); |
152 |
> |
static void transferframes(void); |
153 |
> |
static void filterframes(void); |
154 |
> |
static void renderframes(int nframes); |
155 |
> |
static void animate(void); |
156 |
> |
static void setdefaults(void); |
157 |
> |
static void putastat(void); |
158 |
|
|
159 |
|
|
160 |
|
main(argc, argv) |
228 |
|
} |
229 |
|
|
230 |
|
|
231 |
< |
getastat() /* check/set animation status */ |
231 |
> |
static int |
232 |
> |
getastat(void) /* check/set animation status */ |
233 |
|
{ |
234 |
|
char sfname[256]; |
235 |
|
FILE *fp; |
293 |
|
} |
294 |
|
|
295 |
|
|
296 |
< |
putastat() /* put out current status */ |
296 |
> |
static void |
297 |
> |
putastat(void) /* put out current status */ |
298 |
|
{ |
299 |
|
char buf[256]; |
300 |
|
FILE *fp; |
316 |
|
} |
317 |
|
|
318 |
|
|
319 |
< |
checkdir() /* make sure we have our directory */ |
319 |
> |
static void |
320 |
> |
checkdir(void) /* make sure we have our directory */ |
321 |
|
{ |
322 |
|
struct stat stb; |
323 |
|
|
339 |
|
} |
340 |
|
|
341 |
|
|
342 |
< |
setdefaults() /* set default values */ |
342 |
> |
static void |
343 |
> |
setdefaults(void) /* set default values */ |
344 |
|
{ |
345 |
|
extern char *atos(); |
346 |
|
int decades; |
428 |
|
} |
429 |
|
|
430 |
|
|
431 |
< |
sethosts() /* set up process servers */ |
431 |
> |
static void |
432 |
> |
sethosts(void) /* set up process servers */ |
433 |
|
{ |
434 |
|
extern char *iskip(); |
435 |
|
char buf[256], *dir, *uname; |
484 |
|
} |
485 |
|
} |
486 |
|
|
487 |
< |
|
488 |
< |
getradfile(rfargs) /* run rad and get needed variables */ |
513 |
< |
char *rfargs; |
487 |
> |
static void |
488 |
> |
getradfile(char *rfargs) /* run rad and get needed variables */ |
489 |
|
{ |
490 |
|
static short mvar[] = {OCTREE,PFILT,RESOLUTION,EXPOSURE,-1}; |
491 |
|
char combuf[256]; |
510 |
|
pippt = NULL; |
511 |
|
} |
512 |
|
if (pippt != NULL) |
513 |
< |
strcpy(pippt, "> /dev/null"); /* nothing to match */ |
513 |
> |
strcpy(pippt, "> " NULL_DEVICE); /* nothing to match */ |
514 |
|
else { |
515 |
|
sprintf(cp, ")[ \t]*=' > %s/radset.var", vval(DIRECTORY)); |
516 |
|
cp += 11; /* point to file name */ |
523 |
|
} |
524 |
|
|
525 |
|
|
526 |
< |
animate() /* run animation */ |
526 |
> |
static void |
527 |
> |
animate(void) /* run animation */ |
528 |
|
{ |
529 |
|
int xres, yres; |
530 |
|
float pa, mult; |
595 |
|
} |
596 |
|
|
597 |
|
|
598 |
< |
renderframes(nframes) /* render next nframes frames */ |
599 |
< |
int nframes; |
598 |
> |
static void |
599 |
> |
renderframes(int nframes) /* render next nframes frames */ |
600 |
|
{ |
601 |
|
static char vendbuf[16]; |
602 |
|
VIEW *vp; |
652 |
|
} |
653 |
|
|
654 |
|
|
655 |
< |
filterframes() /* catch up with filtering */ |
655 |
> |
static void |
656 |
> |
filterframes(void) /* catch up with filtering */ |
657 |
|
{ |
658 |
|
VIEW *vp; |
659 |
|
register int i; |
661 |
|
if (astat.tnext < astat.fnext) /* other work to do first */ |
662 |
|
return; |
663 |
|
/* filter each view */ |
664 |
< |
for (i = astat.fnext; i < astat.rnext; i++) { |
665 |
< |
if ((vp = getview(i)) == NULL) { /* get view i */ |
666 |
< |
fprintf(stderr, |
690 |
< |
"%s: unexpected error reading view for frame %d\n", |
691 |
< |
progname, i); |
692 |
< |
quit(1); |
693 |
< |
} |
694 |
< |
dofilt(i, vp, getexp(i), 0); /* filter frame */ |
695 |
< |
} |
664 |
> |
for (i = astat.fnext; i < astat.rnext; i++) |
665 |
> |
dofilt(i, 0); |
666 |
> |
|
667 |
|
bwait(0); /* wait for filter processes */ |
668 |
|
archive(); /* archive originals */ |
669 |
|
astat.fnext = i; /* update status */ |
671 |
|
} |
672 |
|
|
673 |
|
|
674 |
< |
transferframes() /* catch up with picture transfers */ |
674 |
> |
static void |
675 |
> |
transferframes(void) /* catch up with picture transfers */ |
676 |
|
{ |
677 |
|
char combuf[10240], *fbase; |
678 |
|
register char *cp; |
712 |
|
} |
713 |
|
|
714 |
|
|
715 |
< |
animrend(frame, vp) /* start animation frame */ |
716 |
< |
int frame; |
717 |
< |
VIEW *vp; |
715 |
> |
static void |
716 |
> |
animrend( /* start animation frame */ |
717 |
> |
int frame, |
718 |
> |
VIEW *vp |
719 |
> |
) |
720 |
|
{ |
747 |
– |
extern int recover(); |
721 |
|
char combuf[2048]; |
722 |
|
char fname[128]; |
723 |
|
|
731 |
|
} |
732 |
|
|
733 |
|
|
734 |
< |
walkwait(first, last, vfn) /* walk-through frames */ |
735 |
< |
int first, last; |
736 |
< |
char *vfn; |
734 |
> |
static void |
735 |
> |
walkwait( /* walk-through frames */ |
736 |
> |
int first, |
737 |
> |
int last, |
738 |
> |
char *vfn |
739 |
> |
) |
740 |
|
{ |
741 |
|
double blurf; |
742 |
|
int nblur = getblur(&blurf); |
786 |
|
} |
787 |
|
|
788 |
|
|
789 |
< |
int |
790 |
< |
recover(frame) /* recover the specified frame */ |
815 |
< |
int frame; |
789 |
> |
static int |
790 |
> |
recover(int frame) /* recover the specified frame */ |
791 |
|
{ |
792 |
|
static int *rfrm; /* list of recovered frames */ |
793 |
|
static int nrfrms = 0; |
828 |
|
return(1); |
829 |
|
/* add frame to recovered list */ |
830 |
|
if (nrfrms) |
831 |
< |
rfrm = (int *)realloc((char *)rfrm, (nrfrms+1)*sizeof(int)); |
831 |
> |
rfrm = (int *)realloc((void *)rfrm, (nrfrms+1)*sizeof(int)); |
832 |
|
else |
833 |
|
rfrm = (int *)malloc(sizeof(int)); |
834 |
|
if (rfrm == NULL) { |
840 |
|
} |
841 |
|
|
842 |
|
|
843 |
< |
int |
844 |
< |
frecover(frame) /* recover filtered frame */ |
870 |
< |
int frame; |
843 |
> |
static int |
844 |
> |
frecover(int frame) /* recover filtered frame */ |
845 |
|
{ |
846 |
< |
VIEW *vp; |
873 |
< |
char *ex; |
874 |
< |
|
875 |
< |
vp = getview(frame); |
876 |
< |
ex = getexp(frame); |
877 |
< |
if (dofilt(frame, vp, ex, 2) && dofilt(frame, vp, ex, 1)) |
846 |
> |
if (dofilt(frame, 2) && dofilt(frame, 1)) |
847 |
|
return(1); |
848 |
|
return(0); |
849 |
|
} |
850 |
|
|
851 |
|
|
852 |
< |
archive() /* archive and remove renderings */ |
852 |
> |
static void |
853 |
> |
archive(void) /* archive and remove renderings */ |
854 |
|
{ |
855 |
|
#define RMCOML (sizeof(rmcom)-1) |
856 |
|
static char rmcom[] = "rm -f"; |
893 |
|
} |
894 |
|
|
895 |
|
|
896 |
< |
int |
897 |
< |
dofilt(frame, vp, ep, rvr) /* filter frame */ |
898 |
< |
int frame; |
899 |
< |
VIEW *vp; |
900 |
< |
char *ep; |
931 |
< |
int rvr; |
896 |
> |
static int |
897 |
> |
dofilt( /* filter frame */ |
898 |
> |
int frame, |
899 |
> |
int rvr |
900 |
> |
) |
901 |
|
{ |
933 |
– |
extern int frecover(); |
902 |
|
static int iter = 0; |
903 |
|
double blurf; |
904 |
|
int nblur = getblur(&blurf); |
905 |
+ |
VIEW *vp = getview(frame); |
906 |
+ |
char *ep = getexp(frame); |
907 |
|
char fnbefore[128], fnafter[128], *fbase; |
908 |
|
char combuf[1024], fname0[128], fname1[128]; |
909 |
|
int usepinterp, usepfilt, nora_rgbe; |
910 |
|
int frseq[2]; |
911 |
|
/* check what is needed */ |
912 |
+ |
if (vp == NULL) { |
913 |
+ |
fprintf(stderr, |
914 |
+ |
"%s: unexpected error reading view for frame %d\n", |
915 |
+ |
progname, frame); |
916 |
+ |
quit(1); |
917 |
+ |
} |
918 |
+ |
if (ep == NULL) { |
919 |
+ |
fprintf(stderr, |
920 |
+ |
"%s: unexpected error reading exposure for frame %d\n", |
921 |
+ |
progname, frame); |
922 |
+ |
quit(1); |
923 |
+ |
} |
924 |
|
usepinterp = (nblur > 1); |
925 |
< |
usepfilt = pfiltalways | ep==NULL; |
925 |
> |
usepfilt = pfiltalways | (ep==NULL); |
926 |
|
if (ep != NULL && !strcmp(ep, "1")) |
927 |
|
ep = "+0"; |
928 |
|
nora_rgbe = strcmp(vval(OVERSAMP),"1") || ep==NULL || |
993 |
|
putc('\n', fp); fclose(fp); |
994 |
|
} |
995 |
|
sprintf(combuf, |
996 |
< |
"(pmblur %.3f %d %s %s; rm -f %s %s) | pinterp -B", |
996 |
> |
"(pmblur %.3f %d %s %s; rm -f %s %s) | pinterp -B -a", |
997 |
|
blurf, nblur, |
998 |
|
fname0, fname1, fname0, fname1); |
999 |
|
iter++; |
1008 |
|
if (usepfilt) |
1009 |
|
sprintf(combuf+strlen(combuf), " %s", rresopt); |
1010 |
|
else |
1011 |
< |
sprintf(combuf+strlen(combuf), " %s -e %s", |
1011 |
> |
sprintf(combuf+strlen(combuf), " -a %s -e %s", |
1012 |
|
fresopt, ep); |
1013 |
|
sprintf(combuf+strlen(combuf), " %s.unf %s.zbf", |
1014 |
|
fnbefore, fnbefore); |
1055 |
|
} |
1056 |
|
|
1057 |
|
|
1058 |
< |
VIEW * |
1059 |
< |
getview(n) /* get view number n */ |
1078 |
< |
int n; |
1058 |
> |
static VIEW * |
1059 |
> |
getview(int n) /* get view number n */ |
1060 |
|
{ |
1061 |
|
static FILE *viewfp = NULL; /* view file pointer */ |
1062 |
|
static int viewnum = 0; /* current view number */ |
1068 |
|
fclose(viewfp); |
1069 |
|
viewfp = NULL; |
1070 |
|
viewnum = 0; |
1071 |
< |
copystruct(&curview, &stdview); |
1071 |
> |
curview = stdview; |
1072 |
|
} |
1073 |
|
return(NULL); |
1074 |
|
} |
1084 |
|
perror(vval(VIEWFILE)); |
1085 |
|
quit(1); |
1086 |
|
} |
1087 |
< |
copystruct(&curview, &stdview); |
1087 |
> |
curview = stdview; |
1088 |
|
viewnum = 0; |
1089 |
|
} |
1090 |
|
if (n < 0) { /* get next view */ |
1104 |
|
} |
1105 |
|
|
1106 |
|
|
1107 |
< |
int |
1108 |
< |
countviews() /* count views in view file */ |
1107 |
> |
static int |
1108 |
> |
countviews(void) /* count views in view file */ |
1109 |
|
{ |
1110 |
|
int n; |
1111 |
|
|
1117 |
|
} |
1118 |
|
|
1119 |
|
|
1120 |
< |
char * |
1121 |
< |
getexp(n) /* get exposure for nth frame */ |
1141 |
< |
int n; |
1120 |
> |
static char * |
1121 |
> |
getexp(int n) /* get exposure for nth frame */ |
1122 |
|
{ |
1123 |
|
extern char *fskip(); |
1124 |
|
static char expval[32]; |
1187 |
|
} |
1188 |
|
|
1189 |
|
|
1190 |
< |
struct pslot * |
1191 |
< |
findpslot(pid) /* find or allocate a process slot */ |
1212 |
< |
int pid; |
1190 |
> |
static struct pslot * |
1191 |
> |
findpslot(int pid) /* find or allocate a process slot */ |
1192 |
|
{ |
1193 |
|
register struct pslot *psempty = NULL; |
1194 |
|
register int i; |
1203 |
|
} |
1204 |
|
|
1205 |
|
|
1206 |
< |
int |
1207 |
< |
donecom(ps, pn, status) /* clean up after finished process */ |
1208 |
< |
PSERVER *ps; |
1209 |
< |
int pn; |
1210 |
< |
int status; |
1206 |
> |
static int |
1207 |
> |
donecom( /* clean up after finished process */ |
1208 |
> |
PSERVER *ps, |
1209 |
> |
int pn, |
1210 |
> |
int status |
1211 |
> |
) |
1212 |
|
{ |
1213 |
< |
register PROC *pp; |
1213 |
> |
register NETPROC *pp; |
1214 |
|
register struct pslot *psl; |
1215 |
|
|
1216 |
|
pp = ps->proc + pn; |
1245 |
|
} |
1246 |
|
|
1247 |
|
|
1248 |
< |
int |
1249 |
< |
serverdown() /* check status of last process server */ |
1248 |
> |
static int |
1249 |
> |
serverdown(void) /* check status of last process server */ |
1250 |
|
{ |
1251 |
|
if (lastpserver == NULL || !lastpserver->hostname[0]) |
1252 |
|
return(0); |
1262 |
|
} |
1263 |
|
|
1264 |
|
|
1265 |
< |
int |
1266 |
< |
bruncom(com, fout, rf) /* run a command in the background */ |
1267 |
< |
char *com; |
1268 |
< |
int fout; |
1269 |
< |
int (*rf)(); |
1265 |
> |
static int |
1266 |
> |
bruncom( /* run a command in the background */ |
1267 |
> |
char *com, |
1268 |
> |
int fout, |
1269 |
> |
int (*rf)() |
1270 |
> |
) |
1271 |
|
{ |
1272 |
|
int pid; |
1273 |
|
register struct pslot *psl; |
1296 |
|
} |
1297 |
|
|
1298 |
|
|
1299 |
< |
bwait(ncoms) /* wait for batch job(s) to finish */ |
1300 |
< |
int ncoms; |
1299 |
> |
static void |
1300 |
> |
bwait(int ncoms) /* wait for batch job(s) to finish */ |
1301 |
|
{ |
1302 |
|
int status; |
1303 |
|
|
1311 |
|
} |
1312 |
|
|
1313 |
|
|
1314 |
< |
int |
1315 |
< |
pruncom(com, ppins, maxcopies) /* run a command in parallel over network */ |
1316 |
< |
char *com, *ppins; |
1317 |
< |
int maxcopies; |
1314 |
> |
static int |
1315 |
> |
pruncom( /* run a command in parallel over network */ |
1316 |
> |
char *com, |
1317 |
> |
char *ppins, |
1318 |
> |
int maxcopies |
1319 |
> |
) |
1320 |
|
{ |
1321 |
|
int retstatus = 0; |
1322 |
|
int hostcopies; |
1338 |
|
strcpy(com1=buf, com); /* build -PP command */ |
1339 |
|
sprintf(com1+(ppins-com), " -PP %s/%s.persist", |
1340 |
|
vval(DIRECTORY), phostname(ps)); |
1341 |
+ |
unlink(com1+(ppins-com)+5); |
1342 |
|
strcat(com1, ppins); |
1343 |
|
} else |
1344 |
|
com1 = com; |
1383 |
|
} |
1384 |
|
|
1385 |
|
|
1386 |
< |
runcom(cs) /* run a command locally and wait for it */ |
1387 |
< |
char *cs; |
1386 |
> |
static int |
1387 |
> |
runcom(char *cs) /* run a command locally and wait for it */ |
1388 |
|
{ |
1389 |
|
if (!silent) /* echo it */ |
1390 |
|
printf("\t%s\n", cs); |
1395 |
|
} |
1396 |
|
|
1397 |
|
|
1398 |
< |
rmfile(fn) /* remove a file */ |
1399 |
< |
char *fn; |
1398 |
> |
static int |
1399 |
> |
rmfile(char *fn) /* remove a file */ |
1400 |
|
{ |
1401 |
|
if (!silent) |
1402 |
< |
#ifdef MSDOS |
1402 |
> |
#ifdef _WIN32 |
1403 |
|
printf("\tdel %s\n", fn); |
1404 |
|
#else |
1405 |
|
printf("\trm -f %s\n", fn); |
1410 |
|
} |
1411 |
|
|
1412 |
|
|
1413 |
< |
badvalue(vc) /* report bad variable value and exit */ |
1414 |
< |
int vc; |
1413 |
> |
static void |
1414 |
> |
badvalue(int vc) /* report bad variable value and exit */ |
1415 |
|
{ |
1416 |
|
fprintf(stderr, "%s: bad value for variable '%s'\n", |
1417 |
|
progname, vnam(vc)); |
1419 |
|
} |
1420 |
|
|
1421 |
|
|
1422 |
< |
char * |
1423 |
< |
dirfile(df, path) /* separate path into directory and file */ |
1424 |
< |
char *df; |
1425 |
< |
register char *path; |
1422 |
> |
static char * |
1423 |
> |
dirfile( /* separate path into directory and file */ |
1424 |
> |
char *df, |
1425 |
> |
register char *path |
1426 |
> |
) |
1427 |
|
{ |
1428 |
|
register int i; |
1429 |
|
int psep; |
1431 |
|
for (i = 0, psep = -1; path[i]; i++) |
1432 |
|
if (path[i] == '/') |
1433 |
|
psep = i; |
1434 |
< |
if (df != NULL) |
1434 |
> |
if (df != NULL) { |
1435 |
|
if (psep == 0) { |
1436 |
|
df[0] = '/'; |
1437 |
|
df[1] = '\0'; |
1440 |
|
df[psep] = '\0'; |
1441 |
|
} else |
1442 |
|
df[0] = '\0'; |
1443 |
+ |
} |
1444 |
|
return(path+psep+1); |
1445 |
|
} |
1446 |
|
|
1447 |
|
|
1448 |
< |
int |
1448 |
> |
static int |
1449 |
|
getblur(double *bf) /* get # blur samples (and fraction) */ |
1450 |
|
{ |
1451 |
|
double blurf; |