Logo Search packages:      
Sourcecode: eresi version File versions  Download package

libaspect.h File Reference


Detailed Description

The header file for modular objects in the framework.

Started Dec 22 2006 02:57:03 jfv

Id
libaspect.h,v 1.40 2008-02-16 12:32:27 thor Exp

Definition in file libaspect.h.

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <strings.h>
#include <dlfcn.h>
#include "aproxy.h"
#include "libaspect-hash.h"
#include "libaspect-list.h"
#include "libaspect-btree.h"
#include "libaspect-profiler.h"

Go to the source code of this file.

Classes

struct  s_aspectworld
struct  s_config_item
struct  s_container
 Structure to define a generic container. More...
struct  s_info
struct  s_type
 Structure for type. More...
struct  s_vector
 The structure of multidimensional vectors. More...

Defines

#define __ASPECT_H__   1
#define __DEBUG_LIST__   1
#define __USE_GNU
#define ASPECT_TYPE_BASENUM   16
#define ASPECT_TYPE_BIT   9
#define ASPECT_TYPE_BLOC   14
#define ASPECT_TYPE_BYTE   2
#define ASPECT_TYPE_CADDR   8
#define ASPECT_TYPE_CORENUM   10
#define ASPECT_TYPE_DADDR   7
#define ASPECT_TYPE_EXPR   13
#define ASPECT_TYPE_FUNC   15
#define ASPECT_TYPE_HASH   11
#define ASPECT_TYPE_INT   5
#define ASPECT_TYPE_LIST   12
#define ASPECT_TYPE_LONG   6
#define ASPECT_TYPE_MAXPTRDEPTH   1
#define ASPECT_TYPE_RAW   1
#define ASPECT_TYPE_SHORT   4
#define ASPECT_TYPE_SIMPLENUM   13
#define ASPECT_TYPE_STR   3
#define ASPECT_TYPE_UNKNOW   0
#define ASPECT_TYPE_VECT   10
#define ASPECT_TYPENAME_BIT   "bit"
#define ASPECT_TYPENAME_BLOC   "bloc"
#define ASPECT_TYPENAME_BYTE   "byte"
#define ASPECT_TYPENAME_CADDR   "caddr"
#define ASPECT_TYPENAME_DADDR   "daddr"
#define ASPECT_TYPENAME_EXPR   "expr"
#define ASPECT_TYPENAME_FUNC   "func"
#define ASPECT_TYPENAME_HASH   "hash"
#define ASPECT_TYPENAME_INT   "int"
#define ASPECT_TYPENAME_LIST   "list"
#define ASPECT_TYPENAME_LONG   "long"
#define ASPECT_TYPENAME_RAW   "raw"
#define ASPECT_TYPENAME_SHORT   "short"
#define ASPECT_TYPENAME_STR   "string"
#define ASPECT_TYPENAME_UNKNOW   "unknown"
#define ASPECT_TYPENAME_VECT   "vector"
#define CONFIG_ASM_ATT_MARGIN_DEFAULT   14
#define CONFIG_ASM_ATT_MARGIN_FLAG   "libasm.output.att.margin"
#define CONFIG_ASM_BIG_ENDIAN   1
#define CONFIG_ASM_ENDIAN_FLAG   "libasm.endian.flag"
 libasm related config
#define CONFIG_ASM_LITTLE_ENDIAN   0
#define CONFIG_CFGDEPTH   "mjr.cfg_depth"
#define CONFIG_CFGDEPTH_DEFAULT   30
#define CONFIG_HASH_SIZE   256
 Config related data types.
#define CONFIG_MODE_RO   1
#define CONFIG_MODE_RW   0
#define CONFIG_NAME_SAFEMODE   "safemode"
 Default names for config names.
#define CONFIG_SAFEMODE_OFF   0
 Config flags.
#define CONFIG_SAFEMODE_ON   1
#define CONFIG_TYPE_INT   0
#define CONFIG_TYPE_STR   1
#define CONFIG_USE_ASMDEBUG   "asm.debug"
#define CONTAINER_LINK_IN   0
 Input and Output links for containers.
#define CONTAINER_LINK_OUT   1
#define PROFILE_ALLOC   (1 << 2)
#define PROFILE_DEBUG   (1 << 3)
#define PROFILE_FUNCS   (1 << 1)
#define PROFILE_NONE   0
#define PROFILE_WARN   (1 << 0)
#define swap16(x)
#define swap32(x)
#define swap64(x)

Typedefs

typedef struct s_aspectworld aspectworld_t
typedef struct s_type aspectype_t
 Structure for type.
typedef struct s_config_item configitem_t
typedef struct s_container container_t
 Structure to define a generic container.
typedef struct s_info typeinfo_t
typedef struct s_vector vector_t
 The structure of multidimensional vectors.

Functions

typeinfo_t * aspect_basetype_get (unsigned int *nbr)
 Return the list of base types.
int aspect_basetype_register (char *name, u_int size)
 Create and register a new simple type.
int aspect_basetypes_create ()
 Create all simple types.
int aspect_called_ctors_finished ()
 Test if we called all constructors or not (currently we have 3).
void aspect_called_ctors_inc ()
 Count the number of constructors already called in the framework (update internal variable).
int aspect_init ()
 Initialize everything Libaspect.
int aspect_register_vector (char *, void *, unsigned int *, char **, unsigned int, unsigned int)
 Register a new vector. A vector is an multidimentional array of hooks.
aspectype_taspect_type_copy (aspectype_t *type, unsigned int off, u_char isptr, u_int elemnbr, char *fieldname, u_int *dims)
 Copy the structure representing a field data type for creating a new meta-type instance.
aspectype_taspect_type_copy_by_name (aspectype_t *type, char *name, hash_t *fields, u_int, u_int)
 Copy the structure representing a data type and change its name to create a new meta-type.
aspectype_taspect_type_create (u_char isunion, char *label, char **fields, u_int fieldnbr)
 Create a new (meta description) type.
int aspect_type_find_union_size (aspectype_t *type)
 Find the size of an union type.
char * aspect_type_get (u_int type)
aspectype_taspect_type_get_by_id (unsigned int id)
 Get a type by its type id.
aspectype_taspect_type_get_by_name (char *name)
 Get a type by its type id.
aspectype_taspect_type_get_child (aspectype_t *parent, char *name)
 Get field type from field name and parent type.
int aspect_type_register (u_char isunion, char *label, char **fields, u_int fieldnbr)
 Wrapper for easy type creation and registration.
int aspect_type_register_real (char *label, aspectype_t *ntype)
 The real type registering code.
int aspect_type_simple (int typeid)
 Indicate if a type is simple (1) or not (0).
char * aspect_typename_get (u_int typeid)
 Retreive the ascii name of a type.
u_int aspect_typesize_get (u_int type)
 Retreive the size (in bytes) of a type.
hash_taspect_vecthash_get ()
 Retreive the hash table : useful when iterating over it.
vector_taspect_vector_get (char *name)
 Retreive a vector from the hash table giving its name.
void aspect_vectors_insert (vector_t *vect, unsigned int *dim, unsigned long fct)
 Project each dimension and write the desired function pointer.
void * aspect_vectors_select (vector_t *vect, unsigned int *dim)
 Project each dimension and get the requested function pointer.
void * aspect_vectors_selectptr (vector_t *vect, unsigned int *dim)
 Project each dimension and get the requested vector element pointer.
void config_add_item (char *name, u_int type, u_int mode, void *dat)
 Add a configure item to the configuration items hash table.
void * config_get_data (char *name)
 Retreive the value of a configuration item.
void config_init ()
int config_safemode ()
 Indicate safemode state.
void config_safemode_reset ()
 Functions to turn off safemode.
void config_safemode_set ()
 Function to turn on safemode.
void config_update_key (char *name, void *data)
 Update value of an existing configuration item.
container_tcontainer_create (u_int type, void *data, list_t *in, list_t *out)
 Create a new container.
int container_linklists_create (container_t *container, u_int linktype)
 Create container lists.
u_char e2dbg_kpresence_get ()
void e2dbg_kpresence_set (u_char pres)
u_char e2dbg_presence_get ()
void e2dbg_presence_reset ()
 Reset debugger presence.
void e2dbg_presence_set ()
 Set debugger presence.
void profile_alloc_shift ()
profallocentry_tprofiler_alloc_find (u_char direction, u_long addr, u_char optype)
 Find an entry in the allocation profiler cache.
int profiler_alloc_update (char *file, char *func, u_int line, u_long addr, u_char atype, u_char otype)
 Update allocation cache with a new entry.
void profiler_alloc_warning (u_char warntype)
 Warn if anything bad is happening.
void profiler_alloc_warnprint (char *s, int fat, int i)
 Print the warning string.
void profiler_decdepth ()
 Set current function direction to be DOWN (function exiting).
int profiler_disable_all ()
 Disable all profiling printing.
int profiler_disable_alloc ()
 Disable profile verbose printing for internal memory allocations.
int profiler_disable_debug ()
 Disable profile verbose printing for internal debugging informations.
int profiler_disable_err ()
 Disable profile verbose printing for internal warnings.
int profiler_disable_out ()
 Disable profile verbose printing for internal ERESI functions tracing.
int profiler_enable_all ()
 Enable all profiling printing.
int profiler_enable_alloc ()
 Enable profile verbose printing for internal memory allocations.
int profiler_enable_debug ()
 Enable profile verbose printing for internal debugging informations.
int profiler_enable_err ()
 Enable profile verbose printing for internal ERESI warnings.
int profiler_enable_out ()
 Enable profile verbose printing for internal ERESI functions tracing.
int profiler_enabled ()
 Test if profiling is enabled.
void profiler_err (char *file, char *func, u_int line, char *msg)
 Generic routine for profiler error output.
void profiler_error ()
 Display last error message.
void profiler_error_reset ()
 Remove lastly generated error (nulify error string).
void profiler_incdepth ()
 Set the current function depth and direction.
void profiler_install (int(*profile)(char *), int(*profile_err)(char *))
 Change the profiling output function (default: revm_output in librevm).
int profiler_is_enabled (u_char mask)
 Test if profiler is enabled under certain flags.
void profiler_out (char *file, char *func, u_int line)
 Write the last profiling information.
int profiler_print (char *file, char *func, u_int line, char *msg)
 Generic routine for profiler output.
void profiler_reset (u_int sel)
 Reset profiler memory.
void profiler_setcolor (void(*endline)(), char *(*colorinstr)(char *text), char *(*colorstr)(char *t), char *(*colorfieldstr)(char *t), char *(*colortypestr)(char *t), char *(*colorend)(char *text), char *(*colorwarn)(char *text), char *(*colorfunction)(char *text), char *(*colorfilename)(char *text))
 Change simple color functions handlers.
void profiler_setmorecolor (char *(*coloradv)(char *ty, char *p, char *te), char *(*colorinstr_fmt)(char *p, char *t), char *(*coloraddress)(char *p, u_long a), char *(*colornumber)(char *p, u_int n), char *(*colorstr_fmt)(char *p, char *t), char *(*colorfieldstr_fmt)(char *p, char *t), char *(*colortypestr_fmt)(char *p, char *t), char *(*colorwarn_fmt)(char *pat, char *text))
u_char profiler_started ()
 Profiler is started ?
void profiler_updir ()
 Set current function direction to be UP (function entering).

Variables

aspectworld_t aspectworld


Generated by  Doxygen 1.6.0   Back to index