I am building a module which connects to a camera, takes a picture, and reads the data into a piddle. All of this takes place in an Inline::C command. Using the procedure in the PDL documentation I can create a pdl * and return it. However the camera could fail to take a picture in which case I would like to return 0 as per the usual covention my $pic_pdl = $Camera->TakePicture or die "Failed to take image". This seems to mean that I will need to use the Inline_Stack_Push mechanism but I am not sure how to properly convert the pdl * into an SV*. Also I would like to, if possible, set $! with the error code too. Can this be done in Inline?
Perl Inline::C return pdl or 0 on failure
319 Views Asked by Joel Berger At
1
There are 1 best solutions below
Related Questions in PERL
- Perl Regex for converting query strings
- Cross compiling perl for Android ld.lld: error: unable to find library -lpthread
- Regexp to remove small numbers and leave large ones
- `df` command not capturing entire output in perl
- Webmin CentOS7 AWS backup errors - perl(S3::AWSAuthConnection) can't be installed
- How to ignore perm errors with Path::Tiny 'visit'? (Windows)
- Why does setting `*\` to a scalar (string) reference not result in auto printing
- Regex for deconstructing SQL where statement
- Random characters in DS record from Net::DNS:RR when calling print/string
- Perl with Selenium: cannot save the Web page with Ctrl+S
- openssl pbkdf2 and perl
- Strawberry Perl using a separate winlibs distro
- Perl / Undefined value as a HASH reference when running SNMP queries
- Timestamp with timezone: works with isql but not with DBD::Firebird
- Slurping a file ... syntax error - example from perldoc
Related Questions in RETURN-TYPE
- phpstan - return a generic
- User defined function only returns first value in column
- Does proxy subscript operator override always used over non-proxy one?
- Handling Type Changes with auto in C++
- Return the same types as the passed array parameter
- assert returning a value in c++
- How to send muliples values to a method and recived multiple values in different vars in Java
- How do I return the correct type for nested includes in Prisma?
- Why is throwing exceptions not considered a technique to return different data types at runtime?
- How to return either Redirect of the same page with model in Rasor?
- How to return an instance of a derived generic class when a base class is expected using static factory methods?
- Getting "Return from incompatible pointer type" warning, but i don't see why
- Throw exception instead of return. What is the actual type of method return?
- How to wait for an event before returning a value js
- Java nested generics with raw types return type inference
Related Questions in PDL
- Perl PDL, counting occurrences of two float values
- PDL / Vector and matrix algebra / Sort Eigenvalues of symmetric matrix
- perl PDL indexing and which
- Perldl failing to plot. Gnuplot fails to deploy with cpan
- Perl pdl graphics, fails to show image as specified in documentation
- Best practice for accessing data in PDL objects
- Difference between PDL::Core and PDL::Core ':Internal'
- Does Perl PDL have a way to clamp a vector by min/max values given in another vector without iterating?
- Does Perl PDL have an equivalent of Math::Round::nearest()?
- Is there a map() equivalent for PDL without doing pdl( map {} unpdl)?
- PDL/perldl mac weird permissions/malware errors
- Is there a symbolic implementation of the PDL API?
- use PDL::Constants without "Subroutine redefined"
- Transpose in Perl's PDL::Complex
- "First steps with PDL" image created with Gnuplot differs from the one in PDL Book
Related Questions in INLINE-C
- Calling function of an external Inline C block from another perl modules Inline C block
- Where is the memory leak in my Perl XS code?
- Perl Inline::C default flags
- Can Haskell's inline-C return a typedef to a function pointer?
- Why does replacing Perl's s/// with a dummy function using Inline::C cause a significant slow down?
- How to return a list or array from C block in Haskell's inline-c?
- Perl Inline::C: Are Inline_Stack_Vars etc. needed to avoid memory leaks (biosequence character matching)
- Compare 2 arrays of string for matches in C optimization
- Perl Inline C: Passing Arrayref to C Function
- Need to convert Perl unpack to Inline::C AV*
- How can I force Inline::C to link to an older library?
- would it be worth it to use inline::C to speed up math
- Perl Inline::C return pdl or 0 on failure
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The
pdl*is converted to an SV by code found in the typemap.If I read that right, you should be able to do something like:
As for
$!, it's simply an interface to C'serrno. Simply seterrno.