The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions | Variables
base.c File Reference

Base, utility functions for the unlang library. More...

#include "unlang_priv.h"
+ Include dependency graph for base.c:

Go to the source code of this file.

Functions

static int _unlang_global_free (UNUSED void *uctx)
 
static int _unlang_global_init (UNUSED void *uctx)
 
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 TALLOC_CTX * unlang_ctx = NULL
 
unlang_op_t unlang_ops [UNLANG_TYPE_MAX]
 Different operations the interpreter can execute. More...
 

Detailed Description

Base, utility functions for the unlang library.

Id
fc841c11f4fbd9733ee4b58675dd33431bc2560d

Definition in file base.c.

Function Documentation

◆ _unlang_global_free()

static int _unlang_global_free ( UNUSED void *  uctx)
static

Definition at line 72 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _unlang_global_init()

static int _unlang_global_init ( UNUSED void *  uctx)
static

Definition at line 80 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_global_init()

int unlang_global_init ( void  )

Definition at line 133 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_register()

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.

Parameters
[in]typeOperation identifier. Used to map compiled unlang code to operations.
[in]opunlang_op to register.

Definition at line 63 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unlang_section()

bool unlang_section ( CONF_SECTION cs)

Return whether a section has unlang data associated with it.

Parameters
[in]csto check.
Returns
  • true if it has data.
  • false if it doesn't have data.

Definition at line 40 of file base.c.

Variable Documentation

◆ unlang_ctx

TALLOC_CTX* unlang_ctx = NULL
static

Definition at line 70 of file base.c.

◆ unlang_ops

Different operations the interpreter can execute.

Definition at line 31 of file base.c.