summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZev Weiss <zev@bewilderbeest.net>2016-12-25 10:56:06 (GMT)
committerPaul Eggert <eggert@cs.ucla.edu>2016-12-25 23:23:57 (GMT)
commit1d5679ea305370430538e9c1284db736c8433503 (patch)
tree6c971296044199594b89dd8057986aa0f258ce77
parent31a5e0f4f7c365bbad1436f97e684254886f42a3 (diff)
downloadgrep-1d5679ea305370430538e9c1284db736c8433503.zip
grep-1d5679ea305370430538e9c1284db736c8433503.tar.gz
grep-1d5679ea305370430538e9c1284db736c8433503.tar.bz2
grep: move localeinfo to grep.c
It's not really dfasearch-specific, and grep.c initializes it, so it seems like the most appropriate "owner". * src/dfasearch.c (localeinfo): Remove. * src/grep.c (localeinfo): Add. * src/search.h (localeinfo): Move to new commented section.
-rw-r--r--src/dfasearch.c2
-rw-r--r--src/grep.c2
-rw-r--r--src/search.h4
3 files changed, 5 insertions, 3 deletions
diff --git a/src/dfasearch.c b/src/dfasearch.c
index 0abe7f6..c201a51 100644
--- a/src/dfasearch.c
+++ b/src/dfasearch.c
@@ -24,8 +24,6 @@
#include "die.h"
#include <error.h>
-struct localeinfo localeinfo;
-
struct dfa_comp
{
/* KWset compiled pattern. For Ecompile and Gcompile, we compile
diff --git a/src/grep.c b/src/grep.c
index 9a89b5e..f28f3c2 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -625,6 +625,8 @@ clean_up_stdout (void)
/* An unsigned type suitable for fast matching. */
typedef uintmax_t uword;
+struct localeinfo localeinfo;
+
/* A mask to test for unibyte characters, with the pattern repeated to
fill a uword. For a multibyte character encoding where
all bytes are unibyte characters, this is 0. For UTF-8, this is
diff --git a/src/search.h b/src/search.h
index 766b1f6..469fc9c 100644
--- a/src/search.h
+++ b/src/search.h
@@ -54,7 +54,6 @@ extern size_t wordchar_prev (char const *, char const *, char const *);
extern ptrdiff_t mb_goback (char const **, char const *, char const *);
/* dfasearch.c */
-extern struct localeinfo localeinfo;
extern void *GEAcompile (char const *, size_t, reg_syntax_t);
extern size_t EGexecute (void *, char const *, size_t, size_t *, char const *);
@@ -66,6 +65,9 @@ extern size_t Fexecute (void *, char const *, size_t, size_t *, char const *);
extern void *Pcompile (char const *, size_t, reg_syntax_t);
extern size_t Pexecute (void *, char const *, size_t, size_t *, char const *);
+/* grep.c */
+extern struct localeinfo localeinfo;
+
/* Return the number of bytes in the character at the start of S, which
is of size N. N must be positive. MBS is the conversion state.
This acts like mbrlen, except it returns 1 when mbrlen would return 0,