yumapro  24.10-3
YumaPro SDK
Loading...
Searching...
No Matches
User Defined Data Types

User defined types allow SIL code (not SIL-SA code) to provide type handlers. More...

Collaboration diagram for User Defined Data Types:

Data Structures

struct  typ_userdef_t
 one userdef control block The CB will exist if one or more callbacks are registered More...
 

Typedefs

typedef status_t(* typ_validate_fn_t) (typ_def_t *typdef, val_value_t *val, void *cookie)
 userdef validate callback function user validation callback for a userdef type More...
 
typedef status_t(* typ_canonical_fn_t) (typ_def_t *typdef, val_value_t *val, void *cookie)
 userdef canonical callback function convert the inval to the canonical format for the type More...
 
typedef status_t(* typ_compare_fn_t) (const typ_def_t *typdef, const val_value_t *val1, const val_value_t *val2, void *cookie, int *retval)
 userdef compare callback function compare 2 val_value_t nodes of the same user defined type More...
 

Functions

status_t typ_userdef_register (const xmlChar *modname, const xmlChar *typname, typ_validate_fn_t validate_fn, typ_canonical_fn_t canonical_fn, typ_compare_fn_t compare_fn, void *cookie)
 Register the callback functions for a user defined type. More...
 
void typ_userdef_clean_typdef (typ_def_t *typdef)
 Clean the user typedef fields. More...
 
status_t typ_userdef_validate (val_value_t *val)
 Invoke the validate callback function for a user defined type if it exists. More...
 
status_t typ_userdef_canonical (val_value_t *val)
 Invoke the canonical callback function for a user defined type if it exists. More...
 
status_t typ_userdef_compare (const val_value_t *val1, const val_value_t *val2, int32 *ret)
 Invoke the compare callback function for a user defined type if it exists. More...
 

Detailed Description

User defined types allow SIL code (not SIL-SA code) to provide type handlers.

There are validate, compare, and canonicalize callbacks.

Typedef Documentation

◆ typ_canonical_fn_t

typedef status_t(* typ_canonical_fn_t) (typ_def_t *typdef, val_value_t *val, void *cookie)

userdef canonical callback function convert the inval to the canonical format for the type

Parameters
typdeftype definition for the user defined type
[in,out]valinput value to convert
  • val can be converted to canonical format
cookiecookie value passed to register function
Returns
status

◆ typ_compare_fn_t

typedef status_t(* typ_compare_fn_t) (const typ_def_t *typdef, const val_value_t *val1, const val_value_t *val2, void *cookie, int *retval)

userdef compare callback function compare 2 val_value_t nodes of the same user defined type

Parameters
typdeftype definition for the user defined type
val1input value 1 to comapre
val2input value 2 to comapre
cookiecookie value passed to register function
[out]retvaladdress of return compare value
  • *retval return compare value
Returns
status (ERR_NCX_SKIPPED if no compare done)

◆ typ_validate_fn_t

typedef status_t(* typ_validate_fn_t) (typ_def_t *typdef, val_value_t *val, void *cookie)

userdef validate callback function user validation callback for a userdef type

Parameters
typdeftype definition for the user defined type
valinput value to convert
cookiecookie value passed to register function
Returns
the validation status

Function Documentation

◆ typ_userdef_canonical()

status_t typ_userdef_canonical ( val_value_t val)

Invoke the canonical callback function for a user defined type if it exists.

Parameters
[out]valvalue 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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ typ_userdef_clean_typdef()

void typ_userdef_clean_typdef ( typ_def_t typdef)

Clean the user typedef fields.

Parameters
typdeftype definition struct to clean
Here is the caller graph for this function:

◆ typ_userdef_compare()

status_t typ_userdef_compare ( const val_value_t val1,
const val_value_t val2,
int32 *  ret 
)

Invoke the compare callback function for a user defined type if it exists.

Parameters
val1value to check (VAL_TYPDEF) is checked for a userdef
val2value to check must be same type as val1
[out]retaddress of compare result
  • *ret 1, 0, or 1 for compare result
Returns
status or ERR_NCX_SKIPPED if no callback to invoke
Here is the call graph for this function:
Here is the caller graph for this function:

◆ typ_userdef_register()

status_t typ_userdef_register ( const xmlChar *  modname,
const xmlChar *  typname,
typ_validate_fn_t  validate_fn,
typ_canonical_fn_t  canonical_fn,
typ_compare_fn_t  compare_fn,
void *  cookie 
)

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
modnamemodule name defining the type
typnamename of the type
validate_fnvalidate callback (may be NULL)
canonical_fncanonical callback (may be NULL)
compare_fncompare callback (may be NULL)
cookiecookie to pass to callback function
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ typ_userdef_validate()

status_t typ_userdef_validate ( val_value_t val)

Invoke the validate callback function for a user defined type if it exists.

Parameters
valvalue to check (VAL_TYPDEF) is checked for a userdef
Returns
validation status or NO_ERR if no callback to invoke
Here is the call graph for this function:
Here is the caller graph for this function: