Internal

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.

Detailed Description

Internal types and functions.


Define Documentation

#define OPDIS_MAX_INSN_STR   128

Max length of the instruction string.

See also:
opdis_insn_buffer_t
#define OPDIS_MAX_ITEM_SIZE   64

Max size of a single item.

See also:
opdis_insn_buffer_t
#define OPDIS_MAX_ITEMS   64

Max number of items (mnemonic, prefix, operand, etc) that buffer can store.

See also:
opdis_insn_buffer_t

Function Documentation

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.

Parameters:
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.
Returns:
The allocated opdis_insn_buffer_t.
See also:
opdis_insn_buf_free
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.

Parameters:
buf The instruction buffer to append to.
item The item to append.
Returns:
1 on success, 0 on failure.
See also:
opdis_insn_buf_alloc
void opdis_insn_buf_clear ( opdis_insn_buf_t  buf  ) 

Clear the data in an opdis_insn_buffer_t.

Parameters:
buf The instruction buffer to clear.
void opdis_insn_buf_free ( opdis_insn_buf_t  buf  ) 

Free an instruction buffer.

Parameters:
buf The instruction buffer to free.
See also:
opdis_insn_buf_alloc

Generated on Wed Mar 10 14:30:46 2010 for Opdis Disassembly Library by  doxygen 1.6.1