chiark / gitweb /
transaction: maintain anchor_job
[elogind.git] / src / core / transaction.h
1 #ifndef footransactionhfoo
2 #define footransactionhfoo
3
4 typedef struct Transaction Transaction;
5
6 #include "unit.h"
7 #include "manager.h"
8 #include "job.h"
9 #include "hashmap.h"
10
11 struct Transaction {
12         /* Jobs to be added */
13         Hashmap *jobs;      /* Unit object => Job object list 1:1 */
14         JobDependency *anchor;
15         Job *anchor_job;      /* the job the user asked for */
16 };
17
18 Transaction *transaction_new(void);
19 void transaction_free(Transaction *tr);
20
21 int transaction_add_job_and_dependencies(
22                 Transaction *tr,
23                 JobType type,
24                 Unit *unit,
25                 Job *by,
26                 bool matters,
27                 bool override,
28                 bool conflicts,
29                 bool ignore_requirements,
30                 bool ignore_order,
31                 DBusError *e);
32 int transaction_activate(Transaction *tr, Manager *m, JobMode mode, DBusError *e);
33 int transaction_add_isolate_jobs(Transaction *tr, Manager *m);
34 void transaction_abort(Transaction *tr);
35
36 #endif