Hide yasm_arch implementation behind YASM_LIB_INTERNAL.
svn path=/trunk/yasm/; revision=1066
/*@null@*/ /*@only@*/ static char *machine_name = NULL;
static int special_options = 0;
/*@null@*/ /*@dependent@*/ static yasm_arch *cur_arch = NULL;
-/*@null@*/ /*@dependent@*/ static yasm_arch_module *cur_arch_module = NULL;
-/*@null@*/ /*@dependent@*/ static yasm_parser_module *cur_parser_module = NULL;
+/*@null@*/ /*@dependent@*/ static const yasm_arch_module *
+ cur_arch_module = NULL;
+/*@null@*/ /*@dependent@*/ static const yasm_parser_module *
+ cur_parser_module = NULL;
/*@null@*/ /*@dependent@*/ static yasm_preproc *cur_preproc = NULL;
/*@null@*/ /*@dependent@*/ static yasm_objfmt *cur_objfmt = NULL;
/*@null@*/ /*@dependent@*/ static yasm_optimizer *cur_optimizer = NULL;
#include "arch.h"
-yasm_arch_module *
+const yasm_arch_module *
yasm_arch_get_module(yasm_arch *arch)
{
return arch->module;
/*@reldef@*/ STAILQ_HEAD(yasm_insn_operandhead, yasm_insn_operand);
#endif
+#ifdef YASM_LIB_INTERNAL
/** Base #yasm_arch structure. Must be present as the first element in any
* #yasm_arch implementation.
*/
struct yasm_arch {
/** #yasm_arch_module implementation for this architecture. */
- struct yasm_arch_module *module;
+ const struct yasm_arch_module *module;
};
+#endif
/** "Flavor" of the parser.
* Different assemblers order instruction operands differently. Also, some
* \param arch architecture
* \return Module implementation.
*/
-yasm_arch_module *yasm_arch_get_module(yasm_arch *arch);
+const yasm_arch_module *yasm_arch_get_module(yasm_arch *arch);
/** Create an instruction operand from a register.
* \param reg register
#include "x86arch.h"
-yasm_arch_module yasm_x86_LTX_arch;
+const yasm_arch_module yasm_x86_LTX_arch;
static /*@only@*/ yasm_arch *
};
/* Define arch structure -- see arch.h for details */
-yasm_arch_module yasm_x86_LTX_arch = {
+const yasm_arch_module yasm_x86_LTX_arch = {
YASM_ARCH_VERSION,
"x86 (IA-32 and derivatives), AMD64",
"x86",
};
/* Define parser structure -- see parser.h for details */
-yasm_parser_module yasm_nasm_LTX_parser = {
+const yasm_parser_module yasm_nasm_LTX_parser = {
YASM_PARSER_VERSION,
"NASM-compatible parser",
"nasm",