char *section_name = pluralSection(obj_type);  CRM_DEBUG("xml things"); fragment = create_xml_node(NULL, XML_TAG_FRAGMENT); set_xml_property_copy(fragment, XML_ATTR_SECTION, section_name); set_xml_property_copy(msg_options, XML_ATTR_FILTER_TYPE, section_name);  cib = createEmptyCib(); CRM_DEBUG("get the right section"); object_root = get_object_root(section_name, cib); xmlAddChild(object_root, cib_object);  xmlAddChild(fragment, cib); CRM_DEBUG("Fragment created");
handleCibMod(void){	char ch = 0;	gboolean more = TRUE;	gboolean inTag = FALSE;	xmlBufferPtr xml_buffer = xmlBufferCreate();		while (more) {		ch = fgetc(stdin);//		cl_log(LOG_DEBUG, "Got [%c]", ch);		switch(ch) {			case EOF: 			case 0:				ch = 0;				more = FALSE; 				xmlBufferAdd(xml_buffer, &ch, 1);				break;			case '>':			case '<':				inTag = TRUE;				if(ch == '>') inTag = FALSE;				xmlBufferAdd(xml_buffer, &ch, 1);				break;			case '\n':			case '\t':			case ' ':				ch = ' ';				if(inTag) {					xmlBufferAdd(xml_buffer, &ch, 1);				} 				break;			default:				xmlBufferAdd(xml_buffer, &ch, 1);				break;		}	}		xmlNodePtr cib_object = NULL;	const char *the_xml = xmlBufferContent(xml_buffer);	xmlDocPtr doc = xmlParseMemory(the_xml, strlen(the_xml));	if (doc == NULL) {		cl_log(LOG_ERR, "Malformed XML [xml=%s]", the_xml);		return NULL;	}	cib_object = xmlDocGetRootElement(doc);	xml_message_debug(cib_object, "Created fragment");		if(strcmp(cib_object->name, obj_type) != 0) {		cl_log(LOG_ERR, "Mismatching xml."		       "  Expected root element <%s>, got <%s>",		       obj_type, cib_object->name);		return NULL;	}	const char *attr_name = NULL;	const char *attr_value = NULL;	attr_name = XML_ATTR_ID;		attr_value = xmlGetProp(cib_object, attr_name);	if(attr_name == NULL || strlen(attr_name) == 0) {		cl_log(LOG_ERR, "No value for %s specified.", attr_name);		return NULL;	}		CRM_DEBUG("Object creation complete");	// create the cib request	xmlNodePtr cib = NULL, fragment = NULL, object_root = NULL;	set_xml_property_copy(msg_options, XML_ATTR_OP, cib_action);		// create the update section	char *section_name = pluralSection(obj_type);	CRM_DEBUG("xml things");	fragment = create_xml_node(NULL, XML_TAG_FRAGMENT);	set_xml_property_copy(fragment, XML_ATTR_SECTION, section_name);	set_xml_property_copy(msg_options, XML_ATTR_FILTER_TYPE, section_name);	cib = createEmptyCib();	CRM_DEBUG("get the right section");	object_root = get_object_root(section_name, cib);	xmlAddChild(object_root, cib_object);	xmlAddChild(fragment, cib);	CRM_DEBUG("Fragment created");	return fragment;}