--- ray/src/util/rad.c 2003/07/03 18:03:58 2.67 +++ ray/src/util/rad.c 2003/07/21 22:30:19 2.70 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rad.c,v 2.67 2003/07/03 18:03:58 greg Exp $"; +static const char RCSid[] = "$Id: rad.c,v 2.70 2003/07/21 22:30:19 schorsch Exp $"; #endif /* * Executive program for oconv, rpict and pfilt @@ -8,12 +8,21 @@ static const char RCSid[] = "$Id: rad.c,v 2.67 2003/07 #include "standard.h" #include +#include #include "platform.h" #include "view.h" #include "paths.h" #include "vars.h" +#ifdef _WIN32 + #define DELCMD "del" + #define RENAMECMD "rename" +#else + #define DELCMD "rm -f" + #define RENAMECMD "mv" +#endif + /* variables (alphabetical by name) */ #define AMBFILE 0 /* ambient file name */ #define DETAIL 1 /* level of scene detail */ @@ -80,7 +89,6 @@ char overfile[] = NULL_DEVICE; char overfile[] = "overture.unf"; #endif -extern time_t time(); time_t scenedate; /* date of latest scene or object file */ time_t octreedate; /* date of octree */ @@ -310,7 +318,7 @@ double org[3], *sizp; FILE *fp; register int i; - if (osiz <= FTINY) + if (osiz <= FTINY) { if (!nprocs && fdate(oct1name) < (scenedate>illumdate?scenedate:illumdate)) { /* run getbbox */ @@ -346,6 +354,7 @@ double org[3], *sizp; } pclose(fp); } + } org[0] = oorg[0]; org[1] = oorg[1]; org[2] = oorg[2]; *sizp = osiz; } @@ -550,11 +559,12 @@ checkambfile() /* check date on ambient file */ return; if (!(afdate = fdate(vval(AMBFILE)))) return; - if (oct1date > afdate) + if (oct1date > afdate) { if (touchonly) touch(vval(AMBFILE)); else rmfile(vval(AMBFILE)); + } } @@ -1059,7 +1069,7 @@ again: goto again; } #endif - copystruct(&vwr, &stdview); + vwr = stdview; sscanview(&vwr, cp=vopts); /* set initial options */ while ((cp = strstr(cp, "-vf ")) != NULL && *atos(buf, sizeof(buf), cp += 4)) { @@ -1306,11 +1316,7 @@ rmfile(fn) /* remove a file */ char *fn; { if (!silent) -#ifdef _WIN32 - printf("\tdel %s\n", fn); -#else - printf("\trm -f %s\n", fn); -#endif + printf("\t%s %s\n", DELCMD, fn); if (!nprocs) return(0); return(unlink(fn)); @@ -1321,11 +1327,7 @@ mvfile(fold, fnew) /* move a file */ char *fold, *fnew; { if (!silent) -#ifdef _WIN32 - printf("\trename %s %s\n", fold, fnew); -#else - printf("\tmv %s %s\n", fold, fnew); -#endif + printf("\t%s %s %s\n", RENAMECMD, fold, fnew); if (!nprocs) return(0); return(rename(fold, fnew)); @@ -1398,6 +1400,12 @@ wait_process(all) int all; { (void)all; /* no one to wait for */ +} +int +kill(pid, sig) /* win|unix_process.c should also wait and kill */ +int pid, sig; +{ + return 0; } #endif /* ! RHAS_FORK_EXEC */