comparison c/asprintf/asprintf.h @ 621:ca5912ad2909

Misc: massive refactoring, closes #717
author David Demelier <markand@malikania.fr>
date Fri, 20 Oct 2017 12:36:51 +0200
parents port/C/asprintf.h@266f32919d0a
children b327391f6a62
comparison
equal deleted inserted replaced
620:e24fc739ec74 621:ca5912ad2909
1 /*
2 * asprintf.h -- basic port of asprintf / vsprintf functions
3 *
4 * Copyright (c) 2011-2017 David Demelier <markand@malikania.fr>
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19 #ifndef ASPRINTF_H
20 #define ASPRINTF_H
21
22 #include <stdarg.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #ifdef __GNUC__
29 # define ASPRINTF_FMT(i1, i2) __attribute__ ((format (printf, i1, i2)))
30 #else
31 # define ASPRINTF_FMT(i1, i2)
32 #endif
33
34 int
35 asprintf(char **, const char *, ...) ASPRINTF_FMT(2, 3);
36
37 int
38 vasprintf(char **, const char *, va_list);
39
40 #ifdef __cplusplus
41 }
42 #endif
43
44 #endif /* !ASPRINTF_H */