diff options
Diffstat (limited to 'bindings/perl/src')
-rw-r--r-- | bindings/perl/src/CMakeLists.txt | 25 | ||||
-rw-r--r-- | bindings/perl/src/Libproxy.xs | 98 | ||||
-rw-r--r-- | bindings/perl/src/doxsubpp.pl | 23 | ||||
-rw-r--r-- | bindings/perl/src/typemap | 2 |
4 files changed, 0 insertions, 148 deletions
diff --git a/bindings/perl/src/CMakeLists.txt b/bindings/perl/src/CMakeLists.txt deleted file mode 100644 index 2800a85..0000000 --- a/bindings/perl/src/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -include_directories( ${PERL_INCLUDE_PATH} ${CMAKE_SOURCE_DIR}/libproxy ) - -# Run doxsubpp.pl to run xsubpp on Libproxy.xs -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Libproxy.c - COMMAND ${PERL_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/doxsubpp.pl - ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Libproxy.xs ${CMAKE_CURRENT_BINARY_DIR}/Libproxy.c - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Libproxy.xs libproxy - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - -set(Libproxy_LIB_SRCS Libproxy.c) - -set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/perl/auto/Net/Libproxy) -add_library(PLlibproxy SHARED ${Libproxy_LIB_SRCS}) - -set(PLlibproxy_LIB_DEPENDENCIES libproxy pthread) -if(PERL_LINK_LIBPERL) - set(PLlibproxy_LIB_DEPENDENCIES ${PERL_LIBRARY} ${PLlibproxy_LIB_DEPENDENCIES}) -endif() - -target_link_libraries(PLlibproxy ${PLlibproxy_LIB_DEPENDENCIES}) -target_compile_options(PLlibproxy PRIVATE ${PX_PERL_CCFLAGS}) -set_target_properties(PLlibproxy PROPERTIES OUTPUT_NAME "Libproxy") -set_target_properties(PLlibproxy PROPERTIES PREFIX "") - -install( TARGETS PLlibproxy DESTINATION ${PX_PERL_ARCH}/auto/Net/Libproxy ) diff --git a/bindings/perl/src/Libproxy.xs b/bindings/perl/src/Libproxy.xs deleted file mode 100644 index bf5c2bb..0000000 --- a/bindings/perl/src/Libproxy.xs +++ /dev/null @@ -1,98 +0,0 @@ -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -#include <proxy.h> - - -void XS_pack_charPtrPtr( SV * arg, char ** array, int count) { - int i; - AV * avref; - avref = (AV*)sv_2mortal((SV*)newAV()); - for (i=0; i<count; i++) { - av_push(avref, newSVpv(array[i], strlen(array[i]))); - } - SvSetSV( arg, newRV((SV*)avref)); -} - -/* http://www.perlmonks.org/?node_id=680842 */ -static char ** -XS_unpack_charPtrPtr (SV *arg) { - char **ret; - AV *av; - I32 i; - - if (!arg || !SvOK (arg) || !SvROK (arg) || SvTYPE (SvRV (arg)) != SVt_PVAV) - croak ("array reference expected"); - - av = (AV *)SvRV (arg); - ret = malloc ((av_len (av) + 1 + 1) * sizeof (char *)); - if (!ret) - croak ("malloc failed"); - - for (i = 0; i <= av_len (av); i++) { - SV **elem = av_fetch (av, i, 0); - - if (!elem || !*elem) { - free (ret); - croak ("missing element in list"); - } - - ret[i] = SvPV_nolen (*elem); - } - - ret[i] = NULL; - - return ret; -} - - -MODULE = Net::Libproxy PACKAGE = Net::Libproxy - -PROTOTYPES: DISABLE - -pxProxyFactory * -proxy_factory_new() - PREINIT: - pxProxyFactory *pf; - CODE: - pf = px_proxy_factory_new(); - RETVAL = pf; - OUTPUT: - RETVAL - -char ** -proxy_factory_get_proxies(pf, url) - pxProxyFactory * pf - char * url - PREINIT: - char ** array; - int count_charPtrPtr; - int i; - CODE: - array = px_proxy_factory_get_proxies(pf, url); - RETVAL = array; - i = 0; - while( array[i] != NULL ) { - i++; - } - count_charPtrPtr = i; - OUTPUT: - RETVAL - -void -proxy_factory_free_proxies(proxies) - char ** proxies - CODE: - px_proxy_factory_free_proxies(proxies); - -MODULE = Net::Libproxy PACKAGE = Net::Libproxy::ProxyFactoryPtr - -void -DESTROY(pf) - pxProxyFactory * pf - CODE: - printf("Net::Libproxy::DESTROY\n"); - px_proxy_factory_free(pf); - - diff --git a/bindings/perl/src/doxsubpp.pl b/bindings/perl/src/doxsubpp.pl deleted file mode 100644 index 57ab4dd..0000000 --- a/bindings/perl/src/doxsubpp.pl +++ /dev/null @@ -1,23 +0,0 @@ -use strict; -use warnings; -use ExtUtils::MakeMaker; - -my $perl = $ARGV[0]; -my $in = $ARGV[1]; -my $out = $ARGV[2]; - -my $mm = ExtUtils::MakeMaker->new( { - NAME => 'Libproxy', - NEEDS_LINKING => 1, -} ); - -my $perl_include_path = $mm->{PERL_INC}; -my @xsubinfo = split "\n", $mm->tool_xsubpp(); - -my $xsubppdir = (map{ my $foo = $_; $foo =~ s/XSUBPPDIR = //; $foo } grep{ m/^XSUBPPDIR =/ } @xsubinfo)[0]; -my $xsubpp = "$xsubppdir/xsubpp"; - -my $xsubppargs = (map{ my $foo = $_; $foo =~ s/XSUBPPARGS = //; $foo } grep{ m/^XSUBPPARGS =/ } @xsubinfo)[0]; - -my $cmd = "$perl $xsubpp $xsubppargs -typemap typemap $in > $out"; -system $cmd; diff --git a/bindings/perl/src/typemap b/bindings/perl/src/typemap deleted file mode 100644 index 62be990..0000000 --- a/bindings/perl/src/typemap +++ /dev/null @@ -1,2 +0,0 @@ -TYPEMAP -pxProxyFactory * T_PTROBJ |