1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-05-13 15:13:36 +00:00

Formatted output functions for Unicode strings.

This commit is contained in:
Bruno Haible
2007-07-02 01:34:46 +00:00
parent 7c8322243b
commit 2625ca90ab
203 changed files with 11554 additions and 0 deletions

205
ChangeLog
View File

@@ -1,3 +1,208 @@
2007-07-01 Bruno Haible <bruno@clisp.org>
* lib/unistdio.h: New file.
* lib/unistdio/u-asnprintf.h: New file.
* lib/unistdio/u-asprintf.h: New file.
* lib/unistdio/u-printf-args.c: New file.
* lib/unistdio/u-printf-args.h: New file.
* lib/unistdio/u-printf-parse.h: New file.
* lib/unistdio/u-snprintf.h: New file.
* lib/unistdio/u-sprintf.h: New file.
* lib/unistdio/u-vasprintf.h: New file.
* lib/unistdio/u-vsnprintf.h: New file.
* lib/unistdio/u-vsprintf.h: New file.
* lib/unistdio/ulc-asnprintf.c: New file.
* lib/unistdio/ulc-asprintf.c: New file.
* lib/unistdio/ulc-fprintf.c: New file, based on lib/fprintf.c.
* lib/unistdio/ulc-printf-parse.c: New file.
* lib/unistdio/ulc-snprintf.c: New file.
* lib/unistdio/ulc-sprintf.c: New file.
* lib/unistdio/ulc-vasnprintf.c: New file.
* lib/unistdio/ulc-vasprintf.c: New file.
* lib/unistdio/ulc-vfprintf.c: New file, based on lib/vfprintf.c.
* lib/unistdio/ulc-vsnprintf.c: New file.
* lib/unistdio/ulc-vsprintf.c: New file.
* lib/unistdio/u8-asnprintf.c: New file.
* lib/unistdio/u8-asprintf.c: New file.
* lib/unistdio/u8-printf-parse.c: New file.
* lib/unistdio/u8-snprintf.c: New file.
* lib/unistdio/u8-sprintf.c: New file.
* lib/unistdio/u8-vasnprintf.c: New file.
* lib/unistdio/u8-vasprintf.c: New file.
* lib/unistdio/u8-vsnprintf.c: New file.
* lib/unistdio/u8-vsprintf.c: New file.
* lib/unistdio/u8-u8-asnprintf.c: New file.
* lib/unistdio/u8-u8-asprintf.c: New file.
* lib/unistdio/u8-u8-snprintf.c: New file.
* lib/unistdio/u8-u8-sprintf.c: New file.
* lib/unistdio/u8-u8-vasnprintf.c: New file.
* lib/unistdio/u8-u8-vasprintf.c: New file.
* lib/unistdio/u8-u8-vsnprintf.c: New file.
* lib/unistdio/u8-u8-vsprintf.c: New file.
* lib/unistdio/u16-asnprintf.c: New file.
* lib/unistdio/u16-asprintf.c: New file.
* lib/unistdio/u16-printf-parse.c: New file.
* lib/unistdio/u16-snprintf.c: New file.
* lib/unistdio/u16-sprintf.c: New file.
* lib/unistdio/u16-vasnprintf.c: New file.
* lib/unistdio/u16-vasprintf.c: New file.
* lib/unistdio/u16-vsnprintf.c: New file.
* lib/unistdio/u16-vsprintf.c: New file.
* lib/unistdio/u16-u16-asnprintf.c: New file.
* lib/unistdio/u16-u16-asprintf.c: New file.
* lib/unistdio/u16-u16-snprintf.c: New file.
* lib/unistdio/u16-u16-sprintf.c: New file.
* lib/unistdio/u16-u16-vasnprintf.c: New file.
* lib/unistdio/u16-u16-vasprintf.c: New file.
* lib/unistdio/u16-u16-vsnprintf.c: New file.
* lib/unistdio/u16-u16-vsprintf.c: New file.
* lib/unistdio/u32-asnprintf.c: New file.
* lib/unistdio/u32-asprintf.c: New file.
* lib/unistdio/u32-printf-parse.c: New file.
* lib/unistdio/u32-snprintf.c: New file.
* lib/unistdio/u32-sprintf.c: New file.
* lib/unistdio/u32-vasnprintf.c: New file.
* lib/unistdio/u32-vasprintf.c: New file.
* lib/unistdio/u32-vsnprintf.c: New file.
* lib/unistdio/u32-vsprintf.c: New file.
* lib/unistdio/u32-u32-asnprintf.c: New file.
* lib/unistdio/u32-u32-asprintf.c: New file.
* lib/unistdio/u32-u32-snprintf.c: New file.
* lib/unistdio/u32-u32-sprintf.c: New file.
* lib/unistdio/u32-u32-vasnprintf.c: New file.
* lib/unistdio/u32-u32-vasprintf.c: New file.
* lib/unistdio/u32-u32-vsnprintf.c: New file.
* lib/unistdio/u32-u32-vsprintf.c: New file.
* tests/unistdio/test-ulc-asnprintf1.c: New file.
* tests/unistdio/test-ulc-asnprintf1.h: New file.
* tests/unistdio/test-ulc-printf1.h: New file.
* tests/unistdio/test-ulc-vasnprintf1.c: New file.
* tests/unistdio/test-ulc-vasnprintf2.c: New file.
* tests/unistdio/test-ulc-vasnprintf2.sh: New file.
* tests/unistdio/test-ulc-vasnprintf3.c: New file.
* tests/unistdio/test-ulc-vasnprintf3.sh: New file.
* tests/unistdio/test-ulc-vasprintf1.c: New file.
* tests/unistdio/test-ulc-vsnprintf1.c: New file.
* tests/unistdio/test-ulc-vsprintf1.c: New file.
* tests/unistdio/test-u8-asnprintf1.c: New file.
* tests/unistdio/test-u8-asnprintf1.h: New file.
* tests/unistdio/test-u8-printf1.h: New file.
* tests/unistdio/test-u8-vasnprintf1.c: New file.
* tests/unistdio/test-u8-vasnprintf2.c: New file.
* tests/unistdio/test-u8-vasnprintf2.sh: New file.
* tests/unistdio/test-u8-vasnprintf3.c: New file.
* tests/unistdio/test-u8-vasnprintf3.sh: New file.
* tests/unistdio/test-u8-vasprintf1.c: New file.
* tests/unistdio/test-u8-vsnprintf1.c: New file.
* tests/unistdio/test-u8-vsprintf1.c: New file.
* tests/unistdio/test-u16-asnprintf1.c: New file.
* tests/unistdio/test-u16-asnprintf1.h: New file.
* tests/unistdio/test-u16-printf1.h: New file.
* tests/unistdio/test-u16-vasnprintf1.c: New file.
* tests/unistdio/test-u16-vasnprintf2.c: New file.
* tests/unistdio/test-u16-vasnprintf2.sh: New file.
* tests/unistdio/test-u16-vasnprintf3.c: New file.
* tests/unistdio/test-u16-vasnprintf3.sh: New file.
* tests/unistdio/test-u16-vasprintf1.c: New file.
* tests/unistdio/test-u16-vsnprintf1.c: New file.
* tests/unistdio/test-u16-vsprintf1.c: New file.
* tests/unistdio/test-u32-asnprintf1.c: New file.
* tests/unistdio/test-u32-asnprintf1.h: New file.
* tests/unistdio/test-u32-printf1.h: New file.
* tests/unistdio/test-u32-vasnprintf1.c: New file.
* tests/unistdio/test-u32-vasnprintf2.c: New file.
* tests/unistdio/test-u32-vasnprintf2.sh: New file.
* tests/unistdio/test-u32-vasnprintf3.c: New file.
* tests/unistdio/test-u32-vasnprintf3.sh: New file.
* tests/unistdio/test-u32-vasprintf1.c: New file.
* tests/unistdio/test-u32-vsnprintf1.c: New file.
* tests/unistdio/test-u32-vsprintf1.c: New file.
* modules/unistdio/base: New file.
* modules/unistdio/u-printf-args: New file.
* modules/unistdio/ulc-asnprintf: New file.
* modules/unistdio/ulc-asprintf: New file.
* modules/unistdio/ulc-fprintf: New file.
* modules/unistdio/ulc-printf-parse: New file.
* modules/unistdio/ulc-snprintf: New file.
* modules/unistdio/ulc-sprintf: New file.
* modules/unistdio/ulc-vasnprintf: New file.
* modules/unistdio/ulc-vasprintf: New file.
* modules/unistdio/ulc-vfprintf: New file.
* modules/unistdio/ulc-vsnprintf: New file.
* modules/unistdio/ulc-vsprintf: New file.
* modules/unistdio/u8-asnprintf: New file.
* modules/unistdio/u8-asprintf: New file.
* modules/unistdio/u8-printf-parse: New file.
* modules/unistdio/u8-snprintf: New file.
* modules/unistdio/u8-sprintf: New file.
* modules/unistdio/u8-vasnprintf: New file.
* modules/unistdio/u8-vasprintf: New file.
* modules/unistdio/u8-vsnprintf: New file.
* modules/unistdio/u8-vsprintf: New file.
* modules/unistdio/u8-u8-asnprintf: New file.
* modules/unistdio/u8-u8-asprintf: New file.
* modules/unistdio/u8-u8-snprintf: New file.
* modules/unistdio/u8-u8-sprintf: New file.
* modules/unistdio/u8-u8-vasnprintf: New file.
* modules/unistdio/u8-u8-vasprintf: New file.
* modules/unistdio/u8-u8-vsnprintf: New file.
* modules/unistdio/u8-u8-vsprintf: New file.
* modules/unistdio/u16-asnprintf: New file.
* modules/unistdio/u16-asprintf: New file.
* modules/unistdio/u16-printf-parse: New file.
* modules/unistdio/u16-snprintf: New file.
* modules/unistdio/u16-sprintf: New file.
* modules/unistdio/u16-vasnprintf: New file.
* modules/unistdio/u16-vasprintf: New file.
* modules/unistdio/u16-vsnprintf: New file.
* modules/unistdio/u16-vsprintf: New file.
* modules/unistdio/u16-u16-asnprintf: New file.
* modules/unistdio/u16-u16-asprintf: New file.
* modules/unistdio/u16-u16-snprintf: New file.
* modules/unistdio/u16-u16-sprintf: New file.
* modules/unistdio/u16-u16-vasnprintf: New file.
* modules/unistdio/u16-u16-vasprintf: New file.
* modules/unistdio/u16-u16-vsnprintf: New file.
* modules/unistdio/u16-u16-vsprintf: New file.
* modules/unistdio/u32-asnprintf: New file.
* modules/unistdio/u32-asprintf: New file.
* modules/unistdio/u32-printf-parse: New file.
* modules/unistdio/u32-snprintf: New file.
* modules/unistdio/u32-sprintf: New file.
* modules/unistdio/u32-vasnprintf: New file.
* modules/unistdio/u32-vasprintf: New file.
* modules/unistdio/u32-vsnprintf: New file.
* modules/unistdio/u32-vsprintf: New file.
* modules/unistdio/u32-u32-asnprintf: New file.
* modules/unistdio/u32-u32-asprintf: New file.
* modules/unistdio/u32-u32-snprintf: New file.
* modules/unistdio/u32-u32-sprintf: New file.
* modules/unistdio/u32-u32-vasnprintf: New file.
* modules/unistdio/u32-u32-vasprintf: New file.
* modules/unistdio/u32-u32-vsnprintf: New file.
* modules/unistdio/u32-u32-vsprintf: New file.
* modules/unistdio/ulc-asnprintf-tests: New file.
* modules/unistdio/ulc-vasnprintf-tests: New file.
* modules/unistdio/ulc-vasprintf-tests: New file.
* modules/unistdio/ulc-vsnprintf-tests: New file.
* modules/unistdio/ulc-vsprintf-tests: New file.
* modules/unistdio/u8-asnprintf-tests: New file.
* modules/unistdio/u8-vasnprintf-tests: New file.
* modules/unistdio/u8-vasprintf-tests: New file.
* modules/unistdio/u8-vsnprintf-tests: New file.
* modules/unistdio/u8-vsprintf-tests: New file.
* modules/unistdio/u16-asnprintf-tests: New file.
* modules/unistdio/u16-vasnprintf-tests: New file.
* modules/unistdio/u16-vasprintf-tests: New file.
* modules/unistdio/u16-vsnprintf-tests: New file.
* modules/unistdio/u16-vsprintf-tests: New file.
* modules/unistdio/u32-asnprintf-tests: New file.
* modules/unistdio/u32-vasnprintf-tests: New file.
* modules/unistdio/u32-vasprintf-tests: New file.
* modules/unistdio/u32-vsnprintf-tests: New file.
* modules/unistdio/u32-vsprintf-tests: New file.
* MODULES.html.sh (Unicode string functions): Add the new modules.
2007-07-01 Bruno Haible <bruno@clisp.org>
* lib/sprintf.c (sprintf): Limit the available length estimation,

View File

@@ -2439,6 +2439,70 @@ func_all_modules ()
func_module uniconv/u8-strconv-to-locale
func_module uniconv/u16-strconv-to-locale
func_module uniconv/u32-strconv-to-locale
func_module unistdio/base
func_module unistdio/u-printf-args
func_module unistdio/ulc-asnprintf
func_module unistdio/ulc-asprintf
func_module unistdio/ulc-fprintf
func_module unistdio/ulc-printf-parse
func_module unistdio/ulc-snprintf
func_module unistdio/ulc-sprintf
func_module unistdio/ulc-vasnprintf
func_module unistdio/ulc-vasprintf
func_module unistdio/ulc-vfprintf
func_module unistdio/ulc-vsnprintf
func_module unistdio/ulc-vsprintf
func_module unistdio/u8-asnprintf
func_module unistdio/u8-asprintf
func_module unistdio/u8-printf-parse
func_module unistdio/u8-snprintf
func_module unistdio/u8-sprintf
func_module unistdio/u8-vasnprintf
func_module unistdio/u8-vasprintf
func_module unistdio/u8-vsnprintf
func_module unistdio/u8-vsprintf
func_module unistdio/u8-u8-asnprintf
func_module unistdio/u8-u8-asprintf
func_module unistdio/u8-u8-snprintf
func_module unistdio/u8-u8-sprintf
func_module unistdio/u8-u8-vasnprintf
func_module unistdio/u8-u8-vasprintf
func_module unistdio/u8-u8-vsnprintf
func_module unistdio/u8-u8-vsprintf
func_module unistdio/u16-asnprintf
func_module unistdio/u16-asprintf
func_module unistdio/u16-printf-parse
func_module unistdio/u16-snprintf
func_module unistdio/u16-sprintf
func_module unistdio/u16-vasnprintf
func_module unistdio/u16-vasprintf
func_module unistdio/u16-vsnprintf
func_module unistdio/u16-vsprintf
func_module unistdio/u16-u16-asnprintf
func_module unistdio/u16-u16-asprintf
func_module unistdio/u16-u16-snprintf
func_module unistdio/u16-u16-sprintf
func_module unistdio/u16-u16-vasnprintf
func_module unistdio/u16-u16-vasprintf
func_module unistdio/u16-u16-vsnprintf
func_module unistdio/u16-u16-vsprintf
func_module unistdio/u32-asnprintf
func_module unistdio/u32-asprintf
func_module unistdio/u32-printf-parse
func_module unistdio/u32-snprintf
func_module unistdio/u32-sprintf
func_module unistdio/u32-vasnprintf
func_module unistdio/u32-vasprintf
func_module unistdio/u32-vsnprintf
func_module unistdio/u32-vsprintf
func_module unistdio/u32-u32-asnprintf
func_module unistdio/u32-u32-asprintf
func_module unistdio/u32-u32-snprintf
func_module unistdio/u32-u32-sprintf
func_module unistdio/u32-u32-vasnprintf
func_module unistdio/u32-u32-vasprintf
func_module unistdio/u32-u32-vsnprintf
func_module unistdio/u32-u32-vsprintf
func_end_table
element="Executing programs"

258
lib/unistdio.h Normal file
View File

@@ -0,0 +1,258 @@
/* Elementary Unicode string functions.
Copyright (C) 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _UNISTDIO_H
#define _UNISTDIO_H
#include "unitypes.h"
/* Get size_t. */
#include <stddef.h>
/* Get FILE. */
#include <stdio.h>
/* Get va_list. */
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
#endif
/* These work like the printf function family.
In the format string:
The format directive 'U' takes an UTF-8 string (const uint8_t *).
The format directive 'lU' takes an UTF-16 string (const uint16_t *).
The format directive 'llU' takes an UTF-32 string (const uint32_t *).
The prefix (ulc_, u8_, u16_, u16_) indicates the type of the resulting
string. The prefix 'ulc' stands for "locale encoded".
An infix 'v' indicates that a va_list is passed instead of multiple
arguments.
The functions *sprintf have a 'buf' argument that is assumed to be large
enough. (DANGEROUS! Overflowing the buffer will crash the program.)
The functions *snprintf have a 'buf' argument that is assumed to be 'size'
units large. (DANGEROUS! The resulting string might be truncated in the
middle of a multibyte character.)
The functions *asprintf have a 'resultp' argument. The result will be
freshly allocated and stored in *resultp.
The functions *asnprintf have a (resultbuf, lengthp) argument pair. If
resultbuf is not NULL and the result fits into *lengthp units, it is put
in resultbuf, and resultbuf is returned. Otherwise, a freshly allocated
string is returned. In both cases, *lengthp is set to the length (number
of units) of the returned string. In case of error, NULL is returned and
errno is set.
*/
/* ASCII format string, result in locale dependent encoded 'char *'. */
extern int
ulc_sprintf (char *buf,
const char *format, ...);
extern int
ulc_snprintf (char *buf, size_t size,
const char *format, ...);
extern int
ulc_asprintf (char **resultp,
const char *format, ...);
extern char *
ulc_asnprintf (char *resultbuf, size_t *lengthp,
const char *format, ...);
extern int
ulc_vsprintf (char *buf,
const char *format, va_list ap);
extern int
ulc_vsnprintf (char *buf, size_t size,
const char *format, va_list ap);
extern int
ulc_vasprintf (char **resultp,
const char *format, va_list ap);
extern char *
ulc_vasnprintf (char *resultbuf, size_t *lengthp,
const char *format, va_list ap);
/* ASCII format string, result in UTF-8 format. */
extern int
u8_sprintf (uint8_t *buf,
const char *format, ...);
extern int
u8_snprintf (uint8_t *buf, size_t size,
const char *format, ...);
extern int
u8_asprintf (uint8_t **resultp,
const char *format, ...);
extern uint8_t *
u8_asnprintf (uint8_t *resultbuf, size_t *lengthp,
const char *format, ...);
extern int
u8_vsprintf (uint8_t *buf,
const char *format, va_list ap);
extern int
u8_vsnprintf (uint8_t *buf, size_t size,
const char *format, va_list ap);
extern int
u8_vasprintf (uint8_t **resultp,
const char *format, va_list ap);
extern uint8_t *
u8_vasnprintf (uint8_t *resultbuf, size_t *lengthp,
const char *format, va_list ap);
/* UTF-8 format string, result in UTF-8 format. */
extern int
u8_u8_sprintf (uint8_t *buf,
const uint8_t *format, ...);
extern int
u8_u8_snprintf (uint8_t *buf, size_t size,
const uint8_t *format, ...);
extern int
u8_u8_asprintf (uint8_t **resultp,
const uint8_t *format, ...);
extern uint8_t *
u8_u8_asnprintf (uint8_t *resultbuf, size_t *lengthp,
const uint8_t *format, ...);
extern int
u8_u8_vsprintf (uint8_t *buf,
const uint8_t *format, va_list ap);
extern int
u8_u8_vsnprintf (uint8_t *buf, size_t size,
const uint8_t *format, va_list ap);
extern int
u8_u8_vasprintf (uint8_t **resultp,
const uint8_t *format, va_list ap);
extern uint8_t *
u8_u8_vasnprintf (uint8_t *resultbuf, size_t *lengthp,
const uint8_t *format, va_list ap);
/* ASCII format string, result in UTF-16 format. */
extern int
u16_sprintf (uint16_t *buf,
const char *format, ...);
extern int
u16_snprintf (uint16_t *buf, size_t size,
const char *format, ...);
extern int
u16_asprintf (uint16_t **resultp,
const char *format, ...);
extern uint16_t *
u16_asnprintf (uint16_t *resultbuf, size_t *lengthp,
const char *format, ...);
extern int
u16_vsprintf (uint16_t *buf,
const char *format, va_list ap);
extern int
u16_vsnprintf (uint16_t *buf, size_t size,
const char *format, va_list ap);
extern int
u16_vasprintf (uint16_t **resultp,
const char *format, va_list ap);
extern uint16_t *
u16_vasnprintf (uint16_t *resultbuf, size_t *lengthp,
const char *format, va_list ap);
/* UTF-16 format string, result in UTF-16 format. */
extern int
u16_u16_sprintf (uint16_t *buf,
const uint16_t *format, ...);
extern int
u16_u16_snprintf (uint16_t *buf, size_t size,
const uint16_t *format, ...);
extern int
u16_u16_asprintf (uint16_t **resultp,
const uint16_t *format, ...);
extern uint16_t *
u16_u16_asnprintf (uint16_t *resultbuf, size_t *lengthp,
const uint16_t *format, ...);
extern int
u16_u16_vsprintf (uint16_t *buf,
const uint16_t *format, va_list ap);
extern int
u16_u16_vsnprintf (uint16_t *buf, size_t size,
const uint16_t *format, va_list ap);
extern int
u16_u16_vasprintf (uint16_t **resultp,
const uint16_t *format, va_list ap);
extern uint16_t *
u16_u16_vasnprintf (uint16_t *resultbuf, size_t *lengthp,
const uint16_t *format, va_list ap);
/* ASCII format string, result in UTF-32 format. */
extern int
u32_sprintf (uint32_t *buf,
const char *format, ...);
extern int
u32_snprintf (uint32_t *buf, size_t size,
const char *format, ...);
extern int
u32_asprintf (uint32_t **resultp,
const char *format, ...);
extern uint32_t *
u32_asnprintf (uint32_t *resultbuf, size_t *lengthp,
const char *format, ...);
extern int
u32_vsprintf (uint32_t *buf,
const char *format, va_list ap);
extern int
u32_vsnprintf (uint32_t *buf, size_t size,
const char *format, va_list ap);
extern int
u32_vasprintf (uint32_t **resultp,
const char *format, va_list ap);
extern uint32_t *
u32_vasnprintf (uint32_t *resultbuf, size_t *lengthp,
const char *format, va_list ap);
/* UTF-32 format string, result in UTF-32 format. */
extern int
u32_u32_sprintf (uint32_t *buf,
const uint32_t *format, ...);
extern int
u32_u32_snprintf (uint32_t *buf, size_t size,
const uint32_t *format, ...);
extern int
u32_u32_asprintf (uint32_t **resultp,
const uint32_t *format, ...);
extern uint32_t *
u32_u32_asnprintf (uint32_t *resultbuf, size_t *lengthp,
const uint32_t *format, ...);
extern int
u32_u32_vsprintf (uint32_t *buf,
const uint32_t *format, va_list ap);
extern int
u32_u32_vsnprintf (uint32_t *buf, size_t size,
const uint32_t *format, va_list ap);
extern int
u32_u32_vasprintf (uint32_t **resultp,
const uint32_t *format, va_list ap);
extern uint32_t *
u32_u32_vasnprintf (uint32_t *resultbuf, size_t *lengthp,
const uint32_t *format, va_list ap);
/* ASCII format string, output to FILE in locale dependent encoding. */
extern int
ulc_fprintf (FILE *stream,
const char *format, ...);
extern int
ulc_vfprintf (FILE *stream,
const char *format, va_list ap);
#ifdef __cplusplus
}
#endif
#endif /* _UNISTDIO_H */

View File

@@ -0,0 +1,29 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
DCHAR_T *
ASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, const FCHAR_T *format, ...)
{
va_list args;
DCHAR_T *result;
va_start (args, format);
result = VASNPRINTF (resultbuf, lengthp, format, args);
va_end (args);
return result;
}

29
lib/unistdio/u-asprintf.h Normal file
View File

@@ -0,0 +1,29 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
int
ASPRINTF (DCHAR_T **resultp, const FCHAR_T *format, ...)
{
va_list args;
int result;
va_start (args, format);
result = VASPRINTF (resultp, format, args);
va_end (args);
return result;
}

View File

@@ -0,0 +1,24 @@
/* Decomposed printf argument list.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio/u-printf-args.h"
#include "printf-args.c"

View File

@@ -0,0 +1,29 @@
/* Decomposed printf argument list.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _U_PRINTF_ARGS_H
#define _U_PRINTF_ARGS_H
#include "unitypes.h"
/* Parametrization of printf-args.h. */
#define ENABLE_UNISTDIO 1
#define PRINTF_FETCHARGS u_printf_fetchargs
#include "printf-args.h"
#endif /* _U_PRINTF_ARGS_H */

View File

@@ -0,0 +1,29 @@
/* Parse printf format string.
Copyright (C) 1999, 2002, 2005, 2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _U_PRINTF_PARSE_H
#define _U_PRINTF_PARSE_H
#include "unistdio/u-printf-args.h"
/* Parametrization of printf-parse.h. */
#undef ENABLE_UNISTDIO
#define ENABLE_UNISTDIO 1
#include "printf-parse.h"
#endif /* _U_PRINTF_PARSE_H */

29
lib/unistdio/u-snprintf.h Normal file
View File

@@ -0,0 +1,29 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
int
SNPRINTF (DCHAR_T *buf, size_t size, const FCHAR_T *format, ...)
{
va_list args;
int result;
va_start (args, format);
result = VSNPRINTF (buf, size, format, args);
va_end (args);
return result;
}

29
lib/unistdio/u-sprintf.h Normal file
View File

@@ -0,0 +1,29 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
int
SPRINTF (DCHAR_T *buf, const FCHAR_T *format, ...)
{
va_list args;
int result;
va_start (args, format);
result = VSPRINTF (buf, format, args);
va_end (args);
return result;
}

View File

@@ -0,0 +1,42 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
#ifndef EOVERFLOW
# define EOVERFLOW E2BIG
#endif
int
VASPRINTF (DCHAR_T **resultp, const FCHAR_T *format, va_list args)
{
size_t length;
DCHAR_T *result = VASNPRINTF (NULL, &length, format, args);
if (result == NULL)
return -1;
if (length > INT_MAX)
{
free (result);
errno = EOVERFLOW;
return -1;
}
*resultp = result;
/* Return the number of resulting units, excluding the trailing NUL. */
return length;
}

View File

@@ -0,0 +1,59 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
#ifndef EOVERFLOW
# define EOVERFLOW E2BIG
#endif
int
VSNPRINTF (DCHAR_T *buf, size_t size, const FCHAR_T *format, va_list args)
{
size_t length;
DCHAR_T *result;
if (size == 0)
buf = NULL;
else
length = size;
result = VASNPRINTF (buf, &length, format, args);
if (result == NULL)
return -1;
if (result != buf)
{
if (size != 0)
{
/* The result did not fit into the buffer. Copy the initial segment
into the buffer, truncating it if necessary. */
size_t n = (length < size ? length : size - 1);
DCHAR_CPY (buf, result, n);
buf[n] = '\0';
}
free (result);
}
if (length > INT_MAX)
{
errno = EOVERFLOW;
return -1;
}
/* Return the number of resulting units, excluding the trailing NUL. */
return length;
}

65
lib/unistdio/u-vsprintf.h Normal file
View File

@@ -0,0 +1,65 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
#ifndef EOVERFLOW
# define EOVERFLOW E2BIG
#endif
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
#endif
int
VSPRINTF (DCHAR_T *buf, const FCHAR_T *format, va_list args)
{
/* Pass an infinite length. But note that *vasnprintf may fail if the buffer
argument is larger than INT_MAX (if that fits into a 'size_t' at all).
Also note that glibc's iconv fails with E2BIG when we pass a length that
is so large that buf + length wraps around, i.e.
(uintptr_t) (buf + length) < (uintptr_t) buf. */
size_t length;
DCHAR_T *result;
/* Set length = min (SIZE_MAX, INT_MAX, - (uintptr_t) buf - 1). */
length = (SIZE_MAX < INT_MAX ? SIZE_MAX : INT_MAX);
if (length > (~ (uintptr_t) buf) / sizeof (DCHAR_T))
length = (~ (uintptr_t) buf) / sizeof (DCHAR_T);
result = VASNPRINTF (buf, &length, format, args);
if (result == NULL)
return -1;
/* The infinite buffer size guarantees that the result is not malloc()ed. */
if (result != buf)
{
/* length is near SIZE_MAX. */
free (result);
errno = EOVERFLOW;
return -1;
}
if (length > INT_MAX)
{
errno = EOVERFLOW;
return -1;
}
/* Return the number of resulting units, excluding the trailing NUL. */
return length;
}

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASNPRINTF u16_asnprintf
#define VASNPRINTF u16_vasnprintf
#define FCHAR_T char
#define DCHAR_T uint16_t
#include "u-asnprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASPRINTF u16_asprintf
#define VASPRINTF u16_vasprintf
#define FCHAR_T char
#define DCHAR_T uint16_t
#include "u-asprintf.h"

View File

@@ -0,0 +1,28 @@
/* Formatted output to strings.
Copyright (C) 1999-2000, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio/u-printf-parse.h"
#define PRINTF_PARSE u16_printf_parse
#define CHAR_T uint16_t
#define DIRECTIVE u16_directive
#define DIRECTIVES u16_directives
#include "printf-parse.c"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SNPRINTF u16_snprintf
#define VSNPRINTF u16_vsnprintf
#define FCHAR_T char
#define DCHAR_T uint16_t
#include "u-snprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SPRINTF u16_sprintf
#define VSPRINTF u16_vsprintf
#define FCHAR_T char
#define DCHAR_T uint16_t
#include "u-sprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASNPRINTF u16_u16_asnprintf
#define VASNPRINTF u16_u16_vasnprintf
#define FCHAR_T uint16_t
#define DCHAR_T uint16_t
#include "u-asnprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASPRINTF u16_u16_asprintf
#define VASPRINTF u16_u16_vasprintf
#define FCHAR_T uint16_t
#define DCHAR_T uint16_t
#include "u-asprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SNPRINTF u16_u16_snprintf
#define VSNPRINTF u16_u16_vsnprintf
#define FCHAR_T uint16_t
#define DCHAR_T uint16_t
#include "u-snprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SPRINTF u16_u16_sprintf
#define VSPRINTF u16_u16_vsprintf
#define FCHAR_T uint16_t
#define DCHAR_T uint16_t
#include "u-sprintf.h"

View File

@@ -0,0 +1,51 @@
/* Formatted output to UTF-16 strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
This must come before <config.h> because <config.h> may include
<features.h>, and once <features.h> has been included, it's too late. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#include <config.h>
#include <alloca.h>
/* Specification. */
#include "unistdio.h"
#include "uniconv.h"
#include "unistr.h"
#include "unistdio/u-printf-parse.h"
#define VASNPRINTF u16_u16_vasnprintf
#define FCHAR_T uint16_t
#define DIRECTIVE u16_directive
#define DIRECTIVES u16_directives
#define PRINTF_PARSE u16_printf_parse
#define DCHAR_T uint16_t
#define DCHAR_T_IS_UINT16_T 1
#define DCHAR_CPY u16_cpy
#define DCHAR_SET u16_set
#define DCHAR_MBSNLEN u16_mbsnlen
#define DCHAR_IS_UINT16_T 1
#define U8_TO_DCHAR u8_to_u16
#define U32_TO_DCHAR u32_to_u16
#define DCHAR_CONV_FROM_ENCODING u16_conv_from_encoding
#define TCHAR_T char
#include "vasnprintf.c"

View File

@@ -0,0 +1,32 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#define VASPRINTF u16_u16_vasprintf
#define VASNPRINTF u16_u16_vasnprintf
#define FCHAR_T uint16_t
#define DCHAR_T uint16_t
#include "u-vasprintf.h"

View File

@@ -0,0 +1,35 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#include "unistr.h"
#define VSNPRINTF u16_u16_vsnprintf
#define VASNPRINTF u16_u16_vasnprintf
#define FCHAR_T uint16_t
#define DCHAR_T uint16_t
#define DCHAR_CPY u16_cpy
#include "u-vsnprintf.h"

View File

@@ -0,0 +1,34 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#define VSPRINTF u16_u16_vsprintf
#define VASNPRINTF u16_u16_vasnprintf
#define FCHAR_T uint16_t
#define DCHAR_T uint16_t
#include "u-vsprintf.h"

View File

@@ -0,0 +1,52 @@
/* Formatted output to UTF-16 strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
This must come before <config.h> because <config.h> may include
<features.h>, and once <features.h> has been included, it's too late. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#include <config.h>
#include <alloca.h>
/* Specification. */
#include "unistdio.h"
#include "uniconv.h"
#include "unistr.h"
#include "unistdio/u-printf-parse.h"
#define VASNPRINTF u16_vasnprintf
#define FCHAR_T char
#define DIRECTIVE char_directive
#define DIRECTIVES char_directives
#define ASCII_ONLY 1
#define PRINTF_PARSE ulc_printf_parse
#define DCHAR_T uint16_t
#define DCHAR_T_IS_UINT16_T 1
#define DCHAR_CPY u16_cpy
#define DCHAR_SET u16_set
#define DCHAR_MBSNLEN u16_mbsnlen
#define DCHAR_IS_UINT16_T 1
#define U8_TO_DCHAR u8_to_u16
#define U32_TO_DCHAR u32_to_u16
#define DCHAR_CONV_FROM_ENCODING u16_conv_from_encoding
#define TCHAR_T char
#include "vasnprintf.c"

View File

@@ -0,0 +1,32 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#define VASPRINTF u16_vasprintf
#define VASNPRINTF u16_vasnprintf
#define FCHAR_T char
#define DCHAR_T uint16_t
#include "u-vasprintf.h"

View File

@@ -0,0 +1,35 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#include "unistr.h"
#define VSNPRINTF u16_vsnprintf
#define VASNPRINTF u16_vasnprintf
#define FCHAR_T char
#define DCHAR_T uint16_t
#define DCHAR_CPY u16_cpy
#include "u-vsnprintf.h"

View File

@@ -0,0 +1,34 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#define VSPRINTF u16_vsprintf
#define VASNPRINTF u16_vasnprintf
#define FCHAR_T char
#define DCHAR_T uint16_t
#include "u-vsprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASNPRINTF u32_asnprintf
#define VASNPRINTF u32_vasnprintf
#define FCHAR_T char
#define DCHAR_T uint32_t
#include "u-asnprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASPRINTF u32_asprintf
#define VASPRINTF u32_vasprintf
#define FCHAR_T char
#define DCHAR_T uint32_t
#include "u-asprintf.h"

View File

@@ -0,0 +1,28 @@
/* Formatted output to strings.
Copyright (C) 1999-2000, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio/u-printf-parse.h"
#define PRINTF_PARSE u32_printf_parse
#define CHAR_T uint32_t
#define DIRECTIVE u32_directive
#define DIRECTIVES u32_directives
#include "printf-parse.c"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SNPRINTF u32_snprintf
#define VSNPRINTF u32_vsnprintf
#define FCHAR_T char
#define DCHAR_T uint32_t
#include "u-snprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SPRINTF u32_sprintf
#define VSPRINTF u32_vsprintf
#define FCHAR_T char
#define DCHAR_T uint32_t
#include "u-sprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASNPRINTF u32_u32_asnprintf
#define VASNPRINTF u32_u32_vasnprintf
#define FCHAR_T uint32_t
#define DCHAR_T uint32_t
#include "u-asnprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASPRINTF u32_u32_asprintf
#define VASPRINTF u32_u32_vasprintf
#define FCHAR_T uint32_t
#define DCHAR_T uint32_t
#include "u-asprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SNPRINTF u32_u32_snprintf
#define VSNPRINTF u32_u32_vsnprintf
#define FCHAR_T uint32_t
#define DCHAR_T uint32_t
#include "u-snprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SPRINTF u32_u32_sprintf
#define VSPRINTF u32_u32_vsprintf
#define FCHAR_T uint32_t
#define DCHAR_T uint32_t
#include "u-sprintf.h"

View File

@@ -0,0 +1,51 @@
/* Formatted output to UTF-32 strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
This must come before <config.h> because <config.h> may include
<features.h>, and once <features.h> has been included, it's too late. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#include <config.h>
#include <alloca.h>
/* Specification. */
#include "unistdio.h"
#include "uniconv.h"
#include "unistr.h"
#include "unistdio/u-printf-parse.h"
#define VASNPRINTF u32_u32_vasnprintf
#define FCHAR_T uint32_t
#define DIRECTIVE u32_directive
#define DIRECTIVES u32_directives
#define PRINTF_PARSE u32_printf_parse
#define DCHAR_T uint32_t
#define DCHAR_T_IS_UINT32_T 1
#define DCHAR_CPY u32_cpy
#define DCHAR_SET u32_set
#define DCHAR_MBSNLEN u32_mbsnlen
#define DCHAR_IS_UINT32_T 1
#define U8_TO_DCHAR u8_to_u32
#define U16_TO_DCHAR u16_to_u32
#define DCHAR_CONV_FROM_ENCODING u32_conv_from_encoding
#define TCHAR_T char
#include "vasnprintf.c"

View File

@@ -0,0 +1,32 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#define VASPRINTF u32_u32_vasprintf
#define VASNPRINTF u32_u32_vasnprintf
#define FCHAR_T uint32_t
#define DCHAR_T uint32_t
#include "u-vasprintf.h"

View File

@@ -0,0 +1,35 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#include "unistr.h"
#define VSNPRINTF u32_u32_vsnprintf
#define VASNPRINTF u32_u32_vasnprintf
#define FCHAR_T uint32_t
#define DCHAR_T uint32_t
#define DCHAR_CPY u32_cpy
#include "u-vsnprintf.h"

View File

@@ -0,0 +1,34 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#define VSPRINTF u32_u32_vsprintf
#define VASNPRINTF u32_u32_vasnprintf
#define FCHAR_T uint32_t
#define DCHAR_T uint32_t
#include "u-vsprintf.h"

View File

@@ -0,0 +1,52 @@
/* Formatted output to UTF-32 strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
This must come before <config.h> because <config.h> may include
<features.h>, and once <features.h> has been included, it's too late. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#include <config.h>
#include <alloca.h>
/* Specification. */
#include "unistdio.h"
#include "uniconv.h"
#include "unistr.h"
#include "unistdio/u-printf-parse.h"
#define VASNPRINTF u32_vasnprintf
#define FCHAR_T char
#define DIRECTIVE char_directive
#define DIRECTIVES char_directives
#define ASCII_ONLY 1
#define PRINTF_PARSE ulc_printf_parse
#define DCHAR_T uint32_t
#define DCHAR_T_IS_UINT32_T 1
#define DCHAR_CPY u32_cpy
#define DCHAR_SET u32_set
#define DCHAR_MBSNLEN u32_mbsnlen
#define DCHAR_IS_UINT32_T 1
#define U8_TO_DCHAR u8_to_u32
#define U16_TO_DCHAR u16_to_u32
#define DCHAR_CONV_FROM_ENCODING u32_conv_from_encoding
#define TCHAR_T char
#include "vasnprintf.c"

View File

@@ -0,0 +1,32 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#define VASPRINTF u32_vasprintf
#define VASNPRINTF u32_vasnprintf
#define FCHAR_T char
#define DCHAR_T uint32_t
#include "u-vasprintf.h"

View File

@@ -0,0 +1,35 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#include "unistr.h"
#define VSNPRINTF u32_vsnprintf
#define VASNPRINTF u32_vasnprintf
#define FCHAR_T char
#define DCHAR_T uint32_t
#define DCHAR_CPY u32_cpy
#include "u-vsnprintf.h"

View File

@@ -0,0 +1,34 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#define VSPRINTF u32_vsprintf
#define VASNPRINTF u32_vasnprintf
#define FCHAR_T char
#define DCHAR_T uint32_t
#include "u-vsprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASNPRINTF u8_asnprintf
#define VASNPRINTF u8_vasnprintf
#define FCHAR_T char
#define DCHAR_T uint8_t
#include "u-asnprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASPRINTF u8_asprintf
#define VASPRINTF u8_vasprintf
#define FCHAR_T char
#define DCHAR_T uint8_t
#include "u-asprintf.h"

View File

@@ -0,0 +1,28 @@
/* Formatted output to strings.
Copyright (C) 1999-2000, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio/u-printf-parse.h"
#define PRINTF_PARSE u8_printf_parse
#define CHAR_T uint8_t
#define DIRECTIVE u8_directive
#define DIRECTIVES u8_directives
#include "printf-parse.c"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SNPRINTF u8_snprintf
#define VSNPRINTF u8_vsnprintf
#define FCHAR_T char
#define DCHAR_T uint8_t
#include "u-snprintf.h"

30
lib/unistdio/u8-sprintf.c Normal file
View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SPRINTF u8_sprintf
#define VSPRINTF u8_vsprintf
#define FCHAR_T char
#define DCHAR_T uint8_t
#include "u-sprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASNPRINTF u8_u8_asnprintf
#define VASNPRINTF u8_u8_vasnprintf
#define FCHAR_T uint8_t
#define DCHAR_T uint8_t
#include "u-asnprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASPRINTF u8_u8_asprintf
#define VASPRINTF u8_u8_vasprintf
#define FCHAR_T uint8_t
#define DCHAR_T uint8_t
#include "u-asprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SNPRINTF u8_u8_snprintf
#define VSNPRINTF u8_u8_vsnprintf
#define FCHAR_T uint8_t
#define DCHAR_T uint8_t
#include "u-snprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SPRINTF u8_u8_sprintf
#define VSPRINTF u8_u8_vsprintf
#define FCHAR_T uint8_t
#define DCHAR_T uint8_t
#include "u-sprintf.h"

View File

@@ -0,0 +1,51 @@
/* Formatted output to UTF-8 strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
This must come before <config.h> because <config.h> may include
<features.h>, and once <features.h> has been included, it's too late. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#include <config.h>
#include <alloca.h>
/* Specification. */
#include "unistdio.h"
#include "uniconv.h"
#include "unistr.h"
#include "unistdio/u-printf-parse.h"
#define VASNPRINTF u8_u8_vasnprintf
#define FCHAR_T uint8_t
#define DIRECTIVE u8_directive
#define DIRECTIVES u8_directives
#define PRINTF_PARSE u8_printf_parse
#define DCHAR_T uint8_t
#define DCHAR_T_IS_UINT8_T 1
#define DCHAR_CPY u8_cpy
#define DCHAR_SET u8_set
#define DCHAR_MBSNLEN u8_mbsnlen
#define DCHAR_IS_UINT8_T 1
#define U16_TO_DCHAR u16_to_u8
#define U32_TO_DCHAR u32_to_u8
#define DCHAR_CONV_FROM_ENCODING u8_conv_from_encoding
#define TCHAR_T char
#include "vasnprintf.c"

View File

@@ -0,0 +1,32 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#define VASPRINTF u8_u8_vasprintf
#define VASNPRINTF u8_u8_vasnprintf
#define FCHAR_T uint8_t
#define DCHAR_T uint8_t
#include "u-vasprintf.h"

View File

@@ -0,0 +1,35 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#include "unistr.h"
#define VSNPRINTF u8_u8_vsnprintf
#define VASNPRINTF u8_u8_vasnprintf
#define FCHAR_T uint8_t
#define DCHAR_T uint8_t
#define DCHAR_CPY u8_cpy
#include "u-vsnprintf.h"

View File

@@ -0,0 +1,34 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#define VSPRINTF u8_u8_vsprintf
#define VASNPRINTF u8_u8_vasnprintf
#define FCHAR_T uint8_t
#define DCHAR_T uint8_t
#include "u-vsprintf.h"

View File

@@ -0,0 +1,52 @@
/* Formatted output to UTF-8 strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
This must come before <config.h> because <config.h> may include
<features.h>, and once <features.h> has been included, it's too late. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#include <config.h>
#include <alloca.h>
/* Specification. */
#include "unistdio.h"
#include "uniconv.h"
#include "unistr.h"
#include "unistdio/u-printf-parse.h"
#define VASNPRINTF u8_vasnprintf
#define FCHAR_T char
#define DIRECTIVE char_directive
#define DIRECTIVES char_directives
#define ASCII_ONLY 1
#define PRINTF_PARSE ulc_printf_parse
#define DCHAR_T uint8_t
#define DCHAR_T_IS_UINT8_T 1
#define DCHAR_CPY u8_cpy
#define DCHAR_SET u8_set
#define DCHAR_MBSNLEN u8_mbsnlen
#define DCHAR_IS_UINT8_T 1
#define U16_TO_DCHAR u16_to_u8
#define U32_TO_DCHAR u32_to_u8
#define DCHAR_CONV_FROM_ENCODING u8_conv_from_encoding
#define TCHAR_T char
#include "vasnprintf.c"

View File

@@ -0,0 +1,32 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#define VASPRINTF u8_vasprintf
#define VASNPRINTF u8_vasnprintf
#define FCHAR_T char
#define DCHAR_T uint8_t
#include "u-vasprintf.h"

View File

@@ -0,0 +1,35 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#include "unistr.h"
#define VSNPRINTF u8_vsnprintf
#define VASNPRINTF u8_vasnprintf
#define FCHAR_T char
#define DCHAR_T uint8_t
#define DCHAR_CPY u8_cpy
#include "u-vsnprintf.h"

View File

@@ -0,0 +1,34 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#define VSPRINTF u8_vsprintf
#define VASNPRINTF u8_vasnprintf
#define FCHAR_T char
#define DCHAR_T uint8_t
#include "u-vsprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASNPRINTF ulc_asnprintf
#define VASNPRINTF ulc_vasnprintf
#define FCHAR_T char
#define DCHAR_T char
#include "u-asnprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define ASPRINTF ulc_asprintf
#define VASPRINTF ulc_vasprintf
#define FCHAR_T char
#define DCHAR_T char
#include "u-asprintf.h"

View File

@@ -0,0 +1,80 @@
/* Formatted output to a stream.
Copyright (C) 2004, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "fseterr.h"
/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
#ifndef EOVERFLOW
# define EOVERFLOW E2BIG
#endif
/* Print formatted output to the stream FP.
Return string length of formatted string. On error, return a negative
value. */
int
ulc_fprintf (FILE *fp, const char *format, ...)
{
char buf[2000];
char *output;
size_t len;
size_t lenbuf = sizeof (buf);
va_list args;
va_start (args, format);
output = ulc_vasnprintf (buf, &lenbuf, format, args);
len = lenbuf;
va_end (args);
if (!output)
{
fseterr (fp);
return -1;
}
if (fwrite (output, 1, len, fp) < len)
{
if (output != buf)
{
int saved_errno = errno;
free (output);
errno = saved_errno;
}
return -1;
}
if (len > INT_MAX)
{
errno = EOVERFLOW;
fseterr (fp);
return -1;
}
return len;
}

View File

@@ -0,0 +1,29 @@
/* Formatted output to strings.
Copyright (C) 1999-2000, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio/u-printf-parse.h"
#define PRINTF_PARSE ulc_printf_parse
#define CHAR_T char
#define CHAR_T_ONLY_ASCII 1
#define DIRECTIVE char_directive
#define DIRECTIVES char_directives
#include "printf-parse.c"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SNPRINTF ulc_snprintf
#define VSNPRINTF ulc_vsnprintf
#define FCHAR_T char
#define DCHAR_T char
#include "u-snprintf.h"

View File

@@ -0,0 +1,30 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <stdarg.h>
#define SPRINTF ulc_sprintf
#define VSPRINTF ulc_vsprintf
#define FCHAR_T char
#define DCHAR_T char
#include "u-sprintf.h"

View File

@@ -0,0 +1,48 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
This must come before <config.h> because <config.h> may include
<features.h>, and once <features.h> has been included, it's too late. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#include <config.h>
#include <alloca.h>
/* Specification. */
#include "unistdio.h"
#include "uniconv.h"
#include "unistr.h"
#include "unistdio/u-printf-parse.h"
#define VASNPRINTF ulc_vasnprintf
#define FCHAR_T char
#define DIRECTIVE char_directive
#define DIRECTIVES char_directives
#define FCHAR_T_ONLY_ASCII 1
#define PRINTF_PARSE ulc_printf_parse
#define DCHAR_T char
#define DCHAR_CPY memcpy
#define DCHAR_SET memset
#define DCHAR_MBSNLEN mbsnlen
#define TCHAR_T char
#define DCHAR_IS_TCHAR 1
#include "vasnprintf.c"

View File

@@ -0,0 +1,32 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#define VASPRINTF ulc_vasprintf
#define VASNPRINTF ulc_vasnprintf
#define FCHAR_T char
#define DCHAR_T char
#include "u-vasprintf.h"

View File

@@ -0,0 +1,77 @@
/* Formatted output to a stream.
Copyright (C) 2004, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "fseterr.h"
/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
#ifndef EOVERFLOW
# define EOVERFLOW E2BIG
#endif
/* Print formatted output to the stream FP.
Return string length of formatted string. On error, return a negative
value. */
int
ulc_vfprintf (FILE *fp, const char *format, va_list args)
{
char buf[2000];
char *output;
size_t len;
size_t lenbuf = sizeof (buf);
output = ulc_vasnprintf (buf, &lenbuf, format, args);
len = lenbuf;
if (!output)
{
fseterr (fp);
return -1;
}
if (fwrite (output, 1, len, fp) < len)
{
if (output != buf)
{
int saved_errno = errno;
free (output);
errno = saved_errno;
}
return -1;
}
if (len > INT_MAX)
{
errno = EOVERFLOW;
fseterr (fp);
return -1;
}
return len;
}

View File

@@ -0,0 +1,35 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#define VSNPRINTF ulc_vsnprintf
#define VASNPRINTF ulc_vasnprintf
#define FCHAR_T char
#define DCHAR_T char
#define DCHAR_CPY memcpy
#include "u-vsnprintf.h"

View File

@@ -0,0 +1,34 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#include <config.h>
/* Specification. */
#include "unistdio.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#define VSPRINTF ulc_vsprintf
#define VASNPRINTF ulc_vasnprintf
#define FCHAR_T char
#define DCHAR_T char
#include "u-vsprintf.h"

22
modules/unistdio/base Normal file
View File

@@ -0,0 +1,22 @@
Description:
Base layer for formatted output to strings.
Files:
lib/unistdio.h
Depends-on:
unitypes
configure.ac:
Makefile.am:
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,28 @@
Description:
Fetching a printf argument list.
Files:
lib/unistdio/u-printf-args.h
lib/unistdio/u-printf-args.c
lib/printf-args.h
lib/printf-args.c
m4/vasnprintf.m4
Depends-on:
unitypes
configure.ac:
gl_PREREQ_PRINTF_ARGS
Makefile.am:
lib_SOURCES += unistdio/u-printf-args.c
Include:
"unistdio/u-printf-args.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,26 @@
Description:
Formatted output to an UTF-16 string, with automatic memory allocation and
bounded output size.
Files:
lib/unistdio/u16-asnprintf.c
lib/unistdio/u-asnprintf.h
Depends-on:
unistdio/base
unistdio/u16-vasnprintf
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-asnprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,14 @@
Files:
tests/unistdio/test-u16-asnprintf1.c
tests/unistdio/test-u16-asnprintf1.h
tests/unistdio/test-u16-printf1.h
Depends-on:
configure.ac:
Makefile.am:
TESTS += test-u16-asnprintf1
check_PROGRAMS += test-u16-asnprintf1
test_u16_asnprintf1_SOURCES = unistdio/test-u16-asnprintf1.c
test_u16_asnprintf1_LDADD = $(LDADD) @LIBICONV@

View File

@@ -0,0 +1,25 @@
Description:
Formatted output to an UTF-16 string, with automatic memory allocation.
Files:
lib/unistdio/u16-asprintf.c
lib/unistdio/u-asprintf.h
Depends-on:
unistdio/base
unistdio/u16-vasprintf
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-asprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,30 @@
Description:
Parsing an UTF-16 format string.
Files:
lib/unistdio/u-printf-parse.h
lib/unistdio/u16-printf-parse.c
lib/printf-parse.h
lib/printf-parse.c
m4/vasnprintf.m4
Depends-on:
unistdio/u-printf-args
stdint
xsize
configure.ac:
gl_PREREQ_PRINTF_PARSE
Makefile.am:
lib_SOURCES += unistdio/u16-printf-parse.c
Include:
"unistdio/u-printf-parse.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,25 @@
Description:
Formatted output to a fixed-length UTF-16 string.
Files:
lib/unistdio/u16-snprintf.c
lib/unistdio/u-snprintf.h
Depends-on:
unistdio/base
unistdio/u16-vsnprintf
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-snprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,25 @@
Description:
Formatted output to an UTF-16 string.
Files:
lib/unistdio/u16-sprintf.c
lib/unistdio/u-sprintf.h
Depends-on:
unistdio/base
unistdio/u16-sprintf
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-sprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,26 @@
Description:
Formatted output to an UTF-16 string, with automatic memory allocation and
bounded output size.
Files:
lib/unistdio/u16-u16-asnprintf.c
lib/unistdio/u-asnprintf.h
Depends-on:
unistdio/base
unistdio/u16-u16-vasnprintf
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-u16-asnprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,25 @@
Description:
Formatted output to an UTF-16 string, with automatic memory allocation.
Files:
lib/unistdio/u16-u16-asprintf.c
lib/unistdio/u-asprintf.h
Depends-on:
unistdio/base
unistdio/u16-u16-vasprintf
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-u16-asprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,25 @@
Description:
Formatted output to a fixed-length UTF-16 string.
Files:
lib/unistdio/u16-u16-snprintf.c
lib/unistdio/u-snprintf.h
Depends-on:
unistdio/base
unistdio/u16-u16-vsnprintf
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-u16-snprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,25 @@
Description:
Formatted output to an UTF-16 string.
Files:
lib/unistdio/u16-u16-sprintf.c
lib/unistdio/u-sprintf.h
Depends-on:
unistdio/base
unistdio/u16-u16-sprintf
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-u16-sprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,59 @@
Description:
Formatted output to UTF-16 strings.
Files:
lib/unistdio/u16-u16-vasnprintf.c
lib/vasnprintf.c
m4/vasnprintf.m4
m4/printf.m4
m4/wchar_t.m4
m4/wint_t.m4
m4/longlong.m4
m4/intmax_t.m4
m4/stdint_h.m4
m4/inttypes_h.m4
m4/eoverflow.m4
Depends-on:
unistdio/base
unistdio/u16-printf-parse
unistdio/u-printf-args
uniconv/u16-conv-from-enc
unistr/u16-cpy
unistr/u16-set
unistr/u16-mbsnlen
unistr/u8-to-u16
unistr/u32-to-u16
unistr/u8-strlen
unistr/u8-strmblen
unistr/u16-strlen
unistr/u16-strmblen
unistr/u32-strlen
unistr/u32-strmblen
isnan-nolibm
isnanl-nolibm
frexpl-nolibm
printf-frexp
printf-frexpl
signbit
fpucw
printf-safe
alloca-opt
localcharset
xsize
configure.ac:
gl_PREREQ_VASNPRINTF_WITH_EXTRAS
Makefile.am:
lib_SOURCES += unistdio/u16-u16-vasnprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,25 @@
Description:
Formatted output to an UTF-16 string, with automatic memory allocation.
Files:
lib/unistdio/u16-u16-vasprintf.c
lib/unistdio/u-vasprintf.h
Depends-on:
unistdio/base
unistdio/u16-u16-vasnprintf
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-u16-vasprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,26 @@
Description:
Formatted output to a fixed-length UTF-16 string.
Files:
lib/unistdio/u16-u16-vsnprintf.c
lib/unistdio/u-vsnprintf.h
Depends-on:
unistdio/base
unistdio/u16-u16-vasnprintf
unistr/u16-cpy
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-u16-vsnprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,26 @@
Description:
Formatted output to an UTF-16 string.
Files:
lib/unistdio/u16-u16-vsprintf.c
lib/unistdio/u-vsprintf.h
Depends-on:
unistdio/base
unistdio/u16-u16-vasnprintf
stdint
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-u16-vsprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,59 @@
Description:
Formatted output to UTF-16 strings.
Files:
lib/unistdio/u16-vasnprintf.c
lib/vasnprintf.c
m4/vasnprintf.m4
m4/printf.m4
m4/wchar_t.m4
m4/wint_t.m4
m4/longlong.m4
m4/intmax_t.m4
m4/stdint_h.m4
m4/inttypes_h.m4
m4/eoverflow.m4
Depends-on:
unistdio/base
unistdio/ulc-printf-parse
unistdio/u-printf-args
uniconv/u16-conv-from-enc
unistr/u16-cpy
unistr/u16-set
unistr/u16-mbsnlen
unistr/u8-to-u16
unistr/u32-to-u16
unistr/u8-strlen
unistr/u8-strmblen
unistr/u16-strlen
unistr/u16-strmblen
unistr/u32-strlen
unistr/u32-strmblen
isnan-nolibm
isnanl-nolibm
frexpl-nolibm
printf-frexp
printf-frexpl
signbit
fpucw
printf-safe
alloca-opt
localcharset
xsize
configure.ac:
gl_PREREQ_VASNPRINTF_WITH_EXTRAS
Makefile.am:
lib_SOURCES += unistdio/u16-vasnprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,31 @@
Files:
tests/unistdio/test-u16-vasnprintf1.c
tests/unistdio/test-u16-asnprintf1.h
tests/unistdio/test-u16-printf1.h
tests/unistdio/test-u16-vasnprintf2.sh
tests/unistdio/test-u16-vasnprintf2.c
tests/unistdio/test-u16-vasnprintf3.sh
tests/unistdio/test-u16-vasnprintf3.c
m4/locale-fr.m4
Depends-on:
unistr/u16-cmp
unistr/u16-cpy
unistr/u16-strcmp
unistr/u16-strlen
configure.ac:
gt_LOCALE_FR
gt_LOCALE_FR_UTF8
Makefile.am:
TESTS += test-u16-vasnprintf1 unistdio/test-u16-vasnprintf2.sh unistdio/test-u16-vasnprintf3.sh
TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
check_PROGRAMS += test-u16-vasnprintf1 test-u16-vasnprintf2 test-u16-vasnprintf3
test_u16_vasnprintf1_SOURCES = unistdio/test-u16-vasnprintf1.c
test_u16_vasnprintf1_LDADD = $(LDADD) @LIBICONV@
test_u16_vasnprintf2_SOURCES = unistdio/test-u16-vasnprintf2.c
test_u16_vasnprintf2_LDADD = $(LDADD) @LIBICONV@
test_u16_vasnprintf3_SOURCES = unistdio/test-u16-vasnprintf3.c
test_u16_vasnprintf3_LDADD = $(LDADD) @LIBICONV@
EXTRA_DIST += unistdio/test-u16-vasnprintf2.sh unistdio/test-u16-vasnprintf3.sh

View File

@@ -0,0 +1,25 @@
Description:
Formatted output to an UTF-16 string, with automatic memory allocation.
Files:
lib/unistdio/u16-vasprintf.c
lib/unistdio/u-vasprintf.h
Depends-on:
unistdio/base
unistdio/u16-vasnprintf
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-vasprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,13 @@
Files:
tests/unistdio/test-u16-vasprintf1.c
tests/unistdio/test-u16-printf1.h
Depends-on:
configure.ac:
Makefile.am:
TESTS += test-u16-vasprintf1
check_PROGRAMS += test-u16-vasprintf1
test_u16_vasprintf1_SOURCES = unistdio/test-u16-vasprintf1.c
test_u16_vasprintf1_LDADD = $(LDADD) @LIBICONV@

View File

@@ -0,0 +1,26 @@
Description:
Formatted output to a fixed-length UTF-16 string.
Files:
lib/unistdio/u16-vsnprintf.c
lib/unistdio/u-vsnprintf.h
Depends-on:
unistdio/base
unistdio/u16-vasnprintf
unistr/u16-cpy
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-vsnprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,14 @@
Files:
tests/unistdio/test-u16-vsnprintf1.c
tests/unistdio/test-u16-printf1.h
Depends-on:
xalloc
configure.ac:
Makefile.am:
TESTS += test-u16-vsnprintf1
check_PROGRAMS += test-u16-vsnprintf1
test_u16_vsnprintf1_SOURCES = unistdio/test-u16-vsnprintf1.c
test_u16_vsnprintf1_LDADD = $(LDADD) @LIBICONV@

View File

@@ -0,0 +1,26 @@
Description:
Formatted output to an UTF-16 string.
Files:
lib/unistdio/u16-vsprintf.c
lib/unistdio/u-vsprintf.h
Depends-on:
unistdio/base
unistdio/u16-vasnprintf
stdint
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u16-vsprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

View File

@@ -0,0 +1,14 @@
Files:
tests/unistdio/test-u16-vsprintf1.c
tests/unistdio/test-u16-printf1.h
Depends-on:
xalloc
configure.ac:
Makefile.am:
TESTS += test-u16-vsprintf1
check_PROGRAMS += test-u16-vsprintf1
test_u16_vsprintf1_SOURCES = unistdio/test-u16-vsprintf1.c
test_u16_vsprintf1_LDADD = $(LDADD) @LIBICONV@

View File

@@ -0,0 +1,26 @@
Description:
Formatted output to an UTF-32 string, with automatic memory allocation and
bounded output size.
Files:
lib/unistdio/u32-asnprintf.c
lib/unistdio/u-asnprintf.h
Depends-on:
unistdio/base
unistdio/u32-vasnprintf
configure.ac:
Makefile.am:
lib_SOURCES += unistdio/u32-asnprintf.c
Include:
"unistdio.h"
License:
LGPL
Maintainer:
Bruno Haible

Some files were not shown because too many files have changed in this diff Show More