IsoStream version 3 with cmp_ino(),
new API call iso_stream_cmp_ino() for proper comparison of filtered streams
This commit is contained in:
@@ -594,8 +594,13 @@ IsoStream *extf_get_input_stream(IsoStream *stream, int flag)
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
int extf_cmp_ino(IsoStream *s1, IsoStream *s2);
|
||||
/* Function is defined after definition of extf_stream_class */
|
||||
|
||||
|
||||
IsoStreamIface extf_stream_class = {
|
||||
2,
|
||||
3,
|
||||
"extf",
|
||||
extf_stream_open,
|
||||
extf_stream_close,
|
||||
@@ -605,10 +610,28 @@ IsoStreamIface extf_stream_class = {
|
||||
extf_stream_get_id,
|
||||
extf_stream_free,
|
||||
extf_update_size,
|
||||
extf_get_input_stream
|
||||
extf_get_input_stream,
|
||||
extf_cmp_ino
|
||||
};
|
||||
|
||||
|
||||
static
|
||||
int extf_cmp_ino(IsoStream *s1, IsoStream *s2)
|
||||
{
|
||||
ExternalFilterStreamData *data1, *data2;
|
||||
|
||||
if (s1->class != &extf_stream_class || s2->class != &extf_stream_class)
|
||||
return iso_stream_cmp_ino(s1, s2, 1);
|
||||
data1 = (ExternalFilterStreamData*) s1->data;
|
||||
data2 = (ExternalFilterStreamData*) s2->data;
|
||||
if (data1->cmd != data2->cmd)
|
||||
return (data1->cmd < data2->cmd ? -1 : 1);
|
||||
return iso_stream_cmp_ino(data1->orig, data2->orig, 0);
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
static
|
||||
void extf_filter_free(FilterContext *filter)
|
||||
{
|
||||
|
@@ -521,8 +521,12 @@ IsoStream *gzip_get_input_stream(IsoStream *stream, int flag)
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
int gzip_cmp_ino(IsoStream *s1, IsoStream *s2);
|
||||
|
||||
|
||||
IsoStreamIface gzip_stream_compress_class = {
|
||||
2,
|
||||
3,
|
||||
"gzip",
|
||||
gzip_stream_open,
|
||||
gzip_stream_close,
|
||||
@@ -532,12 +536,13 @@ IsoStreamIface gzip_stream_compress_class = {
|
||||
gzip_stream_get_id,
|
||||
gzip_stream_free,
|
||||
gzip_update_size,
|
||||
gzip_get_input_stream
|
||||
gzip_get_input_stream,
|
||||
gzip_cmp_ino
|
||||
};
|
||||
|
||||
|
||||
IsoStreamIface gzip_stream_uncompress_class = {
|
||||
2,
|
||||
3,
|
||||
"pizg",
|
||||
gzip_stream_open,
|
||||
gzip_stream_close,
|
||||
@@ -547,9 +552,24 @@ IsoStreamIface gzip_stream_uncompress_class = {
|
||||
gzip_stream_get_id,
|
||||
gzip_stream_free,
|
||||
gzip_update_size,
|
||||
gzip_get_input_stream
|
||||
gzip_get_input_stream,
|
||||
gzip_cmp_ino
|
||||
};
|
||||
|
||||
|
||||
static
|
||||
int gzip_cmp_ino(IsoStream *s1, IsoStream *s2)
|
||||
{
|
||||
if (s1->class != s2->class || (s1->class != &gzip_stream_compress_class &&
|
||||
s2->class != &gzip_stream_compress_class))
|
||||
return iso_stream_cmp_ino(s1, s2, 1);
|
||||
return iso_stream_cmp_ino(iso_stream_get_input_stream(s1, 0),
|
||||
iso_stream_get_input_stream(s2, 0), 0);
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
static
|
||||
void gzip_filter_free(FilterContext *filter)
|
||||
|
@@ -775,8 +775,12 @@ IsoStream *ziso_get_input_stream(IsoStream *stream, int flag)
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
int ziso_cmp_ino(IsoStream *s1, IsoStream *s2);
|
||||
|
||||
|
||||
IsoStreamIface ziso_stream_compress_class = {
|
||||
2,
|
||||
3,
|
||||
"ziso",
|
||||
ziso_stream_open,
|
||||
ziso_stream_close,
|
||||
@@ -786,12 +790,13 @@ IsoStreamIface ziso_stream_compress_class = {
|
||||
ziso_stream_get_id,
|
||||
ziso_stream_free,
|
||||
ziso_update_size,
|
||||
ziso_get_input_stream
|
||||
ziso_get_input_stream,
|
||||
ziso_cmp_ino
|
||||
};
|
||||
|
||||
|
||||
IsoStreamIface ziso_stream_uncompress_class = {
|
||||
2,
|
||||
3,
|
||||
"osiz",
|
||||
ziso_stream_open,
|
||||
ziso_stream_close,
|
||||
@@ -801,10 +806,25 @@ IsoStreamIface ziso_stream_uncompress_class = {
|
||||
ziso_stream_get_id,
|
||||
ziso_stream_free,
|
||||
ziso_update_size,
|
||||
ziso_get_input_stream
|
||||
ziso_get_input_stream,
|
||||
ziso_cmp_ino
|
||||
};
|
||||
|
||||
|
||||
static
|
||||
int ziso_cmp_ino(IsoStream *s1, IsoStream *s2)
|
||||
{
|
||||
if (s1->class != s2->class || (s1->class != &ziso_stream_compress_class &&
|
||||
s2->class != &ziso_stream_uncompress_class))
|
||||
iso_stream_cmp_ino(s1, s2, 1);
|
||||
return iso_stream_cmp_ino(iso_stream_get_input_stream(s1, 0),
|
||||
iso_stream_get_input_stream(s2, 0), 0);
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
static
|
||||
void ziso_filter_free(FilterContext *filter)
|
||||
{
|
||||
|
Reference in New Issue
Block a user