diff options
author | tjr <tjr@FreeBSD.org> | 2004-07-04 16:16:59 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-07-04 16:16:59 +0000 |
commit | ee5f93f56a2ef4f350b2806d8129fb2b520a0e4d (patch) | |
tree | f6cc1168eb91ba1e90868ec6077d80ec9ca9dba4 /gnu/usr.bin/grep/dfa.h | |
parent | 9dea8aeba1c4f733fc95d1dfd11cfc8d3092a654 (diff) | |
download | FreeBSD-src-ee5f93f56a2ef4f350b2806d8129fb2b520a0e4d.zip FreeBSD-src-ee5f93f56a2ef4f350b2806d8129fb2b520a0e4d.tar.gz |
Make grep run much (~10x) faster in multibyte locales by caching the wide
character representation of input data across calls to dfaexec(), and by
caching the lengths of character across calls to check_multibyte_string().
Obtained from: Fedora (Tim Waugh)
Diffstat (limited to 'gnu/usr.bin/grep/dfa.h')
-rw-r--r-- | gnu/usr.bin/grep/dfa.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gnu/usr.bin/grep/dfa.h b/gnu/usr.bin/grep/dfa.h index 4cdbe7a..014f1b3 100644 --- a/gnu/usr.bin/grep/dfa.h +++ b/gnu/usr.bin/grep/dfa.h @@ -24,6 +24,8 @@ In addition to clobbering modularity, we eat up valuable name space. */ +#include "mbcache.h" + #ifdef __STDC__ # ifndef _PTR_T # define _PTR_T @@ -405,7 +407,8 @@ extern void dfacomp PARAMS ((char const *, size_t, struct dfa *, int)); order to verify backreferencing; otherwise the flag will be cleared. Returns (size_t) -1 if no match is found, or the offset of the first character after the first & shortest matching string in the buffer. */ -extern size_t dfaexec PARAMS ((struct dfa *, char const *, size_t, int *)); +extern size_t dfaexec PARAMS ((struct dfa *, char const *, size_t, int *, + struct mb_cache *)); /* Free the storage held by the components of a struct dfa. */ extern void dfafree PARAMS ((struct dfa *)); |