X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fjob.h;h=e869856d37f3031fa1107fb0725479433766b277;hb=33e48d472e4e8e123be7bce5a0962cab7eaaa508;hp=35c213d7400a3acf64493b44d093bf18b1a9bc47;hpb=668ad332a404736474749cbcc8404af3e4447170;p=elogind.git diff --git a/src/core/job.h b/src/core/job.h index 35c213d74..e869856d3 100644 --- a/src/core/job.h +++ b/src/core/job.h @@ -28,13 +28,13 @@ typedef struct Job Job; typedef struct JobDependency JobDependency; +typedef struct JobBusClient JobBusClient; typedef enum JobType JobType; typedef enum JobState JobState; typedef enum JobMode JobMode; typedef enum JobResult JobResult; #include "manager.h" -#include "transaction.h" #include "unit.h" #include "hashmap.h" #include "list.h" @@ -100,6 +100,13 @@ struct JobDependency { bool conflicts; }; +struct JobBusClient { + LIST_FIELDS(JobBusClient, client); + /* Note that this bus object is not ref counted here. */ + DBusConnection *bus; + char name[0]; +}; + struct Job { Manager *manager; Unit *unit; @@ -122,9 +129,8 @@ struct Job { Watch timer_watch; - /* Note that this bus object is not ref counted here. */ - DBusConnection *bus; - char *bus_client; + /* There can be more than one client, because of job merging. */ + LIST_HEAD(JobBusClient, bus_client_list); JobResult result; @@ -137,15 +143,16 @@ struct Job { bool ignore_order:1; }; +JobBusClient* job_bus_client_new(DBusConnection *connection, const char *name); + Job* job_new(Unit *unit, JobType type); -void job_uninstall(Job *j); void job_free(Job *job); +Job* job_install(Job *j); +void job_uninstall(Job *j); void job_dump(Job *j, FILE*f, const char *prefix); -JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool conflicts, Transaction *tr); -void job_dependency_free(JobDependency *l, Transaction *tr); - -bool job_is_anchor(Job *j); +JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool conflicts); +void job_dependency_free(JobDependency *l); int job_merge(Job *j, Job *other);