slibc
stdio.h
Go to the documentation of this file.
00001 /* Copyright (C) 2011-2012 SBA Research gGmbh
00002 
00003    This file is part of the Slibc Library.
00004 
00005    The Slibc Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The Slibc library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the Slibc Library; if not, see
00017    <http://www.gnu.org/licenses/>.  
00018 */
00023 #include_next <stdio.h>
00024 
00025 #ifndef SLIBC_STDIO_H
00026 #define SLIBC_STDIO_H
00027 
00028 // TR 24731-1 is not available if __STDC_WANT_LIB_EXT1__ equals 0
00029 #if (!defined(__STDC_WANT_LIB_EXT1__) || (__STDC_WANT_LIB_EXT1__ != 0))
00030 
00031 // normally stdlib.h includes stdarg.h but it depends
00032 // on compilaton flags. since we use the standard va_list
00033 // we include it.
00034 #include <stdarg.h>
00035 #include "./base_.h"
00036 #include "./stddef.h"
00037 #include "./errno.h"
00038 
00039 SLIBC_BEGIN_DECLS
00040 
00042 #if ((L_tmpnam) > 25)
00043 # define L_tmpnam_s L_tmpnam
00044 #else
00045 # define L_tmpnam_s 25
00046 #endif
00047 
00049 #define TMP_MAX_S TMP_MAX
00050         
00051 
00076 
00077 errno_t tmpfile_s(FILE * restrict * restrict streamptr);
00078 
00079 
00114 
00115 errno_t tmpnam_s(char *s, rsize_t maxsize);
00116 
00117 
00118 
00136 
00137 char *gets_s(char *s, rsize_t n);
00138 
00139 
00159 
00160 errno_t fopen_s(FILE * restrict * restrict streamptr,
00161                                  const char * restrict filename,
00162                                  const char * restrict mode);
00163 
00164 
00184 
00185 errno_t freopen_s(FILE * restrict * restrict newstreamptr,
00186                   const char * restrict filename,
00187                   const char * restrict mode,
00188                   FILE * restrict stream);
00189 
00190 
00191 
00214 
00215 int sprintf_s(char * restrict s, 
00216                           rsize_t n,
00217                           const char * restrict format, ...) 
00218         __attribute__ ((format (printf, 3, 4)));
00219 
00220 
00248 
00249 int snprintf_s(char * restrict s, 
00250                            rsize_t n,
00251                            const char * restrict format, ...) 
00252         __attribute__ ((format (printf, 3, 4)));
00253 
00254 
00271 
00272 int vsprintf_s(char * restrict s, 
00273                            rsize_t n,
00274                            const char * restrict format,
00275                            va_list arg) 
00276         __attribute__ ((format (printf, 3, 0)));
00277 
00278 
00297 
00298 int vsnprintf_s(char * restrict s, 
00299                                 rsize_t n,
00300                                 const char * restrict format,
00301                                 va_list arg)
00302         __attribute__ ((format (printf, 3, 0)));
00303         
00304 
00319 
00320 int fprintf_s(FILE * restrict stream,
00321                const char * restrict format, ...);
00322 
00323 
00337 
00338 int vfprintf_s(FILE * restrict stream,
00339                const char * restrict format, va_list arg);
00340         
00341         
00354 
00355 int printf_s(const char * restrict format, ...);
00356         
00357 
00358 
00371 
00372 int vprintf_s(const char * restrict format,
00373               va_list arg);
00374 
00375                   
00388 
00389 int scanf_s(const char * restrict format, ...);
00390 
00391 
00404 
00405 int vscanf_s(const char * restrict format, va_list arg);
00406 
00407 
00421 
00422 int vsscanf_s(const char * restrict s,
00423                           const char * restrict format, va_list arg);
00424 
00425 
00438 int sscanf_s(const char * restrict s,
00439               const char * restrict format, ...);
00440                   
00441 
00461 
00462 int fscanf_s(FILE * restrict stream,
00463                 const char * restrict format, ...);
00464                         
00465                         
00479 
00480 int vfscanf_s(FILE * restrict stream,
00481                 const char * restrict format, va_list arg);
00482 
00483 SLIBC_END_DECLS
00484 
00485 #if defined(__cplusplus) && (defined(SLIBC_WANT_TEMPLATES))
00486 # include "./stdio_templates_.hpp"
00487 #endif
00488 
00489 #if (defined(SLIBC_WANT_MKTEMP))
00490 # include "./stdio_ext_.h"
00491 #endif
00492 
00493 #endif //(!defined(__STDC_WANT_LIB_EXT1__) || (__STDC_WANT_LIB_EXT1__ != 0))
00494 
00495 #endif