Help for this page

Select Code to Download


  1. or download this
    int mult (int x, int y);
    void speak (const char* str);
    unsigned char* arr (); // returns (0, 1, 2)
    
  2. or download this
    module-starter \
        --module=XS::Wrap \
        --author="Steve Bertrand" \
        --email=steveb@cpan.org \
        --license=perl
    
  3. or download this
    package XS::Wrap;
    
    ...
    use strict;
    
    our $VERSION = '0.01';
    
  4. or download this
    use warnings;
    use strict;
    ...
    
    #include <stdio.h>
    #include <xswrap.h>
    
  5. or download this
    #include "EXTERN.h"
    #include "perl.h"
    ...
    MODULE = XS::Wrap  PACKAGE = main
    
    PROTOTYPES: DISABLE
    
  6. or download this
    #include "EXTERN.h"
    #include "perl.h"
    ...
        const char* str
    
    unsigned char* arr ()
    
  7. or download this
    use warnings;
    use strict;
    ...
        my @array = arr();
        return @array;
    }
    
  8. or download this
    LIBS => ['-lxswrap'],
    
  9. or download this
    perl Makefile.PL
    make
    make install
    
  10. or download this
    use warnings;
    use strict;
    ...
    my @arr = my_arr();
    
    say $_ for @arr;
    
  11. or download this
    25
    hello, world!
    
  12. or download this
    use warnings;
    use strict;
    ...
        
        inline_stack_done;
    }
    
  13. or download this
    #include "EXTERN.h"
    #include "perl.h"
    ...
            }
            /* must have used dXSARGS; list context implied */
            return; /* assume stack size is correct */
    
  14. or download this
    void _arr (){
        unsigned char* c_array = arr();
    ...
        
        inline_stack_done;
    }
    
  15. or download this
    void
    _arr ()
    ...
              XSRETURN_EMPTY;
            }
            return;
    
  16. or download this
    #include "EXTERN.h"
    #include "perl.h"
    ...
              XSRETURN_EMPTY;
            }
            return;
    
  17. or download this
    sub my_arr {
        my @array = _arr();
        return @array;
    }
    
  18. or download this
    perl example.pl
    25
    ...
    0
    1
    2
    
  19. or download this
    rm -rf _Inline
    perl Makefile.PL
    ...
    make manifest
    make install
    make dist