Move variables from globals to corresponding modules.

This commit is contained in:
Renaud 2013-10-09 14:38:55 +08:00
parent 8862838594
commit 0f6ff70764
10 changed files with 17 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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

3
eval.c
View File

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

2
eval.h
View File

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

View File

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

View File

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

2
tcap.c
View File

@ -34,6 +34,8 @@
#if TERMCAP
char sres[ NBUFN] ; /* current screen resolution */
#if UNIX
#include <signal.h>
#endif

View File

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