GENDERS_LOAD_DATA(3)
π GENDERS_LOAD_DATA β the genders_load_data(3) glow-up π
okay bestie, welcome to libgenders, section 3 of the manual. today's main character is genders_load_data() β the function that literally goes and gets your genders file and reads it. she's the one who opens the door, no cap. πͺβ¨
β¨ SYNOPSIS β¨
#include <genders.h>
int genders_load_data(genders_t handle, const char *filename);
π¦ DESCRIPTION π¦
so here's the vibe: genders_load_data() reads and parses the genders file that filename points at. that's it. that's the job. she shows up, she reads it, she parses it, she's done. π
and if filename is NULL? no problem, she's not gonna throw a fit. she'll just go for the default genders file, which is defined by GENDERS_DEFAULT_FILE. periodt.
handle is a genders handle β and not just any handle, one that was created by genders_handle_create(3). gotta be born legit, yk? π
now the part that actually matters: once genders_load_data() has been called, all the info about that genders file gets stored inside the genders handle you passed in. and every other genders C API function is gonna reach into that handle and use it. so from that moment on, every future use of handle with any other genders C API function is directly associated with the genders file that filename pointed at β or the default genders file, if filename was NULL. she's committed. she's locked in. it's giving relationship. π«Ά
π RETURN VALUES π
- On success? 0 is returned. slay. β¨
- On error? -1 is returned, and an error code gets dropped into
handle.
you can grab that error code with genders_errnum(3), and get a lil description of it with genders_strerror(3). the error codes themselves live in genders.h. π
π ERRORS π
here's the whole rogues gallery of things that can go wrong. read them, memorize them, respect them:
GENDERS_ERR_NULLHANDLEβ thehandleparameter isNULL. bestie. the genders handle has to be created withgenders_handle_create(3). you can't just roll up with nothing. πGENDERS_ERR_OPENβ the genders file thatfilenamepoints at cannot be opened for reading. door's locked, no key, not today.GENDERS_ERR_READβ error reading the genders file thatfilenamepoints at. it opened, but the reading part went sideways. πGENDERS_ERR_PARSEβ the genders file thatfilenamepoints at is incorrectly formatted. grammar check failed fr fr.GENDERS_ERR_ISLOADEDβgenders_load_data(3)has already been called withhandle. she already did this one, girl. one and done.GENDERS_ERR_OVERFLOWβ a line in the genders database is longer than the maximum allowed length. too much text, not enough room, tragic. πGENDERS_ERR_OUTMEMβmalloc(3)has failed internally, meaning the system is out of memory. she's running on empty, genuinely.GENDERS_ERR_MAGICβhandlehas an incorrect magic number. that meanshandledoesn't point to a genders handle at all, OR it's a handle that's already been destroyed bygenders_handle_destroy(3). poof. gone. ghost handle. π»GENDERS_ERR_INTERNALβ an internal system error has occurred. we don't know. the vibes are off. π
π FILES π
/usr/include/genders.h
π SEE ALSO π
libgenders(3)genders_handle_create(3)genders_handle_destroy(3)genders_errnum(3)genders_strerror(3)
lowkey important reminder: if you're passing ahandlearound, make sure it came fromgenders_handle_create(3)and hasn't beengenders_handle_destroy(3)'d, becauseGENDERS_ERR_NULLHANDLEandGENDERS_ERR_MAGICare waiting to humble you. π«Ά
and that's the whole page, bestie!! brought to you by LLNL, dated August 2003 β yes, she's been iconic since 2003 and she's still serving. mwah πβ¨ππ¦
π¦ where this page comes from
- epel 10: libgenders-devel 1.28.1~^20231119git27b915d-5.el10_2 Β· GPL-2.0-only
- fedora 43: libgenders-devel 1.28.1~^20231119git27b915d-5.fc43 Β· GPL-2.0-only
- fedora 43: libgenders-devel 1.28.1~^20231119git27b915d-5.fc43 Β· GPL-2.0-only
- fedora 44: libgenders-devel 1.28.1~^20231119git27b915d-6.fc44 Β· GPL-2.0-only
- fedora 44: libgenders-devel 1.28.1~^20231119git27b915d-6.fc44 Β· GPL-2.0-only
- opensuse-leap 16.0: genders-devel 1.32-bp160.1.11 Β· GPL-2.0-or-later
- opensuse-leap 16.0: genders-devel 1.32-bp160.1.11 Β· GPL-2.0-or-later
- opensuse-leap 16.0: genders-devel 1.32-bp160.1.11 Β· GPL-2.0-or-later
- opensuse-leap 16.0: genders-devel 1.32-bp160.1.11 Β· GPL-2.0-or-later
- Copyright (C) 2007-2019 Lawrence Livermore National Security, LLC
- Copyright (C) 2001-2007 The Regents of the University of California
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms