radcli_ctx_set_opt_str(3)

πŸ“¦ version 2.0.1, in arch rolling

πŸ’… 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 is RADCLI_OPT_TYPE_INT, she is not the one β€” use radcli_ctx_set_opt_int() instead. wrong tool, bestie, we've all been there πŸ’€

πŸŽ€ PARAMETERS πŸŽ€

  • ctx β€” a context from radcli_ctx_new() or radcli_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 with radcli_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: NULL ctx, opt out of range, wrong type for opt, or an invalid val for opt'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