]> rtime.felk.cvut.cz Git - orte.git/blob - orte/libjorte/JIPAddressToString.c
Reformat the sources with orte/uncrustify script
[orte.git] / orte / libjorte / JIPAddressToString.c
1 /* IPAdressToString.c */
2 /**
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')
7   *
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
12   * @version 0.1
13   *
14   *
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.
19   *
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.
24   *
25   */
26
27
28 // origin orte headers
29 #include "orte.h"
30 // pregenerated header
31 #include "jorte/org_ocera_orte_tools_Conversions.h"
32
33
34
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)
39 {
40   char             buff[16];
41   IPAddress        ip;
42
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));
49 }