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 17int putchar(int c); 18 19int puts(const char *str); 20 21int getchar(void); 22 23#if !DISABLE_DEBUG_OUTPUT 24#define printf(x...) _printf(x) 25#define vprintf(x...) _vprintf(x) 26#else 27static inline int __PRINTFLIKE(1, 2) printf(const char *fmt, ...) { return 0; } 28static inline int vprintf(const char *fmt, va_list ap) { return 0; } 29#endif 30 31int _printf(const char *fmt, ...) __PRINTFLIKE(1, 2); 32int _vprintf(const char *fmt, va_list ap); 33 34int snprintf(char *str, size_t len, const char *fmt, ...) __PRINTFLIKE(3, 4); 35int vsnprintf(char *str, size_t len, const char *fmt, va_list ap); 36 37 38__END_CDECLS 39