gnutls_range_split(3)

πŸ’– gnutls_range_split(3) πŸ’–

okay bestie, welcome to the gnutls manual β€” yes THAT gnutls, the TLS library, and yes this page is gonna be cute AND correct. no cap.


✨ NAME ✨

gnutls_range_split β€” an API function, and honestly? a whole little lifesaver. 🫢


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

int gnutls_range_split(gnutls_session_t session, const gnutls_range_st *
orig, gnutls_range_st * next, gnutls_range_st * remainder);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” bestie it's literally just a gnutls_session_t type. that's the vibe. πŸ’…
  • const gnutls_range_st * orig β€” the original range, the one the user handed you. untouched, unbothered, iconic. πŸ‘‘
  • gnutls_range_st * next β€” the returned range that can actually fit and be conveyed in a TLS record. the chunk that gets to go first. ✨
  • gnutls_range_st * remainder β€” the returned remaining range, aka whatever's left over after next did its thing. πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea. you use this function when you need to hide the length of some very long data that you literally cannot hand straight over to gnutls_record_send_range(). πŸ™ˆ

in that case, call this function with your desired length-hiding range sitting in orig. the returned next value is then what you use in your next call to gnutls_record_send_range(), together with the partial data. and then you just… keep doing that. repeat the whole process until remainder is (0,0). that's it, that's the loop, periodt. πŸ”


⭐ RETURNS ⭐

  • 0 β€” in case splitting succeeds. slay. πŸŽ‰
  • non zero β€” in case of error. 😭

and heads up, bestie: orig is not changed. meanwhile the values of next and remainder are modified, because that's where the resulting values get stored. don't get it twisted. πŸ’€


🌈 REPORTING BUGS 🌈

found a bug? not me ignoring it β€” report it, fr fr:


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.


🧚 SEE ALSO 🧚

the full documentation for gnutls is maintained as a Texinfo manual. if the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit:

https://www.gnutls.org/manual/


lowkey the most important part: read the full manual. iykyk. πŸ“š

and that's the whole page, bestie β€” you ate it. this was gnutls_range_split(3) from the gnutls manual, version 3.8.13. mwah, go forth and split those ranges. πŸ’…πŸŒΈπŸ’–

πŸ“¦ where this page comes from