void classreg(JNIEnv* env, const char* name, jclass* mem, jmp_buf err_buf) { jobject local = (*env)->FindClass(env, name); CHECKEX(env, err_buf); if (local == 0) { fprintf(stderr, "\ncould not init class (%s)\n", name); engine_abort(); } *mem = (*env)->NewGlobalRef(env, local); CHECKEX(env, err_buf); (*env)->DeleteLocalRef(env, local); CHECKEX(env, err_buf); if (!(*mem)) longjmp(err_buf, 1); }
static void engine_directfb_quit(void) { DFBCHECK(_input_event->Release(_input_event)); DFBCHECK(_window_event->Release(_window_event)); DFBCHECK(_dfb_surface->Release(_dfb_surface)); DFBCHECK(_dfb_window->Release(_dfb_window)); DFBCHECK(_layer->Release(_layer)); DFBCHECK(_dfb->Release(_dfb)); evas_engine_info_set(evas, NULL); engine_abort(); }
static void setup_closures() { if (!FFI_CLOSURES) { fprintf(stderr, "\nFFI_CLOSURES are not supported on this architecture (libffi)\n"); engine_abort(); } // ffi function args f_args[0] = &ffi_type_pointer; // prepare caller interface if (ffi_prep_cif(&func_cif, FFI_DEFAULT_ABI, 1, &ffi_type_sint, f_args) != FFI_OK) { abort_ffi(); } // args for hook function h_args[0] = &ffi_type_pointer; h_args[1] = &ffi_type_pointer; if (ffi_prep_cif(&hook_cif, FFI_DEFAULT_ABI, 2, &ffi_type_void, h_args) != FFI_OK) { abort_ffi(); } }
static inline void abort_ffi_prep() { fprintf(stderr, "\nfailed to prepare ffi closure\n"); engine_abort(); }
static inline void abort_ffi_alloc() { fprintf(stderr, "\nfailed to allocate ffi closure\n"); engine_abort(); }
static inline void abort_ffi() { fprintf(stderr, "\nfailed to prepare ffi caller interface for C function wrappers\n"); engine_abort(); }