mysql.pp 24 KB

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