Florian Weimer wrote:
> > But it means that we cannot promise that these .h files are even remotely
> > stable APIs.
> 
> I must say I was surprised to see dynarray and scratch_buffer end up in
> gnulib.  I never intended them to escape this way from glibc.  The
> interfaces and their implementation are problematic in some ways, and I
> can't recommend them for general use.

Thanks for this clear statement, Florian.

So I was too optimistic when I wrote
  - "It looks like the 'scratch_buffer' could be useful to some programs
     outside of glibc." [1]
  - "dynarray looks useful" [2]

Here are proposed patches to rename the modules.

[1] https://lists.gnu.org/archive/html/bug-gnulib/2021-02/msg00073.html
[2] https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00042.html


2022-11-03  Bruno Haible  <br...@clisp.org>

        dynarray: Rename to glibc-internal/dynarray.
        * modules/glibc-internal/dynarray: Renamed from modules/dynarray.
        * modules/glibc-internal/dynarray-tests: Renamed from
        modules/dynarray-tests.
        * modules/regex (Depends-on): Update.
        * NEWS: Mention this change and the previous one.

2022-11-03  Bruno Haible  <br...@clisp.org>

        scratch_buffer: Rename to glibc-internal/scratch_buffer.
        * modules/glibc-internal/scratch_buffer: Renamed from
        modules/scratch_buffer.
        * modules/glibc-internal/scratch_buffer-tests: Renamed from
        modules/scratch_buffer-tests.
        * modules/canonicalize (Depends-on): Update.
        * modules/canonicalize-lgpl (Depends-on): Likewise.
        * modules/glob (Depends-on): Likewise.

>From 371a0f95a7e90d29a7272d0e7cfde1eb0b61a235 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Thu, 3 Nov 2022 13:30:04 +0100
Subject: [PATCH 1/2] scratch_buffer: Rename to glibc-internal/scratch_buffer.

* modules/glibc-internal/scratch_buffer: Renamed from
modules/scratch_buffer.
* modules/glibc-internal/scratch_buffer-tests: Renamed from
modules/scratch_buffer-tests.
* modules/canonicalize (Depends-on): Update.
* modules/canonicalize-lgpl (Depends-on): Likewise.
* modules/glob (Depends-on): Likewise.
---
 ChangeLog                                     | 11 +++++
 modules/canonicalize                          |  2 +-
 modules/canonicalize-lgpl                     | 36 ++++++++---------
 modules/{ => glibc-internal}/scratch_buffer   |  0
 .../{ => glibc-internal}/scratch_buffer-tests |  0
 modules/glob                                  | 40 +++++++++----------
 6 files changed, 50 insertions(+), 39 deletions(-)
 rename modules/{ => glibc-internal}/scratch_buffer (100%)
 rename modules/{ => glibc-internal}/scratch_buffer-tests (100%)

diff --git a/ChangeLog b/ChangeLog
index a7a3f30c0d..70e717284b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-11-03  Bruno Haible  <br...@clisp.org>
+
+	scratch_buffer: Rename to glibc-internal/scratch_buffer.
+	* modules/glibc-internal/scratch_buffer: Renamed from
+	modules/scratch_buffer.
+	* modules/glibc-internal/scratch_buffer-tests: Renamed from
+	modules/scratch_buffer-tests.
+	* modules/canonicalize (Depends-on): Update.
+	* modules/canonicalize-lgpl (Depends-on): Likewise.
+	* modules/glob (Depends-on): Likewise.
+
 2022-11-02  Bruno Haible  <br...@clisp.org>
 
 	scratch_buffer: Document last change.
diff --git a/modules/canonicalize b/modules/canonicalize
index ddd83bc841..25667c431b 100644
--- a/modules/canonicalize
+++ b/modules/canonicalize
@@ -24,7 +24,7 @@ mempcpy
 nocrash
 rawmemchr
 readlink
-scratch_buffer
+glibc-internal/scratch_buffer
 stat
 stdbool
 sys_stat
diff --git a/modules/canonicalize-lgpl b/modules/canonicalize-lgpl
index 252618e95e..7842cda2da 100644
--- a/modules/canonicalize-lgpl
+++ b/modules/canonicalize-lgpl
@@ -11,24 +11,24 @@ Depends-on:
 extensions
 stdlib
 nocrash
-double-slash-root [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-eloop-threshold   [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-errno             [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-fcntl-h           [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-filename          [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-idx               [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-intprops          [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-libc-config       [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-memmove           [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-mempcpy           [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-pathmax           [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-rawmemchr         [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-readlink          [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-scratch_buffer    [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-stat              [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-stdbool           [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-sys_stat          [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
-unistd            [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+double-slash-root             [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+eloop-threshold               [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+errno                         [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+fcntl-h                       [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+filename                      [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+idx                           [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+intprops                      [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+libc-config                   [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+memmove                       [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+mempcpy                       [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+pathmax                       [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+rawmemchr                     [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+readlink                      [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+glibc-internal/scratch_buffer [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+stat                          [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+stdbool                       [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+sys_stat                      [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
+unistd                        [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]
 
 configure.ac:
 gl_CANONICALIZE_LGPL
diff --git a/modules/scratch_buffer b/modules/glibc-internal/scratch_buffer
similarity index 100%
rename from modules/scratch_buffer
rename to modules/glibc-internal/scratch_buffer
diff --git a/modules/scratch_buffer-tests b/modules/glibc-internal/scratch_buffer-tests
similarity index 100%
rename from modules/scratch_buffer-tests
rename to modules/glibc-internal/scratch_buffer-tests
diff --git a/modules/glob b/modules/glob
index 83cd729ceb..4a89521e01 100644
--- a/modules/glob
+++ b/modules/glob
@@ -13,26 +13,26 @@ Depends-on:
 glob-h
 c99
 largefile
-alloca          [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-builtin-expect  [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-closedir        [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-d-type          [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-dirfd           [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-flexmember      [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-fnmatch         [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-fstatat         [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-getlogin_r      [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-libc-config     [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-memchr          [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-mempcpy         [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-opendir         [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-readdir         [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-scratch_buffer  [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-stdbool         [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-stdint          [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-strdup          [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-unistd          [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
-malloc-posix    [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+alloca                        [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+builtin-expect                [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+closedir                      [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+d-type                        [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+dirfd                         [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+flexmember                    [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+fnmatch                       [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+fstatat                       [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+getlogin_r                    [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+libc-config                   [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+memchr                        [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+mempcpy                       [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+opendir                       [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+readdir                       [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+glibc-internal/scratch_buffer [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+stdbool                       [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+stdint                        [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+strdup                        [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+unistd                        [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
+malloc-posix                  [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
 
 configure.ac:
 gl_GLOB
-- 
2.34.1

>From 9543a96e7e0975cda93cfb777d2b2e346cc290c5 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Thu, 3 Nov 2022 13:32:42 +0100
Subject: [PATCH 2/2] dynarray: Rename to glibc-internal/dynarray.

* modules/glibc-internal/dynarray: Renamed from modules/dynarray.
* modules/glibc-internal/dynarray-tests: Renamed from
modules/dynarray-tests.
* modules/regex (Depends-on): Update.
* NEWS: Mention this change and the previous one.
---
 ChangeLog                                   |  9 +++++
 NEWS                                        |  4 ++
 modules/{ => glibc-internal}/dynarray       |  0
 modules/{ => glibc-internal}/dynarray-tests |  0
 modules/regex                               | 42 ++++++++++-----------
 5 files changed, 34 insertions(+), 21 deletions(-)
 rename modules/{ => glibc-internal}/dynarray (100%)
 rename modules/{ => glibc-internal}/dynarray-tests (100%)

diff --git a/ChangeLog b/ChangeLog
index 70e717284b..70ece5200a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-11-03  Bruno Haible  <br...@clisp.org>
+
+	dynarray: Rename to glibc-internal/dynarray.
+	* modules/glibc-internal/dynarray: Renamed from modules/dynarray.
+	* modules/glibc-internal/dynarray-tests: Renamed from
+	modules/dynarray-tests.
+	* modules/regex (Depends-on): Update.
+	* NEWS: Mention this change and the previous one.
+
 2022-11-03  Bruno Haible  <br...@clisp.org>
 
 	scratch_buffer: Rename to glibc-internal/scratch_buffer.
diff --git a/NEWS b/NEWS
index 327fc8ceee..3b83e2978d 100644
--- a/NEWS
+++ b/NEWS
@@ -74,6 +74,10 @@ User visible incompatible changes
 
 Date        Modules         Changes
 
+2022-11-03  dynarray        These modules are renamed to glibc-internal/dynarray
+            scratch_buffer  and glibc-internal/scratch_buffer, respectively.
+                            They are not meant for general use.
+
 2022-11-02  scratch_buffer  The function 'gl_scratch_buffer_dupfree' is removed.
 
 2022-09-10  stdbool         This module now assumes C99 and provides C23,
diff --git a/modules/dynarray b/modules/glibc-internal/dynarray
similarity index 100%
rename from modules/dynarray
rename to modules/glibc-internal/dynarray
diff --git a/modules/dynarray-tests b/modules/glibc-internal/dynarray-tests
similarity index 100%
rename from modules/dynarray-tests
rename to modules/glibc-internal/dynarray-tests
diff --git a/modules/regex b/modules/regex
index b780427221..7779a1e796 100644
--- a/modules/regex
+++ b/modules/regex
@@ -20,27 +20,27 @@ c99
 extensions
 ssize_t
 vararrays
-attribute       [test $ac_use_included_regex = yes]
-btowc           [test $ac_use_included_regex = yes]
-builtin-expect  [test $ac_use_included_regex = yes]
-dynarray        [test $ac_use_included_regex = yes]
-intprops        [test $ac_use_included_regex = yes]
-iswctype        [test $ac_use_included_regex = yes]
-langinfo        [test $ac_use_included_regex = yes]
-libc-config     [test $ac_use_included_regex = yes]
-lock            [test $ac_use_included_regex = yes]
-memcmp          [test $ac_use_included_regex = yes]
-memmove         [test $ac_use_included_regex = yes]
-mbrtowc         [test $ac_use_included_regex = yes]
-mbsinit         [test $ac_use_included_regex = yes]
-nl_langinfo     [test $ac_use_included_regex = yes]
-stdbool         [test $ac_use_included_regex = yes]
-stdint          [test $ac_use_included_regex = yes]
-verify          [test $ac_use_included_regex = yes]
-wchar           [test $ac_use_included_regex = yes]
-wcrtomb         [test $ac_use_included_regex = yes]
-wctype-h        [test $ac_use_included_regex = yes]
-wctype          [test $ac_use_included_regex = yes]
+attribute               [test $ac_use_included_regex = yes]
+btowc                   [test $ac_use_included_regex = yes]
+builtin-expect          [test $ac_use_included_regex = yes]
+glibc-internal/dynarray [test $ac_use_included_regex = yes]
+intprops                [test $ac_use_included_regex = yes]
+iswctype                [test $ac_use_included_regex = yes]
+langinfo                [test $ac_use_included_regex = yes]
+libc-config             [test $ac_use_included_regex = yes]
+lock                    [test $ac_use_included_regex = yes]
+memcmp                  [test $ac_use_included_regex = yes]
+memmove                 [test $ac_use_included_regex = yes]
+mbrtowc                 [test $ac_use_included_regex = yes]
+mbsinit                 [test $ac_use_included_regex = yes]
+nl_langinfo             [test $ac_use_included_regex = yes]
+stdbool                 [test $ac_use_included_regex = yes]
+stdint                  [test $ac_use_included_regex = yes]
+verify                  [test $ac_use_included_regex = yes]
+wchar                   [test $ac_use_included_regex = yes]
+wcrtomb                 [test $ac_use_included_regex = yes]
+wctype-h                [test $ac_use_included_regex = yes]
+wctype                  [test $ac_use_included_regex = yes]
 
 configure.ac:
 gl_REGEX
-- 
2.34.1

Reply via email to