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

Go to the source code of this file.

Functions

ZIP_EXTERN zip_int64_t zip_source_tell (zip_source_t *src)
 

Function Documentation

◆ zip_source_tell()

ZIP_EXTERN zip_int64_t zip_source_tell ( zip_source_t src)

Definition at line 39 of file zip_source_tell.c.

39  {
40  if (src->source_closed) {
41  return -1;
42  }
44  zip_error_set(&src->error, ZIP_ER_INVAL, 0);
45  return -1;
46  }
47 
49  if (src->bytes_read > ZIP_INT64_MAX) {
51  return -1;
52  }
53  return (zip_int64_t)src->bytes_read;
54  }
55 
57 }
lzma_index * src
Definition: index.h:567
#define EOVERFLOW
Definition: compat.h:75
#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_SOURCE_MAKE_COMMAND_BITMASK(cmd)
Definition: zip.h:243
#define ZIP_ER_TELL
Definition: zip.h:135
@ ZIP_SOURCE_SEEK
Definition: zip.h:226
@ ZIP_SOURCE_TELL
Definition: zip.h:227
#define ZIP_ER_INVAL
Definition: zip.h:123
zip_int64_t _zip_source_call(zip_source_t *src, void *data, zip_uint64_t length, zip_source_cmd_t command)
#define ZIP_INT64_MAX
Definition: zipconf.h:54
int64_t zip_int64_t
Definition: zipconf.h:38
#define ZIP_SOURCE_IS_OPEN_READING(src)
Definition: zipint.h:402

References _zip_source_call(), EOVERFLOW, NULL, src, ZIP_ER_INVAL, ZIP_ER_TELL, zip_error_set(), ZIP_INT64_MAX, ZIP_SOURCE_IS_OPEN_READING, ZIP_SOURCE_MAKE_COMMAND_BITMASK, ZIP_SOURCE_SEEK, and ZIP_SOURCE_TELL.

Referenced by _zip_find_central_dir(), _zip_read_cdir(), crc_read(), window_read(), and zip_ftell().