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

Go to the source code of this file.

Functions

ZIP_EXTERN const char * zip_get_archive_comment (zip_t *za, int *lenp, zip_flags_t flags)
 

Function Documentation

◆ zip_get_archive_comment()

ZIP_EXTERN const char* zip_get_archive_comment ( zip_t za,
int lenp,
zip_flags_t  flags 
)

Definition at line 41 of file zip_get_archive_comment.c.

41  {
42  zip_string_t *comment;
44  const zip_uint8_t *str;
45 
46  if ((flags & ZIP_FL_UNCHANGED) || (za->comment_changes == NULL))
47  comment = za->comment_orig;
48  else
49  comment = za->comment_changes;
50 
51  if ((str = _zip_string_get(comment, &len, flags, &za->error)) == NULL)
52  return NULL;
53 
54  if (lenp)
55  *lenp = (int)len;
56 
57  return (const char *)str;
58 }
size_t len
Definition: 6502dis.c:15
#define NULL
Definition: cris-opc.c:27
#define ZIP_FL_UNCHANGED
Definition: zip.h:79
static struct sockaddr static addrlen static backlog const void static flags void flags
Definition: sfsocketcall.h:123
static int
Definition: sfsocketcall.h:114
zip_error_t error
Definition: zipint.h:281
zip_string_t * comment_changes
Definition: zipint.h:289
zip_string_t * comment_orig
Definition: zipint.h:288
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_string_get(), zip::comment_changes, zip::comment_orig, zip::error, flags, int, len, NULL, cmd_descs_generate::str, za, and ZIP_FL_UNCHANGED.

Referenced by get_archive_comment(), and list_zip().