Move global window pointers to window and global keyboard variables to input.

This commit is contained in:
Renaud 2013-10-08 17:41:49 +08:00
parent 83a0cc9d67
commit d6e3df6ff3
8 changed files with 20 additions and 22 deletions

View File

@ -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

View File

@ -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"

14
edef.h
View File

@ -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. */

View File

@ -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 */

View File

@ -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() */
/*

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */