- SWIG_croak_null();
- }
-}
-
-
-XS(_wrap_Device_accept) {
- {
- Device *arg1 = (Device *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int argvi = 0;
- DirectTCPConnection *result = 0 ;
- dXSARGS;
-
- if ((items < 1) || (items > 1)) {
- SWIG_croak("Usage: Device_accept(self);");
- }
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_accept" "', argument " "1"" of type '" "Device *""'");
- }
- arg1 = (Device *)(argp1);
- result = (DirectTCPConnection *)Device_accept(arg1);
- ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirectTCPConnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
-
- XSRETURN(argvi);
- fail:
-
- SWIG_croak_null();
- }
-}
-
-
-XS(_wrap_Device_accept_with_cond) {
- {
- Device *arg1 = (Device *) 0 ;
- GMutex *arg2 = (GMutex *) 0 ;
- GCond *arg3 = (GCond *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- void *argp2 = 0 ;
- int res2 = 0 ;
- void *argp3 = 0 ;
- int res3 = 0 ;
- int argvi = 0;
- DirectTCPConnection *result = 0 ;
- dXSARGS;
-
- if ((items < 3) || (items > 3)) {
- SWIG_croak("Usage: Device_accept_with_cond(self,abort_mutex,abort_cond);");
- }
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_accept_with_cond" "', argument " "1"" of type '" "Device *""'");
- }
- arg1 = (Device *)(argp1);
- res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GMutex, 0 | 0 );
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_accept_with_cond" "', argument " "2"" of type '" "GMutex *""'");
- }
- arg2 = (GMutex *)(argp2);
- res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_GCond, 0 | 0 );
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_accept_with_cond" "', argument " "3"" of type '" "GCond *""'");
- }
- arg3 = (GCond *)(argp3);
- result = (DirectTCPConnection *)Device_accept_with_cond(arg1,arg2,arg3);
- ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirectTCPConnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
-
-
-
- XSRETURN(argvi);
- fail:
-
-
-
- SWIG_croak_null();
- }
-}
-
-
-XS(_wrap_Device_connect) {
- {
- Device *arg1 = (Device *) 0 ;
- gboolean arg2 ;
- DirectTCPAddr *arg3 = (DirectTCPAddr *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int argvi = 0;
- DirectTCPConnection *result = 0 ;
- dXSARGS;
-
- if ((items < 3) || (items > 3)) {
- SWIG_croak("Usage: Device_connect(self,for_writing,addrs);");
- }
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_connect" "', argument " "1"" of type '" "Device *""'");
- }
- arg1 = (Device *)(argp1);
- {
- arg2 = SvTRUE(ST(1));
- }
- {
- AV *addrs_av;
- int num_addrs, i;
-
- if (!SvROK(ST(2)) || SvTYPE(SvRV(ST(2))) != SVt_PVAV) {
- SWIG_exception_fail(SWIG_TypeError, "must provide an arrayref of DirectTCPAddrs");
- }
- addrs_av = (AV *)SvRV(ST(2));
- num_addrs = av_len(addrs_av)+1;
-
- arg3 = g_new0(DirectTCPAddr, num_addrs+1);
-
- for (i = 0; i < num_addrs; i++) {
- SV **svp = av_fetch(addrs_av, i, 0);
- AV *addr_av;
- sockaddr_union addr;
- IV port;
-
- if (!svp || !SvROK(*svp) || SvTYPE(SvRV(*svp)) != SVt_PVAV
- || av_len((AV *)SvRV(*svp))+1 != 2) {
- SWIG_exception_fail(SWIG_TypeError, "each DirectTCPAddr must be a 2-element arrayref");
- }
-
- addr_av = (AV *)SvRV(*svp);
-
- /* get address */
- svp = av_fetch(addr_av, 0, 0);
- if (!svp || !SvPOK(*svp) || !str_to_sockaddr(SvPV_nolen(*svp), &addr)) {
- SWIG_exception_fail(SWIG_TypeError, "invalid IPv4 addr in address");
- }
-
- /* get port */
- svp = av_fetch(addr_av, 1, 0);
- if (!svp || !SvIOK(*svp) || (port = SvIV(*svp)) <= 0 || port >= 65536) {
- SWIG_exception_fail(SWIG_TypeError, "invalid port in address");
- }
- SU_SET_PORT(&addr, port);
-
- copy_sockaddr(arg3, &addr);
- }
- }
- result = (DirectTCPConnection *)Device_connect(arg1,arg2,arg3);
- ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirectTCPConnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
-
-
-
- XSRETURN(argvi);
- fail:
-
-
-
- SWIG_croak_null();
- }
-}
-
-
-XS(_wrap_Device_connect_with_cond) {
- {
- Device *arg1 = (Device *) 0 ;
- gboolean arg2 ;
- DirectTCPAddr *arg3 = (DirectTCPAddr *) 0 ;
- GMutex *arg4 = (GMutex *) 0 ;
- GCond *arg5 = (GCond *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- void *argp4 = 0 ;
- int res4 = 0 ;
- void *argp5 = 0 ;
- int res5 = 0 ;
- int argvi = 0;
- DirectTCPConnection *result = 0 ;
- dXSARGS;
-
- if ((items < 5) || (items > 5)) {
- SWIG_croak("Usage: Device_connect_with_cond(self,for_writing,addrs,abort_mutex,abort_cond);");
- }
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_connect_with_cond" "', argument " "1"" of type '" "Device *""'");
- }
- arg1 = (Device *)(argp1);
- {
- arg2 = SvTRUE(ST(1));
- }
- {
- AV *addrs_av;
- int num_addrs, i;
-
- if (!SvROK(ST(2)) || SvTYPE(SvRV(ST(2))) != SVt_PVAV) {
- SWIG_exception_fail(SWIG_TypeError, "must provide an arrayref of DirectTCPAddrs");
- }
- addrs_av = (AV *)SvRV(ST(2));
- num_addrs = av_len(addrs_av)+1;
-
- arg3 = g_new0(DirectTCPAddr, num_addrs+1);
-
- for (i = 0; i < num_addrs; i++) {
- SV **svp = av_fetch(addrs_av, i, 0);
- AV *addr_av;
- sockaddr_union addr;
- IV port;
-
- if (!svp || !SvROK(*svp) || SvTYPE(SvRV(*svp)) != SVt_PVAV
- || av_len((AV *)SvRV(*svp))+1 != 2) {
- SWIG_exception_fail(SWIG_TypeError, "each DirectTCPAddr must be a 2-element arrayref");
- }
-
- addr_av = (AV *)SvRV(*svp);
-
- /* get address */
- svp = av_fetch(addr_av, 0, 0);
- if (!svp || !SvPOK(*svp) || !str_to_sockaddr(SvPV_nolen(*svp), &addr)) {
- SWIG_exception_fail(SWIG_TypeError, "invalid IPv4 addr in address");
- }
-
- /* get port */
- svp = av_fetch(addr_av, 1, 0);
- if (!svp || !SvIOK(*svp) || (port = SvIV(*svp)) <= 0 || port >= 65536) {
- SWIG_exception_fail(SWIG_TypeError, "invalid port in address");
- }
- SU_SET_PORT(&addr, port);
-
- copy_sockaddr(arg3, &addr);
- }
- }
- res4 = SWIG_ConvertPtr(ST(3), &argp4,SWIGTYPE_p_GMutex, 0 | 0 );
- if (!SWIG_IsOK(res4)) {
- SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Device_connect_with_cond" "', argument " "4"" of type '" "GMutex *""'");
- }
- arg4 = (GMutex *)(argp4);
- res5 = SWIG_ConvertPtr(ST(4), &argp5,SWIGTYPE_p_GCond, 0 | 0 );
- if (!SWIG_IsOK(res5)) {
- SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Device_connect_with_cond" "', argument " "5"" of type '" "GCond *""'");
- }
- arg5 = (GCond *)(argp5);
- result = (DirectTCPConnection *)Device_connect_with_cond(arg1,arg2,arg3,arg4,arg5);
- ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirectTCPConnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
-
-
-
-
-
- XSRETURN(argvi);
- fail:
-
-
-
-
-