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

Go to the source code of this file.

Functions

ZIP_EXTERN zip_int8_t zip_fseek (zip_file_t *zf, zip_int64_t offset, int whence)
 
ZIP_EXTERN int zip_file_is_seekable (zip_file_t *zfile)
 

Function Documentation

◆ zip_file_is_seekable()

ZIP_EXTERN int zip_file_is_seekable ( zip_file_t zfile)

Definition at line 55 of file zip_fseek.c.

55  {
56  if (!zfile) {
57  return -1;
58  }
59 
61 }
#define ZIP_SOURCE_CHECK_SUPPORTED(supported, cmd)
Definition: zip.h:245
@ ZIP_SOURCE_SEEK
Definition: zip.h:226
zip_source_t * src
Definition: zipint.h:311
zip_int64_t zip_source_supports(zip_source_t *src)

References zip_file::src, ZIP_SOURCE_CHECK_SUPPORTED, ZIP_SOURCE_SEEK, and zip_source_supports().

Referenced by is_seekable().

◆ zip_fseek()

ZIP_EXTERN zip_int8_t zip_fseek ( zip_file_t zf,
zip_int64_t  offset,
int  whence 
)

Definition at line 38 of file zip_fseek.c.

38  {
39  if (!zf)
40  return -1;
41 
42  if (zf->error.zip_err != 0)
43  return -1;
44 
45  if (zip_source_seek(zf->src, offset, whence) < 0) {
47  return -1;
48  }
49 
50  return 0;
51 }
voidpf uLong offset
Definition: ioapi.h:144
ZIP_EXTERN int zip_source_seek(zip_source_t *_Nonnull, zip_int64_t, int)
int zip_err
Definition: zip.h:285
zip_error_t error
Definition: zipint.h:309
void _zip_error_set_from_source(zip_error_t *err, zip_source_t *src)
Definition: zip_error.c:135

References _zip_error_set_from_source(), zip_file::error, zip_file::src, zip_error::zip_err, and zip_source_seek().

Referenced by main(), and seek().