Commit 75778e21 authored by Michal Schmidt's avatar Michal Schmidt
Browse files

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
parent 7527cb52
...@@ -681,6 +681,8 @@ libsystemd_core_la_SOURCES = \ ...@@ -681,6 +681,8 @@ libsystemd_core_la_SOURCES = \
src/core/job.h \ src/core/job.h \
src/core/manager.c \ src/core/manager.c \
src/core/manager.h \ src/core/manager.h \
src/core/transaction.c \
src/core/transaction.h \
src/core/load-fragment.c \ src/core/load-fragment.c \
src/core/load-fragment.h \ src/core/load-fragment.h \
src/core/service.c \ src/core/service.c \
......
...@@ -34,6 +34,7 @@ typedef enum JobMode JobMode; ...@@ -34,6 +34,7 @@ typedef enum JobMode JobMode;
typedef enum JobResult JobResult; typedef enum JobResult JobResult;
#include "manager.h" #include "manager.h"
#include "transaction.h"
#include "unit.h" #include "unit.h"
#include "hashmap.h" #include "hashmap.h"
#include "list.h" #include "list.h"
......
This diff is collapsed.
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#define MANAGER_MAX_NAMES 131072 /* 128K */ #define MANAGER_MAX_NAMES 131072 /* 128K */
typedef struct Manager Manager; typedef struct Manager Manager;
typedef struct Transaction Transaction;
typedef enum WatchType WatchType; typedef enum WatchType WatchType;
typedef struct Watch Watch; typedef struct Watch Watch;
...@@ -92,12 +91,6 @@ struct Watch { ...@@ -92,12 +91,6 @@ struct Watch {
#include "dbus.h" #include "dbus.h"
#include "path-lookup.h" #include "path-lookup.h"
struct Transaction {
/* Jobs to be added */
Hashmap *jobs; /* Unit object => Job object list 1:1 */
JobDependency *anchor;
};
struct Manager { struct Manager {
/* Note that the set of units we know of is allowed to be /* Note that the set of units we know of is allowed to be
* inconsistent. However the subset of it that is loaded may * inconsistent. However the subset of it that is loaded may
......
This diff is collapsed.
#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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment