diff --git a/.drone.yml b/.drone.yml index 65b7222787..fd0d063ec3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -88,7 +88,6 @@ steps: - sed -i '/mod_rtmp/s/^/#/g' modules.conf - sed -i '/mod_skinny/s/^/#/g' modules.conf - sed -i '/mod_unimrcp/s/^/#/g' modules.conf - - sed -i '/mod_verto/s/^/#/g' modules.conf - sed -i '/mod_xml_rpc/s/^/#/g' modules.conf - ./configure - mkdir -p scan-build @@ -121,6 +120,6 @@ trigger: --- kind: signature -hmac: affb0747b0f16d9673cbbb327451c99fefc9dee2fd30b34b220bf147ad96a7be +hmac: cddd8905a309e3deb7e5859b11aa1ec3593410d9f32ce2f5de3a3557af88f80f ... diff --git a/src/mod/endpoints/mod_verto/Makefile.am b/src/mod/endpoints/mod_verto/Makefile.am index 4b8c144d65..dd54a32ee4 100644 --- a/src/mod/endpoints/mod_verto/Makefile.am +++ b/src/mod/endpoints/mod_verto/Makefile.am @@ -24,11 +24,11 @@ MCAST_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(PERL_LDFLAGS # install -m 755 mcast/MCAST.pm $(DESTDIR)$(PERL_SITEDIR) endif -mcast/esl_wrap.cpp: - cd mcast && swig -module MCAST -shadow -perl5 -c++ -DMULTIPLICITY -I../src/include -o mcast_wrap.cpp ../MCAST.i +mcast/mcast_wrap.cpp: + cd mcast && swig -module MCAST -shadow -perl5 -c++ -DMULTIPLICITY -I../src/include -o mcast_wrap.cpp MCAST.i mcast/perlxsi.c: - $(PERL) -MExtUtils::Embed -e xsinit -- -o perlxsi.c + $(PERL) -MExtUtils::Embed -e xsinit -- -o mcast/perlxsi.c clean-data-local: rm -f *.o *.so *~ diff --git a/src/mod/endpoints/mod_verto/mcast/MCAST.i b/src/mod/endpoints/mod_verto/mcast/MCAST.i index 097a52bc77..f8215233ff 100644 --- a/src/mod/endpoints/mod_verto/mcast/MCAST.i +++ b/src/mod/endpoints/mod_verto/mcast/MCAST.i @@ -1,3 +1,13 @@ +%begin %{ +#ifdef __clang_analyzer__ +#include +static int mystrcmp (const char *a, const char *b) { + return a == b ? 0 : !a ? -1 : !b ? 1 : strcmp(a, b); +} +#define strcmp mystrcmp +#endif +%} + %{ #include "mcast.h" #include "mcast_cpp.h" diff --git a/src/mod/endpoints/mod_verto/mcast/MCAST.pm b/src/mod/endpoints/mod_verto/mcast/MCAST.pm index dc2d01f1f7..ba72ccc8b0 100644 --- a/src/mod/endpoints/mod_verto/mcast/MCAST.pm +++ b/src/mod/endpoints/mod_verto/mcast/MCAST.pm @@ -1,16 +1,16 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.35 +# Version 3.0.12 # -# Don't modify this file, modify the SWIG interface instead. +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. package MCAST; -require Exporter; -require DynaLoader; -@ISA = qw(Exporter DynaLoader); +use base qw(Exporter); +use base qw(DynaLoader); package MCASTc; bootstrap MCAST; package MCAST; -@EXPORT = qw( ); +@EXPORT = qw(); # ---------- BASE METHODS ------------- diff --git a/src/mod/endpoints/mod_verto/mcast/mcast_wrap.cpp b/src/mod/endpoints/mod_verto/mcast/mcast_wrap.cpp index bae2665bb1..5473788de7 100644 --- a/src/mod/endpoints/mod_verto/mcast/mcast_wrap.cpp +++ b/src/mod/endpoints/mod_verto/mcast/mcast_wrap.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.35 + * Version 3.0.12 * * 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,22 +8,39 @@ * interface file instead. * ----------------------------------------------------------------------------- */ +#ifdef __clang_analyzer__ +#include +static int mystrcmp (const char *a, const char *b) { + return a == b ? 0 : !a ? -1 : !b ? 1 : strcmp(a, b); +} +#define strcmp mystrcmp +#endif + + + +#ifndef SWIGPERL #define SWIGPERL +#endif + #define SWIG_CASTRANK_MODE + #ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ template class SwigValueWrapper { - T *tt; + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } - SwigValueWrapper(const T& t) : tt(new T(t)) { } - ~SwigValueWrapper() { delete tt; } - SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } - operator T&() const { return *tt; } - T *operator&() { return tt; } -private: - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } }; template T SwigValueInit() { @@ -73,6 +90,12 @@ template T SwigValueInit() { # endif #endif +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + #ifndef SWIGUNUSEDPARM # ifdef __cplusplus # define SWIGUNUSEDPARM(p) @@ -92,9 +115,11 @@ template T SwigValueInit() { #endif /* exporting methods */ -#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif # endif #endif @@ -133,11 +158,24 @@ template T SwigValueInit() { # define _SCL_SECURE_NO_DEPRECATE #endif +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif /* ----------------------------------------------------------------------------- * swigrun.swg * - * This file contains generic CAPI SWIG runtime support for pointer + * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ @@ -156,11 +194,11 @@ template T SwigValueInit() { /* 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'. + 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. + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. */ #ifndef SWIGRUNTIME @@ -187,14 +225,14 @@ template T SwigValueInit() { /* Flags/methods for returning states. - The swig conversion methods, as ConvertPtr, return and integer + The SWIG conversion methods, as ConvertPtr, return an integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). Use the following macros/flags to set or process the returning states. - In old swig versions, you usually write code as: + In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code @@ -202,7 +240,7 @@ template T SwigValueInit() { //fail code } - Now you can be more explicit as: + Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { @@ -211,7 +249,7 @@ template T SwigValueInit() { // fail code } - that seems to be the same, but now you can also do + which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); @@ -229,7 +267,7 @@ template T SwigValueInit() { I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that - requires also to SWIG_ConvertPtr to return new result values, as + also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if () { @@ -247,7 +285,7 @@ template T SwigValueInit() { Of course, returning the plain '0(success)/-1(fail)' still works, but you can be more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - swig errors code. + SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code allows to return the 'cast rank', for example, if you have this @@ -261,9 +299,8 @@ template T SwigValueInit() { fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() +*/ - - */ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) @@ -288,7 +325,6 @@ template T SwigValueInit() { #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - /* Cast-Rank Mode */ #if defined(SWIG_CASTRANK_MODE) # ifndef SWIG_TypeRank @@ -306,13 +342,11 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; } #else /* no cast-rank mode */ -# define SWIG_AddCast +# define SWIG_AddCast(r) (r) # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) #endif - - #include #ifdef __cplusplus @@ -372,18 +406,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1, /* Check type equivalence in a name list like ||... - Return 0 if not equal, 1 if equal + Return 0 if equal, -1 if nb < tb, 1 if nb > tb */ SWIGRUNTIME int -SWIG_TypeEquiv(const char *nb, const char *tb) { - int equiv = 0; +SWIG_TypeCmp(const char *nb, const char *tb) { + int equiv = 1; const char* te = tb + strlen(tb); const char* ne = nb; - while (!equiv && *ne) { + while (equiv != 0 && *ne) { for (nb = ne; *ne; ++ne) { if (*ne == '|') break; } - equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + equiv = SWIG_TypeNameComp(nb, ne, tb, te); if (*ne) ++ne; } return equiv; @@ -391,58 +425,65 @@ SWIG_TypeEquiv(const char *nb, const char *tb) { /* Check type equivalence in a name list like ||... - Return 0 if equal, -1 if nb < tb, 1 if nb > tb + Return 0 if not equal, 1 if equal */ 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; - } - equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; - if (*ne) ++ne; - } - return equiv; +SWIG_TypeEquiv(const char *nb, const char *tb) { + return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 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); + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + 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; } -/* Same as previous function, except strcmp is replaced with a pointer comparison */ +/* + Identical to SWIG_TypeCheck, 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); +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + 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; } /* @@ -537,14 +578,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *iter = start; do { if (iter->size) { - register size_t l = 0; - register size_t r = iter->size - 1; + size_t l = 0; + size_t r = iter->size - 1; do { /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - register size_t i = (l + r) >> 1; + size_t i = (l + r) >> 1; const char *iname = iter->types[i]->name; if (iname) { - register int compare = strcmp(name, iname); + int compare = strcmp(name, iname); if (compare == 0) { return iter->types[i]; } else if (compare < 0) { @@ -588,7 +629,7 @@ SWIG_TypeQueryModule(swig_module_info *start, of the str field (the human readable name) */ swig_module_info *iter = start; do { - register size_t i = 0; + 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]; @@ -607,10 +648,10 @@ SWIG_TypeQueryModule(swig_module_info *start, 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; + const unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; for (; u != eu; ++u) { - register unsigned char uu = *u; + unsigned char uu = *u; *(c++) = hex[(uu & 0xf0) >> 4]; *(c++) = hex[uu & 0xf]; } @@ -622,22 +663,22 @@ SWIG_PackData(char *c, void *ptr, size_t sz) { */ 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; + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; for (; u != eu; ++u) { - register char d = *(c++); - register unsigned char uu; + char d = *(c++); + unsigned char uu; if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); + uu = (unsigned char)((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); + uu = (unsigned char)((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); + uu |= (unsigned char)(d - '0'); else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); + uu |= (unsigned char)(d - ('a'-10)); else return (char *) 0; *u = uu; @@ -817,7 +858,7 @@ extern "C" { #ifndef pTHX_ #define pTHX_ -#endif +#endif #include #ifdef __cplusplus @@ -830,50 +871,35 @@ extern "C" { SWIGINTERN const char* SWIG_Perl_ErrorType(int code) { - const char* type = 0; switch(code) { case SWIG_MemoryError: - type = "MemoryError"; - break; + return "MemoryError"; case SWIG_IOError: - type = "IOError"; - break; + return "IOError"; case SWIG_RuntimeError: - type = "RuntimeError"; - break; + return "RuntimeError"; case SWIG_IndexError: - type = "IndexError"; - break; + return "IndexError"; case SWIG_TypeError: - type = "TypeError"; - break; + return "TypeError"; case SWIG_DivisionByZero: - type = "ZeroDivisionError"; - break; + return "ZeroDivisionError"; case SWIG_OverflowError: - type = "OverflowError"; - break; + return "OverflowError"; case SWIG_SyntaxError: - type = "SyntaxError"; - break; + return "SyntaxError"; case SWIG_ValueError: - type = "ValueError"; - break; + return "ValueError"; case SWIG_SystemError: - type = "SystemError"; - break; + return "SystemError"; case SWIG_AttributeError: - type = "AttributeError"; - break; + return "AttributeError"; default: - type = "RuntimeError"; + return "RuntimeError"; } - return type; } - - /* ----------------------------------------------------------------------------- * perlrun.swg * @@ -894,7 +920,9 @@ SWIG_Perl_ErrorType(int code) { /* for raw pointers */ #define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags) +#define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own) #define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags) +#define swig_owntype int /* for raw packed data */ #define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type) @@ -915,15 +943,15 @@ SWIG_Perl_ErrorType(int code) { /* Runtime API */ -#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule() +#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule(clientdata) #define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer) /* Error manipulation */ -#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code) -#define SWIG_Error(code, msg) sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail +#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code) +#define SWIG_Error(code, msg) sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg) +#define SWIG_fail goto fail /* Perl-specific SWIG API */ @@ -961,15 +989,15 @@ extern "C" { #endif /* Macro to call an XS function */ -#ifdef PERL_OBJECT -# define SWIG_CALLXS(_name) _name(cv,pPerl) -#else -# ifndef MULTIPLICITY -# define SWIG_CALLXS(_name) _name(cv) -# else -# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) -# endif -#endif +#ifdef PERL_OBJECT +# define SWIG_CALLXS(_name) _name(cv,pPerl) +#else +# ifndef MULTIPLICITY +# define SWIG_CALLXS(_name) _name(cv) +# else +# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) +# endif +#endif #ifdef PERL_OBJECT #define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this; @@ -1016,35 +1044,32 @@ typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); #endif /* MULTIPLICITY */ #endif /* PERL_OBJECT */ -/* Workaround for bug in perl 5.6.x croak and earlier */ -#if (PERL_VERSION < 8) # ifdef PERL_OBJECT # define SWIG_croak_null() SWIG_Perl_croak_null(pPerl) -static void SWIG_Perl_croak_null(CPerlObj *pPerl) +static void SWIGUNUSED SWIG_Perl_croak_null(CPerlObj *pPerl) # else -static void SWIG_croak_null() +static void SWIGUNUSED SWIG_croak_null() # endif { - SV *err=ERRSV; + SV *err = get_sv("@", GV_ADD); # if (PERL_VERSION < 6) croak("%_", err); # else - if (SvOK(err) && !SvROK(err)) croak("%_", err); - croak(Nullch); + if (sv_isobject(err)) + croak(0); + else + croak("%s", SvPV_nolen(err)); # endif } -#else -# define SWIG_croak_null() croak(Nullch) -#endif -/* +/* Define how strict is the cast between strings and integers/doubles when overloading between these types occurs. - + The default is making it as strict as possible by using SWIG_AddCast when needed. - + You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to disable the SWIG_AddCast, making the casting between string and numbers less strict. @@ -1060,7 +1085,7 @@ static void SWIG_croak_null() #endif #ifdef SWIG_PERL_STRICT_STR2NUM /* string takes precedence */ -#define SWIG_Str2NumCast(x) SWIG_AddCast(x) +#define SWIG_Str2NumCast(x) SWIG_AddCast(x) #else /* number takes precedence */ #define SWIG_Str2NumCast(x) x @@ -1075,26 +1100,48 @@ SWIG_Perl_TypeProxyName(const swig_type_info *type) { if (!type) return NULL; if (type->clientdata != NULL) { return (const char*) type->clientdata; - } + } else { return type->name; } } +/* Identical to SWIG_TypeCheck, except for strcmp comparison */ SWIGRUNTIME swig_cast_info * SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) - || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty); + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) { + 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; } - /* Function for getting a pointer value */ SWIGRUNTIME int -SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) { +SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) { swig_cast_info *tc; void *voidptr = (void *)0; SV *tsv = 0; + + if (own) + *own = 0; + /* If magical, apply more magic */ if (SvGMAGICAL(sv)) mg_get(sv); @@ -1126,8 +1173,14 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info * return SWIG_OK; } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ if (!SvROK(sv)) { - *(ptr) = (void *) 0; - return SWIG_OK; + /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */ + if (SvIOK(sv)) { + return SWIG_ERROR; + } else { + /* NULL pointer (reference to undef). */ + *(ptr) = (void *) 0; + return SWIG_OK; + } } else { return SWIG_ERROR; } @@ -1138,32 +1191,40 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info * /* Now see if the types match */ char *_c = HvNAME(SvSTASH(SvRV(sv))); tc = SWIG_TypeProxyCheck(_c,_t); +#ifdef SWIG_DIRECTORS + if (!tc && !sv_derived_from(sv,SWIG_Perl_TypeProxyName(_t))) { +#else if (!tc) { +#endif return SWIG_ERROR; } { int newmemory = 0; *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ + if (newmemory == SWIG_CAST_NEW_MEMORY) { + assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ + if (own) + *own = *own | SWIG_CAST_NEW_MEMORY; + } } } else { *ptr = voidptr; } - /* + /* * DISOWN implementation: we need a perl guru to check this one. */ if (tsv && (flags & SWIG_POINTER_DISOWN)) { - /* + /* * almost copy paste code from below SWIG_POINTER_OWN setting */ SV *obj = sv; HV *stash = SvSTASH(SvRV(obj)); - GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE); + GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE); if (isGV(gv)) { HV *hv = GvHVn(gv); /* - * To set ownership (see below), a newSViv(1) entry is added. + * To set ownership (see below), a newSViv(1) entry is added. * Hence, to remove ownership, we delete the entry. */ if (hv_exists_ent(hv, obj, 0)) { @@ -1174,18 +1235,23 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info * return SWIG_OK; } +SWIGRUNTIME int +SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) { + return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0); +} + SWIGRUNTIME void SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) { - if (ptr && (flags & SWIG_SHADOW)) { + if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) { SV *self; SV *obj=newSV(0); HV *hash=newHV(); HV *stash; - sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr); + sv_setref_pv(obj, SWIG_Perl_TypeProxyName(t), ptr); stash=SvSTASH(SvRV(obj)); if (flags & SWIG_POINTER_OWN) { HV *hv; - GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE); + GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE); if (!isGV(gv)) gv_init(gv, stash, "OWNER", 5, FALSE); hv=GvHVn(gv); @@ -1199,7 +1265,7 @@ SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, i sv_bless(sv, stash); } else { - sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr); + sv_setref_pv(sv, SWIG_Perl_TypeProxyName(t), ptr); } } @@ -1290,19 +1356,23 @@ typedef struct { /* Magic variable code */ #ifndef PERL_OBJECT -#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c) - #ifndef MULTIPLICITY - SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) - #else - SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) - #endif +# ifdef __cplusplus +# define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast(a),b,c) +# else +# define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c) +# endif +# ifndef MULTIPLICITY +SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) +# else +SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) +# endif #else # define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c) -SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) +SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) #endif { MAGIC *mg; - sv_magic(sv,sv,'U',(char *) name,strlen(name)); + sv_magic(sv,sv,'U',name,strlen(name)); mg = mg_find(sv,'U'); mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); mg->mg_virtual->svt_get = (SwigMagicFunc) get; @@ -1314,7 +1384,7 @@ SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, i SWIGRUNTIME swig_module_info * -SWIG_Perl_GetModule(void) { +SWIG_Perl_GetModule(void *SWIGUNUSEDPARM(clientdata)) { static void *type_pointer = (void *)0; SV *pointer; @@ -1351,6 +1421,9 @@ SWIG_Perl_SetModule(swig_module_info *module) { #ifdef do_close #undef do_close #endif +#ifdef do_exec + #undef do_exec +#endif #ifdef scalar #undef scalar #endif @@ -1405,9 +1478,6 @@ SWIG_Perl_SetModule(swig_module_info *module) { #ifdef eof #undef eof #endif -#ifdef bool - #undef bool -#endif #ifdef close #undef close #endif @@ -1435,12 +1505,35 @@ SWIG_Perl_SetModule(swig_module_info *module) { #ifdef open #undef open #endif +#ifdef readdir + #undef readdir +#endif +#ifdef bind + #undef bind +#endif +#ifdef access + #undef access +#endif +#ifdef stat + #undef stat +#endif +#ifdef seed + #undef seed +#endif + +#ifdef bool + /* Leave if macro is from C99 stdbool.h */ + #ifndef __bool_true_false_are_defined + #undef bool + #endif +#endif -#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) -#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else +#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) + +#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else @@ -1448,8 +1541,10 @@ SWIG_Perl_SetModule(swig_module_info *module) { #define SWIGTYPE_p_McastHandle swig_types[0] #define SWIGTYPE_p_char swig_types[1] -static swig_type_info *swig_types[3]; -static swig_module_info swig_module = {swig_types, 2, 0, 0, 0, 0}; +#define SWIGTYPE_p_int16_t swig_types[2] +#define SWIGTYPE_p_mcast_socket_t swig_types[3] +static swig_type_info *swig_types[5]; +static swig_module_info swig_module = {swig_types, 4, 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) @@ -1460,12 +1555,12 @@ static swig_module_info swig_module = {swig_types, 2, 0, 0, 0, 0}; #define SWIG_name "MCASTc::boot_MCAST" #define SWIG_prefix "MCASTc::" -#define SWIGVERSION 0x010335 +#define SWIGVERSION 0x030012 #define SWIG_VERSION SWIGVERSION -#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) -#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) +#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) #include @@ -1505,14 +1600,19 @@ SWIG_pchar_descriptor(void) SWIGINTERN int SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) { + if (SvMAGICAL(obj)) { + SV *tmp = sv_newmortal(); + SvSetSV(tmp, obj); + obj = tmp; + } if (SvPOK(obj)) { STRLEN len = 0; - char *cstr = SvPV(obj, len); + char *cstr = SvPV(obj, len); size_t size = len + 1; if (cptr) { if (alloc) { if (*alloc == SWIG_NEWOBJ) { - *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size))); + *cptr = reinterpret_cast< char* >(memcpy(new char[size], cstr, sizeof(char)*(size))); } else { *cptr = cstr; *alloc = SWIG_OLDOBJ; @@ -1524,7 +1624,7 @@ SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) } else { swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); if (pchar_descriptor) { - char* vptr = 0; + char* vptr = 0; if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { if (cptr) *cptr = vptr; if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; @@ -1550,6 +1650,17 @@ SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) #endif +#include +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + SWIGINTERN int SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val) { @@ -1563,7 +1674,9 @@ SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val) const char *nptr = SvPV_nolen(obj); if (nptr) { char *endptr; - double v = strtod(nptr, &endptr); + double v; + errno = 0; + v = strtod(nptr, &endptr); if (errno == ERANGE) { errno = 0; return SWIG_OverflowError; @@ -1618,9 +1731,20 @@ SWIG_CanCastAsInteger(double *d, double min, double max) { SWIGINTERN int SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val) { - if (SvIOK(obj)) { - if (val) *val = SvIV(obj); - return SWIG_OK; + if (SvUOK(obj)) { + UV v = SvUV(obj); + if (UVSIZE < sizeof(*val) || v <= LONG_MAX) { + if (val) *val = v; + return SWIG_OK; + } + return SWIG_OverflowError; + } else if (SvIOK(obj)) { + IV v = SvIV(obj); + if (IVSIZE <= sizeof(*val) || (v >= LONG_MIN && v <= LONG_MAX)) { + if(val) *val = v; + return SWIG_OK; + } + return SWIG_OverflowError; } else { int dispatch = 0; const char *nptr = SvPV_nolen(obj); @@ -1663,7 +1787,7 @@ SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val) } else { if (val) *val = static_cast< int >(v); } - } + } return res; } @@ -1671,15 +1795,18 @@ SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val) SWIGINTERNINLINE SV * SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value) { - SV *obj = sv_newmortal(); - sv_setiv(obj, (IV) value); - return obj; + SV *sv; + if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX)) + sv = newSViv(value); + else + sv = newSVpvf("%ld", value); + return sv_2mortal(sv); } SWIGINTERNINLINE SV * SWIG_From_int SWIG_PERL_DECL_ARGS_1(int value) -{ +{ return SWIG_From_long SWIG_PERL_CALL_ARGS_1(value); } @@ -1697,9 +1824,9 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) } -SWIGINTERNINLINE SV * +SWIGINTERNINLINE SV * SWIG_FromCharPtr(const char *cptr) -{ +{ return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); } @@ -1735,19 +1862,19 @@ extern "C" { XS(_wrap_new_McastHandle) { { char *arg1 = (char *) 0 ; - int arg2 ; + int16_t arg2 ; int arg3 ; - McastHandle *result = 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - int val2 ; - int ecode2 = 0 ; + void *argp2 ; + int res2 = 0 ; int val3 ; int ecode3 = 0 ; int argvi = 0; + McastHandle *result = 0 ; dXSARGS; - + if ((items < 3) || (items > 3)) { SWIG_croak("Usage: new_McastHandle(host,port,flags);"); } @@ -1756,26 +1883,30 @@ XS(_wrap_new_McastHandle) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_McastHandle" "', argument " "1"" of type '" "char const *""'"); } arg1 = reinterpret_cast< char * >(buf1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_McastHandle" "', argument " "2"" of type '" "int""'"); + { + res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_int16_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_McastHandle" "', argument " "2"" of type '" "int16_t""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_McastHandle" "', argument " "2"" of type '" "int16_t""'"); + } else { + arg2 = *(reinterpret_cast< int16_t * >(argp2)); + } } - arg2 = static_cast< int >(val2); ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_McastHandle" "', argument " "3"" of type '" "int""'"); - } + } arg3 = static_cast< int >(val3); result = (McastHandle *)new McastHandle((char const *)arg1,arg2,arg3); ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_McastHandle, SWIG_OWNER | SWIG_SHADOW); argvi++ ; if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - - + XSRETURN(argvi); fail: if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - - + SWIG_croak_null(); } } @@ -1788,22 +1919,21 @@ XS(_wrap_delete_McastHandle) { int res1 = 0 ; int argvi = 0; dXSARGS; - + if ((items < 1) || (items > 1)) { SWIG_croak("Usage: delete_McastHandle(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_McastHandle, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_McastHandle" "', argument " "1"" of type '" "McastHandle *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_McastHandle" "', argument " "1"" of type '" "McastHandle *""'"); } arg1 = reinterpret_cast< McastHandle * >(argp1); delete arg1; - - - + ST(argvi) = sv_newmortal(); + XSRETURN(argvi); fail: - + SWIG_croak_null(); } } @@ -1813,21 +1943,21 @@ XS(_wrap_McastHandle_send) { { McastHandle *arg1 = (McastHandle *) 0 ; char *arg2 = (char *) 0 ; - int result; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; int argvi = 0; + int result; dXSARGS; - + if ((items < 2) || (items > 2)) { SWIG_croak("Usage: McastHandle_send(self,data);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_McastHandle, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "McastHandle_send" "', argument " "1"" of type '" "McastHandle *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "McastHandle_send" "', argument " "1"" of type '" "McastHandle *""'"); } arg1 = reinterpret_cast< McastHandle * >(argp1); res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); @@ -1837,11 +1967,11 @@ XS(_wrap_McastHandle_send) { arg2 = reinterpret_cast< char * >(buf2); result = (int)(arg1)->send((char const *)arg2); ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; XSRETURN(argvi); fail: - + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; SWIG_croak_null(); } @@ -1852,37 +1982,37 @@ XS(_wrap_McastHandle_recv) { { McastHandle *arg1 = (McastHandle *) 0 ; int arg2 = (int) 0 ; - char *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int argvi = 0; + char *result = 0 ; dXSARGS; - + if ((items < 1) || (items > 2)) { SWIG_croak("Usage: McastHandle_recv(self,ms);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_McastHandle, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "McastHandle_recv" "', argument " "1"" of type '" "McastHandle *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "McastHandle_recv" "', argument " "1"" of type '" "McastHandle *""'"); } arg1 = reinterpret_cast< McastHandle * >(argp1); if (items > 1) { ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "McastHandle_recv" "', argument " "2"" of type '" "int""'"); - } + } arg2 = static_cast< int >(val2); } result = (char *)(arg1)->recv(arg2); ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - + + XSRETURN(argvi); fail: - - + + SWIG_croak_null(); } } @@ -1891,26 +2021,26 @@ XS(_wrap_McastHandle_recv) { XS(_wrap_McastHandle_filenum) { { McastHandle *arg1 = (McastHandle *) 0 ; - int result; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; + mcast_socket_t result; dXSARGS; - + if ((items < 1) || (items > 1)) { SWIG_croak("Usage: McastHandle_filenum(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_McastHandle, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "McastHandle_filenum" "', argument " "1"" of type '" "McastHandle *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "McastHandle_filenum" "', argument " "1"" of type '" "McastHandle *""'"); } arg1 = reinterpret_cast< McastHandle * >(argp1); - result = (int)(arg1)->filenum(); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - + result = (arg1)->filenum(); + ST(argvi) = SWIG_NewPointerObj((new mcast_socket_t(static_cast< const mcast_socket_t& >(result))), SWIGTYPE_p_mcast_socket_t, SWIG_POINTER_OWN | 0); argvi++ ; + XSRETURN(argvi); fail: - + SWIG_croak_null(); } } @@ -1921,18 +2051,26 @@ XS(_wrap_McastHandle_filenum) { static swig_type_info _swigt__p_McastHandle = {"_p_McastHandle", "McastHandle *", 0, 0, (void*)"MCAST::McastHandle", 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int16_t = {"_p_int16_t", "int16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_mcast_socket_t = {"_p_mcast_socket_t", "mcast_socket_t *", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { &_swigt__p_McastHandle, &_swigt__p_char, + &_swigt__p_int16_t, + &_swigt__p_mcast_socket_t, }; static swig_cast_info _swigc__p_McastHandle[] = { {&_swigt__p_McastHandle, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int16_t[] = { {&_swigt__p_int16_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_mcast_socket_t[] = { {&_swigt__p_mcast_socket_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info *swig_cast_initial[] = { _swigc__p_McastHandle, _swigc__p_char, + _swigc__p_int16_t, + _swigc__p_mcast_socket_t, }; @@ -1968,7 +2106,7 @@ static swig_command_info swig_commands[] = { * 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 + * The generated swig_type_info structures are assigned statically to an initial * array. We just loop through 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 @@ -2012,10 +2150,8 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found, init; - - clientdata = clientdata; - + int init; + /* check to see if the circular list has been setup, if not, set it up */ if (swig_module.next==0) { /* Initialize the swig_module */ @@ -2026,39 +2162,35 @@ SWIG_InitializeModule(void *clientdata) { } else { init = 0; } - + /* Try and load any already created modules */ module_head = SWIG_GetModule(clientdata); if (!module_head) { /* This is the first module loaded for this interpreter */ /* so set the swig module into the interpreter */ SWIG_SetModule(clientdata, &swig_module); - module_head = &swig_module; } else { /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - found=0; iter=module_head; do { if (iter==&swig_module) { - found=1; - break; + /* Our module is already in the list, so there's nothing more to do. */ + return; } iter=iter->next; } while (iter!= module_head); - - /* if the is found in the list, then all is done and we may leave */ - if (found) return; - /* otherwise we must add out module into the list */ + + /* otherwise we must add our module into the list */ swig_module.next = module_head->next; module_head->next = &swig_module; } - - /* When multiple interpeters are used, a module could have already been initialized in + + /* When multiple interpreters are used, a module could have already been initialized in a different interpreter, but not yet have a pointer in this interpreter. In this case, we do not want to continue adding types... everything should be set up already */ if (init == 0) return; - + /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); @@ -2067,11 +2199,11 @@ SWIG_InitializeModule(void *clientdata) { swig_type_info *type = 0; swig_type_info *ret; swig_cast_info *cast; - + #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); #endif - + /* 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); @@ -2090,7 +2222,7 @@ SWIG_InitializeModule(void *clientdata) { } else { type = swig_module.type_initial[i]; } - + /* Insert casting types */ cast = swig_module.cast_initial[i]; while (cast->type) { @@ -2121,7 +2253,7 @@ SWIG_InitializeModule(void *clientdata) { if (!ocast) ret = 0; } } - + if (!ret) { #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); @@ -2138,7 +2270,7 @@ SWIG_InitializeModule(void *clientdata) { swig_module.types[i] = type; } swig_module.types[i] = 0; - + #ifdef SWIGRUNTIME_DEBUG printf("**** SWIG_InitializeModule: Cast List ******\n"); for (i = 0; i < swig_module.size; ++i) { @@ -2166,10 +2298,10 @@ 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; @@ -2194,37 +2326,43 @@ SWIG_PropagateClientData(void) { -#ifdef __cplusplus +#if defined(__cplusplus) && ! defined(XSPROTO) extern "C" #endif XS(SWIG_init) { dXSARGS; int i; - + (void)items; + SWIG_InitializeModule(0); - + /* Install commands */ for (i = 0; swig_commands[i].name; i++) { - newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__); + /* Casts only needed for Perl < 5.10. */ +#ifdef __cplusplus + newXS(const_cast(swig_commands[i].name), swig_commands[i].wrapper, const_cast(__FILE__)); +#else + newXS((char*)swig_commands[i].name, swig_commands[i].wrapper, (char*)__FILE__); +#endif } - + /* Install variables */ for (i = 0; swig_variables[i].name; i++) { SV *sv; - sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); + sv = get_sv(swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); if (swig_variables[i].type) { SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); } else { sv_setiv(sv,(IV) 0); } - swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); + swig_create_magic(sv, swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); } - + /* Install constant */ for (i = 0; swig_constants[i].type; i++) { SV *sv; - sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); + sv = get_sv(swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); switch(swig_constants[i].type) { case SWIG_INT: sv_setiv(sv, (IV) swig_constants[i].lvalue); @@ -2233,7 +2371,7 @@ XS(SWIG_init) { sv_setnv(sv, (double) swig_constants[i].dvalue); break; case SWIG_STRING: - sv_setpv(sv, (char *) swig_constants[i].pvalue); + sv_setpv(sv, (const char *) swig_constants[i].pvalue); break; case SWIG_POINTER: SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); @@ -2246,7 +2384,7 @@ XS(SWIG_init) { } SvREADONLY_on(sv); } - + SWIG_TypeClientData(SWIGTYPE_p_McastHandle, (void*) "MCAST::McastHandle"); ST(0) = &PL_sv_yes; XSRETURN(1); diff --git a/src/mod/endpoints/mod_verto/mcast/perlxsi.c b/src/mod/endpoints/mod_verto/mcast/perlxsi.c index 9ca8fc1fb1..f11b766af5 100644 --- a/src/mod/endpoints/mod_verto/mcast/perlxsi.c +++ b/src/mod/endpoints/mod_verto/mcast/perlxsi.c @@ -1,5 +1,6 @@ -#include -#include +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" EXTERN_C void xs_init (pTHX); @@ -8,9 +9,10 @@ EXTERN_C void boot_DynaLoader (pTHX_ CV* cv); EXTERN_C void xs_init(pTHX) { - char *file = __FILE__; - dXSUB_SYS; + static const char file[] = __FILE__; + dXSUB_SYS; + PERL_UNUSED_CONTEXT; - /* DynaLoader is a special case */ - newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); + /* DynaLoader is a special case */ + newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); }