Made struct iso_hfsplus_xinfo_data clonable.

This commit is contained in:
Thomas Schmitt 2012-05-25 10:42:26 +02:00
parent ed986aa4ea
commit 177864bd13
3 changed files with 29 additions and 1 deletions

View File

@ -215,6 +215,10 @@ LIBJTE_MISCONFIGURATION_ = 0;
iso_px_ino_xinfo_cloner, 0); iso_px_ino_xinfo_cloner, 0);
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = iso_node_xinfo_make_clonable(iso_hfsplus_xinfo_func,
iso_hfsplus_xinfo_cloner, 0);
if (ret < 0)
return ret;
return 1; return 1;
} }

View File

@ -2085,3 +2085,21 @@ struct iso_hfsplus_xinfo_data *iso_hfsplus_xinfo_new(int flag)
return o; return o;
} }
/* The iso_node_xinfo_cloner function which gets associated to
* iso_hfsplus_xinfo_func by iso_init() resp. iso_init_with_flag() via
* iso_node_xinfo_make_clonable()
*/
int iso_hfsplus_xinfo_cloner(void *old_data, void **new_data, int flag)
{
*new_data = NULL;
if (flag)
return ISO_XINFO_NO_CLONE;
if (old_data == NULL)
return 0;
*new_data = iso_hfsplus_xinfo_new(0);
if(*new_data == NULL)
return ISO_OUT_OF_MEM;
memcpy(*new_data, old_data, sizeof(struct iso_hfsplus_xinfo_data));
return ISO_SUCCESS;
}

View File

@ -543,6 +543,12 @@ int checksum_md5_xinfo_func(void *data, int flag);
*/ */
int checksum_md5_xinfo_cloner(void *old_data, void **new_data, int flag); int checksum_md5_xinfo_cloner(void *old_data, void **new_data, int flag);
/* The iso_node_xinfo_cloner function which gets associated to
* iso_hfsplus_xinfo_func by iso_init() resp. iso_init_with_flag() via
* iso_node_xinfo_make_clonable()
*/
int iso_hfsplus_xinfo_cloner(void *old_data, void **new_data, int flag);
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */