summaryrefslogtreecommitdiff
path: root/sed
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2012-03-16 09:04:34 +0100
committerPaolo Bonzini <bonzini@gnu.org>2012-03-16 09:43:01 +0100
commit9ea38da9fbeda4ca2d8cdc4bc5ede2202d3ff34e (patch)
treea160a0934373241bfa7da3a77d4707862ec9a3ed /sed
parent944747af30e067b3431cca1ef306e375ba1f4c34 (diff)
downloadsed-9ea38da9fbeda4ca2d8cdc4bc5ede2202d3ff34e.tar.gz
clean up header inclusions
2012-03-16 Paolo Bonzini <bonzini@gnu.org> * basicdefs.h: Enjoy gnulib's headers. * sed/compile.c: Likewise. * sed/execute.c: Likewise. * sed/regexp.c: Likewise. * sed/sed.c: Likewise. * sed/sed.h: Likewise. * sed/utils.c: Likewise.
Diffstat (limited to 'sed')
-rw-r--r--sed/compile.c24
-rw-r--r--sed/execute.c42
-rw-r--r--sed/regexp.c4
-rw-r--r--sed/sed.c38
-rw-r--r--sed/sed.h3
-rw-r--r--sed/utils.c16
6 files changed, 17 insertions, 110 deletions
diff --git a/sed/compile.c b/sed/compile.c
index d71e67d..cf3b32b 100644
--- a/sed/compile.c
+++ b/sed/compile.c
@@ -21,27 +21,9 @@
#include "sed.h"
#include <stdio.h>
#include <ctype.h>
-
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-# ifdef HAVE_MEMORY_H
-# include <memory.h>
-# endif
-#else
-# include <string.h>
-#endif /* HAVE_STRINGS_H */
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
#include <obstack.h>
diff --git a/sed/execute.c b/sed/execute.c
index 3432602..8d0f5e1 100644
--- a/sed/execute.c
+++ b/sed/execute.c
@@ -25,20 +25,18 @@
#include <stddef.h>
#include <stdio.h>
#include <ctype.h>
-
+#include <unistd.h>
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include "stat-macros.h"
#include <selinux/selinux.h>
#include <selinux/context.h>
#include "acl.h"
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
#ifdef __GNUC__
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__-0 >= 7)
/* silence warning about unused parameter even for "gcc -W -Wunused" */
@@ -49,34 +47,6 @@ extern int errno;
# define UNUSED
#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#else
-# include <string.h>
-#endif /*HAVE_STRINGS_H*/
-#ifdef HAVE_MEMORY_H
-# include <memory.h>
-#endif
-
-#ifndef HAVE_STRCHR
-# define strchr index
-# define strrchr rindex
-#endif
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#include <sys/stat.h>
-#include "stat-macros.h"
-
/* Sed operates a line at a time. */
struct line {
diff --git a/sed/regexp.c b/sed/regexp.c
index 39914de..74cee00 100644
--- a/sed/regexp.c
+++ b/sed/regexp.c
@@ -21,9 +21,7 @@
#include <ctype.h>
#include <string.h>
#include <stdio.h>
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
#ifdef gettext_noop
# define N_(String) gettext_noop(String)
diff --git a/sed/sed.c b/sed/sed.c
index e0d5771..a01ab42 100644
--- a/sed/sed.c
+++ b/sed/sed.c
@@ -21,41 +21,13 @@
#include <stdio.h>
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#else
-# include <string.h>
-#endif /*HAVE_STRINGS_H*/
-#ifdef HAVE_MEMORY_H
-# include <memory.h>
-#endif
-
-#ifndef HAVE_STRCHR
-# define strchr index
-# define strrchr rindex
-#endif
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
#include "getopt.h"
#include "version-etc.h"
-#ifndef HAVE_STDLIB_H
- extern char *getenv P_((const char *));
-#endif
-
-#ifndef HAVE_STRTOUL
-# define ATOI(x) atoi(x)
-#else
-# define ATOI(x) strtoul(x, NULL, 0)
-#endif
-
#define AUTHORS \
_("Jay Fenlason"), \
_("Tom Lord"), \
@@ -246,7 +218,7 @@ main(argc, argv)
*/
if (cols)
{
- countT t = ATOI(cols);
+ countT t = atoi(cols);
if (t > 1)
lcmd_out_line_len = t-1;
}
@@ -293,7 +265,7 @@ main(argc, argv)
break;
case 'l':
- lcmd_out_line_len = ATOI(optarg);
+ lcmd_out_line_len = atoi(optarg);
break;
case 'p':
diff --git a/sed/sed.h b/sed/sed.h
index 29a9495..2cbf47e 100644
--- a/sed/sed.h
+++ b/sed/sed.h
@@ -16,10 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
-
#include "basicdefs.h"
#include "regex.h"
#include <stdio.h>
diff --git a/sed/utils.c b/sed/utils.c
index cb29b87..3db737b 100644
--- a/sed/utils.c
+++ b/sed/utils.c
@@ -21,20 +21,8 @@
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
-#ifndef errno
- extern int errno;
-#endif
-
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#else
-# include <string.h>
-#endif /* HAVE_STRINGS_H */
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif /* HAVE_STDLIB_H */
-
+#include <string.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>