Functions to allocate different types of xlat nodes.
More...
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/unlang/xlat.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/types.h>
#include <freeradius-devel/unlang/xlat_priv.h>
Go to the source code of this file.
|
int | _xlat_copy (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx, xlat_exp_head_t *out, xlat_exp_head_t const *in) |
|
static int | _xlat_copy_internal (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx, xlat_exp_head_t *out, xlat_exp_head_t const *in) |
| Copy all nodes in the input list to the output list.
|
|
xlat_exp_t * | _xlat_exp_alloc (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx, xlat_type_t type, char const *in, size_t inlen) |
| Allocate an xlat node.
|
|
xlat_exp_t * | _xlat_exp_alloc_null (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx) |
| Allocate an xlat node with no name, and no type set.
|
|
xlat_exp_head_t * | _xlat_exp_head_alloc (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx) |
|
void | _xlat_exp_set_type (NDEBUG_LOCATION_ARGS xlat_exp_t *node, xlat_type_t type) |
| Set the type of an xlat node.
|
|
static xlat_exp_t * | xlat_exp_alloc_pool (NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx, unsigned int extra_hdrs, size_t extra) |
|
void | xlat_exp_set_name (xlat_exp_t *node, char const *fmt, size_t len) |
| Set the format string for an xlat node.
|
|
void | xlat_exp_set_name_buffer (xlat_exp_t *node, char const *fmt) |
| Set the format string for an xlat node, copying from a talloc'd buffer.
|
|
void | xlat_exp_set_name_buffer_shallow (xlat_exp_t *node, char const *fmt) |
| Set the format string for an xlat node from a pre-existing buffer.
|
|
Functions to allocate different types of xlat nodes.
- Id
- d2c9ccc7454fb1d258a48ddcf10d82e26a433328
Definition in file xlat_alloc.c.
◆ _XLAT_PRIVATE
◆ _xlat_copy()
◆ _xlat_copy_internal()
Copy all nodes in the input list to the output list.
- Parameters
-
[in] | ctx | to allocate new nodes in. |
[out] | out | Where to write new nodes. |
[in] | in | Input nodes. |
- Returns
- 0 on success.
- -1 on failure.
Definition at line 228 of file xlat_alloc.c.
◆ _xlat_exp_alloc()
Allocate an xlat node.
- Parameters
-
[in] | ctx | to allocate node in. |
[in] | type | of the node. |
[in] | in | original input string. |
[in] | inlen | the length of the original input string. |
- Returns
- A new xlat node.
Definition at line 138 of file xlat_alloc.c.
◆ _xlat_exp_alloc_null()
Allocate an xlat node with no name, and no type set.
- Parameters
-
[in] | ctx | to allocate node in. |
- Returns
- A new xlat node.
Definition at line 125 of file xlat_alloc.c.
◆ _xlat_exp_head_alloc()
◆ _xlat_exp_set_type()
Set the type of an xlat node.
Also initialises any xlat_exp_head necessary
- Parameters
-
[in] | node | to set type for. |
[in] | type | to set. |
Definition at line 58 of file xlat_alloc.c.
◆ xlat_exp_alloc_pool()
◆ xlat_exp_set_name()
Set the format string for an xlat node.
- Parameters
-
[in] | node | to set fmt for. |
[in] | fmt | talloced buffer to set as the fmt string. |
[in] | len | of fmt string. |
Definition at line 191 of file xlat_alloc.c.
◆ xlat_exp_set_name_buffer()
void xlat_exp_set_name_buffer |
( |
xlat_exp_t * |
node, |
|
|
char const * |
fmt |
|
) |
| |
Set the format string for an xlat node, copying from a talloc'd buffer.
- Parameters
-
[in] | node | to set fmt for. |
[in] | fmt | talloced buffer to set as the fmt string. |
Definition at line 202 of file xlat_alloc.c.
◆ xlat_exp_set_name_buffer_shallow()
void xlat_exp_set_name_buffer_shallow |
( |
xlat_exp_t * |
node, |
|
|
char const * |
fmt |
|
) |
| |
Set the format string for an xlat node from a pre-existing buffer.
- Parameters
-
[in] | node | to set fmt for. |
[in] | fmt | talloced buffer to set as the fmt string. |
Definition at line 213 of file xlat_alloc.c.