diff --git a/libisofs/image.c b/libisofs/image.c index f1ef90d..3442622 100644 --- a/libisofs/image.c +++ b/libisofs/image.c @@ -722,3 +722,13 @@ int iso_image_hfsplus_bless(IsoImage *img, enum IsoHfsplusBlessings blessing, return 1; } + +/* API */ +int iso_image_hfsplus_get_blessed(IsoImage *img, IsoNode ***blessed_nodes, + int *bless_max, int flag) +{ + *blessed_nodes = img->hfsplus_blessed; + *bless_max = ISO_HFSPLUS_BLESS_MAX; + return 1; +} + diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index 2b652bb..509e1bd 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -6767,6 +6767,39 @@ enum IsoHfsplusBlessings { int iso_image_hfsplus_bless(IsoImage *img, enum IsoHfsplusBlessings blessing, IsoNode *node, int flag); +/** + * Get the array of nodes which are currently blessed. + * Array indice correspond to enum IsoHfsplusBlessings. + * + * Several usage restrictions apply. See parameter blessed_nodes. + * + * @param image + * The image to inquire. + * @param blessed_nodes + * Will return a pointer to an internal node array of image. + * This pointer is valid only as long as image exists and only until + * iso_image_hfsplus_bless() gets used to manipulate the blessings. + * Do not free() this array. Do not alter the content of the array + * directly, but rather use iso_image_hfsplus_bless() and re-inquire + * by iso_image_hfsplus_get_blessed(). + * This call does not impose an extra reference on the nodes in the + * array. So do not iso_node_unref() them. + * Nodes listed here are not necessarily grafted into the tree of + * the IsoImage. + * @param bless_max + * Will return the number of elements in the array. + * It is unlikely but not outruled that it will be larger than + * ISO_HFSPLUS_BLESS_MAX in this libisofs.h file. + * @param flag + * Bitfield for control purposes. Submit 0. + * @return + * 1 means success, <0 means error + * + * @since 1.2.4 + */ +int iso_image_hfsplus_get_blessed(IsoImage *img, IsoNode ***blessed_nodes, + int *bless_max, int flag); + /************ Error codes and return values for libisofs ********************/ diff --git a/libisofs/libisofs.ver b/libisofs/libisofs.ver index 57f057f..6f6ac96 100644 --- a/libisofs/libisofs.ver +++ b/libisofs/libisofs.ver @@ -106,6 +106,7 @@ iso_image_get_volset_id; iso_image_get_volume_id; iso_image_give_up_mips_boot; iso_image_hfsplus_bless; +iso_image_hfsplus_get_blessed; iso_image_import; iso_image_new; iso_image_ref;