Ejemplo n.º 1
0
void __stdcall ServiceMain(int argc, char **argv) {
  ServiceHandle = RegisterServiceCtrlHandler(service, (void (__stdcall *)(unsigned long))ServiceControl);
  ServiceStatus(SERVICE_RUNNING);
  CreateJVM();
  InvokeMethod("serviceStart", ConvertStringArray(g_env, argc, argv), "([Ljava/lang/String;)V");
  (*g_jvm)->DestroyJavaVM(g_jvm);
}
Ejemplo n.º 2
0
/** Invokes the main method in a new thread. */
int JavaStart(void *ignore) {
  CreateJVM();

  char **argv = g_argv;
  int argc = g_argc;
  //skip argv[0]
  argv++;
  argc--;
  InvokeMethod(method, ExpandStringArray(g_env, ConvertStringArray(g_env, argc, argv)), "([Ljava/lang/String;)V");

  (*g_jvm)->DestroyJavaVM(g_jvm);  //waits till all threads are complete

  return 1;
}
Ejemplo n.º 3
0
// Convert an IR constant to an LLVM constant.
llvm::Constant* 
CgConst::Convert(const IRConst* constant) const
{
    if (const IRNumConst* c = UtCast<const IRNumConst*>(constant))
        return ConvertNumData(c->GetData(), c->GetType());
    if (const IRNumArrayConst* c = UtCast<const IRNumArrayConst*>(constant))
        return ConvertNumArray(c);
    if (const IRStringConst* c = UtCast<const IRStringConst*>(constant))
        return ConvertStringData(c->Get());
    if (const IRStringArrayConst* c =
        UtCast<const IRStringArrayConst*>(constant))
        return ConvertStringArray(c);
    assert(false && "Unimplemented kind of constant");
    return NULL;
}