comparison packages/language/c/libc/current/include/stdio.h @ 2:443894e2e912 ecos-v1_2_1-release

Block commit of eCos version 1.2.1
author jlarmour
date Tue, 11 May 1999 12:24:34 +0000
parents 3111d98ba7b3
children 4f2df4ab82c8
comparison
equal deleted inserted replaced
1:72f549f0d891 2:443894e2e912
22 // 22 //
23 // The Original Code is eCos - Embedded Cygnus Operating System, released 23 // The Original Code is eCos - Embedded Cygnus Operating System, released
24 // September 30, 1998. 24 // September 30, 1998.
25 // 25 //
26 // The Initial Developer of the Original Code is Cygnus. Portions created 26 // The Initial Developer of the Original Code is Cygnus. Portions created
27 // by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. 27 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved.
28 // ------------------------------------------- 28 // -------------------------------------------
29 // 29 //
30 //####COPYRIGHTEND#### 30 //####COPYRIGHTEND####
31 //======================================================================== 31 //========================================================================
32 //#####DESCRIPTIONBEGIN#### 32 //#####DESCRIPTIONBEGIN####
33 // 33 //
34 // Author(s): jlarmour 34 // Author(s): jlarmour
35 // Contributors: jlarmour@cygnus.co.uk 35 // Contributors: jlarmour
36 // Date: 1998-02-13 36 // Date: 1999-01-19
37 // Purpose: 37 // Purpose: ISO C standard I/O routines
38 // Description: 38 // Description:
39 // Usage: #include <stdio.h> 39 // Usage: #include <stdio.h>
40 // 40 //
41 //####DESCRIPTIONEND#### 41 //####DESCRIPTIONEND####
42 // 42 //
52 // INCLUDES 52 // INCLUDES
53 53
54 #include <cyg/infra/cyg_type.h> // common type definitions and support 54 #include <cyg/infra/cyg_type.h> // common type definitions and support
55 #include <stddef.h> // NULL and size_t from compiler 55 #include <stddef.h> // NULL and size_t from compiler
56 #include <stdarg.h> // va_list from compiler 56 #include <stdarg.h> // va_list from compiler
57 #include <sys/file_if.h> // FILE definition
58 57
59 // CONSTANTS 58 // CONSTANTS
60 59
61 // Some of these values are odd to ensure that asserts have better effect 60 // Some of these values are odd to ensure that asserts have better effect
62 // should spurious values be passed to functions expecting these constants. 61 // should spurious values be passed to functions expecting these constants.
72 // chap. 7.9.1 71 // chap. 7.9.1
73 #define EOF (-1) 72 #define EOF (-1)
74 73
75 // SEEK_CUR, SEEK_END and SEEK_SET are used with fseek() as position 74 // SEEK_CUR, SEEK_END and SEEK_SET are used with fseek() as position
76 // anchors - ISO C standard chap. 7.9.1 75 // anchors - ISO C standard chap. 7.9.1
77 #define SEEK_CUR (-16) 76 #define SEEK_SET 0
78 #define SEEK_END (-32) 77 #define SEEK_CUR 1
79 #define SEEK_SET (-64) 78 #define SEEK_END 2
80 79
81 80
82 // TYPE DEFINITIONS 81 // TYPE DEFINITIONS
83 82
84 // A type capable of specifying uniquely every file position - ISO C 83 // A type capable of specifying uniquely every file position - ISO C
85 // standard chap 7.9.1 84 // standard chap 7.9.1
86 typedef cyg_ucount32 fpos_t; 85 typedef cyg_ucount32 fpos_t;
87 86
88 87
88 typedef CYG_ADDRESS FILE; // FILE is just cast to an address here. It is
89 // uncast internally to the C library in stream.hxx
90 // as the C++ Cyg_StdioStream class. Optional
91 // run-time checking can be enabled to ensure that
92 // the cast is valid, using the standard assertion
93 // functionality
94
89 // EXTERNAL VARIABLES 95 // EXTERNAL VARIABLES
90 96
91 // Default file streams for input/output. These only need to be 97 // Default file streams for input/output. These only need to be
92 // expressions, not l-values - ISO C standard chap. 7.9.1 98 // expressions, not l-values - ISO C standard chap. 7.9.1
93 99 //
94 externC FILE *stdin, *stdout, *stderr; 100 // cyg_libc_stdio_stdin/out/err aren't really files of course,
101 // but they are only named here so that we can take the address of
102 // them, in which case it doesn't matter what type they point to really
103 //
104 // CYGPRI_LIBC_STDIO_NO_DEFAULT_STREAMS is used when initializing
105 // cyg_libc_stdio_stdin/out/err privately inside the C library
106
107 #ifndef CYGPRI_LIBC_STDIO_NO_DEFAULT_STREAMS
108 extern FILE cyg_libc_stdio_stdin, cyg_libc_stdio_stdout,
109 cyg_libc_stdio_stderr;
110
111 #define stdin (&cyg_libc_stdio_stdin)
112 #define stdout (&cyg_libc_stdio_stdout)
113 #define stderr (&cyg_libc_stdio_stderr)
114 #endif
95 115
96 // FUNCTION PROTOTYPES 116 // FUNCTION PROTOTYPES
97 117
98 //======================================================================== 118 //========================================================================
99 119