From 44bc5a27d53124ba82becd4181fc381053c56fdb Mon Sep 17 00:00:00 2001 From: "Kjetil S. Matheussen" Date: Thu, 8 Jan 2004 14:55:24 +0000 Subject: First commit of k_vst~, k_guile and k_cext svn path=/trunk/externals/k_cext/; revision=1253 --- k_cext_funchandler.c | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 k_cext_funchandler.c (limited to 'k_cext_funchandler.c') diff --git a/k_cext_funchandler.c b/k_cext_funchandler.c new file mode 100644 index 0000000..2554fdd --- /dev/null +++ b/k_cext_funchandler.c @@ -0,0 +1,157 @@ +/* + * Copyright 2003 Kjetil S. Matheussen. + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This program 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + + +#define MAX_FUNCS 1000 +#define MAX_FUNCLENGTH 50 + +static char k_cext_intfuncnames[MAX_FUNCLENGTH*MAX_FUNCS]={0}; +static k_cext_f_int_callback k_cext_intfuncpointers[MAX_FUNCS]={0}; +static t_k_cext *k_cext_intxs[MAX_FUNCS]; + +static char k_cext_floatfuncnames[MAX_FUNCLENGTH*MAX_FUNCS]={0}; +static k_cext_f_float_callback k_cext_floatfuncpointers[MAX_FUNCS]={0}; +static t_k_cext *k_cext_floatxs[MAX_FUNCS]; + + + +static int k_cext_intdummy(t_k_cext *x,...){ + post("Error. An integer k_func function has dissapeared. Returning 0 instead.\n"); + return 0; +} + +static float k_cext_floatdummy(t_k_cext *x,...){ + post("Error. A float k_func function has dissapeared. Returning 0.0f instead.\n"); + return 0.0f; +} + +void k_cext_setdummy(void *func){ + int lokke; + for(lokke=0;lokkek_cext_process; + return; + } + } +} + +static void k_cext_addfloatfunc(char *name,t_k_cext *x){ + int lokke; + for(lokke=0;lokkek_cext_process; + return; + } + } +} + +static int k_cext_findintfromname(char *name){ + int lokke; + for(lokke=0;lokke