Fix description of --profile
[mspang/inapt.git] / inapt.h
diff --git a/inapt.h b/inapt.h
index d695613..50bbd05 100644 (file)
--- a/inapt.h
+++ b/inapt.h
@@ -1,11 +1,39 @@
 #include <vector>
+#include <apt-pkg/pkgcache.h>
+
+struct inapt_conditional;
+struct inapt_package;
 
 struct inapt_action {
-    const char *package;
-    enum action_t { INSTALL, REMOVE, UNSET } action;
+    enum action_t { INSTALL, REMOVE } action;
+    std::vector<std::string> predicates;
+    std::vector<inapt_package *> packages;
+};
+
+struct inapt_package {
+    enum inapt_action::action_t action;
+    std::vector<std::string> alternates;
+    std::vector<std::string> predicates;
+    pkgCache::PkgIterator pkg;
     const char *filename;
     int linenum;
-    void *obj;
 };
 
-void scanner(std::vector<inapt_action> *actions);
+struct inapt_profiles {
+    std::vector<std::string> predicates;
+    std::vector<std::string> profiles;
+};
+
+struct inapt_block {
+    std::vector<inapt_action *> actions;
+    std::vector<inapt_conditional *> children;
+    std::vector<inapt_profiles *> profiles;
+};
+
+struct inapt_conditional {
+    std::vector<std::string> predicates;
+    struct inapt_block *then_block;
+    struct inapt_block *else_block;
+};
+
+void parser(const char *filename, inapt_block *context);