… | |
… | |
1081 | |
1081 | |
1082 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--) |
1082 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--) |
1083 | newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); |
1083 | newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); |
1084 | } |
1084 | } |
1085 | |
1085 | |
1086 | SV * |
1086 | void |
1087 | ber_decode (SV *ber, SV *profile = &PL_sv_undef) |
1087 | ber_decode (SV *ber, SV *profile = &PL_sv_undef) |
|
|
1088 | ALIAS: |
|
|
1089 | ber_decode_prefix = 1 |
1088 | CODE: |
1090 | PPCODE: |
1089 | { |
1091 | { |
1090 | cur_profile = SvPROFILE (profile); |
1092 | cur_profile = SvPROFILE (profile); |
1091 | STRLEN len; |
1093 | STRLEN len; |
1092 | buf = (U8 *)SvPVbyte (ber, len); |
1094 | buf = (U8 *)SvPVbyte (ber, len); |
1093 | cur = buf; |
1095 | cur = buf; |
1094 | end = buf + len; |
1096 | end = buf + len; |
1095 | |
1097 | |
1096 | RETVAL = decode_ber (); |
1098 | SV *tuple = decode_ber (); |
|
|
1099 | |
|
|
1100 | EXTEND (SP, 2); |
|
|
1101 | PUSHs (sv_2mortal (tuple)); |
|
|
1102 | |
|
|
1103 | if (ix) |
|
|
1104 | PUSHs (sv_2mortal (newSViv (cur - buf))); |
|
|
1105 | else if (cur != end) |
|
|
1106 | error ("trailing garbage after BER data"); |
1097 | } |
1107 | } |
1098 | OUTPUT: RETVAL |
|
|
1099 | |
1108 | |
1100 | void |
1109 | void |
1101 | ber_is (SV *tuple, SV *klass = &PL_sv_undef, SV *tag = &PL_sv_undef, SV *flags = &PL_sv_undef, SV *data = &PL_sv_undef) |
1110 | ber_is (SV *tuple, SV *klass = &PL_sv_undef, SV *tag = &PL_sv_undef, SV *flags = &PL_sv_undef, SV *data = &PL_sv_undef) |
1102 | PPCODE: |
1111 | PPCODE: |
1103 | { |
1112 | { |