The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
regex.c File Reference

Wrappers around various regular expression libraries. More...

Go to the source code of this file.

Functions

int fr_regex_cmp_op (fr_token_t op, fr_value_box_t const *a, fr_value_box_t const *b)
 Compare two boxes using an operator. More...
 

Detailed Description

Wrappers around various regular expression libraries.

Definition in file regex.c.

Function Documentation

◆ fr_regex_cmp_op()

int fr_regex_cmp_op ( fr_token_t  op,
fr_value_box_t const *  a,
fr_value_box_t const *  b 
)

Compare two boxes using an operator.

Todo:
  • allow /foo/i on the RHS

However, this involves allocating intermediate sbuffs for the unescaped RHS, and all kinds of extra work. It's not overly hard, but it's something we wish to avoid for now.

Parameters
[in]opto use in comparison. MUST be T_OP_REG_EQ or T_OP_REG_NE
[in]aValue to compare, MUST be FR_TYPE_STRING
[in]buncompiled regex as FR_TYPE_STRING
Returns
  • 1 if true
  • 0 if false
  • -1 on failure.

Definition at line 1360 of file regex.c.

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