/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */12#ifndef __LIBBPF_ZIP_H3#define __LIBBPF_ZIP_H45#include <linux/types.h>67/* Represents an open zip archive.8* Only basic ZIP files are supported, in particular the following are not9* supported:10* - encryption11* - streaming12* - multi-part ZIP files13* - ZIP6414*/15struct zip_archive;1617/* Carries information on name, compression method, and data corresponding to a18* file in a zip archive.19*/20struct zip_entry {21/* Compression method as defined in pkzip spec. 0 means data is uncompressed. */22__u16 compression;2324/* Non-null terminated name of the file. */25const char *name;26/* Length of the file name. */27__u16 name_length;2829/* Pointer to the file data. */30const void *data;31/* Length of the file data. */32__u32 data_length;33/* Offset of the file data within the archive. */34__u32 data_offset;35};3637/* Open a zip archive. Returns NULL in case of an error. */38struct zip_archive *zip_archive_open(const char *path);3940/* Close a zip archive and release resources. */41void zip_archive_close(struct zip_archive *archive);4243/* Look up an entry corresponding to a file in given zip archive. */44int zip_archive_find_entry(struct zip_archive *archive, const char *name, struct zip_entry *out);4546#endif474849