| 11 |
|
#include <time.h> |
| 12 |
|
|
| 13 |
|
#include "platform.h" |
| 14 |
– |
#include "paths.h" |
| 14 |
|
#include "standard.h" |
| 15 |
|
#include "octree.h" |
| 16 |
|
#include "object.h" |
| 126 |
|
} |
| 127 |
|
} |
| 128 |
|
/* close the input */ |
| 129 |
< |
if (infn[0] == '!') |
| 130 |
< |
pclose(infp); |
| 131 |
< |
else if (infp != stdin) |
| 129 |
> |
if (inpspec[0] == '!') { |
| 130 |
> |
if (pclose(infp) != 0) { |
| 131 |
> |
sprintf(errmsg, "bad status from \"%s\"", inpspec); |
| 132 |
> |
error(WARNING, errmsg); |
| 133 |
> |
} |
| 134 |
> |
} else if (infp != stdin) |
| 135 |
|
fclose(infp); |
| 136 |
|
#ifdef getc_unlocked |
| 137 |
|
else |
| 144 |
|
static char * |
| 145 |
|
ogetstr(char *s) /* get null-terminated string */ |
| 146 |
|
{ |
| 145 |
– |
extern char *getstr(); |
| 146 |
– |
|
| 147 |
|
if (getstr(s, infp) == NULL) |
| 148 |
|
octerror(USER, "truncated octree"); |
| 149 |
|
return(s); |
| 154 |
|
getfullnode() /* get a set, return fullnode */ |
| 155 |
|
{ |
| 156 |
|
OBJECT set[MAXSET+1]; |
| 157 |
< |
register int i; |
| 158 |
< |
register long m; |
| 157 |
> |
int i; |
| 158 |
> |
long m; |
| 159 |
|
|
| 160 |
|
if ((set[0] = ogetint(objsize)) > MAXSET) |
| 161 |
|
octerror(USER, "bad set in getfullnode"); |
| 171 |
|
static long |
| 172 |
|
ogetint(int siz) /* get a siz-byte integer */ |
| 173 |
|
{ |
| 174 |
< |
extern long getint(); |
| 175 |
< |
register long r; |
| 174 |
> |
long r; |
| 175 |
|
|
| 176 |
|
r = getint(siz, infp); |
| 177 |
|
if (feof(infp)) |
| 183 |
|
static double |
| 184 |
|
ogetflt() /* get a floating point number */ |
| 185 |
|
{ |
| 187 |
– |
extern double getflt(); |
| 186 |
|
double r; |
| 187 |
|
|
| 188 |
|
r = getflt(infp); |
| 195 |
|
static OCTREE |
| 196 |
|
gettree() /* get a pre-ordered octree */ |
| 197 |
|
{ |
| 198 |
< |
register OCTREE ot; |
| 199 |
< |
register int i; |
| 198 |
> |
OCTREE ot; |
| 199 |
> |
int i; |
| 200 |
|
|
| 201 |
|
switch (getc(infp)) { |
| 202 |
|
case OT_EMPTY: |
| 222 |
|
nonsurfintree(OCTREE ot) /* check tree for modifiers */ |
| 223 |
|
{ |
| 224 |
|
OBJECT set[MAXSET+1]; |
| 225 |
< |
register int i; |
| 225 |
> |
int i; |
| 226 |
|
|
| 227 |
|
if (isempty(ot)) |
| 228 |
|
return(0); |
| 243 |
|
static void |
| 244 |
|
skiptree(void) /* skip octree on input */ |
| 245 |
|
{ |
| 246 |
< |
register int i; |
| 246 |
> |
int i; |
| 247 |
|
|
| 248 |
|
switch (getc(infp)) { |
| 249 |
|
case OT_EMPTY: |