yumapro  20.10-12
YumaPro SDK
ncx_num.h File Reference

NCX Module Library Number Utility Functions. More...

#include <xmlstring.h>
#include "dlq.h"
#include "ncxtypes.h"
#include "tk.h"
#include "typ.h"
#include "val.h"
#include "xmlns.h"
#include "yang.h"
Include dependency graph for ncx_num.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void ncx_init_num (ncx_num_t *num)
 Init a ncx_num_t struct. More...
 
void ncx_clean_num (ncx_btype_t btyp, ncx_num_t *num)
 Scrub the memory in a ncx_num_t by freeing all the sub-fields. More...
 
int32 ncx_compare_nums (const ncx_num_t *num1, const ncx_num_t *num2, ncx_btype_t btyp)
 Compare 2 ncx_num_t union contents. More...
 
void ncx_set_num_min (ncx_num_t *num, ncx_btype_t btyp)
 Set a number to the minimum value for its type. More...
 
void ncx_set_num_max (ncx_num_t *num, ncx_btype_t btyp)
 Set a number to the maximum value for its type. More...
 
void ncx_set_num_one (ncx_num_t *num, ncx_btype_t btyp)
 Set a number to one. More...
 
void ncx_set_num_zero (ncx_num_t *num, ncx_btype_t btyp)
 Set a number to zero. More...
 
void ncx_set_num_nan (ncx_num_t *num, ncx_btype_t btyp)
 Set a FP number to the Not a Number value. More...
 
boolean ncx_num_is_nan (ncx_num_t *num, ncx_btype_t btyp)
 Check if a FP number is set to the Not a Number value. More...
 
boolean ncx_num_zero (const ncx_num_t *num, ncx_btype_t btyp)
 Compare a ncx_num_t to zero. More...
 
status_t ncx_convert_num (const xmlChar *numstr, ncx_numfmt_t numfmt, ncx_btype_t btyp, ncx_num_t *val)
 Convert a number string to a numeric type. More...
 
status_t ncx_convert_dec64 (const xmlChar *numstr, ncx_numfmt_t numfmt, uint8 digits, ncx_num_t *val)
 Convert a number string to a decimal64 number. More...
 
status_t ncx_decode_num (const xmlChar *numstr, ncx_btype_t btyp, ncx_num_t *retnum)
 Handle some sort of number string. More...
 
status_t ncx_decode_num_ex (const xmlChar *numstr, ncx_btype_t btyp, ncx_num_t *retnum, typ_def_t *typdef)
 Handle some sort of number string EXTENDED. More...
 
status_t ncx_decode_dec64 (const xmlChar *numstr, uint8 digits, ncx_num_t *retnum)
 Handle some sort of decimal64 number string (NCX_BT_DECIMAL64) More...
 
status_t ncx_copy_num (const ncx_num_t *num1, ncx_num_t *num2, ncx_btype_t btyp)
 Copy the contents of num1 to num2. More...
 
status_t ncx_cast_num (const ncx_num_t *num1, ncx_btype_t btyp1, ncx_num_t *num2, ncx_btype_t btyp2)
 Cast a number as another number type. More...
 
status_t ncx_num_floor (const ncx_num_t *num1, ncx_num_t *num2, ncx_btype_t btyp)
 Get the floor value of a number. More...
 
status_t ncx_num_ceiling (const ncx_num_t *num1, ncx_num_t *num2, ncx_btype_t btyp)
 Get the ceiling value of a number. More...
 
status_t ncx_round_num (const ncx_num_t *num1, ncx_num_t *num2, ncx_btype_t btyp)
 Get the rounded value of a number. More...
 
boolean ncx_num_is_integral (const ncx_num_t *num, ncx_btype_t btyp)
 Check if the number is integral or if it has a fractional part. More...
 
int64 ncx_cvt_to_int64 (const ncx_num_t *num, ncx_btype_t btyp)
 Convert a number to an integer64; Use rounding for float64. More...
 
ncx_numfmt_t ncx_get_numfmt (const xmlChar *numstr)
 Get the number format of the specified string. More...
 
void ncx_printf_num (const ncx_num_t *num, ncx_btype_t btyp, log_debug_t level)
 Printf a ncx_num_t contents using logging functions. More...
 
void ncx_printf_num_ex (const ncx_num_t *num, ncx_btype_t btyp, log_debug_t level, FILE *overrideOut)
 Printf a ncx_num_t contents (write to a file) More...
 
void ncx_alt_printf_num (const ncx_num_t *num, ncx_btype_t btyp)
 Printf a ncx_num_t contents to the alternate log file. More...
 
void ncx_audit_printf_num (const ncx_num_t *num, ncx_btype_t btyp)
 Printf a ncx_num_t contents to the audit log file. More...
 
status_t ncx_sprintf_num (xmlChar *buff, const ncx_num_t *num, ncx_btype_t btyp, uint32 *len)
 Sprintf a ncx_num_t contents. More...
 
boolean ncx_is_min (const ncx_num_t *num, ncx_btype_t btyp)
 Return TRUE if the specified number is the min value for its type. More...
 
boolean ncx_is_max (const ncx_num_t *num, ncx_btype_t btyp)
 Return TRUE if the specified number is the max value for its type. More...
 
status_t ncx_convert_tkcnum (tk_chain_t *tkc, ncx_btype_t btyp, ncx_num_t *val)
 Convert the current token in a token chain to a ncx_num_t struct. More...
 
status_t ncx_convert_tkc_dec64 (tk_chain_t *tkc, uint8 digits, ncx_num_t *val)
 Convert the current token in a token chain to a ncx_num_t struct, expecting NCX_BT_DECIMAL64. More...
 
int64 ncx_get_dec64_base (const ncx_num_t *num)
 Get the base part of a decimal64 number. More...
 
int64 ncx_get_dec64_fraction (const ncx_num_t *num)
 Get the fraction part of a decimal64 number. More...
 

Detailed Description

NCX Module Library Number Utility Functions.