asprintf.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <assert.h>
#include <grass/gis.h>

Include dependency graph for asprintf.c:

Go to the source code of this file.

Defines

#define _GNU_SOURCE

Functions

int G_asprintf (char **out, const char *fmt,...)
 safe replacement for asprintf()


Define Documentation

#define _GNU_SOURCE

Definition at line 1 of file asprintf.c.


Function Documentation

int G_asprintf ( char **  out,
const char *  fmt,
  ... 
)

safe replacement for asprintf()

Allocate a string large enough to hold the new output, including the terminating NUL, and return a pointer to the first parameter. The pointer should be passed to G_free() to release the allocated storage when it is no longer needed. Returns number of bytes written.

Parameters:
char **out
char *fmt
Returns:
int

Definition at line 61 of file asprintf.c.

References G_calloc(), G_free(), and NULL.


Generated on Sun Apr 6 17:32:15 2008 for GRASS by  doxygen 1.5.5