Authors: Reinhard Grafl
- $Id: loader.h 2148 2005-03-30 16:49:40Z twisti $
+ $Id: loader.h 2199 2005-04-03 21:42:44Z twisti $
*/
typedef struct classpath_info classpath_info;
-#include "config.h"
-#include "types.h"
-#include "vm/class.h"
-#include "vm/descriptor.h"
#include "vm/global.h"
-#include "vm/method.h"
#include "vm/utf8.h"
+#include "vm/references.h"
+#include "vm/descriptor.h"
+#include "vm/method.h"
#if defined(USE_ZLIB)
# include "vm/unzip.h"
*******************************************************************************/
-typedef struct { /* Fieldref, Methodref and InterfaceMethodref */
- classinfo *class; /* class containing this field/method/intfmeth. */ /* XXX remove */
- constant_classref *classref; /* class containing this field/meth./intfm. */
- utf *name; /* field/method/interfacemethod name */
- utf *descriptor; /* field/method/intfmeth. type descriptor string */
- parseddesc parseddesc; /* parsed descriptor */
-} constant_FMIref;
-
-
typedef struct { /* Integer */
s4 value;
} constant_integer;
void loader_close(void);
/* class loading functions */
-classinfo *load_class_from_classloader(classinfo *c, java_objectheader *cl);
-classinfo *load_class_bootstrap(classinfo *c);
+bool load_class_from_sysloader(utf *name, classinfo **result);
+bool load_class_from_classloader(utf *name, java_objectheader *cl, classinfo **result);
+bool load_class_bootstrap(utf *name,classinfo **result);
+/* (don't use the following directly:) */
classinfo *load_class_from_classbuffer(classbuffer *cb);
+bool load_newly_created_array(classinfo *c,java_objectheader *loader);
/* retrieve constantpool element */
bool class_issubclass(classinfo *sub, classinfo *super);
-/* call initializer of class */
-classinfo *class_init(classinfo *c);
-
/* debug purposes */
void class_showmethods(classinfo *c);
void class_showconstantpool(classinfo *c);
-void print_arraydescriptor(FILE *file, arraydescriptor *desc);
/* return the primitive class inidicated by the given signature character */
classinfo *class_primitive_from_sig(char sig);
-/* return the class indicated by the given descriptor */
-/* (see loader.c for documentation) */
-#define CLASSLOAD_NEW 0 /* default */
-#define CLASSLOAD_LOAD 0x0001
-#define CLASSLOAD_SKIP 0x0002
-#define CLASSLOAD_PANIC 0 /* default */
-#define CLASSLOAD_NOPANIC 0x0010
-#define CLASSLOAD_PRIMITIVE 0 /* default */
-#define CLASSLOAD_NULLPRIMITIVE 0x0020
-#define CLASSLOAD_VOID 0 /* default */
-#define CLASSLOAD_NOVOID 0x0040
-#define CLASSLOAD_NOCHECKEND 0 /* default */
-#define CLASSLOAD_CHECKEND 0x1000
-
-classinfo *class_from_descriptor(char *utf_ptr,char *end_ptr,char **next,int mode);
-int type_from_descriptor(classinfo **cls,char *utf_ptr,char *end_ptr,char **next,int mode);
-
-/* (used by class_new, don't use directly) */
-void class_new_array(classinfo *c);
-
-#define LAZYLOADING(class) { \
- if (!class->loaded) \
- if (!class_load(class)) \
- return 0; \
- if (!class->linked) \
- if (!class_link(class)) \
- return 0; }
-
-
-
-#define LAZYLOADING1(class) { \
- if (!class->loaded) \
- if (!class_load(class)) \
- return; \
- if (!class->linked) \
- if (!class_link(class)) \
- return; }
+/* debug helpers */
+void fprintflags(FILE *fp, u2 f);
+void printflags(u2 f);
#endif /* _LOADER_H */