]> rtime.felk.cvut.cz Git - orte.git/blobdiff - orte/libjorte/createAppInfo.c
JORTE: update license headers and clean-up includes
[orte.git] / orte / libjorte / createAppInfo.c
index 87a3652f84a5846387e281e590cb0547585ec2e9..efc8b6b4466fc71136af5fc5d2694c276f6a0aad 100644 (file)
@@ -1,10 +1,32 @@
 /* createAppInfo.c  */
 
-#include <jni.h>
-#include "orte.h"
-#include "jorte/4all.h"
-#include "jorte/jorte_protos_api.h"
-#include <inttypes.h>
+/**
+  * This code provides conversion between JAVA a C environments.
+  * The C functions are calling here and results are send to JAVA
+  * native functions. It uses the header pregenerated by JAVA
+  * (by command 'javah -jni class_with_native_function')
+  *
+  * @author Lukas Pokorny (lukas_pokorny@centrum.cz)
+  * @author Martin Vajnar (martin.vajnar@gmail.com)
+  * @author CTU FEE Prague - Department of Control Engineering (dce.felk.cvut.cz)
+  * @author Project ORTE - OCERA Real Time Ethernet (www.ocera.org)
+  * @author dedication to Kj
+  * @version 0.1
+  *
+  *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License as published by
+  * the Free Software Foundation; either version 2 of the License, or
+  * (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  * GNU General Public License for more details.
+  *
+  */
+
+#include "jorte/jorte.h"
 
 jobject createAppInfo(JNIEnv *env, const ORTEAppInfo *ainfo)
 {
@@ -56,7 +78,7 @@ jobject createAppInfo(JNIEnv *env, const ORTEAppInfo *ainfo)
       break;
     }
     #ifdef TEST_STAGE
-       printf(":c: ainfo.hostId = %d \n",ainfo->hostId);
+       printf(":c: ainfo.hostId = %#"PRIx32" \n",ainfo->hostId);
     #endif
     (*env)->SetLongField(env,
                          obj,
@@ -73,7 +95,7 @@ jobject createAppInfo(JNIEnv *env, const ORTEAppInfo *ainfo)
       break;
     }
     #ifdef TEST_STAGE
-       printf(":c: ainfo.appId = %d \n",ainfo->appId);
+       printf(":c: ainfo.appId = %#"PRIx32" \n",ainfo->appId);
     #endif
     (*env)->SetLongField(env,
                          obj,
@@ -89,7 +111,7 @@ jobject createAppInfo(JNIEnv *env, const ORTEAppInfo *ainfo)
       break;
     }
     #ifdef TEST_STAGE
-       printf(":c: ainfo.unicastIPAddressList = %"PRIoPTR"\n",(intptr_t)ainfo->unicastIPAddressList);
+       printf(":c: ainfo.unicastIPAddressList = %#"PRIxPTR"\n",(intptr_t)ainfo->unicastIPAddressList);
     #endif
     (*env)->SetLongField(env,
                          obj,
@@ -105,7 +127,7 @@ jobject createAppInfo(JNIEnv *env, const ORTEAppInfo *ainfo)
       break;
     }
     #ifdef TEST_STAGE
-       printf(":c: ainfo.unicastIPcount = %d \n",
+       printf(":c: ainfo.unicastIPcount = %hhu \n",
               ainfo->unicastIPAddressCount);
     #endif
     (*env)->SetByteField(env,
@@ -122,7 +144,7 @@ jobject createAppInfo(JNIEnv *env, const ORTEAppInfo *ainfo)
       break;
     }
     #ifdef TEST_STAGE
-       printf(":c: ainfo.multicastIPAddressList = %"PRIoPTR"\n",
+       printf(":c: ainfo.multicastIPAddressList = %#"PRIxPTR"\n",
               (intptr_t)ainfo->metatrafficMulticastIPAddressList);
     #endif
     (*env)->SetLongField(env,
@@ -139,7 +161,7 @@ jobject createAppInfo(JNIEnv *env, const ORTEAppInfo *ainfo)
       break;
     }
     #ifdef TEST_STAGE
-       printf(":c: ainfo.metatrafficMulticastIPAddressCount = %d \n",
+       printf(":c: ainfo.metatrafficMulticastIPAddressCount = %hhu \n",
               ainfo->metatrafficMulticastIPAddressCount);
     #endif
     (*env)->SetByteField(env,
@@ -157,7 +179,7 @@ jobject createAppInfo(JNIEnv *env, const ORTEAppInfo *ainfo)
       break;
     }
     #ifdef TEST_STAGE
-       printf(":c: ainfo.metatrafficUnicastPort = %d \n",
+       printf(":c: ainfo.metatrafficUnicastPort = %"PRIu32" \n",
               ainfo->metatrafficUnicastPort);
     #endif
     (*env)->SetLongField(env,
@@ -175,7 +197,7 @@ jobject createAppInfo(JNIEnv *env, const ORTEAppInfo *ainfo)
       break;
     }
     #ifdef TEST_STAGE
-       printf(":c: ainfo.userdataUnicastPort = %d \n",
+       printf(":c: ainfo.userdataUnicastPort = %"PRIu32" \n",
               ainfo->userdataUnicastPort);
     #endif
     (*env)->SetLongField(env,
@@ -230,7 +252,7 @@ jobject createAppInfo(JNIEnv *env, const ORTEAppInfo *ainfo)
       break;
     }
     #ifdef TEST_STAGE
-       printf(":c: ainfo.vendorId: major = %d, minor = %d \n",
+       printf(":c: ainfo.vendorId: major = %"PRId8", minor = %"PRId8" \n",
               ainfo->vendorId.major, ainfo->vendorId.minor);
     #endif
     (*env)->SetObjectField(env,
@@ -285,7 +307,7 @@ jobject createAppInfo(JNIEnv *env, const ORTEAppInfo *ainfo)
       break;
     }
     #ifdef TEST_STAGE
-       printf(":c: ainfo.protocolVersion: major = %d, minor = %d \n",
+       printf(":c: ainfo.protocolVersion: major = %"PRId8", minor = %"PRId8" \n",
               ainfo->protocolVersion.major, ainfo->protocolVersion.minor);
     #endif
     (*env)->SetObjectField(env,