qlibs(byte)
byte β byte manipulation/evaluation π β¨
Okay so welcome to the qlibs(byte) manual, bestie β this is the one about byte manipulation/evaluation, and it's lowkey iconic. I'm giving you the whole thing, no cap, every detail intact. π«Ά
β¨ NAME β¨
byte - byte manipulation/evaluation
π SYNTAX π
This is the exact include and the function signatures, so copy-paste energy:
#include "byte.h"
unsigned int byte_chr(const char *haystack,unsigned int len,char
needle);
unsigned int byte_rchr(const char *haystack,unsigned int len,char
needle);
void byte_copy(char *out,unsigned int len,const char *in);
void byte_copyr(char *out,unsigned int len,const char *in);
int byte_diff(const char *one,unsigned int len,const char *two);
int byte_equal(const char *one,unsigned int len,const char *two);
void byte_fill(char *out,unsigned int len,const char c);
void byte_zero(char *out,unsigned int len);
Yes, those line breaks are exactly how they show up on the page β I'm not messing with your signatures. π
π DESCRIPTION π
Now the actual tea. β
byte_chrreturns the smallest integeribetween0andlen-1inclusive such thatone[i]equalsneedle. If no such integer exists,byte_chrreturnslen. And heads up:byte_chrmay read all bytesone[0],one[1], ...,one[len-1], even if not all the bytes are relevant to the answer. πbyte_rchrreturns the largest integeribetween0andlen-1inclusive such thatone[i]equalsneedle. If no such integer exists,byte_rchrreturnslen. It may also read all bytesone[0],one[1], ...,one[len-1], even if not all the bytes are relevant to the answer. πbyte_copycopiesin[0]toout[0],in[1]toout[1], etc., and finallyin[len-1]toout[len-1]. Slay, straightforward. β¨byte_copyrcopiesin[len-1]toout[len-1],in[len-2]toout[len-2], etc., andin[0]toout[0]. Reverse-order bestie. π¦byte_diffreturns negative,0, or positive, depending on whether the stringone[0],one[1], ...,one[len-1]is lexicographically smaller than, equal to, or greater than the stringone[0],one[1], ...,one[len-1]. When the strings are different,byte_diffdoes not read bytes past the first difference. And yes, the page literally saysoneboth times in that comparison β I'm not fixing it, I'm delivering it exactly, periodt. πbyte_equalreturns1if the strings are equal,0otherwise. When the strings are different,byte_equaldoes not read bytes past the first difference. πbyte_fillfillsout[0],out[1], ...,out[len-1]with a single bytec. πbyte_zerosetsout[0],out[1], ...,out[len-1]to0. Zero-out era. πΈ
π SEE ALSO π
Go give these a little look when you're done, bestie:
That's the whole SEE ALSO list β no extras, no cap. π«Ά
Final cute little sign-off: this is page 3 of the qlibs(byte) manual β that's the footer energy, and the page doesn't list a date, so I'm not inventing one. π
β¨
π¦ where this page comes from
- alpine 3.24: fehqlibs-doc 31-r0 Β· Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms