The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Base, utility functions for the unlang library. More...
#include "unlang_priv.h"
Go to the source code of this file.
Functions | |
void | unlang_global_free (void) |
int | unlang_global_init (void) |
void | unlang_register (int type, unlang_op_t *op) |
Register an operation with the interpreter. More... | |
bool | unlang_section (CONF_SECTION *cs) |
Return whether a section has unlang data associated with it. More... | |
Variables | |
static uint32_t | instance_count |
static TALLOC_CTX * | unlang_ctx = NULL |
unlang_op_t | unlang_ops [UNLANG_TYPE_MAX] |
Different operations the interpreter can execute. More... | |
Base, utility functions for the unlang library.
Definition in file base.c.
void unlang_global_free | ( | void | ) |
int unlang_global_init | ( | void | ) |
void unlang_register | ( | int | type, |
unlang_op_t * | op | ||
) |
Register an operation with the interpreter.
The main purpose of this registration API is to avoid intermixing the xlat, condition, map APIs with the interpreter, i.e. the callbacks needed for that functionality can be in their own source files, and we don't need to include supporting types and function declarations in the interpreter.
Later, this could potentially be used to register custom operations for modules.
The reason why there's a function instead of accessing the unlang_op array directly, is because 'type' really needs to go away, as needing to add ops to the unlang_type_t enum breaks the pluggable module model. If there's no explicit/consistent type values we need to enumerate the operations ourselves.
[in] | type | Operation identifier. Used to map compiled unlang code to operations. |
[in] | op | unlang_op to register. |
Definition at line 65 of file base.c.
bool unlang_section | ( | CONF_SECTION * | cs | ) |
unlang_op_t unlang_ops[UNLANG_TYPE_MAX] |