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

Go to the source code of this file.

Functions

int zip_source_remove (zip_source_t *src)
 

Function Documentation

◆ zip_source_remove()

int zip_source_remove ( zip_source_t src)

Definition at line 39 of file zip_source_remove.c.

39  {
40  if (src->write_state == ZIP_SOURCE_WRITE_REMOVED) {
41  return 0;
42  }
43 
45  if (zip_source_close(src) < 0) {
46  return -1;
47  }
48  }
49  if (src->write_state != ZIP_SOURCE_WRITE_CLOSED) {
51  }
52 
54  return -1;
55  }
56 
57  src->write_state = ZIP_SOURCE_WRITE_REMOVED;
58 
59  return 0;
60 }
lzma_index * src
Definition: index.h:567
#define NULL
Definition: cris-opc.c:27
ZIP_EXTERN int zip_source_close(zip_source_t *_Nonnull)
ZIP_EXTERN void zip_source_rollback_write(zip_source_t *_Nonnull)
@ ZIP_SOURCE_REMOVE
Definition: zip.h:235
zip_int64_t _zip_source_call(zip_source_t *src, void *data, zip_uint64_t length, zip_source_cmd_t command)
@ ZIP_SOURCE_WRITE_CLOSED
Definition: zipint.h:376
@ ZIP_SOURCE_WRITE_REMOVED
Definition: zipint.h:379
#define ZIP_SOURCE_IS_OPEN_READING(src)
Definition: zipint.h:402

References _zip_source_call(), NULL, src, zip_source_close(), ZIP_SOURCE_IS_OPEN_READING, ZIP_SOURCE_REMOVE, zip_source_rollback_write(), ZIP_SOURCE_WRITE_CLOSED, and ZIP_SOURCE_WRITE_REMOVED.

Referenced by zip_close().