A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git]
/
src
/
bindings
/
java
/
jmsg_file.cpp
diff --git
a/src/bindings/java/jmsg_file.cpp
b/src/bindings/java/jmsg_file.cpp
index
c716c99
..
9f60fc3
100644
(file)
--- a/
src/bindings/java/jmsg_file.cpp
+++ b/
src/bindings/java/jmsg_file.cpp
@@
-20,14
+20,14
@@
msg_file_t jfile_get_native(JNIEnv *env, jobject jfile) {
JNIEXPORT void JNICALL Java_org_simgrid_msg_File_nativeInit(JNIEnv *env, jclass cls) {
jclass class_File = env->FindClass("org/simgrid/msg/File");
jfile_field_bind = jxbt_get_jfield(env , class_File, "bind", "J");
JNIEXPORT void JNICALL Java_org_simgrid_msg_File_nativeInit(JNIEnv *env, jclass cls) {
jclass class_File = env->FindClass("org/simgrid/msg/File");
jfile_field_bind = jxbt_get_jfield(env , class_File, "bind", "J");
- xbt_assert((jfile_field_bind !=
NULL
), "Can't find \"bind\" field in File class.");
+ xbt_assert((jfile_field_bind !=
nullptr
), "Can't find \"bind\" field in File class.");
}
JNIEXPORT void JNICALL Java_org_simgrid_msg_File_open(JNIEnv *env, jobject jfile, jobject jpath) {
const char *path = env->GetStringUTFChars((jstring) jpath, 0);
msg_file_t file;
}
JNIEXPORT void JNICALL Java_org_simgrid_msg_File_open(JNIEnv *env, jobject jfile, jobject jpath) {
const char *path = env->GetStringUTFChars((jstring) jpath, 0);
msg_file_t file;
- file = MSG_file_open(path,
NULL
);
+ file = MSG_file_open(path,
nullptr
);
jfile_bind(env, jfile, file);
env->ReleaseStringUTFChars((jstring) jpath, path);
jfile_bind(env, jfile, file);
env->ReleaseStringUTFChars((jstring) jpath, path);
@@
-43,9
+43,14
@@
JNIEXPORT jlong JNICALL Java_org_simgrid_msg_File_write(JNIEnv *env, jobject jfi
return (jlong)MSG_file_write(file, (sg_size_t)jsize);
}
return (jlong)MSG_file_write(file, (sg_size_t)jsize);
}
+JNIEXPORT void JNICALL Java_org_simgrid_msg_File_seek(JNIEnv *env, jobject jfile, jlong offset, jlong origin) {
+ msg_file_t file = jfile_get_native(env, jfile);
+ MSG_file_seek(file, (sg_offset_t)offset, (int) origin);
+}
+
JNIEXPORT void JNICALL Java_org_simgrid_msg_File_close(JNIEnv *env, jobject jfile) {
msg_file_t file = jfile_get_native(env, jfile);
MSG_file_close(file);
JNIEXPORT void JNICALL Java_org_simgrid_msg_File_close(JNIEnv *env, jobject jfile) {
msg_file_t file = jfile_get_native(env, jfile);
MSG_file_close(file);
- jfile_bind(env, jfile,
NULL
);
+ jfile_bind(env, jfile,
nullptr
);
}
}