summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2015-09-14 12:04:45 +0100
committerRichard Hughes <richard@hughsie.com>2015-09-14 12:04:45 +0100
commit4f8f2429b3dca92e84f9ba60c820cde2189d2a00 (patch)
tree69302eded28324050cd8938af448414e79111aa4
parent55cf07cba0f39cc6dbff0cb86c8c42920d7edf2a (diff)
downloadappstream-glib-4f8f2429b3dca92e84f9ba60c820cde2189d2a00.tar.gz
Use the typedef'd name in the code to help readability
Should be no code, API or ABI changes.
-rw-r--r--client/as-util.c8
-rw-r--r--libappstream-glib/as-node.c164
-rw-r--r--libappstream-glib/as-self-test.c76
-rw-r--r--libappstream-glib/as-store.c14
-rw-r--r--libappstream-glib/as-yaml.c30
-rw-r--r--libappstream-glib/as-yaml.h14
6 files changed, 153 insertions, 153 deletions
diff --git a/client/as-util.c b/client/as-util.c
index 0fbfad0..009199a 100644
--- a/client/as-util.c
+++ b/client/as-util.c
@@ -214,15 +214,15 @@ as_util_convert_appdata (GFile *file_input,
GError **error)
{
AsNodeInsertFlags flags_translate = AS_NODE_INSERT_FLAG_NONE;
- GNode *n;
- GNode *n2;
- GNode *n3;
+ AsNode *n;
+ AsNode *n2;
+ AsNode *n3;
const gchar *tmp;
const gchar *project_group = NULL;
gboolean action_required = FALSE;
g_autoptr(AsNode) root = NULL;
- /* load to GNode */
+ /* load to AsNode */
root = as_node_from_file (file_input,
AS_NODE_FROM_XML_FLAG_LITERAL_TEXT |
AS_NODE_FROM_XML_FLAG_KEEP_COMMENTS,
diff --git a/libappstream-glib/as-node.c b/libappstream-glib/as-node.c
index f929979..53df10c 100644
--- a/libappstream-glib/as-node.c
+++ b/libappstream-glib/as-node.c
@@ -63,7 +63,7 @@ typedef struct {
*
* Since: 0.1.0
**/
-GNode *
+AsNode *
as_node_new (void)
{
AsNodeData *data;
@@ -130,7 +130,7 @@ as_node_attr_lookup (AsNodeData *data, const gchar *key)
* as_node_destroy_node_cb:
**/
static gboolean
-as_node_destroy_node_cb (GNode *node, gpointer user_data)
+as_node_destroy_node_cb (AsNode *node, gpointer user_data)
{
AsNodeData *data = node->data;
if (data == NULL)
@@ -144,14 +144,14 @@ as_node_destroy_node_cb (GNode *node, gpointer user_data)
/**
* as_node_unref:
- * @node: a #GNode.
+ * @node: a #AsNode.
*
* Deallocates all notes in the tree.
*
* Since: 0.1.0
**/
void
-as_node_unref (GNode *node)
+as_node_unref (AsNode *node)
{
g_node_traverse (node,
G_PRE_ORDER,
@@ -319,11 +319,11 @@ as_node_data_set_name (AsNodeData *data, const gchar *name, AsNodeInsertFlags fl
* as_node_sort_children:
**/
static void
-as_node_sort_children (GNode *first)
+as_node_sort_children (AsNode *first)
{
AsNodeData *d1;
AsNodeData *d2;
- GNode *child;
+ AsNode *child;
gpointer tmp;
d1 = (AsNodeData *) first->data;
@@ -350,11 +350,11 @@ as_node_sort_children (GNode *first)
static void
as_node_to_xml_string (GString *xml,
guint depth_offset,
- const GNode *n,
+ const AsNode *n,
AsNodeToXmlFlags flags)
{
AsNodeData *data = n->data;
- GNode *c;
+ AsNode *c;
const gchar *tag_str;
const gchar *comment;
guint depth = g_node_depth ((GNode *) n);
@@ -490,13 +490,13 @@ as_node_reflow_text (const gchar *text, gssize text_len)
}
typedef struct {
- GNode *current;
+ AsNode *current;
AsNodeFromXmlFlags flags;
} AsNodeToXmlHelper;
/**
* as_node_to_xml:
- * @node: a #GNode.
+ * @node: a #AsNode.
* @flags: the AsNodeToXmlFlags, e.g. %AS_NODE_INSERT_FLAG_PRE_ESCAPED.
*
* Converts a node and it's children to XML.
@@ -506,10 +506,10 @@ typedef struct {
* Since: 0.1.0
**/
GString *
-as_node_to_xml (const GNode *node, AsNodeToXmlFlags flags)
+as_node_to_xml (const AsNode *node, AsNodeToXmlFlags flags)
{
GString *xml;
- const GNode *l;
+ const AsNode *l;
guint depth_offset;
g_return_val_if_fail (node != NULL, NULL);
@@ -540,7 +540,7 @@ as_node_start_element_cb (GMarkupParseContext *context,
{
AsNodeToXmlHelper *helper = (AsNodeToXmlHelper *) user_data;
AsNodeData *data;
- GNode *current;
+ AsNode *current;
gchar *tmp;
guint i;
@@ -682,17 +682,17 @@ as_node_passthrough_cb (GMarkupParseContext *context,
*
* Parses XML data into a DOM tree.
*
- * Returns: (transfer none): A populated #GNode tree
+ * Returns: (transfer none): A populated #AsNode tree
*
* Since: 0.1.0
**/
-GNode *
+AsNode *
as_node_from_xml (const gchar *data,
AsNodeFromXmlFlags flags,
GError **error)
{
AsNodeToXmlHelper helper;
- GNode *root = NULL;
+ AsNode *root = NULL;
gboolean ret;
g_autoptr(GError) error_local = NULL;
g_autoptr(GMarkupParseContext) ctx = NULL;
@@ -739,7 +739,7 @@ as_node_from_xml (const gchar *data,
/**
* as_node_to_file: (skip)
- * @root: A populated #GNode tree
+ * @root: A populated #AsNode tree
* @file: a #GFile
* @flags: #AsNodeToXmlFlags, e.g. %AS_NODE_TO_XML_FLAG_NONE
* @cancellable: A #GCancellable, or %NULL
@@ -752,7 +752,7 @@ as_node_from_xml (const gchar *data,
* Since: 0.2.0
**/
gboolean
-as_node_to_file (const GNode *root,
+as_node_to_file (const AsNode *root,
GFile *file,
AsNodeToXmlFlags flags,
GCancellable *cancellable,
@@ -780,11 +780,11 @@ as_node_to_file (const GNode *root,
*
* Parses an XML file into a DOM tree.
*
- * Returns: (transfer none): A populated #GNode tree
+ * Returns: (transfer none): A populated #AsNode tree
*
* Since: 0.1.0
**/
-GNode *
+AsNode *
as_node_from_file (GFile *file,
AsNodeFromXmlFlags flags,
GCancellable *cancellable,
@@ -792,7 +792,7 @@ as_node_from_file (GFile *file,
{
AsNodeToXmlHelper helper;
GError *error_local = NULL;
- GNode *root = NULL;
+ AsNode *root = NULL;
const gchar *content_type = NULL;
gboolean ret = TRUE;
gsize chunk_size = 32 * 1024;
@@ -888,12 +888,12 @@ as_node_from_file (GFile *file,
/**
* as_node_get_child_node:
**/
-static GNode *
-as_node_get_child_node (const GNode *root, const gchar *name,
+static AsNode *
+as_node_get_child_node (const AsNode *root, const gchar *name,
const gchar *attr_key, const gchar *attr_value)
{
AsNodeData *data;
- GNode *node;
+ AsNode *node;
/* invalid */
if (root == NULL)
@@ -921,7 +921,7 @@ as_node_get_child_node (const GNode *root, const gchar *name,
/**
* as_node_get_name:
- * @node: a #GNode
+ * @node: a #AsNode
*
* Gets the node name, e.g. "body"
*
@@ -930,7 +930,7 @@ as_node_get_child_node (const GNode *root, const gchar *name,
* Since: 0.1.0
**/
const gchar *
-as_node_get_name (const GNode *node)
+as_node_get_name (const AsNode *node)
{
g_return_val_if_fail (node != NULL, NULL);
if (node->data == NULL)
@@ -940,7 +940,7 @@ as_node_get_name (const GNode *node)
/**
* as_node_set_name: (skip)
- * @node: a #GNode
+ * @node: a #AsNode
* @name: the new name
*
* Sets the node name, e.g. "body"
@@ -948,7 +948,7 @@ as_node_get_name (const GNode *node)
* Since: 0.1.4
**/
void
-as_node_set_name (GNode *node, const gchar *name)
+as_node_set_name (AsNode *node, const gchar *name)
{
AsNodeData *data;
@@ -968,7 +968,7 @@ as_node_set_name (GNode *node, const gchar *name)
/**
* as_node_get_data:
- * @node: a #GNode
+ * @node: a #AsNode
*
* Gets the node data, e.g. "paragraph text"
*
@@ -977,7 +977,7 @@ as_node_set_name (GNode *node, const gchar *name)
* Since: 0.1.0
**/
const gchar *
-as_node_get_data (const GNode *node)
+as_node_get_data (const AsNode *node)
{
AsNodeData *data;
g_return_val_if_fail (node != NULL, NULL);
@@ -992,7 +992,7 @@ as_node_get_data (const GNode *node)
/**
* as_node_get_comment:
- * @node: a #GNode
+ * @node: a #AsNode
*
* Gets the node data, e.g. "Copyright 2014 Richard Hughes"
*
@@ -1001,14 +1001,14 @@ as_node_get_data (const GNode *node)
* Since: 0.1.6
**/
const gchar *
-as_node_get_comment (const GNode *node)
+as_node_get_comment (const AsNode *node)
{
return as_node_get_attribute (node, "@comment");
}
/**
* as_node_get_tag:
- * @node: a #GNode
+ * @node: a #AsNode
*
* Gets the node tag enum.
*
@@ -1017,7 +1017,7 @@ as_node_get_comment (const GNode *node)
* Since: 0.1.2
**/
AsTag
-as_node_get_tag (const GNode *node)
+as_node_get_tag (const AsNode *node)
{
AsNodeData *data;
const gchar *tmp;
@@ -1039,7 +1039,7 @@ as_node_get_tag (const GNode *node)
/**
* as_node_set_data: (skip)
- * @node: a #GNode
+ * @node: a #AsNode
* @cdata: new data
* @insert_flags: any %AsNodeInsertFlags.
*
@@ -1048,7 +1048,7 @@ as_node_get_tag (const GNode *node)
* Since: 0.1.1
**/
void
-as_node_set_data (GNode *node,
+as_node_set_data (AsNode *node,
const gchar *cdata,
AsNodeInsertFlags insert_flags)
{
@@ -1067,7 +1067,7 @@ as_node_set_data (GNode *node,
/**
* as_node_set_comment: (skip)
- * @node: a #GNode
+ * @node: a #AsNode
* @comment: new comment
*
* Sets new comment for the node.
@@ -1075,14 +1075,14 @@ as_node_set_data (GNode *node,
* Since: 0.1.6
**/
void
-as_node_set_comment (GNode *node, const gchar *comment)
+as_node_set_comment (AsNode *node, const gchar *comment)
{
as_node_add_attribute (node, "@comment", comment);
}
/**
* as_node_take_data:
- * @node: a #GNode
+ * @node: a #AsNode
*
* Gets the node data, e.g. "paragraph text"
*
@@ -1091,7 +1091,7 @@ as_node_set_comment (GNode *node, const gchar *comment)
* Since: 0.1.0
**/
gchar *
-as_node_take_data (const GNode *node)
+as_node_take_data (const AsNode *node)
{
AsNodeData *data;
gchar *tmp;
@@ -1109,7 +1109,7 @@ as_node_take_data (const GNode *node)
/**
* as_node_get_attribute_as_int:
- * @node: a #GNode
+ * @node: a #AsNode
* @key: the attribute key
*
* Gets a node attribute, e.g. 34
@@ -1119,7 +1119,7 @@ as_node_take_data (const GNode *node)
* Since: 0.1.0
**/
gint
-as_node_get_attribute_as_int (const GNode *node, const gchar *key)
+as_node_get_attribute_as_int (const AsNode *node, const gchar *key)
{
const gchar *tmp;
gchar *endptr = NULL;
@@ -1138,7 +1138,7 @@ as_node_get_attribute_as_int (const GNode *node, const gchar *key)
/**
* as_node_get_attribute:
- * @node: a #GNode
+ * @node: a #AsNode
* @key: the attribute key
*
* Gets a node attribute, e.g. "false"
@@ -1148,7 +1148,7 @@ as_node_get_attribute_as_int (const GNode *node, const gchar *key)
* Since: 0.1.0
**/
const gchar *
-as_node_get_attribute (const GNode *node, const gchar *key)
+as_node_get_attribute (const AsNode *node, const gchar *key)
{
AsNodeData *data;
@@ -1163,7 +1163,7 @@ as_node_get_attribute (const GNode *node, const gchar *key)
/**
* as_node_take_attribute: (skip)
- * @node: a #GNode
+ * @node: a #AsNode
* @key: the attribute key
*
* Gets a node attribute, e.g. "false"
@@ -1173,7 +1173,7 @@ as_node_get_attribute (const GNode *node, const gchar *key)
* Since: 0.1.2
**/
gchar *
-as_node_take_attribute (const GNode *node, const gchar *key)
+as_node_take_attribute (const AsNode *node, const gchar *key)
{
AsNodeAttr *attr;
AsNodeData *data;
@@ -1195,7 +1195,7 @@ as_node_take_attribute (const GNode *node, const gchar *key)
/**
* as_node_remove_attribute: (skip)
- * @node: a #GNode
+ * @node: a #AsNode
* @key: the attribute key
*
* Removes a node attribute, e.g. "type"
@@ -1203,7 +1203,7 @@ as_node_take_attribute (const GNode *node, const gchar *key)
* Since: 0.2.0
**/
void
-as_node_remove_attribute (GNode *node, const gchar *key)
+as_node_remove_attribute (AsNode *node, const gchar *key)
{
AsNodeAttr *attr;
AsNodeData *data;
@@ -1223,7 +1223,7 @@ as_node_remove_attribute (GNode *node, const gchar *key)
/**
* as_node_add_attribute: (skip)
- * @node: a #GNode
+ * @node: a #AsNode
* @key: the attribute key
* @value: new data
*
@@ -1232,7 +1232,7 @@ as_node_remove_attribute (GNode *node, const gchar *key)
* Since: 0.1.1
**/
void
-as_node_add_attribute (GNode *node,
+as_node_add_attribute (AsNode *node,
const gchar *key,
const gchar *value)
{
@@ -1251,7 +1251,7 @@ as_node_add_attribute (GNode *node,
/**
* as_node_add_attribute_as_int: (skip)
- * @node: a #GNode
+ * @node: a #AsNode
* @key: the attribute key
* @value: new data
*
@@ -1260,7 +1260,7 @@ as_node_add_attribute (GNode *node,
* Since: 0.3.1
**/
void
-as_node_add_attribute_as_int (GNode *node, const gchar *key, gint value)
+as_node_add_attribute_as_int (AsNode *node, const gchar *key, gint value)
{
g_autofree gchar *tmp = g_strdup_printf ("%i", value);
as_node_add_attribute (node, key, tmp);
@@ -1273,14 +1273,14 @@ as_node_add_attribute_as_int (GNode *node, const gchar *key, gint value)
*
* Gets a node from the DOM tree.
*
- * Return value: A #GNode, or %NULL if not found
+ * Return value: A #AsNode, or %NULL if not found
*
* Since: 0.1.0
**/
-GNode *
-as_node_find (GNode *root, const gchar *path)
+AsNode *
+as_node_find (AsNode *root, const gchar *path)
{
- GNode *node = root;
+ AsNode *node = root;
guint i;
g_auto(GStrv) split = NULL;
@@ -1304,15 +1304,15 @@ as_node_find (GNode *root, const gchar *path)
*
* Gets a node from the DOM tree with a specified attribute.
*
- * Return value: A #GNode, or %NULL if not found
+ * Return value: A #AsNode, or %NULL if not found
*
* Since: 0.1.0
**/
-GNode *
-as_node_find_with_attribute (GNode *root, const gchar *path,
+AsNode *
+as_node_find_with_attribute (AsNode *root, const gchar *path,
const gchar *attr_key, const gchar *attr_value)
{
- GNode *node = root;
+ AsNode *node = root;
guint i;
g_auto(GStrv) split = NULL;
@@ -1360,7 +1360,7 @@ as_node_insert_line_breaks (const gchar *text, guint break_len)
/**
* as_node_insert: (skip)
- * @parent: a parent #GNode.
+ * @parent: a parent #AsNode.
* @name: the tag name, e.g. "id".
* @cdata: the tag data, or %NULL, e.g. "org.gnome.Software.desktop".
* @insert_flags: any %AsNodeInsertFlags.
@@ -1368,12 +1368,12 @@ as_node_insert_line_breaks (const gchar *text, guint break_len)
*
* Inserts a node into the DOM.
*
- * Returns: (transfer none): A populated #GNode
+ * Returns: (transfer none): A populated #AsNode
*
* Since: 0.1.0
**/
-GNode *
-as_node_insert (GNode *parent,
+AsNode *
+as_node_insert (AsNode *parent,
const gchar *name,
const gchar *cdata,
AsNodeInsertFlags insert_flags,
@@ -1424,7 +1424,7 @@ as_node_list_sort_cb (gconstpointer a, gconstpointer b)
/**
* as_node_insert_localized:
- * @parent: a parent #GNode.
+ * @parent: a parent #AsNode.
* @name: the tag name, e.g. "id".
* @localized: the hash table of data, with the locale as the key.
* @insert_flags: any %AsNodeInsertFlags.
@@ -1434,7 +1434,7 @@ as_node_list_sort_cb (gconstpointer a, gconstpointer b)
* Since: 0.1.0
**/
void
-as_node_insert_localized (GNode *parent,
+as_node_insert_localized (AsNode *parent,
const gchar *name,
GHashTable *localized,
AsNodeInsertFlags insert_flags)
@@ -1490,7 +1490,7 @@ as_node_insert_localized (GNode *parent,
/**
* as_node_insert_hash:
- * @parent: a parent #GNode.
+ * @parent: a parent #AsNode.
* @name: the tag name, e.g. "id".
* @attr_key: the key to use as the attribute in the XML, e.g. "key".
* @hash: the hash table with the key as the key to use in the XML.
@@ -1501,7 +1501,7 @@ as_node_insert_localized (GNode *parent,
* Since: 0.1.0
**/
void
-as_node_insert_hash (GNode *parent,
+as_node_insert_hash (AsNode *parent,
const gchar *name,
const gchar *attr_key,
GHashTable *hash,
@@ -1539,7 +1539,7 @@ as_node_insert_hash (GNode *parent,
/**
* as_node_get_localized:
- * @node: a #GNode
+ * @node: a #AsNode
* @key: the key to use, e.g. "copyright"
*
* Extracts localized values from the DOM tree
@@ -1549,14 +1549,14 @@ as_node_insert_hash (GNode *parent,
* Since: 0.1.0
**/
GHashTable *
-as_node_get_localized (const GNode *node, const gchar *key)
+as_node_get_localized (const AsNode *node, const gchar *key)
{
AsNodeData *data;
const gchar *xml_lang;
const gchar *data_unlocalized;
const gchar *data_localized;
GHashTable *hash = NULL;
- GNode *tmp;
+ AsNode *tmp;
/* does it exist? */
tmp = as_node_get_child_node (node, key, NULL, NULL);
@@ -1589,7 +1589,7 @@ as_node_get_localized (const GNode *node, const gchar *key)
/**
* as_node_get_localized_best:
- * @node: a #GNode.
+ * @node: a #AsNode.
* @key: the tag name.
*
* Gets the 'best' locale version of a specific data value.
@@ -1599,7 +1599,7 @@ as_node_get_localized (const GNode *node, const gchar *key)
* Since: 0.1.0
**/
const gchar *
-as_node_get_localized_best (const GNode *node, const gchar *key)
+as_node_get_localized_best (const AsNode *node, const gchar *key)
{
g_autoptr(GHashTable) hash = NULL;
hash = as_node_get_localized (node, key);
@@ -1681,12 +1681,12 @@ as_node_denorm_get_str_for_lang (GHashTable *hash,
* ]|
**/
static gboolean
-as_node_get_localized_unwrap_type_li (const GNode *node,
+as_node_get_localized_unwrap_type_li (const AsNode *node,
GHashTable *hash,
GError **error)
{
- GNode *tmp;
- GNode *tmp_c;
+ AsNode *tmp;
+ AsNode *tmp_c;
AsNodeData *data;
AsNodeData *data_c;
GString *str;
@@ -1769,12 +1769,12 @@ as_node_get_localized_unwrap_type_li (const GNode *node,
* ]|
**/
static gboolean
-as_node_get_localized_unwrap_type_ul (const GNode *node,
+as_node_get_localized_unwrap_type_ul (const AsNode *node,
GHashTable *hash,
GError **error)
{
- GNode *tmp;
- GNode *tmp_c;
+ AsNode *tmp;
+ AsNode *tmp_c;
AsNodeData *data;
AsNodeData *data_c;
GString *str;
@@ -1828,7 +1828,7 @@ as_node_get_localized_unwrap_type_ul (const GNode *node,
/**
* as_node_get_localized_unwrap:
- * @node: a #GNode.
+ * @node: a #AsNode.
* @error: A #GError or %NULL.
*
* Denormalize AppData data like this:
@@ -1856,12 +1856,12 @@ as_node_get_localized_unwrap_type_ul (const GNode *node,
* Since: 0.1.0
**/
GHashTable *
-as_node_get_localized_unwrap (const GNode *node, GError **error)
+as_node_get_localized_unwrap (const AsNode *node, GError **error)
{
AsNodeData *data;
GHashTable *results;
GList *l;
- GNode *tmp;
+ AsNode *tmp;
GString *str;
const gchar *xml_lang;
gboolean is_li_translated = TRUE;
diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c
index 7e6077d..e9e8b41 100644
--- a/libappstream-glib/as-self-test.c
+++ b/libappstream-glib/as-self-test.c
@@ -338,8 +338,8 @@ static void
as_test_release_func (void)
{
GError *error = NULL;
- GNode *n;
- GNode *root;
+ AsNode *n;
+ AsNode *root;
GString *xml;
const gchar *src = "<release version=\"0.1.2\" urgency=\"critical\" timestamp=\"123\"/>";
gboolean ret;
@@ -381,8 +381,8 @@ static void
as_test_provide_func (void)
{
GError *error = NULL;
- GNode *n;
- GNode *root;
+ AsNode *n;
+ AsNode *root;
GString *xml;
const gchar *src = "<binary>/usr/bin/gnome-shell</binary>";
gboolean ret;
@@ -424,8 +424,8 @@ as_test_release_appstream_func (void)
{
AsChecksum *csum;
GError *error = NULL;
- GNode *n;
- GNode *root;
+ AsNode *n;
+ AsNode *root;
GString *xml;
gboolean ret;
const gchar *src =
@@ -499,8 +499,8 @@ static void
as_test_release_appdata_func (void)
{
GError *error = NULL;
- GNode *n;
- GNode *root;
+ AsNode *n;
+ AsNode *root;
gboolean ret;
const gchar *src =
"<release version=\"0.1.2\" timestamp=\"123\">\n"
@@ -730,8 +730,8 @@ static void
as_test_icon_func (void)
{
GError *error = NULL;
- GNode *n;
- GNode *root;
+ AsNode *n;
+ AsNode *root;
GString *xml;
const gchar *src = "<icon type=\"cached\">app.png</icon>";
gboolean ret;
@@ -793,8 +793,8 @@ static void
as_test_checksum_func (void)
{
GError *error = NULL;
- GNode *n;
- GNode *root;
+ AsNode *n;
+ AsNode *root;
GString *xml;
const gchar *src = "<checksum filename=\"fn.cab\" target=\"container\" type=\"sha1\">12345</checksum>";
gboolean ret;
@@ -845,8 +845,8 @@ static void
as_test_icon_embedded_func (void)
{
GError *error = NULL;
- GNode *n;
- GNode *root;
+ AsNode *n;
+ AsNode *root;
GString *xml;
const gchar *src =
"<icon type=\"embedded\"><name>app.png</name>"
@@ -951,8 +951,8 @@ static void
as_test_image_func (void)
{
GError *error = NULL;
- GNode *n;
- GNode *root;
+ AsNode *n;
+ AsNode *root;
GString *xml;
const gchar *src =
"<image type=\"thumbnail\" height=\"12\" width=\"34\">"
@@ -1025,8 +1025,8 @@ static void
as_test_bundle_func (void)
{
GError *error = NULL;
- GNode *n;
- GNode *root;
+ AsNode *n;
+ AsNode *root;
GString *xml;
const gchar *src =
"<bundle type=\"limba\">gnome-3-16</bundle>";
@@ -1070,8 +1070,8 @@ as_test_screenshot_func (void)
GPtrArray *images;
AsImage *im;
GError *error = NULL;
- GNode *n;
- GNode *root;
+ AsNode *n;
+ AsNode *root;
GString *xml;
const gchar *src =
"<screenshot priority=\"-64\">\n"
@@ -1134,8 +1134,8 @@ as_test_app_func (void)
AsBundle *bu;
AsRelease *rel;
GError *error = NULL;
- GNode *n;
- GNode *root;
+ AsNode *n;
+ AsNode *root;
GPtrArray *icons;
GString *xml;
gboolean ret;
@@ -1880,8 +1880,8 @@ static void
as_test_app_no_markup_func (void)
{
GError *error = NULL;
- GNode *n;
- GNode *root;
+ AsNode *n;
+ AsNode *root;
GString *xml;
gboolean ret;
const gchar *src =
@@ -1975,8 +1975,8 @@ as_test_node_sort_func (void)
static void
as_test_node_func (void)
{
- GNode *n1;
- GNode *n2;
+ AsNode *n1;
+ AsNode *n2;
g_autoptr(AsNode) root = NULL;
/* create a simple tree */
@@ -2031,8 +2031,8 @@ as_test_node_xml_func (void)
"<bar key=\"value\">baz</bar>"
"</foo>";
GError *error = NULL;
- GNode *n2;
- GNode *root;
+ AsNode *n2;
+ AsNode *root;
GString *xml;
/* invalid XML */
@@ -2150,8 +2150,8 @@ static void
as_test_node_hash_func (void)
{
GHashTable *hash;
- GNode *n1;
- GNode *root;
+ AsNode *n1;
+ AsNode *root;
GString *xml;
/* test un-swapped hash */
@@ -2189,8 +2189,8 @@ static void
as_test_node_localized_func (void)
{
GHashTable *hash;
- GNode *n1;
- GNode *root;
+ AsNode *n1;
+ AsNode *root;
GString *xml;
/* writing localized values */
@@ -2230,7 +2230,7 @@ static void
as_test_node_localized_wrap_func (void)
{
GError *error = NULL;
- GNode *n1;
+ AsNode *n1;
const gchar *xml =
"<description>"
" <p>Hi</p>"
@@ -2266,7 +2266,7 @@ as_test_node_localized_wrap_func (void)
static void
as_test_node_intltool_func (void)
{
- GNode *n;
+ AsNode *n;
g_autoptr(AsNode) root = NULL;
g_autoptr(GString) str = NULL;
@@ -2284,7 +2284,7 @@ static void
as_test_node_localized_wrap2_func (void)
{
GError *error = NULL;
- GNode *n1;
+ AsNode *n1;
const gchar *xml =
"<description>"
" <p>Hi</p>"
@@ -3104,8 +3104,8 @@ static void
as_test_node_no_dup_c_func (void)
{
GError *error = NULL;
- GNode *n;
- GNode *root;
+ AsNode *n;
+ AsNode *root;
GString *xml;
gboolean ret;
const gchar *src =
@@ -3604,7 +3604,7 @@ as_test_store_metadata_index_func (void)
static void
as_test_yaml_func (void)
{
- GNode *node;
+ AsYaml *node;
GError *error = NULL;
GString *str;
const gchar *expected;
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c
index bf06cb9..43160d5 100644
--- a/libappstream-glib/as-store.c
+++ b/libappstream-glib/as-store.c
@@ -851,14 +851,14 @@ as_store_match_addons (AsStore *store)
**/
static gboolean
as_store_from_root (AsStore *store,
- GNode *root,
+ AsNode *root,
const gchar *icon_root,
const gchar *source_filename,
GError **error)
{
AsStorePrivate *priv = GET_PRIVATE (store);
- GNode *apps;
- GNode *n;
+ AsNode *apps;
+ AsNode *n;
const gchar *tmp;
g_autofree AsNodeContext *ctx = NULL;
g_autofree gchar *icon_path = NULL;
@@ -962,8 +962,8 @@ as_store_load_yaml_file (AsStore *store,
GError **error)
{
AsStorePrivate *priv = GET_PRIVATE (store);
- GNode *app_n;
- GNode *n;
+ AsNode *app_n;
+ AsNode *n;
const gchar *tmp;
g_autofree AsNodeContext *ctx = NULL;
g_autofree gchar *icon_path = NULL;
@@ -1261,8 +1261,8 @@ as_store_to_xml (AsStore *store, AsNodeToXmlFlags flags)
{
AsApp *app;
AsStorePrivate *priv = GET_PRIVATE (store);
- GNode *node_apps;
- GNode *node_root;
+ AsNode *node_apps;
+ AsNode *node_root;
GString *xml;
guint i;
gchar version[6];
diff --git a/libappstream-glib/as-yaml.c b/libappstream-glib/as-yaml.c
index 12db3ae..c9b95fe 100644
--- a/libappstream-glib/as-yaml.c
+++ b/libappstream-glib/as-yaml.c
@@ -47,7 +47,7 @@ typedef struct {
* as_yaml_node_get_key:
**/
const gchar *
-as_yaml_node_get_key (const GNode *node)
+as_yaml_node_get_key (const AsNode *node)
{
AsYamlNode *ym;
if (node == NULL)
@@ -64,7 +64,7 @@ as_yaml_node_get_key (const GNode *node)
* as_yaml_node_get_value:
**/
const gchar *
-as_yaml_node_get_value (const GNode *node)
+as_yaml_node_get_value (const AsNode *node)
{
AsYamlNode *ym;
if (node == NULL)
@@ -81,7 +81,7 @@ as_yaml_node_get_value (const GNode *node)
* as_yaml_node_get_value_as_int:
**/
gint
-as_yaml_node_get_value_as_int (const GNode *node)
+as_yaml_node_get_value_as_int (const AsNode *node)
{
const gchar *tmp;
gchar *endptr = NULL;
@@ -102,7 +102,7 @@ as_yaml_node_get_value_as_int (const GNode *node)
* as_node_yaml_destroy_node_cb:
**/
static gboolean
-as_node_yaml_destroy_node_cb (GNode *node, gpointer data)
+as_node_yaml_destroy_node_cb (AsNode *node, gpointer data)
{
AsYamlNode *ym = node->data;
if (ym == NULL)
@@ -117,7 +117,7 @@ as_node_yaml_destroy_node_cb (GNode *node, gpointer data)
* as_yaml_unref:
**/
void
-as_yaml_unref (GNode *node)
+as_yaml_unref (AsNode *node)
{
g_node_traverse (node, G_PRE_ORDER, G_TRAVERSE_ALL, -1,
as_node_yaml_destroy_node_cb, NULL);
@@ -128,7 +128,7 @@ as_yaml_unref (GNode *node)
* as_yaml_to_string_cb:
**/
static gboolean
-as_yaml_to_string_cb (GNode *node, gpointer data)
+as_yaml_to_string_cb (AsNode *node, gpointer data)
{
AsYamlNode *ym = node->data;
GString *str = (GString *) data;
@@ -171,7 +171,7 @@ as_yaml_to_string_cb (GNode *node, gpointer data)
* as_yaml_to_string:
**/
GString *
-as_yaml_to_string (GNode *node)
+as_yaml_to_string (AsNode *node)
{
GString *str = g_string_new ("");
g_node_traverse (node, G_PRE_ORDER, G_TRAVERSE_ALL, -1,
@@ -184,7 +184,7 @@ as_yaml_to_string (GNode *node)
* as_yaml_node_get_kind:
**/
static AsYamlNodeKind
-as_yaml_node_get_kind (GNode *node)
+as_yaml_node_get_kind (AsNode *node)
{
AsYamlNode *ym;
if (node == NULL)
@@ -212,11 +212,11 @@ as_yaml_node_new (AsYamlNodeKind kind, const gchar *id)
* as_node_yaml_process_layer:
**/
static void
-as_node_yaml_process_layer (yaml_parser_t *parser, GNode *parent)
+as_node_yaml_process_layer (yaml_parser_t *parser, AsNode *parent)
{
AsYamlNode *ym;
- GNode *last_scalar = NULL;
- GNode *new;
+ AsNode *last_scalar = NULL;
+ AsNode *new;
const gchar *tmp;
gboolean valid = TRUE;
yaml_event_t event;
@@ -279,10 +279,10 @@ as_node_yaml_process_layer (yaml_parser_t *parser, GNode *parent)
/**
* as_yaml_from_data:
**/
-GNode *
+AsNode *
as_yaml_from_data (const gchar *data, gssize data_len, GError **error)
{
- GNode *node = NULL;
+ AsNode *node = NULL;
#if AS_BUILD_DEP11
yaml_parser_t parser;
@@ -322,10 +322,10 @@ as_yaml_read_handler_cb (void *data,
/**
* as_yaml_from_file:
**/
-GNode *
+AsNode *
as_yaml_from_file (GFile *file, GCancellable *cancellable, GError **error)
{
- GNode *node = NULL;
+ AsNode *node = NULL;
#if AS_BUILD_DEP11
const gchar *content_type = NULL;
yaml_parser_t parser;
diff --git a/libappstream-glib/as-yaml.h b/libappstream-glib/as-yaml.h
index b66d34a..979dd41 100644
--- a/libappstream-glib/as-yaml.h
+++ b/libappstream-glib/as-yaml.h
@@ -33,17 +33,17 @@ G_BEGIN_DECLS
typedef GNode AsYaml;
-void as_yaml_unref (GNode *node);
-GString *as_yaml_to_string (GNode *node);
-GNode *as_yaml_from_data (const gchar *data,
+void as_yaml_unref (AsYaml *node);
+GString *as_yaml_to_string (AsYaml *node);
+AsYaml *as_yaml_from_data (const gchar *data,
gssize data_len,
GError **error);
-GNode *as_yaml_from_file (GFile *file,
+AsYaml *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);
+const gchar *as_yaml_node_get_key (const AsYaml *node);
+const gchar *as_yaml_node_get_value (const AsYaml *node);
+gint as_yaml_node_get_value_as_int (const AsYaml *node);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(AsYaml, as_yaml_unref)