metadata: remove wp_metadata_iterator_item_extract() API

Similar to WpPropertiesItem, this implements a new WpMetadataItem type that is
returned when iterating metadata
This commit is contained in:
Julian Bouzas
2024-02-23 13:41:46 -05:00
parent bebfc07d84
commit a23248847a
9 changed files with 308 additions and 79 deletions

View File

@@ -596,9 +596,11 @@ metadata_iterator_next (lua_State *L)
WpIterator *it = wplua_checkboxed (L, 1, WP_TYPE_ITERATOR);
g_auto (GValue) item = G_VALUE_INIT;
if (wp_iterator_next (it, &item)) {
guint32 s = 0;
const gchar *k = NULL, *t = NULL, *v = NULL;
wp_metadata_iterator_item_extract (&item, &s, &k, &t, &v);
WpMetadataItem *mi = g_value_get_boxed (&item);
guint32 s = wp_metadata_item_get_subject (mi);
const gchar *k = wp_metadata_item_get_key (mi);
const gchar *t = wp_metadata_item_get_value_type (mi);
const gchar *v = wp_metadata_item_get_value (mi);
lua_pushinteger (L, s);
lua_pushstring (L, k);
lua_pushstring (L, t);