#pragma once

/*
 * Odyssey.
 *
 * Scalable PostgreSQL connection pooler.
 */

extern int pg_strcasecmp(const char *s1, const char *s2);
extern bool parse_bool(const char *value, bool *result);
extern bool parse_bool_with_len(const char *value, size_t len, bool *result);

#define HIGHBIT (0x80)
#define IS_HIGHBIT_SET(ch) ((unsigned char)(ch) & HIGHBIT)

#define od_min(a, b) ((a) < (b) ? (a) : (b))
#define od_max(a, b) ((a) > (b) ? (a) : (b))

#define ROUNDUPDIV(a, b) (((a) + (b) - 1) / (b))
