Lines Matching defs:node

150 static int create_shadow(xmlNodePtr node);
156 static int get_fast_dtype(xmlNodePtr node, xmlChar *name);
205 static int pool_xml_elem_wrap(xmlNodePtr node, pool_elem_class_t class,
236 static pool_value_class_t pool_xml_get_attr(xmlNodePtr node, xmlChar *name,
238 int pool_xml_set_attr(xmlNodePtr node, xmlChar *name,
240 static pool_value_class_t pool_xml_get_prop(xmlNodePtr node, xmlChar *name,
242 int pool_xml_set_prop(xmlNodePtr node, xmlChar *name,
285 get_unique_id(xmlNodePtr node, char *id)
289 if (node->doc->_private) {
291 pool_conf_to_elem((pool_conf_t *)node->doc->_private),
301 pool_conf_to_elem((pool_conf_t *)node->doc->_private), "_next_id",
308 * node_create() creates a child node of type name of the supplied parent in
309 * the supplied document. If the parent or document is NULL, create the node
315 xmlNodePtr node;
318 node = xmlNewNode(NULL, name);
320 node = xmlNewChild(parent, NULL, name, NULL);
321 return (node);
325 * node_create_with_id() creates a child node of type name of the supplied
326 * parent with the ref_id generated by get_unique_id(). Actual node creation
334 xmlNodePtr node = node_create(parent, name);
335 if (node != NULL) {
336 if (get_unique_id(node, id) != PO_SUCCESS) {
337 xmlUnlinkNode(node);
338 xmlFreeNode(node); /* recurses all children */
342 if (xmlSetProp(node, BAD_CAST c_ref_id, BAD_CAST id) == NULL) {
343 xmlUnlinkNode(node);
344 xmlFreeNode(node); /* recurses all children */
349 return (node);
549 /* use xpath to find the node with the appropriate value for name */
555 ctx->node = pxe->pxe_node;
573 * Get the data type for an attribute name from the element node. The data
578 pool_xml_get_attr(xmlNodePtr node, xmlChar *name, pool_value_t *value)
585 if (xmlHasProp(node, name) == NULL && pool_is_xml_attr(node->doc,
586 (const char *) node->name, (const char *) name) == PO_FALSE) {
590 if (xmlHasProp(node, BAD_CAST c_a_dtype) == NULL) {
594 data = xmlGetProp(node, name);
595 data_type = get_fast_dtype(node, name);
644 * Set the data type for an attribute name from the element node. The
649 pool_xml_set_attr(xmlNodePtr node, xmlChar *name, const pool_value_t *value)
660 if (xmlHasProp(node, name) == NULL && pool_is_xml_attr(node->doc,
661 (const char *) node->name, (const char *) name) == PO_FALSE) {
666 if (xmlHasProp(node, BAD_CAST c_a_dtype) == NULL) {
670 data_type = get_fast_dtype(node, name);
709 if (xmlSetProp(node, name, buf) == NULL) {
717 * Get the data type for a property name from the element node. The data
723 pool_xml_get_prop(xmlNodePtr node, xmlChar *name, pool_value_t *value)
733 /* use xpath to find the node with the appropriate value for name */
735 if ((ctx = xmlXPathNewContext(node->doc)) == NULL) {
739 ctx->node = node;
817 * Set the data type for a property name from the element node. The
822 pool_xml_set_prop(xmlNodePtr node, xmlChar *name, const pool_value_t *value)
835 /* use xpath to find the node with the appropriate value for name */
838 if ((ctx = xmlXPathNewContext(node->doc)) == NULL) {
842 ctx->node = node;
852 (node, (const char *)name, value->pv_class);
958 ctx->node = pxe->pxe_node;
1069 * XML data node contained within the passed node. Note this function is
1074 create_shadow(xmlNodePtr node)
1080 if (0 == (xmlStrcmp(node->name,
1082 ret = pool_xml_elem_wrap(node, PEC_SYSTEM, PREC_INVALID,
1084 } else if (0 == (xmlStrcmp(node->name,
1086 ret = pool_xml_elem_wrap(node, PEC_POOL, PREC_INVALID,
1088 } else if (0 == (xmlStrcmp(node->name,
1092 data = xmlGetProp(node, BAD_CAST c_type);
1096 ret = pool_xml_elem_wrap(node, PEC_RES_COMP, res_class,
1098 } else if (0 == (xmlStrcmp(node->name,
1102 data = xmlGetProp(node, BAD_CAST c_type);
1106 ret = pool_xml_elem_wrap(node, PEC_RES_AGG, res_class,
1108 } else if (0 == (xmlStrcmp(node->name,
1112 data = xmlGetProp(node, BAD_CAST c_type);
1117 ret = pool_xml_elem_wrap(node, PEC_COMP, PREC_INVALID,
1121 for (sib = node->children; sib != NULL; sib = sib->next) {
1358 * "Wrap" a suplied XML node with a pool_elem_t sub-type of the supplied
1363 pool_xml_elem_wrap(xmlNodePtr node, pool_elem_class_t class,
1367 pool_conf_t *conf = node->doc->_private;
1402 node->_private = elem;
1403 elem->pxe_node = node;
1472 * Create an XML node in the supplied configuration with a pool_elem_t
1494 * PEC_POOL, the parent must be the system node
1568 * Put the type and an invalid sys_id on the node.
1778 /* Update the context node */
1797 /* Update the context node */
1846 /* Update the context node */
1860 /* Update the context node */
1893 * Set the container for a node.
1918 * Get the container for a node.
2235 rs->pxr_ctx->node = xmlDocGetRootElement
2238 rs->pxr_ctx->node = pxe->pxe_node;
2631 * supplied node. This is called get_fast_dtype() because it uses the cached
2635 get_fast_dtype(xmlNodePtr node, xmlChar *name)
2640 if ((elem = xmlGetDtdElementDesc(node->doc->extSubset, node->name))