/* Context switching within the JVM. */
-/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include <functional>
#include <utility>
-extern "C" JavaVM* __java_vm;
+extern JavaVM* __java_vm;
XBT_LOG_NEW_DEFAULT_CATEGORY(java, "MSG for Java(TM)");
#endif
/* end of eclipse-mandated pimple */
-extern "C" {
-
int JAVA_HOST_LEVEL = -1;
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
{
sg_storage_file_system_init();
}
-} // extern "C"
/** Run a Java org.simgrid.msg.Process
*
/* Java bindings of the NetZones. */
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-extern "C" {
-
static jmethodID jas_method_As_constructor;
static jfieldID jas_field_As_bind;
}
return jtable;
}
-}
/* Java bindings to the Comm API */
-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2012-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-extern "C" {
-
static jfieldID jcomm_field_Comm_bind;
static jfieldID jcomm_field_Comm_finished;
static jfieldID jcomm_field_Comm_receiving;
xbt_dynar_free(&dyn);
return rank;
}
-}
/* Java bindings of the file API. */
-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2012-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "jmsg_file.h"
#include "jxbt_utilities.hpp"
-extern "C" {
-
void jfile_bind(JNIEnv *env, jobject jfile, msg_file_t fd) {
env->SetLongField(jfile, jfile_field_bind, reinterpret_cast<std::intptr_t>(fd));
}
MSG_file_close(file);
jfile_bind(env, jfile, nullptr);
}
-}
/* Functions related to the java host instances. */
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-extern "C" {
-
static jmethodID jhost_method_Host_constructor;
static jfieldID jhost_field_Host_bind;
static jfieldID jhost_field_Host_name;
msg_host_t host = jhost_get_native(env, jhost);
return MSG_host_get_power_peak_at(host, pstate);
}
-}
/* Functions related to the java process instances. */
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-extern "C" {
-
jfieldID jprocess_field_Process_bind;
jfieldID jprocess_field_Process_host;
jfieldID jprocess_field_Process_killTime;
JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls) {
return (jint) MSG_process_get_number();
}
-}
/* Java binding of the RngStream library */
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "jmsg_rngstream.h"
#include "jxbt_utilities.hpp"
-extern "C" {
-
jfieldID jrngstream_bind;
RngStream jrngstream_to_native(JNIEnv *env, jobject jrngstream) {
return (jint)RngStream_RandInt(rngstream, (int)i, (int)j);
}
-}
/* Java bindings of the Storage API. */
-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2012-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-extern "C" {
-
static jmethodID jstorage_method_Storage_constructor;
static jfieldID jstorage_field_Storage_bind;
static jfieldID jstorage_field_Storage_name;
xbt_dynar_free(&table);
return jtable;
}
-}
/* Java bindings of the Synchronization API. */
-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2012-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-extern "C" {
-
static jfieldID jsynchro_field_Mutex_bind;
JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_nativeInit(JNIEnv *env, jclass cls) {
sem = (msg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
MSG_sem_destroy(sem);
}
-}
/* Functions related to the java task instances. */
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-extern "C" {
-
static jmethodID jtask_method_Comm_constructor;
static jfieldID jtask_field_Task_bind;
return (jint) rv;
}
-}
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-extern "C" {
-
extern int JAVA_HOST_LEVEL;
static jfieldID jvm_field_bind;
return static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
}
-}
/* Java bindings of the Trace API. */
-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2012-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
// Define a new category
XBT_LOG_NEW_DEFAULT_CATEGORY (jtrace, "TRACE for Java(TM)");
-extern "C" {
-
JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostStateDeclare(JNIEnv * env, jclass cls, jstring js)
{
const char *s = env->GetStringUTFChars(js, 0);
JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSubWithTime(JNIEnv *env, jclass cls, jdouble,
jstring, jstring, jstring, jdouble)
*/
-}
/* Various JNI helper functions */
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include <cstdlib> /* abort */
-extern "C" {
-
jclass jxbt_get_class(JNIEnv * env, const char *name)
{
jclass cls = env->FindClass(name);
{
jxbt_throw_by_name(env, "org/simgrid/msg/TaskCancelledException", details);
}
-}
-/* Copyright (c) 2010-2017. The SimGrid Team.
+/* Copyright (c) 2010-2018. The SimGrid Team.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
*
*/
/* SimGrid Lua debug functions */
-extern "C" {
#include <lauxlib.h>
-}
#include "lua_utils.hpp"
#include "xbt.h"
-/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "lua_private.hpp"
#include "simgrid/s4u/Host.hpp"
-extern "C" {
#include <lauxlib.h>
-}
XBT_LOG_NEW_DEFAULT_CATEGORY(lua_host, "Lua Host module");
#include <cctype>
#include <cstring>
-extern "C" {
#include <lauxlib.h>
-}
#include "src/surf/surf_private.hpp"
#include <boost/algorithm/string/classification.hpp>
XBT_LOG_NEW_DEFAULT_CATEGORY(lua, "Lua Bindings");
-extern "C" {
#include <lauxlib.h>
-int luaopen_simgrid(lua_State *L);
-}
+extern "C" int luaopen_simgrid(lua_State* L);
/* ********************************************************************************* */
/* simgrid API */