X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Flookup_table.c;h=c6b45fed3d5d20fd3ef113a8353a8166773a2e4d;hp=f22bfaf7cf7df4c995065b81eb0ba10a9af77b65;hb=fd23809cca6a7e9fa748f1c8ec4cc35245337221;hpb=670a0ed6a1f36bebf71f0b221f3d78e497d305c2 diff --git a/src/lookup_table.c b/src/lookup_table.c index f22bfaf7..c6b45fed 100644 --- a/src/lookup_table.c +++ b/src/lookup_table.c @@ -865,6 +865,34 @@ inode_stream_lte(const struct wim_inode *inode, unsigned stream_idx, return inode_stream_lte_unresolved(inode, stream_idx, table); } +struct wim_lookup_table_entry * +inode_unnamed_lte_resolved(const struct wim_inode *inode) +{ + wimlib_assert(inode->i_resolved); + for (unsigned i = 0; i <= inode->i_num_ads; i++) { + if (inode_stream_name_nbytes(inode, i) == 0 && + !is_zero_hash(inode_stream_hash_resolved(inode, i))) + { + return inode_stream_lte_resolved(inode, i); + } + } + return NULL; +} + +struct wim_lookup_table_entry * +inode_unnamed_lte_unresolved(const struct wim_inode *inode, + const struct wim_lookup_table *table) +{ + wimlib_assert(!inode->i_resolved); + for (unsigned i = 0; i <= inode->i_num_ads; i++) { + if (inode_stream_name_nbytes(inode, i) == 0 && + !is_zero_hash(inode_stream_hash_unresolved(inode, i))) + { + return inode_stream_lte_unresolved(inode, i, table); + } + } + return NULL; +} /* Return the lookup table entry for the unnamed data stream of an inode, or * NULL if there is none.