Project Info Name.......: gnu-hello
Description: GNU Hello


gnu-hello       
Info
Commit...:35d9b5fb76e0c0eaa57660c57dc412376589b85e
Author...:karl <>
Committer:karl <>
Date.....:Sat Jul 15 23:26:01 2006 +0000
Parents..:bf96fdb2ca2778a0fb8964ad5c65b1263c27b12e

Message
[project @ 2006-07-15 23:26:01 by karl]
simplify includes

Changes
diff --git a/src/ChangeLog b/src/ChangeLog
line changes: +5/-0
index bcd8bb8..fd249e6
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
 2006-07-15  Karl Berry  <karl@gnu.org>
 
+	* hello.c: remove most of the includes, no longer needed.
+	* system.h: move system includes to here.
+	* version.c: remove, just use the VERSION autotool variable.
+	* Makefile.am (hello_SOURCES): remove version.c
+
 	* hello.c (main): update copyright to 2006.
 
 2006-05-03  Karl Berry  <karl@gnu.org>

diff --git a/src/Makefile.am b/src/Makefile.am
line changes: +1/-1
index 07374e0..52833e0
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,7 +18,7 @@
 ## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 bin_PROGRAMS = hello
-hello_SOURCES = hello.c version.c system.h 
+hello_SOURCES = hello.c system.h 
 
 hello_LDADD = @LIBINTL@ ../gnulib/lib/libgnulib.a
 

diff --git a/src/hello.c b/src/hello.c
line changes: +1/-45
index 20233a4..fc4d11d
--- a/src/hello.c
+++ b/src/hello.c
@@ -16,49 +16,7 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
-#include <stdio.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <pwd.h>
-#include <errno.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifndef errno
-extern int errno;
-#endif
-
-#ifdef	STDC_HEADERS
-#include <stdlib.h>
-#else	/* Not STDC_HEADERS */
-extern void exit ();
-extern char *malloc ();
-#endif	/* STDC_HEADERS */
-
-#ifdef	HAVE_STRING_H
-#include <string.h>
-#else
-#include <strings.h>
-#endif
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#ifdef HAVE_SYS_FILE_H
-#include <sys/file.h>
-#endif
-
-#ifdef HAVE_SYS_PARAM_H
-/* To possibly get the definition of DEV_BSIZE. */
-#include <sys/param.h>
-#endif
 #include "system.h"
 
 struct option longopts[] =
@@ -71,8 +29,6 @@ struct option longopts[] =
   { NULL, 0, NULL, 0 }
 };
 
-extern char version[];
-
 static char *progname;
 
 int
@@ -177,7 +133,7 @@ Report bugs to <%s>.\n"), PACKAGE_BUGREPORT);
   if (v)
     {
       /* Print version number.  */
-      printf ("hello - GNU %s %s\n", PACKAGE, version);
+      printf ("hello (GNU %s) %s\n", PACKAGE, VERSION);
       /* xgettext: no-wrap */
       puts ("");
       printf (_("\

diff --git a/src/system.h b/src/system.h
line changes: +7/-27
index 8395ce2..b706a0a
--- a/src/system.h
+++ b/src/system.h
@@ -1,5 +1,5 @@
 /* system.h: system-dependent declarations; include this first.
-   Copyright (C) 1996, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1996, 2005, 2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -17,36 +17,16 @@
 
 #ifndef HELLO_SYSTEM_H
 
+/* Assume ANSI C89 headers are available.  */
+#include <getopt.h>
 #include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
 #include "gettext.h"
 #define _(str) gettext (str)
 #define N_(str) gettext_noop (str)
 
-#include <getopt.h>
-
-/* Include sys/types.h before this file.  */
-
-/* Get or fake the disk device blocksize.
-   Usually defined by sys/param.h (if at all).  */
-#if !defined(DEV_BSIZE) && defined(BSIZE)
-#define DEV_BSIZE BSIZE
-#endif
-#if !defined(DEV_BSIZE) && defined(BBSIZE) /* SGI */
-#define DEV_BSIZE BBSIZE
-#endif
-#ifndef DEV_BSIZE
-#define DEV_BSIZE 4096
-#endif
-
-/* Extract or fake data from a `struct stat'.
-   ST_BLKSIZE: Optimal I/O blocksize for the file, in bytes. */
-#ifndef HAVE_ST_BLKSIZE
-# define ST_BLKSIZE(statbuf) DEV_BSIZE
-#else /* HAVE_ST_BLKSIZE */
-/* Some systems, like Sequents, return st_blksize of 0 on pipes. */
-# define ST_BLKSIZE(statbuf) ((statbuf).st_blksize > 0 \
-                              ? (statbuf).st_blksize : DEV_BSIZE)
-#endif /* HAVE_ST_BLKSIZE */
-
 #endif /* HELLO_SYSTEM_H */

diff --git a/src/version.c b/src/version.c
line changes: +0/-8
index 171c091..0000000
--- a/src/version.c
+++ /dev/null
@@ -1,8 +0,0 @@
-/* version.c
-   Copyright (C) 1995 Free Software Foundation, Inc. */
-
-#include "config.h"
-
-char version[] = VERSION;
-
-/* eof version.c */

This website is licensed under AGPL-3.0. Feel free to copy!