Updated version, required for darwin
[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 void suck_init(char *cpath);
36
37 /* free resources */
38 void loader_close ();
39
40 /* load a class and all referenced classes */
41 classinfo *loader_load (utf *topname);
42
43 /* initializes all loaded classes */
44 void loader_initclasses ();
45
46 void loader_compute_subclasses ();
47
48 /* retrieve constantpool element */
49 voidptr class_getconstant (classinfo *class, u4 pos, u4 ctype);
50
51 /* determine type of a constantpool element */
52 u4 class_constanttype (classinfo *class, u4 pos);
53
54 /* search class for a field */
55 fieldinfo *class_findfield (classinfo *c, utf *name, utf *desc);
56
57 /* search for a method with a specified name and descriptor */
58 methodinfo *class_findmethod (classinfo *c, utf *name, utf *desc);
59 methodinfo *class_resolvemethod (classinfo *c, utf *name, utf *dest);
60
61 /* search for a method with specified name and arguments (returntype ignored) */
62 methodinfo *class_findmethod_approx (classinfo *c, utf *name, utf *desc);
63 methodinfo *class_resolvemethod_approx (classinfo *c, utf *name, utf *dest);
64
65 bool class_issubclass (classinfo *sub, classinfo *super);
66
67 /* call initializer of class */
68 void class_init (classinfo *c);
69
70 /* debug purposes */
71 void class_showmethods (classinfo *c);
72 void class_showconstantpool (classinfo *c);
73
74 /* set buffer for reading classdata */
75 void classload_buffer(u1 *buf,int len);
76
77 /* create class representing specific arraytype */
78 classinfo *create_array_class(utf *u);
79
80 /* create the arraydescriptor for the arraytype specified by the utf-string */
81 constant_arraydescriptor * buildarraydescriptor(char *utf, u4 namelen);
82
83
84