summaryrefslogtreecommitdiff
path: root/src/lib/openjp2/cio.c
diff options
context:
space:
mode:
authorMickael Savinaud <savmickael@users.noreply.github.com>2013-02-16 17:20:55 +0000
committerMickael Savinaud <savmickael@users.noreply.github.com>2013-02-16 17:20:55 +0000
commitd5884afcf36c567a713fc0ee33e905e5361f6eaf (patch)
tree7156dff9d173f70fdf3bbf7b041d3103f9fe0ca2 /src/lib/openjp2/cio.c
parenta2aeafe85b9a39edb5ef4b74a486e8c162a69921 (diff)
[trunk] add functions to avoid to use FILE* into the API (thanks winfried).
Update issue 120 and update issue 198
Diffstat (limited to 'src/lib/openjp2/cio.c')
-rw-r--r--src/lib/openjp2/cio.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/openjp2/cio.c b/src/lib/openjp2/cio.c
index e6ba8362..8fce9812 100644
--- a/src/lib/openjp2/cio.c
+++ b/src/lib/openjp2/cio.c
@@ -195,6 +195,21 @@ void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream)
}
}
+void OPJ_CALLCONV opj_stream_destroy_v3(opj_stream_t* p_stream)
+{
+ opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
+
+ if (l_stream) {
+ FILE *fp = (FILE*)l_stream->m_user_data;
+ if(fp)
+ fclose(fp);
+
+ opj_free(l_stream->m_stored_data);
+ l_stream->m_stored_data = 00;
+ opj_free(l_stream);
+ }
+}
+
void OPJ_CALLCONV opj_stream_set_read_function(opj_stream_t* p_stream, opj_stream_read_fn p_function)
{
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;