scan_hexdump(3)
π NAME π
okay bestie, say hi to scan_hexdump β she decodes hexdump data. that's it, that's the job, and she does it flawlessly. no cap. β¨
πΈ SYNTAX πΈ
like, the way you summon her:
#include <libowfat/textcode.h>
size_t scan_hexdump(const char *src,char *dest,size_t* destlen);
look at that signature. gorgeous. iconic. π
π¦ DESCRIPTION π¦
so scan_hexdump takes hexdump data from src and decodes it into dest. simple. slay. π«Ά
the moment she bumps into any invalid input characters she just stops. no drama, no guessing β she's done. and then:
- she writes the number of decoded bytes that landed in dest into
*destlen - and she returns the number of bytes she decoded from src
ngl, here's the tea: in the real world, hexdump data is sometimes allowed to contain whitespace characters or new lines. this function will not allow those, and will just return the decoded data up until that point. so don't come for her, she's strict on purpose. π
and the flexible queen she is:
- dest can be
NULL - destlen can be
NULL - dest can be src β in-place, we love a multitasker π
π RETURN VALUE π
scan_hexdump returns the number of bytes successfully scanned and processed from src. that's the number. that's the whole vibe check. β
π EXAMPLES π
here's her in action, serving exactly what you'd expect:
scan_hexdump("302e",buf,&i) -> return 4, i=2, buf="0."
return 4, i=2, and buf="0.". ate and left no crumbs. π₯
π SEE ALSO π
go give her friends some love too:
and that's the whole page, bestie π this was scan_hexdump(3) from the Library Functions Manual β go decode something cute, mwah π§
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms