Simple C Expat Wrapper (SCEW)
1.1.7
|
Element comparison routines. More...
Typedefs | |
typedef scew_bool(* | scew_element_cmp_hook )(scew_element const *, scew_element const *) |
SCEW element compare hooks might be used to define new user XML element comparisons. More... | |
Functions | |
SCEW_API scew_bool | scew_element_compare (scew_element const *a, scew_element const *b, scew_element_cmp_hook hook) |
Performs a deep comparison of the two given elements. More... | |
Element comparison routines.
typedef scew_bool(* scew_element_cmp_hook)(scew_element const *, scew_element const *) |
SCEW element compare hooks might be used to define new user XML element comparisons.
This hook must only compare the element's name and contents and the list of attributes. The new hook is to be used by scew_element_compare.
SCEW_API scew_bool scew_element_compare | ( | scew_element const * | a, |
scew_element const * | b, | ||
scew_element_cmp_hook | hook | ||
) |
Performs a deep comparison of the two given elements.
The comparison is done via the comparison hook. If hook is NULL, the default comparison is done:
It is important to note that, for any given hook (or if NULL), the children are automatically traversed recursively using the given hook. Therefore, the hook must only provide comparisons for element's name and contents and the list of attribtues.
There is no restriction on the provided comparison hook (if any), thus the user is responsible to define how the comparison is to be done.
a | one of the elements to compare. |
b | one of the elements to compare. |
hook | the user defined comparison function. If NULL, the default comparison is used. |