Mercurial > emacs
changeset 57572:d226830a814e
(fast_string_match_ignore_case): New function.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 18 Oct 2004 12:26:36 +0000 |
parents | e624ae20de7c |
children | 43067aee2f3e |
files | src/search.c |
diffstat | 1 files changed, 21 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/search.c Mon Oct 18 12:26:02 2004 +0000 +++ b/src/search.c Mon Oct 18 12:26:36 2004 +0000 @@ -493,6 +493,27 @@ immediate_quit = 0; return val; } + +/* Like fast_string_match but ignore case. */ + +int +fast_string_match_ignore_case (regexp, string) + Lisp_Object regexp, string; +{ + int val; + struct re_pattern_buffer *bufp; + + bufp = compile_pattern (regexp, 0, Vascii_downcase_table, + 0, STRING_MULTIBYTE (string)); + immediate_quit = 1; + re_match_object = string; + + val = re_search (bufp, (char *) SDATA (string), + SBYTES (string), 0, + SBYTES (string), 0); + immediate_quit = 0; + return val; +} /* The newline cache: remembering which sections of text have no newlines. */