#ifndef LCB_SETTINGS_H
#define LCB_SETTINGS_H
#define LCB_S2MS(s) ((lcb_uint32_t)s) * 1000
#define LCB_S2US(s) ((lcb_uint32_t)s) * 1000000
#define LCB_S2NS(s) ((hrtime_t)s) * 1000000000
#define LCB_NS2US(s) (lcb_uint32_t) ((s) / 1000)
#define LCB_MS2US(s) (s) * 1000
#define LCB_US2NS(s) ((hrtime_t)s) * 1000
#define LCB_DEFAULT_TIMEOUT LCB_MS2US(2500)
#define LCB_DEFAULT_CONFIGURATION_TIMEOUT LCB_MS2US(5000)
#define LCB_DEFAULT_NODECONFIG_TIMEOUT LCB_MS2US(2000)
#define LCB_DEFAULT_VIEW_TIMEOUT LCB_MS2US(75000)
#define LCB_DEFAULT_N1QL_TIMEOUT LCB_MS2US(75000)
#define LCB_DEFAULT_DURABILITY_TIMEOUT LCB_MS2US(5000)
#define LCB_DEFAULT_DURABILITY_INTERVAL LCB_MS2US(100)
#define LCB_DEFAULT_HTTP_TIMEOUT LCB_MS2US(75000)
#define LCB_DEFAULT_CONFIG_MAXIMUM_REDIRECTS 3
#define LCB_DEFAULT_CONFIG_ERRORS_THRESHOLD 100
#define LCB_DEFAULT_CONFIG_ERRORS_DELAY LCB_MS2US(10000)
#define LCB_DEFAULT_CLCONFIG_GRACE_CYCLE LCB_MS2US(1000)
#define LCB_DEFAULT_CLCONFIG_GRACE_NEXT LCB_MS2US(100)
#define LCB_DEFAULT_BC_HTTP_DISCONNTMO -1
#define LCB_DEFAULT_RETRY_INTERVAL LCB_MS2US(10)
#define LCB_DEFAULT_RETRY_BACKOFF 1.5
#define LCB_DEFAULT_TOPORETRY LCB_RETRY_CMDS_ALL
#define LCB_DEFAULT_NETRETRY LCB_RETRY_CMDS_ALL
#define LCB_DEFAULT_NMVRETRY LCB_RETRY_CMDS_ALL
#define LCB_DEFAULT_HTCONFIG_URLTYPE LCB_HTCONFIG_URLTYPE_TRYALL
#define LCB_DEFAULT_COMPRESSOPTS LCB_COMPRESS_NONE
#define LCB_DEFAULT_NVM_RETRY_IMM 1
#define LCB_DEFAULT_RETRY_NMV_INTERVAL LCB_MS2US(100)
#define LCB_DEFAULT_VB_NOGUESS 1
#define LCB_DEFAULT_TCP_NODELAY 1
#include "config.h"
#include <libcouchbase/couchbase.h>
#ifdef __cplusplus
extern "C" {
#endif
struct lcb_logprocs_st;
struct lcbio_SSLCTX;
struct rdb_ALLOCATOR;
typedef struct lcb_settings_st {
lcb_U16 iid;
lcb_U8 compressopts;
lcb_U8 syncmode;
lcb_U32 read_chunk_size;
lcb_U32 operation_timeout;
lcb_U32 views_timeout;
lcb_U32 http_timeout;
lcb_U32 n1ql_timeout;
lcb_U32 durability_timeout;
lcb_U32 durability_interval;
lcb_U32 config_timeout;
lcb_U32 config_node_timeout;
lcb_U32 retry_interval;
lcb_U32 weird_things_threshold;
lcb_U32 weird_things_delay;
lcb_U32 grace_next_provider;
lcb_U32 grace_next_cycle;
lcb_U32 bc_http_stream_time;
unsigned bc_http_urltype : 4;
unsigned vb_noguess : 1;
unsigned syncdtor : 1;
unsigned detailed_neterr : 1;
unsigned randomize_bootstrap_nodes : 1;
unsigned conntype : 1;
unsigned refresh_on_hterr : 1;
unsigned sched_implicit_flush : 1;
unsigned nmv_retry_imm : 1;
unsigned keep_guess_vbs : 1;
unsigned fetch_mutation_tokens : 1;
unsigned dur_mutation_tokens : 1;
unsigned sslopts : 3;
unsigned ipv6 : 2;
unsigned tcp_nodelay : 1;
unsigned readj_ts_wait : 1;
short max_redir;
unsigned refcount;
uint8_t retry[LCB_RETRY_ON_MAX];
float retry_backoff;
char *bucket;
char *sasl_mech_force;
char *certpath;
lcb_AUTHENTICATOR *auth;
struct rdb_ALLOCATOR* (*allocator_factory)(void);
struct lcbio_SSLCTX *ssl_ctx;
struct lcb_logprocs_st *logger;
void (*dtorcb)(const void *);
void *dtorarg;
char *client_string;
lcb_U32 retry_nmv_interval;
} lcb_settings;
LCB_INTERNAL_API
void lcb_default_settings(lcb_settings *settings);
LCB_INTERNAL_API
lcb_settings *
lcb_settings_new(void);
LCB_INTERNAL_API
void
lcb_settings_unref(lcb_settings *);
#define lcb_settings_ref(settings) (settings)->refcount++
#ifdef __cplusplus
}
#endif
#endif