Xenomai  3.0.5
stdio.h
1 /*
2  * Copyright (C) 2006 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>.
3  * Copyright (C) 2007 Jan Kiszka <jan.kiszka@web.de>.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
18  */
19 #pragma GCC system_header
20 #include_next <stdio.h>
21 
22 #ifndef _COBALT_STDIO_H
23 #define _COBALT_STDIO_H
24 
25 #include <stddef.h>
26 #include <stdarg.h>
27 #include <xeno_config.h>
28 #include <cobalt/wrappers.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33 
34 COBALT_DECL(int, vfprintf(FILE *stream, const char *fmt, va_list args));
35 
36 #ifdef CONFIG_XENO_FORTIFY
37 
38 COBALT_DECL(int, __vfprintf_chk(FILE *stream, int level,
39  const char *fmt, va_list ap));
40 
41 COBALT_DECL(int, __vprintf_chk(int flag,
42  const char *fmt, va_list ap));
43 
44 COBALT_DECL(int, __printf_chk(int flag, const char *fmt, ...));
45 
46 COBALT_DECL(int, __fprintf_chk(FILE *fp, int flag, const char *fmt, ...));
47 
48 int __rt_vfprintf_chk(FILE *stream, int level,
49  const char *fmt, va_list args);
50 
51 void __rt_vsyslog_chk(int priority, int level,
52  const char *fmt, va_list args);
53 
54 #endif /* CONFIG_XENO_FORTIFY */
55 
56 COBALT_DECL(int, vprintf(const char *fmt, va_list args));
57 
58 COBALT_DECL(int, fprintf(FILE *stream, const char *fmt, ...));
59 
60 COBALT_DECL(int, printf(const char *fmt, ...));
61 
62 COBALT_DECL(int, puts(const char *s));
63 
64 COBALT_DECL(int, fputs(const char *s, FILE *stream));
65 
66 #ifndef putchar
67 COBALT_DECL(int, putchar(int c));
68 #else
69 static inline int __real_putchar(int c)
70 {
71  return putchar(c);
72 }
73 int __wrap_putchar(int c);
74 int __cobalt_putchar(int c);
75 #undef putchar
76 #define putchar __wrap_putchar
77 #endif
78 
79 #ifndef fputc
80 COBALT_DECL(int, fputc(int c, FILE *stream));
81 #else
82 static inline int __real_fputc(int c, FILE *stream)
83 {
84  return fputc(c, stream);
85 }
86 int __wrap_fputc(int c, FILE *stream);
87 int __cobalt_fputc(int c, FILE *stream);
88 #undef fputc
89 #define fputc __wrap_fputc
90 #endif
91 
92 COBALT_DECL(size_t,
93  fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream));
94 
95 COBALT_DECL(int, fclose(FILE *stream));
96 
97 int rt_vfprintf(FILE *stream, const char *format, va_list args);
98 
99 int rt_vprintf(const char *format, va_list args);
100 
101 int rt_fprintf(FILE *stream, const char *format, ...);
102 
103 int rt_printf(const char *format, ...);
104 
105 int rt_puts(const char *s);
106 
107 int rt_fputs(const char *s, FILE *stream);
108 
109 int rt_fputc(int c, FILE *stream);
110 
111 int rt_putchar(int c);
112 
113 size_t rt_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
114 
115 void rt_syslog(int priority, const char *format, ...);
116 
117 void rt_vsyslog(int priority, const char *format, va_list args);
118 
119 int rt_print_init(size_t buffer_size, const char *name);
120 
121 const char *rt_print_buffer_name(void);
122 
123 void rt_print_flush_buffers(void);
124 
125 #ifdef __cplusplus
126 }
127 #endif /* __cplusplus */
128 
129 #endif /* !_COBALT_STDIO_H */