--- ray/src/gen/mkillum.c 1997/10/20 16:37:14 2.10 +++ ray/src/gen/mkillum.c 2003/06/08 12:03:10 2.13 @@ -1,19 +1,17 @@ -/* Copyright (c) 1995 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: mkillum.c,v 2.13 2003/06/08 12:03:10 schorsch Exp $"; #endif - /* * Make illum sources for optimizing rendering process */ -#include "mkillum.h" - #include - #include +#include +#include "platform.h" +#include "mkillum.h" + /* default parameters */ #define SAMPDENS 48 /* points per projected steradian */ #define NSAMPS 32 /* samples per point */ @@ -60,16 +58,11 @@ int doneheader = 0; /* printed header yet? */ int warnings = 1; /* print warnings? */ -extern char *fgetline(), *fgetword(), *sskip(), - *atos(), *iskip(), *fskip(), *strcpy(); -extern FILE *popen(); - main(argc, argv) /* compute illum distributions using rtrace */ int argc; char *argv[]; { - extern char *getenv(), *getpath(); char *rtpath; FILE *fp; register int i; @@ -138,6 +131,7 @@ char *argv[]; } +void quit(status) /* exit with status */ int status; { @@ -163,7 +157,9 @@ init() /* start rtrace and set up buffers */ ofun[OBJ_SPHERE].funp = o_sphere; ofun[OBJ_RING].funp = o_ring; /* set up signal handling */ +#ifndef _WIN32 /* XXX what do we use instead? */ signal(SIGPIPE, quit); +#endif /* start rtrace process */ errno = 0; maxbytes = open_process(rt.pd, rtargv); @@ -185,6 +181,7 @@ init() /* start rtrace and set up buffers */ } +void eputs(s) /* put string to stderr */ register char *s; { @@ -200,6 +197,7 @@ register char *s; } +void wputs(s) /* print warning if enabled */ char *s; { @@ -259,6 +257,8 @@ char *nm; case ' ': case '\t': case '\n': + case '\r': + case '\f': cp++; continue; case 'm': /* material name */ @@ -326,7 +326,7 @@ char *nm; case 'd': /* point sample density */ if (*++cp != '=') break; - if (!isintd(++cp, " \t\n")) + if (!isintd(++cp, " \t\n\r")) break; thisillum.sampdens = atoi(cp); cp = sskip(cp); @@ -334,7 +334,7 @@ char *nm; case 's': /* point super-samples */ if (*++cp != '=') break; - if (!isintd(++cp, " \t\n")) + if (!isintd(++cp, " \t\n\r")) break; thisillum.nsamps = atoi(cp); cp = sskip(cp); @@ -352,7 +352,7 @@ char *nm; case 'b': /* brightness */ if (*++cp != '=') break; - if (!isfltd(++cp, " \t\n")) + if (!isfltd(++cp, " \t\n\r")) break; thisillum.minbrt = atof(cp); if (thisillum.minbrt < 0.) @@ -447,10 +447,10 @@ char *nm; if (fgetword(str, MAXSTR, fp) == NULL) goto readerr; /* is it an alias? */ - if (!strcmp(str, ALIASID)) { + if (!strcmp(str, ALIASKEY)) { if (fgetword(str, MAXSTR, fp) == NULL) goto readerr; - printf("\n%s %s %s", thisillum.altmat, ALIASID, str); + printf("\n%s %s %s", thisillum.altmat, ALIASKEY, str); if (fgetword(str, MAXSTR, fp) == NULL) goto readerr; printf("\t%s\n", str);