]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/core/transaction.h
de3db482050b3108fd930c60fea98c1887412d97
[thirdparty/systemd.git] / src / core / transaction.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 This file is part of systemd.
6
7 Copyright 2010 Lennart Poettering
8 ***/
9
10 typedef struct Transaction Transaction;
11
12 #include "hashmap.h"
13 #include "job.h"
14 #include "manager.h"
15 #include "unit.h"
16
17 struct Transaction {
18 /* Jobs to be added */
19 Hashmap *jobs; /* Unit object => Job object list 1:1 */
20 Job *anchor_job; /* the job the user asked for */
21 bool irreversible;
22 };
23
24 Transaction *transaction_new(bool irreversible);
25 void transaction_free(Transaction *tr);
26
27 void transaction_add_propagate_reload_jobs(Transaction *tr, Unit *unit, Job *by, bool ignore_order, sd_bus_error *e);
28 int transaction_add_job_and_dependencies(
29 Transaction *tr,
30 JobType type,
31 Unit *unit,
32 Job *by,
33 bool matters,
34 bool conflicts,
35 bool ignore_requirements,
36 bool ignore_order,
37 sd_bus_error *e);
38 int transaction_activate(Transaction *tr, Manager *m, JobMode mode, sd_bus_error *e);
39 int transaction_add_isolate_jobs(Transaction *tr, Manager *m);
40 void transaction_abort(Transaction *tr);