balsa r7913 - in trunk: . libbalsa src
- From: PeterB svn gnome org
- To: svn-commits-list gnome org
- Subject: balsa r7913 - in trunk: . libbalsa src
- Date: Tue, 22 Apr 2008 02:27:12 +0100 (BST)
Author: PeterB
Date: Tue Apr 22 01:27:12 2008
New Revision: 7913
URL: http://svn.gnome.org/viewvc/balsa?rev=7913&view=rev
Log:
disable GRegex and PCRE by default
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/libbalsa/filter-funcs.c
trunk/libbalsa/filter-private.h
trunk/libbalsa/mime.c
trunk/libbalsa/misc.h
trunk/src/balsa-app.c
trunk/src/balsa-app.h
trunk/src/balsa-mime-widget-text.c
trunk/src/balsa-print-object-text.c
trunk/src/print.c
trunk/src/quote-color.c
trunk/src/quote-color.h
trunk/src/sendmsg-window.c
trunk/src/spell-check.c
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Tue Apr 22 01:27:12 2008
@@ -176,8 +176,14 @@
AC_ARG_ENABLE([pcre],
AC_HELP_STRING([--enable-pcre],
- [Use Perl-compatible regular expressions if available (default=yes)]),
- [ check_pcre=$enableval],[ check_pcre=yes ])
+ [Use Perl-compatible regular expressions if available (default=no)]),
+ [ check_pcre=$enableval],[ check_pcre=no ])
+
+
+AC_ARG_ENABLE([gregex],
+ AC_HELP_STRING([--enable-gregex],
+ [Use GRegex regular expressions if available (default=no)]),
+ [ check_gregex=$enableval],[ check_gregex=no ])
AC_ARG_WITH(esmtp,
@@ -568,9 +574,15 @@
# PCRE configuration.
#
-AC_MSG_CHECKING(whether to use PCRE)
-if $PKG_CONFIG --atleast-version=2.14.0 glib-2.0; then
- AC_MSG_RESULT(glib)
+AC_MSG_CHECKING(Regular expressions)
+if test x"$check_gregex" = xyes ; then
+ if $PKG_CONFIG --atleast-version=2.14.0 glib-2.0; then
+ AC_MSG_RESULT(GRegex)
+ AC_DEFINE(USE_GREGEX,1,[Defined when GRegex is to be used.])
+ else
+ AC_MSG_ERROR([*** You enabled GRegex but glib is too old. Please
+ upgrade glib to version at least 2.14.0.])
+ fi
else
if test x"$check_pcre" = xyes ; then
if pcre-config --libs-posix > /dev/null 2>&1; then
@@ -584,7 +596,7 @@
fi
if test x"$have_pcre" = xyes ; then
- AC_MSG_RESULT(yes)
+ AC_MSG_RESULT(PCRE)
BALSA_CFLAGS="$BALSA_CFLAGS `pcre-config --cflags-posix`"
PCRE_LIBS="`pcre-config --libs-posix`"
AC_SUBST(PCRE_LIBS)
@@ -596,7 +608,7 @@
fi
else
have_pcre=no
- AC_MSG_RESULT(no)
+ AC_MSG_RESULT(POSIX)
fi
fi
Modified: trunk/libbalsa/filter-funcs.c
==============================================================================
--- trunk/libbalsa/filter-funcs.c (original)
+++ trunk/libbalsa/filter-funcs.c Tue Apr 22 01:27:12 2008
@@ -385,11 +385,11 @@
g_free(reg->string);
if (reg->compiled)
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
g_regex_unref(reg->compiled);
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
regfree(reg->compiled);
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
} /* end condition_regex_free() */
void
Modified: trunk/libbalsa/filter-private.h
==============================================================================
--- trunk/libbalsa/filter-private.h (original)
+++ trunk/libbalsa/filter-private.h Tue Apr 22 01:27:12 2008
@@ -28,14 +28,14 @@
#ifndef __FILTER_PRIVATE_H__
#define __FILTER_PRIVATE_H__
-#if !GLIB_CHECK_VERSION(2, 14, 0)
+#if !USE_GREGEX
# ifdef HAVE_PCRE
# include <pcreposix.h>
# else
# include <sys/types.h>
# include <regex.h>
# endif
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
/* regex options */
@@ -45,11 +45,11 @@
/* regex struct */
struct _LibBalsaConditionRegex {
gchar *string;
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
GRegex *compiled;
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
regex_t *compiled;
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
};
#endif /* __FILTER_PRIVATE_H__ */
Modified: trunk/libbalsa/mime.c
==============================================================================
--- trunk/libbalsa/mime.c (original)
+++ trunk/libbalsa/mime.c Tue Apr 22 01:27:12 2008
@@ -670,11 +670,11 @@
static gboolean prescanner(const gchar * p);
static void mark_urls(GtkTextBuffer * buffer, GtkTextIter * iter,
GtkTextTag * tag, const gchar * p);
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
static GRegex *get_url_reg(void);
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
static regex_t *get_url_reg(void);
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
void
libbalsa_unwrap_buffer(GtkTextBuffer * buffer, GtkTextIter * iter,
@@ -782,7 +782,7 @@
const gchar * line)
{
const gchar *p = line;
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
GRegex *url_reg = get_url_reg();
GMatchInfo *url_match;
GtkTextIter start = *iter;
@@ -806,7 +806,7 @@
break;
}
g_match_info_free(url_match);
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
regex_t *url_reg = get_url_reg();
regmatch_t url_match;
GtkTextIter start = *iter;
@@ -823,7 +823,7 @@
if (!prescanner(p))
break;
}
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
}
/* Prepare the buffer for sending with DelSp=Yes. */
@@ -898,7 +898,7 @@
return FALSE;
}
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
struct url_regex_info {
GRegex *url_reg;
const gchar *str;
@@ -961,7 +961,7 @@
return get_url_helper(&info);
}
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
static regex_t *
get_url_reg(void)
{
@@ -1019,7 +1019,7 @@
return url_reg;
}
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
gboolean
libbalsa_insert_with_url(GtkTextBuffer * buffer,
@@ -1070,7 +1070,7 @@
if (prescanner(p)) {
gint offset = 0;
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
GRegex *url_reg = get_url_reg();
GMatchInfo *url_match;
gboolean match = g_regex_match(url_reg, p, 0, &url_match);
@@ -1183,7 +1183,7 @@
match = FALSE;
}
g_match_info_free(url_match);
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
regex_t *url_reg = get_url_reg();
regmatch_t url_match;
gboolean match = regexec(url_reg, p, 1, &url_match, 0) == 0;
@@ -1287,7 +1287,7 @@
else
match = FALSE;
}
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
}
}
@@ -1299,11 +1299,11 @@
}
void
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
libbalsa_unwrap_selection(GtkTextBuffer * buffer, GRegex * rex)
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
libbalsa_unwrap_selection(GtkTextBuffer * buffer, regex_t * rex)
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
{
GtkTextIter start, end;
gchar *line;
@@ -1374,7 +1374,7 @@
}
}
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
gboolean
libbalsa_match_regex(const gchar * line, GRegex * rex, guint * count,
guint * index)
@@ -1401,7 +1401,7 @@
*index = p - line;
return c > 0;
}
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
gboolean
libbalsa_match_regex(const gchar * line, regex_t * rex, guint * count,
guint * index)
@@ -1419,4 +1419,4 @@
*index = p - line;
return c > 0;
}
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
Modified: trunk/libbalsa/misc.h
==============================================================================
--- trunk/libbalsa/misc.h (original)
+++ trunk/libbalsa/misc.h Tue Apr 22 01:27:12 2008
@@ -31,14 +31,14 @@
#include <auth-client.h>
#endif
-#if !GLIB_CHECK_VERSION(2, 14, 0)
+#if 1 || !USE_GREGEX
# ifdef HAVE_PCRE
# include <pcreposix.h>
# else
# include <sys/types.h>
# include <regex.h>
# endif
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
typedef enum _LibBalsaCodeset LibBalsaCodeset;
@@ -143,15 +143,15 @@
const char *all_chars,
GtkTextTag * tag,
LibBalsaUrlInsertInfo *url_info);
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
void libbalsa_unwrap_selection(GtkTextBuffer * buffer, GRegex * rex);
gboolean libbalsa_match_regex(const gchar * line, GRegex * rex,
guint * count, guint * index);
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
void libbalsa_unwrap_selection(GtkTextBuffer * buffer, regex_t * rex);
gboolean libbalsa_match_regex(const gchar * line, regex_t * rex,
guint * count, guint * index);
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
int libbalsa_safe_open (const char *path, int flags, mode_t mode);
int libbalsa_lock_file (const char *path, int fd, int excl, int dot, int timeout);
Modified: trunk/src/balsa-app.c
==============================================================================
--- trunk/src/balsa-app.c (original)
+++ trunk/src/balsa-app.c Tue Apr 22 01:27:12 2008
@@ -886,7 +886,7 @@
return NULL;
}
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
GRegex *
balsa_quote_regex_new(void)
{
@@ -914,4 +914,4 @@
return g_regex_ref(regex);
}
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
Modified: trunk/src/balsa-app.h
==============================================================================
--- trunk/src/balsa-app.h (original)
+++ trunk/src/balsa-app.h Tue Apr 22 01:27:12 2008
@@ -453,8 +453,8 @@
void balsa_remove_children_mailbox_nodes(BalsaMailboxNode * mbnode);
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
GRegex *balsa_quote_regex_new(void);
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
#endif /* __BALSA_APP_H__ */
Modified: trunk/src/balsa-mime-widget-text.c
==============================================================================
--- trunk/src/balsa-mime-widget-text.c (original)
+++ trunk/src/balsa-mime-widget-text.c Tue Apr 22 01:27:12 2008
@@ -127,11 +127,11 @@
size_t alloced;
BalsaMimeWidget *mw;
GtkTextBuffer *buffer;
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
GRegex *rex;
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
regex_t rex;
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
GList *url_list = NULL;
const gchar *target_cs;
GError *err = NULL;
@@ -236,16 +236,16 @@
gtk_text_buffer_create_tag(buffer, "soft", NULL, NULL);
allocate_quote_colors(GTK_WIDGET(bm), balsa_app.quoted_color,
0, MAX_QUOTED_COLOR - 1);
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
if (!(rex = balsa_quote_regex_new()))
gtk_text_buffer_insert_at_cursor(buffer, ptr, -1);
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
if (regcomp(&rex, balsa_app.quote_regex, REG_EXTENDED) != 0) {
g_warning
("part_info_init_mimetext: quote regex compilation failed.");
gtk_text_buffer_insert_at_cursor(buffer, ptr, -1);
}
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
else {
gchar *line_start;
LibBalsaUrlInsertInfo url_info;
@@ -292,11 +292,11 @@
guint cite_idx;
/* get the cite level only for text/plain parts */
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
libbalsa_match_regex(this_line, rex, "e_level, &cite_idx);
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
libbalsa_match_regex(this_line, &rex, "e_level, &cite_idx);
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
/* check if the citation level changed */
if (cite_level != quote_level) {
@@ -358,11 +358,11 @@
g_signal_connect_after(G_OBJECT(mw->widget), "expose-event",
G_CALLBACK(draw_cite_bars), cite_bars_list);
}
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
g_regex_unref(rex);
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
regfree(&rex);
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
}
prepare_url_offsets(buffer, url_list);
Modified: trunk/src/balsa-print-object-text.c
==============================================================================
--- trunk/src/balsa-print-object-text.c (original)
+++ trunk/src/balsa-print-object-text.c Tue Apr 22 01:27:12 2008
@@ -132,11 +132,11 @@
LibBalsaMessageBody * body,
BalsaPrintSetup * psetup)
{
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
GRegex *rex;
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
regex_t rex;
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
gchar *textbuf;
PangoFontDescription *font;
gdouble c_at_x;
@@ -147,11 +147,11 @@
gint par_len;
/* set up the regular expression for qouted text */
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
if (!(rex = balsa_quote_regex_new()))
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
if (regcomp(&rex, balsa_app.quote_regex, REG_EXTENDED) != 0)
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
return balsa_print_object_default(list, context, body, psetup);
/* start on new page if less than 2 lines can be printed */
@@ -218,13 +218,13 @@
thispar = g_strndup(par_start, par_len);
/* get the cite level and strip off the prefix */
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
if (libbalsa_match_regex
(thispar, rex, &cite_level, &cite_idx))
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
if (libbalsa_match_regex
(thispar, &rex, &cite_level, &cite_idx))
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
{
gchar *new;
@@ -330,9 +330,9 @@
/* clean up */
pango_font_description_free(font);
g_free(textbuf);
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
g_regex_unref(rex);
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
return list;
}
Modified: trunk/src/print.c
==============================================================================
--- trunk/src/print.c (original)
+++ trunk/src/print.c Tue Apr 22 01:27:12 2008
@@ -53,14 +53,14 @@
#include <libbalsa.h>
#include "html.h"
-#if !GLIB_CHECK_VERSION(2, 14, 0)
+#if !USE_GREGEX
# ifdef HAVE_PCRE
# include <pcreposix.h>
# else
# include <sys/types.h>
# include <regex.h>
# endif
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
#include "quote-color.h"
@@ -787,25 +787,25 @@
{
gchar *ptr, *line = str;
gchar *eol;
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
GRegex *rex = NULL;
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
regex_t rex;
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
gboolean checkQuote = balsa_app.print_highlight_cited;
GList *wrappedLines = NULL;
gdouble space_width = gnome_font_get_width_utf8(font, " ");
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
if (checkQuote && !(rex = balsa_quote_regex_new()))
checkQuote = FALSE;
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
if (checkQuote)
if (regcomp(&rex, balsa_app.quote_regex, REG_EXTENDED) != 0) {
g_warning("quote regex compilation failed.");
checkQuote = FALSE;
}
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
g_strchomp(str);
while (line) {
@@ -817,11 +817,11 @@
if (eol)
*eol = '\0';
ptr = line;
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
lineInfo->quoteLevel = checkQuote ? is_a_quote(ptr, rex) : 0;
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
lineInfo->quoteLevel = checkQuote ? is_a_quote(ptr, &rex) : 0;
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
while (*ptr) {
gint pos = 0;
gint last_space = 0;
@@ -870,11 +870,11 @@
}
if (checkQuote)
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
g_regex_unref(rex);
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
regfree(&rex);
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
return g_list_reverse(wrappedLines);
}
Modified: trunk/src/quote-color.c
==============================================================================
--- trunk/src/quote-color.c (original)
+++ trunk/src/quote-color.c Tue Apr 22 01:27:12 2008
@@ -63,11 +63,11 @@
* an integer saying how many levels deep.
* */
guint
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
is_a_quote(const gchar * str, GRegex * rex)
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
is_a_quote(const gchar * str, regex_t * rex)
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
{
guint cnt;
Modified: trunk/src/quote-color.h
==============================================================================
--- trunk/src/quote-color.h (original)
+++ trunk/src/quote-color.h Tue Apr 22 01:27:12 2008
@@ -31,21 +31,21 @@
#endif
#include "config.h"
-#if !GLIB_CHECK_VERSION(2, 14, 0)
+#if !USE_GREGEX
# ifdef HAVE_PCRE
# include <pcreposix.h>
# else
# include <sys/types.h>
# include <regex.h>
# endif
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
extern void make_gradient(GdkColor colors[], gint, gint);
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
extern guint is_a_quote(const gchar *, GRegex * rex);
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
extern guint is_a_quote(const gchar *, regex_t * rex);
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
extern void allocate_quote_colors(GtkWidget *, GdkColor color[], gint, gint);
Modified: trunk/src/sendmsg-window.c
==============================================================================
--- trunk/src/sendmsg-window.c (original)
+++ trunk/src/sendmsg-window.c Tue Apr 22 01:27:12 2008
@@ -6316,26 +6316,26 @@
{
GtkTextView *text_view;
GtkTextBuffer *buffer;
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
GRegex *rex;
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
regex_t rex;
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
if (!bsmsg->flow)
return;
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
if (!(rex = balsa_quote_regex_new()))
return;
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
if (regcomp(&rex, balsa_app.quote_regex, REG_EXTENDED)) {
balsa_information(LIBBALSA_INFORMATION_WARNING,
_("Could not compile %s"),
_("Quoted Text Regular Expression"));
return;
}
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
#if !HAVE_GTKSOURCEVIEW
sw_buffer_save(bsmsg);
@@ -6344,11 +6344,11 @@
text_view = GTK_TEXT_VIEW(bsmsg->text);
buffer = gtk_text_view_get_buffer(text_view);
sw_buffer_signals_block(bsmsg, buffer);
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
libbalsa_unwrap_selection(buffer, rex);
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
libbalsa_unwrap_selection(buffer, &rex);
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
sw_buffer_signals_unblock(bsmsg, buffer);
bsmsg->state = SENDMSG_STATE_MODIFIED;
@@ -6356,11 +6356,11 @@
gtk_text_buffer_get_insert(buffer),
0, FALSE, 0, 0);
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
g_regex_unref(rex);
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
regfree(&rex);
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
}
/* To field "changed" signal callback. */
Modified: trunk/src/spell-check.c
==============================================================================
--- trunk/src/spell-check.c (original)
+++ trunk/src/spell-check.c Tue Apr 22 01:27:12 2008
@@ -32,14 +32,14 @@
#include <string.h>
#include <glib/gi18n.h>
-#if !GLIB_CHECK_VERSION(2, 14, 0)
+#if !USE_GREGEX
# ifdef HAVE_PCRE
# include <pcreposix.h>
# else
# include <sys/types.h>
# include <regex.h>
# endif
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
#include "balsa-app.h"
#include "quote-color.h"
@@ -804,11 +804,11 @@
* PSpellManager to do the checking.
* */
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
static GRegex *quoted_rex;
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
static regex_t quoted_rex;
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
static gboolean quoted_rex_compiled = FALSE;
void
@@ -891,7 +891,7 @@
* balsa_app.quote_regex may change, so compile it new every
* time!)
*/
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
if (quoted_rex_compiled)
g_regex_unref(quoted_rex);
quoted_rex = balsa_quote_regex_new();
@@ -899,7 +899,7 @@
quoted_rex_compiled = FALSE;
else
quoted_rex_compiled = TRUE;
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
if (quoted_rex_compiled)
regfree("ed_rex);
if (regcomp("ed_rex, balsa_app.quote_regex, REG_EXTENDED)) {
@@ -909,7 +909,7 @@
quoted_rex_compiled = FALSE;
} else
quoted_rex_compiled = TRUE;
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
spell_check->end_iter = start;
@@ -1143,11 +1143,11 @@
}
if (quoted_rex_compiled) {
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
g_regex_unref(quoted_rex);
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
regfree("ed_rex);
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
quoted_rex_compiled = FALSE;
}
@@ -1384,13 +1384,13 @@
&line_end, FALSE);
skip_sig = (!balsa_app.check_sig
&& strcmp(line, "-- \n") == 0);
-#if GLIB_CHECK_VERSION(2, 14, 0)
+#if USE_GREGEX
skip_quoted = (!balsa_app.check_quoted && quoted_rex_compiled
&& is_a_quote(line, quoted_rex));
-#else /* GLIB_CHECK_VERSION(2, 14, 0) */
+#else /* USE_GREGEX */
skip_quoted = (!balsa_app.check_quoted && quoted_rex_compiled
&& is_a_quote(line, "ed_rex));
-#endif /* GLIB_CHECK_VERSION(2, 14, 0) */
+#endif /* USE_GREGEX */
g_free(line);
if (skip_sig)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]