/
go_no_c_link.go
213 lines (164 loc) · 5.85 KB
/
go_no_c_link.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
//go:build !enable_ce
// +build !enable_ce
package pq
import "unsafe"
type Cchar = string
type Cint = int
type Csize_t = uint32
type PGconn = unsafe.Pointer
type StatementData = unsafe.Pointer
type Cuint = uint
type Culong = uint32
type CLRefreshParams = unsafe.Pointer
type PGClientLogic = unsafe.Pointer
type Coid = uint
func bool_to_Cint(b bool) Cint {
if b {
return Cint(1)
} else {
return Cint(0)
}
}
func Cint_to_bool(i Cint) bool {
return i != Cint(0)
}
func Cmalloc(sz Csize_t) unsafe.Pointer {
panic("Bad function call Cmalloc")
}
func CString(str string) *Cchar {
panic("Bad function call CString")
}
func GoString(str *Cchar) string {
panic("Bad function call GoString")
}
func Cfree(ptr unsafe.Pointer) {
panic("Bad function call Cfree")
}
func variadic_Cfree(ptrs ...unsafe.Pointer) {
panic("Bad function call variadic_Cfree")
}
func GoBytes(ptr unsafe.Pointer, len Cint) []byte {
panic("Bad function call GoBytes")
}
func CBytes(bytes []byte) unsafe.Pointer {
panic("Bad function call CBytes")
}
func run_post_query(conn *PGconn, rfq_cache_refresh_type Cint, conn_status bool) Cint {
panic("Bad function call run_post_query")
}
func run_pre_query(conn *PGconn, stmt_name *Cchar, query *Cchar, client_side_error *Cint) *StatementData {
panic("Bad function call run_pre_query")
}
func run_pre_exec(conn *PGconn, stmt_name *Cchar, params_count Csize_t, params_values **Cchar,
params_lengths *Cint, params_formats *Cint, client_side_error *Cint) *StatementData {
panic("Bad function call run_pre_exec")
}
func accept_pending_statements(conn *PGconn) Cint {
panic("Bad function call accept_pending_statements")
}
func free_mem_manager() {
panic("Bad function call free_mem_manager")
}
func deprocess_value(processed_value *Cchar, processed_value_len Cint, original_type Cint,
length_output *Csize_t, output_binary_format Cint, pgconn *PGconn) *Cchar {
panic("Bad function call deprocess_value")
}
func deprocess_record(processed_value *Cchar, processed_value_len Cint, original_type Cint, length_output *Csize_t,
function_name *Cchar, output_binary_format Cint, ttype Cuint, pgconn *PGconn) *Cchar {
panic("Bad function call deprocess_record")
}
func statement_data_get_query(statement_data *StatementData) *Cchar {
panic("Bad function call statement_data_get_query")
}
func pgconn_errmsg(pgconn *PGconn) *Cchar {
panic("Bad function call pgconn_errmsg")
}
func delete_statementdata_c(statement_data *StatementData) {
panic("Bad function call delete_statementdata_c")
}
func post_check_resend_query_on_error(conn *PGconn) {
panic("Bad function call post_check_resend_query_on_error")
}
func pre_check_resend_query_on_error(conn *PGconn) bool {
panic("Bad function call pre_check_resend_query_on_error")
}
func is_any_refresh_cache_on_error(conn *PGconn) bool {
panic("Bad function call is_any_refresh_cache_on_error")
}
func pgconn_init(go_conn unsafe.Pointer, user *Cchar, user_len Cint,
database *Cchar, database_len Cint,
application_name *Cchar, application_name_len Cint, enable_full_encryption Cint) *PGconn {
panic("Bad function call pgconn_init")
}
func pgconn_free(conn *PGconn) {
panic("Bad function call pgconn_free")
}
func pgconn_setserverversion(conn *PGconn, server_version Cint) {
panic("Bad function call pgconn_setserverversion")
}
func pgconn_setstdstrings(conn *PGconn, std_strings Cint) {
panic("Bad function call pgconn_setstdstrings")
}
func pgconn_reset(conn *PGconn) {
panic("Bad function call pgconn_reset")
}
func check_library() bool {
return false
}
func deprocess_error_detail_c(conn *PGconn, value *Cchar, contents *Cchar) bool {
panic("Bad function call deprocess_error_detail_c")
}
func get_last_refresh_cache_status(conn *PGconn, r_error **Cchar) bool {
panic("Bad function call get_last_refresh_cache_status")
}
func statement_data_get_params_count(statement_data *StatementData) Csize_t {
panic("Bad function call statement_data_get_params_count")
}
func processed_query_pos_to_deprocessed_c(conn *PGconn, processed_pos Cint) Cint {
panic("Bad function call processed_query_pos_to_deprocessed_c")
}
func statement_data_get_params_values(statement_data *StatementData) **Cchar {
panic("Bad function call statement_data_get_params_values")
}
func statement_data_get_params_lengths(statement_data *StatementData) *Cint {
panic("Bad function call statement_data_get_params_lengths")
}
func process_copy_chunk(conn *PGconn, in_buffer *Cchar, msg_length Cint, buffer **Cchar) Cint {
panic("Bad function call process_copy_chunk")
}
func new_cl_refresh_params() *CLRefreshParams {
panic("Bad function call new_cl_refresh_params")
}
func get_client_logic(conn *PGconn) *PGClientLogic {
panic("Bad function call get_client_logic")
}
func clientlogic_read_error(client_logic *PGClientLogic, id Cchar, data *Cchar, cl_refresh_params *CLRefreshParams) {
panic("Bad function call clientlogic_read_error")
}
func delete_cl_refresh_params(cl_refresh_params *CLRefreshParams) {
panic("Bad function call delete_cl_refresh_params")
}
//export Conncgo_SimpleQuery
func Conncgo_SimpleQuery(conn_ptr unsafe.Pointer, query string) (result ***Cchar,
columns_names **Cchar, rows_count int, columns_count int) {
panic("Bad function call Conncgo_SimpleQuery")
}
func Is_built_with_cgo() bool {
return false
}
func clear_client_keys(conn *PGconn) bool {
panic("Bad function call clear_client_keys")
}
func set_key_to_client_logic(conn *PGconn, rsa_key_len Csize_t, ecdh_key_len Csize_t, rsa_pub_key *Cchar,
ecdh_key *Cchar) bool {
panic("Bad function call set_key_to_client_logic")
}
func get_client_key(conn *PGconn, client_key **Cchar, client_key_len *Csize_t) bool {
panic("Bad function call get_client_key")
}
func fetched_columns(conn *PGconn) Cint {
panic("Bad function call fetched_columns")
}
func get_cached_ceks(conn *PGconn, cek_oids **Coid, cek_algos **Cint, cek_buf_lens **Cint, cek_bufs ***Cchar) bool {
panic("Bad function call get_cache_ceks")
}