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

Go to the source code of this file.

Functions

int zip_source_close (zip_source_t *src)
 

Function Documentation

◆ zip_source_close()

int zip_source_close ( zip_source_t src)

Definition at line 39 of file zip_source_close.c.

39  {
41  zip_error_set(&src->error, ZIP_ER_INVAL, 0);
42  return -1;
43  }
44 
45  src->open_count--;
46  if (src->open_count == 0) {
48 
50  if (zip_source_close(src->src) < 0) {
51  zip_error_set(&src->error, ZIP_ER_INTERNAL, 0);
52  }
53  }
54  }
55 
56  return 0;
57 }
lzma_index * src
Definition: index.h:567
#define NULL
Definition: cris-opc.c:27
#define ZIP_ER_INTERNAL
Definition: zip.h:125
ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int)
Definition: zip_error.c:126
@ ZIP_SOURCE_CLOSE
Definition: zip.h:222
#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)
int zip_source_close(zip_source_t *src)
#define ZIP_SOURCE_IS_LAYERED(src)
Definition: zipint.h:404
#define ZIP_SOURCE_IS_OPEN_READING(src)
Definition: zipint.h:402

References _zip_source_call(), NULL, src, ZIP_ER_INTERNAL, ZIP_ER_INVAL, zip_error_set(), ZIP_SOURCE_CLOSE, zip_source_close(), ZIP_SOURCE_IS_LAYERED, and ZIP_SOURCE_IS_OPEN_READING.

Referenced by copy_source(), main(), write_memory_src_to_file(), zip_discard(), zip_open_from_source(), zip_source_close(), zip_source_commit_write(), zip_source_free(), zip_source_open(), and zip_source_remove().