Trf_ShiftRegister(3)

πŸ’« Trf_ShiftRegister β€” shift the register, bestie πŸ’«

okay so this is a Library Functions Manual page, and the function we're obsessing over today is Trf_ShiftRegister from transform.h πŸ’– it literally just shifts the register. that's the whole name, that's the whole vibe, no cap.


✨ SYNOPSIS ✨

#include <transform.h>

void Trf_ShiftRegister
(
     void *buffer,
     void *in,
     int shift,
     int buffer_length
);

like. look at her. four params, returns nothing, does one job and does it flawlessly πŸ‘‘


πŸŽ€ PARAMETERS πŸŽ€

  • void *buffer β€” the data getting shifted to the left. she's the main character here, she's the one doing the moving πŸ¦‹
  • void *in β€” the 2nd register, aka the one getting shifted into the buffer. supporting role but lowkey essential πŸ’…
  • int shift β€” how many bytes to shift out (and in, bestie, it goes both ways πŸ”)
  • int buffer_length β€” the length of buffer and in, measured in bytes. both of them. same number. don't @ me πŸ™ˆ

🌸 DESCRIPTION 🌸

so the register gets shifted shift bytes to the left. that's it, that's the tea β˜•

but wait, because if we just shifted and left it there we'd have a bunch of empty sad little bytes on the right, right? 😭 so the way that it works is: the same number of bytes from the left of the 2nd register (that's in, keep up bestie) gets inserted at the right of buffer, replacing all the lost bytes.

it's giving very much a conveyor belt situation. stuff slides out the left, new stuff slides in from in on the right, nothing is ever empty, everything stays full, we love a seamless transition ✨🫢


🌈 SEE ALSO 🌈

the whole friend group, fr fr β€” go read these too:


πŸ’€ ngl this page came from c2man transform.h, dated 27 August 2002 β€” so yeah she's vintage, she's an icon, she's been shifting registers since before some of us were born. respect the elders, bestie 🫢

that's the whole page, mwah, go shift something πŸ’–βœ¨