SNOBOL4ZLIB(3)

πŸ“¦
version 2.3.1 Β· 3 versions
, in fedora 43, fedora 44, opensuse-leap 16.0

πŸ’– SNOBOL4ZLIB πŸ’–

ok so bestie, this is the zlib page from the CSNOBOL4 manual, and it's literally the compression girlie you've been looking for. no cap. πŸŽ€


✨ NAME ✨

zlib β€” the compression/decompression library, but make it accessible from SNOBOL4 πŸ¦‹


✨ SYNOPSYS ✨

like, this is the whole vibe right here:

     -INCLUDE 'zlib.sno'
          ZLIB_COMPRESS(string,[level])
          ZLIB_UNCOMPRESS(string,[wbits],[ibufsize])
          ZLIB_CRC32(string[,starting_value])
          ZLIB_ADLER32(string[,starting_value])

yes queen, four functions, one include, we're doing this πŸ’…


✨ DESCRIPTION ✨

okay so the zlib module gives you direct, in-memory access to zlib's compression and checksum routines. and when I say "in the manner of the Python zlib module" I mean it β€” the Python zlib module. that's the blueprint. that's the moment. ✨

if what you actually want is compressed file I/O, that's a different girl, go see snobol4io(1). 🫢


🌸 the functions, one by one

  • ZLIB_COMPRESS(string,[level]) β€” the optional second argument is your compression level: 0-9 or -1. it defaults to 6. pick your fighter bestie πŸ’ͺ
  • ZLIB_UNCOMPRESS(string,[wbits],[ibufsize]) β€” the optional second argument controls the (log2) window buffer size (and container format?). note the little question mark, that's the manual being honest, not me. the optional third argument picks the initial output buffer size β€” and it will be doubled as needed, so don't stress about sizing it perfectly. she grows 🌱
  • ZLIB_CRC32(string[,starting_value]) β€” the optional second argument is the starting value. you'd use that when you're running a CRC across multiple blocks of data. defaults to zero. πŸ“
  • ZLIB_ADLER32(string[,starting_value]) β€” the optional second argument is the starting value, for running the checksum over multiple blocks of data. defaults to one. ⭐
lowkey the pattern here is: optional starting value = you're chaining blocks together. iconic behavior fr fr.

✨ SEE ALSO ✨

go read these too, they're all part of the same little ecosystem:


✨ AUTHOR ✨

Phil Budne β€” the actual main character who wrote this πŸ‘‘


πŸ’– that's the whole page bestie, you're so ready πŸ’–

and for the record, this was CSNOBOL4B 2.3.1, dated March 31, 2022 β€” so if you're quoting her, quote her right. periodt. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from