1pub const _STDINT_H: u32 = 1;
4pub const _FEATURES_H: u32 = 1;
5pub const _DEFAULT_SOURCE: u32 = 1;
6pub const __GLIBC_USE_ISOC2X: u32 = 0;
7pub const __USE_ISOC11: u32 = 1;
8pub const __USE_ISOC99: u32 = 1;
9pub const __USE_ISOC95: u32 = 1;
10pub const __USE_POSIX_IMPLICITLY: u32 = 1;
11pub const _POSIX_SOURCE: u32 = 1;
12pub const _POSIX_C_SOURCE: u32 = 200809;
13pub const __USE_POSIX: u32 = 1;
14pub const __USE_POSIX2: u32 = 1;
15pub const __USE_POSIX199309: u32 = 1;
16pub const __USE_POSIX199506: u32 = 1;
17pub const __USE_XOPEN2K: u32 = 1;
18pub const __USE_XOPEN2K8: u32 = 1;
19pub const _ATFILE_SOURCE: u32 = 1;
20pub const __WORDSIZE: u32 = 64;
21pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
22pub const __SYSCALL_WORDSIZE: u32 = 64;
23pub const __TIMESIZE: u32 = 64;
24pub const __USE_MISC: u32 = 1;
25pub const __USE_ATFILE: u32 = 1;
26pub const __USE_FORTIFY_LEVEL: u32 = 0;
27pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
28pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
29pub const __GLIBC_USE_C2X_STRTOL: u32 = 0;
30pub const _STDC_PREDEF_H: u32 = 1;
31pub const __STDC_IEC_559__: u32 = 1;
32pub const __STDC_IEC_60559_BFP__: u32 = 201404;
33pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
34pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404;
35pub const __STDC_ISO_10646__: u32 = 201706;
36pub const __GNU_LIBRARY__: u32 = 6;
37pub const __GLIBC__: u32 = 2;
38pub const __GLIBC_MINOR__: u32 = 39;
39pub const _SYS_CDEFS_H: u32 = 1;
40pub const __glibc_c99_flexarr_available: u32 = 1;
41pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0;
42pub const __HAVE_GENERIC_SELECTION: u32 = 1;
43pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
44pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
45pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0;
46pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0;
47pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
48pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0;
49pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
50pub const _BITS_TYPES_H: u32 = 1;
51pub const _BITS_TYPESIZES_H: u32 = 1;
52pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
53pub const __INO_T_MATCHES_INO64_T: u32 = 1;
54pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
55pub const __STATFS_MATCHES_STATFS64: u32 = 1;
56pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1;
57pub const __FD_SETSIZE: u32 = 1024;
58pub const _BITS_TIME64_H: u32 = 1;
59pub const _BITS_WCHAR_H: u32 = 1;
60pub const _BITS_STDINT_INTN_H: u32 = 1;
61pub const _BITS_STDINT_UINTN_H: u32 = 1;
62pub const _BITS_STDINT_LEAST_H: u32 = 1;
63pub const INT8_MIN: i32 = -128;
64pub const INT16_MIN: i32 = -32768;
65pub const INT32_MIN: i32 = -2147483648;
66pub const INT8_MAX: u32 = 127;
67pub const INT16_MAX: u32 = 32767;
68pub const INT32_MAX: u32 = 2147483647;
69pub const UINT8_MAX: u32 = 255;
70pub const UINT16_MAX: u32 = 65535;
71pub const UINT32_MAX: u32 = 4294967295;
72pub const INT_LEAST8_MIN: i32 = -128;
73pub const INT_LEAST16_MIN: i32 = -32768;
74pub const INT_LEAST32_MIN: i32 = -2147483648;
75pub const INT_LEAST8_MAX: u32 = 127;
76pub const INT_LEAST16_MAX: u32 = 32767;
77pub const INT_LEAST32_MAX: u32 = 2147483647;
78pub const UINT_LEAST8_MAX: u32 = 255;
79pub const UINT_LEAST16_MAX: u32 = 65535;
80pub const UINT_LEAST32_MAX: u32 = 4294967295;
81pub const INT_FAST8_MIN: i32 = -128;
82pub const INT_FAST16_MIN: i64 = -9223372036854775808;
83pub const INT_FAST32_MIN: i64 = -9223372036854775808;
84pub const INT_FAST8_MAX: u32 = 127;
85pub const INT_FAST16_MAX: u64 = 9223372036854775807;
86pub const INT_FAST32_MAX: u64 = 9223372036854775807;
87pub const UINT_FAST8_MAX: u32 = 255;
88pub const UINT_FAST16_MAX: i32 = -1;
89pub const UINT_FAST32_MAX: i32 = -1;
90pub const INTPTR_MIN: i64 = -9223372036854775808;
91pub const INTPTR_MAX: u64 = 9223372036854775807;
92pub const UINTPTR_MAX: i32 = -1;
93pub const PTRDIFF_MIN: i64 = -9223372036854775808;
94pub const PTRDIFF_MAX: u64 = 9223372036854775807;
95pub const SIG_ATOMIC_MIN: i32 = -2147483648;
96pub const SIG_ATOMIC_MAX: u32 = 2147483647;
97pub const SIZE_MAX: i32 = -1;
98pub const WINT_MIN: u32 = 0;
99pub const WINT_MAX: u32 = 4294967295;
100pub type wchar_t = ::std::os::raw::c_int;
101#[repr(C)]
102#[repr(align(16))]
103#[derive(Debug, Copy, Clone)]
104pub struct max_align_t {
105 pub __clang_max_align_nonce1: ::std::os::raw::c_longlong,
106 pub __bindgen_padding_0: u64,
107 pub __clang_max_align_nonce2: u128,
108}
109#[allow(clippy::unnecessary_operation, clippy::identity_op)]
110const _: () = {
111 ["Size of max_align_t"][::std::mem::size_of::<max_align_t>() - 32usize];
112 ["Alignment of max_align_t"][::std::mem::align_of::<max_align_t>() - 16usize];
113 ["Offset of field: max_align_t::__clang_max_align_nonce1"]
114 [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce1) - 0usize];
115 ["Offset of field: max_align_t::__clang_max_align_nonce2"]
116 [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce2) - 16usize];
117};
118pub type __u_char = ::std::os::raw::c_uchar;
119pub type __u_short = ::std::os::raw::c_ushort;
120pub type __u_int = ::std::os::raw::c_uint;
121pub type __u_long = ::std::os::raw::c_ulong;
122pub type __int8_t = ::std::os::raw::c_schar;
123pub type __uint8_t = ::std::os::raw::c_uchar;
124pub type __int16_t = ::std::os::raw::c_short;
125pub type __uint16_t = ::std::os::raw::c_ushort;
126pub type __int32_t = ::std::os::raw::c_int;
127pub type __uint32_t = ::std::os::raw::c_uint;
128pub type __int64_t = ::std::os::raw::c_long;
129pub type __uint64_t = ::std::os::raw::c_ulong;
130pub type __int_least8_t = __int8_t;
131pub type __uint_least8_t = __uint8_t;
132pub type __int_least16_t = __int16_t;
133pub type __uint_least16_t = __uint16_t;
134pub type __int_least32_t = __int32_t;
135pub type __uint_least32_t = __uint32_t;
136pub type __int_least64_t = __int64_t;
137pub type __uint_least64_t = __uint64_t;
138pub type __quad_t = ::std::os::raw::c_long;
139pub type __u_quad_t = ::std::os::raw::c_ulong;
140pub type __intmax_t = ::std::os::raw::c_long;
141pub type __uintmax_t = ::std::os::raw::c_ulong;
142pub type __dev_t = ::std::os::raw::c_ulong;
143pub type __uid_t = ::std::os::raw::c_uint;
144pub type __gid_t = ::std::os::raw::c_uint;
145pub type __ino_t = ::std::os::raw::c_ulong;
146pub type __ino64_t = ::std::os::raw::c_ulong;
147pub type __mode_t = ::std::os::raw::c_uint;
148pub type __nlink_t = ::std::os::raw::c_ulong;
149pub type __off_t = ::std::os::raw::c_long;
150pub type __off64_t = ::std::os::raw::c_long;
151pub type __pid_t = ::std::os::raw::c_int;
152#[repr(C)]
153#[derive(Debug, Copy, Clone)]
154pub struct __fsid_t {
155 pub __val: [::std::os::raw::c_int; 2usize],
156}
157#[allow(clippy::unnecessary_operation, clippy::identity_op)]
158const _: () = {
159 ["Size of __fsid_t"][::std::mem::size_of::<__fsid_t>() - 8usize];
160 ["Alignment of __fsid_t"][::std::mem::align_of::<__fsid_t>() - 4usize];
161 ["Offset of field: __fsid_t::__val"][::std::mem::offset_of!(__fsid_t, __val) - 0usize];
162};
163pub type __clock_t = ::std::os::raw::c_long;
164pub type __rlim_t = ::std::os::raw::c_ulong;
165pub type __rlim64_t = ::std::os::raw::c_ulong;
166pub type __id_t = ::std::os::raw::c_uint;
167pub type __time_t = ::std::os::raw::c_long;
168pub type __useconds_t = ::std::os::raw::c_uint;
169pub type __suseconds_t = ::std::os::raw::c_long;
170pub type __suseconds64_t = ::std::os::raw::c_long;
171pub type __daddr_t = ::std::os::raw::c_int;
172pub type __key_t = ::std::os::raw::c_int;
173pub type __clockid_t = ::std::os::raw::c_int;
174pub type __timer_t = *mut ::std::os::raw::c_void;
175pub type __blksize_t = ::std::os::raw::c_long;
176pub type __blkcnt_t = ::std::os::raw::c_long;
177pub type __blkcnt64_t = ::std::os::raw::c_long;
178pub type __fsblkcnt_t = ::std::os::raw::c_ulong;
179pub type __fsblkcnt64_t = ::std::os::raw::c_ulong;
180pub type __fsfilcnt_t = ::std::os::raw::c_ulong;
181pub type __fsfilcnt64_t = ::std::os::raw::c_ulong;
182pub type __fsword_t = ::std::os::raw::c_long;
183pub type __ssize_t = ::std::os::raw::c_long;
184pub type __syscall_slong_t = ::std::os::raw::c_long;
185pub type __syscall_ulong_t = ::std::os::raw::c_ulong;
186pub type __loff_t = __off64_t;
187pub type __caddr_t = *mut ::std::os::raw::c_char;
188pub type __intptr_t = ::std::os::raw::c_long;
189pub type __socklen_t = ::std::os::raw::c_uint;
190pub type __sig_atomic_t = ::std::os::raw::c_int;
191pub type int_least8_t = __int_least8_t;
192pub type int_least16_t = __int_least16_t;
193pub type int_least32_t = __int_least32_t;
194pub type int_least64_t = __int_least64_t;
195pub type uint_least8_t = __uint_least8_t;
196pub type uint_least16_t = __uint_least16_t;
197pub type uint_least32_t = __uint_least32_t;
198pub type uint_least64_t = __uint_least64_t;
199pub type int_fast8_t = ::std::os::raw::c_schar;
200pub type int_fast16_t = ::std::os::raw::c_long;
201pub type int_fast32_t = ::std::os::raw::c_long;
202pub type int_fast64_t = ::std::os::raw::c_long;
203pub type uint_fast8_t = ::std::os::raw::c_uchar;
204pub type uint_fast16_t = ::std::os::raw::c_ulong;
205pub type uint_fast32_t = ::std::os::raw::c_ulong;
206pub type uint_fast64_t = ::std::os::raw::c_ulong;
207pub type intmax_t = __intmax_t;
208pub type uintmax_t = __uintmax_t;
209#[repr(C)]
210#[derive(Debug, Copy, Clone)]
211pub struct PdStr {
212 pub len: usize,
213 pub data: *mut ::std::os::raw::c_void,
214}
215#[allow(clippy::unnecessary_operation, clippy::identity_op)]
216const _: () = {
217 ["Size of PdStr"][::std::mem::size_of::<PdStr>() - 16usize];
218 ["Alignment of PdStr"][::std::mem::align_of::<PdStr>() - 8usize];
219 ["Offset of field: PdStr::len"][::std::mem::offset_of!(PdStr, len) - 0usize];
220 ["Offset of field: PdStr::data"][::std::mem::offset_of!(PdStr, data) - 8usize];
221};
222pub type RustString = PdStr;
223#[repr(C)]
224#[derive(Debug, Copy, Clone)]
225pub struct PdStatement {
226 pub version: i32,
227 pub len: u64,
228 pub data: *mut ::std::os::raw::c_void,
229}
230#[allow(clippy::unnecessary_operation, clippy::identity_op)]
231const _: () = {
232 ["Size of PdStatement"][::std::mem::size_of::<PdStatement>() - 24usize];
233 ["Alignment of PdStatement"][::std::mem::align_of::<PdStatement>() - 8usize];
234 ["Offset of field: PdStatement::version"]
235 [::std::mem::offset_of!(PdStatement, version) - 0usize];
236 ["Offset of field: PdStatement::len"][::std::mem::offset_of!(PdStatement, len) - 8usize];
237 ["Offset of field: PdStatement::data"][::std::mem::offset_of!(PdStatement, data) - 16usize];
238};
239#[doc = " Context on the database cluster configuration and the currently processed\n PostgreSQL statement.\n\n This struct is C FFI-safe and therefore uses C types. Use public methods to interact with it instead\n of reading the data directly."]
240#[repr(C)]
241#[derive(Debug, Copy, Clone)]
242pub struct PdRouterContext {
243 #[doc = " How many shards are configured."]
244 pub shards: u64,
245 #[doc = " Does the database cluster have replicas? `1` = `true`, `0` = `false`."]
246 pub has_replicas: u8,
247 #[doc = " Does the database cluster have a primary? `1` = `true`, `0` = `false`."]
248 pub has_primary: u8,
249 #[doc = " Is the query being executed inside a transaction? `1` = `true`, `0` = `false`."]
250 pub in_transaction: u8,
251 #[doc = " PgDog strongly believes this statement should go to a primary. `1` = `true`, `0` = `false`."]
252 pub write_override: u8,
253 #[doc = " pg_query generated Abstract Syntax Tree of the statement."]
254 pub query: PdStatement,
255}
256#[allow(clippy::unnecessary_operation, clippy::identity_op)]
257const _: () = {
258 ["Size of PdRouterContext"][::std::mem::size_of::<PdRouterContext>() - 40usize];
259 ["Alignment of PdRouterContext"][::std::mem::align_of::<PdRouterContext>() - 8usize];
260 ["Offset of field: PdRouterContext::shards"]
261 [::std::mem::offset_of!(PdRouterContext, shards) - 0usize];
262 ["Offset of field: PdRouterContext::has_replicas"]
263 [::std::mem::offset_of!(PdRouterContext, has_replicas) - 8usize];
264 ["Offset of field: PdRouterContext::has_primary"]
265 [::std::mem::offset_of!(PdRouterContext, has_primary) - 9usize];
266 ["Offset of field: PdRouterContext::in_transaction"]
267 [::std::mem::offset_of!(PdRouterContext, in_transaction) - 10usize];
268 ["Offset of field: PdRouterContext::write_override"]
269 [::std::mem::offset_of!(PdRouterContext, write_override) - 11usize];
270 ["Offset of field: PdRouterContext::query"]
271 [::std::mem::offset_of!(PdRouterContext, query) - 16usize];
272};
273#[doc = " Routing decision returned by the plugin."]
274#[repr(C)]
275#[derive(Debug, Copy, Clone)]
276pub struct PdRoute {
277 #[doc = " Which shard the query should go to.\n\n `-1` for all shards, `-2` for unknown, this setting is ignored."]
278 pub shard: i64,
279 #[doc = " Is the query a read and should go to a replica?\n\n `1` for `true`, `0` for `false`, `2` for unknown, this setting is ignored."]
280 pub read_write: u8,
281}
282#[allow(clippy::unnecessary_operation, clippy::identity_op)]
283const _: () = {
284 ["Size of PdRoute"][::std::mem::size_of::<PdRoute>() - 16usize];
285 ["Alignment of PdRoute"][::std::mem::align_of::<PdRoute>() - 8usize];
286 ["Offset of field: PdRoute::shard"][::std::mem::offset_of!(PdRoute, shard) - 0usize];
287 ["Offset of field: PdRoute::read_write"][::std::mem::offset_of!(PdRoute, read_write) - 8usize];
288};