Indentations break the feed.
[SquirrelJME.git] / nanocoat / frontend / emulator / nativeNvmBootParam.c
blob327bd6883a3ca394c0763af07483480644b53c43
1 /* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
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 // -------------------------------------------------------------------------*/
10 #include <jni.h>
12 #include "frontend/emulator/jniHelper.h"
13 #include "sjme/nvm/boot.h"
14 #include "sjme/alloc.h"
16 void SJME_JNI_METHOD(SJME_CLASS_NVM_BOOT_PARAM, _1_1setMainArgs)
17 (JNIEnv* env, jclass classy, jlong thisPtr, jlong listPtr)
19 sjme_nvm_bootParam* param;
21 if (thisPtr == 0)
23 sjme_jni_throwVMException(env, SJME_ERROR_NULL_ARGUMENTS);
24 return;
27 /* Get parameter data. */
28 param = SJME_JLONG_TO_POINTER(sjme_nvm_bootParam*, thisPtr);
30 /* Set main arguments. */
31 param->mainArgs = SJME_JLONG_TO_POINTER(const sjme_list_sjme_lpcstr*,
32 listPtr);
35 void SJME_JNI_METHOD(SJME_CLASS_NVM_BOOT_PARAM, _1_1setMainClass)
36 (JNIEnv* env, jclass classy, jlong thisPtr, jlong stringPtr)
38 sjme_nvm_bootParam* param;
40 if (thisPtr == 0)
42 sjme_jni_throwVMException(env, SJME_ERROR_NULL_ARGUMENTS);
43 return;
46 /* Get parameter data. */
47 param = SJME_JLONG_TO_POINTER(sjme_nvm_bootParam*, thisPtr);
49 /* Set main class. */
50 param->mainClass = SJME_JLONG_TO_POINTER(sjme_lpcstr, stringPtr);
53 void SJME_JNI_METHOD(SJME_CLASS_NVM_BOOT_PARAM, _1_1setMainClassPathIds)
54 (JNIEnv* env, jclass classy, jlong thisPtr, jlong idsPtr)
56 sjme_nvm_bootParam* param;
58 if (thisPtr == 0)
60 sjme_jni_throwVMException(env, SJME_ERROR_NULL_ARGUMENTS);
61 return;
64 /* Get parameter data. */
65 param = SJME_JLONG_TO_POINTER(sjme_nvm_bootParam*, thisPtr);
67 /* Set suite information. */
68 param->mainClassPathById =
69 SJME_JLONG_TO_POINTER(const sjme_list_sjme_jint*, idsPtr);
72 void SJME_JNI_METHOD(SJME_CLASS_NVM_BOOT_PARAM, _1_1setSuite)
73 (JNIEnv* env, jclass classy, jlong thisPtr, jlong funcsPtr)
75 sjme_nvm_bootParam* param;
77 if (thisPtr == 0)
79 sjme_jni_throwVMException(env, SJME_ERROR_NULL_ARGUMENTS);
80 return;
83 /* Get parameter data. */
84 param = SJME_JLONG_TO_POINTER(sjme_nvm_bootParam*, thisPtr);
86 /* Set suite information. */
87 param->bootSuite = SJME_JLONG_TO_POINTER(sjme_rom_suite, funcsPtr);
90 void SJME_JNI_METHOD(SJME_CLASS_NVM_BOOT_PARAM, _1_1setSysProps)
91 (JNIEnv* env, jclass classy, jlong thisPtr, jlong listPtr)
93 sjme_nvm_bootParam* param;
95 if (thisPtr == 0)
97 sjme_jni_throwVMException(env, SJME_ERROR_NULL_ARGUMENTS);
98 return;
101 /* Get parameter data. */
102 param = SJME_JLONG_TO_POINTER(sjme_nvm_bootParam*, thisPtr);
104 /* Set system property chain. */
105 param->sysProps = SJME_JLONG_TO_POINTER(sjme_list_sjme_lpcstr*, listPtr);