zzip_disk_entry_to_data(3)

NAME
zzip_disk_entry_to_data, zzip_disk_entry_to_file_header, zzip_disk_entry_strdup_name, zzip_disk_entry_strdup_comment - helper functions for (mmapped) zip access api

SYNOPSIS

#include <zzip/mmapped.h>

b'zzip_byte_t *\fInzzip_disk_entry_to_data(ZZIP_DISK * disk, struct zzip_disk_entry * entry)
b'struct zzip_file_header *\fInzzip_disk_entry_to_file_header(ZZIP_DISK * disk, struct zzip_disk_entry *entry)
b'zzip__new__ char *\fInzzip_disk_entry_strdup_name(ZZIP_DISK * disk, struct zzip_disk_entry *entry)
b'zzip__new__ char *\fInzzip_disk_entry_strdup_comment(ZZIP_DISK * disk, struct zzip_disk_entry *entry)n'

DESCRIPTION
b'The zzip_disk_entry_to_data function augments the other zzip_disk_entry_* helpers: here we movea disk_entry pointer (as returned by _find* functions) into a pointer tothe data block right after the file_header. Only disk->buffer would beneeded to perform the seek but we check the mmapped range end as well.

b'The zzip_disk_entry_to_data function returns a pointer into disk->buffer or 0 on error (errno).n'

b' The zzip_disk_entry_to_file_header function does half the job of zzip_disk_entry_to_data where itcan augment with zzip_file_header_to_data helper from format/fetch.h

b'The zzip_disk_entry_to_file_header function returns a pointer into disk->buffer or 0 on error (errno).n'

b' The zzip_disk_entry_strdup_name function is a big helper despite its little name: in a zip file theencoded filenames are usually NOT zero-terminated but for common usagewith libc we need it that way. Secondly, the filename SHOULD be presentin the zip central directory but if not then we fallback to the filenamegiven in the file_header of each compressed data portion.

b'The zzip_disk_entry_strdup_name function returns a new string buffer, or null on error.If no name can be found then an empty string is returned.n'

b' The zzip_disk_entry_strdup_comment function is similar creating a reference to a zero terminatedstring but it can only exist in the zip central directory entry.

b'The zzip_disk_entry_strdup_comment function returns a new string buffer, or null on error (errno).If no name can be found then an empty string is returned.n

AUTHOR
b'Guido Draheim <guidod@gmx.de>

COPYRIGHT
b'Copyright (c)Guido Draheim, use under copyleft (LGPL,MPL)n'