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 2.2 by greg, Mon Sep 21 12:13:25 1992 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 Regents of the University of California */
1 > /* Copyright (c) 1992 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 12 | Line 12 | static char SCCSid[] = "$SunId$ LBL";
12  
13   #include  <stdio.h>
14  
15 + #ifdef MSDOS
16 + #include <fcntl.h>
17 + #endif
18  
19 + extern int  fputs();
20 +
21 +
22   tabstr(s)                               /* put out line followed by tab */
23   register char  *s;
24   {
# Line 36 | Line 42 | char  *argv[];
42          if (argc > 1 && !strcmp(argv[1], "-d")) {
43                  argc--; argv++;
44                  dim = 1;
45 +        } else if (argc == 2 && !strcmp(argv[1], "-")) {
46 + #ifdef MSDOS
47 +                setmode(fileno(stdin), O_BINARY);
48 +                setmode(fileno(stdout), O_BINARY);
49 + #endif
50 +                getheader(stdin, NULL);
51 +                copycat();
52 +                exit(0);
53          }
54          for (i = 1; i < argc; i++) {
55                  fputs(argv[i], stdout);
# Line 47 | Line 61 | char  *argv[];
61                                  getdim(fp);
62                          } else {
63                                  tabstr(":\n");
64 <                                getheader(fp, tabstr);
64 >                                getheader(fp, tabstr, NULL);
65                                  putchar('\n');
66                          }
67                          fclose(fp);
# Line 57 | Line 71 | char  *argv[];
71                  if (dim) {
72                          getdim(stdin);
73                  } else {
74 <                        copyheader(stdin, stdout);
74 >                        getheader(stdin, fputs, stdout);
75                          putchar('\n');
76                  }
77          exit(0);
# Line 96 | Line 110 | register FILE  *fp;
110                  fputs("unknown file type\n", stdout);
111                  break;
112          }
113 + }
114 +
115 +
116 + copycat()                       /* copy input to output */
117 + {
118 +        register int    c;
119 +        
120 +        while ((c = getchar()) != EOF)
121 +                putchar(c);
122   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines