You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vasnwprintf.h 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* vswprintf with automatic memory allocation.
  2. Copyright (C) 2002-2003 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify it
  4. under the terms of the GNU Library General Public License as published
  5. by the Free Software Foundation; either version 2, or (at your option)
  6. any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public
  12. License along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  14. USA. */
  15. #ifndef _VASNWPRINTF_H
  16. #define _VASNWPRINTF_H
  17. /* Get va_list. */
  18. #include <stdarg.h>
  19. /* Get wchar_t, size_t. */
  20. #include <stddef.h>
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Write formatted output to a string dynamically allocated with malloc().
  25. You can pass a preallocated buffer for the result in RESULTBUF and its
  26. size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
  27. If successful, return the address of the string (this may be = RESULTBUF
  28. if no dynamic memory allocation was necessary) and set *LENGTHP to the
  29. number of resulting bytes, excluding the trailing NUL. Upon error, set
  30. errno and return NULL. */
  31. extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...);
  32. extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args);
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif /* _VASNWPRINTF_H */