1 /* loader.h - class loader header
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser,
5 M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck,
6 P. Tomsich, J. Wenninger
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Reinhard Grafl
29 $Id: loader.h 757 2003-12-13 22:27:31Z twisti $
39 /* export variables */
41 extern list unloadedclasses; /* list of all referenced but not loaded classes */
42 extern list unlinkedclasses; /* List containing all unlinked classes */
43 extern list linkedclasses; /* List containing all linked classes */
50 /************************ prototypes ******************************************/
52 /* initialize laoder, load important systemclasses */
55 void suck_init(char *cpath);
60 /* load a class and all referenced classes */
61 classinfo *loader_load(utf *topname);
63 /* initializes all loaded classes */
64 void loader_initclasses();
66 void loader_compute_subclasses();
68 /* retrieve constantpool element */
69 voidptr class_getconstant(classinfo *class, u4 pos, u4 ctype);
71 /* determine type of a constantpool element */
72 u4 class_constanttype(classinfo *class, u4 pos);
74 s4 class_findmethodIndex(classinfo *c, utf *name, utf *desc);
76 /* search class for a field */
77 fieldinfo *class_findfield(classinfo *c, utf *name, utf *desc);
79 /* search for a method with a specified name and descriptor */
80 methodinfo *class_findmethod(classinfo *c, utf *name, utf *desc);
81 methodinfo *class_fetchmethod(classinfo *c, utf *name, utf *desc);
82 methodinfo *class_resolvemethod(classinfo *c, utf *name, utf *dest);
84 /* search for a method with specified name and arguments (returntype ignored) */
85 methodinfo *class_findmethod_approx(classinfo *c, utf *name, utf *desc);
86 methodinfo *class_resolvemethod_approx(classinfo *c, utf *name, utf *dest);
88 bool class_issubclass(classinfo *sub, classinfo *super);
90 /* call initializer of class */
91 void class_init(classinfo *c);
93 void class_showconstanti(classinfo *c, int ii);
96 void class_showmethods(classinfo *c);
97 void class_showconstantpool(classinfo *c);
98 void print_arraydescriptor(FILE *file, arraydescriptor *desc);
100 classinfo *loader_load(utf *topname);
101 classinfo *loader_load_sysclass(classinfo **top,utf *topname);
103 /* set buffer for reading classdata */
104 void classload_buffer(u1 *buf, int len);
106 /* return the primitive class inidicated by the given signature character */
107 classinfo *class_primitive_from_sig(char sig);
110 /* return the class indicated by the given descriptor */
111 /* (see loader.c for documentation) */
112 #define CLASSLOAD_NEW 0 /* default */
113 #define CLASSLOAD_LOAD 0x0001
114 #define CLASSLOAD_SKIP 0x0002
115 #define CLASSLOAD_PANIC 0 /* default */
116 #define CLASSLOAD_NOPANIC 0x0010
117 #define CLASSLOAD_PRIMITIVE 0 /* default */
118 #define CLASSLOAD_NULLPRIMITIVE 0x0020
119 #define CLASSLOAD_VOID 0 /* default */
120 #define CLASSLOAD_NOVOID 0x0040
121 #define CLASSLOAD_NOCHECKEND 0 /* default */
122 #define CLASSLOAD_CHECKEND 0x1000
124 classinfo *class_from_descriptor(char *utf_ptr,char *end_ptr,char **next,int mode);
125 int type_from_descriptor(classinfo **cls,char *utf_ptr,char *end_ptr,char **next,int mode);
127 /* (used by class_new, don't use directly) */
128 void class_new_array(classinfo *c);
130 void class_link(classinfo *c);
132 void field_display(fieldinfo *f);
134 void method_display(methodinfo *m);
139 #endif /* _LOADER_H */
143 * These are local overrides for various environment variables in Emacs.
144 * Please do not remove this and leave it at the end of the file, where
145 * Emacs will automagically detect them.
146 * ---------------------------------------------------------------------
149 * indent-tabs-mode: t