diff --git a/ChangeLog b/ChangeLog index 175eead12ef042b22c5546c514dccd7695ba2d99..8603f64315bcd7a7b0a3ee019ba88d2ec8402838 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ CVS code - - General: - Miscellaneous comment fixes. (DLR) + - Various #include fixes. Since proto.h includes nano.h, only + include the former in source files. Also add an #include + guard to proto.h, and make the config.h #include in nano.h + match the config.h #includes everywhere else. (DLR) - files.c: get_next_filename() - Use a long instead of an int for the number prepended to the diff --git a/src/chars.c b/src/chars.c index 7f6c8b7e2ae6d0ad82fa41e40c99677c0b1e44ac..9716951eb89eefb93769797ead68f9d7700fa274 100644 --- a/src/chars.c +++ b/src/chars.c @@ -28,7 +28,6 @@ #include <ctype.h> #include <assert.h> #include "proto.h" -#include "nano.h" #ifdef NANO_WIDE #ifdef HAVE_WCHAR_H diff --git a/src/color.c b/src/color.c index 4eed7d6723fe01439f59484dd70ae1156edd4418..c877510d04d64ca55c18fa1aa421a359f908ee5a 100644 --- a/src/color.c +++ b/src/color.c @@ -29,7 +29,6 @@ #include <errno.h> #include <fcntl.h> #include "proto.h" -#include "nano.h" #ifdef ENABLE_COLOR diff --git a/src/cut.c b/src/cut.c index 6200a88daf593b0be9d2fc5898327f45bff5a3cd..05d87aaf60279e09398e08b875fbd425c9bb0de4 100644 --- a/src/cut.c +++ b/src/cut.c @@ -28,7 +28,6 @@ #include <stdio.h> #include <assert.h> #include "proto.h" -#include "nano.h" static bool keep_cutbuffer = FALSE; /* Should we keep the contents of the cutbuffer? */ diff --git a/src/files.c b/src/files.c index 5fdec47192bf07e166fc6e1452cb5725ab0619ea..15181b0ff50e7a42e9452ced7bdc4221f9d25427 100644 --- a/src/files.c +++ b/src/files.c @@ -35,7 +35,6 @@ #include <pwd.h> #include <assert.h> #include "proto.h" -#include "nano.h" static file_format fmt = NIX_FILE; /* The format of the current file. */ diff --git a/src/global.c b/src/global.c index b55703c4608127e3620fba744f69819e33b7d922..107ea44c869962799c1d98d63c79a1ab5b6afaa3 100644 --- a/src/global.c +++ b/src/global.c @@ -26,7 +26,6 @@ #include <stdlib.h> #include <assert.h> #include "proto.h" -#include "nano.h" /* Global variables */ diff --git a/src/move.c b/src/move.c index 221d80d48c8e99e4af782c665b203e1d97b6d385..a74d3a120958008214d8c80c8ab3a2d2d378f912 100644 --- a/src/move.c +++ b/src/move.c @@ -28,7 +28,6 @@ #include <ctype.h> #include <assert.h> #include "proto.h" -#include "nano.h" void do_first_line(void) { diff --git a/src/nano.c b/src/nano.c index cae70cd90c4f5325659963a5825c33867a90e91a..6662534129b69f6f2bb9499b975081e322d5ca32 100644 --- a/src/nano.c +++ b/src/nano.c @@ -38,7 +38,6 @@ #include <locale.h> #include <assert.h> #include "proto.h" -#include "nano.h" #ifdef HAVE_TERMIOS_H #include <termios.h> diff --git a/src/nano.h b/src/nano.h index 5fc3d616fda7c522d6f2082ee588b7784cd2258d..6b7b3221f37c531071fd1433adcefd1c54ff9ab0 100644 --- a/src/nano.h +++ b/src/nano.h @@ -22,8 +22,12 @@ #ifndef NANO_H #define NANO_H 1 +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #ifdef __TANDEM -/* Tandem NonStop Kernel */ +/* Tandem NonStop Kernel. */ #include <floss.h> #define NANO_ROOT_UID 65535 #else @@ -88,7 +92,6 @@ #include <stddef.h> #include <sys/types.h> #include <sys/stat.h> -#include "config.h" /* If no snprintf() or vsnprintf(), use the versions from glib. */ #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) diff --git a/src/proto.h b/src/proto.h index 8a049e374009c3a9fbe8030b5fc223dbd8477ad1..2b4654a736e7f35e6f100d565983638b7875598f 100644 --- a/src/proto.h +++ b/src/proto.h @@ -19,6 +19,9 @@ * * **************************************************************************/ +#ifndef PROTO_H +#define PROTO_H 1 + /* Externs. */ #include <sys/types.h> @@ -696,3 +699,5 @@ void dump_buffer_reverse(void); #ifdef NANO_EXTRA void do_credits(void); #endif + +#endif /* !PROTO_H */ diff --git a/src/rcfile.c b/src/rcfile.c index 9d0be640510e00512066e3ab0c60c1e91c43c1a7..8a832bbde90970a7116cdfe44c44f69e2a614d67 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -32,7 +32,6 @@ #include <ctype.h> #include <assert.h> #include "proto.h" -#include "nano.h" #ifdef ENABLE_NANORC diff --git a/src/search.c b/src/search.c index d904aaf3a6dbf3f978b3d9ba978e5051f333f959..696e23498434968edd58d0b471e1b647c62098cc 100644 --- a/src/search.c +++ b/src/search.c @@ -31,7 +31,6 @@ #include <errno.h> #include <assert.h> #include "proto.h" -#include "nano.h" static bool search_last_line = FALSE; /* Have we gone past the last line while searching? */ diff --git a/src/utils.c b/src/utils.c index 76437d72e7ef5415d654acf380fbb1bf26b181d8..450dd78ab9300c84b621a6b4227e6facb6b200cd 100644 --- a/src/utils.c +++ b/src/utils.c @@ -32,7 +32,6 @@ #include <errno.h> #include <assert.h> #include "proto.h" -#include "nano.h" #ifdef HAVE_REGEX_H #ifdef BROKEN_REGEXEC diff --git a/src/winio.c b/src/winio.c index 3befda1be5539c845bdf781e750a58d623db961b..09f2c17065bef189f6f8da466a5e5bd070aab6f2 100644 --- a/src/winio.c +++ b/src/winio.c @@ -30,7 +30,6 @@ #include <ctype.h> #include <assert.h> #include "proto.h" -#include "nano.h" static int *key_buffer = NULL; /* The default keystroke buffer,