Age | Commit message (Collapse) | Author |
|
The istream_get_line function is supposed to remove the line break,
inclduing CR+LF if used. The previous implementation simply checked
the buffer when the LF was found, missing the case where the CR was
alraedy added and the LF is at the beginning of the newly loaded
data.
This commit modifies the check to inspect the line itself when it
was found, and remove the CR after the fact.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Instead, make the buffer const, let the user adjust the pointer and
size. The offset can then be inferred in precache.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
It touches internals of the istream, particularly the buffer, but
not of the ostream. It really belongs to istream_t.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
In several places, there are ad-hoc istream_t implementations that
read from a memory buffer to test something else stacked on top.
This commit consolidates those ad-hoc implmentations into a proper
one in libio, and uses the chance to remove external files for some
older tests that rely on file I/O instead.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
For regular iterator types, it's a no-op, for the tree iterator,
it skips the sub tree.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
This basically re-uses the libxfrm pack/unpack tests, but runs
the data through a stream wrapper.
When de-compressing, we have a ridiculously tiny input buffer,
to force the wrapper to snort up the data in several attempts
until the it can decompress something. We read the data byte-by-byte
to force the wraper to internally cache the uncompressed data and
spoon feed it to us. It has to be completely transparent to us that
it internaly decompresses and also reads transparently across
concatenated streams.
When compressing, we only require that the output is smaller than
the input and not equal to it. We also require the wrapper to flush
the wrapped stream when it is flushed. We then test if the compressed
data can be unpacked again.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|