@@ -116,8 +116,7 @@ Java_org_kiwix_libzim_Archive_dispose(JNIEnv* env, jobject thisObj)
116116}
117117
118118#define THIS GET_PTR (zim::Archive)
119- #define GETTER (retType, name ) JNIEXPORT retType JNICALL \
120- Java_org_kiwix_libzim_Archive_##name (JNIEnv* env, jobject thisObj) \
119+ #define GETTER (retType, name ) METHOD0(retType, libzim_Archive, name) \
121120{ \
122121 return TO_JNI (THIS->name ()); \
123122}
@@ -130,87 +129,87 @@ GETTER(jint, getEntryCount)
130129GETTER(jint, getArticleCount)
131130GETTER(jint, getMediaCount)
132131
133- METHOD0(jstring, Archive , getUuid) {
132+ METHOD0(jstring, libzim_Archive , getUuid) {
134133 return TO_JNI (std::string (THIS->getUuid ()));
135134}
136135
137- METHOD (jstring, Archive , getMetadata, jstring name) {
136+ METHOD (jstring, libzim_Archive , getMetadata, jstring name) {
138137 return TO_JNI (THIS->getMetadata (TO_C (name)));
139138}
140139
141- METHOD (jobject, Archive , getMetadataItem, jstring name) {
140+ METHOD (jobject, libzim_Archive , getMetadataItem, jstring name) {
142141 auto obj = NEW_OBJECT (" org/kiwix/libzim/Item" );
143142 SET_HANDLE (zim::Item, obj, THIS->getMetadataItem (TO_C (name)));
144143 return obj;
145144}
146145
147146GETTER (jobjectArray, getMetadataKeys)
148147
149- METHOD(jobject, Archive , getIllustrationItem, jint size) {
148+ METHOD(jobject, libzim_Archive , getIllustrationItem, jint size) {
150149 auto obj = NEW_OBJECT (" org/kiwix/libzim/Item" );
151150 SET_HANDLE (zim::Item, obj, THIS->getIllustrationItem (TO_C (size)));
152151 return obj;
153152}
154153
155- METHOD (jboolean, Archive , hasIllustration, jint size) {
154+ METHOD (jboolean, libzim_Archive , hasIllustration, jint size) {
156155 return TO_JNI (THIS->hasIllustration (TO_C (size)));
157156}
158157
159158GETTER (jlongArray, getIllustrationSizes)
160159
161- METHOD(jobject, Archive , getEntryByPath, jlong index) {
160+ METHOD(jobject, libzim_Archive , getEntryByPath, jlong index) {
162161 auto obj = NEW_OBJECT (" org/kiwix/libzim/Entry" );
163162 SET_HANDLE (zim::Entry, obj, THIS->getEntryByPath (TO_C (index)));
164163 return obj;
165164}
166165
167- METHOD (jobject, Archive , getEntryByPath, jstring path) {
166+ METHOD (jobject, libzim_Archive , getEntryByPath, jstring path) {
168167 auto obj = NEW_OBJECT (" org/kiwix/libzim/Entry" );
169168 SET_HANDLE (zim::Entry, obj, THIS->getEntryByPath (TO_C (path)));
170169 return obj;
171170}
172171
173- METHOD (jobject, Archive , getEntryByTitle, jlong index) {
172+ METHOD (jobject, libzim_Archive , getEntryByTitle, jlong index) {
174173 auto obj = NEW_OBJECT (" org/kiwix/libzim/Entry" );
175174 SET_HANDLE (zim::Entry, obj, THIS->getEntryByTitle (TO_C (index)));
176175 return obj;
177176}
178177
179- METHOD (jobject, Archive , getEntryByTitle, jstring title) {
178+ METHOD (jobject, libzim_Archive , getEntryByTitle, jstring title) {
180179 auto obj = NEW_OBJECT (" org/kiwix/libzim/Entry" );
181180 SET_HANDLE (zim::Entry, obj, THIS->getEntryByTitle (TO_C (title)));
182181 return obj;
183182}
184183
185- METHOD (jobject, Archive , getEntryByClusterOrder, jlong index) {
184+ METHOD (jobject, libzim_Archive , getEntryByClusterOrder, jlong index) {
186185 auto obj = NEW_OBJECT (" org/kiwix/libzim/Entry" );
187186 SET_HANDLE (zim::Entry, obj, THIS->getEntryByClusterOrder (TO_C (index)));
188187 return obj;
189188}
190189
191- METHOD0 (jobject, Archive , getMainEntry) {
190+ METHOD0 (jobject, libzim_Archive , getMainEntry) {
192191 auto obj = NEW_OBJECT (" org/kiwix/libzim/Entry" );
193192 SET_HANDLE (zim::Entry, obj, THIS->getMainEntry ());
194193 return obj;
195194}
196195
197- METHOD0 (jobject, Archive , getRandomEntry) {
196+ METHOD0 (jobject, libzim_Archive , getRandomEntry) {
198197 auto obj = NEW_OBJECT (" org/kiwix/libzim/Entry" );
199198 SET_HANDLE (zim::Entry, obj, THIS->getRandomEntry ());
200199 return obj;
201200}
202201
203- METHOD (jboolean, Archive , hasEntryByPath, jstring path) {
202+ METHOD (jboolean, libzim_Archive , hasEntryByPath, jstring path) {
204203 return TO_JNI (THIS->hasEntryByPath (TO_C (path)));
205204}
206205
207- METHOD (jboolean, Archive , hasEntryByTitle, jstring title) {
206+ METHOD (jboolean, libzim_Archive , hasEntryByTitle, jstring title) {
208207 return TO_JNI (THIS->hasEntryByPath (TO_C (title)));
209208}
210209
211210GETTER (jboolean, hasMainEntry)
212211
213- METHOD(jboolean, Archive , hasIllustration, jlong size) {
212+ METHOD(jboolean, libzim_Archive , hasIllustration, jlong size) {
214213 return TO_JNI (THIS->hasIllustration (TO_C (size)));
215214}
216215
@@ -226,7 +225,7 @@ GETTER(jboolean, hasNewNamespaceScheme)
226225#define ITER_BY_PATH 0
227226#define ITER_BY_TITLE 1
228227#define ITER_EFFICIENT 2
229- METHOD0 (jobject, Archive , iterByPath) {
228+ METHOD0 (jobject, libzim_Archive , iterByPath) {
230229 auto range = THIS->iterByPath ();
231230 jclass objClass = env->FindClass (" org/kiwix/libzim/EntryIterator" );
232231 jmethodID initMethod = env->GetMethodID (objClass, " <init>" , " (I)V" );
@@ -238,7 +237,7 @@ METHOD0(jobject, Archive, iterByPath) {
238237 return obj;
239238}
240239
241- METHOD0 (jobject, Archive , iterByTitle) {
240+ METHOD0 (jobject, libzim_Archive , iterByTitle) {
242241 auto range = THIS->iterByTitle ();
243242 jclass objClass = env->FindClass (" org/kiwix/libzim/EntryIterator" );
244243 jmethodID initMethod = env->GetMethodID (objClass, " <init>" , " (I)V" );
@@ -250,7 +249,7 @@ METHOD0(jobject, Archive, iterByTitle) {
250249 return obj;
251250}
252251
253- METHOD0 (jobject, Archive , iterEfficient) {
252+ METHOD0 (jobject, libzim_Archive , iterEfficient) {
254253 auto range = THIS->iterEfficient ();
255254 jclass objClass = env->FindClass (" org/kiwix/libzim/EntryIterator" );
256255 jmethodID initMethod = env->GetMethodID (objClass, " <init>" , " (I)V" );
@@ -262,7 +261,7 @@ METHOD0(jobject, Archive, iterEfficient) {
262261 return obj;
263262}
264263
265- METHOD (jobject, Archive , findByPath, jstring path) {
264+ METHOD (jobject, libzim_Archive , findByPath, jstring path) {
266265 auto range = THIS->findByPath (TO_C (path));
267266 jclass objClass = env->FindClass (" org/kiwix/libzim/EntryIterator" );
268267 jmethodID initMethod = env->GetMethodID (objClass, " <init>" , " (I)V" );
@@ -274,7 +273,7 @@ METHOD(jobject, Archive, findByPath, jstring path) {
274273 return obj;
275274}
276275
277- METHOD (jobject, Archive , findByTitle, jstring title) {
276+ METHOD (jobject, libzim_Archive , findByTitle, jstring title) {
278277 auto range = THIS->findByTitle (TO_C (title));
279278 jclass objClass = env->FindClass (" org/kiwix/libzim/EntryIterator" );
280279 jmethodID initMethod = env->GetMethodID (objClass, " <init>" , " (I)V" );
0 commit comments