11bb92983SJerome Forissier /* SPDX-License-Identifier: BSD-2-Clause */ 2b0104773SPascal Brand /* 3b0104773SPascal Brand * Copyright (c) 2014, STMicroelectronics International N.V. 4b0104773SPascal Brand */ 5b0104773SPascal Brand #ifndef STDIO_H 6b0104773SPascal Brand #define STDIO_H 7b0104773SPascal Brand 8b0104773SPascal Brand #include <stddef.h> 9b0104773SPascal Brand #include <stdarg.h> 10b0104773SPascal Brand 11b0104773SPascal Brand typedef struct _FILE FILE; 12b0104773SPascal Brand 13b0104773SPascal Brand int printf(const char *fmt, ...) 14b0104773SPascal Brand __attribute__ ((__format__ (__printf__, 1, 2))); 15f35d131bSJerome Forissier /* sprintf() is unsafe and should not be used. Prefer snprintf(). */ 16f35d131bSJerome Forissier int sprintf(char *str, const char *fmt, ...) 17f35d131bSJerome Forissier __attribute__ ((__format__ (__printf__, 2, 3))) 18f35d131bSJerome Forissier __attribute__ ((deprecated)); 19b0104773SPascal Brand int snprintf(char *str, size_t size, const char *fmt, ...) 20b0104773SPascal Brand __attribute__ ((__format__ (__printf__, 3, 4))); 21b0104773SPascal Brand int vsnprintf (char *str, size_t size, const char *fmt, va_list ap) 22b0104773SPascal Brand __attribute__ ((__format__ (__printf__, 3, 0))); 23b0104773SPascal Brand 24b0104773SPascal Brand int puts(const char *str); 25dc454609SJerome Forissier int putchar(int c); 26b0104773SPascal Brand 27*405a5072SJerome Forissier #ifndef __KERNEL__ 28*405a5072SJerome Forissier 29*405a5072SJerome Forissier extern FILE *stdout; 30*405a5072SJerome Forissier extern FILE *stderr; 31*405a5072SJerome Forissier 32*405a5072SJerome Forissier /* 33*405a5072SJerome Forissier * The functions below send their output synchronously to the secure console. 34*405a5072SJerome Forissier * They treat stdout and stderr the same, and will abort if stream is not one or 35*405a5072SJerome Forissier * the other. 36*405a5072SJerome Forissier */ 37*405a5072SJerome Forissier 38*405a5072SJerome Forissier int fputc(int c, FILE *stream); 39*405a5072SJerome Forissier int fputs(const char *s, FILE *stream); 40*405a5072SJerome Forissier size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); 41*405a5072SJerome Forissier #endif 42*405a5072SJerome Forissier 43b0104773SPascal Brand #endif /*STDIO_H*/ 44