c1f87b8349bde9dda55f51f2d52bc04b2a016d77
[platform/upstream/libsolv.git] / src / transaction.h
1 /*
2  * Copyright (c) 2007-2009, Novell Inc.
3  *
4  * This program is licensed under the BSD license, read LICENSE.BSD
5  * for further information
6  */
7
8 /*
9  * transaction.h
10  *
11  */
12
13 #ifndef SATSOLVER_TRANSACTION_H
14 #define SATSOLVER_TRANSACTION_H
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 #include "pooltypes.h"
21 #include "queue.h"
22 #include "bitmap.h"
23
24 struct _Pool;
25
26 typedef struct _Transaction {
27   struct _Pool *pool;
28   Queue steps;
29   Queue transaction_info;
30   Id *transaction_installed;
31   Map transactsmap;
32 } Transaction;
33
34
35 /* step types */
36 #define SOLVER_TRANSACTION_ERASE                0x10
37 #define SOLVER_TRANSACTION_REINSTALLED          0x11
38 #define SOLVER_TRANSACTION_DOWNGRADED           0x12
39 #define SOLVER_TRANSACTION_CHANGED              0x13
40 #define SOLVER_TRANSACTION_UPGRADED             0x14
41 #define SOLVER_TRANSACTION_REPLACED             0x15
42
43 #define SOLVER_TRANSACTION_INSTALL              0x20
44 #define SOLVER_TRANSACTION_REINSTALL            0x21
45 #define SOLVER_TRANSACTION_DOWNGRADE            0x22
46 #define SOLVER_TRANSACTION_CHANGE               0x23
47 #define SOLVER_TRANSACTION_UPGRADE              0x24
48 #define SOLVER_TRANSACTION_REPLACE              0x25
49
50 #define SOLVER_TRANSACTION_MULTIINSTALL         0x30
51 #define SOLVER_TRANSACTION_MULTIREINSTALL       0x31
52
53 /* show modes */
54 #define SOLVER_TRANSACTION_SHOW_ACTIVE          (1 << 0)
55 #define SOLVER_TRANSACTION_SHOW_ALL             (1 << 1)
56 #define SOLVER_TRANSACTION_SHOW_REPLACES        (1 << 2)
57
58 extern void transaction_init(Transaction *trans, struct _Pool *pool);
59 extern void transaction_free(Transaction *trans);
60 extern void transaction_calculate(Transaction *trans, Queue *decisionq, Map *noobsmap);
61 extern void solver_transaction_all_pkgs(Transaction *trans, Id p, Queue *pkgs);
62 extern Id   solver_transaction_pkg(Transaction *trans, Id p);
63 extern Id   solver_transaction_show(Transaction *trans, Id type, Id p, int mode);
64 extern void transaction_order(Transaction *trans);
65
66 #ifdef __cplusplus
67 }
68 #endif
69
70 #endif