Imported Upstream version 0.6.12
[platform/upstream/libsolv.git] / src / cplxdeps.h
1 /*
2  * Copyright (c) 2014, Novell Inc.
3  *
4  * This program is licensed under the BSD license, read LICENSE.BSD
5  * for further information
6  */
7
8 /*
9  * cplxdeps.h (internal)
10  */
11
12 #ifndef LIBSOLV_CPLXDEPS_H
13 #define LIBSOLV_CPLXDEPS_H
14
15 extern int pool_is_complex_dep_rd(Pool *pool, Reldep *rd);
16
17 static inline int 
18 pool_is_complex_dep(Pool *pool, Id dep)
19 {
20   if (ISRELDEP(dep))
21     {   
22       Reldep *rd = GETRELDEP(pool, dep);
23       if (rd->flags >= 8 && pool_is_complex_dep_rd(pool, rd))
24         return 1;
25     }   
26   return 0;
27 }
28
29 extern int pool_normalize_complex_dep(Pool *pool, Id dep, Queue *bq, int flags);
30 extern void pool_add_pos_literals_complex_dep(Pool *pool, Id dep, Queue *q, Map *m, int neg);
31
32 #define CPLXDEPS_TODNF   (1 << 0)
33 #define CPLXDEPS_EXPAND  (1 << 1)
34 #define CPLXDEPS_INVERT  (1 << 2)
35 #define CPLXDEPS_NAME    (1 << 3)
36 #define CPLXDEPS_DONTFIX (1 << 4)
37
38 #define CPLXDEPS_ELSE_AND_1 (1 << 8)
39 #define CPLXDEPS_ELSE_AND_2 (1 << 9)
40 #define CPLXDEPS_ELSE_OR_1  (1 << 10)
41 #define CPLXDEPS_ELSE_OR_2  (1 << 11)
42 #define CPLXDEPS_ELSE_OR_3  (1 << 12)
43 #define CPLXDEPS_ELSE_MASK  (0x1f00)
44
45 #endif
46