GENDERS_ISNODE(3)

πŸ’– GENDERS_ISNODE β€” bestie's guide to node/attr/value check routines πŸ’–

ok so this is GENDERS_ISNODE(3) from the LIBGENDERS crew, and it's literally three lil check-in routines that answer the question "hey, is this a thing in the genders file?" πŸŽ€

They live in section 3 of the manual, they're part of libgenders, and they're your new besties. Let's go πŸ’…


✨ NAME ✨

genders_isnode, genders_isattr, genders_isattrval β€” node, attribute, value check routines

Like, the trio. The girlies. The vibe check squad. 🫢


🌸 SYNOPSIS 🌸

#include <genders.h>

int genders_isnode(genders_t handle, const char *node);

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

int genders_isattrval(genders_t handle, const char *attr, const char
*val);

ok first of all? #include <genders.h>. Always. Non-negotiable. Periodt. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

genders_isnode() β€” this one tests if the node pointed to by node is listed in the genders file. and if node is NULL? bestie, it just tests the current node instead. main character energy honestly 😌

genders_isattr() β€” tests if the attribute pointed to by attr is listed for some node in the genders file. not a specific one, just... somewhere. it's giving "do you know her" πŸ‘‘

genders_isattrval() β€” tests if the attribute pointed to by attr is equal to the value pointed to by val for some node in the genders file. so like, the full package. the pair. the duo. πŸ’–


🌈 RETURN VALUES 🌈

For genders_isnode():

  • if node is listed in the genders file β†’ 1 is returned πŸ”₯
  • if it is not listed β†’ 0 is returned πŸ’€

For genders_isattr():

  • if attr is listed in the genders file β†’ 1 is returned πŸ”₯
  • if it is not listed β†’ 0 is returned πŸ’€

For genders_isattrval():

  • if attr=val is listed in the genders file β†’ 1 is returned πŸ”₯
  • if it is not listed β†’ 0 is returned πŸ’€
and on error? ALL THREE of them return -1, no cap. and an error code gets returned in handle. you can grab that error code with genders_errnum(3), and a lil description of it with genders_strerror(3). the error codes are defined in genders.h. πŸ’…

πŸ’œ ERRORS πŸ’œ

  • GENDERS_ERR_NULLHANDLE β€” the handle parameter is NULL. bestie the handle has to be created with genders_handle_create(3) first, we can't work with nothing πŸ™ˆ
  • GENDERS_ERR_NOTLOADED β€” genders_load_data(3) has not been called to load genders data. no data loaded, no answers, sorry babe 😭
  • GENDERS_ERR_PARAMETERS β€” an incorrect parameter has been passed in. wrong girl, wrong vibe, try again πŸ’€
  • GENDERS_ERR_MAGIC β€” handle has an incorrect magic number. this means handle does not point to a genders handle, OR it's been destroyed by genders_handle_destroy(3). she's gone, she's not coming back 🧚

πŸ“ FILES πŸ“

  • /usr/include/genders.h

the sacred text. the blueprint. iykyk ⭐


πŸŽ€ SEE ALSO πŸŽ€

go read them, they're all iconic, you'll be obsessed 🫢


ok that's the whole page bestie, mwah πŸ’‹ this one came from LLNL, dated August 2003, and it's GENDERS_ISNODE(3) out of LIBGENDERS. slay, ate, no crumbs. πŸ’…βœ¨