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