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