Libecoli 0.10.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
9
10#pragma once
11
12#include <sys/queue.h>
13
27#define EC_INIT_REGISTER(t) \
28 static void ec_init_init_##t(void); \
29 static void __attribute__((constructor, used)) ec_init_init_##t(void) \
30 { \
31 ec_init_register(&t); \
32 }
33
37typedef int(ec_init_t)(void);
38
42typedef void(ec_exit_t)(void);
43
44TAILQ_HEAD(ec_init_list, ec_init);
45
49struct ec_init {
50 TAILQ_ENTRY(ec_init) next;
51 ec_init_t *init;
52 ec_exit_t *exit;
53 unsigned int priority;
54};
55
62void ec_init_register(struct ec_init *test);
63
72int ec_init(void);
73
77void ec_exit(void);
78
void ec_exit_t(void)
Definition init.h:42
int ec_init_t(void)
Definition init.h:37
int ec_init(void)
void ec_exit(void)
void ec_init_register(struct ec_init *test)
Definition init.h:49