---
name: "radcli_ctx_new"
section: "3"
platform: "linux"
package: "radcli"
version: "2.0.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/radcli_ctx_new"
---

# radcli\_ctx\_new(3)

Create an empty context, ready for radcli\_ctx\_set\_opt\_str()/ \_set\_opt\_int() and radcli\_ctx\_apply() the fully programmatic ("backup") way to configure radcli without a config file on disk.

## NAME

radcli\_ctx\_new - Create an empty context, ready for radcli\_ctx\_set\_opt\_str()/ \_set\_opt\_int() and radcli\_ctx\_apply()  the fully programmatic ("backup") way to configure radcli without a config file on disk.

## SYNOPSIS

```
#include <radcli/>

radcli_ctx * radcli_ctx_new(
    unsigned flags
);
```

## DESCRIPTION

Allocates a context with no server, secret, or transport configured yet  radcli\_ctx\_apply() must succeed before it is usable for a request. Also loads the built-in RFC 2865/2866/2869 dictionary, the same one radcli\_ctx\_read\_config() always loads, unless RADCLI\_CTX\_NO\_BUILTIN\_DICT is set in flags  so radcli\_dict\_lookup\_num() is non-NULL for well-known attributes right away, without a separate radcli\_ctx\_read\_dictionary() call.

## PARAMETERS

- **flags**

  a bitwise OR of radcli\_ctx\_flags, or 0 for the common case.

## RETURN VALUE

the new context, or NULL on allocation failure, an unknown flags bit, or a failure loading the built-in dictionary.

## SEE ALSO

[*radcli\_ctx\_apply*(3)](/radcli_ctx_apply/3.md), [*radcli\_ctx\_free*(3)](/radcli_ctx_free/3.md), [*radcli\_ctx\_get\_opt\_int*(3)](/radcli_ctx_get_opt_int/3.md), [*radcli\_ctx\_get\_opt\_str*(3)](/radcli_ctx_get_opt_str/3.md), [*radcli\_ctx\_read\_config*(3)](/radcli_ctx_read_config/3.md), [*radcli\_ctx\_read\_dictionary*(3)](/radcli_ctx_read_dictionary/3.md), [*radcli\_ctx\_read\_dictionary\_from\_buffer*(3)](/radcli_ctx_read_dictionary_from_buffer/3.md), [*radcli\_ctx\_set\_opt\_int*(3)](/radcli_ctx_set_opt_int/3.md), [*radcli\_ctx\_set\_opt\_str*(3)](/radcli_ctx_set_opt_str/3.md), [*radcli\_ctx\_set\_secret*(3)](/radcli_ctx_set_secret/3.md), [*radcli\_ctx\_set\_tls\_psk*(3)](/radcli_ctx_set_tls_psk/3.md)
