Navit SVN

/work/compile/navit/src/intl/vasnwprintf.h

00001 /* vswprintf with automatic memory allocation.
00002    Copyright (C) 2002-2003 Free Software Foundation, Inc.
00003 
00004    This program is free software; you can redistribute it and/or modify it
00005    under the terms of the GNU Library General Public License as published
00006    by the Free Software Foundation; either version 2, or (at your option)
00007    any later version.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public
00015    License along with this program; if not, write to the Free Software
00016    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
00017    USA.  */
00018 
00019 #ifndef _VASNWPRINTF_H
00020 #define _VASNWPRINTF_H
00021 
00022 /* Get va_list.  */
00023 #include <stdarg.h>
00024 
00025 /* Get wchar_t, size_t.  */
00026 #include <stddef.h>
00027 
00028 #ifdef  __cplusplus
00029 extern "C" {
00030 #endif
00031 
00032 /* Write formatted output to a string dynamically allocated with malloc().
00033    You can pass a preallocated buffer for the result in RESULTBUF and its
00034    size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
00035    If successful, return the address of the string (this may be = RESULTBUF
00036    if no dynamic memory allocation was necessary) and set *LENGTHP to the
00037    number of resulting bytes, excluding the trailing NUL.  Upon error, set
00038    errno and return NULL.  */
00039 extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...);
00040 extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args);
00041 
00042 #ifdef  __cplusplus
00043 }
00044 #endif
00045 
00046 #endif /* _VASNWPRINTF_H */