summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2007-10-15 14:46:49 +0100
committerColin Watson <cjwatson@debian.org>2007-10-15 14:46:49 +0100
commitfd369ba030e3b438471331b668b823dc02567615 (patch)
tree96406ad1be97c599528aa1ce84a00898a53e3061
parent480ba1d47a72c96cb2f835c5aaa41e11038e0b9c (diff)
remove attempts at K&R compatibility; such systems are no longer supported by the GNU build system and man-db's support for them was unadvertised and broken anyway
-rw-r--r--lib/appendstr.c29
-rw-r--r--lib/basename.c10
-rw-r--r--lib/decompress.c12
-rw-r--r--lib/hashtable.c12
-rw-r--r--lib/pathsearch.c10
-rw-r--r--lib/tempfile.c4
-rw-r--r--libdb/db_btree.c5
-rw-r--r--libdb/db_delete.c14
-rw-r--r--libdb/db_gdbm.c10
-rw-r--r--libdb/db_lookup.c15
-rw-r--r--libdb/db_ndbm.c5
-rw-r--r--libdb/db_store.c14
-rw-r--r--libdb/db_ver.c7
-rw-r--r--src/accessdb.c17
-rw-r--r--src/catman.c17
-rw-r--r--src/check_mandirs.c18
-rw-r--r--src/compression.c16
-rw-r--r--src/convert_name.c14
-rw-r--r--src/descriptions.c13
-rw-r--r--src/descriptions_store.c13
-rw-r--r--src/encodings.c10
-rw-r--r--src/fake_security.c4
-rw-r--r--src/filenames.c13
-rw-r--r--src/globbing.c15
-rw-r--r--src/globbing_test.c5
-rw-r--r--src/lexgrog.l11
-rw-r--r--src/lexgrog.l-2.3.811
-rw-r--r--src/lexgrog.l-2.4a11
-rw-r--r--src/lexgrog.l.new11
-rw-r--r--src/lexgrog_test.c11
-rw-r--r--src/man.c18
-rw-r--r--src/manconv.c11
-rw-r--r--src/mandb.c16
-rw-r--r--src/manp.c19
-rw-r--r--src/manpath.c11
-rw-r--r--src/security.c15
-rw-r--r--src/straycats.c17
-rw-r--r--src/ult_src.c17
-rw-r--r--src/util.c15
-rw-r--r--src/version.c2
-rw-r--r--src/whatis.c17
-rw-r--r--src/zsoelim.l17
42 files changed, 65 insertions, 467 deletions
diff --git a/lib/appendstr.c b/lib/appendstr.c
index 998dc05b..1bbaebcc 100644
--- a/lib/appendstr.c
+++ b/lib/appendstr.c
@@ -20,35 +20,14 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
-#if defined(STDC_HEADERS)
-# include <string.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strcpy();
-#endif /* STDC_HEADERS */
-
-#ifdef __STDC__
-# include <stdarg.h>
-# define VA_START va_start (ap, str)
-#else
-# include <varargs.h>
-# define VA_START va_start (ap)
-#endif
+#include <string.h>
+#include <stdarg.h>
#include "manconfig.h"
/* append strings to first argument, which is realloced to the correct size
first arg may be NULL */
-#ifdef __STDC__
char *appendstr (char *str, ...)
-#else
-char *appendstr (str, va_alist)
- char *str;
- va_dcl
-#endif
{
va_list ap;
int len, newlen;
@@ -56,7 +35,7 @@ char *appendstr (str, va_alist)
len = str ? strlen (str) : 0;
- VA_START;
+ va_start (ap, str);
newlen = len + 1;
while ((next = va_arg (ap, char *)))
newlen += strlen (next);
@@ -65,7 +44,7 @@ char *appendstr (str, va_alist)
str = xrealloc (str, newlen);
end = str + len;
- VA_START;
+ va_start (ap, str);
while ((next = va_arg (ap, char *))) {
strcpy (end, next);
end += strlen (next);
diff --git a/lib/basename.c b/lib/basename.c
index e86a6e0d..ff6001ba 100644
--- a/lib/basename.c
+++ b/lib/basename.c
@@ -27,15 +27,7 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
-#if defined(STDC_HEADERS)
-# include <string.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strrchr();
-#endif /* STDC_HEADERS */
+#include <string.h>
/* return basename of given filename */
char *basename(char *filename)
diff --git a/lib/decompress.c b/lib/decompress.c
index 5b3c11c8..38a83c4b 100644
--- a/lib/decompress.c
+++ b/lib/decompress.c
@@ -24,16 +24,8 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-#endif /* STDC_HEADERS */
-
+#include <string.h>
+#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/lib/hashtable.c b/lib/hashtable.c
index 43f256df..5935ed10 100644
--- a/lib/hashtable.c
+++ b/lib/hashtable.c
@@ -34,16 +34,8 @@
#endif /* HAVE_CONFIG_H */
#include <stdio.h> /* only for printf() */
-
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-#endif /* STDC_HEADERS */
+#include <string.h>
+#include <stdlib.h>
#include "manconfig.h"
#include "hashtable.h"
diff --git a/lib/pathsearch.c b/lib/pathsearch.c
index 4e366485..adebe952 100644
--- a/lib/pathsearch.c
+++ b/lib/pathsearch.c
@@ -24,14 +24,8 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#endif /* STDC_HEADERS */
+#include <string.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/lib/tempfile.c b/lib/tempfile.c
index 3d6daa3c..dd97646d 100644
--- a/lib/tempfile.c
+++ b/lib/tempfile.c
@@ -26,9 +26,7 @@
#include <stdio.h>
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#endif /* STDC_HEADERS */
+#include <stdlib.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
diff --git a/libdb/db_btree.c b/libdb/db_btree.c
index bcc1ecc2..65bb54c1 100644
--- a/libdb/db_btree.c
+++ b/libdb/db_btree.c
@@ -30,12 +30,7 @@
#include <stdio.h>
#include <errno.h>
-
-#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#include <string.h>
-#elif defined(HAVE_STRINGS_H)
-#include <strings.h>
-#endif /* STDC_HEADERS */
#if HAVE_SYS_FILE_H
# include <sys/file.h> /* for flock() */
diff --git a/libdb/db_delete.c b/libdb/db_delete.c
index 240c9509..0732b04d 100644
--- a/libdb/db_delete.c
+++ b/libdb/db_delete.c
@@ -27,27 +27,13 @@
#include <stdio.h>
#include <assert.h>
-
-#if defined(STDC_HEADERS)
#include <string.h>
#include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-#include <string.h>
-#elif defined(HAVE_STRINGS_H)
-#include <strings.h>
-#else /* no string(s) header file */
-extern char *strsep();
-#endif /* STDC_HEADERS */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifndef STDC_HEADERS
-extern long atol();
-extern char *strsep();
-#endif /* not STDC_HEADERS */
-
#include "gettext.h"
#define _(String) gettext (String)
diff --git a/libdb/db_gdbm.c b/libdb/db_gdbm.c
index c060d5b5..1f78c0e2 100644
--- a/libdb/db_gdbm.c
+++ b/libdb/db_gdbm.c
@@ -26,14 +26,8 @@
#ifdef GDBM
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#endif /* STDC_HEADERS */
+#include <string.h>
+#include <stdlib.h>
#include "manconfig.h"
diff --git a/libdb/db_lookup.c b/libdb/db_lookup.c
index ddc59302..e02a021d 100644
--- a/libdb/db_lookup.c
+++ b/libdb/db_lookup.c
@@ -29,28 +29,13 @@
#include <assert.h>
#include <errno.h>
#include <ctype.h>
-
-#if defined(STDC_HEADERS)
#include <string.h>
#include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-#include <string.h>
-#elif defined(HAVE_STRINGS_H)
-#include <strings.h>
-#else /* no string(s) header file */
-extern char *strsep();
-#endif /* STDC_HEADERS */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifndef STDC_HEADERS
-extern long atol();
-extern char *strsep();
-extern int errno;
-#endif /* not STDC_HEADERS */
-
#include "gettext.h"
#define _(String) gettext (String)
diff --git a/libdb/db_ndbm.c b/libdb/db_ndbm.c
index d293f132..a3591077 100644
--- a/libdb/db_ndbm.c
+++ b/libdb/db_ndbm.c
@@ -26,6 +26,7 @@
#ifdef NDBM
+#include <stdlib.h>
#include <stdio.h>
#if HAVE_SYS_FILE_H
@@ -39,10 +40,6 @@
# include <fcntl.h>
#endif
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif /* STDC_HEADERS */
-
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
diff --git a/libdb/db_store.c b/libdb/db_store.c
index dc82e320..4c91bbb5 100644
--- a/libdb/db_store.c
+++ b/libdb/db_store.c
@@ -27,27 +27,13 @@
#include <stdio.h>
#include <assert.h>
-
-#if defined(STDC_HEADERS)
#include <string.h>
#include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-#include <string.h>
-#elif defined(HAVE_STRINGS_H)
-#include <strings.h>
-#else /* no string(s) header file */
-extern char *strsep();
-#endif /* STDC_HEADERS */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifndef STDC_HEADERS
-extern long atol();
-extern char *strsep();
-#endif /* not STDC_HEADERS */
-
#include "gettext.h"
#define _(String) gettext (String)
diff --git a/libdb/db_ver.c b/libdb/db_ver.c
index d106738a..85a135f9 100644
--- a/libdb/db_ver.c
+++ b/libdb/db_ver.c
@@ -26,15 +26,8 @@
#endif
#include <stdio.h>
-
-#if defined(STDC_HEADERS)
#include <string.h>
#include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-#include <string.h>
-#elif defined(HAVE_STRINGS_H)
-#include <strings.h>
-#endif /* STDC_HEADERS */
#include "gettext.h"
#define _(String) gettext (String)
diff --git a/src/accessdb.c b/src/accessdb.c
index e05093ad..2e1b5215 100644
--- a/src/accessdb.c
+++ b/src/accessdb.c
@@ -29,21 +29,8 @@
#include <stdio.h>
#include <errno.h>
-
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
-
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strchr();
-#endif /* STDC_HEADERS */
+#include <string.h>
+#include <stdlib.h>
#ifdef HAVE_LIBGEN_H
# include <libgen.h>
diff --git a/src/catman.c b/src/catman.c
index ac4d9882..0d615222 100644
--- a/src/catman.c
+++ b/src/catman.c
@@ -33,26 +33,13 @@
#include <assert.h>
#include <sys/types.h>
#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
#if HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif /* HAVE_SYS_WAIT_H */
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-#endif /* STDC_HEADERS */
-
-#ifndef STDC_HEADERS
-extern char *getenv();
-extern int errno;
-#endif
-
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
diff --git a/src/check_mandirs.c b/src/check_mandirs.c
index 5625a638..1e7ede65 100644
--- a/src/check_mandirs.c
+++ b/src/check_mandirs.c
@@ -30,6 +30,8 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
+#include <string.h>
+#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -56,22 +58,6 @@
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strchr(), *strrchr(), *strstr(), *strpbrk();
-#endif /* no string(s) header */
-
-#ifndef STDC_HEADERS
-extern time_t time();
-extern int errno;
-#endif
-
#ifdef HAVE_LIBGEN_H
# include <libgen.h>
#endif /* HAVE_LIBGEN_H */
diff --git a/src/compression.c b/src/compression.c
index a258166f..f64df2c8 100644
--- a/src/compression.c
+++ b/src/compression.c
@@ -30,20 +30,8 @@
#include <stdio.h>
#include <errno.h>
#include <signal.h>
-
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-#endif /* STDC_HEADERS */
-
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
+#include <string.h>
+#include <stdlib.h>
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
diff --git a/src/convert_name.c b/src/convert_name.c
index 786c994c..2df52866 100644
--- a/src/convert_name.c
+++ b/src/convert_name.c
@@ -28,22 +28,14 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-#endif /* STDC_HEADERS */
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#include <stdio.h>
-
#include "gettext.h"
#define _(String) gettext (String)
diff --git a/src/descriptions.c b/src/descriptions.c
index 46783e78..b66e1393 100644
--- a/src/descriptions.c
+++ b/src/descriptions.c
@@ -25,17 +25,8 @@
#endif /* HAVE_CONFIG_H */
#include <stdio.h>
-
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strchr();
-#endif /* no string(s) header */
+#include <string.h>
+#include <stdlib.h>
#include "manconfig.h"
#include "descriptions.h"
diff --git a/src/descriptions_store.c b/src/descriptions_store.c
index bdc2beac..1459150e 100644
--- a/src/descriptions_store.c
+++ b/src/descriptions_store.c
@@ -25,17 +25,8 @@
#endif /* HAVE_CONFIG_H */
#include <stdio.h>
-
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strchr();
-#endif /* no string(s) header */
+#include <string.h>
+#include <stdlib.h>
#include "gettext.h"
#define _(String) gettext (String)
diff --git a/src/encodings.c b/src/encodings.c
index 9d982bf6..ac4118cd 100644
--- a/src/encodings.c
+++ b/src/encodings.c
@@ -24,14 +24,8 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#endif /* STDC_HEADERS */
+#include <string.h>
+#include <stdlib.h>
#include "gettext.h"
#include <locale.h>
diff --git a/src/fake_security.c b/src/fake_security.c
index bbf0021d..80ef15ab 100644
--- a/src/fake_security.c
+++ b/src/fake_security.c
@@ -30,10 +30,6 @@
#include <stdio.h>
#include <errno.h>
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
-
#include <sys/types.h>
#include "gettext.h"
diff --git a/src/filenames.c b/src/filenames.c
index ec1995cf..7e52a24e 100644
--- a/src/filenames.c
+++ b/src/filenames.c
@@ -26,17 +26,8 @@
#endif /* HAVE_CONFIG_H */
#include <stdio.h>
-
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strrchr();
-#endif /* no string(s) header */
+#include <string.h>
+#include <stdlib.h>
#ifdef HAVE_LIBGEN_H
# include <libgen.h>
diff --git a/src/globbing.c b/src/globbing.c
index 344a0c4f..968217e2 100644
--- a/src/globbing.c
+++ b/src/globbing.c
@@ -27,22 +27,11 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strrchr();
-#endif /* STDC_HEADERS */
-
+#include <string.h>
+#include <stdlib.h>
#include <ctype.h>
-
#include <glob.h>
#include <fnmatch.h>
-
#include <sys/types.h>
#include <dirent.h>
diff --git a/src/globbing_test.c b/src/globbing_test.c
index b3de6294..e64d45ea 100644
--- a/src/globbing_test.c
+++ b/src/globbing_test.c
@@ -26,10 +26,7 @@
#endif /* HAVE_CONFIG_H */
#include <stdio.h>
-
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#endif /* STDC_HEADERS */
+#include <stdlib.h>
#include "gettext.h"
#define _(String) gettext (String)
diff --git a/src/lexgrog.l b/src/lexgrog.l
index ac0d3b3e..501b13a4 100644
--- a/src/lexgrog.l
+++ b/src/lexgrog.l
@@ -36,21 +36,12 @@
#include <sys/stat.h>
#include <errno.h>
-
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
+#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_STRING_H
-# include <string.h>
-#elif defined (HAVE_STRINGS_H)
-# include <strings.h>
-#endif /* HAVE_STRING_H */
-
#include "gettext.h"
#define _(String) gettext (String)
diff --git a/src/lexgrog.l-2.3.8 b/src/lexgrog.l-2.3.8
index ee7df99f..3b4168d4 100644
--- a/src/lexgrog.l-2.3.8
+++ b/src/lexgrog.l-2.3.8
@@ -29,21 +29,12 @@
#endif /* HAVE_CONFIG_H */
#include <errno.h>
-
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
+#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_STRING_H
-# include <string.h>
-#elif defined (HAVE_STRINGS_H)
-# include <strings.h>
-#endif /* HAVE_STRING_H */
-
#include "manconfig.h"
#include "error.h"
diff --git a/src/lexgrog.l-2.4a b/src/lexgrog.l-2.4a
index daaca70b..96c3ae4f 100644
--- a/src/lexgrog.l-2.4a
+++ b/src/lexgrog.l-2.4a
@@ -31,21 +31,12 @@
#endif /* HAVE_CONFIG_H */
#include <errno.h>
-
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
+#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_STRING_H
-# include <string.h>
-#elif defined (HAVE_STRINGS_H)
-# include <strings.h>
-#endif /* HAVE_STRING_H */
-
#include "manconfig.h"
#include "error.h"
diff --git a/src/lexgrog.l.new b/src/lexgrog.l.new
index dcf99373..1ca83751 100644
--- a/src/lexgrog.l.new
+++ b/src/lexgrog.l.new
@@ -31,21 +31,12 @@
#endif /* HAVE_CONFIG_H */
#include <errno.h>
-
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
+#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_STRING_H
-# include <string.h>
-#elif defined (HAVE_STRINGS_H)
-# include <strings.h>
-#endif /* HAVE_STRING_H */
-
#include "gettext.h"
#define _(String) gettext (String)
diff --git a/src/lexgrog_test.c b/src/lexgrog_test.c
index 830cbd83..225ecfaf 100644
--- a/src/lexgrog_test.c
+++ b/src/lexgrog_test.c
@@ -26,18 +26,11 @@
#endif /* HAVE_CONFIG_H */
#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
#include <sys/stat.h>
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#endif /* STDC_HEADERS */
-
#ifdef HAVE_LIBGEN_H
# include <libgen.h>
#endif /* HAVE_LIBGEN_H */
diff --git a/src/man.c b/src/man.c
index d9557698..10d7d000 100644
--- a/src/man.c
+++ b/src/man.c
@@ -39,22 +39,13 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
+#include <string.h>
+#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <errno.h>
#include <termios.h>
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strchr(), *strcat();
-#endif /* STDC_HEADERS */
-
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
#else
@@ -103,11 +94,6 @@ static char *cwd;
# include <sys/wait.h>
#endif
-#ifndef STDC_HEADERS
-extern char *getenv();
-extern int errno;
-#endif
-
#ifdef HAVE_LIBGEN_H
# include <libgen.h>
#endif /* HAVE_LIBGEN_H */
diff --git a/src/manconv.c b/src/manconv.c
index f1a0bb5c..2a929ed2 100644
--- a/src/manconv.c
+++ b/src/manconv.c
@@ -35,15 +35,8 @@
#include <stdio.h>
#include <errno.h>
-
-#if defined(STDC_HEADERS)
-# include <stdlib.h>
-# include <string.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#endif
+#include <stdlib.h>
+#include <string.h>
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
diff --git a/src/mandb.c b/src/mandb.c
index 57893623..d5fa7470 100644
--- a/src/mandb.c
+++ b/src/mandb.c
@@ -29,6 +29,8 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
+#include <string.h>
+#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <errno.h>
@@ -36,20 +38,6 @@
#include <sys/stat.h> /* for chmod() */
#include <dirent.h>
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-#endif /* STDC_HEADERS */
-
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
-
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
#else
diff --git a/src/manp.c b/src/manp.c
index 008ff595..bcb366e5 100644
--- a/src/manp.c
+++ b/src/manp.c
@@ -54,28 +54,13 @@
#include <errno.h>
#include <dirent.h>
-#if defined(STDC_HEADERS)
-# include <stdlib.h>
-# include <string.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strtok();
-extern char *strchr();
-extern char *strstr();
-#endif
+#include <stdlib.h>
+#include <string.h>
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#ifndef STDC_HEADERS
-extern char *getenv();
-extern int errno;
-#endif
-
#include <xgetcwd.h>
#include "gettext.h"
diff --git a/src/manpath.c b/src/manpath.c
index 1d1bbf25..7d6619ad 100644
--- a/src/manpath.c
+++ b/src/manpath.c
@@ -27,20 +27,13 @@
#include "config.h"
#endif /* HAVE_CONFIG_H */
+#include <string.h>
+#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <errno.h>
#include <termios.h>
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#endif /* STDC_HEADERS */
-
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
diff --git a/src/security.c b/src/security.c
index 9d39abef..a4821d98 100644
--- a/src/security.c
+++ b/src/security.c
@@ -27,23 +27,12 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
+#include <string.h>
+#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <errno.h>
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
-
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#endif /* STDC_HEADERS */
-
#include <sys/types.h>
#if HAVE_SYS_WAIT_H
diff --git a/src/straycats.c b/src/straycats.c
index 39839c13..62035740 100644
--- a/src/straycats.c
+++ b/src/straycats.c
@@ -27,25 +27,12 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
+#include <string.h>
+#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <errno.h>
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
-
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strrchr();
-#endif /* STDC_HEADERS */
-
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/src/ult_src.c b/src/ult_src.c
index eef8ebac..535b4d24 100644
--- a/src/ult_src.c
+++ b/src/ult_src.c
@@ -31,6 +31,8 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
+#include <string.h>
+#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
@@ -38,10 +40,6 @@
#include <errno.h>
#include <assert.h>
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
-
#ifndef S_ISLNK /* losing sys/stat.h */
# if defined(S_IFMT) && defined(S_IFLNK)
# define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
@@ -63,17 +61,6 @@ extern int errno;
# endif /* HAVE_NDIR_H */
#endif /* HAVE_DIRENT_H */
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strrchr();
-#endif /* no string(s) header */
-
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
diff --git a/src/util.c b/src/util.c
index 1ff94f9b..cfb4f171 100644
--- a/src/util.c
+++ b/src/util.c
@@ -35,21 +35,10 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
+#include <string.h>
+#include <stdlib.h>
#include <stdio.h>
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strrchr();
-extern char *strcat();
-extern char *strcpy();
-#endif /* STDC_HEADERS */
-
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
diff --git a/src/version.c b/src/version.c
index f75ce800..35d9799c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -27,9 +27,7 @@
#endif /* HAVE_CONFIG_H */
#include <stdio.h>
-#ifdef STDC_HEADERS
#include <stdlib.h>
-#endif
#include "gettext.h"
#define _(String) gettext (String)
diff --git a/src/whatis.c b/src/whatis.c
index 97715dc0..182de3ac 100644
--- a/src/whatis.c
+++ b/src/whatis.c
@@ -33,29 +33,16 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
+#include <stdlib.h>
+#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
-
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#if defined(STDC_HEADERS)
-# include <stdlib.h>
-# include <string.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else
-extern char *strrchr();
-#endif /* no string(s) header */
-
#include "gettext.h"
#include <locale.h>
#define _(String) gettext (String)
diff --git a/src/zsoelim.l b/src/zsoelim.l
index 3ee3ce62..2f6eacd5 100644
--- a/src/zsoelim.l
+++ b/src/zsoelim.l
@@ -40,17 +40,8 @@
# include "config.h"
#endif /* HAVE_CONFIG_H */
-#if defined(STDC_HEADERS)
-# include <string.h>
-# include <stdlib.h>
-#elif defined(HAVE_STRING_H)
-# include <string.h>
-#elif defined(HAVE_STRINGS_H)
-# include <strings.h>
-#else /* no string(s) header */
-extern char *strchr(), *strcat();
-extern int strncmp();
-#endif /* STDC_HEADERS */
+#include <string.h>
+#include <stdlib.h>
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
@@ -61,10 +52,6 @@ extern int strncmp();
#include <fcntl.h>
#include <errno.h>
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
-
#ifdef HAVE_LIBGEN_H
# include <libgen.h>
#endif /* HAVE_LIBGEN_H */