Home | History | Annotate | Download | only in java
      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 
     42 PR_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 
     51 typedef struct execenv ExecEnv;
     52 
     53 typedef void JavaStack;
     54 
     55 typedef void JavaFrame;
     56 
     57 struct Hjava_lang_ClassLoader;
     58 
     59 JRI_PUBLIC_API(JHandle *)
     60 ArrayAlloc(int32_t, int32_t);
     61 
     62 JRI_PUBLIC_API(JavaFrame *)
     63 CompiledFramePrev(JavaFrame *, JavaFrame *);
     64 
     65 JRI_PUBLIC_API(JavaStack *)
     66 CreateNewJavaStack(ExecEnv *, JavaStack *);
     67 
     68 JRI_PUBLIC_API(bool_t)
     69 ExecuteJava(unsigned char *, ExecEnv *);
     70 
     71 JRI_PUBLIC_API(ClassClass *)
     72 FindClassFromClass(struct execenv *, char *, bool_t, ClassClass *);
     73 
     74 JRI_PUBLIC_API(ClassClass *)
     75 FindLoadedClass(char *, struct Hjava_lang_ClassLoader *);
     76 
     77 JRI_PUBLIC_API(void)
     78 PrintToConsole(const char *);
     79 
     80 JRI_PUBLIC_API(bool_t)
     81 VerifyClassAccess(ClassClass *, ClassClass *, bool_t);
     82 
     83 JRI_PUBLIC_API(bool_t)
     84 VerifyFieldAccess(ClassClass *, ClassClass *, int, bool_t);
     85 
     86 JRI_PUBLIC_API(long)
     87 do_execute_java_method(ExecEnv *, void *, char *, char *,
     88                        struct methodblock *, bool_t, ...);
     89 
     90 JRI_PUBLIC_API(long)
     91 do_execute_java_method_vararg(ExecEnv *, void *, char *, char *,
     92                               struct methodblock *, bool_t, va_list,
     93                               long *, bool_t);
     94 
     95 JRI_PUBLIC_API(HObject *)
     96 execute_java_constructor_vararg(struct execenv *, char *, ClassClass *,
     97                                 char *, va_list);
     98 
     99 JRI_PUBLIC_API(HObject *)
    100 execute_java_constructor(ExecEnv *, char *, ClassClass *, char *, ...);
    101 
    102 JRI_PUBLIC_API(bool_t)
    103 is_subclass_of(ClassClass *, ClassClass *, ExecEnv *);
    104 
    105 JRI_PUBLIC_API(HObject*)
    106 newobject(ClassClass *, unsigned char *, struct execenv *);
    107 
    108 JRI_PUBLIC_API(int32_t)
    109 sizearray(int32_t, int32_t);
    110 
    111 PR_END_EXTERN_C
    112 
    113 #endif /* ! _INTERPRETER_H_ */
    114