The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Macros | Functions
pair_inline.c File Reference

AVP privately inlineable manipulation and search API. More...

#include <freeradius-devel/util/pair.h>
#include <freeradius-devel/util/tlist.h>
+ Include dependency graph for pair_inline.c:

Go to the source code of this file.

Macros

#define _INLINE
 
#define _PAIR_PRIVATE   1
 

Functions

_INLINE void fr_pair_list_append (fr_pair_list_t *dst, fr_pair_list_t *src)
 Appends a list of fr_pair_t from a temporary list to a destination list. More...
 
_INLINE bool fr_pair_list_empty (fr_pair_list_t const *list)
 Is a valuepair list empty. More...
 
_INLINE void fr_pair_list_free (fr_pair_list_t *list)
 Free memory used by a valuepair list. More...
 
_INLINE fr_pair_list_tfr_pair_list_from_dlist (fr_dlist_head_t const *list)
 Get the pair list head from a dlist. More...
 
_INLINE fr_pair_tfr_pair_list_head (fr_pair_list_t const *list)
 Get the head of a valuepair list. More...
 
_INLINE fr_pair_tfr_pair_list_next (fr_pair_list_t const *list, fr_pair_t const *item)
 Get the next item in a valuepair list after a specific entry. More...
 
_INLINE size_t fr_pair_list_num_elements (fr_pair_list_t const *list)
 Get the length of a list of fr_pair_t. More...
 
_INLINE void fr_pair_list_prepend (fr_pair_list_t *dst, fr_pair_list_t *src)
 Move a list of fr_pair_t from a temporary list to the head of a destination list. More...
 
_INLINE fr_pair_tfr_pair_list_prev (fr_pair_list_t const *list, fr_pair_t const *item)
 Get the previous item in a valuepair list before a specific entry. More...
 
_INLINE void fr_pair_list_sort (fr_pair_list_t *list, fr_cmp_t cmp)
 Sort a doubly linked list of fr_pair_ts using merge sort. More...
 
_INLINE fr_pair_tfr_pair_list_tail (fr_pair_list_t const *list)
 Get the tail of a valuepair list. More...
 
_INLINE fr_dlist_head_tfr_pair_list_to_dlist (fr_pair_list_t const *list)
 Get the dlist head from a pair list. More...
 
_INLINE fr_pair_tfr_pair_remove (fr_pair_list_t *list, fr_pair_t *vp)
 Remove fr_pair_t from a list without freeing. More...
 

Detailed Description

AVP privately inlineable manipulation and search API.

Definition in file pair_inline.c.

Macro Definition Documentation

◆ _INLINE

#define _INLINE

Definition at line 28 of file pair_inline.c.

◆ _PAIR_PRIVATE

#define _PAIR_PRIVATE   1

Definition at line 25 of file pair_inline.c.

Function Documentation

◆ fr_pair_list_append()

_INLINE void fr_pair_list_append ( fr_pair_list_t dst,
fr_pair_list_t src 
)

Appends a list of fr_pair_t from a temporary list to a destination list.

Parameters
dstlist to move pairs into
srclist from which to take pairs

Definition at line 182 of file pair_inline.c.

+ Here is the caller graph for this function:

◆ fr_pair_list_empty()

_INLINE bool fr_pair_list_empty ( fr_pair_list_t const *  list)

Is a valuepair list empty.

Parameters
[in]listto check
Returns
true if empty

Definition at line 125 of file pair_inline.c.

◆ fr_pair_list_free()

_INLINE void fr_pair_list_free ( fr_pair_list_t list)

Free memory used by a valuepair list.

Definition at line 113 of file pair_inline.c.

◆ fr_pair_list_from_dlist()

_INLINE fr_pair_list_t* fr_pair_list_from_dlist ( fr_dlist_head_t const *  list)

Get the pair list head from a dlist.

Parameters
[in]listThe order list from a pair list.
Returns
The pair list head.

Definition at line 172 of file pair_inline.c.

◆ fr_pair_list_head()

_INLINE fr_pair_t* fr_pair_list_head ( fr_pair_list_t const *  list)

Get the head of a valuepair list.

Parameters
[in]listto return the head of
Returns
  • NULL if the list is empty
  • pointer to the first item in the list.

Definition at line 43 of file pair_inline.c.

◆ fr_pair_list_next()

_INLINE fr_pair_t* fr_pair_list_next ( fr_pair_list_t const *  list,
fr_pair_t const *  item 
)

Get the next item in a valuepair list after a specific entry.

Parameters
[in]listto walk
[in]itemwhose "next" item to return
Returns
  • NULL if the end of the list has been reached
  • pointer to the next item

Definition at line 70 of file pair_inline.c.

◆ fr_pair_list_num_elements()

_INLINE size_t fr_pair_list_num_elements ( fr_pair_list_t const *  list)

Get the length of a list of fr_pair_t.

Parameters
[in]listto return the length of
Returns
number of entries in the list

Definition at line 151 of file pair_inline.c.

+ Here is the caller graph for this function:

◆ fr_pair_list_prepend()

_INLINE void fr_pair_list_prepend ( fr_pair_list_t dst,
fr_pair_list_t src 
)

Move a list of fr_pair_t from a temporary list to the head of a destination list.

Parameters
dstlist to move pairs into
srcfrom which to take pairs

Definition at line 195 of file pair_inline.c.

+ Here is the caller graph for this function:

◆ fr_pair_list_prev()

_INLINE fr_pair_t* fr_pair_list_prev ( fr_pair_list_t const *  list,
fr_pair_t const *  item 
)

Get the previous item in a valuepair list before a specific entry.

Parameters
[in]listto walk
[in]itemwhose "prev" item to return
Returns
  • NULL if the head of the list has been reached
  • pointer to the previous item

Definition at line 83 of file pair_inline.c.

+ Here is the caller graph for this function:

◆ fr_pair_list_sort()

_INLINE void fr_pair_list_sort ( fr_pair_list_t list,
fr_cmp_t  cmp 
)

Sort a doubly linked list of fr_pair_ts using merge sort.

Note
We use a merge sort (which is a stable sort), making this suitable for use on lists with things like EAP-Message fragments where the order of EAP-Message attributes needs to be maintained.
Parameters
[in,out]listhead of dlinked fr_pair_ts to sort.
[in]cmpto sort with

Definition at line 140 of file pair_inline.c.

+ Here is the caller graph for this function:

◆ fr_pair_list_tail()

_INLINE fr_pair_t* fr_pair_list_tail ( fr_pair_list_t const *  list)

Get the tail of a valuepair list.

Parameters
[in]listto return the tail of
Returns
  • NULL if the list is empty
  • pointer to the last item in the list.

Definition at line 56 of file pair_inline.c.

+ Here is the caller graph for this function:

◆ fr_pair_list_to_dlist()

_INLINE fr_dlist_head_t* fr_pair_list_to_dlist ( fr_pair_list_t const *  list)

Get the dlist head from a pair list.

Parameters
[in]listto get the head from
Returns
the pointer to the dlist within the pair list.

Definition at line 162 of file pair_inline.c.

+ Here is the caller graph for this function:

◆ fr_pair_remove()

_INLINE fr_pair_t* fr_pair_remove ( fr_pair_list_t list,
fr_pair_t vp 
)

Remove fr_pair_t from a list without freeing.

Parameters
[in]listof value pairs to remove VP from.
[in]vpto remove
Returns
previous item in the list to the one being removed.

Definition at line 94 of file pair_inline.c.

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