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 unsigned char pool_arch2color_slow(Pool *pool, Id arch); 00015 00016 #define ARCHCOLOR_32 1 00017 #define ARCHCOLOR_64 2 00018 #define ARCHCOLOR_ALL 255 00019 00020 static inline unsigned char pool_arch2color(Pool *pool, Id arch) 00021 { 00022 if (arch > pool->lastarch) 00023 return ARCHCOLOR_ALL; 00024 if (pool->id2color && pool->id2color[arch]) 00025 return pool->id2color[arch]; 00026 return pool_arch2color_slow(pool, arch); 00027 } 00028 00029 static inline int pool_colormatch(Pool *pool, Solvable *s1, Solvable *s2) 00030 { 00031 if (s1->arch == s2->arch) 00032 return 1; 00033 if ((pool_arch2color(pool, s1->arch) & pool_arch2color(pool, s2->arch)) != 0) 00034 return 1; 00035 return 0; 00036 } 00037 00038 #endif /* SATSOLVER_POOLARCH_H */