2 * Copyright (c) 2007-2012, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
11 * A solvable represents an object with name-epoch:version-release.arch
15 #ifndef LIBSOLV_SOLVABLE_H
16 #define LIBSOLV_SOLVABLE_H
18 #include "pooltypes.h"
27 typedef struct _Solvable {
30 Id evr; /* epoch:version-release */
33 struct _Repo *repo; /* repo we belong to */
35 /* dependencies are offsets into repo->idarraydata */
36 Offset provides; /* terminated with Id 0 */
49 /* lookup functions */
50 Id solvable_lookup_type(Solvable *s, Id keyname);
51 Id solvable_lookup_id(Solvable *s, Id keyname);
52 unsigned long long solvable_lookup_num(Solvable *s, Id keyname, unsigned long long notfound);
53 unsigned int solvable_lookup_sizek(Solvable *s, Id keyname, unsigned int notfound);
54 const char *solvable_lookup_str(Solvable *s, Id keyname);
55 const char *solvable_lookup_str_poollang(Solvable *s, Id keyname);
56 const char *solvable_lookup_str_lang(Solvable *s, Id keyname, const char *lang, int usebase);
57 int solvable_lookup_bool(Solvable *s, Id keyname);
58 int solvable_lookup_void(Solvable *s, Id keyname);
59 const char *solvable_get_location(Solvable *s, unsigned int *medianrp); /* old name */
60 const char *solvable_lookup_location(Solvable *s, unsigned int *medianrp);
61 const char *solvable_lookup_sourcepkg(Solvable *s);
62 const unsigned char *solvable_lookup_bin_checksum(Solvable *s, Id keyname, Id *typep);
63 const char *solvable_lookup_checksum(Solvable *s, Id keyname, Id *typep);
64 int solvable_lookup_idarray(Solvable *s, Id keyname, Queue *q);
65 int solvable_lookup_deparray(Solvable *s, Id keyname, Queue *q, Id marker);
67 /* setter functions */
68 void solvable_set_id(Solvable *s, Id keyname, Id id);
69 void solvable_set_num(Solvable *s, Id keyname, unsigned long long num);
70 void solvable_set_str(Solvable *s, Id keyname, const char *str);
71 void solvable_set_poolstr(Solvable *s, Id keyname, const char *str);
72 void solvable_add_poolstr_array(Solvable *s, Id keyname, const char *str);
73 void solvable_add_idarray(Solvable *s, Id keyname, Id id);
74 void solvable_add_deparray(Solvable *s, Id keyname, Id dep, Id marker);
75 void solvable_set_idarray(Solvable *s, Id keyname, Queue *q);
76 void solvable_set_deparray(Solvable *s, Id keyname, Queue *q, Id marker);
77 void solvable_unset(Solvable *s, Id keyname);
79 int solvable_identical(Solvable *s1, Solvable *s2);
80 Id solvable_selfprovidedep(Solvable *s);
81 int solvable_matchesdep(Solvable *s, Id keyname, Id dep, int marker);
87 #endif /* LIBSOLV_SOLVABLE_H */