p≡p for Java
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
520 B

  1. #include "foundation_pEp_jniadapter_AndroidHelper.h"
  2. #include <stdlib.h>
  3. extern "C" {
  4. JNIEXPORT jint JNICALL Java_foundation_pEp_jniadapter_AndroidHelper_setenv
  5. (JNIEnv* env, jclass clazz, jstring key, jstring value, jboolean overwrite)
  6. {
  7. char* k = (char *) env->GetStringUTFChars(key, NULL);
  8. char* v = (char *) env->GetStringUTFChars(value, NULL);
  9. int err = setenv(k, v, overwrite);
  10. env->ReleaseStringUTFChars(key, k);
  11. env->ReleaseStringUTFChars(value, v);
  12. return err;
  13. }
  14. } // extern "C"