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

classread.cc File Reference

#include <stdlib.h>
#include <string.h>
#include "analy.h"
#include "class.h"
#include "htstring.h"
#include "snprintf.h"
#include "stream.h"

Go to the source code of this file.

Defines

#define cls_read(a, b, c, d)
#define READ1()
#define READ2()
#define READ4()
#define READN(inb, n)   cls_read (inb, n, 1, htio)
#define SKIPN(n)   {u1 b; for (u4 i=0; i<n; i++) {cls_read(&b, 1, 1, htio);}}
#define STRIP_PATH

Functions

attrib_infoattribute_read (ht_stream *htio, classfile *clazz)
ht_class_shared_dataclass_read (ht_streamfile *htio)
void class_unread (ht_class_shared_data *shared)
int java_demangle_type (char *result, char **type)
char * java_demangle_flags (char *result, int flags)
void java_demangle (char *result, char *classname, char *name, char *type, int flags)
int token_translate (char *buf, int maxlen, dword token, ht_class_shared_data *shared)


Define Documentation

#define cls_read a,
b,
c,
 ) 
 

Value:

(((b) != ((d)->read((a), (b)*(c)))) \
                                ? (0) : (offset+=(b), (b)))

Definition at line 34 of file classread.cc.

 
#define READ1  ) 
 

Value:

(((inp[0]=inp[1]=inp[2]=inp[3]=0),  \
   (1 == cls_read (inp, 1, 1, htio))) \
   ? (u1)(inp[0]) : 0)

Definition at line 36 of file classread.cc.

 
#define READ2  ) 
 

Value:

(((inp[0]=inp[1]=inp[2]=inp[3]=0),  \
   (2 == cls_read (inp, 2, 1, htio))) \
   ? ((((u2)inp[0])<<8)|inp[1]) : 0)

Definition at line 40 of file classread.cc.

Referenced by attribute_read(), and class_read().

 
#define READ4  ) 
 

Value:

(((inp[0]=inp[1]=inp[2]=inp[3]=0),  \
   (4 == cls_read (inp, 4, 1, htio))) \
   ? (((((((u4)inp[0]<<8)|inp[1])<<8)|inp[2])<<8)|inp[3]) : 0)

Definition at line 44 of file classread.cc.

Referenced by attribute_read(), and class_read().

#define READN inb,
 )     cls_read (inb, n, 1, htio)
 

Definition at line 48 of file classread.cc.

#define SKIPN  )     {u1 b; for (u4 i=0; i<n; i++) {cls_read(&b, 1, 1, htio);}}
 

Definition at line 49 of file classread.cc.

Referenced by attribute_read().

#define STRIP_PATH
 

Definition at line 394 of file classread.cc.


Function Documentation

attrib_info* attribute_read ht_stream htio,
classfile clazz
 

Definition at line 136 of file classread.cc.

References attrib_info, classfile, _attrib_info::code, _attrib_info::len, len, malloc(), _attrib_info::name, NULL, _attrib_info::offset, READ2, READ4, SKIPN, _attrib_info::tag, and u4.

Referenced by class_read().

ht_class_shared_data* class_read ht_streamfile htio  ) 
 

Definition at line 208 of file classread.cc.

References _classfile::access_flags, Area::add(), _classfile::aoffset, attrib_info, _classfile::attribs, _mf_info::attribs, _classfile::attribs_count, _mf_info::attribs_count, attribute_read(), classfile, ht_class_shared_data::classinfo, _attrib_info::code, _classfile::coffset, compare_keys_ht_data(), cp_info, _classfile::cpool, _classfile::cpool_count, _mf_info::desc, _classfile::fields, _classfile::fields_count, ht_class_shared_data::file, _mf_info::flags, ht_class_shared_data::flags, _classfile::foffset, Area::init(), ht_stree::init(), ht_class_shared_data::initialized, ht_stree::insert(), _classfile::interfaces, _classfile::interfaces_count, _classfile::magic, _classfile::major_version, malloc(), _classfile::methods, ht_class_shared_data::methods, _classfile::methods_count, mf_info, _classfile::minor_version, _classfile::moffset, _mf_info::name, NULL, _classfile::offset, READ2, READ4, _classfile::super_class, _attrib_info::tag, _cp_info::tag, _classfile::this_class, u2, and ht_class_shared_data::valid.

void class_unread ht_class_shared_data shared  ) 
 

Definition at line 346 of file classread.cc.

References _classfile::attribs, _mf_info::attribs, _classfile::attribs_count, _mf_info::attribs_count, classfile, _classfile::cpool, _classfile::cpool_count, Area::done(), _classfile::fields, _classfile::fields_count, ht_class_shared_data::file, _classfile::interfaces, _classfile::methods, _classfile::methods_count, _cp_info::tag, u1, UINT, and ht_class_shared_data::valid.

Referenced by cview::done().

void java_demangle char *  result,
char *  classname,
char *  name,
char *  type,
int  flags
 

Definition at line 469 of file classread.cc.

References java_demangle_flags(), and java_demangle_type().

Referenced by ClassAnalyser::beginAnalysis(), and token_translate().

char* java_demangle_flags char *  result,
int  flags
 

Definition at line 441 of file classread.cc.

Referenced by ClassAnalyser::beginAnalysis(), and java_demangle().

int java_demangle_type char *  result,
char **  type
 

Definition at line 396 of file classread.cc.

Referenced by java_demangle(), and token_translate().

int token_translate char *  buf,
int  maxlen,
dword  token,
ht_class_shared_data shared
 

Definition at line 494 of file classread.cc.

References buf, classfile, _classfile::cpool, _classfile::cpool_count, escape_special_str(), ht_class_shared_data::file, ht_snprintf(), java_demangle(), java_demangle_type(), NULL, _cp_info::tag, and _cp_info::value.

Referenced by class_token_func().


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