- add support for repository disabling
[platform/upstream/libsolv.git] / src / poolarch.h
1 /*
2  * Copyright (c) 2007, Novell Inc.
3  *
4  * This program is licensed under the BSD license, read LICENSE.BSD
5  * for further information
6  */
7
8 #ifndef SATSOLVER_POOLARCH_H
9 #define SATSOLVER_POOLARCH_H
10
11 #include "pool.h"
12
13 extern void pool_setarch(Pool *, const char *);
14 extern unsigned char pool_arch2color_slow(Pool *pool, Id arch);
15
16 #define ARCHCOLOR_32    1
17 #define ARCHCOLOR_64    2
18 #define ARCHCOLOR_ALL   255
19
20 static inline unsigned char pool_arch2color(Pool *pool, Id arch)
21 {
22   if (arch > pool->lastarch)
23     return ARCHCOLOR_ALL;
24   if (pool->id2color && pool->id2color[arch])
25     return pool->id2color[arch];
26   return pool_arch2color_slow(pool, arch);
27 }
28
29 static inline int pool_colormatch(Pool *pool, Solvable *s1, Solvable *s2)
30 {
31   if (s1->arch == s2->arch)
32     return 1;
33   if ((pool_arch2color(pool, s1->arch) & pool_arch2color(pool, s2->arch)) != 0)
34     return 1;
35   return 0;
36 }
37
38 #endif /* SATSOLVER_POOLARCH_H */