[gtksourceview/wip/chergert/snippets: 49/119] regex: add gtksourceregex-private.h
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/snippets: 49/119] regex: add gtksourceregex-private.h
- Date: Wed, 29 Jan 2020 17:30:56 +0000 (UTC)
commit dd1448548ca7003ecd49a47245bd8ff6f76d88be
Author: Christian Hergert <chergert redhat com>
Date: Thu Jan 9 13:13:09 2020 -0800
regex: add gtksourceregex-private.h
docs/reference/meson.build | 2 +-
gtksourceview/gtksourcecontextengine.c | 2 +-
gtksourceview/gtksourceregex-private.h | 72 ++++++++++++++++++++++++++++++
gtksourceview/gtksourceregex.c | 3 +-
gtksourceview/gtksourceregex.h | 81 ----------------------------------
testsuite/test-regex.c | 2 +-
6 files changed, 77 insertions(+), 85 deletions(-)
---
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index da1ae869..1f155dfd 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -33,7 +33,7 @@ reference_private_h = [
'gtksourcelanguagemanager-private.h',
'gtksourcemarkssequence.h',
'gtksourcepixbufhelper.h',
- 'gtksourceregex.h',
+ 'gtksourceregex-private.h',
'gtksourcesearchcontext-private.h',
'gtksourcestyle-private.h',
'gtksourcestylescheme-private.h',
diff --git a/gtksourceview/gtksourcecontextengine.c b/gtksourceview/gtksourcecontextengine.c
index 0594772d..dc1bf174 100644
--- a/gtksourceview/gtksourcecontextengine.c
+++ b/gtksourceview/gtksourcecontextengine.c
@@ -30,7 +30,7 @@
#include "gtksourcelanguage.h"
#include "gtksourcelanguage-private.h"
#include "gtksourcebuffer.h"
-#include "gtksourceregex.h"
+#include "gtksourceregex-private.h"
#include "gtksourcestyle.h"
#include "gtksourcestylescheme.h"
#include "gtksourceutils-private.h"
diff --git a/gtksourceview/gtksourceregex-private.h b/gtksourceview/gtksourceregex-private.h
new file mode 100644
index 00000000..3cfa321a
--- /dev/null
+++ b/gtksourceview/gtksourceregex-private.h
@@ -0,0 +1,72 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
+ *
+ * This file is part of GtkSourceView
+ *
+ * Copyright 2003 - Gustavo Giráldez <gustavo giraldez gmx net>
+ * Copyright 2005, 2006 - Marco Barisione, Emanuele Aina
+ *
+ * GtkSourceView is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * GtkSourceView is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <glib.h>
+
+#include "gtksourcetypes-private.h"
+
+G_BEGIN_DECLS
+
+GTK_SOURCE_INTERNAL
+GtkSourceRegex *_gtk_source_regex_new (const gchar *pattern,
+ GRegexCompileFlags flags,
+ GError **error);
+GTK_SOURCE_INTERNAL
+GtkSourceRegex *_gtk_source_regex_ref (GtkSourceRegex *regex);
+GTK_SOURCE_INTERNAL
+void _gtk_source_regex_unref (GtkSourceRegex *regex);
+GTK_SOURCE_INTERNAL
+GtkSourceRegex *_gtk_source_regex_resolve (GtkSourceRegex *regex,
+ GtkSourceRegex *start_regex,
+ const gchar *matched_text);
+GTK_SOURCE_INTERNAL
+gboolean _gtk_source_regex_is_resolved (GtkSourceRegex *regex);
+GTK_SOURCE_INTERNAL
+gboolean _gtk_source_regex_match (GtkSourceRegex *regex,
+ const gchar *line,
+ gint byte_length,
+ gint byte_pos);
+GTK_SOURCE_INTERNAL
+gchar *_gtk_source_regex_fetch (GtkSourceRegex *regex,
+ gint num);
+GTK_SOURCE_INTERNAL
+void _gtk_source_regex_fetch_pos (GtkSourceRegex *regex,
+ const gchar *text,
+ gint num,
+ gint *start_pos,
+ gint *end_pos);
+GTK_SOURCE_INTERNAL
+void _gtk_source_regex_fetch_pos_bytes (GtkSourceRegex *regex,
+ gint num,
+ gint *start_pos_p,
+ gint *end_pos_p);
+GTK_SOURCE_INTERNAL
+void _gtk_source_regex_fetch_named_pos (GtkSourceRegex *regex,
+ const gchar *text,
+ const gchar *name,
+ gint *start_pos,
+ gint *end_pos);
+GTK_SOURCE_INTERNAL
+const gchar *_gtk_source_regex_get_pattern (GtkSourceRegex *regex);
+
+G_END_DECLS
diff --git a/gtksourceview/gtksourceregex.c b/gtksourceview/gtksourceregex.c
index 7420437e..691b9dfd 100644
--- a/gtksourceview/gtksourceregex.c
+++ b/gtksourceview/gtksourceregex.c
@@ -21,10 +21,11 @@
#include "config.h"
-#include "gtksourceregex.h"
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
+
+#include "gtksourceregex-private.h"
#include "gtksourceutils-private.h"
/*
diff --git a/testsuite/test-regex.c b/testsuite/test-regex.c
index 6e173b58..cf61b63a 100644
--- a/testsuite/test-regex.c
+++ b/testsuite/test-regex.c
@@ -20,7 +20,7 @@
#include <gtk/gtk.h>
#include <gtksourceview/gtksource.h>
-#include "gtksourceview/gtksourceregex.h"
+#include "gtksourceview/gtksourceregex-private.h"
static void
test_slash_c_pattern (void)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]