]> git.ipfire.org Git - people/ms/systemd.git/blame - job.h
add functions for dumping server state
[people/ms/systemd.git] / job.h
CommitLineData
60918275
LP
1/*-*- Mode: C; c-basic-offset: 8 -*-*/
2
3#ifndef foojobhfoo
4#define foojobhfoo
5
6#include <stdbool.h>
7#include <inttypes.h>
8
9typedef struct Job Job;
10typedef enum JobType JobType;
11typedef enum JobMode JobMode;
12
13#include "manager.h"
14#include "name.h"
15#include "hashmap.h"
16#include "list.h"
17
18enum JobType {
19 JOB_START,
20 JOB_STOP,
21 JOB_VERIFY_STARTED,
22 JOB_RELOAD,
23 JOB_RESTART,
24 JOB_TRY_RESTART, /* restart if running */
25 JOB_RESTART_FINISH, /* 2nd part of a restart, i.e. the actual starting */
26 _JOB_TYPE_MAX
27};
28
29typedef enum JobState {
30 JOB_WAITING,
31 JOB_RUNNING,
32 JOB_DONE,
33 _JOB_STATE_MAX
34} JobState;
35
36enum JobMode {
37 JOB_FAIL,
38 JOB_REPLACE,
39 _JOB_MODE_MAX
40};
41
42struct Job {
43 Manager *manager;
44 uint32_t id;
45
46 JobType type;
47 JobState state;
48 Name *name;
49
50 bool linked:1;
51};
52
53Job* job_new(Manager *m, JobType type, Name *name);
54int job_link(Job *job);
55void job_free(Job *job);
a66d02c3 56void job_dump(Job *j, FILE*f);
60918275
LP
57
58#endif