static gboolean test_query (GBookmarkFile *bookmark) { gint size; gchar **uris; gsize uris_len, i; gboolean res = TRUE; size = g_bookmark_file_get_size (bookmark); uris = g_bookmark_file_get_uris (bookmark, &uris_len); if (uris_len != size) { g_print ("URI/size mismatch: URI count is %d (should be %d)\n", uris_len, size); res = FALSE; } for (i = 0; i < uris_len; i++) if (!g_bookmark_file_has_item (bookmark, uris[i])) { g_print ("URI/bookmark mismatch: bookmark for '%s' does not exist\n", uris[i]); res = FALSE; } g_strfreev (uris); return res; }
static VALUE bf_has_item(VALUE self, VALUE uri) { return CBOOL2RVAL(g_bookmark_file_has_item(_SELF(self), (const gchar *)RVAL2CSTR(uri))); }