]> code.delx.au - gnu-emacs/commitdiff
(fast_string_match_ignore_case): New function.
authorKenichi Handa <handa@m17n.org>
Mon, 18 Oct 2004 12:26:36 +0000 (12:26 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 18 Oct 2004 12:26:36 +0000 (12:26 +0000)
src/search.c

index 0375f353dd2064d6e3099abc3a38b41fb6bd6f1b..f7bee1b8683ff21301a1d77784214f10a3998ae1 100644 (file)
@@ -493,6 +493,27 @@ fast_c_string_match_ignore_case (regexp, string)
   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;
+}
 \f
 /* The newline cache: remembering which sections of text have no newlines.  */