The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
calc.h File Reference
#include <freeradius-devel/util/value.h>
+ Include dependency graph for calc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int fr_value_calc_assignment_op (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_token_t op, fr_value_box_t const *src))
 Calculate DST OP SRC. More...
 
int fr_value_calc_binary_op (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_type_t hint, fr_value_box_t const *a, fr_token_t op, fr_value_box_t const *b))
 Calculate DST = A OP B. More...
 
int fr_value_calc_list_cmp (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_list_t const *list1, fr_token_t op, fr_value_box_list_t const *list2)
 
int fr_value_calc_list_op (TALLOC_CTX *ctx, fr_value_box_t *box, fr_token_t op, fr_value_box_list_t const *list)
 Apply a set of operations in order to create an output box. More...
 
int fr_value_calc_nary_op (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_type_t type, fr_token_t op, fr_value_box_t const *group))
 Calculate DST = OP { A, B, C, ... More...
 
int fr_value_calc_unary_op (TALLOC_CTX *ctx, fr_value_box_t *dst, fr_token_t op, fr_value_box_t const *src))
 Calculate unary operations. More...
 

Function Documentation

◆ fr_value_calc_assignment_op()

int fr_value_calc_assignment_op ( TALLOC_CTX *  ctx,
fr_value_box_t dst,
fr_token_t  op,
fr_value_box_t const *  src 
)

Calculate DST OP SRC.

e.g. "foo += bar".

This is done by doing some sanity checks, and then just calling the "binary operation" function.

Definition at line 2387 of file calc.c.

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

◆ fr_value_calc_binary_op()

int fr_value_calc_binary_op ( TALLOC_CTX *  ctx,
fr_value_box_t dst,
fr_type_t  hint,
fr_value_box_t const *  a,
fr_token_t  op,
fr_value_box_t const *  b 
)

Calculate DST = A OP B.

The result is written to DST only after it has been calculated. So it's safe to pass DST as either A or B. DST should already exist.

This function should arguably not take comparison operators, but whatever. The "promote types" code is the same for all of the binary operations, so we might as well just have one function.

Definition at line 1893 of file calc.c.

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

◆ fr_value_calc_list_cmp()

int fr_value_calc_list_cmp ( TALLOC_CTX *  ctx,
fr_value_box_t dst,
fr_value_box_list_t const *  list1,
fr_token_t  op,
fr_value_box_list_t const *  list2 
)

Definition at line 2645 of file calc.c.

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

◆ fr_value_calc_list_op()

int fr_value_calc_list_op ( TALLOC_CTX *  ctx,
fr_value_box_t box,
fr_token_t  op,
fr_value_box_list_t const *  list 
)

Apply a set of operations in order to create an output box.

Definition at line 2576 of file calc.c.

+ Here is the call graph for this function:

◆ fr_value_calc_nary_op()

int fr_value_calc_nary_op ( TALLOC_CTX *  ctx,
fr_value_box_t dst,
fr_type_t  type,
fr_token_t  op,
fr_value_box_t const *  group 
)

Calculate DST = OP { A, B, C, ...

}

The result is written to DST only after it has been calculated. So it's safe to pass DST as one of the inputs. DST should already exist.

Definition at line 2228 of file calc.c.

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

◆ fr_value_calc_unary_op()

int fr_value_calc_unary_op ( TALLOC_CTX *  ctx,
fr_value_box_t dst,
fr_token_t  op,
fr_value_box_t const *  src 
)

Calculate unary operations.

e.g. "foo++", or "-foo".

Definition at line 2448 of file calc.c.

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