Lines Matching defs:node

317 	xmlNodePtr node = (xmlNodePtr)group;
320 while (node != NULL) {
321 if (strcmp((char *)(node->name), "sharecfg") == 0) {
323 handle = (sa_handle_t)get_handle_for_root(node);
326 node = node->parent;
342 xmlNodePtr node;
351 for (node = root->xmlChildrenNode; node != NULL;
352 node = node->next) {
353 if (xmlStrcmp(node->name, (xmlChar *)"legacy") == 0) {
354 /* a possible legacy node for this path */
355 lpath = xmlGetProp(node, (xmlChar *)"path");
365 if (node == NULL) {
366 /* need to create the first legacy timestamp node */
367 node = xmlNewChild(root, NULL, (xmlChar *)"legacy", NULL);
369 if (node != NULL) {
374 (void) xmlSetProp(node, (xmlChar *)"timestamp",
376 (void) xmlSetProp(node, (xmlChar *)"path", (xmlChar *)path);
693 xmlNodePtr node = (xmlNodePtr)object;
696 if (xmlStrcmp(node->name, (xmlChar *)"group") == 0)
698 else if (xmlStrcmp(node->name, (xmlChar *)"share") == 0)
700 else if (xmlStrcmp(node->name, (xmlChar *)"resource") == 0)
702 else if (xmlStrcmp(node->name, (xmlChar *)"optionset") == 0)
704 else if (xmlStrcmp(node->name, (xmlChar *)"security") == 0)
1116 * find_group_by_name(node, group)
1118 * search the XML document subtree specified by node to find the group
1124 find_group_by_name(xmlNodePtr node, xmlChar *group)
1128 for (node = node->xmlChildrenNode; node != NULL;
1129 node = node->next) {
1130 if (xmlStrcmp(node->name, (xmlChar *)"group") == 0) {
1134 name = xmlGetProp(node, (xmlChar *)"name");
1145 return (node);
1156 xmlNodePtr node = NULL;
1178 node = find_group_by_name(impl_handle->tree,
1182 if (subgroup != NULL && node != NULL)
1183 node = find_group_by_name(node, (xmlChar *)subgroup);
1185 if (node != NULL && (char *)group != NULL)
1189 return ((sa_group_t)(node));
1219 xmlNodePtr node = NULL;
1228 for (node = ((xmlNodePtr)group)->children; node != NULL;
1229 node = node->next) {
1230 if (xmlStrcmp(node->name, (xmlChar *)"share") == 0) {
1235 path = xmlGetProp(node,
1248 return ((sa_share_t)node);
1261 xmlNodePtr node = NULL;
1264 for (node = ((xmlNodePtr)share)->next; node != NULL;
1265 node = node->next) {
1266 if (xmlStrcmp(node->name, (xmlChar *)"share") == 0) {
1271 return ((sa_share_t)node);
1275 * _sa_get_child_node(node, type)
1277 * find the child node of the specified node that has "type". This is
1282 _sa_get_child_node(xmlNodePtr node, xmlChar *type)
1285 for (child = node->xmlChildrenNode; child != NULL;
1474 xmlNodePtr node = NULL;
1479 node = xmlNewChild((xmlNodePtr)group, NULL, (xmlChar *)"share", NULL);
1480 if (node == NULL) {
1483 return (node);
1486 (void) xmlSetProp(node, (xmlChar *)"path", (xmlChar *)sharepath);
1487 (void) xmlSetProp(node, (xmlChar *)"type",
1490 mark_excluded_protos(group, node, flags);
1511 group, (sa_share_t)node);
1526 xmlUnlinkNode(node);
1527 xmlFreeNode(node);
1528 node = NULL;
1534 return (node);
1549 xmlNodePtr node = NULL;
1592 node = _sa_add_share(group, sharepath, persist,
1598 return ((sa_share_t)node);
1734 /* remove the node from its group then free the memory */
1789 /* remove the node from its group then free the memory */
1831 xmlNodePtr node = NULL;
1833 node = ((xmlNodePtr)share)->parent;
1839 if (node == NULL ||
1840 xmlStrcmp(node->name, (xmlChar *)"sharecfg") == 0)
1841 node = NULL;
1843 return ((sa_group_t)node);
1856 xmlNodePtr node = NULL;
1859 node = xmlNewChild(impl_handle->tree, NULL, (xmlChar *)"group",
1861 if (node != NULL) {
1862 (void) xmlSetProp(node, (xmlChar *)"name",
1864 (void) xmlSetProp(node, (xmlChar *)"state",
1868 return ((sa_group_t)node);
1881 xmlNodePtr node = NULL;
1883 node = xmlNewChild((xmlNodePtr)group, NULL, (xmlChar *)"group", NULL);
1884 if (node != NULL) {
1885 (void) xmlSetProp(node, (xmlChar *)"name",
1887 (void) xmlSetProp(node, (xmlChar *)"state",
1891 return ((sa_group_t)node);
1906 xmlNodePtr node = NULL;
1924 node = xmlNewChild(impl_handle->tree, NULL,
1926 if (node != NULL) {
1927 (void) xmlSetProp(node, (xmlChar *)"name",
1930 (void) xmlSetProp(node, (xmlChar *)"state",
1990 xmlUnlinkNode(node);
1991 xmlFreeNode(node);
1992 node = NULL;
2004 return ((sa_group_t)node);
2057 * get_node_attr(node, tag)
2059 * Get the specified tag(attribute) if it exists on the node. This is
2066 xmlNodePtr node = (xmlNodePtr)nodehdl;
2069 if (node != NULL)
2070 name = xmlGetProp(node, (xmlChar *)tag);
2075 * set_node_attr(node, tag)
2085 xmlNodePtr node = (xmlNodePtr)nodehdl;
2086 if (node != NULL && tag != NULL) {
2088 (void) xmlSetProp(node, (xmlChar *)tag,
2091 (void) xmlUnsetProp(node, (xmlChar *)tag);
2186 xmlNodePtr node;
2187 node = xmlNewChild((xmlNodePtr)share, NULL, (xmlChar *)"description",
2189 xmlNodeSetContent(node, (xmlChar *)content);
2190 return (node);
2312 xmlNodePtr node;
2315 for (node = ((xmlNodePtr)group)->children; node != NULL;
2316 node = node->next) {
2317 if (xmlStrcmp(node->name, (xmlChar *)"optionset") == 0) {
2318 value = xmlGetProp(node, (xmlChar *)"type");
2335 return ((sa_optionset_t)node);
2347 xmlNodePtr node;
2349 for (node = ((xmlNodePtr)optionset)->next; node != NULL;
2350 node = node->next) {
2351 if (xmlStrcmp(node->name, (xmlChar *)"optionset") == 0) {
2355 return ((sa_optionset_t)node);
2370 xmlNodePtr node;
2373 for (node = ((xmlNodePtr)group)->children; node != NULL;
2374 node = node->next) {
2375 if (xmlStrcmp(node->name, (xmlChar *)"security") == 0) {
2377 value = xmlGetProp(node, (xmlChar *)"type");
2393 value = xmlGetProp(node, (xmlChar *)"sectype");
2409 return ((sa_security_t)node);
2421 xmlNodePtr node;
2423 for (node = ((xmlNodePtr)security)->next; node != NULL;
2424 node = node->next) {
2425 if (xmlStrcmp(node->name, (xmlChar *)"security") == 0) {
2429 return ((sa_security_t)node);
2442 xmlNodePtr node = (xmlNodePtr)optionset;
2448 for (node = node->children; node != NULL;
2449 node = node->next) {
2450 if (xmlStrcmp(node->name, (xmlChar *)"option") == 0) {
2453 value = xmlGetProp(node, (xmlChar *)"type");
2466 if (node != NULL && xmlStrcmp(node->name, (xmlChar *)"option") != 0) {
2468 * avoid a non option node -- it is possible to be a
2469 * text node
2471 node = NULL;
2473 return ((sa_property_t)node);
2486 xmlNodePtr node;
2488 for (node = ((xmlNodePtr)property)->next; node != NULL;
2489 node = node->next) {
2490 if (xmlStrcmp(node->name, (xmlChar *)"option") == 0) {
2494 return ((sa_property_t)node);
2506 xmlNodePtr node;
2510 for (node = ((xmlNodePtr)share)->children; node != NULL;
2511 node = node->next) {
2512 if (xmlStrcmp(node->name, (xmlChar *)"description") == 0) {
2517 if (node == NULL && content != NULL) {
2519 node = _sa_set_share_description(share, content);
2520 } else if (node != NULL && content != NULL) {
2522 xmlNodeSetContent(node, (xmlChar *)content);
2523 } else if (node != NULL && content == NULL) {
2525 xmlUnlinkNode(node);
2526 xmlFreeNode(node);
2572 xmlNodePtr node;
2574 for (node = ((xmlNodePtr)share)->children; node != NULL;
2575 node = node->next) {
2576 if (xmlStrcmp(node->name, (xmlChar *)"description") == 0) {
2580 if (node != NULL) {
2581 description = xmlNodeGetContent(node);
2709 xmlNodePtr node = NULL;
2712 node = ((xmlNodePtr)property)->parent;
2713 return ((sa_optionset_t)node);
2726 xmlNodePtr node = NULL;
2729 node = ((xmlNodePtr)optionset)->parent;
2730 return ((sa_group_t)node);
3014 * is_nodetype(node, type)
3016 * Check to see if node is of the type specified.
3020 is_nodetype(void *node, char *type)
3022 return (strcmp((char *)((xmlNodePtr)node)->name, type) == 0);
3194 xmlNodePtr node;
3196 node = xmlNewNode(NULL, (xmlChar *)"section");
3197 if (node != NULL) {
3199 (void) xmlSetProp(node, (xmlChar *)"name",
3202 (void) xmlSetProp(node, (xmlChar *)"extra",
3205 return ((sa_property_t)node);
3223 xmlNodePtr node;
3225 node = xmlNewNode(NULL, (xmlChar *)"option");
3226 if (node != NULL) {
3227 (void) xmlSetProp(node, (xmlChar *)"type", (xmlChar *)name);
3228 (void) xmlSetProp(node, (xmlChar *)"value", (xmlChar *)value);
3230 return ((sa_property_t)node);
3436 xmlNodePtr node = (xmlNodePtr)propset;
3447 for (node = node->children; node != NULL;
3448 node = node->next) {
3449 if (xmlStrcmp(node->name, (xmlChar *)"section") == 0) {
3452 value = xmlGetProp(node, (xmlChar *)"name");
3467 if (node != NULL && xmlStrcmp(node->name, (xmlChar *)"section") != 0) {
3469 * avoid a non option node -- it is possible to be a
3470 * text node
3472 node = NULL;
3474 return ((sa_protocol_properties_t)node);
3486 xmlNodePtr node;
3497 for (node = ((xmlNodePtr)prop)->next; node != NULL;
3498 node = node->next) {
3499 if (xmlStrcmp(node->name, (xmlChar *)"section") == 0) {
3502 value = xmlGetProp(node, (xmlChar *)"name");
3518 return ((sa_property_t)node);
3531 xmlNodePtr node = (xmlNodePtr)propset;
3537 for (node = node->children; node != NULL;
3538 node = node->next) {
3539 if (xmlStrcmp(node->name, (xmlChar *)"option") == 0) {
3542 value = xmlGetProp(node, (xmlChar *)"type");
3555 if (node != NULL && xmlStrcmp(node->name, (xmlChar *)"option") != 0) {
3557 * avoid a non option node -- it is possible to be a
3558 * text node
3560 node = NULL;
3562 return ((sa_property_t)node);
3574 xmlNodePtr node;
3577 for (node = ((xmlNodePtr)prop)->next; node != NULL;
3578 node = node->next) {
3579 if (xmlStrcmp(node->name, (xmlChar *)"option") == 0) {
3582 value = xmlGetProp(node, (xmlChar *)"type");
3596 return ((sa_property_t)node);
3637 xmlNodePtr node;
3640 node = xmlAddChild((xmlNodePtr)propset, (xmlNodePtr)prop);
3641 if (node != NULL)
3655 xmlNodePtr node;
3657 node = xmlNewNode(NULL, (xmlChar *)"propertyset");
3658 if (node != NULL)
3659 (void) xmlSetProp(node, (xmlChar *)"type", (xmlChar *)proto);
3660 return (node);
3673 xmlNodePtr node = NULL;
3677 for (node = ((xmlNodePtr)share)->children; node != NULL;
3678 node = node->next) {
3679 if (xmlStrcmp(node->name, (xmlChar *)"resource") == 0) {
3683 * resource node and not a names
3689 name = xmlGetProp(node,
3702 return ((sa_resource_t)node);
3715 xmlNodePtr node = NULL;
3718 for (node = ((xmlNodePtr)resource)->next; node != NULL;
3719 node = node->next) {
3720 if (xmlStrcmp(node->name, (xmlChar *)"resource") == 0)
3724 return ((sa_share_t)node);
3766 xmlNodePtr node;
3781 node = xmlNewChild((xmlNodePtr)share, NULL,
3783 if (node != NULL) {
3784 (void) xmlSetProp(node, (xmlChar *)"name",
3786 (void) xmlSetProp(node, (xmlChar *)"type", persist ?
3792 (void) xmlSetProp(node, (xmlChar *)"id",
3820 return ((sa_resource_t)node);
4338 xmlNodePtr node;
4343 for (node = ((xmlNodePtr)resource)->children;
4344 node != NULL;
4345 node = node->next) {
4346 if (xmlStrcmp(node->name, (xmlChar *)"description") == 0) {
4352 if (node == NULL && content != NULL) {
4354 node = _sa_set_share_description(resource, content);
4355 } else if (node != NULL && content != NULL) {
4357 xmlNodeSetContent(node, (xmlChar *)content);
4358 } else if (node != NULL && content == NULL) {
4360 xmlUnlinkNode(node);
4361 xmlFreeNode(node);
4390 xmlNodePtr node;
4392 for (node = ((xmlNodePtr)resource)->children; node != NULL;
4393 node = node->next) {
4394 if (xmlStrcmp(node->name, (xmlChar *)"description") == 0)
4397 if (node != NULL) {
4398 description = xmlNodeGetContent(node);