Fix build for MinGW

Change-Id: I3e6f4a29679996026516b1e35858e69ac9c47862
Reviewed-on: http://review.couchbase.org/21676
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
CCBC-87: Add documentation about the error codes

This patch moves the error codes to a separate file to keep
the files small and easy to navigate in. I cleaned up one
obsolete error code and added new and unique error codes
for the error situation for failures related to shared objects.

Change-Id: I09b0e5bf259ae91ed93641f8545ca43e543938d7
Reviewed-on: http://review.couchbase.org/21958
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
All enums should have explicit values

In order to ensure binary compatibility we're not going to
reuse the values if we're changing the list. By explicitly
specifying them it's easier to ensure that it doesn't happen.

Change-Id: I9485debb418989d091ca714361bcf99e9043569e
Reviewed-on: http://review.couchbase.org/21870
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Don't end an enum with a ,

Change-Id: I0f3dccb3e4d5045f6ae916ac1bada910a88123b9
Reviewed-on: http://review.couchbase.org/21966
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Add lcb_verify_compiler_setup

This method allows the "user" of the library to verify that
the compiler use a compatible struct packing scheme.

Change-Id: I26fe131a9da1685d5ea2fa1e247fb8b7b23f7872
Reviewed-on: http://review.couchbase.org/22201
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Don't use the time_t for win32

When compiling from php it turns out that it gets another
size of the time_t type, causing the struct offsets to differ.

Let's just use a 32 bit time_t for now (that's the only thing
that gets stored on the server anyway...)

Change-Id: I74fc19356f5bd41a8b86353a608ec899d60d8c86
Reviewed-on: http://review.couchbase.org/22113
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Try all known plugins for LCB_IO_OPS_DEFAULT in run time

Change-Id: Ic8ac7e49b40ea06468e5bbfb1af676f5cc0314e0
Reviewed-on: http://review.couchbase.org/22209
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
CCBC-113 Remove unauthorized asserion

The lcb_server_send_packets() function later check if the server object
connected and establish connection if not (with raising possible errors)

Change-Id: I8979d7337901a6a5e987877c6a4d1361d590c53b
Reviewed-on: http://review.couchbase.org/22266
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Michael Leib <michael_i_leib@yahoo.com>
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
CCBC-114 Lookup the plugin symbol in current executable image

The patch get back fallback with dlopen(NULL) which allows to search plugin
symbol in the main program. But if the fallback will return failure, the
create function will still use original error code.

Change-Id: Ie729d31d67ece5300e7c6c5a4568267380e8701d
Reviewed-on: http://review.couchbase.org/22265
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Michael Leib <michael_i_leib@yahoo.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Apply new packaging scheme

Now it could be recommended to install:

1) in case of development dependency (like when user need to build ruby
   extension)

     apt-get install libcouchbase-all libcouchbase-dev
     yum install libcouchbase-all libcouchbase-dev

2) in case of just library (and executable tool set)

     apt-get install libcouchbase-all
     yum install libcouchbase-all

3) in case of reduced setup, when user is going to provide its own IO
   backend (like in case of couchnode library, which uses libuv)

     apt-get install libcouchbase-core libcouchbase-dev
     yum install libcouchbase-core libcouchbase-dev

The libcouchbase.dot file:

  digraph libcouchbase {
    "libcouchbase2-all"         -> "libcouchbase-bin"       [label = "provided by"];
    "libcouchbase2"             -> "libcouchbase2-core"     [label = "depends on"];
    "libcouchbase2"             -> "libcouchbase2-backend"  [label = "depends on"];
    "libcouchbase2-backend"     -> "libcouchbase2-libevent" [label = "provided by"];
    "libcouchbase2-backend"     -> "libcouchbase2-libev"    [label = "provided by"];
    "libcouchbase-bin"          -> "libcouchbase2"          [label = "depends on"];
    "libcouchbase-dbg"          -> "libcouchbase2-core"     [label = "depends on"];
    "libcouchbase-dev"          -> "libcouchbase2-core"     [label = "depends on"];
    "libcouchbase-libev-dev"    -> "libcouchbase2-libev"    [label = "depends on"];
    "libcouchbase-libevent-dev" -> "libcouchbase2-libevent" [label = "depends on"];
    "libcouchbase-libev-dev"    -> "libcouchbase2-dev"      [label = "depends on"];
    "libcouchbase-libevent-dev" -> "libcouchbase2-dev"      [label = "depends on"];
  }

Reference: https://gist.github.com/3996394
Change-Id: I91d97cc2a7fe69c05eb679614b674f389411897e
Reviewed-on: http://review.couchbase.org/22214
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Fix README formatting

Change-Id: Ib83bf32570b141bd2a7a3576af3bdcd1f704ffdc
Reviewed-on: http://review.couchbase.org/22273
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Fix the list should be even, not odd

Change-Id: Ifc10577cc158a0dd7521dc30406caca390f0bc04
Reviewed-on: http://review.couchbase.org/22270
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
README: add hacking section

This section should help people who are trying edge version of libcouchbase.

Change-Id: I93d3281a47958ef33ea1d002bc1350f5aba0e3fd
Reviewed-on: http://review.couchbase.org/22277
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>