// the library.
#define _CRAZY_PUBLIC __attribute__((__visibility__("default")))
+// Maximum path length of a file in a zip file.
+const size_t kMaxFilePathLengthInZip = 256;
+
// Status values returned by crazy linker functions to indicate
// success or failure. They were chosen to match boolean values,
// this allows one to test for failures with:
void** java_vm,
int* minimum_jni_version);
+// Set the flag whether the fallback due to lack of support for mapping the
+// APK file with executable permission is enabled.
+void crazy_context_set_no_map_exec_support_fallback_enabled(
+ crazy_context_t* context,
+ bool no_map_exec_support_fallback_enabled) _CRAZY_PUBLIC;
+
// Destroy a given context object.
void crazy_context_destroy(crazy_context_t* context) _CRAZY_PUBLIC;
void* address,
crazy_library_t** library) _CRAZY_PUBLIC;
+// Return the full path of |lib_name| in the zip file
+// (lib/<abi>/crazy.<lib_name>). The result is returned in
+// |buffer[0..buffer_size - 1]|. If |buffer_size| is too small,
+// CRAZY_STATUS_FAILURE is returned.
+crazy_status_t crazy_library_file_path_in_zip_file(const char* lib_name,
+ char* buffer,
+ size_t buffer_size)
+ _CRAZY_PUBLIC;
+
+// Check whether |lib_name| is page aligned and uncompressed in |zipfile_name|.
+crazy_status_t crazy_linker_check_library_is_mappable_in_zip_file(
+ const char* zipfile_name,
+ const char* lib_name) _CRAZY_PUBLIC;
+
// Close a library. This decrements its reference count. If it reaches
// zero, the library be unloaded from the process.
void crazy_library_close(crazy_library_t* library) _CRAZY_PUBLIC;