1
2
3
4
5
6
7
8
9 #pragma once
10
11 #include <stdlib.h>
12 #include <stdbool.h>
13
14 #include <crm/common/ipc_internal.h>
15
16
17 struct module_s;
18
19 typedef struct mock_based_context_s {
20 size_t modules_cnt;
21 struct module_s** modules;
22 } mock_based_context_t;
23
24
25 typedef int (*mock_based_argparse_hook)(mock_based_context_t *,
26 bool, int,
27 const char *[]);
28
29 typedef void (*mock_based_destroy_hook)(struct module_s *);
30
31
32 typedef void (*mock_based_cib_notify_hook)(pcmk__client_t *);
33
34 typedef struct mock_based_hooks_s {
35
36 mock_based_argparse_hook argparse;
37 mock_based_destroy_hook destroy;
38
39
40 mock_based_cib_notify_hook cib_notify;
41 } mock_based_hooks_t;
42
43 typedef struct module_s {
44 char shortopt;
45 mock_based_hooks_t hooks;
46 void *priv;
47 } module_t;
48
49 size_t mock_based_register_module(module_t mod);