Lines Matching refs:parent

27  *   stp_mxmlRemove()     - Remove a node from its parent.
43 static stp_mxml_node_t *mxml_new(stp_mxml_node_t *parent, stp_mxml_type_t type);
49 * Adds the specified node to the parent. If the child argument is not
58 stp_mxmlAdd(stp_mxml_node_t *parent, /* I - Parent node */
63 /* fprintf(stderr, "stp_mxmlAdd(parent=%p, where=%d, child=%p, node=%p)\n", parent,
70 if (!parent || !node)
74 * Remove the node from any existing parent...
77 if (node->parent)
84 node->parent = parent;
89 if (!child || child == parent->child || child->parent != parent)
92 * Insert as first node under parent...
95 node->next = parent->child;
97 if (parent->child)
98 parent->child->prev = node;
100 parent->last_child = node;
102 parent->child = node;
116 parent->child = node;
123 if (!child || child == parent->last_child || child->parent != parent)
126 * Insert as last node under parent...
129 node->parent = parent;
130 node->prev = parent->last_child;
132 if (parent->last_child)
133 parent->last_child->next = node;
135 parent->child = node;
137 parent->last_child = node;
151 parent->last_child = node;
163 * If the specified node has a parent, this function first removes the
164 * node from its parent using the stp_mxmlRemove() function.
183 * Remove the node from its parent, if any...
245 * The new element node is added to the end of the specified parent's child
247 * element node has no parent.
251 stp_mxmlNewElement(stp_mxml_node_t *parent, /* I - Parent node or STP_MXML_NO_PARENT */
268 if ((node = mxml_new(parent, STP_MXML_ELEMENT)) != NULL)
278 * The new integer node is added to the end of the specified parent's child
280 * integer node has no parent.
284 stp_mxmlNewInteger(stp_mxml_node_t *parent, /* I - Parent node or STP_MXML_NO_PARENT */
294 if (!parent)
301 if ((node = mxml_new(parent, STP_MXML_INTEGER)) != NULL)
311 * The new opaque node is added to the end of the specified parent's child
313 * opaque node has no parent. The opaque string must be nul-terminated and
318 stp_mxmlNewOpaque(stp_mxml_node_t *parent, /* I - Parent node or STP_MXML_NO_PARENT */
328 if (!parent || !opaque)
335 if ((node = mxml_new(parent, STP_MXML_OPAQUE)) != NULL)
345 * The new real number node is added to the end of the specified parent's
347 * the new real number node has no parent.
351 stp_mxmlNewReal(stp_mxml_node_t *parent, /* I - Parent node or STP_MXML_NO_PARENT */
361 if (!parent)
368 if ((node = mxml_new(parent, STP_MXML_REAL)) != NULL)
378 * The new text node is added to the end of the specified parent's child
380 * text node has no parent. The whitespace parameter is used to specify
386 stp_mxmlNewText(stp_mxml_node_t *parent, /* I - Parent node or STP_MXML_NO_PARENT */
397 if (!parent || !string)
404 if ((node = mxml_new(parent, STP_MXML_TEXT)) != NULL)
415 * 'stp_mxmlRemove()' - Remove a node from its parent.
418 * This function does nothing if the node has no parent.
430 if (!node || !node->parent)
434 * Remove from parent...
440 node->parent->child = node->next;
445 node->parent->last_child = node->prev;
447 node->parent = NULL;
458 mxml_new(stp_mxml_node_t *parent, /* I - Parent node */
478 * Add to the parent if present...
481 if (parent)
482 stp_mxmlAdd(parent, STP_MXML_ADD_AFTER, STP_MXML_ADD_TO_PARENT, node);