Imported Upstream version 0.7.12
[platform/upstream/libsolv.git] / src / poolarch.h
index 5ace54f..787883b 100644 (file)
@@ -5,12 +5,17 @@
  * for further information
  */
 
-#ifndef SATSOLVER_POOLARCH_H
-#define SATSOLVER_POOLARCH_H
+#ifndef LIBSOLV_POOLARCH_H
+#define LIBSOLV_POOLARCH_H
 
 #include "pool.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern void pool_setarch(Pool *, const char *);
+extern void pool_setarchpolicy(Pool *, const char *);
 extern unsigned char pool_arch2color_slow(Pool *pool, Id arch);
 
 #define ARCHCOLOR_32    1
@@ -19,7 +24,7 @@ extern unsigned char pool_arch2color_slow(Pool *pool, Id arch);
 
 static inline unsigned char pool_arch2color(Pool *pool, Id arch)
 {
-  if (arch > pool->lastarch)
+  if ((unsigned int)arch >= (unsigned int)pool->lastarch)
     return ARCHCOLOR_ALL;
   if (pool->id2color && pool->id2color[arch])
     return pool->id2color[arch];
@@ -35,4 +40,12 @@ static inline int pool_colormatch(Pool *pool, Solvable *s1, Solvable *s2)
   return 0;
 }
 
-#endif /* SATSOLVER_POOLARCH_H */
+static inline unsigned int pool_arch2score(const Pool *pool, Id arch) {
+  return (unsigned int)arch < (unsigned int)pool->lastarch ? (unsigned int)pool->id2arch[arch] : 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LIBSOLV_POOLARCH_H */