use guile-snarf for subr definition
[bpt/emacs.git] / src / search.c
index dc4820d..3abb49c 100644 (file)
@@ -1416,7 +1416,7 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
 
                      while (boyer_moore_ok)
                        {
-                         if (ASCII_BYTE_P (inverse))
+                         if (ASCII_CHAR_P (inverse))
                            {
                              if (this_char_base > 0)
                                boyer_moore_ok = 0;
@@ -1827,7 +1827,7 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat,
             matching with CHAR_BASE are to be checked.  */
          int ch = -1;
 
-         if (ASCII_BYTE_P (*ptr) || ! multibyte)
+         if (ASCII_CHAR_P (*ptr) || ! multibyte)
            ch = *ptr;
          else if (char_base
                   && ((pat_end - ptr) == 1 || CHAR_HEAD_P (ptr[1])))
@@ -2578,7 +2578,7 @@ since only regular expressions have distinguished subexpressions.  */)
       substed_alloc_size = (length <= (STRING_BYTES_BOUND - 100) / 2
                            ? length * 2 + 100
                            : STRING_BYTES_BOUND);
-      substed = xmalloc (substed_alloc_size);
+      substed = xmalloc_atomic (substed_alloc_size);
       substed_len = 0;
 
       /* Go thru NEWTEXT, producing the actual text to insert in
@@ -2596,7 +2596,7 @@ since only regular expressions have distinguished subexpressions.  */)
            {
              FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, newtext, pos, pos_byte);
              if (!buf_multibyte)
-               c = multibyte_char_to_unibyte (c);
+               c = CHAR_TO_BYTE8 (c);
            }
          else
            {
@@ -2619,7 +2619,7 @@ since only regular expressions have distinguished subexpressions.  */)
                  FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, newtext,
                                                      pos, pos_byte);
                  if (!buf_multibyte && !ASCII_CHAR_P (c))
-                   c = multibyte_char_to_unibyte (c);
+                   c = CHAR_TO_BYTE8 (c);
                }
              else
                {
@@ -3283,12 +3283,14 @@ the buffer.  If the buffer doesn't have a cache, the value is nil.  */)
 void
 syms_of_search (void)
 {
+#include "search.x"
+
   register int i;
 
   for (i = 0; i < REGEXP_CACHE_SIZE; ++i)
     {
       searchbufs[i].buf.allocated = 100;
-      searchbufs[i].buf.buffer = xmalloc (100);
+      searchbufs[i].buf.buffer = xmalloc_atomic (100);
       searchbufs[i].buf.fastmap = searchbufs[i].fastmap;
       searchbufs[i].regexp = Qnil;
       searchbufs[i].whitespace_regexp = Qnil;
@@ -3334,22 +3336,4 @@ such as `looking-at', `string-match', `re-search-forward', etc.,
 do not set the match data.  The proper way to use this variable
 is to bind it with `let' around a small expression.  */);
   Vinhibit_changing_match_data = Qnil;
-
-  defsubr (&Slooking_at);
-  defsubr (&Sposix_looking_at);
-  defsubr (&Sstring_match);
-  defsubr (&Sposix_string_match);
-  defsubr (&Ssearch_forward);
-  defsubr (&Ssearch_backward);
-  defsubr (&Sre_search_forward);
-  defsubr (&Sre_search_backward);
-  defsubr (&Sposix_search_forward);
-  defsubr (&Sposix_search_backward);
-  defsubr (&Sreplace_match);
-  defsubr (&Smatch_beginning);
-  defsubr (&Smatch_end);
-  defsubr (&Smatch_data);
-  defsubr (&Sset_match_data);
-  defsubr (&Sregexp_quote);
-  defsubr (&Snewline_cache_check);
 }