1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-19 11:33:51 +01:00
AnnsAnn 55fa531e02 examples: restructure to use subfolders based on README structure
examples: Fix incorrect category heading

examples: shorten coap folder name

static-tests/examples: check subfolders for entries

ci/test_native: Adjust to new examples structure

examples: adjust makefiles to new structure

ci/tests: Fix symlinks to point towards proper examples
2025-02-13 11:54:09 +01:00

45 lines
1.3 KiB
C

/*
* Copyright (C) 2020 TU Bergakademie Freiberg Karl Fessel
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
/*provide some test program*/
#include "blob/test.wasm.h"
#include "blob/hello.wasm.h"
bool iwasm_runtime_init(void);
void iwasm_runtime_destroy(void);
/* wamr_run is a very direct interpretation of "i like to have a wamr_run" */
int wamr_run(void *bytecode, size_t bytecode_len, int argc, char **argv);
/* wamr_run_cp creates a copy bytecode and argv
* if argc is 0 it is set to 1 and argv[0] is set to ""
* to create some space for a return value */
int wamr_run_cp(const void *bytecode, size_t bytecode_len, int argc, const char **argv);
#define telltruth(X) ((X) ? "true" : "false")
int main(void)
{
printf("iwasm_initilised: %s\n", telltruth(iwasm_runtime_init()));
int app_argc = 2;
const char *app_argv[] = {"test", "bob"};
int ret = wamr_run_cp(test_wasm, test_wasm_len, app_argc, app_argv);
printf("ret = %d\n", ret);
ret = wamr_run_cp(hello_wasm, hello_wasm_len, app_argc, app_argv);
printf("ret = %d\n", ret);
iwasm_runtime_destroy();
}