diff options
| author | Paul Eggert | 2018-08-05 18:41:20 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-08-05 19:36:09 -0700 |
| commit | e5652268a993ad9117f7253553c143d60460eb8f (patch) | |
| tree | 82b54b12fa3c5d41fd5e5345f19613b722709495 /src | |
| parent | ba8eb994f86206f69cbf9743a67b9d86ef9b1d8f (diff) | |
| download | emacs-e5652268a993ad9117f7253553c143d60460eb8f.tar.gz emacs-e5652268a993ad9117f7253553c143d60460eb8f.zip | |
Rename src/regex.c to src/regex-emacs.c.
This is in preparation for using Gnulib regex for etags,
to avoid collisions in include directives.
* src/regex-emacs.c: Rename from src/regex.c.
* src/regex-emacs.h: Rename from src/regex.h. All uses changed.
* test/src/regex-emacs-tests.el: Rename from test/src/regex-tests.el.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.in | 2 | ||||
| -rw-r--r-- | src/casetab.c | 3 | ||||
| -rw-r--r-- | src/conf_post.h | 2 | ||||
| -rw-r--r-- | src/deps.mk | 9 | ||||
| -rw-r--r-- | src/emacs.c | 8 | ||||
| -rw-r--r-- | src/regex-emacs.c (renamed from src/regex.c) | 55 | ||||
| -rw-r--r-- | src/regex-emacs.h (renamed from src/regex.h) | 8 | ||||
| -rw-r--r-- | src/search.c | 11 | ||||
| -rw-r--r-- | src/syntax.c | 11 | ||||
| -rw-r--r-- | src/thread.h | 2 |
10 files changed, 59 insertions, 52 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index c3bcc503492..1aae27b2f91 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -391,7 +391,7 @@ base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \ | |||
| 391 | emacs.o keyboard.o macros.o keymap.o sysdep.o \ | 391 | emacs.o keyboard.o macros.o keymap.o sysdep.o \ |
| 392 | buffer.o filelock.o insdel.o marker.o \ | 392 | buffer.o filelock.o insdel.o marker.o \ |
| 393 | minibuf.o fileio.o dired.o \ | 393 | minibuf.o fileio.o dired.o \ |
| 394 | cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \ | 394 | cmds.o casetab.o casefiddle.o indent.o search.o regex-emacs.o undo.o \ |
| 395 | alloc.o data.o doc.o editfns.o callint.o \ | 395 | alloc.o data.o doc.o editfns.o callint.o \ |
| 396 | eval.o floatfns.o fns.o font.o print.o lread.o $(MODULES_OBJ) \ | 396 | eval.o floatfns.o fns.o font.o print.o lread.o $(MODULES_OBJ) \ |
| 397 | syntax.o $(UNEXEC_OBJ) bytecode.o \ | 397 | syntax.o $(UNEXEC_OBJ) bytecode.o \ |
diff --git a/src/casetab.c b/src/casetab.c index 8f806a0647c..36f94f43dbc 100644 --- a/src/casetab.c +++ b/src/casetab.c | |||
| @@ -144,7 +144,8 @@ set_case_table (Lisp_Object table, bool standard) | |||
| 144 | set_char_table_extras (table, 2, eqv); | 144 | set_char_table_extras (table, 2, eqv); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ | 147 | /* This is so set_image_of_range_1 in regex-emacs.c can find the EQV |
| 148 | table. */ | ||
| 148 | set_char_table_extras (canon, 2, eqv); | 149 | set_char_table_extras (canon, 2, eqv); |
| 149 | 150 | ||
| 150 | if (standard) | 151 | if (standard) |
diff --git a/src/conf_post.h b/src/conf_post.h index 080d7b7e688..8d56f0b4905 100644 --- a/src/conf_post.h +++ b/src/conf_post.h | |||
| @@ -203,7 +203,7 @@ extern void _DebPrint (const char *fmt, ...); | |||
| 203 | #endif | 203 | #endif |
| 204 | 204 | ||
| 205 | #ifdef emacs /* Don't do this for lib-src. */ | 205 | #ifdef emacs /* Don't do this for lib-src. */ |
| 206 | /* Tell regex.c to use a type compatible with Emacs. */ | 206 | /* Tell regex-emacs.c to use a type compatible with Emacs. */ |
| 207 | #define RE_TRANSLATE_TYPE Lisp_Object | 207 | #define RE_TRANSLATE_TYPE Lisp_Object |
| 208 | #define RE_TRANSLATE(TBL, C) char_table_translate (TBL, C) | 208 | #define RE_TRANSLATE(TBL, C) char_table_translate (TBL, C) |
| 209 | #define RE_TRANSLATE_P(TBL) (!EQ (TBL, make_number (0))) | 209 | #define RE_TRANSLATE_P(TBL) (!EQ (TBL, make_number (0))) |
diff --git a/src/deps.mk b/src/deps.mk index 7b6ae9cd8e0..f202d0e1041 100644 --- a/src/deps.mk +++ b/src/deps.mk | |||
| @@ -71,7 +71,7 @@ cmds.o: cmds.c syntax.h buffer.h character.h commands.h window.h lisp.h \ | |||
| 71 | pre-crt0.o: pre-crt0.c | 71 | pre-crt0.o: pre-crt0.c |
| 72 | dbusbind.o: dbusbind.c termhooks.h frame.h keyboard.h lisp.h $(config_h) | 72 | dbusbind.o: dbusbind.c termhooks.h frame.h keyboard.h lisp.h $(config_h) |
| 73 | dired.o: dired.c commands.h buffer.h lisp.h $(config_h) character.h charset.h \ | 73 | dired.o: dired.c commands.h buffer.h lisp.h $(config_h) character.h charset.h \ |
| 74 | coding.h regex.h systime.h blockinput.h atimer.h composite.h \ | 74 | coding.h regex-emacs.h systime.h blockinput.h atimer.h composite.h \ |
| 75 | ../lib/filemode.h ../lib/unistd.h globals.h | 75 | ../lib/filemode.h ../lib/unistd.h globals.h |
| 76 | dispnew.o: dispnew.c systime.h commands.h process.h frame.h coding.h \ | 76 | dispnew.o: dispnew.c systime.h commands.h process.h frame.h coding.h \ |
| 77 | window.h buffer.h termchar.h termopts.h termhooks.h cm.h \ | 77 | window.h buffer.h termchar.h termopts.h termhooks.h cm.h \ |
| @@ -169,20 +169,21 @@ process.o: process.c process.h buffer.h window.h termhooks.h termopts.h \ | |||
| 169 | blockinput.h atimer.h coding.h msdos.h nsterm.h composite.h \ | 169 | blockinput.h atimer.h coding.h msdos.h nsterm.h composite.h \ |
| 170 | keyboard.h lisp.h globals.h $(config_h) character.h xgselect.h sysselect.h \ | 170 | keyboard.h lisp.h globals.h $(config_h) character.h xgselect.h sysselect.h \ |
| 171 | ../lib/unistd.h gnutls.h | 171 | ../lib/unistd.h gnutls.h |
| 172 | regex.o: regex.c syntax.h buffer.h lisp.h globals.h $(config_h) regex.h \ | 172 | regex-emacs.o: regex-emacs.c syntax.h buffer.h lisp.h globals.h \ |
| 173 | $(config_h) regex-emacs.h \ | ||
| 173 | category.h character.h | 174 | category.h character.h |
| 174 | region-cache.o: region-cache.c buffer.h region-cache.h \ | 175 | region-cache.o: region-cache.c buffer.h region-cache.h \ |
| 175 | lisp.h globals.h $(config_h) | 176 | lisp.h globals.h $(config_h) |
| 176 | scroll.o: scroll.c termchar.h dispextern.h frame.h msdos.h keyboard.h \ | 177 | scroll.o: scroll.c termchar.h dispextern.h frame.h msdos.h keyboard.h \ |
| 177 | termhooks.h lisp.h globals.h $(config_h) systime.h coding.h composite.h \ | 178 | termhooks.h lisp.h globals.h $(config_h) systime.h coding.h composite.h \ |
| 178 | window.h | 179 | window.h |
| 179 | search.o: search.c regex.h commands.h buffer.h region-cache.h syntax.h \ | 180 | search.o: search.c regex-emacs.h commands.h buffer.h region-cache.h syntax.h \ |
| 180 | blockinput.h atimer.h systime.h category.h character.h charset.h \ | 181 | blockinput.h atimer.h systime.h category.h character.h charset.h \ |
| 181 | $(INTERVALS_H) lisp.h globals.h $(config_h) | 182 | $(INTERVALS_H) lisp.h globals.h $(config_h) |
| 182 | sound.o: sound.c dispextern.h syssignal.h lisp.h globals.h $(config_h) \ | 183 | sound.o: sound.c dispextern.h syssignal.h lisp.h globals.h $(config_h) \ |
| 183 | atimer.h systime.h ../lib/unistd.h msdos.h | 184 | atimer.h systime.h ../lib/unistd.h msdos.h |
| 184 | syntax.o: syntax.c syntax.h buffer.h commands.h category.h character.h \ | 185 | syntax.o: syntax.c syntax.h buffer.h commands.h category.h character.h \ |
| 185 | keymap.h regex.h $(INTERVALS_H) lisp.h globals.h $(config_h) | 186 | keymap.h regex-emacs.h $(INTERVALS_H) lisp.h globals.h $(config_h) |
| 186 | sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \ | 187 | sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \ |
| 187 | process.h dispextern.h termhooks.h termchar.h termopts.h coding.h \ | 188 | process.h dispextern.h termhooks.h termchar.h termopts.h coding.h \ |
| 188 | frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h lisp.h \ | 189 | frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h lisp.h \ |
diff --git a/src/emacs.c b/src/emacs.c index 130a9f8fc8e..7304bc406eb 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -84,7 +84,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 84 | #include "composite.h" | 84 | #include "composite.h" |
| 85 | #include "dispextern.h" | 85 | #include "dispextern.h" |
| 86 | #include "ptr-bounds.h" | 86 | #include "ptr-bounds.h" |
| 87 | #include "regex.h" | 87 | #include "regex-emacs.h" |
| 88 | #include "sheap.h" | 88 | #include "sheap.h" |
| 89 | #include "syntax.h" | 89 | #include "syntax.h" |
| 90 | #include "sysselect.h" | 90 | #include "sysselect.h" |
| @@ -846,9 +846,9 @@ main (int argc, char **argv) | |||
| 846 | { | 846 | { |
| 847 | rlim_t lim = rlim.rlim_cur; | 847 | rlim_t lim = rlim.rlim_cur; |
| 848 | 848 | ||
| 849 | /* Approximate the amount regex.c needs per unit of | 849 | /* Approximate the amount regex-emacs.c needs per unit of |
| 850 | emacs_re_max_failures, then add 33% to cover the size of the | 850 | emacs_re_max_failures, then add 33% to cover the size of the |
| 851 | smaller stacks that regex.c successively allocates and | 851 | smaller stacks that regex-emacs.c successively allocates and |
| 852 | discards on its way to the maximum. */ | 852 | discards on its way to the maximum. */ |
| 853 | int min_ratio = 20 * sizeof (char *); | 853 | int min_ratio = 20 * sizeof (char *); |
| 854 | int ratio = min_ratio + min_ratio / 3; | 854 | int ratio = min_ratio + min_ratio / 3; |
| @@ -887,7 +887,7 @@ main (int argc, char **argv) | |||
| 887 | lim = newlim; | 887 | lim = newlim; |
| 888 | } | 888 | } |
| 889 | } | 889 | } |
| 890 | /* If the stack is big enough, let regex.c more of it before | 890 | /* If the stack is big enough, let regex-emacs.c more of it before |
| 891 | falling back to heap allocation. */ | 891 | falling back to heap allocation. */ |
| 892 | emacs_re_safe_alloca = max | 892 | emacs_re_safe_alloca = max |
| 893 | (min (lim - extra, SIZE_MAX) * (min_ratio / ratio), | 893 | (min (lim - extra, SIZE_MAX) * (min_ratio / ratio), |
diff --git a/src/regex.c b/src/regex-emacs.c index 6ee13c4c99d..08fc8c67f1c 100644 --- a/src/regex.c +++ b/src/regex-emacs.c | |||
| @@ -53,7 +53,8 @@ | |||
| 53 | #include <stdlib.h> | 53 | #include <stdlib.h> |
| 54 | 54 | ||
| 55 | #ifdef emacs | 55 | #ifdef emacs |
| 56 | /* We need this for `regex.h', and perhaps for the Emacs include files. */ | 56 | /* We need this for `regex-emacs.h', and perhaps for the Emacs include |
| 57 | files. */ | ||
| 57 | # include <sys/types.h> | 58 | # include <sys/types.h> |
| 58 | #endif | 59 | #endif |
| 59 | 60 | ||
| @@ -289,7 +290,7 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 }; | |||
| 289 | #endif | 290 | #endif |
| 290 | 291 | ||
| 291 | /* Get the interface, including the syntax bits. */ | 292 | /* Get the interface, including the syntax bits. */ |
| 292 | #include "regex.h" | 293 | #include "regex-emacs.h" |
| 293 | 294 | ||
| 294 | /* isalpha etc. are used for the character classes. */ | 295 | /* isalpha etc. are used for the character classes. */ |
| 295 | #include <ctype.h> | 296 | #include <ctype.h> |
| @@ -1157,7 +1158,7 @@ reg_syntax_t re_syntax_options; | |||
| 1157 | different, incompatible syntaxes. | 1158 | different, incompatible syntaxes. |
| 1158 | 1159 | ||
| 1159 | The argument SYNTAX is a bit mask comprised of the various bits | 1160 | The argument SYNTAX is a bit mask comprised of the various bits |
| 1160 | defined in regex.h. We return the old syntax. */ | 1161 | defined in regex-emacs.h. We return the old syntax. */ |
| 1161 | 1162 | ||
| 1162 | reg_syntax_t | 1163 | reg_syntax_t |
| 1163 | re_set_syntax (reg_syntax_t syntax) | 1164 | re_set_syntax (reg_syntax_t syntax) |
| @@ -1172,7 +1173,7 @@ WEAK_ALIAS (__re_set_syntax, re_set_syntax) | |||
| 1172 | #endif | 1173 | #endif |
| 1173 | 1174 | ||
| 1174 | /* This table gives an error message for each of the error codes listed | 1175 | /* This table gives an error message for each of the error codes listed |
| 1175 | in regex.h. Obviously the order here has to be same as there. | 1176 | in regex-emacs.h. Obviously the order here has to be same as there. |
| 1176 | POSIX doesn't require that we do anything for REG_NOERROR, | 1177 | POSIX doesn't require that we do anything for REG_NOERROR, |
| 1177 | but why not be nice? */ | 1178 | but why not be nice? */ |
| 1178 | 1179 | ||
| @@ -1474,28 +1475,28 @@ do { \ | |||
| 1474 | char *destination; \ | 1475 | char *destination; \ |
| 1475 | /* Must be int, so when we don't save any registers, the arithmetic \ | 1476 | /* Must be int, so when we don't save any registers, the arithmetic \ |
| 1476 | of 0 + -1 isn't done as unsigned. */ \ | 1477 | of 0 + -1 isn't done as unsigned. */ \ |
| 1477 | \ | 1478 | \ |
| 1478 | DEBUG_STATEMENT (nfailure_points_pushed++); \ | 1479 | DEBUG_STATEMENT (nfailure_points_pushed++); \ |
| 1479 | DEBUG_PRINT ("\nPUSH_FAILURE_POINT:\n"); \ | 1480 | DEBUG_PRINT ("\nPUSH_FAILURE_POINT:\n"); \ |
| 1480 | DEBUG_PRINT (" Before push, next avail: %zd\n", (fail_stack).avail); \ | 1481 | DEBUG_PRINT (" Before push, next avail: %zd\n", (fail_stack).avail); \ |
| 1481 | DEBUG_PRINT (" size: %zd\n", (fail_stack).size);\ | 1482 | DEBUG_PRINT (" size: %zd\n", (fail_stack).size);\ |
| 1482 | \ | 1483 | \ |
| 1483 | ENSURE_FAIL_STACK (NUM_NONREG_ITEMS); \ | 1484 | ENSURE_FAIL_STACK (NUM_NONREG_ITEMS); \ |
| 1484 | \ | 1485 | \ |
| 1485 | DEBUG_PRINT ("\n"); \ | 1486 | DEBUG_PRINT ("\n"); \ |
| 1486 | \ | 1487 | \ |
| 1487 | DEBUG_PRINT (" Push frame index: %zd\n", fail_stack.frame); \ | 1488 | DEBUG_PRINT (" Push frame index: %zd\n", fail_stack.frame); \ |
| 1488 | PUSH_FAILURE_INT (fail_stack.frame); \ | 1489 | PUSH_FAILURE_INT (fail_stack.frame); \ |
| 1489 | \ | 1490 | \ |
| 1490 | DEBUG_PRINT (" Push string %p: \"", string_place); \ | 1491 | DEBUG_PRINT (" Push string %p: \"", string_place); \ |
| 1491 | DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, size2);\ | 1492 | DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, size2);\ |
| 1492 | DEBUG_PRINT ("\"\n"); \ | 1493 | DEBUG_PRINT ("\"\n"); \ |
| 1493 | PUSH_FAILURE_POINTER (string_place); \ | 1494 | PUSH_FAILURE_POINTER (string_place); \ |
| 1494 | \ | 1495 | \ |
| 1495 | DEBUG_PRINT (" Push pattern %p: ", pattern); \ | 1496 | DEBUG_PRINT (" Push pattern %p: ", pattern); \ |
| 1496 | DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern, pend); \ | 1497 | DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern, pend); \ |
| 1497 | PUSH_FAILURE_POINTER (pattern); \ | 1498 | PUSH_FAILURE_POINTER (pattern); \ |
| 1498 | \ | 1499 | \ |
| 1499 | /* Close the frame by moving the frame pointer past it. */ \ | 1500 | /* Close the frame by moving the frame pointer past it. */ \ |
| 1500 | fail_stack.frame = fail_stack.avail; \ | 1501 | fail_stack.frame = fail_stack.avail; \ |
| 1501 | } while (0) | 1502 | } while (0) |
| @@ -1822,7 +1823,7 @@ struct range_table_work_area | |||
| 1822 | #define SETUP_ASCII_RANGE(work_area, FROM, TO) \ | 1823 | #define SETUP_ASCII_RANGE(work_area, FROM, TO) \ |
| 1823 | do { \ | 1824 | do { \ |
| 1824 | int C0, C1; \ | 1825 | int C0, C1; \ |
| 1825 | \ | 1826 | \ |
| 1826 | for (C0 = (FROM); C0 <= (TO); C0++) \ | 1827 | for (C0 = (FROM); C0 <= (TO); C0++) \ |
| 1827 | { \ | 1828 | { \ |
| 1828 | C1 = TRANSLATE (C0); \ | 1829 | C1 = TRANSLATE (C0); \ |
| @@ -1843,7 +1844,7 @@ struct range_table_work_area | |||
| 1843 | do { \ | 1844 | do { \ |
| 1844 | int C0, C1, C2, I; \ | 1845 | int C0, C1, C2, I; \ |
| 1845 | int USED = RANGE_TABLE_WORK_USED (work_area); \ | 1846 | int USED = RANGE_TABLE_WORK_USED (work_area); \ |
| 1846 | \ | 1847 | \ |
| 1847 | for (C0 = (FROM); C0 <= (TO); C0++) \ | 1848 | for (C0 = (FROM); C0 <= (TO); C0++) \ |
| 1848 | { \ | 1849 | { \ |
| 1849 | C1 = RE_CHAR_TO_MULTIBYTE (C0); \ | 1850 | C1 = RE_CHAR_TO_MULTIBYTE (C0); \ |
| @@ -1882,7 +1883,7 @@ struct range_table_work_area | |||
| 1882 | #define SETUP_MULTIBYTE_RANGE(work_area, FROM, TO) \ | 1883 | #define SETUP_MULTIBYTE_RANGE(work_area, FROM, TO) \ |
| 1883 | do { \ | 1884 | do { \ |
| 1884 | int C0, C1, C2, I, USED = RANGE_TABLE_WORK_USED (work_area); \ | 1885 | int C0, C1, C2, I, USED = RANGE_TABLE_WORK_USED (work_area); \ |
| 1885 | \ | 1886 | \ |
| 1886 | SET_RANGE_TABLE_WORK_AREA ((work_area), (FROM), (TO)); \ | 1887 | SET_RANGE_TABLE_WORK_AREA ((work_area), (FROM), (TO)); \ |
| 1887 | for (C0 = (FROM); C0 <= (TO); C0++) \ | 1888 | for (C0 = (FROM); C0 <= (TO); C0++) \ |
| 1888 | { \ | 1889 | { \ |
| @@ -1896,7 +1897,7 @@ struct range_table_work_area | |||
| 1896 | { \ | 1897 | { \ |
| 1897 | int from = RANGE_TABLE_WORK_ELT (work_area, I); \ | 1898 | int from = RANGE_TABLE_WORK_ELT (work_area, I); \ |
| 1898 | int to = RANGE_TABLE_WORK_ELT (work_area, I + 1); \ | 1899 | int to = RANGE_TABLE_WORK_ELT (work_area, I + 1); \ |
| 1899 | \ | 1900 | \ |
| 1900 | if (C1 >= from - 1 && C1 <= to + 1) \ | 1901 | if (C1 >= from - 1 && C1 <= to + 1) \ |
| 1901 | { \ | 1902 | { \ |
| 1902 | if (C1 == from - 1) \ | 1903 | if (C1 == from - 1) \ |
| @@ -2371,7 +2372,7 @@ static boolean group_in_compile_stack (compile_stack_type compile_stack, | |||
| 2371 | regnum_t regnum); | 2372 | regnum_t regnum); |
| 2372 | 2373 | ||
| 2373 | /* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX. | 2374 | /* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX. |
| 2374 | Returns one of error codes defined in `regex.h', or zero for success. | 2375 | Returns one of error codes defined in `regex-emacs.h', or zero for success. |
| 2375 | 2376 | ||
| 2376 | If WHITESPACE_REGEXP is given (only #ifdef emacs), it is used instead of | 2377 | If WHITESPACE_REGEXP is given (only #ifdef emacs), it is used instead of |
| 2377 | a space character in PATTERN. | 2378 | a space character in PATTERN. |
| @@ -2714,15 +2715,15 @@ regex_compile (re_char *pattern, size_t size, | |||
| 2714 | 2715 | ||
| 2715 | if (!zero_times_ok && simple) | 2716 | if (!zero_times_ok && simple) |
| 2716 | { /* Since simple * loops can be made faster by using | 2717 | { /* Since simple * loops can be made faster by using |
| 2717 | on_failure_keep_string_jump, we turn simple P+ | 2718 | on_failure_keep_string_jump, we turn simple P+ |
| 2718 | into PP* if P is simple. */ | 2719 | into PP* if P is simple. */ |
| 2719 | unsigned char *p1, *p2; | 2720 | unsigned char *p1, *p2; |
| 2720 | startoffset = b - laststart; | 2721 | startoffset = b - laststart; |
| 2721 | GET_BUFFER_SPACE (startoffset); | 2722 | GET_BUFFER_SPACE (startoffset); |
| 2722 | p1 = b; p2 = laststart; | 2723 | p1 = b; p2 = laststart; |
| 2723 | while (p2 < p1) | 2724 | while (p2 < p1) |
| 2724 | *b++ = *p2++; | 2725 | *b++ = *p2++; |
| 2725 | zero_times_ok = 1; | 2726 | zero_times_ok = 1; |
| 2726 | } | 2727 | } |
| 2727 | 2728 | ||
| 2728 | GET_BUFFER_SPACE (6); | 2729 | GET_BUFFER_SPACE (6); |
| @@ -6217,7 +6218,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, | |||
| 6217 | 6218 | ||
| 6218 | FREE_VARIABLES (); | 6219 | FREE_VARIABLES (); |
| 6219 | 6220 | ||
| 6220 | return -1; /* Failure to match. */ | 6221 | return -1; /* Failure to match. */ |
| 6221 | } | 6222 | } |
| 6222 | 6223 | ||
| 6223 | /* Subroutine definitions for re_match_2. */ | 6224 | /* Subroutine definitions for re_match_2. */ |
| @@ -6400,7 +6401,7 @@ re_exec (const char *s) | |||
| 6400 | routine will report only success or failure, and nothing about the | 6401 | routine will report only success or failure, and nothing about the |
| 6401 | registers. | 6402 | registers. |
| 6402 | 6403 | ||
| 6403 | It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for | 6404 | It returns 0 if it succeeds, nonzero if it doesn't. (See regex-emacs.h for |
| 6404 | the return codes and their meanings.) */ | 6405 | the return codes and their meanings.) */ |
| 6405 | 6406 | ||
| 6406 | reg_errcode_t | 6407 | reg_errcode_t |
diff --git a/src/regex.h b/src/regex-emacs.h index 3a2d74d86a1..cb6dd76ed3e 100644 --- a/src/regex.h +++ b/src/regex-emacs.h | |||
| @@ -160,9 +160,9 @@ typedef unsigned long reg_syntax_t; | |||
| 160 | 160 | ||
| 161 | /* If this bit is set, turn on internal regex debugging. | 161 | /* If this bit is set, turn on internal regex debugging. |
| 162 | If not set, and debugging was on, turn it off. | 162 | If not set, and debugging was on, turn it off. |
| 163 | This only works if regex.c is compiled -DDEBUG. | 163 | This only works if regex-emacs.c is compiled -DDEBUG. |
| 164 | We define this bit always, so that all that's needed to turn on | 164 | We define this bit always, so that all that's needed to turn on |
| 165 | debugging is to recompile regex.c; the calling code can always have | 165 | debugging is to recompile regex-emacs.c; the calling code can always have |
| 166 | this bit set, and it won't affect anything in the normal case. */ | 166 | this bit set, and it won't affect anything in the normal case. */ |
| 167 | #define RE_DEBUG (RE_NO_NEWLINE_ANCHOR << 1) | 167 | #define RE_DEBUG (RE_NO_NEWLINE_ANCHOR << 1) |
| 168 | 168 | ||
| @@ -317,7 +317,7 @@ extern ptrdiff_t emacs_re_safe_alloca; | |||
| 317 | 317 | ||
| 318 | 318 | ||
| 319 | /* If any error codes are removed, changed, or added, update the | 319 | /* If any error codes are removed, changed, or added, update the |
| 320 | `re_error_msg' table in regex.c. */ | 320 | `re_error_msg' table in regex-emacs.c. */ |
| 321 | typedef enum | 321 | typedef enum |
| 322 | { | 322 | { |
| 323 | #ifdef _XOPEN_SOURCE | 323 | #ifdef _XOPEN_SOURCE |
| @@ -650,5 +650,5 @@ typedef int re_wchar_t; | |||
| 650 | 650 | ||
| 651 | #endif /* not WIDE_CHAR_SUPPORT */ | 651 | #endif /* not WIDE_CHAR_SUPPORT */ |
| 652 | 652 | ||
| 653 | #endif /* regex.h */ | 653 | #endif /* regex-emacs.h */ |
| 654 | 654 | ||
diff --git a/src/search.c b/src/search.c index ccdb659776d..d4b03220412 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -30,7 +30,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 30 | #include "blockinput.h" | 30 | #include "blockinput.h" |
| 31 | #include "intervals.h" | 31 | #include "intervals.h" |
| 32 | 32 | ||
| 33 | #include "regex.h" | 33 | #include "regex-emacs.h" |
| 34 | 34 | ||
| 35 | #define REGEXP_CACHE_SIZE 20 | 35 | #define REGEXP_CACHE_SIZE 20 |
| 36 | 36 | ||
| @@ -290,7 +290,8 @@ looking_at_1 (Lisp_Object string, bool posix) | |||
| 290 | if (running_asynch_code) | 290 | if (running_asynch_code) |
| 291 | save_search_regs (); | 291 | save_search_regs (); |
| 292 | 292 | ||
| 293 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ | 293 | /* This is so set_image_of_range_1 in regex-emacs.c can find the EQV |
| 294 | table. */ | ||
| 294 | set_char_table_extras (BVAR (current_buffer, case_canon_table), 2, | 295 | set_char_table_extras (BVAR (current_buffer, case_canon_table), 2, |
| 295 | BVAR (current_buffer, case_eqv_table)); | 296 | BVAR (current_buffer, case_eqv_table)); |
| 296 | 297 | ||
| @@ -410,7 +411,8 @@ string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, | |||
| 410 | pos_byte = string_char_to_byte (string, pos); | 411 | pos_byte = string_char_to_byte (string, pos); |
| 411 | } | 412 | } |
| 412 | 413 | ||
| 413 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ | 414 | /* This is so set_image_of_range_1 in regex-emacs.c can find the EQV |
| 415 | table. */ | ||
| 414 | set_char_table_extras (BVAR (current_buffer, case_canon_table), 2, | 416 | set_char_table_extras (BVAR (current_buffer, case_canon_table), 2, |
| 415 | BVAR (current_buffer, case_eqv_table)); | 417 | BVAR (current_buffer, case_eqv_table)); |
| 416 | 418 | ||
| @@ -1062,7 +1064,8 @@ search_command (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, | |||
| 1062 | lim_byte = CHAR_TO_BYTE (lim); | 1064 | lim_byte = CHAR_TO_BYTE (lim); |
| 1063 | } | 1065 | } |
| 1064 | 1066 | ||
| 1065 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ | 1067 | /* This is so set_image_of_range_1 in regex-emacs.c can find the EQV |
| 1068 | table. */ | ||
| 1066 | set_char_table_extras (BVAR (current_buffer, case_canon_table), 2, | 1069 | set_char_table_extras (BVAR (current_buffer, case_canon_table), 2, |
| 1067 | BVAR (current_buffer, case_eqv_table)); | 1070 | BVAR (current_buffer, case_eqv_table)); |
| 1068 | 1071 | ||
diff --git a/src/syntax.c b/src/syntax.c index c5a4b03955b..2f9fd05ddf4 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -23,7 +23,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 23 | #include "lisp.h" | 23 | #include "lisp.h" |
| 24 | #include "character.h" | 24 | #include "character.h" |
| 25 | #include "buffer.h" | 25 | #include "buffer.h" |
| 26 | #include "regex.h" | 26 | #include "regex-emacs.h" |
| 27 | #include "syntax.h" | 27 | #include "syntax.h" |
| 28 | #include "intervals.h" | 28 | #include "intervals.h" |
| 29 | #include "category.h" | 29 | #include "category.h" |
| @@ -267,9 +267,10 @@ SETUP_SYNTAX_TABLE (ptrdiff_t from, ptrdiff_t count) | |||
| 267 | If it is t (which is only used in fast_c_string_match_ignore_case), | 267 | If it is t (which is only used in fast_c_string_match_ignore_case), |
| 268 | ignore properties altogether. | 268 | ignore properties altogether. |
| 269 | 269 | ||
| 270 | This is meant for regex.c to use. For buffers, regex.c passes arguments | 270 | This is meant for regex-emacs.c to use. For buffers, regex-emacs.c |
| 271 | to the UPDATE_SYNTAX_TABLE functions which are relative to BEGV. | 271 | passes arguments to the UPDATE_SYNTAX_TABLE functions which are |
| 272 | So if it is a buffer, we set the offset field to BEGV. */ | 272 | relative to BEGV. So if it is a buffer, we set the offset field to |
| 273 | BEGV. */ | ||
| 273 | 274 | ||
| 274 | void | 275 | void |
| 275 | SETUP_SYNTAX_TABLE_FOR_OBJECT (Lisp_Object object, | 276 | SETUP_SYNTAX_TABLE_FOR_OBJECT (Lisp_Object object, |
| @@ -3729,7 +3730,7 @@ syms_of_syntax (void) | |||
| 3729 | staticpro (&gl_state.current_syntax_table); | 3730 | staticpro (&gl_state.current_syntax_table); |
| 3730 | staticpro (&gl_state.old_prop); | 3731 | staticpro (&gl_state.old_prop); |
| 3731 | 3732 | ||
| 3732 | /* Defined in regex.c. */ | 3733 | /* Defined in regex-emacs.c. */ |
| 3733 | staticpro (&re_match_object); | 3734 | staticpro (&re_match_object); |
| 3734 | 3735 | ||
| 3735 | DEFSYM (Qscan_error, "scan-error"); | 3736 | DEFSYM (Qscan_error, "scan-error"); |
diff --git a/src/thread.h b/src/thread.h index 922eea62178..e1eb40921b4 100644 --- a/src/thread.h +++ b/src/thread.h | |||
| @@ -19,7 +19,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 19 | #ifndef THREAD_H | 19 | #ifndef THREAD_H |
| 20 | #define THREAD_H | 20 | #define THREAD_H |
| 21 | 21 | ||
| 22 | #include "regex.h" | 22 | #include "regex-emacs.h" |
| 23 | 23 | ||
| 24 | #ifdef WINDOWSNT | 24 | #ifdef WINDOWSNT |
| 25 | #include <sys/socket.h> | 25 | #include <sys/socket.h> |