From 75778e21dfeee51036d24501e39ea7398fabe502 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Thu, 19 Apr 2012 23:54:11 +0200 Subject: manager: split transaction.[ch] manager.c takes care of the main loop, unit management, signal handling, ... transaction.c computes transactions. After split: manager.c: 65 KB transaction.c: 40 KB --- src/core/transaction.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/core/transaction.h (limited to 'src/core/transaction.h') diff --git a/src/core/transaction.h b/src/core/transaction.h new file mode 100644 index 0000000000..d519ffb1f5 --- /dev/null +++ b/src/core/transaction.h @@ -0,0 +1,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 -- cgit v1.2.3-54-g00ecf