Rizin
unix-like reverse engineering framework and cli tools
zip_get_num_files.c File Reference
#include "zipint.h"
#include <limits.h>

Go to the source code of this file.

Macros

#define _ZIP_COMPILING_DEPRECATED
 

Functions

ZIP_EXTERN int zip_get_num_files (zip_t *za)
 

Macro Definition Documentation

◆ _ZIP_COMPILING_DEPRECATED

#define _ZIP_COMPILING_DEPRECATED

Definition at line 35 of file zip_get_num_files.c.

Function Documentation

◆ zip_get_num_files()

ZIP_EXTERN int zip_get_num_files ( zip_t za)

Definition at line 41 of file zip_get_num_files.c.

41  {
42  if (za == NULL)
43  return -1;
44 
45  if (za->nentry > INT_MAX) {
47  return -1;
48  }
49 
50  return (int)za->nentry;
51 }
#define INT_MAX
Definition: cp-demangle.c:131
#define NULL
Definition: cris-opc.c:27
ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int)
Definition: zip_error.c:126
#define ZIP_ER_OPNOTSUPP
Definition: zip.h:133
zip_error_t error
Definition: zipint.h:281
zip_uint64_t nentry
Definition: zipint.h:292
zip_t * za
Definition: ziptool.c:79

References zip::error, INT_MAX, zip::nentry, NULL, za, ZIP_ER_OPNOTSUPP, and zip_error_set().

Referenced by rz_io_zip_alloc_zipfileobj(), rz_io_zip_get_by_file_idx(), and rz_io_zip_get_files().