1 /* IPAdressToString.c */
3 * This code provides conversion between JAVA a C environments.
4 * The C functions are calling here and results are send to JAVA
5 * native functions. It uses the header pregenerated by JAVA
6 * (by command 'javah -jni class_with_native_function')
8 * @author Lukas Pokorny (lukas_pokorny@centrum.cz)
9 * @author CTU FEE Prague - Department of Control Engineering (dce.felk.cvut.cz)
10 * @author Project ORTE - OCERA Real Time Ethernet (www.ocera.org)
11 * @author dedication to Kj
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
28 // origin orte headers
30 // pregenerated header
31 #include "jorte/org_ocera_orte_tools_Conversions.h"
35 /* native function - prototype declared in pregenerated header */
36 JNIEXPORT jstring JNICALL
37 Java_org_ocera_orte_tools_JORTEConversions_IPAddressToString
38 (JNIEnv *env, jclass class, jlong long_ipAddr)
43 // conversion between data types
44 ip = (IPAddress) long_ipAddr;
45 // call the original liborte function
46 IPAddressToString(ip, buff);
47 // send the result to JAVA Environment
48 return((*env)->NewStringUTF(env, buff));