[vte] Revert "regex: Disable PCRE2 for 0.44"



commit 30f7bdddd30a6265804c6a82023732415ad3f6e5
Author: Christian Persch <chpe gnome org>
Date:   Sat Feb 13 14:19:34 2016 +0100

    Revert "regex: Disable PCRE2 for 0.44"
    
    This reverts commit ce94be5ea7f68be90849a1147e13747227adf5ee.

 configure.ac                   |    6 +++++-
 doc/reference/vte-docs.xml     |    3 +++
 doc/reference/vte-sections.txt |   12 ++++++++----
 src/Makefile.am                |    7 ++++---
 src/vte/vte.h                  |    1 +
 src/vte/vtedeprecated.h        |   25 +++++++++++++++++++++++++
 src/vte/vteenums.h             |   20 ++++++++++++++++++++
 src/vte/vteterminal.h          |   28 ++++++++++++++--------------
 src/vteapp.c                   |    1 -
 src/vtegtk.cc                  |   28 +++++++++-------------------
 src/vteinternal.hh             |    2 --
 src/vteregexinternal.hh        |    8 --------
 12 files changed, 89 insertions(+), 52 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index fa75442..c1f772c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -234,7 +234,11 @@ AM_CONDITIONAL([WITH_GNUTLS],[test "$with_gnutls" = "yes"])
 
 # PCRE2
 
-with_pcre2=no
+AC_MSG_CHECKING([whether PCRE2 support is requested])
+AC_ARG_WITH([pcre2],
+  [AS_HELP_STRING([--without-pcre2],[Disable pcre2 support])],
+  [],[with_pcre2=yes])
+AC_MSG_RESULT([$with_pcre2])
 
 PCRE2_PKGS=
 if test "$with_pcre2" = "yes"; then
diff --git a/doc/reference/vte-docs.xml b/doc/reference/vte-docs.xml
index 49f7797..0bf076e 100644
--- a/doc/reference/vte-docs.xml
+++ b/doc/reference/vte-docs.xml
@@ -63,6 +63,9 @@
       <xi:include href="xml/vte-terminal.xml"/>
     </chapter>
     <chapter>
+      <xi:include href="xml/vte-regex.xml"/>
+    </chapter>
+    <chapter>
       <xi:include href="xml/vte-pty.xml"/>
     </chapter>
     <chapter>
diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index 5e65e5f..8fa4107 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -54,6 +54,7 @@ vte_terminal_get_text
 vte_terminal_get_text_include_trailing_spaces
 vte_terminal_get_text_range
 vte_terminal_get_cursor_position
+vte_terminal_match_add_regex
 vte_terminal_match_remove
 vte_terminal_match_remove_all
 vte_terminal_match_check
@@ -69,12 +70,11 @@ vte_terminal_get_word_char_exceptions
 vte_terminal_write_contents_sync
 vte_terminal_search_find_next
 vte_terminal_search_find_previous
+vte_terminal_search_get_regex
 vte_terminal_search_get_wrap_around
+vte_terminal_search_set_regex
 vte_terminal_search_set_wrap_around
-vte_terminal_match_add_gregex
-vte_terminal_search_get_gregex
-vte_terminal_search_set_gregex
-vte_terminal_event_check_gregex_simple
+vte_terminal_event_check_regex_simple
 
 <SUBSECTION>
 vte_get_user_shell
@@ -120,6 +120,10 @@ vte_terminal_get_current_file_uri
 
 <SUBSECTION Deprecated>
 vte_terminal_match_set_cursor
+vte_terminal_match_add_gregex
+vte_terminal_search_get_gregex
+vte_terminal_search_set_gregex
+vte_terminal_event_check_gregex_simple
 
 <SUBSECTION Private>
 VteCharAttributes
diff --git a/src/Makefile.am b/src/Makefile.am
index 0b8b66a..8dcf170 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,6 +16,7 @@ header_HEADERS = \
        vte/vteglobals.h \
        vte/vtemacros.h \
        vte/vtepty.h \
+       vte/vteregex.h \
        vte/vteterminal.h \
        $(NULL)
 
@@ -302,9 +303,9 @@ vte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_LDADD = \
 if HAVE_GTK_3_16
 vte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_VALAFLAGS += -D GTK_3_16
 endif
-#if WITH_PCRE2
-#vte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_VALAFLAGS += -D WITH_PCRE2
-#endif
+if WITH_PCRE2
+vte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_VALAFLAGS += -D WITH_PCRE2
+endif
 
 CLEANFILES += \
        app.c \
diff --git a/src/vte/vte.h b/src/vte/vte.h
index f46ff9b..85d267b 100644
--- a/src/vte/vte.h
+++ b/src/vte/vte.h
@@ -26,6 +26,7 @@
 #include "vteenums.h"
 #include "vteglobals.h"
 #include "vtepty.h"
+#include "vteregex.h"
 #include "vteterminal.h"
 #include "vtetypebuiltins.h"
 #include "vteversion.h"
diff --git a/src/vte/vtedeprecated.h b/src/vte/vtedeprecated.h
index a67fb18..b3303e3 100644
--- a/src/vte/vtedeprecated.h
+++ b/src/vte/vtedeprecated.h
@@ -33,6 +33,12 @@ G_BEGIN_DECLS
 
 _VTE_DEPRECATED
 _VTE_PUBLIC
+int vte_terminal_match_add_gregex(VteTerminal *terminal,
+                                  GRegex *gregex,
+                                  GRegexMatchFlags gflags) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
+
+_VTE_DEPRECATED
+_VTE_PUBLIC
 void vte_terminal_match_set_cursor(VteTerminal *terminal,
                                    int tag,
                                    GdkCursor *cursor) _VTE_GNUC_NONNULL(1);
@@ -45,6 +51,25 @@ char *vte_terminal_match_check(VteTerminal *terminal,
 
 _VTE_DEPRECATED
 _VTE_PUBLIC
+gboolean vte_terminal_event_check_gregex_simple(VteTerminal *terminal,
+                                                GdkEvent *event,
+                                                GRegex **regexes,
+                                                gsize n_regexes,
+                                                GRegexMatchFlags match_flags,
+                                                char **matches) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
+
+_VTE_DEPRECATED
+_VTE_PUBLIC
+void      vte_terminal_search_set_gregex      (VteTerminal *terminal,
+                                              GRegex      *gregex,
+                                               GRegexMatchFlags gflags) _VTE_GNUC_NONNULL(1);
+
+_VTE_DEPRECATED
+_VTE_PUBLIC
+GRegex   *vte_terminal_search_get_gregex      (VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
+
+_VTE_DEPRECATED
+_VTE_PUBLIC
 void vte_pty_close (VtePty *pty) _VTE_GNUC_NONNULL(1);
 
 G_END_DECLS
diff --git a/src/vte/vteenums.h b/src/vte/vteenums.h
index ceb2486..a0777bb 100644
--- a/src/vte/vteenums.h
+++ b/src/vte/vteenums.h
@@ -117,6 +117,26 @@ typedef enum {
   VTE_WRITE_DEFAULT = 0
 } VteWriteFlags;
 
+/**
+ * VteRegexError:
+ * @VTE_REGEX_ERROR_INCOMPATIBLE: The PCRE2 library was built without
+ *   Unicode support which is required for VTE
+ * @VTE_REGEX_ERROR_NOT_SUPPORTED: Regexes are not supported because VTE was
+ *   built without PCRE2 support
+ *
+ * An enum type for regex errors. In addition to the values listed above,
+ * any PCRE2 error values may occur.
+ *
+ * Since: 0.44
+ */
+typedef enum {
+        /* Negative values are PCRE2 errors */
+
+        /* VTE specific values */
+        VTE_REGEX_ERROR_INCOMPATIBLE  = G_MAXINT-1,
+        VTE_REGEX_ERROR_NOT_SUPPORTED = G_MAXINT
+} VteRegexError;
+
 G_END_DECLS
 
 #endif /* __VTE_VTE_ENUMS_H__ */
diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h
index 38ea8c3..c5b900e 100644
--- a/src/vte/vteterminal.h
+++ b/src/vte/vteterminal.h
@@ -31,6 +31,7 @@
 #include "vteenums.h"
 #include "vtemacros.h"
 #include "vtepty.h"
+#include "vteregex.h"
 
 G_BEGIN_DECLS
 
@@ -337,9 +338,9 @@ void vte_terminal_get_cursor_position(VteTerminal *terminal,
 /* Add a matching expression, returning the tag the widget assigns to that
  * expression. */
 _VTE_PUBLIC
-int vte_terminal_match_add_gregex(VteTerminal *terminal,
-                                  GRegex *gregex,
-                                  GRegexMatchFlags gflags) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
+int vte_terminal_match_add_regex(VteTerminal *terminal,
+                                 VteRegex *regex,
+                                 guint32 flags) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
 /* Set the cursor to be used when the pointer is over a given match. */
 _VTE_PUBLIC
 void vte_terminal_match_set_cursor_type(VteTerminal *terminal,
@@ -363,20 +364,19 @@ char *vte_terminal_match_check_event(VteTerminal *terminal,
                                      GdkEvent *event,
                                      int *tag) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2) G_GNUC_MALLOC;
 _VTE_PUBLIC
-gboolean vte_terminal_event_check_gregex_simple(VteTerminal *terminal,
-                                                GdkEvent *event,
-                                                GRegex **regexes,
-                                                gsize n_regexes,
-                                                GRegexMatchFlags match_flags,
-                                                char **matches) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
+gboolean vte_terminal_event_check_regex_simple(VteTerminal *terminal,
+                                               GdkEvent *event,
+                                               VteRegex **regexes,
+                                               gsize n_regexes,
+                                               guint32 match_flags,
+                                               char **matches) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
 
 _VTE_PUBLIC
-void      vte_terminal_search_set_gregex      (VteTerminal *terminal,
-                                              GRegex      *gregex,
-                                               GRegexMatchFlags gflags) _VTE_GNUC_NONNULL(1);
+void      vte_terminal_search_set_regex      (VteTerminal *terminal,
+                                              VteRegex    *regex,
+                                              guint32      flags) _VTE_GNUC_NONNULL(1);
 _VTE_PUBLIC
-GRegex   *vte_terminal_search_get_gregex      (VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
-
+VteRegex *vte_terminal_search_get_regex      (VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
 _VTE_PUBLIC
 void      vte_terminal_search_set_wrap_around (VteTerminal *terminal,
                                               gboolean     wrap_around) _VTE_GNUC_NONNULL(1);
diff --git a/src/vteapp.c b/src/vteapp.c
index e82079e..580cbe9 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -31,7 +31,6 @@
 #include "debug.h"
 
 #undef VTE_DISABLE_DEPRECATED
-#undef WITH_PCRE2
 #include <vte/vte.h>
 
 #ifdef WITH_PCRE2
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index 566c74d..025bdd1 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -84,25 +84,6 @@ G_DEFINE_TYPE_WITH_CODE(VteTerminal, vte_terminal, GTK_TYPE_WIDGET,
 
 #define IMPL(t) (reinterpret_cast<VteTerminalPrivate*>(vte_terminal_get_instance_private(t)))
 
-
-int vte_terminal_match_add_regex(VteTerminal *terminal,
-                                 VteRegex *regex,
-                                 guint32 flags);
-
-gboolean vte_terminal_event_check_regex_simple(VteTerminal *terminal,
-                                               GdkEvent *event,
-                                               VteRegex **regexes,
-                                               gsize n_regexes,
-                                               guint32 match_flags,
-                                               char **matches);
-
-void      vte_terminal_search_set_regex      (VteTerminal *terminal,
-                                              VteRegex    *regex,
-                                              guint32      flags);
-
-VteRegex *vte_terminal_search_get_regex      (VteTerminal *terminal);
-
-
 guint signals[LAST_SIGNAL];
 GParamSpec *pspecs[LAST_PROP];
 GTimer *process_timer;
@@ -1696,6 +1677,8 @@ vte_terminal_paste_primary(VteTerminal *terminal)
  *
  * Returns: an integer associated with this expression, or -1 if @gregex could not be
  *   transformed into a #VteRegex or @flags were incompatible
+ *
+ * Deprecated: 0.44: Use vte_terminal_match_add_regex() or vte_terminal_match_add_regex_full() instead.
  */
 int
 vte_terminal_match_add_gregex(VteTerminal *terminal,
@@ -1867,6 +1850,9 @@ vte_terminal_event_check_regex_simple(VteTerminal *terminal,
  * %NULL is stored there.
  *
  * Returns: %TRUE iff any of the regexes produced a match
+ *
+ * Since: 0.44
+ * Deprecated: 0.44: Use vte_terminal_event_check_regex_simple() instead.
  */
 gboolean
 vte_terminal_event_check_gregex_simple(VteTerminal *terminal,
@@ -2052,6 +2038,8 @@ vte_terminal_search_get_regex(VteTerminal *terminal)
  * @gflags: flags from #GRegexMatchFlags
  *
  * Sets the #GRegex regex to search for. Unsets the search regex when passed %NULL.
+ *
+ * Deprecated: 0.44: use vte_terminal_search_set_regex() instead.
  */
 void
 vte_terminal_search_set_gregex (VteTerminal *terminal,
@@ -2068,6 +2056,8 @@ vte_terminal_search_set_gregex (VteTerminal *terminal,
  * @terminal: a #VteTerminal
  *
  * Returns: (transfer none): the search #GRegex regex set in @terminal, or %NULL
+ *
+ * Deprecated: 0.44: use vte_terminal_search_get_regex() instead.
  */
 GRegex *
 vte_terminal_search_get_gregex (VteTerminal *terminal)
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 04edeeb..99da6d4 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -31,8 +31,6 @@
 #include "vteregexinternal.hh"
 #endif
 
-#include "vteregex.h"
-
 typedef enum {
         VTE_REGEX_UNDECIDED,
         VTE_REGEX_PCRE2,
diff --git a/src/vteregexinternal.hh b/src/vteregexinternal.hh
index 588f0b1..b12d25a 100644
--- a/src/vteregexinternal.hh
+++ b/src/vteregexinternal.hh
@@ -22,11 +22,3 @@ gboolean _vte_regex_get_jited(VteRegex *regex);
 #ifdef WITH_PCRE2
 const pcre2_code_8 *_vte_regex_get_pcre (VteRegex *regex);
 #endif
-
-typedef enum {
-        /* Negative values are PCRE2 errors */
-
-        /* VTE specific values */
-        VTE_REGEX_ERROR_INCOMPATIBLE  = G_MAXINT-1,
-        VTE_REGEX_ERROR_NOT_SUPPORTED = G_MAXINT
-} VteRegexError;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]