Move global variable to module scope (display, exec, input).

This commit is contained in:
Renaud 2013-09-29 21:58:54 +08:00
parent 897c50013e
commit 63e2f82211
6 changed files with 14 additions and 22 deletions

View File

@ -60,6 +60,15 @@ static int displaying = TRUE;
int chg_width, chg_height;
#endif
static int currow ; /* Cursor row */
static int curcol ; /* Cursor column */
static int vtrow = 0 ; /* Row location of SW cursor */
static int vtcol = 0 ; /* Column location of SW cursor */
static int lbound = 0 ; /* leftmost column of current line being displayed */
static int taboff = 0 ; /* tab offset for display */
int mpresf = FALSE ; /* TRUE if message in last line */
static int reframe(struct window *wp);
static void updone(struct window *wp);
static void updall(struct window *wp);

View File

@ -1,6 +1,8 @@
#ifndef _DISPLAY_H_
#define _DISPLAY_H_
extern int mpresf ; /* Stuff in message line */
void vtinit( void) ;
void vtfree( void) ;
void vttidy( void) ;

12
edef.h
View File

@ -38,23 +38,15 @@ extern int gbcolor; /* global backgrnd color (black) */
extern int gasave; /* global ASAVE size */
extern int gacount; /* count until next ASAVE */
extern int sgarbf; /* State of screen unknown */
extern int mpresf; /* Stuff in message line */
extern int clexec; /* command line execution flag */
extern int mstore; /* storing text to macro flag */
extern int discmd; /* display command flag */
extern int disinp; /* display input characters */
extern int vtrow; /* Row location of SW cursor */
extern int vtcol; /* Column location of SW cursor */
extern int lbound; /* leftmost column of current line
being displayed */
extern int taboff; /* tab offset for display */
extern int metac; /* current meta character */
extern int ctlxc; /* current control X prefix char */
extern int reptc; /* current universal repeat char */
extern int abortc; /* current abort command char */
extern int quotec; /* quote char during mlreply() */
extern int tabmask;
@ -81,10 +73,6 @@ extern int scrollcount; /* number of lines to scroll */
/* Uninitialized global external declarations. */
extern int currow; /* Cursor row */
extern int curcol; /* Cursor column */
#define CFCPCN 0x0001 /* Last command was C-P, C-N */
#define CFKILL 0x0002 /* Last command was a kill */

1
exec.c
View File

@ -67,6 +67,7 @@ static const char *dname[] = {
static char golabel[ NPAT] = "" ; /* current line to go to */
static int execlevel = 0 ; /* execution IF level */
static struct buffer *bstore = NULL ; /* buffer to store macro text to */
static int mstore = FALSE ; /* storing text to macro flag */
static int dobuf( struct buffer *bp) ;
static void freewhile( struct while_block *wp) ;

View File

@ -48,23 +48,15 @@ int gbcolor = 0; /* global backgrnd color (black) */
int gasave = 256; /* global ASAVE size */
int gacount = 256; /* count until next ASAVE */
int sgarbf = TRUE; /* TRUE if screen is garbage */
int mpresf = FALSE; /* TRUE if message in last line */
int clexec = FALSE; /* command line execution flag */
int mstore = FALSE; /* storing text to macro flag */
int discmd = TRUE; /* display command flag */
int disinp = TRUE; /* display input characters */
int vtrow = 0; /* Row location of SW cursor */
int vtcol = 0; /* Column location of SW cursor */
int lbound = 0; /* leftmost column of current line
being displayed */
int taboff = 0; /* tab offset for display */
int metac = CONTROL | '['; /* current meta character */
int ctlxc = CONTROL | 'X'; /* current control X prefix char */
int reptc = CONTROL | 'U'; /* current universal repeat char */
int abortc = CONTROL | 'G'; /* current abort command char */
int quotec = 0x11; /* quote char during mlreply() */
int tabmask = 0x07; /* tabulator mask */
@ -82,8 +74,6 @@ int scrollcount = 1; /* number of lines to scroll */
/* uninitialized global definitions */
int currow; /* Cursor row */
int curcol; /* Cursor column */
int thisflag; /* Flags, this command */
int lastflag; /* Flags, last command */
int curgoal; /* Goal for C-P, C-N */

View File

@ -38,6 +38,8 @@ int kbdm[ NKBDM] ; /* Macro */
int *kbdptr ; /* current position in keyboard buf */
int *kbdend = &kbdm[0] ; /* ptr to end of the keyboard */
static const int quotec = 0x11 ; /* quote char during mlreply() */
/*
* Ask a yes or no question in the message line. Return either TRUE, FALSE, or
* ABORT. The ABORT status is returned if the user bumps out of the question