data parsers CHANGE simplify API of data parser functions

Adds some checks regarding data set type and prepares code for support
of RPCs/actions and Notifications.
diff --git a/tests/src/test_tree_data.c b/tests/src/test_tree_data.c
index dbc26ea..5ba858a 100644
--- a/tests/src/test_tree_data.c
+++ b/tests/src/test_tree_data.c
@@ -111,8 +111,8 @@
 
     assert_int_equal(LY_SUCCESS, lyd_compare(NULL, NULL, 0));
 
-    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA));
-    assert_non_null(tree2 = lyd_parse_mem(ctx, data2, LYD_XML, LYD_OPT_DATA));
+    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA, NULL));
+    assert_non_null(tree2 = lyd_parse_mem(ctx, data2, LYD_XML, LYD_OPT_DATA, NULL));
     assert_int_equal(LY_SUCCESS, lyd_compare(tree1, tree2, 0));
     assert_int_equal(LY_ENOT, lyd_compare(tree1, tree2, LYD_COMPARE_FULL_RECURSION));
     assert_int_equal(LY_ENOT, lyd_compare(((struct lyd_node_inner*)tree1)->child, tree2, 0));
@@ -121,8 +121,8 @@
 
     data1 = "<l2 xmlns=\"urn:tests:a\"><c><x>a</x></c></l2><l2 xmlns=\"urn:tests:a\"><c><x>b</x></c></l2>";
     data2 = "<l2 xmlns=\"urn:tests:a\"><c><x>b</x></c></l2>";
-    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA));
-    assert_non_null(tree2 = lyd_parse_mem(ctx, data2, LYD_XML, LYD_OPT_DATA));
+    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA, NULL));
+    assert_non_null(tree2 = lyd_parse_mem(ctx, data2, LYD_XML, LYD_OPT_DATA, NULL));
     assert_int_equal(LY_ENOT, lyd_compare(tree1, tree2, 0));
     assert_int_equal(LY_SUCCESS, lyd_compare(tree1->next, tree2, 0));
     lyd_free_all(tree1);
@@ -130,8 +130,8 @@
 
     data1 = "<ll xmlns=\"urn:tests:a\">a</ll><ll xmlns=\"urn:tests:a\">b</ll>";
     data2 = "<ll xmlns=\"urn:tests:a\">b</ll>";
-    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA));
-    assert_non_null(tree2 = lyd_parse_mem(ctx, data2, LYD_XML, LYD_OPT_DATA));
+    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA, NULL));
+    assert_non_null(tree2 = lyd_parse_mem(ctx, data2, LYD_XML, LYD_OPT_DATA, NULL));
     assert_int_equal(LY_ENOT, lyd_compare(tree1, tree2, 0));
     assert_int_equal(LY_ENOT, lyd_compare(NULL, tree2, 0));
     assert_int_equal(LY_ENOT, lyd_compare(tree1, NULL, 0));
@@ -141,8 +141,8 @@
 
     data1 = "<c xmlns=\"urn:tests:a\"><x>x</x></c>";
     data2 = "<c xmlns=\"urn:tests:a\"><x>y</x></c>";
-    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA));
-    assert_non_null(tree2 = lyd_parse_mem(ctx, data2, LYD_XML, LYD_OPT_DATA));
+    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA, NULL));
+    assert_non_null(tree2 = lyd_parse_mem(ctx, data2, LYD_XML, LYD_OPT_DATA, NULL));
     assert_int_equal(LY_SUCCESS, lyd_compare(tree1, tree2, 0));
     assert_int_equal(LY_ENOT, lyd_compare(tree1, tree2, LYD_COMPARE_FULL_RECURSION));
     lyd_free_all(tree1);
@@ -150,8 +150,8 @@
 
     data1 = "<c xmlns=\"urn:tests:a\"><x>x</x></c>";
     data2 = "<c xmlns=\"urn:tests:a\"><x>x</x><x>y</x></c>";
-    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA));
-    assert_non_null(tree2 = lyd_parse_mem(ctx, data2, LYD_XML, LYD_OPT_DATA));
+    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA, NULL));
+    assert_non_null(tree2 = lyd_parse_mem(ctx, data2, LYD_XML, LYD_OPT_DATA, NULL));
     assert_int_equal(LY_SUCCESS, lyd_compare(tree1, tree2, 0));
     assert_int_equal(LY_ENOT, lyd_compare(tree1, tree2, LYD_COMPARE_FULL_RECURSION));
     lyd_free_all(tree1);
@@ -159,12 +159,12 @@
 
     data1 = "<any xmlns=\"urn:tests:a\"><x>x</x></any>";
     data2 = "<any xmlns=\"urn:tests:a\"><x>x</x><x>y</x></any>";
-    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA));
-    assert_non_null(tree2 = lyd_parse_mem(ctx, data2, LYD_XML, LYD_OPT_DATA));
+    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA, NULL));
+    assert_non_null(tree2 = lyd_parse_mem(ctx, data2, LYD_XML, LYD_OPT_DATA, NULL));
     assert_int_equal(LY_ENOT, lyd_compare(tree1, tree2, 0));
     lyd_free_all(tree1);
     data1 = "<any xmlns=\"urn:tests:a\"><x>x</x><x>y</x></any>";
-    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA));
+    assert_non_null(tree1 = lyd_parse_mem(ctx, data1, LYD_XML, LYD_OPT_DATA, NULL));
     assert_int_equal(LY_SUCCESS, lyd_compare(tree1, tree2, 0));
     lyd_free_all(tree1);
     lyd_free_all(tree2);