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

zzip_read(3) πŸ’–

okay bestie, welcome to the zziplib Function List ✨ this one's about reading data, and honestly? it's giving "small function, big feelings" πŸŽ€


✨ NAME ✨

  • zzip_read, zzip_fread β€” read data. that's it, that's the whole vibe πŸ’…

🌸 SYNOPSIS 🌸

#include <zzip/lib.h>

zzip_ssize_t
zzip_read(ZZIP_FILE* fp, void* buf, zzip_size_t len)

zzip_size_t
zzip_fread(void* ptr, zzip_size_t size, zzip_size_t nmemb, ZZIP_FILE* file)

no cap, those signatures are literal, copy them exactly bestie 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so zzip_read is literally just doing a read(2) on a real or zipped file. iconic behaviour honestly.

zzip_read is the replacement for read(2) and it will fill the buffer you gave it with bytes from the opened file. it returns the number of bytes read, so when you hit EOF you'll get prompted with the number of bytes actually read β€” not the number you asked for, the number you got. the way that matters 😭✨

and here's the tea πŸ“: if the file-handle is wrapping a stat'able file, then it will literally just perform a normal read(2)-call. otherwise zzip_file_read gets called to decompress the data stream, and any error gets mapped to errno(3). main character error handling fr fr πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Guido Draheim <guidod@gmx.de> and Tomi Ollila <Tomi.Ollila@iki.fi> β€” the icons who made this happen, we stan 🌈⭐


Copyright (c) Guido Draheim, use under copyleft (LGPL,MPL) β€” so go forth and share responsibly bestie 🧚


🌟 SEE ALSO 🌟

(ngl this page doesn't list any, but the ones named up top β€” read(2) and errno(3) β€” are the ones doing the heavy lifting, iykyk πŸ‘€)


heads up: the <zzip/lib.h> include and the exact type names (zzip_ssize_t, zzip_size_t, ZZIP_FILE) are load-bearing. don't freestyle those, fr fr πŸ’€

anyway that's the whole page! this was the zziplib manual, version 0.13.78 β€” catch you in the next one, bye bestie πŸŽ€πŸ’…πŸ¦‹πŸŒΈβœ¨