GRU - Generic Reusable Utilities
Loading...
Searching...
No Matches
asprintf.h
Go to the documentation of this file.
1/*
2Copyright (C) 2014 insane coder (http://insanecoding.blogspot.com/,
3http://asprintf.insanecoding.org/)
4
5Permission to use, copy, modify, and distribute this software for any
6purpose with or without fee is hereby granted, provided that the above
7copyright notice and this permission notice appear in all copies.
8
9THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*/
17
18#ifndef INSANE_ASPRINTF_H
19#define INSANE_ASPRINTF_H
20
21#ifndef __cplusplus
22#include <stdarg.h>
23#else
24#include <cstdarg>
25extern "C" {
26#endif
27
28#define insane_free(ptr) \
29 { \
30 free(ptr); \
31 (ptr) = 0; \
32 }
33
34int vasprintf(char **strp, const char *fmt, va_list ap);
35int asprintf(char **strp, const char *fmt, ...);
36
37#ifdef __cplusplus
38}
39#endif
40
41#endif
int asprintf(char **strp, const char *fmt,...)
Definition: asprintf.c:20
int vasprintf(char **strp, const char *fmt, va_list ap)
Definition: vasprintf.c:31