chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build-sys: move .pc files next to the matching sources
[elogind.git]
/
src
/
unit.h
diff --git
a/src/unit.h
b/src/unit.h
index 7da572350ef5dbaa5c11265acee138f9a533221e..4d83309591776f772d6d51064480cf618965be7d 100644
(file)
--- a/
src/unit.h
+++ b/
src/unit.h
@@
-32,6
+32,7
@@
typedef enum UnitType UnitType;
typedef enum UnitLoadState UnitLoadState;
typedef enum UnitActiveState UnitActiveState;
typedef enum UnitDependency UnitDependency;
typedef enum UnitLoadState UnitLoadState;
typedef enum UnitActiveState UnitActiveState;
typedef enum UnitDependency UnitDependency;
+typedef struct UnitRef UnitRef;
#include "set.h"
#include "util.h"
#include "set.h"
#include "util.h"
@@
-119,6
+120,10
@@
enum UnitDependency {
/* On Failure */
UNIT_ON_FAILURE,
/* On Failure */
UNIT_ON_FAILURE,
+ /* Triggers (i.e. a socket triggers a service) */
+ UNIT_TRIGGERS,
+ UNIT_TRIGGERED_BY,
+
/* Reference information for GC logic */
UNIT_REFERENCES, /* Inverse of 'references' is 'referenced_by' */
UNIT_REFERENCED_BY,
/* Reference information for GC logic */
UNIT_REFERENCES, /* Inverse of 'references' is 'referenced_by' */
UNIT_REFERENCED_BY,
@@
-156,6
+161,9
@@
struct Meta {
usec_t job_timeout;
usec_t job_timeout;
+ /* References to this */
+ LIST_HEAD(UnitRef, refs);
+
/* Conditions to check */
LIST_HEAD(Condition, conditions);
/* Conditions to check */
LIST_HEAD(Condition, conditions);
@@
-237,6
+245,15
@@
struct Meta {
bool in_audit:1;
};
bool in_audit:1;
};
+struct UnitRef {
+ /* Keeps tracks of references to a unit. This is useful so
+ * that we can merge two units if necessary and correct all
+ * references to them */
+
+ Unit* unit;
+ LIST_FIELDS(UnitRef, refs);
+};
+
#include "service.h"
#include "timer.h"
#include "socket.h"
#include "service.h"
#include "timer.h"
#include "socket.h"
@@
-512,7
+529,7
@@
int unit_add_node_link(Unit *u, const char *what, bool wants);
int unit_coldplug(Unit *u);
int unit_coldplug(Unit *u);
-void unit_status_printf(Unit *u, const char *format, ...);
+void unit_status_printf(Unit *u, const char *
status, const char *
format, ...);
bool unit_need_daemon_reload(Unit *u);
bool unit_need_daemon_reload(Unit *u);
@@
-536,6
+553,11
@@
bool unit_condition_test(Unit *u);
UnitFileState unit_get_unit_file_state(Unit *u);
UnitFileState unit_get_unit_file_state(Unit *u);
+Unit* unit_ref_set(UnitRef *ref, Unit *u);
+void unit_ref_unset(UnitRef *ref);
+
+#define UNIT_DEREF(ref) ((ref).unit)
+
const char *unit_load_state_to_string(UnitLoadState i);
UnitLoadState unit_load_state_from_string(const char *s);
const char *unit_load_state_to_string(UnitLoadState i);
UnitLoadState unit_load_state_from_string(const char *s);