2 * Copyright (c) 2007, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
8 #ifndef LIBSOLV_POOLARCH_H
9 #define LIBSOLV_POOLARCH_H
17 extern void pool_setarch(Pool *, const char *);
18 extern void pool_setarchpolicy(Pool *, const char *);
19 extern unsigned char pool_arch2color_slow(Pool *pool, Id arch);
21 #define ARCHCOLOR_32 1
22 #define ARCHCOLOR_64 2
23 #define ARCHCOLOR_ALL 255
25 static inline unsigned char pool_arch2color(Pool *pool, Id arch)
27 if ((unsigned int)arch >= (unsigned int)pool->lastarch)
29 if (pool->id2color && pool->id2color[arch])
30 return pool->id2color[arch];
31 return pool_arch2color_slow(pool, arch);
34 static inline int pool_colormatch(Pool *pool, Solvable *s1, Solvable *s2)
36 if (s1->arch == s2->arch)
38 if ((pool_arch2color(pool, s1->arch) & pool_arch2color(pool, s2->arch)) != 0)
43 static inline unsigned int pool_arch2score(const Pool *pool, Id arch) {
44 return (unsigned int)arch < (unsigned int)pool->lastarch ? (unsigned int)pool->id2arch[arch] : 0;
51 #endif /* LIBSOLV_POOLARCH_H */