]> git.kaiwu.me - klib.git/log
klib.git
10 years agoPrevent unused function warnings in khash.h, klist.h
John Marshall [Tue, 24 Mar 2015 09:37:12 +0000 (09:37 +0000)]
Prevent unused function warnings in khash.h, klist.h

Recent versions of Clang warn about unused static inline functions
in .c files (though they suppress this warning for such definitions
in header files).  Definitions via KHASH_INIT etc are effectively in
the .c file, and it's impractical to make these inline other than
static inline; so add attributes to suppress these warnings.

10 years agoMerge pull request #52 from ihh/master
Heng Li [Fri, 26 Jun 2015 19:27:38 +0000 (15:27 -0400)]
Merge pull request #52 from ihh/master

Fixed output bug where leaf branch length is not printed

10 years agoFixed output bug where branch length is not printed on branches to leaf nodes
Ian Holmes [Fri, 26 Jun 2015 18:21:26 +0000 (14:21 -0400)]
Fixed output bug where branch length is not printed on branches to leaf nodes

10 years agofixed a bug and a portability issue
Heng Li [Fri, 22 May 2015 18:35:19 +0000 (14:35 -0400)]
fixed a bug and a portability issue

10 years agodon't stop on undefined functions
Heng Li [Fri, 22 May 2015 18:02:38 +0000 (14:02 -0400)]
don't stop on undefined functions

10 years agoset user-defined functions
Heng Li [Fri, 22 May 2015 14:54:16 +0000 (10:54 -0400)]
set user-defined functions

10 years agocode cleanup
Heng Li [Fri, 22 May 2015 13:53:25 +0000 (09:53 -0400)]
code cleanup

10 years agodon't return a parse error if see undef func
Heng Li [Fri, 22 May 2015 13:42:03 +0000 (09:42 -0400)]
don't return a parse error if see undef func

10 years agoa little bit code cleanup
Heng Li [Fri, 22 May 2015 13:36:05 +0000 (09:36 -0400)]
a little bit code cleanup

10 years agomoved argument checking to ke_parse()
Heng Li [Fri, 22 May 2015 13:12:15 +0000 (09:12 -0400)]
moved argument checking to ke_parse()

10 years agosimplified ke_eval() with operator functions
Heng Li [Fri, 22 May 2015 13:02:38 +0000 (09:02 -0400)]
simplified ke_eval() with operator functions

10 years agouse operator functions
Heng Li [Fri, 22 May 2015 12:50:12 +0000 (08:50 -0400)]
use operator functions

10 years agosupport single-quotation mark and escaping
Heng Li [Fri, 22 May 2015 02:29:24 +0000 (22:29 -0400)]
support single-quotation mark and escaping

10 years agocommand line assignment
Heng Li [Fri, 22 May 2015 02:26:56 +0000 (22:26 -0400)]
command line assignment

10 years agocheck unknown function names
Heng Li [Fri, 22 May 2015 02:18:41 +0000 (22:18 -0400)]
check unknown function names

10 years agoreturn final type
Heng Li [Fri, 22 May 2015 02:12:02 +0000 (22:12 -0400)]
return final type

10 years agosupport assignment
Heng Li [Fri, 22 May 2015 02:05:51 +0000 (22:05 -0400)]
support assignment

10 years agofixed a bug related to functions
Heng Li [Fri, 22 May 2015 01:54:10 +0000 (21:54 -0400)]
fixed a bug related to functions

10 years agoadded a few unary functions
Heng Li [Fri, 22 May 2015 01:50:26 +0000 (21:50 -0400)]
added a few unary functions

10 years agoeval working
Heng Li [Fri, 22 May 2015 01:38:12 +0000 (21:38 -0400)]
eval working

10 years agochanged a variable name
Heng Li [Thu, 21 May 2015 23:38:46 +0000 (19:38 -0400)]
changed a variable name

10 years agoadded ** and //
Heng Li [Thu, 21 May 2015 23:14:51 +0000 (19:14 -0400)]
added ** and //

10 years agosupport ","
Heng Li [Thu, 21 May 2015 23:01:43 +0000 (19:01 -0400)]
support ","

10 years agoparse math expression with Shunting-yard
Heng Li [Thu, 21 May 2015 19:58:14 +0000 (15:58 -0400)]
parse math expression with Shunting-yard

11 years agoa bit more comments
Heng Li [Sun, 11 Jan 2015 21:29:39 +0000 (16:29 -0500)]
a bit more comments

11 years agoallow to change pipeline threads
Heng Li [Sun, 11 Jan 2015 21:27:22 +0000 (16:27 -0500)]
allow to change pipeline threads

11 years agokt_pipeline() example
Heng Li [Sun, 11 Jan 2015 21:24:54 +0000 (16:24 -0500)]
kt_pipeline() example

11 years agoerh... wrong link in the last commit
Heng Li [Mon, 1 Dec 2014 01:07:04 +0000 (20:07 -0500)]
erh... wrong link in the last commit

11 years agoadded a link to the new doc
Heng Li [Mon, 1 Dec 2014 01:04:22 +0000 (20:04 -0500)]
added a link to the new doc

11 years agoadded links to the new tiddlywiki doc
Heng Li [Mon, 1 Dec 2014 00:52:22 +0000 (19:52 -0500)]
added links to the new tiddlywiki doc

11 years agokson_query() -> kson_by_path() for clarity
Heng Li [Sun, 30 Nov 2014 06:15:00 +0000 (01:15 -0500)]
kson_query() -> kson_by_path() for clarity

11 years agosimplified format() due to a later change
Heng Li [Sun, 30 Nov 2014 05:53:37 +0000 (00:53 -0500)]
simplified format() due to a later change

11 years agorename a member var for clarity
Heng Li [Sun, 30 Nov 2014 05:47:00 +0000 (00:47 -0500)]
rename a member var for clarity

11 years agoremoved *error from kson_parse()
Heng Li [Sun, 30 Nov 2014 05:40:26 +0000 (00:40 -0500)]
removed *error from kson_parse()

Few would be interested in this error code

11 years agoremoved kt_spawn(); added kt_pipeline()
Heng Li [Sun, 30 Nov 2014 05:13:29 +0000 (00:13 -0500)]
removed kt_spawn(); added kt_pipeline()

11 years agomissing include
Heng Li [Sun, 30 Nov 2014 03:13:15 +0000 (22:13 -0500)]
missing include

11 years agoget rid of stdint.h for portability
Heng Li [Sun, 30 Nov 2014 01:44:23 +0000 (20:44 -0500)]
get rid of stdint.h for portability

11 years agominor
Heng Li [Sun, 30 Nov 2014 01:37:04 +0000 (20:37 -0500)]
minor

11 years agominor change
Heng Li [Sun, 30 Nov 2014 01:35:28 +0000 (20:35 -0500)]
minor change

11 years agosimplified the struct
Heng Li [Sun, 30 Nov 2014 01:06:53 +0000 (20:06 -0500)]
simplified the struct

11 years agosimplified the struct a little
Heng Li [Sun, 30 Nov 2014 01:00:28 +0000 (20:00 -0500)]
simplified the struct a little

11 years agosimplified API
Heng Li [Sun, 30 Nov 2014 00:54:16 +0000 (19:54 -0500)]
simplified API

11 years agoquery on CMD; more chanages to happen
Heng Li [Sun, 30 Nov 2014 00:40:08 +0000 (19:40 -0500)]
query on CMD; more chanages to happen

11 years agofixed an error in the example (due to prev rev)
Heng Li [Sun, 30 Nov 2014 00:00:53 +0000 (19:00 -0500)]
fixed an error in the example (due to prev rev)

11 years agoa bit code cleaup
Heng Li [Sat, 29 Nov 2014 23:55:36 +0000 (18:55 -0500)]
a bit code cleaup

11 years agoindent output
Heng Li [Sat, 29 Nov 2014 23:54:26 +0000 (18:54 -0500)]
indent output

11 years agominor change
Heng Li [Sat, 29 Nov 2014 23:24:52 +0000 (18:24 -0500)]
minor change

11 years agoadded JSON query
Heng Li [Sat, 29 Nov 2014 23:20:35 +0000 (18:20 -0500)]
added JSON query

11 years agoisblank() -> isspace()
Heng Li [Sat, 29 Nov 2014 18:02:17 +0000 (13:02 -0500)]
isblank() -> isspace()

11 years agono effective changes
Heng Li [Sat, 29 Nov 2014 18:00:19 +0000 (13:00 -0500)]
no effective changes

11 years agosimplified API a bit
Heng Li [Sat, 29 Nov 2014 17:59:10 +0000 (12:59 -0500)]
simplified API a bit

11 years agofixed compilation error in the last commit
Heng Li [Sat, 29 Nov 2014 17:41:26 +0000 (12:41 -0500)]
fixed compilation error in the last commit

11 years agoadded deallocator
Heng Li [Sat, 29 Nov 2014 17:40:39 +0000 (12:40 -0500)]
added deallocator

11 years agoadded API documentation
Heng Li [Sat, 29 Nov 2014 17:37:57 +0000 (12:37 -0500)]
added API documentation

11 years agocode cleanup
Heng Li [Sat, 29 Nov 2014 17:28:04 +0000 (12:28 -0500)]
code cleanup

11 years agoimproved comments a little
Heng Li [Sat, 29 Nov 2014 17:21:42 +0000 (12:21 -0500)]
improved comments a little

11 years agobug for empty []/{}; check extra left brackets
Heng Li [Sat, 29 Nov 2014 17:09:47 +0000 (12:09 -0500)]
bug for empty []/{}; check extra left brackets

11 years agorename brackets
Heng Li [Sat, 29 Nov 2014 17:05:12 +0000 (12:05 -0500)]
rename brackets

11 years agoadded a bit error checking
Heng Li [Sat, 29 Nov 2014 17:01:31 +0000 (12:01 -0500)]
added a bit error checking

11 years agoA light-weight JSON parser
Heng Li [Sat, 29 Nov 2014 16:48:11 +0000 (11:48 -0500)]
A light-weight JSON parser

11 years agogive kh_##name##_t a struct name
Heng Li [Sat, 29 Nov 2014 02:04:38 +0000 (21:04 -0500)]
give kh_##name##_t a struct name

11 years agodefault to following redirect & no SSL certificate
Heng Li [Fri, 28 Nov 2014 16:49:11 +0000 (11:49 -0500)]
default to following redirect & no SSL certificate

11 years agoMerge pull request #39 from jmarshall/kseq-eof
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

11 years agoFix 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.)

11 years agoSimplify 8d8d1a19f0c69b53d5ed8d9f6592dfa4b91c23f3 code changes
John Marshall [Thu, 13 Nov 2014 11:57:56 +0000 (11:57 +0000)]
Simplify 8d8d1a19f0c69b53d5ed8d9f6592dfa4b91c23f3 code changes

11 years agoMerge branch 'master' of github.com:attractivechaos/klib
Heng Li [Mon, 10 Nov 2014 21:05:06 +0000 (16:05 -0500)]
Merge branch 'master' of github.com:attractivechaos/klib

11 years agobug with incomplete read() call
Heng Li [Mon, 10 Nov 2014 21:04:13 +0000 (16:04 -0500)]
bug with incomplete read() call

See also issue #43 of seqtk

11 years agoMerge pull request #38 from immerrr/enable-inline-macro-overrides
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

11 years agoEnable 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

11 years agoMerge pull request #28 from piki/fix-new_flags-leak
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

12 years agoMerge pull request #31 from jmarshall/warnings
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

12 years agoSilence -Wstrict-prototypes and static analyser warnings
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.

12 years agofix the leak that happens if krealloc fails
Patrick Reynolds [Sun, 9 Feb 2014 08:24:08 +0000 (02:24 -0600)]
fix the leak that happens if krealloc fails

12 years agoMerge branch 'master' of github.com:attractivechaos/klib
Heng Li [Sat, 7 Dec 2013 14:28:32 +0000 (09:28 -0500)]
Merge branch 'master' of github.com:attractivechaos/klib

12 years agodon't seek when opening
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.

12 years agoMerge pull request #26 from zhanxw/patch-1
Heng Li [Sun, 1 Dec 2013 17:27:44 +0000 (09:27 -0800)]
Merge pull request #26 from zhanxw/patch-1

Update ksort.h

12 years agoUpdate 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.

12 years agofixed a bug in seek
Heng Li [Sun, 24 Nov 2013 19:59:37 +0000 (14:59 -0500)]
fixed a bug in seek

12 years agoadded a note about S3
Heng Li [Thu, 21 Nov 2013 18:13:57 +0000 (13:13 -0500)]
added a note about S3

12 years agoadded HMAC-SHA1 to drop the openssl dependency
Heng Li [Thu, 21 Nov 2013 17:51:44 +0000 (12:51 -0500)]
added HMAC-SHA1 to drop the openssl dependency

12 years agoallow to feed change key/secret/id-file
Heng Li [Thu, 21 Nov 2013 05:22:33 +0000 (00:22 -0500)]
allow to feed change key/secret/id-file

12 years agosupport the s3:// protocol
Heng Li [Thu, 21 Nov 2013 05:13:05 +0000 (00:13 -0500)]
support the s3:// protocol

12 years agohalve the buffer size
Heng Li [Wed, 20 Nov 2013 19:32:49 +0000 (14:32 -0500)]
halve the buffer size

12 years agouse fixed-length buffer with pause()
Heng Li [Wed, 20 Nov 2013 19:18:19 +0000 (14:18 -0500)]
use fixed-length buffer with pause()

12 years agoignore signal
Heng Li [Wed, 20 Nov 2013 16:23:02 +0000 (11:23 -0500)]
ignore signal

12 years agoneed to grow buffer
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.

12 years agowrong dopen() interface
Heng Li [Tue, 19 Nov 2013 02:35:23 +0000 (21:35 -0500)]
wrong dopen() interface

12 years agoforgot ";"
Heng Li [Tue, 19 Nov 2013 02:04:58 +0000 (21:04 -0500)]
forgot ";"

12 years agoforgot to alias kurl_t to knetFile
Heng Li [Tue, 19 Nov 2013 02:04:40 +0000 (21:04 -0500)]
forgot to alias kurl_t to knetFile

12 years agoemulating knetfile APIs
Heng Li [Tue, 19 Nov 2013 02:03:25 +0000 (21:03 -0500)]
emulating knetfile APIs

12 years agoadded dopen()/buflen() and optional options
Heng Li [Tue, 19 Nov 2013 01:42:28 +0000 (20:42 -0500)]
added dopen()/buflen() and optional options

12 years agouse larger buffer for remote files
Heng Li [Mon, 18 Nov 2013 20:39:12 +0000 (15:39 -0500)]
use larger buffer for remote files

12 years agoFixed slow sftp/scp connection
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.

12 years agobetter CLI
Heng Li [Mon, 18 Nov 2013 17:18:34 +0000 (12:18 -0500)]
better CLI

sftp connection is really slow. Don't know why.

12 years agobetter interface and documentations
Heng Li [Mon, 18 Nov 2013 16:48:26 +0000 (11:48 -0500)]
better interface and documentations

12 years agoknetfile-like interface to CURL
Heng Li [Mon, 18 Nov 2013 15:55:21 +0000 (10:55 -0500)]
knetfile-like interface to CURL

12 years agoforgot the header file
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.

12 years agoadded a more flexible scheduler; not tested
Heng Li [Fri, 11 Oct 2013 17:17:26 +0000 (13:17 -0400)]
added a more flexible scheduler; not tested

not thoroughly

12 years agochange the argument ordering
Heng Li [Fri, 11 Oct 2013 13:34:42 +0000 (09:34 -0400)]
change the argument ordering

12 years agoadded the test program for kthread
Heng Li [Fri, 11 Oct 2013 03:28:17 +0000 (23:28 -0400)]
added the test program for kthread