… | |
… | |
24 | |
24 | |
25 | // known tags |
25 | // known tags |
26 | enum cbor_tag |
26 | enum cbor_tag |
27 | { |
27 | { |
28 | // inofficial extensions (pending iana registration) |
28 | // inofficial extensions (pending iana registration) |
29 | CBOR_TAG_PERL_OBJECT = 256, |
29 | CBOR_TAG_PERL_OBJECT = 24, // http://cbor.schmorp.de/perl-object |
30 | CBOR_TAG_GENERIC_OBJECT = 257, |
30 | CBOR_TAG_GENERIC_OBJECT = 25, // http://cbor.schmorp.de/generic-object |
|
|
31 | CBOR_TAG_VALUE_SHAREABLE = 26, // http://cbor.schmorp.de/value-sharing |
|
|
32 | CBOR_TAG_VALUE_SHAREDREF = 27, // http://cbor.schmorp.de/value-sharing |
|
|
33 | CBOR_TAG_STRINGREF_NAMESPACE = 65537, // http://cbor.schmorp.de/stringref |
|
|
34 | CBOR_TAG_STRINGREF = 28, // http://cbor.schmorp.de/stringref |
|
|
35 | CBOR_TAG_INDIRECTION = 22098, // http://cbor.schmorp.de/indirection |
31 | |
36 | |
32 | // rfc7049 |
37 | // rfc7049 |
33 | CBOR_TAG_DATETIME = 0, // rfc4287, utf-8 |
38 | CBOR_TAG_DATETIME = 0, // rfc4287, utf-8 |
34 | CBOR_TAG_TIMESTAMP = 1, // unix timestamp, any |
39 | CBOR_TAG_TIMESTAMP = 1, // unix timestamp, any |
35 | CBOR_TAG_POS_BIGNUM = 2, // byte string |
40 | CBOR_TAG_POS_BIGNUM = 2, // byte string |
… | |
… | |
49 | CBOR_TAG_MIME = 36, // mime message rfc2045, utf-8 |
54 | CBOR_TAG_MIME = 36, // mime message rfc2045, utf-8 |
50 | |
55 | |
51 | CBOR_TAG_MAGIC = 55799 // self-describe cbor |
56 | CBOR_TAG_MAGIC = 55799 // self-describe cbor |
52 | }; |
57 | }; |
53 | |
58 | |
54 | #define F_SHRINK 0x00000200UL |
59 | #define F_SHRINK 0x00000001UL |
55 | #define F_ALLOW_UNKNOWN 0x00002000UL |
60 | #define F_ALLOW_UNKNOWN 0x00000002UL |
|
|
61 | #define F_ALLOW_SHARING 0x00000004UL //TODO |
|
|
62 | #define F_DEDUP_STRINGS 0x00000008UL //TODO |
|
|
63 | #define F_DEDUP_KEYS 0x00000010UL //TODO |
56 | |
64 | |
57 | #define INIT_SIZE 32 // initial scalar size to be allocated |
65 | #define INIT_SIZE 32 // initial scalar size to be allocated |
58 | |
66 | |
59 | #define SB do { |
67 | #define SB do { |
60 | #define SE } while (0) |
68 | #define SE } while (0) |
… | |
… | |
117 | #endif |
125 | #endif |
118 | } |
126 | } |
119 | } |
127 | } |
120 | |
128 | |
121 | ///////////////////////////////////////////////////////////////////////////// |
129 | ///////////////////////////////////////////////////////////////////////////// |
122 | // fp hell |
|
|
123 | |
|
|
124 | //TODO |
|
|
125 | |
|
|
126 | ///////////////////////////////////////////////////////////////////////////// |
|
|
127 | // encoder |
130 | // encoder |
128 | |
131 | |
129 | // structure used for encoding CBOR |
132 | // structure used for encoding CBOR |
130 | typedef struct |
133 | typedef struct |
131 | { |
134 | { |
132 | char *cur; // SvPVX (sv) + current output position |
135 | char *cur; // SvPVX (sv) + current output position |
133 | char *end; // SvEND (sv) |
136 | char *end; // SvEND (sv) |
134 | SV *sv; // result scalar |
137 | SV *sv; // result scalar |
135 | CBOR cbor; |
138 | CBOR cbor; |
136 | U32 depth; // recursion level |
139 | U32 depth; // recursion level |
|
|
140 | HV *stringref; // string => index, or 0 |
|
|
141 | HV *shareable; // ptr => index, or 0 |
|
|
142 | UV shareable_idx; |
137 | } enc_t; |
143 | } enc_t; |
138 | |
144 | |
139 | ecb_inline void |
145 | ecb_inline void |
140 | need (enc_t *enc, STRLEN len) |
146 | need (enc_t *enc, STRLEN len) |
141 | { |
147 | { |
… | |
… | |
202 | need (enc, len); |
208 | need (enc, len); |
203 | memcpy (enc->cur, str, len); |
209 | memcpy (enc->cur, str, len); |
204 | enc->cur += len; |
210 | enc->cur += len; |
205 | } |
211 | } |
206 | |
212 | |
|
|
213 | ecb_inline void |
|
|
214 | encode_tag (enc_t *enc, UV tag) |
|
|
215 | { |
|
|
216 | encode_uint (enc, 0xc0, tag); |
|
|
217 | } |
|
|
218 | |
207 | static void encode_sv (enc_t *enc, SV *sv); |
219 | static void encode_sv (enc_t *enc, SV *sv); |
208 | |
220 | |
209 | static void |
221 | static void |
210 | encode_av (enc_t *enc, AV *av) |
222 | encode_av (enc_t *enc, AV *av) |
211 | { |
223 | { |
… | |
… | |
263 | |
275 | |
264 | // encode objects, arrays and special \0=false and \1=true values. |
276 | // encode objects, arrays and special \0=false and \1=true values. |
265 | static void |
277 | static void |
266 | encode_rv (enc_t *enc, SV *sv) |
278 | encode_rv (enc_t *enc, SV *sv) |
267 | { |
279 | { |
268 | svtype svt; |
|
|
269 | |
|
|
270 | SvGETMAGIC (sv); |
280 | SvGETMAGIC (sv); |
|
|
281 | |
|
|
282 | if (ecb_expect_false (enc->cbor.flags & F_ALLOW_SHARING) |
|
|
283 | && ecb_expect_false (SvREFCNT (sv) > 1)) |
|
|
284 | { |
|
|
285 | if (!enc->shareable) |
|
|
286 | enc->shareable = (HV *)sv_2mortal ((SV *)newHV ()); |
|
|
287 | |
|
|
288 | SV **svp = hv_fetch (enc->shareable, (char *)&sv, sizeof (sv), 1); |
|
|
289 | |
|
|
290 | if (SvOK (*svp)) |
|
|
291 | { |
|
|
292 | encode_tag (enc, CBOR_TAG_VALUE_SHAREDREF); |
|
|
293 | encode_uint (enc, 0x00, SvUV (*svp)); |
|
|
294 | return; |
|
|
295 | } |
|
|
296 | else |
|
|
297 | { |
|
|
298 | sv_setuv (*svp, enc->shareable_idx); |
|
|
299 | ++enc->shareable_idx; |
|
|
300 | encode_tag (enc, CBOR_TAG_VALUE_SHAREABLE); |
|
|
301 | } |
|
|
302 | } |
|
|
303 | |
271 | svt = SvTYPE (sv); |
304 | svtype svt = SvTYPE (sv); |
272 | |
305 | |
273 | if (ecb_expect_false (SvOBJECT (sv))) |
306 | if (ecb_expect_false (SvOBJECT (sv))) |
274 | { |
307 | { |
275 | HV *boolean_stash = !CBOR_SLOW || types_boolean_stash |
308 | HV *boolean_stash = !CBOR_SLOW || types_boolean_stash |
276 | ? types_boolean_stash |
309 | ? types_boolean_stash |
… | |
… | |
336 | |
369 | |
337 | // catch this surprisingly common error |
370 | // catch this surprisingly common error |
338 | if (count == 1 && SvROK (TOPs) && SvRV (TOPs) == sv) |
371 | if (count == 1 && SvROK (TOPs) && SvRV (TOPs) == sv) |
339 | croak ("%s::FREEZE(CBOR) method returned same object as was passed instead of a new one", HvNAME (stash)); |
372 | croak ("%s::FREEZE(CBOR) method returned same object as was passed instead of a new one", HvNAME (stash)); |
340 | |
373 | |
341 | encode_uint (enc, 0xc0, CBOR_TAG_PERL_OBJECT); |
374 | encode_tag (enc, CBOR_TAG_PERL_OBJECT); |
342 | encode_uint (enc, 0x80, count + 1); |
375 | encode_uint (enc, 0x80, count + 1); |
343 | encode_str (enc, HvNAMEUTF8 (stash), HvNAME (stash), HvNAMELEN (stash)); |
376 | encode_str (enc, HvNAMEUTF8 (stash), HvNAME (stash), HvNAMELEN (stash)); |
344 | |
377 | |
345 | while (count) |
378 | while (count) |
346 | encode_sv (enc, SP[1 - count--]); |
379 | encode_sv (enc, SP[1 - count--]); |
… | |
… | |
355 | } |
388 | } |
356 | else if (svt == SVt_PVHV) |
389 | else if (svt == SVt_PVHV) |
357 | encode_hv (enc, (HV *)sv); |
390 | encode_hv (enc, (HV *)sv); |
358 | else if (svt == SVt_PVAV) |
391 | else if (svt == SVt_PVAV) |
359 | encode_av (enc, (AV *)sv); |
392 | encode_av (enc, (AV *)sv); |
360 | else if (svt < SVt_PVAV) |
|
|
361 | { |
|
|
362 | STRLEN len = 0; |
|
|
363 | char *pv = svt ? SvPV (sv, len) : 0; |
|
|
364 | |
|
|
365 | if (len == 1 && *pv == '1') |
|
|
366 | encode_ch (enc, 0xe0 | 21); |
|
|
367 | else if (len == 1 && *pv == '0') |
|
|
368 | encode_ch (enc, 0xe0 | 20); |
|
|
369 | else if (enc->cbor.flags & F_ALLOW_UNKNOWN) |
|
|
370 | encode_ch (enc, 0xe0 | 23); |
|
|
371 | else |
|
|
372 | croak ("cannot encode reference to scalar '%s' unless the scalar is 0 or 1", |
|
|
373 | SvPV_nolen (sv_2mortal (newRV_inc (sv)))); |
|
|
374 | } |
|
|
375 | else if (enc->cbor.flags & F_ALLOW_UNKNOWN) |
|
|
376 | encode_ch (enc, 0xe0 | 23); |
|
|
377 | else |
393 | else |
378 | croak ("encountered %s, but CBOR can only represent references to arrays or hashes", |
394 | { |
379 | SvPV_nolen (sv_2mortal (newRV_inc (sv)))); |
395 | encode_tag (enc, CBOR_TAG_INDIRECTION); |
|
|
396 | encode_sv (enc, sv); |
|
|
397 | } |
380 | } |
398 | } |
381 | |
399 | |
382 | static void |
400 | static void |
383 | encode_nv (enc_t *enc, SV *sv) |
401 | encode_nv (enc_t *enc, SV *sv) |
384 | { |
402 | { |
… | |
… | |
449 | } |
467 | } |
450 | |
468 | |
451 | static SV * |
469 | static SV * |
452 | encode_cbor (SV *scalar, CBOR *cbor) |
470 | encode_cbor (SV *scalar, CBOR *cbor) |
453 | { |
471 | { |
454 | enc_t enc; |
472 | enc_t enc = { }; |
455 | |
473 | |
456 | enc.cbor = *cbor; |
474 | enc.cbor = *cbor; |
457 | enc.sv = sv_2mortal (NEWSV (0, INIT_SIZE)); |
475 | enc.sv = sv_2mortal (NEWSV (0, INIT_SIZE)); |
458 | enc.cur = SvPVX (enc.sv); |
476 | enc.cur = SvPVX (enc.sv); |
459 | enc.end = SvEND (enc.sv); |
477 | enc.end = SvEND (enc.sv); |
460 | enc.depth = 0; |
|
|
461 | |
478 | |
462 | SvPOK_only (enc.sv); |
479 | SvPOK_only (enc.sv); |
463 | encode_sv (&enc, scalar); |
480 | encode_sv (&enc, scalar); |
464 | |
481 | |
465 | SvCUR_set (enc.sv, enc.cur - SvPVX (enc.sv)); |
482 | SvCUR_set (enc.sv, enc.cur - SvPVX (enc.sv)); |
… | |
… | |
481 | U8 *end; // end of input string |
498 | U8 *end; // end of input string |
482 | const char *err; // parse error, if != 0 |
499 | const char *err; // parse error, if != 0 |
483 | CBOR cbor; |
500 | CBOR cbor; |
484 | U32 depth; // recursion depth |
501 | U32 depth; // recursion depth |
485 | U32 maxdepth; // recursion depth limit |
502 | U32 maxdepth; // recursion depth limit |
|
|
503 | AV *shareable; |
486 | } dec_t; |
504 | } dec_t; |
487 | |
505 | |
488 | #define ERR(reason) SB if (!dec->err) dec->err = reason; goto fail; SE |
506 | #define ERR(reason) SB if (!dec->err) dec->err = reason; goto fail; SE |
489 | |
507 | |
490 | #define WANT(len) if (ecb_expect_false (dec->cur + len > dec->end)) ERR ("unexpected end of CBOR data") |
508 | #define WANT(len) if (ecb_expect_false (dec->cur + len > dec->end)) ERR ("unexpected end of CBOR data") |
… | |
… | |
706 | } |
724 | } |
707 | |
725 | |
708 | static SV * |
726 | static SV * |
709 | decode_tagged (dec_t *dec) |
727 | decode_tagged (dec_t *dec) |
710 | { |
728 | { |
|
|
729 | SV *sv = 0; |
711 | UV tag = decode_uint (dec); |
730 | UV tag = decode_uint (dec); |
712 | SV *sv = decode_sv (dec); |
|
|
713 | |
731 | |
714 | if (tag == CBOR_TAG_MAGIC) |
732 | WANT (1); |
715 | return sv; |
|
|
716 | else if (tag == CBOR_TAG_PERL_OBJECT) |
|
|
717 | { |
|
|
718 | if (!SvROK (sv) || SvTYPE (SvRV (sv)) != SVt_PVAV) |
|
|
719 | ERR ("corrupted CBOR data (non-array perl object)"); |
|
|
720 | |
733 | |
721 | AV *av = (AV *)SvRV (sv); |
734 | switch (tag) |
722 | int len = av_len (av) + 1; |
735 | { |
723 | HV *stash = gv_stashsv (*av_fetch (av, 0, 1), 0); |
736 | case CBOR_TAG_MAGIC: |
|
|
737 | return decode_sv (dec); |
724 | |
738 | |
725 | if (!stash) |
739 | case CBOR_TAG_INDIRECTION: |
726 | ERR ("cannot decode perl-object (package does not exist)"); |
740 | return newRV_noinc (decode_sv (dec)); |
727 | |
741 | |
728 | GV *method = gv_fetchmethod_autoload (stash, "THAW", 0); |
742 | case CBOR_TAG_VALUE_SHAREABLE: |
729 | |
|
|
730 | if (!method) |
|
|
731 | ERR ("cannot decode perl-object (package does not have a THAW method)"); |
|
|
732 | |
|
|
733 | dSP; |
|
|
734 | |
|
|
735 | ENTER; SAVETMPS; PUSHMARK (SP); |
|
|
736 | EXTEND (SP, len + 1); |
|
|
737 | // we re-bless the reference to get overload and other niceties right |
|
|
738 | PUSHs (*av_fetch (av, 0, 1)); |
|
|
739 | PUSHs (sv_cbor); |
|
|
740 | |
|
|
741 | int i; |
|
|
742 | |
|
|
743 | for (i = 1; i < len; ++i) |
|
|
744 | PUSHs (*av_fetch (av, i, 1)); |
|
|
745 | |
|
|
746 | PUTBACK; |
|
|
747 | call_sv ((SV *)GvCV (method), G_SCALAR | G_EVAL); |
|
|
748 | SPAGAIN; |
|
|
749 | |
|
|
750 | if (SvTRUE (ERRSV)) |
|
|
751 | { |
743 | { |
|
|
744 | if (ecb_expect_false (!dec->shareable)) |
|
|
745 | dec->shareable = (AV *)sv_2mortal ((SV *)newAV ()); |
|
|
746 | |
|
|
747 | sv = newSV (0); |
|
|
748 | av_push (dec->shareable, SvREFCNT_inc_NN (sv)); |
|
|
749 | |
|
|
750 | SV *osv = decode_sv (dec); |
|
|
751 | sv_setsv (sv, osv); |
|
|
752 | SvREFCNT_dec_NN (osv); |
|
|
753 | } |
|
|
754 | |
|
|
755 | return sv; |
|
|
756 | |
|
|
757 | case CBOR_TAG_VALUE_SHAREDREF: |
|
|
758 | { |
|
|
759 | if ((*dec->cur >> 5) != 0) |
|
|
760 | ERR ("corrupted CBOR data (sharedref index not an unsigned integer)"); |
|
|
761 | |
|
|
762 | UV idx = decode_uint (dec); |
|
|
763 | |
|
|
764 | if (!dec->shareable || idx > AvFILLp (dec->shareable)) |
|
|
765 | ERR ("corrupted CBOR data (sharedref index out of bounds)"); |
|
|
766 | |
|
|
767 | return SvREFCNT_inc_NN (AvARRAY (dec->shareable)[idx]); |
|
|
768 | } |
|
|
769 | |
|
|
770 | case CBOR_TAG_PERL_OBJECT: |
|
|
771 | { |
|
|
772 | sv = decode_sv (dec); |
|
|
773 | |
|
|
774 | if (!SvROK (sv) || SvTYPE (SvRV (sv)) != SVt_PVAV) |
|
|
775 | ERR ("corrupted CBOR data (non-array perl object)"); |
|
|
776 | |
|
|
777 | AV *av = (AV *)SvRV (sv); |
|
|
778 | int len = av_len (av) + 1; |
|
|
779 | HV *stash = gv_stashsv (*av_fetch (av, 0, 1), 0); |
|
|
780 | |
|
|
781 | if (!stash) |
|
|
782 | ERR ("cannot decode perl-object (package does not exist)"); |
|
|
783 | |
|
|
784 | GV *method = gv_fetchmethod_autoload (stash, "THAW", 0); |
|
|
785 | |
|
|
786 | if (!method) |
|
|
787 | ERR ("cannot decode perl-object (package does not have a THAW method)"); |
|
|
788 | |
|
|
789 | dSP; |
|
|
790 | |
|
|
791 | ENTER; SAVETMPS; PUSHMARK (SP); |
|
|
792 | EXTEND (SP, len + 1); |
|
|
793 | // we re-bless the reference to get overload and other niceties right |
|
|
794 | PUSHs (*av_fetch (av, 0, 1)); |
|
|
795 | PUSHs (sv_cbor); |
|
|
796 | |
|
|
797 | int i; |
|
|
798 | |
|
|
799 | for (i = 1; i < len; ++i) |
|
|
800 | PUSHs (*av_fetch (av, i, 1)); |
|
|
801 | |
|
|
802 | PUTBACK; |
|
|
803 | call_sv ((SV *)GvCV (method), G_SCALAR | G_EVAL); |
|
|
804 | SPAGAIN; |
|
|
805 | |
|
|
806 | if (SvTRUE (ERRSV)) |
|
|
807 | { |
|
|
808 | FREETMPS; LEAVE; |
|
|
809 | ERR (SvPVutf8_nolen (sv_2mortal (SvREFCNT_inc (ERRSV)))); |
|
|
810 | } |
|
|
811 | |
|
|
812 | SvREFCNT_dec (sv); |
|
|
813 | sv = SvREFCNT_inc (POPs); |
|
|
814 | |
|
|
815 | PUTBACK; |
|
|
816 | |
752 | FREETMPS; LEAVE; |
817 | FREETMPS; LEAVE; |
753 | ERR (SvPVutf8_nolen (sv_2mortal (SvREFCNT_inc (ERRSV)))); |
818 | |
|
|
819 | return sv; |
754 | } |
820 | } |
755 | |
821 | |
756 | SvREFCNT_dec (sv); |
822 | default: |
757 | sv = SvREFCNT_inc (POPs); |
823 | { |
|
|
824 | sv = decode_sv (dec); |
758 | |
825 | |
759 | PUTBACK; |
|
|
760 | |
|
|
761 | FREETMPS; LEAVE; |
|
|
762 | |
|
|
763 | return sv; |
|
|
764 | } |
|
|
765 | else |
|
|
766 | { |
|
|
767 | AV *av = newAV (); |
826 | AV *av = newAV (); |
768 | av_push (av, newSVuv (tag)); |
827 | av_push (av, newSVuv (tag)); |
769 | av_push (av, sv); |
828 | av_push (av, sv); |
770 | |
829 | |
771 | HV *tagged_stash = !CBOR_SLOW || cbor_tagged_stash |
830 | HV *tagged_stash = !CBOR_SLOW || cbor_tagged_stash |
772 | ? cbor_tagged_stash |
831 | ? cbor_tagged_stash |
773 | : gv_stashpv ("CBOR::XS::Tagged" , 1); |
832 | : gv_stashpv ("CBOR::XS::Tagged" , 1); |
774 | |
833 | |
775 | return sv_bless (newRV_noinc ((SV *)av), tagged_stash); |
834 | return sv_bless (newRV_noinc ((SV *)av), tagged_stash); |
|
|
835 | } |
776 | } |
836 | } |
777 | |
837 | |
778 | fail: |
838 | fail: |
779 | SvREFCNT_dec (sv); |
839 | SvREFCNT_dec (sv); |
780 | return &PL_sv_undef; |
840 | return &PL_sv_undef; |
… | |
… | |
872 | } |
932 | } |
873 | |
933 | |
874 | static SV * |
934 | static SV * |
875 | decode_cbor (SV *string, CBOR *cbor, char **offset_return) |
935 | decode_cbor (SV *string, CBOR *cbor, char **offset_return) |
876 | { |
936 | { |
877 | dec_t dec; |
937 | dec_t dec = { }; |
878 | SV *sv; |
938 | SV *sv; |
879 | STRLEN len; |
939 | STRLEN len; |
880 | char *data = SvPVbyte (string, len); |
940 | char *data = SvPVbyte (string, len); |
881 | |
941 | |
882 | if (len > cbor->max_size && cbor->max_size) |
942 | if (len > cbor->max_size && cbor->max_size) |
… | |
… | |
884 | (unsigned long)len, (unsigned long)cbor->max_size); |
944 | (unsigned long)len, (unsigned long)cbor->max_size); |
885 | |
945 | |
886 | dec.cbor = *cbor; |
946 | dec.cbor = *cbor; |
887 | dec.cur = (U8 *)data; |
947 | dec.cur = (U8 *)data; |
888 | dec.end = (U8 *)data + len; |
948 | dec.end = (U8 *)data + len; |
889 | dec.err = 0; |
|
|
890 | dec.depth = 0; |
|
|
891 | |
949 | |
892 | sv = decode_sv (&dec); |
950 | sv = decode_sv (&dec); |
893 | |
951 | |
894 | if (offset_return) |
952 | if (offset_return) |
895 | *offset_return = dec.cur; |
953 | *offset_return = dec.cur; |
… | |
… | |
953 | |
1011 | |
954 | void shrink (CBOR *self, int enable = 1) |
1012 | void shrink (CBOR *self, int enable = 1) |
955 | ALIAS: |
1013 | ALIAS: |
956 | shrink = F_SHRINK |
1014 | shrink = F_SHRINK |
957 | allow_unknown = F_ALLOW_UNKNOWN |
1015 | allow_unknown = F_ALLOW_UNKNOWN |
|
|
1016 | allow_sharing = F_ALLOW_SHARING |
|
|
1017 | dedup_keys = F_DEDUP_KEYS |
|
|
1018 | dedup_strings = F_DEDUP_STRINGS |
958 | PPCODE: |
1019 | PPCODE: |
959 | { |
1020 | { |
960 | if (enable) |
1021 | if (enable) |
961 | self->flags |= ix; |
1022 | self->flags |= ix; |
962 | else |
1023 | else |
… | |
… | |
967 | |
1028 | |
968 | void get_shrink (CBOR *self) |
1029 | void get_shrink (CBOR *self) |
969 | ALIAS: |
1030 | ALIAS: |
970 | get_shrink = F_SHRINK |
1031 | get_shrink = F_SHRINK |
971 | get_allow_unknown = F_ALLOW_UNKNOWN |
1032 | get_allow_unknown = F_ALLOW_UNKNOWN |
|
|
1033 | get_allow_sharing = F_ALLOW_SHARING |
|
|
1034 | get_dedup_keys = F_DEDUP_KEYS |
|
|
1035 | get_dedup_strings = F_DEDUP_STRINGS |
972 | PPCODE: |
1036 | PPCODE: |
973 | XPUSHs (boolSV (self->flags & ix)); |
1037 | XPUSHs (boolSV (self->flags & ix)); |
974 | |
1038 | |
975 | void max_depth (CBOR *self, U32 max_depth = 0x80000000UL) |
1039 | void max_depth (CBOR *self, U32 max_depth = 0x80000000UL) |
976 | PPCODE: |
1040 | PPCODE: |