81 * JImageClose - Given the supplied open image file (see JImageOpen), release
82 * memory and resources used by the open file and close the file. If the image
83 * file is shared by other uses, release and close is deferred until the last use
84 * is also closed.
85 *
86 * Ex.
87 * (*JImageClose)(image);
88 */
89
90 extern "C" JNIEXPORT void
91 JIMAGE_Close(JImageFile* jimage);
92
93 typedef void (*JImageClose_t)(JImageFile* jimage);
94
95
96 /*
97 * JImageFindResource - Given an open image file (see JImageOpen), a module
98 * name, a version string and the name of a class/resource, return location
99 * information describing the resource and its size. If no resource is found, the
100 * function returns JIMAGE_NOT_FOUND and the value of size is undefined.
101 * The version number should be "9.0" and is not used in locating the resource.
102 * The resulting location does/should not have to be released.
103 * All strings are utf-8, zero byte terminated.
104 *
105 * Ex.
106 * jlong size;
107 * JImageLocationRef location = (*JImageFindResource)(image,
108 * "java.base", "9.0", "java/lang/String.class", &size);
109 */
110 extern "C" JNIEXPORT JImageLocationRef JIMAGE_FindResource(JImageFile* jimage,
111 const char* module_name, const char* version, const char* name,
112 jlong* size);
113
114 typedef JImageLocationRef(*JImageFindResource_t)(JImageFile* jimage,
115 const char* module_name, const char* version, const char* name,
116 jlong* size);
117
118
119 /*
120 * JImageGetResource - Given an open image file (see JImageOpen), a resource's
121 * location information (see JImageFindResource), a buffer of appropriate
122 * size and the size, retrieve the bytes associated with the
123 * resource. If the size is less than the resource size then the read is truncated.
124 * If the size is greater than the resource size then the remainder of the buffer
125 * is zero filled. The function will return the actual size of the resource.
126 *
127 * Ex.
128 * jlong size;
129 * JImageLocationRef location = (*JImageFindResource)(image,
130 * "java.base", "9.0", "java/lang/String.class", &size);
131 * char* buffer = new char[size];
132 * (*JImageGetResource)(image, location, buffer, size);
133 */
134 extern "C" JNIEXPORT jlong
135 JIMAGE_GetResource(JImageFile* jimage, JImageLocationRef location,
|
81 * JImageClose - Given the supplied open image file (see JImageOpen), release
82 * memory and resources used by the open file and close the file. If the image
83 * file is shared by other uses, release and close is deferred until the last use
84 * is also closed.
85 *
86 * Ex.
87 * (*JImageClose)(image);
88 */
89
90 extern "C" JNIEXPORT void
91 JIMAGE_Close(JImageFile* jimage);
92
93 typedef void (*JImageClose_t)(JImageFile* jimage);
94
95
96 /*
97 * JImageFindResource - Given an open image file (see JImageOpen), a module
98 * name, a version string and the name of a class/resource, return location
99 * information describing the resource and its size. If no resource is found, the
100 * function returns JIMAGE_NOT_FOUND and the value of size is undefined.
101 * The resulting location does/should not have to be released.
102 * All strings are utf-8, zero byte terminated.
103 *
104 * Ex.
105 * jlong size;
106 * JImageLocationRef location = (*JImageFindResource)(image,
107 * "java.base", "java/lang/String.class", is_preview_mode, &size);
108 */
109 extern "C" JNIEXPORT JImageLocationRef JIMAGE_FindResource(JImageFile* jimage,
110 const char* module_name, const char* name, bool is_preview_mode,
111 jlong* size);
112
113 typedef JImageLocationRef(*JImageFindResource_t)(JImageFile* jimage,
114 const char* module_name, const char* name, bool is_preview_mode,
115 jlong* size);
116
117
118 /*
119 * JImageGetResource - Given an open image file (see JImageOpen), a resource's
120 * location information (see JImageFindResource), a buffer of appropriate
121 * size and the size, retrieve the bytes associated with the
122 * resource. If the size is less than the resource size then the read is truncated.
123 * If the size is greater than the resource size then the remainder of the buffer
124 * is zero filled. The function will return the actual size of the resource.
125 *
126 * Ex.
127 * jlong size;
128 * JImageLocationRef location = (*JImageFindResource)(image,
129 * "java.base", "9.0", "java/lang/String.class", &size);
130 * char* buffer = new char[size];
131 * (*JImageGetResource)(image, location, buffer, size);
132 */
133 extern "C" JNIEXPORT jlong
134 JIMAGE_GetResource(JImageFile* jimage, JImageLocationRef location,
|