Add a structure to group actions by command
[mspang/inapt.git] / inapt.h
1 #include <vector>
2 #include <apt-pkg/pkgcache.h>
3
4 struct inapt_conditional;
5
6 struct inapt_package {
7     std::vector<std::string> alternates;
8     std::vector<std::string> predicates;
9     pkgCache::PkgIterator pkg;
10     const char *filename;
11     int linenum;
12 };
13
14 struct inapt_action {
15     enum action_t { INSTALL, REMOVE } action;
16     std::vector<std::string> predicates;
17     std::vector<inapt_package *> packages;
18 };
19
20 struct inapt_block {
21     std::vector<inapt_action *> actions;
22     std::vector<inapt_conditional *> children;
23 };
24
25 struct inapt_conditional {
26     const char *condition;
27     struct inapt_block *then_block;
28     struct inapt_block *else_block;
29 };
30
31 void parser(const char *filename, inapt_block *context);