diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2023-04-26 19:58:45 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2023-04-26 19:58:45 (GMT) |
commit | a1ff7646ce6f829dd192e2e2246def2ea583e93b (patch) | |
tree | 092c83cebf8e711ac2da851a3f3c2cbdfb52aeac /plugins/yaml/collection.c | |
parent | f06602ac36b4ad7974d836aad76ed236a7a0c942 (diff) |
Provide access to the first node of a collection.
Diffstat (limited to 'plugins/yaml/collection.c')
-rw-r--r-- | plugins/yaml/collection.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/yaml/collection.c b/plugins/yaml/collection.c index 376e894..03c3992 100644 --- a/plugins/yaml/collection.c +++ b/plugins/yaml/collection.c @@ -275,6 +275,36 @@ GYamlNode **g_yaml_collection_get_nodes(const GYamlCollection *collec, size_t *c /****************************************************************************** * * +* Paramètres : collec = noeud d'arborescence Yaml à consulter. * +* * +* Description : Fournit le premier noeud intégré dans une collection. * +* * +* Retour : Noeud issu d'une collection Yaml. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GYamlNode *g_yaml_collection_get_first_node(const GYamlCollection *collec) +{ + GYamlNode *result; /* Elément à retourner */ + + if (collec->count == 0) + result = NULL; + + else + { + result = collec->nodes[0]; + g_object_ref(G_OBJECT(result)); + } + + return result; + +} + + +/****************************************************************************** +* * * Paramètres : node = noeud d'arborescence Yaml à consulter. * * path = chemin d'accès à parcourir. * * prepare = indication sur une préparation d'un prochain appel.* |