summaryrefslogtreecommitdiff
path: root/src/cplxdeps.h
blob: 798b485a3076d77941d283903af9d661791780f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * Copyright (c) 2014, Novell Inc.
 *
 * This program is licensed under the BSD license, read LICENSE.BSD
 * for further information
 */

/*
 * cplxdeps.h (internal)
 */

#ifndef LIBSOLV_CPLXDEPS_H
#define LIBSOLV_CPLXDEPS_H

extern int pool_is_complex_dep_rd(Pool *pool, Reldep *rd);

static inline int 
pool_is_complex_dep(Pool *pool, Id dep)
{
  if (ISRELDEP(dep))
    {   
      Reldep *rd = GETRELDEP(pool, dep);
      if (rd->flags >= 8 && pool_is_complex_dep_rd(pool, rd))
        return 1;
    }   
  return 0;
}

extern int pool_normalize_complex_dep(Pool *pool, Id dep, Queue *bq, int flags);
extern void pool_add_pos_literals_complex_dep(Pool *pool, Id dep, Queue *q, Map *m, int neg);

#define CPLXDEPS_TODNF   (1 << 0)
#define CPLXDEPS_EXPAND  (1 << 1)
#define CPLXDEPS_INVERT  (1 << 2)
#define CPLXDEPS_NAME    (1 << 3)
#define CPLXDEPS_DONTFIX (1 << 4)

#define CPLXDEPS_ELSE_AND_1 (1 << 8)
#define CPLXDEPS_ELSE_AND_2 (1 << 9)
#define CPLXDEPS_ELSE_OR_1  (1 << 10)
#define CPLXDEPS_ELSE_OR_2  (1 << 11)
#define CPLXDEPS_ELSE_OR_3  (1 << 12)
#define CPLXDEPS_ELSE_MASK  (0x1f00)

#endif