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