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; /* Debug-Meldungen beim Laden ausgeben */
20 extern bool linkverbose;
21 extern bool initverbose; /* Meldungen ausgeben, wenn Klasse
23 extern bool makeinitializations; /* Klassen automatisch initialisieren */
25 extern bool getloadingtime;
26 extern long int loadingtime; /* CPU-Zeit f"urs Laden der Klassen */
28 extern list linkedclasses; /* Liste aller fertig gelinkten Klassen */
31 /************************ prototypes ******************************************/
33 /* initialize laoder, load important systemclasses */
39 /* load a class and all referenced classes */
40 classinfo *loader_load (utf *topname);
42 /* initializes all loaded classes */
43 void loader_initclasses ();
45 void loader_compute_subclasses ();
47 /* retrieve constantpool element */
48 voidptr class_getconstant (classinfo *class, u4 pos, u4 ctype);
50 /* determine type of a constantpool element */
51 u4 class_constanttype (classinfo *class, u4 pos);
53 /* search class for a field */
54 fieldinfo *class_findfield (classinfo *c, utf *name, utf *desc);
56 /* search for a method with a specified name and descriptor */
57 methodinfo *class_findmethod (classinfo *c, utf *name, utf *desc);
58 methodinfo *class_resolvemethod (classinfo *c, utf *name, utf *dest);
60 /* search for a method with specified name and arguments (returntype ignored) */
61 methodinfo *class_findmethod_approx (classinfo *c, utf *name, utf *desc);
62 methodinfo *class_resolvemethod_approx (classinfo *c, utf *name, utf *dest);
64 bool class_issubclass (classinfo *sub, classinfo *super);
66 /* call initializer of class */
67 void class_init (classinfo *c);
70 void class_showmethods (classinfo *c);
71 void class_showconstantpool (classinfo *c);
73 /* set buffer for reading classdata */
74 void classload_buffer(u1 *buf,int len);
76 /* create class representing specific arraytype */
77 classinfo *create_array_class(utf *u);
79 /* create the arraydescriptor for the arraytype specified by the utf-string */
80 constant_arraydescriptor * buildarraydescriptor(char *utf, u4 namelen);