1/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* ***** BEGIN LICENSE BLOCK *****
3 * Version: NPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Netscape Public License
6 * Version 1.1 (the "License"); you may not use this file except in
7 * compliance with the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/NPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the NPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the NPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37#ifndef _INTERPRETER_H_
38#define _INTERPRETER_H_
39
40#include "prtypes.h"
41
42PR_BEGIN_EXTERN_C
43
44#include <stdio.h>
45#include <stdlib.h>
46#include <string.h>
47
48#include "bool.h"
49#include "jni.h"
50
51typedef struct execenv ExecEnv;
52
53typedef void JavaStack;
54
55typedef void JavaFrame;
56
57struct Hjava_lang_ClassLoader;
58
59JRI_PUBLIC_API(JHandle *)
60ArrayAlloc(int32_t, int32_t);
61
62JRI_PUBLIC_API(JavaFrame *)
63CompiledFramePrev(JavaFrame *, JavaFrame *);
64
65JRI_PUBLIC_API(JavaStack *)
66CreateNewJavaStack(ExecEnv *, JavaStack *);
67
68JRI_PUBLIC_API(bool_t)
69ExecuteJava(unsigned char *, ExecEnv *);
70
71JRI_PUBLIC_API(ClassClass *)
72FindClassFromClass(struct execenv *, char *, bool_t, ClassClass *);
73
74JRI_PUBLIC_API(ClassClass *)
75FindLoadedClass(char *, struct Hjava_lang_ClassLoader *);
76
77JRI_PUBLIC_API(void)
78PrintToConsole(const char *);
79
80JRI_PUBLIC_API(bool_t)
81VerifyClassAccess(ClassClass *, ClassClass *, bool_t);
82
83JRI_PUBLIC_API(bool_t)
84VerifyFieldAccess(ClassClass *, ClassClass *, int, bool_t);
85
86JRI_PUBLIC_API(long)
87do_execute_java_method(ExecEnv *, void *, char *, char *,
88                       struct methodblock *, bool_t, ...);
89
90JRI_PUBLIC_API(long)
91do_execute_java_method_vararg(ExecEnv *, void *, char *, char *,
92                              struct methodblock *, bool_t, va_list,
93                              long *, bool_t);
94
95JRI_PUBLIC_API(HObject *)
96execute_java_constructor_vararg(struct execenv *, char *, ClassClass *,
97                                char *, va_list);
98
99JRI_PUBLIC_API(HObject *)
100execute_java_constructor(ExecEnv *, char *, ClassClass *, char *, ...);
101
102JRI_PUBLIC_API(bool_t)
103is_subclass_of(ClassClass *, ClassClass *, ExecEnv *);
104
105JRI_PUBLIC_API(HObject*)
106newobject(ClassClass *, unsigned char *, struct execenv *);
107
108JRI_PUBLIC_API(int32_t)
109sizearray(int32_t, int32_t);
110
111PR_END_EXTERN_C
112
113#endif /* ! _INTERPRETER_H_ */
114