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

Go to the source code of this file.

Functions

ZIP_EXTERN const char * zip_get_name (zip_t *za, zip_uint64_t idx, zip_flags_t flags)
 
const char * _zip_get_name (zip_t *za, zip_uint64_t idx, zip_flags_t flags, zip_error_t *error)
 

Function Documentation

◆ _zip_get_name()

const char* _zip_get_name ( zip_t za,
zip_uint64_t  idx,
zip_flags_t  flags,
zip_error_t error 
)

Definition at line 47 of file zip_get_name.c.

47  {
48  zip_dirent_t *de;
49  const zip_uint8_t *str;
50 
51  if ((de = _zip_get_dirent(za, idx, flags, error)) == NULL)
52  return NULL;
53 
54  if ((str = _zip_string_get(de->filename, NULL, flags, error)) == NULL)
55  return NULL;
56 
57  return (const char *)str;
58 }
#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 * filename
Definition: zipint.h:341
void error(const char *msg)
Definition: untgz.c:593
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
uint8_t zip_uint8_t
Definition: zipconf.h:33
zip_t * za
Definition: ziptool.c:79

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

Referenced by _zip_name_locate(), _zip_unchange(), zip_delete(), and zip_get_name().

◆ zip_get_name()

ZIP_EXTERN const char* zip_get_name ( zip_t za,
zip_uint64_t  idx,
zip_flags_t  flags 
)

Definition at line 41 of file zip_get_name.c.

41  {
42  return _zip_get_name(za, idx, flags, &za->error);
43 }
zip_error_t error
Definition: zipint.h:281
const char * _zip_get_name(zip_t *za, zip_uint64_t idx, zip_flags_t flags, zip_error_t *error)
Definition: zip_get_name.c:47

References _zip_get_name(), zip::error, flags, setup::idx, and za.

Referenced by get_file_comment(), merge_zip(), zip_file_rename(), and zip_stat_index().