GENDERS_INDEX_NODES(3)

πŸ’– GENDERS_INDEX_NODES(3) πŸ’–

ok bestie, welcome to genders_index_attrvals from LIBGENDERS β€” this is the glow-up your genders searches have been waiting for, no cap ✨


🌸 NAME 🌸

genders_index_attrvals β€” internally index attribute values in genders 🫢


✨ SYNOPSIS ✨

#include <genders.h>

int genders_index_attrvals(genders_t handle, const char *attr);

like. that's it. two args. she's simple, she's powerful, she's iconic πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea πŸ“ β€” genders_index_attrvals() internally indexes attribute values in a genders handle, so that genders searches can be done more quickly in the genders_getnodes(3) and genders_isattrval(3) functions. it's giving "prep work that pays off later" energy, fr fr.

Only one attribute can be indexed at a time through this function. and lowkey important: subsequent calls to this function with a different attribute will overwrite earlier indexes 😭 so don't come crying to me when your old index is just... gone. she's replaced. that's the vibe.


🌈 RETURN VALUES 🌈

On success, 0 is returned. slay ✨

On error, -1 is returned, and an error code is returned in handle. You can grab that error code via genders_errnum(3), and a lil description of the error code via genders_strerror(3). the error codes are defined in genders.h β€” that's where they live, bestie πŸ’œ


πŸ’€ ERRORS πŸ’€

ok so when things go wrong, here's what you might catch:

  • GENDERS_ERR_NULLHANDLE β€” the handle parameter is NULL πŸ™ˆ the genders handle must be created with genders_handle_create(3). you can't search with vibes alone, you need an actual handle.
  • GENDERS_ERR_NOTLOADED β€” genders_load_data(3) has not been called to load genders data. she's running on an empty stomach, feed her the data first πŸ“
  • GENDERS_ERR_PARAMETERS β€” an incorrect parameter has been passed in. wrong arg, bestie, try again 😭
  • GENDERS_ERR_NOTFOUND β€” the attribute pointed to by attr cannot be found in the genders file. it's simply not there. not in this house 🚫
  • GENDERS_ERR_OUTMEM β€” malloc(3) has failed internally, system is out of memory. the machine said "i have nothing left to give" πŸ’€
  • GENDERS_ERR_MAGIC β€” handle has an incorrect magic number. meaning: handle does not point to a genders handle, OR handle has been destroyed by genders_handle_destroy(3). the magic is ✨gone✨, it's a ghost handle now πŸ‘»
  • GENDERS_ERR_INTERNAL β€” an internal system error has occurred. not us, not you, it's the system being messy πŸ€·β€β™€οΈ

πŸŽ€ FILES πŸŽ€

  • /usr/include/genders.h

πŸ‘‘ SEE ALSO πŸ‘‘

libgenders(3), genders_handle_create(3), genders_load_data(3), genders_getnodes(3), genders_isattrval(3), genders_errnum(3), genders_strerror(3)


real talk: if you're indexing one attr and then index a different one, the first index is gone gone. not deprecated, not undefined β€” just overwritten. plan accordingly, bestie 🫢

and that's the whole page, you ate it πŸ’… this one came out of LLNL, dated August 2003, and yes the page header was GENDERS_INDEX_NODES(3) and the footer was the same β€” LIBGENDERS edition, forever iconic ⭐ stay indexed, stay slay πŸ¦‹πŸ’–