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"
23 typedef struct _Solvable {
26 Id evr; /* epoch:version-release */
29 struct _Repo *repo; /* repo we belong to */
31 /* dependencies are offsets into repo->idarraydata */
32 Offset provides; /* terminated with Id 0 */
45 /* lookup functions */
46 Id solvable_lookup_type(Solvable *s, Id keyname);
47 Id solvable_lookup_id(Solvable *s, Id keyname);
48 unsigned long long solvable_lookup_num(Solvable *s, Id keyname, unsigned long long notfound);
49 unsigned int solvable_lookup_sizek(Solvable *s, Id keyname, unsigned int notfound);
50 const char *solvable_lookup_str(Solvable *s, Id keyname);
51 const char *solvable_lookup_str_poollang(Solvable *s, Id keyname);
52 const char *solvable_lookup_str_lang(Solvable *s, Id keyname, const char *lang, int usebase);
53 int solvable_lookup_bool(Solvable *s, Id keyname);
54 int solvable_lookup_void(Solvable *s, Id keyname);
55 const char *solvable_get_location(Solvable *s, unsigned int *medianrp); /* old name */
56 const char *solvable_lookup_location(Solvable *s, unsigned int *medianrp);
57 const char *solvable_lookup_sourcepkg(Solvable *s);
58 const unsigned char *solvable_lookup_bin_checksum(Solvable *s, Id keyname, Id *typep);
59 const char *solvable_lookup_checksum(Solvable *s, Id keyname, Id *typep);
60 int solvable_lookup_idarray(Solvable *s, Id keyname, Queue *q);
61 int solvable_lookup_deparray(Solvable *s, Id keyname, Queue *q, Id marker);
63 /* setter functions */
64 void solvable_set_id(Solvable *s, Id keyname, Id id);
65 void solvable_set_num(Solvable *s, Id keyname, unsigned long long num);
66 void solvable_set_str(Solvable *s, Id keyname, const char *str);
67 void solvable_set_poolstr(Solvable *s, Id keyname, const char *str);
68 void solvable_add_poolstr_array(Solvable *s, Id keyname, const char *str);
69 void solvable_add_idarray(Solvable *s, Id keyname, Id id);
70 void solvable_add_deparray(Solvable *s, Id keyname, Id dep, Id marker);
71 void solvable_set_idarray(Solvable *s, Id keyname, Queue *q);
72 void solvable_set_deparray(Solvable *s, Id keyname, Queue *q, Id marker);
73 void solvable_unset(Solvable *s, Id keyname);
75 int solvable_identical(Solvable *s1, Solvable *s2);
76 Id solvable_selfprovidedep(Solvable *s);
78 #endif /* LIBSOLV_SOLVABLE_H */