qlibs:(case)

πŸ“¦ version 31, in alpine 3.24

✨ NAME ✨

case β€” case independent string manipulation/evaluation πŸ’…

okay so this is the qlibs:(case) page, and it's literally all about the case crew: a bunch of functions that do string stuff without caring about upper/lowercase. no cap, they're icons.


πŸŽ€ SYNTAX πŸŽ€

here's the exact include and the whole function lineup, bestie:

#include "case.h"

void case_lowers(s);
void case_lowerb(s,len);
void case_uppers(s);
void case_upperb(s,len);
int case_diffs(s,t);
int case_equals(s,t);
int case_diffrs(s,t);
int case_equalrs(s,t);
int case_starts(s,t);
int case_diffb(s,len,t);
int case_startb(s,len,t);

char *s;
char *t;
unsigned int len;

πŸ¦‹ DESCRIPTION πŸ¦‹

  • case_lowers β€” converts each uppercase byte in the string s to lowercase. s must be 0-terminated, periodt.
  • case_lowerb β€” converts each uppercase byte in the buffer s, of length len, to lowercase. buffer behavior, no 0-termination requirement here.
  • case_uppers β€” converts each lowercase byte in the string s to uppercase. s must be 0-terminated.
  • case_upperb β€” converts each lowercase byte in the buffer s, of length len, to uppercase.
  • case_diffs β€” lexicographically compares lowercase versions of the strings s and t. it returns something positive, negative, or zero when the first is larger than, smaller than, or equal to the second. s and t must be 0-terminated.
  • case_equals β€” means !case_diffs. that's it, that's the whole vibe.
  • case_diffrs and case_equalrs β€” compare strings from right to left instead from left to right. yes, they go the other way, and yes, it's giving main character energy.
  • case_starts β€” returns 1 if a lowercase version of s starts with a lowercase version of t. s and t must be 0-terminated.
  • case_diffb β€” lexicographically compares lowercase versions of the buffers s and t, each of length len. it returns something positive, negative, or zero when the first is larger than, smaller than, or equal to the second.
  • case_startb β€” returns 1 if a lowercase version of the buffer s, of length len, starts with a lowercase version of the string t. t must be 0-terminated.

the case routines are ASCII-specific. they're suitable for programs that handle case-independent networking protocols. all comparisons are performed on unsigned bytes β€” that's lowkey important, so don't forget it 🫢


🌈 SEE ALSO 🌈


and that's the page!! footer vibes: section 3, qlibs:(case) β€” source/version and date included, bestie, we didn't skip a single byte πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from