Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
9b205986b3679d6515bbba53988ccb74c9a21db2
[simgrid.git] / src / bindings / java / jmsg_file.h
1 /* Java bindings of the file API.                                           */
2
3 /* Copyright (c) 2012-2015. The SimGrid Team. All rights reserved.          */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef MSG_JFILE_H
9 #define MSG_JFILE_H
10
11 #include "simgrid/msg.h"
12 #include "simgrid/plugins/file_system.h"
13 #include <jni.h>
14
15 SG_BEGIN_DECL()
16
17 /* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
18 #ifndef JNIEXPORT
19 #define JNIEXPORT
20 #endif
21 #ifndef JNICALL
22 #define JNICALL
23 #endif
24 /* end of eclipse-mandated pimple */
25
26 jfieldID jfile_field_bind;
27
28 void jfile_bind(JNIEnv *env, jobject jfile, msg_file_t fd);
29 msg_file_t jfile_get_native(JNIEnv *env, jobject jfile);
30
31 JNIEXPORT void JNICALL Java_org_simgrid_msg_File_nativeInit(JNIEnv *env, jclass cls);
32 JNIEXPORT void JNICALL Java_org_simgrid_msg_File_open(JNIEnv *env, jobject jfile, jobject jpath);
33 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_File_read(JNIEnv *env, jobject jfile, jlong jsize);
34 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_File_write(JNIEnv *env, jobject jfile, jlong jsize);
35 JNIEXPORT void JNICALL Java_org_simgrid_msg_File_seek(JNIEnv *env, jobject jfile, jlong joffset, jlong jorigin);
36 JNIEXPORT void JNICALL Java_org_simgrid_msg_File_close(JNIEnv *env, jobject jfile);
37
38 SG_END_DECL()
39 #endif