#ifndef MPLIB1_VRE #define MPLIB1_VRE /* ******************************************************************************* * Copyright (c) 1996 Martin Poole * ******************************************************************************* ** ** WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! ** ** Any changes to be made to this file should first be checked with ** mplib1 source control for library integrity. ** ** mplib1 source control can be reached at mplib1@quatermass.co.uk ** * * $Source: /home/cvs/cvsroot/onelan/onelan/src/mplib1/mplib1/vre.h,v $ * $Author: mpoole $ * $Date: 2002/10/07 09:37:44 $ * $Revision: 1.2 $ * ******************************************************************************* * * Change History * * $Log: vre.h,v $ * Revision 1.2 2002/10/07 09:37:44 mpoole * Initial checkin of mplib1-3.1.0 * * Revision 1.1 2002/10/07 09:37:00 mpoole * Initial checkin of mplib1-3.1.0 * * ******************************************************************************* */ #ident "$Header: /home/cvs/cvsroot/onelan/onelan/src/mplib1/mplib1/vre.h,v 1.2 2002/10/07 09:37:44 mpoole Exp $" #ifdef CXREF #include #include #include #endif /* vre2disp.c vogon record editor. Display only version ******************************************************************** Copyright 1989,90,91 Martin Poole Released for use by Y2 Computing Limited - 1989 Released for use by Perot Systems Europe Limited - 1995. ******************************************************************** */ /* ------------------------------------------------------------------ defines ------------------------------------------------------------------ */ #define TO_COMPOSITE BIT(0) #define TO_DISPLAY BIT(1) #define TO_TYPEDEF BIT(2) /* ------------------------------------------------------------------ structures ------------------------------------------------------------------ */ struct vre_disp_walk_item { FILE *fp; const char *prefix; const void *ptr; const void *base; int flags; void *u_param; struct vre_elem_obj *eop; struct vre_type_obj *top; }; typedef int (* vre_disp_t)( const void *, struct vre_disp_walk_item *dwip ); struct vre_type_obj { dl_Node_t to_Node; int to_Flags; vre_disp_t to_Disp; size_t to_Size; int to_Align; dl_List_t to_Elems; char to_Name[1]; /* with the strlen and this byte for the null */ }; struct vre_elem_obj { dl_Node_t eo_Node; off_t eo_Offset; char *eo_Name; int eo_Arr_sz; char eo_Type[1]; }; #define VRE_DISP_ELEM_NAMES BIT(0) /* ------------------------------------------------------------------ function definitions ------------------------------------------------------------------ */ /* ---- vre_alloc ---- */ extern int vre_Init_VRE( FILE *fp ); extern struct vre_type_obj * vre_Find_Type( const char *nm ); extern int vre_Add_Type( struct vre_type_obj *top ); extern struct vre_type_obj * vre_Type_Synonym( const char *nm, const char *synm ); extern struct vre_type_obj * vre_New_Type( const char *nm, vre_disp_t disp, size_t isize, int ialign, int add ); extern struct vre_elem_obj * vre_New_Elem( const char *nm, const char *typ, off_t offset, int arr_sz ); extern struct vre_elem_obj * vre_Cat_New_Elem( struct vre_type_obj *ntyp, const char *el_nm, const char *el_typ, int arr_sz ); extern int vre_Get_Info( const char *el_nm, size_t *isize, int *ialign, off_t *offset, int *arr_sz, int *flags ); extern off_t vre_Get_Offset( const char *el_nm ); extern int vre_Disp_Item( FILE *fp, const char *type, const char *name, const void *ptr, const void *base, int flags, void *u_param ); extern int vre_Disp_Types( FILE *fp, int flags ); extern int vre_Disp_Prefix( FILE *fp, const void *ptr, const void *base, const char *prefix, const char *suffix ); /* ---- vre_disp ---- */ extern int vre_Init_Disp_Primitives( FILE *fp ); /* ---- vre_parse ---- */ extern int vre_Parse_Line( FILE *fp, char *line ); extern int vre_Parse_File( FILE *fp, const char *fname ); /* ---- vre_loop ---- */ extern int vre_Interactive_Loop( char *line, FILE *fp, void *base ); extern int vre_Get_ADDR( char *np, char **nnp ); #endif /* -- End of File -- */