[asterisk-commits] russell: branch russell/bindings r103761 - in /team/russell/bindings: binding...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 18 08:36:53 CST 2008


Author: russell
Date: Mon Feb 18 08:36:53 2008
New Revision: 103761

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103761
Log:
move logger functions to their own file since they will be common to all language bindings

Added:
    team/russell/bindings/res/bindings/
    team/russell/bindings/res/bindings/asterisk.c   (with props)
    team/russell/bindings/res/bindings/bindings.h   (with props)
Modified:
    team/russell/bindings/bindings/   (props changed)
    team/russell/bindings/res/   (props changed)
    team/russell/bindings/res/Makefile
    team/russell/bindings/res/python/res_python.h
    team/russell/bindings/res/res_python.c

Propchange: team/russell/bindings/bindings/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Feb 18 08:36:53 2008
@@ -10,3 +10,4 @@
 asterisk_wrap.c
 ast_cdr.i
 asterisk.i
+swigpyrun.h

Propchange: team/russell/bindings/res/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Feb 18 08:36:53 2008
@@ -9,3 +9,5 @@
 *.so
 modules.link
 python_ast_cdr_wrap.c
+python_ast_channel_wrap.c
+python_asterisk_wrap.c

Modified: team/russell/bindings/res/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/bindings/res/Makefile?view=diff&rev=103761&r1=103760&r2=103761
==============================================================================
--- team/russell/bindings/res/Makefile (original)
+++ team/russell/bindings/res/Makefile Mon Feb 18 08:36:53 2008
@@ -49,7 +49,7 @@
 ael/pval.o: ael/pval.c
 
 PYTHON_WRAPPERS:=python_ast_cdr_wrap.o python_ast_channel_wrap.o python_asterisk_wrap.o
-RES_PYTHON_OBJS:=res_python.o python/cdr.o python/channel.o
+RES_PYTHON_OBJS:=res_python.o python/cdr.o python/channel.o bindings/asterisk.o
 
 res_python.so: $(RES_PYTHON_OBJS) $(PYTHON_WRAPPERS)
 
@@ -59,21 +59,22 @@
 
 python_asterisk_wrap.o: ASTCFLAGS+=$(PYTHON_INCLUDE)
 	
-python_asterisk_wrap.c: ../bindings/asterisk_wrap.c
+python_asterisk_wrap.c: $(ASTTOPDIR)/bindings/asterisk_wrap.c
 	@cp $< $@
 	
 python_ast_channel_wrap.o: ASTCFLAGS+=$(PYTHON_INCLUDE)
 	
-python_ast_channel_wrap.c: ../bindings/ast_channel_wrap.c
+python_ast_channel_wrap.c: $(ASTTOPDIR)/bindings/ast_channel_wrap.c
 	@cp $< $@
 
 python_ast_cdr_wrap.o: ASTCFLAGS+=$(PYTHON_INCLUDE)
 
-python_ast_cdr_wrap.c: ../bindings/ast_cdr_wrap.c
+python_ast_cdr_wrap.c: $(ASTTOPDIR)/bindings/ast_cdr_wrap.c
 	@cp $< $@
 
 clean::
 	rm -f snmp/*.o
 	rm -f ael/*.o
 	rm -f python/*.o
+	rm -f bindings/*.o
 	rm -f $(PYTHON_WRAPPERS:.o=.c)

Added: team/russell/bindings/res/bindings/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/russell/bindings/res/bindings/asterisk.c?view=auto&rev=103761
==============================================================================
--- team/russell/bindings/res/bindings/asterisk.c (added)
+++ team/russell/bindings/res/bindings/asterisk.c Mon Feb 18 08:36:53 2008
@@ -1,0 +1,57 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2008, Digium, Inc.
+ *
+ * Russell Bryant <russell at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*! \file
+ *
+ * \brief Language bindings for Asterisk
+ *
+ * \author Russell Bryant <russell at digium.com>
+ */
+
+#include "asterisk.h"
+
+#include "asterisk/utils.h"
+#include "asterisk/logger.h"
+
+#include "bindings.h"
+
+void ast_log_error(const char *msg)
+{
+	ast_log(LOG_ERROR, "%s\n", msg);
+}
+
+void ast_log_warning(const char *msg)
+{
+	ast_log(LOG_WARNING, "%s\n", msg);
+}
+
+void ast_log_notice(const char *msg)
+{
+	ast_log(LOG_NOTICE, "%s\n", msg);
+}
+
+void ast_log_debug(unsigned int level, const char *msg)
+{
+	ast_debug(level, "%s\n", msg);
+}
+
+void ast_log_verbose(unsigned int level, const char *msg)
+{
+	ast_verb(level, "%s\n", msg);
+}
+

Propchange: team/russell/bindings/res/bindings/asterisk.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/russell/bindings/res/bindings/asterisk.c
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/russell/bindings/res/bindings/asterisk.c
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/russell/bindings/res/bindings/bindings.h
URL: http://svn.digium.com/view/asterisk/team/russell/bindings/res/bindings/bindings.h?view=auto&rev=103761
==============================================================================
--- team/russell/bindings/res/bindings/bindings.h (added)
+++ team/russell/bindings/res/bindings/bindings.h Mon Feb 18 08:36:53 2008
@@ -1,0 +1,36 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2008, Digium, Inc.
+ *
+ * Russell Bryant <russell at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*!
+ * \file
+ * \brief Common bindings definitions
+ * \author Russell Bryant <russell at digium.com>
+ */
+
+#ifndef ASTERISK_BINDINGS_H
+#define ASTERISK_BINDINGS_H
+
+/*** SWIG_BEGIN ***/
+void ast_log_error(const char *msg);
+void ast_log_warning(const char *msg);
+void ast_log_notice(const char *msg);
+void ast_log_debug(unsigned int level, const char *msg);
+void ast_log_verbose(unsigned int level, const char *msg);
+/*** SWIG_END ***/
+
+#endif /* ASTERISK_BINDINGS_H */

Propchange: team/russell/bindings/res/bindings/bindings.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/russell/bindings/res/bindings/bindings.h
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/russell/bindings/res/bindings/bindings.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: team/russell/bindings/res/python/res_python.h
URL: http://svn.digium.com/view/asterisk/team/russell/bindings/res/python/res_python.h?view=diff&rev=103761&r1=103760&r2=103761
==============================================================================
--- team/russell/bindings/res/python/res_python.h (original)
+++ team/russell/bindings/res/python/res_python.h Mon Feb 18 08:36:53 2008
@@ -16,6 +16,12 @@
  * at the top of the source tree.
  */
 
+/*!
+ * \file
+ * \brief Python bindings definitions
+ * \author Russell Bryant <russell at digium.com>
+ */
+
 #ifndef RES_PYTHON_H
 #define RES_PYTHON_H
 
@@ -28,14 +34,6 @@
 
 /*! defined by python_asterisk_wrap.c */
 void init_asterisk(void);
-
-/*** SWIG_BEGIN ***/
-void ast_log_error(const char *msg);
-void ast_log_warning(const char *msg);
-void ast_log_notice(const char *msg);
-void ast_log_debug(unsigned int level, const char *msg);
-void ast_log_verbose(unsigned int level, const char *msg);
-/*** SWIG_END ***/
 
 /*! defined by python_ast_cdr_wrap.c */
 void init_ast_cdr(void);

Modified: team/russell/bindings/res/res_python.c
URL: http://svn.digium.com/view/asterisk/team/russell/bindings/res/res_python.c?view=diff&rev=103761&r1=103760&r2=103761
==============================================================================
--- team/russell/bindings/res/res_python.c (original)
+++ team/russell/bindings/res/res_python.c Mon Feb 18 08:36:53 2008
@@ -45,31 +45,6 @@
 
 /*! \brief Don't let python register signal handlers */
 #define INIT_SIGS 0
-
-void ast_log_error(const char *msg)
-{
-	ast_log(LOG_ERROR, "%s\n", msg);
-}
-
-void ast_log_warning(const char *msg)
-{
-	ast_log(LOG_WARNING, "%s\n", msg);
-}
-
-void ast_log_notice(const char *msg)
-{
-	ast_log(LOG_NOTICE, "%s\n", msg);
-}
-
-void ast_log_debug(unsigned int level, const char *msg)
-{
-	ast_debug(level, "%s\n", msg);
-}
-
-void ast_log_verbose(unsigned int level, const char *msg)
-{
-	ast_verb(level, "%s\n", msg);
-}
 
 static char *cli_python_settings(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {




More information about the asterisk-commits mailing list