Merge pull request #108 from MauricioCarneiro/develop

synced_bcf_reader: Add extern "C" to enable C++ linking
Fixed REF_PATH to handle URLs better.

Without a REF_PATH it now defaults to using the EBI's MD5 service.
With a REF_PATH it now parses it in a friendly fashion. The URL= part
is now optional, instead auto-detecting http: and ftp: (no https yet).
Also even when using : as a path separator, when faced with a URL it
knows the syntax and treats the colons in http://host:80 as part of
the URL and not the separator. The old :: escape still works.
vcf: Detect broken structured header lines
synced_reader: Logical complements of target regions
bgzf: Translate windows line endings

so that files produced on windows (\r\n) can be read on
UNIX systems (\n)
bcf_hdr_combine: Check for tags of conflicting lengths
faidx: Exit with an error if run on gzip-ed files
Suppress compression suffix search on default EBI MD5 service

The default REF_PATH setting should not query EBI's MD5 service for
compressed files like <md5>.Z, because such queries will always fail.

Also fix the URL colon auto-detection when used in conjunction with '|'
to suppress suffix searching.
Merge REF_PATH fixes and libcurl removal (PR #111)

Eventually we will want an htslib-native open_path_hfile() and then to
get rid of open_trace_file.[ch] and associated code, but for now this
implementation serves us well.

(Also fix Makefile dependencies and use hclose_abruptly() for cleanup.)
vcf: Support for mpileup's symbolic <X> allele
On open failure, set errno instead of printing message

Having this low-level routine printing diagnostics itself causes
problems now that hopen() is used to resolve files via paths such
as $REF_PATH.  If the file is fulfilled by the second path entry,
a not-found error may already have been printed from the first entry.

Instead set errno so that higher-level callers have a chance to emit
a useful error message themselves where appropriate.
Expose bcf_hdr_parse
vcf: Expose bcf_hdr_sync() and hrec_add_idx()
vcf: bcf_hdr_get_hrec() interface made more general

Changed behavior of bcf_hdr_combine() to be more terse, don't
add generic header lines with the same key. This may be not
desired in some situations, in that case a new parameter 'flags'
can be added to control the behavior.
mpileup: Support for cigar operator "P"
faidx: new faidx_has_seq() call
faidx: Fixed copy-and-paste documentation error
hts_file_type: correct return of FT_VCF_GZ
Merge pull request #113 from mcshane/feature/hts_file_type_fix

hts_file_type: correct return of FT_VCF_GZ
Don't call freeaddrinfo() when getaddrinfo() fails

POSIX is somewhat unclear here, but doing so segfaults on some
platforms.  Hat tip Kamil Slowikowski @slowkow.

Instead print a more detailed error message using gai_strerror().

[Cherry-picked from patch submitted to upstream klib.]