blob: 0f03967a16abdcba2ce7b152320b890f6a4da51e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
/* ISC license. */
#ifndef S6RC_DB_H
#define S6RC_DB_H
#include <stdint.h>
#include <skalibs/diuint32.h>
#include <skalibs/buffer.h>
#define S6RC_DB_BANNER_START "s6rc-db: start\n"
#define S6RC_DB_BANNER_START_LEN (sizeof(S6RC_DB_BANNER_START) - 1)
#define S6RC_DB_BANNER_END "\ns6rc-db: end\n"
#define S6RC_DB_BANNER_END_LEN (sizeof(S6RC_DB_BANNER_END) - 1)
#define S6RC_DB_FLAG_ESSENTIAL 0x00000001U
typedef struct s6rc_oneshot_s s6rc_oneshot_t, *s6rc_oneshot_t_ref ;
struct s6rc_oneshot_s
{
uint32_t argc[2] ;
uint32_t argv[2] ;
} ;
typedef struct s6rc_longrun_s s6rc_longrun_t, *s6rc_longrun_t_ref ;
struct s6rc_longrun_s
{
uint32_t consumer ;
uint32_t nproducers ;
uint32_t producers ;
} ;
typedef union s6rc_longshot_u s6rc_longshot_t, *s6rc_longshot_t_ref ;
union s6rc_longshot_u
{
s6rc_oneshot_t oneshot ;
s6rc_longrun_t longrun ;
} ;
typedef struct s6rc_service_s s6rc_service_t, *s6rc_service_t_ref ;
struct s6rc_service_s
{
uint32_t name ;
uint32_t flags ;
uint32_t deps[2] ;
uint32_t ndeps[2] ;
uint32_t timeout[2] ;
s6rc_longshot_t x ;
} ;
typedef struct s6rc_db_s s6rc_db_t, *s6rc_db_t_ref ;
struct s6rc_db_s
{
s6rc_service_t *services ;
unsigned int nshort ;
unsigned int nlong ;
unsigned int stringlen ;
unsigned int nargvs ;
unsigned int ndeps ;
unsigned int nproducers ;
char *string ;
char const **argvs ;
uint32_t *deps ;
uint32_t *producers ;
} ;
extern int s6rc_db_read_uint32 (buffer *, uint32_t *) ;
extern int s6rc_db_read_sizes (int, s6rc_db_t *) ;
extern int s6rc_db_read (int, s6rc_db_t *) ;
extern int s6rc_db_check_pipelines (s6rc_db_t const *, diuint32 *) ;
extern int s6rc_db_check_depcycles (s6rc_db_t const *, int, diuint32 *) ;
extern int s6rc_db_check_revdeps (s6rc_db_t const *) ;
#endif
|