zzip_entry_data_offset(3)

πŸ“¦
version 0.13.78 Β· 4 versions
, in centos-stream 10, debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 (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