}
static struct zip_entry *
-zip_entry_find (struct zip_reader *zr, const char *member)
+zip_entry_find (const struct zip_reader *zr, const char *member)
{
for (int i = 0; i < zr->n_entries; ++i)
{
return idx < zr->n_entries ? zr->entries[idx].name : NULL;
}
+/* Returns true if ZR contains a member named MEMBER, false otherwise. */
+bool
+zip_reader_contains_member (const struct zip_reader *zr, const char *member)
+{
+ return zip_entry_find (zr, member) != NULL;
+}
+
/* Return the member called MEMBER from the reader ZR */
struct zip_member *
zip_member_open (struct zip_reader *zr, const char *member)
const char *zip_reader_get_member_name(const struct zip_reader *zr,
size_t idx);
+/* Returns true if ZR contains a member named MEMBER, false otherwise. */
+bool zip_reader_contains_member (const struct zip_reader *zr,
+ const char *member);
+
/* Return the zip member in the reader ZR, called MEMBER */
struct zip_member *zip_member_open (struct zip_reader *zr, const char *member);