]> git.ipfire.org Git - thirdparty/systemd.git/blame - manager.h
move test files to test1/
[thirdparty/systemd.git] / manager.h
CommitLineData
60918275
LP
1/*-*- Mode: C; c-basic-offset: 8 -*-*/
2
3#ifndef foomanagerhfoo
4#define foomanagerhfoo
5
6#include <stdbool.h>
7#include <inttypes.h>
a66d02c3 8#include <stdio.h>
60918275
LP
9
10typedef struct Manager Manager;
11
12#include "name.h"
13#include "job.h"
14#include "hashmap.h"
15#include "list.h"
16#include "set.h"
17
18struct Manager {
19 uint32_t current_job_id;
20
87d1515d
LP
21 /* Note that the set of names we know of is allowed to be
22 * incosistent. However the subset of it that is loaded may
23 * not, and the list of jobs may neither. */
24
60918275
LP
25 /* Active jobs and names */
26 Hashmap *names; /* name string => Name object n:1 */
27 Hashmap *jobs; /* job id => Job object 1:1 */
28
29 /* Names that need to be loaded */
30 LIST_HEAD(Meta, load_queue); /* this is actually more a stack than a queue, but uh. */
31
e5b5ae50
LP
32 /* Jobs to be added */
33 Hashmap *transaction_jobs; /* Name object => Job object list 1:1 */
34 JobDependency *transaction_anchor;
223dabab
LP
35
36 bool dispatching_load_queue:1;
60918275
LP
37};
38
39Manager* manager_new(void);
40void manager_free(Manager *m);
41
42Job *manager_get_job(Manager *m, uint32_t id);
43Name *manager_get_name(Manager *m, const char *name);
44
45int manager_load_name(Manager *m, const char *name, Name **_ret);
e5b5ae50 46int manager_add_job(Manager *m, JobType type, Name *name, JobMode mode, bool force, Job **_ret);
60918275 47
cea8e32e
LP
48void manager_dump_names(Manager *s, FILE *f, const char *prefix);
49void manager_dump_jobs(Manager *s, FILE *f, const char *prefix);
a66d02c3 50
e5b5ae50
LP
51void manager_transaction_delete_job(Manager *m, Job *j);
52
60918275 53#endif