overhaul internally-public declarations using wrapper headers
authorRich Felker <dalias@aerifal.cx>
Tue, 11 Sep 2018 03:26:40 +0000 (23:26 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 12 Sep 2018 18:34:33 +0000 (14:34 -0400)
commit13d1afa46f8098df290008c681816c9eb89ffbdb
tree01ec1581298b49f20848f9c5ce61bfa9bccd7e1a
parent8c1ac426e15b27d2879afa26a500fd80010b33b9
overhaul internally-public declarations using wrapper headers

commits leading up to this one have moved the vast majority of
libc-internal interface declarations to appropriate internal headers,
allowing them to be type-checked and setting the stage to limit their
visibility. the ones that have not yet been moved are mostly
namespace-protected aliases for standard/public interfaces, which
exist to facilitate implementing plain C functions in terms of POSIX
functionality, or C or POSIX functionality in terms of extensions that
are not standardized. some don't quite fit this description, but are
"internally public" interfacs between subsystems of libc.

rather than create a number of newly-named headers to declare these
functions, and having to add explicit include directives for them to
every source file where they're needed, I have introduced a method of
wrapping the corresponding public headers.

parallel to the public headers in $(srcdir)/include, we now have
wrappers in $(srcdir)/src/include that come earlier in the include
path order. they include the public header they're wrapping, then add
declarations for namespace-protected versions of the same interfaces
and any "internally public" interfaces for the subsystem they
correspond to.

along these lines, the wrapper for features.h is now responsible for
the definition of the hidden, weak, and weak_alias macros. this means
source files will no longer need to include any special headers to
access these features.

over time, it is my expectation that the scope of what is "internally
public" will expand, reducing the number of source files which need to
include *_impl.h and related headers down to those which are actually
implementing the corresponding subsystems, not just using them.
92 files changed:
Makefile
ldso/dynlink.c
src/conf/sysconf.c
src/crypt/crypt.c
src/crypt/crypt_r.c
src/env/__libc_start_main.c
src/env/clearenv.c
src/env/getenv.c
src/env/putenv.c
src/env/setenv.c
src/env/unsetenv.c
src/include/arpa/inet.h [new file with mode: 0644]
src/include/crypt.h [new file with mode: 0644]
src/include/features.h [new file with mode: 0644]
src/include/langinfo.h [new file with mode: 0644]
src/include/pthread.h [new file with mode: 0644]
src/include/resolv.h [new file with mode: 0644]
src/include/signal.h [new file with mode: 0644]
src/include/stdlib.h [new file with mode: 0644]
src/include/string.h [new file with mode: 0644]
src/include/sys/mman.h [new file with mode: 0644]
src/include/sys/sysinfo.h [new file with mode: 0644]
src/include/sys/time.h [new file with mode: 0644]
src/include/time.h [new file with mode: 0644]
src/include/unistd.h [new file with mode: 0644]
src/internal/libc.h
src/internal/malloc_impl.h
src/internal/pthread_impl.h
src/linux/utimes.c
src/locale/dcngettext.c
src/locale/locale_map.c
src/locale/setlocale.c
src/misc/ptsname.c
src/mman/shm_open.c
src/network/getnameinfo.c
src/network/inet_addr.c
src/network/lookup_ipliteral.c
src/network/lookup_name.c
src/network/res_query.c
src/network/res_send.c
src/process/posix_spawn.c
src/process/posix_spawnp.c
src/signal/signal.c
src/stdio/freopen.c
src/stdio/tempnam.c
src/stdio/tmpfile.c
src/stdio/tmpnam.c
src/string/strchr.c
src/string/strcpy.c
src/string/strcspn.c
src/string/strncpy.c
src/string/strrchr.c
src/temp/__randname.c
src/temp/mkdtemp.c
src/temp/mkostemp.c
src/temp/mkostemps.c
src/temp/mkstemp.c
src/temp/mkstemps.c
src/temp/mktemp.c
src/thread/__timedwait.c
src/thread/call_once.c
src/thread/cnd_broadcast.c
src/thread/cnd_signal.c
src/thread/cnd_timedwait.c
src/thread/mtx_timedlock.c
src/thread/mtx_trylock.c
src/thread/mtx_unlock.c
src/thread/pthread_cond_broadcast.c
src/thread/pthread_cond_signal.c
src/thread/pthread_cond_timedwait.c
src/thread/pthread_create.c
src/thread/pthread_detach.c
src/thread/pthread_join.c
src/thread/pthread_mutex_lock.c
src/thread/pthread_mutex_timedlock.c
src/thread/sem_open.c
src/thread/thrd_create.c
src/thread/thrd_exit.c
src/thread/thrd_join.c
src/thread/tss_create.c
src/thread/tss_delete.c
src/time/__map_file.c
src/time/__tz.c
src/time/asctime.c
src/time/asctime_r.c
src/time/clock.c
src/time/gmtime.c
src/time/localtime.c
src/time/strftime.c
src/time/time.c
src/time/time_impl.h
src/time/timespec_get.c