[tracker/wip/carlosg/resources-as-cursors: 1/18] libtracker-sparql: Move enum definition




commit d8db4d4990690c27376623b1d4be338be4e33723
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Jul 2 19:27:28 2022 +0200

    libtracker-sparql: Move enum definition
    
    This will be used from more public headers than the connection's, and
    it's easier to move to a separate header than shuffling header dependencies
    so other users pull tracker-connection.h

 src/libtracker-sparql/meson.build          |  3 ++-
 src/libtracker-sparql/tracker-connection.h |  7 +------
 src/libtracker-sparql/tracker-enums.h      | 31 ++++++++++++++++++++++++++++++
 src/libtracker-sparql/tracker-sparql.h     |  1 +
 4 files changed, 35 insertions(+), 7 deletions(-)
---
diff --git a/src/libtracker-sparql/meson.build b/src/libtracker-sparql/meson.build
index 98ec5528f..fba9cfeb3 100644
--- a/src/libtracker-sparql/meson.build
+++ b/src/libtracker-sparql/meson.build
@@ -11,7 +11,7 @@ version_header = configure_file(
     configuration: conf)
 
 enum_types = gnome.mkenums('tracker-sparql-enum-types',
-    sources: ['tracker-notifier.h', 'tracker-connection.h'],
+    sources: ['tracker-notifier.h', 'tracker-connection.h', 'tracker-enums.h'],
     c_template: 'tracker-sparql-enum-types.c.template',
     h_template: 'tracker-sparql-enum-types.h.template',
     install_dir: join_paths(get_option('prefix'), get_option('includedir'), 
'tracker-@0@'.format(tracker_api_version), 'libtracker-sparql'),
@@ -55,6 +55,7 @@ libtracker_sparql_c_public_headers = files(
     'tracker-endpoint.h',
     'tracker-endpoint-dbus.h',
     'tracker-endpoint-http.h',
+    'tracker-enums.h',
     'tracker-error.h',
     'tracker-namespace-manager.h',
     'tracker-notifier.h',
diff --git a/src/libtracker-sparql/tracker-connection.h b/src/libtracker-sparql/tracker-connection.h
index 41aede1ff..656dcb862 100644
--- a/src/libtracker-sparql/tracker-connection.h
+++ b/src/libtracker-sparql/tracker-connection.h
@@ -23,6 +23,7 @@
 #error "only <libtracker-sparql/tracker-sparql.h> must be included directly."
 #endif
 
+#include <libtracker-sparql/tracker-enums.h>
 #include <libtracker-sparql/tracker-error.h>
 #include <libtracker-sparql/tracker-notifier.h>
 #include <libtracker-sparql/tracker-resource.h>
@@ -54,12 +55,6 @@ typedef enum {
        TRACKER_SPARQL_CONNECTION_FLAGS_ANONYMOUS_BNODES      = 1 << 5,
 } TrackerSparqlConnectionFlags;
 
-typedef enum {
-       TRACKER_RDF_FORMAT_TURTLE,
-       TRACKER_RDF_FORMAT_TRIG,
-       TRACKER_N_RDF_FORMATS
-} TrackerRdfFormat;
-
 typedef enum {
        TRACKER_SERIALIZE_FLAGS_NONE = 0,
 } TrackerSerializeFlags;
diff --git a/src/libtracker-sparql/tracker-enums.h b/src/libtracker-sparql/tracker-enums.h
new file mode 100644
index 000000000..bcbb11359
--- /dev/null
+++ b/src/libtracker-sparql/tracker-enums.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2022, Red Hat, Inc
+ *
+ * This library 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.
+ *
+ * This library 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, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Author: Carlos Garnacho <carlosg gnome org>
+ */
+
+#ifndef TRACKER_ENUMS_H
+#define TRACKER_ENUMS_H
+
+typedef enum {
+       TRACKER_RDF_FORMAT_TURTLE,
+       TRACKER_RDF_FORMAT_TRIG,
+       TRACKER_N_RDF_FORMATS
+} TrackerRdfFormat;
+
+#endif /* TRACKER_ENUMS_H */
diff --git a/src/libtracker-sparql/tracker-sparql.h b/src/libtracker-sparql/tracker-sparql.h
index 3b9aa2ffd..4667fa5a1 100644
--- a/src/libtracker-sparql/tracker-sparql.h
+++ b/src/libtracker-sparql/tracker-sparql.h
@@ -24,6 +24,7 @@
 
 #include <libtracker-sparql/tracker-version-generated.h>
 #include <libtracker-sparql/tracker-version.h>
+#include <libtracker-sparql/tracker-enums.h>
 #include <libtracker-sparql/tracker-error.h>
 #include <libtracker-sparql/tracker-connection.h>
 #include <libtracker-sparql/tracker-batch.h>


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