diff options
author | Michael Schroeder <mls@suse.de> | 2009-06-08 17:20:20 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2009-06-08 17:20:20 +0200 |
commit | 3ef06f9901829dc03aaf685faf8612170f4c909c (patch) | |
tree | 541e569507955e0bc02fabde8e6d4203b57c0f56 /src/solvable.c | |
parent | 93ed9cc41fadfd5eeb1928e9028f5f2f600fb752 (diff) | |
download | libsolv-3ef06f9901829dc03aaf685faf8612170f4c909c.tar.gz libsolv-3ef06f9901829dc03aaf685faf8612170f4c909c.tar.bz2 libsolv-3ef06f9901829dc03aaf685faf8612170f4c909c.zip |
- update transaction ordering code
- add queue insert/delete functions
Diffstat (limited to 'src/solvable.c')
-rw-r--r-- | src/solvable.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/solvable.c b/src/solvable.c index 68a3855..6f6f590 100644 --- a/src/solvable.c +++ b/src/solvable.c @@ -42,6 +42,29 @@ solvable_lookup_id(Solvable *s, Id keyname) return repo_lookup_id(s->repo, s - s->repo->pool->solvables, keyname); } +int +solvable_lookup_idarray(Solvable *s, Id keyname, Queue *q) +{ + Dataiterator di; + int found = 0; + + queue_empty(q); + if (!s->repo) + return 0; + dataiterator_init(&di, s->repo->pool, s->repo, s - s->repo->pool->solvables, keyname, 0, SEARCH_ARRAYSENTINEL); + while (dataiterator_step(&di)) + { + if (di.key->type != REPOKEY_TYPE_IDARRAY && di.key->type != REPOKEY_TYPE_REL_IDARRAY) + continue; + found = 1; + if (di.kv.eof) + break; + queue_push(q, di.kv.id); + } + dataiterator_free(&di); + return found; +} + const char * solvable_lookup_str(Solvable *s, Id keyname) { |