2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-10-20 17:44:03 -07:00
|
|
|
|
|
|
|
#ifndef APKOpen_h
|
|
|
|
#define APKOpen_h
|
|
|
|
|
2012-03-08 10:25:44 -08:00
|
|
|
#include <jni.h>
|
|
|
|
|
2011-09-28 21:39:03 -07:00
|
|
|
#ifndef NS_EXPORT
|
|
|
|
#define NS_EXPORT __attribute__ ((visibility("default")))
|
|
|
|
#endif
|
|
|
|
|
2010-10-20 17:44:03 -07:00
|
|
|
struct mapping_info {
|
|
|
|
char * name;
|
|
|
|
char * file_id;
|
|
|
|
uintptr_t base;
|
|
|
|
size_t len;
|
|
|
|
size_t offset;
|
|
|
|
};
|
|
|
|
|
2010-10-29 12:22:28 -07:00
|
|
|
const struct mapping_info * getLibraryMapping();
|
|
|
|
|
2012-03-08 10:25:44 -08:00
|
|
|
static const int SUCCESS = 0;
|
|
|
|
static const int FAILURE = 1;
|
|
|
|
void JNI_Throw(JNIEnv* jenv, const char* classname, const char* msg);
|
|
|
|
|
2010-10-29 12:22:28 -07:00
|
|
|
#define MAX_LIB_CACHE_ENTRIES 32
|
|
|
|
#define MAX_LIB_CACHE_NAME_LEN 32
|
|
|
|
|
|
|
|
struct lib_cache_info {
|
|
|
|
char name[MAX_LIB_CACHE_NAME_LEN];
|
|
|
|
int fd;
|
2011-01-19 14:32:58 -08:00
|
|
|
uint32_t lib_size;
|
|
|
|
void* buffer;
|
2010-10-29 12:22:28 -07:00
|
|
|
};
|
|
|
|
|
2011-09-28 21:39:03 -07:00
|
|
|
NS_EXPORT const struct lib_cache_info * getLibraryCache();
|
2010-10-20 17:44:03 -07:00
|
|
|
|
2012-03-08 10:25:44 -08:00
|
|
|
|
2010-10-20 17:44:03 -07:00
|
|
|
#endif /* APKOpen_h */
|