radcli_ctx_set_opt_str(3)
π radcli_ctx_set_opt_str(3) β the string-option setter, bestie
okay so this is a page straight out of the radcli manual (radius client library, yes that one) and it's literally all about radcli_ctx_set_opt_str β the little function that puts a string into a config option slot and actually double-checks it for you β¨
πΈ NAME πΈ
radcli_ctx_set_opt_str β set a string-typed configuration option. that's it, that's the whole job π
π¦ SYNOPSIS π¦
#include <radcli/>
int radcli_ctx_set_opt_str(
radcli_ctx *ctx,
radcli_opt_id opt,
const char *val
);
like, she's a three-argument queen and she returns an int, no cap π
π DESCRIPTION π
okay so what she does is: she stores val for opt on ctx β but not blindly, bestie, no ma'am π she validates it against opt's own grammar first. it's giving "trust but verify" energy.
for example, #RADCLI_OPT_AUTHSERVER accepts the "host[:port[:secret]]" form β literally the same shape a config file's authserver line takes. iconic consistency, honestly π
and she's valid for any radcli_opt_id whose RC_OPTION_TABLE type is RADCLI_OPT_TYPE_STR or RADCLI_OPT_TYPE_SRV. π«Ά
β οΈ but if your option isRADCLI_OPT_TYPE_INT, she is not the one β useradcli_ctx_set_opt_int()instead. wrong tool, bestie, we've all been there π
π PARAMETERS π
ctxβ a context fromradcli_ctx_new()orradcli_ctx_read_config(). your whole vibe lives in here β¨optβ the option to set. pick your fighter π₯valβ the value. but heads up: for#RADCLI_OPT_AUTHSERVER/#RADCLI_OPT_ACCTSERVER, the shared secret is better set withradcli_ctx_set_secret()than embedded in this string. keep the secret in its own lane, periodt π
π₯ RETURN VALUE π₯
0β success. slay, it worked π-1β failure. and the glow-down reasons are:NULLctx,optout of range, wrong type foropt, or an invalidvalforopt's grammar. she tells you no and she means it π
π SEE ALSO π
the whole friend group, fr fr:
radcli_ctx_apply(3), radcli_ctx_free(3), radcli_ctx_get_opt_int(3), radcli_ctx_get_opt_str(3), radcli_ctx_new(3), radcli_ctx_read_config(3), radcli_ctx_read_dictionary(3), radcli_ctx_read_dictionary_from_buffer(3), radcli_ctx_set_opt_int(3), radcli_ctx_set_secret(3), radcli_ctx_set_tls_psk(3) πΈ
and that's the tea β this page is from radcli, dated 2026-10-10 β go set some strings responsibly, bestie, mwah πβ¨
π¦ 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