Move the whole bunch of nvm functions into their own header.
[SquirrelJME.git] / nanocoat / tests / src / tac.c
blob0c167ed19a01278408897ae8fdd8fa03b7675b2a
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 <string.h>
12 #include "sjme/boot.h"
13 #include "sjme/nvm.h"
14 #include "sjme/nvmFunc.h"
15 #include "sjme/payload.h"
16 #include "test.h"
18 int main(int argc, char** argv)
20 sjme_nvm_bootConfig bootConfig;
21 sjme_nvm_state* state;
22 sjme_jint exitCode;
24 /* Setup boot configuration. */
25 memset(&bootConfig, 0, sizeof(bootConfig));
26 bootConfig.payload = &sjme_static_payload_data;
28 /* Boot the virtual machine. */
29 state = NULL;
30 if (!sjme_nvm_boot(NULL, &bootConfig, &state, argc, argv))
31 return EXIT_FAILURE;
33 /* Constantly ticks the virtual machine until it stops. */
34 while (sjme_nvm_tick(state, -1))
37 /* Cleanup the virtual machine. */
38 exitCode = EXIT_FAILURE;
39 if (!sjme_nvm_destroy(state, &exitCode))
40 return EXIT_FAILURE;
42 return exitCode;