TAB(3)

πŸ“¦ version 93vu, in opensuse-leap 16.0

πŸ’… TAB(3) β€” Library Functions Manual πŸ’…

okay bestie, this is TAB(3) from the Library Functions Manual β€” the simple table lookup routines chapter, and it’s lowkey iconic in a β€œtiny lookup table” way. 🫢


✨ NAME ✨

tab β€” simple table lookup routines

πŸŽ€ SYNOPSIS πŸŽ€

#include <ast.h>

int tabindex(const void* tab, int size, const char* name); void*
tablook(const void* tab, int size, const char* name);

πŸ’– DESCRIPTION πŸ’–

so these routines are doing linear lookups in small tables β€” like, on the order of 32 elements, not some giant main-character database. πŸ’€

Each table element has a size of size bytes, and the beginning of the element points to a name that gets matched by the lookup routines. that’s the whole shape of it, no cap. πŸ¦‹

  • tabindex β€” returns the index of the table element in tab that matches name. if there’s no match, it returns -1 (rip, not found 😭).
  • tablook β€” returns a pointer to the table element in tab that matches name. if there’s no match, it returns 0 (empty-handed bestie πŸ™ˆ).

πŸ¦‹ SEE ALSO πŸ¦‹


k byeee β€” that’s TAB(3) from the Library Functions Manual. πŸ’– the footer is literally just TAB(3); no source/version/date line to report on this one, so that’s the whole tea. 🫢

πŸ“¦ where this page comes from