Libecoli 0.11.1
Extensible COmmand LIne library
Loading...
Searching...
No Matches
init.h
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2016, Olivier MATZ <zer0@droids-corp.org>
3 */
4
11
12#pragma once
13
14#include <sys/queue.h>
15
29#define EC_INIT_REGISTER(t) \
30 static void ec_init_init_##t(void); \
31 static void __attribute__((constructor, used)) ec_init_init_##t(void) \
32 { \
33 ec_init_register(&t); \
34 }
35
39typedef int(ec_init_t)(void);
40
44typedef void(ec_exit_t)(void);
45
46TAILQ_HEAD(ec_init_list, ec_init);
47
51struct ec_init {
52 TAILQ_ENTRY(ec_init) next;
53 ec_init_t *init;
54 ec_exit_t *exit;
55 unsigned int priority;
56};
57
64void ec_init_register(struct ec_init *test);
65
74int ec_init(void);
75
79void ec_exit(void);
80
void ec_exit_t(void)
Definition init.h:44
int ec_init_t(void)
Definition init.h:39
int ec_init(void)
void ec_exit(void)
void ec_init_register(struct ec_init *test)
Definition init.h:51