diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-01-18 23:50:13 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-01-18 23:50:13 +0100 |
commit | 87d1515de5ae611e95144def9ef4b2c0c933f6fe (patch) | |
tree | 4cdeceee70826dffd460775aaddbea8e60e51eaa /name.h | |
parent | 91cdde8a7a08c6797995cc67f4b55ac43780cdd8 (diff) |
first try at implementing dependency loader
Diffstat (limited to 'name.h')
-rw-r--r-- | name.h | 35 |
1 files changed, 22 insertions, 13 deletions
@@ -42,24 +42,33 @@ typedef enum NameState { NAME_FAILED } NameState; -struct Meta { - Manager *manager; - NameType type; - NameState state; - - char **names; - +typedef enum NameDependency { /* Positive dependencies */ - Set *requires, *soft_requires, *wants, *requisite, *soft_requisite; - Set *required_by; /* inverse of 'requires', 'soft_requires', 'requisite' and 'soft_requisite' is 'required_by' */ + NAME_REQUIRES, + NAME_SOFT_REQUIRES, + NAME_WANTS, + NAME_REQUISITE, + NAME_SOFT_REQUISITE, + NAME_REQUIRED_BY, /* inverse of 'requires' and 'requisite' is 'required_by' */ + NAME_WANTED_BY, /* inverse of 'wants', 'soft_requires' and 'soft_requisite' is 'wanted_by' */ /* Negative dependencies */ - Set *conflicts; /* inverse of 'conflicts' is 'conflicts' */ + NAME_CONFLICTS, /* inverse of 'conflicts' is 'conflicts' */ /* Order */ - Set *before, *after; /* inverse of before is after and vice versa */ + NAME_BEFORE, /* inverse of before is after and vice versa */ + NAME_AFTER, + _NAME_DEPENDENCY_MAX +} NameDependency; + +struct Meta { + Manager *manager; + NameType type; + NameState state; + + Set *names; + Set *dependencies[_NAME_DEPENDENCY_MAX]; - /* Information */ char *description; /* If there is something to do with this name, then this is @@ -265,7 +274,7 @@ bool name_is_valid(const char *n); Name *name_new(Manager *m); void name_free(Name *name); int name_link(Name *name); - +int name_merge(Name *name, Name *other); int name_augment(Name *n); #endif |