~ubuntu-branches/ubuntu/gutsy/avr-libc/gutsy

« back to all changes in this revision

Viewing changes to libc/stdio/stdio_private.h

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2005-03-19 11:16:14 UTC
  • mfrom: (1.1.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050319111614-4g01s2ftv5x5nxf3
Tags: 1:1.2.3-3
* Added build depends on netpbm
* Added build depends on tetex-extra

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2002, Joerg Wunsch
 
2
   All rights reserved.
 
3
 
 
4
   Redistribution and use in source and binary forms, with or without
 
5
   modification, are permitted provided that the following conditions are met:
 
6
 
 
7
   * Redistributions of source code must retain the above copyright
 
8
     notice, this list of conditions and the following disclaimer.
 
9
   * Redistributions in binary form must reproduce the above copyright
 
10
     notice, this list of conditions and the following disclaimer in
 
11
     the documentation and/or other materials provided with the
 
12
     distribution.
 
13
   * Neither the name of the copyright holders nor the names of
 
14
     contributors may be used to endorse or promote products derived
 
15
     from this software without specific prior written permission.
 
16
 
 
17
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 
18
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
19
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
20
  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 
21
  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 
22
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
23
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
24
  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 
25
  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
26
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
27
  POSSIBILITY OF SUCH DAMAGE.
 
28
*/
 
29
 
 
30
/* $Id: stdio_private.h,v 1.7 2003/09/30 23:05:18 troth Exp $ */
 
31
 
 
32
#include <inttypes.h>
 
33
#include <stdio.h>
 
34
 
 
35
#if !defined(DOXYGEN)
 
36
 
 
37
struct __file {
 
38
        char    *buf;           /* buffer pointer */
 
39
        unsigned char unget;    /* ungetc() buffer */
 
40
        uint8_t flags;          /* flags, see below */
 
41
#define __SRD   0x0001          /* OK to read */
 
42
#define __SWR   0x0002          /* OK to write */
 
43
#define __SSTR  0x0004          /* this is an sprintf/snprintf string */
 
44
#define __SPGM  0x0008          /* fmt string is in progmem */
 
45
#define __SERR  0x0010          /* found error */
 
46
#define __SEOF  0x0020          /* found EOF */
 
47
#define __SUNGET 0x040          /* ungetc() happened */
 
48
#if 0
 
49
/* possible future extensions, will require uint16_t flags */
 
50
#define __SRW   0x0080          /* open for reading & writing */
 
51
#define __SLBF  0x0100          /* line buffered */
 
52
#define __SNBF  0x0200          /* unbuffered */
 
53
#define __SMBF  0x0400          /* buf is from malloc */
 
54
#endif
 
55
        int     size;           /* size of buffer */
 
56
        int     len;            /* characters read or written so far */
 
57
        int     (*put)(char);   /* function to write one char to device */
 
58
        int     (*get)(void);   /* function to read one char from device */
 
59
};
 
60
 
 
61
#endif /* not DOXYGEN */
 
62
 
 
63
/* values for PRINTF_LEVEL */
 
64
#define PRINTF_MIN 1
 
65
#define PRINTF_STD 2
 
66
#define PRINTF_FLT 3
 
67
 
 
68
/* values for SCANF_LEVEL */
 
69
#define SCANF_MIN 1
 
70
#define SCANF_STD 2
 
71
#define SCANF_FLT 3