radcli_avp_list_error(3)
π radcli_avp_list_error β ok so bestie, did anything break?
hey bestie π«Ά this is a page from the Radius client library man pages, and it's a short one but honestly iconic. It's radcli_avp_list_error(3) and it's your one-shot vibe check for a list of AVPs. Let's go β¨
πΈ NAME
radcli_avp_list_error β check whether any radcli_avp_add_*() / _by_num() call on list has ever failed. Ever. Like, in its whole life. π
β¨ SYNOPSIS
#include <radcli/>
int radcli_avp_list_error(
const radcli_avp_list *list
);
π DESCRIPTION
okay so here's the situation. The absolute second any add call on a given list fails, that list remembers it. And not in a "haha whatever, moving on" way β it's sticky: it remembers the first failure, not just the most recent one. π
Why does that matter? Because it lets you build a whole request as a flat sequence of add calls, no per-call check, and then just check once, right here, before sending. Bestie, do you understand what that saves you? It saves you from this ~6-line block:
if (radcli_avp_add_...(...) != 0) { log; abort; }
...repeated at every single call site π β when there is honestly only one realistic recovery action anyway (abort the whole request), no matter which attribute failed to add. It's giving "why are we like this". So we don't do that anymore. π¦
Now, important: this function is purely observational. It does not change any radcli_avp_add_*()'s own behavior. Not even a little. Every add call is still attempted and still returns its own 0/-1 exactly as it would if this function didn't exist β even after an earlier add on the same list has already failed. So if you're a caller who checks each call individually, or you're deliberately testing that one bad attribute gets rejected before you add others (the way tests/avp.c does), you see no difference. None. Zero. Nada. π
This function just adds a second, aggregate way to notice a failure that already happened β for the caller who'd rather check once than at every call site. Main character energy tbh. π
π§ PARAMETERS
listβ the list to check. And listen:NULLcounts as an error (there's nothing to build onto, bestie). This matches how everyradcli_avp_add_*()already treats aNULLlist as failure, which means you do not need a separateif (list == NULL)check right afterradcli_avp_list_new()before you start relying on this. Slay, one less line. π
π RETURN VALUE
non-zero if list is NULL or any add call on it has ever failed, 0 otherwise. That's it. That's the whole return value. β
π₯ SEE ALSO
the whole friend group, fr fr:
radcli_avp_add_bytes(3)radcli_avp_add_bytes_by_num(3)radcli_avp_add_gigawords64(3)radcli_avp_add_gigawords64_by_num(3)radcli_avp_add_ip4(3)radcli_avp_add_ip4_by_num(3)radcli_avp_add_ip4prefix(3)radcli_avp_add_ip4prefix_by_num(3)radcli_avp_add_ip6(3)radcli_avp_add_ip6_by_num(3)radcli_avp_add_str(3)radcli_avp_add_str_by_num(3)radcli_avp_add_uint32(3)radcli_avp_add_uint32_by_num(3)radcli_avp_add_uint64(3)radcli_avp_add_uint64_by_num(3)radcli_avp_add_username(3)radcli_avp_concat_str(3)radcli_avp_concat_str_by_num(3)radcli_avp_def(3)radcli_avp_get(3)radcli_avp_get_by_num(3)radcli_avp_get_bytes(3)radcli_avp_get_bytes_by_num(3)radcli_avp_get_cstr(3)radcli_avp_get_cstr_by_num(3)radcli_avp_get_gigawords64(3)radcli_avp_get_gigawords64_by_num(3)radcli_avp_get_ip4prefix(3)radcli_avp_get_ip4prefix_by_num(3)radcli_avp_get_ip6(3)radcli_avp_get_ip6_by_num(3)radcli_avp_get_uint32(3)radcli_avp_get_uint32_by_num(3)radcli_avp_get_uint64(3)radcli_avp_get_uint64_by_num(3)radcli_avp_iter_next(3)radcli_avp_list_free(3)radcli_avp_list_iter(3)radcli_avp_list_new(3)
π real talk: if you're checking every single add call by hand, this page is literally your sign to stop. check once, bestie. live your life. π¦
k bye, this page is from radcli, dated 2026-10-10 β go off, you absolute icon ππ
π¦ where this page comes from
- arch rolling: radcli 2.0.1-1 Β· BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms