Ruby: ext/zlib/zlib-1.2.13/contrib/minizip/mztools.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Functions
mztools.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include "zlib.h"`
`#include "unzip.h"`

Go to the source code of this file.

## Macros
#define | READ_8(adr) ((unsigned char)*(adr))
#define | READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) )
#define | READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) )
#define | WRITE_8(buff, n)
#define | WRITE_16(buff, n)
#define | WRITE_32(buff, n)

## Functions
int ZEXPORT | unzRepair (char *file, const char *fileOut, const char *fileOutTmp, uLong *nRecovered, uLong *bytesRecovered) const

## Macro Definition Documentation

## ◆ READ_16

#define READ_16 | ( |  | adr | ) | ( READ_8(adr) | (READ_8(adr+1) << 8) )

Definition at line 15 of file mztools.c.

## ◆ READ_32

#define READ_32 | ( |  | adr | ) | ( READ_16(adr) | (READ_16((adr)+2) << 16) )

Definition at line 16 of file mztools.c.

## ◆ READ_8

#define READ_8 | ( |  | adr | ) | ((unsigned char)*(adr))

Definition at line 14 of file mztools.c.

## ◆ WRITE_16

#define WRITE_16 | ( |  | buff,
|  |  | n
| ) |  |

Value:
do { \
WRITE_8((unsigned char*)(buff), n); \
WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \
} while(0)

Definition at line 21 of file mztools.c.

## ◆ WRITE_32

#define WRITE_32 | ( |  | buff,
|  |  | n
| ) |  |

Value:
do { \
WRITE_16((unsigned char*)(buff), (n) & 0xffff); \
WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \
} while(0)

Definition at line 25 of file mztools.c.

## ◆ WRITE_8

#define WRITE_8 | ( |  | buff,
|  |  | n
| ) |  |

Value:
do { \
*((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \
} while(0)

Definition at line 18 of file mztools.c.

## Function Documentation

## ◆ unzRepair()

int ZEXPORT unzRepair | ( | char* | file,
|  | const char* | fileOut,
|  | const char* | fileOutTmp,
|  | uLong* | nRecovered,
|  | uLong* | bytesRecovered
| ) |  | const

Definition at line 30 of file mztools.c.

References err, filetime(), free, int(), malloc, NULL, READ_16, READ_32, strlen(), WRITE_16, WRITE_32, Z_ERRNO, Z_MEM_ERROR, Z_OK, and Z_STREAM_ERROR.