New flag bits 8 to 15 in API call iso_node_zf_by_magic()
This commit is contained in:
parent
d5ffecf2f5
commit
dc61e7d298
@ -8191,9 +8191,9 @@ int iso_zisofs_get_params(struct iso_zisofs_ctrl *params, int flag);
|
|||||||
* Use this if you insert the compressed results of program mkzftree from disk
|
* Use this if you insert the compressed results of program mkzftree from disk
|
||||||
* into the image.
|
* into the image.
|
||||||
* @param node
|
* @param node
|
||||||
* The node which shall be checked and eventually marked.
|
* The node which shall be checked and, if appropriate, be marked.
|
||||||
* @param flag
|
* @param flag
|
||||||
* Bitfield for control purposes, unused yet, submit 0
|
* Bitfield for control purposes
|
||||||
* bit0= prepare for a run with iso_write_opts_set_appendable(,1).
|
* bit0= prepare for a run with iso_write_opts_set_appendable(,1).
|
||||||
* Take into account that files from the imported image
|
* Take into account that files from the imported image
|
||||||
* do not get their content filtered.
|
* do not get their content filtered.
|
||||||
@ -8202,6 +8202,7 @@ int iso_zisofs_get_params(struct iso_zisofs_ctrl *params, int flag);
|
|||||||
* create xinfo with parameters which indicate no zisofs
|
* create xinfo with parameters which indicate no zisofs
|
||||||
* bit3= no tree recursion if node is a directory
|
* bit3= no tree recursion if node is a directory
|
||||||
* bit4= skip files which stem from the imported image
|
* bit4= skip files which stem from the imported image
|
||||||
|
* bit8-bit15= maximum zisofs version to be recognized (0 means 1)
|
||||||
* @return
|
* @return
|
||||||
* 0= no zisofs data found
|
* 0= no zisofs data found
|
||||||
* 1= zf xinfo added
|
* 1= zf xinfo added
|
||||||
|
@ -2440,13 +2440,14 @@ int zisofs_zf_xinfo_cloner(void *old_data, void **new_data, int flag)
|
|||||||
* bit1= permission to overwrite existing zisofs_zf_info
|
* bit1= permission to overwrite existing zisofs_zf_info
|
||||||
* bit2= if no zisofs header is found:
|
* bit2= if no zisofs header is found:
|
||||||
* create xinfo with parameters which indicate no zisofs
|
* create xinfo with parameters which indicate no zisofs
|
||||||
|
* bit8-bit15= maximum zisofs version to be recognized (0 means 1)
|
||||||
* @return 1= zf xinfo added, 0= no zisofs data found ,
|
* @return 1= zf xinfo added, 0= no zisofs data found ,
|
||||||
* 2= found existing zf xinfo and flag bit1 was not set
|
* 2= found existing zf xinfo and flag bit1 was not set
|
||||||
* <0 means error
|
* <0 means error
|
||||||
*/
|
*/
|
||||||
int iso_file_zf_by_magic(IsoFile *file, int flag)
|
int iso_file_zf_by_magic(IsoFile *file, int flag)
|
||||||
{
|
{
|
||||||
int ret, stream_type, header_size_div4, block_size_log2;
|
int ret, stream_type, header_size_div4, block_size_log2, version;
|
||||||
uint64_t uncompressed_size;
|
uint64_t uncompressed_size;
|
||||||
IsoStream *stream, *input_stream;
|
IsoStream *stream, *input_stream;
|
||||||
struct zisofs_zf_info *zf = NULL;
|
struct zisofs_zf_info *zf = NULL;
|
||||||
@ -2474,12 +2475,16 @@ int iso_file_zf_by_magic(IsoFile *file, int flag)
|
|||||||
break;
|
break;
|
||||||
stream = input_stream;
|
stream = input_stream;
|
||||||
}
|
}
|
||||||
|
version = ((flag >> 8) & 0xff);
|
||||||
|
algo[0] = algo[1] = 0;
|
||||||
ret = ziso_is_zisofs_stream(stream, &stream_type, algo, &header_size_div4,
|
ret = ziso_is_zisofs_stream(stream, &stream_type, algo, &header_size_div4,
|
||||||
&block_size_log2, &uncompressed_size, 7);
|
&block_size_log2, &uncompressed_size, 3);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
if (version < 2 && ret > 0 && (algo[0] != 'p' || algo[1] != 'z'))
|
||||||
|
ret = 0;
|
||||||
if (ret != 1 || stream_type != 2) {
|
if (ret != 1 || stream_type != 2) {
|
||||||
if (flag & 4)
|
if (!(flag & 4))
|
||||||
return 0;
|
return 0;
|
||||||
algo[0] = algo[1] = 0;
|
algo[0] = algo[1] = 0;
|
||||||
header_size_div4 = 0;
|
header_size_div4 = 0;
|
||||||
@ -2508,7 +2513,7 @@ int iso_node_zf_by_magic(IsoNode *node, int flag)
|
|||||||
IsoDir *dir;
|
IsoDir *dir;
|
||||||
|
|
||||||
if (node->type == LIBISO_FILE)
|
if (node->type == LIBISO_FILE)
|
||||||
return iso_file_zf_by_magic((IsoFile *) node, flag);
|
return iso_file_zf_by_magic((IsoFile *) node, flag & 0xff06);
|
||||||
if (node->type != LIBISO_DIR || (flag & 8))
|
if (node->type != LIBISO_DIR || (flag & 8))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -2529,7 +2534,7 @@ int iso_node_zf_by_magic(IsoNode *node, int flag)
|
|||||||
return 0; /* Will not be zisofs format */
|
return 0; /* Will not be zisofs format */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hflag = flag & ~6;
|
hflag = flag & 0xff06;
|
||||||
if ((flag & 1) && file->from_old_session)
|
if ((flag & 1) && file->from_old_session)
|
||||||
hflag |= 1;
|
hflag |= 1;
|
||||||
ret = iso_file_zf_by_magic(file, hflag);
|
ret = iso_file_zf_by_magic(file, hflag);
|
||||||
|
Loading…
Reference in New Issue
Block a user