Trf_QueryMaxRead(3)

✨ NAME ✨

Trf_QueryMaxRead β€” the interface for procedures that want to ask a transformation about the max πŸ’…

(also hi bestie, this one lives in the Library Functions Manual, okurrr)


🌸 SYNOPSIS 🌸

#include <transform.h>

int Trf_QueryMaxRead
(
     Trf_ControlBlock ctrlBlock,
     ClientData clientData
);

πŸŽ€ PARAMETERS πŸŽ€

  • Trf_ControlBlock ctrlBlock β€” the state of the encoder/decoder. like, the whole vibe of where your transform currently is 🫢
  • ClientData clientData β€” arbitrary info, exactly as defined in Trf_TypeDefinition.clientData. whatever you stuffed in there, it comes back to you ✨

πŸ’œ DESCRIPTION πŸ’œ

So basically: this is the number of bytes to read in the next call to the down channel. That's the whole thing. That's the assignment.

The generic trf layer calls this procedure right before it reads data from the channel that sits below the transformation. Which means β€” and this is the iconic part β€” a transformation gets to control its own consumption of characters πŸ‘‘

An example? 'identity with stop after n characters'. That one transfers at most n characters and then, lowkey, fakes all the higher transformations into believing that EOF occurred 😭 then popping it would reveal the truth. Sneaky. Love that for it.

Pattern matching could be used here too (internet protocols !) 🌈


πŸ”₯ SEE ALSO πŸ”₯


okay that's the whole page bestie, go read the other thirty of them, they're all linked above, you got this πŸ¦‹

This one came to you via c2man transform.h, dated 27 August 2002 ⭐ like a little time capsule fr fr, and the page itself is Trf_QueryMaxRead(3). periodt πŸ’–