29 #include <grass/config.h>
35 #include <grass/gis.h>
59 int G_vasprintf(
char **out,
const char *fmt, va_list ap)
61 return vasprintf(out, fmt, ap);
81 GetTempPath(2000, dir_name);
82 GetTempFileName(dir_name,
"asprintf", 0, file_name);
83 fp = fopen(file_name,
"w+");
91 count = vfprintf(fp, fmt, ap);
93 work = G_calloc(count + 1,
sizeof(
char));
96 ret_status = fread(work,
sizeof(
char), count, fp);
97 if (ret_status != count) {
void G_free(void *buf)
Free allocated memory.
int G_asprintf(char **out, const char *fmt,...)
int G_vasprintf(char **out, const char *fmt, va_list ap)
Safe replacement for asprintf().