Keep the style of the surrounding code
Fixes incorrect MD5 calculation in cram_write_SAM_hdr

cram_write_SAM_hdr adds a @SQ M5 tag if not already present.  When doing
this, if the reference had not already been loaded it would incorrectly
pass rlen = 0 to MD5_Update, resulting in it calculating the MD5 of an
empty file.  This patch updates rlen after the reference has been loaded
so the correct MD5 is calculated.

It also adds a check for cram_get_ref returning NULL, and calls cram_ref_decr
earlier to prevent a possible memory leak if sam_hdr_update returns non-zero.
Add HTS_IDX_NONE and document HTS_IDX_*

Also change hts_itr_next() to return -1 when iter==NULL instead of
crashing on the next line.  Presumably this is what was intended by
the original faulty "iter &&" test.
Merge #68, fix incorrect length given to MD5 calculation

Fixes #67.  Also bump copyright notice date.
Add 'a' (append) mode letter; propagate mode letters

For bgzf_[dh]open() and hts_open(), treat 'a' the same as 'w';
the underlying hopen() will treat it differently and open the file
in append mode.  So that hopen() can do that (and so that it gets
to see other eventual mode letters that it will be interested in),
propagate _mode_ itself to underlying *_open() calls rather than
slicing it to just 'r' or 'w'.

It has been verified that there is (currently) no conflict amongst
the mode letters acted upon by different *_open() functions at their
different levels.
Add "data:blahblah" in-memory hFILE backend (read-only)

Currently read-only; implementing writing would be useful but a little
more complex.

This is akin to the data URI scheme (RFC 2397) but without the leading
MIME-type etc.  We may want to change this to require (or perhaps ignore
if present) a leading comma, which would make for the same syntax as the
URI scheme.
fix remote fetching of regions for bam and vcf

hts.c: if `_USE_KNETFILE` is set, then remote fetching of a bam or vcf
region with `samtools view` or `bcftools view` will now work (after a
few attempts to get a usually non-existant .csi file).
Use hFILE rather than knet in test_and_fetch()

By using hFILE, fetching indices will work with other remote protocols
added to hFILE, e.g. iRODS.  Before this works, the existing ftp|http
check will need to be made more flexible (see FIXME).
Merge #70, fetching of remote BAM/VCF indices

Fixes #69, using the index for remote files.
Fixed a bug when loading in fasta files consisting of all sequence on
a single line and in lowercase.

The uppercasing code was only being called during the loop to strip
out newlines.
vcf: Allow omitted trailing FORMAT fields