Working towards better make dist
[cacao.git] / loader.h
1 /******************************* loader.h **************************************
2
3         Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
4
5         See file COPYRIGHT for information on usage and disclaimer of warranties
6
7         Contains the prototypes for the class loader.
8
9         Author:  Reinhard Grafl      EMAIL: cacao@complang.tuwien.ac.at
10
11         Last Change: 1997/11/14
12
13 *******************************************************************************/
14
15
16
17 /************************* program switches ***********************************/
18
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 */
23
24 extern bool getloadingtime;
25 extern long int loadingtime;     /* CPU time for class loading */
26
27 extern list linkedclasses;       /* List containing all linked classes */
28
29
30 /************************ prototypes ******************************************/
31
32 /* initialize laoder, load important systemclasses */
33 void loader_init ();
34
35 /* free resources */
36 void loader_close ();
37
38 /* load a class and all referenced classes */
39 classinfo *loader_load (utf *topname);
40
41 /* initializes all loaded classes */
42 void loader_initclasses ();
43
44 void loader_compute_subclasses ();
45
46 /* retrieve constantpool element */
47 voidptr class_getconstant (classinfo *class, u4 pos, u4 ctype);
48
49 /* determine type of a constantpool element */
50 u4 class_constanttype (classinfo *class, u4 pos);
51
52 /* search class for a field */
53 fieldinfo *class_findfield (classinfo *c, utf *name, utf *desc);
54
55 /* search for a method with a specified name and descriptor */
56 methodinfo *class_findmethod (classinfo *c, utf *name, utf *desc);
57 methodinfo *class_resolvemethod (classinfo *c, utf *name, utf *dest);
58
59 /* search for a method with specified name and arguments (returntype ignored) */
60 methodinfo *class_findmethod_approx (classinfo *c, utf *name, utf *desc);
61 methodinfo *class_resolvemethod_approx (classinfo *c, utf *name, utf *dest);
62
63 bool class_issubclass (classinfo *sub, classinfo *super);
64
65 /* call initializer of class */
66 void class_init (classinfo *c);
67
68 /* debug purposes */
69 void class_showmethods (classinfo *c);
70 void class_showconstantpool (classinfo *c);
71
72 /* set buffer for reading classdata */
73 void classload_buffer(u1 *buf,int len);
74
75 /* create class representing specific arraytype */
76 classinfo *create_array_class(utf *u);
77
78 /* create the arraydescriptor for the arraytype specified by the utf-string */
79 constant_arraydescriptor * buildarraydescriptor(char *utf, u4 namelen);
80
81
82