1
/* Copyright (c) 2002, Joerg Wunsch
4
Redistribution and use in source and binary forms, with or without
5
modification, are permitted provided that the following conditions are met:
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
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.
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.
30
/* $Id: stdio_private.h,v 1.7 2003/09/30 23:05:18 troth Exp $ */
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 */
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 */
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 */
61
#endif /* not DOXYGEN */
63
/* values for PRINTF_LEVEL */
68
/* values for SCANF_LEVEL */