#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <daemon/func.h>
#include "wsjni.h"
#include "jvm.h"
JNIEXPORT void JNICALL Java_webserver_ModuleLoader_addMethod
(JNIEnv *e, jobject loader, jstring funcName, jint safindex)
{
const char *name = (*e)->GetStringUTFChars(e, funcName ,
NULL);
printf(
"addMethod: Name: {%s} index: %d\n", name, safindex);
FuncStruct func;
func.name = strdup(name);
func.func =
NULL;
func.func_exec = jvm_method_exec;
func.exec_data = (
void*)safindex;
printf(
"exec_data: %d\n", func.exec_data);
add_function(&func);
(*e)->ReleaseStringUTFChars(e, funcName, name);
}