[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    PCRE regexp patch.
From:       Michael Bedy <mjbedy () mediaone ! net>
Date:       2001-02-03 3:56:26
[Download RAW message or body]

With this patch, www.qixo.com (which uses many regexps) works (more)
correctly. This library (libpcre3) was already installed on my debian
system, I don't know about other distros.

  This patch does not fix up the rest of the missing regexp features, but
it should now be doable. (Any page that uses enough regex features to need
the fancier interface to .match would be totally screwed with POSIX regex
anyway, so this is kind of a necessary condition of finishing the rest of 
it.)

  This probably should not be checked in now because of the feature
freeze? Or is this (as a non-user visible patch) still cool to be checked
in?

  Could someone more well versed in autoconf etc. check out what I did? I
am not very well versed in autofoo and Made It Up On The Spot(tm).

  I checked out the c++ interface at regx.sourceforge.net, and desided I
liked the C interface better for this particular application. One, the C++
version was more compilcated and I'm lazy. Two, using the POSIX interface
to pcre means the same code can still work on systems with only POSIX
regexs. (A broken kind of 'work' though it may be.) Of course, if someone
really really wants to use the c++ interface, I guess it can be done.

  See ya,
    - Mike


["kjspcre.diff" (TEXT/PLAIN)]

Index: Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kjs/Makefile.am,v
retrieving revision 1.12
diff -u -r1.12 Makefile.am
--- Makefile.am	2001/01/23 17:16:25	1.12
+++ Makefile.am	2001/02/03 03:38:21
@@ -40,7 +40,7 @@
 	debugger.h
 
 libkjs_la_LDFLAGS = -version-info 1:0 -no-undefined
-libkjs_la_LIBADD = -lm
+libkjs_la_LIBADD = -lm $(LIBPCRE)
 
 parser: $(srcdir)/grammar.y
 	cd $(srcdir); \
Index: configure.in.in
===================================================================
RCS file: /home/kde/kdelibs/kjs/configure.in.in,v
retrieving revision 1.1
diff -u -r1.1 configure.in.in
--- configure.in.in	2000/05/29 20:56:36	1.1
+++ configure.in.in	2001/02/03 03:38:21
@@ -10,3 +10,6 @@
 AC_CHECK_LIB(m, isnan, [
   AC_DEFINE_UNQUOTED(HAVE_FUNC_ISNAN, 1, [Define if you have isnan])
 ])
+
+AC_CHECK_HEADERS(pcreposix.h, [LIBPCRE='-lpcre -lpcreposix'])
+AC_SUBST(LIBPCRE)
Index: regexp.h
===================================================================
RCS file: /home/kde/kdelibs/kjs/regexp.h,v
retrieving revision 1.4
diff -u -r1.4 regexp.h
--- regexp.h	2000/12/11 16:06:23	1.4
+++ regexp.h	2001/02/03 03:38:21
@@ -21,9 +21,18 @@
 #define _KJS_REGEXP_H_
 
 #include <sys/types.h>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef HAVE_PCREPOSIX_H
+#include <pcreposix.h>
+#else  // POSIX regex - not so good...
 extern "C" { // bug with some libc5 distributions
 #include <regex.h>
 }
+#endif //HAVE_PCREPOSIX_H
 
 #include "ustring.h"
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic