main.c
static void
print_element_names(xmlNode * a_node)
{
	xmlNode *cur_node = NULL;

	for (cur_node = a_node; cur_node; cur_node = cur_node->next) {

		if (cur_node->properties && cur_node->properties->next) {

			char *nameProp = (char *) cur_node->properties->children->content;
			char *valueProp = (char *) cur_node->properties->next->children->content;
			int changeType = 0;
			float value = 0;

			// Increase 10
			for (int i = 0; NULL != increasex10List[i]; i++) {
				if (0 == strcmp(nameProp, increasex10List[i])) {
					changeType = INCREASEx10;
					goto FINISHED_CHECK_CHANGE;
				} else {}
			}

			// Increase 2
			for (int i = 0; NULL != increasex2List[i]; i++) {
				if (0 == strcmp(nameProp, increasex2List[i])) {
					changeType = INCREASEx2;
					goto FINISHED_CHECK_CHANGE;
				} else {}
			}

			//Decrease
			for (int i = 0; NULL != decreaseList[i]; i++) {
				if (0 == strcmp(nameProp, decreaseList[i])) {
					changeType = DECREASE;
					goto FINISHED_CHECK_CHANGE;
				} else {}
			}
FINISHED_CHECK_CHANGE:
			if (changeType) {
				printf("\t%s = %s -> ", nameProp, valueProp);
				sscanf(valueProp, "%f", &value);
				switch (changeType) {
					case INCREASEx10:
					case INCREASEx2:

						if (0 == value) {
							value = 10;
						} else if (0 <= value) {
							value *= changeType;
						} else {}
						break;

					case DECREASE:
						if (10 >= value && 0 != value) {
							value = 1;
						} else {
							value /= 10;
						}

					default:
						break;
				}
				sprintf(valueProp, "%d", (int) value);
				printf("%s\n", valueProp);
			} else {}
		}
		print_element_names(cur_node->children);
	}
}
/**
 * print_element_names:
 * @a_node: the initial xml node to consider.
 *
 * Prints the names of the all the xml elements
 * that are siblings or children of a given xml node.
 */
@a_node: the initial xml node to consider.

Prints the names of the all the xml elements
that are siblings or children of a given xml node.
@a_node : the initial xml node to consider . Prints the names of the all the xml elements that are siblings or children of a given xml node .
static void
print_element_names(xmlNode * a_node)
{
	xmlNode *cur_node = NULL;
	for (cur_node = a_node; cur_node; cur_node = cur_node->next) {
		if (cur_node->properties && cur_node->properties->next) {
			char *nameProp = (char *) cur_node->properties->children->content;
			char *valueProp = (char *) cur_node->properties->next->children->content;
			int changeType = 0;
			float value = 0;
			for (int i = 0; NULL != increasex10List[i]; i++) {
				if (0 == strcmp(nameProp, increasex10List[i])) {
					changeType = INCREASEx10;
					goto FINISHED_CHECK_CHANGE;
				} else {}
			}
			for (int i = 0; NULL != increasex2List[i]; i++) {
				if (0 == strcmp(nameProp, increasex2List[i])) {
					changeType = INCREASEx2;
					goto FINISHED_CHECK_CHANGE;
				} else {}
			}
			for (int i = 0; NULL != decreaseList[i]; i++) {
				if (0 == strcmp(nameProp, decreaseList[i])) {
					changeType = DECREASE;
					goto FINISHED_CHECK_CHANGE;
				} else {}
			}
FINISHED_CHECK_CHANGE:
			if (changeType) {
				printf("\t%s = %s -> ", nameProp, valueProp);
				sscanf(valueProp, "%f", &value);
				switch (changeType) {
					case INCREASEx10:
					case INCREASEx2:
						if (0 == value) {
							value = 10;
						} else if (0 <= value) {
							value *= changeType;
						} else {}
						break;
					case DECREASE:
						if (10 >= value && 0 != value) {
							value = 1;
						} else {
							value /= 10;
						}
					default:
						break;
				}
				sprintf(valueProp, "%d", (int) value);
				printf("%s\n", valueProp);
			} else {}
		}
		print_element_names(cur_node->children);
	}
}
static void print_element_names ( xmlNode * a_node ) { xmlNode * cur_node = NULL ; for ( cur_node = a_node ; cur_node ; cur_node = cur_node -> next ) { if ( cur_node -> properties && cur_node -> properties -> next ) { char * nameProp = ( char * ) cur_node -> properties -> children -> content ; char * valueProp = ( char * ) cur_node -> properties -> next -> children -> content ; int changeType = 0 ; float value = 0 ; for ( int i = 0 ; NULL != increasex10List [ i ] ; i ++ ) { if ( 0 == strcmp ( nameProp , increasex10List [ i ] ) ) { changeType = INCREASEx10 ; goto FINISHED_CHECK_CHANGE ; } else { } } for ( int i = 0 ; NULL != increasex2List [ i ] ; i ++ ) { if ( 0 == strcmp ( nameProp , increasex2List [ i ] ) ) { changeType = INCREASEx2 ; goto FINISHED_CHECK_CHANGE ; } else { } } for ( int i = 0 ; NULL != decreaseList [ i ] ; i ++ ) { if ( 0 == strcmp ( nameProp , decreaseList [ i ] ) ) { changeType = DECREASE ; goto FINISHED_CHECK_CHANGE ; } else { } } FINISHED_CHECK_CHANGE : if ( changeType ) { printf ( " \t " , nameProp , valueProp ) ; sscanf ( valueProp , " " , & value ) ; switch ( changeType ) { case INCREASEx10 : case INCREASEx2 : if ( 0 == value ) { value = 10 ; } else if ( 0 <= value ) { value *= changeType ; } else { } break ; case DECREASE : if ( 10 >= value && 0 != value ) { value = 1 ; } else { value /= 10 ; } default : break ; } sprintf ( valueProp , " " , ( int ) value ) ; printf ( " \n " , valueProp ) ; } else { } } print_element_names ( cur_node -> children ) ; } }
print_element_names:
 @a_node: the initial xml node to consider.
print_element_names : @a_node : the initial xml node to consider .
// Increase 10 // Increase 2 //Decrease