Loading...
Searching...
No Matches
init.h
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2016, Olivier MATZ <zer0@droids-corp.org>
*/
#pragma once
#include <sys/queue.h>
#define EC_INIT_REGISTER(t) \
static void ec_init_init_##t(void); \
static void __attribute__((constructor, used)) ec_init_init_##t(void) \
{ \
ec_init_register(&t); \
}
typedef int(ec_init_t)(void);
typedef void(ec_exit_t)(void);
TAILQ_HEAD(ec_init_list, ec_init);
struct ec_init {
TAILQ_ENTRY(ec_init) next;
ec_init_t *init;
ec_exit_t *exit;
unsigned int priority;
};
void ec_init_register(struct ec_init *test);
int ec_init(void);
void ec_exit(void);
ec_exit_t
void ec_exit_t(void)
Type of exit function.
Definition init.h:44
ec_init_t
int ec_init_t(void)
Type of init function.
Definition init.h:39
ec_init
int ec_init(void)
Initialize ecoli library.
ec_exit
void ec_exit(void)
Uninitialize ecoli library.
ec_init_register
void ec_init_register(struct ec_init *test)
Register an initialization function.
ec_init
A structure describing initialization callbacks.
Definition init.h:51