diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2021-06-28 21:35:19 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska@appnovation.com> | 2021-06-28 21:35:19 +0000 |
| commit | 4b057ce275a2761656b62a3fa1e57ebf934c3af8 (patch) | |
| tree | d11a170b2e871b061e5998eba9b507c198ca2460 /src/server/state.h | |
| parent | ae1a76cad535a04f0c059e8dae9c8a27a84222a4 (diff) | |
| download | s6-rc-4b057ce275a2761656b62a3fa1e57ebf934c3af8.tar.gz | |
Add dynstorage, finish state IO
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/server/state.h')
| -rw-r--r-- | src/server/state.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/server/state.h b/src/server/state.h index f0149bc..f49ffb4 100644 --- a/src/server/state.h +++ b/src/server/state.h @@ -17,11 +17,12 @@ struct stateatom_s uint8_t current : 1 ; uint8_t transitioning : 1 ; } ; +#define STATEATOM_ZERO { .wanted = 0, .current = 0, .transitioning = 0 } typedef struct instance_s instance_t, *instance_t_ref ; struct instance_s { - char const *param ; + char const *param ; /* refcounted pointer to dynstorage */ stateatom_t state ; } ; @@ -32,14 +33,15 @@ struct state_s genalloc *dyn[S6RC_STYPE_PHAIL] ; /* every genalloc is a list of instance_t */ } ; +extern void instance_free (instance_t *) ; +extern int instance_new (instance_t *, stateatom_t const *, char const *) ; + extern void state_free (state_t *, uint32_t const *) ; -extern int state_ready (state_t *, uint32_t const *) ; +extern int state_init (state_t *, uint32_t const *) ; extern int state_write (char const *, state_t const *, uint32_t const *) ; -extern int state_read (char const *, state_t *, uint32_t const *) ; - +extern int state_read (char const *, state_t *, uint32_t const *) ; /* also inits */ extern stateatom_t *state_atom (s6rc_db_t const *, state_t const *, s6rc_sid_t const *) ; - #endif |
