]> rtime.felk.cvut.cz Git - orte.git/blob - orte/libjorte/JORTEDomainPropSet.c
Reformat the sources with orte/uncrustify script
[orte.git] / orte / libjorte / JORTEDomainPropSet.c
1 #include <string.h>
2 #include <stdlib.h>
3 #include "orte.h"
4 #include "jorte/4all.h"
5
6 #include "jorte/org_ocera_orte_types_DomainProp.h"
7
8 JNIEXPORT jboolean JNICALL
9 Java_org_ocera_orte_types_DomainProp_jORTEDomainPropSet
10 (
11   JNIEnv *env,
12   jobject obj,
13   jlong propshandle,         //ORTEDomainProp handle
14   jstring mgrs               //Managers
15 )
16 {
17   const char     *str = NULL;
18   //
19   int flag_ok = 0;
20
21   ORTEDomainProp *dp = NULL;
22
23     #ifdef TEST_STAGE
24   printf(":c: jORTEDomainPropSet() called.. \n");
25     #endif
26
27   do {
28     dp = (ORTEDomainProp *)propshandle;
29     if (dp == 0) {
30         #ifdef TEST_STAGE
31       printf(":!c: *dp = NULL \n");
32         #endif
33       break;
34     }
35
36     //call ReleaseStringUTFChars from destructor !!
37     str = (*env)->GetStringUTFChars(env, mgrs, 0);
38
39     //set managers
40     dp->mgrs = (char *)str;
41
42     flag_ok = 1;
43   } while (0);
44
45   if (flag_ok) {
46     return ORTE_TRUE;
47   }
48
49   return ORTE_FALSE;
50 }