Home | History | Annotate | Line # | Download | only in libasprintf
      1  1.1  christos /* Formatted output to strings.
      2  1.1  christos    Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
      3  1.1  christos 
      4  1.1  christos    This program is free software; you can redistribute it and/or modify it
      5  1.1  christos    under the terms of the GNU Library General Public License as published
      6  1.1  christos    by the Free Software Foundation; either version 2, or (at your option)
      7  1.1  christos    any later version.
      8  1.1  christos 
      9  1.1  christos    This program is distributed in the hope that it will be useful,
     10  1.1  christos    but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  1.1  christos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12  1.1  christos    Library General Public License for more details.
     13  1.1  christos 
     14  1.1  christos    You should have received a copy of the GNU Library General Public
     15  1.1  christos    License along with this program; if not, write to the Free Software
     16  1.1  christos    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
     17  1.1  christos    USA.  */
     18  1.1  christos 
     19  1.1  christos #include <config.h>
     20  1.1  christos 
     21  1.1  christos /* Specification.  */
     22  1.1  christos #include "vasprintf.h"
     23  1.1  christos 
     24  1.1  christos #include <stdarg.h>
     25  1.1  christos 
     26  1.1  christos int
     27  1.1  christos asprintf (char **resultp, const char *format, ...)
     28  1.1  christos {
     29  1.1  christos   va_list args;
     30  1.1  christos   int result;
     31  1.1  christos 
     32  1.1  christos   va_start (args, format);
     33  1.1  christos   result = vasprintf (resultp, format, args);
     34  1.1  christos   va_end (args);
     35  1.1  christos   return result;
     36  1.1  christos }
     37