1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Generate renderable grids from a holodeck file |
6 |
|
*/ |
7 |
|
|
8 |
+ |
#include "platform.h" |
9 |
|
#include "holo.h" |
10 |
|
|
11 |
|
char *progname; /* global argv[0] */ |
21 |
|
int sect; |
22 |
|
|
23 |
|
progname = argv[0]; |
24 |
< |
if (argc < 5 | argc > 6) |
24 |
> |
if ((argc < 5) | (argc > 6)) |
25 |
|
goto userr; |
26 |
|
mat = argv[1]; |
27 |
|
name = argv[2]; |
42 |
|
char *fname; |
43 |
|
int sect; |
44 |
|
{ |
47 |
– |
extern long ftell(); |
45 |
|
FILE *fp; |
46 |
|
HOLO hdsect; |
47 |
|
int fd; |
48 |
< |
int4 nextloc; |
48 |
> |
int32 nextloc; |
49 |
|
int n; |
50 |
|
/* open holodeck file */ |
51 |
|
if ((fp = fopen(fname, "r")) == NULL) { |
61 |
|
nextloc = ftell(fp); /* get stdio position */ |
62 |
|
fclose(fp); /* done with stdio */ |
63 |
|
for (n = 0; nextloc > 0L; n++) { /* get the section(s) */ |
64 |
< |
lseek(fd, (long)nextloc, 0); |
64 |
> |
lseek(fd, (off_t)nextloc, SEEK_SET); |
65 |
|
read(fd, (char *)&nextloc, sizeof(nextloc)); |
66 |
< |
if (sect < 0 | n == sect) { |
66 |
> |
if ((sect < 0) | (n == sect)) { |
67 |
|
read(fd, (char *)&hdsect, sizeof(HDGRID)); |
68 |
|
hdcompgrid(&hdsect); |
69 |
|
putgrid(&hdsect); /* print grid */ |