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

Go to the source code of this file.

Functions

int zip_file_get_external_attributes (zip_t *za, zip_uint64_t idx, zip_flags_t flags, zip_uint8_t *opsys, zip_uint32_t *attributes)
 

Function Documentation

◆ zip_file_get_external_attributes()

int zip_file_get_external_attributes ( zip_t za,
zip_uint64_t  idx,
zip_flags_t  flags,
zip_uint8_t opsys,
zip_uint32_t attributes 
)

Definition at line 37 of file zip_file_get_external_attributes.c.

37  {
38  zip_dirent_t *de;
39 
40  if ((de = _zip_get_dirent(za, idx, flags, NULL)) == NULL)
41  return -1;
42 
43  if (opsys)
44  *opsys = (zip_uint8_t)((de->version_madeby >> 8) & 0xff);
45 
46  if (attributes)
47  *attributes = de->ext_attrib;
48 
49  return 0;
50 }
#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_uint32_t ext_attrib
Definition: zipint.h:346
zip_uint16_t version_madeby
Definition: zipint.h:333
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
uint8_t zip_uint8_t
Definition: zipconf.h:33
zip_t * za
Definition: ziptool.c:79

References _zip_get_dirent(), zip_dirent::ext_attrib, flags, setup::idx, NULL, zip_dirent::version_madeby, and za.