| 281 |
|
return(0); |
| 282 |
|
while ((fnames = nextword(thisfile, PATH_MAX, fnames)) != NULL) { |
| 283 |
|
if (thisfile[0] == '!' || |
| 284 |
< |
(thisfile[0] == '\\' && thisfile[1] == '!')) |
| 284 |
> |
(thisfile[0] == '\\' && thisfile[1] == '!')) { |
| 285 |
> |
if (!lastdate) |
| 286 |
> |
lastdate = 1; |
| 287 |
|
continue; |
| 288 |
+ |
} |
| 289 |
|
if (!(thisdate = fdate(thisfile))) |
| 290 |
|
syserr(thisfile); |
| 291 |
|
if (thisdate > lastdate) |
| 472 |
|
oconv(void) /* run oconv and mkillum if necessary */ |
| 473 |
|
{ |
| 474 |
|
static char illumtmp[] = "ilXXXXXX"; |
| 475 |
< |
char combuf[PATH_MAX], ocopts[64], mkopts[64]; |
| 475 |
> |
char combuf[PATH_MAX], ocopts[64], mkopts[1024]; |
| 476 |
|
|
| 477 |
|
oconvopts(ocopts); /* get options */ |
| 478 |
|
if (octreedate < scenedate) { /* check date on original octree */ |
| 599 |
|
|
| 600 |
|
static void |
| 601 |
|
mkillumopts( /* get mkillum options */ |
| 602 |
< |
register char *mo |
| 602 |
> |
char *mo |
| 603 |
|
) |
| 604 |
|
{ |
| 605 |
|
/* BEWARE: This may be called via setdefaults(), so no assumptions */ |
| 606 |
|
|
| 607 |
< |
*mo = '\0'; |
| 607 |
> |
if (nprocs > 1) { |
| 608 |
> |
sprintf(mo, " -n %d", nprocs); |
| 609 |
> |
while (*mo) |
| 610 |
> |
mo++; |
| 611 |
> |
} else |
| 612 |
> |
*mo = '\0'; |
| 613 |
|
if (vdef(MKILLUM)) |
| 614 |
|
addarg(mo, vval(MKILLUM)); |
| 615 |
|
} |
| 1013 |
|
zpos = -1; vs++; |
| 1014 |
|
} |
| 1015 |
|
viewtype = 'v'; |
| 1016 |
< |
if((*vs == 'v') | (*vs == 'l') | (*vs == 'a') | (*vs == 'h') | (*vs == 'c')) |
| 1016 |
> |
if ((*vs == 'v') | (*vs == 'l') | (*vs == 'a') | |
| 1017 |
> |
(*vs == 'h') | (*vs == 'c') | (*vs == 's')) |
| 1018 |
|
viewtype = *vs++; |
| 1019 |
|
cp = viewopts; |
| 1020 |
|
if ((!*vs || isspace(*vs)) && (xpos|ypos|zpos)) { /* got one! */ |
| 1146 |
|
VIEW vwr; |
| 1147 |
|
char buf[128]; |
| 1148 |
|
register char *cp; |
| 1149 |
+ |
#ifdef _WIN32 |
| 1150 |
+ |
/* XXX Should we allow something like this for all platforms? */ |
| 1151 |
+ |
/* XXX Or is it still required at all? */ |
| 1152 |
+ |
again: |
| 1153 |
+ |
#endif |
| 1154 |
|
if (vopts == NULL) |
| 1155 |
|
return(-1); |
| 1156 |
|
#ifdef _WIN32 |
| 1323 |
|
/* rpict persistent mode */ |
| 1324 |
|
if (!silent) |
| 1325 |
|
printf("\t%s\n", combuf); |
| 1326 |
+ |
fflush(stdout); |
| 1327 |
|
sprintf(combuf, "rpict%s %s %s%s%s %s > %s", |
| 1328 |
|
rep, rppopt, res, po, opts, |
| 1329 |
|
oct1name, rawfile); |
| 1315 |
– |
fflush(stdout); |
| 1330 |
|
fp = popen(combuf, "w"); |
| 1331 |
|
if (fp == NULL) |
| 1332 |
|
goto rperror; |
| 1364 |
|
} |
| 1365 |
|
wait_process(1); /* wait for children to finish */ |
| 1366 |
|
if (pfile != NULL) { /* clean up rpict persistent mode */ |
| 1367 |
< |
int pid; |
| 1367 |
> |
RT_PID pid; |
| 1368 |
|
fp = fopen(pfile, "r"); |
| 1369 |
|
if (fp != NULL) { |
| 1370 |
|
if (fscanf(fp, "%*s %d", &pid) != 1 || |
| 1407 |
|
printf("\t%s\n", cs); |
| 1408 |
|
if (!nprocs) |
| 1409 |
|
return(0); |
| 1410 |
< |
fflush(stdout); /* flush output and pass to shell */ |
| 1410 |
> |
fflush(NULL); /* flush output and pass to shell */ |
| 1411 |
|
return(system(cs)); |
| 1412 |
|
} |
| 1413 |
|
|
| 1443 |
|
static int |
| 1444 |
|
next_process(void) /* fork the next process (max. nprocs) */ |
| 1445 |
|
{ |
| 1446 |
< |
int child_pid; |
| 1446 |
> |
RT_PID child_pid; |
| 1447 |
|
|
| 1448 |
|
if (nprocs <= 1) |
| 1449 |
|
return(0); /* it's us or no one */ |
| 1454 |
|
} |
| 1455 |
|
if (children_running >= nprocs) |
| 1456 |
|
wait_process(0); /* wait for someone to finish */ |
| 1457 |
< |
fflush(stdout); |
| 1457 |
> |
fflush(NULL); /* flush output */ |
| 1458 |
|
child_pid = fork(); /* split process */ |
| 1459 |
|
if (child_pid == 0) { /* we're the child */ |
| 1460 |
|
children_running = -1; |
| 1474 |
|
) |
| 1475 |
|
{ |
| 1476 |
|
int ourstatus = 0; |
| 1477 |
< |
int pid, status; |
| 1477 |
> |
RT_PID pid, status; |
| 1478 |
|
|
| 1479 |
|
if (all) |
| 1480 |
|
all = children_running; |
| 1511 |
|
} |
| 1512 |
|
int |
| 1513 |
|
kill(pid, sig) /* win|unix_process.c should also wait and kill */ |
| 1514 |
< |
int pid, sig; |
| 1514 |
> |
RT_PID pid, sig; |
| 1515 |
|
{ |
| 1516 |
|
return 0; |
| 1517 |
|
} |