Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
adapt to lastest cleanups in the core library
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 27 Apr 2012 21:02:30 +0000 (23:02 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 27 Apr 2012 21:02:30 +0000 (23:02 +0200)
src/jmsg.c
src/jmsg_host.c
src/jmsg_host.h
src/jmsg_process.h
src/smx_context_java.c
src/smx_context_java.h

index 323d3aa..e956efc 100644 (file)
@@ -7,7 +7,7 @@
   * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <msg/msg.h>
-#include <simix/context.h>
+#include <simgrid/simix.h>
 #include <surf/surfxml_parse.h>
 
 #include "smx_context_java.h"
@@ -354,7 +354,7 @@ Java_org_simgrid_msg_MsgNative_hostGetByName(JNIEnv * env, jclass cls,
   XBT_DEBUG("Looking for host '%s'",name);
   /* get the host by name       (the hosts are created during the grid resolution) */
   host = MSG_get_host_by_name(name);
-  XBT_DEBUG("MSG gave %p as native host (simdata=%p)", host,host? host->simdata:NULL);
+  XBT_DEBUG("MSG gave %p as native host (smx_host=%p)", host,host? host->smx_host:NULL);
 
   if (!host) {                  /* invalid name */
     jxbt_throw_host_not_found(env, name);
@@ -849,7 +849,7 @@ JNIEXPORT void JNICALL
   /* Cleanup java hosts */
   hosts = MSG_hosts_as_dynar();
   for (index = 0; index < xbt_dynar_length(hosts) - 1; index++) {
-    jhost = (jobject) xbt_dynar_get_as(hosts,index,m_host_t)->data;
+    jhost = (jobject) MSG_host_get_data(xbt_dynar_get_as(hosts,index,m_host_t));
     if (jhost)
       jhost_unref(env, jhost);
 
index 04402bc..7185b20 100644 (file)
@@ -56,21 +56,7 @@ m_host_t jhost_get_native(JNIEnv * env, jobject jhost)
 const char *jhost_get_name(jobject jhost, JNIEnv * env)
 {
   m_host_t host = jhost_get_native(env, jhost);
-  return (const char *) host->name;
-}
-
-void jhost_set_name(jobject jhost, jstring jname, JNIEnv * env)
-{
-  const char *name;
-  m_host_t host = jhost_get_native(env, jhost);
-
-  name = (*env)->GetStringUTFChars(env, jname, 0);
-
-  if (host->name)
-    free(host->name);
-
-  host->name = xbt_strdup(name);
-  (*env)->ReleaseStringUTFChars(env, jname, name);
+  return MSG_host_get_name(host);
 }
 
 jboolean jhost_is_valid(jobject jhost, JNIEnv * env)
index 1f40c13..4434b16 100644 (file)
@@ -85,16 +85,6 @@ m_host_t jhost_get_native(JNIEnv * env, jobject jhost);
  */
 const char *jhost_get_name(jobject jhost, JNIEnv * env);
 
-
-/**
- * This function sets the name of a MSG        host.
- *
- * @param host                 The host concerned by the operation.
- * @param jname                        The new name of the host.
- * @param env                  The environment of the current thread
- */
-void jhost_set_name(jobject jhost, jstring jname, JNIEnv * env);
-
 /**
  * This function tests if a java host instance is valid.
  * A java host object is valid if it is bind to a native host.
index 8d3862a..101c248 100644 (file)
@@ -10,8 +10,8 @@
 #define MSG_JPROCESS_H
 
 #include <jni.h>
-#include "msg/msg.h"
-#include "simix/simix.h"
+#include <msg/msg.h>
+#include <simgrid/simix.h>
 
 /**
  * This function returns a global reference to the  java process instance 
index c91e1d9..647b34e 100644 (file)
@@ -8,7 +8,7 @@
 
 
 #include <xbt/function_types.h>
-#include <simix/simix.h>
+#include <simgrid/simix.h>
 #include "smx_context_java.h"
 #include "xbt/dynar.h"
 
index b970fe0..c95f15b 100644 (file)
@@ -8,7 +8,7 @@
 #define _XBT_CONTEXT_JAVA_H
 
 #include <xbt/misc.h>
-#include <simix/context.h>
+#include <simgrid/simix.h>
 #include "jmsg.h"
 #include "jmsg_process.h"