1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-08 17:22:05 +03:00

Global rename *zs[n]printf -> *s[n]zprintf.

* lib/aszprintf.c: Renamed from lib/azsprintf.c.
* lib/c-aszprintf.c: Renamed from lib/c-azsprintf.c.
* lib/c-vaszprintf.c: Renamed from lib/c-vazsprintf.c.
* lib/c-vsnzprintf.c: Renamed from lib/c-vzsnprintf.c.
* lib/c-snzprintf.c: Renamed from lib/c-zsnprintf.c.
* lib/vaszprintf.c: Renamed from lib/vazsprintf.c.
* lib/vsnzprintf.c: Renamed from lib/vzsnprintf.c.
* lib/vszprintf.c: Renamed from lib/vzsprintf.c.
* lib/snzprintf.c: Renamed from lib/zsnprintf.c.
* lib/szprintf.c: Renamed from lib/zsprintf.c.
* tests/test-c-vaszprintf-gnu.c: Renamed from
tests/test-c-vazsprintf-gnu.c.
* tests/test-c-vaszprintf-gnu.sh: Renamed from
tests/test-c-vazsprintf-gnu.sh.
* tests/test-c-vsnzprintf-gnu.c: Renamed from
tests/test-c-vzsnprintf-gnu.c.
* tests/test-c-vsnzprintf-gnu.sh: Renamed from
tests/test-c-vzsnprintf-gnu.sh.
* tests/test-c-snzprintf-gnu.c: Renamed from
tests/test-c-zsnprintf-gnu.c.
* tests/test-c-snzprintf-gnu.sh: Renamed from
tests/test-c-zsnprintf-gnu.sh.
* tests/test-vaszprintf-gnu.c: Renamed from tests/test-vazsprintf-gnu.c.
* tests/test-vaszprintf-gnu.h: Renamed from tests/test-vazsprintf-gnu.h.
* tests/test-vaszprintf-posix.c: Renamed from
tests/test-vazsprintf-posix.c.
* tests/test-vsnzprintf-gnu.c: Renamed from tests/test-vzsnprintf-gnu.c.
* tests/test-vsnzprintf-posix.c: Renamed from
tests/test-vzsnprintf-posix.c.
* tests/test-vszprintf-gnu.c: Renamed from tests/test-vzsprintf-gnu.c.
* tests/test-vszprintf-posix.c: Renamed from
tests/test-vzsprintf-posix.c.
* tests/test-snzprintf-gnu.c: Renamed from tests/test-zsnprintf-gnu.c.
* tests/test-snzprintf-gnu.h: Renamed from tests/test-zsnprintf-gnu.h.
* tests/test-snzprintf-posix.c: Renamed from
tests/test-zsnprintf-posix.c.
* tests/test-snzprintf-posix.h: Renamed from
tests/test-zsnprintf-posix.h.
* tests/test-szprintf-gnu.c: Renamed from tests/test-zsprintf-gnu.c.
* tests/test-szprintf-gnu.h: Renamed from tests/test-zsprintf-gnu.h.
* tests/test-szprintf-posix.c: Renamed from tests/test-zsprintf-posix.c.
* tests/test-szprintf-posix.h: Renamed from tests/test-zsprintf-posix.h.
* modules/c-vaszprintf: Renamed from modules/c-vazsprintf.
* modules/c-vaszprintf-gnu: Renamed from modules/c-vazsprintf-gnu.
* modules/c-vaszprintf-gnu-tests: Renamed from
modules/c-vazsprintf-gnu-tests.
* modules/c-vsnzprintf: Renamed from modules/c-vzsnprintf.
* modules/c-vsnzprintf-gnu: Renamed from modules/c-vzsnprintf-gnu.
* modules/c-vsnzprintf-gnu-tests: Renamed from
modules/c-vzsnprintf-gnu-tests.
* modules/c-snzprintf: Renamed from modules/c-zsnprintf.
* modules/c-snzprintf-gnu: Renamed from modules/c-zsnprintf-gnu.
* modules/c-snzprintf-gnu-tests: Renamed from
modules/c-zsnprintf-gnu-tests.
* modules/vaszprintf: Renamed from modules/vazsprintf.
* modules/vaszprintf-gnu: Renamed from modules/vazsprintf-gnu.
* modules/vaszprintf-gnu-tests: Renamed from
modules/vazsprintf-gnu-tests.
* modules/vaszprintf-posix: Renamed from modules/vazsprintf-posix.
* modules/vaszprintf-posix-tests: Renamed from
modules/vazsprintf-posix-tests.
* modules/vsnzprintf: Renamed from modules/vzsnprintf.
* modules/vsnzprintf-gnu: Renamed from modules/vzsnprintf-gnu.
* modules/vsnzprintf-gnu-tests: Renamed from
modules/vzsnprintf-gnu-tests.
* modules/vsnzprintf-posix: Renamed from modules/vzsnprintf-posix.
* modules/vsnzprintf-posix-tests: Renamed from
modules/vzsnprintf-posix-tests.
* modules/vszprintf: Renamed from modules/vzsprintf.
* modules/vszprintf-gnu: Renamed from modules/vzsprintf-gnu.
* modules/vszprintf-gnu-tests: Renamed from modules/vzsprintf-gnu-tests.
* modules/vszprintf-posix: Renamed from modules/vzsprintf-posix.
* modules/vszprintf-posix-tests: Renamed from
modules/vzsprintf-posix-tests.
* modules/snzprintf: Renamed from modules/zsnprintf.
* modules/snzprintf-gnu: Renamed from modules/zsnprintf-gnu.
* modules/snzprintf-gnu-tests: Renamed from modules/zsnprintf-gnu-tests.
* modules/snzprintf-posix: Renamed from modules/zsnprintf-posix.
* modules/snzprintf-posix-tests: Renamed from
modules/zsnprintf-posix-tests.
* modules/szprintf: Renamed from modules/zsprintf.
* modules/szprintf-gnu: Renamed from modules/zsprintf-gnu.
* modules/szprintf-gnu-tests: Renamed from modules/zsprintf-gnu-tests.
* modules/szprintf-posix: Renamed from modules/zsprintf-posix.
* modules/szprintf-posix-tests: Renamed from
modules/zsprintf-posix-tests.
All function names updated.
* lib/stdio.in.h, m4/stdio_h.m4, modules/stdio: Update module indicator
names.
This commit is contained in:
Bruno Haible
2024-06-30 01:32:24 +02:00
parent 490c880281
commit 9118630ed3
101 changed files with 521 additions and 428 deletions

View File

@@ -1,3 +1,96 @@
2024-06-29 Bruno Haible <bruno@clisp.org>
Global rename *zs[n]printf -> *s[n]zprintf.
* lib/aszprintf.c: Renamed from lib/azsprintf.c.
* lib/c-aszprintf.c: Renamed from lib/c-azsprintf.c.
* lib/c-vaszprintf.c: Renamed from lib/c-vazsprintf.c.
* lib/c-vsnzprintf.c: Renamed from lib/c-vzsnprintf.c.
* lib/c-snzprintf.c: Renamed from lib/c-zsnprintf.c.
* lib/vaszprintf.c: Renamed from lib/vazsprintf.c.
* lib/vsnzprintf.c: Renamed from lib/vzsnprintf.c.
* lib/vszprintf.c: Renamed from lib/vzsprintf.c.
* lib/snzprintf.c: Renamed from lib/zsnprintf.c.
* lib/szprintf.c: Renamed from lib/zsprintf.c.
* tests/test-c-vaszprintf-gnu.c: Renamed from
tests/test-c-vazsprintf-gnu.c.
* tests/test-c-vaszprintf-gnu.sh: Renamed from
tests/test-c-vazsprintf-gnu.sh.
* tests/test-c-vsnzprintf-gnu.c: Renamed from
tests/test-c-vzsnprintf-gnu.c.
* tests/test-c-vsnzprintf-gnu.sh: Renamed from
tests/test-c-vzsnprintf-gnu.sh.
* tests/test-c-snzprintf-gnu.c: Renamed from
tests/test-c-zsnprintf-gnu.c.
* tests/test-c-snzprintf-gnu.sh: Renamed from
tests/test-c-zsnprintf-gnu.sh.
* tests/test-vaszprintf-gnu.c: Renamed from tests/test-vazsprintf-gnu.c.
* tests/test-vaszprintf-gnu.h: Renamed from tests/test-vazsprintf-gnu.h.
* tests/test-vaszprintf-posix.c: Renamed from
tests/test-vazsprintf-posix.c.
* tests/test-vsnzprintf-gnu.c: Renamed from tests/test-vzsnprintf-gnu.c.
* tests/test-vsnzprintf-posix.c: Renamed from
tests/test-vzsnprintf-posix.c.
* tests/test-vszprintf-gnu.c: Renamed from tests/test-vzsprintf-gnu.c.
* tests/test-vszprintf-posix.c: Renamed from
tests/test-vzsprintf-posix.c.
* tests/test-snzprintf-gnu.c: Renamed from tests/test-zsnprintf-gnu.c.
* tests/test-snzprintf-gnu.h: Renamed from tests/test-zsnprintf-gnu.h.
* tests/test-snzprintf-posix.c: Renamed from
tests/test-zsnprintf-posix.c.
* tests/test-snzprintf-posix.h: Renamed from
tests/test-zsnprintf-posix.h.
* tests/test-szprintf-gnu.c: Renamed from tests/test-zsprintf-gnu.c.
* tests/test-szprintf-gnu.h: Renamed from tests/test-zsprintf-gnu.h.
* tests/test-szprintf-posix.c: Renamed from tests/test-zsprintf-posix.c.
* tests/test-szprintf-posix.h: Renamed from tests/test-zsprintf-posix.h.
* modules/c-vaszprintf: Renamed from modules/c-vazsprintf.
* modules/c-vaszprintf-gnu: Renamed from modules/c-vazsprintf-gnu.
* modules/c-vaszprintf-gnu-tests: Renamed from
modules/c-vazsprintf-gnu-tests.
* modules/c-vsnzprintf: Renamed from modules/c-vzsnprintf.
* modules/c-vsnzprintf-gnu: Renamed from modules/c-vzsnprintf-gnu.
* modules/c-vsnzprintf-gnu-tests: Renamed from
modules/c-vzsnprintf-gnu-tests.
* modules/c-snzprintf: Renamed from modules/c-zsnprintf.
* modules/c-snzprintf-gnu: Renamed from modules/c-zsnprintf-gnu.
* modules/c-snzprintf-gnu-tests: Renamed from
modules/c-zsnprintf-gnu-tests.
* modules/vaszprintf: Renamed from modules/vazsprintf.
* modules/vaszprintf-gnu: Renamed from modules/vazsprintf-gnu.
* modules/vaszprintf-gnu-tests: Renamed from
modules/vazsprintf-gnu-tests.
* modules/vaszprintf-posix: Renamed from modules/vazsprintf-posix.
* modules/vaszprintf-posix-tests: Renamed from
modules/vazsprintf-posix-tests.
* modules/vsnzprintf: Renamed from modules/vzsnprintf.
* modules/vsnzprintf-gnu: Renamed from modules/vzsnprintf-gnu.
* modules/vsnzprintf-gnu-tests: Renamed from
modules/vzsnprintf-gnu-tests.
* modules/vsnzprintf-posix: Renamed from modules/vzsnprintf-posix.
* modules/vsnzprintf-posix-tests: Renamed from
modules/vzsnprintf-posix-tests.
* modules/vszprintf: Renamed from modules/vzsprintf.
* modules/vszprintf-gnu: Renamed from modules/vzsprintf-gnu.
* modules/vszprintf-gnu-tests: Renamed from modules/vzsprintf-gnu-tests.
* modules/vszprintf-posix: Renamed from modules/vzsprintf-posix.
* modules/vszprintf-posix-tests: Renamed from
modules/vzsprintf-posix-tests.
* modules/snzprintf: Renamed from modules/zsnprintf.
* modules/snzprintf-gnu: Renamed from modules/zsnprintf-gnu.
* modules/snzprintf-gnu-tests: Renamed from modules/zsnprintf-gnu-tests.
* modules/snzprintf-posix: Renamed from modules/zsnprintf-posix.
* modules/snzprintf-posix-tests: Renamed from
modules/zsnprintf-posix-tests.
* modules/szprintf: Renamed from modules/zsprintf.
* modules/szprintf-gnu: Renamed from modules/zsprintf-gnu.
* modules/szprintf-gnu-tests: Renamed from modules/zsprintf-gnu-tests.
* modules/szprintf-posix: Renamed from modules/zsprintf-posix.
* modules/szprintf-posix-tests: Renamed from
modules/zsprintf-posix-tests.
All function names updated.
* lib/stdio.in.h, m4/stdio_h.m4, modules/stdio: Update module indicator
names.
2024-06-29 Jim Meyering <meyering@meta.com> 2024-06-29 Jim Meyering <meyering@meta.com>
bootstrap-funclib.sh: shrink or split too-long lines bootstrap-funclib.sh: shrink or split too-long lines

View File

@@ -22,13 +22,13 @@
#include <stdarg.h> #include <stdarg.h>
ptrdiff_t ptrdiff_t
azsprintf (char **resultp, const char *format, ...) aszprintf (char **resultp, const char *format, ...)
{ {
va_list args; va_list args;
ptrdiff_t result; ptrdiff_t result;
va_start (args, format); va_start (args, format);
result = vazsprintf (resultp, format, args); result = vaszprintf (resultp, format, args);
va_end (args); va_end (args);
return result; return result;
} }

View File

@@ -22,13 +22,13 @@
#include <stdarg.h> #include <stdarg.h>
ptrdiff_t ptrdiff_t
c_azsprintf (char **resultp, const char *format, ...) c_aszprintf (char **resultp, const char *format, ...)
{ {
va_list args; va_list args;
ptrdiff_t result; ptrdiff_t result;
va_start (args, format); va_start (args, format);
result = c_vazsprintf (resultp, format, args); result = c_vaszprintf (resultp, format, args);
va_end (args); va_end (args);
return result; return result;
} }

View File

@@ -33,7 +33,7 @@ c_snprintf (char *str, size_t size, const char *format, ...)
ptrdiff_t ret; ptrdiff_t ret;
va_start (args, format); va_start (args, format);
ret = c_vzsnprintf (str, size, format, args); ret = c_vsnzprintf (str, size, format, args);
va_end (args); va_end (args);
#if PTRDIFF_MAX > INT_MAX #if PTRDIFF_MAX > INT_MAX

View File

@@ -44,7 +44,7 @@ extern "C" {
Formatting takes place in the C locale, that is, the decimal point Formatting takes place in the C locale, that is, the decimal point
used in floating-point formatting directives is always '.'. */ used in floating-point formatting directives is always '.'. */
extern ptrdiff_t c_zsnprintf (char *restrict str, size_t size, extern ptrdiff_t c_snzprintf (char *restrict str, size_t size,
const char *format, ...) const char *format, ...)
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4)); _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4));

View File

@@ -29,7 +29,7 @@
#include "c-vasnprintf.h" #include "c-vasnprintf.h"
ptrdiff_t ptrdiff_t
c_zsnprintf (char *str, size_t size, const char *format, ...) c_snzprintf (char *str, size_t size, const char *format, ...)
{ {
char *output; char *output;
size_t len; size_t len;

View File

@@ -47,9 +47,9 @@ extern "C" {
Formatting takes place in the C locale, that is, the decimal point Formatting takes place in the C locale, that is, the decimal point
used in floating-point formatting directives is always '.'. */ used in floating-point formatting directives is always '.'. */
ptrdiff_t c_azsprintf (char **resultp, const char *format, ...) ptrdiff_t c_aszprintf (char **resultp, const char *format, ...)
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 2, 3)); _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 2, 3));
ptrdiff_t c_vazsprintf (char **resultp, const char *format, va_list args) ptrdiff_t c_vaszprintf (char **resultp, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 2, 0)); _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 2, 0));
/* Prints formatted output to a string dynamically allocated with malloc(). /* Prints formatted output to a string dynamically allocated with malloc().

View File

@@ -26,7 +26,7 @@
#include "c-vasnprintf.h" #include "c-vasnprintf.h"
ptrdiff_t ptrdiff_t
c_vazsprintf (char **resultp, const char *format, va_list args) c_vaszprintf (char **resultp, const char *format, va_list args)
{ {
size_t length; size_t length;
char *result = c_vasnprintf (NULL, &length, format, args); char *result = c_vasnprintf (NULL, &length, format, args);

View File

@@ -29,7 +29,7 @@
int int
c_vsnprintf (char *str, size_t size, const char *format, va_list args) c_vsnprintf (char *str, size_t size, const char *format, va_list args)
{ {
ptrdiff_t ret = c_vzsnprintf (str, size, format, args); ptrdiff_t ret = c_vsnzprintf (str, size, format, args);
#if PTRDIFF_MAX > INT_MAX #if PTRDIFF_MAX > INT_MAX
if (ret > INT_MAX) if (ret > INT_MAX)

View File

@@ -47,7 +47,7 @@ extern "C" {
Formatting takes place in the C locale, that is, the decimal point Formatting takes place in the C locale, that is, the decimal point
used in floating-point formatting directives is always '.'. */ used in floating-point formatting directives is always '.'. */
extern ptrdiff_t c_vzsnprintf (char *restrict str, size_t size, extern ptrdiff_t c_vsnzprintf (char *restrict str, size_t size,
const char *format, va_list args) const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0)); _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0));

View File

@@ -32,7 +32,7 @@
#include "c-vasnprintf.h" #include "c-vasnprintf.h"
ptrdiff_t ptrdiff_t
c_vzsnprintf (char *str, size_t size, const char *format, va_list args) c_vsnzprintf (char *str, size_t size, const char *format, va_list args)
{ {
char *output; char *output;
size_t len; size_t len;

View File

@@ -32,7 +32,7 @@ c_xvasprintf (const char *format, va_list args)
{ {
char *result; char *result;
if (c_vazsprintf (&result, format, args) < 0) if (c_vaszprintf (&result, format, args) < 0)
{ {
if (errno == ENOMEM) if (errno == ENOMEM)
xalloc_die (); xalloc_die ();

View File

@@ -31,7 +31,7 @@ snprintf (char *str, size_t size, const char *format, ...)
ptrdiff_t ret; ptrdiff_t ret;
va_start (args, format); va_start (args, format);
ret = vzsnprintf (str, size, format, args); ret = vsnzprintf (str, size, format, args);
va_end (args); va_end (args);
#if PTRDIFF_MAX > INT_MAX #if PTRDIFF_MAX > INT_MAX

View File

@@ -29,7 +29,7 @@
#include "vasnprintf.h" #include "vasnprintf.h"
ptrdiff_t ptrdiff_t
zsnprintf (char *str, size_t size, const char *format, ...) snzprintf (char *str, size_t size, const char *format, ...)
{ {
char *output; char *output;
size_t len; size_t len;

View File

@@ -33,7 +33,7 @@ sprintf (char *str, const char *format, ...)
ptrdiff_t ret; ptrdiff_t ret;
va_start (args, format); va_start (args, format);
ret = vzsprintf (str, format, args); ret = vszprintf (str, format, args);
va_end (args); va_end (args);
#if PTRDIFF_MAX > INT_MAX #if PTRDIFF_MAX > INT_MAX

View File

@@ -1459,7 +1459,7 @@ _GL_CXXALIASWARN (scanf);
# endif # endif
#endif #endif
#if @GNULIB_ZSNPRINTF@ #if @GNULIB_SNZPRINTF@
/* Prints formatted output to string STR. Similar to sprintf, but the /* Prints formatted output to string STR. Similar to sprintf, but the
additional parameter SIZE limits how much is written into STR. additional parameter SIZE limits how much is written into STR.
STR may be NULL, in which case nothing will be written. STR may be NULL, in which case nothing will be written.
@@ -1468,12 +1468,12 @@ _GL_CXXALIASWARN (scanf);
Failure code EOVERFLOW can only occur when a width > INT_MAX is used. Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure code is ENOMEM. */ directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (zsnprintf, ptrdiff_t, _GL_FUNCDECL_SYS (snzprintf, ptrdiff_t,
(char *restrict str, size_t size, (char *restrict str, size_t size,
const char *restrict format, ...) const char *restrict format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
_GL_ARG_NONNULL ((3))); _GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_SYS (zsnprintf, ptrdiff_t, _GL_CXXALIAS_SYS (snzprintf, ptrdiff_t,
(char *restrict str, size_t size, (char *restrict str, size_t size,
const char *restrict format, ...)); const char *restrict format, ...));
#endif #endif
@@ -1520,19 +1520,19 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
# endif # endif
#endif #endif
#if @GNULIB_ZSPRINTF@ #if @GNULIB_SZPRINTF@
/* Prints formatted output to string STR. /* Prints formatted output to string STR.
Returns the string length of the formatted string. Upon failure, Returns the string length of the formatted string. Upon failure,
returns -1 with errno set. returns -1 with errno set.
Failure code EOVERFLOW can only occur when a width > INT_MAX is used. Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure code is ENOMEM. */ directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (zsprintf, ptrdiff_t, _GL_FUNCDECL_SYS (szprintf, ptrdiff_t,
(char *restrict str, (char *restrict str,
const char *restrict format, ...) const char *restrict format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (zsprintf, ptrdiff_t, _GL_CXXALIAS_SYS (szprintf, ptrdiff_t,
(char *restrict str, (char *restrict str,
const char *restrict format, ...)); const char *restrict format, ...));
#endif #endif
@@ -1629,7 +1629,7 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
# endif # endif
#endif #endif
#if @GNULIB_VAZSPRINTF@ #if @GNULIB_VASZPRINTF@
/* Prints formatted output to a string dynamically allocated with malloc(). /* Prints formatted output to a string dynamically allocated with malloc().
If the memory allocation succeeds, it stores the address of the string in If the memory allocation succeeds, it stores the address of the string in
*RESULT and returns the number of resulting bytes, excluding the trailing *RESULT and returns the number of resulting bytes, excluding the trailing
@@ -1638,17 +1638,17 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
Failure code EOVERFLOW can only occur when a width > INT_MAX is used. Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure code is ENOMEM. */ directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (azsprintf, ptrdiff_t, _GL_FUNCDECL_SYS (aszprintf, ptrdiff_t,
(char **result, const char *format, ...) (char **result, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (azsprintf, ptrdiff_t, _GL_CXXALIAS_SYS (aszprintf, ptrdiff_t,
(char **result, const char *format, ...)); (char **result, const char *format, ...));
_GL_FUNCDECL_SYS (vazsprintf, ptrdiff_t, _GL_FUNCDECL_SYS (vaszprintf, ptrdiff_t,
(char **result, const char *format, va_list args) (char **result, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (vazsprintf, ptrdiff_t, _GL_CXXALIAS_SYS (vaszprintf, ptrdiff_t,
(char **result, const char *format, va_list args)); (char **result, const char *format, va_list args));
#endif #endif
@@ -1862,7 +1862,7 @@ _GL_CXXALIASWARN (vscanf);
# endif # endif
#endif #endif
#if @GNULIB_VZSNPRINTF@ #if @GNULIB_VSNZPRINTF@
/* Prints formatted output to string STR. Similar to sprintf, but the /* Prints formatted output to string STR. Similar to sprintf, but the
additional parameter SIZE limits how much is written into STR. additional parameter SIZE limits how much is written into STR.
STR may be NULL, in which case nothing will be written. STR may be NULL, in which case nothing will be written.
@@ -1871,12 +1871,12 @@ _GL_CXXALIASWARN (vscanf);
Failure code EOVERFLOW can only occur when a width > INT_MAX is used. Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure code is ENOMEM. */ directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (vzsnprintf, ptrdiff_t, _GL_FUNCDECL_SYS (vsnzprintf, ptrdiff_t,
(char *restrict str, size_t size, (char *restrict str, size_t size,
const char *restrict format, va_list args) const char *restrict format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
_GL_ARG_NONNULL ((3))); _GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_SYS (vzsnprintf, ptrdiff_t, _GL_CXXALIAS_SYS (vsnzprintf, ptrdiff_t,
(char *restrict str, size_t size, (char *restrict str, size_t size,
const char *restrict format, va_list args)); const char *restrict format, va_list args));
#endif #endif
@@ -1923,19 +1923,19 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
# endif # endif
#endif #endif
#if @GNULIB_VZSPRINTF@ #if @GNULIB_VSZPRINTF@
/* Prints formatted output to string STR. /* Prints formatted output to string STR.
Returns the string length of the formatted string. Upon failure, Returns the string length of the formatted string. Upon failure,
returns -1 with errno set. returns -1 with errno set.
Failure code EOVERFLOW can only occur when a width > INT_MAX is used. Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure code is ENOMEM. */ directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (vzsprintf, ptrdiff_t, _GL_FUNCDECL_SYS (vszprintf, ptrdiff_t,
(char *restrict str, (char *restrict str,
const char *restrict format, va_list args) const char *restrict format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2))); _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (vzsprintf, ptrdiff_t, _GL_CXXALIAS_SYS (vszprintf, ptrdiff_t,
(char *restrict str, (char *restrict str,
const char *restrict format, va_list args)); const char *restrict format, va_list args));
#endif #endif

View File

@@ -29,7 +29,7 @@
#include "vasnprintf.h" #include "vasnprintf.h"
ptrdiff_t ptrdiff_t
zsprintf (char *str, const char *format, ...) szprintf (char *str, const char *format, ...)
{ {
char *output; char *output;
size_t len; size_t len;

View File

@@ -26,7 +26,7 @@
#include "vasnprintf.h" #include "vasnprintf.h"
ptrdiff_t ptrdiff_t
vazsprintf (char **resultp, const char *format, va_list args) vaszprintf (char **resultp, const char *format, va_list args)
{ {
size_t length; size_t length;
char *result = vasnprintf (NULL, &length, format, args); char *result = vasnprintf (NULL, &length, format, args);

View File

@@ -29,7 +29,7 @@
int int
vsnprintf (char *str, size_t size, const char *format, va_list args) vsnprintf (char *str, size_t size, const char *format, va_list args)
{ {
ptrdiff_t ret = vzsnprintf (str, size, format, args); ptrdiff_t ret = vsnzprintf (str, size, format, args);
#if PTRDIFF_MAX > INT_MAX #if PTRDIFF_MAX > INT_MAX
if (ret > INT_MAX) if (ret > INT_MAX)

View File

@@ -31,7 +31,7 @@
#include "vasnprintf.h" #include "vasnprintf.h"
ptrdiff_t ptrdiff_t
vzsnprintf (char *str, size_t size, const char *format, va_list args) vsnzprintf (char *str, size_t size, const char *format, va_list args)
{ {
char *output; char *output;
size_t len; size_t len;

View File

@@ -29,7 +29,7 @@
int int
vsprintf (char *str, const char *format, va_list args) vsprintf (char *str, const char *format, va_list args)
{ {
ptrdiff_t ret = vzsprintf (str, format, args); ptrdiff_t ret = vszprintf (str, format, args);
#if PTRDIFF_MAX > INT_MAX #if PTRDIFF_MAX > INT_MAX
if (ret > INT_MAX) if (ret > INT_MAX)

View File

@@ -29,7 +29,7 @@
#include "vasnprintf.h" #include "vasnprintf.h"
ptrdiff_t ptrdiff_t
vzsprintf (char *str, const char *format, va_list args) vszprintf (char *str, const char *format, va_list args)
{ {
char *output; char *output;
size_t len; size_t len;

View File

@@ -96,7 +96,7 @@ xvasprintf (const char *format, va_list args)
} }
} }
if (vazsprintf (&result, format, args) < 0) if (vaszprintf (&result, format, args) < 0)
{ {
if (errno == ENOMEM) if (errno == ENOMEM)
xalloc_die (); xalloc_die ();

View File

@@ -178,7 +178,7 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TMPFILE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TMPFILE])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VAZSPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFSCANF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFSCANF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSCANF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSCANF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDPRINTF])
@@ -188,10 +188,10 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF_POSIX])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSPRINTF_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSPRINTF_POSIX])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VZSNPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VZSPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ZSNPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNZPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ZSPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SZPRINTF])
dnl Support Microsoft deprecated alias function names by default. dnl Support Microsoft deprecated alias function names by default.
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCLOSEALL], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCLOSEALL], [1])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FDOPEN], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FDOPEN], [1])

View File

@@ -8,7 +8,7 @@ lib/c-snprintf.c
Depends-on: Depends-on:
stdint stdint
stdio stdio
c-vzsnprintf c-vsnzprintf
configure.ac: configure.ac:
AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([AC_C_RESTRICT])

View File

@@ -1,10 +1,10 @@
Description: Description:
c_zsnprintf(): print formatted output to a fixed length string (without c_snzprintf(): print formatted output to a fixed length string (without
INT_MAX limitation) in C locale INT_MAX limitation) in C locale
Files: Files:
lib/c-snprintf.h lib/c-snprintf.h
lib/c-zsnprintf.c lib/c-snzprintf.c
Depends-on: Depends-on:
stdint stdint
@@ -15,7 +15,7 @@ configure.ac:
AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([AC_C_RESTRICT])
Makefile.am: Makefile.am:
lib_SOURCES += c-zsnprintf.c lib_SOURCES += c-snzprintf.c
Include: Include:
"c-snprintf.h" "c-snprintf.h"

View File

@@ -1,11 +1,11 @@
Description: Description:
c_zsnprintf() function c_snzprintf() function
with POSIX compliant and GNU compatible format string interpretation with POSIX compliant and GNU compatible format string interpretation
Files: Files:
Depends-on: Depends-on:
c-zsnprintf c-snzprintf
mixin/printf-gnu mixin/printf-gnu
configure.ac: configure.ac:

View File

@@ -0,0 +1,19 @@
Files:
tests/test-c-snzprintf-gnu.c
tests/test-snzprintf-gnu.h
tests/test-c-snzprintf-gnu.sh
tests/macros.h
m4/locale-fr.m4
m4/codeset.m4
Depends-on:
setlocale
configure.ac:
gt_LOCALE_FR
Makefile.am:
TESTS += test-c-snzprintf-gnu.sh
TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@'
check_PROGRAMS += test-c-snzprintf-gnu
test_c_snzprintf_gnu_LDADD = $(LDADD) $(SETLOCALE_LIB)

View File

@@ -1,10 +1,10 @@
Description: Description:
azsprintf() and vazsprintf() in C locale aszprintf() and vaszprintf() in C locale
Files: Files:
lib/c-vasprintf.h lib/c-vasprintf.h
lib/c-azsprintf.c lib/c-aszprintf.c
lib/c-vazsprintf.c lib/c-vaszprintf.c
Depends-on: Depends-on:
stdint stdint
@@ -14,7 +14,7 @@ c-vasnprintf
configure.ac: configure.ac:
Makefile.am: Makefile.am:
lib_SOURCES += c-azsprintf.c c-vazsprintf.c lib_SOURCES += c-aszprintf.c c-vaszprintf.c
Include: Include:
"c-vasprintf.h" "c-vasprintf.h"

View File

@@ -1,11 +1,11 @@
Description: Description:
c_azsprintf() and c_vazsprintf() functions c_aszprintf() and c_vaszprintf() functions
with POSIX compliant and GNU compatible format string interpretation with POSIX compliant and GNU compatible format string interpretation
Files: Files:
Depends-on: Depends-on:
c-vazsprintf c-vaszprintf
mixin/printf-gnu mixin/printf-gnu
configure.ac: configure.ac:

View File

@@ -0,0 +1,19 @@
Files:
tests/test-c-vaszprintf-gnu.c
tests/test-vaszprintf-gnu.h
tests/test-c-vaszprintf-gnu.sh
tests/macros.h
m4/locale-fr.m4
m4/codeset.m4
Depends-on:
setlocale
configure.ac:
gt_LOCALE_FR
Makefile.am:
TESTS += test-c-vaszprintf-gnu.sh
TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@'
check_PROGRAMS += test-c-vaszprintf-gnu
test_c_vaszprintf_gnu_LDADD = $(LDADD) $(SETLOCALE_LIB)

View File

@@ -1,19 +0,0 @@
Files:
tests/test-c-vazsprintf-gnu.c
tests/test-vazsprintf-gnu.h
tests/test-c-vazsprintf-gnu.sh
tests/macros.h
m4/locale-fr.m4
m4/codeset.m4
Depends-on:
setlocale
configure.ac:
gt_LOCALE_FR
Makefile.am:
TESTS += test-c-vazsprintf-gnu.sh
TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@'
check_PROGRAMS += test-c-vazsprintf-gnu
test_c_vazsprintf_gnu_LDADD = $(LDADD) $(SETLOCALE_LIB)

View File

@@ -9,7 +9,7 @@ lib/c-vsnprintf.c
Depends-on: Depends-on:
stdint stdint
stdio stdio
c-vzsnprintf c-vsnzprintf
configure.ac: configure.ac:
AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([AC_C_RESTRICT])

View File

@@ -1,10 +1,10 @@
Description: Description:
c_vzsnprintf(): print formatted output from an stdarg argument list to a c_vsnzprintf(): print formatted output from an stdarg argument list to a
fixed length string (without INT_MAX limitation) in C locale fixed length string (without INT_MAX limitation) in C locale
Files: Files:
lib/c-vsnprintf.h lib/c-vsnprintf.h
lib/c-vzsnprintf.c lib/c-vsnzprintf.c
Depends-on: Depends-on:
stdint stdint
@@ -15,7 +15,7 @@ configure.ac:
AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([AC_C_RESTRICT])
Makefile.am: Makefile.am:
lib_SOURCES += c-vzsnprintf.c lib_SOURCES += c-vsnzprintf.c
Include: Include:
"c-vsnprintf.h" "c-vsnprintf.h"

View File

@@ -1,11 +1,11 @@
Description: Description:
c_vzsnprintf() function c_vsnzprintf() function
with POSIX compliant and GNU compatible format string interpretation with POSIX compliant and GNU compatible format string interpretation
Files: Files:
Depends-on: Depends-on:
c-vzsnprintf c-vsnzprintf
mixin/printf-gnu mixin/printf-gnu
configure.ac: configure.ac:

View File

@@ -0,0 +1,19 @@
Files:
tests/test-c-vsnzprintf-gnu.c
tests/test-snzprintf-gnu.h
tests/test-c-vsnzprintf-gnu.sh
tests/macros.h
m4/locale-fr.m4
m4/codeset.m4
Depends-on:
setlocale
configure.ac:
gt_LOCALE_FR
Makefile.am:
TESTS += test-c-vsnzprintf-gnu.sh
TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@'
check_PROGRAMS += test-c-vsnzprintf-gnu
test_c_vsnzprintf_gnu_LDADD = $(LDADD) $(SETLOCALE_LIB)

View File

@@ -1,19 +0,0 @@
Files:
tests/test-c-vzsnprintf-gnu.c
tests/test-zsnprintf-gnu.h
tests/test-c-vzsnprintf-gnu.sh
tests/macros.h
m4/locale-fr.m4
m4/codeset.m4
Depends-on:
setlocale
configure.ac:
gt_LOCALE_FR
Makefile.am:
TESTS += test-c-vzsnprintf-gnu.sh
TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@'
check_PROGRAMS += test-c-vzsnprintf-gnu
test_c_vzsnprintf_gnu_LDADD = $(LDADD) $(SETLOCALE_LIB)

View File

@@ -10,7 +10,7 @@ m4/strerrorname_np.m4
Depends-on: Depends-on:
extensions extensions
stdio stdio
c-vazsprintf c-vaszprintf
xalloc-die xalloc-die
configure.ac: configure.ac:

View File

@@ -1,19 +0,0 @@
Files:
tests/test-c-zsnprintf-gnu.c
tests/test-zsnprintf-gnu.h
tests/test-c-zsnprintf-gnu.sh
tests/macros.h
m4/locale-fr.m4
m4/codeset.m4
Depends-on:
setlocale
configure.ac:
gt_LOCALE_FR
Makefile.am:
TESTS += test-c-zsnprintf-gnu.sh
TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@'
check_PROGRAMS += test-c-zsnprintf-gnu
test_c_zsnprintf_gnu_LDADD = $(LDADD) $(SETLOCALE_LIB)

View File

@@ -10,7 +10,7 @@ Depends-on:
stdio stdio
errno [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] errno [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
stdint [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] stdint [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
vzsnprintf [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1] vsnzprintf [test $ac_cv_func_snprintf = no || test $REPLACE_SNPRINTF = 1]
configure.ac: configure.ac:
gl_FUNC_SNPRINTF gl_FUNC_SNPRINTF

View File

@@ -1,9 +1,9 @@
Description: Description:
zsnprintf() function: print formatted output to a fixed length string snzprintf() function: print formatted output to a fixed length string
(without INT_MAX limitation) (without INT_MAX limitation)
Files: Files:
lib/zsnprintf.c lib/snzprintf.c
Depends-on: Depends-on:
stdio stdio
@@ -12,10 +12,10 @@ errno
stdint stdint
configure.ac: configure.ac:
gl_STDIO_MODULE_INDICATOR([zsnprintf]) gl_STDIO_MODULE_INDICATOR([snzprintf])
Makefile.am: Makefile.am:
lib_SOURCES += zsnprintf.c lib_SOURCES += snzprintf.c
Include: Include:
<stdio.h> <stdio.h>

View File

@@ -1,11 +1,11 @@
Description: Description:
zsnprintf() function snzprintf() function
with POSIX compliant and GNU compatible format string interpretation with POSIX compliant and GNU compatible format string interpretation
Files: Files:
Depends-on: Depends-on:
zsnprintf-posix snzprintf-posix
mixin/printf-gnu mixin/printf-gnu
configure.ac: configure.ac:

View File

@@ -0,0 +1,12 @@
Files:
tests/test-snzprintf-gnu.c
tests/test-snzprintf-gnu.h
tests/macros.h
Depends-on:
configure.ac:
Makefile.am:
TESTS += test-snzprintf-gnu
check_PROGRAMS += test-snzprintf-gnu

View File

@@ -1,10 +1,10 @@
Description: Description:
zsnprintf() function with POSIX compliant format string interpretation snzprintf() function with POSIX compliant format string interpretation
Files: Files:
Depends-on: Depends-on:
zsnprintf snzprintf
mixin/printf-posix mixin/printf-posix
configure.ac: configure.ac:

View File

@@ -0,0 +1,14 @@
Files:
tests/test-snzprintf-posix.c
tests/test-snzprintf-posix.h
tests/infinity.h
tests/macros.h
Depends-on:
nan
configure.ac:
Makefile.am:
TESTS += test-snzprintf-posix
check_PROGRAMS += test-snzprintf-posix

View File

@@ -18,7 +18,7 @@ stdio
nocrash nocrash
printf-safe printf-safe
multiarch multiarch
vzsprintf [test $REPLACE_SPRINTF = 1] vszprintf [test $REPLACE_SPRINTF = 1]
mixin/printf-posix [test $REPLACE_SPRINTF = 1] mixin/printf-posix [test $REPLACE_SPRINTF = 1]
stdint [test $REPLACE_SPRINTF = 1] stdint [test $REPLACE_SPRINTF = 1]
errno [test $REPLACE_SPRINTF = 1] errno [test $REPLACE_SPRINTF = 1]

View File

@@ -113,7 +113,7 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \ -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
-e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \ -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
-e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \ -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
-e 's/@''GNULIB_VAZSPRINTF''@/$(GNULIB_VAZSPRINTF)/g' \ -e 's/@''GNULIB_VASZPRINTF''@/$(GNULIB_VASZPRINTF)/g' \
-e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \ -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \ -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \ -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
@@ -123,10 +123,10 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \ -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \ -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
-e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \ -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VZSNPRINTF''@/$(GNULIB_VZSNPRINTF)/g' \ -e 's/@''GNULIB_VSNZPRINTF''@/$(GNULIB_VSNZPRINTF)/g' \
-e 's/@''GNULIB_VZSPRINTF''@/$(GNULIB_VZSPRINTF)/g' \ -e 's/@''GNULIB_VSZPRINTF''@/$(GNULIB_VSZPRINTF)/g' \
-e 's/@''GNULIB_ZSNPRINTF''@/$(GNULIB_ZSNPRINTF)/g' \ -e 's/@''GNULIB_SNZPRINTF''@/$(GNULIB_SNZPRINTF)/g' \
-e 's/@''GNULIB_ZSPRINTF''@/$(GNULIB_ZSPRINTF)/g' \ -e 's/@''GNULIB_SZPRINTF''@/$(GNULIB_SZPRINTF)/g' \
-e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GNULIB_MDA_FCLOSEALL)/g' \ -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GNULIB_MDA_FCLOSEALL)/g' \
-e 's/@''GNULIB_MDA_FDOPEN''@/$(GNULIB_MDA_FDOPEN)/g' \ -e 's/@''GNULIB_MDA_FDOPEN''@/$(GNULIB_MDA_FDOPEN)/g' \
-e 's/@''GNULIB_MDA_FILENO''@/$(GNULIB_MDA_FILENO)/g' \ -e 's/@''GNULIB_MDA_FILENO''@/$(GNULIB_MDA_FILENO)/g' \

View File

@@ -1,9 +1,9 @@
Description: Description:
zsprintf() function: print formatted output to a string (without INT_MAX szprintf() function: print formatted output to a string (without INT_MAX
limitation) limitation)
Files: Files:
lib/zsprintf.c lib/szprintf.c
Depends-on: Depends-on:
stdio stdio
@@ -12,10 +12,10 @@ errno
stdint stdint
configure.ac: configure.ac:
gl_STDIO_MODULE_INDICATOR([zsprintf]) gl_STDIO_MODULE_INDICATOR([szprintf])
Makefile.am: Makefile.am:
lib_SOURCES += zsprintf.c lib_SOURCES += szprintf.c
Include: Include:
<stdio.h> <stdio.h>

View File

@@ -1,11 +1,11 @@
Description: Description:
zsprintf() function szprintf() function
with POSIX compliant and GNU compatible format string interpretation with POSIX compliant and GNU compatible format string interpretation
Files: Files:
Depends-on: Depends-on:
zsprintf-posix szprintf-posix
mixin/printf-gnu mixin/printf-gnu
configure.ac: configure.ac:

View File

@@ -0,0 +1,12 @@
Files:
tests/test-szprintf-gnu.c
tests/test-szprintf-gnu.h
tests/macros.h
Depends-on:
configure.ac:
Makefile.am:
TESTS += test-szprintf-gnu
check_PROGRAMS += test-szprintf-gnu

View File

@@ -1,10 +1,10 @@
Description: Description:
zsprintf() function with POSIX compliant format string interpretation szprintf() function with POSIX compliant format string interpretation
Files: Files:
Depends-on: Depends-on:
zsprintf szprintf
mixin/printf-posix mixin/printf-posix
configure.ac: configure.ac:

View File

@@ -0,0 +1,14 @@
Files:
tests/test-szprintf-posix.c
tests/test-szprintf-posix.h
tests/infinity.h
tests/macros.h
Depends-on:
nan
configure.ac:
Makefile.am:
TESTS += test-szprintf-posix
check_PROGRAMS += test-szprintf-posix

View File

@@ -2,8 +2,8 @@ Description:
vsprintf (without INT_MAX limitation) with automatic memory allocation vsprintf (without INT_MAX limitation) with automatic memory allocation
Files: Files:
lib/vazsprintf.c lib/vaszprintf.c
lib/azsprintf.c lib/aszprintf.c
Depends-on: Depends-on:
stdio stdio
@@ -12,13 +12,13 @@ errno
stdint stdint
configure.ac: configure.ac:
gl_STDIO_MODULE_INDICATOR([vazsprintf]) gl_STDIO_MODULE_INDICATOR([vaszprintf])
m4_ifdef([AM_XGETTEXT_OPTION], m4_ifdef([AM_XGETTEXT_OPTION],
[AM_][XGETTEXT_OPTION([--flag=azsprintf:2:c-format]) [AM_][XGETTEXT_OPTION([--flag=aszprintf:2:c-format])
AM_][XGETTEXT_OPTION([--flag=vazsprintf:2:c-format])]) AM_][XGETTEXT_OPTION([--flag=vaszprintf:2:c-format])])
Makefile.am: Makefile.am:
lib_SOURCES += vazsprintf.c azsprintf.c lib_SOURCES += vaszprintf.c aszprintf.c
Include: Include:
<stdio.h> <stdio.h>

View File

@@ -1,11 +1,11 @@
Description: Description:
azsprintf() and vazsprintf() functions aszprintf() and vaszprintf() functions
with POSIX compliant and GNU compatible format string interpretation with POSIX compliant and GNU compatible format string interpretation
Files: Files:
Depends-on: Depends-on:
vazsprintf-posix vaszprintf-posix
mixin/printf-gnu mixin/printf-gnu
configure.ac: configure.ac:

View File

@@ -0,0 +1,12 @@
Files:
tests/test-vaszprintf-gnu.c
tests/test-vaszprintf-gnu.h
tests/macros.h
Depends-on:
configure.ac:
Makefile.am:
TESTS += test-vaszprintf-gnu
check_PROGRAMS += test-vaszprintf-gnu

View File

@@ -1,11 +1,11 @@
Description: Description:
azsprintf() and vazsprintf() functions aszprintf() and vaszprintf() functions
with POSIX compliant format string interpretation with POSIX compliant format string interpretation
Files: Files:
Depends-on: Depends-on:
vazsprintf vaszprintf
mixin/printf-posix mixin/printf-posix
configure.ac: configure.ac:

View File

@@ -0,0 +1,13 @@
Files:
tests/test-vaszprintf-posix.c
tests/infinity.h
tests/macros.h
Depends-on:
nan
configure.ac:
Makefile.am:
TESTS += test-vaszprintf-posix
check_PROGRAMS += test-vaszprintf-posix

View File

@@ -1,12 +0,0 @@
Files:
tests/test-vazsprintf-gnu.c
tests/test-vazsprintf-gnu.h
tests/macros.h
Depends-on:
configure.ac:
Makefile.am:
TESTS += test-vazsprintf-gnu
check_PROGRAMS += test-vazsprintf-gnu

View File

@@ -1,13 +0,0 @@
Files:
tests/test-vazsprintf-posix.c
tests/infinity.h
tests/macros.h
Depends-on:
nan
configure.ac:
Makefile.am:
TESTS += test-vazsprintf-posix
check_PROGRAMS += test-vazsprintf-posix

View File

@@ -11,7 +11,7 @@ Depends-on:
stdio stdio
errno [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] errno [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
stdint [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] stdint [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
vzsnprintf [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1] vsnzprintf [test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1]
configure.ac: configure.ac:
gl_FUNC_VSNPRINTF gl_FUNC_VSNPRINTF

View File

@@ -1,9 +1,9 @@
Description: Description:
vzsnprintf() function: print formatted output from an stdarg argument list vsnzprintf() function: print formatted output from an stdarg argument list
to a fixed length string (without INT_MAX limitation) to a fixed length string (without INT_MAX limitation)
Files: Files:
lib/vzsnprintf.c lib/vsnzprintf.c
Depends-on: Depends-on:
stdio stdio
@@ -12,10 +12,10 @@ errno
stdint stdint
configure.ac: configure.ac:
gl_STDIO_MODULE_INDICATOR([vzsnprintf]) gl_STDIO_MODULE_INDICATOR([vsnzprintf])
Makefile.am: Makefile.am:
lib_SOURCES += vzsnprintf.c lib_SOURCES += vsnzprintf.c
Include: Include:
<stdio.h> <stdio.h>

View File

@@ -1,11 +1,11 @@
Description: Description:
vzsnprintf() function vsnzprintf() function
with POSIX compliant and GNU compatible format string interpretation with POSIX compliant and GNU compatible format string interpretation
Files: Files:
Depends-on: Depends-on:
vzsnprintf-posix vsnzprintf-posix
mixin/printf-gnu mixin/printf-gnu
configure.ac: configure.ac:

View File

@@ -0,0 +1,12 @@
Files:
tests/test-vsnzprintf-gnu.c
tests/test-snzprintf-gnu.h
tests/macros.h
Depends-on:
configure.ac:
Makefile.am:
TESTS += test-vsnzprintf-gnu
check_PROGRAMS += test-vsnzprintf-gnu

View File

@@ -1,10 +1,10 @@
Description: Description:
vzsnprintf() function with POSIX compliant format string interpretation vsnzprintf() function with POSIX compliant format string interpretation
Files: Files:
Depends-on: Depends-on:
vzsnprintf vsnzprintf
mixin/printf-posix mixin/printf-posix
configure.ac: configure.ac:

View File

@@ -0,0 +1,14 @@
Files:
tests/test-vsnzprintf-posix.c
tests/test-snzprintf-posix.h
tests/infinity.h
tests/macros.h
Depends-on:
nan
configure.ac:
Makefile.am:
TESTS += test-vsnzprintf-posix
check_PROGRAMS += test-vsnzprintf-posix

View File

@@ -18,7 +18,7 @@ stdio
nocrash nocrash
printf-safe printf-safe
multiarch multiarch
vzsprintf [test $REPLACE_VSPRINTF = 1] vszprintf [test $REPLACE_VSPRINTF = 1]
mixin/printf-posix [test $REPLACE_VSPRINTF = 1] mixin/printf-posix [test $REPLACE_VSPRINTF = 1]
stdint [test $REPLACE_VSPRINTF = 1] stdint [test $REPLACE_VSPRINTF = 1]
errno [test $REPLACE_VSPRINTF = 1] errno [test $REPLACE_VSPRINTF = 1]

View File

@@ -1,9 +1,9 @@
Description: Description:
vzsprintf() function: print formatted output from an stdarg argument list vszprintf() function: print formatted output from an stdarg argument list
to a string (without INT_MAX limitation) to a string (without INT_MAX limitation)
Files: Files:
lib/vzsprintf.c lib/vszprintf.c
Depends-on: Depends-on:
stdio stdio
@@ -12,10 +12,10 @@ errno
stdint stdint
configure.ac: configure.ac:
gl_STDIO_MODULE_INDICATOR([vzsprintf]) gl_STDIO_MODULE_INDICATOR([vszprintf])
Makefile.am: Makefile.am:
lib_SOURCES += vzsprintf.c lib_SOURCES += vszprintf.c
Include: Include:
<stdio.h> <stdio.h>

View File

@@ -1,11 +1,11 @@
Description: Description:
vzsprintf() function vszprintf() function
with POSIX compliant and GNU compatible format string interpretation with POSIX compliant and GNU compatible format string interpretation
Files: Files:
Depends-on: Depends-on:
vzsprintf-posix vszprintf-posix
mixin/printf-gnu mixin/printf-gnu
configure.ac: configure.ac:

View File

@@ -0,0 +1,12 @@
Files:
tests/test-vszprintf-gnu.c
tests/test-szprintf-gnu.h
tests/macros.h
Depends-on:
configure.ac:
Makefile.am:
TESTS += test-vszprintf-gnu
check_PROGRAMS += test-vszprintf-gnu

View File

@@ -1,10 +1,10 @@
Description: Description:
vzsprintf() function with POSIX compliant format string interpretation vszprintf() function with POSIX compliant format string interpretation
Files: Files:
Depends-on: Depends-on:
vzsprintf vszprintf
mixin/printf-posix mixin/printf-posix
configure.ac: configure.ac:

View File

@@ -0,0 +1,14 @@
Files:
tests/test-vszprintf-posix.c
tests/test-szprintf-posix.h
tests/infinity.h
tests/macros.h
Depends-on:
nan
configure.ac:
Makefile.am:
TESTS += test-vszprintf-posix
check_PROGRAMS += test-vszprintf-posix

View File

@@ -1,12 +0,0 @@
Files:
tests/test-vzsnprintf-gnu.c
tests/test-zsnprintf-gnu.h
tests/macros.h
Depends-on:
configure.ac:
Makefile.am:
TESTS += test-vzsnprintf-gnu
check_PROGRAMS += test-vzsnprintf-gnu

View File

@@ -1,14 +0,0 @@
Files:
tests/test-vzsnprintf-posix.c
tests/test-zsnprintf-posix.h
tests/infinity.h
tests/macros.h
Depends-on:
nan
configure.ac:
Makefile.am:
TESTS += test-vzsnprintf-posix
check_PROGRAMS += test-vzsnprintf-posix

View File

@@ -1,12 +0,0 @@
Files:
tests/test-vzsprintf-gnu.c
tests/test-zsprintf-gnu.h
tests/macros.h
Depends-on:
configure.ac:
Makefile.am:
TESTS += test-vzsprintf-gnu
check_PROGRAMS += test-vzsprintf-gnu

View File

@@ -1,14 +0,0 @@
Files:
tests/test-vzsprintf-posix.c
tests/test-zsprintf-posix.h
tests/infinity.h
tests/macros.h
Depends-on:
nan
configure.ac:
Makefile.am:
TESTS += test-vzsprintf-posix
check_PROGRAMS += test-vzsprintf-posix

View File

@@ -12,7 +12,7 @@ m4/strerrorname_np.m4
Depends-on: Depends-on:
extensions extensions
stdio stdio
vazsprintf vaszprintf
xalloc xalloc
xalloc-die xalloc-die
extern-inline extern-inline

View File

@@ -1,12 +0,0 @@
Files:
tests/test-zsnprintf-gnu.c
tests/test-zsnprintf-gnu.h
tests/macros.h
Depends-on:
configure.ac:
Makefile.am:
TESTS += test-zsnprintf-gnu
check_PROGRAMS += test-zsnprintf-gnu

View File

@@ -1,14 +0,0 @@
Files:
tests/test-zsnprintf-posix.c
tests/test-zsnprintf-posix.h
tests/infinity.h
tests/macros.h
Depends-on:
nan
configure.ac:
Makefile.am:
TESTS += test-zsnprintf-posix
check_PROGRAMS += test-zsnprintf-posix

View File

@@ -1,12 +0,0 @@
Files:
tests/test-zsprintf-gnu.c
tests/test-zsprintf-gnu.h
tests/macros.h
Depends-on:
configure.ac:
Makefile.am:
TESTS += test-zsprintf-gnu
check_PROGRAMS += test-zsprintf-gnu

View File

@@ -1,14 +0,0 @@
Files:
tests/test-zsprintf-posix.c
tests/test-zsprintf-posix.h
tests/infinity.h
tests/macros.h
Depends-on:
nan
configure.ac:
Makefile.am:
TESTS += test-zsprintf-posix
check_PROGRAMS += test-zsprintf-posix

View File

@@ -1,4 +1,4 @@
/* Test of POSIX and GNU compatible c_zsnprintf() function. /* Test of POSIX and GNU compatible c_snzprintf() function.
Copyright (C) 2011-2024 Free Software Foundation, Inc. Copyright (C) 2011-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -26,7 +26,7 @@
#include "macros.h" #include "macros.h"
#include "test-zsnprintf-gnu.h" #include "test-snzprintf-gnu.h"
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
@@ -35,7 +35,7 @@ main (int argc, char *argv[])
if (setlocale (LC_ALL, "") == NULL) if (setlocale (LC_ALL, "") == NULL)
return 1; return 1;
test_function (c_zsnprintf); test_function (c_snzprintf);
return test_exit_status; return test_exit_status;
} }

View File

@@ -12,4 +12,4 @@ if test $LOCALE_FR = none; then
fi fi
LC_ALL=$LOCALE_FR \ LC_ALL=$LOCALE_FR \
${CHECKER} ./test-c-zsnprintf-gnu${EXEEXT} 1 ${CHECKER} ./test-c-snzprintf-gnu${EXEEXT} 1

View File

@@ -1,4 +1,4 @@
/* Test of POSIX and GNU compatible c_vazsprintf() and c_azsprintf() functions. /* Test of POSIX and GNU compatible c_vaszprintf() and c_aszprintf() functions.
Copyright (C) 2011-2024 Free Software Foundation, Inc. Copyright (C) 2011-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -26,30 +26,30 @@
#include "macros.h" #include "macros.h"
#include "test-vazsprintf-gnu.h" #include "test-vaszprintf-gnu.h"
static ptrdiff_t static ptrdiff_t
my_c_azsprintf (char **result, const char *format, ...) my_c_aszprintf (char **result, const char *format, ...)
{ {
va_list args; va_list args;
ptrdiff_t ret; ptrdiff_t ret;
va_start (args, format); va_start (args, format);
ret = c_vazsprintf (result, format, args); ret = c_vaszprintf (result, format, args);
va_end (args); va_end (args);
return ret; return ret;
} }
static void static void
test_c_vazsprintf () test_c_vaszprintf ()
{ {
test_function (my_c_azsprintf); test_function (my_c_aszprintf);
} }
static void static void
test_c_azsprintf () test_c_aszprintf ()
{ {
test_function (c_azsprintf); test_function (c_aszprintf);
} }
int int
@@ -59,8 +59,8 @@ main (int argc, char *argv[])
if (setlocale (LC_ALL, "") == NULL) if (setlocale (LC_ALL, "") == NULL)
return 1; return 1;
test_c_vazsprintf (); test_c_vaszprintf ();
test_c_azsprintf (); test_c_aszprintf ();
return test_exit_status; return test_exit_status;
} }

View File

@@ -12,4 +12,4 @@ if test $LOCALE_FR = none; then
fi fi
LC_ALL=$LOCALE_FR \ LC_ALL=$LOCALE_FR \
${CHECKER} ./test-c-vazsprintf-gnu${EXEEXT} 1 ${CHECKER} ./test-c-vaszprintf-gnu${EXEEXT} 1

View File

@@ -1,4 +1,4 @@
/* Test of POSIX and GNU compatible c_vzsnprintf() function. /* Test of POSIX and GNU compatible c_vsnzprintf() function.
Copyright (C) 2011-2024 Free Software Foundation, Inc. Copyright (C) 2011-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -26,16 +26,16 @@
#include "macros.h" #include "macros.h"
#include "test-zsnprintf-gnu.h" #include "test-snzprintf-gnu.h"
static ptrdiff_t static ptrdiff_t
my_c_zsnprintf (char *str, size_t size, const char *format, ...) my_c_snzprintf (char *str, size_t size, const char *format, ...)
{ {
va_list args; va_list args;
ptrdiff_t ret; ptrdiff_t ret;
va_start (args, format); va_start (args, format);
ret = c_vzsnprintf (str, size, format, args); ret = c_vsnzprintf (str, size, format, args);
va_end (args); va_end (args);
return ret; return ret;
} }
@@ -47,7 +47,7 @@ main (int argc, char *argv[])
if (setlocale (LC_ALL, "") == NULL) if (setlocale (LC_ALL, "") == NULL)
return 1; return 1;
test_function (my_c_zsnprintf); test_function (my_c_snzprintf);
return test_exit_status; return test_exit_status;
} }

View File

@@ -12,4 +12,4 @@ if test $LOCALE_FR = none; then
fi fi
LC_ALL=$LOCALE_FR \ LC_ALL=$LOCALE_FR \
${CHECKER} ./test-c-vzsnprintf-gnu${EXEEXT} 1 ${CHECKER} ./test-c-vsnzprintf-gnu${EXEEXT} 1

View File

@@ -1,4 +1,4 @@
/* Test of POSIX and GNU compatible zsnprintf() function. /* Test of POSIX and GNU compatible snzprintf() function.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -25,11 +25,11 @@
#include "macros.h" #include "macros.h"
#include "test-zsnprintf-gnu.h" #include "test-snzprintf-gnu.h"
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
test_function (zsnprintf); test_function (snzprintf);
return test_exit_status; return test_exit_status;
} }

View File

@@ -1,4 +1,4 @@
/* Test of POSIX and GNU compatible vzsnprintf() and zsnprintf() functions. /* Test of POSIX and GNU compatible vsnzprintf() and snzprintf() functions.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -21,7 +21,7 @@
see test-snprintf-posix.h. */ see test-snprintf-posix.h. */
static void static void
test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...)) test_function (ptrdiff_t (*my_snzprintf) (char *, size_t, const char *, ...))
{ {
char result[5000]; char result[5000];
@@ -30,7 +30,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on all platforms other than glibc ≥ 2.35. */ { /* This test would fail on all platforms other than glibc ≥ 2.35. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%#B %d", 12345, 33, 44, 55); my_snzprintf (result, sizeof (result), "%#B %d", 12345, 33, 44, 55);
ASSERT (strcmp (result, "0B11000000111001 33") == 0); ASSERT (strcmp (result, "0B11000000111001 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));
} }

View File

@@ -1,4 +1,4 @@
/* Test of POSIX compatible zsnprintf() function. /* Test of POSIX compatible snzprintf() function.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -25,11 +25,11 @@
#include "macros.h" #include "macros.h"
#include "test-zsnprintf-posix.h" #include "test-snzprintf-posix.h"
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
test_function (zsnprintf); test_function (snzprintf);
return test_exit_status; return test_exit_status;
} }

View File

@@ -1,4 +1,4 @@
/* Test of POSIX compatible vzsnprintf() and zsnprintf() functions. /* Test of POSIX compatible vsnzprintf() and snzprintf() functions.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -45,7 +45,7 @@ strisnan (const char *string, size_t start_index, size_t end_index, int uppercas
} }
static void static void
test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...)) test_function (ptrdiff_t (*my_snzprintf) (char *, size_t, const char *, ...))
{ {
char result[5000]; char result[5000];
@@ -54,7 +54,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on Solaris 11.4. */ { /* This test would fail on Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%a %d", 3.1416015625, 33, 44, 55); my_snzprintf (result, sizeof (result), "%a %d", 3.1416015625, 33, 44, 55);
ASSERT (strcmp (result, "0x1.922p+1 33") == 0 ASSERT (strcmp (result, "0x1.922p+1 33") == 0
|| strcmp (result, "0x3.244p+0 33") == 0 || strcmp (result, "0x3.244p+0 33") == 0
|| strcmp (result, "0x6.488p-1 33") == 0 || strcmp (result, "0x6.488p-1 33") == 0
@@ -64,7 +64,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on Solaris 11.4. */ { /* This test would fail on Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%A %d", -3.1416015625, 33, 44, 55); my_snzprintf (result, sizeof (result), "%A %d", -3.1416015625, 33, 44, 55);
ASSERT (strcmp (result, "-0X1.922P+1 33") == 0 ASSERT (strcmp (result, "-0X1.922P+1 33") == 0
|| strcmp (result, "-0X3.244P+0 33") == 0 || strcmp (result, "-0X3.244P+0 33") == 0
|| strcmp (result, "-0X6.488P-1 33") == 0 || strcmp (result, "-0X6.488P-1 33") == 0
@@ -74,7 +74,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on FreeBSD 6.1, NetBSD 10.0. */ { /* This test would fail on FreeBSD 6.1, NetBSD 10.0. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%.2a %d", 1.51, 33, 44, 55); my_snzprintf (result, sizeof (result), "%.2a %d", 1.51, 33, 44, 55);
ASSERT (strcmp (result, "0x1.83p+0 33") == 0 ASSERT (strcmp (result, "0x1.83p+0 33") == 0
|| strcmp (result, "0x3.05p-1 33") == 0 || strcmp (result, "0x3.05p-1 33") == 0
|| strcmp (result, "0x6.0ap-2 33") == 0 || strcmp (result, "0x6.0ap-2 33") == 0
@@ -85,7 +85,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on macOS 14, FreeBSD 14.0, OpenBSD 7.5, AIX 7.3, { /* This test would fail on macOS 14, FreeBSD 14.0, OpenBSD 7.5, AIX 7.3,
Solaris 11.4. */ Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%.0a %d", 1.51, 33, 44, 55); my_snzprintf (result, sizeof (result), "%.0a %d", 1.51, 33, 44, 55);
ASSERT (strcmp (result, "0x2p+0 33") == 0 ASSERT (strcmp (result, "0x2p+0 33") == 0
|| strcmp (result, "0x3p-1 33") == 0 || strcmp (result, "0x3p-1 33") == 0
|| strcmp (result, "0x6p-2 33") == 0 || strcmp (result, "0x6p-2 33") == 0
@@ -97,7 +97,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%f %d", Infinityd (), 33, 44, 55); my_snzprintf (result, sizeof (result), "%f %d", Infinityd (), 33, 44, 55);
ASSERT (strcmp (result, "inf 33") == 0 ASSERT (strcmp (result, "inf 33") == 0
|| strcmp (result, "infinity 33") == 0); || strcmp (result, "infinity 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));
@@ -105,7 +105,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%f %d", NaNd (), 33, 44, 55); my_snzprintf (result, sizeof (result), "%f %d", NaNd (), 33, 44, 55);
ASSERT (strlen (result) >= 3 + 3 ASSERT (strlen (result) >= 3 + 3
&& strisnan (result, 0, strlen (result) - 3, 0) && strisnan (result, 0, strlen (result) - 3, 0)
&& strcmp (result + strlen (result) - 3, " 33") == 0); && strcmp (result + strlen (result) - 3, " 33") == 0);
@@ -114,7 +114,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%010f %d", Infinityd (), 33, 44, 55); my_snzprintf (result, sizeof (result), "%010f %d", Infinityd (), 33, 44, 55);
ASSERT (strcmp (result, " inf 33") == 0 ASSERT (strcmp (result, " inf 33") == 0
|| strcmp (result, " infinity 33") == 0); || strcmp (result, " infinity 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));
@@ -124,7 +124,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%e %d", Infinityd (), 33, 44, 55); my_snzprintf (result, sizeof (result), "%e %d", Infinityd (), 33, 44, 55);
ASSERT (strcmp (result, "inf 33") == 0 ASSERT (strcmp (result, "inf 33") == 0
|| strcmp (result, "infinity 33") == 0); || strcmp (result, "infinity 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));
@@ -132,7 +132,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%e %d", NaNd (), 33, 44, 55); my_snzprintf (result, sizeof (result), "%e %d", NaNd (), 33, 44, 55);
ASSERT (strlen (result) >= 3 + 3 ASSERT (strlen (result) >= 3 + 3
&& strisnan (result, 0, strlen (result) - 3, 0) && strisnan (result, 0, strlen (result) - 3, 0)
&& strcmp (result + strlen (result) - 3, " 33") == 0); && strcmp (result + strlen (result) - 3, " 33") == 0);
@@ -143,7 +143,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%g %d", Infinityd (), 33, 44, 55); my_snzprintf (result, sizeof (result), "%g %d", Infinityd (), 33, 44, 55);
ASSERT (strcmp (result, "inf 33") == 0 ASSERT (strcmp (result, "inf 33") == 0
|| strcmp (result, "infinity 33") == 0); || strcmp (result, "infinity 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));
@@ -151,7 +151,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%g %d", NaNd (), 33, 44, 55); my_snzprintf (result, sizeof (result), "%g %d", NaNd (), 33, 44, 55);
ASSERT (strlen (result) >= 3 + 3 ASSERT (strlen (result) >= 3 + 3
&& strisnan (result, 0, strlen (result) - 3, 0) && strisnan (result, 0, strlen (result) - 3, 0)
&& strcmp (result + strlen (result) - 3, " 33") == 0); && strcmp (result + strlen (result) - 3, " 33") == 0);
@@ -162,7 +162,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on AIX 7.1. */ { /* This test would fail on AIX 7.1. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%.4000d %d", 1234567, 99); my_snzprintf (result, sizeof (result), "%.4000d %d", 1234567, 99);
size_t i; size_t i;
for (i = 0; i < 4000 - 7; i++) for (i = 0; i < 4000 - 7; i++)
ASSERT (result[i] == '0'); ASSERT (result[i] == '0');
@@ -176,7 +176,7 @@ test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
{ /* This test would fail on glibc 2.34, musl libc, macOS 14, { /* This test would fail on glibc 2.34, musl libc, macOS 14,
FreeBSD 13.2, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4. */ FreeBSD 13.2, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsnprintf (result, sizeof (result), "%b %d", 12345, 33, 44, 55); my_snzprintf (result, sizeof (result), "%b %d", 12345, 33, 44, 55);
ASSERT (strcmp (result, "11000000111001 33") == 0); ASSERT (strcmp (result, "11000000111001 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));
} }

View File

@@ -1,4 +1,4 @@
/* Test of POSIX and GNU compatible zsprintf() function. /* Test of POSIX and GNU compatible szprintf() function.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -26,11 +26,11 @@
#include "macros.h" #include "macros.h"
#include "test-zsprintf-gnu.h" #include "test-szprintf-gnu.h"
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
test_function (zsprintf); test_function (szprintf);
return test_exit_status; return test_exit_status;
} }

View File

@@ -1,4 +1,4 @@
/* Test of POSIX and GNU compatible vzsprintf() and zsprintf() functions. /* Test of POSIX and GNU compatible vszprintf() and szprintf() functions.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -21,7 +21,7 @@
see test-sprintf-posix.h. */ see test-sprintf-posix.h. */
static void static void
test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...)) test_function (ptrdiff_t (*my_szprintf) (char *, const char *, ...))
{ {
char result[5000]; char result[5000];
@@ -30,7 +30,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on all platforms other than glibc ≥ 2.35. */ { /* This test would fail on all platforms other than glibc ≥ 2.35. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%#B %d", 12345, 33, 44, 55); my_szprintf (result, "%#B %d", 12345, 33, 44, 55);
ASSERT (strcmp (result, "0B11000000111001 33") == 0); ASSERT (strcmp (result, "0B11000000111001 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));
} }

View File

@@ -1,4 +1,4 @@
/* Test of POSIX compatible zsprintf() function. /* Test of POSIX compatible szprintf() function.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -26,11 +26,11 @@
#include "macros.h" #include "macros.h"
#include "test-zsprintf-posix.h" #include "test-szprintf-posix.h"
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
test_function (zsprintf); test_function (szprintf);
return test_exit_status; return test_exit_status;
} }

View File

@@ -1,4 +1,4 @@
/* Test of POSIX compatible vzsprintf() and zsprintf() functions. /* Test of POSIX compatible vszprintf() and szprintf() functions.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -45,7 +45,7 @@ strisnan (const char *string, size_t start_index, size_t end_index, int uppercas
} }
static void static void
test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...)) test_function (ptrdiff_t (*my_szprintf) (char *, const char *, ...))
{ {
char result[5000]; char result[5000];
@@ -54,7 +54,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on Solaris 11.4. */ { /* This test would fail on Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%a %d", 3.1416015625, 33, 44, 55); my_szprintf (result, "%a %d", 3.1416015625, 33, 44, 55);
ASSERT (strcmp (result, "0x1.922p+1 33") == 0 ASSERT (strcmp (result, "0x1.922p+1 33") == 0
|| strcmp (result, "0x3.244p+0 33") == 0 || strcmp (result, "0x3.244p+0 33") == 0
|| strcmp (result, "0x6.488p-1 33") == 0 || strcmp (result, "0x6.488p-1 33") == 0
@@ -64,7 +64,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on Solaris 11.4. */ { /* This test would fail on Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%A %d", -3.1416015625, 33, 44, 55); my_szprintf (result, "%A %d", -3.1416015625, 33, 44, 55);
ASSERT (strcmp (result, "-0X1.922P+1 33") == 0 ASSERT (strcmp (result, "-0X1.922P+1 33") == 0
|| strcmp (result, "-0X3.244P+0 33") == 0 || strcmp (result, "-0X3.244P+0 33") == 0
|| strcmp (result, "-0X6.488P-1 33") == 0 || strcmp (result, "-0X6.488P-1 33") == 0
@@ -74,7 +74,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on FreeBSD 6.1, NetBSD 10.0. */ { /* This test would fail on FreeBSD 6.1, NetBSD 10.0. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%.2a %d", 1.51, 33, 44, 55); my_szprintf (result, "%.2a %d", 1.51, 33, 44, 55);
ASSERT (strcmp (result, "0x1.83p+0 33") == 0 ASSERT (strcmp (result, "0x1.83p+0 33") == 0
|| strcmp (result, "0x3.05p-1 33") == 0 || strcmp (result, "0x3.05p-1 33") == 0
|| strcmp (result, "0x6.0ap-2 33") == 0 || strcmp (result, "0x6.0ap-2 33") == 0
@@ -85,7 +85,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on macOS 14, FreeBSD 14.0, OpenBSD 7.5, AIX 7.3, { /* This test would fail on macOS 14, FreeBSD 14.0, OpenBSD 7.5, AIX 7.3,
Solaris 11.4. */ Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%.0a %d", 1.51, 33, 44, 55); my_szprintf (result, "%.0a %d", 1.51, 33, 44, 55);
ASSERT (strcmp (result, "0x2p+0 33") == 0 ASSERT (strcmp (result, "0x2p+0 33") == 0
|| strcmp (result, "0x3p-1 33") == 0 || strcmp (result, "0x3p-1 33") == 0
|| strcmp (result, "0x6p-2 33") == 0 || strcmp (result, "0x6p-2 33") == 0
@@ -97,7 +97,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%f %d", Infinityd (), 33, 44, 55); my_szprintf (result, "%f %d", Infinityd (), 33, 44, 55);
ASSERT (strcmp (result, "inf 33") == 0 ASSERT (strcmp (result, "inf 33") == 0
|| strcmp (result, "infinity 33") == 0); || strcmp (result, "infinity 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));
@@ -105,7 +105,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%f %d", NaNd (), 33, 44, 55); my_szprintf (result, "%f %d", NaNd (), 33, 44, 55);
ASSERT (strlen (result) >= 3 + 3 ASSERT (strlen (result) >= 3 + 3
&& strisnan (result, 0, strlen (result) - 3, 0) && strisnan (result, 0, strlen (result) - 3, 0)
&& strcmp (result + strlen (result) - 3, " 33") == 0); && strcmp (result + strlen (result) - 3, " 33") == 0);
@@ -114,7 +114,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%010f %d", Infinityd (), 33, 44, 55); my_szprintf (result, "%010f %d", Infinityd (), 33, 44, 55);
ASSERT (strcmp (result, " inf 33") == 0 ASSERT (strcmp (result, " inf 33") == 0
|| strcmp (result, " infinity 33") == 0); || strcmp (result, " infinity 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));
@@ -124,7 +124,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%e %d", Infinityd (), 33, 44, 55); my_szprintf (result, "%e %d", Infinityd (), 33, 44, 55);
ASSERT (strcmp (result, "inf 33") == 0 ASSERT (strcmp (result, "inf 33") == 0
|| strcmp (result, "infinity 33") == 0); || strcmp (result, "infinity 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));
@@ -132,7 +132,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%e %d", NaNd (), 33, 44, 55); my_szprintf (result, "%e %d", NaNd (), 33, 44, 55);
ASSERT (strlen (result) >= 3 + 3 ASSERT (strlen (result) >= 3 + 3
&& strisnan (result, 0, strlen (result) - 3, 0) && strisnan (result, 0, strlen (result) - 3, 0)
&& strcmp (result + strlen (result) - 3, " 33") == 0); && strcmp (result + strlen (result) - 3, " 33") == 0);
@@ -143,7 +143,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%g %d", Infinityd (), 33, 44, 55); my_szprintf (result, "%g %d", Infinityd (), 33, 44, 55);
ASSERT (strcmp (result, "inf 33") == 0 ASSERT (strcmp (result, "inf 33") == 0
|| strcmp (result, "infinity 33") == 0); || strcmp (result, "infinity 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));
@@ -151,7 +151,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%g %d", NaNd (), 33, 44, 55); my_szprintf (result, "%g %d", NaNd (), 33, 44, 55);
ASSERT (strlen (result) >= 3 + 3 ASSERT (strlen (result) >= 3 + 3
&& strisnan (result, 0, strlen (result) - 3, 0) && strisnan (result, 0, strlen (result) - 3, 0)
&& strcmp (result + strlen (result) - 3, " 33") == 0); && strcmp (result + strlen (result) - 3, " 33") == 0);
@@ -162,7 +162,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on AIX 7.1. */ { /* This test would fail on AIX 7.1. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%.4000d %d", 1234567, 99); my_szprintf (result, "%.4000d %d", 1234567, 99);
size_t i; size_t i;
for (i = 0; i < 4000 - 7; i++) for (i = 0; i < 4000 - 7; i++)
ASSERT (result[i] == '0'); ASSERT (result[i] == '0');
@@ -176,7 +176,7 @@ test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
{ /* This test would fail on glibc 2.34, musl libc, macOS 14, { /* This test would fail on glibc 2.34, musl libc, macOS 14,
FreeBSD 13.2, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4. */ FreeBSD 13.2, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4. */
ptrdiff_t retval = ptrdiff_t retval =
my_zsprintf (result, "%b %d", 12345, 33, 44, 55); my_szprintf (result, "%b %d", 12345, 33, 44, 55);
ASSERT (strcmp (result, "11000000111001 33") == 0); ASSERT (strcmp (result, "11000000111001 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));
} }

View File

@@ -1,4 +1,4 @@
/* Test of POSIX and GNU compatible vazsprintf() and azsprintf() functions. /* Test of POSIX and GNU compatible vaszprintf() and aszprintf() functions.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -31,36 +31,36 @@
#include "macros.h" #include "macros.h"
#include "test-vazsprintf-gnu.h" #include "test-vaszprintf-gnu.h"
static ptrdiff_t static ptrdiff_t
my_azsprintf (char **result, const char *format, ...) my_aszprintf (char **result, const char *format, ...)
{ {
va_list args; va_list args;
ptrdiff_t ret; ptrdiff_t ret;
va_start (args, format); va_start (args, format);
ret = vazsprintf (result, format, args); ret = vaszprintf (result, format, args);
va_end (args); va_end (args);
return ret; return ret;
} }
static void static void
test_vazsprintf () test_vaszprintf ()
{ {
test_function (my_azsprintf); test_function (my_aszprintf);
} }
static void static void
test_azsprintf () test_aszprintf ()
{ {
test_function (azsprintf); test_function (aszprintf);
} }
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
test_vazsprintf (); test_vaszprintf ();
test_azsprintf (); test_aszprintf ();
return test_exit_status; return test_exit_status;
} }

View File

@@ -1,4 +1,4 @@
/* Test of POSIX and GNU compatible vazsprintf() and azsprintf() functions. /* Test of POSIX and GNU compatible vaszprintf() and aszprintf() functions.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -17,7 +17,7 @@
/* Written by Bruno Haible <bruno@clisp.org>, 2024. */ /* Written by Bruno Haible <bruno@clisp.org>, 2024. */
static void static void
test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...)) test_function (ptrdiff_t (*my_aszprintf) (char **, const char *, ...))
{ {
/* Test the support of the 'B' conversion specifier for binary output of /* Test the support of the 'B' conversion specifier for binary output of
integers. */ integers. */
@@ -25,7 +25,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
{ /* This test would fail on all platforms other than glibc ≥ 2.35. */ { /* This test would fail on all platforms other than glibc ≥ 2.35. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%#B %d", 12345, 33, 44, 55); my_aszprintf (&result, "%#B %d", 12345, 33, 44, 55);
ASSERT (result != NULL); ASSERT (result != NULL);
ASSERT (strcmp (result, "0B11000000111001 33") == 0); ASSERT (strcmp (result, "0B11000000111001 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));

View File

@@ -1,4 +1,4 @@
/* Test of POSIX compatible vazsprintf() and azsprintf() functions. /* Test of POSIX compatible vaszprintf() and aszprintf() functions.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -55,7 +55,7 @@ strisnan (const char *string, size_t start_index, size_t end_index, int uppercas
} }
static void static void
test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...)) test_function (ptrdiff_t (*my_aszprintf) (char **, const char *, ...))
{ {
char result[5000]; char result[5000];
@@ -65,7 +65,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
{ /* This test would fail on Solaris 11.4. */ { /* This test would fail on Solaris 11.4. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%a %d", 3.1416015625, 33, 44, 55); my_aszprintf (&result, "%a %d", 3.1416015625, 33, 44, 55);
ASSERT (result != NULL); ASSERT (result != NULL);
ASSERT (strcmp (result, "0x1.922p+1 33") == 0 ASSERT (strcmp (result, "0x1.922p+1 33") == 0
|| strcmp (result, "0x3.244p+0 33") == 0 || strcmp (result, "0x3.244p+0 33") == 0
@@ -78,7 +78,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
{ /* This test would fail on Solaris 11.4. */ { /* This test would fail on Solaris 11.4. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%A %d", -3.1416015625, 33, 44, 55); my_aszprintf (&result, "%A %d", -3.1416015625, 33, 44, 55);
ASSERT (result != NULL); ASSERT (result != NULL);
ASSERT (strcmp (result, "-0X1.922P+1 33") == 0 ASSERT (strcmp (result, "-0X1.922P+1 33") == 0
|| strcmp (result, "-0X3.244P+0 33") == 0 || strcmp (result, "-0X3.244P+0 33") == 0
@@ -91,7 +91,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
{ /* This test would fail on FreeBSD 6.1, NetBSD 10.0. */ { /* This test would fail on FreeBSD 6.1, NetBSD 10.0. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%.2a %d", 1.51, 33, 44, 55); my_aszprintf (&result, "%.2a %d", 1.51, 33, 44, 55);
ASSERT (result != NULL); ASSERT (result != NULL);
ASSERT (strcmp (result, "0x1.83p+0 33") == 0 ASSERT (strcmp (result, "0x1.83p+0 33") == 0
|| strcmp (result, "0x3.05p-1 33") == 0 || strcmp (result, "0x3.05p-1 33") == 0
@@ -105,7 +105,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
Solaris 11.4. */ Solaris 11.4. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%.0a %d", 1.51, 33, 44, 55); my_aszprintf (&result, "%.0a %d", 1.51, 33, 44, 55);
ASSERT (result != NULL); ASSERT (result != NULL);
ASSERT (strcmp (result, "0x2p+0 33") == 0 ASSERT (strcmp (result, "0x2p+0 33") == 0
|| strcmp (result, "0x3p-1 33") == 0 || strcmp (result, "0x3p-1 33") == 0
@@ -120,7 +120,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%f %d", Infinityd (), 33, 44, 55); my_aszprintf (&result, "%f %d", Infinityd (), 33, 44, 55);
ASSERT (result != NULL); ASSERT (result != NULL);
ASSERT (strcmp (result, "inf 33") == 0 ASSERT (strcmp (result, "inf 33") == 0
|| strcmp (result, "infinity 33") == 0); || strcmp (result, "infinity 33") == 0);
@@ -131,7 +131,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%f %d", NaNd (), 33, 44, 55); my_aszprintf (&result, "%f %d", NaNd (), 33, 44, 55);
ASSERT (result != NULL); ASSERT (result != NULL);
ASSERT (strlen (result) >= 3 + 3 ASSERT (strlen (result) >= 3 + 3
&& strisnan (result, 0, strlen (result) - 3, 0) && strisnan (result, 0, strlen (result) - 3, 0)
@@ -143,7 +143,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%010f %d", Infinityd (), 33, 44, 55); my_aszprintf (&result, "%010f %d", Infinityd (), 33, 44, 55);
ASSERT (result != NULL); ASSERT (result != NULL);
ASSERT (strcmp (result, " inf 33") == 0 ASSERT (strcmp (result, " inf 33") == 0
|| strcmp (result, " infinity 33") == 0); || strcmp (result, " infinity 33") == 0);
@@ -156,7 +156,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%e %d", Infinityd (), 33, 44, 55); my_aszprintf (&result, "%e %d", Infinityd (), 33, 44, 55);
ASSERT (result != NULL); ASSERT (result != NULL);
ASSERT (strcmp (result, "inf 33") == 0 ASSERT (strcmp (result, "inf 33") == 0
|| strcmp (result, "infinity 33") == 0); || strcmp (result, "infinity 33") == 0);
@@ -167,7 +167,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%e %d", NaNd (), 33, 44, 55); my_aszprintf (&result, "%e %d", NaNd (), 33, 44, 55);
ASSERT (result != NULL); ASSERT (result != NULL);
ASSERT (strlen (result) >= 3 + 3 ASSERT (strlen (result) >= 3 + 3
&& strisnan (result, 0, strlen (result) - 3, 0) && strisnan (result, 0, strlen (result) - 3, 0)
@@ -181,7 +181,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%g %d", Infinityd (), 33, 44, 55); my_aszprintf (&result, "%g %d", Infinityd (), 33, 44, 55);
ASSERT (result != NULL); ASSERT (result != NULL);
ASSERT (strcmp (result, "inf 33") == 0 ASSERT (strcmp (result, "inf 33") == 0
|| strcmp (result, "infinity 33") == 0); || strcmp (result, "infinity 33") == 0);
@@ -192,7 +192,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
{ /* This test would fail on AIX 7.3, Solaris 11.4. */ { /* This test would fail on AIX 7.3, Solaris 11.4. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%g %d", NaNd (), 33, 44, 55); my_aszprintf (&result, "%g %d", NaNd (), 33, 44, 55);
ASSERT (result != NULL); ASSERT (result != NULL);
ASSERT (strlen (result) >= 3 + 3 ASSERT (strlen (result) >= 3 + 3
&& strisnan (result, 0, strlen (result) - 3, 0) && strisnan (result, 0, strlen (result) - 3, 0)
@@ -206,7 +206,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
{ /* This test would fail on AIX 7.1. */ { /* This test would fail on AIX 7.1. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%.4000d %d", 1234567, 99); my_aszprintf (&result, "%.4000d %d", 1234567, 99);
ASSERT (result != NULL); ASSERT (result != NULL);
size_t i; size_t i;
for (i = 0; i < 4000 - 7; i++) for (i = 0; i < 4000 - 7; i++)
@@ -223,7 +223,7 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
FreeBSD 13.2, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4. */ FreeBSD 13.2, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4. */
char *result; char *result;
ptrdiff_t retval = ptrdiff_t retval =
my_azsprintf (&result, "%b %d", 12345, 33, 44, 55); my_aszprintf (&result, "%b %d", 12345, 33, 44, 55);
ASSERT (result != NULL); ASSERT (result != NULL);
ASSERT (strcmp (result, "11000000111001 33") == 0); ASSERT (strcmp (result, "11000000111001 33") == 0);
ASSERT (retval == strlen (result)); ASSERT (retval == strlen (result));
@@ -232,33 +232,33 @@ test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
} }
static ptrdiff_t static ptrdiff_t
my_azsprintf (char **result, const char *format, ...) my_aszprintf (char **result, const char *format, ...)
{ {
va_list args; va_list args;
ptrdiff_t ret; ptrdiff_t ret;
va_start (args, format); va_start (args, format);
ret = vazsprintf (result, format, args); ret = vaszprintf (result, format, args);
va_end (args); va_end (args);
return ret; return ret;
} }
static void static void
test_vazsprintf () test_vaszprintf ()
{ {
test_function (my_azsprintf); test_function (my_aszprintf);
} }
static void static void
test_azsprintf () test_aszprintf ()
{ {
test_function (azsprintf); test_function (aszprintf);
} }
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
test_vazsprintf (); test_vaszprintf ();
test_azsprintf (); test_aszprintf ();
return test_exit_status; return test_exit_status;
} }

View File

@@ -1,4 +1,4 @@
/* Test of POSIX and GNU compatible vzsnprintf() function. /* Test of POSIX and GNU compatible vsnzprintf() function.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -26,16 +26,16 @@
#include "macros.h" #include "macros.h"
#include "test-zsnprintf-gnu.h" #include "test-snzprintf-gnu.h"
static ptrdiff_t static ptrdiff_t
my_zsnprintf (char *str, size_t size, const char *format, ...) my_snzprintf (char *str, size_t size, const char *format, ...)
{ {
va_list args; va_list args;
ptrdiff_t ret; ptrdiff_t ret;
va_start (args, format); va_start (args, format);
ret = vzsnprintf (str, size, format, args); ret = vsnzprintf (str, size, format, args);
va_end (args); va_end (args);
return ret; return ret;
} }
@@ -43,6 +43,6 @@ my_zsnprintf (char *str, size_t size, const char *format, ...)
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
test_function (my_zsnprintf); test_function (my_snzprintf);
return test_exit_status; return test_exit_status;
} }

View File

@@ -1,4 +1,4 @@
/* Test of POSIX compatible vzsnprintf() function. /* Test of POSIX compatible vsnzprintf() function.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -26,16 +26,16 @@
#include "macros.h" #include "macros.h"
#include "test-zsnprintf-posix.h" #include "test-snzprintf-posix.h"
static ptrdiff_t static ptrdiff_t
my_zsnprintf (char *str, size_t size, const char *format, ...) my_snzprintf (char *str, size_t size, const char *format, ...)
{ {
va_list args; va_list args;
ptrdiff_t ret; ptrdiff_t ret;
va_start (args, format); va_start (args, format);
ret = vzsnprintf (str, size, format, args); ret = vsnzprintf (str, size, format, args);
va_end (args); va_end (args);
return ret; return ret;
} }
@@ -43,6 +43,6 @@ my_zsnprintf (char *str, size_t size, const char *format, ...)
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
test_function (my_zsnprintf); test_function (my_snzprintf);
return test_exit_status; return test_exit_status;
} }

View File

@@ -1,4 +1,4 @@
/* Test of POSIX and GNU compatible vzsprintf() function. /* Test of POSIX and GNU compatible vszprintf() function.
Copyright (C) 2007-2024 Free Software Foundation, Inc. Copyright (C) 2007-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -26,16 +26,16 @@
#include "macros.h" #include "macros.h"
#include "test-zsprintf-gnu.h" #include "test-szprintf-gnu.h"
static ptrdiff_t static ptrdiff_t
my_zsprintf (char *str, const char *format, ...) my_szprintf (char *str, const char *format, ...)
{ {
va_list args; va_list args;
ptrdiff_t ret; ptrdiff_t ret;
va_start (args, format); va_start (args, format);
ret = vzsprintf (str, format, args); ret = vszprintf (str, format, args);
va_end (args); va_end (args);
return ret; return ret;
} }
@@ -43,6 +43,6 @@ my_zsprintf (char *str, const char *format, ...)
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
test_function (my_zsprintf); test_function (my_szprintf);
return test_exit_status; return test_exit_status;
} }

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