Rizin
unix-like reverse engineering framework and cli tools
zip_get_num_entries.c File Reference
#include "zipint.h"

Go to the source code of this file.

Functions

ZIP_EXTERN zip_int64_t zip_get_num_entries (zip_t *za, zip_flags_t flags)
 

Function Documentation

◆ zip_get_num_entries()

ZIP_EXTERN zip_int64_t zip_get_num_entries ( zip_t za,
zip_flags_t  flags 
)

Definition at line 39 of file zip_get_num_entries.c.

39  {
41 
42  if (za == NULL)
43  return -1;
44 
45  if (flags & ZIP_FL_UNCHANGED) {
46  n = za->nentry;
47  while (n > 0 && za->entry[n - 1].orig == NULL)
48  --n;
49  return (zip_int64_t)n;
50  }
51  return (zip_int64_t)za->nentry;
52 }
#define NULL
Definition: cris-opc.c:27
#define ZIP_FL_UNCHANGED
Definition: zip.h:79
int n
Definition: mipsasm.c:19
static struct sockaddr static addrlen static backlog const void static flags void flags
Definition: sfsocketcall.h:123
zip_dirent_t * orig
Definition: zipint.h:409
zip_entry_t * entry
Definition: zipint.h:294
zip_uint64_t nentry
Definition: zipint.h:292
uint64_t zip_uint64_t
Definition: zipconf.h:39
int64_t zip_int64_t
Definition: zipconf.h:38
zip_t * za
Definition: ziptool.c:79

References zip::entry, flags, n, zip::nentry, NULL, zip_entry::orig, za, and ZIP_FL_UNCHANGED.

Referenced by get_num_entries(), list_zip(), LLVMFuzzerTestOneInput(), main(), merge_zip(), and set_file_mtime_all().