diff options
author | Colin Watson <cjwatson@debian.org> | 2022-01-16 17:11:18 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2022-01-16 17:11:18 +0000 |
commit | 83df40649a556a9113b1633ef50ded73463a558d (patch) | |
tree | ff912dee9ea6d4f1db83c54c7a5698f403f092eb | |
parent | 8161dece9d0c202668251ca8ad6d89c3bbca566f (diff) |
Move appendstr out of manconfig.h
* include/manconfig.h (appendstr): Move to ...
* lib/appendstr.h: ... here (new file).
* lib/Makefile.am (libman_la_SOURCES): Add appendstr.h.
* lib/README: Update file names.
* lib/appendstr.c, libdb/db_delete.c, src/catman.c, src/check_mandirs.c,
src/compression.c, src/filenames.c, src/globbing.c, src/man.c,
src/manconv_client.c, src/manconv_main.c, src/manp.c, src/straycats.c,
src/whatis.c, src/zsoelim.l: Include appendstr.h.
-rw-r--r-- | include/manconfig.h | 3 | ||||
-rw-r--r-- | lib/Makefile.am | 1 | ||||
-rw-r--r-- | lib/README | 2 | ||||
-rw-r--r-- | lib/appendstr.c | 2 | ||||
-rw-r--r-- | lib/appendstr.h | 24 | ||||
-rw-r--r-- | libdb/db_delete.c | 1 | ||||
-rw-r--r-- | src/catman.c | 1 | ||||
-rw-r--r-- | src/check_mandirs.c | 1 | ||||
-rw-r--r-- | src/compression.c | 4 | ||||
-rw-r--r-- | src/filenames.c | 1 | ||||
-rw-r--r-- | src/globbing.c | 1 | ||||
-rw-r--r-- | src/man.c | 1 | ||||
-rw-r--r-- | src/manconv_client.c | 2 | ||||
-rw-r--r-- | src/manconv_main.c | 1 | ||||
-rw-r--r-- | src/manp.c | 1 | ||||
-rw-r--r-- | src/straycats.c | 1 | ||||
-rw-r--r-- | src/whatis.c | 1 | ||||
-rw-r--r-- | src/zsoelim.l | 1 |
18 files changed, 44 insertions, 5 deletions
diff --git a/include/manconfig.h b/include/manconfig.h index ba250774..509cccd3 100644 --- a/include/manconfig.h +++ b/include/manconfig.h @@ -181,14 +181,11 @@ extern struct compression comp_list[]; /* some library function declarations */ #include <stddef.h> /* for size_t */ -#include "attribute.h" #include "xalloc.h" #include "xstrndup.h" struct pipeline; -NODISCARD extern char *appendstr (char *, ...) ATTRIBUTE_SENTINEL (); - extern int quiet; /* be quiet(er) if 1 */ /*--------------------------*/ diff --git a/lib/Makefile.am b/lib/Makefile.am index abed20df..72ce5ad2 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -34,6 +34,7 @@ libman_la_CPPFLAGS = \ libman_la_SOURCES = \ appendstr.c \ + appendstr.h \ cleanup.c \ cleanup.h \ debug.c \ @@ -5,7 +5,7 @@ the terms of the GNU General Public License version 2 or later. See the files ../docs/COPYING and ../docs/COPYING.LIB for relevant information. -appendstr.c author - Markus Armbruster +appendstr.* author - Markus Armbruster cleanup.* author - Markus Armbruster, Colin Watson debug.* author - Colin Watson encodings.* author - Colin Watson diff --git a/lib/appendstr.c b/lib/appendstr.c index ee545f4b..011522d7 100644 --- a/lib/appendstr.c +++ b/lib/appendstr.c @@ -25,6 +25,8 @@ #include "manconfig.h" +#include "appendstr.h" + /* append strings to first argument, which is realloced to the correct size first arg may be NULL */ char *appendstr (char *str, ...) diff --git a/lib/appendstr.h b/lib/appendstr.h new file mode 100644 index 00000000..30b18b81 --- /dev/null +++ b/lib/appendstr.h @@ -0,0 +1,24 @@ +/* appendstr.h -- interface to appending to a dynamically allocated string + * + * Copyright (C) 1994 Markus Armbruster + * Copyright (C) 2022 Colin Watson + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Library Public License + * as published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING.LIB. If not, write + * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA + * 02139, USA. + */ + +#include "attribute.h" + +NODISCARD extern char *appendstr (char *, ...) ATTRIBUTE_SENTINEL (); diff --git a/libdb/db_delete.c b/libdb/db_delete.c index ccf07863..6b0a6c62 100644 --- a/libdb/db_delete.c +++ b/libdb/db_delete.c @@ -38,6 +38,7 @@ #include "manconfig.h" +#include "appendstr.h" #include "debug.h" #include "glcontainers.h" diff --git a/src/catman.c b/src/catman.c index 869f07d9..51c60f75 100644 --- a/src/catman.c +++ b/src/catman.c @@ -73,6 +73,7 @@ #include "manconfig.h" +#include "appendstr.h" #include "cleanup.h" #include "debug.h" #include "glcontainers.h" diff --git a/src/check_mandirs.c b/src/check_mandirs.c index 7db53856..9a9f5f0e 100644 --- a/src/check_mandirs.c +++ b/src/check_mandirs.c @@ -60,6 +60,7 @@ #include "manconfig.h" +#include "appendstr.h" #include "debug.h" #include "glcontainers.h" #include "orderfiles.h" diff --git a/src/compression.c b/src/compression.c index bdd72e0e..314853ad 100644 --- a/src/compression.c +++ b/src/compression.c @@ -38,13 +38,15 @@ #include <sys/stat.h> #include <fcntl.h> +#include "error.h" #include "xvasprintf.h" #include "manconfig.h" -#include "error.h" #include "pipeline.h" +#include "appendstr.h" + #include "compression.h" /* Take filename as arg, return structure containing decompressor diff --git a/src/filenames.c b/src/filenames.c index 669921b3..5d07323e 100644 --- a/src/filenames.c +++ b/src/filenames.c @@ -37,6 +37,7 @@ #include "manconfig.h" +#include "appendstr.h" #include "debug.h" #include "db_storage.h" diff --git a/src/globbing.c b/src/globbing.c index df22d69c..23c327a3 100644 --- a/src/globbing.c +++ b/src/globbing.c @@ -47,6 +47,7 @@ #include "manconfig.h" +#include "appendstr.h" #include "cleanup.h" #include "debug.h" #include "glcontainers.h" @@ -82,6 +82,7 @@ #include "manconfig.h" +#include "appendstr.h" #include "cleanup.h" #include "debug.h" #include "glcontainers.h" diff --git a/src/manconv_client.c b/src/manconv_client.c index d14da3de..49905445 100644 --- a/src/manconv_client.c +++ b/src/manconv_client.c @@ -36,6 +36,8 @@ #include "manconfig.h" #include "pipeline.h" + +#include "appendstr.h" #include "decompress.h" #include "glcontainers.h" #include "sandbox.h" diff --git a/src/manconv_main.c b/src/manconv_main.c index 6c85ebd2..d7f941d0 100644 --- a/src/manconv_main.c +++ b/src/manconv_main.c @@ -42,6 +42,7 @@ #include "manconfig.h" +#include "appendstr.h" #include "cleanup.h" #include "debug.h" #include "encodings.h" @@ -74,6 +74,7 @@ #include "manconfig.h" +#include "appendstr.h" #include "cleanup.h" #include "debug.h" #include "glcontainers.h" diff --git a/src/straycats.c b/src/straycats.c index aeb9da82..371e8726 100644 --- a/src/straycats.c +++ b/src/straycats.c @@ -50,6 +50,7 @@ #include "manconfig.h" +#include "appendstr.h" #include "debug.h" #include "glcontainers.h" #include "pipeline.h" diff --git a/src/whatis.c b/src/whatis.c index 3145f697..237fa640 100644 --- a/src/whatis.c +++ b/src/whatis.c @@ -65,6 +65,7 @@ #include "manconfig.h" +#include "appendstr.h" #include "cleanup.h" #include "debug.h" #include "glcontainers.h" diff --git a/src/zsoelim.l b/src/zsoelim.l index c23d30cf..9f2dad30 100644 --- a/src/zsoelim.l +++ b/src/zsoelim.l @@ -81,6 +81,7 @@ #include <locale.h> #define _(String) gettext (String) +#include "appendstr.h" #include "debug.h" #include "glcontainers.h" #include "pipeline.h" |