2 * YASM module loader header file
4 * Copyright (C) 2002-2007 Peter Johnson
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS''
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
34 typedef enum yasm_module_type {
44 /*@dependent@*/ /*@null@*/ void *yasm_load_module
45 (yasm_module_type type, const char *keyword);
47 #define yasm_load_arch(keyword) \
48 yasm_load_module(YASM_MODULE_ARCH, keyword)
49 #define yasm_load_dbgfmt(keyword) \
50 yasm_load_module(YASM_MODULE_DBGFMT, keyword)
51 #define yasm_load_objfmt(keyword) \
52 yasm_load_module(YASM_MODULE_OBJFMT, keyword)
53 #define yasm_load_listfmt(keyword) \
54 yasm_load_module(YASM_MODULE_LISTFMT, keyword)
55 #define yasm_load_parser(keyword) \
56 yasm_load_module(YASM_MODULE_PARSER, keyword)
57 #define yasm_load_preproc(keyword) \
58 yasm_load_module(YASM_MODULE_PREPROC, keyword)
61 void yasm_list_modules
62 (yasm_module_type type,
63 void (*printfunc) (const char *name, const char *keyword));
65 #define yasm_list_arch(func) \
66 yasm_list_modules(YASM_MODULE_ARCH, func)
67 #define yasm_list_dbgfmt(func) \
68 yasm_list_modules(YASM_MODULE_DBGFMT, func)
69 #define yasm_list_objfmt(func) \
70 yasm_list_modules(YASM_MODULE_OBJFMT, func)
71 #define yasm_list_listfmt(func) \
72 yasm_list_modules(YASM_MODULE_LISTFMT, func)
73 #define yasm_list_parser(func) \
74 yasm_list_modules(YASM_MODULE_PARSER, func)
75 #define yasm_list_preproc(func) \
76 yasm_list_modules(YASM_MODULE_PREPROC, func)
79 void yasm_register_module(yasm_module_type type, const char *keyword,