30 */
31
32 /* First, if system header files define "boolean" map it to "system_boolean" */
33 #define boolean system_boolean
34
35 #include <stdio.h>
36 #include <setjmp.h>
37 #include <string.h>
38 #include <stdlib.h>
39 #include <assert.h>
40
41 #include "jni.h"
42 #include "jni_util.h"
43
44 /* undo "system_boolean" hack and undef FAR since we don't use it anyway */
45 #undef boolean
46 #undef FAR
47 #include <jpeglib.h>
48 #include "jerror.h"
49
50 /* The method IDs we cache. Note that the last two belongs to the
51 * java.io.InputStream class.
52 */
53 static jmethodID sendHeaderInfoID;
54 static jmethodID sendPixelsByteID;
55 static jmethodID sendPixelsIntID;
56 static jmethodID InputStream_readID;
57 static jmethodID InputStream_availableID;
58
59 /* Initialize the Java VM instance variable when the library is
60 first loaded */
61 JavaVM *jvm;
62
63 JNIEXPORT jint JNICALL
64 JNI_OnLoad(JavaVM *vm, void *reserved)
65 {
66 jvm = vm;
67 return JNI_VERSION_1_2;
68 }
69
|
30 */
31
32 /* First, if system header files define "boolean" map it to "system_boolean" */
33 #define boolean system_boolean
34
35 #include <stdio.h>
36 #include <setjmp.h>
37 #include <string.h>
38 #include <stdlib.h>
39 #include <assert.h>
40
41 #include "jni.h"
42 #include "jni_util.h"
43
44 /* undo "system_boolean" hack and undef FAR since we don't use it anyway */
45 #undef boolean
46 #undef FAR
47 #include <jpeglib.h>
48 #include "jerror.h"
49
50 #ifdef __APPLE__
51 /* use setjmp/longjmp versions that do not save/restore the signal mask */
52 #define setjmp _setjmp
53 #define longjmp _longjmp
54 #endif
55
56 /* The method IDs we cache. Note that the last two belongs to the
57 * java.io.InputStream class.
58 */
59 static jmethodID sendHeaderInfoID;
60 static jmethodID sendPixelsByteID;
61 static jmethodID sendPixelsIntID;
62 static jmethodID InputStream_readID;
63 static jmethodID InputStream_availableID;
64
65 /* Initialize the Java VM instance variable when the library is
66 first loaded */
67 JavaVM *jvm;
68
69 JNIEXPORT jint JNICALL
70 JNI_OnLoad(JavaVM *vm, void *reserved)
71 {
72 jvm = vm;
73 return JNI_VERSION_1_2;
74 }
75
|