2012-05-21 15:12:37 +04: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-21 04:44:03 +04:00
|
|
|
|
|
|
|
#ifndef APKOpen_h
|
|
|
|
#define APKOpen_h
|
|
|
|
|
2012-03-08 22:25:44 +04:00
|
|
|
#include <jni.h>
|
2016-08-13 06:15:52 +03:00
|
|
|
#include <pthread.h>
|
2012-03-08 22:25:44 +04:00
|
|
|
|
2011-09-29 08:39:03 +04:00
|
|
|
#ifndef NS_EXPORT
|
|
|
|
#define NS_EXPORT __attribute__ ((visibility("default")))
|
|
|
|
#endif
|
|
|
|
|
2010-10-21 04:44:03 +04:00
|
|
|
struct mapping_info {
|
|
|
|
char * name;
|
|
|
|
uintptr_t base;
|
|
|
|
size_t len;
|
|
|
|
size_t offset;
|
|
|
|
};
|
|
|
|
|
2014-05-06 09:26:46 +04:00
|
|
|
NS_EXPORT const struct mapping_info * getLibraryMapping();
|
2014-09-24 22:12:54 +04:00
|
|
|
NS_EXPORT void abortThroughJava(const char* msg);
|
2016-08-13 06:15:52 +03:00
|
|
|
NS_EXPORT pthread_t getJavaUiThread();
|
2010-10-29 23:22:28 +04:00
|
|
|
|
2012-03-08 22:25:44 +04:00
|
|
|
static const int SUCCESS = 0;
|
|
|
|
static const int FAILURE = 1;
|
|
|
|
void JNI_Throw(JNIEnv* jenv, const char* classname, const char* msg);
|
|
|
|
|
2015-10-21 15:27:00 +03:00
|
|
|
// Bug 1207642 - Work around Dalvik bug by realigning stack on JNI entry
|
|
|
|
#ifndef MOZ_JNICALL
|
|
|
|
# ifdef __i386__
|
|
|
|
# define MOZ_JNICALL JNICALL __attribute__((force_align_arg_pointer))
|
|
|
|
# else
|
|
|
|
# define MOZ_JNICALL JNICALL
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2010-10-21 04:44:03 +04:00
|
|
|
#endif /* APKOpen_h */
|