58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
end
return true
end
terra ty:ffw()
var newp = m.ffw(self.ptr,self.ct)
var newct = self.ct - (newp - self.ptr)
return ty { ptr = newp, ct = newct }
end
end
install_funcs(strptr)
install_funcs(strref)
--strptr.methods.cmpl = macro(function(self,other)
-- return `self:cmp(strptr { ptr = [other:asvalue()], ct = [#(other:asvalue())] })
|
|
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
end
return true
end
terra ty:ffw()
var newp = m.ffw(self.ptr,self.ct)
var newct = self.ct - (newp - self.ptr)
return ty { ptr = newp, ct = newct }
end
terra ty:blob()
return byteptr {
ptr = [&uint8](self.ptr);
ct = self.ct;
}
end
end
install_funcs(strptr)
install_funcs(strref)
--strptr.methods.cmpl = macro(function(self,other)
-- return `self:cmp(strptr { ptr = [other:asvalue()], ct = [#(other:asvalue())] })
|