---
name: "zip_source_window_create"
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_source_window_create"
---

# zip\_source\_window\_create(3)

create zip data source overlay

## NAME

**zip\_source\_window\_create** – create zip data source overlay

## LIBRARY

libzip (-lzip)

## SYNOPSIS

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

*zip\_source\_t* *\**\

**zip\_source\_window\_create**(*zip\_source\_t \*source*, *zip\_uint64\_t start*, *zip\_int64\_t len*, *zip\_error\_t \*error*);

## DESCRIPTION

The **zip\_source\_window\_create**() function create a zip source from an underlying zip source, restricting access to a particular window starting at byte *start* and having size *len*. If *len* is -1, the window spans to the end of the underlying source.

**zip\_source\_window**() and **zip\_source\_window\_create**() don't take ownership of *source*. The caller is responsible for freeing it. (This is different to other layered sources.)

## RETURN VALUES

Upon successful completion, the created source is returned. Otherwise, NULL is returned and the error code in *error* is set to indicate the error.

## ERRORS

**zip\_source\_window\_create**() fails if:

- \[ZIP\_ER\_INVAL\]

  *src* is NULL; there is an integer overflow adding *start* and *len*; or *len* is less than -1.

- \[ZIP\_ER\_MEMORY\]

  Required memory could not be allocated.

## SEE ALSO

[libzip(3)](/libzip/3.md), [zip\_source(5)](/zip_source/5.md)

## HISTORY

**zip\_source\_window\_create**() was added in libzip 1.8.0.

## AUTHORS

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