blob: 442dd6423dd2be5e4dea46d99f3064ce2beddb15 [file] [log] [blame]
Adam Tkac247b7292008-11-14 13:11:31 +00001/* Copyright (C) 2008 TightVNC Team. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 */
18
19#ifndef OS_PRINT_H
20#define OS_PRINT_H
21
Adam Tkac8aee1a82009-09-04 12:08:56 +000022#ifdef HAVE_CONFIG_H
23#include <config.h>
Adam Tkac247b7292008-11-14 13:11:31 +000024#endif
25
26#include <stdarg.h>
Adam Tkac20e0d712008-11-14 14:48:21 +000027#include <stdio.h>
Adam Tkac247b7292008-11-14 13:11:31 +000028#include <sys/types.h>
29
Adam Tkac20e0d712008-11-14 14:48:21 +000030#ifdef __cplusplus
31extern "C" {
32#endif
33
Adam Tkac247b7292008-11-14 13:11:31 +000034#ifndef HAVE_VSNPRINTF
Adam Tkac241e9002008-12-03 14:13:36 +000035/* NOTE:
36 *
37 * This is only very limited implementation for our internal purposes. It
38 * doesn't conform to C99/POSIX
39 * - limited conversion specifiers
40 * - returns written number of characters instead of number what would be
41 * written
42 */
43int tight_vsnprintf(char *str, size_t n, const char *format, va_list ap);
44#define vsnprintf tight_vsnprintf
Adam Tkac247b7292008-11-14 13:11:31 +000045#endif
46
Adam Tkac3422fbd2008-12-03 14:18:19 +000047#ifndef HAVE_SNPRINTF
48/* Inherits tight_vsnprintf limitations if vsnprintf is not present */
49int tight_snprintf(char *str, size_t n, const char *format, ...);
50#define snprintf tight_snprintf
51#endif
52
Adam Tkac20e0d712008-11-14 14:48:21 +000053#ifdef __cplusplus
54};
55#endif
56
Adam Tkac247b7292008-11-14 13:11:31 +000057#endif /* OS_PRINT_H */