changeset 842:5ce0a9ac1ea7

entered into RCS
author Richard M. Stallman <rms@gnu.org>
date Wed, 22 Jul 1992 03:10:28 +0000
parents 2cdce064065f
children 8f6ea998ad0a
files src/search.c
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c	Wed Jul 22 02:58:48 1992 +0000
+++ b/src/search.c	Wed Jul 22 03:10:28 1992 +0000
@@ -227,6 +227,25 @@
   if (val < 0) return Qnil;
   return make_number (val);
 }
+
+/* Match REGEXP against STRING, searching all of STRING,
+   and return the index of the match, or negative on failure.
+   This does not clobber the match data.  */
+
+int
+fast_string_match (regexp, string)
+     Lisp_Object regexp, string;
+{
+  int val;
+
+  compile_pattern (regexp, &searchbuf, 0, 0);
+  immediate_quit = 1;
+  val = re_search (&searchbuf, (char *) XSTRING (string)->data,
+		   XSTRING (string)->size, 0, XSTRING (string)->size,
+		   0);
+  immediate_quit = 0;
+  return val;
+}
 
 /* Search for COUNT instances of the character TARGET, starting at START.
    If COUNT is negative, search backwards.