]>
git.kaiwu.me - klib.git/log
Heng Li [Sun, 30 Nov 2014 01:06:53 +0000 (20:06 -0500)]
simplified the struct
Heng Li [Sun, 30 Nov 2014 01:00:28 +0000 (20:00 -0500)]
simplified the struct a little
Heng Li [Sun, 30 Nov 2014 00:54:16 +0000 (19:54 -0500)]
simplified API
Heng Li [Sun, 30 Nov 2014 00:40:08 +0000 (19:40 -0500)]
query on CMD; more chanages to happen
Heng Li [Sun, 30 Nov 2014 00:00:53 +0000 (19:00 -0500)]
fixed an error in the example (due to prev rev)
Heng Li [Sat, 29 Nov 2014 23:55:36 +0000 (18:55 -0500)]
a bit code cleaup
Heng Li [Sat, 29 Nov 2014 23:54:26 +0000 (18:54 -0500)]
indent output
Heng Li [Sat, 29 Nov 2014 23:24:52 +0000 (18:24 -0500)]
minor change
Heng Li [Sat, 29 Nov 2014 23:20:35 +0000 (18:20 -0500)]
added JSON query
Heng Li [Sat, 29 Nov 2014 18:02:17 +0000 (13:02 -0500)]
isblank() -> isspace()
Heng Li [Sat, 29 Nov 2014 18:00:19 +0000 (13:00 -0500)]
no effective changes
Heng Li [Sat, 29 Nov 2014 17:59:10 +0000 (12:59 -0500)]
simplified API a bit
Heng Li [Sat, 29 Nov 2014 17:41:26 +0000 (12:41 -0500)]
fixed compilation error in the last commit
Heng Li [Sat, 29 Nov 2014 17:40:39 +0000 (12:40 -0500)]
added deallocator
Heng Li [Sat, 29 Nov 2014 17:37:57 +0000 (12:37 -0500)]
added API documentation
Heng Li [Sat, 29 Nov 2014 17:28:04 +0000 (12:28 -0500)]
code cleanup
Heng Li [Sat, 29 Nov 2014 17:21:42 +0000 (12:21 -0500)]
improved comments a little
Heng Li [Sat, 29 Nov 2014 17:09:47 +0000 (12:09 -0500)]
bug for empty []/{}; check extra left brackets
Heng Li [Sat, 29 Nov 2014 17:05:12 +0000 (12:05 -0500)]
rename brackets
Heng Li [Sat, 29 Nov 2014 17:01:31 +0000 (12:01 -0500)]
added a bit error checking
Heng Li [Sat, 29 Nov 2014 16:48:11 +0000 (11:48 -0500)]
A light-weight JSON parser
Heng Li [Sat, 29 Nov 2014 02:04:38 +0000 (21:04 -0500)]
give kh_##name##_t a struct name
Heng Li [Fri, 28 Nov 2014 16:49:11 +0000 (11:49 -0500)]
default to following redirect & no SSL certificate
Heng Li [Thu, 13 Nov 2014 15:38:57 +0000 (10:38 -0500)]
Merge pull request #39 from jmarshall/kseq-eof
Fix ks_getuntil2() extra empty record at EOF bug
John Marshall [Thu, 13 Nov 2014 14:28:46 +0000 (14:28 +0000)]
Fix ks_getuntil2() extra empty record at EOF bug
When the stream is an exact multiple of the buffer size, ks_getuntil2()
was returning a final empty record when it should have returned -1.
Fixed by moving the "EOF => return -1" check to after the read loop.
(See samtools/samtools#318 for an example of an error caused by a
spurious empty line at the end of a SAM file.)
John Marshall [Thu, 13 Nov 2014 11:57:56 +0000 (11:57 +0000)]
Heng Li [Mon, 10 Nov 2014 21:05:06 +0000 (16:05 -0500)]
Merge branch 'master' of github.com:attractivechaos/klib
Heng Li [Mon, 10 Nov 2014 21:04:13 +0000 (16:04 -0500)]
bug with incomplete read() call
See also issue #43 of seqtk
Heng Li [Mon, 13 Oct 2014 20:41:25 +0000 (16:41 -0400)]
Merge pull request #38 from immerrr/enable-inline-macro-overrides
Enable overriding kh_inline from user code
immerrr [Mon, 13 Oct 2014 17:25:24 +0000 (21:25 +0400)]
Enable overriding kh_inline from user code
Heng Li [Sun, 21 Sep 2014 23:05:45 +0000 (19:05 -0400)]
Merge pull request #28 from piki/fix-new_flags-leak
fix the leak that happens if krealloc fails
Heng Li [Wed, 9 Apr 2014 13:40:35 +0000 (09:40 -0400)]
Merge pull request #31 from jmarshall/warnings
Silence -Wstrict-prototypes and static analyser warnings in klist.h
John Marshall [Wed, 9 Apr 2014 12:40:34 +0000 (13:40 +0100)]
Silence -Wstrict-prototypes and static analyser warnings
Using "(void)" provides an explicit there-are-no-arguments prototype.
Using the exact type in "malloc(...sizeof)" is clearer and silences
warnings from clang's static analyzer.
Patrick Reynolds [Sun, 9 Feb 2014 08:24:08 +0000 (02:24 -0600)]
fix the leak that happens if krealloc fails
Heng Li [Sat, 7 Dec 2013 14:28:32 +0000 (09:28 -0500)]
Merge branch 'master' of github.com:attractivechaos/klib
Heng Li [Sat, 7 Dec 2013 14:27:50 +0000 (09:27 -0500)]
don't seek when opening
If the input is a stream, it will always fail.
Heng Li [Sun, 1 Dec 2013 17:27:44 +0000 (09:27 -0800)]
Merge pull request #26 from zhanxw/patch-1
Update ksort.h
zhanxw [Sat, 30 Nov 2013 04:37:10 +0000 (23:37 -0500)]
Update ksort.h
From my personal communication, I got this suggestion:
using inline incorrectly: see the C99 standard ยง6.7.4. Please change to static inline (and report upstream). This also caused some clang compilation problem.
Heng Li [Sun, 24 Nov 2013 19:59:37 +0000 (14:59 -0500)]
fixed a bug in seek
Heng Li [Thu, 21 Nov 2013 18:13:57 +0000 (13:13 -0500)]
added a note about S3
Heng Li [Thu, 21 Nov 2013 17:51:44 +0000 (12:51 -0500)]
added HMAC-SHA1 to drop the openssl dependency
Heng Li [Thu, 21 Nov 2013 05:22:33 +0000 (00:22 -0500)]
allow to feed change key/secret/id-file
Heng Li [Thu, 21 Nov 2013 05:13:05 +0000 (00:13 -0500)]
support the s3:// protocol
Heng Li [Wed, 20 Nov 2013 19:32:49 +0000 (14:32 -0500)]
halve the buffer size
Heng Li [Wed, 20 Nov 2013 19:18:19 +0000 (14:18 -0500)]
use fixed-length buffer with pause()
Heng Li [Wed, 20 Nov 2013 16:23:02 +0000 (11:23 -0500)]
ignore signal
Heng Li [Tue, 19 Nov 2013 03:07:40 +0000 (22:07 -0500)]
need to grow buffer
One multi_perform() frequently invokes multiple write_cb(). We have to use a
dynamic buffer. Hmm.. I really do not like the curl APIs, although I understand
why they are designed this way.
Heng Li [Tue, 19 Nov 2013 02:35:23 +0000 (21:35 -0500)]
wrong dopen() interface
Heng Li [Tue, 19 Nov 2013 02:04:58 +0000 (21:04 -0500)]
forgot ";"
Heng Li [Tue, 19 Nov 2013 02:04:40 +0000 (21:04 -0500)]
forgot to alias kurl_t to knetFile
Heng Li [Tue, 19 Nov 2013 02:03:25 +0000 (21:03 -0500)]
emulating knetfile APIs
Heng Li [Tue, 19 Nov 2013 01:42:28 +0000 (20:42 -0500)]
added dopen()/buflen() and optional options
Heng Li [Mon, 18 Nov 2013 20:39:12 +0000 (15:39 -0500)]
use larger buffer for remote files
Heng Li [Mon, 18 Nov 2013 20:29:18 +0000 (15:29 -0500)]
Fixed slow sftp/scp connection
In curl/docs/examples/fopen.c, the developer didn't check maxfd set by
curl_multi_fdset() and supposed that calling select(0,...) is effectively
equivalent to sleep. While the comment is correct, timeout estimated by
curl_multi_fdset() is frequently too large - in my case 10 seconds. We seldom
need to wait that long.
In curl_multi_fdset.3, the cURL developers recommended to wait at least 100ms
if maxfd is set to 1. This is what I am doing in the revised code. It does
little harm.
Heng Li [Mon, 18 Nov 2013 17:18:34 +0000 (12:18 -0500)]
better CLI
sftp connection is really slow. Don't know why.
Heng Li [Mon, 18 Nov 2013 16:48:26 +0000 (11:48 -0500)]
better interface and documentations
Heng Li [Mon, 18 Nov 2013 15:55:21 +0000 (10:55 -0500)]
knetfile-like interface to CURL
Heng Li [Sat, 2 Nov 2013 12:26:41 +0000 (08:26 -0400)]
forgot the header file
For kt_for() it is actually not needed.
Heng Li [Fri, 11 Oct 2013 17:17:26 +0000 (13:17 -0400)]
added a more flexible scheduler; not tested
not thoroughly
Heng Li [Fri, 11 Oct 2013 13:34:42 +0000 (09:34 -0400)]
change the argument ordering
Heng Li [Fri, 11 Oct 2013 03:28:17 +0000 (23:28 -0400)]
added the test program for kthread
Heng Li [Thu, 10 Oct 2013 20:06:02 +0000 (16:06 -0400)]
reduced a redundant variable; fix for wrong tid
Heng Li [Thu, 10 Oct 2013 16:39:12 +0000 (12:39 -0400)]
wait-free heap-free implementation of kt_for()
and also much simpler
Heng Li [Thu, 10 Oct 2013 14:37:14 +0000 (10:37 -0400)]
simplified the kt_for() API
* the local array can fit into the global data
* sometimes caller needs to know thread id to maintain buffer
Heng Li [Thu, 10 Oct 2013 04:20:08 +0000 (00:20 -0400)]
revert to kt_for()
the new version is buggy and even if I could fix it, I would not feel
confident. Perhaps I will come back later when I am more competent.
Heng Li [Thu, 10 Oct 2013 04:18:59 +0000 (00:18 -0400)]
test C++
Heng Li [Thu, 10 Oct 2013 03:53:56 +0000 (23:53 -0400)]
more versatile APIs
Heng Li [Thu, 10 Oct 2013 03:52:13 +0000 (23:52 -0400)]
pass item index to function calls
kt_for() to be replaced by more complex but more versatile APIs
Heng Li [Wed, 9 Oct 2013 18:26:17 +0000 (14:26 -0400)]
don't need this now, but maybe in future
Heng Li [Wed, 9 Oct 2013 16:51:34 +0000 (12:51 -0400)]
fixed a dead loop when n_threads==1
Heng Li [Wed, 9 Oct 2013 15:55:39 +0000 (11:55 -0400)]
bugfix: wrong integer type
but it does not really matter
Heng Li [Wed, 9 Oct 2013 15:50:27 +0000 (11:50 -0400)]
no effective changes
Heng Li [Wed, 9 Oct 2013 15:47:29 +0000 (11:47 -0400)]
documentation; better var names
Heng Li [Wed, 9 Oct 2013 15:26:20 +0000 (11:26 -0400)]
let the main thread help the unfinished workers
Heng Li [Wed, 9 Oct 2013 15:01:28 +0000 (11:01 -0400)]
more comments
Heng Li [Wed, 9 Oct 2013 03:08:18 +0000 (23:08 -0400)]
forgot to remove debugging code
which causes bugs
Heng Li [Wed, 9 Oct 2013 03:01:44 +0000 (23:01 -0400)]
fixed a typo
Heng Li [Wed, 9 Oct 2013 02:52:48 +0000 (22:52 -0400)]
Merge branch 'master' of github.com:attractivechaos/klib
Heng Li [Wed, 9 Oct 2013 02:45:29 +0000 (22:45 -0400)]
for C++ compatibility
Heng Li [Wed, 9 Oct 2013 00:54:22 +0000 (20:54 -0400)]
use test-and-set for spin lock
Heng Li [Wed, 9 Oct 2013 00:45:40 +0000 (20:45 -0400)]
working, but locking is slow
Heng Li [Tue, 8 Oct 2013 20:55:28 +0000 (16:55 -0400)]
remove
Heng Li [Tue, 8 Oct 2013 20:50:21 +0000 (16:50 -0400)]
parallelize simple "for" loops
Heng Li [Tue, 8 Oct 2013 20:50:21 +0000 (16:50 -0400)]
parallelize simple "for" loops
Heng Li [Wed, 24 Jul 2013 15:19:38 +0000 (11:19 -0400)]
removed incorrect comments
Heng Li [Wed, 24 Jul 2013 15:12:19 +0000 (11:12 -0400)]
revert a change to ks_resize()
due to a mistaken merge
Heng Li [Wed, 24 Jul 2013 14:42:23 +0000 (07:42 -0700)]
Merge pull request #21 from jmarshall/kstring
Make ks_resize(&kstr,kstr.l+1) useful for ensuring the string is allocated and NUL-terminated
John Marshall [Wed, 24 Jul 2013 13:30:57 +0000 (14:30 +0100)]
Add kstring_t init/destroy documentation
Ideally these could be provided as ks_init()/ks_destroy(),
but those names are already in use with kstream_t.
John Marshall [Wed, 24 Jul 2013 13:08:25 +0000 (14:08 +0100)]
Only canonicalise if there is room, and add docs
We could increment SIZE to ensure there would be room, but that would
disadvantage people using kstrings for binary data in power-of-2-sized
blocks. Instead document that SIZE=KS.l+1 will ensure NUL-termination.
This fixes a bug in the previous version when the l<m invariant does not
hold (kputc_()/etc and manual manipulation only maintain the weaker l<=m);
hattip Rob Davies.
John Marshall [Tue, 23 Jul 2013 15:16:19 +0000 (16:16 +0100)]
ks_resize() canonicalises the stored string
It ensures the string is NUL-terminated, especially in the case that
ks_resize(&kstr,1) has been used on a newly-created kstring_t to ensure
that kstr.s is not NULL.
Heng Li [Tue, 23 Jul 2013 11:50:21 +0000 (04:50 -0700)]
Merge pull request #20 from jmarshall/kputl
Bug fix for kputl(), and kputw()/kputl() tests
John Marshall [Tue, 23 Jul 2013 10:56:15 +0000 (11:56 +0100)]
Fix kputl(LONG_MIN) bug
Use an explicitly unsigned long, and do any negation as that type.
Make similar changes to kputw(), as the code is clearer.
John Marshall [Mon, 22 Jul 2013 15:07:45 +0000 (16:07 +0100)]
Add kputw() and kputl() tests
Heng Li [Fri, 19 Jul 2013 17:58:43 +0000 (10:58 -0700)]
Merge pull request #19 from jkbonfield/master
Error checking + updates from htslib
James Bonfield [Wed, 17 Jul 2013 16:51:13 +0000 (17:51 +0100)]
Merged with attractivechaos/klib:
- add upstream kvsprintf and rework ksprintf
- add upstream printf attribute checks
- use our kputw (has MIN_INT bug fix)
- keep our extra functions (kputc_, kputsn_, kputl)
Added ks_str and ks_len functions for tidier manipulation of
internals.
Added error checking to all functions that allocate memory and could
potentially fail; ie return EOF or negative values as per stdio
equivalents.
Attractive Chaos [Mon, 15 Jul 2013 14:36:39 +0000 (07:36 -0700)]
Merge pull request #18 from sciascid/master
Document -1 extra return code in kh_put().
Daniele Sciascia [Sat, 13 Jul 2013 19:22:53 +0000 (21:22 +0200)]
Document -1 extra return code in kh_put().
Attractive Chaos [Wed, 8 May 2013 15:27:26 +0000 (08:27 -0700)]
Merge pull request #15 from yorhel/master
kstring printf improvements
Yorhel [Tue, 7 May 2013 10:03:48 +0000 (12:03 +0200)]
kstring: Add printf format attribute to kvsprintf() and ksprintf()
This allows compile-time detection of format-string related bugs.
Although the macros only check for the GCC version, clang (and perhaps
other compilers too) have these macros defined and can recognize
the formatting attributes as well.
Yorhel [Tue, 7 May 2013 09:56:49 +0000 (11:56 +0200)]
kstring: Add kvsprintf()