make all module code static

This commit is contained in:
Nguyen Anh Quynh 2013-12-21 10:06:59 +08:00
parent 31baeb570f
commit abc02059e3
5 changed files with 13 additions and 13 deletions

View File

@ -8,7 +8,7 @@
#include "AArch64InstPrinter.h"
#include "mapping.h"
void init_arm64(cs_struct *ud)
static void init_arm64(cs_struct *ud)
{
MCRegisterInfo *mri = malloc(sizeof(*mri));
@ -23,7 +23,7 @@ void init_arm64(cs_struct *ud)
ud->post_printer = AArch64_post_printer;
}
void __attribute__ ((constructor)) __init_arm64__()
static void __attribute__ ((constructor)) __init_arm64__()
{
init_arch[CS_ARCH_ARM64] = init_arm64;
}

View File

@ -8,7 +8,7 @@
#include "ARMInstPrinter.h"
#include "mapping.h"
void init_arm(cs_struct *ud)
static void init_arm(cs_struct *ud)
{
MCRegisterInfo *mri = malloc(sizeof(*mri));
@ -27,7 +27,7 @@ void init_arm(cs_struct *ud)
ud->disasm = ARM_getInstruction;
}
cs_err option_arm(cs_struct *handle, cs_opt_type type, size_t value)
static cs_err option_arm(cs_struct *handle, cs_opt_type type, size_t value)
{
if (type == CS_OPT_MODE) {
if (value & CS_MODE_THUMB)
@ -40,7 +40,7 @@ cs_err option_arm(cs_struct *handle, cs_opt_type type, size_t value)
return CS_ERR_OK;
}
void __attribute__ ((constructor)) __init_arm__()
static void __attribute__ ((constructor)) __init_arm__()
{
init_arch[CS_ARCH_ARM] = init_arm;
option_arch[CS_ARCH_ARM] = option_arm;

View File

@ -8,7 +8,7 @@
#include "MipsInstPrinter.h"
#include "mapping.h"
void init_mips(cs_struct *ud)
static void init_mips(cs_struct *ud)
{
MCRegisterInfo *mri = malloc(sizeof(*mri));
@ -26,7 +26,7 @@ void init_mips(cs_struct *ud)
ud->disasm = Mips64_getInstruction;
}
cs_err option_mips(cs_struct *handle, cs_opt_type type, size_t value)
static cs_err option_mips(cs_struct *handle, cs_opt_type type, size_t value)
{
if (type == CS_OPT_MODE) {
if (value & CS_MODE_32)
@ -39,7 +39,7 @@ cs_err option_mips(cs_struct *handle, cs_opt_type type, size_t value)
return CS_ERR_OK;
}
void __attribute__ ((constructor)) __init_mips__()
static void __attribute__ ((constructor)) __init_mips__()
{
init_arch[CS_ARCH_MIPS] = init_mips;
option_arch[CS_ARCH_MIPS] = option_mips;

View File

@ -8,7 +8,7 @@
#include "X86InstPrinter.h"
#include "mapping.h"
void init_x86(cs_struct *ud)
static void init_x86(cs_struct *ud)
{
// by default, we use Intel syntax
ud->printer = X86_Intel_printInst;
@ -20,7 +20,7 @@ void init_x86(cs_struct *ud)
ud->post_printer = X86_post_printer;
}
cs_err option_x86(cs_struct *handle, cs_opt_type type, size_t value)
static cs_err option_x86(cs_struct *handle, cs_opt_type type, size_t value)
{
if (type == CS_OPT_SYNTAX) {
switch(value) {
@ -41,7 +41,7 @@ cs_err option_x86(cs_struct *handle, cs_opt_type type, size_t value)
return CS_ERR_OK;
}
void __attribute__ ((constructor)) __init_x86__()
static void __attribute__ ((constructor)) __init_x86__()
{
init_arch[CS_ARCH_X86] = init_x86;
option_arch[CS_ARCH_X86] = option_x86;

View File

@ -1,8 +1,8 @@
/* Capstone Disassembler Engine */
/* By Dang Hoang Vu <danghvu@gmail.com> 2013 */
#ifndef __MODULE_H__
#define __MODULE_H__
#ifndef __CS_MODULE_H__
#define __CS_MODULE_H__
#define MAX_ARCH 32