The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
size.h File Reference

Boxed value structures and functions to manipulate them. More...

#include <stdint.h>
#include <freeradius-devel/util/sbuff.h>
+ Include dependency graph for size.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

fr_slen_t fr_size_from_str (size_t *out, fr_sbuff_t *in)
 Parse a size string with optional unit. More...
 
fr_slen_t fr_size_to_str (fr_sbuff_t *out, size_t in)
 Print a size string with unit. More...
 

Detailed Description

Boxed value structures and functions to manipulate them.

Definition in file size.h.

Function Documentation

◆ fr_size_from_str()

fr_slen_t fr_size_from_str ( size_t out,
fr_sbuff_t in 
)

Parse a size string with optional unit.

Default scale with no suffix is bytes.

Parameters
[out]outParsed and scaled size
[in]insbuff to parse.
Returns
  • >0 on success.
  • <0 on error.

Definition at line 40 of file size.c.

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

◆ fr_size_to_str()

fr_slen_t fr_size_to_str ( fr_sbuff_t out,
size_t  in 
)

Print a size string with unit.

Suffix is the largest unit possible without losing precision.

Parameters
[out]outTo write size to.
[in]insize to print.
Returns
  • >0 on success.
  • <0 on error.

Definition at line 155 of file size.c.

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