From 62e887547b4e247a6b1dd5b4d3ae4330b2d44e85 Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Fri, 27 Sep 2013 14:53:04 +0800 Subject: [PATCH] Move global search pattern variables to public search scope. --- edef.h | 5 ----- globals.c | 12 ------------ search.c | 14 ++++++++++++++ search.h | 3 +++ 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/edef.h b/edef.h index f3a4927..6743275 100644 --- a/edef.h +++ b/edef.h @@ -112,11 +112,6 @@ extern struct buffer *blistp; /* Buffer for C-X C-B */ extern char sres[NBUFN]; /* Current screen resolution. */ -extern unsigned int matchlen; -extern unsigned int mlenold; -extern char *patmatch; -extern struct line *matchline; -extern int matchoff; #if DEBUGM /* Vars needed for macro debugging output. */ diff --git a/globals.c b/globals.c index e90ad7f..a06968e 100644 --- a/globals.c +++ b/globals.c @@ -113,18 +113,6 @@ char pat[NPAT]; /* Search pattern */ char tap[NPAT]; /* Reversed pattern array. */ char rpat[NPAT]; /* replacement pattern */ -/* The variable matchlen holds the length of the matched - * string - used by the replace functions. - * The variable patmatch holds the string that satisfies - * the search command. - * The variables matchline and matchoff hold the line and - * offset position of the *start* of match. - */ -unsigned int matchlen = 0; -unsigned int mlenold = 0; -char *patmatch = NULL; -struct line *matchline = NULL; -int matchoff = 0; #if DEBUGM /* vars needed for macro debugging output */ diff --git a/search.c b/search.c index c7deea9..0deccae 100644 --- a/search.c +++ b/search.c @@ -72,6 +72,20 @@ #include "terminal.h" #include "window.h" +/* The variable matchlen holds the length of the matched + * string - used by the replace functions. + * The variable patmatch holds the string that satisfies + * the search command. + * The variables matchline and matchoff hold the line and + * offset position of the *start* of match. + */ +unsigned int matchlen = 0 ; +static unsigned int mlenold = 0 ; +char *patmatch = NULL ; +static struct line *matchline = NULL; +static int matchoff = 0; + + #if defined(MAGIC) /* * Defines for the metacharacters in the regular expression diff --git a/search.h b/search.h index 6f16445..1bf2d1e 100644 --- a/search.h +++ b/search.h @@ -5,6 +5,9 @@ #include "line.h" +extern unsigned int matchlen ; +extern char *patmatch ; + /* * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for * the scan routines.