gibaseinfo: Add initialiser macro for GIAttributeIter

Makes it a little easier to use.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall
2024-01-18 12:27:46 +00:00
parent 57d64b111f
commit 9aea530ac0
4 changed files with 15 additions and 5 deletions

View File

@@ -784,7 +784,7 @@ const char *
gi_base_info_get_attribute (GIBaseInfo *info,
const char *name)
{
GIAttributeIter iter = { 0, };
GIAttributeIter iter = GI_ATTRIBUTE_ITER_INIT;
const char *curname, *curvalue;
while (gi_base_info_iterate_attributes (info, &iter, &curname, &curvalue))
{
@@ -872,7 +872,7 @@ _attribute_blob_find_first (GIBaseInfo *info,
* void
* print_attributes (GIBaseInfo *info)
* {
* GIAttributeIter iter = { 0, };
* GIAttributeIter iter = GI_ATTRIBUTE_ITER_INIT;
* const char *name;
* const char *value;
* while (gi_base_info_iterate_attributes (info, &iter, &name, &value))