User defined types allow SIL code (not SIL-SA code) to provide type handlers.
More...
|
struct | typ_userdef_t |
| one userdef control block The CB will exist if one or more callbacks are registered More...
|
|
User defined types allow SIL code (not SIL-SA code) to provide type handlers.
There are validate, compare, and canonicalize callbacks.
- validate callback
- convert to canonical format callback
- compare callback If a callback is not provided then the system behavior is used instead.
◆ typ_canonical_fn_t
userdef canonical callback function convert the inval to the canonical format for the type
- Parameters
-
| typdef | type definition for the user defined type |
[in,out] | val | input value to convert
- val can be converted to canonical format
|
| cookie | cookie value passed to register function |
- Returns
- status
◆ typ_compare_fn_t
userdef compare callback function compare 2 val_value_t nodes of the same user defined type
- Parameters
-
| typdef | type definition for the user defined type |
| val1 | input value 1 to comapre |
| val2 | input value 2 to comapre |
| cookie | cookie value passed to register function |
[out] | retval | address of return compare value
- *retval return compare value
|
- Returns
- status (ERR_NCX_SKIPPED if no compare done)
◆ typ_validate_fn_t
userdef validate callback function user validation callback for a userdef type
- Parameters
-
typdef | type definition for the user defined type |
val | input value to convert |
cookie | cookie value passed to register function |
- Returns
- the validation status
◆ typ_userdef_canonical()
Invoke the canonical callback function for a user defined type if it exists.
- Parameters
-
[out] | val | value to check (VAL_TYPDEF) is checked for a userdef
- val may be modified if converted to canonical form
|
- Returns
- status or NO_ERR if no callback to invoke
◆ typ_userdef_clean_typdef()
void typ_userdef_clean_typdef |
( |
typ_def_t * |
typdef | ) |
|
Clean the user typedef fields.
- Parameters
-
typdef | type definition struct to clean |
◆ typ_userdef_compare()
Invoke the compare callback function for a user defined type if it exists.
- Parameters
-
| val1 | value to check (VAL_TYPDEF) is checked for a userdef |
| val2 | value to check must be same type as val1 |
[out] | ret | address of compare result
- *ret 1, 0, or 1 for compare result
|
- Returns
- status or ERR_NCX_SKIPPED if no callback to invoke
◆ typ_userdef_register()
Register the callback functions for a user defined type.
At least one callback needs to be set in order for this userdef type to have any affect
- Parameters
-
modname | module name defining the type |
typname | name of the type |
validate_fn | validate callback (may be NULL) |
canonical_fn | canonical callback (may be NULL) |
compare_fn | compare callback (may be NULL) |
cookie | cookie to pass to callback function |
- Returns
- status
◆ typ_userdef_validate()
Invoke the validate callback function for a user defined type if it exists.
- Parameters
-
val | value to check (VAL_TYPDEF) is checked for a userdef |
- Returns
- validation status or NO_ERR if no callback to invoke