1225152Skib/*-
2225152Skib * Copyright 2011 Konstantin Belousov <kib@FreeBSD.org>.
3225152Skib * All rights reserved.
4225152Skib *
5225152Skib * Redistribution and use in source and binary forms, with or without
6225152Skib * modification, are permitted provided that the following conditions
7225152Skib * are met:
8225152Skib * 1. Redistributions of source code must retain the above copyright
9225152Skib *    notice, this list of conditions and the following disclaimer.
10225152Skib * 2. Redistributions in binary form must reproduce the above copyright
11225152Skib *    notice, this list of conditions and the following disclaimer in the
12225152Skib *    documentation and/or other materials provided with the distribution.
13225152Skib *
14225152Skib * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15225152Skib * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16225152Skib * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17225152Skib * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18225152Skib * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19225152Skib * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20225152Skib * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21225152Skib * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22225152Skib * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23225152Skib * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24225152Skib *
25225152Skib * $FreeBSD$
26225152Skib */
27225152Skib
28225152Skib#ifndef RTLD_PRINTF_H
29225152Skib#define RTLD_PRINTF_H 1
30225152Skib
31225152Skib#include <sys/cdefs.h>
32225152Skib#include <unistd.h>
33225152Skib
34225152Skibint rtld_vsnprintf(char *buf, size_t bufsize, const char *fmt, va_list ap);
35225152Skibint rtld_vfdprintf(int fd, const char *fmt, va_list ap);
36225152Skibint rtld_fdprintf(int fd, const char *fmt, ...) __printflike(2, 3);
37225152Skibvoid rtld_fdputstr(int fd, const char *str);
38225152Skibvoid rtld_fdputchar(int fd, int c);
39225152Skib
40225152Skib#define	rtld_printf(...) rtld_fdprintf(STDOUT_FILENO, __VA_ARGS__)
41225152Skib#define	rtld_putstr(str) rtld_fdputstr(STDOUT_FILENO, (str))
42225152Skib#define	rtld_putchar(c) rtld_fdputchar(STDOUT_FILENO, (c))
43225152Skib
44225152Skib#endif
45