chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
journald: adjust permissions for rotated files
[elogind.git]
/
src
/
timer.h
diff --git
a/src/timer.h
b/src/timer.h
index eb22688a3be3f61f4e2de2562f515992b9298548..f5c5c64f2509ceb63d4878395ce6bfdb5ce823ae 100644
(file)
--- a/
src/timer.h
+++ b/
src/timer.h
@@
-1,4
+1,4
@@
-/*-*- Mode: C; c-basic-offset: 8 -*-*/
+/*-*- Mode: C; c-basic-offset: 8
; indent-tabs-mode: nil
-*-*/
#ifndef footimerhfoo
#define footimerhfoo
#ifndef footimerhfoo
#define footimerhfoo
@@
-31,7
+31,7
@@
typedef enum TimerState {
TIMER_WAITING,
TIMER_RUNNING,
TIMER_ELAPSED,
TIMER_WAITING,
TIMER_RUNNING,
TIMER_ELAPSED,
- TIMER_
MAINTAINANCE
,
+ TIMER_
FAILED
,
_TIMER_STATE_MAX,
_TIMER_STATE_INVALID = -1
} TimerState;
_TIMER_STATE_MAX,
_TIMER_STATE_INVALID = -1
} TimerState;
@@
-47,28
+47,34
@@
typedef enum TimerBase {
} TimerBase;
typedef struct TimerValue {
} TimerBase;
typedef struct TimerValue {
- TimerBase base;
usec_t value;
usec_t value;
-
usec_t next_elapse;
usec_t next_elapse;
- bool disabled;
-
LIST_FIELDS(struct TimerValue, value);
LIST_FIELDS(struct TimerValue, value);
+
+ TimerBase base;
+ bool disabled;
} TimerValue;
} TimerValue;
+typedef enum TimerResult {
+ TIMER_SUCCESS,
+ TIMER_FAILURE_RESOURCES,
+ _TIMER_RESULT_MAX,
+ _TIMER_RESULT_INVALID = -1
+} TimerResult;
+
struct Timer {
struct Timer {
-
Meta
meta;
+
Unit
meta;
LIST_HEAD(TimerValue, values);
usec_t next_elapse;
TimerState state, deserialized_state;
LIST_HEAD(TimerValue, values);
usec_t next_elapse;
TimerState state, deserialized_state;
- Unit
*
unit;
+ Unit
Ref
unit;
Watch timer_watch;
Watch timer_watch;
-
bool failure
;
+
TimerResult result
;
};
void timer_unit_notify(Unit *u, UnitActiveState new_state);
};
void timer_unit_notify(Unit *u, UnitActiveState new_state);
@@
-81,4
+87,7
@@
TimerState timer_state_from_string(const char *s);
const char *timer_base_to_string(TimerBase i);
TimerBase timer_base_from_string(const char *s);
const char *timer_base_to_string(TimerBase i);
TimerBase timer_base_from_string(const char *s);
+const char* timer_result_to_string(TimerResult i);
+TimerResult timer_result_from_string(const char *s);
+
#endif
#endif