if (findResource(cib, ID(xml_node)) != NULL) FNRET(-1); FNRET(add_node_copy(cib, XML_CIB_TAG_RESOURCES, xml_node));
int add_res = 0; const char * id = NULL; const char * type = NULL;  FNIN();  id = xmlGetProp(xml_node, XML_ATTR_ID); type = xmlGetProp(xml_node, XML_CIB_ATTR_NODETYPE);  if (id == NULL || strlen(id) < 1) add_res = -1; else if (findResource(cib, ID(xml_node)) != NULL) add_res = -2; else if (type == NULL || strlen(type) < 1) add_res = -3; else add_res = add_node_copy(cib, XML_CIB_TAG_RESOURCES, xml_node);  FNRET(add_res);
addResource(xmlNodePtr cib, cibResource *xml_node){    if (findResource(cib, ID(xml_node)) != NULL) FNRET(-1);    FNRET(add_node_copy(cib, XML_CIB_TAG_RESOURCES, xml_node));}