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