From 0f6ff70764fa0f7c1b0d3e2712b9ceb634643c6a Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Wed, 9 Oct 2013 14:38:55 +0800 Subject: [PATCH] Move variables from globals to corresponding modules. --- basic.c | 4 ++++ basic.h | 2 ++ display.c | 1 + display.h | 1 + eval.c | 3 +++ eval.h | 2 ++ globals.c | 5 ----- globals.h | 6 ------ tcap.c | 2 ++ terminal.h | 2 ++ 10 files changed, 17 insertions(+), 11 deletions(-) diff --git a/basic.c b/basic.c index a88fff8..96b6715 100644 --- a/basic.c +++ b/basic.c @@ -27,6 +27,10 @@ #include "utf8.h" #include "window.h" + +int overlap = 0 ; /* line overlap in forw/back page */ + + /* * This routine, given a pointer to a struct line, and the current cursor goal * column, return the best choice for the offset. The offset is returned. diff --git a/basic.h b/basic.h index 1b0f6ee..27ba4d4 100644 --- a/basic.h +++ b/basic.h @@ -1,6 +1,8 @@ #ifndef _BASIC_H_ #define _BASIC_H_ +extern int overlap ; /* line overlap in forw/back page */ + int gotobol( int f, int n) ; int gotoeol( int f, int n) ; int gotoline( int f, int n) ; diff --git a/display.c b/display.c index a1994cc..68cc8b1 100644 --- a/display.c +++ b/display.c @@ -70,6 +70,7 @@ 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 */ +int scrollcount = 1 ; /* number of lines to scroll */ static int reframe(struct window *wp); static void updone(struct window *wp); diff --git a/display.h b/display.h index b5ecbd4..8892a8f 100644 --- a/display.h +++ b/display.h @@ -2,6 +2,7 @@ #define _DISPLAY_H_ extern int mpresf ; /* Stuff in message line */ +extern int scrollcount ; /* number of lines to scroll */ void vtinit( void) ; void vtfree( void) ; diff --git a/eval.c b/eval.c index 6b19832..05f9c0a 100644 --- a/eval.c +++ b/eval.c @@ -47,6 +47,9 @@ int cmdstatus = TRUE ; /* last command status */ static int saveflag = 0 ; /* Flags, saved with the $target var */ +long envram = 0l ; /* # of bytes current in use by malloc */ + + /* Max #chars in a var name. */ #define NVSIZE 10 diff --git a/eval.h b/eval.h index 85fe51f..3b1d9ea 100644 --- a/eval.h +++ b/eval.h @@ -19,6 +19,8 @@ extern int gflags ; /* global control flag */ extern int macbug ; /* macro debuging flag */ extern int cmdstatus ; /* last command status */ +extern long envram ; /* # of bytes current in use by malloc */ + /* Macro argument token types */ #define TKNUL 0 /* end-of-string */ diff --git a/globals.c b/globals.c index 612ddd8..51787d0 100644 --- a/globals.c +++ b/globals.c @@ -25,15 +25,10 @@ int abortc = CONTROL | 'G'; /* current abort command char */ int tabmask = 0x07; /* tabulator mask */ -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 */ -int scrollcount = 1; /* number of lines to scroll */ /* uninitialized global definitions */ int thisflag; /* Flags, this command */ int lastflag; /* Flags, last command */ int curgoal; /* Goal for C-P, C-N */ - -char sres[NBUFN]; /* current screen resolution */ diff --git a/globals.h b/globals.h index eadf57b..16229d7 100644 --- a/globals.h +++ b/globals.h @@ -26,10 +26,7 @@ extern int abortc; /* current abort command char */ extern int tabmask; -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 */ -extern int scrollcount; /* number of lines to scroll */ /* Uninitialized global external declarations. */ @@ -41,7 +38,4 @@ extern int lastflag; /* Flags, last command */ extern int curgoal; /* Goal for C-P, C-N */ -extern char sres[] ; /* Current screen resolution. */ - - #endif diff --git a/tcap.c b/tcap.c index 9176c20..b10bbc1 100644 --- a/tcap.c +++ b/tcap.c @@ -34,6 +34,8 @@ #if TERMCAP +char sres[ NBUFN] ; /* current screen resolution */ + #if UNIX #include #endif diff --git a/terminal.h b/terminal.h index 2e4701f..d979b6b 100644 --- a/terminal.h +++ b/terminal.h @@ -70,4 +70,6 @@ extern struct terminal term ; extern int ttrow ; /* Row location of HW cursor */ extern int ttcol ; /* Column location of HW cursor */ +extern char sres[] ; /* Current screen resolution. */ + #endif