summaryrefslogtreecommitdiff
path: root/libappstream-glib/as-yaml.h
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-03-21 20:28:50 +0000
committerRichard Hughes <richard@hughsie.com>2014-08-20 10:01:26 +0100
commitc63ae20cbbfe7e241fca2775f4df05da85335d13 (patch)
treee8f3a00955a29eb6ad285b2d6bf93bdb06c73601 /libappstream-glib/as-yaml.h
parent451a7489300e19221bb5bed6da182839e2e3ad69 (diff)
downloadappstream-glib-c63ae20cbbfe7e241fca2775f4df05da85335d13.tar.gz
Use libyaml to read DEP-11 metadata
This is optional, but enabled by default. Use --disable-dep11 to remove the libyaml dependancy.
Diffstat (limited to 'libappstream-glib/as-yaml.h')
-rw-r--r--libappstream-glib/as-yaml.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/libappstream-glib/as-yaml.h b/libappstream-glib/as-yaml.h
new file mode 100644
index 0000000..3f479e8
--- /dev/null
+++ b/libappstream-glib/as-yaml.h
@@ -0,0 +1,49 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2014 Richard Hughes <richard@hughsie.com>
+ *
+ * Licensed under the GNU Lesser General Public License Version 2.1
+ *
+ * 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
+ */
+
+#if !defined (__APPSTREAM_GLIB_H) && !defined (AS_COMPILATION)
+#error "Only <appstream-glib.h> can be included directly."
+#endif
+
+#ifndef __AS_YAML_H
+#define __AS_YAML_H
+
+#include <gio/gio.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+void as_yaml_unref (GNode *node);
+GString *as_yaml_to_string (GNode *node);
+GNode *as_yaml_from_data (const gchar *data,
+ gssize data_len,
+ GError **error);
+GNode *as_yaml_from_file (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+const gchar *as_yaml_node_get_key (const GNode *node);
+const gchar *as_yaml_node_get_value (const GNode *node);
+gint as_yaml_node_get_value_as_int (const GNode *node);
+
+G_END_DECLS
+
+#endif /* __AS_YAML_H */
+