| 1 |
|
| UV |
| 2 |
|
| _abi_ptr(version, size) |
| 3 |
|
| SV *version |
| 4 |
|
| SV *size |
| 5 |
|
| PREINIT: |
| 6 |
|
| const symprim_abi *table; |
| 7 |
|
| uint32_t asked, room; |
| 8 |
|
| CODE: |
| 9 |
|
| /* What another extension asks for when it loads: the table of |
| 10 |
|
| * symprim_abi.h, at the version it was written against or any later, |
| 11 |
|
| * and no shorter than the table it was compiled with. It is never asked |
| 12 |
|
| * to be equal: the table only grows at its end. The address is unsigned, |
| 13 |
|
| * since where the loader put this object decides its top bit. */ |
| 14 |
42 |
| asked = number_between(aTHX_ "_abi_ptr", "the version", settled(aTHX_ version), 1, 0xFFFFFFFFUL); |
| 15 |
33 |
| room = number_between(aTHX_ "_abi_ptr", "the size", settled(aTHX_ size), 8, 0xFFFFFFFFUL); |
| 16 |
23 |
| table = symprim_abi_table(); |
| 17 |
23 |
▶ | if (asked > table->abi_version) |
Branch: 1 branch
| Branch | True | False | Total |
| if (asked > table->abi_version) |
3 |
20 |
23 |
|
| 18 |
3 |
| croak("Crypt::Symmetric::Primitives: version %lu of the C interface was asked for and this is version %lu", |
| 19 |
|
| (unsigned long)asked, (unsigned long)table->abi_version); |
| 20 |
20 |
▶ | if (room > table->size) |
Branch: 1 branch
| Branch | True | False | Total |
| if (room > table->size) |
3 |
17 |
20 |
|
| 21 |
3 |
| croak("Crypt::Symmetric::Primitives: a C interface table of %lu bytes was asked for and this one is %lu", |
| 22 |
|
| (unsigned long)room, (unsigned long)table->size); |
| 23 |
17 |
▶ | RETVAL = PTR2UV(table); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = PTR2UV(table); |
8 |
9 |
17 |
|
| 24 |
|
| OUTPUT: |
| 25 |
|
| RETVAL |
| 26 |
|
| |
| 27 |
|
| UV |
| 28 |
|
| _abi_version() |
| 29 |
|
| CODE: |
| 30 |
1 |
▶ | RETVAL = symprim_abi_table()->abi_version; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = symprim_abi_table()->abi_version; |
0 |
1 |
1 |
|
| 31 |
|
| OUTPUT: |
| 32 |
|
| RETVAL |