1 /* udis86 - libudis86/extern.h
2  *
3  * Copyright (c) 2002-2013 Vivek Thampi
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without modification, 
7  * are permitted provided that the following conditions are met:
8  *
9  *     * Redistributions of source code must retain the above copyright notice, 
10  *       this list of conditions and the following disclaimer.
11  *     * Redistributions in binary form must reproduce the above copyright notice, 
12  *       this list of conditions and the following disclaimer in the documentation 
13  *       and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
18  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 
19  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
20  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
21  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
22  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
24  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26 
27 module udis86.c.extern_;
28 
29 import udis86.c.types;
30 import udis86.c.itab;
31 
32 import core.stdc.stdio;
33 
34 extern (C):
35 
36 void ud_init(ud*);
37 void ud_set_mode(ud*, ubyte);
38 void ud_set_pc(ud*, ulong);
39 void ud_set_input_hook(ud*, int function(ud*));
40 void ud_set_input_buffer(ud*, const(ubyte)*, size_t);
41 void ud_set_input_file(ud*, FILE*);
42 void ud_set_vendor(ud*, uint);
43 void ud_set_syntax(ud*, void function(ud*));
44 void ud_input_skip(ud*, size_t);
45 int ud_input_end(const(ud)*);
46 uint ud_decode(ud*);
47 uint ud_disassemble(ud*);
48 void ud_translate_intel(ud*);
49 void ud_translate_att(ud*);
50 const(char)* ud_insn_asm(const(ud)* u);
51 const(ubyte)* ud_insn_ptr(const(ud)* u);
52 ulong ud_insn_off(const(ud)*);
53 const(char)* ud_insn_hex(ud*);
54 uint ud_insn_len(const(ud)* u);
55 const(ud_operand)* ud_insn_opr(const(ud)* u, uint n);
56 int ud_opr_is_sreg(const(ud_operand)* opr);
57 int ud_opr_is_gpr(const(ud_operand)* opr);
58 ud_mnemonic_code ud_insn_mnemonic(const(ud)* u);
59 const(char)* ud_lookup_mnemonic(ud_mnemonic_code c);
60 void ud_set_user_opaque_data(ud*, void*);
61 void* ud_get_user_opaque_data(const(ud)*);
62 ulong ud_insn_sext_imm(const(ud)*, const(ud_operand)*);
63 void ud_set_asm_buffer(ud* u, char* buf, size_t size);
64 void ud_set_sym_resolver(ud* u, const(char)* function(ud*, ulong, long*) resolver);