X-Git-Url: https://rtime.felk.cvut.cz/gitweb/orte.git/blobdiff_plain/e80a6f5e0540d9e10ee957240e6f5b3faaa54021..44b53e7b789fa481a19db83e52cb3f15f0d90e85:/orte/libjorte/JORTEDomainPropSet.c diff --git a/orte/libjorte/JORTEDomainPropSet.c b/orte/libjorte/JORTEDomainPropSet.c index fe6abd8..f945932 100644 --- a/orte/libjorte/JORTEDomainPropSet.c +++ b/orte/libjorte/JORTEDomainPropSet.c @@ -5,45 +5,46 @@ #include "jorte/org_ocera_orte_types_DomainProp.h" - JNIEXPORT jboolean JNICALL Java_org_ocera_orte_types_DomainProp_jORTEDomainPropSet - ( - JNIEnv *env, - jobject obj, - jlong propshandle, //ORTEDomainProp handle - jstring mgrs //Managers - ) - { - const char *str = NULL; - // - int flag_ok = 0; - - ORTEDomainProp *dp = NULL; +JNIEXPORT jboolean JNICALL +Java_org_ocera_orte_types_DomainProp_jORTEDomainPropSet +( + JNIEnv *env, + jobject obj, + jlong propshandle, //ORTEDomainProp handle + jstring mgrs //Managers +) +{ + const char *str = NULL; + // + int flag_ok = 0; + + ORTEDomainProp *dp = NULL; #ifdef TEST_STAGE - printf(":c: jORTEDomainPropSet() called.. \n"); + printf(":c: jORTEDomainPropSet() called.. \n"); #endif - do { - dp = (ORTEDomainProp *) propshandle; - if(dp == 0) { - #ifdef TEST_STAGE - printf(":!c: *dp = NULL \n"); - #endif - break; - } - - //call ReleaseStringUTFChars from destructor !! - str = (*env)->GetStringUTFChars(env,mgrs,0); - - //set managers - dp->mgrs=(char *)str; - - flag_ok = 1; - } while (0); - - if(flag_ok) { - return ORTE_TRUE; + do { + dp = (ORTEDomainProp *)propshandle; + if (dp == 0) { + #ifdef TEST_STAGE + printf(":!c: *dp = NULL \n"); + #endif + break; } - return ORTE_FALSE; - } \ No newline at end of file + //call ReleaseStringUTFChars from destructor !! + str = (*env)->GetStringUTFChars(env, mgrs, 0); + + //set managers + dp->mgrs = (char *)str; + + flag_ok = 1; + } while (0); + + if (flag_ok) { + return ORTE_TRUE; + } + + return ORTE_FALSE; +}