aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Farina <tfransosi@gmail.com>2010-12-05 18:35:55 -0200
committerLinus Torvalds <torvalds@linux-foundation.org>2010-12-14 11:28:55 -0800
commitbf3c3ac2bd36ee89c1b18999ac779e86deb7750f (patch)
treee402c494b7e03514e2c1f9154cfe8c910cada8f1
parentd6e76cca7b54f9e692481f878c663f97748e8ad9 (diff)
downloaduemacs-bf3c3ac2bd36ee89c1b18999ac779e86deb7750f.tar.gz
uemacs: Make some magic variables private to search.c module.
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--edef.h8
-rw-r--r--globals.c17
-rw-r--r--search.c14
3 files changed, 14 insertions, 25 deletions
diff --git a/edef.h b/edef.h
index 1705f39..31fb735 100644
--- a/edef.h
+++ b/edef.h
@@ -115,14 +115,6 @@ extern char *patmatch;
extern struct line *matchline;
extern int matchoff;
-#if MAGIC
-extern short int magical;
-extern short int rmagical;
-extern struct magic mcpat[NPAT]; /* The magic pattern. */
-extern struct magic tapcm[NPAT]; /* The reversed magic patterni. */
-extern struct magic_replacement rmcpat[NPAT]; /* The replacement magic array. */
-#endif
-
extern char *dname[]; /* Directive name table. */
#if DEBUGM
diff --git a/globals.c b/globals.c
index 4488d60..235e2f3 100644
--- a/globals.c
+++ b/globals.c
@@ -119,21 +119,6 @@ char *patmatch = NULL;
struct line *matchline = NULL;
int matchoff = 0;
-#if MAGIC
-/*
- * The variables magical and rmagical determine if there
- * were actual metacharacters in the search and replace strings -
- * if not, then we don't have to use the slower MAGIC mode
- * search functions.
- */
-short int magical = FALSE;
-short int rmagical = FALSE;
-struct magic mcpat[NPAT]; /* the magic pattern */
-struct magic tapcm[NPAT]; /* the reversed magic pattern */
-struct magic_replacement rmcpat[NPAT]; /* the replacement magic array */
-
-#endif
-
/* directive name table:
This holds the names of all the directives.... */
@@ -148,5 +133,3 @@ char *dname[] = {
/* vars needed for macro debugging output */
char outline[NSTRING]; /* global string to hold debug line text */
#endif
-
-
diff --git a/search.c b/search.c
index 7f080d8..32877ab 100644
--- a/search.c
+++ b/search.c
@@ -64,6 +64,20 @@
#include "efunc.h"
#include "line.h"
+#if defined(MAGIC)
+/*
+ * The variables magical and rmagical determine if there
+ * were actual metacharacters in the search and replace strings -
+ * if not, then we don't have to use the slower MAGIC mode
+ * search functions.
+ */
+static short int magical;
+static short int rmagical;
+static struct magic mcpat[NPAT]; /* The magic pattern. */
+static struct magic tapcm[NPAT]; /* The reversed magic patterni. */
+static struct magic_replacement rmcpat[NPAT]; /* The replacement magic array. */
+#endif
+
static int amatch(struct magic *mcptr, int direct, struct line **pcwline, int *pcwoff);
static int readpattern(char *prompt, char *apat, int srch);
static int replaces(int kind, int f, int n);