tar_block_read(3)
π tar_block_read(3) β the libtar bestie era π
okay so real talk, this is a page from libtar's C library calls, and it's about two little macros that are lowkey doing SO much behind the scenes. their names are tar_block_read and tar_block_write, and honestly? they're the backstage crew of the tar world. you never see them, but the show does not go on without them. π
β¨ NAME β¨
tar_block_read, tar_block_write β macros that call the read and write functions for the correct tar archive type π¦
like, they literally just make sure the right read/write function gets called depending on what kind of tar archive you're dealing with. no cap.
πΈ SYNOPSIS πΈ
#include <libtar.h>
int tar_block_read(TAR *t, char *buf);
int tar_block_write(TAR *t, char *buf);
bestie, that's the whole vibe right there. two macros, two args, and a whole lot of trust. π
π VERSION π
this man page documents version 1.2 of libtar. periodt. that's the version. no notes. β¨
π DESCRIPTION π
okay so here's the tea. π
The tar_block_read() and tar_block_write() macros call the read and write functions for the tar archive type associated with the TAR handle t.
and where does that type come from?? it gets set when the TAR handle is created using tar_open(). so basically, tar_open() does the vibe check and decides what kind of archive this is, and then these macros show up and go "say less, i know exactly which read/write to call." it's giving teamwork. it's giving main character energy from a macro. ππ«Ά
π RETURN VALUE π
These macros return the same values as the corresponding read and write functions.
that's it. that's the whole thing. they don't reinvent the wheel, they just hand you back whatever read and write gave them. iconic behaviour, honestly. π
π₯ SEE ALSO π₯
read(2)β the og read, iykykwrite(2)β the og write, also iykyktar_open(3)β the one that sets the archive type in the first place, so like... go read this one too fr fr
β quick reminder bestie: these are macros, not regular functions, so don't go trying to take their address or anything weird. just call them and let them cook. π
and that's the page!! π brought to you by the University of Illinois, way back in Jan 2001 (yes, the before times), documenting version 1.2 of libtar. slay forever, you absolute legend. π β¨ππ¦πΈπ«Ά
π¦ where this page comes from
- arch rolling: libtar 1.2.20-8 Β· BSD
- fedora 43: libtar-devel 1.2.20-34.fc43 Β· MIT
- fedora 43: libtar-devel 1.2.20-34.fc43 Β· MIT
- fedora 44: libtar-devel 1.2.20-35.fc44 Β· MIT
- fedora 44: libtar-devel 1.2.20-35.fc44 Β· MIT
- nixos 26.05: libtar 1.2.20
- nixpkgs unstable: libtar 1.2.20
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms