[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[screen-devel] [PATCH 3/4] make all header files self-contained and incl
From: |
Simon Ruderich |
Subject: |
[screen-devel] [PATCH 3/4] make all header files self-contained and include it in the source file |
Date: |
Sun, 7 Feb 2016 16:35:00 +0100 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
Including the header in the source file guarantees matching signatures,
thus preventing subtle errors.
Self-contained headers document the required headers and makes using it
easier to use the header in new source files.
---
src/acls.c | 2 ++
src/acls.h | 4 ++++
src/ansi.c | 4 ++--
src/ansi.h | 2 ++
src/attacher.c | 2 ++
src/backtick.c | 1 +
src/canvas.c | 6 ++----
src/canvas.h | 3 +++
src/comm.c | 6 +-----
src/comm.sh | 7 +++++++
src/display.c | 2 ++
src/display.h | 3 +++
src/encoding.c | 4 ++--
src/encoding.h | 2 ++
src/fileio.c | 3 ++-
src/fileio.h | 2 ++
src/help.c | 2 ++
src/help.h | 3 +++
src/input.c | 4 +---
src/input.h | 2 ++
src/layer.c | 6 ++----
src/layer.h | 3 +++
src/layout.c | 3 ++-
src/list_display.c | 3 ++-
src/list_generic.c | 9 +++------
src/list_generic.h | 4 ++++
src/list_window.c | 3 ++-
src/logfile.c | 3 ++-
src/logfile.h | 2 ++
src/mark.c | 3 ++-
src/mark.h | 2 ++
src/misc.c | 3 ++-
src/misc.h | 4 ++++
src/os.h | 3 +++
src/process.c | 3 ++-
src/pty.c | 2 ++
src/resize.c | 3 ++-
src/resize.h | 2 ++
src/sched.c | 3 ++-
src/sched.h | 1 +
src/screen.c | 7 +++----
src/screen.h | 17 +++++++++--------
src/search.c | 4 ++--
src/search.h | 2 ++
src/socket.c | 3 ++-
src/socket.h | 2 ++
src/telnet.c | 9 ++++-----
src/telnet.h | 2 ++
src/term.sh | 2 +-
src/termcap.c | 4 ++--
src/termcap.h | 2 ++
src/tty.c | 2 ++
src/tty.h | 2 ++
src/utmp.c | 5 ++---
src/utmp.h | 4 ++++
src/viewport.c | 5 +----
src/viewport.h | 2 ++
src/window.c | 6 ++----
src/window.h | 4 ++++
src/winmsg.c | 3 ++-
src/winmsg.h | 1 -
src/winmsgbuf.c | 3 ++-
src/winmsgcond.c | 4 +++-
src/winmsgcond.h | 1 -
64 files changed, 150 insertions(+), 75 deletions(-)
diff --git a/src/acls.c b/src/acls.c
index 90083df..b9c219e 100644
--- a/src/acls.c
+++ b/src/acls.c
@@ -26,6 +26,8 @@
****************************************************************
*/
+#include "acls.h"
+
#include "config.h"
#include <stdbool.h>
diff --git a/src/acls.h b/src/acls.h
index 9d148f4..e13fe43 100644
--- a/src/acls.h
+++ b/src/acls.h
@@ -29,6 +29,8 @@
#ifndef SCREEN_ACLS_H
#define SCREEN_ACLS_H
+#include "os.h"
+
/* three known bits: */
#define ACL_EXEC 0
#define ACL_WRITE 1
@@ -42,6 +44,8 @@
#define ACLBYTE(data, w) ((data)[(w) >> 3])
#define ACLBIT(w) (0x80 >> ((w) & 7))
+typedef struct Window Window;
+
typedef unsigned char * AclBits;
/*
diff --git a/src/ansi.c b/src/ansi.c
index f04bbc5..b68ebed 100644
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -26,10 +26,10 @@
****************************************************************
*/
+#include "ansi.h"
+
#include <sys/types.h>
#include <fcntl.h>
-#include <stdint.h>
-#include <stdbool.h>
#include <sys/ioctl.h>
#include "config.h"
diff --git a/src/ansi.h b/src/ansi.h
index 5ce68fb..54b4c28 100644
--- a/src/ansi.h
+++ b/src/ansi.h
@@ -30,7 +30,9 @@
#ifndef SCREEN_ANSI_H
#define SCREEN_ANSI_H
+#include <stdbool.h>
#include <stdint.h>
+#include <stdlib.h>
#define NATTR 6
diff --git a/src/attacher.c b/src/attacher.c
index 2abb388..93b88e5 100644
--- a/src/attacher.c
+++ b/src/attacher.c
@@ -26,6 +26,8 @@
****************************************************************
*/
+#include "attacher.h"
+
#include <fcntl.h>
#include <pwd.h>
#include <signal.h>
diff --git a/src/backtick.c b/src/backtick.c
index 1bff2f1..79b8e9d 100644
--- a/src/backtick.c
+++ b/src/backtick.c
@@ -32,6 +32,7 @@
*/
#include "backtick.h"
+
#include "fileio.h"
/* TODO: get rid of global var */
diff --git a/src/canvas.c b/src/canvas.c
index 0f280bc..d737fd5 100644
--- a/src/canvas.c
+++ b/src/canvas.c
@@ -26,13 +26,11 @@
****************************************************************
*/
-#include <stdint.h>
-#include <stdbool.h>
+#include "canvas.h"
#include "config.h"
-#include "screen.h"
-#include "canvas.h"
+#include "screen.h"
#include "help.h"
#include "list_generic.h"
#include "resize.h"
diff --git a/src/canvas.h b/src/canvas.h
index 124cead..686ddba 100644
--- a/src/canvas.h
+++ b/src/canvas.h
@@ -30,6 +30,9 @@
#ifndef SCREEN_CANVAS_H
#define SCREEN_CANVAS_H
+#include "layer.h"
+#include "sched.h"
+
#define SLICE_UNKN 0
#define SLICE_VERT (1 << 0)
#define SLICE_HORI (1 << 1)
diff --git a/src/comm.c b/src/comm.c
index fedc758..0744ff0 100644
--- a/src/comm.c
+++ b/src/comm.c
@@ -27,13 +27,9 @@
****************************************************************
*/
-#include <stdbool.h>
-#include <stdint.h>
+#include "comm.h"
#include "config.h"
-#include "os.h"
-
-#include "screen.h"
/* Must be in alpha order ! */
diff --git a/src/comm.sh b/src/comm.sh
index fca5e4f..5bae17f 100644
--- a/src/comm.sh
+++ b/src/comm.sh
@@ -19,6 +19,11 @@ cat << EOF > comm.h
* This file is automagically created from comm.c -- DO NOT EDIT
*/
+#ifndef SCREEN_COMM_H
+#define SCREEN_COMM_H
+
+#include "acls.h"
+
struct comm
{
char *name;
@@ -71,6 +76,8 @@ struct action
#define RC_ILLEGAL -1
+#endif /* SCREEN_COMM_H */
+
EOF
$AWK < ${srcdir}/comm.c >> comm.h '
/^ [{] ".*/ { if (old > $2) {
diff --git a/src/display.c b/src/display.c
index 4c371ec..3cd9623 100644
--- a/src/display.c
+++ b/src/display.c
@@ -26,6 +26,8 @@
****************************************************************
*/
+#include "display.h"
+
#include <sys/types.h>
#include <signal.h>
#include <fcntl.h>
diff --git a/src/display.h b/src/display.h
index 288a684..4b2e65f 100644
--- a/src/display.h
+++ b/src/display.h
@@ -33,6 +33,9 @@
#include "layout.h"
#include "canvas.h"
#include "viewport.h"
+#include "comm.h"
+#include "image.h"
+#include "screen.h"
#define KMAP_KEYS (T_OCAPS-T_CAPS)
#define KMAP_AKEYS (T_OCAPS-T_CURSOR)
diff --git a/src/encoding.c b/src/encoding.c
index 556fe72..0b3f2d6 100644
--- a/src/encoding.c
+++ b/src/encoding.c
@@ -21,13 +21,13 @@
****************************************************************
*/
+#include "encoding.h"
+
#include <sys/types.h>
#include <stdint.h>
-#include <stdbool.h>
#include "config.h"
#include "screen.h"
-#include "encoding.h"
#include "fileio.h"
static int encmatch(char *, char *);
diff --git a/src/encoding.h b/src/encoding.h
index ec284e4..76859cd 100644
--- a/src/encoding.h
+++ b/src/encoding.h
@@ -1,6 +1,8 @@
#ifndef SCREEN_ENCODING_H
#define SCREEN_ENCODING_H
+#include "window.h"
+
void InitBuiltinTabs (void);
struct mchar *recode_mchar (struct mchar *, int, int);
struct mline *recode_mline (struct mline *, int, int, int);
diff --git a/src/fileio.c b/src/fileio.c
index 6cd21ac..ba224d7 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -26,6 +26,8 @@
****************************************************************
*/
+#include "fileio.h"
+
#include <sys/types.h>
#include <fcntl.h>
#include <stdint.h>
@@ -38,7 +40,6 @@
#include "config.h"
#include "screen.h"
-#include "fileio.h"
#include "misc.h"
#include "process.h"
#include "termcap.h"
diff --git a/src/fileio.h b/src/fileio.h
index c69ee97..57bc666 100644
--- a/src/fileio.h
+++ b/src/fileio.h
@@ -1,6 +1,8 @@
#ifndef SCREEN_FILEIO_H
#define SCREEN_FILEIO_H
+#include "window.h"
+
int StartRc (char *, int);
void FinishRc (char *);
void RcLine (char *, int);
diff --git a/src/help.c b/src/help.c
index f82e422..e5cf1af 100644
--- a/src/help.c
+++ b/src/help.c
@@ -29,6 +29,8 @@
****************************************************************
*/
+#include "help.h"
+
#include <stdint.h>
#include <stdbool.h>
#include <sys/types.h>
diff --git a/src/help.h b/src/help.h
index fb47bbc..f3734c0 100644
--- a/src/help.h
+++ b/src/help.h
@@ -1,6 +1,9 @@
#ifndef SCREEN_HELP_H
#define SCREEN_HELP_H
+#include "comm.h"
+#include "canvas.h"
+
void exit_with_usage (char *, char *, char *);
void display_help (char *, struct action *);
void display_copyright (void);
diff --git a/src/input.c b/src/input.c
index b245c40..a636f2e 100644
--- a/src/input.c
+++ b/src/input.c
@@ -26,9 +26,7 @@
****************************************************************
*/
-#include <stdint.h>
-#include <stdbool.h>
-#include <sys/types.h>
+#include "input.h"
#include "config.h"
#include "screen.h"
diff --git a/src/input.h b/src/input.h
index c327206..bdb5bde 100644
--- a/src/input.h
+++ b/src/input.h
@@ -1,6 +1,8 @@
#ifndef SCREEN_INPUT_H
#define SCREEN_INPUT_H
+#include <stdlib.h>
+
void inp_setprompt (char *, char *);
void Input (char *, size_t, int, void (*)(char *, size_t, void *), char *,
int);
int InInput (void);
diff --git a/src/layer.c b/src/layer.c
index e7f843b..220c3bb 100644
--- a/src/layer.c
+++ b/src/layer.c
@@ -26,13 +26,11 @@
****************************************************************
*/
-#include <stdint.h>
-#include <stdbool.h>
-#include <sys/types.h>
+#include "layer.h"
#include "config.h"
-#include "screen.h"
+#include "screen.h"
#include "encoding.h"
#include "mark.h"
#include "tty.h"
diff --git a/src/layer.h b/src/layer.h
index a5595bf..2a9387d 100644
--- a/src/layer.h
+++ b/src/layer.h
@@ -30,6 +30,9 @@
#ifndef SCREEN_LAYER_H
#define SCREEN_LAYER_H
+#include <stdbool.h>
+#include <stdlib.h>
+
/*
* This is the overlay structure. It is used to create a seperate
* layer over the current windows.
diff --git a/src/layout.c b/src/layout.c
index 3ed2045..c879ecf 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -26,6 +26,8 @@
****************************************************************
*/
+#include "layout.h"
+
#include <stdbool.h>
#include <stdint.h>
@@ -33,7 +35,6 @@
#include "screen.h"
#include "fileio.h"
-#include "layout.h"
#include "misc.h"
#include "process.h"
#include "resize.h"
diff --git a/src/list_display.c b/src/list_display.c
index e33010f..c473475 100644
--- a/src/list_display.c
+++ b/src/list_display.c
@@ -31,13 +31,14 @@
/* Deals with the list of displays */
+#include "list_generic.h"
+
#include <stdbool.h>
#include <stdint.h>
#include "config.h"
#include "screen.h"
-#include "list_generic.h"
#include "misc.h"
static char ListID[] = "display";
diff --git a/src/list_generic.c b/src/list_generic.c
index 6413567..a727183 100644
--- a/src/list_generic.c
+++ b/src/list_generic.c
@@ -20,16 +20,13 @@
****************************************************************
*/
+#include "list_generic.h"
+
#include <stdbool.h>
#include <stdint.h>
-#include "config.h"
-#include "screen.h"
-
-#include "input.h"
-#include "layer.h"
-#include "list_generic.h"
#include "misc.h"
+#include "input.h"
/* Deals with a generic list display */
diff --git a/src/list_generic.h b/src/list_generic.h
index b62c7e4..8081cf6 100644
--- a/src/list_generic.h
+++ b/src/list_generic.h
@@ -23,6 +23,10 @@
#ifndef SCREEN_LIST_GENERIC_H
#define SCREEN_LIST_GENERIC_H
+#include <stdlib.h>
+
+#include "window.h"
+
typedef struct ListData ListData;
typedef struct ListRow ListRow;
typedef struct GenericList GenericList;
diff --git a/src/list_window.c b/src/list_window.c
index 542da33..8178763 100644
--- a/src/list_window.c
+++ b/src/list_window.c
@@ -27,6 +27,8 @@
* verify that the window does exist (by looking at wtab[]).
*/
+#include "list_generic.h"
+
#include <stdbool.h>
#include <stdint.h>
@@ -36,7 +38,6 @@
#include "input.h"
#include "layer.h"
-#include "list_generic.h"
#include "misc.h"
#include "process.h"
diff --git a/src/logfile.c b/src/logfile.c
index 6477bcf..fa24dbb 100644
--- a/src/logfile.c
+++ b/src/logfile.c
@@ -26,6 +26,8 @@
****************************************************************
*/
+#include "logfile.h"
+
#include <sys/types.h> /* dev_t, ino_t, off_t, ... */
#include <sys/stat.h> /* struct stat */
#include <fcntl.h> /* O_WRONLY for logfile_reopen */
@@ -35,7 +37,6 @@
#include "config.h"
#include "screen.h"
-#include "logfile.h"
#include "misc.h"
static void changed_logfile(Log *);
diff --git a/src/logfile.h b/src/logfile.h
index bad8ab0..eb3d3d6 100644
--- a/src/logfile.h
+++ b/src/logfile.h
@@ -30,6 +30,8 @@
#ifndef SCREEN_LOGFILE_H
#define SCREEN_LOGFILE_H
+#include <stdio.h>
+
typedef struct Log Log;
struct Log {
Log *next;
diff --git a/src/mark.c b/src/mark.c
index 754e4f0..5d2eb19 100644
--- a/src/mark.c
+++ b/src/mark.c
@@ -26,6 +26,8 @@
****************************************************************
*/
+#include "mark.h"
+
#include <sys/types.h>
#include <ctype.h>
#include <stdbool.h>
@@ -37,7 +39,6 @@
#include "encoding.h"
#include "fileio.h"
-#include "mark.h"
#include "process.h"
#include "search.h"
diff --git a/src/mark.h b/src/mark.h
index b3fe60b..948e3ce 100644
--- a/src/mark.h
+++ b/src/mark.h
@@ -30,6 +30,8 @@
#ifndef SCREEN_MARK_H
#define SCREEN_MARK_H
+#include "window.h"
+
struct markdata {
Window *md_window;/* pointer to window we are working on */
struct acluser *md_user; /* The user who brought us up */
diff --git a/src/misc.c b/src/misc.c
index aece087..567ebc7 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -26,13 +26,14 @@
****************************************************************
*/
+#include "misc.h"
+
#include <sys/types.h>
#include <sys/stat.h> /* mkdir() declaration */
#include <signal.h>
#include <stdint.h>
#include <stdbool.h>
-#include "config.h"
#include "screen.h"
char *SaveStr(const char *str)
diff --git a/src/misc.h b/src/misc.h
index 6d20474..de8ab4d 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -1,6 +1,10 @@
#ifndef SCREEN_MISC_H
#define SCREEN_MISC_H
+#include "config.h"
+
+#include "image.h"
+
char *SaveStr (const char *);
char *SaveStrn (const char *, int);
char *InStr (char *, const char *);
diff --git a/src/os.h b/src/os.h
index 1a9402d..9ebd938 100644
--- a/src/os.h
+++ b/src/os.h
@@ -27,9 +27,12 @@
* $Id$ GNU
*/
+#include "config.h"
+
#include <stdio.h>
#include <errno.h>
#include <sys/param.h>
+#include <fcntl.h>
#include <limits.h>
diff --git a/src/process.c b/src/process.c
index 98f633c..1e08fbd 100644
--- a/src/process.c
+++ b/src/process.c
@@ -31,6 +31,8 @@
****************************************************************
*/
+#include "process.h"
+
#include <fcntl.h>
#include <signal.h>
#include <sys/ioctl.h>
@@ -56,7 +58,6 @@
#include "logfile.h"
#include "mark.h"
#include "misc.h"
-#include "process.h"
#include "resize.h"
#include "search.h"
#include "socket.h"
diff --git a/src/pty.c b/src/pty.c
index a4db53e..ff13736 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -26,6 +26,8 @@
****************************************************************
*/
+#include "pty.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <stdint.h>
diff --git a/src/resize.c b/src/resize.c
index 04b2a9f..b2616d8 100644
--- a/src/resize.c
+++ b/src/resize.c
@@ -26,6 +26,8 @@
****************************************************************
*/
+#include "resize.h"
+
#include <sys/types.h>
#include <signal.h>
#include <stdint.h>
@@ -36,7 +38,6 @@
#include "screen.h"
#include "process.h"
-#include "resize.h"
#include "telnet.h"
/* maximum window width */
diff --git a/src/resize.h b/src/resize.h
index 1b57f10..ed0f31c 100644
--- a/src/resize.h
+++ b/src/resize.h
@@ -1,6 +1,8 @@
#ifndef SCREEN_RESIZE_H
#define SCREEN_RESIZE_H
+#include "window.h"
+
int ChangeWindowSize (Window *, int, int, int);
void ChangeScreenSize (int, int, int);
void CheckScreenSize (int);
diff --git a/src/sched.c b/src/sched.c
index af9ed10..57553ce 100644
--- a/src/sched.c
+++ b/src/sched.c
@@ -26,8 +26,9 @@
****************************************************************
*/
+#include "sched.h"
+
#include <stdint.h>
-#include <stdbool.h>
#include <sys/types.h>
#include <time.h>
#include <sys/time.h>
diff --git a/src/sched.h b/src/sched.h
index 89db240..27779a1 100644
--- a/src/sched.h
+++ b/src/sched.h
@@ -30,6 +30,7 @@
#ifndef SCREEN_SCHED_H
#define SCREEN_SCHED_H
+#include <stdbool.h>
#include <sys/time.h>
typedef enum {
diff --git a/src/screen.c b/src/screen.c
index dcd7054..3acd7f2 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -28,6 +28,8 @@
****************************************************************
*/
+#include "screen.h"
+
#include <ctype.h>
#include <fcntl.h>
#include <pwd.h>
@@ -37,20 +39,18 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include "config.h"
-
#include <locale.h>
#if defined(HAVE_NL_LANGINFO)
#include <langinfo.h>
#endif
-#include "screen.h"
#include "winmsg.h"
#include "version.h"
#include "logfile.h" /* islogfile, logfflush */
#include "fileio.h"
#include "mark.h"
+#include "utmp.h"
extern char **environ;
@@ -163,7 +163,6 @@ int af;
#include "socket.h"
#include "termcap.h"
#include "tty.h"
-#include "utmp.h"
char strnomem[] = "Out of memory.";
diff --git a/src/screen.h b/src/screen.h
index 66770f2..27a4353 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -30,17 +30,12 @@
#ifndef SCREEN_SCREEN_H
#define SCREEN_SCREEN_H
+#include "config.h"
+
#include <stdbool.h>
#include "os.h"
-#include "ansi.h"
-#include "sched.h"
-#include "acls.h"
-#include "comm.h"
-#include "layer.h"
-#include "term.h"
-
/* here comes my own Free: jw. */
#define Free(a) {if ((a) == 0) abort(); else free((void *)(a)); (a)=0;}
@@ -69,7 +64,13 @@ struct mode {
};
-/* #include "logfile.h" */ /* (requires stat.h) struct logfile */
+#include "ansi.h"
+#include "sched.h"
+#include "acls.h"
+#include "comm.h"
+#include "layer.h"
+#include "term.h"
+
#include "image.h"
#include "canvas.h"
#include "display.h"
diff --git a/src/search.c b/src/search.c
index 9811750..939bd80 100644
--- a/src/search.c
+++ b/src/search.c
@@ -26,12 +26,12 @@
****************************************************************
*/
+#include "search.h"
+
#include <stdint.h>
-#include <stdbool.h>
#include <sys/types.h>
#include "config.h"
-#include "screen.h"
#include "mark.h"
#include "mark.h"
#include "input.h"
diff --git a/src/search.h b/src/search.h
index 729b0d7..5f384df 100644
--- a/src/search.h
+++ b/src/search.h
@@ -1,6 +1,8 @@
#ifndef SCREEN_SEARCH_H
#define SCREEN_SEARCH_H
+#include <stdbool.h>
+
void Search (int);
void ISearch (int);
diff --git a/src/socket.c b/src/socket.c
index 80e92c0..d396c66 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -26,6 +26,8 @@
****************************************************************
*/
+#include "socket.h"
+
#include "config.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -62,7 +64,6 @@
#include "misc.h"
#include "process.h"
#include "resize.h"
-#include "socket.h"
#include "termcap.h"
#include "tty.h"
#include "utmp.h"
diff --git a/src/socket.h b/src/socket.h
index fbc69ae..e338f9d 100644
--- a/src/socket.h
+++ b/src/socket.h
@@ -1,6 +1,8 @@
#ifndef SCREEN_SOCKET_H
#define SCREEN_SOCKET_H
+#include "window.h"
+
int FindSocket (int *, int *, int *, char *);
int MakeClientSocket (int);
int MakeServerSocket (void);
diff --git a/src/telnet.c b/src/telnet.c
index d5178b4..7d8f27e 100644
--- a/src/telnet.c
+++ b/src/telnet.c
@@ -26,18 +26,17 @@
****************************************************************
*/
+#include "telnet.h"
+
+#ifdef BUILTIN_TELNET
+
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <netdb.h>
#include <stdio.h>
-#include "config.h"
-
-#ifdef BUILTIN_TELNET
-
#include "screen.h"
-#include "telnet.h"
extern Window *fore;
extern Layer *flayer;
diff --git a/src/telnet.h b/src/telnet.h
index 2ee73b9..e3b4971 100644
--- a/src/telnet.h
+++ b/src/telnet.h
@@ -1,6 +1,8 @@
#ifndef SCREEN_TELNET_H
#define SCREEN_TELNET_H
+#include "config.h"
+
#ifdef BUILTIN_TELNET
int TelOpenAndConnect(Window *);
int TelIsline(Window *);
diff --git a/src/term.sh b/src/term.sh
index d4933fa..cae53ce 100644
--- a/src/term.sh
+++ b/src/term.sh
@@ -103,7 +103,7 @@ cat << EOF > kmapdef.c
* This file is automagically created from term.c -- DO NOT EDIT
*/
-#include "config.h"
+#include "kmapdef.h"
EOF
diff --git a/src/termcap.c b/src/termcap.c
index d2a8bf2..81673c3 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -26,9 +26,10 @@
****************************************************************
*/
+#include "termcap.h"
+
#include <sys/types.h>
#include <stdint.h>
-#include <stdbool.h>
#include "config.h"
#include "screen.h"
@@ -37,7 +38,6 @@
#include "misc.h"
#include "process.h"
#include "resize.h"
-#include "termcap.h"
static void AddCap(char *);
static void MakeString(char *, char *, int, char *);
diff --git a/src/termcap.h b/src/termcap.h
index f3e6eb0..9e7c5df 100644
--- a/src/termcap.h
+++ b/src/termcap.h
@@ -1,6 +1,8 @@
#ifndef SCREEN_TERMCAP_H
#define SCREEN_TERMCAP_H
+#include <stdbool.h>
+
int InitTermcap (int, int);
char *MakeTermcap (bool);
char *gettermcapstring (char *);
diff --git a/src/tty.c b/src/tty.c
index 6cd7212..5366ce7 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -26,6 +26,8 @@
****************************************************************
*/
+#include "tty.h"
+
#include <sys/types.h>
#include <signal.h>
#include <fcntl.h>
diff --git a/src/tty.h b/src/tty.h
index 46b99f4..ccb1e53 100644
--- a/src/tty.h
+++ b/src/tty.h
@@ -1,6 +1,8 @@
#ifndef SCREEN_TTY_H
#define SCREEN_TTY_H
+#include "screen.h"
+
int OpenTTY (char *, char *);
void InitTTY (struct mode *, int);
void GetTTY (int, struct mode *);
diff --git a/src/utmp.c b/src/utmp.c
index 67b6e1b..da8d7ff 100644
--- a/src/utmp.c
+++ b/src/utmp.c
@@ -26,23 +26,22 @@
****************************************************************
*/
+#include "utmp.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdbool.h>
-#include "config.h"
#include "screen.h"
-/* needs config.h */
#ifdef HAVE_UTEMPTER
#include <utempter.h>
#endif
#include "misc.h"
#include "tty.h"
-#include "utmp.h"
/*
* we have a suid-root helper app that changes the utmp for us
diff --git a/src/utmp.h b/src/utmp.h
index 4d07117..9b83565 100644
--- a/src/utmp.h
+++ b/src/utmp.h
@@ -1,6 +1,10 @@
#ifndef SCREEN_UTMP_H
#define SCREEN_UTMP_H
+#include "config.h"
+
+#include "window.h"
+
#ifdef UTMPOK
void InitUtmp (void);
void RemoveLoginSlot (void);
diff --git a/src/viewport.c b/src/viewport.c
index 5adee3a..6ac3431 100644
--- a/src/viewport.c
+++ b/src/viewport.c
@@ -26,12 +26,9 @@
****************************************************************
*/
-#include <stdbool.h>
-#include <stdint.h>
+#include "viewport.h"
-#include "config.h"
#include "screen.h"
-#include "viewport.h"
int RethinkDisplayViewports() {
Canvas *canvas;
diff --git a/src/viewport.h b/src/viewport.h
index d29721d..dca56c9 100644
--- a/src/viewport.h
+++ b/src/viewport.h
@@ -30,6 +30,8 @@
#ifndef SCREEN_VIEWPORT_H
#define SCREEN_VIEWPORT_H
+#include "canvas.h"
+
typedef struct Viewport Viewport;
struct Viewport {
Viewport *v_next; /* next vp on canvas */
diff --git a/src/window.c b/src/window.c
index 5e41997..4eff11a 100644
--- a/src/window.c
+++ b/src/window.c
@@ -29,6 +29,8 @@
****************************************************************
*/
+#include "window.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
@@ -37,14 +39,10 @@
#include <fcntl.h>
#include <sys/ioctl.h>
-#include "config.h"
-
-#include "screen.h"
#include "winmsg.h"
#include "fileio.h"
#include "help.h"
#include "input.h"
-#include "logfile.h" /* logfopen() */
#include "mark.h"
#include "misc.h"
#include "process.h"
diff --git a/src/window.h b/src/window.h
index 8d3567f..530c5d9 100644
--- a/src/window.h
+++ b/src/window.h
@@ -33,9 +33,13 @@
#ifndef SCREEN_WINDOW_H
#define SCREEN_WINDOW_H
+#include "config.h"
+
#include "sched.h"
#include "logfile.h"
#include "screen.h"
+#include "layer.h"
+#include "display.h"
struct NewWindow {
int StartAt; /* where to start the search for the slot */
diff --git a/src/winmsg.c b/src/winmsg.c
index 44e5720..41dfea5 100644
--- a/src/winmsg.c
+++ b/src/winmsg.c
@@ -31,10 +31,11 @@
****************************************************************
*/
+#include "winmsg.h"
+
#include "config.h"
#include "screen.h"
-#include "winmsg.h"
#include "fileio.h"
#include "logfile.h"
#include "process.h"
diff --git a/src/winmsg.h b/src/winmsg.h
index 030745b..0b8baa8 100644
--- a/src/winmsg.h
+++ b/src/winmsg.h
@@ -36,7 +36,6 @@
#include <stdint.h>
#include <stdbool.h>
-#include <assert.h>
#include "window.h"
#include "winmsgbuf.h"
diff --git a/src/winmsgbuf.c b/src/winmsgbuf.c
index 40c817e..d2c96bb 100644
--- a/src/winmsgbuf.c
+++ b/src/winmsgbuf.c
@@ -20,10 +20,11 @@
****************************************************************
*/
+#include "winmsgbuf.h"
+
#include <stdarg.h>
#include <stdio.h>
#include <assert.h>
-#include "winmsgbuf.h"
/* Allocate and initialize to the empty string a new window message buffer. The
diff --git a/src/winmsgcond.c b/src/winmsgcond.c
index 6ff9bde..58955eb 100644
--- a/src/winmsgcond.c
+++ b/src/winmsgcond.c
@@ -20,9 +20,11 @@
****************************************************************
*/
-#include <assert.h>
#include "winmsgcond.h"
+#include <assert.h>
+#include <stdlib.h>
+
/* Initialize new condition and set to false; can be used to re-initialize a
* condition for re-use */
diff --git a/src/winmsgcond.h b/src/winmsgcond.h
index 421c90f..58af532 100644
--- a/src/winmsgcond.h
+++ b/src/winmsgcond.h
@@ -23,7 +23,6 @@
#ifndef SCREEN_WINMSGCOND_H
#define SCREEN_WINMSGCOND_H
-#include <stdlib.h>
#include <stdbool.h>
--
2.7.0
--
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [screen-devel] [PATCH 3/4] make all header files self-contained and include it in the source file,
Simon Ruderich <=