MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / java_processOFDResult

Function java_processOFDResult

src/android/Window_Android.c:390–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388static FileDialogCallback ofd_callback;
389static int ofd_action;
390static void JNICALL java_processOFDResult(JNIEnv* env, jobject o, jstring str) {
391 const char* raw;
392 char buffer[NATIVE_STR_LEN]; cc_string path;
393 String_InitArray(path, buffer);
394
395 // TODO should be raw
396 Java_DecodeString(env, str, &path);
397 ofd_callback(&path);
398
399 if (ofd_action == OFD_UPLOAD_DELETE) {
400 // TODO better way of doing this? msybe move to java side?
401 raw = (*env)->GetStringUTFChars(env, str, NULL);
402 unlink(raw);
403 (*env)->ReleaseStringUTFChars(env, str, raw);
404 }
405 ofd_callback = NULL;
406}
407
408cc_result Window_OpenFileDialog(const struct OpenFileDialogArgs* open_args) {
409 JNIEnv* env;

Callers

nothing calls this directly

Calls 1

Java_DecodeStringFunction · 0.85

Tested by

no test coverage detected