mysql.pp 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. unit mysql;
  2. interface
  3. uses mysql_com;
  4. {
  5. Automatically converted by H2Pas 0.99.15 from mysql.ph
  6. The following command line parameters were used:
  7. -p
  8. -D
  9. -l
  10. mysqlclient
  11. mysql.ph
  12. }
  13. const
  14. External_library='mysqlclient'; {Setup as you need}
  15. { Pointers to basic pascal types, inserted by h2pas conversion program.}
  16. Type
  17. PLongint = ^Longint;
  18. PSmallInt = ^SmallInt;
  19. PByte = ^Byte;
  20. PWord = ^Word;
  21. PDWord = ^DWord;
  22. PDouble = ^Double;
  23. {$PACKRECORDS C}
  24. { Copyright (C) 2000 MySQL AB
  25. This program is free software; you can redistribute it and/or modify
  26. it under the terms of the GNU General Public License as published by
  27. the Free Software Foundation; either version 2 of the License, or
  28. (at your option) any later version.
  29. This program is distributed in the hope that it will be useful,
  30. but WITHOUT ANY WARRANTY; without even the implied warranty of
  31. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  32. GNU General Public License for more details.
  33. You should have received a copy of the GNU General Public License
  34. along with this program; if not, write to the Free Software
  35. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA }
  36. type
  37. Pmy_bool = ^my_bool;
  38. my_bool = char;
  39. Pgptr = ^gptr;
  40. gptr = char;
  41. Pmy_socket = ^my_socket;
  42. my_socket = longint;
  43. var
  44. mysql_port : dword;cvar;external;
  45. mysql_unix_port : Pchar;cvar;external;
  46. type
  47. Pst_mysql_field = ^st_mysql_field;
  48. st_mysql_field = record
  49. name : Pchar;
  50. table : Pchar;
  51. org_table : Pchar;
  52. db : Pchar;
  53. def : Pchar;
  54. length : dword;
  55. max_length : dword;
  56. flags : dword;
  57. decimals : dword;
  58. _type : enum_field_types;
  59. end;
  60. MYSQL_FIELD = st_mysql_field;
  61. PMYSQL_FIELD = ^MYSQL_FIELD;
  62. { was #define dname(params) para_def_expr }
  63. { argument types are unknown }
  64. function IS_PRI_KEY(n : longint) : Boolean;
  65. { was #define dname(params) para_def_expr }
  66. { argument types are unknown }
  67. function IS_NOT_NULL(n : longint) : Boolean;
  68. { was #define dname(params) para_def_expr }
  69. { argument types are unknown }
  70. function IS_BLOB(n : longint) : boolean;
  71. (* error
  72. #define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR)
  73. in define line 32 *)
  74. { was #define dname(params) para_def_expr }
  75. { argument types are unknown }
  76. { return type might be wrong }
  77. function IS_NUM_FIELD(f : Pst_mysql_field) : boolean;
  78. (* error
  79. #define INTERNAL_NUM_FIELD(f) (((f)->type <= FIELD_TYPE_INT24 && ((f)->type != FIELD_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == FIELD_TYPE_YEAR)
  80. in define line 34 *)
  81. { Name of column }
  82. { Table of column if column was a field }
  83. { Org table name if table was an alias }
  84. { Database for table }
  85. { Default value (set by mysql_list_fields) }
  86. { Width of column }
  87. { Max width of selected set }
  88. { Div flags }
  89. { Number of decimals in field }
  90. { Type of field. Se mysql_com.h for types }
  91. type
  92. PMYSQL_ROW = ^MYSQL_ROW;
  93. MYSQL_ROW = char;
  94. { return data as array of strings }
  95. PMYSQL_FIELD_OFFSET = ^MYSQL_FIELD_OFFSET;
  96. MYSQL_FIELD_OFFSET = dword;
  97. { offset to current field }
  98. Pmy_ulonglong = ^my_ulonglong;
  99. my_ulonglong = qword;
  100. { was #define dname def_expr }
  101. function MYSQL_COUNT_ERROR : longint;
  102. { return type might be wrong }
  103. { list of rows }
  104. type
  105. Pst_mysql_rows = ^st_mysql_rows;
  106. st_mysql_rows = record
  107. next : Pst_mysql_rows;
  108. data : MYSQL_ROW;
  109. end;
  110. MYSQL_ROWS = st_mysql_rows;
  111. PMYSQL_ROWS = ^MYSQL_ROWS;
  112. PMYSQL_ROW_OFFSET = ^MYSQL_ROW_OFFSET;
  113. MYSQL_ROW_OFFSET = MYSQL_ROWS;
  114. { offset to current row }
  115. { struct for once_alloc }
  116. { Next block in use }
  117. { memory left in block }
  118. { size of block }
  119. Pst_used_mem = ^st_used_mem;
  120. st_used_mem = record
  121. next : Pst_used_mem;
  122. left : dword;
  123. size : dword;
  124. end;
  125. USED_MEM = st_used_mem;
  126. PUSED_MEM = ^USED_MEM;
  127. Pst_mem_root = ^st_mem_root;
  128. st_mem_root = record
  129. free : PUSED_MEM;
  130. used : PUSED_MEM;
  131. pre_alloc : PUSED_MEM;
  132. min_malloc : dword;
  133. block_size : dword;
  134. error_handler : procedure ;cdecl;
  135. end;
  136. MEM_ROOT = st_mem_root;
  137. PMEM_ROOT = ^MEM_ROOT;
  138. Pst_mysql_data = ^st_mysql_data;
  139. st_mysql_data = record
  140. rows : my_ulonglong;
  141. fields : dword;
  142. data : PMYSQL_ROWS;
  143. alloc : MEM_ROOT;
  144. end;
  145. MYSQL_DATA = st_mysql_data;
  146. PMYSQL_DATA = ^MYSQL_DATA;
  147. { PEM key file }
  148. { PEM cert file }
  149. { PEM CA file }
  150. { PEM directory of CA-s? }
  151. { cipher to use }
  152. { if to use SSL or not }
  153. {
  154. on connect, find out the replication role of the server, and
  155. establish connections to all the peers
  156. }
  157. {
  158. each call to mysql_real_query() will parse it to tell if it is a read
  159. or a write, and direct it to the slave or the master
  160. }
  161. {
  162. if set, never read from a master,only from slave, when doing
  163. a read that is replication-aware
  164. }
  165. Pst_mysql_options = ^st_mysql_options;
  166. st_mysql_options = record
  167. connect_timeout : dword;
  168. client_flag : dword;
  169. port : dword;
  170. host : Pchar;
  171. init_command : Pchar;
  172. user : Pchar;
  173. password : Pchar;
  174. unix_socket : Pchar;
  175. db : Pchar;
  176. my_cnf_file : Pchar;
  177. my_cnf_group : Pchar;
  178. charset_dir : Pchar;
  179. charset_name : Pchar;
  180. ssl_key : Pchar;
  181. ssl_cert : Pchar;
  182. ssl_ca : Pchar;
  183. ssl_capath : Pchar;
  184. ssl_cipher : Pchar;
  185. use_ssl : my_bool;
  186. compress : my_bool;
  187. named_pipe : my_bool;
  188. rpl_probe : my_bool;
  189. rpl_parse : my_bool;
  190. no_master_reads : my_bool;
  191. end;
  192. mysql_option = (MYSQL_OPT_CONNECT_TIMEOUT,MYSQL_OPT_COMPRESS,
  193. MYSQL_OPT_NAMED_PIPE,MYSQL_INIT_COMMAND,
  194. MYSQL_READ_DEFAULT_FILE,MYSQL_READ_DEFAULT_GROUP,
  195. MYSQL_SET_CHARSET_DIR,MYSQL_SET_CHARSET_NAME
  196. );
  197. mysql_status = (MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,
  198. MYSQL_STATUS_USE_RESULT);
  199. {
  200. There are three types of queries - the ones that have to go to
  201. the master, the ones that go to a slave, and the adminstrative
  202. type which must happen on the pivot connectioin
  203. }
  204. mysql_rpl_type = (MYSQL_RPL_MASTER,MYSQL_RPL_SLAVE,MYSQL_RPL_ADMIN
  205. );
  206. { Communication parameters }
  207. { ConnectorFd for SSL }
  208. { id if insert on table with NEXTNR }
  209. { Used by mysqlshow }
  210. { Id for connection in server }
  211. { If free in mysql_close }
  212. { set to 1 if automatic reconnect }
  213. {
  214. Set if this is the original connection, not a master or a slave we have
  215. added though mysql_rpl_probe() or mysql_set_master()/ mysql_add_slave()
  216. }
  217. { pointers to the master, and the next slave
  218. connections, points to itself if lone connection }
  219. { needed for round-robin slave pick }
  220. { needed for send/read/store/use result to work correctly with replication }
  221. Pst_mysql = ^st_mysql;
  222. st_mysql = record
  223. net : NET;
  224. connector_fd : gptr;
  225. host : Pchar;
  226. user : Pchar;
  227. passwd : Pchar;
  228. unix_socket : Pchar;
  229. server_version : Pchar;
  230. host_info : Pchar;
  231. info : Pchar;
  232. db : Pchar;
  233. charset : Pointer; //!! Was Pcharset_info_st;
  234. fields : PMYSQL_FIELD;
  235. field_alloc : MEM_ROOT;
  236. affected_rows : my_ulonglong;
  237. insert_id : my_ulonglong;
  238. extra_info : my_ulonglong;
  239. thread_id : dword;
  240. packet_length : dword;
  241. port : dword;
  242. client_flag : dword;
  243. server_capabilities : dword;
  244. protocol_version : dword;
  245. field_count : dword;
  246. server_status : dword;
  247. server_language : dword;
  248. options : st_mysql_options;
  249. status : mysql_status;
  250. free_me : my_bool;
  251. reconnect : my_bool;
  252. scramble_buff : array[0..8] of char;
  253. rpl_pivot : my_bool;
  254. master : Pst_mysql;
  255. next_slave : Pst_mysql;
  256. last_used_slave : Pst_mysql;
  257. last_used_con : Pst_mysql;
  258. end;
  259. TMYSQL = st_mysql;
  260. PMYSQL = ^TMYSQL;
  261. { column lengths of current row }
  262. { for unbuffered reads }
  263. { If unbuffered read }
  264. { buffer to current row }
  265. { Used by mysql_fetch_row }
  266. Pst_mysql_res = ^st_mysql_res;
  267. st_mysql_res = record
  268. row_count : my_ulonglong;
  269. fields : PMYSQL_FIELD;
  270. data : PMYSQL_DATA;
  271. data_cursor : PMYSQL_ROWS;
  272. lengths : Pdword;
  273. handle : PMYSQL;
  274. field_alloc : MEM_ROOT;
  275. field_count : dword;
  276. current_field : dword;
  277. row : MYSQL_ROW;
  278. current_row : MYSQL_ROW;
  279. eof : my_bool;
  280. end;
  281. MYSQL_RES = st_mysql_res;
  282. PMYSQL_RES = ^MYSQL_RES;
  283. const
  284. MAX_MYSQL_MANAGER_ERR = 256;
  285. MAX_MYSQL_MANAGER_MSG = 256;
  286. MANAGER_OK = 200;
  287. MANAGER_INFO = 250;
  288. MANAGER_ACCESS = 401;
  289. MANAGER_CLIENT_ERR = 450;
  290. MANAGER_INTERNAL_ERR = 500;
  291. type
  292. Pst_mysql_manager = ^st_mysql_manager;
  293. st_mysql_manager = record
  294. net : NET;
  295. host : Pchar;
  296. user : Pchar;
  297. passwd : Pchar;
  298. port : dword;
  299. free_me : my_bool;
  300. eof : my_bool;
  301. cmd_status : longint;
  302. last_errno : longint;
  303. net_buf : Pchar;
  304. net_buf_pos : Pchar;
  305. net_data_end : Pchar;
  306. net_buf_size : longint;
  307. last_error : array[0..(MAX_MYSQL_MANAGER_ERR)-1] of char;
  308. end;
  309. MYSQL_MANAGER = st_mysql_manager;
  310. PMYSQL_MANAGER = ^MYSQL_MANAGER;
  311. { Set up and bring down the server; to ensure that applications will
  312. work when linked against either the standard client library or the
  313. embedded server library, these functions should be called. }
  314. function mysql_server_init(argc:longint; argv:PPchar; groups:PPchar):longint;cdecl;external External_library name 'mysql_server_init';
  315. procedure mysql_server_end;cdecl;external External_library name 'mysql_server_end';
  316. { Set up and bring down a thread; these function should be called
  317. for each thread in an application which opens at least one MySQL
  318. connection. All uses of the connection(s) should be between these
  319. function calls. }
  320. function mysql_thread_init:my_bool;cdecl;external External_library name 'mysql_thread_init';
  321. procedure mysql_thread_end;cdecl;external External_library name 'mysql_thread_end';
  322. { Functions to get information from the MYSQL and MYSQL_RES structures }
  323. { Should definitely be used if one uses shared libraries }
  324. function mysql_num_rows(res:PMYSQL_RES):my_ulonglong;cdecl;external External_library name 'mysql_num_rows';
  325. function mysql_num_fields(res:PMYSQL_RES):dword;cdecl;external External_library name 'mysql_num_fields';
  326. function mysql_eof(res:PMYSQL_RES):my_bool;cdecl;external External_library name 'mysql_eof';
  327. function mysql_fetch_field_direct(res:PMYSQL_RES; fieldnr:dword):PMYSQL_FIELD;cdecl;external External_library name 'mysql_fetch_field_direct';
  328. function mysql_fetch_fields(res:PMYSQL_RES):PMYSQL_FIELD;cdecl;external External_library name 'mysql_fetch_fields';
  329. function mysql_row_tell(res:PMYSQL_RES):PMYSQL_ROWS;cdecl;external External_library name 'mysql_row_tell';
  330. function mysql_field_tell(res:PMYSQL_RES):dword;cdecl;external External_library name 'mysql_field_tell';
  331. function mysql_field_count(mysql:PMYSQL):dword;cdecl;external External_library name 'mysql_field_count';
  332. function mysql_affected_rows(mysql:PMYSQL):my_ulonglong;cdecl;external External_library name 'mysql_affected_rows';
  333. function mysql_insert_id(mysql:PMYSQL):my_ulonglong;cdecl;external External_library name 'mysql_insert_id';
  334. function mysql_errno(mysql:PMYSQL):dword;cdecl;external External_library name 'mysql_errno';
  335. function mysql_error(mysql:PMYSQL):Pchar;cdecl;external External_library name 'mysql_error';
  336. function mysql_info(mysql:PMYSQL):Pchar;cdecl;external External_library name 'mysql_info';
  337. function mysql_thread_id(mysql:PMYSQL):dword;cdecl;external External_library name 'mysql_thread_id';
  338. (* Const before type ignored *)
  339. function mysql_character_set_name(mysql:PMYSQL):Pchar;cdecl;external External_library name 'mysql_character_set_name';
  340. function mysql_init(mysql:PMYSQL):PMYSQL;cdecl;external External_library name 'mysql_init';
  341. (* Const before type ignored *)
  342. (* Const before type ignored *)
  343. (* Const before type ignored *)
  344. (* Const before type ignored *)
  345. (* Const before type ignored *)
  346. function mysql_ssl_set(mysql:PMYSQL; key:Pchar; cert:Pchar; ca:Pchar; capath:Pchar;
  347. cipher:Pchar):longint;cdecl;external External_library name 'mysql_ssl_set';
  348. function mysql_ssl_clear(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_ssl_clear';
  349. (* Const before type ignored *)
  350. (* Const before type ignored *)
  351. (* Const before type ignored *)
  352. function mysql_change_user(mysql:PMYSQL; user:Pchar; passwd:Pchar; db:Pchar):my_bool;cdecl;external External_library name 'mysql_change_user';
  353. (* Const before type ignored *)
  354. (* Const before type ignored *)
  355. (* Const before type ignored *)
  356. (* Const before type ignored *)
  357. (* Const before type ignored *)
  358. function mysql_real_connect(mysql:PMYSQL; host:Pchar; user:Pchar; passwd:Pchar; db:Pchar;
  359. port:dword; unix_socket:Pchar; clientflag:dword):PMYSQL;cdecl;external External_library name 'mysql_real_connect';
  360. procedure mysql_close(sock:PMYSQL);cdecl;external External_library name 'mysql_close';
  361. (* Const before type ignored *)
  362. function mysql_select_db(mysql:PMYSQL; db:Pchar):longint;cdecl;external External_library name 'mysql_select_db';
  363. (* Const before type ignored *)
  364. function mysql_query(mysql:PMYSQL; q:Pchar):longint;cdecl;external External_library name 'mysql_query';
  365. (* Const before type ignored *)
  366. function mysql_send_query(mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;external External_library name 'mysql_send_query';
  367. function mysql_read_query_result(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_read_query_result';
  368. (* Const before type ignored *)
  369. function mysql_real_query(mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;external External_library name 'mysql_real_query';
  370. { perform query on master }
  371. (* Const before type ignored *)
  372. function mysql_master_query(mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;external External_library name 'mysql_master_query';
  373. (* Const before type ignored *)
  374. function mysql_master_send_query(mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;external External_library name 'mysql_master_send_query';
  375. { perform query on slave }
  376. (* Const before type ignored *)
  377. function mysql_slave_query(mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;external External_library name 'mysql_slave_query';
  378. (* Const before type ignored *)
  379. function mysql_slave_send_query(mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;external External_library name 'mysql_slave_send_query';
  380. {
  381. enable/disable parsing of all queries to decide if they go on master or
  382. slave
  383. }
  384. procedure mysql_enable_rpl_parse(mysql:PMYSQL);cdecl;external External_library name 'mysql_enable_rpl_parse';
  385. procedure mysql_disable_rpl_parse(mysql:PMYSQL);cdecl;external External_library name 'mysql_disable_rpl_parse';
  386. { get the value of the parse flag }
  387. function mysql_rpl_parse_enabled(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_rpl_parse_enabled';
  388. { enable/disable reads from master }
  389. procedure mysql_enable_reads_from_master(mysql:PMYSQL);cdecl;external External_library name 'mysql_enable_reads_from_master';
  390. procedure mysql_disable_reads_from_master(mysql:PMYSQL);cdecl;external External_library name 'mysql_disable_reads_from_master';
  391. { get the value of the master read flag }
  392. function mysql_reads_from_master_enabled(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_reads_from_master_enabled';
  393. (* error
  394. enum mysql_rpl_type mysql_rpl_query_type(const char* q, int len);
  395. in declaration at line 291 *)
  396. { discover the master and its slaves }
  397. function mysql_rpl_probe(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_rpl_probe';
  398. { set the master, close/free the old one, if it is not a pivot }
  399. (* Const before type ignored *)
  400. (* Const before type ignored *)
  401. (* Const before type ignored *)
  402. function mysql_set_master(mysql:PMYSQL; host:Pchar; port:dword; user:Pchar; passwd:Pchar):longint;cdecl;external External_library name 'mysql_set_master';
  403. (* Const before type ignored *)
  404. (* Const before type ignored *)
  405. (* Const before type ignored *)
  406. function mysql_add_slave(mysql:PMYSQL; host:Pchar; port:dword; user:Pchar; passwd:Pchar):longint;cdecl;external External_library name 'mysql_add_slave';
  407. function mysql_shutdown(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_shutdown';
  408. function mysql_dump_debug_info(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_dump_debug_info';
  409. function mysql_refresh(mysql:PMYSQL; refresh_options:dword):longint;cdecl;external External_library name 'mysql_refresh';
  410. function mysql_kill(mysql:PMYSQL; pid:dword):longint;cdecl;external External_library name 'mysql_kill';
  411. function mysql_ping(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_ping';
  412. function mysql_stat(mysql:PMYSQL):Pchar;cdecl;external External_library name 'mysql_stat';
  413. function mysql_get_server_info(mysql:PMYSQL):Pchar;cdecl;external External_library name 'mysql_get_server_info';
  414. function mysql_get_client_info:Pchar;cdecl;external External_library name 'mysql_get_client_info';
  415. function mysql_get_host_info(mysql:PMYSQL):Pchar;cdecl;external External_library name 'mysql_get_host_info';
  416. function mysql_get_proto_info(mysql:PMYSQL):dword;cdecl;external External_library name 'mysql_get_proto_info';
  417. (* Const before type ignored *)
  418. function mysql_list_dbs(mysql:PMYSQL; wild:Pchar):PMYSQL_RES;cdecl;external External_library name 'mysql_list_dbs';
  419. (* Const before type ignored *)
  420. function mysql_list_tables(mysql:PMYSQL; wild:Pchar):PMYSQL_RES;cdecl;external External_library name 'mysql_list_tables';
  421. (* Const before type ignored *)
  422. (* Const before type ignored *)
  423. function mysql_list_fields(mysql:PMYSQL; table:Pchar; wild:Pchar):PMYSQL_RES;cdecl;external External_library name 'mysql_list_fields';
  424. function mysql_list_processes(mysql:PMYSQL):PMYSQL_RES;cdecl;external External_library name 'mysql_list_processes';
  425. function mysql_store_result(mysql:PMYSQL):PMYSQL_RES;cdecl;external External_library name 'mysql_store_result';
  426. function mysql_use_result(mysql:PMYSQL):PMYSQL_RES;cdecl;external External_library name 'mysql_use_result';
  427. (* Const before type ignored *)
  428. function mysql_options(mysql:PMYSQL; option:mysql_option; arg:Pchar):longint;cdecl;external External_library name 'mysql_options';
  429. procedure mysql_free_result(result:PMYSQL_RES);cdecl;external External_library name 'mysql_free_result';
  430. procedure mysql_data_seek(result:PMYSQL_RES; offset:my_ulonglong);cdecl;external External_library name 'mysql_data_seek';
  431. function mysql_row_seek(result:PMYSQL_RES; _para2:MYSQL_ROW_OFFSET):MYSQL_ROW_OFFSET;cdecl;external External_library name 'mysql_row_seek';
  432. function mysql_field_seek(result:PMYSQL_RES; offset:MYSQL_FIELD_OFFSET):MYSQL_FIELD_OFFSET;cdecl;external External_library name 'mysql_field_seek';
  433. function mysql_fetch_row(result:PMYSQL_RES):MYSQL_ROW;cdecl;external External_library name 'mysql_fetch_row';
  434. function mysql_fetch_lengths(result:PMYSQL_RES):Pdword;cdecl;external External_library name 'mysql_fetch_lengths';
  435. function mysql_fetch_field(result:PMYSQL_RES):PMYSQL_FIELD;cdecl;external External_library name 'mysql_fetch_field';
  436. (* Const before type ignored *)
  437. function mysql_escape_string(_to:Pchar; from:Pchar; from_length:dword):dword;cdecl;external External_library name 'mysql_escape_string';
  438. (* Const before type ignored *)
  439. function mysql_real_escape_string(mysql:PMYSQL; _to:Pchar; from:Pchar; length:dword):dword;cdecl;external External_library name 'mysql_real_escape_string';
  440. (* Const before type ignored *)
  441. procedure mysql_debug(debug:Pchar);cdecl;external External_library name 'mysql_debug';
  442. (* Const before type ignored *)
  443. Type
  444. TExdendBuffer = function (_para1:pointer; _to:Pchar; length:Pdword):Pchar;
  445. function mysql_odbc_escape_string(mysql:PMYSQL; _to:Pchar; to_length:dword; from:Pchar; from_length:dword;
  446. param:pointer; extend_buffer: TExdendBuffer):Pchar;cdecl;external External_library name 'mysql_odbc_escape_string';
  447. procedure myodbc_remove_escape(mysql:PMYSQL; name:Pchar);cdecl;external External_library name 'myodbc_remove_escape';
  448. function mysql_thread_safe:dword;cdecl;external External_library name 'mysql_thread_safe';
  449. function mysql_manager_init(con:PMYSQL_MANAGER):PMYSQL_MANAGER;cdecl;external External_library name 'mysql_manager_init';
  450. (* Const before type ignored *)
  451. (* Const before type ignored *)
  452. (* Const before type ignored *)
  453. function mysql_manager_connect(con:PMYSQL_MANAGER; host:Pchar; user:Pchar; passwd:Pchar; port:dword):PMYSQL_MANAGER;cdecl;external External_library name 'mysql_manager_connect';
  454. procedure mysql_manager_close(con:PMYSQL_MANAGER);cdecl;external External_library name 'mysql_manager_close';
  455. (* Const before type ignored *)
  456. function mysql_manager_command(con:PMYSQL_MANAGER; cmd:Pchar; cmd_len:longint):longint;cdecl;external External_library name 'mysql_manager_command';
  457. function mysql_manager_fetch_line(con:PMYSQL_MANAGER; res_buf:Pchar; res_buf_size:longint):longint;cdecl;external External_library name 'mysql_manager_fetch_line';
  458. { was #define dname(params) para_def_expr }
  459. { argument types are unknown }
  460. { return type might be wrong }
  461. function mysql_reload(mysql : pmysql) : longint;
  462. {
  463. The following functions are mainly exported because of mysqlbinlog;
  464. They are not for general usage
  465. }
  466. (* Const before type ignored *)
  467. function simple_command(mysql:PMYSQL; command:enum_server_command; arg:Pchar; length:dword; skipp_check:my_bool):longint;cdecl;external External_library name 'simple_command';
  468. function net_safe_read(mysql:PMYSQL):dword;cdecl;external External_library name 'net_safe_read';
  469. implementation
  470. { was #define dname(params) para_def_expr }
  471. { argument types are unknown }
  472. function IS_PRI_KEY(n : longint) : Boolean;
  473. begin
  474. IS_PRI_KEY:=(n and PRI_KEY_FLAG)<>0;
  475. end;
  476. { was #define dname(params) para_def_expr }
  477. { argument types are unknown }
  478. function IS_NOT_NULL(n : longint) : Boolean;
  479. begin
  480. IS_NOT_NULL:=(n and NOT_NULL_FLAG)<>0;
  481. end;
  482. { was #define dname(params) para_def_expr }
  483. { argument types are unknown }
  484. function IS_BLOB(n : longint) : Boolean;
  485. begin
  486. IS_BLOB:=(n and BLOB_FLAG)<>0;
  487. end;
  488. { was #define dname(params) para_def_expr }
  489. { argument types are unknown }
  490. { return type might be wrong }
  491. function IS_NUM_FIELD(f : Pst_mysql_field) : Boolean;
  492. begin
  493. IS_NUM_FIELD:=((f^.flags) and NUM_FLAG)<>0;
  494. end;
  495. { was #define dname def_expr }
  496. function MYSQL_COUNT_ERROR : longint;
  497. { return type might be wrong }
  498. begin
  499. MYSQL_COUNT_ERROR:= not (my_ulonglong(0));
  500. end;
  501. { was #define dname(params) para_def_expr }
  502. { argument types are unknown }
  503. { return type might be wrong }
  504. function mysql_reload(mysql : pmysql) : longint;
  505. begin
  506. mysql_reload:=mysql_refresh(mysql,REFRESH_GRANT);
  507. end;
  508. end.