summaryrefslogtreecommitdiff
path: root/src/core/transaction.h
blob: d519ffb1f5edb9a5bdda6b096c6336048edcaed3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef footransactionhfoo
#define footransactionhfoo

typedef struct Transaction Transaction;

#include "unit.h"
#include "manager.h"
#include "job.h"
#include "hashmap.h"

struct Transaction {
        /* Jobs to be added */
        Hashmap *jobs;      /* Unit object => Job object list 1:1 */
        JobDependency *anchor;
};

Transaction *transaction_new(void);
void transaction_free(Transaction *tr);

int transaction_add_job_and_dependencies(
                Transaction *tr,
                JobType type,
                Unit *unit,
                Job *by,
                bool matters,
                bool override,
                bool conflicts,
                bool ignore_requirements,
                bool ignore_order,
                DBusError *e,
                Job **_ret);
int transaction_activate(Transaction *tr, Manager *m, JobMode mode, DBusError *e);
int transaction_add_isolate_jobs(Transaction *tr, Manager *m);
void transaction_abort(Transaction *tr);

#endif