Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

data_analy.h

Go to the documentation of this file.
00001 /* 
00002  *      HT Editor
00003  *      data_analy.h
00004  *
00005  *      Copyright (C) 1999-2002 Sebastian Biallas (sb@web-productions.de)
00006  *
00007  *      This program is free software; you can redistribute it and/or modify
00008  *      it under the terms of the GNU General Public License version 2 as
00009  *      published by the Free Software Foundation.
00010  *
00011  *      This program is distributed in the hope that it will be useful,
00012  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *      GNU General Public License for more details.
00015  *
00016  *      You should have received a copy of the GNU General Public License
00017  *      along with this program; if not, write to the Free Software
00018  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 #ifndef DATA_ANALY_H
00022 #define DATA_ANALY_H
00023 
00024 #include "global.h"
00025 #include "analy.h"
00026 
00027 
00028 typedef enum {op_read, op_write, op_offset} OP;
00029 
00030 /*
00031  * general type of an address
00032  */
00033 typedef enum {
00034         dt_unknown = 0,
00035         dt_code,
00036         dt_unknown_data,
00037         dt_int,
00038         dt_float,
00039         dt_array
00040 } taddr_typetype;
00041 
00042 typedef enum {
00043         dst_cunknown = 0,
00044         dst_location,
00045         dst_function
00046 } taddr_code_subtype;
00047 
00048 typedef enum {
00049         dst_iunknown = 0,
00050         dst_ibyte,
00051         dst_iword,
00052         dst_idword,
00053         dst_ipword,
00054         dst_iqword
00055 } taddr_int_subtype;
00056 
00057 typedef enum {
00058         dst_funknown = 0,
00059         dst_fdouble,
00060         dst_fextended
00061 } taddr_float_subtype;
00062 
00063 typedef enum {
00064         dst_aunknown = 0,
00065         dst_abyte,
00066         dst_aword,
00067         dst_adword,
00068         dst_apword,
00069         dst_aqword,
00070         dst_string,
00071         dst_unistring
00072 } taddr_array_subtype;
00073 
00074 struct taddr_type {
00075         taddr_typetype type;
00076         union {
00077                 byte                            subtype;
00078                 taddr_code_subtype      code_subtype;
00079                 taddr_int_subtype       int_subtype;
00080                 taddr_float_subtype     float_subtype;
00081                 taddr_array_subtype     array_subtype;
00082         };
00083         union {
00084                 int  length;
00085                 // ...?
00086         };
00087 };
00088 
00089 void analyser_put_addrtype(ht_object_stream *f, const taddr_type *at);
00090 int analyser_get_addrtype(ht_object_stream *f, taddr_type *at);
00091 
00092 class Analyser;
00093 class Address;
00094 struct Location;
00095 
00096 class DataAnalyser: public Object       {
00097 public:
00098         Analyser                *analy;
00099                         void            init(Analyser *Analy);
00100                         int             load(ht_object_stream *f);
00101         virtual void            done();
00102         virtual OBJECT_ID       object_id() const;
00103 
00104                         void            access(Address *Addr, OP op, int size);
00105                         void            setAddressType(Address *Addr, taddr_typetype type, int subtype, int length);
00106                         void            setAddressType(Location *Addr, taddr_typetype type, int subtype, int length);
00107                         void            setCodeAddressType(Address *Addr, taddr_code_subtype subtype);
00108                         void            setCodeAddressType(Location *Addr, taddr_code_subtype subtype);
00109                         void            setIntAddressType(Address *Addr, taddr_int_subtype subtype, int length);
00110                         void            setIntAddressType(Location *Addr, taddr_int_subtype subtype, int length);
00111                         void            setFloatAddressType(Address *Addr, taddr_float_subtype subtype, int length);
00112                         void            setFloatAddressType(Location *Addr, taddr_float_subtype subtype, int length);
00113                         void            setArrayAddressType(Address *Addr, taddr_array_subtype subtype, int length);
00114                         void            setArrayAddressType(Location *Addr, taddr_array_subtype subtype, int length);
00115         virtual void            store(ht_object_stream *f);
00116 };
00117 
00118 void analyser_put_addrtype(ht_object_stream *f, const taddr_type *at);
00119 int analyser_get_addrtype(ht_object_stream *f, taddr_type *at);
00120 
00121 #endif

Generated on Fri May 7 21:15:30 2004 by doxygen 1.3.5