From d6e3df6ff37ed79d0b947d85873115dc01232b81 Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Tue, 8 Oct 2013 17:41:49 +0800 Subject: [PATCH] Move global window pointers to window and global keyboard variables to input. --- Makefile | 6 +++--- display.c | 1 + edef.h | 14 -------------- globals.c | 5 ----- input.c | 4 ++++ input.h | 6 ++++++ window.c | 3 +++ window.h | 3 +++ 8 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 9ec8584..2fd24a3 100644 --- a/Makefile +++ b/Makefile @@ -140,8 +140,8 @@ buffer.o: buffer.c buffer.h crypt.h line.h utf8.h defines.h display.h \ edef.h estruct.h retcode.h file.h input.h window.h crypt.o: crypt.c crypt.h display.o: display.c display.h buffer.h crypt.h line.h utf8.h estruct.h \ - retcode.h edef.h termio.h terminal.h defines.h version.h wrapper.h \ - window.h + retcode.h edef.h input.h termio.h terminal.h defines.h version.h \ + wrapper.h window.h ebind.o: ebind.c ebind.h basic.h bind.h edef.h buffer.h crypt.h line.h \ utf8.h estruct.h retcode.h bindable.h eval.h exec.h file.h isearch.h \ random.h region.h search.h spawn.h window.h defines.h word.h @@ -202,7 +202,7 @@ vmsvt.o: vmsvt.c estruct.h retcode.h edef.h buffer.h crypt.h line.h \ utf8.h vt52.o: vt52.c estruct.h retcode.h edef.h buffer.h crypt.h line.h utf8.h window.o: window.c window.h defines.h buffer.h crypt.h line.h utf8.h \ - basic.h display.h edef.h estruct.h retcode.h execute.h terminal.h \ + basic.h display.h estruct.h retcode.h edef.h execute.h terminal.h \ wrapper.h word.o: word.c word.h basic.h buffer.h crypt.h line.h utf8.h estruct.h \ retcode.h edef.h log.h random.h region.h window.h defines.h diff --git a/display.c b/display.c index 9400a8b..604acfc 100644 --- a/display.c +++ b/display.c @@ -20,6 +20,7 @@ #include "buffer.h" #include "estruct.h" #include "edef.h" +#include "input.h" #include "line.h" #include "termio.h" #include "terminal.h" diff --git a/edef.h b/edef.h index 6f1274a..66c6a9d 100644 --- a/edef.h +++ b/edef.h @@ -42,19 +42,7 @@ extern int abortc; /* current abort command char */ extern int tabmask; -#if 0 -#define STOP 0 /* keyboard macro not in use */ -#define PLAY 1 /* playing */ -#define RECORD 2 /* recording */ -#endif - -typedef enum { - STOP, PLAY, RECORD -} kbdstate ; -extern kbdstate kbdmode ; /* current keyboard macro mode */ -extern int kbdrep; /* number of repetitions */ extern int restflag; /* restricted use? */ -extern int lastkey; /* last keystoke */ extern long envram; /* # of bytes current in use by malloc */ extern int rval; /* return value of a subprocess */ extern int overlap; /* line overlap in forw/back page */ @@ -69,8 +57,6 @@ extern int thisflag; /* Flags, this command */ extern int lastflag; /* Flags, last command */ extern int curgoal; /* Goal for C-P, C-N */ -extern struct window *curwp; /* Current window */ -extern struct window *wheadp; /* Head of list of windows */ extern char sres[NBUFN]; /* Current screen resolution. */ diff --git a/globals.c b/globals.c index 28eaef7..384aa55 100644 --- a/globals.c +++ b/globals.c @@ -25,10 +25,7 @@ int abortc = CONTROL | 'G'; /* current abort command char */ int tabmask = 0x07; /* tabulator mask */ -kbdstate kbdmode = STOP; /* current keyboard macro mode */ -int kbdrep = 0; /* number of repetitions */ int restflag = FALSE; /* restricted use? */ -int lastkey = 0; /* last keystoke */ long envram = 0l; /* # of bytes current in use by malloc */ int rval = 0; /* return value of a subprocess */ int overlap = 0; /* line overlap in forw/back page */ @@ -39,7 +36,5 @@ int scrollcount = 1; /* number of lines to scroll */ int thisflag; /* Flags, this command */ int lastflag; /* Flags, last command */ int curgoal; /* Goal for C-P, C-N */ -struct window *curwp; /* Current window */ -struct window *wheadp; /* Head of list of windows */ char sres[NBUFN]; /* current screen resolution */ diff --git a/input.c b/input.c index 16c17db..c40a5fd 100644 --- a/input.c +++ b/input.c @@ -38,6 +38,10 @@ int kbdm[ NKBDM] ; /* Macro */ int *kbdptr ; /* current position in keyboard buf */ int *kbdend = &kbdm[0] ; /* ptr to end of the keyboard */ +kbdstate kbdmode = STOP ; /* current keyboard macro mode */ +int lastkey = 0 ; /* last keystoke */ +int kbdrep = 0 ; /* number of repetitions */ + static const int quotec = 0x11 ; /* quote char during mlreply() */ /* diff --git a/input.h b/input.h index da12bba..1fc1aa9 100644 --- a/input.h +++ b/input.h @@ -3,6 +3,12 @@ #include "edef.h" +typedef enum { + STOP, PLAY, RECORD +} kbdstate ; +extern kbdstate kbdmode ; /* current keyboard macro mode */ +extern int lastkey ; /* last keystoke */ +extern int kbdrep ; /* number of repetitions */ extern int kbdm[] ; /* Holds kayboard macro data */ extern int *kbdptr ; /* current position in keyboard buf */ extern int *kbdend ; /* ptr to end of the keyboard */ diff --git a/window.c b/window.c index 288bb9e..dab5f8f 100644 --- a/window.c +++ b/window.c @@ -22,6 +22,9 @@ #include "wrapper.h" +struct window *curwp ; /* Current window */ +struct window *wheadp ; /* Head of list of windows */ + static struct window *swindow = NULL ; /* saved window pointer */ diff --git a/window.h b/window.h index 60d17b2..669d8e1 100644 --- a/window.h +++ b/window.h @@ -31,6 +31,9 @@ struct window { #endif }; +extern struct window *curwp ; /* Current window */ +extern struct window *wheadp ; /* Head of list of windows */ + #define WFFORCE 0x01 /* Window needs forced reframe */ #define WFMOVE 0x02 /* Movement from line to line */ #define WFEDIT 0x04 /* Editing within a line */