[icinga-checkins] icinga.org: icinga-core/master: common/objects.c: Remove unused functions ( Andreas Ericsson)

git at icinga.org git at icinga.org
Wed May 19 13:41:53 CEST 2010


Module: icinga-core
Branch: master
Commit: e5fc3e56660373d501b1153f5a549f39e4534a06
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=e5fc3e56660373d501b1153f5a549f39e4534a06

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed May 12 22:18:20 2010 +0200

common/objects.c: Remove unused functions (Andreas Ericsson)

[--snip--]
These two functions weren't used anywhere and probably won't
be ever again. If they are, we can easily resurrect them later.

The two functions were is_contact_mamber_of_contactgroup and
is_contact_for_hostgroup.
[--snip--]

refs #388

---

 Changelog        |    1 +
 common/objects.c |   74 ------------------------------------------------------
 2 files changed, 1 insertions(+), 74 deletions(-)

diff --git a/Changelog b/Changelog
index 4655567..6424acd 100644
--- a/Changelog
+++ b/Changelog
@@ -38,6 +38,7 @@ FIXES
 * core: fix checking of the open(2) system call (David Glick)
 * core: xodtemplate: Use macro magic to get rid of 900 LoC (Andreas Ericsson)
 * core: more s/malloc(size) + init/calloc(1, size)/ replacements (Andreas Ericsson)
+* core: common/objects.c: Remove unused functions (Andreas Ericsson)
 
 * idoutils: Host DB inserts use string 'NULL\n' instead of NULL (William Preston)
 * idoutils: ndo2db_get_object_id fails to return existing IDs (William Preston)
diff --git a/common/objects.c b/common/objects.c
index 525e51a..3982e27 100644
--- a/common/objects.c
+++ b/common/objects.c
@@ -2884,80 +2884,6 @@ int is_service_member_of_servicegroup(servicegroup *group, service *svc){
         }
 
 
-/*  tests whether a contact is a member of a particular contactgroup - used only by the CGIs */
-/* 08/14/07 EG NO LONGER USED */
-int is_contact_member_of_contactgroup(contactgroup *group, contact *cntct){
-	contactsmember *temp_contactsmember=NULL;
-
-	if(group==NULL || cntct==NULL)
-		return FALSE;
-
-	/* search all contacts in this contact group */
-	for(temp_contactsmember=group->members;temp_contactsmember!=NULL;temp_contactsmember=temp_contactsmember->next){
-
-#ifdef NSCORE
-		if(temp_contactsmember->contact_ptr==cntct)
-			return TRUE;
-#else
-		if(!strcmp(temp_contactsmember->contact_name,cntct->name))
-			return TRUE;
-#endif
-                }
-
-	return FALSE;
-        }
-
-
-/*  tests whether a contact is a member of a particular hostgroup - used only by the CGIs */
-int is_contact_for_hostgroup(hostgroup *group, contact *cntct){
-	hostsmember *temp_hostsmember=NULL;
-	host *temp_host=NULL;
-
-	if(group==NULL || cntct==NULL)
-		return FALSE;
-
-	for(temp_hostsmember=group->members;temp_hostsmember!=NULL;temp_hostsmember=temp_hostsmember->next){
-#ifdef NSCORE
-		temp_host=temp_hostsmember->host_ptr;
-#else
-		temp_host=find_host(temp_hostsmember->host_name);
-#endif
-		if(temp_host==NULL)
-			continue;
-		if(is_contact_for_host(temp_host,cntct)==TRUE)
-			return TRUE;
-	        }
-
-	return FALSE;
-        }
-
-
-
-/*  tests whether a contact is a member of a particular servicegroup - used only by the CGIs */
-int is_contact_for_servicegroup(servicegroup *group, contact *cntct){
-	servicesmember *temp_servicesmember=NULL;
-	service *temp_service=NULL;
-
-	if(group==NULL || cntct==NULL)
-		return FALSE;
-
-	for(temp_servicesmember=group->members;temp_servicesmember!=NULL;temp_servicesmember=temp_servicesmember->next){
-#ifdef NSCORE
-		temp_service=temp_servicesmember->service_ptr;
-#else
-		temp_service=find_service(temp_servicesmember->host_name,temp_servicesmember->service_description);
-#endif
-		if(temp_service==NULL)
-			continue;
-		if(is_contact_for_service(temp_service,cntct)==TRUE)
-			return TRUE;
-	        }
-
-	return FALSE;
-        }
-
-
-
 /*  tests whether a contact is a contact for a particular host */
 int is_contact_for_host(host *hst, contact *cntct){
 	contactsmember *temp_contactsmember=NULL;





More information about the icinga-checkins mailing list