ARCHIVE\_READ\_HEADER(3) Library Functions Manual ARCHIVE\_READ\_HEADER(3)

# [NAME](#NAME)

`archive_read_next_header`, `archive_read_next_header2` — functions for reading streaming archives

# [LIBRARY](#LIBRARY)

Streaming Archive Library (libarchive, -larchive)

# [SYNOPSIS](#SYNOPSIS)

`#include <archive.h>`

`int`  
`archive_read_next_header`(`struct archive *`, `struct archive_entry **`);

`int`  
`archive_read_next_header2`(`struct archive *`, `struct archive_entry *`);

# [DESCRIPTION](#DESCRIPTION)

[`archive_read_next_header`](#archive_read_next_header)()

Read the header for the next entry and return a pointer to a struct archive\_entry. This is a convenience wrapper around [`archive_read_next_header2`](#archive_read_next_header2)() that reuses an internal struct archive\_entry object for each request.

`archive_read_next_header2`()

Read the header for the next entry and populate the provided struct archive\_entry.

# [RETURN VALUES](#RETURN_VALUES)

These functions return `ARCHIVE_OK` (the operation succeeded), `ARCHIVE_WARN` (the operation succeeded but a non-critical error was encountered), `ARCHIVE_EOF` (end-of-archive was encountered), `ARCHIVE_RETRY` (the operation failed but can be retried), and `ARCHIVE_FATAL` (there was a fatal error; the archive should be closed immediately).

# [ERRORS](#ERRORS)

Detailed error codes and textual descriptions are available from the `archive_errno`() and `archive_error_string`() functions.

# [SEE ALSO](#SEE_ALSO)

[tar(1)](/man/os/libarchive/tar.1), [archive\_read(3)](/man/os/libarchive/archive_read.3), [archive\_read\_data(3)](/man/os/libarchive/archive_read_data.3), [archive\_read\_extract(3)](/man/os/libarchive/archive_read_extract.3), [archive\_read\_filter(3)](/man/os/libarchive/archive_read_filter.3), [archive\_read\_format(3)](/man/os/libarchive/archive_read_format.3), [archive\_read\_open(3)](/man/os/libarchive/archive_read_open.3), [archive\_read\_set\_options(3)](/man/os/libarchive/archive_read_set_options.3), [archive\_util(3)](/man/os/libarchive/archive_util.3), [libarchive(3)](/man/os/libarchive/libarchive.3), [tar(5)](/man/os/libarchive/tar.5)

February 2, 2012 Linux 4.19.0-gvisor

---

Document: archive_read_header(3) from libarchive 3.8.10-r0 (Chainguard OS)
Source: https://github.com/libarchive/libarchive
