]> git.kaiwu.me - klib.git/commit
Add kgetline() to kstring.c/.h
authorJohn Marshall <jm18@sanger.ac.uk>
Tue, 9 Jun 2015 02:29:54 +0000 (03:29 +0100)
committerJohn Marshall <jm18@sanger.ac.uk>
Thu, 23 Jul 2015 09:31:57 +0000 (10:31 +0100)
commitcbcfcabc8f9b7f0ca14c6dce2ee5644e4e80e5e4
treebff8c9fbbda158dc39029e93ebb4ad4e1d5cd394
parent93531803a8dd0d2e357ad1b8fd90e07162d0e660
Add kgetline() to kstring.c/.h

Similar to BSD's getline() but omits the \n terminator and manages the
memory as a kstring.  Call with "(kgets_func *) fgets" to read from stdio,
or implement an fgets()-style function to read from other streams, e.g.,
a wrapper around gzgets() that reorders its parameters as per fgets().
kstring.c
kstring.h
test/kstring_test.c