yumapro
24.10-3
YumaPro SDK
|
APIs to access compiler data strctures during compilation. More...
Functions | |
status_t | typ_load_basetypes (void) |
Create typ_template_t structs for the base types. More... | |
void | typ_unload_basetypes (void) |
Unload and destroy the typ_template_t structs for the base types unload the typ_template_t structs for the ncx_btype_t types. More... | |
typ_template_t * | typ_new_template (void) |
Malloc and initialize the fields in a typ_template_t. More... | |
void | typ_free_template (typ_template_t *typ) |
Scrub the memory in a typ_template_t by freeing all the sub-fields and then freeing the entire struct itself. More... | |
typ_def_t * | typ_new_typdef (void) |
Malloc and initialize the fields in a typ_def_t. More... | |
void | typ_init_typdef (typ_def_t *typdef) |
init a pre-allocated typdef (done first) More... | |
void | typ_init_simple (typ_def_t *tdef, ncx_btype_t btyp) |
Init a typ_simple_t struct inside a typ_def_t. More... | |
void | typ_init_named (typ_def_t *tdef) |
Init a typ_named_t struct inside a typ_def_t. More... | |
void | typ_free_typdef (typ_def_t *typdef) |
Scrub the memory in a typ_def_t by freeing all Then free the typdef itself. More... | |
void | typ_clean_typdef (typ_def_t *typdef) |
Clean a typ_def_t struct, but do not delete it. More... | |
void | typ_set_named_typdef (typ_def_t *typdef, typ_template_t *imptyp) |
Set the fields in a named typedef (used by YANG parser) More... | |
void | typ_unset_named_typdef (typ_def_t *typdef) |
UnSet the typ link in a named typedef (used by YANG parser) More... | |
const xmlChar * | typ_get_named_typename (const typ_def_t *typdef) |
Get the type name of the named typ. More... | |
const xmlChar * | typ_get_named_type_modname (const typ_def_t *typdef) |
Get the module name of the named typ. More... | |
uint32 | typ_get_named_type_linenum (const typ_def_t *typdef) |
Get the line number of the type template of the named type. More... | |
status_t | typ_set_new_named (typ_def_t *typdef, ncx_btype_t btyp) |
Create a new typdef inside a typ_named_t struct inside a typ_def_t. More... | |
typ_def_t * | typ_get_new_named (typ_def_t *typdef) |
Access the new typdef inside a typ_named_t struct inside a typ_def_t. More... | |
const typ_def_t * | typ_cget_new_named (const typ_def_t *typdef) |
Access the new typdef inside a typ_named_t struct inside a typ_def_t. More... | |
void | typ_set_simple_typdef (typ_template_t *typ, ncx_btype_t btyp) |
Set the fields in a simple typedef (used by YANG parser) More... | |
typ_enum_t * | typ_new_enum (const xmlChar *name) |
Alloc and Init a typ_enum_t struct. More... | |
typ_enum_t * | typ_new_enum2 (xmlChar *name) |
Alloc and Init a typ_enum_t struct. More... | |
void | typ_free_enum (typ_enum_t *en) |
Free a typ_enum_t struct. More... | |
typ_rangedef_t * | typ_new_rangedef (void) |
Alloc and Init a typ_rangedef_t struct (range-stmt) More... | |
void | typ_free_rangedef (typ_rangedef_t *rv, ncx_btype_t btyp) |
Free a typ_rangedef_t struct (range-stmt) More... | |
void | typ_normalize_rangeQ (dlq_hdr_t *rangeQ, ncx_btype_t btyp) |
Start with a valid rangedef chain. More... | |
dlq_hdr_t * | typ_get_rangeQ (typ_def_t *typdef) |
Return the rangeQ for the given typdef. More... | |
dlq_hdr_t * | typ_get_rangeQ_con (typ_def_t *typdef) |
Return the rangeQ for the given typdef Do not follow typdef chains. More... | |
const dlq_hdr_t * | typ_get_crangeQ (const typ_def_t *typdef) |
Return the rangeQ for the given typdef. More... | |
const dlq_hdr_t * | typ_get_crangeQ_con (const typ_def_t *typdef) |
Return the rangeQ for the given typdef Do not follow typdef chains. More... | |
typ_range_t * | typ_get_range_con (typ_def_t *typdef) |
Return the range struct for the given typdef Do not follow typdef chains. More... | |
const typ_range_t * | typ_get_crange_con (const typ_def_t *typdef) |
Return the range struct for the given typdef Do not follow typdef chains. More... | |
const xmlChar * | typ_get_rangestr (const typ_def_t *typdef) |
Return the range string for the given typdef chain. More... | |
const typ_rangedef_t * | typ_first_rangedef (const typ_def_t *typdef) |
Return the lower bound range definition struct. More... | |
const typ_rangedef_t * | typ_first_rangedef_con (const typ_def_t *typdef) |
Return the lower bound range definition struct Constrain search to this typdef. More... | |
status_t | typ_get_rangebounds_con (const typ_def_t *typdef, ncx_btype_t *btyp, const ncx_num_t **lb, const ncx_num_t **ub) |
Return the lower and upper bound range number. More... | |
ncx_strrest_t | typ_get_strrest (const typ_def_t *typdef) |
Get the string restrinvtion type set for this typdef. More... | |
void | typ_set_strrest (typ_def_t *typdef, ncx_strrest_t strrest) |
Set the string restrinvtion type set for this typdef. More... | |
typ_sval_t * | typ_new_sval (const xmlChar *str, ncx_btype_t btyp) |
Alloc and Init a typ_sval_t struct malloc and init a string descriptor. More... | |
void | typ_free_sval (typ_sval_t *sv) |
Free a typ_sval_t struct free a string descriptor. More... | |
typ_listval_t * | typ_new_listval (void) |
Alloc and Init a typ_listval_t struct malloc and init a list descriptor. More... | |
void | typ_free_listval (typ_listval_t *lv) |
Free a typ_listval_t struct free a list descriptor. More... | |
ncx_btype_t | typ_get_range_type (ncx_btype_t btyp) |
Get the correct typ_rangedef_t data type for the indicated base type. More... | |
ncx_btype_t | typ_get_basetype (const typ_def_t *typdef) |
Get the final base type of the specified typ_def_t. More... | |
ncx_btype_t | typ_get_basetype2 (typ_def_t *typdef) |
Get the final base type of the specified typ_def_t. More... | |
const xmlChar * | typ_get_name (const typ_def_t *typdef) |
Get the name for the specified typdef. More... | |
const xmlChar * | typ_get_basetype_name (const typ_template_t *typ) |
Get the name of the final base type of the specified typ_template_t. More... | |
const xmlChar * | typ_get_parenttype_name (const typ_template_t *typ) |
Get the final base type of the specified typ_def_t. More... | |
ncx_tclass_t | typ_get_base_class (const typ_def_t *typdef) |
Follow any typdef links and get the class of the base typdef for the specified typedef. More... | |
typ_template_t * | typ_get_basetype_typ (ncx_btype_t btyp) |
Get the default typ_template_t for the specified base type. More... | |
typ_def_t * | typ_get_basetype_typdef (ncx_btype_t btyp) |
Get the default typdef for the specified base type. More... | |
typ_def_t * | typ_get_parent_typdef (typ_def_t *typdef) |
Get the next typ_def_t in a chain – for NCX_CL_NAMED chained typed. More... | |
const typ_template_t * | typ_get_parent_type (const typ_template_t *typ) |
Get the next typ_template_t in a chain – for NCX_CL_NAMED only. More... | |
const typ_def_t * | typ_get_cparent_typdef (const typ_def_t *typdef) |
Get the next typ_def_t in a chain – for NCX_CL_NAMED chained typed. More... | |
typ_def_t * | typ_get_next_typdef (typ_def_t *typdef) |
Get the next typ_def_t in a chain – for NCX_CL_NAMED chained typed. More... | |
typ_def_t * | typ_get_base_typdef (typ_def_t *typdef) |
Get the base typ_def_t in a chain – for NCX_CL_NAMED chained typed. More... | |
typ_def_t * | typ_get_userdef_typdef (typ_def_t *typdef) |
Get the base typ_def_t in a chain – for NCX_CL_NAMED chained typed. More... | |
const typ_def_t * | typ_get_cuserdef_typdef (const typ_def_t *typdef) |
Get the base typ_def_t in a chain – for NCX_CL_NAMED chained typed. More... | |
const typ_def_t * | typ_get_cbase_typdef (const typ_def_t *typdef) |
Get the base typ_def_t in a chain – for NCX_CL_NAMED chained typed Also NCX_CL_REF pointer typdefs. More... | |
typ_def_t * | typ_get_qual_typdef (typ_def_t *typdef, ncx_squal_t squal) |
Get the final typ_def_t of the specified typ_def_t based on the qualifier. More... | |
const typ_def_t * | typ_get_cqual_typdef (const typ_def_t *typdef, ncx_squal_t squal) |
Get the final typ_def_t of the specified typ_def_t based on the qualifier. More... | |
const ncx_appinfo_t * | typ_find_appinfo (const typ_def_t *typdef, const xmlChar *prefix, const xmlChar *name) |
Find the specified appinfo variable by its prefix and name. More... | |
const ncx_appinfo_t * | typ_find_appinfo_con (const typ_def_t *typdef, const xmlChar *prefix, const xmlChar *name) |
Find the specified appinfo name, constrained to the current typdef. More... | |
boolean | typ_is_xpath_string (const typ_def_t *typdef) |
Find the ncx:xpath extension within the specified typdef chain. More... | |
boolean | typ_is_qname_string (const typ_def_t *typdef) |
Find the ncx:qname extension within the specified typdef chain. More... | |
boolean | typ_is_schema_instance_string (const typ_def_t *typdef) |
Find the ncx:schema-instance extension within the specified typdef chain. More... | |
const xmlChar * | typ_get_defval (const typ_template_t *typ) |
Find the default value string for the specified type template get default from template. More... | |
const xmlChar * | typ_get_default (const typ_def_t *typdef) |
Check if this typdef has a default value defined get default from typdef. More... | |
ncx_iqual_t | typ_get_iqualval (const typ_template_t *typ) |
Find the instance qualifier value enum for the specified type template. More... | |
ncx_iqual_t | typ_get_iqualval_def (const typ_def_t *typdef) |
Find the instance qualifier value enum for the specified type template. More... | |
const xmlChar * | typ_get_units (const typ_template_t *typ) |
Find the units string for the specified type template. More... | |
const xmlChar * | typ_get_units_from_typdef (const typ_def_t *typdef) |
Find the units string for the specified typdef template. More... | |
boolean | typ_has_children (ncx_btype_t btyp) |
Check if this is a data type that uses the val.v.childQ. More... | |
boolean | typ_has_index (ncx_btype_t btyp) |
Check if this is a data type that has an index. More... | |
boolean | typ_is_simple (ncx_btype_t btyp) |
Check if this is a simple data type. More... | |
boolean | typ_is_xsd_simple (ncx_btype_t btyp) |
Check if this is a simple data type in XSD encoding. More... | |
typ_enum_t * | typ_first_enumdef (typ_def_t *typdef) |
Get the first enum def struct looks past named typedefs to base typedef. More... | |
typ_enum_t * | typ_next_enumdef (typ_enum_t *enumdef) |
Get the next enum def struct. More... | |
typ_enum_t * | typ_get_enumdef_n (typ_def_t *typdef, uint32 num) |
Get the enum defs defined based on enum order. More... | |
const typ_enum_t * | typ_first_con_enumdef (const typ_def_t *typdef) |
Get the first enum def struct constrained to this typdef. More... | |
typ_enum_t * | typ_find_enumdef (dlq_hdr_t *ebQ, const xmlChar *name) |
Get the specified enum def struct. More... | |
uint32 | typ_enumdef_count (const typ_def_t *typdef) |
Get the number of typ_enum_t Q entries. More... | |
boolean | typ_enumdef_conditional (typ_def_t *typdef, const xmlChar *valstr) |
Check if the specified enumdef value is conditional on if-feature. More... | |
typ_def_t * | typ_get_correct_enumdef (typ_def_t *typdef) |
Get the typ_enum_t to use. More... | |
typ_enum_t * | typ_get_enumdef (typ_def_t *typdef, const xmlChar *valstr) |
Get the typ_enum_t. More... | |
const typ_sval_t * | typ_first_strdef (const typ_def_t *typdef) |
Get the first string def struct. More... | |
uint32 | typ_get_maxrows (const typ_def_t *typdef) |
Get the maxrows value if it exists or zero if not. More... | |
ncx_access_t | typ_get_maxaccess (const typ_def_t *typdef) |
Find the max-access value for the specified typdef. More... | |
ncx_data_class_t | typ_get_dataclass (const typ_def_t *typdef) |
Find the data-class value for the specified typdef. More... | |
ncx_merge_t | typ_get_mergetype (const typ_def_t *typdef) |
Get the merge type for a specified type def. More... | |
xmlns_id_t | typ_get_nsid (const typ_template_t *typ) |
Return the namespace ID. More... | |
typ_template_t * | typ_get_listtyp (typ_def_t *typdef) |
Return the typ_template for the list type, if the supplied. More... | |
const typ_template_t * | typ_get_clisttyp (const typ_def_t *typdef) |
Return the typ_template for the list type, if the supplied. More... | |
typ_unionnode_t * | typ_new_unionnode (typ_template_t *typ) |
Alloc and Init a typ_unionnode_t struct. More... | |
void | typ_free_unionnode (typ_unionnode_t *un) |
Free a typ_unionnode_t struct. More... | |
typ_def_t * | typ_get_unionnode_ptr (typ_unionnode_t *un) |
Get the proper typdef pointer from a unionnode. More... | |
typ_unionnode_t * | typ_first_unionnode (typ_def_t *typdef) |
Get the first union node in the queue for a given typdef. More... | |
const typ_unionnode_t * | typ_first_con_unionnode (const typ_def_t *typdef) |
Get the first union node in the queue for a given typdef constrained. More... | |
boolean | typ_is_number (ncx_btype_t btyp) |
Check if the base type is numeric. More... | |
boolean | typ_is_string (ncx_btype_t btyp) |
Check if the base type is a simple string (not list) More... | |
boolean | typ_is_enum (ncx_btype_t btyp) |
Check if the base type is an enumeration. More... | |
typ_pattern_t * | typ_new_pattern (const xmlChar *pat_str, boolean ocmode) |
Malloc and init a pattern struct. More... | |
void | typ_free_pattern (typ_pattern_t *pat) |
Free a pattern struct. More... | |
status_t | typ_compile_pattern (typ_pattern_t *pat) |
Compile a pattern as into a regex_t struct. More... | |
typ_pattern_t * | typ_get_first_pattern (typ_def_t *typdef) |
Get the first pattern struct for a typdef. More... | |
typ_pattern_t * | typ_get_next_pattern (typ_pattern_t *curpat) |
Get the next pattern struct for a typdef. More... | |
const typ_pattern_t * | typ_get_first_cpattern (const typ_def_t *typdef) |
Get the first pattern struct for a typdef Const version. More... | |
const typ_pattern_t * | typ_get_next_cpattern (const typ_pattern_t *curpat) |
Get the next pattern struct for a typdef Const version. More... | |
uint32 | typ_get_pattern_count (const typ_def_t *typdef) |
Get the number of pattern structs in a typdef. More... | |
ncx_errinfo_t * | typ_get_range_errinfo (typ_def_t *typdef) |
Get the range errinfo for a typdef. More... | |
void | typ_clean_typeQ (dlq_hdr_t *que) |
Clean a queue of typ_template_t structs. More... | |
boolean | typ_ok_for_inline_index (ncx_yang_version_t langver, ncx_btype_t btyp) |
Check if the base type is okay to use in an inline index decl. More... | |
boolean | typ_ok_for_metadata (ncx_btype_t btyp) |
Check if the base type is okay to use in an XML attribute. More... | |
boolean | typ_ok_for_union (ncx_yang_version_t langver, ncx_btype_t btyp) |
Check if the base type is okay to use in an union decl. More... | |
boolean | typ_ok (const typ_def_t *typdef) |
Check if the typdef chain has any errors. More... | |
boolean | typ_ok_for_xsdlist (ncx_btype_t btyp) |
Check if the base type is okay to use in an ncx:xsdlist typedef. More... | |
const xmlChar * | typ_get_leafref_path (const typ_def_t *typdef) |
Get the path argument for the leafref data type. More... | |
const void * | typ_get_leafref_path_addr (const typ_def_t *typdef) |
Get the address of the path argument for the leafref data type. More... | |
struct xpath_pcb_t_ * | typ_get_leafref_pcb (typ_def_t *typdef) |
Get the XPath parser control block for the leafref data type returns xpath_pcb_t but cannot import due to H file loop. More... | |
ncx_leafref_class_t | typ_get_leafref_class (typ_def_t *typdef) |
Get the leafref class for the leafref type. More... | |
void | typ_set_leafref_class_key (typ_def_t *typdef) |
Change the leafref class for the type to NCX_LEAFREF_CLASS_KEY. More... | |
boolean | typ_get_constrained (const typ_def_t *typdef) |
Get the constrained true/false field for the data type leafref or instance-identifier constrained flag. More... | |
boolean | typ_get_constrained_set (const typ_def_t *typdef) |
Return TRUE if the require-instance stmt is set. More... | |
void | typ_set_xref_typdef (typ_def_t *typdef, typ_def_t *target) |
Set the target typdef for a leafref or instance-identifier NCX_BT_LEAFREF or NCX_BT_INSTANCE_ID. More... | |
typ_def_t * | typ_get_xref_typdef (typ_def_t *typdef) |
Get the xrefdef target typdef from a leafref or instance-identifier. More... | |
boolean | typ_has_subclauses (const typ_def_t *typdef) |
Check if the specified typdef has any sub-clauses. More... | |
typ_idref_t * | typ_get_first_idref (typ_def_t *typdef) |
Get the first idref field if this is an NCX_BT_IDREF typdef. More... | |
typ_idref_t * | typ_get_next_idref (typ_def_t *typdef, typ_idref_t *curdef) |
Get the next idref field if this is an NCX_BT_IDREF typdef. More... | |
const typ_idref_t * | typ_get_first_cidref (typ_def_t *typdef) |
Get the idref field if this is an NCX_BT_IDREF typdef Const version. More... | |
const typ_idref_t * | typ_get_next_cidref (const typ_def_t *typdef, const typ_idref_t *curdef) |
Get the next idref field if this is an NCX_BT_IDREF typdef. More... | |
uint8 | typ_get_fraction_digits (const typ_def_t *typdef) |
Get the fraction-digits field from the typdef chain typdef must be an NCX_BT_DECIMAL64 or 0 will be returned valid values are 1..18. More... | |
status_t | typ_set_fraction_digits (typ_def_t *typdef, uint8 digits) |
Set the fraction-digits field from the typdef chain. More... | |
uint32 | typ_get_typ_linenum (const typ_template_t *typ) |
Get the line number for the typ_template_t. More... | |
uint32 | typ_get_typdef_linenum (const typ_def_t *typdef) |
Get the line number for the typ_def_t. More... | |
void | typ_get_union_types (typ_def_t *typdef, typ_union_walker_fn_t walkerfn, void *cookie) |
Walk the union type nodes to print the names. More... | |
void | typ_get_union_basetypes (typ_def_t *typdef, typ_union_walker2_fn_t walkerfn, void *cookie) |
Walk the union type nodes to print the base type names. More... | |
void | typ_get_union_typdefs (typ_def_t *typdef, typ_union_walker3_fn_t walkerfn, void *cookie) |
| |
const xmlChar * | typ_get_yang_typename (const typ_def_t *typdef) |
Get the YANG type name for this typdef if there is one. More... | |
boolean | typ_union_needs_xpath_check (typ_def_t *checkdef) |
Walk the union type nodes to check if there are any unconstrained leafref or instance-identifier nodes that need validation. More... | |
typ_idref_t * | typ_new_idref (void) |
Malloc a new idref. More... | |
void | typ_free_idref (typ_idref_t *idref) |
Clean and freec an idref. More... | |
APIs to access compiler data strctures during compilation.
Access the new typdef inside a typ_named_t struct inside a typ_def_t.
typdef | pointer to the typ_def_t struct to check |
void typ_clean_typdef | ( | typ_def_t * | typdef | ) |
void typ_clean_typeQ | ( | dlq_hdr_t * | que | ) |
Clean a queue of typ_template_t structs.
que | Q of typ_template_t to clean |
status_t typ_compile_pattern | ( | typ_pattern_t * | pat | ) |
Compile a pattern as into a regex_t struct.
[in,out] | pat | pattern to compile
|
boolean typ_enumdef_conditional | ( | typ_def_t * | typdef, |
const xmlChar * | valstr | ||
) |
Check if the specified enumdef value is conditional on if-feature.
typdef | typ def struct to check |
valstr | value string to check (1 enum or 1 bit) |
uint32 typ_enumdef_count | ( | const typ_def_t * | typdef | ) |
Get the number of typ_enum_t Q entries.
typdef | typ def struct to check |
const ncx_appinfo_t * typ_find_appinfo | ( | const typ_def_t * | typdef, |
const xmlChar * | prefix, | ||
const xmlChar * | name | ||
) |
Find the specified appinfo variable by its prefix and name.
typdef | typedef to check |
prefix | module prefix (may be NULL) |
name | name of the appinfo var to find |
const ncx_appinfo_t * typ_find_appinfo_con | ( | const typ_def_t * | typdef, |
const xmlChar * | prefix, | ||
const xmlChar * | name | ||
) |
Find the specified appinfo name, constrained to the current typdef.
typdef | typedef to check |
prefix | appinfo module prefix (may be NULL) |
name | name of the appinfo var to find |
typ_enum_t * typ_find_enumdef | ( | dlq_hdr_t * | ebQ, |
const xmlChar * | name | ||
) |
Get the specified enum def struct.
ebQ | enum/bits Q to check |
name | name of the enum to find |
const typ_enum_t * typ_first_con_enumdef | ( | const typ_def_t * | typdef | ) |
Get the first enum def struct constrained to this typdef.
typdef | typ def struct to check |
const typ_unionnode_t * typ_first_con_unionnode | ( | const typ_def_t * | typdef | ) |
Get the first union node in the queue for a given typdef constrained.
typdef | pointer to type definition for the union node |
typ_enum_t * typ_first_enumdef | ( | typ_def_t * | typdef | ) |
Get the first enum def struct looks past named typedefs to base typedef.
typdef | typ def struct to check |
const typ_rangedef_t * typ_first_rangedef | ( | const typ_def_t * | typdef | ) |
Return the lower bound range definition struct.
Follow typdef chains if needed until first range found
typdef | type def struct to check |
const typ_rangedef_t * typ_first_rangedef_con | ( | const typ_def_t * | typdef | ) |
Return the lower bound range definition struct Constrain search to this typdef.
typdef | typ def struct to check |
const typ_sval_t * typ_first_strdef | ( | const typ_def_t * | typdef | ) |
Get the first string def struct.
typdef | typ def struct to check |
typ_unionnode_t * typ_first_unionnode | ( | typ_def_t * | typdef | ) |
Get the first union node in the queue for a given typdef.
typdef | pointer to type definition for the union node |
void typ_free_enum | ( | typ_enum_t * | en | ) |
Free a typ_enum_t struct.
free an enumeration descriptor
en | enum struct to free |
void typ_free_idref | ( | typ_idref_t * | idref | ) |
Clean and freec an idref.
idref | struct to free |
void typ_free_listval | ( | typ_listval_t * | lv | ) |
Free a typ_listval_t struct free a list descriptor.
lv | typ_listval_t struct to free |
void typ_free_pattern | ( | typ_pattern_t * | pat | ) |
Free a pattern struct.
Must be freed from any Q before calling this function
pat | typ_pattern_t struct to free |
void typ_free_rangedef | ( | typ_rangedef_t * | rv, |
ncx_btype_t | btyp | ||
) |
Free a typ_rangedef_t struct (range-stmt)
rv | rangeval struct to delete |
btyp | base type of range (float and double have malloced strings) |
void typ_free_sval | ( | typ_sval_t * | sv | ) |
Free a typ_sval_t struct free a string descriptor.
sv | typ_sval_t struct to free |
void typ_free_template | ( | typ_template_t * | typ | ) |
Scrub the memory in a typ_template_t by freeing all the sub-fields and then freeing the entire struct itself.
The struct must be removed from any queue it is in before this function is called.
typ | typ_template_t to delete |
void typ_free_typdef | ( | typ_def_t * | typdef | ) |
void typ_free_unionnode | ( | typ_unionnode_t * | un | ) |
Free a typ_unionnode_t struct.
un | union node to free |
ncx_tclass_t typ_get_base_class | ( | const typ_def_t * | typdef | ) |
Follow any typdef links and get the class of the base typdef for the specified typedef.
typdef | typdef to check |
Get the base typ_def_t in a chain – for NCX_CL_NAMED chained typed.
Also NCX_CL_REF pointer typdefs get the real typdef that describes the type, if the input is one of the 'pointer' typdef classes. Otherwise, just return the input typdef
typdef | typdef to check |
ncx_btype_t typ_get_basetype | ( | const typ_def_t * | typdef | ) |
ncx_btype_t typ_get_basetype2 | ( | typ_def_t * | typdef | ) |
Get the final base type of the specified typ_def_t.
Follow any typdef links and get the actual base type of the specified typedef WILL SET final_type is btyp is set but not final_type
typdef | typdef to check |
const xmlChar * typ_get_basetype_name | ( | const typ_template_t * | typ | ) |
Get the name of the final base type of the specified typ_template_t.
typ | template containing the typdef to check |
typ_template_t * typ_get_basetype_typ | ( | ncx_btype_t | btyp | ) |
Get the default typ_template_t for the specified base type.
btyp | base type to get |
typ_def_t * typ_get_basetype_typdef | ( | ncx_btype_t | btyp | ) |
Get the default typdef for the specified base type.
btyp | base type to get |
const typ_template_t * typ_get_clisttyp | ( | const typ_def_t * | typdef | ) |
Return the typ_template for the list type, if the supplied.
typ_template contains a list typ_def, or named type chain leads to a NCX_BT_SLIST typdef (CONST version)
typdef | typ_template_t struct to check |
boolean typ_get_constrained | ( | const typ_def_t * | typdef | ) |
Get the constrained true/false field for the data type leafref or instance-identifier constrained flag.
typdef | typdef for the the leafref or instance-identifier |
boolean typ_get_constrained_set | ( | const typ_def_t * | typdef | ) |
Return TRUE if the require-instance stmt is set.
typdef | typdef to check |
Get the typ_enum_t to use.
typdef | typ def struct to check |
const typ_def_t * typ_get_cqual_typdef | ( | const typ_def_t * | typdef, |
ncx_squal_t | squal | ||
) |
Get the final typ_def_t of the specified typ_def_t based on the qualifier.
typdef | typdef to check |
squal | type of search qualifier desired NCX_SQUAL_NONE == get first non-empty typdef NCX_SQUAL_RANGE == find the first w/ range definition NCX_SQUAL_VAL == find the first w/ stringval/pattern def NCX_SQUAL_META == find the first typdef w/ meta-data def |
const typ_range_t * typ_get_crange_con | ( | const typ_def_t * | typdef | ) |
Return the range struct for the given typdef Do not follow typdef chains.
typdef | typ def struct to check |
const dlq_hdr_t * typ_get_crangeQ | ( | const typ_def_t * | typdef | ) |
Return the rangeQ for the given typdef.
Follow typdef chains if needed until first range found
typdef | typ def struct to check |
const dlq_hdr_t * typ_get_crangeQ_con | ( | const typ_def_t * | typdef | ) |
Return the rangeQ for the given typdef Do not follow typdef chains.
typdef | typ def struct to check |
Get the base typ_def_t in a chain – for NCX_CL_NAMED chained typed.
Also NCX_CL_REF pointer typdefs Stop if the userdef field is set CONST VERSION
typdef | typdef to check |
ncx_data_class_t typ_get_dataclass | ( | const typ_def_t * | typdef | ) |
Find the data-class value for the specified typdef.
Follow named types to see if any parent typdef has a data-class clause, if none found in the parameter
typdef | typ_def_t struct to check |
const xmlChar * typ_get_default | ( | const typ_def_t * | typdef | ) |
Check if this typdef has a default value defined get default from typdef.
typdef | typ_def_t struct to check |
const xmlChar * typ_get_defval | ( | const typ_template_t * | typ | ) |
Find the default value string for the specified type template get default from template.
typ | typ_template_t struct to check |
typ_enum_t * typ_get_enumdef | ( | typ_def_t * | typdef, |
const xmlChar * | valstr | ||
) |
Get the typ_enum_t.
typdef | typ def struct to check |
valstr | value string to find (1 enum or 1 bit) |
typ_enum_t * typ_get_enumdef_n | ( | typ_def_t * | typdef, |
uint32 | num | ||
) |
Get the enum defs defined based on enum order.
typdef | typ def struct to check |
num | enum # [ 0 to N-1 based ] |
const typ_idref_t * typ_get_first_cidref | ( | typ_def_t * | typdef | ) |
Get the idref field if this is an NCX_BT_IDREF typdef Const version.
typdef | typdef to check |
const typ_pattern_t * typ_get_first_cpattern | ( | const typ_def_t * | typdef | ) |
Get the first pattern struct for a typdef Const version.
typdef | typ_def_t to check |
typ_idref_t * typ_get_first_idref | ( | typ_def_t * | typdef | ) |
Get the first idref field if this is an NCX_BT_IDREF typdef.
typdef | typdef to check |
typ_pattern_t * typ_get_first_pattern | ( | typ_def_t * | typdef | ) |
Get the first pattern struct for a typdef.
typdef | typ_def_t to check |
uint8 typ_get_fraction_digits | ( | const typ_def_t * | typdef | ) |
Get the fraction-digits field from the typdef chain typdef must be an NCX_BT_DECIMAL64 or 0 will be returned valid values are 1..18.
typdef | typdef to check |
ncx_iqual_t typ_get_iqualval | ( | const typ_template_t * | typ | ) |
Find the instance qualifier value enum for the specified type template.
typ | typ_template_t struct to check |
ncx_iqual_t typ_get_iqualval_def | ( | const typ_def_t * | typdef | ) |
Find the instance qualifier value enum for the specified type template.
typdef | typ_def_t struct to check |
ncx_leafref_class_t typ_get_leafref_class | ( | typ_def_t * | typdef | ) |
Get the leafref class for the leafref type.
typdef | typdef for the leafref |
const xmlChar * typ_get_leafref_path | ( | const typ_def_t * | typdef | ) |
Get the path argument for the leafref data type.
typdef | typdef for the the leafref |
const void * typ_get_leafref_path_addr | ( | const typ_def_t * | typdef | ) |
Get the address of the path argument for the leafref data type.
typdef | typdef for the the leafref |
struct xpath_pcb_t_ * typ_get_leafref_pcb | ( | typ_def_t * | typdef | ) |
Get the XPath parser control block for the leafref data type returns xpath_pcb_t but cannot import due to H file loop.
typdef | typdef for the the leafref |
typ_template_t * typ_get_listtyp | ( | typ_def_t * | typdef | ) |
Return the typ_template for the list type, if the supplied.
typ_template contains a list typ_def, or named type chain leads to a NCX_BT_SLIST or NCX_BT_BITS typdef
typdef | typ_template_t struct to check |
ncx_access_t typ_get_maxaccess | ( | const typ_def_t * | typdef | ) |
Find the max-access value for the specified typdef.
Follow named types to see if any parent typdef has a maxaccess clause, if none found in the parameter
typdef | typ_def_t struct to check |
uint32 typ_get_maxrows | ( | const typ_def_t * | typdef | ) |
Get the maxrows value if it exists or zero if not.
typdef | typdef to check |
ncx_merge_t typ_get_mergetype | ( | const typ_def_t * | typdef | ) |
Get the merge type for a specified type def.
typdef | typ_def_t struct to check |
const xmlChar * typ_get_name | ( | const typ_def_t * | typdef | ) |
Get the name for the specified typdef.
typdef | type definition to check |
uint32 typ_get_named_type_linenum | ( | const typ_def_t * | typdef | ) |
Get the line number of the type template of the named type.
typdef | pointer to the typ_def_t struct to check |
const xmlChar * typ_get_named_type_modname | ( | const typ_def_t * | typdef | ) |
Get the module name of the named typ.
typdef | pointer to the typ_def_t struct to check |
const xmlChar * typ_get_named_typename | ( | const typ_def_t * | typdef | ) |
Get the type name of the named typ.
typdef | pointer to the typ_def_t struct to check |
Access the new typdef inside a typ_named_t struct inside a typ_def_t.
typdef | pointer to the typ_def_t struct to check |
const typ_idref_t * typ_get_next_cidref | ( | const typ_def_t * | typdef, |
const typ_idref_t * | curdef | ||
) |
Get the next idref field if this is an NCX_BT_IDREF typdef.
typdef | typdef to check |
curdef | current idref |
const typ_pattern_t * typ_get_next_cpattern | ( | const typ_pattern_t * | curpat | ) |
Get the next pattern struct for a typdef Const version.
curpat | current typ_pattern_t to check |
typ_idref_t * typ_get_next_idref | ( | typ_def_t * | typdef, |
typ_idref_t * | curdef | ||
) |
Get the next idref field if this is an NCX_BT_IDREF typdef.
typdef | typdef to check |
curdef | current idref |
typ_pattern_t * typ_get_next_pattern | ( | typ_pattern_t * | curpat | ) |
Get the next pattern struct for a typdef.
curpat | current typ_pattern_t to check |
Get the next typ_def_t in a chain – for NCX_CL_NAMED chained typed.
Also NCX_CL_REF pointer typdefs Get the next typdef in the chain for NCX_CL_NAMED or NCX_CL_REF Returns the input typdef for all other typdef classes
typdef | typdef to check |
xmlns_id_t typ_get_nsid | ( | const typ_template_t * | typ | ) |
Return the namespace ID.
typ | typ_template_t struct to check |
Get the next typ_def_t in a chain – for NCX_CL_NAMED chained typed.
Also NCX_CL_REF pointer typdefs Ignores current named type even if if has new restrictions Get the parent typdef for NCX_CL_NAMED and NCX_CL_REF Returns NULL for all other classes
typdef | typdef to check |
const typ_template_t * typ_get_parent_type | ( | const typ_template_t * | typ | ) |
Get the next typ_template_t in a chain – for NCX_CL_NAMED only.
typ | type template to check |
const xmlChar * typ_get_parenttype_name | ( | const typ_template_t * | typ | ) |
uint32 typ_get_pattern_count | ( | const typ_def_t * | typdef | ) |
Get the number of pattern structs in a typdef.
typdef | typ_def_t to check |
typ_def_t * typ_get_qual_typdef | ( | typ_def_t * | typdef, |
ncx_squal_t | squal | ||
) |
Get the final typ_def_t of the specified typ_def_t based on the qualifier.
Get the next typdef in the chain for NCX_CL_NAMED or NCX_CL_REF Skip any named types without the specific restriction defined
Returns the input typdef for simple typdef classes
typdef | typdef to check |
squal | type of search qualifier desired NCX_SQUAL_NONE == get first non-empty typdef NCX_SQUAL_RANGE == find the first w/ range definition NCX_SQUAL_VAL == find the first w/ stringval/pattern def NCX_SQUAL_META == find the first typdef w/ meta-data def |
typ_range_t * typ_get_range_con | ( | typ_def_t * | typdef | ) |
Return the range struct for the given typdef Do not follow typdef chains.
typdef | typ def struct to check |
ncx_errinfo_t * typ_get_range_errinfo | ( | typ_def_t * | typdef | ) |
Get the range errinfo for a typdef.
typdef | typ_def_t to check |
ncx_btype_t typ_get_range_type | ( | ncx_btype_t | btyp | ) |
Get the correct typ_rangedef_t data type for the indicated base type.
get the proper range base type to use for a given base type
btyp | base type enum |
status_t typ_get_rangebounds_con | ( | const typ_def_t * | typdef, |
ncx_btype_t * | btyp, | ||
const ncx_num_t ** | lb, | ||
const ncx_num_t ** | ub | ||
) |
Return the lower and upper bound range number.
Constrain search to this typdef deprecated – does not support multi-part ranges
typdef | typ def struct to check | |
[out] | btyp | pointer to output range number type *btyp the type of number in the return type, if non-NULL |
[out] | lb | pointer to output lower bound number *lb lower bound number |
[out] | ub | pointer to output upper bound number *ub upper bound number |
dlq_hdr_t * typ_get_rangeQ | ( | typ_def_t * | typdef | ) |
Return the rangeQ for the given typdef.
Follow typdef chains if needed until first range found
typdef | typ def struct to check |
dlq_hdr_t * typ_get_rangeQ_con | ( | typ_def_t * | typdef | ) |
Return the rangeQ for the given typdef Do not follow typdef chains.
typdef | typ def struct to check |
const xmlChar * typ_get_rangestr | ( | const typ_def_t * | typdef | ) |
Return the range string for the given typdef chain.
typdef | typ def struct to check |
ncx_strrest_t typ_get_strrest | ( | const typ_def_t * | typdef | ) |
Get the string restrinvtion type set for this typdef.
typdef | typdef to check |
uint32 typ_get_typ_linenum | ( | const typ_template_t * | typ | ) |
Get the line number for the typ_template_t.
typ | type template to check |
uint32 typ_get_typdef_linenum | ( | const typ_def_t * | typdef | ) |
void typ_get_union_basetypes | ( | typ_def_t * | typdef, |
typ_union_walker2_fn_t | walkerfn, | ||
void * | cookie | ||
) |
Walk the union type nodes to print the base type names.
typdef | typ_def_t for the designated union type |
walkerfn | union node walker fn |
cookie | pointer to pass to walkerfn |
void typ_get_union_typdefs | ( | typ_def_t * | typdef, |
typ_union_walker3_fn_t | walkerfn, | ||
void * | cookie | ||
) |
typdef | typ_def_t for the designated union type |
walkerfn | union node walker fn |
cookie | pointer to pass to walkerfn |
void typ_get_union_types | ( | typ_def_t * | typdef, |
typ_union_walker_fn_t | walkerfn, | ||
void * | cookie | ||
) |
Walk the union type nodes to print the names.
typdef | typ_def_t for the designated union type |
walkerfn | union node walker fn |
cookie | pointer to pass to walkerfn |
typ_def_t * typ_get_unionnode_ptr | ( | typ_unionnode_t * | un | ) |
Get the proper typdef pointer from a unionnode.
un | union node to check |
const xmlChar * typ_get_units | ( | const typ_template_t * | typ | ) |
Find the units string for the specified type template.
typ | typ_template_t struct to check |
const xmlChar * typ_get_units_from_typdef | ( | const typ_def_t * | typdef | ) |
Find the units string for the specified typdef template.
Follow any NCX_CL_NAMED typdefs and check for a units clause in the the nearest ancestor typdef get units from named type if any
typdef | typ_def_t struct to check |
Get the base typ_def_t in a chain – for NCX_CL_NAMED chained typed.
Also NCX_CL_REF pointer typdefs Stop if the userdef field is set
typdef | typdef to check |
Get the xrefdef target typdef from a leafref or instance-identifier.
NCX_BT_LEAFREF or NCX_BT_INSTANCE_ID
typdef | typdef for the the leafref or instance-identifier |
const xmlChar * typ_get_yang_typename | ( | const typ_def_t * | typdef | ) |
Get the YANG type name for this typdef if there is one.
typdef | pointer to the typ_def_t struct to check |
boolean typ_has_children | ( | ncx_btype_t | btyp | ) |
Check if this is a data type that uses the val.v.childQ.
btyp | base type enum |
boolean typ_has_index | ( | ncx_btype_t | btyp | ) |
Check if this is a data type that has an index.
btyp | base type enum |
boolean typ_has_subclauses | ( | const typ_def_t * | typdef | ) |
Check if the specified typdef has any sub-clauses.
Used by yangdump to reverse-engineer the YANG from the typdef If any appinfo clauses present, then the result will be TRUE
typdef | typdef to check |
void typ_init_named | ( | typ_def_t * | tdef | ) |
Init a typ_named_t struct inside a typ_def_t.
init a named data type after typ_init_typdef
INPUTS: typdef == pointer to the typ_def_t struct to init as a NCX_CL_SIMPLE variant
void typ_init_simple | ( | typ_def_t * | tdef, |
ncx_btype_t | btyp | ||
) |
Init a typ_simple_t struct inside a typ_def_t.
init a simple data type after typ_init_typdef
tdef | pointer to the typ_def_t struct to init as a NCX_CL_SIMPLE variant |
btyp | base type to use for type |
void typ_init_typdef | ( | typ_def_t * | typdef | ) |
init a pre-allocated typdef (done first)
Initialize the fields in a typ_def_t
!! Still need to call typ_init_simple !! when the actual builting type is determined
typdef | pointer to the struct to initialize |
boolean typ_is_enum | ( | ncx_btype_t | btyp | ) |
Check if the base type is an enumeration.
btyp | base type enum to check |
boolean typ_is_number | ( | ncx_btype_t | btyp | ) |
Check if the base type is numeric.
btyp | basetype enum to check |
boolean typ_is_qname_string | ( | const typ_def_t * | typdef | ) |
Find the ncx:qname extension within the specified typdef chain.
typdef | start of typ_def_t chain to check |
boolean typ_is_schema_instance_string | ( | const typ_def_t * | typdef | ) |
Find the ncx:schema-instance extension within the specified typdef chain.
typdef | start of typ_def_t chain to check |
boolean typ_is_simple | ( | ncx_btype_t | btyp | ) |
Check if this is a simple data type.
btyp | base type enum |
boolean typ_is_string | ( | ncx_btype_t | btyp | ) |
Check if the base type is a simple string (not list)
btyp | base type enum to check |
boolean typ_is_xpath_string | ( | const typ_def_t * | typdef | ) |
Find the ncx:xpath extension within the specified typdef chain.
typdef | start of typ_def_t chain to check |
boolean typ_is_xsd_simple | ( | ncx_btype_t | btyp | ) |
Check if this is a simple data type in XSD encoding.
btyp | base type enum |
status_t typ_load_basetypes | ( | void | ) |
Create typ_template_t structs for the base types.
Must be called before any modules are loaded load the typ_template_t structs for the ncx_btype_t types MUST be called during ncx_init startup
typ_enum_t * typ_new_enum | ( | const xmlChar * | name | ) |
Alloc and Init a typ_enum_t struct.
malloc and init an enumeration descriptor, strdup name ptr
name | name string for the enumeration |
typ_enum_t * typ_new_enum2 | ( | xmlChar * | name | ) |
Alloc and Init a typ_enum_t struct.
Use the string value as-is, instead of mallocing a new one malloc and init an enumeration descriptor, pass off name ptr
name | name string for the enumeration (will get free-ed later!!) PASS OFF THIS MEMORY HERE |
typ_idref_t * typ_new_idref | ( | void | ) |
Malloc a new idref.
typ_listval_t * typ_new_listval | ( | void | ) |
Alloc and Init a typ_listval_t struct malloc and init a list descriptor.
typ_pattern_t * typ_new_pattern | ( | const xmlChar * | pat_str, |
boolean | ocmode | ||
) |
Malloc and init a pattern struct.
pat_str | pattern string to copy and save |
ocmode | T:openconfig pattern mode; F: IETF pattern mode |
typ_rangedef_t * typ_new_rangedef | ( | void | ) |
Alloc and Init a typ_rangedef_t struct (range-stmt)
typ_sval_t * typ_new_sval | ( | const xmlChar * | str, |
ncx_btype_t | btyp | ||
) |
Alloc and Init a typ_sval_t struct malloc and init a string descriptor.
str | string value inside token to copy |
btyp | type of string (NCX_BT_STRING/LIST, OSTRING/OLIST) |
typ_template_t * typ_new_template | ( | void | ) |
Malloc and initialize the fields in a typ_template_t.
typ_def_t * typ_new_typdef | ( | void | ) |
Malloc and initialize the fields in a typ_def_t.
typ_unionnode_t * typ_new_unionnode | ( | typ_template_t * | typ | ) |
Alloc and Init a typ_unionnode_t struct.
typ | pointer to type template for this union node |
typ_enum_t * typ_next_enumdef | ( | typ_enum_t * | enumdef | ) |
Get the next enum def struct.
enumdef | typ enum struct to check |
void typ_normalize_rangeQ | ( | dlq_hdr_t * | rangeQ, |
ncx_btype_t | btyp | ||
) |
Start with a valid rangedef chain.
Combine any consecutive range definitions like 1..4|5|6|7..9 would break replaced with 1..9 concat consecutive rangedef sections for integral numbers
Not done for NCX_BT_FLOAT64 data types
rangeQ | Q of typ_rangeval_t structs to normalize |
btyp | base type of range |
boolean typ_ok | ( | const typ_def_t * | typdef | ) |
Check if the typdef chain has any errors.
Checks the named types in the typdef chain to see if they were already flagged as invalid
typdef | starting typdef to check |
boolean typ_ok_for_inline_index | ( | ncx_yang_version_t | langver, |
ncx_btype_t | btyp | ||
) |
Check if the base type is okay to use in an inline index decl.
langver | YANG language version |
btyp | base type enum |
boolean typ_ok_for_metadata | ( | ncx_btype_t | btyp | ) |
Check if the base type is okay to use in an XML attribute.
btyp | base type enum |
boolean typ_ok_for_union | ( | ncx_yang_version_t | langver, |
ncx_btype_t | btyp | ||
) |
Check if the base type is okay to use in an union decl.
langver | YANG language version enum |
btyp | base type enum |
boolean typ_ok_for_xsdlist | ( | ncx_btype_t | btyp | ) |
Check if the base type is okay to use in an ncx:xsdlist typedef.
btyp | base type enum |
Set the fraction-digits field from the typdef chain.
typdef | typdef to set (must be TYP_CL_SIMPLE) |
digits | digits value to set |
void typ_set_leafref_class_key | ( | typ_def_t * | typdef | ) |
Change the leafref class for the type to NCX_LEAFREF_CLASS_KEY.
typdef | typdef for the the leafref |
void typ_set_named_typdef | ( | typ_def_t * | typdef, |
typ_template_t * | imptyp | ||
) |
Set the fields in a named typedef (used by YANG parser)
typdef | type def struct to set |
imptyp | named type to set within 'typ.typdef' |
status_t typ_set_new_named | ( | typ_def_t * | typdef, |
ncx_btype_t | btyp | ||
) |
Create a new typdef inside a typ_named_t struct inside a typ_def_t.
typdef | pointer to the typ_def_t struct to setup |
btyp | builtin type (NCX_BT_NONE if local type extension) |
void typ_set_simple_typdef | ( | typ_template_t * | typ, |
ncx_btype_t | btyp | ||
) |
Set the fields in a simple typedef (used by YANG parser)
typ | type template to set |
btyp | builtin type to set within 'typ.typdef' |
void typ_set_strrest | ( | typ_def_t * | typdef, |
ncx_strrest_t | strrest | ||
) |
Set the string restrinvtion type set for this typdef.
typdef | typdef to check |
strrest | string restriction enum value to set |
Set the target typdef for a leafref or instance-identifier NCX_BT_LEAFREF or NCX_BT_INSTANCE_ID.
[in,out] | typdef | typdef for the the leafref or instance-identifier; typdef is set with the target typdef |
target | target object typedef |
boolean typ_union_needs_xpath_check | ( | typ_def_t * | checkdef | ) |
Walk the union type nodes to check if there are any unconstrained leafref or instance-identifier nodes that need validation.
checkdef | typ_def_t for the designated union type |
void typ_unload_basetypes | ( | void | ) |
Unload and destroy the typ_template_t structs for the base types unload the typ_template_t structs for the ncx_btype_t types.
SHOULD be called during ncx_cleanup
void typ_unset_named_typdef | ( | typ_def_t * | typdef | ) |
UnSet the typ link in a named typedef (used by YANG parser)
Needed if there is a named type loop to prevent any type references such as typ_get_basetype and loop until crash
typdef | type def struct to set |