[tracker/wip/carlosg/remote-module-reduction: 2/8] libtracker-sparql: Move TrackerSerializerFormat enum to distinct header




commit 64a45ec4ba3c1ee7dcb4faeea7d73715f8cea44a
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Apr 23 13:22:54 2022 +0200

    libtracker-sparql: Move TrackerSerializerFormat enum to distinct header
    
    We want this enum to be used from places that do not necessarily pull
    TrackerSerializer directly, or other internals. Move it to a separate
    header so that the enum can be used without further dependencies.

 src/libtracker-sparql/tracker-enums-private.h | 34 +++++++++++++++++++++++++++
 src/libtracker-sparql/tracker-private.h       |  1 +
 src/libtracker-sparql/tracker-serializer.h    |  9 +------
 3 files changed, 36 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-sparql/tracker-enums-private.h b/src/libtracker-sparql/tracker-enums-private.h
new file mode 100644
index 000000000..e1b0792ae
--- /dev/null
+++ b/src/libtracker-sparql/tracker-enums-private.h
@@ -0,0 +1,34 @@
+/*
+ * 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_PRIVATE_H
+#define TRACKER_ENUMS_PRIVATE_H
+
+typedef enum
+{
+       TRACKER_SERIALIZER_FORMAT_JSON, /* application/sparql-results+json */
+       TRACKER_SERIALIZER_FORMAT_XML, /* application/sparql-results+xml */
+       TRACKER_SERIALIZER_FORMAT_TTL, /* text/turtle */
+       TRACKER_SERIALIZER_FORMAT_TRIG, /* application/trig */
+       TRACKER_N_SERIALIZER_FORMATS
+} TrackerSerializerFormat;
+
+#endif /* TRACKER_ENUMS_PRIVATE_H */
diff --git a/src/libtracker-sparql/tracker-private.h b/src/libtracker-sparql/tracker-private.h
index d91f5dae3..03b4c04ec 100644
--- a/src/libtracker-sparql/tracker-private.h
+++ b/src/libtracker-sparql/tracker-private.h
@@ -23,6 +23,7 @@
 #include <libtracker-sparql/tracker-version-generated.h>
 #include <libtracker-sparql/tracker-cursor.h>
 #include <libtracker-sparql/tracker-endpoint-dbus.h>
+#include <libtracker-sparql/tracker-enums-private.h>
 
 struct _TrackerSparqlConnectionClass
 {
diff --git a/src/libtracker-sparql/tracker-serializer.h b/src/libtracker-sparql/tracker-serializer.h
index 9f6a87df8..b0c54d8e0 100644
--- a/src/libtracker-sparql/tracker-serializer.h
+++ b/src/libtracker-sparql/tracker-serializer.h
@@ -23,6 +23,7 @@
 #define TRACKER_SERIALIZER_H
 
 #include <libtracker-sparql/tracker-sparql.h>
+#include <libtracker-sparql/tracker-enums-private.h>
 
 #define TRACKER_TYPE_SERIALIZER (tracker_serializer_get_type())
 
@@ -31,14 +32,6 @@ G_DECLARE_DERIVABLE_TYPE (TrackerSerializer,
                           TRACKER, SERIALIZER,
                           GInputStream)
 
-typedef enum
-{
-       TRACKER_SERIALIZER_FORMAT_JSON, /* application/sparql-results+json */
-       TRACKER_SERIALIZER_FORMAT_XML, /* application/sparql-results+xml */
-       TRACKER_SERIALIZER_FORMAT_TTL, /* text/turtle */
-       TRACKER_SERIALIZER_FORMAT_TRIG, /* application/trig */
-} TrackerSerializerFormat;
-
 GInputStream * tracker_serializer_new (TrackerSparqlCursor     *cursor,
                                        TrackerSerializerFormat  format);
 


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