SAFE_ADD_ID_TO_LIST(3)

πŸ“¦ version 1.0.5, in nixos 26.05, nixpkgs unstable

πŸ’– safe_add_id_to_list(3) / SAFE_ADD_ID_TO_LIST(3) β€” the safe_id_range_list bestie page πŸ’–

okay so bestie, welcome to the SAFE_ADD_ID_TO_LIST(3) manual page. This is the one about adding an id or a whole range of ids to the list. It’s giving β€œtiny utility, big main character energy.” ✨


🌸 NAME 🌸

safe_add_id_to_list, safe_add_id_range_to_list β€” add an id or range of ids to the list. Periodt. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include "safe_id_range_list.h"

struct safe_id_range_list;
typedef struct safe_id_range_list safe_id_range_list;

int safe_add_id_to_list(safe_id_range_list list, id_t id);
int safe_add_id_range_to_list(safe_id_range_list list, id_t min_id, id_t max_id);

πŸŽ€ DESCRIPTION πŸŽ€

safe_add_id_to_list adds a single id to list. One id. One little icon. Slay. πŸ’–

safe_add_id_range_to_list adds a range of ids to list. The min_id must be less than or equal to max_id, no cap. 🫢

🧚 Parameters 🧚

  • list β€” the safe_id_range_list to add values to. The value must be non-NULL. Like, literally must not be NULL, bestie. 🫠
  • id β€” the id to add. That’s it. That’s the whole job. ✨
  • min_id, max_id β€” the range of ids to add. The min_id must be less than or equal to the max_id. πŸ”₯

🌈 RETURN VALUE 🌈

returns 0 on success and -1 on failure with errno set appropriately. That’s the vibe check: 0 = we ate, -1 = check errno. πŸ’€


πŸ“ ERRORS πŸ“

  • EINVAL β€” the list parameter was NULL, or, in safe_add_id_range_to_list, min_id was greater than max_id. 🚩
  • ENOMEM β€” failed to allocate memory. The memory allocation said β€œnot today,” and honestly? relatable. 😭

πŸ‘‘ AUTHOR πŸ‘‘

James A. Kupsch. Icon behavior. πŸ’œ


⭐ SEE ALSO ⭐


πŸ§šβ€β™€οΈπŸ’– cute little sign-off: this page’s footer is serving 2011-07-26 and SAFE_ADD_ID_TO_LIST(3) energy β€” source/version and date noted, bestie, periodt. πŸ’…πŸŽ€

πŸ“¦ where this page comes from