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

Go to the source code of this file.

Functions

zip_source_tzip_source_layered (zip_t *za, zip_source_t *src, zip_source_layered_callback cb, void *ud)
 
zip_source_tzip_source_layered_create (zip_source_t *src, zip_source_layered_callback cb, void *ud, zip_error_t *error)
 

Function Documentation

◆ zip_source_layered()

zip_source_t* zip_source_layered ( zip_t za,
zip_source_t src,
zip_source_layered_callback  cb,
void *  ud 
)

Definition at line 41 of file zip_source_layered.c.

41  {
42  if (za == NULL)
43  return NULL;
44 
45  return zip_source_layered_create(src, cb, ud, &za->error);
46 }
lzma_index * src
Definition: index.h:567
#define NULL
Definition: cris-opc.c:27
zip_error_t error
Definition: zipint.h:281
static const char * cb[]
Definition: z80_tab.h:176
zip_source_t * zip_source_layered_create(zip_source_t *src, zip_source_layered_callback cb, void *ud, zip_error_t *error)
zip_t * za
Definition: ziptool.c:79

References cb, zip::error, NULL, src, za, and zip_source_layered_create().

Referenced by compression_source_new(), zip_source_pkware_decode(), zip_source_pkware_encode(), zip_source_winzip_aes_decode(), and zip_source_winzip_aes_encode().

◆ zip_source_layered_create()

zip_source_t* zip_source_layered_create ( zip_source_t src,
zip_source_layered_callback  cb,
void *  ud,
zip_error_t error 
)

Definition at line 50 of file zip_source_layered.c.

50  {
51  zip_source_t *zs;
52 
53  if ((zs = _zip_source_new(error)) == NULL)
54  return NULL;
55 
57  zs->src = src;
58  zs->cb.l = cb;
59  zs->ud = ud;
60 
61  zs->supports = cb(src, ud, NULL, 0, ZIP_SOURCE_SUPPORTS);
62  if (zs->supports < 0) {
64  }
65 
66  return zs;
67 }
#define ZIP_SOURCE_SUPPORTS_READABLE
Definition: zip.h:249
@ ZIP_SOURCE_SUPPORTS
Definition: zip.h:234
ZIP_EXTERN void zip_source_keep(zip_source_t *_Nonnull)
zip_source_t * src
Definition: zipint.h:384
zip_source_layered_callback l
Definition: zipint.h:387
void * ud
Definition: zipint.h:389
union zip_source::@410 cb
zip_int64_t supports
Definition: zipint.h:391
void error(const char *msg)
Definition: untgz.c:593
zip_source_t * _zip_source_new(zip_error_t *error)

References _zip_source_new(), cb, zip_source::cb, error(), zip_source::l, NULL, zip_source::src, src, zip_source::supports, zip_source::ud, zip_source_keep(), ZIP_SOURCE_SUPPORTS, and ZIP_SOURCE_SUPPORTS_READABLE.

Referenced by _zip_source_window_new(), zip_source_crc_create(), and zip_source_layered().