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

Go to the source code of this file.

Functions

ZIP_EXTERN const char * zip_file_get_comment (zip_t *za, zip_uint64_t idx, zip_uint32_t *lenp, zip_flags_t flags)
 

Function Documentation

◆ zip_file_get_comment()

ZIP_EXTERN const char* zip_file_get_comment ( zip_t za,
zip_uint64_t  idx,
zip_uint32_t lenp,
zip_flags_t  flags 
)

Definition at line 40 of file zip_file_get_comment.c.

40  {
41  zip_dirent_t *de;
43  const zip_uint8_t *str;
44 
45  if ((de = _zip_get_dirent(za, idx, flags, NULL)) == NULL)
46  return NULL;
47 
48  if ((str = _zip_string_get(de->comment, &len, flags, &za->error)) == NULL)
49  return NULL;
50 
51  if (lenp)
52  *lenp = len;
53 
54  return (const char *)str;
55 }
size_t len
Definition: 6502dis.c:15
#define NULL
Definition: cris-opc.c:27
int idx
Definition: setup.py:197
static struct sockaddr static addrlen static backlog const void static flags void flags
Definition: sfsocketcall.h:123
zip_string_t * comment
Definition: zipint.h:343
zip_error_t error
Definition: zipint.h:281
zip_dirent_t * _zip_get_dirent(zip_t *za, zip_uint64_t idx, zip_flags_t flags, zip_error_t *error)
Definition: zip_dirent.c:1064
const zip_uint8_t * _zip_string_get(zip_string_t *string, zip_uint32_t *lenp, zip_flags_t flags, zip_error_t *error)
Definition: zip_string.c:80
uint32_t zip_uint32_t
Definition: zipconf.h:37
uint8_t zip_uint8_t
Definition: zipconf.h:33
zip_t * za
Definition: ziptool.c:79

References _zip_get_dirent(), _zip_string_get(), zip_dirent::comment, zip::error, flags, setup::idx, len, NULL, cmd_descs_generate::str, and za.

Referenced by list_zip(), and zip_get_file_comment().