Build fixes

These changes comprise many smaller changes for builds, they are listed
below:

- cbc: Fix formatting for cas printf. This uses a new my_inttypes.h to
  properly format the CAS on multiple platforms
- cbc: Include stdint.h and config.h because windows lacks the uint_*
  types (they might be included in later versions of C++ but currently
- pillowfight: Apparently windows C++ doesn't think size_t and
  lcb_size_t are the same.
  break on visual studio 2010)
- Histogram: fix shadowed class member
- Fix mixed code and declarations in get.c
- Fix mixed code and declarations in negotiate.c
- Remove empty files from ioserver tests
- Clean up code for -Wno-cast-align (clang)
- Autotools: Link against snappy when enabled
- Travis: Disable snappy

Change-Id: I6311c58bb2aa103f0b0477c332ec9076cdc17883
Reviewed-on: http://review.couchbase.org/38327
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
netbuf: Use 'cursor' semantics regions with start_flush

This fixes an issue where sometimes the same data would be flushed twice
because a call to start_flush() was made before a prior call to
end_flush had completed. For some reason this was only reproducible on
IOCP/windows.

Change-Id: I466c56ca4e927f4b881a604817c994aa7766095c
Reviewed-on: http://review.couchbase.org/38328
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
iocp: don't requeue overlapped if stop_loop is called

While this might have good intentions, the ordering of operations --
namely read operations is important. If we repost an event we'd also
need to reorder everything.

I just happened to notice this while looking about :)

Change-Id: I4c542ab792db7f450e325a12b5f39d0135a0fe2a
Reviewed-on: http://review.couchbase.org/38329
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Enhance API documentation

- Undocument older create_st fields
- Document iops integration APIs with libev, libevent, and libuv

Change-Id: Ia1d889b2cfc406fde015652062b90b2640070dbf
Reviewed-on: http://review.couchbase.org/38331
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
make server->curhost a pointer

This wastes 1k of memory within the server structure and it's barely
ever accessed.

Change-Id: I6db4676138e810e8890f3a1b40b0be800811e26c
Reviewed-on: http://review.couchbase.org/38348
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
lcbio: optimize field layout and access patterns

- Move some fields closer together in lbcio_CTX
- Use cached fd field in CTX rather than ->sock. This makes it so that
  we never actually have to reference the socket structure in normal
  usage

Change-Id: Idd8cfbf7d4ec0cedb8f70dee1745bbb8bc263218
Reviewed-on: http://review.couchbase.org/38349
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
cli tools: better handling of DSN/options mixing

- Allow mixed DSN and options
- Don't use lcb_cntl() for logging. Pass it as an option to the DSN to
  allow for early logging

Change-Id: I7ac7028505756707d62176e8c4ef73c22ea085be
Reviewed-on: http://review.couchbase.org/38371
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
dsn: preparse logging level

This allows us to set the logging level early on in the library, rather
than deferring it to later invocations of lcb_cntl()

Change-Id: I93fd4c46c14d6d7de4267359289cd328cd4f1b85
Reviewed-on: http://review.couchbase.org/38372
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
dsn: copy out capath

Change-Id: I478a0720acb5fa4d8753d445497328073c4b693f
Reviewed-on: http://review.couchbase.org/38373
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Some loging enhancements

- Print host and port (and relevant pointer) for most modules that
  produce logging
- Enable printf-style compiler processing so that we can get warnings
  about mismatched arguments. Unfortunately this also results in casting
  many simpler pointer arguments to 'void*'
- bc_file provider now outputs filename
- bootstrap functions notify the user if a bootstrap request is being
  throttled.
- Add 'thread ID' in console logger output

Change-Id: If106816eabdee674c19b0989e2b8284df000b3ef
Reviewed-on: http://review.couchbase.org/38365
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Sync dsn system with latest spec

This provides support for couchbase, couchbases and http

Additionally support for https:// and couchbase+explicit:// are provided
for internal testing purposes.

Change-Id: Ia55b93de29493077f65736afba49426191675770
Reviewed-on: http://review.couchbase.org/38385
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Allow reinitialization via DSN

Change-Id: I53eb990fc9bf83e3eff99f1765463278171871c3
Reviewed-on: http://review.couchbase.org/38389
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
cliopts: initialize Option() properly

Change-Id: I465dfbb6a5cab8e0f207f6e79f73a118342db1ba
Reviewed-on: http://review.couchbase.org/38387
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
cntl.h: specify lifetime of logprocs

Change-Id: Id27ac4348a6ad15ad71d85d9fa2cf545b9f0237c
Reviewed-on: http://review.couchbase.org/38386
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
cbc: add dsn parsing command

This command will help users understand how their connection string is
being interpreted by the library.

Change-Id: I1823c09c97a7a0479909d340dd62e969c197b543
Reviewed-on: http://review.couchbase.org/38404
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
CCBC-446: Undocument LCB_KV_CONTIG for keys

This is supported functionality but the API is a bit difficult to use.
Let's expose this once we have a cleaner way of doing it.

Change-Id: I9213459bdba3479719ed68e063c5a0eee684b961
Reviewed-on: http://review.couchbase.org/38405
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
tools: move common library to its own directory

Makes it easier to build and process in the future

Change-Id: Ibd8752646e5d346863d3b23ac7be3c384d5af90c
Reviewed-on: http://review.couchbase.org/38428
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Sync release notes with 2.3.1

This simply checks out the 2.3.1 version of the release notes

Change-Id: I99033e8c0b97a8c3413c7bb03bd4385b6aa7db0b
Reviewed-on: http://review.couchbase.org/38429
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Add reasons for deprecation

Change-Id: Ia27437c9c0732eb4aae347c467746ee87c3a7670
Reviewed-on: http://review.couchbase.org/38427
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Brett Lawson <brett19@gmail.com>
autotools: Move more boilerplate to gensrclist

This affects some of the EXTRA_DIST and SOURCES variables in Makefile.am
which are now defined automatically from within config/gensrclist.pl.
These changes fix breakage caused by missing files.

Change-Id: I2bc7c8b58a51e99c726b15a3f2503a4cdafb8676