00001 /* 00002 * Copyright (c) 2007, Novell Inc. 00003 * 00004 * This program is licensed under the BSD license, read LICENSE.BSD 00005 * for further information 00006 */ 00007 00008 #ifndef SATSOLVER_POOLARCH_H 00009 #define SATSOLVER_POOLARCH_H 00010 00011 #include "pool.h" 00012 00013 extern void pool_setarch(Pool *, const char *); 00014 extern void pool_setarchpolicy(Pool *, const char *); 00015 extern unsigned char pool_arch2color_slow(Pool *pool, Id arch); 00016 00017 #define ARCHCOLOR_32 1 00018 #define ARCHCOLOR_64 2 00019 #define ARCHCOLOR_ALL 255 00020 00021 static inline unsigned char pool_arch2color(Pool *pool, Id arch) 00022 { 00023 if (arch > pool->lastarch) 00024 return ARCHCOLOR_ALL; 00025 if (pool->id2color && pool->id2color[arch]) 00026 return pool->id2color[arch]; 00027 return pool_arch2color_slow(pool, arch); 00028 } 00029 00030 static inline int pool_colormatch(Pool *pool, Solvable *s1, Solvable *s2) 00031 { 00032 if (s1->arch == s2->arch) 00033 return 1; 00034 if ((pool_arch2color(pool, s1->arch) & pool_arch2color(pool, s2->arch)) != 0) 00035 return 1; 00036 return 0; 00037 } 00038 00039 #endif /* SATSOLVER_POOLARCH_H */