| 1 |
|
| |
| 2 |
|
| #line 453 "lib/PDL/PP.pm" |
| 3 |
|
| /* |
| 4 |
|
| * THIS FILE WAS GENERATED BY PDL::PP from lib/PDL/Compression.pd! Do not modify! |
| 5 |
|
| */ |
| 6 |
|
| |
| 7 |
|
| #define PDL_FREE_CODE(trans, destroy, comp_free_code, ntpriv_free_code) \ |
| 8 |
|
| if (destroy) { \ |
| 9 |
|
| comp_free_code \ |
| 10 |
|
| } \ |
| 11 |
|
| if ((trans)->dims_redone) { \ |
| 12 |
|
| ntpriv_free_code \ |
| 13 |
|
| } |
| 14 |
|
| |
| 15 |
|
| #include "EXTERN.h" |
| 16 |
|
| #include "perl.h" |
| 17 |
|
| #include "XSUB.h" |
| 18 |
|
| #include "pdl.h" |
| 19 |
|
| #include "pdlcore.h" |
| 20 |
|
| #define PDL PDL_Compression |
| 21 |
|
| extern Core* PDL; /* Structure hold core C functions */ |
| 22 |
|
| #line 23 "lib/PDL/Compression.xs" |
| 23 |
|
| pdl_error pdl_run_rice_compress(pdl *in,pdl *out,pdl *len,int blocksize); |
| 24 |
|
| pdl_error pdl_run_rice_expand(pdl *in,pdl *len,pdl *out,IV dim0,int blocksize); |
| 25 |
|
| |
| 26 |
|
| #line 449 "lib/PDL/PP.pm" |
| 27 |
|
| #include "pdlperl.h" |
| 28 |
|
| #line 29 "lib/PDL/Compression.xs" |
| 29 |
|
| |
| 30 |
|
| Core* PDL = NULL; /* Structure hold core C functions */ |
| 31 |
|
| |
| 32 |
|
| MODULE = PDL::Compression PACKAGE = PDL PREFIX=pdl_run_ |
| 33 |
|
| |
| 34 |
|
| PROTOTYPES: DISABLE |
| 35 |
|
| |
| 36 |
|
| |
| 37 |
|
| void |
| 38 |
|
| _rice_compress_int(in,out,len,blocksize) |
| 39 |
|
| pdl *in |
| 40 |
|
| pdl *out |
| 41 |
|
| pdl *len |
| 42 |
|
| int blocksize |
| 43 |
|
| CODE: |
| 44 |
4 |
| PDL->barf_if_error(pdl_run_rice_compress(in,out,len,blocksize)); |
| 45 |
|
| |
| 46 |
|
| void |
| 47 |
|
| pdl_run_rice_expand(in, len, out=out, dim0=dim0, blocksize=blocksize) |
| 48 |
|
| SV *out_SV = (items == 5) ? ST(2) : NULL; |
| 49 |
|
| SV *dim0_SV = (items == 5) ? ST(3) : ST(2); |
| 50 |
|
| SV *blocksize_SV = (items == 5) ? ST(4) : !(items == (4-1)) ? ST(3) : NULL; |
| 51 |
|
| PREINIT: |
| 52 |
10 |
▶ | PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
10 |
0 |
10 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
10 |
10 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
10 |
0 |
10 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
10 |
0 |
10 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
10 |
0 |
10 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
10 |
10 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
10 |
0 |
10 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
10 |
10 |
|
| 53 |
10 |
▶ | if (!((items == (4-1)) || (items == 4) || (items == 5))) |
Branch: 3 branches
| Branch | True | False | Total |
| if (!((items == (4-1)) || (items == 4) || (items == 5))) |
7 |
3 |
10 |
| if (!((items == (4-1)) || (items == 4) || (items == 5))) |
0 |
7 |
7 |
| if (!((items == (4-1)) || (items == 4) || (items == 5))) |
0 |
0 |
0 |
|
| 54 |
0 |
| croak("Usage: PDL::rice_expand(in,len,[out],dim0,blocksize=32) (you may leave [outputs] and values with =defaults out of list)"); |
| 55 |
|
| INPUT: |
| 56 |
|
| pdl *in |
| 57 |
|
| pdl *len |
| 58 |
|
| pdl *out=NO_INIT |
| 59 |
|
| IV dim0; { dim0 = (IV)SvIV(dim0_SV); } |
| 60 |
|
| int blocksize=NO_INIT |
| 61 |
|
| PPCODE: |
| 62 |
10 |
▶ | if (!blocksize_SV) { blocksize = (32); } else { blocksize = (int)SvIV(blocksize_SV); } |
Branch: 1 branch
| Branch | True | False | Total |
| if (!blocksize_SV) { blocksize = (32); } else { blocksize = (int)SvIV(blocksize_SV); } |
3 |
7 |
10 |
|
| 63 |
10 |
▶ | if (out_SV) { out = PDL_CORE_(SvPDLV)(out_SV); } else out = PDL_XS_PERLINIT_initsv(out_SV); |
Branch: 2 branches
| Branch | True | False | Total |
| if (out_SV) { out = PDL_CORE_(SvPDLV)(out_SV); } else out = PDL_XS_PERLINIT_initsv(out_SV); |
0 |
10 |
10 |
| if (out_SV) { out = PDL_CORE_(SvPDLV)(out_SV); } else out = PDL_XS_PERLINIT_initsv(out_SV); |
0 |
10 |
10 |
|
| 64 |
10 |
▶ | if (PDL_IS_INPLACE(in)) PDL->pdl_barf("rice_expand: in->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(in)) PDL->pdl_barf("rice_expand: in->inplace but not supported"); |
0 |
10 |
10 |
|
| 65 |
10 |
▶ | if (PDL_IS_INPLACE(len)) PDL->pdl_barf("rice_expand: len->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(len)) PDL->pdl_barf("rice_expand: len->inplace but not supported"); |
0 |
10 |
10 |
|
| 66 |
10 |
| PDL->barf_if_error(pdl_run_rice_expand(in,len,out,dim0,blocksize)); |
| 67 |
10 |
▶ | PDL_XS_RETURN(ST(0) = out_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = out_SV) |
10 |
0 |
10 |
| PDL_XS_RETURN(ST(0) = out_SV) |
10 |
0 |
10 |
| PDL_XS_RETURN(ST(0) = out_SV) |
10 |
0 |
10 |
| PDL_XS_RETURN(ST(0) = out_SV) |
0 |
10 |
10 |
| PDL_XS_RETURN(ST(0) = out_SV) |
0 |
0 |
0 |
|
| 68 |
|
| |
| 69 |
|
| |
| 70 |
|
| #line 483 "lib/PDL/PP.pm" |
| 71 |
|
| BOOT: |
| 72 |
|
| /* Get pointer to structure of core shared C routines */ |
| 73 |
|
| /* make sure PDL::Core is loaded */ |
| 74 |
|
| #line 75 "lib/PDL/Compression.xs" |
| 75 |
3 |
| perl_require_pv ("PDL/Core.pm"); /* make sure PDL::Core is loaded */ |
| 76 |
|
| #ifndef aTHX_ |
| 77 |
|
| #define aTHX_ |
| 78 |
|
| #endif |
| 79 |
3 |
▶ | if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
Branch: 3 branches
| Branch | True | False | Total |
| if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
3 |
0 |
3 |
| if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
0 |
3 |
3 |
| if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
0 |
0 |
0 |
|
| 80 |
3 |
| SV* CoreSV = perl_get_sv("PDL::SHARE",FALSE); /* var with core structure */ |
| 81 |
3 |
▶ | if (!CoreSV) |
Branch: 1 branch
| Branch | True | False | Total |
| if (!CoreSV) |
0 |
3 |
3 |
|
| 82 |
0 |
| Perl_croak(aTHX_ "We require the PDL::Core module, which was not found"); |
| 83 |
3 |
▶ | if (!(PDL = INT2PTR(Core*,SvIV( CoreSV )))) /* Core* value */ |
Branch: 1 branch
| Branch | True | False | Total |
| if (!(PDL = INT2PTR(Core*,SvIV( CoreSV )))) /* Core* value */ |
0 |
3 |
3 |
|
| 84 |
0 |
| Perl_croak(aTHX_ "Got NULL pointer for PDL"); |
| 85 |
3 |
▶ | if (PDL->Version != PDL_CORE_VERSION) |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL->Version != PDL_CORE_VERSION) |
0 |
3 |
3 |
|
| 86 |
0 |
| Perl_croak(aTHX_ "[PDL->Version: %ld PDL_CORE_VERSION: %ld XS_VERSION: %s] PDL::Compression needs to be recompiled against the newly installed PDL", (long int)PDL->Version, (long int)PDL_CORE_VERSION, XS_VERSION); |