parseint.h File Reference

Parse integers, in a saner way than atoi() or strtoul() do. More...

#include <isc/lang.h>
#include <isc/types.h>

Go to the source code of this file.

Defines

#define ISC_PARSEINT_H   1

Functions

ISC_LANG_BEGINDECLS isc_result_t isc_parse_uint32 (isc_uint32_t *uip, const char *string, int base)
isc_result_t isc_parse_uint16 (isc_uint16_t *uip, const char *string, int base)
isc_result_t isc_parse_uint8 (isc_uint8_t *uip, const char *string, int base)
 Parse the null-terminated string 'string' containing a base 'base' integer, storing the result in '*uip'. The base is interpreted as in strtoul(). Unlike strtoul(), leading whitespace, minus or plus signs are not accepted, and all errors (including overflow) are reported uniformly through the return value.


Detailed Description

Parse integers, in a saner way than atoi() or strtoul() do.

Definition in file parseint.h.


Define Documentation

#define ISC_PARSEINT_H   1

Definition at line 21 of file parseint.h.


Function Documentation

ISC_LANG_BEGINDECLS isc_result_t isc_parse_uint32 ( isc_uint32_t uip,
const char *  string,
int  base 
)

Definition at line 33 of file parseint.c.

References ISC_R_BADNUMBER, ISC_R_RANGE, ISC_R_SUCCESS, and r.

Referenced by ATF_TC_BODY(), bind_ttl(), evaluate_ttl(), isc_lex_gettoken(), isc_parse_uint16(), isc_parse_uint8(), maybe_numeric(), ns_server_signing(), parse_args(), parse_netprefix(), parse_uint_helper(), and update_addordelete().

isc_result_t isc_parse_uint16 ( isc_uint16_t uip,
const char *  string,
int  base 
)

Definition at line 56 of file parseint.c.

References isc_parse_uint32(), ISC_R_RANGE, and ISC_R_SUCCESS.

Referenced by bind9_check_key(), ns_config_getkeyalgorithm2(), parse_args(), and parse_hmac().

isc_result_t isc_parse_uint8 ( isc_uint8_t uip,
const char *  string,
int  base 
)

Parse the null-terminated string 'string' containing a base 'base' integer, storing the result in '*uip'. The base is interpreted as in strtoul(). Unlike strtoul(), leading whitespace, minus or plus signs are not accepted, and all errors (including overflow) are reported uniformly through the return value.

Requires:

Returns:

Definition at line 69 of file parseint.c.

References isc_parse_uint32(), ISC_R_RANGE, and ISC_R_SUCCESS.

Referenced by disable_algorithms(), and fromtext_in_apl().


Generated on Tue Apr 28 17:41:15 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha