Internal types and functions. More...
Data Structures | |
struct | opdis_insn_buffer_t |
A buffer that stores the output of libopcodes before processing. More... | |
Defines | |
#define | OPDIS_MAX_ITEMS 64 |
#define | OPDIS_MAX_ITEM_SIZE 64 |
#define | OPDIS_MAX_INSN_STR 128 |
Functions | |
opdis_insn_buf_t LIBCALL | opdis_insn_buf_alloc (unsigned int max_items, unsigned int max_item_size, unsigned int max_insn_str) |
Allocate an instruction buffer. | |
void LIBCALL | opdis_insn_buf_free (opdis_insn_buf_t buf) |
Free an instruction buffer. | |
int LIBCALL | opdis_insn_buf_append (opdis_insn_buf_t buf, const char *item) |
Append a string to an opdis_insn_buffer_t. | |
void LIBCALL | opdis_insn_buf_clear (opdis_insn_buf_t buf) |
Clear the data in an opdis_insn_buffer_t. | |
void | opdis_debug (opdis_t o, int min_level, const char *format,...) |
Print debug message to STDERR. |
Internal types and functions.
#define OPDIS_MAX_INSN_STR 128 |
Max length of the instruction string.
#define OPDIS_MAX_ITEM_SIZE 64 |
Max size of a single item.
#define OPDIS_MAX_ITEMS 64 |
Max number of items (mnemonic, prefix, operand, etc) that buffer can store.
opdis_insn_buf_t opdis_insn_buf_alloc | ( | unsigned int | max_items, | |
unsigned int | max_item_size, | |||
unsigned int | max_insn_str | |||
) |
Allocate an instruction buffer.
Allocates an opdis_insn_buffer_t based on the specified parameters. The buffer contents are initialized to zero.
max_items | Default is OPDIS_MAX_ITEMS. | |
max_item_size | Default is OPDIS_MAX_ITEM_SIZE. | |
max_insn_str | Default is OPDIS_MAX_INSN_STR. |
int opdis_insn_buf_append | ( | opdis_insn_buf_t | buf, | |
const char * | item | |||
) |
Append a string to an opdis_insn_buffer_t.
This will add the item to the array of items in the buffer, and increase the buffer item count. The item will also be appended to the raw instruction string.
buf | The instruction buffer to append to. | |
item | The item to append. |
void opdis_insn_buf_clear | ( | opdis_insn_buf_t | buf | ) |
Clear the data in an opdis_insn_buffer_t.
buf | The instruction buffer to clear. |
void opdis_insn_buf_free | ( | opdis_insn_buf_t | buf | ) |
Free an instruction buffer.
buf | The instruction buffer to free. |