Questions tagged [xs]

XS is a language extension for Perl that can wrap a C library to make it a Perl library.

The documentation is available at http://perldoc.perl.org/perlxs.html.

The characters "xs" are also a commonly-used name for the XML Schema namespace. Questions about XML Schema should use .

130 questions
1
vote
1 answer

Why are static variables in an xsub not thread safe?

According to perldoc threads: Since Perl 5.8, thread programming has been available using a model called interpreter threads which provides a new Perl interpreter for each thread, and, by default, results in no data or state information being…
Håkon Hægland
  • 39,012
  • 21
  • 81
  • 174
1
vote
2 answers

OpenSSL and Threads in Perl XS

I am working with OpenSSL inside a Perl-XS-Module. I have a C-function that calls OpenSSL-API-functions. It is very simple for test-purposes (init openssl, read a key, make the RSA-object and use it, no arguments). No big checks needed and addresses…
chris01
  • 10,921
  • 9
  • 54
  • 93
1
vote
1 answer

JSON::XS under mod_perl fails with POST requests

I am using the default install of Apache and mod_perl on Ubuntu 16.04.1 LTS, I also have reproduced this with the default JSON::XS and I updated to the latest from CPAN JSON-XS-3.02. The code below works in all cases if I am not using mod_perl. …
Severun
  • 2,893
  • 1
  • 16
  • 22
1
vote
1 answer

How do I turn the Perl stack into an AV?

NOTE: This is a question about the Perl internals, the C code itself. I want to pass the contents of the Perl stack (ie. SP) as an array to a Perl function. Is there an existing way to copy the stack into an AV? If not, how would one accomplish it?…
Schwern
  • 153,029
  • 25
  • 195
  • 336
1
vote
2 answers

XS typemap for intptr_t

I'm trying to return an intptr_t type from some XS code: intptr_t my_func( self ) myObjPtr self CODE: RETVAL = (intptr_t) self; OUTPUT: RETVAL My typemap doesn't have anything about intptr_t, so of course dmake fails…
Nate Glenn
  • 6,455
  • 8
  • 52
  • 95
1
vote
0 answers

Inline::CPP/Inline::C - debug code

I'm trying to use some proprietary C++ code in a Perl module. I have seen it is easy to debug if something goes wrong at compiling time by just enabling the BUILD_NOISY flag. In my case the problem comes at running time...the code C++ works fine…
barbasa
  • 675
  • 4
  • 22
1
vote
2 answers

How do I use tied filehandles from Perl XS code?

The following minimal example defines a wrapper around PerlIO_write: MODULE = My::FH PACKAGE = My::FH INCLUDE: const-xs.inc int write_fh (SV* fh, SV* str) CODE: STRLEN len char* buf = SvPV(str, len); PerlIO* io = IoIFP(sv_2io(fh)); if (io) { …
hillu
  • 9,423
  • 4
  • 26
  • 30
1
vote
1 answer

perlembed/perlcall example unbounded memory growth - valgrind says no leaks possible

all. I've been banging my head up against this one for a while... I'm trying to put together an example of basically perlembed + perlcall and more or less "borrowed" it from evpsgi. The problem is that it grows about 1MB in size for every 1000…
bennymack
  • 33
  • 4
1
vote
2 answers

Why can't my Perl object find its skip() method, even though I can call it as a subroutine?

I'm working on a Perl module and whenever I call the skip() method I wrote in the following way: $cursor->skip(4); I get: Undefined subroutine &MyModule::Cursor::skip called at t/tester.pl line 24. (in cleanup) invalid object at…
kris
  • 23,024
  • 10
  • 70
  • 79
0
votes
1 answer

Changing character encoding for embedded Vaadin application

I need to embed Vaadin app in a third party web page. Web server and application server are in different domains. Due to the nature of the application, using iframe is not an option. So I used VaadinXS add-on and embeded application inside a…
David Goshadze
  • 1,439
  • 12
  • 16
0
votes
1 answer

how to alleviate local::lib troubles after system/perl upgrade?

our system admin recently upgraded my OS and perl (to 5.12.3). when I load up the local::lib environment variables, it appears to break anything that depends on xs: demianshell~> perl -e 'use Storable; store({a=>1}, 'test')' demianshell~> eval…
Demian
  • 215
  • 2
  • 9
0
votes
1 answer

Execution of Perl Script XS module

I am trying to run my Perl Script but am getting the following error: /home/nippyi8v/perl5/lib/perl5/x86_64-linux-thread-multi/auto/Class/Load/XS/XS.so: undefined symbol: Perl_Tstack_sp_ptr Some problem with the version of Perl installation - can…
0
votes
1 answer

Passing an array reference to a perl callback using call_sv(), should I use newRV() or newRV_noinc()?

I have this XS code (XsTest.xs): #define PERL_NO_GET_CONTEXT #include "EXTERN.h" #include "perl.h" #include "XSUB.h" MODULE = My::XsTest PACKAGE = My::XsTest PROTOTYPES: DISABLE void foo( callback ) SV *callback PREINIT: AV…
Håkon Hægland
  • 39,012
  • 21
  • 81
  • 174
0
votes
1 answer

The relationship between MULTIPLICITY and PERL_IMPLICIT_CONTEXT

What is the relationship between the Perl API macros MULTIPLICITY and PERL_IMPLICIT_CONTEXT? According to perlguts: One macro controls the major Perl build flavor: MULTIPLICITY. The MULTIPLICITY build has a C structure that packages all the…
Håkon Hægland
  • 39,012
  • 21
  • 81
  • 174
0
votes
1 answer

Testing for LibreSSL in a Perl build script

I released Net::NSCAng::Client a while ago and am getting a lot of test failures on OpenBSD. The reason for that is that the NSCAng protocol uses OpenSSL in preshared-key mode (RFC4279), something the folks at LibreSSL (default on OpenBSD now) have…
mbethke
  • 935
  • 8
  • 19
1 2 3
8
9