summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-03-02 14:17:34 +0100
committerMichael Schroeder <mls@suse.de>2012-03-02 14:17:34 +0100
commit6bee613a2725c660ac97f76b867f8fb27cc8a1ef (patch)
treea6341fd44ba9871dff9d6eb3b73eb2fa996ee139
parent0a5baff771db11cea25e646677e72765e164e57a (diff)
downloadlibsolv-6bee613a2725c660ac97f76b867f8fb27cc8a1ef.tar.gz
libsolv-6bee613a2725c660ac97f76b867f8fb27cc8a1ef.tar.bz2
libsolv-6bee613a2725c660ac97f76b867f8fb27cc8a1ef.zip
- yet another incompatible change: as everybody seems to use repo_write_stdkeyfilter, make repo_write use it automatically and add repo_write_filtered
-rw-r--r--bindings/solv.i6
-rw-r--r--examples/solv.c6
-rw-r--r--src/libsolv.ver2
-rw-r--r--src/repo_write.c18
-rw-r--r--src/repo_write.h9
-rw-r--r--tools/common_write.c6
6 files changed, 32 insertions, 15 deletions
diff --git a/bindings/solv.i b/bindings/solv.i
index fdf548d..3bc6593 100644
--- a/bindings/solv.i
+++ b/bindings/solv.i
@@ -1169,13 +1169,13 @@ typedef struct {
return repo_lookup_num($self, entry, keyname, notfound);
}
void write(FILE *fp) {
- repo_write($self, fp, repo_write_stdkeyfilter, 0, 0);
+ repo_write($self, fp);
}
# HACK, remove if no longer needed!
bool write_first_repodata(FILE *fp) {
int oldnrepodata = $self->nrepodata;
$self->nrepodata = oldnrepodata > 2 ? 2 : oldnrepodata;
- repo_write($self, fp, repo_write_stdkeyfilter, 0, 0);
+ repo_write($self, fp);
$self->nrepodata = oldnrepodata;
return 1;
}
@@ -2438,7 +2438,7 @@ rb_eval_string(
repodata_create_stubs(repo_id2repodata($self->repo, $self->id));
}
void write(FILE *fp) {
- repodata_write(repo_id2repodata($self->repo, $self->id), fp, repo_write_stdkeyfilter, 0);
+ repodata_write(repo_id2repodata($self->repo, $self->id), fp);
}
bool add_solv(FILE *fp, int flags = 0) {
Repodata *data = repo_id2repodata($self->repo, $self->id);
diff --git a/examples/solv.c b/examples/solv.c
index 8ea27d0..455eae8 100644
--- a/examples/solv.c
+++ b/examples/solv.c
@@ -1114,14 +1114,14 @@ writecachedrepo(Repo *repo, Repodata *info, const char *repoext, unsigned char *
onepiece = 0;
if (!info)
- repo_write(repo, fp, repo_write_stdkeyfilter, 0, 0);
+ repo_write(repo, fp);
else if (repoext)
- repodata_write(info, fp, repo_write_stdkeyfilter, 0);
+ repodata_write(info, fp);
else
{
int oldnrepodata = repo->nrepodata;
repo->nrepodata = oldnrepodata > 2 ? 2 : oldnrepodata; /* XXX: do this right */
- repo_write(repo, fp, repo_write_stdkeyfilter, 0, 0);
+ repo_write(repo, fp);
repo->nrepodata = oldnrepodata;
onepiece = 0;
}
diff --git a/src/libsolv.ver b/src/libsolv.ver
index 9a200a5..0b852da 100644
--- a/src/libsolv.ver
+++ b/src/libsolv.ver
@@ -149,6 +149,7 @@ SOLV_1.0 {
repo_set_str;
repo_sidedata_create;
repo_write;
+ repo_write_filtered;
repo_write_stdkeyfilter;
repodata_add_dirnumnum;
repodata_add_dirstr;
@@ -206,6 +207,7 @@ SOLV_1.0 {
repodata_stringify;
repodata_swap_attrs;
repodata_write;
+ repodata_write_filtered;
repopagestore_compress_page;
solv_bin2hex;
solv_calloc;
diff --git a/src/repo_write.c b/src/repo_write.c
index 7675f44..ff4fac9 100644
--- a/src/repo_write.c
+++ b/src/repo_write.c
@@ -975,7 +975,7 @@ repo_write_stdkeyfilter(Repo *repo, Repokey *key, void *kfdata)
* 5) write everything to disk
*/
int
-repo_write(Repo *repo, FILE *fp, int (*keyfilter)(Repo *repo, Repokey *key, void *kfdata), void *kfdata, Queue *keyq)
+repo_write_filtered(Repo *repo, FILE *fp, int (*keyfilter)(Repo *repo, Repokey *key, void *kfdata), void *kfdata, Queue *keyq)
{
Pool *pool = repo->pool;
int i, j, n;
@@ -1936,12 +1936,24 @@ repodata_write_keyfilter(Repo *repo, Repokey *key, void *kfdata)
}
int
-repodata_write(Repodata *data, FILE *fp, int (*keyfilter)(Repo *repo, Repokey *key, void *kfdata), void *kfdata)
+repodata_write_filtered(Repodata *data, FILE *fp, int (*keyfilter)(Repo *repo, Repokey *key, void *kfdata), void *kfdata, Queue *keyq)
{
struct repodata_write_data wd;
wd.keyfilter = keyfilter;
wd.kfdata = kfdata;
wd.repodataid = data->repodataid;
- return repo_write(data->repo, fp, repodata_write_keyfilter, &wd, 0);
+ return repo_write_filtered(data->repo, fp, repodata_write_keyfilter, &wd, keyq);
+}
+
+int
+repodata_write(Repodata *data, FILE *fp)
+{
+ return repodata_write_filtered(data, fp, repo_write_stdkeyfilter, 0, 0);
+}
+
+int
+repo_write(Repo *repo, FILE *fp)
+{
+ return repo_write_filtered(repo, fp, repo_write_stdkeyfilter, 0, 0);
}
diff --git a/src/repo_write.h b/src/repo_write.h
index 756a41e..46e1d4a 100644
--- a/src/repo_write.h
+++ b/src/repo_write.h
@@ -18,9 +18,12 @@
#include "repo.h"
#include "queue.h"
-extern int repo_write(Repo *repo, FILE *fp, int (*keyfilter)(Repo *repo, Repokey *key, void *kfdata), void *kfdata, Queue *keyq);
-extern int repo_write_stdkeyfilter(Repo *repo, Repokey *key, void *kfdata);
+extern int repo_write(Repo *repo, FILE *fp);
+extern int repo_write_filtered(Repo *repo, FILE *fp, int (*keyfilter)(Repo *repo, Repokey *key, void *kfdata), void *kfdata, Queue *keyq);
+
+extern int repodata_write(Repodata *data , FILE *fp);
+extern int repodata_write_filtered(Repodata *data , FILE *fp, int (*keyfilter)(Repo *repo, Repokey *key, void *kfdata), void *kfdata, Queue *keyq);
-extern int repodata_write(Repodata *data , FILE *fp, int (*keyfilter)(Repo *repo, Repokey *key, void *kfdata), void *kfdata);
+extern int repo_write_stdkeyfilter(Repo *repo, Repokey *key, void *kfdata);
#endif
diff --git a/tools/common_write.c b/tools/common_write.c
index 9f7e627..3ea6a5b 100644
--- a/tools/common_write.c
+++ b/tools/common_write.c
@@ -180,7 +180,7 @@ write_info(Repo *repo, FILE *fp, int (*keyfilter)(Repo *repo, Repokey *key, void
Queue keyq;
queue_init(&keyq);
- repo_write(repo, fp, keyfilter, kfdata, &keyq);
+ repo_write_filtered(repo, fp, keyfilter, kfdata, &keyq);
h = repodata_new_handle(info);
if (keyq.count)
repodata_set_idarray(info, h, REPOSITORY_KEYS, &keyq);
@@ -298,7 +298,7 @@ tool_write(Repo *repo, const char *basename, const char *attrname)
kd.languages = languages;
kd.nlanguages = nlanguages;
repodata_internalize(info);
- repo_write(repo, fp, keyfilter_other, &kd, 0);
+ repo_write_filtered(repo, fp, keyfilter_other, &kd, 0);
fclose(fp);
for (i = 0; i < nlanguages; i++)
free(languages[i]);
@@ -316,7 +316,7 @@ tool_write(Repo *repo, const char *basename, const char *attrname)
kd.haveexternal = 1;
}
repodata_internalize(info);
- repo_write(repo, stdout, keyfilter_solv, &kd, 0);
+ repo_write_filtered(repo, stdout, keyfilter_solv, &kd, 0);
repodata_free(info);
return 0;
}