1 /******************************* loader.h **************************************
3 Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
5 See file COPYRIGHT for information on usage and disclaimer of warranties
7 Contains the prototypes for the class loader.
9 Author: Reinhard Grafl EMAIL: cacao@complang.tuwien.ac.at
11 Last Change: 1997/11/14
13 *******************************************************************************/
17 /************************* program switches ***********************************/
19 extern bool loadverbose; /* Print debug messages during loading */
20 extern bool linkverbose;
21 extern bool initverbose; /* Log class initialization */
22 extern bool makeinitializations; /* Initialize classes automatically */
24 extern bool getloadingtime;
25 extern long int loadingtime; /* CPU time for class loading */
27 extern list unlinkedclasses; /* List containing all unlinked classes */
28 extern list linkedclasses; /* List containing all linked classes */
31 /************************ prototypes ******************************************/
33 /* initialize laoder, load important systemclasses */
36 void suck_init(char *cpath);
41 /* load a class and all referenced classes */
42 classinfo *loader_load (utf *topname);
44 /* initializes all loaded classes */
45 void loader_initclasses ();
47 void loader_compute_subclasses ();
49 /* retrieve constantpool element */
50 voidptr class_getconstant (classinfo *class, u4 pos, u4 ctype);
52 /* determine type of a constantpool element */
53 u4 class_constanttype (classinfo *class, u4 pos);
55 /* search class for a field */
56 fieldinfo *class_findfield (classinfo *c, utf *name, utf *desc);
58 /* search for a method with a specified name and descriptor */
59 methodinfo *class_findmethod (classinfo *c, utf *name, utf *desc);
60 methodinfo *class_resolvemethod (classinfo *c, utf *name, utf *dest);
62 /* search for a method with specified name and arguments (returntype ignored) */
63 methodinfo *class_findmethod_approx (classinfo *c, utf *name, utf *desc);
64 methodinfo *class_resolvemethod_approx (classinfo *c, utf *name, utf *dest);
66 bool class_issubclass (classinfo *sub, classinfo *super);
68 /* call initializer of class */
69 void class_init (classinfo *c);
72 void class_showmethods (classinfo *c);
73 void class_showconstantpool (classinfo *c);
75 /* set buffer for reading classdata */
76 void classload_buffer(u1 *buf,int len);
78 /* create class representing specific arraytype */
79 classinfo *create_array_class(utf *u);
81 /* create the arraydescriptor for the arraytype specified by the utf-string */
82 constant_arraydescriptor * buildarraydescriptor(char *utf, u4 namelen);
84 extern void class_link (classinfo *c);
86 void field_display (fieldinfo *f);
88 void method_display(methodinfo *m);