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
316 Views Asked by Joel Berger At
1
There are 1 best solutions below
Related Questions in PERL
- Perl Command Line Interpreter crashing on exit
- Perl Regex: Merge multiple one-character substrings
- Syntax error in Perl open
- Need help in understanding perl tr command with /d
- Referencing a Schema's table batch/perl
- Retrieving filtered list of files using template toolkit
- “Badly placed ()'s” error when running loc command
- getting google contacts using shuttlecloud
- Perl Module using %EXPORT_TAGS
- get all possible permutations of words in string using perl script
- Can't locate DBI.pm in @INC with Perl
- split string into several substring using indexes
- How to find strings between two specified texts
- Getting a json from a server and assigning it to a variable
- Is there anyway to plot timeline charts in excel sheets using Spreadhseet::WriteExcel module in Perl?
Related Questions in RETURN-TYPE
- C arrays and functions, how to return?
- Return type of list front (C++)
- python(2.7) function takes the multiple integers and a list, and return an integer and a list
- Register return Type
- Difference between function returning by reference and const function returning a const value
- Return value of a function in C
- Abstract class and new() used as constraints; return type parameter issue
- How can I retrieve the return type of a function to use in a template?
- Using a class to find errors in data structures
- using void methods in log method
- I'm Returning a Reference From a Lambda, why is a Copy Happening?
- Is it possible that a function can return 2 or more values with different data types in php?
- Swift: Why class method has return type AnyObject?
- Java arraylist and polymorphism
- Why int type method is allowing character type as return value?
Related Questions in PDL
- Perl PDL not working as expected
- About gsl_cdf_tdist_P from PDL::GSL::CDF (Perl)
- How to iterate through a Perl PDL piddle?
- convert PDL scalar to Perl scalar
- export pdl() only from perl PDL
- perl PDL indexing and which
- PDL / Vector and matrix algebra / Sort Eigenvalues of symmetric matrix
- Perl PDL, counting occurrences of two float values
- Is there a signal processing module for PDL?
- Use Perl PDL to rotate a matrix
- Is there a map() equivalent for PDL without doing pdl( map {} unpdl)?
- Does Perl PDL have an equivalent of Math::Round::nearest()?
- Does Perl PDL have a way to clamp a vector by min/max values given in another vector without iterating?
- How do I extract specific rows from a PDL matrix?
- use PDL::Constants without "Subroutine redefined"
Related Questions in INLINE-C
- How to return a list or array from C block in Haskell's inline-c?
- Where is the memory leak in my Perl XS code?
- Need to convert Perl unpack to Inline::C AV*
- Calling function of an external Inline C block from another perl modules Inline C block
- Perl Inline C: Passing Arrayref to C Function
- Perl Inline::C default flags
- How can I force Inline::C to link to an older library?
- Perl Inline::C return pdl or 0 on failure
- Perl Inline::C: Are Inline_Stack_Vars etc. needed to avoid memory leaks (biosequence character matching)
- Can Haskell's inline-C return a typedef to a function pointer?
- Compare 2 arrays of string for matches in C optimization
- would it be worth it to use inline::C to speed up math
- Why does replacing Perl's s/// with a dummy function using Inline::C cause a significant slow down?
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 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.