summaryrefslogtreecommitdiff
path: root/src/core/transaction.h
blob: 74d74616a35d990edbdfd8f7ea886852173a57f0 (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
#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 */
        Job *anchor_job;      /* the job the user asked for */
};

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);
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