ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/getinfo.c
(Generate patch)

Comparing ray/src/util/getinfo.c (file contents):
Revision 1.1 by greg, Thu Feb 2 10:49:19 1989 UTC vs.
Revision 1.3 by greg, Thu Apr 18 14:35:06 1991 UTC

# Line 12 | Line 12 | static char SCCSid[] = "$SunId$ LBL";
12  
13   #include  <stdio.h>
14  
15 + extern int  fputs();
16  
17 +
18   tabstr(s)                               /* put out line followed by tab */
19   register char  *s;
20   {
# Line 36 | Line 38 | char  *argv[];
38          if (argc > 1 && !strcmp(argv[1], "-d")) {
39                  argc--; argv++;
40                  dim = 1;
41 +        } else if (argc == 2 && !strcmp(argv[1], "-")) {
42 +                getheader(stdin, NULL);
43 +                copycat();
44 +                exit(0);
45          }
46          for (i = 1; i < argc; i++) {
47                  fputs(argv[i], stdout);
# Line 47 | Line 53 | char  *argv[];
53                                  getdim(fp);
54                          } else {
55                                  tabstr(":\n");
56 <                                getheader(fp, tabstr);
56 >                                getheader(fp, tabstr, NULL);
57                                  putchar('\n');
58                          }
59                          fclose(fp);
# Line 57 | Line 63 | char  *argv[];
63                  if (dim) {
64                          getdim(stdin);
65                  } else {
66 <                        copyheader(stdin, stdout);
66 >                        getheader(stdin, fputs, stdout);
67                          putchar('\n');
68                  }
69          exit(0);
# Line 96 | Line 102 | register FILE  *fp;
102                  fputs("unknown file type\n", stdout);
103                  break;
104          }
105 + }
106 +
107 +
108 + copycat()                       /* copy input to output */
109 + {
110 +        register int    c;
111 +
112 +        while ((c = getchar()) != EOF)
113 +                putchar(c);
114   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines