[Nagios-checkins] SF.net SVN: nagios:[2099] nagioscore/trunk/xdata

ageric at users.sourceforge.net ageric at users.sourceforge.net
Sun Aug 26 20:03:47 UTC 2012


Revision: 2099
          http://nagios.svn.sourceforge.net/nagios/?rev=2099&view=rev
Author:   ageric
Date:     2012-08-26 20:03:46 +0000 (Sun, 26 Aug 2012)
Log Message:
-----------
xdata/xodtemplate: Fix minor macro insanity

objects.h and xodtemplate.h previously had separate macros for which
skiplist to use for which type of objects, but the skiplists were
off by one to match, which screwed up one of my plans for improvement,
so we fix that with this obviously correct patch.

Signed-off-by: Andreas Ericsson <ae at op5.se>

Modified Paths:
--------------
    nagioscore/trunk/xdata/xodtemplate.c
    nagioscore/trunk/xdata/xodtemplate.h

Modified: nagioscore/trunk/xdata/xodtemplate.c
===================================================================
--- nagioscore/trunk/xdata/xodtemplate.c	2012-08-26 20:03:24 UTC (rev 2098)
+++ nagioscore/trunk/xdata/xodtemplate.c	2012-08-26 20:03:46 UTC (rev 2099)
@@ -1246,7 +1246,7 @@
 
 				if(result == OK) {
 					/* add timeperiod to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_TIMEPERIOD_SKIPLIST], (void *)temp_timeperiod);
+					result = skiplist_insert(xobject_template_skiplists[TIMEPERIOD_SKIPLIST], (void *)temp_timeperiod);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for timeperiod '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_timeperiod->_config_file), temp_timeperiod->_start_line);
@@ -1267,7 +1267,7 @@
 
 				if(result == OK) {
 					/* add timeperiod to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_TIMEPERIOD_SKIPLIST], (void *)temp_timeperiod);
+					result = skiplist_insert(xobject_skiplists[TIMEPERIOD_SKIPLIST], (void *)temp_timeperiod);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for timeperiod '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_timeperiod->_config_file), temp_timeperiod->_start_line);
@@ -1317,7 +1317,7 @@
 
 				if(result == OK) {
 					/* add command to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_COMMAND_SKIPLIST], (void *)temp_command);
+					result = skiplist_insert(xobject_template_skiplists[COMMAND_SKIPLIST], (void *)temp_command);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for command '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_command->_config_file), temp_command->_start_line);
@@ -1338,7 +1338,7 @@
 
 				if(result == OK) {
 					/* add command to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_COMMAND_SKIPLIST], (void *)temp_command);
+					result = skiplist_insert(xobject_skiplists[COMMAND_SKIPLIST], (void *)temp_command);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for command '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_command->_config_file), temp_command->_start_line);
@@ -1381,7 +1381,7 @@
 
 				if(result == OK) {
 					/* add contactgroup to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_CONTACTGROUP_SKIPLIST], (void *)temp_contactgroup);
+					result = skiplist_insert(xobject_template_skiplists[CONTACTGROUP_SKIPLIST], (void *)temp_contactgroup);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for contactgroup '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_contactgroup->_config_file), temp_contactgroup->_start_line);
@@ -1402,7 +1402,7 @@
 
 				if(result == OK) {
 					/* add contactgroup to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_CONTACTGROUP_SKIPLIST], (void *)temp_contactgroup);
+					result = skiplist_insert(xobject_skiplists[CONTACTGROUP_SKIPLIST], (void *)temp_contactgroup);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for contactgroup '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_contactgroup->_config_file), temp_contactgroup->_start_line);
@@ -1477,7 +1477,7 @@
 
 				if(result == OK) {
 					/* add hostgroup to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_HOSTGROUP_SKIPLIST], (void *)temp_hostgroup);
+					result = skiplist_insert(xobject_template_skiplists[HOSTGROUP_SKIPLIST], (void *)temp_hostgroup);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for hostgroup '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_hostgroup->_config_file), temp_hostgroup->_start_line);
@@ -1498,7 +1498,7 @@
 
 				if(result == OK) {
 					/* add hostgroup to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_HOSTGROUP_SKIPLIST], (void *)temp_hostgroup);
+					result = skiplist_insert(xobject_skiplists[HOSTGROUP_SKIPLIST], (void *)temp_hostgroup);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for hostgroup '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_hostgroup->_config_file), temp_hostgroup->_start_line);
@@ -1595,7 +1595,7 @@
 
 				if(result == OK) {
 					/* add servicegroup to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_SERVICEGROUP_SKIPLIST], (void *)temp_servicegroup);
+					result = skiplist_insert(xobject_template_skiplists[SERVICEGROUP_SKIPLIST], (void *)temp_servicegroup);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for servicegroup '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_servicegroup->_config_file), temp_servicegroup->_start_line);
@@ -1616,7 +1616,7 @@
 
 				if(result == OK) {
 					/* add servicegroup to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_SERVICEGROUP_SKIPLIST], (void *)temp_servicegroup);
+					result = skiplist_insert(xobject_skiplists[SERVICEGROUP_SKIPLIST], (void *)temp_servicegroup);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for servicegroup '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_servicegroup->_config_file), temp_servicegroup->_start_line);
@@ -1713,7 +1713,7 @@
 
 				if(result == OK) {
 					/* add dependency to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_SERVICEDEPENDENCY_SKIPLIST], (void *)temp_servicedependency);
+					result = skiplist_insert(xobject_template_skiplists[SERVICEDEPENDENCY_SKIPLIST], (void *)temp_servicedependency);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for service dependency '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_servicedependency->_config_file), temp_servicedependency->_start_line);
@@ -1780,7 +1780,7 @@
 				/* NOTE: dependencies are added to the skiplist in xodtemplate_duplicate_objects(), except if daemon is using precached config */
 				if(result == OK && force_skiplists == TRUE && temp_servicedependency->dependent_host_name != NULL && temp_servicedependency->dependent_service_description != NULL) {
 					/* add servicedependency to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_SERVICEDEPENDENCY_SKIPLIST], (void *)temp_servicedependency);
+					result = skiplist_insert(xobject_skiplists[SERVICEDEPENDENCY_SKIPLIST], (void *)temp_servicedependency);
 					switch(result) {
 						case SKIPLIST_OK:
 							result = OK;
@@ -1801,7 +1801,7 @@
 				/* NOTE: dependencies are added to the skiplist in xodtemplate_duplicate_objects(), except if daemon is using precached config */
 				if(result == OK && force_skiplists == TRUE && temp_servicedependency->dependent_host_name != NULL && temp_servicedependency->dependent_service_description != NULL) {
 					/* add servicedependency to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_SERVICEDEPENDENCY_SKIPLIST], (void *)temp_servicedependency);
+					result = skiplist_insert(xobject_skiplists[SERVICEDEPENDENCY_SKIPLIST], (void *)temp_servicedependency);
 					switch(result) {
 						case SKIPLIST_OK:
 							result = OK;
@@ -1912,7 +1912,7 @@
 
 				if(result == OK) {
 					/* add escalation to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_SERVICEESCALATION_SKIPLIST], (void *)temp_serviceescalation);
+					result = skiplist_insert(xobject_template_skiplists[SERVICEESCALATION_SKIPLIST], (void *)temp_serviceescalation);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for service escalation '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_serviceescalation->_config_file), temp_serviceescalation->_start_line);
@@ -1938,7 +1938,7 @@
 				/* NOTE: escalations are added to the skiplist in xodtemplate_duplicate_objects(), except if daemon is using precached config */
 				if(result == OK && force_skiplists == TRUE  && temp_serviceescalation->host_name != NULL && temp_serviceescalation->service_description != NULL) {
 					/* add serviceescalation to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_SERVICEESCALATION_SKIPLIST], (void *)temp_serviceescalation);
+					result = skiplist_insert(xobject_skiplists[SERVICEESCALATION_SKIPLIST], (void *)temp_serviceescalation);
 					switch(result) {
 						case SKIPLIST_OK:
 							result = OK;
@@ -1959,7 +1959,7 @@
 				/* NOTE: escalations are added to the skiplist in xodtemplate_duplicate_objects(), except if daemon is using precached config */
 				if(result == OK && force_skiplists == TRUE  && temp_serviceescalation->host_name != NULL && temp_serviceescalation->service_description != NULL) {
 					/* add serviceescalation to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_SERVICEESCALATION_SKIPLIST], (void *)temp_serviceescalation);
+					result = skiplist_insert(xobject_skiplists[SERVICEESCALATION_SKIPLIST], (void *)temp_serviceescalation);
 					switch(result) {
 						case SKIPLIST_OK:
 							result = OK;
@@ -2071,7 +2071,7 @@
 
 				if(result == OK) {
 					/* add contact to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_CONTACT_SKIPLIST], (void *)temp_contact);
+					result = skiplist_insert(xobject_template_skiplists[CONTACT_SKIPLIST], (void *)temp_contact);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for contact '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_contact->_config_file), temp_contact->_start_line);
@@ -2092,7 +2092,7 @@
 
 				if(result == OK) {
 					/* add contact to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_CONTACT_SKIPLIST], (void *)temp_contact);
+					result = skiplist_insert(xobject_skiplists[CONTACT_SKIPLIST], (void *)temp_contact);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for contact '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_contact->_config_file), temp_contact->_start_line);
@@ -2315,7 +2315,7 @@
 
 				if(result == OK) {
 					/* add host to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_HOST_SKIPLIST], (void *)temp_host);
+					result = skiplist_insert(xobject_template_skiplists[HOST_SKIPLIST], (void *)temp_host);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for host '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_host->_config_file), temp_host->_start_line);
@@ -2336,7 +2336,7 @@
 
 				if(result == OK) {
 					/* add host to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_HOST_SKIPLIST], (void *)temp_host);
+					result = skiplist_insert(xobject_skiplists[HOST_SKIPLIST], (void *)temp_host);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for host '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_host->_config_file), temp_host->_start_line);
@@ -2739,7 +2739,7 @@
 
 				if(result == OK) {
 					/* add service to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_SERVICE_SKIPLIST], (void *)temp_service);
+					result = skiplist_insert(xobject_template_skiplists[SERVICE_SKIPLIST], (void *)temp_service);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for service '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_service->_config_file), temp_service->_start_line);
@@ -2764,7 +2764,7 @@
 				/* NOTE: services are added to the skiplist in xodtemplate_duplicate_services(), except if daemon is using precached config */
 				if(result == OK && force_skiplists == TRUE  && temp_service->host_name != NULL && temp_service->service_description != NULL) {
 					/* add service to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_SERVICE_SKIPLIST], (void *)temp_service);
+					result = skiplist_insert(xobject_skiplists[SERVICE_SKIPLIST], (void *)temp_service);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for service '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_service->_config_file), temp_service->_start_line);
@@ -2789,7 +2789,7 @@
 				/* NOTE: services are added to the skiplist in xodtemplate_duplicate_services(), except if daemon is using precached config */
 				if(result == OK && force_skiplists == TRUE  && temp_service->host_name != NULL && temp_service->service_description != NULL) {
 					/* add service to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_SERVICE_SKIPLIST], (void *)temp_service);
+					result = skiplist_insert(xobject_skiplists[SERVICE_SKIPLIST], (void *)temp_service);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for service '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_service->_config_file), temp_service->_start_line);
@@ -3169,7 +3169,7 @@
 
 				if(result == OK) {
 					/* add dependency to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_HOSTDEPENDENCY_SKIPLIST], (void *)temp_hostdependency);
+					result = skiplist_insert(xobject_template_skiplists[HOSTDEPENDENCY_SKIPLIST], (void *)temp_hostdependency);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for host dependency '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_hostdependency->_config_file), temp_hostdependency->_start_line);
@@ -3215,7 +3215,7 @@
 				/* NOTE: dependencies are added to the skiplist in xodtemplate_duplicate_objects(), except if daemon is using precached config */
 				if(result == OK && force_skiplists == TRUE) {
 					/* add hostdependency to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_HOSTDEPENDENCY_SKIPLIST], (void *)temp_hostdependency);
+					result = skiplist_insert(xobject_skiplists[HOSTDEPENDENCY_SKIPLIST], (void *)temp_hostdependency);
 					switch(result) {
 						case SKIPLIST_OK:
 							result = OK;
@@ -3320,7 +3320,7 @@
 
 				if(result == OK) {
 					/* add escalation to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_HOSTESCALATION_SKIPLIST], (void *)temp_hostescalation);
+					result = skiplist_insert(xobject_template_skiplists[HOSTESCALATION_SKIPLIST], (void *)temp_hostescalation);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for host escalation '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_hostescalation->_config_file), temp_hostescalation->_start_line);
@@ -3352,7 +3352,7 @@
 				/* NOTE: escalations are added to the skiplist in xodtemplate_duplicate_objects(), except if daemon is using precached config */
 				if(result == OK && force_skiplists == TRUE) {
 					/* add hostescalation to template skiplist for fast searches */
-					result = skiplist_insert(xobject_skiplists[X_HOSTESCALATION_SKIPLIST], (void *)temp_hostescalation);
+					result = skiplist_insert(xobject_skiplists[HOSTESCALATION_SKIPLIST], (void *)temp_hostescalation);
 					switch(result) {
 						case SKIPLIST_OK:
 							result = OK;
@@ -3445,7 +3445,7 @@
 
 				if(result == OK) {
 					/* add to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_HOSTEXTINFO_SKIPLIST], (void *)temp_hostextinfo);
+					result = skiplist_insert(xobject_template_skiplists[HOSTEXTINFO_SKIPLIST], (void *)temp_hostextinfo);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for extended host info '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_hostextinfo->_config_file), temp_hostextinfo->_start_line);
@@ -3583,7 +3583,7 @@
 
 				if(result == OK) {
 					/* add to template skiplist for fast searches */
-					result = skiplist_insert(xobject_template_skiplists[X_SERVICEEXTINFO_SKIPLIST], (void *)temp_serviceextinfo);
+					result = skiplist_insert(xobject_template_skiplists[SERVICEEXTINFO_SKIPLIST], (void *)temp_serviceextinfo);
 					switch(result) {
 						case SKIPLIST_ERROR_DUPLICATE:
 							logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for extended service info '%s' (config file '%s', starting on line %d)\n", value, xodtemplate_config_file_name(temp_serviceextinfo->_config_file), temp_serviceextinfo->_start_line);
@@ -4205,7 +4205,7 @@
 			}
 
 
-		result = skiplist_insert(xobject_skiplists[X_SERVICE_SKIPLIST], (void *)temp_service);
+		result = skiplist_insert(xobject_skiplists[SERVICE_SKIPLIST], (void *)temp_service);
 		switch(result) {
 			case SKIPLIST_ERROR_DUPLICATE:
 				logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for service '%s' on host '%s' (config file '%s', starting on line %d)\n", temp_service->service_description, temp_service->host_name, xodtemplate_config_file_name(temp_service->_config_file), temp_service->_start_line);
@@ -4239,7 +4239,7 @@
 		/*The flag X_SERVICE_IS_FROM_HOSTGROUP is set, unset it*/
 		xodtemplate_unset_service_is_from_hostgroup(temp_service);
 
-		result = skiplist_insert(xobject_skiplists[X_SERVICE_SKIPLIST], (void *)temp_service);
+		result = skiplist_insert(xobject_skiplists[SERVICE_SKIPLIST], (void *)temp_service);
 		switch(result) {
 			case SKIPLIST_ERROR_DUPLICATE:
 				logit(NSLOG_CONFIG_WARNING, TRUE, "Warning: Duplicate definition found for service '%s' on host '%s' (config file '%s', starting on line %d)\n", temp_service->service_description, temp_service->host_name, xodtemplate_config_file_name(temp_service->_config_file), temp_service->_start_line);
@@ -5003,7 +5003,7 @@
 		if(temp_hostescalation->host_name == NULL)
 			continue;
 
-		result = skiplist_insert(xobject_skiplists[X_HOSTESCALATION_SKIPLIST], (void *)temp_hostescalation);
+		result = skiplist_insert(xobject_skiplists[HOSTESCALATION_SKIPLIST], (void *)temp_hostescalation);
 		switch(result) {
 			case SKIPLIST_OK:
 				result = OK;
@@ -5025,7 +5025,7 @@
 		if(temp_serviceescalation->host_name == NULL || temp_serviceescalation->service_description == NULL)
 			continue;
 
-		result = skiplist_insert(xobject_skiplists[X_SERVICEESCALATION_SKIPLIST], (void *)temp_serviceescalation);
+		result = skiplist_insert(xobject_skiplists[SERVICEESCALATION_SKIPLIST], (void *)temp_serviceescalation);
 		switch(result) {
 			case SKIPLIST_OK:
 				result = OK;
@@ -5047,7 +5047,7 @@
 		if(temp_hostdependency->host_name == NULL)
 			continue;
 
-		result = skiplist_insert(xobject_skiplists[X_HOSTDEPENDENCY_SKIPLIST], (void *)temp_hostdependency);
+		result = skiplist_insert(xobject_skiplists[HOSTDEPENDENCY_SKIPLIST], (void *)temp_hostdependency);
 		switch(result) {
 			case SKIPLIST_OK:
 				result = OK;
@@ -5069,7 +5069,7 @@
 		if(temp_servicedependency->dependent_host_name == NULL || temp_servicedependency->dependent_service_description == NULL)
 			continue;
 
-		result = skiplist_insert(xobject_skiplists[X_SERVICEDEPENDENCY_SKIPLIST], (void *)temp_servicedependency);
+		result = skiplist_insert(xobject_skiplists[SERVICEDEPENDENCY_SKIPLIST], (void *)temp_servicedependency);
 		switch(result) {
 			case SKIPLIST_OK:
 				result = OK;
@@ -8112,7 +8112,7 @@
 
 	temp_timeperiod.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_TIMEPERIOD_SKIPLIST], &temp_timeperiod, NULL);
+	return skiplist_find_first(xobject_template_skiplists[TIMEPERIOD_SKIPLIST], &temp_timeperiod, NULL);
 	}
 
 
@@ -8125,7 +8125,7 @@
 
 	temp_command.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_COMMAND_SKIPLIST], &temp_command, NULL);
+	return skiplist_find_first(xobject_template_skiplists[COMMAND_SKIPLIST], &temp_command, NULL);
 	}
 
 
@@ -8138,7 +8138,7 @@
 
 	temp_contactgroup.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_CONTACTGROUP_SKIPLIST], &temp_contactgroup, NULL);
+	return skiplist_find_first(xobject_template_skiplists[CONTACTGROUP_SKIPLIST], &temp_contactgroup, NULL);
 	}
 
 
@@ -8151,7 +8151,7 @@
 
 	temp_contactgroup.contactgroup_name = name;
 
-	return skiplist_find_first(xobject_skiplists[X_CONTACTGROUP_SKIPLIST], &temp_contactgroup, NULL);
+	return skiplist_find_first(xobject_skiplists[CONTACTGROUP_SKIPLIST], &temp_contactgroup, NULL);
 	}
 
 
@@ -8164,7 +8164,7 @@
 
 	temp_hostgroup.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_HOSTGROUP_SKIPLIST], &temp_hostgroup, NULL);
+	return skiplist_find_first(xobject_template_skiplists[HOSTGROUP_SKIPLIST], &temp_hostgroup, NULL);
 	}
 
 
@@ -8177,7 +8177,7 @@
 
 	temp_hostgroup.hostgroup_name = name;
 
-	return skiplist_find_first(xobject_skiplists[X_HOSTGROUP_SKIPLIST], &temp_hostgroup, NULL);
+	return skiplist_find_first(xobject_skiplists[HOSTGROUP_SKIPLIST], &temp_hostgroup, NULL);
 	}
 
 
@@ -8190,7 +8190,7 @@
 
 	temp_servicegroup.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_SERVICEGROUP_SKIPLIST], &temp_servicegroup, NULL);
+	return skiplist_find_first(xobject_template_skiplists[SERVICEGROUP_SKIPLIST], &temp_servicegroup, NULL);
 	}
 
 
@@ -8203,7 +8203,7 @@
 
 	temp_servicegroup.servicegroup_name = name;
 
-	return skiplist_find_first(xobject_skiplists[X_SERVICEGROUP_SKIPLIST], &temp_servicegroup, NULL);
+	return skiplist_find_first(xobject_skiplists[SERVICEGROUP_SKIPLIST], &temp_servicegroup, NULL);
 	}
 
 
@@ -8216,7 +8216,7 @@
 
 	temp_servicedependency.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_SERVICEDEPENDENCY_SKIPLIST], &temp_servicedependency, NULL);
+	return skiplist_find_first(xobject_template_skiplists[SERVICEDEPENDENCY_SKIPLIST], &temp_servicedependency, NULL);
 	}
 
 
@@ -8229,7 +8229,7 @@
 
 	temp_serviceescalation.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_SERVICEESCALATION_SKIPLIST], &temp_serviceescalation, NULL);
+	return skiplist_find_first(xobject_template_skiplists[SERVICEESCALATION_SKIPLIST], &temp_serviceescalation, NULL);
 	}
 
 
@@ -8242,7 +8242,7 @@
 
 	temp_contact.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_CONTACT_SKIPLIST], &temp_contact, NULL);
+	return skiplist_find_first(xobject_template_skiplists[CONTACT_SKIPLIST], &temp_contact, NULL);
 	}
 
 
@@ -8255,7 +8255,7 @@
 
 	temp_contact.contact_name = name;
 
-	return skiplist_find_first(xobject_skiplists[X_CONTACT_SKIPLIST], &temp_contact, NULL);
+	return skiplist_find_first(xobject_skiplists[CONTACT_SKIPLIST], &temp_contact, NULL);
 	}
 
 
@@ -8268,7 +8268,7 @@
 
 	temp_host.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_HOST_SKIPLIST], &temp_host, NULL);
+	return skiplist_find_first(xobject_template_skiplists[HOST_SKIPLIST], &temp_host, NULL);
 	}
 
 
@@ -8281,7 +8281,7 @@
 
 	temp_host.host_name = name;
 
-	return skiplist_find_first(xobject_skiplists[X_HOST_SKIPLIST], &temp_host, NULL);
+	return skiplist_find_first(xobject_skiplists[HOST_SKIPLIST], &temp_host, NULL);
 	}
 
 
@@ -8294,7 +8294,7 @@
 
 	temp_hostdependency.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_HOSTDEPENDENCY_SKIPLIST], &temp_hostdependency, NULL);
+	return skiplist_find_first(xobject_template_skiplists[HOSTDEPENDENCY_SKIPLIST], &temp_hostdependency, NULL);
 	}
 
 
@@ -8307,7 +8307,7 @@
 
 	temp_hostescalation.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_HOSTESCALATION_SKIPLIST], &temp_hostescalation, NULL);
+	return skiplist_find_first(xobject_template_skiplists[HOSTESCALATION_SKIPLIST], &temp_hostescalation, NULL);
 	}
 
 
@@ -8320,7 +8320,7 @@
 
 	temp_hostextinfo.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_HOSTEXTINFO_SKIPLIST], &temp_hostextinfo, NULL);
+	return skiplist_find_first(xobject_template_skiplists[HOSTEXTINFO_SKIPLIST], &temp_hostextinfo, NULL);
 	}
 
 
@@ -8333,7 +8333,7 @@
 
 	temp_serviceextinfo.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_SERVICEEXTINFO_SKIPLIST], &temp_serviceextinfo, NULL);
+	return skiplist_find_first(xobject_template_skiplists[SERVICEEXTINFO_SKIPLIST], &temp_serviceextinfo, NULL);
 	}
 
 
@@ -8346,7 +8346,7 @@
 
 	temp_service.name = name;
 
-	return skiplist_find_first(xobject_template_skiplists[X_SERVICE_SKIPLIST], &temp_service, NULL);
+	return skiplist_find_first(xobject_template_skiplists[SERVICE_SKIPLIST], &temp_service, NULL);
 	}
 
 
@@ -8360,7 +8360,7 @@
 	temp_service.host_name = host_name;
 	temp_service.service_description = service_description;
 
-	return skiplist_find_first(xobject_skiplists[X_SERVICE_SKIPLIST], &temp_service, NULL);
+	return skiplist_find_first(xobject_skiplists[SERVICE_SKIPLIST], &temp_service, NULL);
 	}
 
 #endif
@@ -8389,98 +8389,86 @@
 	void *ptr = NULL;
 
 	/* register timeperiods */
-	/*for(temp_timeperiod=xodtemplate_timeperiod_list;temp_timeperiod!=NULL;temp_timeperiod=temp_timeperiod->next){*/
 	ptr = NULL;
-	for(temp_timeperiod = (xodtemplate_timeperiod *)skiplist_get_first(xobject_skiplists[X_TIMEPERIOD_SKIPLIST], &ptr); temp_timeperiod != NULL; temp_timeperiod = (xodtemplate_timeperiod *)skiplist_get_next(&ptr)) {
+	for(temp_timeperiod = (xodtemplate_timeperiod *)skiplist_get_first(xobject_skiplists[TIMEPERIOD_SKIPLIST], &ptr); temp_timeperiod != NULL; temp_timeperiod = (xodtemplate_timeperiod *)skiplist_get_next(&ptr)) {
 		if((result = xodtemplate_register_timeperiod(temp_timeperiod)) == ERROR)
 			return ERROR;
 		}
 
 	/* register commands */
-	/*for(temp_command=xodtemplate_command_list;temp_command!=NULL;temp_command=temp_command->next){*/
 	ptr = NULL;
-	for(temp_command = (xodtemplate_command *)skiplist_get_first(xobject_skiplists[X_COMMAND_SKIPLIST], &ptr); temp_command != NULL; temp_command = (xodtemplate_command *)skiplist_get_next(&ptr)) {
+	for(temp_command = (xodtemplate_command *)skiplist_get_first(xobject_skiplists[COMMAND_SKIPLIST], &ptr); temp_command != NULL; temp_command = (xodtemplate_command *)skiplist_get_next(&ptr)) {
 		if((result = xodtemplate_register_command(temp_command)) == ERROR)
 			return ERROR;
 		}
 
 	/* register contactgroups */
-	/*for(temp_contactgroup=xodtemplate_contactgroup_list;temp_contactgroup!=NULL;temp_contactgroup=temp_contactgroup->next){*/
 	ptr = NULL;
-	for(temp_contactgroup = (xodtemplate_contactgroup *)skiplist_get_first(xobject_skiplists[X_CONTACTGROUP_SKIPLIST], &ptr); temp_contactgroup != NULL; temp_contactgroup = (xodtemplate_contactgroup *)skiplist_get_next(&ptr)) {
+	for(temp_contactgroup = (xodtemplate_contactgroup *)skiplist_get_first(xobject_skiplists[CONTACTGROUP_SKIPLIST], &ptr); temp_contactgroup != NULL; temp_contactgroup = (xodtemplate_contactgroup *)skiplist_get_next(&ptr)) {
 		if((result = xodtemplate_register_contactgroup(temp_contactgroup)) == ERROR)
 			return ERROR;
 		}
 
 	/* register hostgroups */
-	/*for(temp_hostgroup=xodtemplate_hostgroup_list;temp_hostgroup!=NULL;temp_hostgroup=temp_hostgroup->next){*/
 	ptr = NULL;
-	for(temp_hostgroup = (xodtemplate_hostgroup *)skiplist_get_first(xobject_skiplists[X_HOSTGROUP_SKIPLIST], &ptr); temp_hostgroup != NULL; temp_hostgroup = (xodtemplate_hostgroup *)skiplist_get_next(&ptr)) {
+	for(temp_hostgroup = (xodtemplate_hostgroup *)skiplist_get_first(xobject_skiplists[HOSTGROUP_SKIPLIST], &ptr); temp_hostgroup != NULL; temp_hostgroup = (xodtemplate_hostgroup *)skiplist_get_next(&ptr)) {
 		if((result = xodtemplate_register_hostgroup(temp_hostgroup)) == ERROR)
 			return ERROR;
 		}
 
 	/* register servicegroups */
-	/*for(temp_servicegroup=xodtemplate_servicegroup_list;temp_servicegroup!=NULL;temp_servicegroup=temp_servicegroup->next){*/
 	ptr = NULL;
-	for(temp_servicegroup = (xodtemplate_servicegroup *)skiplist_get_first(xobject_skiplists[X_SERVICEGROUP_SKIPLIST], &ptr); temp_servicegroup != NULL; temp_servicegroup = (xodtemplate_servicegroup *)skiplist_get_next(&ptr)) {
+	for(temp_servicegroup = (xodtemplate_servicegroup *)skiplist_get_first(xobject_skiplists[SERVICEGROUP_SKIPLIST], &ptr); temp_servicegroup != NULL; temp_servicegroup = (xodtemplate_servicegroup *)skiplist_get_next(&ptr)) {
 		if((result = xodtemplate_register_servicegroup(temp_servicegroup)) == ERROR)
 			return ERROR;
 		}
 
 	/* register contacts */
-	/*for(temp_contact=xodtemplate_contact_list;temp_contact!=NULL;temp_contact=temp_contact->next){*/
 	ptr = NULL;
-	for(temp_contact = (xodtemplate_contact *)skiplist_get_first(xobject_skiplists[X_CONTACT_SKIPLIST], &ptr); temp_contact != NULL; temp_contact = (xodtemplate_contact *)skiplist_get_next(&ptr)) {
+	for(temp_contact = (xodtemplate_contact *)skiplist_get_first(xobject_skiplists[CONTACT_SKIPLIST], &ptr); temp_contact != NULL; temp_contact = (xodtemplate_contact *)skiplist_get_next(&ptr)) {
 		if((result = xodtemplate_register_contact(temp_contact)) == ERROR)
 			return ERROR;
 		}
 
 	/* register hosts */
-	/*for(temp_host=xodtemplate_host_list;temp_host!=NULL;temp_host=temp_host->next){*/
 	ptr = NULL;
-	for(temp_host = (xodtemplate_host *)skiplist_get_first(xobject_skiplists[X_HOST_SKIPLIST], &ptr); temp_host != NULL; temp_host = (xodtemplate_host *)skiplist_get_next(&ptr)) {
+	for(temp_host = (xodtemplate_host *)skiplist_get_first(xobject_skiplists[HOST_SKIPLIST], &ptr); temp_host != NULL; temp_host = (xodtemplate_host *)skiplist_get_next(&ptr)) {
 		if((result = xodtemplate_register_host(temp_host)) == ERROR)
 			return ERROR;
 		}
 
 	/* register services */
-	/*for(temp_service=xodtemplate_service_list;temp_service!=NULL;temp_service=temp_service->next){*/
 	ptr = NULL;
-	for(temp_service = (xodtemplate_service *)skiplist_get_first(xobject_skiplists[X_SERVICE_SKIPLIST], &ptr); temp_service != NULL; temp_service = (xodtemplate_service *)skiplist_get_next(&ptr)) {
+	for(temp_service = (xodtemplate_service *)skiplist_get_first(xobject_skiplists[SERVICE_SKIPLIST], &ptr); temp_service != NULL; temp_service = (xodtemplate_service *)skiplist_get_next(&ptr)) {
 
 		if((result = xodtemplate_register_service(temp_service)) == ERROR)
 			return ERROR;
 		}
 
 	/* register service dependencies */
-	/*for(temp_servicedependency=xodtemplate_servicedependency_list;temp_servicedependency!=NULL;temp_servicedependency=temp_servicedependency->next){*/
 	ptr = NULL;
-	for(temp_servicedependency = (xodtemplate_servicedependency *)skiplist_get_first(xobject_skiplists[X_SERVICEDEPENDENCY_SKIPLIST], &ptr); temp_servicedependency != NULL; temp_servicedependency = (xodtemplate_servicedependency *)skiplist_get_next(&ptr)) {
+	for(temp_servicedependency = (xodtemplate_servicedependency *)skiplist_get_first(xobject_skiplists[SERVICEDEPENDENCY_SKIPLIST], &ptr); temp_servicedependency != NULL; temp_servicedependency = (xodtemplate_servicedependency *)skiplist_get_next(&ptr)) {
 		if((result = xodtemplate_register_servicedependency(temp_servicedependency)) == ERROR)
 			return ERROR;
 		}
 
 	/* register service escalations */
-	/*for(temp_serviceescalation=xodtemplate_serviceescalation_list;temp_serviceescalation!=NULL;temp_serviceescalation=temp_serviceescalation->next){*/
 	ptr = NULL;
-	for(temp_serviceescalation = (xodtemplate_serviceescalation *)skiplist_get_first(xobject_skiplists[X_SERVICEESCALATION_SKIPLIST], &ptr); temp_serviceescalation != NULL; temp_serviceescalation = (xodtemplate_serviceescalation *)skiplist_get_next(&ptr)) {
+	for(temp_serviceescalation = (xodtemplate_serviceescalation *)skiplist_get_first(xobject_skiplists[SERVICEESCALATION_SKIPLIST], &ptr); temp_serviceescalation != NULL; temp_serviceescalation = (xodtemplate_serviceescalation *)skiplist_get_next(&ptr)) {
 		if((result = xodtemplate_register_serviceescalation(temp_serviceescalation)) == ERROR)
 			return ERROR;
 		}
 
 	/* register host dependencies */
-	/*for(temp_hostdependency=xodtemplate_hostdependency_list;temp_hostdependency!=NULL;temp_hostdependency=temp_hostdependency->next){*/
 	ptr = NULL;
-	for(temp_hostdependency = (xodtemplate_hostdependency *)skiplist_get_first(xobject_skiplists[X_HOSTDEPENDENCY_SKIPLIST], &ptr); temp_hostdependency != NULL; temp_hostdependency = (xodtemplate_hostdependency *)skiplist_get_next(&ptr)) {
+	for(temp_hostdependency = (xodtemplate_hostdependency *)skiplist_get_first(xobject_skiplists[HOSTDEPENDENCY_SKIPLIST], &ptr); temp_hostdependency != NULL; temp_hostdependency = (xodtemplate_hostdependency *)skiplist_get_next(&ptr)) {
 		if((result = xodtemplate_register_hostdependency(temp_hostdependency)) == ERROR)
 			return ERROR;
 		}
 
 	/* register host escalations */
-	/*for(temp_hostescalation=xodtemplate_hostescalation_list;temp_hostescalation!=NULL;temp_hostescalation=temp_hostescalation->next){*/
 	ptr = NULL;
-	for(temp_hostescalation = (xodtemplate_hostescalation *)skiplist_get_first(xobject_skiplists[X_HOSTESCALATION_SKIPLIST], &ptr); temp_hostescalation != NULL; temp_hostescalation = (xodtemplate_hostescalation *)skiplist_get_next(&ptr)) {
+	for(temp_hostescalation = (xodtemplate_hostescalation *)skiplist_get_first(xobject_skiplists[HOSTESCALATION_SKIPLIST], &ptr); temp_hostescalation != NULL; temp_hostescalation = (xodtemplate_hostescalation *)skiplist_get_next(&ptr)) {
 		if((result = xodtemplate_register_hostescalation(temp_hostescalation)) == ERROR)
 			return ERROR;
 		}
@@ -10129,7 +10117,7 @@
 	/* cache timeperiods */
 	/*for(temp_timeperiod=xodtemplate_timeperiod_list;temp_timeperiod!=NULL;temp_timeperiod=temp_timeperiod->next){*/
 	ptr = NULL;
-	for(temp_timeperiod = (xodtemplate_timeperiod *)skiplist_get_first(xobject_skiplists[X_TIMEPERIOD_SKIPLIST], &ptr); temp_timeperiod != NULL; temp_timeperiod = (xodtemplate_timeperiod *)skiplist_get_next(&ptr)) {
+	for(temp_timeperiod = (xodtemplate_timeperiod *)skiplist_get_first(xobject_skiplists[TIMEPERIOD_SKIPLIST], &ptr); temp_timeperiod != NULL; temp_timeperiod = (xodtemplate_timeperiod *)skiplist_get_next(&ptr)) {
 
 		if(temp_timeperiod->register_object == FALSE)
 			continue;
@@ -10207,7 +10195,7 @@
 	/* cache commands */
 	/*for(temp_command=xodtemplate_command_list;temp_command!=NULL;temp_command=temp_command->next){*/
 	ptr = NULL;
-	for(temp_command = (xodtemplate_command *)skiplist_get_first(xobject_skiplists[X_COMMAND_SKIPLIST], &ptr); temp_command != NULL; temp_command = (xodtemplate_command *)skiplist_get_next(&ptr)) {
+	for(temp_command = (xodtemplate_command *)skiplist_get_first(xobject_skiplists[COMMAND_SKIPLIST], &ptr); temp_command != NULL; temp_command = (xodtemplate_command *)skiplist_get_next(&ptr)) {
 		if(temp_command->register_object == FALSE)
 			continue;
 		fprintf(fp, "define command {\n");
@@ -10221,7 +10209,7 @@
 	/* cache contactgroups */
 	/*for(temp_contactgroup=xodtemplate_contactgroup_list;temp_contactgroup!=NULL;temp_contactgroup=temp_contactgroup->next){*/
 	ptr = NULL;
-	for(temp_contactgroup = (xodtemplate_contactgroup *)skiplist_get_first(xobject_skiplists[X_CONTACTGROUP_SKIPLIST], &ptr); temp_contactgroup != NULL; temp_contactgroup = (xodtemplate_contactgroup *)skiplist_get_next(&ptr)) {
+	for(temp_contactgroup = (xodtemplate_contactgroup *)skiplist_get_first(xobject_skiplists[CONTACTGROUP_SKIPLIST], &ptr); temp_contactgroup != NULL; temp_contactgroup = (xodtemplate_contactgroup *)skiplist_get_next(&ptr)) {
 		if(temp_contactgroup->register_object == FALSE)
 			continue;
 		fprintf(fp, "define contactgroup {\n");
@@ -10237,7 +10225,7 @@
 	/* cache hostgroups */
 	/*for(temp_hostgroup=xodtemplate_hostgroup_list;temp_hostgroup!=NULL;temp_hostgroup=temp_hostgroup->next){*/
 	ptr = NULL;
-	for(temp_hostgroup = (xodtemplate_hostgroup *)skiplist_get_first(xobject_skiplists[X_HOSTGROUP_SKIPLIST], &ptr); temp_hostgroup != NULL; temp_hostgroup = (xodtemplate_hostgroup *)skiplist_get_next(&ptr)) {
+	for(temp_hostgroup = (xodtemplate_hostgroup *)skiplist_get_first(xobject_skiplists[HOSTGROUP_SKIPLIST], &ptr); temp_hostgroup != NULL; temp_hostgroup = (xodtemplate_hostgroup *)skiplist_get_next(&ptr)) {
 		if(temp_hostgroup->register_object == FALSE)
 			continue;
 		fprintf(fp, "define hostgroup {\n");
@@ -10259,7 +10247,7 @@
 	/* cache servicegroups */
 	/*for(temp_servicegroup=xodtemplate_servicegroup_list;temp_servicegroup!=NULL;temp_servicegroup=temp_servicegroup->next){*/
 	ptr = NULL;
-	for(temp_servicegroup = (xodtemplate_servicegroup *)skiplist_get_first(xobject_skiplists[X_SERVICEGROUP_SKIPLIST], &ptr); temp_servicegroup != NULL; temp_servicegroup = (xodtemplate_servicegroup *)skiplist_get_next(&ptr)) {
+	for(temp_servicegroup = (xodtemplate_servicegroup *)skiplist_get_first(xobject_skiplists[SERVICEGROUP_SKIPLIST], &ptr); temp_servicegroup != NULL; temp_servicegroup = (xodtemplate_servicegroup *)skiplist_get_next(&ptr)) {
 		if(temp_servicegroup->register_object == FALSE)
 			continue;
 		fprintf(fp, "define servicegroup {\n");
@@ -10281,7 +10269,7 @@
 	/* cache contacts */
 	/*for(temp_contact=xodtemplate_contact_list;temp_contact!=NULL;temp_contact=temp_contact->next){*/
 	ptr = NULL;
-	for(temp_contact = (xodtemplate_contact *)skiplist_get_first(xobject_skiplists[X_CONTACT_SKIPLIST], &ptr); temp_contact != NULL; temp_contact = (xodtemplate_contact *)skiplist_get_next(&ptr)) {
+	for(temp_contact = (xodtemplate_contact *)skiplist_get_first(xobject_skiplists[CONTACT_SKIPLIST], &ptr); temp_contact != NULL; temp_contact = (xodtemplate_contact *)skiplist_get_next(&ptr)) {
 		if(temp_contact->register_object == FALSE)
 			continue;
 		fprintf(fp, "define contact {\n");
@@ -10356,7 +10344,7 @@
 	/* cache hosts */
 	/*for(temp_host=xodtemplate_host_list;temp_host!=NULL;temp_host=temp_host->next){*/
 	ptr = NULL;
-	for(temp_host = (xodtemplate_host *)skiplist_get_first(xobject_skiplists[X_HOST_SKIPLIST], &ptr); temp_host != NULL; temp_host = (xodtemplate_host *)skiplist_get_next(&ptr)) {
+	for(temp_host = (xodtemplate_host *)skiplist_get_first(xobject_skiplists[HOST_SKIPLIST], &ptr); temp_host != NULL; temp_host = (xodtemplate_host *)skiplist_get_next(&ptr)) {
 		if(temp_host->register_object == FALSE)
 			continue;
 		fprintf(fp, "define host {\n");
@@ -10479,7 +10467,7 @@
 	/* cache services */
 	/*for(temp_service=xodtemplate_service_list;temp_service!=NULL;temp_service=temp_service->next){*/
 	ptr = NULL;
-	for(temp_service = (xodtemplate_service *)skiplist_get_first(xobject_skiplists[X_SERVICE_SKIPLIST], &ptr); temp_service != NULL; temp_service = (xodtemplate_service *)skiplist_get_next(&ptr)) {
+	for(temp_service = (xodtemplate_service *)skiplist_get_first(xobject_skiplists[SERVICE_SKIPLIST], &ptr); temp_service != NULL; temp_service = (xodtemplate_service *)skiplist_get_next(&ptr)) {
 		if(temp_service->register_object == FALSE)
 			continue;
 		fprintf(fp, "define service {\n");
@@ -10599,7 +10587,7 @@
 	/* cache service dependencies */
 	/*for(temp_servicedependency=xodtemplate_servicedependency_list;temp_servicedependency!=NULL;temp_servicedependency=temp_servicedependency->next){*/
 	ptr = NULL;
-	for(temp_servicedependency = (xodtemplate_servicedependency *)skiplist_get_first(xobject_skiplists[X_SERVICEDEPENDENCY_SKIPLIST], &ptr); temp_servicedependency != NULL; temp_servicedependency = (xodtemplate_servicedependency *)skiplist_get_next(&ptr)) {
+	for(temp_servicedependency = (xodtemplate_servicedependency *)skiplist_get_first(xobject_skiplists[SERVICEDEPENDENCY_SKIPLIST], &ptr); temp_servicedependency != NULL; temp_servicedependency = (xodtemplate_servicedependency *)skiplist_get_next(&ptr)) {
 		if(temp_servicedependency->register_object == FALSE)
 			continue;
 		fprintf(fp, "define servicedependency {\n");
@@ -10654,7 +10642,7 @@
 	/* cache service escalations */
 	/*for(temp_serviceescalation=xodtemplate_serviceescalation_list;temp_serviceescalation!=NULL;temp_serviceescalation=temp_serviceescalation->next){*/
 	ptr = NULL;
-	for(temp_serviceescalation = (xodtemplate_serviceescalation *)skiplist_get_first(xobject_skiplists[X_SERVICEESCALATION_SKIPLIST], &ptr); temp_serviceescalation != NULL; temp_serviceescalation = (xodtemplate_serviceescalation *)skiplist_get_next(&ptr)) {
+	for(temp_serviceescalation = (xodtemplate_serviceescalation *)skiplist_get_first(xobject_skiplists[SERVICEESCALATION_SKIPLIST], &ptr); temp_serviceescalation != NULL; temp_serviceescalation = (xodtemplate_serviceescalation *)skiplist_get_next(&ptr)) {
 		if(temp_serviceescalation->register_object == FALSE)
 			continue;
 		fprintf(fp, "define serviceescalation {\n");
@@ -10692,7 +10680,7 @@
 	/* cache host dependencies */
 	/*for(temp_hostdependency=xodtemplate_hostdependency_list;temp_hostdependency!=NULL;temp_hostdependency=temp_hostdependency->next){*/
 	ptr = NULL;
-	for(temp_hostdependency = (xodtemplate_hostdependency *)skiplist_get_first(xobject_skiplists[X_HOSTDEPENDENCY_SKIPLIST], &ptr); temp_hostdependency != NULL; temp_hostdependency = (xodtemplate_hostdependency *)skiplist_get_next(&ptr)) {
+	for(temp_hostdependency = (xodtemplate_hostdependency *)skiplist_get_first(xobject_skiplists[HOSTDEPENDENCY_SKIPLIST], &ptr); temp_hostdependency != NULL; temp_hostdependency = (xodtemplate_hostdependency *)skiplist_get_next(&ptr)) {
 		if(temp_hostdependency->register_object == FALSE)
 			continue;
 		fprintf(fp, "define hostdependency {\n");
@@ -10739,7 +10727,7 @@
 	/* cache host escalations */
 	/*for(temp_hostescalation=xodtemplate_hostescalation_list;temp_hostescalation!=NULL;temp_hostescalation=temp_hostescalation->next){*/
 	ptr = NULL;
-	for(temp_hostescalation = (xodtemplate_hostescalation *)skiplist_get_first(xobject_skiplists[X_HOSTESCALATION_SKIPLIST], &ptr); temp_hostescalation != NULL; temp_hostescalation = (xodtemplate_hostescalation *)skiplist_get_next(&ptr)) {
+	for(temp_hostescalation = (xodtemplate_hostescalation *)skiplist_get_first(xobject_skiplists[HOSTESCALATION_SKIPLIST], &ptr); temp_hostescalation != NULL; temp_hostescalation = (xodtemplate_hostescalation *)skiplist_get_next(&ptr)) {
 		if(temp_hostescalation->register_object == FALSE)
 			continue;
 		fprintf(fp, "define hostescalation {\n");
@@ -10789,34 +10777,34 @@
 		xobject_skiplists[x] = NULL;
 		}
 
-	xobject_template_skiplists[X_HOST_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_host_template);
-	xobject_template_skiplists[X_SERVICE_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_service_template);
-	xobject_template_skiplists[X_COMMAND_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_command_template);
-	xobject_template_skiplists[X_TIMEPERIOD_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_timeperiod_template);
-	xobject_template_skiplists[X_CONTACT_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_contact_template);
-	xobject_template_skiplists[X_CONTACTGROUP_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_contactgroup_template);
-	xobject_template_skiplists[X_HOSTGROUP_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_hostgroup_template);
-	xobject_template_skiplists[X_SERVICEGROUP_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_servicegroup_template);
-	xobject_template_skiplists[X_HOSTDEPENDENCY_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_hostdependency_template);
-	xobject_template_skiplists[X_SERVICEDEPENDENCY_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_servicedependency_template);
-	xobject_template_skiplists[X_HOSTESCALATION_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_hostescalation_template);
-	xobject_template_skiplists[X_SERVICEESCALATION_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_serviceescalation_template);
-	xobject_template_skiplists[X_HOSTEXTINFO_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_hostextinfo_template);
-	xobject_template_skiplists[X_SERVICEEXTINFO_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_serviceextinfo_template);
+	xobject_template_skiplists[HOST_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_host_template);
+	xobject_template_skiplists[SERVICE_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_service_template);
+	xobject_template_skiplists[COMMAND_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_command_template);
+	xobject_template_skiplists[TIMEPERIOD_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_timeperiod_template);
+	xobject_template_skiplists[CONTACT_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_contact_template);
+	xobject_template_skiplists[CONTACTGROUP_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_contactgroup_template);
+	xobject_template_skiplists[HOSTGROUP_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_hostgroup_template);
+	xobject_template_skiplists[SERVICEGROUP_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_servicegroup_template);
+	xobject_template_skiplists[HOSTDEPENDENCY_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_hostdependency_template);
+	xobject_template_skiplists[SERVICEDEPENDENCY_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_servicedependency_template);
+	xobject_template_skiplists[HOSTESCALATION_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_hostescalation_template);
+	xobject_template_skiplists[SERVICEESCALATION_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_serviceescalation_template);
+	xobject_template_skiplists[HOSTEXTINFO_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_hostextinfo_template);
+	xobject_template_skiplists[SERVICEEXTINFO_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_serviceextinfo_template);
 
-	xobject_skiplists[X_HOST_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_host);
-	xobject_skiplists[X_SERVICE_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_service);
-	xobject_skiplists[X_COMMAND_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_command);
-	xobject_skiplists[X_TIMEPERIOD_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_timeperiod);
-	xobject_skiplists[X_CONTACT_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_contact);
-	xobject_skiplists[X_CONTACTGROUP_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_contactgroup);
-	xobject_skiplists[X_HOSTGROUP_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_hostgroup);
-	xobject_skiplists[X_SERVICEGROUP_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_servicegroup);
+	xobject_skiplists[HOST_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_host);
+	xobject_skiplists[SERVICE_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_service);
+	xobject_skiplists[COMMAND_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_command);
+	xobject_skiplists[TIMEPERIOD_SKIPLIST] = skiplist_new(16, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_timeperiod);
+	xobject_skiplists[CONTACT_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_contact);
+	xobject_skiplists[CONTACTGROUP_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_contactgroup);
+	xobject_skiplists[HOSTGROUP_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_hostgroup);
+	xobject_skiplists[SERVICEGROUP_SKIPLIST] = skiplist_new(10, 0.5, FALSE, FALSE, xodtemplate_skiplist_compare_servicegroup);
 	/* allow dups in the following lists... */
-	xobject_skiplists[X_HOSTDEPENDENCY_SKIPLIST] = skiplist_new(16, 0.5, TRUE, FALSE, xodtemplate_skiplist_compare_hostdependency);
-	xobject_skiplists[X_SERVICEDEPENDENCY_SKIPLIST] = skiplist_new(16, 0.5, TRUE, FALSE, xodtemplate_skiplist_compare_servicedependency);
-	xobject_skiplists[X_HOSTESCALATION_SKIPLIST] = skiplist_new(16, 0.5, TRUE, FALSE, xodtemplate_skiplist_compare_hostescalation);
-	xobject_skiplists[X_SERVICEESCALATION_SKIPLIST] = skiplist_new(16, 0.5, TRUE, FALSE, xodtemplate_skiplist_compare_serviceescalation);
+	xobject_skiplists[HOSTDEPENDENCY_SKIPLIST] = skiplist_new(16, 0.5, TRUE, FALSE, xodtemplate_skiplist_compare_hostdependency);
+	xobject_skiplists[SERVICEDEPENDENCY_SKIPLIST] = skiplist_new(16, 0.5, TRUE, FALSE, xodtemplate_skiplist_compare_servicedependency);
+	xobject_skiplists[HOSTESCALATION_SKIPLIST] = skiplist_new(16, 0.5, TRUE, FALSE, xodtemplate_skiplist_compare_hostescalation);
+	xobject_skiplists[SERVICEESCALATION_SKIPLIST] = skiplist_new(16, 0.5, TRUE, FALSE, xodtemplate_skiplist_compare_serviceescalation);
 	/* host and service extinfo entries don't need to be added to a list... */
 
 	return OK;

Modified: nagioscore/trunk/xdata/xodtemplate.h
===================================================================
--- nagioscore/trunk/xdata/xodtemplate.h	2012-08-26 20:03:24 UTC (rev 2098)
+++ nagioscore/trunk/xdata/xodtemplate.h	2012-08-26 20:03:46 UTC (rev 2099)
@@ -55,24 +55,11 @@
 
 /***************** SKIP LISTS ****************/
 
-#define NUM_XOBJECT_SKIPLISTS                  15
+#define HOSTEXTINFO_SKIPLIST                 (NUM_OBJECT_SKIPLISTS)
+#define SERVICEEXTINFO_SKIPLIST              (NUM_OBJECT_SKIPLISTS + 1)
+#define NUM_XOBJECT_SKIPLISTS                (NUM_OBJECT_SKIPLISTS + 2)
 
-#define X_HOST_SKIPLIST                        1
-#define X_SERVICE_SKIPLIST                     2
-#define X_COMMAND_SKIPLIST                     3
-#define X_TIMEPERIOD_SKIPLIST                  4
-#define X_CONTACT_SKIPLIST                     5
-#define X_CONTACTGROUP_SKIPLIST                6
-#define X_HOSTGROUP_SKIPLIST                   7
-#define X_SERVICEGROUP_SKIPLIST                8
-#define X_HOSTDEPENDENCY_SKIPLIST              9
-#define X_SERVICEDEPENDENCY_SKIPLIST           10
-#define X_HOSTESCALATION_SKIPLIST              11
-#define X_SERVICEESCALATION_SKIPLIST           12
-#define X_HOSTEXTINFO_SKIPLIST                 13
-#define X_SERVICEEXTINFO_SKIPLIST              14
 
-
 /********** STRUCTURE DEFINITIONS **********/
 
 /* CUSTOMVARIABLESMEMBER structure */

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Nagios-commits mailing list