Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: help with XS pointers

by bliako (Prior)
on Jul 31, 2020 at 12:46 UTC ( #11120129=note: print w/replies, xml ) Need Help??


in reply to Re^2: help with XS pointers
in thread help with XS pointers

Does that make sense at all?

my $device = SDR::RTLSDR->new(); my $status = rtlsdr_open( \$device , $index); print "status $status for index $index\n";

also see this example perlxstypemap (search for T_PTROBJ_SPECIAL) and the Netconfig example in perlxs

Does the error message you cited corresponds for the typemap source code you have shown?

Replies are listed 'Best First'.
Re^4: help with XS pointers
by Bpl (Beadle) on Jul 31, 2020 at 12:58 UTC
    Hi, yes the typemap is the same as before, if I try to change to "T_PTROBJ_SPECIAL" it gives this error:
    Downloads/SDR::RTLSDR/SDR (another copy)/typemap' RTLSDR.xs > RTLSDR. +xsc Can't locate object method "xstype" via package "SDR__RTLSDR *" (perha +ps you forgot to load "SDR__RTLSDR *"?) at /usr/local/share/perl/5.22 +.1/ExtUtils/ParseXS.pm line 1905, <__ANONIO__> line 38. Makefile:359: recipe for target 'RTLSDR.c' failed
    the typemap file now is:
    GNU nano 2.5.3 File: typemap + TYPEMAP SDR::RTLSDR * T_PTROBJ_SPECIAL SDR::RTLSDR ** T_PTROBJ const char * T_PV int * T_PV char * T_PV unsigned long int T_U_LONG uint8_t T_U_SHORT uint8_t * T_U_SHORT uint16_t T_U_SHORT uint32_t * T_U_SHORT uint32_t T_U_SHORT

      Sorry, I did not say that you must copy it, I meant that that's how they associate a C struct with a Perl object.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11120129]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2020-11-24 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?