| 10 |
|
*/ |
| 11 |
|
|
| 12 |
|
#include <stdio.h> |
| 13 |
+ |
#include <string.h> |
| 14 |
|
#include <math.h> |
| 15 |
|
#include <sys/types.h> |
| 16 |
|
#include <ctype.h> |
| 79 |
|
#define U_METERS 2 |
| 80 |
|
/* string lengths */ |
| 81 |
|
#define MAXLINE 132 |
| 82 |
< |
#define MAXWORD 76 |
| 82 |
> |
#define RMAXWORD 76 |
| 83 |
|
/* file types */ |
| 84 |
|
#define T_RAD ".rad" |
| 85 |
|
#define T_DST ".dat" |
| 124 |
|
int gargc; /* global argc (minus filenames) */ |
| 125 |
|
char **gargv; /* global argv */ |
| 126 |
|
|
| 127 |
< |
extern char *strcpy(), *strcat(), *stradd(), *tailtrunc(), *filetrunc(), |
| 127 |
> |
extern char *stradd(), *tailtrunc(), *filetrunc(), |
| 128 |
|
*filename(), *libname(), *fullnam(), *getword(), *atos(); |
| 129 |
|
extern float *matchlamp(); |
| 130 |
|
extern time_t fdate(); |
| 140 |
|
{ |
| 141 |
|
char *outfile = NULL; |
| 142 |
|
int status; |
| 143 |
< |
char outname[MAXWORD]; |
| 143 |
> |
char outname[RMAXWORD]; |
| 144 |
|
double d1; |
| 145 |
|
int i; |
| 146 |
|
|
| 421 |
|
while (islower(*hdl) ? toupper(*hdl) == *kwd++ : *hdl == *kwd++) |
| 422 |
|
if (!*hdl++) |
| 423 |
|
return(0); |
| 424 |
< |
return(!*kwd & *hdl == ']'); |
| 424 |
> |
return((!*kwd) & (*hdl == ']')); |
| 425 |
|
} |
| 426 |
|
|
| 427 |
|
|
| 457 |
|
char *inpname, *outname; |
| 458 |
|
{ |
| 459 |
|
SRCINFO srcinfo; |
| 460 |
< |
char buf[MAXLINE], tltid[MAXWORD]; |
| 460 |
> |
char buf[MAXLINE], tltid[RMAXWORD]; |
| 461 |
|
char geomfile[128]; |
| 462 |
|
FILE *inpfp, *outfp; |
| 463 |
|
int lineno = 0; |
| 516 |
|
fprintf(stderr, "%s: not in IES format\n", inpname); |
| 517 |
|
goto readerr; |
| 518 |
|
} |
| 519 |
< |
atos(tltid, MAXWORD, buf+TLTSTRLEN); |
| 519 |
> |
atos(tltid, RMAXWORD, buf+TLTSTRLEN); |
| 520 |
|
if (inpfp == stdin) |
| 521 |
|
buf[0] = '\0'; |
| 522 |
|
else |
| 550 |
|
{ |
| 551 |
|
int nangles, tlt_type; |
| 552 |
|
double minmax[2]; |
| 553 |
< |
char buf[PATH_MAX], tltname[MAXWORD]; |
| 553 |
> |
char buf[PATH_MAX], tltname[RMAXWORD]; |
| 554 |
|
FILE *datin, *datout; |
| 555 |
|
|
| 556 |
|
if (!strcmp(tltspec, TLTNONE)) { |
| 622 |
|
FILE *in, *out; |
| 623 |
|
char *mod, *name; |
| 624 |
|
{ |
| 625 |
< |
char buf[PATH_MAX], id[MAXWORD]; |
| 625 |
> |
char buf[PATH_MAX], id[RMAXWORD]; |
| 626 |
|
FILE *datout; |
| 627 |
|
double mult, bfactor, pfactor, width, length, height, wattage; |
| 628 |
|
double bounds[2][2]; |
| 729 |
|
char *mod, *name; |
| 730 |
|
int dolower, doupper; |
| 731 |
|
{ |
| 732 |
< |
char lname[MAXWORD]; |
| 732 |
> |
char lname[RMAXWORD]; |
| 733 |
|
|
| 734 |
|
strcat(strcpy(lname, name), "_light"); |
| 735 |
|
fprintf(fp, "\n%s %s %s\n", mod, |
| 974 |
|
getword(fp) /* scan a word from fp */ |
| 975 |
|
register FILE *fp; |
| 976 |
|
{ |
| 977 |
< |
static char wrd[MAXWORD]; |
| 977 |
> |
static char wrd[RMAXWORD]; |
| 978 |
|
register char *cp; |
| 979 |
|
register int c; |
| 980 |
|
|
| 981 |
|
while (isspace(c=getc(fp))) |
| 982 |
|
; |
| 983 |
< |
for (cp = wrd; c != EOF && cp < wrd+MAXWORD-1; |
| 983 |
> |
for (cp = wrd; c != EOF && cp < wrd+RMAXWORD-1; |
| 984 |
|
*cp++ = c, c = getc(fp)) |
| 985 |
|
if (isspace(c) || c == ',') { |
| 986 |
|
while (isspace(c)) |
| 987 |
|
c = getc(fp); |
| 988 |
< |
if (c != EOF & c != ',') |
| 988 |
> |
if ((c != EOF) & (c != ',')) |
| 989 |
|
ungetc(c, fp); |
| 990 |
|
*cp = '\0'; |
| 991 |
|
return(wrd); |