Lines Matching +full:child +full:- +full:node
3 * Copyright (c) 2012-2013, Qualcomm Atheros, Inc.
12 #include "xml-utils.h"
19 xml_node_t *node; in get_node_uri_iter() local
26 node = root; in get_node_uri_iter()
27 xml_node_for_each_sibling(ctx, node) { in get_node_uri_iter()
28 xml_node_for_each_check(ctx, node); in get_node_uri_iter()
29 name = xml_node_get_localname(ctx, node); in get_node_uri_iter()
34 if (node == NULL) in get_node_uri_iter()
38 return get_node_uri_iter(ctx, xml_node_first_child(ctx, node), in get_node_uri_iter()
42 return node; in get_node_uri_iter()
50 xml_node_t *node; in get_node_uri() local
56 node = get_node_uri_iter(ctx, root, search); in get_node_uri()
59 return node; in get_node_uri()
67 xml_node_t *node; in get_node_iter() local
74 xml_node_for_each_child(ctx, node, root) { in get_node_iter()
75 xml_node_for_each_check(ctx, node); in get_node_iter()
76 name = xml_node_get_localname(ctx, node); in get_node_iter()
81 if (node == NULL) in get_node_iter()
84 return get_node_iter(ctx, node, end); in get_node_iter()
85 return node; in get_node_iter()
93 xml_node_t *node; in get_node() local
99 node = get_node_iter(ctx, root, search); in get_node()
102 return node; in get_node()
109 xml_node_t *node; in get_child_node() local
112 xml_node_for_each_child(ctx, node, root) { in get_child_node()
113 xml_node_for_each_check(ctx, node); in get_child_node()
114 match = get_node(ctx, node, path); in get_child_node()
125 xml_node_t *node; in node_from_file() local
148 count--; in node_from_file()
158 os_memset(start, ' ', pos - start); in node_from_file()
162 node = xml_node_from_buf(ctx, buf); in node_from_file()
165 return node; in node_from_file()
169 int node_to_file(struct xml_node_ctx *ctx, const char *fname, xml_node_t *node) in node_to_file() argument
174 str = xml_node_to_str(ctx, node); in node_to_file()
176 return -1; in node_to_file()
181 return -1; in node_to_file()
192 static char * get_val(struct xml_node_ctx *ctx, xml_node_t *node) in get_val() argument
196 val = xml_node_get_text(ctx, node); in get_val()
230 xml_node_t *node; in node_to_tnds() local
236 xml_node_for_each_child(ctx, node, in) { in node_to_tnds()
237 xml_node_for_each_check(ctx, node); in node_to_tnds()
238 name = xml_node_get_localname(ctx, node); in node_to_tnds()
240 tnds = xml_node_create(ctx, out, NULL, "Node"); in node_to_tnds()
248 val = get_val(ctx, node); in node_to_tnds()
249 if (val || !xml_node_first_child(ctx, node)) in node_to_tnds()
255 node_to_tnds(ctx, new_uri ? out : tnds, node, new_uri); in node_to_tnds()
264 xml_node_t *node; in add_ddfname() local
266 node = xml_node_create(ctx, parent, NULL, "RTProperties"); in add_ddfname()
267 if (node == NULL) in add_ddfname()
268 return -1; in add_ddfname()
269 node = xml_node_create(ctx, node, NULL, "Type"); in add_ddfname()
270 if (node == NULL) in add_ddfname()
271 return -1; in add_ddfname()
272 xml_node_create_text(ctx, node, NULL, "DDFName", urn); in add_ddfname()
281 xml_node_t *node; in mo_to_tnds() local
292 node = xml_node_create(ctx, root, NULL, "Node"); in mo_to_tnds()
293 if (node == NULL) in mo_to_tnds()
295 xml_node_create_text(ctx, node, NULL, "NodeName", name); in mo_to_tnds()
297 add_ddfname(ctx, node, urn); in mo_to_tnds()
299 node_to_tnds(ctx, use_path ? root : node, mo, use_path ? name : NULL); in mo_to_tnds()
310 xml_node_t *node, in get_first_child_node() argument
314 xml_node_t *child; in get_first_child_node() local
316 xml_node_for_each_child(ctx, child, node) { in get_first_child_node()
317 xml_node_for_each_check(ctx, child); in get_first_child_node()
318 lname = xml_node_get_localname(ctx, child); in get_first_child_node()
320 return child; in get_first_child_node()
327 static char * get_node_text(struct xml_node_ctx *ctx, xml_node_t *node, in get_node_text() argument
330 node = get_first_child_node(ctx, node, node_name); in get_node_text()
331 if (node == NULL) in get_node_text()
333 return xml_node_get_text(ctx, node); in get_node_text()
338 xml_node_t *node, const char *uri) in add_mo_node() argument
343 nodename = get_node_text(ctx, node, "NodeName"); in add_mo_node()
346 value = get_node_text(ctx, node, "Value"); in add_mo_node()
359 path = get_node_text(ctx, node, "Path"); in add_mo_node()
385 xml_node_t *node, const char *uri) in tnds_to_mo_iter() argument
387 xml_node_t *child; in tnds_to_mo_iter() local
391 xml_node_for_each_sibling(ctx, node) { in tnds_to_mo_iter()
392 xml_node_for_each_check(ctx, node); in tnds_to_mo_iter()
394 nodename = get_node_text(ctx, node, "NodeName"); in tnds_to_mo_iter()
398 name = xml_node_get_localname(ctx, node); in tnds_to_mo_iter()
399 if (strcmp(name, "Node") == 0) { in tnds_to_mo_iter()
401 printf("Invalid TNDS tree structure - " in tnds_to_mo_iter()
406 root = add_mo_node(ctx, root, node, uri); in tnds_to_mo_iter()
409 child = get_first_child_node(ctx, node, "Node"); in tnds_to_mo_iter()
410 if (child) { in tnds_to_mo_iter()
412 tnds_to_mo_iter(ctx, root, child, nodename); in tnds_to_mo_iter()
416 tnds_to_mo_iter(ctx, root, child, new_uri); in tnds_to_mo_iter()
430 xml_node_t *node; in tnds_to_mo() local
436 node = get_first_child_node(ctx, tnds, "Node"); in tnds_to_mo()
437 if (!node) in tnds_to_mo()
439 return tnds_to_mo_iter(ctx, NULL, node, NULL); in tnds_to_mo()
443 xml_node_t * soap_build_envelope(struct xml_node_ctx *ctx, xml_node_t *node) in soap_build_envelope() argument
449 ctx, "http://www.w3.org/2003/05/soap-envelope", "soap12", &ns, in soap_build_envelope()
454 xml_node_add_child(ctx, body, node); in soap_build_envelope()
461 xml_node_t *body, *child; in soap_get_body() local
466 xml_node_for_each_child(ctx, child, body) { in soap_get_body()
467 xml_node_for_each_check(ctx, child); in soap_get_body()
468 return child; in soap_get_body()