#define REPODATA_STUB 1
#define REPODATA_ERROR 2
#define REPODATA_STORE 3
+#define REPODATA_LOADING 4
+
int state; /* available, stub or error */
void (*loadcallback)(struct _Repodata *);
*/
void repodata_initdata(Repodata *data, struct _Repo *repo, int localpool);
void repodata_freedata(Repodata *data);
+
+Repodata *repodata_create(struct _Repo *repo, int localpool);
void repodata_free(Repodata *data);
return x && (x & (1 << (keyname & 7))) ? 1 : 0;
}
+/* check if the repodata contains data for the specified keyname */
+static inline int
+repodata_has_keyname(Repodata *data, Id keyname)
+{
+ int i;
+ if (!repodata_precheck_keyname(data, keyname))
+ return 0;
+ for (i = 1; i < data->nkeys; i++)
+ if (data->keys[i].name == keyname)
+ return 1;
+ return 0;
+}
+
/* search key <keyname> (all keys, if keyname == 0) for Id <solvid>
* Call <callback> for each match */
void repodata_search(Repodata *data, Id solvid, Id keyname, int flags, int (*callback)(void *cbdata, Solvable *s, Repodata *data, Repokey *key, struct _KeyValue *kv), void *cbdata);
* if not possible */
int repodata_stringify(Pool *pool, Repodata *data, Repokey *key, struct _KeyValue *kv, int flags);
+int repodata_filelistfilter_matches(Repodata *data, const char *str);
+
/* lookup functions */
Id repodata_lookup_id(Repodata *data, Id solvid, Id keyname);
int repodata_lookup_num(Repodata *data, Id solvid, Id keyname, unsigned int *value);
int repodata_lookup_void(Repodata *data, Id solvid, Id keyname);
const unsigned char *repodata_lookup_bin_checksum(Repodata *data, Id solvid, Id keyname, Id *typep);
-
+int repodata_lookup_idarray(Repodata *data, Id solvid, Id keyname, Queue *q);
/*-----
*/
void repodata_extend(Repodata *data, Id p);
void repodata_extend_block(Repodata *data, Id p, int num);
+void repodata_shrink(Repodata *data, int end);
/* internalize freshly set data, so that it is found by the search
* functions and written out */
void repodata_set_num(Repodata *data, Id solvid, Id keyname, unsigned int num);
void repodata_set_id(Repodata *data, Id solvid, Id keyname, Id id);
void repodata_set_str(Repodata *data, Id solvid, Id keyname, const char *str);
+void repodata_set_binary(Repodata *data, Id solvid, Id keyname, void *buf, int len);
/* create id from string, then set_id */
void repodata_set_poolstr(Repodata *data, Id solvid, Id keyname, const char *str);
void repodata_add_fixarray(Repodata *data, Id solvid, Id keyname, Id ghandle);
void repodata_add_flexarray(Repodata *data, Id solvid, Id keyname, Id ghandle);
+void repodata_delete_uninternalized(Repodata *data, Id solvid, Id keyname);
+
/*
merge attributes from one solvable to another
works only if the data is not yet internalized
*/
void repodata_merge_attrs(Repodata *data, Id dest, Id src);
+void repodata_merge_some_attrs(Repodata *data, Id dest, Id src, Map *keyidmap, int overwrite);
+
+void repodata_create_stubs(Repodata *data);
+void repodata_join(Repodata *data, Id joinkey);
/*
* load all paged data, used to speed up copying in repo_rpmdb