2 * Author: Matthias Braun
4 * Copyright: (c) Universitaet Karlsruhe
5 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
13 #include "bemodules.h"
16 typedef struct _constructor_list_entry_t {
17 struct _constructor_list_entry_t *next;
18 be_module_constructor_func func;
19 } constructor_list_entry_t;
21 static constructor_list_entry_t *constructors = NULL;
23 static void free_constructor_list(void)
25 constructor_list_entry_t *entry = constructors;
27 while(entry != NULL) {
28 constructor_list_entry_t *next = entry->next;
34 void be_module_add_constructor(be_module_constructor_func func)
36 static int initialized = 0;
37 constructor_list_entry_t *entry;
40 atexit(free_constructor_list);
44 entry = xmalloc(sizeof(entry[0]));
45 entry->next = constructors;
51 void be_module_call_constructors()
53 constructor_list_entry_t *entry;
55 for(entry = constructors; entry != NULL; entry = entry->next) {