Main Page   Modules   Data Structures   File List   Data Fields   Examples  

_memgrep_functions Struct Reference
[The memory manglement library interface.]

Medium-independant function table. More...

#include <memgrep.h>


Data Fields

unsigned long(* open )(struct _mem_ctx *ctx)
unsigned long(* close )(struct _mem_ctx *ctx)
unsigned long(* getSections )(struct _mem_ctx *ctx)
unsigned char *(* get )(struct _mem_ctx *ctx, unsigned long addr, unsigned long length)
unsigned long(* put )(struct _mem_ctx *ctx, unsigned long addr, unsigned char *buf, unsigned long bufLength)
unsigned long(* populateKeyword )(struct _mem_ctx *ctx, const char *keyword)
unsigned long(* listSegments )(struct _mem_ctx *ctx)
unsigned long(* heapEnumerate )(struct _mem_ctx *ctx, unsigned long current, unsigned long *addr, unsigned long *size)


Detailed Description

Medium-independant function table.

The medium-independant function table used internally by memgrep.


Field Documentation

unsigned long(* _memgrep_functions::close)(struct _mem_ctx *ctx)
 

Closes the medium, releasing any resources used.

Parameters:
ctx  [in] The memgrep context.
Returns:
On success, 1 is returned, otherwise 0 is returned.

unsigned char*(* _memgrep_functions::get)(struct _mem_ctx *ctx, unsigned long addr, unsigned long length)
 

Gets a memory address for a specified number of bytes.

Parameters:
ctx  [in] The memgrep context.
addr  [in] The address to start from.
length  [in] The number of bytes to get.
Returns:
On success, a buffer containing the data at the specified address is returned. Otherwise, NULL is returned.

unsigned long(* _memgrep_functions::getSections)(struct _mem_ctx *ctx)
 

Get the sections (rodata, bss, data, stack) associated with a given medium.

Parameters:
ctx  [in] The memgrep context.
Returns:
On success, 1 is returned, otherwise 0 is returned.

unsigned long(* _memgrep_functions::heapEnumerate)(struct _mem_ctx *ctx, unsigned long current, unsigned long *addr, unsigned long *size)
 

Enumerate the heap of the given medium.

Parameters:
ctx  [in] The memgrep context.
current  [in] The current node in the list, or 0 if the first node.
addr  [out] The adderss of the allocation unit at this point.
size  [out] The size of the allocation unit at this point.
Returns:
On success, 1 is returned, otherwise 0 is returned.

unsigned long(* _memgrep_functions::listSegments)(struct _mem_ctx *ctx)
 

List the segments of a given medium.

Parameters:
ctx  [in] The memgrep context.
Returns:
On success, 1 is returned, otherwise 0 is returned.

unsigned long(* _memgrep_functions::open)(struct _mem_ctx *ctx)
 

Open the medium and prepare it for operation.

Parameters:
ctx  [in] The memgrep context.
Returns:
On success, 1 is returned, otherwise 0 is returned.

unsigned long(* _memgrep_functions::populateKeyword)(struct _mem_ctx *ctx, const char *keyword)
 

Populate the addresses array from a given keyword.

Parameters:
ctx  [in] The memgrep context.
keyword  [in] The keyword to replace (such as 'bss').
Returns:
If the keyword is valid, 1 is returned, otherwise 0 is returned.

unsigned long(* _memgrep_functions::put)(struct _mem_ctx *ctx, unsigned long addr, unsigned char *buf, unsigned long bufLength)
 

Puts arbitrary data into memory at the specified address for a given length.

Parameters:
ctx  [in] The memgrep context.
addr  [in] The address to start from.
buf  [in] The buffer to write from.
bufLength  [in] The number of bytes to write.
Returns:
On success, 1 is returned, otherwise 0 is returned.


The documentation for this struct was generated from the following file:
Generated on Mon Dec 29 02:04:13 2003 for memgrep by doxygen1.2.15