Simple C Expat Wrapper (SCEW)  1.1.7
Typedefs | Functions
Comparison

Tree comparison routines. More...

Typedefs

typedef scew_bool(* scew_tree_cmp_hook )(scew_tree const *, scew_tree const *)
 SCEW tree compare hooks might be used to define new user XML tree comparisons. More...
 

Functions

SCEW_API scew_bool scew_tree_compare (scew_tree const *a, scew_tree const *b, scew_tree_cmp_hook hook)
 Performs a deep comparison for the given trees. More...
 

Detailed Description

Tree comparison routines.

Typedef Documentation

typedef scew_bool(* scew_tree_cmp_hook)(scew_tree const *, scew_tree const *)

SCEW tree compare hooks might be used to define new user XML tree comparisons.

The hooks are used by scew_tree_compare.

Returns
true if the given XML trees are considered equal, false otherwise.

Function Documentation

SCEW_API scew_bool scew_tree_compare ( scew_tree const *  a,
scew_tree const *  b,
scew_tree_cmp_hook  hook 
)

Performs a deep comparison for the given trees.

The comparison is done via the comparison hook. If hook is NULL, the default comparison is done:

  • XML declaration: version, encoding and standalone attribute (encoding is considered case-sensitive).
  • Preamble is considered case-sensitive as well.
  • The root element comparison uses scew_element_compare with a NULL element comparison hook.

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.

Precondition
a != NULL
b != NULL
Parameters
aone of the trees to compare.
bone of the trees to compare.
hookthe user defined comparison function. If NULL, the default comparison is used.
Returns
true if trees are considered equal, false otherwise.