[sr-dev] git:master: kcore: removed local_route.{c, h} - they are not used

Daniel-Constantin Mierla miconda at gmail.com
Fri Feb 10 13:44:56 CET 2012


Module: sip-router
Branch: master
Commit: 04979bc60fcd22752ab74521e1e56da9090a1607
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=04979bc60fcd22752ab74521e1e56da9090a1607

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Fri Feb 10 11:28:06 2012 +0100

kcore: removed local_route.{c,h} - they are not used

- removed unused code from acc related to local route

---

 lib/kcore/local_route.c |   78 -----------------------------------------------
 lib/kcore/local_route.h |   42 -------------------------
 modules_k/acc/acc_mod.c |   19 -----------
 3 files changed, 0 insertions(+), 139 deletions(-)

diff --git a/lib/kcore/local_route.c b/lib/kcore/local_route.c
deleted file mode 100644
index ba2f156..0000000
--- a/lib/kcore/local_route.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *$Id: local_route.c 5132 2008-10-24 11:49:14Z miconda $
- *
- * Copyright (C) 2001-2003 FhG Fokus
- *
- * This file is part of Kamailio, a free SIP server.
- *
- * Kamailio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version
- *
- * Kamailio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-/*!
- * \file
- * \brief Local Route related functions.
- */
-
-#include <string.h>
-
-#include "../../dprint.h"
-#include "../../mem/mem.h"
-
-#include "local_route.h"
-
-static lrt_info_t* lrt_info_list = 0;
-static int lrt_info_no = 0;
-
-
-int lrt_do_init_child(void)
-{
-	int i;
-
-	for ( i=0; i< lrt_info_no; i++ )
-	{
-		if ( lrt_info_list[i].init && lrt_info_list[i].init()!=0 )
-		{
-			LM_ERR("failed to init child for local route <%s>\n",
-					 lrt_info_list[i].name);
-			return -1;
-		}
-	}
-	return 0;
-}
-
-int register_lrt_info(lrt_info_t *lrti)
-{
-	lrt_info_t *l;
-
-	if(lrti==NULL || lrti->name==NULL || lrti->init==NULL)
-		return 0;
-
-	l = (lrt_info_t*)pkg_realloc(lrt_info_list,
-			(lrt_info_no+1)*sizeof(lrt_info_t));
-	if (l==0)
-	{
-		LM_ERR("no more pkg memory\n");
-		return -1;
-	}
-
-	lrt_info_list = l;
-	lrt_info_list[lrt_info_no].init = lrti->init;
-	lrt_info_list[lrt_info_no].name = lrti->name;
-	lrt_info_no++;
-
-	return 0;
-}
-
-
diff --git a/lib/kcore/local_route.h b/lib/kcore/local_route.h
deleted file mode 100644
index fe1da2c..0000000
--- a/lib/kcore/local_route.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *$Id: local_route.h 5132 2008-10-24 11:49:14Z miconda $
- *
- * Copyright (C) 2001-2003 FhG Fokus
- *
- * This file is part of Kamailio, a free SIP server.
- *
- * Kamailio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version
- *
- * Kamailio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-/*!
- * \file
- * \brief Local Route related functions.
- */
-
-#ifndef _LOCAL_ROUTE_H_
-#define _LOCAL_ROUTE_H_
-
-typedef int (lrt_child_init_f)(void);
-
-typedef struct _lrt_info {
-	char *name;
-	lrt_child_init_f *init;
-} lrt_info_t;
-
-int lrt_do_init_child(void);
-int register_lrt_info(lrt_info_t *lrti);
-
-#endif
-
diff --git a/modules_k/acc/acc_mod.c b/modules_k/acc/acc_mod.c
index c913eba..c1d6d68 100644
--- a/modules_k/acc/acc_mod.c
+++ b/modules_k/acc/acc_mod.c
@@ -63,7 +63,6 @@
 #include <string.h>
 
 #include "../../sr_module.h"
-#include "../../lib/kcore/local_route.h"
 #include "../../dprint.h"
 #include "../../mem/mem.h"
 #include "../../modules/tm/tm_load.h"
@@ -362,18 +361,6 @@ static int free_acc_fixup(void** param, int param_no)
 
 /************************** INTERFACE functions ****************************/
 
-static int mod_lrt_init( void )
-{
-
-#ifdef SQL_ACC
-	if(db_url.s && acc_db_init_child(&db_url)<0) {
-		LM_ERR("could not open database connection");
-		return -1;
-	}
-#endif
-
-	return 0;
-}
 
 static int parse_failed_filter(char *s, unsigned short *failed_filter)
 {
@@ -416,12 +403,6 @@ static int parse_failed_filter(char *s, unsigned short *failed_filter)
 
 static int mod_init( void )
 {
-	lrt_info_t li;
-	li.init = mod_lrt_init;
-	li.name = "acc";
-	if(register_lrt_info(&li)!=0)
-		return -1;
-
 #ifdef SQL_ACC
 	if (db_url.s) {
 		db_url.len = strlen(db_url.s);




More information about the sr-dev mailing list