1 /* -*- Mode: C++; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // -------------------------------------------------------------------------*/
12 #include "squirreljme.h"
14 // The class to forward to
15 #define TASK_CLASSNAME "cc/squirreljme/emulator/EmulatedTaskShelf"
17 #define TASK_START_DESC "([Lcc/squirreljme/jvm/mle/brackets/JarPackageBracket;Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;II)Lcc/squirreljme/jvm/mle/brackets/TaskBracket;"
18 #define TASK_STATUS_DESC "(Lcc/squirreljme/jvm/mle/brackets/TaskBracket;)I"
20 JNIEXPORT jobject JNICALL
Impl_mle_TaskShelf_start(
21 JNIEnv
* env
, jclass classy
, jobjectArray classPath
, jstring mainClass
,
22 jobjectArray args
, jobjectArray sysPropPairs
, jint stdOut
, jint stdErr
)
24 return forwardCallStaticObject(env
, TASK_CLASSNAME
,
25 "start", TASK_START_DESC
,
26 classPath
, mainClass
, args
, sysPropPairs
, stdOut
, stdErr
);
29 JNIEXPORT jint JNICALL
Impl_mle_TaskShelf_status(
30 JNIEnv
* env
, jclass classy
, jobject task
)
32 return forwardCallStaticInteger(env
, TASK_CLASSNAME
,
33 "status", TASK_STATUS_DESC
,
37 static const JNINativeMethod mleTaskMethods
[] =
39 {"start", TASK_START_DESC
, (void*)Impl_mle_TaskShelf_start
},
40 {"status", TASK_STATUS_DESC
, (void*)Impl_mle_TaskShelf_status
},
43 jint JNICALL
mleTaskInit(JNIEnv
* env
, jclass classy
)
45 return (*env
)->RegisterNatives(env
,
46 (*env
)->FindClass(env
, "cc/squirreljme/jvm/mle/TaskShelf"),
47 mleTaskMethods
, sizeof(mleTaskMethods
) /
48 sizeof(JNINativeMethod
));