24 |
|
* To copy header from input to output, use getheader(fin, fputs, fout) |
25 |
|
*/ |
26 |
|
|
27 |
< |
/* ==================================================================== |
28 |
< |
* The Radiance Software License, Version 1.0 |
29 |
< |
* |
30 |
< |
* Copyright (c) 1990 - 2002 The Regents of the University of California, |
31 |
< |
* through Lawrence Berkeley National Laboratory. All rights reserved. |
32 |
< |
* |
33 |
< |
* Redistribution and use in source and binary forms, with or without |
34 |
< |
* modification, are permitted provided that the following conditions |
35 |
< |
* are met: |
36 |
< |
* |
37 |
< |
* 1. Redistributions of source code must retain the above copyright |
38 |
< |
* notice, this list of conditions and the following disclaimer. |
39 |
< |
* |
40 |
< |
* 2. Redistributions in binary form must reproduce the above copyright |
41 |
< |
* notice, this list of conditions and the following disclaimer in |
42 |
< |
* the documentation and/or other materials provided with the |
43 |
< |
* distribution. |
44 |
< |
* |
45 |
< |
* 3. The end-user documentation included with the redistribution, |
46 |
< |
* if any, must include the following acknowledgment: |
47 |
< |
* "This product includes Radiance software |
48 |
< |
* (http://radsite.lbl.gov/) |
49 |
< |
* developed by the Lawrence Berkeley National Laboratory |
50 |
< |
* (http://www.lbl.gov/)." |
51 |
< |
* Alternately, this acknowledgment may appear in the software itself, |
52 |
< |
* if and wherever such third-party acknowledgments normally appear. |
53 |
< |
* |
54 |
< |
* 4. The names "Radiance," "Lawrence Berkeley National Laboratory" |
55 |
< |
* and "The Regents of the University of California" must |
56 |
< |
* not be used to endorse or promote products derived from this |
57 |
< |
* software without prior written permission. For written |
58 |
< |
* permission, please contact [email protected]. |
59 |
< |
* |
60 |
< |
* 5. Products derived from this software may not be called "Radiance", |
61 |
< |
* nor may "Radiance" appear in their name, without prior written |
62 |
< |
* permission of Lawrence Berkeley National Laboratory. |
63 |
< |
* |
64 |
< |
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
65 |
< |
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
66 |
< |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
67 |
< |
* DISCLAIMED. IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR |
68 |
< |
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
69 |
< |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
70 |
< |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
71 |
< |
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
72 |
< |
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
73 |
< |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
74 |
< |
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
75 |
< |
* SUCH DAMAGE. |
76 |
< |
* ==================================================================== |
77 |
< |
* |
78 |
< |
* This software consists of voluntary contributions made by many |
79 |
< |
* individuals on behalf of Lawrence Berkeley National Laboratory. For more |
80 |
< |
* information on Lawrence Berkeley National Laboratory, please see |
81 |
< |
* <http://www.lbl.gov/>. |
82 |
< |
*/ |
27 |
> |
#include "copyright.h" |
28 |
> |
#include "resolu.h" |
29 |
|
|
30 |
|
#include <stdio.h> |
31 |
|
#include <string.h> |
34 |
|
|
35 |
|
#define MAXLINE 512 |
36 |
|
|
91 |
– |
#ifndef BSD |
92 |
– |
#define index strchr |
93 |
– |
#endif |
94 |
– |
|
95 |
– |
extern char *index(); |
96 |
– |
|
37 |
|
char HDRSTR[] = "#?"; /* information header magic number */ |
38 |
|
|
39 |
|
char FMTSTR[] = "FORMAT="; /* format identifier */ |
40 |
|
|
41 |
|
char TMSTR[] = "CAPDATE="; /* capture date identifier */ |
42 |
|
|
43 |
+ |
extern void fputword(char *s, FILE *fp); |
44 |
+ |
|
45 |
|
static int mycheck(); |
46 |
|
|
47 |
|
|
141 |
|
char **av; |
142 |
|
FILE *fp; |
143 |
|
{ |
202 |
– |
int quote; |
203 |
– |
|
144 |
|
while (ac-- > 0) { |
145 |
|
fputword(*av++, fp); |
146 |
|
fputc(ac ? ' ' : '\n', fp); |
308 |
|
|
309 |
|
cdat.fp = fout; |
310 |
|
cdat.fs[0] = '\0'; |
311 |
< |
if (getheader(fin, mycheck, &cdat) < 0) |
311 |
> |
if (getheader(fin, mycheck, (char *)&cdat) < 0) |
312 |
|
return(-1); |
313 |
|
if (!cdat.fs[0]) |
314 |
|
return(0); |