Rizin
unix-like reverse engineering framework and cli tools
diff_output.h File Reference
#include <zip.h>

Go to the source code of this file.

Classes

struct  diff_output_t
 

Macros

#define PRINTF_LIKE(n, m)
 

Functions

void diff_output_init (diff_output_t *output, int verbose, char *const archive_names[])
 
void diff_output_start_file (diff_output_t *output, const char *name, zip_uint64_t size, zip_uint32_t crc)
 
void diff_output_end_file (diff_output_t *output)
 
void diff_output (diff_output_t *output, int side, const char *fmt,...) PRINTF_LIKE(3
 
void void diff_output_data (diff_output_t *output, int side, const zip_uint8_t *data, zip_uint64_t data_length, const char *fmt,...) PRINTF_LIKE(5
 
void void void diff_output_file (diff_output_t *output, char side, const char *name, zip_uint64_t size, zip_uint32_t crc)
 

Macro Definition Documentation

◆ PRINTF_LIKE

#define PRINTF_LIKE (   n,
 
)

Definition at line 17 of file diff_output.h.

Function Documentation

◆ diff_output()

void diff_output ( diff_output_t output,
int  side,
const char *  fmt,
  ... 
)

◆ diff_output_data()

void void diff_output_data ( diff_output_t output,
int  side,
const zip_uint8_t data,
zip_uint64_t  data_length,
const char *  fmt,
  ... 
)

◆ diff_output_end_file()

void diff_output_end_file ( diff_output_t output)

Definition at line 34 of file diff_output.c.

34  {
36 }
#define NULL
Definition: cris-opc.c:27
const char * file_name
Definition: diff_output.h:8
diff_output_t output
Definition: zipcmp.c:237

References diff_output_t::file_name, NULL, and output.

Referenced by compare_list().

◆ diff_output_file()

void void void diff_output_file ( diff_output_t output,
char  side,
const char *  name,
zip_uint64_t  size,
zip_uint32_t  crc 
)

Definition at line 59 of file diff_output.c.

59  {
60  if (!output->verbose) {
61  return;
62  }
63 
65 
66  if (size == 0 && crc == 0 && name[0] != '\0' && name[strlen(name) - 1] == '/') {
67  printf("%c directory '%s'\n", side, name);
68  }
69  else {
70  printf("%c file '%s', size %" PRIu64 ", crc %08x\n", side, name, size, crc);
71  }
72 }
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
Definition: cs_driver.c:93
static void ensure_header(diff_output_t *output)
Definition: diff_output.c:10
voidpf void uLong size
Definition: ioapi.h:138
#define PRIu64
Definition: macros.h:18
Definition: z80asm.h:102

References ensure_header(), output, printf(), PRIu64, and diff_output_t::verbose.

Referenced by diff_output(), and entry_print().

◆ diff_output_init()

void diff_output_init ( diff_output_t output,
int  verbose,
char *const  archive_names[] 
)

Definition at line 19 of file diff_output.c.

19  {
20  output->archive_names[0] = archive_names[0];
21  output->archive_names[1] = archive_names[1];
24  output->file_size = 0;
25  output->file_crc = 0;
26 }
zip_uint64_t file_size
Definition: diff_output.h:9
zip_uint32_t file_crc
Definition: diff_output.h:10
const char * archive_names[2]
Definition: diff_output.h:7
static int verbose
Definition: z80asm.c:73

References diff_output_t::archive_names, diff_output_t::file_crc, diff_output_t::file_name, diff_output_t::file_size, NULL, output, verbose, and diff_output_t::verbose.

Referenced by compare_zip().

◆ diff_output_start_file()

void diff_output_start_file ( diff_output_t output,
const char *  name,
zip_uint64_t  size,
zip_uint32_t  crc 
)

Definition at line 28 of file diff_output.c.

28  {
31  output->file_crc = crc;
32 }
const char * name
Definition: op.c:541

References diff_output_t::file_crc, diff_output_t::file_name, diff_output_t::file_size, name, and output.

Referenced by entry_start_file().