ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CBOR-XS/XS.xs
(Generate patch)

Comparing CBOR-XS/XS.xs (file contents):
Revision 1.14 by root, Tue Oct 29 15:56:32 2013 UTC vs.
Revision 1.15 by root, Tue Oct 29 18:37:31 2013 UTC

991 CODE: 991 CODE:
992 RETVAL = self->max_size; 992 RETVAL = self->max_size;
993 OUTPUT: 993 OUTPUT:
994 RETVAL 994 RETVAL
995 995
996#if 0 //TODO
997
998void filter_cbor_object (CBOR *self, SV *cb = &PL_sv_undef)
999 PPCODE:
1000{
1001 SvREFCNT_dec (self->cb_object);
1002 self->cb_object = SvOK (cb) ? newSVsv (cb) : 0;
1003
1004 XPUSHs (ST (0));
1005}
1006
1007void filter_cbor_single_key_object (CBOR *self, SV *key, SV *cb = &PL_sv_undef)
1008 PPCODE:
1009{
1010 if (!self->cb_sk_object)
1011 self->cb_sk_object = newHV ();
1012
1013 if (SvOK (cb))
1014 hv_store_ent (self->cb_sk_object, key, newSVsv (cb), 0);
1015 else
1016 {
1017 hv_delete_ent (self->cb_sk_object, key, G_DISCARD, 0);
1018
1019 if (!HvKEYS (self->cb_sk_object))
1020 {
1021 SvREFCNT_dec (self->cb_sk_object);
1022 self->cb_sk_object = 0;
1023 }
1024 }
1025
1026 XPUSHs (ST (0));
1027}
1028
1029#endif
1030
1031void encode (CBOR *self, SV *scalar) 996void encode (CBOR *self, SV *scalar)
1032 PPCODE: 997 PPCODE:
1033 PUTBACK; scalar = encode_cbor (scalar, self); SPAGAIN; 998 PUTBACK; scalar = encode_cbor (scalar, self); SPAGAIN;
1034 XPUSHs (scalar); 999 XPUSHs (scalar);
1035 1000
1047 EXTEND (SP, 2); 1012 EXTEND (SP, 2);
1048 PUSHs (sv); 1013 PUSHs (sv);
1049 PUSHs (sv_2mortal (newSVuv (offset - SvPVX (cborstr)))); 1014 PUSHs (sv_2mortal (newSVuv (offset - SvPVX (cborstr))));
1050} 1015}
1051 1016
1052#if 0
1053
1054void DESTROY (CBOR *self)
1055 CODE:
1056 SvREFCNT_dec (self->cb_sk_object);
1057 SvREFCNT_dec (self->cb_object);
1058
1059#endif
1060
1061PROTOTYPES: ENABLE 1017PROTOTYPES: ENABLE
1062 1018
1063void encode_cbor (SV *scalar) 1019void encode_cbor (SV *scalar)
1064 PPCODE: 1020 PPCODE:
1065{ 1021{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines