zzip_entry_data_offset(3)
β¨ NAME β¨
zzip_entry_data_offset, zzip_entry_fread_file_header, zzip_entry_strdup_name β bestie, these are the helper functions for the (fseeko) zip access api π
πΈ SYNOPSIS πΈ
#include <zzip/fseeko.h>
zzip_off_t
zzip_entry_data_offset(ZZIP_ENTRY* entry)
static zzip_off_t
zzip_entry_fread_file_header(ZZIP_ENTRY* entry, struct zzip_file_header* file_header)
zzip__new__ char*
zzip_entry_strdup_name(ZZIP_ENTRY* entry)
π DESCRIPTION π
π zzip_entry_data_offset
okay so zzip_entry_data_offset hands you back the seekval offset of the data portion of the file that the given zzip_entry is pointing at π lowkey it has to do an intermediate lil check of the file_header structure first (aka it literally reads it off the disk, no skips). and after you call it? the contained diskfile readposition is already set to the data_offset it just returned. convenient, fr fr β¨
Returns -1 on error, and the errno is EINVAL|EBADMSG π
π¦ zzip_entry_fread_file_header
zzip_entry_fread_file_header reads the corresponding struct zzip_file_header from the zip disk of the given entry π the off_t it returns points to the end of the file_header where the current fseek pointer has stopped β that's the whole point, so you can immediately parse out any filename/extras block that comes right after the file_header π«
Returns zero on error, with errno = EINVAL|EBADMSG|EBADF|EIO π
π zzip_entry_strdup_name
zzip_entry_strdup_name is a big helper despite its little name, no cap π«Ά here's why: in a zip file the encoded filenames are usually NOT zero-terminated, but for common usage with libc we absolutely need them that way. and secondly? the filename SHOULD be present in the zip central directory, but if it's not, we fallback to the filename given in the file_header of each compressed data portion π
returns: a new string buffer, null on error (errno = EINVAL|ENOMEM|EBADMSG) πΈ
π AUTHOR π
Guido Draheim <guidod@gmx.de>
π COPYRIGHT π
Copyright (c) Guido Draheim, use under copyleft (LGPL,MPL)
ok bestie that's the whole page, go forth and slay your zip parsing πβ¨
signing off β this was the zziplib manpage set, version 0.13.78, and yeah that's the whole vibe π¦ mwah
π¦ where this page comes from
- centos-stream 10: zziplib-devel 0.13.78-2.el10 Β· LGPL-2.0-or-later OR MPL-1.1
- debian trixie: libzzip-dev 0.13.78+dfsg.1-0.1 Β· ZZIP
- fedora 43: zziplib-devel 0.13.78-2.fc43 Β· LGPL-2.0-or-later OR MPL-1.1
- fedora 43: zziplib-devel 0.13.78-2.fc43 Β· LGPL-2.0-or-later OR MPL-1.1
- fedora 44: zziplib-devel 0.13.78-4.fc44 Β· LGPL-2.0-or-later OR MPL-1.1
- fedora 44: zziplib-devel 0.13.78-4.fc44 Β· LGPL-2.0-or-later OR MPL-1.1
- opensuse-leap 16.0: zziplib-devel 0.13.78-160000.2.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: zziplib-devel 0.13.78-160000.2.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: zziplib-devel 0.13.78-160000.2.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: zziplib-devel 0.13.78-160000.2.2 Β· LGPL-2.1-or-later
- ubuntu questing: libzzip-dev 0.13.78+dfsg.1-0.1
- ubuntu resolute: libzzip-dev 0.13.78+dfsg.1-0.2 Β· ZZIP
- ubuntu stonking: libzzip-dev 0.13.78+dfsg.1-0.2 Β· ZZIP
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms