Fix sam_format1 failure on lines ending in integer/float tags and issue #63

This fixes a bug in sam_format1 where it gets a check to see if it has gone
off the end of the bam1_t data structure wrong when writing out optional
tags.  This affects any line ending in an integer or floating-point tag.

Also fixes __skip_tag so that it works properly with floating point tags
(issue #63).
vcf: Allow omitted trailing FORMAT fields
Rewrite __skip_tag() as skip_aux()

Redo this code similarly to swap_data() and its infrastructure, so that
it obviously handles all tag types, and making it a function rather than
an invalidly-named macro.  Fixes #63.

Fix a raft of bugs in swap_data()'s B handling -- though do we ever expect
to see another big-endian HPC machine?  Complete the partial support for
XX:d:1.5 aux tags (type 'd' for double is an existing samtools extension).
Add sam aux field tests
Merge sam_format1() and __skip_tag() fixes (PR #73)
synced_reader: Init position correctly
synced_reader: Init position correctly
Merge branch 'develop' into bcftools+calling
Add ks_release() to kstring.h

Using this function is a more explicit way of transferring ownership
than just "foo = str.s"; the latter leaves room for readers to wonder
whether a subsequent "free(str.s)" has been forgotten.
Merge branch 'develop' into bcftools+calling
Reinstate bam_header_dup as bam_hdr_dup

In the original samtools API there was an undocumented call
bam_header_dup which was used to copy an existing header.  As I
found this is rather useful in certain situations and I have
reinstated this.

Signed-off-by: Martin O. Pollard <mp15@sanger.ac.uk>
Fix typo in comment

Signed-off-by: Martin O. Pollard <mp15@sanger.ac.uk>
Merge branch 'bcftools+calling' into develop
Make hfile.h part of the public API
Add MIT/Expat license boilerplate

As noted in the copyright notices, these files are recent additions and
have been contributed to solely by GRL.  So their provenance is clear.
Define __attribute__ macros in a new (semi-public) header
Fixed comment typo
Merge pull request #79 from spalte/comment_typo

Fixed comment typo
hts_idx: fixed indexing of NO_COOR blocks

This also fixes indexing of bams with no mapped reads.
Add duplication function for the bam1_t interface

Function is present in the bam header interface (bam_hdr_dup) and only
existed in the bam_copy1(dst, src) format. Hence, code using this
interface and the header interface was incoherent.

This commit adds a bam_dup1 function implemented as a call to bam_copy1
with the proper initialization to make the API's more uniform.