80bec6a4bf80c37e7629cf010d55d34565080feb
[libfirm] / ir / be / bemodule.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /*
21  * Author:      Matthias Braun
22  * Date:                11.12.2006
23  * Copyright:   (c) Universitaet Karlsruhe
24  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
25  */
26 #ifndef BEMODULE_H_
27 #define BEMODULE_H_
28
29 /**
30  * Mark a function as module constructor.
31  * Currently you have to add modules manually in the list in bemodule.c.
32  * However future extensions might allow them to be automatically discovered
33  * when they are marked with BE_REGISTER_MODULE_CONSTRUCTOR
34  */
35 #define BE_REGISTER_MODULE_CONSTRUCTOR(func)
36
37 /**
38  * Mark a function as module destructor.
39  */
40 #define BE_REGISTER_MODULE_DESTRUCTOR(func)
41
42 /**
43  * Call all module constructors
44  */
45 void be_init_modules(void);
46
47 /**
48  * Call all module destructors
49  */
50 void be_quit_modules(void);
51
52 //---------------------------------------------------------------------------
53
54 #include <libcore/lc_opts.h>
55
56 typedef struct be_module_list_entry_t be_module_list_entry_t;
57
58 void be_add_module_to_list(be_module_list_entry_t **list_head, const char *name,
59                            void *module);
60
61 void be_add_module_list_opt(lc_opt_entry_t *grp, const char *name,
62                             const char *description,
63                             be_module_list_entry_t * const * first,
64                             void **var);
65
66 #endif