fcml  1.2.2
fcml_choosers.h
Go to the documentation of this file.
1 /*
2  * FCML - Free Code Manipulation Library.
3  * Copyright (C) 2010-2020 Slawomir Wojtasiak
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
28 #ifndef FCML_CHOOSER_H_
29 #define FCML_CHOOSER_H_
30 
31 #include "fcml_lib_export.h"
32 
33 #include "fcml_types.h"
34 #include "fcml_common.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
44 typedef fcml_ptr (*fcml_fnp_chooser_next)(fcml_ptr instruction);
45 
52 typedef void (*fcml_fnp_chooser_extract)(fcml_ptr instruction,
53  fcml_st_instruction_code *instruction_code);
54 
56 typedef struct fcml_st_chooser_context {
58  fcml_ptr instruction;
64 
68 typedef fcml_ptr (LIB_CALL *fcml_fnp_asm_instruction_chooser)(
69  fcml_st_chooser_context *chooser_context);
70 
74 fcml_ptr LIB_EXPORT LIB_CALL fcml_fn_asm_default_instruction_chooser(
75  fcml_st_chooser_context *chooser_context);
76 
80 fcml_ptr LIB_EXPORT LIB_CALL fcml_fn_asm_no_instruction_chooser(
81  fcml_st_chooser_context *chooser_context);
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif /* FCML_CHOOSER_H_ */
void(* fcml_fnp_chooser_extract)(fcml_ptr instruction, fcml_st_instruction_code *instruction_code)
Gets instruction code from current abstract instruction pointer.
Definition: fcml_choosers.h:52
fcml_ptr LIB_EXPORT LIB_CALL fcml_fn_asm_default_instruction_chooser(fcml_st_chooser_context *chooser_context)
Default instruction chooser which chooses the shortest instruction available.
fcml_ptr(LIB_CALL * fcml_fnp_asm_instruction_chooser)(fcml_st_chooser_context *chooser_context)
Instruction chooser function pointer declaration.
Definition: fcml_choosers.h:68
Definitions of common structures used by FCML components.
Handles Win32 DLL symbols importing/exporting.
fcml_ptr instruction
First instruction in the chain.
Definition: fcml_choosers.h:58
fcml_fnp_chooser_extract extract
Extracts instruction code from abstract instruction pointer.
Definition: fcml_choosers.h:62
fcml_fnp_chooser_next next
Gets next instruction code from iterator.
Definition: fcml_choosers.h:60
struct fcml_st_chooser_context fcml_st_chooser_context
Instruction chooser context used to communicate with environment.
fcml_ptr(* fcml_fnp_chooser_next)(fcml_ptr instruction)
Returns next instructions from the iterator.
Definition: fcml_choosers.h:44
Instruction chooser context used to communicate with environment.
Definition: fcml_choosers.h:56
An encoded instruction.
Definition: fcml_common.h:810
fcml_ptr LIB_EXPORT LIB_CALL fcml_fn_asm_no_instruction_chooser(fcml_st_chooser_context *chooser_context)
NULL chooser which do not chose anything.
Types declarations.