ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/fwrite.c
Revision: 2.2
Committed: Sat Feb 22 02:07:22 2003 UTC (21 years, 2 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.1: +57 -3 lines
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

# User Rev Content
1 greg 1.1 #ifndef lint
2 greg 2.2 static const char RCSid[] = "$Id$";
3 greg 1.1 #endif
4 greg 2.2 /* ====================================================================
5     * The Radiance Software License, Version 1.0
6     *
7     * Copyright (c) 1990 - 2002 The Regents of the University of California,
8     * through Lawrence Berkeley National Laboratory. All rights reserved.
9     *
10     * Redistribution and use in source and binary forms, with or without
11     * modification, are permitted provided that the following conditions
12     * are met:
13     *
14     * 1. Redistributions of source code must retain the above copyright
15     * notice, this list of conditions and the following disclaimer.
16     *
17     * 2. Redistributions in binary form must reproduce the above copyright
18     * notice, this list of conditions and the following disclaimer in
19     * the documentation and/or other materials provided with the
20     * distribution.
21     *
22     * 3. The end-user documentation included with the redistribution,
23     * if any, must include the following acknowledgment:
24     * "This product includes Radiance software
25     * (http://radsite.lbl.gov/)
26     * developed by the Lawrence Berkeley National Laboratory
27     * (http://www.lbl.gov/)."
28     * Alternately, this acknowledgment may appear in the software itself,
29     * if and wherever such third-party acknowledgments normally appear.
30     *
31     * 4. The names "Radiance," "Lawrence Berkeley National Laboratory"
32     * and "The Regents of the University of California" must
33     * not be used to endorse or promote products derived from this
34     * software without prior written permission. For written
35     * permission, please contact [email protected].
36     *
37     * 5. Products derived from this software may not be called "Radiance",
38     * nor may "Radiance" appear in their name, without prior written
39     * permission of Lawrence Berkeley National Laboratory.
40     *
41     * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
42     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
43     * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
44     * DISCLAIMED. IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR
45     * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
46     * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
47     * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
48     * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
49     * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
50     * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
51     * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
52     * SUCH DAMAGE.
53     * ====================================================================
54     *
55     * This software consists of voluntary contributions made by many
56     * individuals on behalf of Lawrence Berkeley National Laboratory. For more
57     * information on Lawrence Berkeley National Laboratory, please see
58     * <http://www.lbl.gov/>.
59     */
60 greg 1.2
61     #include <stdio.h>
62 greg 1.1
63    
64     int
65     fwrite(ptr, size, count, fp) /* system version is broken (*sigh*) */
66     register char *ptr;
67     int size, count;
68     register FILE *fp;
69     {
70     register long n = size*count;
71    
72     while (n--)
73     putc(*ptr++, fp);
74    
75     return(ferror(fp) ? 0 : count);
76     }