| 1 |
|
| #define PERL_NO_GET_CONTEXT |
| 2 |
|
| #include "EXTERN.h" |
| 3 |
|
| #include "perl.h" |
| 4 |
|
| #include "XSUB.h" |
| 5 |
|
| |
| 6 |
|
| #include "ppport.h" |
| 7 |
|
| |
| 8 |
|
| |
| 9 |
|
| int ge_frombytes_vartime(unsigned char *s); |
| 10 |
|
| |
| 11 |
|
| MODULE = Solana::SPLAddress PACKAGE = Solana::SPLAddress |
| 12 |
|
| |
| 13 |
|
| int |
| 14 |
|
| check_pub_address_is_ok(SV* address) |
| 15 |
|
| CODE: |
| 16 |
|
| { |
| 17 |
1 |
| unsigned char* tmp = NULL; |
| 18 |
1 |
| STRLEN len = 0; |
| 19 |
1 |
▶ | if (SvOK(address)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (SvOK(address)) { |
1 |
0 |
1 |
|
| 20 |
1 |
| tmp = (unsigned char*)SvPVbyte(address, len); |
| 21 |
|
| } |
| 22 |
1 |
▶ | if (len != 32) croak("owner must be 32 bytes long"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (len != 32) croak("owner must be 32 bytes long"); |
0 |
1 |
1 |
|
| 23 |
|
| |
| 24 |
1 |
▶ | RETVAL = ge_frombytes_vartime(tmp) != -1; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = ge_frombytes_vartime(tmp) != -1; |
0 |
1 |
1 |
|
| 25 |
|
| } |
| 26 |
|
| OUTPUT: |
| 27 |
|
| RETVAL |