From 0191360b3c4a311dad5fa2e16c089d8f225abc69 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 9 Sep 2006 04:11:58 +0000 Subject: [PATCH] show doc git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2592 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/languages/mod_perl/fs_perl.pm | 1 + src/mod/languages/mod_perl/switch_swig.c | 10 +- src/mod/languages/mod_perl/switch_swig_wrap.c | 976 ++++++------------ 3 files changed, 331 insertions(+), 656 deletions(-) diff --git a/src/mod/languages/mod_perl/fs_perl.pm b/src/mod/languages/mod_perl/fs_perl.pm index e0adcb0b09..83da541e58 100644 --- a/src/mod/languages/mod_perl/fs_perl.pm +++ b/src/mod/languages/mod_perl/fs_perl.pm @@ -61,6 +61,7 @@ package fs_perl; *fs_channel_get_variable = *fs_perlc::fs_channel_get_variable; *fs_channel_set_state = *fs_perlc::fs_channel_set_state; *fs_ivr_play_file = *fs_perlc::fs_ivr_play_file; +*fs_ivr_play_file2 = *fs_perlc::fs_ivr_play_file2; # ------- VARIABLE STUBS -------- diff --git a/src/mod/languages/mod_perl/switch_swig.c b/src/mod/languages/mod_perl/switch_swig.c index c6cf92ecbd..6d1efc6aa9 100644 --- a/src/mod/languages/mod_perl/switch_swig.c +++ b/src/mod/languages/mod_perl/switch_swig.c @@ -55,9 +55,15 @@ int fs_console_loop(void) return 0; } -void fs_console_log(char *msg) +void fs_console_log(char *level_str, char *msg) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, msg); + switch_log_level_t level = SWITCH_LOG_DEBUG; + + if (level_str) { + level = switch_log_str2level(level_str); + } + + switch_log_printf(SWITCH_CHANNEL_LOG, level, msg); } void fs_console_clean(char *msg) diff --git a/src/mod/languages/mod_perl/switch_swig_wrap.c b/src/mod/languages/mod_perl/switch_swig_wrap.c index 150b3cb84b..8d60f30542 100644 --- a/src/mod/languages/mod_perl/switch_swig_wrap.c +++ b/src/mod/languages/mod_perl/switch_swig_wrap.c @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.26 + * Version 1.3.21 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -8,112 +8,71 @@ * interface file instead. * ----------------------------------------------------------------------------- */ -/*********************************************************************** +/*************************************************************** -*- c -*- + * perl5/precommon.swg * - * This section contains generic SWIG labels for method/variable - * declarations/attributes, and other compiler dependent labels. + * Rename all exported symbols from common.swg, to avoid symbol + * clashes if multiple interpreters are included * ************************************************************************/ -/* template workaround for compilers that cannot correctly implement the C++ standard */ -#ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif -#endif - -/* inline attribute */ -#ifndef SWIGINLINE -# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) -# define SWIGINLINE inline -# else -# define SWIGINLINE -# endif -#endif - -/* attribute recognised by some compilers to avoid 'unused' warnings */ -#ifndef SWIGUNUSED -# if defined(__GNUC__) || defined(__ICC) -# define SWIGUNUSED __attribute__ ((unused)) -# else -# define SWIGUNUSED -# endif -#endif - -/* internal SWIG method */ -#ifndef SWIGINTERN -# define SWIGINTERN static SWIGUNUSED -#endif - -/* internal inline SWIG method */ -#ifndef SWIGINTERNINLINE -# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE -#endif - -/* exporting methods for Windows DLLs */ -#ifndef SWIGEXPORT -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# if defined(STATIC_LINKED) -# define SWIGEXPORT -# else -# define SWIGEXPORT __declspec(dllexport) -# endif -# else -# define SWIGEXPORT -# endif -#endif - -/* calling conventions for Windows */ -#ifndef SWIGSTDCALL -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# define SWIGSTDCALL __stdcall -# else -# define SWIGSTDCALL -# endif -#endif +#define SWIG_TypeRegister SWIG_Perl_TypeRegister +#define SWIG_TypeCheck SWIG_Perl_TypeCheck +#define SWIG_TypeCast SWIG_Perl_TypeCast +#define SWIG_TypeDynamicCast SWIG_Perl_TypeDynamicCast +#define SWIG_TypeName SWIG_Perl_TypeName +#define SWIG_TypeQuery SWIG_Perl_TypeQuery +#define SWIG_TypeClientData SWIG_Perl_TypeClientData +#define SWIG_PackData SWIG_Perl_PackData +#define SWIG_UnpackData SWIG_Perl_UnpackData /*********************************************************************** - * swigrun.swg + * common.swg * - * This file contains generic CAPI SWIG runtime support for pointer - * type checking. + * This file contains generic SWIG runtime support for pointer + * type checking as well as a few commonly used macros to control + * external linkage. * + * Author : David Beazley (beazley@cs.uchicago.edu) + * + * Copyright (c) 1999-2000, The University of Chicago + * + * This file may be freely redistributed without license or fee provided + * this copyright message remains intact. ************************************************************************/ -/* This should only be incremented when either the layout of swig_type_info changes, - or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "2" - -/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ -#ifdef SWIG_TYPE_TABLE -# define SWIG_QUOTE_STRING(x) #x -# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) -# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) -#else -# define SWIG_TYPE_TABLE_NAME -#endif - -/* - You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the swig runtime code. - In 99.9% of the cases, swig just needs to declare them as 'static'. - - But only do this if is strictly necessary, ie, if you have problems - with your compiler or so. -*/ - -#ifndef SWIGRUNTIME -# define SWIGRUNTIME SWIGINTERN -#endif - -#ifndef SWIGRUNTIMEINLINE -# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE -#endif - #include +#include + +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(_MSC_VER) || defined(__GNUC__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) extern a +# else +# define SWIGEXPORT(a) __declspec(dllexport) a +# define SWIGIMPORT(a) extern a +# endif +# else +# if defined(__BORLANDC__) +# define SWIGEXPORT(a) a _export +# define SWIGIMPORT(a) a _export +# else +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) a +# endif +# endif +#else +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) a +#endif + +#ifdef SWIG_GLOBAL +# define SWIGRUNTIME(a) SWIGEXPORT(a) +#else +# define SWIGRUNTIME(a) static a +#endif #ifdef __cplusplus extern "C" { @@ -122,141 +81,106 @@ extern "C" { typedef void *(*swig_converter_func)(void *); typedef struct swig_type_info *(*swig_dycast_func)(void **); -/* Structure to store inforomation on one type */ typedef struct swig_type_info { - const char *name; /* mangled name of this type */ - const char *str; /* human readable name of this type */ - swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ - struct swig_cast_info *cast; /* linked list of types that can cast into this type */ - void *clientdata; /* language specific type data */ + const char *name; + swig_converter_func converter; + const char *str; + void *clientdata; + swig_dycast_func dcast; + struct swig_type_info *next; + struct swig_type_info *prev; } swig_type_info; -/* Structure to store a type and conversion function used for casting */ -typedef struct swig_cast_info { - swig_type_info *type; /* pointer to type that is equivalent to this type */ - swig_converter_func converter; /* function to cast the void pointers */ - struct swig_cast_info *next; /* pointer to next cast in linked list */ - struct swig_cast_info *prev; /* pointer to the previous cast */ -} swig_cast_info; +#ifdef SWIG_NOINCLUDE -/* Structure used to store module information - * Each module generates one structure like this, and the runtime collects - * all of these structures and stores them in a circularly linked list.*/ -typedef struct swig_module_info { - swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ - size_t size; /* Number of types in this module */ - struct swig_module_info *next; /* Pointer to next element in circularly linked list */ - swig_type_info **type_initial; /* Array of initially generated type structures */ - swig_cast_info **cast_initial; /* Array of initially generated casting structures */ - void *clientdata; /* Language specific module data */ -} swig_module_info; +SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *); +SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *); +SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *); +SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **); +SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *); +SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *); +SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); +SWIGIMPORT(char *) SWIG_PackData(char *, void *, int); +SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int); +#else -/* - Compare two type names skipping the space characters, therefore - "char*" == "char *" and "Class" == "Class", etc. +static swig_type_info *swig_type_list = 0; - Return 0 when the two name types are equivalent, as in - strncmp, but skipping ' '. -*/ -SWIGRUNTIME int -SWIG_TypeNameComp(const char *f1, const char *l1, - const char *f2, const char *l2) { - for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { - while ((*f1 == ' ') && (f1 != l1)) ++f1; - while ((*f2 == ' ') && (f2 != l2)) ++f2; - if (*f1 != *f2) return (int)(*f1 - *f2); - } - return (l1 - f1) - (l2 - f2); -} - -/* - Check type equivalence in a name list like ||... - Return 0 if not equal, 1 if equal -*/ -SWIGRUNTIME int -SWIG_TypeEquiv(const char *nb, const char *tb) { - int equiv = 0; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (!equiv && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; +/* Register a type mapping with the type-checking */ +SWIGRUNTIME(swig_type_info *) +SWIG_TypeRegister(swig_type_info *ti) { + swig_type_info *tc, *head, *ret, *next; + /* Check to see if this type has already been registered */ + tc = swig_type_list; + while (tc) { + if (strcmp(tc->name, ti->name) == 0) { + /* Already exists in the table. Just add additional types to the list */ + if (tc->clientdata) ti->clientdata = tc->clientdata; + head = tc; + next = tc->next; + goto l1; } - equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; - if (*ne) ++ne; + tc = tc->prev; } - return equiv; + head = ti; + next = 0; + + /* Place in list */ + ti->prev = swig_type_list; + swig_type_list = ti; + + /* Build linked lists */ + l1: + ret = head; + tc = ti + 1; + /* Patch up the rest of the links */ + while (tc->name) { + head->next = tc; + tc->prev = head; + head = tc; + tc++; + } + if (next) next->prev = head; + head->next = next; + return ret; } -/* - Check type equivalence in a name list like ||... - Return 0 if equal, -1 if nb < tb, 1 if nb > tb -*/ -SWIGRUNTIME int -SWIG_TypeCompare(const char *nb, const char *tb) { - int equiv = 0; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (!equiv && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; +/* Check the typename */ +SWIGRUNTIME(swig_type_info *) +SWIG_TypeCheck(char *c, swig_type_info *ty) { + swig_type_info *s; + if (!ty) return 0; /* Void pointer */ + s = ty->next; /* First element always just a name */ + do { + if (strcmp(s->name,c) == 0) { + if (s == ty->next) return s; + /* Move s to the top of the linked list */ + s->prev->next = s->next; + if (s->next) { + s->next->prev = s->prev; + } + /* Insert s as second element in the list */ + s->next = ty->next; + if (ty->next) ty->next->prev = s; + ty->next = s; + s->prev = ty; + return s; } - equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; - if (*ne) ++ne; - } - return equiv; + s = s->next; + } while (s && (s != ty->next)); + return 0; } - -/* think of this as a c++ template<> or a scheme macro */ -#define SWIG_TypeCheck_Template(comparison, ty) \ - if (ty) { \ - swig_cast_info *iter = ty->cast; \ - while (iter) { \ - if (comparison) { \ - if (iter == ty->cast) return iter; \ - /* Move iter to the top of the linked list */ \ - iter->prev->next = iter->next; \ - if (iter->next) \ - iter->next->prev = iter->prev; \ - iter->next = ty->cast; \ - iter->prev = 0; \ - if (ty->cast) ty->cast->prev = iter; \ - ty->cast = iter; \ - return iter; \ - } \ - iter = iter->next; \ - } \ - } \ - return 0 - -/* - Check the typename -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); +/* Cast a pointer up an inheritance hierarchy */ +SWIGRUNTIME(void *) +SWIG_TypeCast(swig_type_info *ty, void *ptr) { + if ((!ty) || (!ty->converter)) return ptr; + return (*ty->converter)(ptr); } -/* Same as previous function, except strcmp is replaced with a pointer comparison */ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { - SWIG_TypeCheck_Template(iter->type == from, into); -} - -/* - Cast a pointer up an inheritance hierarchy -*/ -SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); -} - -/* - Dynamic pointer casting. Down an inheritance hierarchy -*/ -SWIGRUNTIME swig_type_info * +/* Dynamic pointer casting. Down an inheritance hierarchy */ +SWIGRUNTIME(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { swig_type_info *lastty = ty; if (!ty || !ty->dcast) return ty; @@ -267,233 +191,83 @@ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { return lastty; } -/* - Return the name associated with this type -*/ -SWIGRUNTIMEINLINE const char * +/* Return the name associated with this type */ +SWIGRUNTIME(const char *) SWIG_TypeName(const swig_type_info *ty) { return ty->name; } -/* - Return the pretty name associated with this type, - that is an unmangled type name in a form presentable to the user. -*/ -SWIGRUNTIME const char * -SWIG_TypePrettyName(const swig_type_info *type) { - /* The "str" field contains the equivalent pretty names of the - type, separated by vertical-bar characters. We choose - to print the last name, as it is often (?) the most - specific. */ - if (type->str != NULL) { - const char *last_name = type->str; - const char *s; - for (s = type->str; *s; s++) - if (*s == '|') last_name = s+1; - return last_name; +/* Search for a swig_type_info structure */ +SWIGRUNTIME(swig_type_info *) +SWIG_TypeQuery(const char *name) { + swig_type_info *ty = swig_type_list; + while (ty) { + if (ty->str && (strcmp(name,ty->str) == 0)) return ty; + if (ty->name && (strcmp(name,ty->name) == 0)) return ty; + ty = ty->prev; } - else - return type->name; + return 0; } -/* - Set the clientdata field for a type -*/ -SWIGRUNTIME void +/* Set the clientdata field for a type */ +SWIGRUNTIME(void) SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { - swig_cast_info *cast = ti->cast; - /* if (ti->clientdata == clientdata) return; */ + swig_type_info *tc, *equiv; + if (ti->clientdata == clientdata) return; ti->clientdata = clientdata; - - while (cast) { - if (!cast->converter) { - swig_type_info *tc = cast->type; - if (!tc->clientdata) { - SWIG_TypeClientData(tc, clientdata); + equiv = ti->next; + while (equiv) { + if (!equiv->converter) { + tc = swig_type_list; + while (tc) { + if ((strcmp(tc->name, equiv->name) == 0)) + SWIG_TypeClientData(tc,clientdata); + tc = tc->prev; } - } - cast = cast->next; - } -} - -/* - Search for a swig_type_info structure only by mangled name - Search is a O(log #types) - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_MangledTypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - swig_module_info *iter = start; - do { - if (iter->size) { - register size_t l = 0; - register size_t r = iter->size - 1; - do { - /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - register size_t i = (l + r) >> 1; - const char *iname = iter->types[i]->name; - if (iname) { - register int compare = strcmp(name, iname); - if (compare == 0) { - return iter->types[i]; - } else if (compare < 0) { - if (i) { - r = i - 1; - } else { - break; - } - } else if (compare > 0) { - l = i + 1; - } - } else { - break; /* should never happen */ - } - } while (l <= r); } - iter = iter->next; - } while (iter != end); - return 0; -} - -/* - Search for a swig_type_info structure for either a mangled name or a human readable name. - It first searches the mangled names of the types, which is a O(log #types) - If a type is not found it then searches the human readable names, which is O(#types). - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - /* STEP 1: Search the name field using binary search */ - swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); - if (ret) { - return ret; - } else { - /* STEP 2: If the type hasn't been found, do a complete search - of the str field (the human readable name) */ - swig_module_info *iter = start; - do { - register size_t i = 0; - for (; i < iter->size; ++i) { - if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) - return iter->types[i]; - } - iter = iter->next; - } while (iter != end); + equiv = equiv->next; } - - /* neither found a match */ - return 0; } - -/* - Pack binary data into a string -*/ -SWIGRUNTIME char * -SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - register const unsigned char *u = (unsigned char *) ptr; - register const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - register unsigned char uu = *u; +/* Pack binary data into a string */ +SWIGRUNTIME(char *) +SWIG_PackData(char *c, void *ptr, int sz) { + static char hex[17] = "0123456789abcdef"; + int i; + unsigned char *u = (unsigned char *) ptr; + register unsigned char uu; + for (i = 0; i < sz; i++,u++) { + uu = *u; *(c++) = hex[(uu & 0xf0) >> 4]; *(c++) = hex[uu & 0xf]; } return c; } -/* - Unpack binary data from a string -*/ -SWIGRUNTIME const char * -SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - register unsigned char *u = (unsigned char *) ptr; - register const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - register char d = *(c++); - register unsigned char uu = 0; +/* Unpack binary data from a string */ +SWIGRUNTIME(char *) +SWIG_UnpackData(char *c, void *ptr, int sz) { + register unsigned char uu = 0; + register int d; + unsigned char *u = (unsigned char *) ptr; + int i; + for (i = 0; i < sz; i++, u++) { + d = *(c++); if ((d >= '0') && (d <= '9')) uu = ((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) uu = ((d - ('a'-10)) << 4); - else - return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) uu |= (d - '0'); else if ((d >= 'a') && (d <= 'f')) uu |= (d - ('a'-10)); - else - return (char *) 0; *u = uu; } return c; } -/* - Pack 'void *' into a string buffer. -*/ -SWIGRUNTIME char * -SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { - char *r = buff; - if ((2*sizeof(void *) + 2) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,&ptr,sizeof(void *)); - if (strlen(name) + 1 > (bsz - (r - buff))) return 0; - strcpy(r,name); - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - *ptr = (void *) 0; - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sizeof(void *)); -} - -SWIGRUNTIME char * -SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { - char *r = buff; - size_t lname = (name ? strlen(name) : 0); - if ((2*sz + 2 + lname) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - if (lname) { - strncpy(r,name,lname+1); - } else { - *r = 0; - } - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - memset(ptr,0,sz); - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sz); -} +#endif #ifdef __cplusplus } @@ -503,7 +277,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { * perl5.swg * * Perl5 runtime library - * $Header: /cvsroot/swig/SWIG/Lib/perl5/perlrun.swg,v 1.21 2005/02/01 00:08:17 wuzzeb Exp $ + * $Header: /cvsroot/SWIG/Lib/perl5/perlrun.swg,v 1.14 2003/12/04 19:14:14 beazley Exp $ * ----------------------------------------------------------------------------- */ #define SWIGPERL @@ -643,19 +417,19 @@ extern "C" { SWIG_Perl_ConvertPacked(obj, p, s, type, flags) #endif -/* Runtime API */ -#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule() -#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer) - /* Perl-specific API */ #ifdef PERL_OBJECT # define SWIG_MakePtr(sv, ptr, type, flags) \ SWIG_Perl_MakePtr(pPerl, sv, ptr, type, flags) +# define SWIG_TypeCheckRV(rv, ty) \ + SWIG_Perl_TypeCheckRV(pPerl, rv, ty) # define SWIG_SetError(str) \ SWIG_Perl_SetError(pPerl, str) #else # define SWIG_MakePtr(sv, ptr, type, flags) \ SWIG_Perl_MakePtr(sv, ptr, type, flags) +# define SWIG_TypeCheckRV(rv, ty) \ + SWIG_Perl_TypeCheckRV(rv, ty) # define SWIG_SetError(str) \ SWIG_Perl_SetError(str) # define SWIG_SetErrorSV(str) \ @@ -671,16 +445,48 @@ extern "C" { # define SWIG_MAYBE_PERL_OBJECT #endif -static swig_cast_info * +#ifdef SWIG_NOINCLUDE + +SWIGIMPORT(int) SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *, void **, swig_type_info *, int flags); +SWIGIMPORT(void) SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *, void *, swig_type_info *, int flags); +SWIGIMPORT(SV *) SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *, swig_type_info *, int flags); +SWIGIMPORT(void) SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *, void *, int, swig_type_info *); +SWIGIMPORT(int) SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *, void *, int, swig_type_info *, int flags); +SWIGIMPORT(swig_type_info *) SWIG_Perl_TypeCheckRV(SWIG_MAYBE_PERL_OBJECT SV *rv, swig_type_info *ty); +SWIGIMPORT(SV *) SWIG_Perl_SetError(SWIG_MAYBE_PERL_OBJECT char *); + +#else + +SWIGRUNTIME(swig_type_info *) SWIG_Perl_TypeCheckRV(SWIG_MAYBE_PERL_OBJECT SV *rv, swig_type_info *ty) { - SWIG_TypeCheck_Template(sv_derived_from(rv, (char *) iter->type->name), ty); + swig_type_info *s; + if (!ty) return 0; /* Void pointer */ + s = ty->next; /* First element always just a name */ + do { + if (sv_derived_from(rv, (char *) s->name)) { + if (s == ty->next) return s; + /* Move s to the top of the linked list */ + s->prev->next = s->next; + if (s->next) { + s->next->prev = s->prev; + } + /* Insert s as second element in the list */ + s->next = ty->next; + if (ty->next) ty->next->prev = s; + ty->next = s; + s->prev = ty; + return s; + } + s = s->next; + } while (s && (s != ty->next)); + return 0; } /* Function for getting a pointer value */ -static int +SWIGRUNTIME(int) SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) { - swig_cast_info *tc; + swig_type_info *tc; void *voidptr = (void *)0; /* If magical, apply more magic */ @@ -696,9 +502,9 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info * if (SvMAGICAL(tsv)) { mg = mg_find(tsv,'P'); if (mg) { - sv = mg->mg_obj; - if (sv_isobject(sv)) { - tmp = SvIV((SV*)SvRV(sv)); + SV *rsv = mg->mg_obj; + if (sv_isobject(rsv)) { + tmp = SvIV((SV*)SvRV(rsv)); } } } else { @@ -727,8 +533,7 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info * } if (_t) { /* Now see if the types match */ - char *_c = HvNAME(SvSTASH(SvRV(sv))); - tc = SWIG_TypeCheck(_c,_t); + tc = SWIG_TypeCheckRV(sv,_t); if (!tc) { *ptr = voidptr; return -1; @@ -740,7 +545,7 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info * return 0; } -static void +SWIGRUNTIME(void) SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) { if (ptr && (flags & SWIG_SHADOW)) { SV *self; @@ -769,14 +574,14 @@ SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, i } } -static SWIGINLINE SV * +SWIGRUNTIME(SV *) SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) { SV *result = sv_newmortal(); SWIG_MakePtr(result, ptr, t, flags); return result; } -static void +SWIGRUNTIME(void) SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) { char result[1024]; char *r = result; @@ -788,10 +593,10 @@ static void } /* Convert a packed value value */ -static int +SWIGRUNTIME(int) SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty, int flags) { - swig_cast_info *tc; - const char *c = 0; + swig_type_info *tc; + char *c = 0; if ((!obj) || (!SvOK(obj))) return -1; c = SvPV(obj, PL_na); @@ -806,17 +611,17 @@ SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_ return 0; } -static SWIGINLINE void +SWIGRUNTIME(void) SWIG_Perl_SetError(SWIG_MAYBE_PERL_OBJECT const char *error) { if (error) sv_setpv(perl_get_sv("@", TRUE), error); } -static SWIGINLINE void +SWIGRUNTIME(void) SWIG_Perl_SetErrorSV(SWIG_MAYBE_PERL_OBJECT SV *error) { if (error) sv_setsv(perl_get_sv("@", TRUE), error); } -static void +SWIGRUNTIME(void) SWIG_Perl_SetErrorf(const char *fmt, ...) { va_list args; va_start(args, fmt); @@ -824,6 +629,8 @@ SWIG_Perl_SetErrorf(const char *fmt, ...) { va_end(args); } +#endif + /* Macros for low-level exception handling */ #define SWIG_fail goto fail #define SWIG_croak(x) { SWIG_SetError(x); goto fail; } @@ -895,30 +702,9 @@ static void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (C } -static swig_module_info * -SWIG_Perl_GetModule() { - static void *type_pointer = (void *)0; - SV *pointer; - /* first check if pointer already created */ - if (!type_pointer) { - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE); - if (pointer && SvOK(pointer)) { - type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); - } - } - return (swig_module_info *) type_pointer; -} -static void -SWIG_Perl_SetModule(swig_module_info *module) { - SV *pointer; - - /* create a new pointer */ - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE); - sv_setiv(pointer, PTR2IV(module)); -} #ifdef do_open #undef do_open @@ -974,29 +760,13 @@ SWIG_Perl_SetModule(swig_module_info *module) { #ifdef ENTER #undef ENTER #endif -#ifdef read - #undef read -#endif -#ifdef write - #undef write -#endif -#ifdef eof - #undef eof -#endif -#ifdef bool - #undef bool -#endif - /* -------- TYPES TABLE (BEGIN) -------- */ -#define SWIGTYPE_p_switch_core_session_t swig_types[0] -#define SWIGTYPE_p_switch_input_callback_function_t swig_types[1] +#define SWIGTYPE_p_switch_core_session_t swig_types[0] +#define SWIGTYPE_p_switch_input_callback_function_t swig_types[1] static swig_type_info *swig_types[3]; -static swig_module_info swig_module = {swig_types, 2, 0, 0, 0, 0}; -#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) -#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) /* -------- TYPES TABLE (END) -------- */ @@ -1010,14 +780,31 @@ extern "C" #endif #ifndef PERL_OBJECT #ifndef MULTIPLICITY -SWIGEXPORT void SWIG_init (CV* cv); +SWIGEXPORT(void) SWIG_init (CV* cv); #else -SWIGEXPORT void SWIG_init (pTHXo_ CV* cv); +SWIGEXPORT(void) SWIG_init (pTHXo_ CV* cv); #endif #else -SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *); +SWIGEXPORT(void) SWIG_init (CV *cv, CPerlObj *); #endif +extern void fs_core_set_globals(void); +extern int fs_core_init(char *); +extern int fs_core_destroy(void); +extern int fs_loadable_module_init(void); +extern int fs_loadable_module_shutdown(void); +extern int fs_console_loop(void); +extern void fs_console_log(char *,char *); +extern void fs_console_clean(char *); +extern switch_core_session_t *fs_core_session_locate(char *); +extern void fs_channel_answer(switch_core_session_t *); +extern void fs_channel_pre_answer(switch_core_session_t *); +extern void fs_channel_hangup(switch_core_session_t *,char *); +extern void fs_channel_set_variable(switch_core_session_t *,char *,char *); +extern void fs_channel_get_variable(switch_core_session_t *,char *); +extern void fs_channel_set_state(switch_core_session_t *,char *); +extern int fs_ivr_play_file(switch_core_session_t *,char *,char *,switch_input_callback_function_t,void *,unsigned int); +extern int fs_ivr_play_file2(switch_core_session_t *,char *); #include @@ -1064,7 +851,7 @@ XS(_wrap_fs_core_set_globals) { XS(_wrap_fs_core_init) { { - char *arg1 = (char *) 0 ; + char *arg1 ; int result; int argvi = 0; dXSARGS; @@ -1172,16 +959,19 @@ XS(_wrap_fs_console_loop) { XS(_wrap_fs_console_log) { { - char *arg1 = (char *) 0 ; + char *arg1 ; + char *arg2 ; int argvi = 0; dXSARGS; - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: fs_console_log(msg);"); + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: fs_console_log(level_str,msg);"); } if (!SvOK((SV*) ST(0))) arg1 = 0; else arg1 = (char *) SvPV(ST(0), PL_na); - fs_console_log(arg1); + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + fs_console_log(arg1,arg2); XSRETURN(argvi); @@ -1194,7 +984,7 @@ XS(_wrap_fs_console_log) { XS(_wrap_fs_console_clean) { { - char *arg1 = (char *) 0 ; + char *arg1 ; int argvi = 0; dXSARGS; @@ -1216,7 +1006,7 @@ XS(_wrap_fs_console_clean) { XS(_wrap_fs_core_session_locate) { { - char *arg1 = (char *) 0 ; + char *arg1 ; switch_core_session_t *result; int argvi = 0; dXSARGS; @@ -1291,7 +1081,7 @@ XS(_wrap_fs_channel_pre_answer) { XS(_wrap_fs_channel_hangup) { { switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; - char *arg2 = (char *) 0 ; + char *arg2 ; int argvi = 0; dXSARGS; @@ -1319,8 +1109,8 @@ XS(_wrap_fs_channel_hangup) { XS(_wrap_fs_channel_set_variable) { { switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; + char *arg2 ; + char *arg3 ; int argvi = 0; dXSARGS; @@ -1350,7 +1140,7 @@ XS(_wrap_fs_channel_set_variable) { XS(_wrap_fs_channel_get_variable) { { switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; - char *arg2 = (char *) 0 ; + char *arg2 ; int argvi = 0; dXSARGS; @@ -1378,7 +1168,7 @@ XS(_wrap_fs_channel_get_variable) { XS(_wrap_fs_channel_set_state) { { switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; - char *arg2 = (char *) 0 ; + char *arg2 ; int argvi = 0; dXSARGS; @@ -1406,8 +1196,8 @@ XS(_wrap_fs_channel_set_state) { XS(_wrap_fs_ivr_play_file) { { switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; + char *arg2 ; + char *arg3 ; switch_input_callback_function_t arg4 ; void *arg5 = (void *) 0 ; unsigned int arg6 ; @@ -1452,36 +1242,59 @@ XS(_wrap_fs_ivr_play_file) { } +XS(_wrap_fs_ivr_play_file2) { + { + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + char *arg2 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: fs_ivr_play_file2(session,file);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_switch_core_session_t,0) < 0) { + SWIG_croak("Type error in argument 1 of fs_ivr_play_file2. Expected _p_switch_core_session_t"); + } + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + result = (int)fs_ivr_play_file2(arg1,arg2); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + ; + } + croak(Nullch); +} + + /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ -static swig_type_info _swigt__p_switch_core_session_t = {"_p_switch_core_session_t", "switch_core_session_t *", 0, 0, 0}; -static swig_type_info _swigt__p_switch_input_callback_function_t = {"_p_switch_input_callback_function_t", "switch_input_callback_function_t *", 0, 0, 0}; +static swig_type_info _swigt__p_switch_core_session_t[] = {{"_p_switch_core_session_t", 0, "switch_core_session_t *", 0},{"_p_switch_core_session_t"},{0}}; +static swig_type_info _swigt__p_switch_input_callback_function_t[] = {{"_p_switch_input_callback_function_t", 0, "switch_input_callback_function_t *", 0},{"_p_switch_input_callback_function_t"},{0}}; -static swig_type_info *swig_type_initial[] = { - &_swigt__p_switch_core_session_t, - &_swigt__p_switch_input_callback_function_t, -}; - -static swig_cast_info _swigc__p_switch_core_session_t[] = { {&_swigt__p_switch_core_session_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_switch_input_callback_function_t[] = { {&_swigt__p_switch_input_callback_function_t, 0, 0, 0},{0, 0, 0, 0}}; - -static swig_cast_info *swig_cast_initial[] = { - _swigc__p_switch_core_session_t, - _swigc__p_switch_input_callback_function_t, +static swig_type_info *swig_types_initial[] = { +_swigt__p_switch_core_session_t, +_swigt__p_switch_input_callback_function_t, +0 }; /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ static swig_constant_info swig_constants[] = { -{0,0,0,0,0,0} +{0} }; #ifdef __cplusplus } #endif static swig_variable_info swig_variables[] = { -{0,0,0,0} +{0} }; static swig_command_info swig_commands[] = { {"fs_perlc::fs_core_set_globals", _wrap_fs_core_set_globals}, @@ -1500,159 +1313,9 @@ static swig_command_info swig_commands[] = { {"fs_perlc::fs_channel_get_variable", _wrap_fs_channel_get_variable}, {"fs_perlc::fs_channel_set_state", _wrap_fs_channel_set_state}, {"fs_perlc::fs_ivr_play_file", _wrap_fs_ivr_play_file}, +{"fs_perlc::fs_ivr_play_file2", _wrap_fs_ivr_play_file2}, {0,0} }; -/************************************************************************* - * Type initialization: - * This problem is tough by the requirement that no dynamic - * memory is used. Also, since swig_type_info structures store pointers to - * swig_cast_info structures and swig_cast_info structures store pointers back - * to swig_type_info structures, we need some lookup code at initialization. - * The idea is that swig generates all the structures that are needed. - * The runtime then collects these partially filled structures. - * The SWIG_InitializeModule function takes these initial arrays out of - * swig_module, and does all the lookup, filling in the swig_module.types - * array with the correct data and linking the correct swig_cast_info - * structures together. - - * The generated swig_type_info structures are assigned staticly to an initial - * array. We just loop though that array, and handle each type individually. - * First we lookup if this type has been already loaded, and if so, use the - * loaded structure instead of the generated one. Then we have to fill in the - * cast linked list. The cast data is initially stored in something like a - * two-dimensional array. Each row corresponds to a type (there are the same - * number of rows as there are in the swig_type_initial array). Each entry in - * a column is one of the swig_cast_info structures for that type. - * The cast_initial array is actually an array of arrays, because each row has - * a variable number of columns. So to actually build the cast linked list, - * we find the array of casts associated with the type, and loop through it - * adding the casts to the list. The one last trick we need to do is making - * sure the type pointer in the swig_cast_info struct is correct. - - * First off, we lookup the cast->type name to see if it is already loaded. - * There are three cases to handle: - * 1) If the cast->type has already been loaded AND the type we are adding - * casting info to has not been loaded (it is in this module), THEN we - * replace the cast->type pointer with the type pointer that has already - * been loaded. - * 2) If BOTH types (the one we are adding casting info to, and the - * cast->type) are loaded, THEN the cast info has already been loaded by - * the previous module so we just ignore it. - * 3) Finally, if cast->type has not already been loaded, then we add that - * swig_cast_info to the linked list (because the cast->type) pointer will - * be correct. -**/ - -#ifdef __cplusplus -extern "C" { -#endif - - SWIGRUNTIME void - SWIG_InitializeModule(void *clientdata) { - swig_type_info *type, *ret; - swig_cast_info *cast; - size_t i; - swig_module_info *module_head; - static int init_run = 0; - - clientdata = clientdata; - - if (init_run) return; - init_run = 1; - - /* Initialize the swig_module */ - swig_module.type_initial = swig_type_initial; - swig_module.cast_initial = swig_cast_initial; - - /* Try and load any already created modules */ - module_head = SWIG_GetModule(clientdata); - if (module_head) { - swig_module.next = module_head->next; - module_head->next = &swig_module; - } else { - /* This is the first module loaded */ - swig_module.next = &swig_module; - SWIG_SetModule(clientdata, &swig_module); - } - - /* Now work on filling in swig_module.types */ - for (i = 0; i < swig_module.size; ++i) { - type = 0; - - /* if there is another module already loaded */ - if (swig_module.next != &swig_module) { - type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); - } - if (type) { - /* Overwrite clientdata field */ - if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata; - } else { - type = swig_module.type_initial[i]; - } - - /* Insert casting types */ - cast = swig_module.cast_initial[i]; - while (cast->type) { - /* Don't need to add information already in the list */ - ret = 0; - if (swig_module.next != &swig_module) { - ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); - } - if (ret && type == swig_module.type_initial[i]) { - cast->type = ret; - ret = 0; - } - - if (!ret) { - if (type->cast) { - type->cast->prev = cast; - cast->next = type->cast; - } - type->cast = cast; - } - - cast++; - } - - /* Set entry in modules->types array equal to the type */ - swig_module.types[i] = type; - } - swig_module.types[i] = 0; - } - - /* This function will propagate the clientdata field of type to - * any new swig_type_info structures that have been added into the list - * of equivalent types. It is like calling - * SWIG_TypeClientData(type, clientdata) a second time. - */ - SWIGRUNTIME void - SWIG_PropagateClientData(void) { - size_t i; - swig_cast_info *equiv; - static int init_run = 0; - - if (init_run) return; - init_run = 1; - - for (i = 0; i < swig_module.size; i++) { - if (swig_module.types[i]->clientdata) { - equiv = swig_module.types[i]->cast; - while (equiv) { - if (!equiv->converter) { - if (equiv->type && !equiv->type->clientdata) - SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); - } - equiv = equiv->next; - } - } - } - } - -#ifdef __cplusplus -} -#endif - - #ifdef __cplusplus extern "C" @@ -1661,8 +1324,13 @@ extern "C" XS(SWIG_init) { dXSARGS; int i; - - SWIG_InitializeModule(0); + static int _init = 0; + if (!_init) { + for (i = 0; swig_types_initial[i]; i++) { + swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]); + } + _init = 1; + } /* Install commands */ for (i = 0; swig_commands[i].name; i++) {