libyasm/module.h

00001 /* $Id: module.h 2101 2008-05-23 06:46:51Z peter $
00002  * YASM module loader header file
00003  *
00004  *  Copyright (C) 2002-2007  Peter Johnson
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  * 1. Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  * 2. Redistributions in binary form must reproduce the above copyright
00012  *    notice, this list of conditions and the following disclaimer in the
00013  *    documentation and/or other materials provided with the distribution.
00014  *
00015  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS''
00016  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00017  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00018  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE
00019  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00020  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00021  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00022  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00023  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00024  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00025  * POSSIBILITY OF SUCH DAMAGE.
00026  */
00027 #ifndef YASM_MODULE_H
00028 #define YASM_MODULE_H
00029 
00030 #ifndef YASM_LIB_DECL
00031 #define YASM_LIB_DECL
00032 #endif
00033 
00034 typedef enum yasm_module_type {
00035     YASM_MODULE_ARCH = 0,
00036     YASM_MODULE_DBGFMT,
00037     YASM_MODULE_OBJFMT,
00038     YASM_MODULE_LISTFMT,
00039     YASM_MODULE_PARSER,
00040     YASM_MODULE_PREPROC
00041 } yasm_module_type;
00042 
00043 YASM_LIB_DECL
00044 /*@dependent@*/ /*@null@*/ void *yasm_load_module
00045     (yasm_module_type type, const char *keyword);
00046 
00047 #define yasm_load_arch(keyword) \
00048     yasm_load_module(YASM_MODULE_ARCH, keyword)
00049 #define yasm_load_dbgfmt(keyword)       \
00050     yasm_load_module(YASM_MODULE_DBGFMT, keyword)
00051 #define yasm_load_objfmt(keyword)       \
00052     yasm_load_module(YASM_MODULE_OBJFMT, keyword)
00053 #define yasm_load_listfmt(keyword)      \
00054     yasm_load_module(YASM_MODULE_LISTFMT, keyword)
00055 #define yasm_load_parser(keyword)       \
00056     yasm_load_module(YASM_MODULE_PARSER, keyword)
00057 #define yasm_load_preproc(keyword)      \
00058     yasm_load_module(YASM_MODULE_PREPROC, keyword)
00059 
00060 YASM_LIB_DECL
00061 void yasm_list_modules
00062     (yasm_module_type type,
00063      void (*printfunc) (const char *name, const char *keyword));
00064 
00065 #define yasm_list_arch(func)            \
00066     yasm_list_modules(YASM_MODULE_ARCH, func)
00067 #define yasm_list_dbgfmt(func)          \
00068     yasm_list_modules(YASM_MODULE_DBGFMT, func)
00069 #define yasm_list_objfmt(func)          \
00070     yasm_list_modules(YASM_MODULE_OBJFMT, func)
00071 #define yasm_list_listfmt(func)         \
00072     yasm_list_modules(YASM_MODULE_LISTFMT, func)
00073 #define yasm_list_parser(func)          \
00074     yasm_list_modules(YASM_MODULE_PARSER, func)
00075 #define yasm_list_preproc(func)         \
00076     yasm_list_modules(YASM_MODULE_PREPROC, func)
00077 
00078 YASM_LIB_DECL
00079 void yasm_register_module(yasm_module_type type, const char *keyword,
00080                           void *data);
00081 
00082 #endif

Generated on Fri Jul 25 01:23:32 2008 for libyasm by  doxygen 1.5.2