]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/core/transaction.h
core: add new API for enqueing a job with returning the transaction data
[thirdparty/systemd.git] / src / core / transaction.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
05d3a176 2#pragma once
75778e21
MS
3
4typedef struct Transaction Transaction;
5
75778e21 6#include "hashmap.h"
71d35b6b
TA
7#include "job.h"
8#include "manager.h"
9#include "unit.h"
75778e21
MS
10
11struct Transaction {
12 /* Jobs to be added */
13 Hashmap *jobs; /* Unit object => Job object list 1:1 */
b94fbd30 14 Job *anchor_job; /* the job the user asked for */
23ade460 15 bool irreversible;
75778e21
MS
16};
17
23ade460 18Transaction *transaction_new(bool irreversible);
75778e21
MS
19void transaction_free(Transaction *tr);
20
15d167f8 21void transaction_add_propagate_reload_jobs(Transaction *tr, Unit *unit, Job *by, bool ignore_order, sd_bus_error *e);
75778e21
MS
22int transaction_add_job_and_dependencies(
23 Transaction *tr,
24 JobType type,
25 Unit *unit,
26 Job *by,
27 bool matters,
75778e21
MS
28 bool conflicts,
29 bool ignore_requirements,
30 bool ignore_order,
718db961 31 sd_bus_error *e);
50cbaba4 32int transaction_activate(Transaction *tr, Manager *m, JobMode mode, Set *affected, sd_bus_error *e);
75778e21
MS
33int transaction_add_isolate_jobs(Transaction *tr, Manager *m);
34void transaction_abort(Transaction *tr);