Robert Spalek [Tue, 17 Aug 2004 20:12:05 +0000 (20:12 +0000)]
added a module that supports transparent compression of data streamed into
an output fastbuf. on the other side, reading from the stream is also
transparent
Martin Mares [Thu, 5 Aug 2004 22:28:58 +0000 (22:28 +0000)]
Bucket fastbuf's have to be seekable, since shep-reap seeks on them
(although the seek will be inside the buffer [and thence optimized out
by bseek()] under all reasonable circumstances [it was triggered by
a bug in buck2obj]).
Martin Mares [Fri, 16 Jul 2004 18:18:02 +0000 (18:18 +0000)]
Reading of V30 buckets was broken (for example it didn't work when a bucket
had only header and no body). When fixing it, I've modified it to terminate
after buck_len bytes, so the terminating NUL character is no longer needed.
Martin Mares [Sat, 10 Jul 2004 21:04:23 +0000 (21:04 +0000)]
I always wanted to rename the rather inconsistent memory pool modules.
After the big library earthquake I caused with my unicode.h changes,
this is the small fish, so let's go.
Martin Mares [Tue, 6 Jul 2004 10:36:47 +0000 (10:36 +0000)]
can_overwrite_buffer fixes for bucket.c: added f->buffer resetting and
also don't forget to set can_overwrite_buffer on slurp fastbufs (this
involves a little dirty trick, see the comment).
Robert Spalek [Sun, 4 Jul 2004 11:30:53 +0000 (11:30 +0000)]
- use buck2obj_parse() instead of obj_read_bucket() to separate the header
and the body
- use the new interface for writing the attributes to the buckets
Robert Spalek [Sun, 4 Jul 2004 11:29:17 +0000 (11:29 +0000)]
- obj_parse_dump() generalized to store apart the header and the body, and
renamed to buck2obj_parse()
- added new obj_parse_dump() with the same interface as before; it is a
wrapper of buck2obj_parse()
Robert Spalek [Mon, 28 Jun 2004 11:44:00 +0000 (11:44 +0000)]
deleted obj_attr_to_bucket*(). sorry, I like them, however I have already
converted all sources to my version of these functions. if we reintroduce
them, let us put them to obj2buck.[ch]
Robert Spalek [Mon, 28 Jun 2004 09:45:49 +0000 (09:45 +0000)]
- added buck2obj_flush() that flushed the memory pool (some caller only
remember struct buck2obj_buf * and since it is not exported, they could not
flush it by themselves)
- obj_read_bucket() returns the length of the header if requested
- adapted to growing buffers (gbuf.h)
- updated interface of bconfig()
- lizard_decompress_safe() automatically realloc's the buffer, hence the
wrapper is not needed
Robert Spalek [Mon, 28 Jun 2004 09:34:27 +0000 (09:34 +0000)]
- encapsulation: hide struct lizard_buffer in the source code
===> interface changed, now it returns the pointer in one extra parameter
- lizard_alloc() allocates no memory, hence no size parameter needed
- lizard_realloc() made static and it is automatically called by the
decompression routine
Martin Mares [Sun, 27 Jun 2004 14:10:47 +0000 (14:10 +0000)]
obj_read_bucket() now gets the bucket length as a parameter, because
in many cases, the fastbuf continues after the end of the bucket.
If a V30 bucket ends with a NUL byte, eat that byte as well.
Also introduced obj_attr_to_bucket{,_num}() -- these functions take
a single attribute and encode it using the specified bucket type
for inclusion at the beginning of the bucket header. These functions
probably belong to obj2buck instead, but currently there is no such
file, so I'm leaving the moving to you.
Robert Spalek [Fri, 25 Jun 2004 18:45:56 +0000 (18:45 +0000)]
- buck2obj_alloc() initially allocates no buffers
- buck2obj_realloc() only stretches the main buffer (and not the lizard)
+ it is not exported anymore
- if lizard_decompress_safe() returns EFBIG, its buffer is shrinked
hence buck2obj.c allocates no memory if not needed. the internal buffer is
allocated when the first non-compact bucket is encountered and lizard's
buffer is allocated when the first compressed bucket is encountered.
Robert Spalek [Fri, 25 Jun 2004 15:35:57 +0000 (15:35 +0000)]
MJ's objections:
- test can_overwrite outside the loop in decode_attributes()
- mp_alloc() -> mp_alloc_fast_noalign()
- MAX() is a macro, be careful
- do not call bflush(body), but comment it in the header file