From: Klaus Kaempf Date: Tue, 8 Apr 2008 10:01:37 +0000 (+0000) Subject: - fix prototype for repodata_set_num() X-Git-Tag: BASE-SuSE-Code-12_1-Branch~308^2~435 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0edf38996a5392ef320c8f36e8b3d167efad2d1d;p=thirdparty%2Flibsolv.git - fix prototype for repodata_set_num() - add comments to repodata.h --- diff --git a/src/repodata.c b/src/repodata.c index c4b8156f..7458528a 100644 --- a/src/repodata.c +++ b/src/repodata.c @@ -1163,14 +1163,14 @@ repodata_set_id(Repodata *data, Id entry, Id keyname, Id id) } void -repodata_set_num(Repodata *data, Id entry, Id keyname, Id num) +repodata_set_num(Repodata *data, Id entry, Id keyname, unsigned int num) { Repokey key; key.name = keyname; key.type = REPOKEY_TYPE_NUM; key.size = 0; key.storage = KEY_STORAGE_INCORE; - repodata_set(data, entry, &key, num); + repodata_set(data, entry, &key, (Id)num); } void diff --git a/src/repodata.h b/src/repodata.h index 091390ca..d86ff93c 100644 --- a/src/repodata.h +++ b/src/repodata.h @@ -112,13 +112,24 @@ typedef struct _Repodata { Id *addedfileprovides; } Repodata; -/* management functions */ + +/*----- + * management functions + */ void repodata_init(Repodata *data, struct _Repo *repo, int localpool); void repodata_extend(Repodata *data, Id p); void repodata_extend_extra(Repodata *data, int nextra); void repodata_extend_block(Repodata *data, Id p, int num); void repodata_free(Repodata *data); +/* internalize repodata into .solv, required before writing out a .solv file */ +void repodata_internalize(Repodata *data); + + +/*---- + * access functions + */ + /* Search key (all keys, if keyname == 0) for Id * is _relative_ Id for * Call for each match @@ -128,30 +139,52 @@ void repodata_search(Repodata *data, Id entry, Id keyname, int (*callback)(void /* lookup functions */ Id repodata_lookup_id(Repodata *data, Id entry, Id keyid); const char *repodata_lookup_str(Repodata *data, Id entry, Id keyid); -int repodata_lookup_num(Repodata *data, Id entry, Id keyid, unsigned *value); +int repodata_lookup_num(Repodata *data, Id entry, Id keyid, unsigned int *value); int repodata_lookup_void(Repodata *data, Id entry, Id keyid); const unsigned char *repodata_lookup_bin_checksum(Repodata *data, Id entry, Id keyid, Id *typep); -/* data assignment */ + +/*----- + * data assignment functions + */ + +/* basic types: void, num, string, Id */ + +void repodata_set_void(Repodata *data, Id entry, Id keyname); +void repodata_set_num(Repodata *data, Id entry, Id keyname, unsigned int num); +void repodata_set_str(Repodata *data, Id entry, Id keyname, const char *str); void repodata_set_id(Repodata *data, Id entry, Id keyname, Id id); -void repodata_set_num(Repodata *data, Id entry, Id keyname, Id num); + +/* */ + void repodata_set_poolstr(Repodata *data, Id entry, Id keyname, const char *str); void repodata_set_constant(Repodata *data, Id entry, Id keyname, Id constant); void repodata_set_constantid(Repodata *data, Id entry, Id keyname, Id id); -void repodata_set_void(Repodata *data, Id entry, Id keyname); -void repodata_set_str(Repodata *data, Id entry, Id keyname, const char *str); + +/* checksum */ void repodata_set_bin_checksum(Repodata *data, Id entry, Id keyname, Id type, const unsigned char *buf); void repodata_set_checksum(Repodata *data, Id entry, Id keyname, Id type, const char *str); + +/* directory (for package file list) */ void repodata_add_dirnumnum(Repodata *data, Id entry, Id keyname, Id dir, Id num, Id num2); void repodata_add_dirstr(Repodata *data, Id entry, Id keyname, Id dir, const char *str); + + +/* Arrays */ void repodata_add_idarray(Repodata *data, Id entry, Id keyname, Id id); void repodata_add_poolstr_array(Repodata *data, Id entry, Id keyname, const char *str); + +/*----- + * data management + */ + +/* merge attributes */ void repodata_merge_attrs (Repodata *data, Id dest, Id src); -void repodata_internalize(Repodata *data); +/* */ void repodata_disable_paging(Repodata *data); /* helper functions */