1 // Copyright 2016 The Fuchsia Authors
2 // Copyright (c) 2008-2015 Travis Geiselbrecht
3 //
4 // Use of this source code is governed by a MIT-style
5 // license that can be found in the LICENSE file or at
6 // https://opensource.org/licenses/MIT
7 
8 #pragma once
9 
10 #include <zircon/compiler.h>
11 #include <printf.h>
12 #include <sys/types.h>
13 #include <lib/io.h>
14 
15 __BEGIN_CDECLS
16 
17 int putchar(int c);
18 
19 int puts(const char *str);
20 
21 int getchar(void);
22 
23 #if !DISABLE_DEBUG_OUTPUT
24 #define printf(x...) _printf(x)
25 #define vprintf(x...) _vprintf(x)
26 #else
printf(const char * fmt,...)27 static inline int __PRINTFLIKE(1, 2) printf(const char *fmt, ...) { return 0; }
vprintf(const char * fmt,va_list ap)28 static inline int vprintf(const char *fmt, va_list ap) { return 0; }
29 #endif
30 
31 int _printf(const char *fmt, ...) __PRINTFLIKE(1, 2);
32 int _vprintf(const char *fmt, va_list ap);
33 
34 int snprintf(char *str, size_t len, const char *fmt, ...) __PRINTFLIKE(3, 4);
35 int vsnprintf(char *str, size_t len, const char *fmt, va_list ap);
36 
37 
38 __END_CDECLS
39