#include <assert.h>
#include <unistd.h>
+/********* exported symbols *********/
+
+void
+Java_net_dot_MonoRunner_setEnv (JNIEnv* env, jobject thiz, jstring j_key, jstring j_value);
+
+int
+Java_net_dot_MonoRunner_initRuntime (JNIEnv* env, jobject thiz, jstring j_files_dir, jstring j_cache_dir, jstring j_testresults_dir, jstring j_entryPointLibName, jobjectArray j_args, long current_local_time);
+
+/********* imported symbols *********/
+void SayHello ();
+
+/********* implementation *********/
+
static void
strncpy_str (JNIEnv *env, char *buff, jstring str, int nbuff)
{
(*env)->ReleaseStringUTFChars (env, str, copy_buff);
}
-void SayHello ();
-
-int invoke_netlibrary_entrypoints (void)
+static int
+invoke_netlibrary_entrypoints (void)
{
SayHello ();
#include <mono/utils/mono-publib.h>
#include <mono/utils/mono-logger.h>
+#include <mono/metadata/appdomain.h>
#include <mono/metadata/assembly.h>
+#include <mono/metadata/class.h>
#include <mono/metadata/mono-debug.h>
#include <mono/metadata/mono-gc.h>
#include <mono/metadata/exception.h>
+#include <mono/metadata/object.h>
#include <mono/jit/jit.h>
#include <mono/jit/mono-private-unstable.h>
#include <assert.h>
#include <unistd.h>
+/********* exported symbols *********/
+
+/* JNI exports */
+
+void
+Java_net_dot_MonoRunner_setEnv (JNIEnv* env, jobject thiz, jstring j_key, jstring j_value);
+
+int
+Java_net_dot_MonoRunner_initRuntime (JNIEnv* env, jobject thiz, jstring j_files_dir, jstring j_cache_dir, jstring j_testresults_dir, jstring j_entryPointLibName, jobjectArray j_args, long current_local_time);
+
+// called from C#
+void
+invoke_external_native_api (void (*callback)(void));
+
+/********* implementation *********/
+
static char *bundle_path;
static char *executable;
munmap (handle, size);
}
-char *
+static char *
strdup_printf (const char *msg, ...)
{
va_list args;
return str ? mono_string_to_utf8 (str) : NULL;
}
-void
+static void
unhandled_exception_handler (MonoObject *exc, void *user_data)
{
MonoClass *type = mono_object_get_class (exc);
exit (1);
}
-void
+static void
log_callback (const char *log_domain, const char *log_level, const char *message, mono_bool fatal, void *user_data)
{
LOG_INFO ("(%s %s) %s", log_domain, log_level, message);
void register_aot_modules (void);
#endif
-void
+static void
cleanup_runtime_config (MonovmRuntimeConfigArguments *args, void *user_data)
{
free (args);
free (user_data);
}
-int
+static int
mono_droid_runtime_init (const char* executable, int managed_argc, char* managed_argv[], int local_date_time_offset)
{
// NOTE: these options can be set via command line args for adb or xharness, see AndroidSampleApp.csproj