aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert2018-08-05 18:41:20 -0700
committerPaul Eggert2018-08-05 19:36:09 -0700
commitd904cc83f3036db96107a3976cee1a0112547de6 (patch)
tree7186eee577f0112462a024368c014819c4055152 /lib-src
parente5652268a993ad9117f7253553c143d60460eb8f (diff)
downloademacs-d904cc83f3036db96107a3976cee1a0112547de6.tar.gz
emacs-d904cc83f3036db96107a3976cee1a0112547de6.zip
Use Gnulib regex for lib-src
Emacs regular expressions forked from everyone else long ago. This makes it official and should allow simplification later. etags.c now uses the glibc regex API, falling back on a Gnulib-supplied substitute lib/regex.c if necessary. Emacs proper now uses its own regular expression module. Although this patch may look dauntingly large, most of it was generated automatically by admin/merge-gnulib and contains an exact copy of the glibc regex source, and the by-hand changes do not grow the Emacs source code. * admin/merge-gnulib (GNULIB_MODULES): Add regex. (AVOIDED_MODULES): Add btowc, langinfo, lock, mbrtowc, mbsinit, nl_langinfo, wchar, wcrtomb, wctype-h. * lib-src/Makefile.in (regex-emacs.o): Remove; Gnulib does it now. (etags_deps, etags_libs): Remove regex-emacs.o. * lib-src/etags.c: Go back to including regex.h. (add_regex): Use unsigned char translation array, since glibc regex requires that. * lib/Makefile.in (not_emacs_OBJECTS, for_emacs_OBJECTS): New macros. (libegnu_a_OBJECTS): Use them, to avoid building e-regex.o. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib/regcomp.c, lib/regex.c, lib/regex.h, lib/regex_internal.c: * lib/regex_internal.h, lib/regexec.c, m4/builtin-expect.m4: * m4/eealloc.m4, m4/glibc21.m4, m4/mbstate_t.m4, m4/regex.m4: New files, copied from Gnulib. * src/regex-emacs.h, src/conf_post.h: (RE_TRANSLATE_TYPE, RE_TRANSLATE, RE_TRANSLATE_P): Move from src/conf_post.h to src/regex-emacs.h, so that they don’t interfere with compiling lib/regex.c.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/Makefile.in8
-rw-r--r--lib-src/etags.c4
2 files changed, 4 insertions, 8 deletions
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index e70b23c4b3f..b2b901788a5 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -361,13 +361,9 @@ TAGS: etags${EXEEXT} ${tagsfiles}
361../lib/libgnu.a: $(config_h) 361../lib/libgnu.a: $(config_h)
362 $(MAKE) -C ../lib all 362 $(MAKE) -C ../lib all
363 363
364regex-emacs.o: $(srcdir)/../src/regex-emacs.c $(srcdir)/../src/regex-emacs.h $(config_h) 364etags_deps = ${srcdir}/etags.c $(NTLIB) $(config_h)
365 $(AM_V_CC)$(CC) -c $(CPP_CFLAGS) $<
366
367
368etags_deps = ${srcdir}/etags.c regex-emacs.o $(NTLIB) $(config_h)
369etags_cflags = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" -o $@ 365etags_cflags = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" -o $@
370etags_libs = regex-emacs.o $(NTLIB) $(LOADLIBES) 366etags_libs = $(NTLIB) $(LOADLIBES)
371 367
372etags${EXEEXT}: ${etags_deps} 368etags${EXEEXT}: ${etags_deps}
373 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs) 369 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs)
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 47d13116db6..ee506703436 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -135,7 +135,7 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
135#endif 135#endif
136 136
137#include <getopt.h> 137#include <getopt.h>
138#include <regex-emacs.h> 138#include <regex.h>
139 139
140/* Define CTAGS to make the program "ctags" compatible with the usual one. 140/* Define CTAGS to make the program "ctags" compatible with the usual one.
141 Leave it undefined to make the program "etags", which makes emacs-style 141 Leave it undefined to make the program "etags", which makes emacs-style
@@ -6401,7 +6401,7 @@ add_regex (char *regexp_pattern, language *lang)
6401 *patbuf = zeropattern; 6401 *patbuf = zeropattern;
6402 if (ignore_case) 6402 if (ignore_case)
6403 { 6403 {
6404 static char lc_trans[UCHAR_MAX + 1]; 6404 static unsigned char lc_trans[UCHAR_MAX + 1];
6405 int i; 6405 int i;
6406 for (i = 0; i < UCHAR_MAX + 1; i++) 6406 for (i = 0; i < UCHAR_MAX + 1; i++)
6407 lc_trans[i] = c_tolower (i); 6407 lc_trans[i] = c_tolower (i);