---
name: "zip_error_init"
section: "3"
platform: "linux"
package: "libzip"
version: "1.11.4-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/zip_error_init"
---

# zip\_error\_init(3)

initialize zip\_error structure

## NAME

**zip\_error\_init**, **zip\_error\_init\_with\_code** – initialize zip\_error structure

## LIBRARY

libzip (-lzip)

## SYNOPSIS

**#include \<zip.h\>**

*void*\

**zip\_error\_init**(*zip\_error\_t \*error*);

*void*\

**zip\_error\_init\_with\_code**(*zip\_error\_t \*error*, *int ze*);

## DESCRIPTION

The **zip\_error\_init**() function initializes the zip\_error pointed to by *error*. *\*error* must be allocated before calling **zip\_error\_init**().

The **zip\_error\_init\_with\_code**() function does the same, but additionally sets the zip error code to *ze* and sets the system error code to the current [errno(3)](/errno/3.md) value, if appropriate.

## SEE ALSO

[libzip(3)](/libzip/3.md), [zip\_error\_fini(3)](/zip_error_fini/3.md)

## HISTORY

**zip\_error\_init**() and **zip\_error\_init\_with\_code**() were added in libzip 1.0.

## AUTHORS

Dieter Baron ⟨*dillo@nih.at*⟩ and Thomas Klausner ⟨*wiz@gatalith.at*⟩
