]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/libc/misc/gnu/obprintf.c
update
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / libc / misc / gnu / obprintf.c
1 /* Copyright (C) 2013 Gentoo Foundation
2  * Licensed under LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
3  */
4
5 #include <stdio.h>
6 #include <stdarg.h>
7 #include <obstack.h>
8
9 int
10 obstack_vprintf (struct obstack *obstack, const char *format, va_list args)
11 {
12   int n;
13   char *s;
14   n = vasprintf(&s, format, args);
15   obstack_grow(obstack, s, n);
16   return n;
17 }
18 libc_hidden_def(obstack_vprintf)
19
20 int
21 obstack_printf (struct obstack *obstack, const char *format, ...)
22 {
23   int n;
24   va_list ap;
25   va_start (ap, format);
26   n = obstack_vprintf (obstack, format, ap);
27   va_end (ap);
28   return n;
29 }