]> Savannah Git Hosting - gnulib.git/commitdiff
Global rename *zs[n]printf -> *s[n]zprintf.
authorBruno Haible <bruno@clisp.org>
Sat, 29 Jun 2024 23:32:24 +0000 (01:32 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 29 Jun 2024 23:51:38 +0000 (01:51 +0200)
* 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.

153 files changed:
ChangeLog
lib/aszprintf.c [new file with mode: 0644]
lib/azsprintf.c [deleted file]
lib/c-aszprintf.c [new file with mode: 0644]
lib/c-azsprintf.c [deleted file]
lib/c-snprintf.c
lib/c-snprintf.h
lib/c-snzprintf.c [new file with mode: 0644]
lib/c-vasprintf.h
lib/c-vaszprintf.c [new file with mode: 0644]
lib/c-vazsprintf.c [deleted file]
lib/c-vsnprintf.c
lib/c-vsnprintf.h
lib/c-vsnzprintf.c [new file with mode: 0644]
lib/c-vzsnprintf.c [deleted file]
lib/c-xvasprintf.c
lib/c-zsnprintf.c [deleted file]
lib/snprintf.c
lib/snzprintf.c [new file with mode: 0644]
lib/sprintf.c
lib/stdio.in.h
lib/szprintf.c [new file with mode: 0644]
lib/vaszprintf.c [new file with mode: 0644]
lib/vazsprintf.c [deleted file]
lib/vsnprintf.c
lib/vsnzprintf.c [new file with mode: 0644]
lib/vsprintf.c
lib/vszprintf.c [new file with mode: 0644]
lib/vzsnprintf.c [deleted file]
lib/vzsprintf.c [deleted file]
lib/xvasprintf.c
lib/zsnprintf.c [deleted file]
lib/zsprintf.c [deleted file]
m4/stdio_h.m4
modules/c-snprintf
modules/c-snzprintf [new file with mode: 0644]
modules/c-snzprintf-gnu [new file with mode: 0644]
modules/c-snzprintf-gnu-tests [new file with mode: 0644]
modules/c-vaszprintf [new file with mode: 0644]
modules/c-vaszprintf-gnu [new file with mode: 0644]
modules/c-vaszprintf-gnu-tests [new file with mode: 0644]
modules/c-vazsprintf [deleted file]
modules/c-vazsprintf-gnu [deleted file]
modules/c-vazsprintf-gnu-tests [deleted file]
modules/c-vsnprintf
modules/c-vsnzprintf [new file with mode: 0644]
modules/c-vsnzprintf-gnu [new file with mode: 0644]
modules/c-vsnzprintf-gnu-tests [new file with mode: 0644]
modules/c-vzsnprintf [deleted file]
modules/c-vzsnprintf-gnu [deleted file]
modules/c-vzsnprintf-gnu-tests [deleted file]
modules/c-xvasprintf
modules/c-zsnprintf [deleted file]
modules/c-zsnprintf-gnu [deleted file]
modules/c-zsnprintf-gnu-tests [deleted file]
modules/snprintf
modules/snzprintf [new file with mode: 0644]
modules/snzprintf-gnu [new file with mode: 0644]
modules/snzprintf-gnu-tests [new file with mode: 0644]
modules/snzprintf-posix [new file with mode: 0644]
modules/snzprintf-posix-tests [new file with mode: 0644]
modules/sprintf-posix
modules/stdio
modules/szprintf [new file with mode: 0644]
modules/szprintf-gnu [new file with mode: 0644]
modules/szprintf-gnu-tests [new file with mode: 0644]
modules/szprintf-posix [new file with mode: 0644]
modules/szprintf-posix-tests [new file with mode: 0644]
modules/vaszprintf [new file with mode: 0644]
modules/vaszprintf-gnu [new file with mode: 0644]
modules/vaszprintf-gnu-tests [new file with mode: 0644]
modules/vaszprintf-posix [new file with mode: 0644]
modules/vaszprintf-posix-tests [new file with mode: 0644]
modules/vazsprintf [deleted file]
modules/vazsprintf-gnu [deleted file]
modules/vazsprintf-gnu-tests [deleted file]
modules/vazsprintf-posix [deleted file]
modules/vazsprintf-posix-tests [deleted file]
modules/vsnprintf
modules/vsnzprintf [new file with mode: 0644]
modules/vsnzprintf-gnu [new file with mode: 0644]
modules/vsnzprintf-gnu-tests [new file with mode: 0644]
modules/vsnzprintf-posix [new file with mode: 0644]
modules/vsnzprintf-posix-tests [new file with mode: 0644]
modules/vsprintf-posix
modules/vszprintf [new file with mode: 0644]
modules/vszprintf-gnu [new file with mode: 0644]
modules/vszprintf-gnu-tests [new file with mode: 0644]
modules/vszprintf-posix [new file with mode: 0644]
modules/vszprintf-posix-tests [new file with mode: 0644]
modules/vzsnprintf [deleted file]
modules/vzsnprintf-gnu [deleted file]
modules/vzsnprintf-gnu-tests [deleted file]
modules/vzsnprintf-posix [deleted file]
modules/vzsnprintf-posix-tests [deleted file]
modules/vzsprintf [deleted file]
modules/vzsprintf-gnu [deleted file]
modules/vzsprintf-gnu-tests [deleted file]
modules/vzsprintf-posix [deleted file]
modules/vzsprintf-posix-tests [deleted file]
modules/xvasprintf
modules/zsnprintf [deleted file]
modules/zsnprintf-gnu [deleted file]
modules/zsnprintf-gnu-tests [deleted file]
modules/zsnprintf-posix [deleted file]
modules/zsnprintf-posix-tests [deleted file]
modules/zsprintf [deleted file]
modules/zsprintf-gnu [deleted file]
modules/zsprintf-gnu-tests [deleted file]
modules/zsprintf-posix [deleted file]
modules/zsprintf-posix-tests [deleted file]
tests/test-c-snzprintf-gnu.c [new file with mode: 0644]
tests/test-c-snzprintf-gnu.sh [new file with mode: 0755]
tests/test-c-vaszprintf-gnu.c [new file with mode: 0644]
tests/test-c-vaszprintf-gnu.sh [new file with mode: 0755]
tests/test-c-vazsprintf-gnu.c [deleted file]
tests/test-c-vazsprintf-gnu.sh [deleted file]
tests/test-c-vsnzprintf-gnu.c [new file with mode: 0644]
tests/test-c-vsnzprintf-gnu.sh [new file with mode: 0755]
tests/test-c-vzsnprintf-gnu.c [deleted file]
tests/test-c-vzsnprintf-gnu.sh [deleted file]
tests/test-c-zsnprintf-gnu.c [deleted file]
tests/test-c-zsnprintf-gnu.sh [deleted file]
tests/test-snzprintf-gnu.c [new file with mode: 0644]
tests/test-snzprintf-gnu.h [new file with mode: 0644]
tests/test-snzprintf-posix.c [new file with mode: 0644]
tests/test-snzprintf-posix.h [new file with mode: 0644]
tests/test-szprintf-gnu.c [new file with mode: 0644]
tests/test-szprintf-gnu.h [new file with mode: 0644]
tests/test-szprintf-posix.c [new file with mode: 0644]
tests/test-szprintf-posix.h [new file with mode: 0644]
tests/test-vaszprintf-gnu.c [new file with mode: 0644]
tests/test-vaszprintf-gnu.h [new file with mode: 0644]
tests/test-vaszprintf-posix.c [new file with mode: 0644]
tests/test-vazsprintf-gnu.c [deleted file]
tests/test-vazsprintf-gnu.h [deleted file]
tests/test-vazsprintf-posix.c [deleted file]
tests/test-vsnzprintf-gnu.c [new file with mode: 0644]
tests/test-vsnzprintf-posix.c [new file with mode: 0644]
tests/test-vszprintf-gnu.c [new file with mode: 0644]
tests/test-vszprintf-posix.c [new file with mode: 0644]
tests/test-vzsnprintf-gnu.c [deleted file]
tests/test-vzsnprintf-posix.c [deleted file]
tests/test-vzsprintf-gnu.c [deleted file]
tests/test-vzsprintf-posix.c [deleted file]
tests/test-zsnprintf-gnu.c [deleted file]
tests/test-zsnprintf-gnu.h [deleted file]
tests/test-zsnprintf-posix.c [deleted file]
tests/test-zsnprintf-posix.h [deleted file]
tests/test-zsprintf-gnu.c [deleted file]
tests/test-zsprintf-gnu.h [deleted file]
tests/test-zsprintf-posix.c [deleted file]
tests/test-zsprintf-posix.h [deleted file]

index e55831aaef34770812ab9234c89248f19f5fc049..86fae3c40801acbf16d102d7c92a0a15a23d69bb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        bootstrap-funclib.sh: shrink or split too-long lines
diff --git a/lib/aszprintf.c b/lib/aszprintf.c
new file mode 100644 (file)
index 0000000..206bf74
--- /dev/null
@@ -0,0 +1,34 @@
+/* Formatted output to strings.
+   Copyright (C) 1999-2024 Free Software Foundation, Inc.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   This file 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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdio.h>
+
+#include <stdarg.h>
+
+ptrdiff_t
+aszprintf (char **resultp, const char *format, ...)
+{
+  va_list args;
+  ptrdiff_t result;
+
+  va_start (args, format);
+  result = vaszprintf (resultp, format, args);
+  va_end (args);
+  return result;
+}
diff --git a/lib/azsprintf.c b/lib/azsprintf.c
deleted file mode 100644 (file)
index 9489854..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Formatted output to strings.
-   Copyright (C) 1999-2024 Free Software Foundation, Inc.
-
-   This file is free software: you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   This file 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 Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include <stdio.h>
-
-#include <stdarg.h>
-
-ptrdiff_t
-azsprintf (char **resultp, const char *format, ...)
-{
-  va_list args;
-  ptrdiff_t result;
-
-  va_start (args, format);
-  result = vazsprintf (resultp, format, args);
-  va_end (args);
-  return result;
-}
diff --git a/lib/c-aszprintf.c b/lib/c-aszprintf.c
new file mode 100644 (file)
index 0000000..59d1072
--- /dev/null
@@ -0,0 +1,34 @@
+/* Formatted output to strings in C locale.
+   Copyright (C) 1999-2024 Free Software Foundation, Inc.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   This file 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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "c-vasprintf.h"
+
+#include <stdarg.h>
+
+ptrdiff_t
+c_aszprintf (char **resultp, const char *format, ...)
+{
+  va_list args;
+  ptrdiff_t result;
+
+  va_start (args, format);
+  result = c_vaszprintf (resultp, format, args);
+  va_end (args);
+  return result;
+}
diff --git a/lib/c-azsprintf.c b/lib/c-azsprintf.c
deleted file mode 100644 (file)
index 78bc973..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Formatted output to strings in C locale.
-   Copyright (C) 1999-2024 Free Software Foundation, Inc.
-
-   This file is free software: you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   This file 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 Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include "c-vasprintf.h"
-
-#include <stdarg.h>
-
-ptrdiff_t
-c_azsprintf (char **resultp, const char *format, ...)
-{
-  va_list args;
-  ptrdiff_t result;
-
-  va_start (args, format);
-  result = c_vazsprintf (resultp, format, args);
-  va_end (args);
-  return result;
-}
index 658f3faed40a4250820b727bb768a6fde363e46d..f768213ba23f2b21ee0ef5146a8f89226297bf82 100644 (file)
@@ -33,7 +33,7 @@ c_snprintf (char *str, size_t size, const char *format, ...)
   ptrdiff_t ret;
 
   va_start (args, format);
-  ret = c_vzsnprintf (str, size, format, args);
+  ret = c_vsnzprintf (str, size, format, args);
   va_end (args);
 
 #if PTRDIFF_MAX > INT_MAX
index f52e058e9ec32a79f06332f3a330c66f59a7ae60..8cd637d4dd6679c98cdb1b988544eac6b287c6a4 100644 (file)
@@ -44,7 +44,7 @@ extern "C" {
 
    Formatting takes place in the C locale, that is, the decimal point
    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, ...)
        _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4));
 
diff --git a/lib/c-snzprintf.c b/lib/c-snzprintf.c
new file mode 100644 (file)
index 0000000..c674af9
--- /dev/null
@@ -0,0 +1,66 @@
+/* Formatted output to strings in C locale.
+   Copyright (C) 2004, 2006-2024 Free Software Foundation, Inc.
+   Written by Simon Josefsson and Paul Eggert.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   This file 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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "c-snprintf.h"
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "c-vasnprintf.h"
+
+ptrdiff_t
+c_snzprintf (char *str, size_t size, const char *format, ...)
+{
+  char *output;
+  size_t len;
+  size_t lenbuf = size;
+  va_list args;
+
+  va_start (args, format);
+  output = c_vasnprintf (str, &lenbuf, format, args);
+  len = lenbuf;
+  va_end (args);
+
+  if (!output)
+    return -1;
+
+  if (output != str)
+    {
+      if (size)
+        {
+          size_t pruned_len = (len < size ? len : size - 1);
+          memcpy (str, output, pruned_len);
+          str[pruned_len] = '\0';
+        }
+
+      free (output);
+    }
+
+  if (len > PTRDIFF_MAX)
+    {
+      errno = ENOMEM;
+      return -1;
+    }
+
+  return len;
+}
index bcd40bd5e012a7ae6bb4e49dcac80a7cbb3c6640..048ecf0f629d360a45de994ae86179346d26b864 100644 (file)
@@ -47,9 +47,9 @@ extern "C" {
 
    Formatting takes place in the C locale, that is, the decimal point
    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));
-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));
 
 /* Prints formatted output to a string dynamically allocated with malloc().
diff --git a/lib/c-vaszprintf.c b/lib/c-vaszprintf.c
new file mode 100644 (file)
index 0000000..a5ef686
--- /dev/null
@@ -0,0 +1,46 @@
+/* Formatted output to strings in C locale.
+   Copyright (C) 1999-2024 Free Software Foundation, Inc.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   This file 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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "c-vasprintf.h"
+
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#include "c-vasnprintf.h"
+
+ptrdiff_t
+c_vaszprintf (char **resultp, const char *format, va_list args)
+{
+  size_t length;
+  char *result = c_vasnprintf (NULL, &length, format, args);
+  if (result == NULL)
+    return -1;
+
+  if (length > PTRDIFF_MAX)
+    {
+      free (result);
+      errno = ENOMEM;
+      return -1;
+    }
+
+  *resultp = result;
+  /* Return the number of resulting bytes, excluding the trailing NUL.  */
+  return length;
+}
diff --git a/lib/c-vazsprintf.c b/lib/c-vazsprintf.c
deleted file mode 100644 (file)
index 88ab938..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Formatted output to strings in C locale.
-   Copyright (C) 1999-2024 Free Software Foundation, Inc.
-
-   This file is free software: you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   This file 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 Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include "c-vasprintf.h"
-
-#include <errno.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-#include "c-vasnprintf.h"
-
-ptrdiff_t
-c_vazsprintf (char **resultp, const char *format, va_list args)
-{
-  size_t length;
-  char *result = c_vasnprintf (NULL, &length, format, args);
-  if (result == NULL)
-    return -1;
-
-  if (length > PTRDIFF_MAX)
-    {
-      free (result);
-      errno = ENOMEM;
-      return -1;
-    }
-
-  *resultp = result;
-  /* Return the number of resulting bytes, excluding the trailing NUL.  */
-  return length;
-}
index 941c2d4609d4f61e271af8df798f6704e36ec31b..aee05c2be2a923d70058e5f4bb4d772dd7b1f7cf 100644 (file)
@@ -29,7 +29,7 @@
 int
 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 (ret > INT_MAX)
index ff9cc2250c4b2ab8b9baa690468fdb1dd840c46c..26151183350821daf040ad031bddd5b887132775 100644 (file)
@@ -47,7 +47,7 @@ extern "C" {
 
    Formatting takes place in the C locale, that is, the decimal point
    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)
        _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0));
 
diff --git a/lib/c-vsnzprintf.c b/lib/c-vsnzprintf.c
new file mode 100644 (file)
index 0000000..28f7e4f
--- /dev/null
@@ -0,0 +1,66 @@
+/* Formatted output to strings in C locale.
+   Copyright (C) 2004, 2006-2024 Free Software Foundation, Inc.
+   Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
+   Modified for C locale by Ben Pfaff.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   This file 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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification.  */
+#include "c-vsnprintf.h"
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "c-vasnprintf.h"
+
+ptrdiff_t
+c_vsnzprintf (char *str, size_t size, const char *format, va_list args)
+{
+  char *output;
+  size_t len;
+  size_t lenbuf = size;
+
+  output = c_vasnprintf (str, &lenbuf, format, args);
+  len = lenbuf;
+
+  if (!output)
+    return -1;
+
+  if (output != str)
+    {
+      if (size)
+        {
+          size_t pruned_len = (len < size ? len : size - 1);
+          memcpy (str, output, pruned_len);
+          str[pruned_len] = '\0';
+        }
+
+      free (output);
+    }
+
+  if (len > PTRDIFF_MAX)
+    {
+      errno = ENOMEM;
+      return -1;
+    }
+
+  return len;
+}
diff --git a/lib/c-vzsnprintf.c b/lib/c-vzsnprintf.c
deleted file mode 100644 (file)
index 948266d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Formatted output to strings in C locale.
-   Copyright (C) 2004, 2006-2024 Free Software Foundation, Inc.
-   Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
-   Modified for C locale by Ben Pfaff.
-
-   This file is free software: you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   This file 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 Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification.  */
-#include "c-vsnprintf.h"
-
-#include <errno.h>
-#include <stdarg.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "c-vasnprintf.h"
-
-ptrdiff_t
-c_vzsnprintf (char *str, size_t size, const char *format, va_list args)
-{
-  char *output;
-  size_t len;
-  size_t lenbuf = size;
-
-  output = c_vasnprintf (str, &lenbuf, format, args);
-  len = lenbuf;
-
-  if (!output)
-    return -1;
-
-  if (output != str)
-    {
-      if (size)
-        {
-          size_t pruned_len = (len < size ? len : size - 1);
-          memcpy (str, output, pruned_len);
-          str[pruned_len] = '\0';
-        }
-
-      free (output);
-    }
-
-  if (len > PTRDIFF_MAX)
-    {
-      errno = ENOMEM;
-      return -1;
-    }
-
-  return len;
-}
index b058bde4c542d0465a3e35572ddd358b0b09120f..f4c77d4a00571cf6f7634ea1c781cc9a0fe5ef1e 100644 (file)
@@ -32,7 +32,7 @@ c_xvasprintf (const char *format, va_list args)
 {
   char *result;
 
-  if (c_vazsprintf (&result, format, args) < 0)
+  if (c_vaszprintf (&result, format, args) < 0)
     {
       if (errno == ENOMEM)
         xalloc_die ();
diff --git a/lib/c-zsnprintf.c b/lib/c-zsnprintf.c
deleted file mode 100644 (file)
index 85ed3f9..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Formatted output to strings in C locale.
-   Copyright (C) 2004, 2006-2024 Free Software Foundation, Inc.
-   Written by Simon Josefsson and Paul Eggert.
-
-   This file is free software: you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   This file 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 Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include "c-snprintf.h"
-
-#include <errno.h>
-#include <stdarg.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "c-vasnprintf.h"
-
-ptrdiff_t
-c_zsnprintf (char *str, size_t size, const char *format, ...)
-{
-  char *output;
-  size_t len;
-  size_t lenbuf = size;
-  va_list args;
-
-  va_start (args, format);
-  output = c_vasnprintf (str, &lenbuf, format, args);
-  len = lenbuf;
-  va_end (args);
-
-  if (!output)
-    return -1;
-
-  if (output != str)
-    {
-      if (size)
-        {
-          size_t pruned_len = (len < size ? len : size - 1);
-          memcpy (str, output, pruned_len);
-          str[pruned_len] = '\0';
-        }
-
-      free (output);
-    }
-
-  if (len > PTRDIFF_MAX)
-    {
-      errno = ENOMEM;
-      return -1;
-    }
-
-  return len;
-}
index 80f69225ac97922bdcf0866471a73b82d7b77dfc..b82f782a9d39ceea8e54e446e6f894cc02116bdb 100644 (file)
@@ -31,7 +31,7 @@ snprintf (char *str, size_t size, const char *format, ...)
   ptrdiff_t ret;
 
   va_start (args, format);
-  ret = vzsnprintf (str, size, format, args);
+  ret = vsnzprintf (str, size, format, args);
   va_end (args);
 
 #if PTRDIFF_MAX > INT_MAX
diff --git a/lib/snzprintf.c b/lib/snzprintf.c
new file mode 100644 (file)
index 0000000..b786914
--- /dev/null
@@ -0,0 +1,66 @@
+/* Formatted output to strings.
+   Copyright (C) 2004, 2006-2024 Free Software Foundation, Inc.
+   Written by Simon Josefsson and Paul Eggert.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   This file 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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdio.h>
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "vasnprintf.h"
+
+ptrdiff_t
+snzprintf (char *str, size_t size, const char *format, ...)
+{
+  char *output;
+  size_t len;
+  size_t lenbuf = size;
+  va_list args;
+
+  va_start (args, format);
+  output = vasnprintf (str, &lenbuf, format, args);
+  len = lenbuf;
+  va_end (args);
+
+  if (!output)
+    return -1;
+
+  if (output != str)
+    {
+      if (size)
+        {
+          size_t pruned_len = (len < size ? len : size - 1);
+          memcpy (str, output, pruned_len);
+          str[pruned_len] = '\0';
+        }
+
+      free (output);
+    }
+
+  if (len > PTRDIFF_MAX)
+    {
+      errno = ENOMEM;
+      return -1;
+    }
+
+  return len;
+}
index d781b8c7b5114ba5dbe07d3649742bd9f3e1ae7b..fb861b87e6b39231f23502b3322ed2f59f1ce6f5 100644 (file)
@@ -33,7 +33,7 @@ sprintf (char *str, const char *format, ...)
   ptrdiff_t ret;
 
   va_start (args, format);
-  ret = vzsprintf (str, format, args);
+  ret = vszprintf (str, format, args);
   va_end (args);
 
 #if PTRDIFF_MAX > INT_MAX
index cf2d8c999bcada55766a35d28c511af19f6dc128..bcae688b785e51e27653c9a1b9f50165b078b8b5 100644 (file)
@@ -1459,7 +1459,7 @@ _GL_CXXALIASWARN (scanf);
 # endif
 #endif
 
-#if @GNULIB_ZSNPRINTF@
+#if @GNULIB_SNZPRINTF@
 /* Prints formatted output to string STR.  Similar to sprintf, but the
    additional parameter SIZE limits how much is written into STR.
    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.
    Therefore, if the format string is valid and does not use %ls/%lc
    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,
                    const char *restrict format, ...)
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
                   _GL_ARG_NONNULL ((3)));
-_GL_CXXALIAS_SYS (zsnprintf, ptrdiff_t,
+_GL_CXXALIAS_SYS (snzprintf, ptrdiff_t,
                   (char *restrict str, size_t size,
                    const char *restrict format, ...));
 #endif
@@ -1520,19 +1520,19 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
 # endif
 #endif
 
-#if @GNULIB_ZSPRINTF@
+#if @GNULIB_SZPRINTF@
 /* Prints formatted output to string STR.
    Returns the string length of the formatted string.  Upon failure,
    returns -1 with errno set.
    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
    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,
                    const char *restrict format, ...)
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_SYS (zsprintf, ptrdiff_t,
+_GL_CXXALIAS_SYS (szprintf, ptrdiff_t,
                   (char *restrict str,
                    const char *restrict format, ...));
 #endif
@@ -1629,7 +1629,7 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
 # endif
 #endif
 
-#if @GNULIB_VAZSPRINTF@
+#if @GNULIB_VASZPRINTF@
 /* Prints formatted output to a string dynamically allocated with malloc().
    If the memory allocation succeeds, it stores the address of the string in
    *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.
    Therefore, if the format string is valid and does not use %ls/%lc
    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, ...)
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_SYS (azsprintf, ptrdiff_t,
+_GL_CXXALIAS_SYS (aszprintf, ptrdiff_t,
                   (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)
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _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));
 #endif
 
@@ -1862,7 +1862,7 @@ _GL_CXXALIASWARN (vscanf);
 # endif
 #endif
 
-#if @GNULIB_VZSNPRINTF@
+#if @GNULIB_VSNZPRINTF@
 /* Prints formatted output to string STR.  Similar to sprintf, but the
    additional parameter SIZE limits how much is written into STR.
    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.
    Therefore, if the format string is valid and does not use %ls/%lc
    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,
                    const char *restrict format, va_list args)
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
                   _GL_ARG_NONNULL ((3)));
-_GL_CXXALIAS_SYS (vzsnprintf, ptrdiff_t,
+_GL_CXXALIAS_SYS (vsnzprintf, ptrdiff_t,
                   (char *restrict str, size_t size,
                    const char *restrict format, va_list args));
 #endif
@@ -1923,19 +1923,19 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
 # endif
 #endif
 
-#if @GNULIB_VZSPRINTF@
+#if @GNULIB_VSZPRINTF@
 /* Prints formatted output to string STR.
    Returns the string length of the formatted string.  Upon failure,
    returns -1 with errno set.
    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
    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,
                    const char *restrict format, va_list args)
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_SYS (vzsprintf, ptrdiff_t,
+_GL_CXXALIAS_SYS (vszprintf, ptrdiff_t,
                   (char *restrict str,
                    const char *restrict format, va_list args));
 #endif
diff --git a/lib/szprintf.c b/lib/szprintf.c
new file mode 100644 (file)
index 0000000..c5f07de
--- /dev/null
@@ -0,0 +1,67 @@
+/* Formatted output to strings.
+   Copyright (C) 2004, 2006-2024 Free Software Foundation, Inc.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation, either version 3 of the
+   License, or (at your option) any later version.
+
+   This file 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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification.  */
+#include <stdio.h>
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#include "vasnprintf.h"
+
+ptrdiff_t
+szprintf (char *str, const char *format, ...)
+{
+  char *output;
+  size_t len;
+  size_t lenbuf;
+  va_list args;
+
+  /* Set lenbuf = min (SIZE_MAX, - (uintptr_t) str - 1).  */
+  lenbuf = SIZE_MAX;
+  if (lenbuf >= ~ (uintptr_t) str)
+    lenbuf = ~ (uintptr_t) str;
+
+  va_start (args, format);
+  output = vasnprintf (str, &lenbuf, format, args);
+  len = lenbuf;
+  va_end (args);
+
+  if (!output)
+    return -1;
+
+  if (output != str)
+    {
+      /* len is near SIZE_MAX.  */
+      free (output);
+      errno = ENOMEM;
+      return -1;
+    }
+
+  if (len > PTRDIFF_MAX)
+    {
+      errno = ENOMEM;
+      return -1;
+    }
+
+  return len;
+}
diff --git a/lib/vaszprintf.c b/lib/vaszprintf.c
new file mode 100644 (file)
index 0000000..7589fbe
--- /dev/null
@@ -0,0 +1,46 @@
+/* Formatted output to strings.
+   Copyright (C) 1999-2024 Free Software Foundation, Inc.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   This file 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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdio.h>
+
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#include "vasnprintf.h"
+
+ptrdiff_t
+vaszprintf (char **resultp, const char *format, va_list args)
+{
+  size_t length;
+  char *result = vasnprintf (NULL, &length, format, args);
+  if (result == NULL)
+    return -1;
+
+  if (length > PTRDIFF_MAX)
+    {
+      free (result);
+      errno = ENOMEM;
+      return -1;
+    }
+
+  *resultp = result;
+  /* Return the number of resulting bytes, excluding the trailing NUL.  */
+  return length;
+}
diff --git a/lib/vazsprintf.c b/lib/vazsprintf.c
deleted file mode 100644 (file)
index 73002a1..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Formatted output to strings.
-   Copyright (C) 1999-2024 Free Software Foundation, Inc.
-
-   This file is free software: you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   This file 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 Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include <stdio.h>
-
-#include <errno.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-#include "vasnprintf.h"
-
-ptrdiff_t
-vazsprintf (char **resultp, const char *format, va_list args)
-{
-  size_t length;
-  char *result = vasnprintf (NULL, &length, format, args);
-  if (result == NULL)
-    return -1;
-
-  if (length > PTRDIFF_MAX)
-    {
-      free (result);
-      errno = ENOMEM;
-      return -1;
-    }
-
-  *resultp = result;
-  /* Return the number of resulting bytes, excluding the trailing NUL.  */
-  return length;
-}
index 1954dcea26e41f27532a83292dd47a6e6955fff2..cfcee78b86f3fc717e57f680a9a4ca123e4165c6 100644 (file)
@@ -29,7 +29,7 @@
 int
 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 (ret > INT_MAX)
diff --git a/lib/vsnzprintf.c b/lib/vsnzprintf.c
new file mode 100644 (file)
index 0000000..f598526
--- /dev/null
@@ -0,0 +1,65 @@
+/* Formatted output to strings.
+   Copyright (C) 2004, 2006-2024 Free Software Foundation, Inc.
+   Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   This file 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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification.  */
+#include <stdio.h>
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "vasnprintf.h"
+
+ptrdiff_t
+vsnzprintf (char *str, size_t size, const char *format, va_list args)
+{
+  char *output;
+  size_t len;
+  size_t lenbuf = size;
+
+  output = vasnprintf (str, &lenbuf, format, args);
+  len = lenbuf;
+
+  if (!output)
+    return -1;
+
+  if (output != str)
+    {
+      if (size)
+        {
+          size_t pruned_len = (len < size ? len : size - 1);
+          memcpy (str, output, pruned_len);
+          str[pruned_len] = '\0';
+        }
+
+      free (output);
+    }
+
+  if (len > PTRDIFF_MAX)
+    {
+      errno = ENOMEM;
+      return -1;
+    }
+
+  return len;
+}
index 065ed7422228b65b0b584b3293e081d63569500c..ec7c8da4f8c31a5de0d7ffbbb4985c3e2be86dd2 100644 (file)
@@ -29,7 +29,7 @@
 int
 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 (ret > INT_MAX)
diff --git a/lib/vszprintf.c b/lib/vszprintf.c
new file mode 100644 (file)
index 0000000..f980d1e
--- /dev/null
@@ -0,0 +1,64 @@
+/* Formatted output to strings.
+   Copyright (C) 2004, 2006-2024 Free Software Foundation, Inc.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation, either version 3 of the
+   License, or (at your option) any later version.
+
+   This file 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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification.  */
+#include <stdio.h>
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#include "vasnprintf.h"
+
+ptrdiff_t
+vszprintf (char *str, const char *format, va_list args)
+{
+  char *output;
+  size_t len;
+  size_t lenbuf;
+
+  /* Set lenbuf = min (SIZE_MAX, - (uintptr_t) str - 1).  */
+  lenbuf = SIZE_MAX;
+  if (lenbuf >= ~ (uintptr_t) str)
+    lenbuf = ~ (uintptr_t) str;
+
+  output = vasnprintf (str, &lenbuf, format, args);
+  len = lenbuf;
+
+  if (!output)
+    return -1;
+
+  if (output != str)
+    {
+      /* len is near SIZE_MAX.  */
+      free (output);
+      errno = ENOMEM;
+      return -1;
+    }
+
+  if (len > PTRDIFF_MAX)
+    {
+      errno = ENOMEM;
+      return -1;
+    }
+
+  return len;
+}
diff --git a/lib/vzsnprintf.c b/lib/vzsnprintf.c
deleted file mode 100644 (file)
index 96e240b..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Formatted output to strings.
-   Copyright (C) 2004, 2006-2024 Free Software Foundation, Inc.
-   Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
-
-   This file is free software: you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   This file 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 Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification.  */
-#include <stdio.h>
-
-#include <errno.h>
-#include <stdarg.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "vasnprintf.h"
-
-ptrdiff_t
-vzsnprintf (char *str, size_t size, const char *format, va_list args)
-{
-  char *output;
-  size_t len;
-  size_t lenbuf = size;
-
-  output = vasnprintf (str, &lenbuf, format, args);
-  len = lenbuf;
-
-  if (!output)
-    return -1;
-
-  if (output != str)
-    {
-      if (size)
-        {
-          size_t pruned_len = (len < size ? len : size - 1);
-          memcpy (str, output, pruned_len);
-          str[pruned_len] = '\0';
-        }
-
-      free (output);
-    }
-
-  if (len > PTRDIFF_MAX)
-    {
-      errno = ENOMEM;
-      return -1;
-    }
-
-  return len;
-}
diff --git a/lib/vzsprintf.c b/lib/vzsprintf.c
deleted file mode 100644 (file)
index 5495430..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Formatted output to strings.
-   Copyright (C) 2004, 2006-2024 Free Software Foundation, Inc.
-
-   This file is free software: you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation, either version 3 of the
-   License, or (at your option) any later version.
-
-   This file 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 Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification.  */
-#include <stdio.h>
-
-#include <errno.h>
-#include <stdarg.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-#include "vasnprintf.h"
-
-ptrdiff_t
-vzsprintf (char *str, const char *format, va_list args)
-{
-  char *output;
-  size_t len;
-  size_t lenbuf;
-
-  /* Set lenbuf = min (SIZE_MAX, - (uintptr_t) str - 1).  */
-  lenbuf = SIZE_MAX;
-  if (lenbuf >= ~ (uintptr_t) str)
-    lenbuf = ~ (uintptr_t) str;
-
-  output = vasnprintf (str, &lenbuf, format, args);
-  len = lenbuf;
-
-  if (!output)
-    return -1;
-
-  if (output != str)
-    {
-      /* len is near SIZE_MAX.  */
-      free (output);
-      errno = ENOMEM;
-      return -1;
-    }
-
-  if (len > PTRDIFF_MAX)
-    {
-      errno = ENOMEM;
-      return -1;
-    }
-
-  return len;
-}
index 97f24eb297294d327af625fe272257e7c09584bc..6aba32c09a39a00c0e2e05d006f6dda486302521 100644 (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)
         xalloc_die ();
diff --git a/lib/zsnprintf.c b/lib/zsnprintf.c
deleted file mode 100644 (file)
index 894631d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Formatted output to strings.
-   Copyright (C) 2004, 2006-2024 Free Software Foundation, Inc.
-   Written by Simon Josefsson and Paul Eggert.
-
-   This file is free software: you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   This file 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 Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include <stdio.h>
-
-#include <errno.h>
-#include <stdarg.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "vasnprintf.h"
-
-ptrdiff_t
-zsnprintf (char *str, size_t size, const char *format, ...)
-{
-  char *output;
-  size_t len;
-  size_t lenbuf = size;
-  va_list args;
-
-  va_start (args, format);
-  output = vasnprintf (str, &lenbuf, format, args);
-  len = lenbuf;
-  va_end (args);
-
-  if (!output)
-    return -1;
-
-  if (output != str)
-    {
-      if (size)
-        {
-          size_t pruned_len = (len < size ? len : size - 1);
-          memcpy (str, output, pruned_len);
-          str[pruned_len] = '\0';
-        }
-
-      free (output);
-    }
-
-  if (len > PTRDIFF_MAX)
-    {
-      errno = ENOMEM;
-      return -1;
-    }
-
-  return len;
-}
diff --git a/lib/zsprintf.c b/lib/zsprintf.c
deleted file mode 100644 (file)
index f004ed7..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Formatted output to strings.
-   Copyright (C) 2004, 2006-2024 Free Software Foundation, Inc.
-
-   This file is free software: you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation, either version 3 of the
-   License, or (at your option) any later version.
-
-   This file 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 Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification.  */
-#include <stdio.h>
-
-#include <errno.h>
-#include <stdarg.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-#include "vasnprintf.h"
-
-ptrdiff_t
-zsprintf (char *str, const char *format, ...)
-{
-  char *output;
-  size_t len;
-  size_t lenbuf;
-  va_list args;
-
-  /* Set lenbuf = min (SIZE_MAX, - (uintptr_t) str - 1).  */
-  lenbuf = SIZE_MAX;
-  if (lenbuf >= ~ (uintptr_t) str)
-    lenbuf = ~ (uintptr_t) str;
-
-  va_start (args, format);
-  output = vasnprintf (str, &lenbuf, format, args);
-  len = lenbuf;
-  va_end (args);
-
-  if (!output)
-    return -1;
-
-  if (output != str)
-    {
-      /* len is near SIZE_MAX.  */
-      free (output);
-      errno = ENOMEM;
-      return -1;
-    }
-
-  if (len > PTRDIFF_MAX)
-    {
-      errno = ENOMEM;
-      return -1;
-    }
-
-  return len;
-}
index 10e1fbb8aa9073baa116474acfa4bfed9de4af1b..f3edc43ccdf0ef82cfa7b3599282f5aaf7238fc9 100644 (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_TMPFILE])
     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_VSCANF])
     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_VSNPRINTF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSPRINTF_POSIX])
-    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VZSNPRINTF])
-    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VZSPRINTF])
-    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ZSNPRINTF])
-    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ZSPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNZPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSZPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNZPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SZPRINTF])
     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_FDOPEN], [1])
index 49857beca7172bd8e93ffbac046b140db8875425..19a054dcbeb10d7abeafc4fae0eb0dfe87459be7 100644 (file)
@@ -8,7 +8,7 @@ lib/c-snprintf.c
 Depends-on:
 stdint
 stdio
-c-vzsnprintf
+c-vsnzprintf
 
 configure.ac:
 AC_REQUIRE([AC_C_RESTRICT])
diff --git a/modules/c-snzprintf b/modules/c-snzprintf
new file mode 100644 (file)
index 0000000..83c2cd8
--- /dev/null
@@ -0,0 +1,27 @@
+Description:
+c_snzprintf(): print formatted output to a fixed length string (without
+INT_MAX limitation) in C locale
+
+Files:
+lib/c-snprintf.h
+lib/c-snzprintf.c
+
+Depends-on:
+stdint
+stdio
+c-vasnprintf
+
+configure.ac:
+AC_REQUIRE([AC_C_RESTRICT])
+
+Makefile.am:
+lib_SOURCES += c-snzprintf.c
+
+Include:
+"c-snprintf.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/c-snzprintf-gnu b/modules/c-snzprintf-gnu
new file mode 100644 (file)
index 0000000..ff4d2c5
--- /dev/null
@@ -0,0 +1,23 @@
+Description:
+c_snzprintf() function
+with POSIX compliant and GNU compatible format string interpretation
+
+Files:
+
+Depends-on:
+c-snzprintf
+mixin/printf-gnu
+
+configure.ac:
+gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
+
+Makefile.am:
+
+Include:
+"c-snprintf.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/c-snzprintf-gnu-tests b/modules/c-snzprintf-gnu-tests
new file mode 100644 (file)
index 0000000..ce574fc
--- /dev/null
@@ -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)
diff --git a/modules/c-vaszprintf b/modules/c-vaszprintf
new file mode 100644 (file)
index 0000000..da7df0d
--- /dev/null
@@ -0,0 +1,26 @@
+Description:
+aszprintf() and vaszprintf() in C locale
+
+Files:
+lib/c-vasprintf.h
+lib/c-aszprintf.c
+lib/c-vaszprintf.c
+
+Depends-on:
+stdint
+stdio
+c-vasnprintf
+
+configure.ac:
+
+Makefile.am:
+lib_SOURCES += c-aszprintf.c c-vaszprintf.c
+
+Include:
+"c-vasprintf.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/c-vaszprintf-gnu b/modules/c-vaszprintf-gnu
new file mode 100644 (file)
index 0000000..acee07d
--- /dev/null
@@ -0,0 +1,23 @@
+Description:
+c_aszprintf() and c_vaszprintf() functions
+with POSIX compliant and GNU compatible format string interpretation
+
+Files:
+
+Depends-on:
+c-vaszprintf
+mixin/printf-gnu
+
+configure.ac:
+gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
+
+Makefile.am:
+
+Include:
+"c-vasprintf.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/c-vaszprintf-gnu-tests b/modules/c-vaszprintf-gnu-tests
new file mode 100644 (file)
index 0000000..56565cd
--- /dev/null
@@ -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)
diff --git a/modules/c-vazsprintf b/modules/c-vazsprintf
deleted file mode 100644 (file)
index 5cea385..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-Description:
-azsprintf() and vazsprintf() in C locale
-
-Files:
-lib/c-vasprintf.h
-lib/c-azsprintf.c
-lib/c-vazsprintf.c
-
-Depends-on:
-stdint
-stdio
-c-vasnprintf
-
-configure.ac:
-
-Makefile.am:
-lib_SOURCES += c-azsprintf.c c-vazsprintf.c
-
-Include:
-"c-vasprintf.h"
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/c-vazsprintf-gnu b/modules/c-vazsprintf-gnu
deleted file mode 100644 (file)
index 46690f4..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Description:
-c_azsprintf() and c_vazsprintf() functions
-with POSIX compliant and GNU compatible format string interpretation
-
-Files:
-
-Depends-on:
-c-vazsprintf
-mixin/printf-gnu
-
-configure.ac:
-gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
-
-Makefile.am:
-
-Include:
-"c-vasprintf.h"
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/c-vazsprintf-gnu-tests b/modules/c-vazsprintf-gnu-tests
deleted file mode 100644 (file)
index a7c5762..0000000
+++ /dev/null
@@ -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)
index 835968f96a05626c0f65a3a1ea68ed6c0c1d2ac3..9ba2b3657a7b600d8325475060227e230edf0e0e 100644 (file)
@@ -9,7 +9,7 @@ lib/c-vsnprintf.c
 Depends-on:
 stdint
 stdio
-c-vzsnprintf
+c-vsnzprintf
 
 configure.ac:
 AC_REQUIRE([AC_C_RESTRICT])
diff --git a/modules/c-vsnzprintf b/modules/c-vsnzprintf
new file mode 100644 (file)
index 0000000..9d56f9c
--- /dev/null
@@ -0,0 +1,27 @@
+Description:
+c_vsnzprintf(): print formatted output from an stdarg argument list to a
+fixed length string (without INT_MAX limitation) in C locale
+
+Files:
+lib/c-vsnprintf.h
+lib/c-vsnzprintf.c
+
+Depends-on:
+stdint
+stdio
+c-vasnprintf
+
+configure.ac:
+AC_REQUIRE([AC_C_RESTRICT])
+
+Makefile.am:
+lib_SOURCES += c-vsnzprintf.c
+
+Include:
+"c-vsnprintf.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/c-vsnzprintf-gnu b/modules/c-vsnzprintf-gnu
new file mode 100644 (file)
index 0000000..0bebe83
--- /dev/null
@@ -0,0 +1,23 @@
+Description:
+c_vsnzprintf() function
+with POSIX compliant and GNU compatible format string interpretation
+
+Files:
+
+Depends-on:
+c-vsnzprintf
+mixin/printf-gnu
+
+configure.ac:
+gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
+
+Makefile.am:
+
+Include:
+"c-vsnprintf.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/c-vsnzprintf-gnu-tests b/modules/c-vsnzprintf-gnu-tests
new file mode 100644 (file)
index 0000000..c731225
--- /dev/null
@@ -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)
diff --git a/modules/c-vzsnprintf b/modules/c-vzsnprintf
deleted file mode 100644 (file)
index 4049974..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Description:
-c_vzsnprintf(): print formatted output from an stdarg argument list to a
-fixed length string (without INT_MAX limitation) in C locale
-
-Files:
-lib/c-vsnprintf.h
-lib/c-vzsnprintf.c
-
-Depends-on:
-stdint
-stdio
-c-vasnprintf
-
-configure.ac:
-AC_REQUIRE([AC_C_RESTRICT])
-
-Makefile.am:
-lib_SOURCES += c-vzsnprintf.c
-
-Include:
-"c-vsnprintf.h"
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/c-vzsnprintf-gnu b/modules/c-vzsnprintf-gnu
deleted file mode 100644 (file)
index 9a02c1d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Description:
-c_vzsnprintf() function
-with POSIX compliant and GNU compatible format string interpretation
-
-Files:
-
-Depends-on:
-c-vzsnprintf
-mixin/printf-gnu
-
-configure.ac:
-gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
-
-Makefile.am:
-
-Include:
-"c-vsnprintf.h"
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/c-vzsnprintf-gnu-tests b/modules/c-vzsnprintf-gnu-tests
deleted file mode 100644 (file)
index 044c5f2..0000000
+++ /dev/null
@@ -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)
index ccbc93d794b6b5dbbea1a6da264fa5affa871a57..a46e418544f1302e4defa006eeadb2f82345c737 100644 (file)
@@ -10,7 +10,7 @@ m4/strerrorname_np.m4
 Depends-on:
 extensions
 stdio
-c-vazsprintf
+c-vaszprintf
 xalloc-die
 
 configure.ac:
diff --git a/modules/c-zsnprintf b/modules/c-zsnprintf
deleted file mode 100644 (file)
index 5410db0..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Description:
-c_zsnprintf(): print formatted output to a fixed length string (without
-INT_MAX limitation) in C locale
-
-Files:
-lib/c-snprintf.h
-lib/c-zsnprintf.c
-
-Depends-on:
-stdint
-stdio
-c-vasnprintf
-
-configure.ac:
-AC_REQUIRE([AC_C_RESTRICT])
-
-Makefile.am:
-lib_SOURCES += c-zsnprintf.c
-
-Include:
-"c-snprintf.h"
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/c-zsnprintf-gnu b/modules/c-zsnprintf-gnu
deleted file mode 100644 (file)
index 1955098..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Description:
-c_zsnprintf() function
-with POSIX compliant and GNU compatible format string interpretation
-
-Files:
-
-Depends-on:
-c-zsnprintf
-mixin/printf-gnu
-
-configure.ac:
-gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
-
-Makefile.am:
-
-Include:
-"c-snprintf.h"
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/c-zsnprintf-gnu-tests b/modules/c-zsnprintf-gnu-tests
deleted file mode 100644 (file)
index 6ae7df3..0000000
+++ /dev/null
@@ -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)
index cd4eb6b2c4910ae63f983451f3c12814a6df231f..b44fc9a6eaf52254d1eed8314a4f9f02651f051b 100644 (file)
@@ -10,7 +10,7 @@ Depends-on:
 stdio
 errno           [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:
 gl_FUNC_SNPRINTF
diff --git a/modules/snzprintf b/modules/snzprintf
new file mode 100644 (file)
index 0000000..9d81fc4
--- /dev/null
@@ -0,0 +1,27 @@
+Description:
+snzprintf() function: print formatted output to a fixed length string
+(without INT_MAX limitation)
+
+Files:
+lib/snzprintf.c
+
+Depends-on:
+stdio
+vasnprintf
+errno
+stdint
+
+configure.ac:
+gl_STDIO_MODULE_INDICATOR([snzprintf])
+
+Makefile.am:
+lib_SOURCES += snzprintf.c
+
+Include:
+<stdio.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/snzprintf-gnu b/modules/snzprintf-gnu
new file mode 100644 (file)
index 0000000..d2aa9e5
--- /dev/null
@@ -0,0 +1,23 @@
+Description:
+snzprintf() function
+with POSIX compliant and GNU compatible format string interpretation
+
+Files:
+
+Depends-on:
+snzprintf-posix
+mixin/printf-gnu
+
+configure.ac:
+gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
+
+Makefile.am:
+
+Include:
+<stdio.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/snzprintf-gnu-tests b/modules/snzprintf-gnu-tests
new file mode 100644 (file)
index 0000000..662795c
--- /dev/null
@@ -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
diff --git a/modules/snzprintf-posix b/modules/snzprintf-posix
new file mode 100644 (file)
index 0000000..c181159
--- /dev/null
@@ -0,0 +1,22 @@
+Description:
+snzprintf() function with POSIX compliant format string interpretation
+
+Files:
+
+Depends-on:
+snzprintf
+mixin/printf-posix
+
+configure.ac:
+gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
+
+Makefile.am:
+
+Include:
+<stdio.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/snzprintf-posix-tests b/modules/snzprintf-posix-tests
new file mode 100644 (file)
index 0000000..bafb886
--- /dev/null
@@ -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
index 2c47424bec47df9e959c3a30d972f91a5a9716fd..682043847fae6250aa25da9e71ddc1b7f7694e98 100644 (file)
@@ -18,7 +18,7 @@ stdio
 nocrash
 printf-safe
 multiarch
-vzsprintf          [test $REPLACE_SPRINTF = 1]
+vszprintf          [test $REPLACE_SPRINTF = 1]
 mixin/printf-posix [test $REPLACE_SPRINTF = 1]
 stdint             [test $REPLACE_SPRINTF = 1]
 errno              [test $REPLACE_SPRINTF = 1]
index 64fdc5fb60476b68793292d8a059605d02438124..319309828f08f184e47ee50c6b25acb8099ee0bb 100644 (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_TMPFILE''@/$(GNULIB_TMPFILE)/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_VFPRINTF''@/$(GNULIB_VFPRINTF)/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_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
              -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_VZSNPRINTF''@/$(GNULIB_VZSNPRINTF)/g' \
-             -e 's/@''GNULIB_VZSPRINTF''@/$(GNULIB_VZSPRINTF)/g' \
-             -e 's/@''GNULIB_ZSNPRINTF''@/$(GNULIB_ZSNPRINTF)/g' \
-             -e 's/@''GNULIB_ZSPRINTF''@/$(GNULIB_ZSPRINTF)/g' \
+             -e 's/@''GNULIB_VSNZPRINTF''@/$(GNULIB_VSNZPRINTF)/g' \
+             -e 's/@''GNULIB_VSZPRINTF''@/$(GNULIB_VSZPRINTF)/g' \
+             -e 's/@''GNULIB_SNZPRINTF''@/$(GNULIB_SNZPRINTF)/g' \
+             -e 's/@''GNULIB_SZPRINTF''@/$(GNULIB_SZPRINTF)/g' \
              -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GNULIB_MDA_FCLOSEALL)/g' \
              -e 's/@''GNULIB_MDA_FDOPEN''@/$(GNULIB_MDA_FDOPEN)/g' \
              -e 's/@''GNULIB_MDA_FILENO''@/$(GNULIB_MDA_FILENO)/g' \
diff --git a/modules/szprintf b/modules/szprintf
new file mode 100644 (file)
index 0000000..1e647c2
--- /dev/null
@@ -0,0 +1,27 @@
+Description:
+szprintf() function: print formatted output to a string (without INT_MAX
+limitation)
+
+Files:
+lib/szprintf.c
+
+Depends-on:
+stdio
+vasnprintf
+errno
+stdint
+
+configure.ac:
+gl_STDIO_MODULE_INDICATOR([szprintf])
+
+Makefile.am:
+lib_SOURCES += szprintf.c
+
+Include:
+<stdio.h>
+
+License:
+LGPL
+
+Maintainer:
+all
diff --git a/modules/szprintf-gnu b/modules/szprintf-gnu
new file mode 100644 (file)
index 0000000..4fcb993
--- /dev/null
@@ -0,0 +1,23 @@
+Description:
+szprintf() function
+with POSIX compliant and GNU compatible format string interpretation
+
+Files:
+
+Depends-on:
+szprintf-posix
+mixin/printf-gnu
+
+configure.ac:
+gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
+
+Makefile.am:
+
+Include:
+<stdio.h>
+
+License:
+LGPL
+
+Maintainer:
+all
diff --git a/modules/szprintf-gnu-tests b/modules/szprintf-gnu-tests
new file mode 100644 (file)
index 0000000..3910afb
--- /dev/null
@@ -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
diff --git a/modules/szprintf-posix b/modules/szprintf-posix
new file mode 100644 (file)
index 0000000..6775762
--- /dev/null
@@ -0,0 +1,22 @@
+Description:
+szprintf() function with POSIX compliant format string interpretation
+
+Files:
+
+Depends-on:
+szprintf
+mixin/printf-posix
+
+configure.ac:
+gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
+
+Makefile.am:
+
+Include:
+<stdio.h>
+
+License:
+LGPL
+
+Maintainer:
+all
diff --git a/modules/szprintf-posix-tests b/modules/szprintf-posix-tests
new file mode 100644 (file)
index 0000000..39a9399
--- /dev/null
@@ -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
diff --git a/modules/vaszprintf b/modules/vaszprintf
new file mode 100644 (file)
index 0000000..a732581
--- /dev/null
@@ -0,0 +1,30 @@
+Description:
+vsprintf (without INT_MAX limitation) with automatic memory allocation
+
+Files:
+lib/vaszprintf.c
+lib/aszprintf.c
+
+Depends-on:
+stdio
+vasnprintf
+errno
+stdint
+
+configure.ac:
+gl_STDIO_MODULE_INDICATOR([vaszprintf])
+m4_ifdef([AM_XGETTEXT_OPTION],
+  [AM_][XGETTEXT_OPTION([--flag=aszprintf:2:c-format])
+   AM_][XGETTEXT_OPTION([--flag=vaszprintf:2:c-format])])
+
+Makefile.am:
+lib_SOURCES += vaszprintf.c aszprintf.c
+
+Include:
+<stdio.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/vaszprintf-gnu b/modules/vaszprintf-gnu
new file mode 100644 (file)
index 0000000..c4cbf7c
--- /dev/null
@@ -0,0 +1,23 @@
+Description:
+aszprintf() and vaszprintf() functions
+with POSIX compliant and GNU compatible format string interpretation
+
+Files:
+
+Depends-on:
+vaszprintf-posix
+mixin/printf-gnu
+
+configure.ac:
+gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
+
+Makefile.am:
+
+Include:
+<stdio.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/vaszprintf-gnu-tests b/modules/vaszprintf-gnu-tests
new file mode 100644 (file)
index 0000000..3076d19
--- /dev/null
@@ -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
diff --git a/modules/vaszprintf-posix b/modules/vaszprintf-posix
new file mode 100644 (file)
index 0000000..add22fc
--- /dev/null
@@ -0,0 +1,23 @@
+Description:
+aszprintf() and vaszprintf() functions
+with POSIX compliant format string interpretation
+
+Files:
+
+Depends-on:
+vaszprintf
+mixin/printf-posix
+
+configure.ac:
+gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
+
+Makefile.am:
+
+Include:
+<stdio.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/vaszprintf-posix-tests b/modules/vaszprintf-posix-tests
new file mode 100644 (file)
index 0000000..da83ebc
--- /dev/null
@@ -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
diff --git a/modules/vazsprintf b/modules/vazsprintf
deleted file mode 100644 (file)
index 787825a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-Description:
-vsprintf (without INT_MAX limitation) with automatic memory allocation
-
-Files:
-lib/vazsprintf.c
-lib/azsprintf.c
-
-Depends-on:
-stdio
-vasnprintf
-errno
-stdint
-
-configure.ac:
-gl_STDIO_MODULE_INDICATOR([vazsprintf])
-m4_ifdef([AM_XGETTEXT_OPTION],
-  [AM_][XGETTEXT_OPTION([--flag=azsprintf:2:c-format])
-   AM_][XGETTEXT_OPTION([--flag=vazsprintf:2:c-format])])
-
-Makefile.am:
-lib_SOURCES += vazsprintf.c azsprintf.c
-
-Include:
-<stdio.h>
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/vazsprintf-gnu b/modules/vazsprintf-gnu
deleted file mode 100644 (file)
index ce3c0e1..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Description:
-azsprintf() and vazsprintf() functions
-with POSIX compliant and GNU compatible format string interpretation
-
-Files:
-
-Depends-on:
-vazsprintf-posix
-mixin/printf-gnu
-
-configure.ac:
-gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
-
-Makefile.am:
-
-Include:
-<stdio.h>
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/vazsprintf-gnu-tests b/modules/vazsprintf-gnu-tests
deleted file mode 100644 (file)
index 80de638..0000000
+++ /dev/null
@@ -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
diff --git a/modules/vazsprintf-posix b/modules/vazsprintf-posix
deleted file mode 100644 (file)
index 39a1da3..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Description:
-azsprintf() and vazsprintf() functions
-with POSIX compliant format string interpretation
-
-Files:
-
-Depends-on:
-vazsprintf
-mixin/printf-posix
-
-configure.ac:
-gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
-
-Makefile.am:
-
-Include:
-<stdio.h>
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/vazsprintf-posix-tests b/modules/vazsprintf-posix-tests
deleted file mode 100644 (file)
index 04c84e7..0000000
+++ /dev/null
@@ -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
index de2a86e28589407585b38b14a4fdaf2c26d73807..2c77dd4d610ad9a1f044ce05ec1ef05917efb894 100644 (file)
@@ -11,7 +11,7 @@ Depends-on:
 stdio
 errno           [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:
 gl_FUNC_VSNPRINTF
diff --git a/modules/vsnzprintf b/modules/vsnzprintf
new file mode 100644 (file)
index 0000000..e6b060d
--- /dev/null
@@ -0,0 +1,27 @@
+Description:
+vsnzprintf() function: print formatted output from an stdarg argument list
+to a fixed length string (without INT_MAX limitation)
+
+Files:
+lib/vsnzprintf.c
+
+Depends-on:
+stdio
+vasnprintf
+errno
+stdint
+
+configure.ac:
+gl_STDIO_MODULE_INDICATOR([vsnzprintf])
+
+Makefile.am:
+lib_SOURCES += vsnzprintf.c
+
+Include:
+<stdio.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/vsnzprintf-gnu b/modules/vsnzprintf-gnu
new file mode 100644 (file)
index 0000000..54c8b7f
--- /dev/null
@@ -0,0 +1,23 @@
+Description:
+vsnzprintf() function
+with POSIX compliant and GNU compatible format string interpretation
+
+Files:
+
+Depends-on:
+vsnzprintf-posix
+mixin/printf-gnu
+
+configure.ac:
+gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
+
+Makefile.am:
+
+Include:
+<stdio.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/vsnzprintf-gnu-tests b/modules/vsnzprintf-gnu-tests
new file mode 100644 (file)
index 0000000..299ce4f
--- /dev/null
@@ -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
diff --git a/modules/vsnzprintf-posix b/modules/vsnzprintf-posix
new file mode 100644 (file)
index 0000000..dac079c
--- /dev/null
@@ -0,0 +1,22 @@
+Description:
+vsnzprintf() function with POSIX compliant format string interpretation
+
+Files:
+
+Depends-on:
+vsnzprintf
+mixin/printf-posix
+
+configure.ac:
+gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
+
+Makefile.am:
+
+Include:
+<stdio.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/vsnzprintf-posix-tests b/modules/vsnzprintf-posix-tests
new file mode 100644 (file)
index 0000000..3d4e214
--- /dev/null
@@ -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
index 91b634921ab6de1c0bd5da4fbe6c204c817d863f..d1df5a39b98da4bd80c62d3ca069fc3aaa3cbed9 100644 (file)
@@ -18,7 +18,7 @@ stdio
 nocrash
 printf-safe
 multiarch
-vzsprintf          [test $REPLACE_VSPRINTF = 1]
+vszprintf          [test $REPLACE_VSPRINTF = 1]
 mixin/printf-posix [test $REPLACE_VSPRINTF = 1]
 stdint             [test $REPLACE_VSPRINTF = 1]
 errno              [test $REPLACE_VSPRINTF = 1]
diff --git a/modules/vszprintf b/modules/vszprintf
new file mode 100644 (file)
index 0000000..1e74637
--- /dev/null
@@ -0,0 +1,27 @@
+Description:
+vszprintf() function: print formatted output from an stdarg argument list
+to a string (without INT_MAX limitation)
+
+Files:
+lib/vszprintf.c
+
+Depends-on:
+stdio
+vasnprintf
+errno
+stdint
+
+configure.ac:
+gl_STDIO_MODULE_INDICATOR([vszprintf])
+
+Makefile.am:
+lib_SOURCES += vszprintf.c
+
+Include:
+<stdio.h>
+
+License:
+LGPL
+
+Maintainer:
+all
diff --git a/modules/vszprintf-gnu b/modules/vszprintf-gnu
new file mode 100644 (file)
index 0000000..a93d90c
--- /dev/null
@@ -0,0 +1,23 @@
+Description:
+vszprintf() function
+with POSIX compliant and GNU compatible format string interpretation
+
+Files:
+
+Depends-on:
+vszprintf-posix
+mixin/printf-gnu
+
+configure.ac:
+gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
+
+Makefile.am:
+
+Include:
+<stdio.h>
+
+License:
+LGPL
+
+Maintainer:
+all
diff --git a/modules/vszprintf-gnu-tests b/modules/vszprintf-gnu-tests
new file mode 100644 (file)
index 0000000..5a843aa
--- /dev/null
@@ -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
diff --git a/modules/vszprintf-posix b/modules/vszprintf-posix
new file mode 100644 (file)
index 0000000..5733560
--- /dev/null
@@ -0,0 +1,22 @@
+Description:
+vszprintf() function with POSIX compliant format string interpretation
+
+Files:
+
+Depends-on:
+vszprintf
+mixin/printf-posix
+
+configure.ac:
+gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
+
+Makefile.am:
+
+Include:
+<stdio.h>
+
+License:
+LGPL
+
+Maintainer:
+all
diff --git a/modules/vszprintf-posix-tests b/modules/vszprintf-posix-tests
new file mode 100644 (file)
index 0000000..9f430dc
--- /dev/null
@@ -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
diff --git a/modules/vzsnprintf b/modules/vzsnprintf
deleted file mode 100644 (file)
index 853d882..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Description:
-vzsnprintf() function: print formatted output from an stdarg argument list
-to a fixed length string (without INT_MAX limitation)
-
-Files:
-lib/vzsnprintf.c
-
-Depends-on:
-stdio
-vasnprintf
-errno
-stdint
-
-configure.ac:
-gl_STDIO_MODULE_INDICATOR([vzsnprintf])
-
-Makefile.am:
-lib_SOURCES += vzsnprintf.c
-
-Include:
-<stdio.h>
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/vzsnprintf-gnu b/modules/vzsnprintf-gnu
deleted file mode 100644 (file)
index 04c46a3..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Description:
-vzsnprintf() function
-with POSIX compliant and GNU compatible format string interpretation
-
-Files:
-
-Depends-on:
-vzsnprintf-posix
-mixin/printf-gnu
-
-configure.ac:
-gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
-
-Makefile.am:
-
-Include:
-<stdio.h>
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/vzsnprintf-gnu-tests b/modules/vzsnprintf-gnu-tests
deleted file mode 100644 (file)
index caf3f4e..0000000
+++ /dev/null
@@ -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
diff --git a/modules/vzsnprintf-posix b/modules/vzsnprintf-posix
deleted file mode 100644 (file)
index e1d30cf..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-Description:
-vzsnprintf() function with POSIX compliant format string interpretation
-
-Files:
-
-Depends-on:
-vzsnprintf
-mixin/printf-posix
-
-configure.ac:
-gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
-
-Makefile.am:
-
-Include:
-<stdio.h>
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/vzsnprintf-posix-tests b/modules/vzsnprintf-posix-tests
deleted file mode 100644 (file)
index 58df0a2..0000000
+++ /dev/null
@@ -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
diff --git a/modules/vzsprintf b/modules/vzsprintf
deleted file mode 100644 (file)
index 6564c02..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Description:
-vzsprintf() function: print formatted output from an stdarg argument list
-to a string (without INT_MAX limitation)
-
-Files:
-lib/vzsprintf.c
-
-Depends-on:
-stdio
-vasnprintf
-errno
-stdint
-
-configure.ac:
-gl_STDIO_MODULE_INDICATOR([vzsprintf])
-
-Makefile.am:
-lib_SOURCES += vzsprintf.c
-
-Include:
-<stdio.h>
-
-License:
-LGPL
-
-Maintainer:
-all
diff --git a/modules/vzsprintf-gnu b/modules/vzsprintf-gnu
deleted file mode 100644 (file)
index 3241ea5..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Description:
-vzsprintf() function
-with POSIX compliant and GNU compatible format string interpretation
-
-Files:
-
-Depends-on:
-vzsprintf-posix
-mixin/printf-gnu
-
-configure.ac:
-gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
-
-Makefile.am:
-
-Include:
-<stdio.h>
-
-License:
-LGPL
-
-Maintainer:
-all
diff --git a/modules/vzsprintf-gnu-tests b/modules/vzsprintf-gnu-tests
deleted file mode 100644 (file)
index 38bf038..0000000
+++ /dev/null
@@ -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
diff --git a/modules/vzsprintf-posix b/modules/vzsprintf-posix
deleted file mode 100644 (file)
index fb3428a..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-Description:
-vzsprintf() function with POSIX compliant format string interpretation
-
-Files:
-
-Depends-on:
-vzsprintf
-mixin/printf-posix
-
-configure.ac:
-gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
-
-Makefile.am:
-
-Include:
-<stdio.h>
-
-License:
-LGPL
-
-Maintainer:
-all
diff --git a/modules/vzsprintf-posix-tests b/modules/vzsprintf-posix-tests
deleted file mode 100644 (file)
index ea4682d..0000000
+++ /dev/null
@@ -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
index bb537ce3eeb457ba21734de8916a1689eb4ae525..b94bd6694025af3a0ad14bd04c8385b3bdeb9d76 100644 (file)
@@ -12,7 +12,7 @@ m4/strerrorname_np.m4
 Depends-on:
 extensions
 stdio
-vazsprintf
+vaszprintf
 xalloc
 xalloc-die
 extern-inline
diff --git a/modules/zsnprintf b/modules/zsnprintf
deleted file mode 100644 (file)
index 40fd329..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Description:
-zsnprintf() function: print formatted output to a fixed length string
-(without INT_MAX limitation)
-
-Files:
-lib/zsnprintf.c
-
-Depends-on:
-stdio
-vasnprintf
-errno
-stdint
-
-configure.ac:
-gl_STDIO_MODULE_INDICATOR([zsnprintf])
-
-Makefile.am:
-lib_SOURCES += zsnprintf.c
-
-Include:
-<stdio.h>
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/zsnprintf-gnu b/modules/zsnprintf-gnu
deleted file mode 100644 (file)
index d0bd557..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Description:
-zsnprintf() function
-with POSIX compliant and GNU compatible format string interpretation
-
-Files:
-
-Depends-on:
-zsnprintf-posix
-mixin/printf-gnu
-
-configure.ac:
-gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
-
-Makefile.am:
-
-Include:
-<stdio.h>
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/zsnprintf-gnu-tests b/modules/zsnprintf-gnu-tests
deleted file mode 100644 (file)
index 6fd7c1c..0000000
+++ /dev/null
@@ -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
diff --git a/modules/zsnprintf-posix b/modules/zsnprintf-posix
deleted file mode 100644 (file)
index 6e2f2c6..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-Description:
-zsnprintf() function with POSIX compliant format string interpretation
-
-Files:
-
-Depends-on:
-zsnprintf
-mixin/printf-posix
-
-configure.ac:
-gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
-
-Makefile.am:
-
-Include:
-<stdio.h>
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/zsnprintf-posix-tests b/modules/zsnprintf-posix-tests
deleted file mode 100644 (file)
index 75f7594..0000000
+++ /dev/null
@@ -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
diff --git a/modules/zsprintf b/modules/zsprintf
deleted file mode 100644 (file)
index 7da8687..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Description:
-zsprintf() function: print formatted output to a string (without INT_MAX
-limitation)
-
-Files:
-lib/zsprintf.c
-
-Depends-on:
-stdio
-vasnprintf
-errno
-stdint
-
-configure.ac:
-gl_STDIO_MODULE_INDICATOR([zsprintf])
-
-Makefile.am:
-lib_SOURCES += zsprintf.c
-
-Include:
-<stdio.h>
-
-License:
-LGPL
-
-Maintainer:
-all
diff --git a/modules/zsprintf-gnu b/modules/zsprintf-gnu
deleted file mode 100644 (file)
index a530b34..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Description:
-zsprintf() function
-with POSIX compliant and GNU compatible format string interpretation
-
-Files:
-
-Depends-on:
-zsprintf-posix
-mixin/printf-gnu
-
-configure.ac:
-gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS
-
-Makefile.am:
-
-Include:
-<stdio.h>
-
-License:
-LGPL
-
-Maintainer:
-all
diff --git a/modules/zsprintf-gnu-tests b/modules/zsprintf-gnu-tests
deleted file mode 100644 (file)
index 7db1e58..0000000
+++ /dev/null
@@ -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
diff --git a/modules/zsprintf-posix b/modules/zsprintf-posix
deleted file mode 100644 (file)
index c3ab891..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-Description:
-zsprintf() function with POSIX compliant format string interpretation
-
-Files:
-
-Depends-on:
-zsprintf
-mixin/printf-posix
-
-configure.ac:
-gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
-
-Makefile.am:
-
-Include:
-<stdio.h>
-
-License:
-LGPL
-
-Maintainer:
-all
diff --git a/modules/zsprintf-posix-tests b/modules/zsprintf-posix-tests
deleted file mode 100644 (file)
index 8ea6819..0000000
+++ /dev/null
@@ -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
diff --git a/tests/test-c-snzprintf-gnu.c b/tests/test-c-snzprintf-gnu.c
new file mode 100644 (file)
index 0000000..0609a6f
--- /dev/null
@@ -0,0 +1,41 @@
+/* Test of POSIX and GNU compatible c_snzprintf() function.
+   Copyright (C) 2011-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
+
+#include <config.h>
+
+#include "c-snprintf.h"
+
+#include <locale.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "macros.h"
+
+#include "test-snzprintf-gnu.h"
+
+int
+main (int argc, char *argv[])
+{
+  /* configure should already have checked that the locale is supported.  */
+  if (setlocale (LC_ALL, "") == NULL)
+    return 1;
+
+  test_function (c_snzprintf);
+
+  return test_exit_status;
+}
diff --git a/tests/test-c-snzprintf-gnu.sh b/tests/test-c-snzprintf-gnu.sh
new file mode 100755 (executable)
index 0000000..66d967a
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test in an ISO-8859-1 or ISO-8859-15 locale.
+: "${LOCALE_FR=fr_FR}"
+if test $LOCALE_FR = none; then
+  if test -f /usr/bin/localedef; then
+    echo "Skipping test: no traditional french locale is installed"
+  else
+    echo "Skipping test: no traditional french locale is supported"
+  fi
+  exit 77
+fi
+
+LC_ALL=$LOCALE_FR \
+${CHECKER} ./test-c-snzprintf-gnu${EXEEXT} 1
diff --git a/tests/test-c-vaszprintf-gnu.c b/tests/test-c-vaszprintf-gnu.c
new file mode 100644 (file)
index 0000000..aa8140d
--- /dev/null
@@ -0,0 +1,66 @@
+/* Test of POSIX and GNU compatible c_vaszprintf() and c_aszprintf() functions.
+   Copyright (C) 2011-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
+
+#include <config.h>
+
+#include "c-vasprintf.h"
+
+#include <locale.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "macros.h"
+
+#include "test-vaszprintf-gnu.h"
+
+static ptrdiff_t
+my_c_aszprintf (char **result, const char *format, ...)
+{
+  va_list args;
+  ptrdiff_t ret;
+
+  va_start (args, format);
+  ret = c_vaszprintf (result, format, args);
+  va_end (args);
+  return ret;
+}
+
+static void
+test_c_vaszprintf ()
+{
+  test_function (my_c_aszprintf);
+}
+
+static void
+test_c_aszprintf ()
+{
+  test_function (c_aszprintf);
+}
+
+int
+main (int argc, char *argv[])
+{
+  /* configure should already have checked that the locale is supported.  */
+  if (setlocale (LC_ALL, "") == NULL)
+    return 1;
+
+  test_c_vaszprintf ();
+  test_c_aszprintf ();
+
+  return test_exit_status;
+}
diff --git a/tests/test-c-vaszprintf-gnu.sh b/tests/test-c-vaszprintf-gnu.sh
new file mode 100755 (executable)
index 0000000..79b2560
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test in an ISO-8859-1 or ISO-8859-15 locale.
+: "${LOCALE_FR=fr_FR}"
+if test $LOCALE_FR = none; then
+  if test -f /usr/bin/localedef; then
+    echo "Skipping test: no traditional french locale is installed"
+  else
+    echo "Skipping test: no traditional french locale is supported"
+  fi
+  exit 77
+fi
+
+LC_ALL=$LOCALE_FR \
+${CHECKER} ./test-c-vaszprintf-gnu${EXEEXT} 1
diff --git a/tests/test-c-vazsprintf-gnu.c b/tests/test-c-vazsprintf-gnu.c
deleted file mode 100644 (file)
index 0db9948..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Test of POSIX and GNU compatible c_vazsprintf() and c_azsprintf() functions.
-   Copyright (C) 2011-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
-
-#include <config.h>
-
-#include "c-vasprintf.h"
-
-#include <locale.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-vazsprintf-gnu.h"
-
-static ptrdiff_t
-my_c_azsprintf (char **result, const char *format, ...)
-{
-  va_list args;
-  ptrdiff_t ret;
-
-  va_start (args, format);
-  ret = c_vazsprintf (result, format, args);
-  va_end (args);
-  return ret;
-}
-
-static void
-test_c_vazsprintf ()
-{
-  test_function (my_c_azsprintf);
-}
-
-static void
-test_c_azsprintf ()
-{
-  test_function (c_azsprintf);
-}
-
-int
-main (int argc, char *argv[])
-{
-  /* configure should already have checked that the locale is supported.  */
-  if (setlocale (LC_ALL, "") == NULL)
-    return 1;
-
-  test_c_vazsprintf ();
-  test_c_azsprintf ();
-
-  return test_exit_status;
-}
diff --git a/tests/test-c-vazsprintf-gnu.sh b/tests/test-c-vazsprintf-gnu.sh
deleted file mode 100755 (executable)
index 1410b4e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-# Test in an ISO-8859-1 or ISO-8859-15 locale.
-: "${LOCALE_FR=fr_FR}"
-if test $LOCALE_FR = none; then
-  if test -f /usr/bin/localedef; then
-    echo "Skipping test: no traditional french locale is installed"
-  else
-    echo "Skipping test: no traditional french locale is supported"
-  fi
-  exit 77
-fi
-
-LC_ALL=$LOCALE_FR \
-${CHECKER} ./test-c-vazsprintf-gnu${EXEEXT} 1
diff --git a/tests/test-c-vsnzprintf-gnu.c b/tests/test-c-vsnzprintf-gnu.c
new file mode 100644 (file)
index 0000000..85272e3
--- /dev/null
@@ -0,0 +1,53 @@
+/* Test of POSIX and GNU compatible c_vsnzprintf() function.
+   Copyright (C) 2011-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
+
+#include <config.h>
+
+#include "c-vsnprintf.h"
+
+#include <locale.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "macros.h"
+
+#include "test-snzprintf-gnu.h"
+
+static ptrdiff_t
+my_c_snzprintf (char *str, size_t size, const char *format, ...)
+{
+  va_list args;
+  ptrdiff_t ret;
+
+  va_start (args, format);
+  ret = c_vsnzprintf (str, size, format, args);
+  va_end (args);
+  return ret;
+}
+
+int
+main (int argc, char *argv[])
+{
+  /* configure should already have checked that the locale is supported.  */
+  if (setlocale (LC_ALL, "") == NULL)
+    return 1;
+
+  test_function (my_c_snzprintf);
+
+  return test_exit_status;
+}
diff --git a/tests/test-c-vsnzprintf-gnu.sh b/tests/test-c-vsnzprintf-gnu.sh
new file mode 100755 (executable)
index 0000000..a49ea67
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test in an ISO-8859-1 or ISO-8859-15 locale.
+: "${LOCALE_FR=fr_FR}"
+if test $LOCALE_FR = none; then
+  if test -f /usr/bin/localedef; then
+    echo "Skipping test: no traditional french locale is installed"
+  else
+    echo "Skipping test: no traditional french locale is supported"
+  fi
+  exit 77
+fi
+
+LC_ALL=$LOCALE_FR \
+${CHECKER} ./test-c-vsnzprintf-gnu${EXEEXT} 1
diff --git a/tests/test-c-vzsnprintf-gnu.c b/tests/test-c-vzsnprintf-gnu.c
deleted file mode 100644 (file)
index 4facc1f..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Test of POSIX and GNU compatible c_vzsnprintf() function.
-   Copyright (C) 2011-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
-
-#include <config.h>
-
-#include "c-vsnprintf.h"
-
-#include <locale.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-zsnprintf-gnu.h"
-
-static ptrdiff_t
-my_c_zsnprintf (char *str, size_t size, const char *format, ...)
-{
-  va_list args;
-  ptrdiff_t ret;
-
-  va_start (args, format);
-  ret = c_vzsnprintf (str, size, format, args);
-  va_end (args);
-  return ret;
-}
-
-int
-main (int argc, char *argv[])
-{
-  /* configure should already have checked that the locale is supported.  */
-  if (setlocale (LC_ALL, "") == NULL)
-    return 1;
-
-  test_function (my_c_zsnprintf);
-
-  return test_exit_status;
-}
diff --git a/tests/test-c-vzsnprintf-gnu.sh b/tests/test-c-vzsnprintf-gnu.sh
deleted file mode 100755 (executable)
index 9d416a1..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-# Test in an ISO-8859-1 or ISO-8859-15 locale.
-: "${LOCALE_FR=fr_FR}"
-if test $LOCALE_FR = none; then
-  if test -f /usr/bin/localedef; then
-    echo "Skipping test: no traditional french locale is installed"
-  else
-    echo "Skipping test: no traditional french locale is supported"
-  fi
-  exit 77
-fi
-
-LC_ALL=$LOCALE_FR \
-${CHECKER} ./test-c-vzsnprintf-gnu${EXEEXT} 1
diff --git a/tests/test-c-zsnprintf-gnu.c b/tests/test-c-zsnprintf-gnu.c
deleted file mode 100644 (file)
index 016c782..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Test of POSIX and GNU compatible c_zsnprintf() function.
-   Copyright (C) 2011-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
-
-#include <config.h>
-
-#include "c-snprintf.h"
-
-#include <locale.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-zsnprintf-gnu.h"
-
-int
-main (int argc, char *argv[])
-{
-  /* configure should already have checked that the locale is supported.  */
-  if (setlocale (LC_ALL, "") == NULL)
-    return 1;
-
-  test_function (c_zsnprintf);
-
-  return test_exit_status;
-}
diff --git a/tests/test-c-zsnprintf-gnu.sh b/tests/test-c-zsnprintf-gnu.sh
deleted file mode 100755 (executable)
index 3edb34e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-# Test in an ISO-8859-1 or ISO-8859-15 locale.
-: "${LOCALE_FR=fr_FR}"
-if test $LOCALE_FR = none; then
-  if test -f /usr/bin/localedef; then
-    echo "Skipping test: no traditional french locale is installed"
-  else
-    echo "Skipping test: no traditional french locale is supported"
-  fi
-  exit 77
-fi
-
-LC_ALL=$LOCALE_FR \
-${CHECKER} ./test-c-zsnprintf-gnu${EXEEXT} 1
diff --git a/tests/test-snzprintf-gnu.c b/tests/test-snzprintf-gnu.c
new file mode 100644 (file)
index 0000000..f502eeb
--- /dev/null
@@ -0,0 +1,35 @@
+/* Test of POSIX and GNU compatible snzprintf() function.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <stddef.h>
+#include <string.h>
+
+#include "macros.h"
+
+#include "test-snzprintf-gnu.h"
+
+int
+main (int argc, char *argv[])
+{
+  test_function (snzprintf);
+  return test_exit_status;
+}
diff --git a/tests/test-snzprintf-gnu.h b/tests/test-snzprintf-gnu.h
new file mode 100644 (file)
index 0000000..eb8e503
--- /dev/null
@@ -0,0 +1,37 @@
+/* Test of POSIX and GNU compatible vsnzprintf() and snzprintf() functions.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
+
+/* This test exercises only a few POSIX compliance problems that are still
+   visible on platforms relevant in 2024.  For a much more complete test suite,
+   see test-snprintf-posix.h.  */
+
+static void
+test_function (ptrdiff_t (*my_snzprintf) (char *, size_t, const char *, ...))
+{
+  char result[5000];
+
+  /* Test the support of the 'B' conversion specifier for binary output of
+     integers.  */
+
+  { /* This test would fail on all platforms other than glibc ≥ 2.35.  */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%#B %d", 12345, 33, 44, 55);
+    ASSERT (strcmp (result, "0B11000000111001 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+}
diff --git a/tests/test-snzprintf-posix.c b/tests/test-snzprintf-posix.c
new file mode 100644 (file)
index 0000000..673f880
--- /dev/null
@@ -0,0 +1,35 @@
+/* Test of POSIX compatible snzprintf() function.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <stddef.h>
+#include <string.h>
+
+#include "macros.h"
+
+#include "test-snzprintf-posix.h"
+
+int
+main (int argc, char *argv[])
+{
+  test_function (snzprintf);
+  return test_exit_status;
+}
diff --git a/tests/test-snzprintf-posix.h b/tests/test-snzprintf-posix.h
new file mode 100644 (file)
index 0000000..46cef4f
--- /dev/null
@@ -0,0 +1,183 @@
+/* Test of POSIX compatible vsnzprintf() and snzprintf() functions.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
+
+/* This test exercises only a few POSIX compliance problems that are still
+   visible on platforms relevant in 2024.  For a much more complete test suite,
+   see test-snprintf-posix.h.  */
+
+#include "infinity.h"
+#include "nan.h"
+
+/* Test whether string[start_index..end_index-1] is a valid textual
+   representation of NaN.  */
+static int
+strisnan (const char *string, size_t start_index, size_t end_index, int uppercase)
+{
+  if (start_index < end_index)
+    {
+      if (string[start_index] == '-')
+        start_index++;
+      if (start_index + 3 <= end_index
+          && memcmp (string + start_index, uppercase ? "NAN" : "nan", 3) == 0)
+        {
+          start_index += 3;
+          if (start_index == end_index
+              || (string[start_index] == '(' && string[end_index - 1] == ')'))
+            return 1;
+        }
+    }
+  return 0;
+}
+
+static void
+test_function (ptrdiff_t (*my_snzprintf) (char *, size_t, const char *, ...))
+{
+  char result[5000];
+
+  /* Test the support of the 'a' and 'A' conversion specifier for hexadecimal
+     output of floating-point numbers.  */
+
+  { /* This test would fail on Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%a %d", 3.1416015625, 33, 44, 55);
+    ASSERT (strcmp (result, "0x1.922p+1 33") == 0
+            || strcmp (result, "0x3.244p+0 33") == 0
+            || strcmp (result, "0x6.488p-1 33") == 0
+            || strcmp (result, "0xc.91p-2 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%A %d", -3.1416015625, 33, 44, 55);
+    ASSERT (strcmp (result, "-0X1.922P+1 33") == 0
+            || strcmp (result, "-0X3.244P+0 33") == 0
+            || strcmp (result, "-0X6.488P-1 33") == 0
+            || strcmp (result, "-0XC.91P-2 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on FreeBSD 6.1, NetBSD 10.0. */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%.2a %d", 1.51, 33, 44, 55);
+    ASSERT (strcmp (result, "0x1.83p+0 33") == 0
+            || strcmp (result, "0x3.05p-1 33") == 0
+            || strcmp (result, "0x6.0ap-2 33") == 0
+            || strcmp (result, "0xc.14p-3 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on macOS 14, FreeBSD 14.0, OpenBSD 7.5, AIX 7.3,
+       Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%.0a %d", 1.51, 33, 44, 55);
+    ASSERT (strcmp (result, "0x2p+0 33") == 0
+            || strcmp (result, "0x3p-1 33") == 0
+            || strcmp (result, "0x6p-2 33") == 0
+            || strcmp (result, "0xcp-3 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  /* Test the support of the %f format directive.  */
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%f %d", Infinityd (), 33, 44, 55);
+    ASSERT (strcmp (result, "inf 33") == 0
+            || strcmp (result, "infinity 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%f %d", NaNd (), 33, 44, 55);
+    ASSERT (strlen (result) >= 3 + 3
+            && strisnan (result, 0, strlen (result) - 3, 0)
+            && strcmp (result + strlen (result) - 3, " 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%010f %d", Infinityd (), 33, 44, 55);
+    ASSERT (strcmp (result, "       inf 33") == 0
+            || strcmp (result, "  infinity 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  /* Test the support of the %e format directive.  */
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%e %d", Infinityd (), 33, 44, 55);
+    ASSERT (strcmp (result, "inf 33") == 0
+            || strcmp (result, "infinity 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%e %d", NaNd (), 33, 44, 55);
+    ASSERT (strlen (result) >= 3 + 3
+            && strisnan (result, 0, strlen (result) - 3, 0)
+            && strcmp (result + strlen (result) - 3, " 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  /* Test the support of the %g format directive.  */
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%g %d", Infinityd (), 33, 44, 55);
+    ASSERT (strcmp (result, "inf 33") == 0
+            || strcmp (result, "infinity 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%g %d", NaNd (), 33, 44, 55);
+    ASSERT (strlen (result) >= 3 + 3
+            && strisnan (result, 0, strlen (result) - 3, 0)
+            && strcmp (result + strlen (result) - 3, " 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  /* Test the support of large precision.  */
+
+  { /* This test would fail on AIX 7.1.  */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%.4000d %d", 1234567, 99);
+    size_t i;
+    for (i = 0; i < 4000 - 7; i++)
+      ASSERT (result[i] == '0');
+    ASSERT (strcmp (result + 4000 - 7, "1234567 99") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  /* Test the support of the 'b' conversion specifier for binary output of
+     integers.  */
+
+  { /* 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.  */
+    ptrdiff_t retval =
+      my_snzprintf (result, sizeof (result), "%b %d", 12345, 33, 44, 55);
+    ASSERT (strcmp (result, "11000000111001 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+}
diff --git a/tests/test-szprintf-gnu.c b/tests/test-szprintf-gnu.c
new file mode 100644 (file)
index 0000000..bdc6d1a
--- /dev/null
@@ -0,0 +1,36 @@
+/* Test of POSIX and GNU compatible szprintf() function.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <string.h>
+
+#include "macros.h"
+
+#include "test-szprintf-gnu.h"
+
+int
+main (int argc, char *argv[])
+{
+  test_function (szprintf);
+  return test_exit_status;
+}
diff --git a/tests/test-szprintf-gnu.h b/tests/test-szprintf-gnu.h
new file mode 100644 (file)
index 0000000..8f059e2
--- /dev/null
@@ -0,0 +1,37 @@
+/* Test of POSIX and GNU compatible vszprintf() and szprintf() functions.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
+
+/* This test exercises only a few POSIX compliance problems that are still
+   visible on platforms relevant in 2024.  For a much more complete test suite,
+   see test-sprintf-posix.h.  */
+
+static void
+test_function (ptrdiff_t (*my_szprintf) (char *, const char *, ...))
+{
+  char result[5000];
+
+  /* Test the support of the 'B' conversion specifier for binary output of
+     integers.  */
+
+  { /* This test would fail on all platforms other than glibc ≥ 2.35.  */
+    ptrdiff_t retval =
+      my_szprintf (result, "%#B %d", 12345, 33, 44, 55);
+    ASSERT (strcmp (result, "0B11000000111001 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+}
diff --git a/tests/test-szprintf-posix.c b/tests/test-szprintf-posix.c
new file mode 100644 (file)
index 0000000..fef51c7
--- /dev/null
@@ -0,0 +1,36 @@
+/* Test of POSIX compatible szprintf() function.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <string.h>
+
+#include "macros.h"
+
+#include "test-szprintf-posix.h"
+
+int
+main (int argc, char *argv[])
+{
+  test_function (szprintf);
+  return test_exit_status;
+}
diff --git a/tests/test-szprintf-posix.h b/tests/test-szprintf-posix.h
new file mode 100644 (file)
index 0000000..6ab9cfc
--- /dev/null
@@ -0,0 +1,183 @@
+/* Test of POSIX compatible vszprintf() and szprintf() functions.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
+
+/* This test exercises only a few POSIX compliance problems that are still
+   visible on platforms relevant in 2024.  For a much more complete test suite,
+   see test-sprintf-posix.h.  */
+
+#include "infinity.h"
+#include "nan.h"
+
+/* Test whether string[start_index..end_index-1] is a valid textual
+   representation of NaN.  */
+static int
+strisnan (const char *string, size_t start_index, size_t end_index, int uppercase)
+{
+  if (start_index < end_index)
+    {
+      if (string[start_index] == '-')
+        start_index++;
+      if (start_index + 3 <= end_index
+          && memcmp (string + start_index, uppercase ? "NAN" : "nan", 3) == 0)
+        {
+          start_index += 3;
+          if (start_index == end_index
+              || (string[start_index] == '(' && string[end_index - 1] == ')'))
+            return 1;
+        }
+    }
+  return 0;
+}
+
+static void
+test_function (ptrdiff_t (*my_szprintf) (char *, const char *, ...))
+{
+  char result[5000];
+
+  /* Test the support of the 'a' and 'A' conversion specifier for hexadecimal
+     output of floating-point numbers.  */
+
+  { /* This test would fail on Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_szprintf (result, "%a %d", 3.1416015625, 33, 44, 55);
+    ASSERT (strcmp (result, "0x1.922p+1 33") == 0
+            || strcmp (result, "0x3.244p+0 33") == 0
+            || strcmp (result, "0x6.488p-1 33") == 0
+            || strcmp (result, "0xc.91p-2 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_szprintf (result, "%A %d", -3.1416015625, 33, 44, 55);
+    ASSERT (strcmp (result, "-0X1.922P+1 33") == 0
+            || strcmp (result, "-0X3.244P+0 33") == 0
+            || strcmp (result, "-0X6.488P-1 33") == 0
+            || strcmp (result, "-0XC.91P-2 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on FreeBSD 6.1, NetBSD 10.0. */
+    ptrdiff_t retval =
+      my_szprintf (result, "%.2a %d", 1.51, 33, 44, 55);
+    ASSERT (strcmp (result, "0x1.83p+0 33") == 0
+            || strcmp (result, "0x3.05p-1 33") == 0
+            || strcmp (result, "0x6.0ap-2 33") == 0
+            || strcmp (result, "0xc.14p-3 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on macOS 14, FreeBSD 14.0, OpenBSD 7.5, AIX 7.3,
+       Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_szprintf (result, "%.0a %d", 1.51, 33, 44, 55);
+    ASSERT (strcmp (result, "0x2p+0 33") == 0
+            || strcmp (result, "0x3p-1 33") == 0
+            || strcmp (result, "0x6p-2 33") == 0
+            || strcmp (result, "0xcp-3 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  /* Test the support of the %f format directive.  */
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_szprintf (result, "%f %d", Infinityd (), 33, 44, 55);
+    ASSERT (strcmp (result, "inf 33") == 0
+            || strcmp (result, "infinity 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_szprintf (result, "%f %d", NaNd (), 33, 44, 55);
+    ASSERT (strlen (result) >= 3 + 3
+            && strisnan (result, 0, strlen (result) - 3, 0)
+            && strcmp (result + strlen (result) - 3, " 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_szprintf (result, "%010f %d", Infinityd (), 33, 44, 55);
+    ASSERT (strcmp (result, "       inf 33") == 0
+            || strcmp (result, "  infinity 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  /* Test the support of the %e format directive.  */
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_szprintf (result, "%e %d", Infinityd (), 33, 44, 55);
+    ASSERT (strcmp (result, "inf 33") == 0
+            || strcmp (result, "infinity 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_szprintf (result, "%e %d", NaNd (), 33, 44, 55);
+    ASSERT (strlen (result) >= 3 + 3
+            && strisnan (result, 0, strlen (result) - 3, 0)
+            && strcmp (result + strlen (result) - 3, " 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  /* Test the support of the %g format directive.  */
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_szprintf (result, "%g %d", Infinityd (), 33, 44, 55);
+    ASSERT (strcmp (result, "inf 33") == 0
+            || strcmp (result, "infinity 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    ptrdiff_t retval =
+      my_szprintf (result, "%g %d", NaNd (), 33, 44, 55);
+    ASSERT (strlen (result) >= 3 + 3
+            && strisnan (result, 0, strlen (result) - 3, 0)
+            && strcmp (result + strlen (result) - 3, " 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  /* Test the support of large precision.  */
+
+  { /* This test would fail on AIX 7.1.  */
+    ptrdiff_t retval =
+      my_szprintf (result, "%.4000d %d", 1234567, 99);
+    size_t i;
+    for (i = 0; i < 4000 - 7; i++)
+      ASSERT (result[i] == '0');
+    ASSERT (strcmp (result + 4000 - 7, "1234567 99") == 0);
+    ASSERT (retval == strlen (result));
+  }
+
+  /* Test the support of the 'b' conversion specifier for binary output of
+     integers.  */
+
+  { /* 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.  */
+    ptrdiff_t retval =
+      my_szprintf (result, "%b %d", 12345, 33, 44, 55);
+    ASSERT (strcmp (result, "11000000111001 33") == 0);
+    ASSERT (retval == strlen (result));
+  }
+}
diff --git a/tests/test-vaszprintf-gnu.c b/tests/test-vaszprintf-gnu.c
new file mode 100644 (file)
index 0000000..357554e
--- /dev/null
@@ -0,0 +1,66 @@
+/* Test of POSIX and GNU compatible vaszprintf() and aszprintf() functions.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
+
+/* This test exercises only a few POSIX compliance problems that are still
+   visible on platforms relevant in 2024.  For a much more complete test suite,
+   see test-vasprintf-posix.c.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+#include "test-vaszprintf-gnu.h"
+
+static ptrdiff_t
+my_aszprintf (char **result, const char *format, ...)
+{
+  va_list args;
+  ptrdiff_t ret;
+
+  va_start (args, format);
+  ret = vaszprintf (result, format, args);
+  va_end (args);
+  return ret;
+}
+
+static void
+test_vaszprintf ()
+{
+  test_function (my_aszprintf);
+}
+
+static void
+test_aszprintf ()
+{
+  test_function (aszprintf);
+}
+
+int
+main (int argc, char *argv[])
+{
+  test_vaszprintf ();
+  test_aszprintf ();
+  return test_exit_status;
+}
diff --git a/tests/test-vaszprintf-gnu.h b/tests/test-vaszprintf-gnu.h
new file mode 100644 (file)
index 0000000..498c8ef
--- /dev/null
@@ -0,0 +1,34 @@
+/* Test of POSIX and GNU compatible vaszprintf() and aszprintf() functions.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
+
+static void
+test_function (ptrdiff_t (*my_aszprintf) (char **, const char *, ...))
+{
+  /* Test the support of the 'B' conversion specifier for binary output of
+     integers.  */
+
+  { /* This test would fail on all platforms other than glibc ≥ 2.35.  */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%#B %d", 12345, 33, 44, 55);
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "0B11000000111001 33") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+}
diff --git a/tests/test-vaszprintf-posix.c b/tests/test-vaszprintf-posix.c
new file mode 100644 (file)
index 0000000..0e6af1c
--- /dev/null
@@ -0,0 +1,264 @@
+/* Test of POSIX compatible vaszprintf() and aszprintf() functions.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
+
+/* This test exercises only a few POSIX compliance problems that are still
+   visible on platforms relevant in 2024.  For a much more complete test suite,
+   see test-vasprintf-posix.c.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+#include "infinity.h"
+#include "nan.h"
+
+/* Test whether string[start_index..end_index-1] is a valid textual
+   representation of NaN.  */
+static int
+strisnan (const char *string, size_t start_index, size_t end_index, int uppercase)
+{
+  if (start_index < end_index)
+    {
+      if (string[start_index] == '-')
+        start_index++;
+      if (start_index + 3 <= end_index
+          && memcmp (string + start_index, uppercase ? "NAN" : "nan", 3) == 0)
+        {
+          start_index += 3;
+          if (start_index == end_index
+              || (string[start_index] == '(' && string[end_index - 1] == ')'))
+            return 1;
+        }
+    }
+  return 0;
+}
+
+static void
+test_function (ptrdiff_t (*my_aszprintf) (char **, const char *, ...))
+{
+  char result[5000];
+
+  /* Test the support of the 'a' and 'A' conversion specifier for hexadecimal
+     output of floating-point numbers.  */
+
+  { /* This test would fail on Solaris 11.4.  */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%a %d", 3.1416015625, 33, 44, 55);
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "0x1.922p+1 33") == 0
+            || strcmp (result, "0x3.244p+0 33") == 0
+            || strcmp (result, "0x6.488p-1 33") == 0
+            || strcmp (result, "0xc.91p-2 33") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+
+  { /* This test would fail on Solaris 11.4.  */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%A %d", -3.1416015625, 33, 44, 55);
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "-0X1.922P+1 33") == 0
+            || strcmp (result, "-0X3.244P+0 33") == 0
+            || strcmp (result, "-0X6.488P-1 33") == 0
+            || strcmp (result, "-0XC.91P-2 33") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+
+  { /* This test would fail on FreeBSD 6.1, NetBSD 10.0. */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%.2a %d", 1.51, 33, 44, 55);
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "0x1.83p+0 33") == 0
+            || strcmp (result, "0x3.05p-1 33") == 0
+            || strcmp (result, "0x6.0ap-2 33") == 0
+            || strcmp (result, "0xc.14p-3 33") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+
+  { /* This test would fail on macOS 14, FreeBSD 14.0, OpenBSD 7.5, AIX 7.3,
+       Solaris 11.4.  */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%.0a %d", 1.51, 33, 44, 55);
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "0x2p+0 33") == 0
+            || strcmp (result, "0x3p-1 33") == 0
+            || strcmp (result, "0x6p-2 33") == 0
+            || strcmp (result, "0xcp-3 33") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+
+  /* Test the support of the %f format directive.  */
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%f %d", Infinityd (), 33, 44, 55);
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "inf 33") == 0
+            || strcmp (result, "infinity 33") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%f %d", NaNd (), 33, 44, 55);
+    ASSERT (result != NULL);
+    ASSERT (strlen (result) >= 3 + 3
+            && strisnan (result, 0, strlen (result) - 3, 0)
+            && strcmp (result + strlen (result) - 3, " 33") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%010f %d", Infinityd (), 33, 44, 55);
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "       inf 33") == 0
+            || strcmp (result, "  infinity 33") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+
+  /* Test the support of the %e format directive.  */
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%e %d", Infinityd (), 33, 44, 55);
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "inf 33") == 0
+            || strcmp (result, "infinity 33") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%e %d", NaNd (), 33, 44, 55);
+    ASSERT (result != NULL);
+    ASSERT (strlen (result) >= 3 + 3
+            && strisnan (result, 0, strlen (result) - 3, 0)
+            && strcmp (result + strlen (result) - 3, " 33") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+
+  /* Test the support of the %g format directive.  */
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%g %d", Infinityd (), 33, 44, 55);
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "inf 33") == 0
+            || strcmp (result, "infinity 33") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+
+  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%g %d", NaNd (), 33, 44, 55);
+    ASSERT (result != NULL);
+    ASSERT (strlen (result) >= 3 + 3
+            && strisnan (result, 0, strlen (result) - 3, 0)
+            && strcmp (result + strlen (result) - 3, " 33") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+
+  /* Test the support of large precision.  */
+
+  { /* This test would fail on AIX 7.1.  */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%.4000d %d", 1234567, 99);
+    ASSERT (result != NULL);
+    size_t i;
+    for (i = 0; i < 4000 - 7; i++)
+      ASSERT (result[i] == '0');
+    ASSERT (strcmp (result + 4000 - 7, "1234567 99") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+
+  /* Test the support of the 'b' conversion specifier for binary output of
+     integers.  */
+
+  { /* 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.  */
+    char *result;
+    ptrdiff_t retval =
+      my_aszprintf (&result, "%b %d", 12345, 33, 44, 55);
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "11000000111001 33") == 0);
+    ASSERT (retval == strlen (result));
+    free (result);
+  }
+}
+
+static ptrdiff_t
+my_aszprintf (char **result, const char *format, ...)
+{
+  va_list args;
+  ptrdiff_t ret;
+
+  va_start (args, format);
+  ret = vaszprintf (result, format, args);
+  va_end (args);
+  return ret;
+}
+
+static void
+test_vaszprintf ()
+{
+  test_function (my_aszprintf);
+}
+
+static void
+test_aszprintf ()
+{
+  test_function (aszprintf);
+}
+
+int
+main (int argc, char *argv[])
+{
+  test_vaszprintf ();
+  test_aszprintf ();
+  return test_exit_status;
+}
diff --git a/tests/test-vazsprintf-gnu.c b/tests/test-vazsprintf-gnu.c
deleted file mode 100644 (file)
index f0c015d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Test of POSIX and GNU compatible vazsprintf() and azsprintf() functions.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
-
-/* This test exercises only a few POSIX compliance problems that are still
-   visible on platforms relevant in 2024.  For a much more complete test suite,
-   see test-vasprintf-posix.c.  */
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-vazsprintf-gnu.h"
-
-static ptrdiff_t
-my_azsprintf (char **result, const char *format, ...)
-{
-  va_list args;
-  ptrdiff_t ret;
-
-  va_start (args, format);
-  ret = vazsprintf (result, format, args);
-  va_end (args);
-  return ret;
-}
-
-static void
-test_vazsprintf ()
-{
-  test_function (my_azsprintf);
-}
-
-static void
-test_azsprintf ()
-{
-  test_function (azsprintf);
-}
-
-int
-main (int argc, char *argv[])
-{
-  test_vazsprintf ();
-  test_azsprintf ();
-  return test_exit_status;
-}
diff --git a/tests/test-vazsprintf-gnu.h b/tests/test-vazsprintf-gnu.h
deleted file mode 100644 (file)
index 0aba9fa..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Test of POSIX and GNU compatible vazsprintf() and azsprintf() functions.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
-
-static void
-test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
-{
-  /* Test the support of the 'B' conversion specifier for binary output of
-     integers.  */
-
-  { /* This test would fail on all platforms other than glibc ≥ 2.35.  */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%#B %d", 12345, 33, 44, 55);
-    ASSERT (result != NULL);
-    ASSERT (strcmp (result, "0B11000000111001 33") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-}
diff --git a/tests/test-vazsprintf-posix.c b/tests/test-vazsprintf-posix.c
deleted file mode 100644 (file)
index 5505966..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-/* Test of POSIX compatible vazsprintf() and azsprintf() functions.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
-
-/* This test exercises only a few POSIX compliance problems that are still
-   visible on platforms relevant in 2024.  For a much more complete test suite,
-   see test-vasprintf-posix.c.  */
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "macros.h"
-#include "infinity.h"
-#include "nan.h"
-
-/* Test whether string[start_index..end_index-1] is a valid textual
-   representation of NaN.  */
-static int
-strisnan (const char *string, size_t start_index, size_t end_index, int uppercase)
-{
-  if (start_index < end_index)
-    {
-      if (string[start_index] == '-')
-        start_index++;
-      if (start_index + 3 <= end_index
-          && memcmp (string + start_index, uppercase ? "NAN" : "nan", 3) == 0)
-        {
-          start_index += 3;
-          if (start_index == end_index
-              || (string[start_index] == '(' && string[end_index - 1] == ')'))
-            return 1;
-        }
-    }
-  return 0;
-}
-
-static void
-test_function (ptrdiff_t (*my_azsprintf) (char **, const char *, ...))
-{
-  char result[5000];
-
-  /* Test the support of the 'a' and 'A' conversion specifier for hexadecimal
-     output of floating-point numbers.  */
-
-  { /* This test would fail on Solaris 11.4.  */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%a %d", 3.1416015625, 33, 44, 55);
-    ASSERT (result != NULL);
-    ASSERT (strcmp (result, "0x1.922p+1 33") == 0
-            || strcmp (result, "0x3.244p+0 33") == 0
-            || strcmp (result, "0x6.488p-1 33") == 0
-            || strcmp (result, "0xc.91p-2 33") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-
-  { /* This test would fail on Solaris 11.4.  */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%A %d", -3.1416015625, 33, 44, 55);
-    ASSERT (result != NULL);
-    ASSERT (strcmp (result, "-0X1.922P+1 33") == 0
-            || strcmp (result, "-0X3.244P+0 33") == 0
-            || strcmp (result, "-0X6.488P-1 33") == 0
-            || strcmp (result, "-0XC.91P-2 33") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-
-  { /* This test would fail on FreeBSD 6.1, NetBSD 10.0. */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%.2a %d", 1.51, 33, 44, 55);
-    ASSERT (result != NULL);
-    ASSERT (strcmp (result, "0x1.83p+0 33") == 0
-            || strcmp (result, "0x3.05p-1 33") == 0
-            || strcmp (result, "0x6.0ap-2 33") == 0
-            || strcmp (result, "0xc.14p-3 33") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-
-  { /* This test would fail on macOS 14, FreeBSD 14.0, OpenBSD 7.5, AIX 7.3,
-       Solaris 11.4.  */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%.0a %d", 1.51, 33, 44, 55);
-    ASSERT (result != NULL);
-    ASSERT (strcmp (result, "0x2p+0 33") == 0
-            || strcmp (result, "0x3p-1 33") == 0
-            || strcmp (result, "0x6p-2 33") == 0
-            || strcmp (result, "0xcp-3 33") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-
-  /* Test the support of the %f format directive.  */
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%f %d", Infinityd (), 33, 44, 55);
-    ASSERT (result != NULL);
-    ASSERT (strcmp (result, "inf 33") == 0
-            || strcmp (result, "infinity 33") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%f %d", NaNd (), 33, 44, 55);
-    ASSERT (result != NULL);
-    ASSERT (strlen (result) >= 3 + 3
-            && strisnan (result, 0, strlen (result) - 3, 0)
-            && strcmp (result + strlen (result) - 3, " 33") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%010f %d", Infinityd (), 33, 44, 55);
-    ASSERT (result != NULL);
-    ASSERT (strcmp (result, "       inf 33") == 0
-            || strcmp (result, "  infinity 33") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-
-  /* Test the support of the %e format directive.  */
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%e %d", Infinityd (), 33, 44, 55);
-    ASSERT (result != NULL);
-    ASSERT (strcmp (result, "inf 33") == 0
-            || strcmp (result, "infinity 33") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%e %d", NaNd (), 33, 44, 55);
-    ASSERT (result != NULL);
-    ASSERT (strlen (result) >= 3 + 3
-            && strisnan (result, 0, strlen (result) - 3, 0)
-            && strcmp (result + strlen (result) - 3, " 33") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-
-  /* Test the support of the %g format directive.  */
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%g %d", Infinityd (), 33, 44, 55);
-    ASSERT (result != NULL);
-    ASSERT (strcmp (result, "inf 33") == 0
-            || strcmp (result, "infinity 33") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%g %d", NaNd (), 33, 44, 55);
-    ASSERT (result != NULL);
-    ASSERT (strlen (result) >= 3 + 3
-            && strisnan (result, 0, strlen (result) - 3, 0)
-            && strcmp (result + strlen (result) - 3, " 33") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-
-  /* Test the support of large precision.  */
-
-  { /* This test would fail on AIX 7.1.  */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%.4000d %d", 1234567, 99);
-    ASSERT (result != NULL);
-    size_t i;
-    for (i = 0; i < 4000 - 7; i++)
-      ASSERT (result[i] == '0');
-    ASSERT (strcmp (result + 4000 - 7, "1234567 99") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-
-  /* Test the support of the 'b' conversion specifier for binary output of
-     integers.  */
-
-  { /* 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.  */
-    char *result;
-    ptrdiff_t retval =
-      my_azsprintf (&result, "%b %d", 12345, 33, 44, 55);
-    ASSERT (result != NULL);
-    ASSERT (strcmp (result, "11000000111001 33") == 0);
-    ASSERT (retval == strlen (result));
-    free (result);
-  }
-}
-
-static ptrdiff_t
-my_azsprintf (char **result, const char *format, ...)
-{
-  va_list args;
-  ptrdiff_t ret;
-
-  va_start (args, format);
-  ret = vazsprintf (result, format, args);
-  va_end (args);
-  return ret;
-}
-
-static void
-test_vazsprintf ()
-{
-  test_function (my_azsprintf);
-}
-
-static void
-test_azsprintf ()
-{
-  test_function (azsprintf);
-}
-
-int
-main (int argc, char *argv[])
-{
-  test_vazsprintf ();
-  test_azsprintf ();
-  return test_exit_status;
-}
diff --git a/tests/test-vsnzprintf-gnu.c b/tests/test-vsnzprintf-gnu.c
new file mode 100644 (file)
index 0000000..d47ff96
--- /dev/null
@@ -0,0 +1,48 @@
+/* Test of POSIX and GNU compatible vsnzprintf() function.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <string.h>
+
+#include "macros.h"
+
+#include "test-snzprintf-gnu.h"
+
+static ptrdiff_t
+my_snzprintf (char *str, size_t size, const char *format, ...)
+{
+  va_list args;
+  ptrdiff_t ret;
+
+  va_start (args, format);
+  ret = vsnzprintf (str, size, format, args);
+  va_end (args);
+  return ret;
+}
+
+int
+main (int argc, char *argv[])
+{
+  test_function (my_snzprintf);
+  return test_exit_status;
+}
diff --git a/tests/test-vsnzprintf-posix.c b/tests/test-vsnzprintf-posix.c
new file mode 100644 (file)
index 0000000..f245796
--- /dev/null
@@ -0,0 +1,48 @@
+/* Test of POSIX compatible vsnzprintf() function.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <string.h>
+
+#include "macros.h"
+
+#include "test-snzprintf-posix.h"
+
+static ptrdiff_t
+my_snzprintf (char *str, size_t size, const char *format, ...)
+{
+  va_list args;
+  ptrdiff_t ret;
+
+  va_start (args, format);
+  ret = vsnzprintf (str, size, format, args);
+  va_end (args);
+  return ret;
+}
+
+int
+main (int argc, char *argv[])
+{
+  test_function (my_snzprintf);
+  return test_exit_status;
+}
diff --git a/tests/test-vszprintf-gnu.c b/tests/test-vszprintf-gnu.c
new file mode 100644 (file)
index 0000000..e77855b
--- /dev/null
@@ -0,0 +1,48 @@
+/* Test of POSIX and GNU compatible vszprintf() function.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <string.h>
+
+#include "macros.h"
+
+#include "test-szprintf-gnu.h"
+
+static ptrdiff_t
+my_szprintf (char *str, const char *format, ...)
+{
+  va_list args;
+  ptrdiff_t ret;
+
+  va_start (args, format);
+  ret = vszprintf (str, format, args);
+  va_end (args);
+  return ret;
+}
+
+int
+main (int argc, char *argv[])
+{
+  test_function (my_szprintf);
+  return test_exit_status;
+}
diff --git a/tests/test-vszprintf-posix.c b/tests/test-vszprintf-posix.c
new file mode 100644 (file)
index 0000000..10f0213
--- /dev/null
@@ -0,0 +1,48 @@
+/* Test of POSIX compatible vszprintf() function.
+   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <string.h>
+
+#include "macros.h"
+
+#include "test-szprintf-posix.h"
+
+static ptrdiff_t
+my_szprintf (char *str, const char *format, ...)
+{
+  va_list args;
+  ptrdiff_t ret;
+
+  va_start (args, format);
+  ret = vszprintf (str, format, args);
+  va_end (args);
+  return ret;
+}
+
+int
+main (int argc, char *argv[])
+{
+  test_function (my_szprintf);
+  return test_exit_status;
+}
diff --git a/tests/test-vzsnprintf-gnu.c b/tests/test-vzsnprintf-gnu.c
deleted file mode 100644 (file)
index 65e893c..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Test of POSIX and GNU compatible vzsnprintf() function.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include <stdarg.h>
-#include <stddef.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-zsnprintf-gnu.h"
-
-static ptrdiff_t
-my_zsnprintf (char *str, size_t size, const char *format, ...)
-{
-  va_list args;
-  ptrdiff_t ret;
-
-  va_start (args, format);
-  ret = vzsnprintf (str, size, format, args);
-  va_end (args);
-  return ret;
-}
-
-int
-main (int argc, char *argv[])
-{
-  test_function (my_zsnprintf);
-  return test_exit_status;
-}
diff --git a/tests/test-vzsnprintf-posix.c b/tests/test-vzsnprintf-posix.c
deleted file mode 100644 (file)
index e44b94c..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Test of POSIX compatible vzsnprintf() function.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include <stdarg.h>
-#include <stddef.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-zsnprintf-posix.h"
-
-static ptrdiff_t
-my_zsnprintf (char *str, size_t size, const char *format, ...)
-{
-  va_list args;
-  ptrdiff_t ret;
-
-  va_start (args, format);
-  ret = vzsnprintf (str, size, format, args);
-  va_end (args);
-  return ret;
-}
-
-int
-main (int argc, char *argv[])
-{
-  test_function (my_zsnprintf);
-  return test_exit_status;
-}
diff --git a/tests/test-vzsprintf-gnu.c b/tests/test-vzsprintf-gnu.c
deleted file mode 100644 (file)
index 8920fa1..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Test of POSIX and GNU compatible vzsprintf() function.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include <stdarg.h>
-#include <stddef.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-zsprintf-gnu.h"
-
-static ptrdiff_t
-my_zsprintf (char *str, const char *format, ...)
-{
-  va_list args;
-  ptrdiff_t ret;
-
-  va_start (args, format);
-  ret = vzsprintf (str, format, args);
-  va_end (args);
-  return ret;
-}
-
-int
-main (int argc, char *argv[])
-{
-  test_function (my_zsprintf);
-  return test_exit_status;
-}
diff --git a/tests/test-vzsprintf-posix.c b/tests/test-vzsprintf-posix.c
deleted file mode 100644 (file)
index a3dd260..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Test of POSIX compatible vzsprintf() function.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include <stdarg.h>
-#include <stddef.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-zsprintf-posix.h"
-
-static ptrdiff_t
-my_zsprintf (char *str, const char *format, ...)
-{
-  va_list args;
-  ptrdiff_t ret;
-
-  va_start (args, format);
-  ret = vzsprintf (str, format, args);
-  va_end (args);
-  return ret;
-}
-
-int
-main (int argc, char *argv[])
-{
-  test_function (my_zsprintf);
-  return test_exit_status;
-}
diff --git a/tests/test-zsnprintf-gnu.c b/tests/test-zsnprintf-gnu.c
deleted file mode 100644 (file)
index efd4f5b..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Test of POSIX and GNU compatible zsnprintf() function.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include <stddef.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-zsnprintf-gnu.h"
-
-int
-main (int argc, char *argv[])
-{
-  test_function (zsnprintf);
-  return test_exit_status;
-}
diff --git a/tests/test-zsnprintf-gnu.h b/tests/test-zsnprintf-gnu.h
deleted file mode 100644 (file)
index 0e28c58..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Test of POSIX and GNU compatible vzsnprintf() and zsnprintf() functions.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
-
-/* This test exercises only a few POSIX compliance problems that are still
-   visible on platforms relevant in 2024.  For a much more complete test suite,
-   see test-snprintf-posix.h.  */
-
-static void
-test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
-{
-  char result[5000];
-
-  /* Test the support of the 'B' conversion specifier for binary output of
-     integers.  */
-
-  { /* This test would fail on all platforms other than glibc ≥ 2.35.  */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%#B %d", 12345, 33, 44, 55);
-    ASSERT (strcmp (result, "0B11000000111001 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-}
diff --git a/tests/test-zsnprintf-posix.c b/tests/test-zsnprintf-posix.c
deleted file mode 100644 (file)
index 0acefb5..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Test of POSIX compatible zsnprintf() function.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include <stddef.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-zsnprintf-posix.h"
-
-int
-main (int argc, char *argv[])
-{
-  test_function (zsnprintf);
-  return test_exit_status;
-}
diff --git a/tests/test-zsnprintf-posix.h b/tests/test-zsnprintf-posix.h
deleted file mode 100644 (file)
index 64639d4..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/* Test of POSIX compatible vzsnprintf() and zsnprintf() functions.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
-
-/* This test exercises only a few POSIX compliance problems that are still
-   visible on platforms relevant in 2024.  For a much more complete test suite,
-   see test-snprintf-posix.h.  */
-
-#include "infinity.h"
-#include "nan.h"
-
-/* Test whether string[start_index..end_index-1] is a valid textual
-   representation of NaN.  */
-static int
-strisnan (const char *string, size_t start_index, size_t end_index, int uppercase)
-{
-  if (start_index < end_index)
-    {
-      if (string[start_index] == '-')
-        start_index++;
-      if (start_index + 3 <= end_index
-          && memcmp (string + start_index, uppercase ? "NAN" : "nan", 3) == 0)
-        {
-          start_index += 3;
-          if (start_index == end_index
-              || (string[start_index] == '(' && string[end_index - 1] == ')'))
-            return 1;
-        }
-    }
-  return 0;
-}
-
-static void
-test_function (ptrdiff_t (*my_zsnprintf) (char *, size_t, const char *, ...))
-{
-  char result[5000];
-
-  /* Test the support of the 'a' and 'A' conversion specifier for hexadecimal
-     output of floating-point numbers.  */
-
-  { /* This test would fail on Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%a %d", 3.1416015625, 33, 44, 55);
-    ASSERT (strcmp (result, "0x1.922p+1 33") == 0
-            || strcmp (result, "0x3.244p+0 33") == 0
-            || strcmp (result, "0x6.488p-1 33") == 0
-            || strcmp (result, "0xc.91p-2 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%A %d", -3.1416015625, 33, 44, 55);
-    ASSERT (strcmp (result, "-0X1.922P+1 33") == 0
-            || strcmp (result, "-0X3.244P+0 33") == 0
-            || strcmp (result, "-0X6.488P-1 33") == 0
-            || strcmp (result, "-0XC.91P-2 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on FreeBSD 6.1, NetBSD 10.0. */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%.2a %d", 1.51, 33, 44, 55);
-    ASSERT (strcmp (result, "0x1.83p+0 33") == 0
-            || strcmp (result, "0x3.05p-1 33") == 0
-            || strcmp (result, "0x6.0ap-2 33") == 0
-            || strcmp (result, "0xc.14p-3 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on macOS 14, FreeBSD 14.0, OpenBSD 7.5, AIX 7.3,
-       Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%.0a %d", 1.51, 33, 44, 55);
-    ASSERT (strcmp (result, "0x2p+0 33") == 0
-            || strcmp (result, "0x3p-1 33") == 0
-            || strcmp (result, "0x6p-2 33") == 0
-            || strcmp (result, "0xcp-3 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  /* Test the support of the %f format directive.  */
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%f %d", Infinityd (), 33, 44, 55);
-    ASSERT (strcmp (result, "inf 33") == 0
-            || strcmp (result, "infinity 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%f %d", NaNd (), 33, 44, 55);
-    ASSERT (strlen (result) >= 3 + 3
-            && strisnan (result, 0, strlen (result) - 3, 0)
-            && strcmp (result + strlen (result) - 3, " 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%010f %d", Infinityd (), 33, 44, 55);
-    ASSERT (strcmp (result, "       inf 33") == 0
-            || strcmp (result, "  infinity 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  /* Test the support of the %e format directive.  */
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%e %d", Infinityd (), 33, 44, 55);
-    ASSERT (strcmp (result, "inf 33") == 0
-            || strcmp (result, "infinity 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%e %d", NaNd (), 33, 44, 55);
-    ASSERT (strlen (result) >= 3 + 3
-            && strisnan (result, 0, strlen (result) - 3, 0)
-            && strcmp (result + strlen (result) - 3, " 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  /* Test the support of the %g format directive.  */
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%g %d", Infinityd (), 33, 44, 55);
-    ASSERT (strcmp (result, "inf 33") == 0
-            || strcmp (result, "infinity 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%g %d", NaNd (), 33, 44, 55);
-    ASSERT (strlen (result) >= 3 + 3
-            && strisnan (result, 0, strlen (result) - 3, 0)
-            && strcmp (result + strlen (result) - 3, " 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  /* Test the support of large precision.  */
-
-  { /* This test would fail on AIX 7.1.  */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%.4000d %d", 1234567, 99);
-    size_t i;
-    for (i = 0; i < 4000 - 7; i++)
-      ASSERT (result[i] == '0');
-    ASSERT (strcmp (result + 4000 - 7, "1234567 99") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  /* Test the support of the 'b' conversion specifier for binary output of
-     integers.  */
-
-  { /* 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.  */
-    ptrdiff_t retval =
-      my_zsnprintf (result, sizeof (result), "%b %d", 12345, 33, 44, 55);
-    ASSERT (strcmp (result, "11000000111001 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-}
diff --git a/tests/test-zsprintf-gnu.c b/tests/test-zsprintf-gnu.c
deleted file mode 100644 (file)
index 8f95471..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Test of POSIX and GNU compatible zsprintf() function.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include <stdarg.h>
-#include <stddef.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-zsprintf-gnu.h"
-
-int
-main (int argc, char *argv[])
-{
-  test_function (zsprintf);
-  return test_exit_status;
-}
diff --git a/tests/test-zsprintf-gnu.h b/tests/test-zsprintf-gnu.h
deleted file mode 100644 (file)
index d33a18f..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Test of POSIX and GNU compatible vzsprintf() and zsprintf() functions.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
-
-/* This test exercises only a few POSIX compliance problems that are still
-   visible on platforms relevant in 2024.  For a much more complete test suite,
-   see test-sprintf-posix.h.  */
-
-static void
-test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
-{
-  char result[5000];
-
-  /* Test the support of the 'B' conversion specifier for binary output of
-     integers.  */
-
-  { /* This test would fail on all platforms other than glibc ≥ 2.35.  */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%#B %d", 12345, 33, 44, 55);
-    ASSERT (strcmp (result, "0B11000000111001 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-}
diff --git a/tests/test-zsprintf-posix.c b/tests/test-zsprintf-posix.c
deleted file mode 100644 (file)
index b5af845..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Test of POSIX compatible zsprintf() function.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include <stdarg.h>
-#include <stddef.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-zsprintf-posix.h"
-
-int
-main (int argc, char *argv[])
-{
-  test_function (zsprintf);
-  return test_exit_status;
-}
diff --git a/tests/test-zsprintf-posix.h b/tests/test-zsprintf-posix.h
deleted file mode 100644 (file)
index c127549..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/* Test of POSIX compatible vzsprintf() and zsprintf() functions.
-   Copyright (C) 2007-2024 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2024.  */
-
-/* This test exercises only a few POSIX compliance problems that are still
-   visible on platforms relevant in 2024.  For a much more complete test suite,
-   see test-sprintf-posix.h.  */
-
-#include "infinity.h"
-#include "nan.h"
-
-/* Test whether string[start_index..end_index-1] is a valid textual
-   representation of NaN.  */
-static int
-strisnan (const char *string, size_t start_index, size_t end_index, int uppercase)
-{
-  if (start_index < end_index)
-    {
-      if (string[start_index] == '-')
-        start_index++;
-      if (start_index + 3 <= end_index
-          && memcmp (string + start_index, uppercase ? "NAN" : "nan", 3) == 0)
-        {
-          start_index += 3;
-          if (start_index == end_index
-              || (string[start_index] == '(' && string[end_index - 1] == ')'))
-            return 1;
-        }
-    }
-  return 0;
-}
-
-static void
-test_function (ptrdiff_t (*my_zsprintf) (char *, const char *, ...))
-{
-  char result[5000];
-
-  /* Test the support of the 'a' and 'A' conversion specifier for hexadecimal
-     output of floating-point numbers.  */
-
-  { /* This test would fail on Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%a %d", 3.1416015625, 33, 44, 55);
-    ASSERT (strcmp (result, "0x1.922p+1 33") == 0
-            || strcmp (result, "0x3.244p+0 33") == 0
-            || strcmp (result, "0x6.488p-1 33") == 0
-            || strcmp (result, "0xc.91p-2 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%A %d", -3.1416015625, 33, 44, 55);
-    ASSERT (strcmp (result, "-0X1.922P+1 33") == 0
-            || strcmp (result, "-0X3.244P+0 33") == 0
-            || strcmp (result, "-0X6.488P-1 33") == 0
-            || strcmp (result, "-0XC.91P-2 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on FreeBSD 6.1, NetBSD 10.0. */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%.2a %d", 1.51, 33, 44, 55);
-    ASSERT (strcmp (result, "0x1.83p+0 33") == 0
-            || strcmp (result, "0x3.05p-1 33") == 0
-            || strcmp (result, "0x6.0ap-2 33") == 0
-            || strcmp (result, "0xc.14p-3 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on macOS 14, FreeBSD 14.0, OpenBSD 7.5, AIX 7.3,
-       Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%.0a %d", 1.51, 33, 44, 55);
-    ASSERT (strcmp (result, "0x2p+0 33") == 0
-            || strcmp (result, "0x3p-1 33") == 0
-            || strcmp (result, "0x6p-2 33") == 0
-            || strcmp (result, "0xcp-3 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  /* Test the support of the %f format directive.  */
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%f %d", Infinityd (), 33, 44, 55);
-    ASSERT (strcmp (result, "inf 33") == 0
-            || strcmp (result, "infinity 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%f %d", NaNd (), 33, 44, 55);
-    ASSERT (strlen (result) >= 3 + 3
-            && strisnan (result, 0, strlen (result) - 3, 0)
-            && strcmp (result + strlen (result) - 3, " 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%010f %d", Infinityd (), 33, 44, 55);
-    ASSERT (strcmp (result, "       inf 33") == 0
-            || strcmp (result, "  infinity 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  /* Test the support of the %e format directive.  */
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%e %d", Infinityd (), 33, 44, 55);
-    ASSERT (strcmp (result, "inf 33") == 0
-            || strcmp (result, "infinity 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%e %d", NaNd (), 33, 44, 55);
-    ASSERT (strlen (result) >= 3 + 3
-            && strisnan (result, 0, strlen (result) - 3, 0)
-            && strcmp (result + strlen (result) - 3, " 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  /* Test the support of the %g format directive.  */
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%g %d", Infinityd (), 33, 44, 55);
-    ASSERT (strcmp (result, "inf 33") == 0
-            || strcmp (result, "infinity 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  { /* This test would fail on AIX 7.3, Solaris 11.4.  */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%g %d", NaNd (), 33, 44, 55);
-    ASSERT (strlen (result) >= 3 + 3
-            && strisnan (result, 0, strlen (result) - 3, 0)
-            && strcmp (result + strlen (result) - 3, " 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  /* Test the support of large precision.  */
-
-  { /* This test would fail on AIX 7.1.  */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%.4000d %d", 1234567, 99);
-    size_t i;
-    for (i = 0; i < 4000 - 7; i++)
-      ASSERT (result[i] == '0');
-    ASSERT (strcmp (result + 4000 - 7, "1234567 99") == 0);
-    ASSERT (retval == strlen (result));
-  }
-
-  /* Test the support of the 'b' conversion specifier for binary output of
-     integers.  */
-
-  { /* 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.  */
-    ptrdiff_t retval =
-      my_zsprintf (result, "%b %d", 12345, 33, 44, 55);
-    ASSERT (strcmp (result, "11000000111001 33") == 0);
-    ASSERT (retval == strlen (result));
-  }
-}