Remove ViewByteBuf
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/1357cc11 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/1357cc11 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/1357cc11 Branch: refs/heads/master Commit: 1357cc114de6ca1df833768de737973d06787390 Parents: 911bcb7 Author: Nick Wellnhofer <[email protected]> Authored: Mon May 4 15:38:06 2015 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Tue May 5 11:15:12 2015 +0200 ---------------------------------------------------------------------- runtime/core/Clownfish/ByteBuf.c | 35 --------------------------------- runtime/core/Clownfish/ByteBuf.cfh | 29 --------------------------- runtime/perl/lib/Clownfish.pm | 8 -------- 3 files changed, 72 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/1357cc11/runtime/core/Clownfish/ByteBuf.c ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/ByteBuf.c b/runtime/core/Clownfish/ByteBuf.c index 6287552..739d764 100644 --- a/runtime/core/Clownfish/ByteBuf.c +++ b/runtime/core/Clownfish/ByteBuf.c @@ -15,7 +15,6 @@ */ #define C_CFISH_BYTEBUF -#define C_CFISH_VIEWBYTEBUF #define CFISH_USE_SHORT_NAMES #include <stdlib.h> @@ -204,38 +203,4 @@ BB_Compare_To_IMP(ByteBuf *self, Obj *other) { return BB_compare(&self, &other); } -/******************************************************************/ - -ViewByteBuf* -ViewBB_new(char *buf, size_t size) { - ViewByteBuf *self = (ViewByteBuf*)Class_Make_Obj(VIEWBYTEBUF); - return ViewBB_init(self, buf, size); -} - -ViewByteBuf* -ViewBB_init(ViewByteBuf *self, char *buf, size_t size) { - self->cap = 0; - self->buf = buf; - self->size = size; - return self; -} - -void -ViewBB_Destroy_IMP(ViewByteBuf *self) { - Obj_Destroy_t super_duper_destroy = METHOD_PTR(OBJ, CFISH_Obj_Destroy); - super_duper_destroy((Obj*)self); -} - -void -ViewBB_Assign_Bytes_IMP(ViewByteBuf *self, char*buf, size_t size) { - self->buf = buf; - self->size = size; -} - -void -ViewBB_Assign_IMP(ViewByteBuf *self, ByteBuf *other) { - self->buf = other->buf; - self->size = other->size; -} - http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/1357cc11/runtime/core/Clownfish/ByteBuf.cfh ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/ByteBuf.cfh b/runtime/core/Clownfish/ByteBuf.cfh index b44703a..65178db 100644 --- a/runtime/core/Clownfish/ByteBuf.cfh +++ b/runtime/core/Clownfish/ByteBuf.cfh @@ -124,33 +124,4 @@ class Clownfish::ByteBuf nickname BB inherits Clownfish::Obj { Equals(ByteBuf *self, Obj *other); } -/** - * A ByteBuf that doesn't own its own string. - */ -class Clownfish::ViewByteBuf nickname ViewBB - inherits Clownfish::ByteBuf { - - /** Return a pointer to a new "view" ByteBuf, offing a persective on the - * passed-in string. - */ - inert incremented ViewByteBuf* - new(char *buf, size_t size); - - inert incremented ViewByteBuf* - init(ViewByteBuf *self, char *buf, size_t size); - - /** Assign buf and size members to the passed in values. - */ - void - Assign_Bytes(ViewByteBuf *self, char *buf, size_t size); - - /** Assign buf and size members from the passed-in ByteBuf. - */ - void - Assign(ViewByteBuf *self, ByteBuf *other); - - public void - Destroy(ViewByteBuf *self); -} - http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/1357cc11/runtime/perl/lib/Clownfish.pm ---------------------------------------------------------------------- diff --git a/runtime/perl/lib/Clownfish.pm b/runtime/perl/lib/Clownfish.pm index 4047492..bfcc23a 100644 --- a/runtime/perl/lib/Clownfish.pm +++ b/runtime/perl/lib/Clownfish.pm @@ -143,14 +143,6 @@ sub error {$Clownfish::Err::error} } { - package Clownfish::ViewByteBuf; - our $VERSION = '0.004000'; - $VERSION = eval $VERSION; - use Carp; - sub new { confess "ViewByteBuf objects can only be created from C." } -} - -{ package Clownfish::String; our $VERSION = '0.004000'; $VERSION = eval $VERSION;
