mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-24 15:09:13 +02:00
+ Dynamic library implementation by Joost van der Sluis
This commit is contained in:
parent
bfcb70b5e4
commit
bedf31abe9
@ -34,29 +34,306 @@ uses
|
|||||||
|
|
||||||
{$i ibase60types.inc}
|
{$i ibase60types.inc}
|
||||||
|
|
||||||
var isc_attach_database : function (_para1:PISC_STATUS; _para2:smallint; _para3:Pchar; _para4:Pisc_db_handle; _para5:smallint;
|
var
|
||||||
_para6:Pchar):ISC_STATUS; gdsdecl;
|
|
||||||
isc_interprete : function (_para1:Pchar; _para2:PPISC_STATUS):ISC_STATUS; gdsdecl;
|
{ }
|
||||||
isc_commit_transaction : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle):ISC_STATUS; gdsdecl;
|
{ OSRI database functions }
|
||||||
isc_rollback_transaction : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle):ISC_STATUS; gdsdecl;
|
{ }
|
||||||
isc_start_transaction : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:smallint; args:array of const):ISC_STATUS; cdecl;
|
isc_attach_database : function (_para1:PISC_STATUS; _para2:smallint; _para3:Pchar; _para4:Pisc_db_handle; _para5:smallint;_para6:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_array_gen_sdl : function (_para1:PISC_STATUS; _para2:PISC_ARRAY_DESC; _para3:Psmallint; _para4:Pchar; _para5:Psmallint):ISC_STATUS; gdsdecl;
|
||||||
|
isc_array_get_slice : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:PISC_QUAD; _para5:PISC_ARRAY_DESC;_para6:pointer; _para7:PISC_LONG):ISC_STATUS; gdsdecl;
|
||||||
|
isc_array_lookup_bounds : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Pchar; _para5:Pchar;_para6:PISC_ARRAY_DESC):ISC_STATUS; gdsdecl;
|
||||||
|
isc_array_lookup_desc : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Pchar; _para5:Pchar;_para6:PISC_ARRAY_DESC):ISC_STATUS; gdsdecl;
|
||||||
|
isc_array_set_desc : function (_para1:PISC_STATUS; _para2:Pchar; _para3:Pchar; _para4:Psmallint; _para5:Psmallint;_para6:Psmallint; _para7:PISC_ARRAY_DESC):ISC_STATUS; gdsdecl;
|
||||||
|
isc_array_put_slice : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:PISC_QUAD; _para5:PISC_ARRAY_DESC;_para6:pointer; _para7:PISC_LONG):ISC_STATUS; gdsdecl;
|
||||||
|
isc_blob_default_desc : procedure (_para1:PISC_BLOB_DESC; _para2:Pbyte; _para3:Pbyte); gdsdecl;
|
||||||
|
isc_blob_gen_bpb : function (_para1:PISC_STATUS; _para2:PISC_BLOB_DESC; _para3:PISC_BLOB_DESC; _para4:word; _para5:Pbyte;_para6:Pword):ISC_STATUS; gdsdecl;
|
||||||
|
isc_blob_info : function (_para1:PISC_STATUS; _para2:Pisc_blob_handle; _para3:smallint; _para4:Pchar; _para5:smallint;_para6:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_blob_lookup_desc : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Pbyte; _para5:Pbyte;_para6:PISC_BLOB_DESC; _para7:Pbyte):ISC_STATUS; gdsdecl;
|
||||||
|
isc_blob_set_desc : function (_para1:PISC_STATUS; _para2:Pbyte; _para3:Pbyte; _para4:smallint; _para5:smallint;_para6:smallint; _para7:PISC_BLOB_DESC):ISC_STATUS; gdsdecl;
|
||||||
|
isc_cancel_blob : function (_para1:PISC_STATUS; _para2:Pisc_blob_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_cancel_events : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:PISC_LONG):ISC_STATUS; gdsdecl;
|
||||||
|
isc_close_blob : function (_para1:PISC_STATUS; _para2:Pisc_blob_handle):ISC_STATUS; gdsdecl;
|
||||||
isc_commit_retaining : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle):ISC_STATUS; gdsdecl;
|
isc_commit_retaining : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle):ISC_STATUS; gdsdecl;
|
||||||
isc_rollback_retaining : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle):ISC_STATUS; gdsdecl;
|
isc_commit_transaction : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle):ISC_STATUS; gdsdecl;
|
||||||
isc_detach_database : function (_para1:PISC_STATUS; _para2:Pisc_db_handle):ISC_STATUS; gdsdecl;
|
isc_create_blob : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Pisc_blob_handle; _para5:PISC_QUAD):ISC_STATUS; gdsdecl;
|
||||||
isc_vax_integer : function (_para1:Pchar; _para2:smallint):ISC_LONG; gdsdecl;
|
isc_create_blob2 : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Pisc_blob_handle; _para5:PISC_QUAD;_para6:smallint; _para7:Pchar):ISC_STATUS; gdsdecl;
|
||||||
isc_dsql_free_statement : function (_para1:PISC_STATUS; _para2:Pisc_stmt_handle; _para3:word):ISC_STATUS; gdsdecl;
|
isc_create_database : function (_para1:PISC_STATUS; _para2:smallint; _para3:Pchar; _para4:Pisc_db_handle; _para5:smallint;_para6:Pchar; _para7:smallint):ISC_STATUS; gdsdecl;
|
||||||
isc_dsql_allocate_statement : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_stmt_handle):ISC_STATUS; gdsdecl;
|
isc_database_info : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:smallint; _para4:Pchar; _para5:smallint;_para6:Pchar):ISC_STATUS; gdsdecl;
|
||||||
isc_dsql_prepare : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pisc_stmt_handle; _para4:word; _para5:Pchar;
|
|
||||||
_para6:word; _para7:PXSQLDA):ISC_STATUS; gdsdecl;
|
|
||||||
isc_dsql_describe : function (_para1:PISC_STATUS; _para2:Pisc_stmt_handle; _para3:word; _para4:PXSQLDA):ISC_STATUS; gdsdecl;
|
|
||||||
isc_dsql_execute : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pisc_stmt_handle; _para4:word; _para5:PXSQLDA):ISC_STATUS; gdsdecl;
|
|
||||||
isc_dsql_fetch : function (_para1:PISC_STATUS; _para2:Pisc_stmt_handle; _para3:word; _para4:PXSQLDA):ISC_STATUS; gdsdecl;
|
|
||||||
isc_decode_date : procedure (_para1:PISC_QUAD; _para2:pointer); gdsdecl;
|
isc_decode_date : procedure (_para1:PISC_QUAD; _para2:pointer); gdsdecl;
|
||||||
isc_decode_sql_date : procedure (_para1:PISC_DATE; _para2:pointer); gdsdecl;
|
isc_decode_sql_date : procedure (_para1:PISC_DATE; _para2:pointer); gdsdecl;
|
||||||
isc_decode_sql_time : procedure (_para1:PISC_TIME; _para2:pointer); gdsdecl;
|
isc_decode_sql_time : procedure (_para1:PISC_TIME; _para2:pointer); gdsdecl;
|
||||||
isc_decode_timestamp : procedure (_para1:PISC_TIMESTAMP; _para2:pointer); gdsdecl;
|
isc_decode_timestamp : procedure (_para1:PISC_TIMESTAMP; _para2:pointer); gdsdecl;
|
||||||
isc_database_info : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:smallint; _para4:Pchar; _para5:smallint;
|
isc_detach_database : function (_para1:PISC_STATUS; _para2:Pisc_db_handle):ISC_STATUS; gdsdecl;
|
||||||
_para6:Pchar):ISC_STATUS; gdsdecl;
|
isc_drop_database : function (_para1:PISC_STATUS; _para2:Pisc_db_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_allocate_statement : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_stmt_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_alloc_statement2 : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_stmt_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_describe : function (_para1:PISC_STATUS; _para2:Pisc_stmt_handle; _para3:word; _para4:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_describe_bind : function (_para1:PISC_STATUS; _para2:Pisc_stmt_handle; _para3:word; _para4:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_exec_immed2 : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:word; _para5:Pchar;_para6:word; _para7:PXSQLDA; _para8:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_execute : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pisc_stmt_handle; _para4:word; _para5:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_execute2 : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pisc_stmt_handle; _para4:word; _para5:PXSQLDA;_para6:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_execute_immediate : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:word; _para5:Pchar;_para6:word; _para7:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_fetch : function (_para1:PISC_STATUS; _para2:Pisc_stmt_handle; _para3:word; _para4:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_finish : function (_para1:Pisc_db_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_free_statement : function (_para1:PISC_STATUS; _para2:Pisc_stmt_handle; _para3:word):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_insert : function (_para1:PISC_STATUS; _para2:Pisc_stmt_handle; _para3:word; _para4:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_prepare : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pisc_stmt_handle; _para4:word; _para5:Pchar;_para6:word; _para7:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_set_cursor_name : function (_para1:PISC_STATUS; _para2:Pisc_stmt_handle; _para3:Pchar; _para4:word):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_sql_info : function (_para1:PISC_STATUS; _para2:Pisc_stmt_handle; _para3:smallint; _para4:Pchar; _para5:smallint;_para6:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_encode_date : procedure (_para1:pointer; _para2:PISC_QUAD); gdsdecl;
|
||||||
|
isc_encode_sql_date : procedure (_para1:pointer; _para2:PISC_DATE); gdsdecl;
|
||||||
|
isc_encode_sql_time : procedure (_para1:pointer; _para2:PISC_TIME); gdsdecl;
|
||||||
|
isc_encode_timestamp : procedure (_para1:pointer; _para2:PISC_TIMESTAMP); gdsdecl;
|
||||||
|
isc_event_block : function (_para1:PPchar; _para2:PPchar; _para3:word; args:array of const):ISC_LONG; cdecl;
|
||||||
|
{!!MVC
|
||||||
|
void isc_event_counts (unsigned ISC_LONG ,
|
||||||
|
short,
|
||||||
|
char ,
|
||||||
|
char ); gdsdecl; external gdslib;
|
||||||
|
!!MVC }
|
||||||
|
isc_expand_dpb : procedure (_para1:PPchar; _para2:Psmallint; args:array of const); cdecl;
|
||||||
|
isc_modify_dpb : function (_para1:PPchar; _para2:Psmallint; _para3:word; _para4:Pchar; _para5:smallint):longint; gdsdecl;
|
||||||
|
isc_free : function (_para1:Pchar):ISC_LONG; gdsdecl;
|
||||||
|
isc_get_segment : function (_para1:PISC_STATUS; _para2:Pisc_blob_handle; _para3:Pword; _para4:word; _para5:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_get_slice : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:PISC_QUAD; _para5:smallint;_para6:Pchar; _para7:smallint; _para8:PISC_LONG; _para9:ISC_LONG; _para10:pointer;_para11:PISC_LONG):ISC_STATUS; gdsdecl;
|
||||||
|
isc_interprete : function (_para1:Pchar; _para2:PPISC_STATUS):ISC_STATUS; gdsdecl;
|
||||||
|
isc_open_blob : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Pisc_blob_handle; _para5:PISC_QUAD):ISC_STATUS; gdsdecl;
|
||||||
|
isc_open_blob2 : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Pisc_blob_handle; _para5:PISC_QUAD;_para6:smallint; _para7:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_prepare_transaction2 : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:smallint; _para4:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_print_sqlerror : procedure (_para1:smallint; _para2:PISC_STATUS); gdsdecl;
|
||||||
|
isc_print_status : function (_para1:PISC_STATUS):ISC_STATUS; gdsdecl;
|
||||||
|
isc_put_segment : function (_para1:PISC_STATUS; _para2:Pisc_blob_handle; _para3:word; _para4:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_put_slice : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:PISC_QUAD; _para5:smallint;_para6:Pchar; _para7:smallint; _para8:PISC_LONG; _para9:ISC_LONG; _para10:pointer):ISC_STATUS; gdsdecl;
|
||||||
|
isc_que_events : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:PISC_LONG; _para4:smallint; _para5:Pchar;_para6:isc_callback; _para7:pointer):ISC_STATUS; gdsdecl;
|
||||||
|
isc_rollback_retaining : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_rollback_transaction : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_start_multiple : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:smallint; _para4:pointer):ISC_STATUS; gdsdecl;
|
||||||
|
isc_start_transaction : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:smallint; args:array of const):ISC_STATUS; cdecl;
|
||||||
|
isc_sqlcode : function (_para1:PISC_STATUS):ISC_LONG; gdsdecl;
|
||||||
|
isc_sql_interprete : procedure (_para1:smallint; _para2:Pchar; _para3:smallint); gdsdecl;
|
||||||
|
isc_transaction_info : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:smallint; _para4:Pchar; _para5:smallint;_para6:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_transact_request : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:word; _para5:Pchar;_para6:word; _para7:Pchar; _para8:word; _para9:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_vax_integer : function (_para1:Pchar; _para2:smallint):ISC_LONG; gdsdecl;
|
||||||
|
isc_portable_integer : function (_para1:Pbyte; _para2:smallint):ISC_INT64; gdsdecl;
|
||||||
|
{ }
|
||||||
|
{ Security Functions }
|
||||||
|
{ }
|
||||||
|
isc_add_user : function (_para1:PISC_STATUS; _para2:PUSER_SEC_DATA):longint; gdsdecl;
|
||||||
|
isc_delete_user : function (_para1:PISC_STATUS; _para2:PUSER_SEC_DATA):longint; gdsdecl;
|
||||||
|
isc_modify_user : function (_para1:PISC_STATUS; _para2:PUSER_SEC_DATA):longint; gdsdecl;
|
||||||
|
{ }
|
||||||
|
{ Other OSRI functions }
|
||||||
|
{ }
|
||||||
|
isc_compile_request : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_req_handle; _para4:smallint; _para5:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_compile_request2 : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_req_handle; _para4:smallint; _para5:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_ddl : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:smallint; _para5:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_prepare_transaction : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_receive : function (_para1:PISC_STATUS; _para2:Pisc_req_handle; _para3:smallint; _para4:smallint; _para5:pointer;_para6:smallint):ISC_STATUS; gdsdecl;
|
||||||
|
isc_reconnect_transaction : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:smallint; _para5:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_release_request : function (_para1:PISC_STATUS; _para2:Pisc_req_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_request_info : function (_para1:PISC_STATUS; _para2:Pisc_req_handle; _para3:smallint; _para4:smallint; _para5:Pchar;_para6:smallint; _para7:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_seek_blob : function (_para1:PISC_STATUS; _para2:Pisc_blob_handle; _para3:smallint; _para4:ISC_LONG; _para5:PISC_LONG):ISC_STATUS; gdsdecl;
|
||||||
|
isc_send : function (_para1:PISC_STATUS; _para2:Pisc_req_handle; _para3:smallint; _para4:smallint; _para5:pointer;_para6:smallint):ISC_STATUS; gdsdecl;
|
||||||
|
isc_start_and_send : function (_para1:PISC_STATUS; _para2:Pisc_req_handle; _para3:Pisc_tr_handle; _para4:smallint; _para5:smallint;_para6:pointer; _para7:smallint):ISC_STATUS; gdsdecl;
|
||||||
|
isc_start_request : function (_para1:PISC_STATUS; _para2:Pisc_req_handle; _para3:Pisc_tr_handle; _para4:smallint):ISC_STATUS; gdsdecl;
|
||||||
|
isc_unwind_request : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:smallint):ISC_STATUS; gdsdecl;
|
||||||
|
isc_wait_for_event : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:smallint; _para4:Pchar; _para5:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
{ }
|
||||||
|
{ Other Sql functions }
|
||||||
|
{ }
|
||||||
|
isc_close : function (_para1:PISC_STATUS; _para2:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_declare : function (_para1:PISC_STATUS; _para2:Pchar; _para3:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_describe : function (_para1:PISC_STATUS; _para2:Pchar; _para3:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_describe_bind : function (_para1:PISC_STATUS; _para2:Pchar; _para3:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_execute : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pchar; _para4:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_execute_immediate : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Psmallint; _para5:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_fetch : function (_para1:PISC_STATUS; _para2:Pchar; _para3:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_open : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pchar; _para4:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_prepare : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Pchar; _para5:Psmallint;_para6:Pchar; _para7:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
{ }
|
||||||
|
{ Other Dynamic sql functions }
|
||||||
|
{ }
|
||||||
|
isc_dsql_execute_m : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pisc_stmt_handle; _para4:word; _para5:Pchar;_para6:word; _para7:word; _para8:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_execute2_m : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pisc_stmt_handle; _para4:word; _para5:Pchar;_para6:word; _para7:word; _para8:Pchar; _para9:word; _para10:Pchar;_para11:word; _para12:word; _para13:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_execute_immediate_m : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:word; _para5:Pchar;_para6:word; _para7:word; _para8:Pchar; _para9:word; _para10:word;_para11:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_exec_immed3_m : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:word; _para5:Pchar;_para6:word; _para7:word; _para8:Pchar; _para9:word; _para10:word;_para11:Pchar; _para12:word; _para13:Pchar; _para14:word; _para15:word;_para16:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_fetch_m : function (_para1:PISC_STATUS; _para2:Pisc_stmt_handle; _para3:word; _para4:Pchar; _para5:word;_para6:word; _para7:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_insert_m : function (_para1:PISC_STATUS; _para2:Pisc_stmt_handle; _para3:word; _para4:Pchar; _para5:word;_para6:word; _para7:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_prepare_m : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pisc_stmt_handle; _para4:word; _para5:Pchar;_para6:word; _para7:word; _para8:Pchar; _para9:word; _para10:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_dsql_release : function (_para1:PISC_STATUS; _para2:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_embed_dsql_close : function (_para1:PISC_STATUS; _para2:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_embed_dsql_declare : function (_para1:PISC_STATUS; _para2:Pchar; _para3:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_embed_dsql_describe : function (_para1:PISC_STATUS; _para2:Pchar; _para3:word; _para4:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_embed_dsql_describe_bind : function (_para1:PISC_STATUS; _para2:Pchar; _para3:word; _para4:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_embed_dsql_execute : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pchar; _para4:word; _para5:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_embed_dsql_execute2 : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pchar; _para4:word; _para5:PXSQLDA;_para6:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_embed_dsql_execute_immed : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:word; _para5:Pchar;_para6:word; _para7:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_embed_dsql_fetch : function (_para1:PISC_STATUS; _para2:Pchar; _para3:word; _para4:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_embed_dsql_open : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pchar; _para4:word; _para5:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_embed_dsql_open2 : function (_para1:PISC_STATUS; _para2:Pisc_tr_handle; _para3:Pchar; _para4:word; _para5:PXSQLDA;_para6:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_embed_dsql_insert : function (_para1:PISC_STATUS; _para2:Pchar; _para3:word; _para4:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_embed_dsql_prepare : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Pchar; _para5:word;_para6:Pchar; _para7:word; _para8:PXSQLDA):ISC_STATUS; gdsdecl;
|
||||||
|
isc_embed_dsql_release : function (_para1:PISC_STATUS; _para2:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
{ }
|
||||||
|
{ Other Blob functions }
|
||||||
|
{ }
|
||||||
|
BLOB_open : function (_para1:isc_blob_handle; _para2:Pchar; _para3:longint):PBSTREAM; gdsdecl;
|
||||||
|
BLOB_put : function (_para1:char; _para2:PBSTREAM):longint; gdsdecl;
|
||||||
|
BLOB_close : function (_para1:PBSTREAM):longint; gdsdecl;
|
||||||
|
BLOB_get : function (_para1:PBSTREAM):longint; gdsdecl;
|
||||||
|
BLOB_display : function (_para1:PISC_QUAD; _para2:isc_db_handle; _para3:isc_tr_handle; _para4:Pchar):longint; gdsdecl;
|
||||||
|
BLOB_dump : function (_para1:PISC_QUAD; _para2:isc_db_handle; _para3:isc_tr_handle; _para4:Pchar):longint; gdsdecl;
|
||||||
|
BLOB_edit : function (_para1:PISC_QUAD; _para2:isc_db_handle; _para3:isc_tr_handle; _para4:Pchar):longint; gdsdecl;
|
||||||
|
BLOB_load : function (_para1:PISC_QUAD; _para2:isc_db_handle; _para3:isc_tr_handle; _para4:Pchar):longint; gdsdecl;
|
||||||
|
BLOB_text_dump : function (_para1:PISC_QUAD; _para2:isc_db_handle; _para3:isc_tr_handle; _para4:Pchar):longint; gdsdecl;
|
||||||
|
BLOB_text_load : function (_para1:PISC_QUAD; _para2:isc_db_handle; _para3:isc_tr_handle; _para4:Pchar):longint; gdsdecl;
|
||||||
|
Bopen : function (_para1:PISC_QUAD; _para2:isc_db_handle; _para3:isc_tr_handle; _para4:Pchar):PBSTREAM; gdsdecl;
|
||||||
|
{$IFDEF Unix}
|
||||||
|
Bopen2 : function (_para1:PISC_QUAD; _para2:isc_db_handle; _para3:isc_tr_handle; _para4:Pchar; _para5:word):PBSTREAM; gdsdecl;
|
||||||
|
{$ENDIF}
|
||||||
|
{ }
|
||||||
|
{ Other Misc functions }
|
||||||
|
{ }
|
||||||
|
isc_ftof : function (_para1:Pchar; _para2:word; _para3:Pchar; _para4:word):ISC_LONG; gdsdecl;
|
||||||
|
isc_print_blr : function (_para1:Pchar; _para2:isc_callback; _para3:pointer; _para4:smallint):ISC_STATUS; gdsdecl;
|
||||||
|
isc_set_debug : procedure (_para1:longint); gdsdecl;
|
||||||
|
isc_qtoq : procedure (_para1:PISC_QUAD; _para2:PISC_QUAD); gdsdecl;
|
||||||
|
isc_vtof : procedure (_para1:Pchar; _para2:Pchar; _para3:word); gdsdecl;
|
||||||
|
isc_vtov : procedure (_para1:Pchar; _para2:Pchar; _para3:smallint); gdsdecl;
|
||||||
|
isc_version : function (_para1:Pisc_db_handle; _para2:isc_callback; _para3:pointer):longint; gdsdecl;
|
||||||
|
{$IFDEF Unix}
|
||||||
|
isc_reset_fpe : function (_para1:word):ISC_LONG; gdsdecl;
|
||||||
|
{$ENDIF}
|
||||||
|
{ }
|
||||||
|
{ Service manager functions }
|
||||||
|
{ }
|
||||||
|
(*!!MVC
|
||||||
|
#define ADD_SPB_LENGTH(p, length) { (p)++ = (length); \
|
||||||
|
(p)++ = (length) >> 8;}
|
||||||
|
|
||||||
|
#define ADD_SPB_NUMERIC(p, data) { (p)++ = (data); \
|
||||||
|
(p)++ = (data) >> 8; \
|
||||||
|
(p)++ = (data) >> 16; \
|
||||||
|
(p)++ = (data) >> 24;}
|
||||||
|
!!MVC *)
|
||||||
|
isc_service_attach : function (_para1:PISC_STATUS; _para2:word; _para3:Pchar; _para4:Pisc_svc_handle; _para5:word;_para6:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_service_detach : function (_para1:PISC_STATUS; _para2:Pisc_svc_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_service_query : function (_para1:PISC_STATUS; _para2:Pisc_svc_handle; _para3:Pisc_resv_handle; _para4:word; _para5:Pchar;_para6:word; _para7:Pchar; _para8:word; _para9:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_service_start : function (_para1:PISC_STATUS; _para2:Pisc_svc_handle; _para3:Pisc_resv_handle; _para4:word; _para5:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
{ }
|
||||||
|
{ Forms functions }
|
||||||
|
{ }
|
||||||
|
{$IFDEF Unix}
|
||||||
|
isc_compile_map : function (_para1:PISC_STATUS; _para2:Pisc_form_handle; _para3:Pisc_req_handle; _para4:Psmallint; _para5:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_compile_menu : function (_para1:PISC_STATUS; _para2:Pisc_form_handle; _para3:Pisc_req_handle; _para4:Psmallint; _para5:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_compile_sub_map : function (_para1:PISC_STATUS; _para2:Pisc_win_handle; _para3:Pisc_req_handle; _para4:Psmallint; _para5:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_create_window : function (_para1:PISC_STATUS; _para2:Pisc_win_handle; _para3:Psmallint; _para4:Pchar; _para5:Psmallint;_para6:Psmallint):ISC_STATUS; gdsdecl;
|
||||||
|
isc_delete_window : function (_para1:PISC_STATUS; _para2:Pisc_win_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_drive_form : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Pisc_win_handle; _para5:Pisc_req_handle;_para6:Pbyte; _para7:Pbyte):ISC_STATUS; gdsdecl;
|
||||||
|
isc_drive_menu : function (_para1:PISC_STATUS; _para2:Pisc_win_handle; _para3:Pisc_req_handle; _para4:Psmallint; _para5:Pchar;_para6:Psmallint; _para7:Pchar; _para8:Psmallint; _para9:Psmallint; _para10:Pchar;_para11:PISC_LONG):ISC_STATUS; gdsdecl;
|
||||||
|
isc_form_delete : function (_para1:PISC_STATUS; _para2:Pisc_form_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_form_fetch : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Pisc_req_handle; _para5:Pbyte):ISC_STATUS; gdsdecl;
|
||||||
|
isc_form_insert : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Pisc_req_handle; _para5:Pbyte):ISC_STATUS; gdsdecl;
|
||||||
|
isc_get_entree : function (_para1:PISC_STATUS; _para2:Pisc_req_handle; _para3:Psmallint; _para4:Pchar; _para5:PISC_LONG;_para6:Psmallint):ISC_STATUS; gdsdecl;
|
||||||
|
isc_initialize_menu : function (_para1:PISC_STATUS; _para2:Pisc_req_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_menu : function (_para1:PISC_STATUS; _para2:Pisc_win_handle; _para3:Pisc_req_handle; _para4:Psmallint; _para5:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_load_form : function (_para1:PISC_STATUS; _para2:Pisc_db_handle; _para3:Pisc_tr_handle; _para4:Pisc_form_handle; _para5:Psmallint;_para6:Pchar):ISC_STATUS; gdsdecl;
|
||||||
|
isc_pop_window : function (_para1:PISC_STATUS; _para2:Pisc_win_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_put_entree : function (_para1:PISC_STATUS; _para2:Pisc_req_handle; _para3:Psmallint; _para4:Pchar; _para5:PISC_LONG):ISC_STATUS; gdsdecl;
|
||||||
|
isc_reset_form : function (_para1:PISC_STATUS; _para2:Pisc_req_handle):ISC_STATUS; gdsdecl;
|
||||||
|
isc_suspend_window : function (_para1:PISC_STATUS; _para2:Pisc_win_handle):ISC_STATUS; gdsdecl;
|
||||||
|
{$ENDIF}
|
||||||
|
{ isc_attach_database : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_array_gen_sdl : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_array_get_slice : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_array_lookup_bounds : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_array_lookup_desc : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_array_set_desc : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_array_put_slice : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_blob_gen_bpb : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_blob_info : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_blob_lookup_desc : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_blob_set_desc : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_cancel_blob : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_cancel_events : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_close_blob : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_commit_retaining : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_commit_transaction : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_compile_request : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_compile_request2 : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_create_blob : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_create_blob2 : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_create_database : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_database_info : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_ddl : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_decode_date : procedure; gdsdecl;
|
||||||
|
isc_decode_sql_date : procedure; gdsdecl;
|
||||||
|
isc_decode_sql_time : procedure; gdsdecl;
|
||||||
|
isc_decode_timestamp : procedure; gdsdecl;
|
||||||
|
isc_detach_database : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_drop_database : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_encode_date : procedure; gdsdecl;
|
||||||
|
isc_encode_sql_date : procedure; gdsdecl;
|
||||||
|
isc_encode_sql_time : procedure; gdsdecl;
|
||||||
|
isc_encode_timestamp : procedure; gdsdecl;
|
||||||
|
isc_event_block : function : ISC_LONG; cdecl;
|
||||||
|
isc_event_counts : procedure; gdsdecl;
|
||||||
|
isc_expand_dpb : procedure; cdecl;
|
||||||
|
isc_modify_dpb : function : longint; gdsdecl;
|
||||||
|
isc_free : function : ISC_LONG; gdsdecl;
|
||||||
|
isc_get_segment : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_get_slice : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_interprete : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_open_blob : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_open_blob2 : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_prepare_transaction : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_prepare_transaction2 : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_print_sqlerror : procedure; gdsdecl;
|
||||||
|
isc_print_status : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_put_segment : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_put_slice : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_que_events : function : ISC_STATUS; gdsdecl;
|
||||||
|
isc_receive : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_reconnect_transaction : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_release_request : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_request_info : function :ISC_STATUS; gdsdecl;}
|
||||||
|
{$IFDEF Unix}
|
||||||
|
// isc_reset_fpe : function :ISC_LONG; gdsdecl;
|
||||||
|
{$ENDIF}
|
||||||
|
{ isc_rollback_transaction : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_rollback_retaining : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_seek_blob : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_send : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_service_attach : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_service_detach : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_service_query : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_service_start : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_start_and_send : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_start_multiple : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_start_request : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_start_transaction : function :ISC_STATUS; cdecl;
|
||||||
|
isc_sqlcode : function :ISC_LONG; gdsdecl;
|
||||||
|
isc_transaction_info : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_transact_request : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_unwind_request : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_wait_for_event : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_ftof : function :ISC_LONG; gdsdecl;
|
||||||
|
isc_print_blr : function :ISC_STATUS; gdsdecl;
|
||||||
|
isc_set_debug : procedure; gdsdecl;
|
||||||
|
isc_qtoq : procedure; gdsdecl;
|
||||||
|
isc_vax_integer : function :ISC_LONG; gdsdecl;
|
||||||
|
isc_vtof : procedure; gdsdecl;
|
||||||
|
isc_vtov : procedure; gdsdecl;
|
||||||
|
isc_version : function :longint; gdsdecl;}
|
||||||
|
{ }
|
||||||
|
{ Blob functions }
|
||||||
|
{ }
|
||||||
|
// Bopen : function :PBSTREAM; gdsdecl;
|
||||||
|
// BLOB_open : function :PBSTREAM; gdsdecl;
|
||||||
|
{$IFDEF Unix}
|
||||||
|
// Bopen2 : function :PBSTREAM; gdsdecl;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
|
||||||
Procedure InitialiseIBase60;
|
Procedure InitialiseIBase60;
|
||||||
@ -84,26 +361,261 @@ begin
|
|||||||
Raise EInOutError.Create('Can not load Firebird or Interbase client. Is it installed? ('+gdslib+' or '+fbclib+')');
|
Raise EInOutError.Create('Can not load Firebird or Interbase client. Is it installed? ('+gdslib+' or '+fbclib+')');
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
pointer(isc_attach_database) := GetProcedureAddress(IBaseLibraryHandle,'isc_attach_database');
|
pointer(isc_attach_database) := GetProcedureAddress(IBaseLibraryHandle,'isc_attach_database');
|
||||||
pointer(isc_interprete) := GetProcedureAddress(IBaseLibraryHandle,'isc_interprete');
|
pointer(isc_array_gen_sdl) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_gen_sdl');
|
||||||
pointer(isc_commit_transaction) := GetProcedureAddress(IBaseLibraryHandle,'isc_commit_transaction');
|
pointer(isc_array_get_slice) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_get_slice');
|
||||||
pointer(isc_rollback_transaction) := GetProcedureAddress(IBaseLibraryHandle,'isc_rollback_transaction');
|
pointer(isc_array_lookup_bounds) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_lookup_bounds');
|
||||||
pointer(isc_start_transaction) := GetProcedureAddress(IBaseLibraryHandle,'isc_start_transaction');
|
pointer(isc_array_lookup_desc) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_lookup_desc');
|
||||||
|
pointer(isc_array_set_desc) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_set_desc');
|
||||||
|
pointer(isc_array_put_slice) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_put_slice');
|
||||||
|
pointer(isc_blob_default_desc) := GetProcedureAddress(IBaseLibraryHandle,'isc_blob_default_desc');
|
||||||
|
pointer(isc_blob_gen_bpb) := GetProcedureAddress(IBaseLibraryHandle,'isc_blob_gen_bpb');
|
||||||
|
pointer(isc_blob_info) := GetProcedureAddress(IBaseLibraryHandle,'isc_blob_info');
|
||||||
|
pointer(isc_blob_lookup_desc) := GetProcedureAddress(IBaseLibraryHandle,'isc_blob_lookup_desc');
|
||||||
|
pointer(isc_blob_set_desc) := GetProcedureAddress(IBaseLibraryHandle,'isc_blob_set_desc');
|
||||||
|
pointer(isc_cancel_blob) := GetProcedureAddress(IBaseLibraryHandle,'isc_cancel_blob');
|
||||||
|
pointer(isc_cancel_events) := GetProcedureAddress(IBaseLibraryHandle,'isc_cancel_events');
|
||||||
|
pointer(isc_close_blob) := GetProcedureAddress(IBaseLibraryHandle,'isc_close_blob');
|
||||||
pointer(isc_commit_retaining) := GetProcedureAddress(IBaseLibraryHandle,'isc_commit_retaining');
|
pointer(isc_commit_retaining) := GetProcedureAddress(IBaseLibraryHandle,'isc_commit_retaining');
|
||||||
pointer(isc_rollback_retaining) := GetProcedureAddress(IBaseLibraryHandle,'isc_rollback_retaining');
|
pointer(isc_commit_transaction) := GetProcedureAddress(IBaseLibraryHandle,'isc_commit_transaction');
|
||||||
pointer(isc_detach_database) := GetProcedureAddress(IBaseLibraryHandle,'isc_detach_database');
|
pointer(isc_create_blob) := GetProcedureAddress(IBaseLibraryHandle,'isc_create_blob');
|
||||||
pointer(isc_vax_integer) := GetProcedureAddress(IBaseLibraryHandle,'isc_vax_integer');
|
pointer(isc_create_blob2) := GetProcedureAddress(IBaseLibraryHandle,'isc_create_blob2');
|
||||||
pointer(isc_dsql_free_statement) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_free_statement');
|
pointer(isc_create_database) := GetProcedureAddress(IBaseLibraryHandle,'isc_create_database');
|
||||||
pointer(isc_dsql_allocate_statement) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_allocate_statement');
|
pointer(isc_database_info) := GetProcedureAddress(IBaseLibraryHandle,'isc_database_info');
|
||||||
pointer(isc_dsql_prepare) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_prepare');
|
|
||||||
pointer(isc_dsql_describe) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_describe');
|
|
||||||
pointer(isc_dsql_execute) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_execute');
|
|
||||||
pointer(isc_dsql_fetch) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_fetch');
|
|
||||||
pointer(isc_decode_date) := GetProcedureAddress(IBaseLibraryHandle,'isc_decode_date');
|
pointer(isc_decode_date) := GetProcedureAddress(IBaseLibraryHandle,'isc_decode_date');
|
||||||
pointer(isc_decode_sql_date) := GetProcedureAddress(IBaseLibraryHandle,'isc_decode_sql_date');
|
pointer(isc_decode_sql_date) := GetProcedureAddress(IBaseLibraryHandle,'isc_decode_sql_date');
|
||||||
pointer(isc_decode_sql_time) := GetProcedureAddress(IBaseLibraryHandle,'isc_decode_sql_time');
|
pointer(isc_decode_sql_time) := GetProcedureAddress(IBaseLibraryHandle,'isc_decode_sql_time');
|
||||||
pointer(isc_decode_timestamp) := GetProcedureAddress(IBaseLibraryHandle,'isc_decode_timestamp');
|
pointer(isc_decode_timestamp) := GetProcedureAddress(IBaseLibraryHandle,'isc_decode_timestamp');
|
||||||
|
pointer(isc_detach_database) := GetProcedureAddress(IBaseLibraryHandle,'isc_detach_database');
|
||||||
|
pointer(isc_drop_database) := GetProcedureAddress(IBaseLibraryHandle,'isc_drop_database');
|
||||||
|
pointer(isc_dsql_allocate_statement) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_allocate_statement');
|
||||||
|
pointer(isc_dsql_alloc_statement2) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_alloc_statement2');
|
||||||
|
pointer(isc_dsql_describe) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_describe');
|
||||||
|
pointer(isc_dsql_describe_bind) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_describe_bind');
|
||||||
|
pointer(isc_dsql_exec_immed2) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_exec_immed2');
|
||||||
|
pointer(isc_dsql_execute) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_execute');
|
||||||
|
pointer(isc_dsql_execute2) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_execute2');
|
||||||
|
pointer(isc_dsql_execute_immediate) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_execute_immediate');
|
||||||
|
pointer(isc_dsql_fetch) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_fetch');
|
||||||
|
pointer(isc_dsql_finish) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_finish');
|
||||||
|
pointer(isc_dsql_free_statement) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_free_statement');
|
||||||
|
pointer(isc_dsql_insert) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_insert');
|
||||||
|
pointer(isc_dsql_prepare) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_prepare');
|
||||||
|
pointer(isc_dsql_set_cursor_name) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_set_cursor_name');
|
||||||
|
pointer(isc_dsql_sql_info) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_sql_info');
|
||||||
|
pointer(isc_encode_date) := GetProcedureAddress(IBaseLibraryHandle,'isc_encode_date');
|
||||||
|
pointer(isc_encode_sql_date) := GetProcedureAddress(IBaseLibraryHandle,'isc_encode_sql_date');
|
||||||
|
pointer(isc_encode_sql_time) := GetProcedureAddress(IBaseLibraryHandle,'isc_encode_sql_time');
|
||||||
|
pointer(isc_encode_timestamp) := GetProcedureAddress(IBaseLibraryHandle,'isc_encode_timestamp');
|
||||||
|
pointer(isc_event_block) := GetProcedureAddress(IBaseLibraryHandle,'isc_event_block');
|
||||||
|
pointer(isc_expand_dpb) := GetProcedureAddress(IBaseLibraryHandle,'isc_expand_dpb');
|
||||||
|
pointer(isc_modify_dpb) := GetProcedureAddress(IBaseLibraryHandle,'isc_modify_dpb');
|
||||||
|
pointer(isc_free) := GetProcedureAddress(IBaseLibraryHandle,'isc_free');
|
||||||
|
pointer(isc_get_segment) := GetProcedureAddress(IBaseLibraryHandle,'isc_get_segment');
|
||||||
|
pointer(isc_get_slice) := GetProcedureAddress(IBaseLibraryHandle,'isc_get_slice');
|
||||||
|
pointer(isc_interprete) := GetProcedureAddress(IBaseLibraryHandle,'isc_interprete');
|
||||||
|
pointer(isc_open_blob) := GetProcedureAddress(IBaseLibraryHandle,'isc_open_blob');
|
||||||
|
pointer(isc_open_blob2) := GetProcedureAddress(IBaseLibraryHandle,'isc_open_blob2');
|
||||||
|
pointer(isc_prepare_transaction2) := GetProcedureAddress(IBaseLibraryHandle,'isc_prepare_transaction2');
|
||||||
|
pointer(isc_print_sqlerror) := GetProcedureAddress(IBaseLibraryHandle,'isc_print_sqlerror');
|
||||||
|
pointer(isc_print_status) := GetProcedureAddress(IBaseLibraryHandle,'isc_print_status');
|
||||||
|
pointer(isc_put_segment) := GetProcedureAddress(IBaseLibraryHandle,'isc_put_segment');
|
||||||
|
pointer(isc_put_slice) := GetProcedureAddress(IBaseLibraryHandle,'isc_put_slice');
|
||||||
|
pointer(isc_que_events) := GetProcedureAddress(IBaseLibraryHandle,'isc_que_events');
|
||||||
|
pointer(isc_rollback_retaining) := GetProcedureAddress(IBaseLibraryHandle,'isc_rollback_retaining');
|
||||||
|
pointer(isc_rollback_transaction) := GetProcedureAddress(IBaseLibraryHandle,'isc_rollback_transaction');
|
||||||
|
pointer(isc_start_multiple) := GetProcedureAddress(IBaseLibraryHandle,'isc_start_multiple');
|
||||||
|
pointer(isc_start_transaction) := GetProcedureAddress(IBaseLibraryHandle,'isc_start_transaction');
|
||||||
|
pointer(isc_sqlcode) := GetProcedureAddress(IBaseLibraryHandle,'isc_sqlcode');
|
||||||
|
pointer(isc_sql_interprete) := GetProcedureAddress(IBaseLibraryHandle,'isc_sql_interprete');
|
||||||
|
pointer(isc_transaction_info) := GetProcedureAddress(IBaseLibraryHandle,'isc_transaction_info');
|
||||||
|
pointer(isc_transact_request) := GetProcedureAddress(IBaseLibraryHandle,'isc_transact_request');
|
||||||
|
pointer(isc_vax_integer) := GetProcedureAddress(IBaseLibraryHandle,'isc_vax_integer');
|
||||||
|
pointer(isc_portable_integer) := GetProcedureAddress(IBaseLibraryHandle,'isc_portable_integer');
|
||||||
|
pointer(isc_add_user) := GetProcedureAddress(IBaseLibraryHandle,'isc_add_user');
|
||||||
|
pointer(isc_delete_user) := GetProcedureAddress(IBaseLibraryHandle,'isc_delete_user');
|
||||||
|
pointer(isc_modify_user) := GetProcedureAddress(IBaseLibraryHandle,'isc_modify_user');
|
||||||
|
pointer(isc_compile_request) := GetProcedureAddress(IBaseLibraryHandle,'isc_compile_request');
|
||||||
|
pointer(isc_compile_request2) := GetProcedureAddress(IBaseLibraryHandle,'isc_compile_request2');
|
||||||
|
pointer(isc_ddl) := GetProcedureAddress(IBaseLibraryHandle,'isc_ddl');
|
||||||
|
pointer(isc_prepare_transaction) := GetProcedureAddress(IBaseLibraryHandle,'isc_prepare_transaction');
|
||||||
|
pointer(isc_receive) := GetProcedureAddress(IBaseLibraryHandle,'isc_receive');
|
||||||
|
pointer(isc_reconnect_transaction) := GetProcedureAddress(IBaseLibraryHandle,'isc_reconnect_transaction');
|
||||||
|
pointer(isc_release_request) := GetProcedureAddress(IBaseLibraryHandle,'isc_release_request');
|
||||||
|
pointer(isc_request_info) := GetProcedureAddress(IBaseLibraryHandle,'isc_request_info');
|
||||||
|
pointer(isc_seek_blob) := GetProcedureAddress(IBaseLibraryHandle,'isc_seek_blob');
|
||||||
|
pointer(isc_send) := GetProcedureAddress(IBaseLibraryHandle,'isc_send');
|
||||||
|
pointer(isc_start_and_send) := GetProcedureAddress(IBaseLibraryHandle,'isc_start_and_send');
|
||||||
|
pointer(isc_start_request) := GetProcedureAddress(IBaseLibraryHandle,'isc_start_request');
|
||||||
|
pointer(isc_unwind_request) := GetProcedureAddress(IBaseLibraryHandle,'isc_unwind_request');
|
||||||
|
pointer(isc_wait_for_event) := GetProcedureAddress(IBaseLibraryHandle,'isc_wait_for_event');
|
||||||
|
pointer(isc_close) := GetProcedureAddress(IBaseLibraryHandle,'isc_close');
|
||||||
|
pointer(isc_declare) := GetProcedureAddress(IBaseLibraryHandle,'isc_declare');
|
||||||
|
pointer(isc_describe) := GetProcedureAddress(IBaseLibraryHandle,'isc_describe');
|
||||||
|
pointer(isc_describe_bind) := GetProcedureAddress(IBaseLibraryHandle,'isc_describe_bind');
|
||||||
|
pointer(isc_execute) := GetProcedureAddress(IBaseLibraryHandle,'isc_execute');
|
||||||
|
pointer(isc_execute_immediate) := GetProcedureAddress(IBaseLibraryHandle,'isc_execute_immediate');
|
||||||
|
pointer(isc_fetch) := GetProcedureAddress(IBaseLibraryHandle,'isc_fetch');
|
||||||
|
pointer(isc_open) := GetProcedureAddress(IBaseLibraryHandle,'isc_open');
|
||||||
|
pointer(isc_prepare) := GetProcedureAddress(IBaseLibraryHandle,'isc_prepare');
|
||||||
|
pointer(isc_dsql_execute_m) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_execute_m');
|
||||||
|
pointer(isc_dsql_execute2_m) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_execute2_m');
|
||||||
|
pointer(isc_dsql_execute_immediate_m) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_execute_immediate_m');
|
||||||
|
pointer(isc_dsql_exec_immed3_m) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_exec_immed3_m');
|
||||||
|
pointer(isc_dsql_fetch_m) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_fetch_m');
|
||||||
|
pointer(isc_dsql_insert_m) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_insert_m');
|
||||||
|
pointer(isc_dsql_prepare_m) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_prepare_m');
|
||||||
|
pointer(isc_dsql_release) := GetProcedureAddress(IBaseLibraryHandle,'isc_dsql_release');
|
||||||
|
pointer(isc_embed_dsql_close) := GetProcedureAddress(IBaseLibraryHandle,'isc_embed_dsql_close');
|
||||||
|
pointer(isc_embed_dsql_declare) := GetProcedureAddress(IBaseLibraryHandle,'isc_embed_dsql_declare');
|
||||||
|
pointer(isc_embed_dsql_describe) := GetProcedureAddress(IBaseLibraryHandle,'isc_embed_dsql_describe');
|
||||||
|
pointer(isc_embed_dsql_describe_bind) := GetProcedureAddress(IBaseLibraryHandle,'isc_embed_dsql_describe_bind');
|
||||||
|
pointer(isc_embed_dsql_execute) := GetProcedureAddress(IBaseLibraryHandle,'isc_embed_dsql_execute');
|
||||||
|
pointer(isc_embed_dsql_execute2) := GetProcedureAddress(IBaseLibraryHandle,'isc_embed_dsql_execute2');
|
||||||
|
pointer(isc_embed_dsql_execute_immed) := GetProcedureAddress(IBaseLibraryHandle,'isc_embed_dsql_execute_immed');
|
||||||
|
pointer(isc_embed_dsql_fetch) := GetProcedureAddress(IBaseLibraryHandle,'isc_embed_dsql_fetch');
|
||||||
|
pointer(isc_embed_dsql_open) := GetProcedureAddress(IBaseLibraryHandle,'isc_embed_dsql_open');
|
||||||
|
pointer(isc_embed_dsql_open2) := GetProcedureAddress(IBaseLibraryHandle,'isc_embed_dsql_open2');
|
||||||
|
pointer(isc_embed_dsql_insert) := GetProcedureAddress(IBaseLibraryHandle,'isc_embed_dsql_insert');
|
||||||
|
pointer(isc_embed_dsql_prepare) := GetProcedureAddress(IBaseLibraryHandle,'isc_embed_dsql_prepare');
|
||||||
|
pointer(isc_embed_dsql_release) := GetProcedureAddress(IBaseLibraryHandle,'isc_embed_dsql_release');
|
||||||
|
pointer(BLOB_open) := GetProcedureAddress(IBaseLibraryHandle,'BLOB_open');
|
||||||
|
pointer(BLOB_put) := GetProcedureAddress(IBaseLibraryHandle,'BLOB_put');
|
||||||
|
pointer(BLOB_close) := GetProcedureAddress(IBaseLibraryHandle,'BLOB_close');
|
||||||
|
pointer(BLOB_get) := GetProcedureAddress(IBaseLibraryHandle,'BLOB_get');
|
||||||
|
pointer(BLOB_display) := GetProcedureAddress(IBaseLibraryHandle,'BLOB_display');
|
||||||
|
pointer(BLOB_dump) := GetProcedureAddress(IBaseLibraryHandle,'BLOB_dump');
|
||||||
|
pointer(BLOB_edit) := GetProcedureAddress(IBaseLibraryHandle,'BLOB_edit');
|
||||||
|
pointer(BLOB_load) := GetProcedureAddress(IBaseLibraryHandle,'BLOB_load');
|
||||||
|
pointer(BLOB_text_dump) := GetProcedureAddress(IBaseLibraryHandle,'BLOB_text_dump');
|
||||||
|
pointer(BLOB_text_load) := GetProcedureAddress(IBaseLibraryHandle,'BLOB_text_load');
|
||||||
|
pointer(Bopen) := GetProcedureAddress(IBaseLibraryHandle,'Bopen');
|
||||||
|
{$IFDEF Unix}
|
||||||
|
pointer(Bopen2) := GetProcedureAddress(IBaseLibraryHandle,'Bopen2');
|
||||||
|
{$ENDIF}
|
||||||
|
pointer(isc_ftof) := GetProcedureAddress(IBaseLibraryHandle,'isc_ftof');
|
||||||
|
pointer(isc_print_blr) := GetProcedureAddress(IBaseLibraryHandle,'isc_print_blr');
|
||||||
|
pointer(isc_set_debug) := GetProcedureAddress(IBaseLibraryHandle,'isc_set_debug');
|
||||||
|
pointer(isc_qtoq) := GetProcedureAddress(IBaseLibraryHandle,'isc_qtoq');
|
||||||
|
pointer(isc_vtof) := GetProcedureAddress(IBaseLibraryHandle,'isc_vtof');
|
||||||
|
pointer(isc_vtov) := GetProcedureAddress(IBaseLibraryHandle,'isc_vtov');
|
||||||
|
pointer(isc_version) := GetProcedureAddress(IBaseLibraryHandle,'isc_version');
|
||||||
|
{$IFDEF Unix}
|
||||||
|
pointer(isc_reset_fpe) := GetProcedureAddress(IBaseLibraryHandle,'isc_reset_fpe');
|
||||||
|
{$ENDIF}
|
||||||
|
pointer(isc_service_attach) := GetProcedureAddress(IBaseLibraryHandle,'isc_service_attach');
|
||||||
|
pointer(isc_service_detach) := GetProcedureAddress(IBaseLibraryHandle,'isc_service_detach');
|
||||||
|
pointer(isc_service_query) := GetProcedureAddress(IBaseLibraryHandle,'isc_service_query');
|
||||||
|
pointer(isc_service_start) := GetProcedureAddress(IBaseLibraryHandle,'isc_service_start');
|
||||||
|
{$IFDEF Unix}
|
||||||
|
pointer(isc_compile_map) := GetProcedureAddress(IBaseLibraryHandle,'isc_compile_map');
|
||||||
|
pointer(isc_compile_menu) := GetProcedureAddress(IBaseLibraryHandle,'isc_compile_menu');
|
||||||
|
pointer(isc_compile_sub_map) := GetProcedureAddress(IBaseLibraryHandle,'isc_compile_sub_map');
|
||||||
|
pointer(isc_create_window) := GetProcedureAddress(IBaseLibraryHandle,'isc_create_window');
|
||||||
|
pointer(isc_delete_window) := GetProcedureAddress(IBaseLibraryHandle,'isc_delete_window');
|
||||||
|
pointer(isc_drive_form) := GetProcedureAddress(IBaseLibraryHandle,'isc_drive_form');
|
||||||
|
pointer(isc_drive_menu) := GetProcedureAddress(IBaseLibraryHandle,'isc_drive_menu');
|
||||||
|
pointer(isc_form_delete) := GetProcedureAddress(IBaseLibraryHandle,'isc_form_delete');
|
||||||
|
pointer(isc_form_fetch) := GetProcedureAddress(IBaseLibraryHandle,'isc_form_fetch');
|
||||||
|
pointer(isc_form_insert) := GetProcedureAddress(IBaseLibraryHandle,'isc_form_insert');
|
||||||
|
pointer(isc_get_entree) := GetProcedureAddress(IBaseLibraryHandle,'isc_get_entree');
|
||||||
|
pointer(isc_initialize_menu) := GetProcedureAddress(IBaseLibraryHandle,'isc_initialize_menu');
|
||||||
|
pointer(isc_menu) := GetProcedureAddress(IBaseLibraryHandle,'isc_menu');
|
||||||
|
pointer(isc_load_form) := GetProcedureAddress(IBaseLibraryHandle,'isc_load_form');
|
||||||
|
pointer(isc_pop_window) := GetProcedureAddress(IBaseLibraryHandle,'isc_pop_window');
|
||||||
|
pointer(isc_put_entree) := GetProcedureAddress(IBaseLibraryHandle,'isc_put_entree');
|
||||||
|
pointer(isc_reset_form) := GetProcedureAddress(IBaseLibraryHandle,'isc_reset_form');
|
||||||
|
pointer(isc_suspend_window) := GetProcedureAddress(IBaseLibraryHandle,'isc_suspend_window');
|
||||||
|
{$ENDIF}
|
||||||
|
pointer(isc_attach_database) := GetProcedureAddress(IBaseLibraryHandle,'isc_attach_database');
|
||||||
|
pointer(isc_array_gen_sdl) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_gen_sdl');
|
||||||
|
pointer(isc_array_get_slice) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_get_slice');
|
||||||
|
pointer(isc_array_lookup_bounds) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_lookup_bounds');
|
||||||
|
pointer(isc_array_lookup_desc) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_lookup_desc');
|
||||||
|
pointer(isc_array_set_desc) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_set_desc');
|
||||||
|
pointer(isc_array_put_slice) := GetProcedureAddress(IBaseLibraryHandle,'isc_array_put_slice');
|
||||||
|
pointer(isc_blob_gen_bpb) := GetProcedureAddress(IBaseLibraryHandle,'isc_blob_gen_bpb');
|
||||||
|
pointer(isc_blob_info) := GetProcedureAddress(IBaseLibraryHandle,'isc_blob_info');
|
||||||
|
pointer(isc_blob_lookup_desc) := GetProcedureAddress(IBaseLibraryHandle,'isc_blob_lookup_desc');
|
||||||
|
pointer(isc_blob_set_desc) := GetProcedureAddress(IBaseLibraryHandle,'isc_blob_set_desc');
|
||||||
|
pointer(isc_cancel_blob) := GetProcedureAddress(IBaseLibraryHandle,'isc_cancel_blob');
|
||||||
|
pointer(isc_cancel_events) := GetProcedureAddress(IBaseLibraryHandle,'isc_cancel_events');
|
||||||
|
pointer(isc_close_blob) := GetProcedureAddress(IBaseLibraryHandle,'isc_close_blob');
|
||||||
|
pointer(isc_commit_retaining) := GetProcedureAddress(IBaseLibraryHandle,'isc_commit_retaining');
|
||||||
|
pointer(isc_commit_retaining) := GetProcedureAddress(IBaseLibraryHandle,'isc_commit_retaining');
|
||||||
|
pointer(isc_commit_transaction) := GetProcedureAddress(IBaseLibraryHandle,'isc_commit_transaction');
|
||||||
|
pointer(isc_compile_request) := GetProcedureAddress(IBaseLibraryHandle,'isc_compile_request');
|
||||||
|
pointer(isc_compile_request2) := GetProcedureAddress(IBaseLibraryHandle,'isc_compile_request2');
|
||||||
|
pointer(isc_create_blob) := GetProcedureAddress(IBaseLibraryHandle,'isc_create_blob');
|
||||||
|
pointer(isc_create_blob2) := GetProcedureAddress(IBaseLibraryHandle,'isc_create_blob2');
|
||||||
|
pointer(isc_create_database) := GetProcedureAddress(IBaseLibraryHandle,'isc_create_database');
|
||||||
pointer(isc_database_info) := GetProcedureAddress(IBaseLibraryHandle,'isc_database_info');
|
pointer(isc_database_info) := GetProcedureAddress(IBaseLibraryHandle,'isc_database_info');
|
||||||
|
pointer(isc_ddl) := GetProcedureAddress(IBaseLibraryHandle,'isc_ddl');
|
||||||
|
pointer(isc_decode_date) := GetProcedureAddress(IBaseLibraryHandle,'isc_decode_date');
|
||||||
|
pointer(isc_decode_sql_date) := GetProcedureAddress(IBaseLibraryHandle,'isc_decode_sql_date');
|
||||||
|
pointer(isc_decode_sql_time) := GetProcedureAddress(IBaseLibraryHandle,'isc_decode_sql_time');
|
||||||
|
pointer(isc_decode_timestamp) := GetProcedureAddress(IBaseLibraryHandle,'isc_decode_timestamp');
|
||||||
|
pointer(isc_detach_database) := GetProcedureAddress(IBaseLibraryHandle,'isc_detach_database');
|
||||||
|
pointer(isc_drop_database) := GetProcedureAddress(IBaseLibraryHandle,'isc_drop_database');
|
||||||
|
pointer(isc_encode_date) := GetProcedureAddress(IBaseLibraryHandle,'isc_encode_date');
|
||||||
|
pointer(isc_encode_sql_date) := GetProcedureAddress(IBaseLibraryHandle,'isc_encode_sql_date');
|
||||||
|
pointer(isc_encode_sql_time) := GetProcedureAddress(IBaseLibraryHandle,'isc_encode_sql_time');
|
||||||
|
pointer(isc_encode_timestamp) := GetProcedureAddress(IBaseLibraryHandle,'isc_encode_timestamp');
|
||||||
|
pointer(isc_event_block) := GetProcedureAddress(IBaseLibraryHandle,'isc_event_block');
|
||||||
|
// pointer(isc_event_counts) := GetProcedureAddress(IBaseLibraryHandle,'isc_event_counts');
|
||||||
|
pointer(isc_expand_dpb) := GetProcedureAddress(IBaseLibraryHandle,'isc_expand_dpb');
|
||||||
|
pointer(isc_modify_dpb) := GetProcedureAddress(IBaseLibraryHandle,'isc_modify_dpb');
|
||||||
|
pointer(isc_free) := GetProcedureAddress(IBaseLibraryHandle,'isc_free');
|
||||||
|
pointer(isc_get_segment) := GetProcedureAddress(IBaseLibraryHandle,'isc_get_segment');
|
||||||
|
pointer(isc_get_slice) := GetProcedureAddress(IBaseLibraryHandle,'isc_get_slice');
|
||||||
|
pointer(isc_interprete) := GetProcedureAddress(IBaseLibraryHandle,'isc_interprete');
|
||||||
|
pointer(isc_open_blob) := GetProcedureAddress(IBaseLibraryHandle,'isc_open_blob');
|
||||||
|
pointer(isc_open_blob2) := GetProcedureAddress(IBaseLibraryHandle,'isc_open_blob2');
|
||||||
|
pointer(isc_prepare_transaction) := GetProcedureAddress(IBaseLibraryHandle,'isc_prepare_transaction');
|
||||||
|
pointer(isc_prepare_transaction2) := GetProcedureAddress(IBaseLibraryHandle,'isc_prepare_transaction2');
|
||||||
|
pointer(isc_print_sqlerror) := GetProcedureAddress(IBaseLibraryHandle,'isc_print_sqlerror');
|
||||||
|
pointer(isc_print_status) := GetProcedureAddress(IBaseLibraryHandle,'isc_print_status');
|
||||||
|
pointer(isc_put_segment) := GetProcedureAddress(IBaseLibraryHandle,'isc_put_segment');
|
||||||
|
pointer(isc_put_slice) := GetProcedureAddress(IBaseLibraryHandle,'isc_put_slice');
|
||||||
|
pointer(isc_que_events) := GetProcedureAddress(IBaseLibraryHandle,'isc_que_events');
|
||||||
|
pointer(isc_receive) := GetProcedureAddress(IBaseLibraryHandle,'isc_receive');
|
||||||
|
pointer(isc_reconnect_transaction) := GetProcedureAddress(IBaseLibraryHandle,'isc_reconnect_transaction');
|
||||||
|
pointer(isc_release_request) := GetProcedureAddress(IBaseLibraryHandle,'isc_release_request');
|
||||||
|
pointer(isc_request_info) := GetProcedureAddress(IBaseLibraryHandle,'isc_request_info');
|
||||||
|
{$IFDEF Unix}
|
||||||
|
pointer(isc_reset_fpe) := GetProcedureAddress(IBaseLibraryHandle,'isc_reset_fpe');
|
||||||
|
{$ENDIF}
|
||||||
|
pointer(isc_rollback_transaction) := GetProcedureAddress(IBaseLibraryHandle,'isc_rollback_transaction');
|
||||||
|
pointer(isc_rollback_retaining) := GetProcedureAddress(IBaseLibraryHandle,'isc_rollback_retaining');
|
||||||
|
pointer(isc_seek_blob) := GetProcedureAddress(IBaseLibraryHandle,'isc_seek_blob');
|
||||||
|
pointer(isc_send) := GetProcedureAddress(IBaseLibraryHandle,'isc_send');
|
||||||
|
pointer(isc_service_attach) := GetProcedureAddress(IBaseLibraryHandle,'isc_service_attach');
|
||||||
|
pointer(isc_service_detach) := GetProcedureAddress(IBaseLibraryHandle,'isc_service_detach');
|
||||||
|
pointer(isc_service_query) := GetProcedureAddress(IBaseLibraryHandle,'isc_service_query');
|
||||||
|
pointer(isc_service_start) := GetProcedureAddress(IBaseLibraryHandle,'isc_service_start');
|
||||||
|
pointer(isc_start_and_send) := GetProcedureAddress(IBaseLibraryHandle,'isc_start_and_send');
|
||||||
|
pointer(isc_start_multiple) := GetProcedureAddress(IBaseLibraryHandle,'isc_start_multiple');
|
||||||
|
pointer(isc_start_request) := GetProcedureAddress(IBaseLibraryHandle,'isc_start_request');
|
||||||
|
pointer(isc_start_transaction) := GetProcedureAddress(IBaseLibraryHandle,'isc_start_transaction');
|
||||||
|
pointer(isc_sqlcode) := GetProcedureAddress(IBaseLibraryHandle,'isc_sqlcode');
|
||||||
|
pointer(isc_transaction_info) := GetProcedureAddress(IBaseLibraryHandle,'isc_transaction_info');
|
||||||
|
pointer(isc_transact_request) := GetProcedureAddress(IBaseLibraryHandle,'isc_transact_request');
|
||||||
|
pointer(isc_unwind_request) := GetProcedureAddress(IBaseLibraryHandle,'isc_unwind_request');
|
||||||
|
pointer(isc_wait_for_event) := GetProcedureAddress(IBaseLibraryHandle,'isc_wait_for_event');
|
||||||
|
pointer(isc_ftof) := GetProcedureAddress(IBaseLibraryHandle,'isc_ftof');
|
||||||
|
pointer(isc_print_blr) := GetProcedureAddress(IBaseLibraryHandle,'isc_print_blr');
|
||||||
|
pointer(isc_set_debug) := GetProcedureAddress(IBaseLibraryHandle,'isc_set_debug');
|
||||||
|
pointer(isc_qtoq) := GetProcedureAddress(IBaseLibraryHandle,'isc_qtoq');
|
||||||
|
pointer(isc_vax_integer) := GetProcedureAddress(IBaseLibraryHandle,'isc_vax_integer');
|
||||||
|
pointer(isc_vtof) := GetProcedureAddress(IBaseLibraryHandle,'isc_vtof');
|
||||||
|
pointer(isc_vtov) := GetProcedureAddress(IBaseLibraryHandle,'isc_vtov');
|
||||||
|
pointer(isc_version) := GetProcedureAddress(IBaseLibraryHandle,'isc_version');
|
||||||
|
pointer(Bopen) := GetProcedureAddress(IBaseLibraryHandle,'Bopen');
|
||||||
|
pointer(BLOB_open) := GetProcedureAddress(IBaseLibraryHandle,'BLOB_open');
|
||||||
|
{$IFDEF Unix}
|
||||||
|
pointer(Bopen2) := GetProcedureAddress(IBaseLibraryHandle,'Bopen2');
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -136,7 +136,21 @@ function mktemp(__template:Pchar):Pchar;cdecl;external clib name 'mktemp';
|
|||||||
function mkstemp(__template:Pchar):longint;cdecl;external clib name 'mkstemp';
|
function mkstemp(__template:Pchar):longint;cdecl;external clib name 'mkstemp';
|
||||||
function mkstemp64(__template:Pchar):longint;cdecl;external clib name 'mkstemp64';
|
function mkstemp64(__template:Pchar):longint;cdecl;external clib name 'mkstemp64';
|
||||||
function mkdtemp(__template:Pchar):Pchar;cdecl;external clib name 'mkdtemp';
|
function mkdtemp(__template:Pchar):Pchar;cdecl;external clib name 'mkdtemp';
|
||||||
|
// **************** detect whether system symbol is hidden. Should be as of 1.9.4
|
||||||
|
{$ifdef VER1_0}
|
||||||
|
{$define __SYSTEMONLY}
|
||||||
|
{$endif}
|
||||||
|
{$ifdef VER1_1}
|
||||||
|
{$define __SYSTEMONLY}
|
||||||
|
{$endif}
|
||||||
|
{$ifdef VER1_9_2}
|
||||||
|
{$define __SYSTEMONLY}
|
||||||
|
{$endif}
|
||||||
|
// **************** End of detect
|
||||||
function __system(__command:Pchar):longint;cdecl;external clib name 'system';
|
function __system(__command:Pchar):longint;cdecl;external clib name 'system';
|
||||||
|
{$ifndef __SYSTEMONLY}
|
||||||
|
function system(__command:Pchar):longint;cdecl;external clib name 'system';
|
||||||
|
{$endif}
|
||||||
function canonicalize_file_name(__name:Pchar):Pchar;cdecl;external clib name 'canonicalize_file_name';
|
function canonicalize_file_name(__name:Pchar):Pchar;cdecl;external clib name 'canonicalize_file_name';
|
||||||
function realpath(__name:Pchar; __resolved:Pchar):Pchar;cdecl;external clib name 'realpath';
|
function realpath(__name:Pchar; __resolved:Pchar):Pchar;cdecl;external clib name 'realpath';
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ name=mysql
|
|||||||
version=1.9.7
|
version=1.9.7
|
||||||
|
|
||||||
[target]
|
[target]
|
||||||
units=mysql4_com mysql4_version mysql4 mysql3_com mysql3_version mysql3
|
units=mysql4_com mysql4_version mysql4 mysql4dyn mysql4_comdyn mysql3_com mysql3_version mysql3
|
||||||
examples=testdb4 testdb3
|
examples=testdb4 testdb3
|
||||||
|
|
||||||
[require]
|
[require]
|
||||||
|
@ -13,19 +13,6 @@ uses mysql4_com;
|
|||||||
mysql.ph
|
mysql.ph
|
||||||
}
|
}
|
||||||
|
|
||||||
const
|
|
||||||
External_library='mysqlclient'; {Setup as you need}
|
|
||||||
|
|
||||||
{ Pointers to basic pascal types, inserted by h2pas conversion program.}
|
|
||||||
Type
|
|
||||||
PLongint = ^Longint;
|
|
||||||
PSmallInt = ^SmallInt;
|
|
||||||
PByte = ^Byte;
|
|
||||||
PWord = ^Word;
|
|
||||||
PDWord = ^DWord;
|
|
||||||
PDouble = ^Double;
|
|
||||||
|
|
||||||
{$PACKRECORDS C}
|
|
||||||
|
|
||||||
{ Copyright (C) 2000 MySQL AB
|
{ Copyright (C) 2000 MySQL AB
|
||||||
|
|
||||||
@ -43,238 +30,21 @@ uses mysql4_com;
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA }
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA }
|
||||||
|
|
||||||
type
|
{$PACKRECORDS C}
|
||||||
|
|
||||||
Pmy_bool = ^my_bool;
|
const
|
||||||
my_bool = char;
|
External_library='mysqlclient'; {Setup as you need}
|
||||||
|
|
||||||
Pgptr = ^gptr;
|
{ Pointers to basic pascal types, inserted by h2pas conversion program.}
|
||||||
gptr = char;
|
{ Type
|
||||||
|
PLongint = ^Longint;
|
||||||
|
PSmallInt = ^SmallInt;
|
||||||
|
PByte = ^Byte;
|
||||||
|
PWord = ^Word;
|
||||||
|
PDWord = ^DWord;
|
||||||
|
PDouble = ^Double;}
|
||||||
|
|
||||||
Pmy_socket = ^my_socket;
|
{$i mysql4types.inc}
|
||||||
my_socket = longint;
|
|
||||||
|
|
||||||
var
|
|
||||||
mysql_port : dword;cvar;external;
|
|
||||||
mysql_unix_port : Pchar;cvar;external;
|
|
||||||
|
|
||||||
type
|
|
||||||
Pst_mysql_field = ^st_mysql_field;
|
|
||||||
st_mysql_field = record
|
|
||||||
name : Pchar;
|
|
||||||
table : Pchar;
|
|
||||||
org_table : Pchar;
|
|
||||||
db : Pchar;
|
|
||||||
def : Pchar;
|
|
||||||
length : dword;
|
|
||||||
max_length : dword;
|
|
||||||
flags : dword;
|
|
||||||
decimals : dword;
|
|
||||||
ftype : enum_field_types;
|
|
||||||
end;
|
|
||||||
MYSQL_FIELD = st_mysql_field;
|
|
||||||
TMYSQL_FIELD = MYSQL_FIELD;
|
|
||||||
PMYSQL_FIELD = ^MYSQL_FIELD;
|
|
||||||
|
|
||||||
function IS_PRI_KEY(n : longint) : Boolean;
|
|
||||||
function IS_NOT_NULL(n : longint) : Boolean;
|
|
||||||
function IS_BLOB(n : longint) : boolean;
|
|
||||||
|
|
||||||
type
|
|
||||||
MYSQL_ROW = ppchar;
|
|
||||||
PMYSQL_ROW = ^MYSQL_ROW;
|
|
||||||
TMYSQL_ROW = MYSQL_ROW;
|
|
||||||
|
|
||||||
PMYSQL_FIELD_OFFSET = ^MYSQL_FIELD_OFFSET;
|
|
||||||
MYSQL_FIELD_OFFSET = dword;
|
|
||||||
|
|
||||||
Pmy_ulonglong = ^my_ulonglong;
|
|
||||||
my_ulonglong = qword;
|
|
||||||
|
|
||||||
function MYSQL_COUNT_ERROR : longint;
|
|
||||||
|
|
||||||
type
|
|
||||||
Pst_mysql_rows = ^st_mysql_rows;
|
|
||||||
st_mysql_rows = record
|
|
||||||
next : Pst_mysql_rows;
|
|
||||||
data : MYSQL_ROW;
|
|
||||||
end;
|
|
||||||
MYSQL_ROWS = st_mysql_rows;
|
|
||||||
TMYSQL_ROWS = MYSQL_ROWS;
|
|
||||||
PMYSQL_ROWS = ^MYSQL_ROWS;
|
|
||||||
|
|
||||||
MYSQL_ROW_OFFSET = MYSQL_ROWS;
|
|
||||||
PMYSQL_ROW_OFFSET = ^MYSQL_ROW_OFFSET;
|
|
||||||
|
|
||||||
Pst_used_mem = ^st_used_mem;
|
|
||||||
st_used_mem = record
|
|
||||||
next : Pst_used_mem;
|
|
||||||
left : dword;
|
|
||||||
size : dword;
|
|
||||||
end;
|
|
||||||
|
|
||||||
USED_MEM = st_used_mem;
|
|
||||||
TUSED_MEM = USED_MEM;
|
|
||||||
PUSED_MEM = ^USED_MEM;
|
|
||||||
|
|
||||||
Pst_mem_root = ^st_mem_root;
|
|
||||||
st_mem_root = record
|
|
||||||
free : PUSED_MEM;
|
|
||||||
used : PUSED_MEM;
|
|
||||||
pre_alloc : PUSED_MEM;
|
|
||||||
min_malloc : dword;
|
|
||||||
block_size : dword;
|
|
||||||
block_num : dword;
|
|
||||||
first_block_usage : dword;
|
|
||||||
error_handler : procedure ;cdecl;
|
|
||||||
end;
|
|
||||||
MEM_ROOT = st_mem_root;
|
|
||||||
TMEM_ROOT = MEM_ROOT;
|
|
||||||
PMEM_ROOT = ^MEM_ROOT;
|
|
||||||
|
|
||||||
Pst_mysql_data = ^st_mysql_data;
|
|
||||||
st_mysql_data = record
|
|
||||||
rows : my_ulonglong;
|
|
||||||
fields : dword;
|
|
||||||
data : PMYSQL_ROWS;
|
|
||||||
alloc : MEM_ROOT;
|
|
||||||
end;
|
|
||||||
MYSQL_DATA = st_mysql_data;
|
|
||||||
TMYSQL_DATA = MYSQL_DATA;
|
|
||||||
PMYSQL_DATA = ^MYSQL_DATA;
|
|
||||||
|
|
||||||
Pst_mysql_options = ^st_mysql_options;
|
|
||||||
st_mysql_options = record
|
|
||||||
connect_timeout : dword;
|
|
||||||
client_flag : dword;
|
|
||||||
port : dword;
|
|
||||||
host : Pchar;
|
|
||||||
init_command : Pchar;
|
|
||||||
user : Pchar;
|
|
||||||
password : Pchar;
|
|
||||||
unix_socket : Pchar;
|
|
||||||
db : Pchar;
|
|
||||||
my_cnf_file : Pchar;
|
|
||||||
my_cnf_group : Pchar;
|
|
||||||
charset_dir : Pchar;
|
|
||||||
charset_name : Pchar;
|
|
||||||
ssl_key : Pchar;
|
|
||||||
ssl_cert : Pchar;
|
|
||||||
ssl_ca : Pchar;
|
|
||||||
ssl_capath : Pchar;
|
|
||||||
ssl_cipher : Pchar;
|
|
||||||
max_allowed_packet : Cardinal;
|
|
||||||
use_ssl : my_bool;
|
|
||||||
compress : my_bool;
|
|
||||||
named_pipe : my_bool;
|
|
||||||
rpl_probe : my_bool;
|
|
||||||
rpl_parse : my_bool;
|
|
||||||
no_master_reads : my_bool;
|
|
||||||
end;
|
|
||||||
TMYSQL_OPTIONS = st_mysql_options;
|
|
||||||
PTMYSQL_OPTIONS = ^TMYSQL_OPTIONS;
|
|
||||||
|
|
||||||
mysql_option = (MYSQL_OPT_CONNECT_TIMEOUT,MYSQL_OPT_COMPRESS,
|
|
||||||
MYSQL_OPT_NAMED_PIPE,MYSQL_INIT_COMMAND,
|
|
||||||
MYSQL_READ_DEFAULT_FILE,MYSQL_READ_DEFAULT_GROUP,
|
|
||||||
MYSQL_SET_CHARSET_DIR,MYSQL_SET_CHARSET_NAME
|
|
||||||
);
|
|
||||||
|
|
||||||
mysql_status = (MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,
|
|
||||||
MYSQL_STATUS_USE_RESULT);
|
|
||||||
|
|
||||||
mysql_rpl_type = (MYSQL_RPL_MASTER,MYSQL_RPL_SLAVE,MYSQL_RPL_ADMIN );
|
|
||||||
|
|
||||||
Pst_mysql = ^st_mysql;
|
|
||||||
st_mysql = record
|
|
||||||
net : NET;
|
|
||||||
connector_fd : gptr;
|
|
||||||
host : Pchar;
|
|
||||||
user : Pchar;
|
|
||||||
passwd : Pchar;
|
|
||||||
unix_socket : Pchar;
|
|
||||||
server_version : Pchar;
|
|
||||||
host_info : Pchar;
|
|
||||||
info : Pchar;
|
|
||||||
db : Pchar;
|
|
||||||
charset : Pointer; //!! Was Pcharset_info_st;
|
|
||||||
fields : PMYSQL_FIELD;
|
|
||||||
field_alloc : MEM_ROOT;
|
|
||||||
affected_rows : my_ulonglong;
|
|
||||||
insert_id : my_ulonglong;
|
|
||||||
extra_info : my_ulonglong;
|
|
||||||
thread_id : dword;
|
|
||||||
packet_length : dword;
|
|
||||||
port : dword;
|
|
||||||
client_flag : dword;
|
|
||||||
server_capabilities : dword;
|
|
||||||
protocol_version : dword;
|
|
||||||
field_count : dword;
|
|
||||||
server_status : dword;
|
|
||||||
server_language : dword;
|
|
||||||
options : st_mysql_options;
|
|
||||||
status : mysql_status;
|
|
||||||
free_me : my_bool;
|
|
||||||
reconnect : my_bool;
|
|
||||||
scramble_buff : array[0..8] of char;
|
|
||||||
rpl_pivot : my_bool;
|
|
||||||
master : Pst_mysql;
|
|
||||||
next_slave : Pst_mysql;
|
|
||||||
last_used_slave : Pst_mysql;
|
|
||||||
last_used_con : Pst_mysql;
|
|
||||||
end;
|
|
||||||
TMYSQL = st_mysql;
|
|
||||||
PMYSQL = ^TMYSQL;
|
|
||||||
|
|
||||||
Pst_mysql_res = ^st_mysql_res;
|
|
||||||
st_mysql_res = record
|
|
||||||
row_count : my_ulonglong;
|
|
||||||
fields : PMYSQL_FIELD;
|
|
||||||
data : PMYSQL_DATA;
|
|
||||||
data_cursor : PMYSQL_ROWS;
|
|
||||||
lengths : Pdword;
|
|
||||||
handle : PMYSQL;
|
|
||||||
field_alloc : MEM_ROOT;
|
|
||||||
field_count : dword;
|
|
||||||
current_field : dword;
|
|
||||||
row : MYSQL_ROW;
|
|
||||||
current_row : MYSQL_ROW;
|
|
||||||
eof : my_bool;
|
|
||||||
end;
|
|
||||||
MYSQL_RES = st_mysql_res;
|
|
||||||
TMYSQL_RES = MYSQL_RES;
|
|
||||||
PMYSQL_RES = ^MYSQL_RES;
|
|
||||||
|
|
||||||
const
|
|
||||||
MAX_MYSQL_MANAGER_ERR = 256;
|
|
||||||
MAX_MYSQL_MANAGER_MSG = 256;
|
|
||||||
MANAGER_OK = 200;
|
|
||||||
MANAGER_INFO = 250;
|
|
||||||
MANAGER_ACCESS = 401;
|
|
||||||
MANAGER_CLIENT_ERR = 450;
|
|
||||||
MANAGER_INTERNAL_ERR = 500;
|
|
||||||
|
|
||||||
type
|
|
||||||
|
|
||||||
Pst_mysql_manager = ^st_mysql_manager;
|
|
||||||
st_mysql_manager = record
|
|
||||||
net : NET;
|
|
||||||
host : Pchar;
|
|
||||||
user : Pchar;
|
|
||||||
passwd : Pchar;
|
|
||||||
port : dword;
|
|
||||||
free_me : my_bool;
|
|
||||||
eof : my_bool;
|
|
||||||
cmd_status : longint;
|
|
||||||
last_errno : longint;
|
|
||||||
net_buf : Pchar;
|
|
||||||
net_buf_pos : Pchar;
|
|
||||||
net_data_end : Pchar;
|
|
||||||
net_buf_size : longint;
|
|
||||||
last_error : array[0..(MAX_MYSQL_MANAGER_ERR)-1] of char;
|
|
||||||
end;
|
|
||||||
MYSQL_MANAGER = st_mysql_manager;
|
|
||||||
PMYSQL_MANAGER = ^MYSQL_MANAGER;
|
|
||||||
|
|
||||||
function mysql_server_init(argc:longint; argv:PPchar; groups:PPchar):longint;cdecl;external External_library name 'mysql_server_init';
|
function mysql_server_init(argc:longint; argv:PPchar; groups:PPchar):longint;cdecl;external External_library name 'mysql_server_init';
|
||||||
procedure mysql_server_end;cdecl;external External_library name 'mysql_server_end';
|
procedure mysql_server_end;cdecl;external External_library name 'mysql_server_end';
|
||||||
@ -354,56 +124,27 @@ function mysql_escape_string(_to:Pchar; from:Pchar; from_length:dword):dword;cde
|
|||||||
function mysql_real_escape_string(mysql:PMYSQL; _to:Pchar; from:Pchar; length:dword):dword;cdecl;external External_library name 'mysql_real_escape_string';
|
function mysql_real_escape_string(mysql:PMYSQL; _to:Pchar; from:Pchar; length:dword):dword;cdecl;external External_library name 'mysql_real_escape_string';
|
||||||
procedure mysql_debug(debug:Pchar);cdecl;external External_library name 'mysql_debug';
|
procedure mysql_debug(debug:Pchar);cdecl;external External_library name 'mysql_debug';
|
||||||
|
|
||||||
Type
|
function mysql_odbc_escape_string(mysql:PMYSQL; _to:Pchar; to_length:dword; from:Pchar; from_length:dword;
|
||||||
TExdendBuffer = function (_para1:pointer; _to:Pchar; length:Pdword):Pchar;
|
|
||||||
function mysql_odbc_escape_string(mysql:PMYSQL; _to:Pchar; to_length:dword; from:Pchar; from_length:dword;
|
|
||||||
param:pointer; extend_buffer: TExdendBuffer):Pchar;cdecl;external External_library name 'mysql_odbc_escape_string';
|
param:pointer; extend_buffer: TExdendBuffer):Pchar;cdecl;external External_library name 'mysql_odbc_escape_string';
|
||||||
procedure myodbc_remove_escape(mysql:PMYSQL; name:Pchar);cdecl;external External_library name 'myodbc_remove_escape';
|
procedure myodbc_remove_escape(mysql:PMYSQL; name:Pchar);cdecl;external External_library name 'myodbc_remove_escape';
|
||||||
function mysql_thread_safe:dword;cdecl;external External_library name 'mysql_thread_safe';
|
function mysql_thread_safe:dword;cdecl;external External_library name 'mysql_thread_safe';
|
||||||
function mysql_manager_init(con:PMYSQL_MANAGER):PMYSQL_MANAGER;cdecl;external External_library name 'mysql_manager_init';
|
function mysql_manager_init(con:PMYSQL_MANAGER):PMYSQL_MANAGER;cdecl;external External_library name 'mysql_manager_init';
|
||||||
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';
|
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';
|
||||||
procedure mysql_manager_close(con:PMYSQL_MANAGER);cdecl;external External_library name 'mysql_manager_close';
|
procedure mysql_manager_close(con:PMYSQL_MANAGER);cdecl;external External_library name 'mysql_manager_close';
|
||||||
function mysql_manager_command(con:PMYSQL_MANAGER; cmd:Pchar; cmd_len:longint):longint;cdecl;external External_library name 'mysql_manager_command';
|
function mysql_manager_command(con:PMYSQL_MANAGER; cmd:Pchar; cmd_len:longint):longint;cdecl;external External_library name 'mysql_manager_command';
|
||||||
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';
|
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';
|
||||||
function mysql_reload(mysql : pmysql) : longint;
|
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';
|
||||||
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';
|
function net_safe_read(mysql:PMYSQL):dword;cdecl;external External_library name 'net_safe_read';
|
||||||
function net_safe_read(mysql:PMYSQL):dword;cdecl;external External_library name 'net_safe_read';
|
|
||||||
|
function IS_PRI_KEY(n : longint) : Boolean;
|
||||||
|
function IS_NOT_NULL(n : longint) : Boolean;
|
||||||
|
function IS_BLOB(n : longint) : boolean;
|
||||||
|
function MYSQL_COUNT_ERROR : longint;
|
||||||
|
function mysql_reload(mysql : pmysql) : longint;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
function IS_PRI_KEY(n : longint) : Boolean;
|
{$i mysql4impl.inc}
|
||||||
begin
|
|
||||||
IS_PRI_KEY:=(n and PRI_KEY_FLAG)<>0;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
function IS_NOT_NULL(n : longint) : Boolean;
|
|
||||||
begin
|
|
||||||
IS_NOT_NULL:=(n and NOT_NULL_FLAG)<>0;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
function IS_BLOB(n : longint) : Boolean;
|
|
||||||
begin
|
|
||||||
IS_BLOB:=(n and BLOB_FLAG)<>0;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
function IS_NUM_FIELD(f : Pst_mysql_field) : Boolean;
|
|
||||||
begin
|
|
||||||
IS_NUM_FIELD:=((f^.flags) and NUM_FLAG)<>0;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
function MYSQL_COUNT_ERROR : longint;
|
|
||||||
begin
|
|
||||||
MYSQL_COUNT_ERROR:= not (my_ulonglong(0));
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
function mysql_reload(mysql : pmysql) : longint;
|
|
||||||
begin
|
|
||||||
mysql_reload:=mysql_refresh(mysql,REFRESH_GRANT);
|
|
||||||
end;
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -10,10 +10,12 @@ interface
|
|||||||
mysqlclient
|
mysqlclient
|
||||||
mysql_com.ph
|
mysql_com.ph
|
||||||
}
|
}
|
||||||
|
{$PACKRECORDS C}
|
||||||
|
|
||||||
const
|
const
|
||||||
External_library='mysqlclient'; {Setup as you need}
|
External_library='mysqlclient'; {Setup as you need}
|
||||||
|
|
||||||
|
|
||||||
{ Pointers to basic pascal types, inserted by h2pas conversion program.}
|
{ Pointers to basic pascal types, inserted by h2pas conversion program.}
|
||||||
Type
|
Type
|
||||||
PLongint = ^Longint;
|
PLongint = ^Longint;
|
||||||
@ -23,15 +25,7 @@ Type
|
|||||||
PDWord = ^DWord;
|
PDWord = ^DWord;
|
||||||
PDouble = ^Double;
|
PDouble = ^Double;
|
||||||
|
|
||||||
{ Extra manually added types }
|
{$i mysql4_comtypes.inc}
|
||||||
PVIO = Pointer;
|
|
||||||
My_socket = longint;
|
|
||||||
my_bool = byte;
|
|
||||||
pppchar = ^PPChar;
|
|
||||||
gptr = Pointer;
|
|
||||||
|
|
||||||
|
|
||||||
{$PACKRECORDS C}
|
|
||||||
|
|
||||||
{ Copyright (C) 2000 MySQL AB
|
{ Copyright (C) 2000 MySQL AB
|
||||||
|
|
||||||
@ -48,151 +42,7 @@ Type
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA }
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA }
|
||||||
{
|
|
||||||
Common definition between mysql server & client
|
|
||||||
}
|
|
||||||
{ Field/table name length }
|
|
||||||
|
|
||||||
const
|
|
||||||
NAME_LEN = 64;
|
|
||||||
HOSTNAME_LENGTH = 60;
|
|
||||||
USERNAME_LENGTH = 16;
|
|
||||||
SERVER_VERSION_LENGTH = 60;
|
|
||||||
LOCAL_HOST = 'localhost';
|
|
||||||
LOCAL_HOST_NAMEDPIPE = '.';
|
|
||||||
|
|
||||||
type
|
|
||||||
enum_server_command = (COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY,
|
|
||||||
COM_FIELD_LIST,COM_CREATE_DB,COM_DROP_DB,
|
|
||||||
COM_REFRESH,COM_SHUTDOWN,COM_STATISTICS,
|
|
||||||
COM_PROCESS_INFO,COM_CONNECT,COM_PROCESS_KILL,
|
|
||||||
COM_DEBUG,COM_PING,COM_TIME,COM_DELAYED_INSERT,
|
|
||||||
COM_CHANGE_USER,COM_BINLOG_DUMP,COM_TABLE_DUMP,
|
|
||||||
COM_CONNECT_OUT,COM_REGISTER_SLAVE);
|
|
||||||
|
|
||||||
{ Field can't be NULL }
|
|
||||||
|
|
||||||
const
|
|
||||||
NOT_NULL_FLAG = 1;
|
|
||||||
PRI_KEY_FLAG = 2;
|
|
||||||
UNIQUE_KEY_FLAG = 4;
|
|
||||||
MULTIPLE_KEY_FLAG = 8;
|
|
||||||
BLOB_FLAG = 16;
|
|
||||||
UNSIGNED_FLAG = 32;
|
|
||||||
ZEROFILL_FLAG = 64;
|
|
||||||
BINARY_FLAG = 128;
|
|
||||||
ENUM_FLAG = 256;
|
|
||||||
AUTO_INCREMENT_FLAG = 512;
|
|
||||||
TIMESTAMP_FLAG = 1024;
|
|
||||||
SET_FLAG = 2048;
|
|
||||||
NUM_FLAG = 32768;
|
|
||||||
PART_KEY_FLAG = 16384;
|
|
||||||
GROUP_FLAG = 32768;
|
|
||||||
UNIQUE_FLAG = 65536;
|
|
||||||
REFRESH_GRANT = 1;
|
|
||||||
REFRESH_LOG = 2;
|
|
||||||
REFRESH_TABLES = 4;
|
|
||||||
REFRESH_HOSTS = 8;
|
|
||||||
REFRESH_STATUS = 16;
|
|
||||||
REFRESH_THREADS = 32;
|
|
||||||
REFRESH_SLAVE = 64;
|
|
||||||
REFRESH_MASTER = 128;
|
|
||||||
REFRESH_READ_LOCK = 16384;
|
|
||||||
REFRESH_FAST = 32768;
|
|
||||||
REFRESH_QUERY_CACHE = 65536;
|
|
||||||
REFRESH_QUERY_CACHE_FREE = $20000;
|
|
||||||
REFRESH_DES_KEY_FILE = $40000;
|
|
||||||
CLIENT_LONG_PASSWORD = 1;
|
|
||||||
CLIENT_FOUND_ROWS = 2;
|
|
||||||
CLIENT_LONG_FLAG = 4;
|
|
||||||
CLIENT_CONNECT_WITH_DB = 8;
|
|
||||||
CLIENT_NO_SCHEMA = 16;
|
|
||||||
CLIENT_COMPRESS = 32;
|
|
||||||
CLIENT_ODBC = 64;
|
|
||||||
CLIENT_LOCAL_FILES = 128;
|
|
||||||
CLIENT_IGNORE_SPACE = 256;
|
|
||||||
CLIENT_CHANGE_USER = 512;
|
|
||||||
CLIENT_INTERACTIVE = 1024;
|
|
||||||
CLIENT_SSL = 2048;
|
|
||||||
CLIENT_IGNORE_SIGPIPE = 4096;
|
|
||||||
CLIENT_TRANSACTIONS = 8192;
|
|
||||||
SERVER_STATUS_IN_TRANS = 1;
|
|
||||||
SERVER_STATUS_AUTOCOMMIT = 2;
|
|
||||||
MYSQL_ERRMSG_SIZE = 200;
|
|
||||||
NET_READ_TIMEOUT = 30;
|
|
||||||
NET_WRITE_TIMEOUT = 60;
|
|
||||||
MAX_BLOB_WIDTH = 8192;
|
|
||||||
{
|
|
||||||
#define NET_WAIT_TIMEOUT (8 60 60)
|
|
||||||
}
|
|
||||||
{
|
|
||||||
struct st_vio; // Only C
|
|
||||||
typedef struct st_vio Vio;
|
|
||||||
}
|
|
||||||
|
|
||||||
type
|
|
||||||
Pst_net = ^st_net;
|
|
||||||
st_net = record
|
|
||||||
vio : PVio;
|
|
||||||
buff : Pbyte;
|
|
||||||
buff_end : Pbyte;
|
|
||||||
write_pos : Pbyte;
|
|
||||||
read_pos : Pbyte;
|
|
||||||
fd : my_socket;
|
|
||||||
max_packet : dword;
|
|
||||||
max_packet_size : dword;
|
|
||||||
last_errno : dword;
|
|
||||||
pkt_nr : dword;
|
|
||||||
compress_pkt_nr : dword;
|
|
||||||
write_timeout : dword;
|
|
||||||
read_timeout : dword;
|
|
||||||
retry_count : dword;
|
|
||||||
fcntl : longint;
|
|
||||||
last_error : array[0..(MYSQL_ERRMSG_SIZE)-1] of char;
|
|
||||||
error : byte;
|
|
||||||
return_errno : my_bool;
|
|
||||||
compress : my_bool;
|
|
||||||
remain_in_buf : dword;
|
|
||||||
length : dword;
|
|
||||||
buf_length : dword;
|
|
||||||
where_b : dword;
|
|
||||||
return_status : Pdword;
|
|
||||||
reading_or_writing : byte;
|
|
||||||
save_char : char;
|
|
||||||
no_send_ok : my_bool;
|
|
||||||
query_cache_query : gptr;
|
|
||||||
end;
|
|
||||||
NET = st_net;
|
|
||||||
TNET = NET;
|
|
||||||
PNET = ^NET;
|
|
||||||
|
|
||||||
function packet_error : longint;
|
|
||||||
|
|
||||||
type
|
|
||||||
enum_field_types = (FIELD_TYPE_DECIMAL,FIELD_TYPE_TINY,FIELD_TYPE_SHORT,
|
|
||||||
FIELD_TYPE_LONG,FIELD_TYPE_FLOAT,FIELD_TYPE_DOUBLE,
|
|
||||||
FIELD_TYPE_NULL,FIELD_TYPE_TIMESTAMP,
|
|
||||||
FIELD_TYPE_LONGLONG,FIELD_TYPE_INT24,
|
|
||||||
FIELD_TYPE_DATE,FIELD_TYPE_TIME,FIELD_TYPE_DATETIME,
|
|
||||||
FIELD_TYPE_YEAR,FIELD_TYPE_NEWDATE,FIELD_TYPE_ENUM := 247,
|
|
||||||
FIELD_TYPE_SET := 248,FIELD_TYPE_TINY_BLOB := 249,
|
|
||||||
FIELD_TYPE_MEDIUM_BLOB := 250,FIELD_TYPE_LONG_BLOB := 251,
|
|
||||||
FIELD_TYPE_BLOB := 252,FIELD_TYPE_VAR_STRING := 253,
|
|
||||||
FIELD_TYPE_STRING := 254);
|
|
||||||
|
|
||||||
{ For compability }
|
|
||||||
|
|
||||||
const
|
|
||||||
FIELD_TYPE_CHAR = FIELD_TYPE_TINY;
|
|
||||||
{ For compability }
|
|
||||||
FIELD_TYPE_INTERVAL = FIELD_TYPE_ENUM;
|
|
||||||
{
|
|
||||||
#define net_new_transaction(net) ((net)->pkt_nr=0)
|
|
||||||
}
|
|
||||||
|
|
||||||
var
|
|
||||||
max_allowed_packet : dword;cvar;external;
|
|
||||||
net_buffer_length : dword;cvar;external;
|
|
||||||
|
|
||||||
function my_net_init(net:PNET; vio:PVio):longint;cdecl;external External_library name 'my_net_init';
|
function my_net_init(net:PNET; vio:PVio):longint;cdecl;external External_library name 'my_net_init';
|
||||||
|
|
||||||
@ -220,61 +70,6 @@ type
|
|||||||
unsigned int timeout);
|
unsigned int timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
type
|
|
||||||
Prand_struct = ^rand_struct;
|
|
||||||
rand_struct = record
|
|
||||||
seed1 : dword;
|
|
||||||
seed2 : dword;
|
|
||||||
max_value : dword;
|
|
||||||
max_value_dbl : double;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ The following is for user defined functions }
|
|
||||||
Item_result = (STRING_RESULT,REAL_RESULT,INT_RESULT
|
|
||||||
);
|
|
||||||
pitem_result = ^item_result;
|
|
||||||
|
|
||||||
{ Number of arguments }
|
|
||||||
{ Pointer to item_results }
|
|
||||||
{ Pointer to argument }
|
|
||||||
{ Length of string arguments }
|
|
||||||
{ Set to 1 for all maybe_null args }
|
|
||||||
|
|
||||||
Pst_udf_args = ^st_udf_args;
|
|
||||||
st_udf_args = record
|
|
||||||
arg_count : dword;
|
|
||||||
arg_type : PItem_result;
|
|
||||||
args : ^Pchar;
|
|
||||||
lengths : Pdword;
|
|
||||||
maybe_null : Pchar;
|
|
||||||
end;
|
|
||||||
UDF_ARGS = st_udf_args;
|
|
||||||
PUDF_ARGS = ^UDF_ARGS;
|
|
||||||
{ This holds information about the result }
|
|
||||||
{ 1 if function can return NULL }
|
|
||||||
{ for real functions }
|
|
||||||
{ For string functions }
|
|
||||||
{ free pointer for function data }
|
|
||||||
{ 0 if result is independent of arguments }
|
|
||||||
|
|
||||||
Pst_udf_init = ^st_udf_init;
|
|
||||||
st_udf_init = record
|
|
||||||
maybe_null : my_bool;
|
|
||||||
decimals : dword;
|
|
||||||
max_length : dword;
|
|
||||||
ptr : Pchar;
|
|
||||||
const_item : my_bool;
|
|
||||||
end;
|
|
||||||
UDF_INIT = st_udf_init;
|
|
||||||
PUDF_INIT = ^UDF_INIT;
|
|
||||||
{ Constants when using compression }
|
|
||||||
{ standard header size }
|
|
||||||
|
|
||||||
const
|
|
||||||
NET_HEADER_SIZE = 4;
|
|
||||||
{ compression header extra size }
|
|
||||||
COMP_HEADER_SIZE = 3;
|
|
||||||
{ Prototypes to password functions }
|
|
||||||
|
|
||||||
procedure randominit(_para1:Prand_struct; seed1:dword; seed2:dword);cdecl;external External_library name 'randominit';
|
procedure randominit(_para1:Prand_struct; seed1:dword; seed2:dword);cdecl;external External_library name 'randominit';
|
||||||
|
|
||||||
@ -312,6 +107,9 @@ type
|
|||||||
|
|
||||||
procedure my_thread_end;cdecl;external External_library name 'my_thread_end';
|
procedure my_thread_end;cdecl;external External_library name 'my_thread_end';
|
||||||
|
|
||||||
|
|
||||||
|
function packet_error : longint;
|
||||||
|
|
||||||
{ For net_store_length }
|
{ For net_store_length }
|
||||||
{ was #define dname def_expr }
|
{ was #define dname def_expr }
|
||||||
function NULL_LENGTH : dword;
|
function NULL_LENGTH : dword;
|
||||||
@ -319,6 +117,7 @@ type
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
// Next function also defined in mysql4_comdyn
|
||||||
{ was #define dname def_expr }
|
{ was #define dname def_expr }
|
||||||
function packet_error : longint;
|
function packet_error : longint;
|
||||||
{ return type might be wrong }
|
{ return type might be wrong }
|
||||||
@ -326,6 +125,7 @@ implementation
|
|||||||
packet_error:= not (dword(0));
|
packet_error:= not (dword(0));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// Next function also defined in mysql4_comdyn
|
||||||
{ was #define dname def_expr }
|
{ was #define dname def_expr }
|
||||||
function NULL_LENGTH : dword;
|
function NULL_LENGTH : dword;
|
||||||
begin
|
begin
|
||||||
|
159
packages/base/mysql/mysql4_comdyn.pp
Normal file
159
packages/base/mysql/mysql4_comdyn.pp
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
{
|
||||||
|
Contains the MySQL_com functions calls
|
||||||
|
|
||||||
|
Call InitialiseMysql4_com before using any of the calls, and call ReleaseMysql4_com
|
||||||
|
when finished.
|
||||||
|
}
|
||||||
|
unit mysql4_comdyn;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses dynlibs, sysutils;
|
||||||
|
|
||||||
|
{$PACKRECORDS C}
|
||||||
|
|
||||||
|
const
|
||||||
|
Mysqllib = 'libmysqlclient.so';
|
||||||
|
|
||||||
|
{$i mysql4_comtypes.inc}
|
||||||
|
|
||||||
|
{ Copyright (C) 2000 MySQL AB
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA }
|
||||||
|
|
||||||
|
|
||||||
|
var
|
||||||
|
my_net_init : function (net:PNET; vio:PVio):longint;cdecl;
|
||||||
|
net_end : procedure (net:PNET);cdecl;
|
||||||
|
net_clear : procedure (net:PNET);cdecl;
|
||||||
|
net_flush : function (net:PNET):longint;cdecl;
|
||||||
|
(* Const before type ignored *)
|
||||||
|
my_net_write : function (net:PNET; packet:Pchar; len:dword):longint;cdecl;
|
||||||
|
(* Const before type ignored *)
|
||||||
|
net_write_command : function (net:PNET; command:byte; packet:Pchar; len:dword):longint;cdecl;
|
||||||
|
(* Const before type ignored *)
|
||||||
|
net_real_write : function (net:PNET; packet:Pchar; len:dword):longint;cdecl;
|
||||||
|
my_net_read : function (net:PNET):dword;cdecl;
|
||||||
|
{ The following function is not meant for normal usage }
|
||||||
|
{
|
||||||
|
struct sockaddr;
|
||||||
|
int my_connect(my_socket s, const struct sockaddr name, unsigned int namelen,
|
||||||
|
unsigned int timeout);
|
||||||
|
}
|
||||||
|
randominit : procedure (_para1:Prand_struct; seed1:dword; seed2:dword);cdecl;
|
||||||
|
rnd : function (_para1:Prand_struct):double;cdecl;
|
||||||
|
(* Const before type ignored *)
|
||||||
|
make_scrambled_password : procedure (_to:Pchar; password:Pchar);cdecl;
|
||||||
|
(* Const before type ignored *)
|
||||||
|
get_salt_from_password : procedure (res:Pdword; password:Pchar);cdecl;
|
||||||
|
make_password_from_salt : procedure (_to:Pchar; hash_res:Pdword);cdecl;
|
||||||
|
(* Const before type ignored *)
|
||||||
|
(* Const before type ignored *)
|
||||||
|
scramble : function (_to:Pchar; message:Pchar; password:Pchar; old_ver:my_bool):Pchar;cdecl;
|
||||||
|
(* Const before type ignored *)
|
||||||
|
(* Const before type ignored *)
|
||||||
|
check_scramble : function (_para1:Pchar; message:Pchar; salt:Pdword; old_ver:my_bool):my_bool;cdecl;
|
||||||
|
get_tty_password : function (opt_message:Pchar):Pchar;cdecl;
|
||||||
|
(* Const before type ignored *)
|
||||||
|
hash_password : procedure (result:Pdword; password:Pchar);cdecl;
|
||||||
|
{ Some other useful functions }
|
||||||
|
my_init : procedure;cdecl;
|
||||||
|
(* Const before type ignored *)
|
||||||
|
(* Const before type ignored *)
|
||||||
|
load_defaults : procedure (conf_file:Pchar; groups:PPchar; argc:Plongint; argv:PPPchar);cdecl;
|
||||||
|
my_thread_init : function : my_bool;cdecl;
|
||||||
|
my_thread_end : procedure ;cdecl;
|
||||||
|
|
||||||
|
function packet_error : longint;
|
||||||
|
{ For net_store_length }
|
||||||
|
{ was #define dname def_expr }
|
||||||
|
function NULL_LENGTH : dword;
|
||||||
|
|
||||||
|
|
||||||
|
Procedure InitialiseMysql4_com;
|
||||||
|
Procedure ReleaseMysql4_com;
|
||||||
|
|
||||||
|
var Mysql4_comLibraryHandle : TLibHandle;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
var RefCount : integer;
|
||||||
|
|
||||||
|
Procedure InitialiseMysql4_com;
|
||||||
|
|
||||||
|
begin
|
||||||
|
inc(RefCount);
|
||||||
|
if RefCount = 1 then
|
||||||
|
begin
|
||||||
|
Mysql4_comLibraryHandle := loadlibrary(Mysqllib);
|
||||||
|
if Mysql4_comLibraryHandle = nilhandle then
|
||||||
|
begin
|
||||||
|
RefCount := 0;
|
||||||
|
Raise EInOutError.Create('Can not load MySQL client. Is it installed? ('+Mysqllib+')');
|
||||||
|
end;
|
||||||
|
|
||||||
|
pointer(my_net_init) := GetProcedureAddress(Mysql4_comLibraryHandle,'my_net_init');
|
||||||
|
pointer(net_end) := GetProcedureAddress(Mysql4_comLibraryHandle,'net_end');
|
||||||
|
pointer(net_clear) := GetProcedureAddress(Mysql4_comLibraryHandle,'net_clear');
|
||||||
|
pointer(net_flush) := GetProcedureAddress(Mysql4_comLibraryHandle,'net_flush');
|
||||||
|
pointer(my_net_write) := GetProcedureAddress(Mysql4_comLibraryHandle,'my_net_write');
|
||||||
|
pointer(net_write_command) := GetProcedureAddress(Mysql4_comLibraryHandle,'net_write_command');
|
||||||
|
pointer(net_real_write) := GetProcedureAddress(Mysql4_comLibraryHandle,'net_real_write');
|
||||||
|
pointer(my_net_read) := GetProcedureAddress(Mysql4_comLibraryHandle,'my_net_read');
|
||||||
|
pointer(randominit) := GetProcedureAddress(Mysql4_comLibraryHandle,'randominit');
|
||||||
|
pointer(rnd) := GetProcedureAddress(Mysql4_comLibraryHandle,'rnd');
|
||||||
|
pointer(make_scrambled_password) := GetProcedureAddress(Mysql4_comLibraryHandle,'make_scrambled_password');
|
||||||
|
pointer(get_salt_from_password) := GetProcedureAddress(Mysql4_comLibraryHandle,'get_salt_from_password');
|
||||||
|
pointer(make_password_from_salt) := GetProcedureAddress(Mysql4_comLibraryHandle,'make_password_from_salt');
|
||||||
|
pointer(scramble) := GetProcedureAddress(Mysql4_comLibraryHandle,'scramble');
|
||||||
|
pointer(check_scramble) := GetProcedureAddress(Mysql4_comLibraryHandle,'check_scramble');
|
||||||
|
pointer(get_tty_password) := GetProcedureAddress(Mysql4_comLibraryHandle,'get_tty_password');
|
||||||
|
pointer(hash_password) := GetProcedureAddress(Mysql4_comLibraryHandle,'hash_password');
|
||||||
|
pointer(my_init) := GetProcedureAddress(Mysql4_comLibraryHandle,'my_init');
|
||||||
|
pointer(load_defaults) := GetProcedureAddress(Mysql4_comLibraryHandle,'load_defaults');
|
||||||
|
pointer(my_thread_init) := GetProcedureAddress(Mysql4_comLibraryHandle,'my_thread_init');
|
||||||
|
pointer(my_thread_end) := GetProcedureAddress(Mysql4_comLibraryHandle,'my_thread_end');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure ReleaseMysql4_com;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if RefCount > 0 then dec(RefCount);
|
||||||
|
if RefCount = 0 then
|
||||||
|
begin
|
||||||
|
if not UnloadLibrary(Mysql4_comLibraryHandle) then inc(RefCount);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Next function also defined in mysql4_com
|
||||||
|
{ was #define dname def_expr }
|
||||||
|
function packet_error : longint;
|
||||||
|
{ return type might be wrong }
|
||||||
|
begin
|
||||||
|
packet_error:= not (dword(0));
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Next function also defined in mysql4_com
|
||||||
|
{ was #define dname def_expr }
|
||||||
|
function NULL_LENGTH : dword;
|
||||||
|
begin
|
||||||
|
NULL_LENGTH:=dword( not (0));
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
end.
|
212
packages/base/mysql/mysql4_comtypes.inc
Normal file
212
packages/base/mysql/mysql4_comtypes.inc
Normal file
@ -0,0 +1,212 @@
|
|||||||
|
{
|
||||||
|
Contains the types needed for mysql4_com
|
||||||
|
}
|
||||||
|
|
||||||
|
{ Extra manually added types }
|
||||||
|
type
|
||||||
|
PVIO = Pointer;
|
||||||
|
My_socket = longint;
|
||||||
|
my_bool = byte;
|
||||||
|
pppchar = ^PPChar;
|
||||||
|
gptr = Pointer;
|
||||||
|
|
||||||
|
{
|
||||||
|
Common definition between mysql server & client
|
||||||
|
}
|
||||||
|
{ Field/table name length }
|
||||||
|
|
||||||
|
const
|
||||||
|
NAME_LEN = 64;
|
||||||
|
HOSTNAME_LENGTH = 60;
|
||||||
|
USERNAME_LENGTH = 16;
|
||||||
|
SERVER_VERSION_LENGTH = 60;
|
||||||
|
LOCAL_HOST = 'localhost';
|
||||||
|
LOCAL_HOST_NAMEDPIPE = '.';
|
||||||
|
|
||||||
|
type
|
||||||
|
enum_server_command = (COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY,
|
||||||
|
COM_FIELD_LIST,COM_CREATE_DB,COM_DROP_DB,
|
||||||
|
COM_REFRESH,COM_SHUTDOWN,COM_STATISTICS,
|
||||||
|
COM_PROCESS_INFO,COM_CONNECT,COM_PROCESS_KILL,
|
||||||
|
COM_DEBUG,COM_PING,COM_TIME,COM_DELAYED_INSERT,
|
||||||
|
COM_CHANGE_USER,COM_BINLOG_DUMP,COM_TABLE_DUMP,
|
||||||
|
COM_CONNECT_OUT,COM_REGISTER_SLAVE);
|
||||||
|
|
||||||
|
{ Field can't be NULL }
|
||||||
|
|
||||||
|
const
|
||||||
|
NOT_NULL_FLAG = 1;
|
||||||
|
PRI_KEY_FLAG = 2;
|
||||||
|
UNIQUE_KEY_FLAG = 4;
|
||||||
|
MULTIPLE_KEY_FLAG = 8;
|
||||||
|
BLOB_FLAG = 16;
|
||||||
|
UNSIGNED_FLAG = 32;
|
||||||
|
ZEROFILL_FLAG = 64;
|
||||||
|
BINARY_FLAG = 128;
|
||||||
|
ENUM_FLAG = 256;
|
||||||
|
AUTO_INCREMENT_FLAG = 512;
|
||||||
|
TIMESTAMP_FLAG = 1024;
|
||||||
|
SET_FLAG = 2048;
|
||||||
|
NUM_FLAG = 32768;
|
||||||
|
PART_KEY_FLAG = 16384;
|
||||||
|
GROUP_FLAG = 32768;
|
||||||
|
UNIQUE_FLAG = 65536;
|
||||||
|
REFRESH_GRANT = 1;
|
||||||
|
REFRESH_LOG = 2;
|
||||||
|
REFRESH_TABLES = 4;
|
||||||
|
REFRESH_HOSTS = 8;
|
||||||
|
REFRESH_STATUS = 16;
|
||||||
|
REFRESH_THREADS = 32;
|
||||||
|
REFRESH_SLAVE = 64;
|
||||||
|
REFRESH_MASTER = 128;
|
||||||
|
REFRESH_READ_LOCK = 16384;
|
||||||
|
REFRESH_FAST = 32768;
|
||||||
|
REFRESH_QUERY_CACHE = 65536;
|
||||||
|
REFRESH_QUERY_CACHE_FREE = $20000;
|
||||||
|
REFRESH_DES_KEY_FILE = $40000;
|
||||||
|
CLIENT_LONG_PASSWORD = 1;
|
||||||
|
CLIENT_FOUND_ROWS = 2;
|
||||||
|
CLIENT_LONG_FLAG = 4;
|
||||||
|
CLIENT_CONNECT_WITH_DB = 8;
|
||||||
|
CLIENT_NO_SCHEMA = 16;
|
||||||
|
CLIENT_COMPRESS = 32;
|
||||||
|
CLIENT_ODBC = 64;
|
||||||
|
CLIENT_LOCAL_FILES = 128;
|
||||||
|
CLIENT_IGNORE_SPACE = 256;
|
||||||
|
CLIENT_CHANGE_USER = 512;
|
||||||
|
CLIENT_INTERACTIVE = 1024;
|
||||||
|
CLIENT_SSL = 2048;
|
||||||
|
CLIENT_IGNORE_SIGPIPE = 4096;
|
||||||
|
CLIENT_TRANSACTIONS = 8192;
|
||||||
|
SERVER_STATUS_IN_TRANS = 1;
|
||||||
|
SERVER_STATUS_AUTOCOMMIT = 2;
|
||||||
|
MYSQL_ERRMSG_SIZE = 200;
|
||||||
|
NET_READ_TIMEOUT = 30;
|
||||||
|
NET_WRITE_TIMEOUT = 60;
|
||||||
|
MAX_BLOB_WIDTH = 8192;
|
||||||
|
{
|
||||||
|
#define NET_WAIT_TIMEOUT (8 60 60)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
struct st_vio; // Only C
|
||||||
|
typedef struct st_vio Vio;
|
||||||
|
}
|
||||||
|
|
||||||
|
type
|
||||||
|
Pst_net = ^st_net;
|
||||||
|
st_net = record
|
||||||
|
vio : PVio;
|
||||||
|
buff : Pbyte;
|
||||||
|
buff_end : Pbyte;
|
||||||
|
write_pos : Pbyte;
|
||||||
|
read_pos : Pbyte;
|
||||||
|
fd : my_socket;
|
||||||
|
max_packet : dword;
|
||||||
|
max_packet_size : dword;
|
||||||
|
last_errno : dword;
|
||||||
|
pkt_nr : dword;
|
||||||
|
compress_pkt_nr : dword;
|
||||||
|
write_timeout : dword;
|
||||||
|
read_timeout : dword;
|
||||||
|
retry_count : dword;
|
||||||
|
fcntl : longint;
|
||||||
|
last_error : array[0..(MYSQL_ERRMSG_SIZE)-1] of char;
|
||||||
|
error : byte;
|
||||||
|
return_errno : my_bool;
|
||||||
|
compress : my_bool;
|
||||||
|
remain_in_buf : dword;
|
||||||
|
length : dword;
|
||||||
|
buf_length : dword;
|
||||||
|
where_b : dword;
|
||||||
|
return_status : Pdword;
|
||||||
|
reading_or_writing : byte;
|
||||||
|
save_char : char;
|
||||||
|
no_send_ok : my_bool;
|
||||||
|
query_cache_query : gptr;
|
||||||
|
end;
|
||||||
|
NET = st_net;
|
||||||
|
TNET = NET;
|
||||||
|
PNET = ^NET;
|
||||||
|
|
||||||
|
type
|
||||||
|
enum_field_types = (FIELD_TYPE_DECIMAL,FIELD_TYPE_TINY,FIELD_TYPE_SHORT,
|
||||||
|
FIELD_TYPE_LONG,FIELD_TYPE_FLOAT,FIELD_TYPE_DOUBLE,
|
||||||
|
FIELD_TYPE_NULL,FIELD_TYPE_TIMESTAMP,
|
||||||
|
FIELD_TYPE_LONGLONG,FIELD_TYPE_INT24,
|
||||||
|
FIELD_TYPE_DATE,FIELD_TYPE_TIME,FIELD_TYPE_DATETIME,
|
||||||
|
FIELD_TYPE_YEAR,FIELD_TYPE_NEWDATE,FIELD_TYPE_ENUM := 247,
|
||||||
|
FIELD_TYPE_SET := 248,FIELD_TYPE_TINY_BLOB := 249,
|
||||||
|
FIELD_TYPE_MEDIUM_BLOB := 250,FIELD_TYPE_LONG_BLOB := 251,
|
||||||
|
FIELD_TYPE_BLOB := 252,FIELD_TYPE_VAR_STRING := 253,
|
||||||
|
FIELD_TYPE_STRING := 254);
|
||||||
|
|
||||||
|
{ For compability }
|
||||||
|
|
||||||
|
const
|
||||||
|
FIELD_TYPE_CHAR = FIELD_TYPE_TINY;
|
||||||
|
{ For compability }
|
||||||
|
FIELD_TYPE_INTERVAL = FIELD_TYPE_ENUM;
|
||||||
|
{
|
||||||
|
#define net_new_transaction(net) ((net)->pkt_nr=0)
|
||||||
|
}
|
||||||
|
|
||||||
|
var
|
||||||
|
max_allowed_packet : dword;cvar;external;
|
||||||
|
net_buffer_length : dword;cvar;external;
|
||||||
|
|
||||||
|
type
|
||||||
|
Prand_struct = ^rand_struct;
|
||||||
|
rand_struct = record
|
||||||
|
seed1 : dword;
|
||||||
|
seed2 : dword;
|
||||||
|
max_value : dword;
|
||||||
|
max_value_dbl : double;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ The following is for user defined functions }
|
||||||
|
Item_result = (STRING_RESULT,REAL_RESULT,INT_RESULT
|
||||||
|
);
|
||||||
|
pitem_result = ^item_result;
|
||||||
|
|
||||||
|
{ Number of arguments }
|
||||||
|
{ Pointer to item_results }
|
||||||
|
{ Pointer to argument }
|
||||||
|
{ Length of string arguments }
|
||||||
|
{ Set to 1 for all maybe_null args }
|
||||||
|
|
||||||
|
Pst_udf_args = ^st_udf_args;
|
||||||
|
st_udf_args = record
|
||||||
|
arg_count : dword;
|
||||||
|
arg_type : PItem_result;
|
||||||
|
args : ^Pchar;
|
||||||
|
lengths : Pdword;
|
||||||
|
maybe_null : Pchar;
|
||||||
|
end;
|
||||||
|
UDF_ARGS = st_udf_args;
|
||||||
|
PUDF_ARGS = ^UDF_ARGS;
|
||||||
|
{ This holds information about the result }
|
||||||
|
{ 1 if function can return NULL }
|
||||||
|
{ for real functions }
|
||||||
|
{ For string functions }
|
||||||
|
{ free pointer for function data }
|
||||||
|
{ 0 if result is independent of arguments }
|
||||||
|
|
||||||
|
Pst_udf_init = ^st_udf_init;
|
||||||
|
st_udf_init = record
|
||||||
|
maybe_null : my_bool;
|
||||||
|
decimals : dword;
|
||||||
|
max_length : dword;
|
||||||
|
ptr : Pchar;
|
||||||
|
const_item : my_bool;
|
||||||
|
end;
|
||||||
|
UDF_INIT = st_udf_init;
|
||||||
|
PUDF_INIT = ^UDF_INIT;
|
||||||
|
{ Constants when using compression }
|
||||||
|
{ standard header size }
|
||||||
|
|
||||||
|
const
|
||||||
|
NET_HEADER_SIZE = 4;
|
||||||
|
{ compression header extra size }
|
||||||
|
COMP_HEADER_SIZE = 3;
|
||||||
|
{ Prototypes to password functions }
|
||||||
|
|
262
packages/base/mysql/mysql4dyn.pp
Normal file
262
packages/base/mysql/mysql4dyn.pp
Normal file
@ -0,0 +1,262 @@
|
|||||||
|
{
|
||||||
|
Contains the MySQL 4 functions calls
|
||||||
|
|
||||||
|
Call InitialiseMysql4 before using any of the calls, and call ReleaseMysql4
|
||||||
|
when finished.
|
||||||
|
}
|
||||||
|
unit mysql4dyn;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses dynlibs, classes, sysutils, mysql4_comdyn;
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
Automatically converted by H2Pas 0.99.15 from mysql.ph
|
||||||
|
The following command line parameters were used:
|
||||||
|
-p
|
||||||
|
-D
|
||||||
|
-l
|
||||||
|
mysqlclient
|
||||||
|
mysql.ph
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
{ Copyright (C) 2000 MySQL AB
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA }
|
||||||
|
|
||||||
|
{$PACKRECORDS C}
|
||||||
|
|
||||||
|
const
|
||||||
|
Mysqllib = 'libmysqlclient.so';
|
||||||
|
|
||||||
|
{$i mysql4types.inc}
|
||||||
|
|
||||||
|
var
|
||||||
|
mysql_server_init : function (argc:longint; argv:PPchar; groups:PPchar):longint;cdecl;
|
||||||
|
mysql_server_end : procedure;cdecl;
|
||||||
|
mysql_thread_init : function :my_bool;cdecl;
|
||||||
|
mysql_thread_end : procedure;cdecl;
|
||||||
|
mysql_num_rows : function (res:PMYSQL_RES):my_ulonglong;cdecl;
|
||||||
|
mysql_num_fields : function (res:PMYSQL_RES):dword;cdecl;
|
||||||
|
mysql_eof : function (res:PMYSQL_RES):my_bool;cdecl;
|
||||||
|
mysql_fetch_field_direct : function (res:PMYSQL_RES; fieldnr:dword):PMYSQL_FIELD;cdecl;
|
||||||
|
mysql_fetch_fields : function (res:PMYSQL_RES):PMYSQL_FIELD;cdecl;
|
||||||
|
mysql_row_tell : function (res:PMYSQL_RES):PMYSQL_ROWS;cdecl;
|
||||||
|
mysql_field_tell : function (res:PMYSQL_RES):dword;cdecl;
|
||||||
|
mysql_field_count : function (mysql:PMYSQL):dword;cdecl;
|
||||||
|
mysql_affected_rows : function (mysql:PMYSQL):my_ulonglong;cdecl;
|
||||||
|
mysql_insert_id : function (mysql:PMYSQL):my_ulonglong;cdecl;
|
||||||
|
mysql_errno : function (mysql:PMYSQL):dword;cdecl;
|
||||||
|
mysql_error : function (mysql:PMYSQL):Pchar;cdecl;
|
||||||
|
mysql_info : function (mysql:PMYSQL):Pchar;cdecl;
|
||||||
|
mysql_thread_id : function (mysql:PMYSQL):dword;cdecl;
|
||||||
|
mysql_character_set_name : function (mysql:PMYSQL):Pchar;cdecl;
|
||||||
|
mysql_init : function (mysql:PMYSQL):PMYSQL;cdecl;
|
||||||
|
mysql_ssl_set : function (mysql:PMYSQL; key:Pchar; cert:Pchar; ca:Pchar; capath:Pchar;cipher:Pchar):longint;cdecl;
|
||||||
|
mysql_ssl_clear : function (mysql:PMYSQL):longint;cdecl;
|
||||||
|
mysql_change_user : function (mysql:PMYSQL; user:Pchar; passwd:Pchar; db:Pchar):my_bool;cdecl;
|
||||||
|
mysql_real_connect : function (mysql:PMYSQL; host:Pchar; user:Pchar; passwd:Pchar; db:Pchar;port:dword; unix_socket:Pchar; clientflag:dword):PMYSQL;cdecl;
|
||||||
|
mysql_close : procedure (sock:PMYSQL);cdecl;
|
||||||
|
mysql_select_db : function (mysql:PMYSQL; db:Pchar):longint;cdecl;
|
||||||
|
mysql_query : function (mysql:PMYSQL; q:Pchar):longint;cdecl;
|
||||||
|
mysql_send_query : function (mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;
|
||||||
|
mysql_read_query_result : function (mysql:PMYSQL):longint;cdecl;
|
||||||
|
mysql_real_query : function (mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;
|
||||||
|
mysql_master_query : function (mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;
|
||||||
|
mysql_master_send_query : function (mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;
|
||||||
|
mysql_slave_query : function (mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;
|
||||||
|
mysql_slave_send_query : function (mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;
|
||||||
|
mysql_enable_rpl_parse : procedure (mysql:PMYSQL);cdecl;
|
||||||
|
mysql_disable_rpl_parse : procedure (mysql:PMYSQL);cdecl;
|
||||||
|
mysql_rpl_parse_enabled : function (mysql:PMYSQL):longint;cdecl;
|
||||||
|
mysql_enable_reads_from_master : procedure (mysql:PMYSQL);cdecl;
|
||||||
|
mysql_disable_reads_from_master : procedure (mysql:PMYSQL);cdecl;
|
||||||
|
mysql_reads_from_master_enabled : function (mysql:PMYSQL):longint;cdecl;
|
||||||
|
(* error
|
||||||
|
enum mysql_rpl_type mysql_rpl_query_type(const char* q, int len);
|
||||||
|
in declaration at line 291 *)
|
||||||
|
mysql_rpl_probe : function (mysql:PMYSQL):longint;cdecl;
|
||||||
|
mysql_set_master : function (mysql:PMYSQL; host:Pchar; port:dword; user:Pchar; passwd:Pchar):longint;cdecl;
|
||||||
|
mysql_add_slave : function (mysql:PMYSQL; host:Pchar; port:dword; user:Pchar; passwd:Pchar):longint;cdecl;
|
||||||
|
mysql_shutdown : function (mysql:PMYSQL):longint;cdecl;
|
||||||
|
mysql_dump_debug_info : function (mysql:PMYSQL):longint;cdecl;
|
||||||
|
mysql_refresh : function (mysql:PMYSQL; refresh_options:dword):longint;cdecl;
|
||||||
|
mysql_kill : function (mysql:PMYSQL; pid:dword):longint;cdecl;
|
||||||
|
mysql_ping : function (mysql:PMYSQL):longint;cdecl;
|
||||||
|
mysql_stat : function (mysql:PMYSQL):Pchar;cdecl;
|
||||||
|
mysql_get_server_info : function (mysql:PMYSQL):Pchar;cdecl;
|
||||||
|
mysql_get_client_info : function:Pchar; cdecl;
|
||||||
|
mysql_get_host_info : function (mysql:PMYSQL):Pchar;cdecl;
|
||||||
|
mysql_get_proto_info : function (mysql:PMYSQL):dword;cdecl;
|
||||||
|
mysql_list_dbs : function (mysql:PMYSQL; wild:Pchar):PMYSQL_RES;cdecl;
|
||||||
|
mysql_list_tables : function (mysql:PMYSQL; wild:Pchar):PMYSQL_RES;cdecl;
|
||||||
|
mysql_list_fields : function (mysql:PMYSQL; table:Pchar; wild:Pchar):PMYSQL_RES;cdecl;
|
||||||
|
mysql_list_processes : function (mysql:PMYSQL):PMYSQL_RES;cdecl;
|
||||||
|
mysql_store_result : function (mysql:PMYSQL):PMYSQL_RES;cdecl;
|
||||||
|
mysql_use_result : function (mysql:PMYSQL):PMYSQL_RES;cdecl;
|
||||||
|
mysql_options : function (mysql:PMYSQL; option:mysql_option; arg:Pchar):longint;cdecl;
|
||||||
|
mysql_free_result : procedure (result:PMYSQL_RES);cdecl;
|
||||||
|
mysql_data_seek : procedure (result:PMYSQL_RES; offset:my_ulonglong);cdecl;
|
||||||
|
mysql_row_seek : function (result:PMYSQL_RES; _para2:MYSQL_ROW_OFFSET):MYSQL_ROW_OFFSET;cdecl;
|
||||||
|
mysql_field_seek : function (result:PMYSQL_RES; offset:MYSQL_FIELD_OFFSET):MYSQL_FIELD_OFFSET;cdecl;
|
||||||
|
mysql_fetch_row : function (result:PMYSQL_RES):MYSQL_ROW;cdecl;
|
||||||
|
mysql_fetch_lengths : function (result:PMYSQL_RES):Pdword;cdecl;
|
||||||
|
mysql_fetch_field : function (result:PMYSQL_RES):PMYSQL_FIELD;cdecl;
|
||||||
|
mysql_escape_string : function (_to:Pchar; from:Pchar; from_length:dword):dword;cdecl;
|
||||||
|
mysql_real_escape_string : function (mysql:PMYSQL; _to:Pchar; from:Pchar; length:dword):dword;cdecl;
|
||||||
|
mysql_debug : procedure (debug:Pchar);cdecl;
|
||||||
|
mysql_odbc_escape_string : function (mysql:PMYSQL; _to:Pchar; to_length:dword; from:Pchar; from_length:dword;param:pointer; extend_buffer: TExdendBuffer):Pchar;cdecl;
|
||||||
|
myodbc_remove_escape : procedure (mysql:PMYSQL; name:Pchar);cdecl;
|
||||||
|
mysql_thread_safe : function :dword;cdecl;
|
||||||
|
mysql_manager_init : function (con:PMYSQL_MANAGER):PMYSQL_MANAGER;cdecl;
|
||||||
|
mysql_manager_connect : function (con:PMYSQL_MANAGER; host:Pchar; user:Pchar; passwd:Pchar; port:dword):PMYSQL_MANAGER;cdecl;
|
||||||
|
mysql_manager_close : procedure (con:PMYSQL_MANAGER);cdecl;
|
||||||
|
mysql_manager_command : function (con:PMYSQL_MANAGER; cmd:Pchar; cmd_len:longint):longint;cdecl;
|
||||||
|
mysql_manager_fetch_line : function (con:PMYSQL_MANAGER; res_buf:Pchar; res_buf_size:longint):longint;cdecl;
|
||||||
|
simple_command : function (mysql:PMYSQL; command:enum_server_command; arg:Pchar; length:dword; skipp_check:my_bool):longint;cdecl;
|
||||||
|
net_safe_read : function (mysql:PMYSQL):dword;cdecl;
|
||||||
|
|
||||||
|
|
||||||
|
function IS_PRI_KEY(n : longint) : Boolean;
|
||||||
|
function IS_NOT_NULL(n : longint) : Boolean;
|
||||||
|
function IS_BLOB(n : longint) : boolean;
|
||||||
|
function MYSQL_COUNT_ERROR : longint;
|
||||||
|
function mysql_reload(mysql : pmysql) : longint;
|
||||||
|
|
||||||
|
|
||||||
|
Procedure InitialiseMysql4;
|
||||||
|
Procedure ReleaseMysql4;
|
||||||
|
|
||||||
|
var Mysql4LibraryHandle : TLibHandle;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
var RefCount : integer;
|
||||||
|
|
||||||
|
Procedure InitialiseMysql4;
|
||||||
|
|
||||||
|
begin
|
||||||
|
inc(RefCount);
|
||||||
|
if RefCount = 1 then
|
||||||
|
begin
|
||||||
|
Mysql4LibraryHandle := loadlibrary(Mysqllib);
|
||||||
|
if Mysql4LibraryHandle = nilhandle then
|
||||||
|
begin
|
||||||
|
RefCount := 0;
|
||||||
|
Raise EInOutError.Create('Can not load MySQL client. Is it installed? ('+Mysqllib+')');
|
||||||
|
end;
|
||||||
|
pointer(mysql_server_init) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_server_init');
|
||||||
|
pointer(mysql_server_end) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_server_end');
|
||||||
|
pointer(mysql_thread_init) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_thread_init');
|
||||||
|
pointer(mysql_thread_end) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_thread_end');
|
||||||
|
pointer(mysql_num_rows) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_num_rows');
|
||||||
|
pointer(mysql_num_fields) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_num_fields');
|
||||||
|
pointer(mysql_eof) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_eof');
|
||||||
|
pointer(mysql_fetch_field_direct) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_fetch_field_direct');
|
||||||
|
pointer(mysql_fetch_fields) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_fetch_fields');
|
||||||
|
pointer(mysql_row_tell) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_row_tell');
|
||||||
|
pointer(mysql_field_tell) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_field_tell');
|
||||||
|
pointer(mysql_field_count) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_field_count');
|
||||||
|
pointer(mysql_affected_rows) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_affected_rows');
|
||||||
|
pointer(mysql_insert_id) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_insert_id');
|
||||||
|
pointer(mysql_errno) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_errno');
|
||||||
|
pointer(mysql_error) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_error');
|
||||||
|
pointer(mysql_info) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_info');
|
||||||
|
pointer(mysql_thread_id) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_thread_id');
|
||||||
|
pointer(mysql_character_set_name) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_character_set_name');
|
||||||
|
pointer(mysql_init) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_init');
|
||||||
|
pointer(mysql_ssl_set) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_ssl_set');
|
||||||
|
pointer(mysql_ssl_clear) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_ssl_clear');
|
||||||
|
pointer(mysql_change_user) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_change_user');
|
||||||
|
pointer(mysql_real_connect) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_real_connect');
|
||||||
|
pointer(mysql_close) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_close');
|
||||||
|
pointer(mysql_select_db) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_select_db');
|
||||||
|
pointer(mysql_query) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_query');
|
||||||
|
pointer(mysql_send_query) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_send_query');
|
||||||
|
pointer(mysql_read_query_result) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_read_query_result');
|
||||||
|
pointer(mysql_real_query) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_real_query');
|
||||||
|
pointer(mysql_master_query) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_master_query');
|
||||||
|
pointer(mysql_master_send_query) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_master_send_query');
|
||||||
|
pointer(mysql_slave_query) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_slave_query');
|
||||||
|
pointer(mysql_slave_send_query) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_slave_send_query');
|
||||||
|
pointer(mysql_enable_rpl_parse) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_enable_rpl_parse');
|
||||||
|
pointer(mysql_disable_rpl_parse) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_disable_rpl_parse');
|
||||||
|
pointer(mysql_rpl_parse_enabled) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_rpl_parse_enabled');
|
||||||
|
pointer(mysql_enable_reads_from_master) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_enable_reads_from_master');
|
||||||
|
pointer(mysql_disable_reads_from_master) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_disable_reads_from_master');
|
||||||
|
pointer(mysql_reads_from_master_enabled) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_reads_from_master_enabled');
|
||||||
|
pointer(mysql_rpl_probe) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_rpl_probe');
|
||||||
|
pointer(mysql_set_master) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_set_master');
|
||||||
|
pointer(mysql_add_slave) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_add_slave');
|
||||||
|
pointer(mysql_shutdown) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_shutdown');
|
||||||
|
pointer(mysql_dump_debug_info) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_dump_debug_info');
|
||||||
|
pointer(mysql_refresh) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_refresh');
|
||||||
|
pointer(mysql_kill) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_kill');
|
||||||
|
pointer(mysql_ping) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_ping');
|
||||||
|
pointer(mysql_stat) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_stat');
|
||||||
|
pointer(mysql_get_server_info) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_get_server_info');
|
||||||
|
pointer(mysql_get_client_info) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_get_client_info');
|
||||||
|
pointer(mysql_get_host_info) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_get_host_info');
|
||||||
|
pointer(mysql_get_proto_info) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_get_proto_info');
|
||||||
|
pointer(mysql_list_dbs) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_list_dbs');
|
||||||
|
pointer(mysql_list_tables) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_list_tables');
|
||||||
|
pointer(mysql_list_fields) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_list_fields');
|
||||||
|
pointer(mysql_list_processes) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_list_processes');
|
||||||
|
pointer(mysql_store_result) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_store_result');
|
||||||
|
pointer(mysql_use_result) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_use_result');
|
||||||
|
pointer(mysql_options) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_options');
|
||||||
|
pointer(mysql_free_result) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_free_result');
|
||||||
|
pointer(mysql_data_seek) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_data_seek');
|
||||||
|
pointer(mysql_row_seek) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_row_seek');
|
||||||
|
pointer(mysql_field_seek) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_field_seek');
|
||||||
|
pointer(mysql_fetch_row) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_fetch_row');
|
||||||
|
pointer(mysql_fetch_lengths) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_fetch_lengths');
|
||||||
|
pointer(mysql_fetch_field) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_fetch_field');
|
||||||
|
pointer(mysql_escape_string) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_escape_string');
|
||||||
|
pointer(mysql_real_escape_string) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_real_escape_string');
|
||||||
|
pointer(mysql_debug) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_debug');
|
||||||
|
pointer(mysql_odbc_escape_string) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_odbc_escape_string');
|
||||||
|
pointer(myodbc_remove_escape) := GetProcedureAddress(Mysql4LibraryHandle,'myodbc_remove_escape');
|
||||||
|
pointer(mysql_thread_safe) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_thread_safe');
|
||||||
|
pointer(mysql_manager_init) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_manager_init');
|
||||||
|
pointer(mysql_manager_connect) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_manager_connect');
|
||||||
|
pointer(mysql_manager_close) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_manager_close');
|
||||||
|
pointer(mysql_manager_command) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_manager_command');
|
||||||
|
pointer(mysql_manager_fetch_line) := GetProcedureAddress(Mysql4LibraryHandle,'mysql_manager_fetch_line');
|
||||||
|
pointer(simple_command) := GetProcedureAddress(Mysql4LibraryHandle,'simple_command');
|
||||||
|
pointer(net_safe_read) := GetProcedureAddress(Mysql4LibraryHandle,'net_safe_read');
|
||||||
|
|
||||||
|
InitialiseMysql4_com;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure ReleaseMysql4;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if RefCount > 0 then dec(RefCount);
|
||||||
|
if RefCount = 0 then
|
||||||
|
begin
|
||||||
|
if not UnloadLibrary(Mysql4LibraryHandle) then inc(RefCount);
|
||||||
|
ReleaseMysql4_com;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{$i mysql4impl.inc}
|
||||||
|
|
||||||
|
end.
|
235
packages/base/mysql/mysql4types.inc
Normal file
235
packages/base/mysql/mysql4types.inc
Normal file
@ -0,0 +1,235 @@
|
|||||||
|
{
|
||||||
|
Contains the types needed for use with MySQL v4.0
|
||||||
|
}
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
Pmy_bool = ^my_bool;
|
||||||
|
my_bool = char;
|
||||||
|
|
||||||
|
Pgptr = ^gptr;
|
||||||
|
gptr = char;
|
||||||
|
|
||||||
|
Pmy_socket = ^my_socket;
|
||||||
|
my_socket = longint;
|
||||||
|
|
||||||
|
var
|
||||||
|
mysql_port : dword;cvar;external;
|
||||||
|
mysql_unix_port : Pchar;cvar;external;
|
||||||
|
|
||||||
|
type
|
||||||
|
Pst_mysql_field = ^st_mysql_field;
|
||||||
|
st_mysql_field = record
|
||||||
|
name : Pchar;
|
||||||
|
table : Pchar;
|
||||||
|
org_table : Pchar;
|
||||||
|
db : Pchar;
|
||||||
|
def : Pchar;
|
||||||
|
length : dword;
|
||||||
|
max_length : dword;
|
||||||
|
flags : dword;
|
||||||
|
decimals : dword;
|
||||||
|
ftype : enum_field_types;
|
||||||
|
end;
|
||||||
|
MYSQL_FIELD = st_mysql_field;
|
||||||
|
TMYSQL_FIELD = MYSQL_FIELD;
|
||||||
|
PMYSQL_FIELD = ^MYSQL_FIELD;
|
||||||
|
|
||||||
|
type
|
||||||
|
MYSQL_ROW = ppchar;
|
||||||
|
PMYSQL_ROW = ^MYSQL_ROW;
|
||||||
|
TMYSQL_ROW = MYSQL_ROW;
|
||||||
|
|
||||||
|
PMYSQL_FIELD_OFFSET = ^MYSQL_FIELD_OFFSET;
|
||||||
|
MYSQL_FIELD_OFFSET = dword;
|
||||||
|
|
||||||
|
Pmy_ulonglong = ^my_ulonglong;
|
||||||
|
my_ulonglong = qword;
|
||||||
|
|
||||||
|
type
|
||||||
|
Pst_mysql_rows = ^st_mysql_rows;
|
||||||
|
st_mysql_rows = record
|
||||||
|
next : Pst_mysql_rows;
|
||||||
|
data : MYSQL_ROW;
|
||||||
|
end;
|
||||||
|
MYSQL_ROWS = st_mysql_rows;
|
||||||
|
TMYSQL_ROWS = MYSQL_ROWS;
|
||||||
|
PMYSQL_ROWS = ^MYSQL_ROWS;
|
||||||
|
|
||||||
|
MYSQL_ROW_OFFSET = MYSQL_ROWS;
|
||||||
|
PMYSQL_ROW_OFFSET = ^MYSQL_ROW_OFFSET;
|
||||||
|
|
||||||
|
Pst_used_mem = ^st_used_mem;
|
||||||
|
st_used_mem = record
|
||||||
|
next : Pst_used_mem;
|
||||||
|
left : dword;
|
||||||
|
size : dword;
|
||||||
|
end;
|
||||||
|
|
||||||
|
USED_MEM = st_used_mem;
|
||||||
|
TUSED_MEM = USED_MEM;
|
||||||
|
PUSED_MEM = ^USED_MEM;
|
||||||
|
|
||||||
|
Pst_mem_root = ^st_mem_root;
|
||||||
|
st_mem_root = record
|
||||||
|
free : PUSED_MEM;
|
||||||
|
used : PUSED_MEM;
|
||||||
|
pre_alloc : PUSED_MEM;
|
||||||
|
min_malloc : dword;
|
||||||
|
block_size : dword;
|
||||||
|
block_num : dword;
|
||||||
|
first_block_usage : dword;
|
||||||
|
error_handler : procedure ;cdecl;
|
||||||
|
end;
|
||||||
|
MEM_ROOT = st_mem_root;
|
||||||
|
TMEM_ROOT = MEM_ROOT;
|
||||||
|
PMEM_ROOT = ^MEM_ROOT;
|
||||||
|
|
||||||
|
Pst_mysql_data = ^st_mysql_data;
|
||||||
|
st_mysql_data = record
|
||||||
|
rows : my_ulonglong;
|
||||||
|
fields : dword;
|
||||||
|
data : PMYSQL_ROWS;
|
||||||
|
alloc : MEM_ROOT;
|
||||||
|
end;
|
||||||
|
MYSQL_DATA = st_mysql_data;
|
||||||
|
TMYSQL_DATA = MYSQL_DATA;
|
||||||
|
PMYSQL_DATA = ^MYSQL_DATA;
|
||||||
|
|
||||||
|
Pst_mysql_options = ^st_mysql_options;
|
||||||
|
st_mysql_options = record
|
||||||
|
connect_timeout : dword;
|
||||||
|
client_flag : dword;
|
||||||
|
port : dword;
|
||||||
|
host : Pchar;
|
||||||
|
init_command : Pchar;
|
||||||
|
user : Pchar;
|
||||||
|
password : Pchar;
|
||||||
|
unix_socket : Pchar;
|
||||||
|
db : Pchar;
|
||||||
|
my_cnf_file : Pchar;
|
||||||
|
my_cnf_group : Pchar;
|
||||||
|
charset_dir : Pchar;
|
||||||
|
charset_name : Pchar;
|
||||||
|
ssl_key : Pchar;
|
||||||
|
ssl_cert : Pchar;
|
||||||
|
ssl_ca : Pchar;
|
||||||
|
ssl_capath : Pchar;
|
||||||
|
ssl_cipher : Pchar;
|
||||||
|
max_allowed_packet : Cardinal;
|
||||||
|
use_ssl : my_bool;
|
||||||
|
compress : my_bool;
|
||||||
|
named_pipe : my_bool;
|
||||||
|
rpl_probe : my_bool;
|
||||||
|
rpl_parse : my_bool;
|
||||||
|
no_master_reads : my_bool;
|
||||||
|
end;
|
||||||
|
TMYSQL_OPTIONS = st_mysql_options;
|
||||||
|
PTMYSQL_OPTIONS = ^TMYSQL_OPTIONS;
|
||||||
|
|
||||||
|
mysql_option = (MYSQL_OPT_CONNECT_TIMEOUT,MYSQL_OPT_COMPRESS,
|
||||||
|
MYSQL_OPT_NAMED_PIPE,MYSQL_INIT_COMMAND,
|
||||||
|
MYSQL_READ_DEFAULT_FILE,MYSQL_READ_DEFAULT_GROUP,
|
||||||
|
MYSQL_SET_CHARSET_DIR,MYSQL_SET_CHARSET_NAME
|
||||||
|
);
|
||||||
|
|
||||||
|
mysql_status = (MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,
|
||||||
|
MYSQL_STATUS_USE_RESULT);
|
||||||
|
|
||||||
|
mysql_rpl_type = (MYSQL_RPL_MASTER,MYSQL_RPL_SLAVE,MYSQL_RPL_ADMIN );
|
||||||
|
|
||||||
|
Pst_mysql = ^st_mysql;
|
||||||
|
st_mysql = record
|
||||||
|
net : NET;
|
||||||
|
connector_fd : gptr;
|
||||||
|
host : Pchar;
|
||||||
|
user : Pchar;
|
||||||
|
passwd : Pchar;
|
||||||
|
unix_socket : Pchar;
|
||||||
|
server_version : Pchar;
|
||||||
|
host_info : Pchar;
|
||||||
|
info : Pchar;
|
||||||
|
db : Pchar;
|
||||||
|
charset : Pointer; //!! Was Pcharset_info_st;
|
||||||
|
fields : PMYSQL_FIELD;
|
||||||
|
field_alloc : MEM_ROOT;
|
||||||
|
affected_rows : my_ulonglong;
|
||||||
|
insert_id : my_ulonglong;
|
||||||
|
extra_info : my_ulonglong;
|
||||||
|
thread_id : dword;
|
||||||
|
packet_length : dword;
|
||||||
|
port : dword;
|
||||||
|
client_flag : dword;
|
||||||
|
server_capabilities : dword;
|
||||||
|
protocol_version : dword;
|
||||||
|
field_count : dword;
|
||||||
|
server_status : dword;
|
||||||
|
server_language : dword;
|
||||||
|
options : st_mysql_options;
|
||||||
|
status : mysql_status;
|
||||||
|
free_me : my_bool;
|
||||||
|
reconnect : my_bool;
|
||||||
|
scramble_buff : array[0..8] of char;
|
||||||
|
rpl_pivot : my_bool;
|
||||||
|
master : Pst_mysql;
|
||||||
|
next_slave : Pst_mysql;
|
||||||
|
last_used_slave : Pst_mysql;
|
||||||
|
last_used_con : Pst_mysql;
|
||||||
|
end;
|
||||||
|
TMYSQL = st_mysql;
|
||||||
|
PMYSQL = ^TMYSQL;
|
||||||
|
|
||||||
|
Pst_mysql_res = ^st_mysql_res;
|
||||||
|
st_mysql_res = record
|
||||||
|
row_count : my_ulonglong;
|
||||||
|
fields : PMYSQL_FIELD;
|
||||||
|
data : PMYSQL_DATA;
|
||||||
|
data_cursor : PMYSQL_ROWS;
|
||||||
|
lengths : Pdword;
|
||||||
|
handle : PMYSQL;
|
||||||
|
field_alloc : MEM_ROOT;
|
||||||
|
field_count : dword;
|
||||||
|
current_field : dword;
|
||||||
|
row : MYSQL_ROW;
|
||||||
|
current_row : MYSQL_ROW;
|
||||||
|
eof : my_bool;
|
||||||
|
end;
|
||||||
|
MYSQL_RES = st_mysql_res;
|
||||||
|
TMYSQL_RES = MYSQL_RES;
|
||||||
|
PMYSQL_RES = ^MYSQL_RES;
|
||||||
|
|
||||||
|
const
|
||||||
|
MAX_MYSQL_MANAGER_ERR = 256;
|
||||||
|
MAX_MYSQL_MANAGER_MSG = 256;
|
||||||
|
MANAGER_OK = 200;
|
||||||
|
MANAGER_INFO = 250;
|
||||||
|
MANAGER_ACCESS = 401;
|
||||||
|
MANAGER_CLIENT_ERR = 450;
|
||||||
|
MANAGER_INTERNAL_ERR = 500;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
Pst_mysql_manager = ^st_mysql_manager;
|
||||||
|
st_mysql_manager = record
|
||||||
|
net : NET;
|
||||||
|
host : Pchar;
|
||||||
|
user : Pchar;
|
||||||
|
passwd : Pchar;
|
||||||
|
port : dword;
|
||||||
|
free_me : my_bool;
|
||||||
|
eof : my_bool;
|
||||||
|
cmd_status : longint;
|
||||||
|
last_errno : longint;
|
||||||
|
net_buf : Pchar;
|
||||||
|
net_buf_pos : Pchar;
|
||||||
|
net_data_end : Pchar;
|
||||||
|
net_buf_size : longint;
|
||||||
|
last_error : array[0..(MAX_MYSQL_MANAGER_ERR)-1] of char;
|
||||||
|
end;
|
||||||
|
MYSQL_MANAGER = st_mysql_manager;
|
||||||
|
PMYSQL_MANAGER = ^MYSQL_MANAGER;
|
||||||
|
|
||||||
|
Type
|
||||||
|
TExdendBuffer = function (_para1:pointer; _to:Pchar; length:Pdword):Pchar;
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Don't edit, this file is generated by FPCMake Version 1.9.8 [2005/01/11]
|
# Don't edit, this file is generated by FPCMake Version 1.9.8 [2005/01/10]
|
||||||
#
|
#
|
||||||
default: all
|
default: all
|
||||||
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-sunos i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-sunos x86_64-linux x86_64-freebsd arm-linux
|
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-sunos i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-sunos x86_64-linux x86_64-freebsd arm-linux
|
||||||
|
@ -7,7 +7,7 @@ name=postgres
|
|||||||
version=1.9.7
|
version=1.9.7
|
||||||
|
|
||||||
[target]
|
[target]
|
||||||
units=dllist postgres postgres3
|
units=dllist dllistdyn postgres postgres3 postgres3dyn
|
||||||
examples=testpg1 testpg2
|
examples=testpg1 testpg2
|
||||||
|
|
||||||
[require]
|
[require]
|
||||||
|
@ -4,37 +4,7 @@ interface
|
|||||||
|
|
||||||
{$linklib pq}
|
{$linklib pq}
|
||||||
|
|
||||||
{ Pointers to basic pascal types, inserted by h2pas conversion program.}
|
{$i dllisttypes.inc}
|
||||||
Type
|
|
||||||
PLongint = ^Longint;
|
|
||||||
PByte = ^Byte;
|
|
||||||
PWord = ^Word;
|
|
||||||
PINteger = ^Integer;
|
|
||||||
PCardinal = ^Cardinal;
|
|
||||||
PReal = ^Real;
|
|
||||||
PDouble = ^Double;
|
|
||||||
|
|
||||||
{ next element }
|
|
||||||
{ previous element }
|
|
||||||
{ value of the element }
|
|
||||||
{ what list this element is in }
|
|
||||||
|
|
||||||
type
|
|
||||||
{ Pointer types }
|
|
||||||
PDllist= ^TDllist;
|
|
||||||
PDlelem= ^TDlelem;
|
|
||||||
|
|
||||||
TDlelem = record
|
|
||||||
dle_next : PDlelem;
|
|
||||||
dle_prev : PDlElem;
|
|
||||||
dle_val : pointer;
|
|
||||||
dle_list : PDllist;
|
|
||||||
end;
|
|
||||||
|
|
||||||
TDllist = record
|
|
||||||
dll_head : PDlelem;
|
|
||||||
dll_tail : PDlelem;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function DLNewList:PDllist;cdecl; external;
|
function DLNewList:PDllist;cdecl; external;
|
||||||
procedure DLFreeList(_para1:PDllist);cdecl; external;
|
procedure DLFreeList(_para1:PDllist);cdecl; external;
|
||||||
@ -55,8 +25,7 @@ Function DLE_VAL(elem : PDlelem) : pointer;
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
// This function is also defined in DllistDyn!
|
||||||
|
|
||||||
Function DLE_VAL(elem : PDlelem) : pointer;
|
Function DLE_VAL(elem : PDlelem) : pointer;
|
||||||
begin
|
begin
|
||||||
DLE_VAL:=elem^.dle_val
|
DLE_VAL:=elem^.dle_val
|
||||||
@ -64,7 +33,10 @@ end;
|
|||||||
|
|
||||||
end.
|
end.
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 2004-11-21 16:33:55 peter
|
Revision 1.4 2005-01-24 10:58:26 michael
|
||||||
|
+ Dynamic library implementation by Joost van der Sluis
|
||||||
|
|
||||||
|
Revision 1.3 2004/11/21 16:33:55 peter
|
||||||
* external fixes
|
* external fixes
|
||||||
|
|
||||||
Revision 1.2 2002/09/07 15:42:53 peter
|
Revision 1.2 2002/09/07 15:42:53 peter
|
||||||
|
95
packages/base/postgres/dllistdyn.pp
Normal file
95
packages/base/postgres/dllistdyn.pp
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
{
|
||||||
|
Call InitialiseDllist before using any of the calls, and call ReleaseDllist
|
||||||
|
when finished.
|
||||||
|
}
|
||||||
|
|
||||||
|
unit DllistDyn;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
dynlibs, SysUtils;
|
||||||
|
|
||||||
|
{$PACKRECORDS C}
|
||||||
|
|
||||||
|
const
|
||||||
|
pqlib = 'libpq.so';
|
||||||
|
|
||||||
|
{$i dllisttypes.inc}
|
||||||
|
|
||||||
|
var
|
||||||
|
DLNewList : function : PDllist;cdecl;
|
||||||
|
DLFreeList : procedure (_para1:PDllist);cdecl;
|
||||||
|
DLNewElem : function (val : pointer) :PDlelem;cdecl;
|
||||||
|
DLFreeElem : procedure (_para1:PDlelem);cdecl;
|
||||||
|
DLGetHead : function (_para1:PDllist):PDlelem;cdecl;
|
||||||
|
DLGetTail : function (_para1:PDllist):PDlelem;cdecl;
|
||||||
|
DLRemTail : function (l:PDllist):PDlelem;cdecl;
|
||||||
|
DLGetPred : function (_para1:PDlelem):PDlelem;cdecl;
|
||||||
|
DLGetSucc : function (_para1:PDlelem):PDlelem;cdecl;
|
||||||
|
DLRemove : procedure (_para1:PDlelem);cdecl;
|
||||||
|
DLAddHead : procedure (list:PDllist; node:PDlelem);cdecl;
|
||||||
|
DLAddTail : procedure (list:PDllist; node:PDlelem);cdecl;
|
||||||
|
DLRemHead : function (list:PDllist):PDlelem;cdecl;
|
||||||
|
|
||||||
|
{ Macro translated }
|
||||||
|
Function DLE_VAL(elem : PDlelem) : pointer;
|
||||||
|
|
||||||
|
Procedure InitialiseDllist;
|
||||||
|
Procedure ReleaseDllist;
|
||||||
|
|
||||||
|
var DllistLibraryHandle : TLibHandle;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
var RefCount : integer;
|
||||||
|
|
||||||
|
Procedure InitialiseDllist;
|
||||||
|
|
||||||
|
begin
|
||||||
|
inc(RefCount);
|
||||||
|
if RefCount = 1 then
|
||||||
|
begin
|
||||||
|
DllistLibraryHandle := loadlibrary(pqlib);
|
||||||
|
if DllistLibraryHandle = nilhandle then
|
||||||
|
begin
|
||||||
|
RefCount := 0;
|
||||||
|
Raise EInOutError.Create('Can not load PosgreSQL client. Is it installed? ('+pqlib+')');
|
||||||
|
end;
|
||||||
|
|
||||||
|
pointer(DLNewList) := GetProcedureAddress(DllistLibraryHandle,'DLNewList');
|
||||||
|
pointer(DLFreeList) := GetProcedureAddress(DllistLibraryHandle,'DLFreeList');
|
||||||
|
pointer( DLNewElem) := GetProcedureAddress(DllistLibraryHandle,' DLNewElem');
|
||||||
|
pointer(DLFreeElem) := GetProcedureAddress(DllistLibraryHandle,'DLFreeElem');
|
||||||
|
pointer( DLGetHead) := GetProcedureAddress(DllistLibraryHandle,' DLGetHead');
|
||||||
|
pointer( DLGetTail) := GetProcedureAddress(DllistLibraryHandle,' DLGetTail');
|
||||||
|
pointer( DLRemTail) := GetProcedureAddress(DllistLibraryHandle,' DLRemTail');
|
||||||
|
pointer( DLGetPred) := GetProcedureAddress(DllistLibraryHandle,' DLGetPred');
|
||||||
|
pointer( DLGetSucc) := GetProcedureAddress(DllistLibraryHandle,' DLGetSucc');
|
||||||
|
pointer(DLRemove) := GetProcedureAddress(DllistLibraryHandle,'DLRemove');
|
||||||
|
pointer(DLAddHead) := GetProcedureAddress(DllistLibraryHandle,'DLAddHead');
|
||||||
|
pointer(DLAddTail) := GetProcedureAddress(DllistLibraryHandle,'DLAddTail');
|
||||||
|
pointer( DLRemHead) := GetProcedureAddress(DllistLibraryHandle,' DLRemHead');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure ReleaseDllist;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if RefCount > 0 then dec(RefCount);
|
||||||
|
if RefCount = 0 then
|
||||||
|
begin
|
||||||
|
if not UnloadLibrary(DllistLibraryHandle) then inc(RefCount);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// This function is also defined in Dllist!
|
||||||
|
Function DLE_VAL(elem : PDlelem) : pointer;
|
||||||
|
begin
|
||||||
|
DLE_VAL:=elem^.dle_val
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
end.
|
32
packages/base/postgres/dllisttypes.inc
Normal file
32
packages/base/postgres/dllisttypes.inc
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
Contains the types needed for dllist
|
||||||
|
}
|
||||||
|
|
||||||
|
{ Pointers to basic pascal types, inserted by h2pas conversion program.}
|
||||||
|
Type
|
||||||
|
PCardinal = ^Cardinal;
|
||||||
|
PReal = ^Real;
|
||||||
|
PDouble = ^Double;
|
||||||
|
|
||||||
|
{ next element }
|
||||||
|
{ previous element }
|
||||||
|
{ value of the element }
|
||||||
|
{ what list this element is in }
|
||||||
|
|
||||||
|
type
|
||||||
|
{ Pointer types }
|
||||||
|
PDllist= ^TDllist;
|
||||||
|
PDlelem= ^TDlelem;
|
||||||
|
|
||||||
|
TDlelem = record
|
||||||
|
dle_next : PDlelem;
|
||||||
|
dle_prev : PDlElem;
|
||||||
|
dle_val : pointer;
|
||||||
|
dle_list : PDllist;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TDllist = record
|
||||||
|
dll_head : PDlelem;
|
||||||
|
dll_tail : PDlelem;
|
||||||
|
end;
|
||||||
|
|
@ -16,185 +16,9 @@ uses dllist;
|
|||||||
const
|
const
|
||||||
External_library='pq';
|
External_library='pq';
|
||||||
|
|
||||||
Type
|
{$i postgres3types.inc}
|
||||||
PLongint = ^Longint;
|
|
||||||
PSmallInt = ^SmallInt;
|
|
||||||
PByte = ^Byte;
|
|
||||||
PWord = ^Word;
|
|
||||||
PDWord = ^DWord;
|
|
||||||
PDouble = ^Double;
|
|
||||||
size_t = sizeint;
|
|
||||||
psize_t = ^size_t;
|
|
||||||
TFILE = Longint;
|
|
||||||
PFIle = ^TFILE;
|
|
||||||
POid = ^Oid;
|
|
||||||
Oid = dword;
|
|
||||||
|
|
||||||
const
|
|
||||||
ERROR_MSG_LENGTH = 4096;
|
|
||||||
CMDSTATUS_LEN = 40;
|
|
||||||
|
|
||||||
Type
|
|
||||||
TSockAddr = Array [1..112] of byte;
|
|
||||||
TPGresAttDesc = record
|
|
||||||
name : Pchar;
|
|
||||||
adtid : Oid;
|
|
||||||
adtsize : integer;
|
|
||||||
end;
|
|
||||||
PPGresAttDesc= ^TPGresAttDesc;
|
|
||||||
PPPGresAttDesc= ^PPGresAttDesc;
|
|
||||||
TPGresAttValue = record
|
|
||||||
len : longint;
|
|
||||||
value : Pchar;
|
|
||||||
end;
|
|
||||||
PPGresAttValue= ^TPGresAttValue;
|
|
||||||
PPPGresAttValue= ^PPGresAttValue;
|
|
||||||
|
|
||||||
PExecStatusType = ^TExecStatusType;
|
|
||||||
TExecStatusType = (PGRES_EMPTY_QUERY := 0,PGRES_COMMAND_OK,
|
|
||||||
PGRES_TUPLES_OK,PGRES_COPY_OUT,PGRES_COPY_IN,
|
|
||||||
PGRES_BAD_RESPONSE,PGRES_NONFATAL_ERROR,
|
|
||||||
PGRES_FATAL_ERROR);
|
|
||||||
|
|
||||||
|
|
||||||
TPGlobjfuncs = record
|
|
||||||
fn_lo_open : Oid;
|
|
||||||
fn_lo_close : Oid;
|
|
||||||
fn_lo_creat : Oid;
|
|
||||||
fn_lo_unlink : Oid;
|
|
||||||
fn_lo_lseek : Oid;
|
|
||||||
fn_lo_tell : Oid;
|
|
||||||
fn_lo_read : Oid;
|
|
||||||
fn_lo_write : Oid;
|
|
||||||
end;
|
|
||||||
PPGlobjfuncs= ^TPGlobjfuncs;
|
|
||||||
|
|
||||||
PConnStatusType = ^TConnStatusType;
|
|
||||||
TConnStatusType = (CONNECTION_OK,CONNECTION_BAD,CONNECTION_STARTED,
|
|
||||||
CONNECTION_MADE,CONNECTION_AWAITING_RESPONSE,
|
|
||||||
CONNECTION_AUTH_OK,CONNECTION_SETENV,
|
|
||||||
CONNECTION_SSL_STARTUP,CONNECTION_NEEDED);
|
|
||||||
|
|
||||||
TPGconn = record
|
|
||||||
pghost : Pchar;
|
|
||||||
pgtty : Pchar;
|
|
||||||
pgport : Pchar;
|
|
||||||
pgoptions : Pchar;
|
|
||||||
dbName : Pchar;
|
|
||||||
status : TConnStatusType;
|
|
||||||
errorMessage : array[0..(ERROR_MSG_LENGTH)-1] of char;
|
|
||||||
Pfin : PFILE;
|
|
||||||
Pfout : PFILE;
|
|
||||||
Pfdebug : PFILE;
|
|
||||||
sock : longint;
|
|
||||||
laddr : TSockAddr;
|
|
||||||
raddr : TSockAddr;
|
|
||||||
salt : array[0..(2)-1] of char;
|
|
||||||
asyncNotifyWaiting : longint;
|
|
||||||
notifyList : PDllist;
|
|
||||||
pguser : Pchar;
|
|
||||||
pgpass : Pchar;
|
|
||||||
lobjfuncs : PPGlobjfuncs;
|
|
||||||
end;
|
|
||||||
PPGconn= ^TPGconn;
|
|
||||||
|
|
||||||
TPGresult = record
|
|
||||||
ntups : longint;
|
|
||||||
numAttributes : longint;
|
|
||||||
attDescs : PPGresAttDesc;
|
|
||||||
tuples : PPPGresAttValue;
|
|
||||||
tupArrSize : longint;
|
|
||||||
resultStatus : TExecStatusType;
|
|
||||||
cmdStatus : array[0..(CMDSTATUS_LEN)-1] of char;
|
|
||||||
binary : longint;
|
|
||||||
conn : PPGconn;
|
|
||||||
end;
|
|
||||||
PPGresult= ^TPGresult;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PPostgresPollingStatusType = ^PostgresPollingStatusType;
|
|
||||||
PostgresPollingStatusType = (PGRES_POLLING_FAILED := 0,PGRES_POLLING_READING,
|
|
||||||
PGRES_POLLING_WRITING,PGRES_POLLING_OK,
|
|
||||||
PGRES_POLLING_ACTIVE);
|
|
||||||
|
|
||||||
|
|
||||||
PPGTransactionStatusType = ^PGTransactionStatusType;
|
|
||||||
PGTransactionStatusType = (PQTRANS_IDLE,PQTRANS_ACTIVE,PQTRANS_INTRANS,
|
|
||||||
PQTRANS_INERROR,PQTRANS_UNKNOWN);
|
|
||||||
|
|
||||||
PPGVerbosity = ^PGVerbosity;
|
|
||||||
PGVerbosity = (PQERRORS_TERSE,PQERRORS_DEFAULT,PQERRORS_VERBOSE);
|
|
||||||
|
|
||||||
PpgNotify = ^pgNotify;
|
|
||||||
pgNotify = record
|
|
||||||
relname : Pchar;
|
|
||||||
be_pid : longint;
|
|
||||||
extra : Pchar;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ Function types for notice-handling callbacks }
|
|
||||||
PQnoticeReceiver = procedure (arg:pointer; res:PPGresult);cdecl;
|
|
||||||
PQnoticeProcessor = procedure (arg:pointer; message:Pchar);cdecl;
|
|
||||||
{ Print options for PQprint() }
|
|
||||||
Ppqbool = ^pqbool;
|
|
||||||
pqbool = char;
|
|
||||||
|
|
||||||
P_PQprintOpt = ^_PQprintOpt;
|
|
||||||
_PQprintOpt = record
|
|
||||||
header : pqbool;
|
|
||||||
align : pqbool;
|
|
||||||
standard : pqbool;
|
|
||||||
html3 : pqbool;
|
|
||||||
expanded : pqbool;
|
|
||||||
pager : pqbool;
|
|
||||||
fieldSep : Pchar;
|
|
||||||
tableOpt : Pchar;
|
|
||||||
caption : Pchar;
|
|
||||||
fieldName : ^Pchar;
|
|
||||||
end;
|
|
||||||
PQprintOpt = _PQprintOpt;
|
|
||||||
PPQprintOpt = ^PQprintOpt;
|
|
||||||
|
|
||||||
{ ----------------
|
|
||||||
* Structure for the conninfo parameter definitions returned by PQconndefaults
|
|
||||||
*
|
|
||||||
* All fields except "val" point at static strings which must not be altered.
|
|
||||||
* "val" is either NULL or a malloc'd current-value string. PQconninfoFree()
|
|
||||||
* will release both the val strings and the PQconninfoOption array itself.
|
|
||||||
* ----------------
|
|
||||||
}
|
|
||||||
|
|
||||||
P_PQconninfoOption = ^_PQconninfoOption;
|
|
||||||
_PQconninfoOption = record
|
|
||||||
keyword : Pchar;
|
|
||||||
envvar : Pchar;
|
|
||||||
compiled : Pchar;
|
|
||||||
val : Pchar;
|
|
||||||
_label : Pchar;
|
|
||||||
dispchar : Pchar;
|
|
||||||
dispsize : longint;
|
|
||||||
end;
|
|
||||||
PQconninfoOption = _PQconninfoOption;
|
|
||||||
PPQconninfoOption = ^PQconninfoOption;
|
|
||||||
{ ----------------
|
|
||||||
* PQArgBlock -- structure for PQfn() arguments
|
|
||||||
* ----------------
|
|
||||||
}
|
|
||||||
{ can't use void (dec compiler barfs) }
|
|
||||||
|
|
||||||
PPQArgBlock = ^PQArgBlock;
|
|
||||||
PQArgBlock = record
|
|
||||||
len : longint;
|
|
||||||
isint : longint;
|
|
||||||
u : record
|
|
||||||
case longint of
|
|
||||||
0 : ( ptr : Plongint );
|
|
||||||
1 : ( integer : longint );
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
{ ----------------
|
{ ----------------
|
||||||
* Exported functions of libpq
|
* Exported functions of libpq
|
||||||
* ----------------
|
* ----------------
|
||||||
@ -478,6 +302,9 @@ implementation
|
|||||||
{ was #define dname(params) para_def_expr }
|
{ was #define dname(params) para_def_expr }
|
||||||
{ argument types are unknown }
|
{ argument types are unknown }
|
||||||
{ return type might be wrong }
|
{ return type might be wrong }
|
||||||
|
|
||||||
|
// This function is also defined in postgres3dyn!
|
||||||
|
|
||||||
function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : pchar) : ppgconn;
|
function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : pchar) : ppgconn;
|
||||||
begin
|
begin
|
||||||
PQsetdb:=PQsetdbLogin(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME,'','');
|
PQsetdb:=PQsetdbLogin(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME,'','');
|
||||||
|
387
packages/base/postgres/postgres3dyn.pp
Normal file
387
packages/base/postgres/postgres3dyn.pp
Normal file
@ -0,0 +1,387 @@
|
|||||||
|
{
|
||||||
|
Contains the Postgres protocol 3 functions calls
|
||||||
|
|
||||||
|
Call InitialisePostgres3 before using any of the calls, and call ReleasePostgres3
|
||||||
|
when finished.
|
||||||
|
}
|
||||||
|
|
||||||
|
unit postgres3dyn;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
dynlibs, SysUtils, dllistdyn;
|
||||||
|
|
||||||
|
{$PACKRECORDS C}
|
||||||
|
|
||||||
|
const
|
||||||
|
pqlib = 'libpq.so';
|
||||||
|
|
||||||
|
{$i postgres3types.inc}
|
||||||
|
|
||||||
|
var
|
||||||
|
{ ----------------
|
||||||
|
* Exported functions of libpq
|
||||||
|
* ----------------
|
||||||
|
}
|
||||||
|
{ === in fe-connect.c === }
|
||||||
|
{ make a new client connection to the backend }
|
||||||
|
{ Asynchronous (non-blocking) }
|
||||||
|
(* Const before type ignored *)
|
||||||
|
PQconnectStart : function (conninfo:Pchar):PPGconn;cdecl;
|
||||||
|
PQconnectPoll : function (conn:PPGconn):PostgresPollingStatusType;cdecl;
|
||||||
|
{ Synchronous (blocking) }
|
||||||
|
(* Const before type ignored *)
|
||||||
|
PQconnectdb : function (conninfo:Pchar):PPGconn;cdecl;
|
||||||
|
PQsetdbLogin : function (pghost:Pchar; pgport:Pchar; pgoptions:Pchar; pgtty:Pchar; dbName:Pchar;login:Pchar; pwd:Pchar):PPGconn;cdecl;
|
||||||
|
{ was #define dname(params) para_def_expr }
|
||||||
|
{ argument types are unknown }
|
||||||
|
{ return type might be wrong }
|
||||||
|
{ close the current connection and free the PGconn data structure }
|
||||||
|
PQfinish : procedure (conn:PPGconn);cdecl;
|
||||||
|
{ get info about connection options known to PQconnectdb }
|
||||||
|
PQconndefaults : function : PPQconninfoOption;cdecl;
|
||||||
|
{ free the data structure returned by PQconndefaults() }
|
||||||
|
PQconninfoFree : procedure (connOptions:PPQconninfoOption);cdecl;
|
||||||
|
{
|
||||||
|
* close the current connection and restablish a new one with the same
|
||||||
|
* parameters
|
||||||
|
}
|
||||||
|
{ Asynchronous (non-blocking) }
|
||||||
|
PQresetStart : function (conn:PPGconn):longint;cdecl;
|
||||||
|
PQresetPoll : function (conn:PPGconn):PostgresPollingStatusType;cdecl;
|
||||||
|
{ Synchronous (blocking) }
|
||||||
|
PQreset : procedure (conn:PPGconn);cdecl;
|
||||||
|
{ issue a cancel request }
|
||||||
|
PQrequestCancel : function (conn:PPGconn):longint;cdecl;
|
||||||
|
{ Accessor functions for PGconn objects }
|
||||||
|
PQdb : function (conn:PPGconn):Pchar;cdecl;
|
||||||
|
PQuser : function (conn:PPGconn):Pchar;cdecl;
|
||||||
|
PQpass : function (conn:PPGconn):Pchar;cdecl;
|
||||||
|
PQhost : function (conn:PPGconn):Pchar;cdecl;
|
||||||
|
PQport : function (conn:PPGconn):Pchar;cdecl;
|
||||||
|
PQtty : function (conn:PPGconn):Pchar;cdecl;
|
||||||
|
PQoptions : function (conn:PPGconn):Pchar;cdecl;
|
||||||
|
PQstatus : function (conn:PPGconn):TConnStatusType;cdecl;
|
||||||
|
PQtransactionStatus : function (conn:PPGconn):PGTransactionStatusType;cdecl;
|
||||||
|
PQparameterStatus : function (conn:PPGconn; paramName:Pchar):Pchar;cdecl;
|
||||||
|
PQprotocolVersion : function (conn:PPGconn):longint;cdecl;
|
||||||
|
PQerrorMessage : function (conn:PPGconn):Pchar;cdecl;
|
||||||
|
PQsocket : function (conn:PPGconn):longint;cdecl;
|
||||||
|
PQbackendPID : function (conn:PPGconn):longint;cdecl;
|
||||||
|
PQclientEncoding : function (conn:PPGconn):longint;cdecl;
|
||||||
|
PQsetClientEncoding : function (conn:PPGconn; encoding:Pchar):longint;cdecl;
|
||||||
|
{$ifdef USE_SSL}
|
||||||
|
{ Get the SSL structure associated with a connection }
|
||||||
|
PQgetssl : function (conn:PPGconn):PSSL;cdecl;
|
||||||
|
{$endif}
|
||||||
|
{ Set verbosity for PQerrorMessage and PQresultErrorMessage }
|
||||||
|
PQsetErrorVerbosity : function (conn:PPGconn; verbosity:PGVerbosity):PGVerbosity;cdecl;
|
||||||
|
{ Enable/disable tracing }
|
||||||
|
PQtrace : procedure (conn:PPGconn; debug_port:PFILE);cdecl;
|
||||||
|
PQuntrace : procedure (conn:PPGconn);cdecl;
|
||||||
|
{ Override default notice handling routines }
|
||||||
|
PQsetNoticeReceiver : function (conn:PPGconn; proc:PQnoticeReceiver; arg:pointer):PQnoticeReceiver;cdecl;
|
||||||
|
PQsetNoticeProcessor : function (conn:PPGconn; proc:PQnoticeProcessor; arg:pointer):PQnoticeProcessor;cdecl;
|
||||||
|
{ === in fe-exec.c === }
|
||||||
|
{ Simple synchronous query }
|
||||||
|
PQexec : function (conn:PPGconn; query:Pchar):PPGresult;cdecl;
|
||||||
|
PQexecParams : function (conn:PPGconn; command:Pchar; nParams:longint; paramTypes:POid; paramValues:PPchar;paramLengths:Plongint; paramFormats:Plongint; resultFormat:longint):PPGresult;cdecl;
|
||||||
|
PQexecPrepared : function (conn:PPGconn; stmtName:Pchar; nParams:longint; paramValues:PPchar; paramLengths:Plongint;paramFormats:Plongint; resultFormat:longint):PPGresult;cdecl;
|
||||||
|
{ Interface for multiple-result or asynchronous queries }
|
||||||
|
PQsendQuery : function (conn:PPGconn; query:Pchar):longint;cdecl;
|
||||||
|
PQsendQueryParams : function (conn:PPGconn; command:Pchar; nParams:longint; paramTypes:POid; paramValues:PPchar;paramLengths:Plongint; paramFormats:Plongint; resultFormat:longint):longint;cdecl;
|
||||||
|
PQsendQueryPrepared : function (conn:PPGconn; stmtName:Pchar; nParams:longint; paramValues:PPchar; paramLengths:Plongint;paramFormats:Plongint; resultFormat:longint):longint;cdecl;
|
||||||
|
PQgetResult : function (conn:PPGconn):PPGresult;cdecl;
|
||||||
|
{ Routines for managing an asynchronous query }
|
||||||
|
PQisBusy : function (conn:PPGconn):longint;cdecl;
|
||||||
|
PQconsumeInput : function (conn:PPGconn):longint;cdecl;
|
||||||
|
{ LISTEN/NOTIFY support }
|
||||||
|
PQnotifies : function (conn:PPGconn):PPGnotify;cdecl;
|
||||||
|
{ Routines for copy in/out }
|
||||||
|
PQputCopyData : function (conn:PPGconn; buffer:Pchar; nbytes:longint):longint;cdecl;
|
||||||
|
PQputCopyEnd : function (conn:PPGconn; errormsg:Pchar):longint;cdecl;
|
||||||
|
PQgetCopyData : function (conn:PPGconn; buffer:PPchar; async:longint):longint;cdecl;
|
||||||
|
{ Deprecated routines for copy in/out }
|
||||||
|
PQgetline : function (conn:PPGconn; _string:Pchar; length:longint):longint;cdecl;
|
||||||
|
PQputline : function (conn:PPGconn; _string:Pchar):longint;cdecl;
|
||||||
|
PQgetlineAsync : function (conn:PPGconn; buffer:Pchar; bufsize:longint):longint;cdecl;
|
||||||
|
PQputnbytes : function (conn:PPGconn; buffer:Pchar; nbytes:longint):longint;cdecl;
|
||||||
|
PQendcopy : function (conn:PPGconn):longint;cdecl;
|
||||||
|
{ Set blocking/nonblocking connection to the backend }
|
||||||
|
PQsetnonblocking : function (conn:PPGconn; arg:longint):longint;cdecl;
|
||||||
|
PQisnonblocking : function (conn:PPGconn):longint;cdecl;
|
||||||
|
{ Force the write buffer to be written (or at least try) }
|
||||||
|
PQflush : function (conn:PPGconn):longint;cdecl;
|
||||||
|
{
|
||||||
|
* "Fast path" interface --- not really recommended for application
|
||||||
|
* use
|
||||||
|
}
|
||||||
|
PQfn : function (conn:PPGconn; fnid:longint; result_buf:Plongint; result_len:Plongint; result_is_int:longint;args:PPQArgBlock; nargs:longint):PPGresult;cdecl;
|
||||||
|
{ Accessor functions for PGresult objects }
|
||||||
|
PQresultStatus : function (res:PPGresult):TExecStatusType;cdecl;
|
||||||
|
PQresStatus : function (status:TExecStatusType):Pchar;cdecl;
|
||||||
|
PQresultErrorMessage : function (res:PPGresult):Pchar;cdecl;
|
||||||
|
PQresultErrorField : function (res:PPGresult; fieldcode:longint):Pchar;cdecl;
|
||||||
|
PQntuples : function (res:PPGresult):longint;cdecl;
|
||||||
|
PQnfields : function (res:PPGresult):longint;cdecl;
|
||||||
|
PQbinaryTuples : function (res:PPGresult):longint;cdecl;
|
||||||
|
PQfname : function (res:PPGresult; field_num:longint):Pchar;cdecl;
|
||||||
|
PQfnumber : function (res:PPGresult; field_name:Pchar):longint;cdecl;
|
||||||
|
PQftable : function (res:PPGresult; field_num:longint):Oid;cdecl;
|
||||||
|
PQftablecol : function (res:PPGresult; field_num:longint):longint;cdecl;
|
||||||
|
PQfformat : function (res:PPGresult; field_num:longint):longint;cdecl;
|
||||||
|
PQftype : function (res:PPGresult; field_num:longint):Oid;cdecl;
|
||||||
|
PQfsize : function (res:PPGresult; field_num:longint):longint;cdecl;
|
||||||
|
PQfmod : function (res:PPGresult; field_num:longint):longint;cdecl;
|
||||||
|
PQcmdStatus : function (res:PPGresult):Pchar;cdecl;
|
||||||
|
PQoidStatus : function (res:PPGresult):Pchar;cdecl;
|
||||||
|
{ old and ugly }
|
||||||
|
PQoidValue : function (res:PPGresult):Oid;cdecl;
|
||||||
|
{ new and improved }
|
||||||
|
PQcmdTuples : function (res:PPGresult):Pchar;cdecl;
|
||||||
|
PQgetvalue : function (res:PPGresult; tup_num:longint; field_num:longint):Pchar;cdecl;
|
||||||
|
PQgetlength : function (res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl;
|
||||||
|
PQgetisnull : function (res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl;
|
||||||
|
{ Delete a PGresult }
|
||||||
|
PQclear : procedure (res:PPGresult);cdecl;
|
||||||
|
{ For freeing other alloc'd results, such as PGnotify structs }
|
||||||
|
PQfreemem : procedure (ptr:pointer);cdecl;
|
||||||
|
{ Exists for backward compatibility. bjm 2003-03-24 }
|
||||||
|
{ was #define dname(params) para_def_expr }
|
||||||
|
{ argument types are unknown }
|
||||||
|
{ return type might be wrong }
|
||||||
|
// function PQfreeNotify(ptr : longint) : longint;
|
||||||
|
{
|
||||||
|
* Make an empty PGresult with given status (some apps find this
|
||||||
|
* useful). If conn is not NULL and status indicates an error, the
|
||||||
|
* conn's errorMessage is copied.
|
||||||
|
}
|
||||||
|
PQmakeEmptyPGresult : function (conn:PPGconn; status:TExecStatusType):PPGresult;cdecl;
|
||||||
|
{ Quoting strings before inclusion in queries. }
|
||||||
|
PQescapeString : function (till:Pchar; from:Pchar; length:size_t):size_t;cdecl;
|
||||||
|
PQescapeBytea : function (bintext:Pbyte; binlen:size_t; bytealen:Psize_t):Pbyte;cdecl;
|
||||||
|
PQunescapeBytea : function (strtext:Pbyte; retbuflen:Psize_t):Pbyte;cdecl;
|
||||||
|
{ === in fe-print.c === }
|
||||||
|
{ output stream }
|
||||||
|
PQprint : procedure (fout:PFILE; res:PPGresult; ps:PPQprintOpt);cdecl;
|
||||||
|
{ option structure }
|
||||||
|
{
|
||||||
|
* really old printing routines
|
||||||
|
}
|
||||||
|
{ where to send the output }
|
||||||
|
{ pad the fields with spaces }
|
||||||
|
{ field separator }
|
||||||
|
{ display headers? }
|
||||||
|
PQdisplayTuples : procedure (res:PPGresult; fp:PFILE; fillAlign:longint; fieldSep:Pchar; printHeader:longint;quiet:longint);cdecl;
|
||||||
|
(* Const before type ignored *)
|
||||||
|
{ output stream }
|
||||||
|
{ print attribute names }
|
||||||
|
{ delimiter bars }
|
||||||
|
PQprintTuples : procedure (res:PPGresult; fout:PFILE; printAttName:longint; terseOutput:longint; width:longint);cdecl;
|
||||||
|
{ width of column, if 0, use variable
|
||||||
|
* width }
|
||||||
|
{ === in fe-lobj.c === }
|
||||||
|
{ Large-object access routines }
|
||||||
|
lo_open : function (conn:PPGconn; lobjId:Oid; mode:longint):longint;cdecl;
|
||||||
|
lo_close : function (conn:PPGconn; fd:longint):longint;cdecl;
|
||||||
|
lo_read : function (conn:PPGconn; fd:longint; buf:Pchar; len:size_t):longint;cdecl;
|
||||||
|
lo_write : function (conn:PPGconn; fd:longint; buf:Pchar; len:size_t):longint;cdecl;
|
||||||
|
lo_lseek : function (conn:PPGconn; fd:longint; offset:longint; whence:longint):longint;cdecl;
|
||||||
|
lo_creat : function (conn:PPGconn; mode:longint):Oid;cdecl;
|
||||||
|
lo_tell : function (conn:PPGconn; fd:longint):longint;cdecl;
|
||||||
|
lo_unlink : function (conn:PPGconn; lobjId:Oid):longint;cdecl;
|
||||||
|
lo_import : function (conn:PPGconn; filename:Pchar):Oid;cdecl;
|
||||||
|
lo_export : function (conn:PPGconn; lobjId:Oid; filename:Pchar):longint;cdecl;
|
||||||
|
{ === in fe-misc.c === }
|
||||||
|
{ Determine length of multibyte encoded char at *s }
|
||||||
|
PQmblen : function (s:Pbyte; encoding:longint):longint;cdecl;
|
||||||
|
{ Get encoding id from environment variable PGCLIENTENCODING }
|
||||||
|
PQenv2encoding: function :longint;cdecl;
|
||||||
|
|
||||||
|
{ PQexec : function (conn:PPGconn; query:Pchar):PPGresult;cdecl;
|
||||||
|
PQsetdbLogin : function (pghost:Pchar; pgport:Pchar; pgoptions:Pchar; pgtty:Pchar; dbName:Pchar;
|
||||||
|
login:Pchar; pwd:Pchar):PPGconn;cdecl;
|
||||||
|
PQerrorMessage : function (conn:PPGconn):Pchar;cdecl;
|
||||||
|
PQclear : procedure (res:PPGresult);cdecl;
|
||||||
|
PQresultStatus : function (res:PPGresult):TExecStatusType;cdecl;
|
||||||
|
PQconnectdb : function (conninfo:Pchar):PPGconn;cdecl;
|
||||||
|
PQfinish : procedure (conn:PPGconn);cdecl;
|
||||||
|
PQstatus : function (conn:PPGconn):TConnStatusType;cdecl;
|
||||||
|
PQgetvalue : function (res:PPGresult; tup_num:longint; field_num:longint):Pchar;cdecl;
|
||||||
|
PQfmod : function (res:PPGresult; field_num:longint):longint;cdecl;
|
||||||
|
PQgetlength : function (res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl;
|
||||||
|
PQntuples : function(res:PPGresult):longint;cdecl;
|
||||||
|
PQnfields : function(res:PPGresult):longint;cdecl;
|
||||||
|
PQgetisnull : function(res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl;
|
||||||
|
PQfsize : function (res:PPGresult; field_num:longint):longint;cdecl;
|
||||||
|
PQftype : function (res:PPGresult; field_num:longint):Oid;cdecl;
|
||||||
|
PQfname : function (res:PPGresult; field_num:longint):Pchar;cdecl;
|
||||||
|
}
|
||||||
|
Procedure InitialisePostgres3;
|
||||||
|
Procedure ReleasePostgres3;
|
||||||
|
|
||||||
|
var Postgres3LibraryHandle : TLibHandle;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
var RefCount : integer;
|
||||||
|
|
||||||
|
Procedure InitialisePostgres3;
|
||||||
|
|
||||||
|
begin
|
||||||
|
inc(RefCount);
|
||||||
|
if RefCount = 1 then
|
||||||
|
begin
|
||||||
|
Postgres3LibraryHandle := loadlibrary(pqlib);
|
||||||
|
if Postgres3LibraryHandle = nilhandle then
|
||||||
|
begin
|
||||||
|
RefCount := 0;
|
||||||
|
Raise EInOutError.Create('Can not load PosgreSQL client. Is it installed? ('+pqlib+')');
|
||||||
|
end;
|
||||||
|
|
||||||
|
pointer(PQconnectStart) := GetProcedureAddress(Postgres3LibraryHandle,'PQconnectStart');
|
||||||
|
pointer(PQconnectPoll) := GetProcedureAddress(Postgres3LibraryHandle,'PQconnectPoll');
|
||||||
|
pointer(PQconnectdb) := GetProcedureAddress(Postgres3LibraryHandle,'PQconnectdb');
|
||||||
|
pointer(PQsetdbLogin) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetdbLogin');
|
||||||
|
pointer(PQfinish) := GetProcedureAddress(Postgres3LibraryHandle,'PQfinish');
|
||||||
|
pointer(PQconndefaults) := GetProcedureAddress(Postgres3LibraryHandle,'PQconndefaults');
|
||||||
|
pointer(PQconninfoFree) := GetProcedureAddress(Postgres3LibraryHandle,'PQconninfoFree');
|
||||||
|
pointer(PQresetStart) := GetProcedureAddress(Postgres3LibraryHandle,'PQresetStart');
|
||||||
|
pointer(PQresetPoll) := GetProcedureAddress(Postgres3LibraryHandle,'PQresetPoll');
|
||||||
|
pointer(PQreset) := GetProcedureAddress(Postgres3LibraryHandle,'PQreset');
|
||||||
|
pointer(PQrequestCancel) := GetProcedureAddress(Postgres3LibraryHandle,'PQrequestCancel');
|
||||||
|
pointer(PQdb) := GetProcedureAddress(Postgres3LibraryHandle,'PQdb');
|
||||||
|
pointer(PQuser) := GetProcedureAddress(Postgres3LibraryHandle,'PQuser');
|
||||||
|
pointer(PQpass) := GetProcedureAddress(Postgres3LibraryHandle,'PQpass');
|
||||||
|
pointer(PQhost) := GetProcedureAddress(Postgres3LibraryHandle,'PQhost');
|
||||||
|
pointer(PQport) := GetProcedureAddress(Postgres3LibraryHandle,'PQport');
|
||||||
|
pointer(PQtty) := GetProcedureAddress(Postgres3LibraryHandle,'PQtty');
|
||||||
|
pointer(PQoptions) := GetProcedureAddress(Postgres3LibraryHandle,'PQoptions');
|
||||||
|
pointer(PQstatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQstatus');
|
||||||
|
pointer(PQtransactionStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQtransactionStatus');
|
||||||
|
pointer(PQparameterStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQparameterStatus');
|
||||||
|
pointer(PQprotocolVersion) := GetProcedureAddress(Postgres3LibraryHandle,'PQprotocolVersion');
|
||||||
|
pointer(PQerrorMessage) := GetProcedureAddress(Postgres3LibraryHandle,'PQerrorMessage');
|
||||||
|
pointer(PQsocket) := GetProcedureAddress(Postgres3LibraryHandle,'PQsocket');
|
||||||
|
pointer(PQbackendPID) := GetProcedureAddress(Postgres3LibraryHandle,'PQbackendPID');
|
||||||
|
pointer(PQclientEncoding) := GetProcedureAddress(Postgres3LibraryHandle,'PQclientEncoding');
|
||||||
|
pointer(PQsetClientEncoding) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetClientEncoding');
|
||||||
|
{$ifdef USE_SSL}
|
||||||
|
pointer(PQgetssl) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetssl');
|
||||||
|
{$endif}
|
||||||
|
pointer(PQsetErrorVerbosity) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetErrorVerbosity');
|
||||||
|
pointer(PQtrace) := GetProcedureAddress(Postgres3LibraryHandle,'PQtrace');
|
||||||
|
pointer(PQuntrace) := GetProcedureAddress(Postgres3LibraryHandle,'PQuntrace');
|
||||||
|
pointer(PQsetNoticeReceiver) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetNoticeReceiver');
|
||||||
|
pointer(PQsetNoticeProcessor) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetNoticeProcessor');
|
||||||
|
pointer(PQexec) := GetProcedureAddress(Postgres3LibraryHandle,'PQexec');
|
||||||
|
pointer(PQexecParams) := GetProcedureAddress(Postgres3LibraryHandle,'PQexecParams');
|
||||||
|
pointer(PQexecPrepared) := GetProcedureAddress(Postgres3LibraryHandle,'PQexecPrepared');
|
||||||
|
pointer(PQsendQuery) := GetProcedureAddress(Postgres3LibraryHandle,'PQsendQuery');
|
||||||
|
pointer(PQsendQueryParams) := GetProcedureAddress(Postgres3LibraryHandle,'PQsendQueryParams');
|
||||||
|
pointer(PQsendQueryPrepared) := GetProcedureAddress(Postgres3LibraryHandle,'PQsendQueryPrepared');
|
||||||
|
pointer(PQgetResult) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetResult');
|
||||||
|
pointer(PQisBusy) := GetProcedureAddress(Postgres3LibraryHandle,'PQisBusy');
|
||||||
|
pointer(PQconsumeInput) := GetProcedureAddress(Postgres3LibraryHandle,'PQconsumeInput');
|
||||||
|
pointer(PQnotifies) := GetProcedureAddress(Postgres3LibraryHandle,'PQnotifies');
|
||||||
|
pointer(PQputCopyData) := GetProcedureAddress(Postgres3LibraryHandle,'PQputCopyData');
|
||||||
|
pointer(PQputCopyEnd) := GetProcedureAddress(Postgres3LibraryHandle,'PQputCopyEnd');
|
||||||
|
pointer(PQgetCopyData) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetCopyData');
|
||||||
|
pointer(PQgetline) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetline');
|
||||||
|
pointer(PQputline) := GetProcedureAddress(Postgres3LibraryHandle,'PQputline');
|
||||||
|
pointer(PQgetlineAsync) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetlineAsync');
|
||||||
|
pointer(PQputnbytes) := GetProcedureAddress(Postgres3LibraryHandle,'PQputnbytes');
|
||||||
|
pointer(PQendcopy) := GetProcedureAddress(Postgres3LibraryHandle,'PQendcopy');
|
||||||
|
pointer(PQsetnonblocking) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetnonblocking');
|
||||||
|
pointer(PQisnonblocking) := GetProcedureAddress(Postgres3LibraryHandle,'PQisnonblocking');
|
||||||
|
pointer(PQflush) := GetProcedureAddress(Postgres3LibraryHandle,'PQflush');
|
||||||
|
pointer(PQfn) := GetProcedureAddress(Postgres3LibraryHandle,'PQfn');
|
||||||
|
pointer(PQresultStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQresultStatus');
|
||||||
|
pointer(PQresStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQresStatus');
|
||||||
|
pointer(PQresultErrorMessage) := GetProcedureAddress(Postgres3LibraryHandle,'PQresultErrorMessage');
|
||||||
|
pointer(PQresultErrorField) := GetProcedureAddress(Postgres3LibraryHandle,'PQresultErrorField');
|
||||||
|
pointer(PQntuples) := GetProcedureAddress(Postgres3LibraryHandle,'PQntuples');
|
||||||
|
pointer(PQnfields) := GetProcedureAddress(Postgres3LibraryHandle,'PQnfields');
|
||||||
|
pointer(PQbinaryTuples) := GetProcedureAddress(Postgres3LibraryHandle,'PQbinaryTuples');
|
||||||
|
pointer(PQfname) := GetProcedureAddress(Postgres3LibraryHandle,'PQfname');
|
||||||
|
pointer(PQfnumber) := GetProcedureAddress(Postgres3LibraryHandle,'PQfnumber');
|
||||||
|
pointer(PQftable) := GetProcedureAddress(Postgres3LibraryHandle,'PQftable');
|
||||||
|
pointer(PQftablecol) := GetProcedureAddress(Postgres3LibraryHandle,'PQftablecol');
|
||||||
|
pointer(PQfformat) := GetProcedureAddress(Postgres3LibraryHandle,'PQfformat');
|
||||||
|
pointer(PQftype) := GetProcedureAddress(Postgres3LibraryHandle,'PQftype');
|
||||||
|
pointer(PQfsize) := GetProcedureAddress(Postgres3LibraryHandle,'PQfsize');
|
||||||
|
pointer(PQfmod) := GetProcedureAddress(Postgres3LibraryHandle,'PQfmod');
|
||||||
|
pointer(PQcmdStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQcmdStatus');
|
||||||
|
pointer(PQoidStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQoidStatus');
|
||||||
|
pointer(PQoidValue) := GetProcedureAddress(Postgres3LibraryHandle,'PQoidValue');
|
||||||
|
pointer(PQcmdTuples) := GetProcedureAddress(Postgres3LibraryHandle,'PQcmdTuples');
|
||||||
|
pointer(PQgetvalue) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetvalue');
|
||||||
|
pointer(PQgetlength) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetlength');
|
||||||
|
pointer(PQgetisnull) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetisnull');
|
||||||
|
pointer(PQclear) := GetProcedureAddress(Postgres3LibraryHandle,'PQclear');
|
||||||
|
pointer(PQfreemem) := GetProcedureAddress(Postgres3LibraryHandle,'PQfreemem');
|
||||||
|
pointer(PQmakeEmptyPGresult) := GetProcedureAddress(Postgres3LibraryHandle,'PQmakeEmptyPGresult');
|
||||||
|
pointer(PQescapeString) := GetProcedureAddress(Postgres3LibraryHandle,'PQescapeString');
|
||||||
|
pointer(PQescapeBytea) := GetProcedureAddress(Postgres3LibraryHandle,'PQescapeBytea');
|
||||||
|
pointer(PQunescapeBytea) := GetProcedureAddress(Postgres3LibraryHandle,'PQunescapeBytea');
|
||||||
|
pointer(PQprint) := GetProcedureAddress(Postgres3LibraryHandle,'PQprint');
|
||||||
|
pointer(PQdisplayTuples) := GetProcedureAddress(Postgres3LibraryHandle,'PQdisplayTuples');
|
||||||
|
pointer(PQprintTuples) := GetProcedureAddress(Postgres3LibraryHandle,'PQprintTuples');
|
||||||
|
pointer(lo_open) := GetProcedureAddress(Postgres3LibraryHandle,'lo_open');
|
||||||
|
pointer(lo_close) := GetProcedureAddress(Postgres3LibraryHandle,'lo_close');
|
||||||
|
pointer(lo_read) := GetProcedureAddress(Postgres3LibraryHandle,'lo_read');
|
||||||
|
pointer(lo_write) := GetProcedureAddress(Postgres3LibraryHandle,'lo_write');
|
||||||
|
pointer(lo_lseek) := GetProcedureAddress(Postgres3LibraryHandle,'lo_lseek');
|
||||||
|
pointer(lo_creat) := GetProcedureAddress(Postgres3LibraryHandle,'lo_creat');
|
||||||
|
pointer(lo_tell) := GetProcedureAddress(Postgres3LibraryHandle,'lo_tell');
|
||||||
|
pointer(lo_unlink) := GetProcedureAddress(Postgres3LibraryHandle,'lo_unlink');
|
||||||
|
pointer(lo_import) := GetProcedureAddress(Postgres3LibraryHandle,'lo_import');
|
||||||
|
pointer(lo_export) := GetProcedureAddress(Postgres3LibraryHandle,'lo_export');
|
||||||
|
pointer(PQmblen) := GetProcedureAddress(Postgres3LibraryHandle,'PQmblen');
|
||||||
|
pointer(PQenv2encoding) := GetProcedureAddress(Postgres3LibraryHandle,'PQenv2encoding');
|
||||||
|
|
||||||
|
{ pointer(PQexec) := GetProcedureAddress(Postgres3LibraryHandle,'PQexec');
|
||||||
|
pointer(PQsetdbLogin) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetdbLogin');
|
||||||
|
pointer(PQerrorMessage) := GetProcedureAddress(Postgres3LibraryHandle,'PQerrorMessage');
|
||||||
|
pointer(PQclear) := GetProcedureAddress(Postgres3LibraryHandle,'PQclear');
|
||||||
|
pointer(PQresultStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQresultStatus');
|
||||||
|
pointer(PQconnectdb) := GetProcedureAddress(Postgres3LibraryHandle,'PQconnectdb');
|
||||||
|
pointer(PQfinish) := GetProcedureAddress(Postgres3LibraryHandle,'PQfinish');
|
||||||
|
pointer(PQstatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQstatus');
|
||||||
|
pointer(PQgetvalue) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetvalue');
|
||||||
|
pointer(PQfmod) := GetProcedureAddress(Postgres3LibraryHandle,'PQfmod');
|
||||||
|
pointer(PQgetlength) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetlength');
|
||||||
|
pointer(PQntuples) := GetProcedureAddress(Postgres3LibraryHandle,'PQnfields');
|
||||||
|
pointer(PQnfields) := GetProcedureAddress(Postgres3LibraryHandle,'PQnfields');
|
||||||
|
pointer(PQgetisnull) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetisnull');
|
||||||
|
pointer(PQfsize) := GetProcedureAddress(Postgres3LibraryHandle,'PQfsize');
|
||||||
|
pointer(PQftype) := GetProcedureAddress(Postgres3LibraryHandle,'PQftype');
|
||||||
|
pointer(PQfname) := GetProcedureAddress(Postgres3LibraryHandle,'PQfname');}
|
||||||
|
|
||||||
|
InitialiseDllist;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure ReleasePostgres3;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if RefCount > 0 then dec(RefCount);
|
||||||
|
if RefCount = 0 then
|
||||||
|
begin
|
||||||
|
if not UnloadLibrary(Postgres3LibraryHandle) then inc(RefCount);
|
||||||
|
ReleaseDllist;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// This function is also defined in postgres3!
|
||||||
|
function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : pchar) : ppgconn;
|
||||||
|
begin
|
||||||
|
PQsetdb:=PQsetdbLogin(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME,'','');
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
178
packages/base/postgres/postgres3types.inc
Normal file
178
packages/base/postgres/postgres3types.inc
Normal file
@ -0,0 +1,178 @@
|
|||||||
|
{
|
||||||
|
Contains the types needed for use with Postgres protocol v3
|
||||||
|
}
|
||||||
|
|
||||||
|
Type
|
||||||
|
size_t = sizeint;
|
||||||
|
psize_t = ^size_t;
|
||||||
|
TFILE = Longint;
|
||||||
|
PFIle = ^TFILE;
|
||||||
|
POid = ^Oid;
|
||||||
|
Oid = dword;
|
||||||
|
|
||||||
|
const
|
||||||
|
ERROR_MSG_LENGTH = 4096;
|
||||||
|
CMDSTATUS_LEN = 40;
|
||||||
|
|
||||||
|
Type
|
||||||
|
TSockAddr = Array [1..112] of byte;
|
||||||
|
TPGresAttDesc = record
|
||||||
|
name : Pchar;
|
||||||
|
adtid : Oid;
|
||||||
|
adtsize : integer;
|
||||||
|
end;
|
||||||
|
PPGresAttDesc= ^TPGresAttDesc;
|
||||||
|
PPPGresAttDesc= ^PPGresAttDesc;
|
||||||
|
TPGresAttValue = record
|
||||||
|
len : longint;
|
||||||
|
value : Pchar;
|
||||||
|
end;
|
||||||
|
PPGresAttValue= ^TPGresAttValue;
|
||||||
|
PPPGresAttValue= ^PPGresAttValue;
|
||||||
|
|
||||||
|
PExecStatusType = ^TExecStatusType;
|
||||||
|
TExecStatusType = (PGRES_EMPTY_QUERY := 0,PGRES_COMMAND_OK,
|
||||||
|
PGRES_TUPLES_OK,PGRES_COPY_OUT,PGRES_COPY_IN,
|
||||||
|
PGRES_BAD_RESPONSE,PGRES_NONFATAL_ERROR,
|
||||||
|
PGRES_FATAL_ERROR);
|
||||||
|
|
||||||
|
|
||||||
|
TPGlobjfuncs = record
|
||||||
|
fn_lo_open : Oid;
|
||||||
|
fn_lo_close : Oid;
|
||||||
|
fn_lo_creat : Oid;
|
||||||
|
fn_lo_unlink : Oid;
|
||||||
|
fn_lo_lseek : Oid;
|
||||||
|
fn_lo_tell : Oid;
|
||||||
|
fn_lo_read : Oid;
|
||||||
|
fn_lo_write : Oid;
|
||||||
|
end;
|
||||||
|
PPGlobjfuncs= ^TPGlobjfuncs;
|
||||||
|
|
||||||
|
PConnStatusType = ^TConnStatusType;
|
||||||
|
TConnStatusType = (CONNECTION_OK,CONNECTION_BAD,CONNECTION_STARTED,
|
||||||
|
CONNECTION_MADE,CONNECTION_AWAITING_RESPONSE,
|
||||||
|
CONNECTION_AUTH_OK,CONNECTION_SETENV,
|
||||||
|
CONNECTION_SSL_STARTUP,CONNECTION_NEEDED);
|
||||||
|
|
||||||
|
TPGconn = record
|
||||||
|
pghost : Pchar;
|
||||||
|
pgtty : Pchar;
|
||||||
|
pgport : Pchar;
|
||||||
|
pgoptions : Pchar;
|
||||||
|
dbName : Pchar;
|
||||||
|
status : TConnStatusType;
|
||||||
|
errorMessage : array[0..(ERROR_MSG_LENGTH)-1] of char;
|
||||||
|
Pfin : PFILE;
|
||||||
|
Pfout : PFILE;
|
||||||
|
Pfdebug : PFILE;
|
||||||
|
sock : longint;
|
||||||
|
laddr : TSockAddr;
|
||||||
|
raddr : TSockAddr;
|
||||||
|
salt : array[0..(2)-1] of char;
|
||||||
|
asyncNotifyWaiting : longint;
|
||||||
|
notifyList : PDllist;
|
||||||
|
pguser : Pchar;
|
||||||
|
pgpass : Pchar;
|
||||||
|
lobjfuncs : PPGlobjfuncs;
|
||||||
|
end;
|
||||||
|
PPGconn= ^TPGconn;
|
||||||
|
|
||||||
|
TPGresult = record
|
||||||
|
ntups : longint;
|
||||||
|
numAttributes : longint;
|
||||||
|
attDescs : PPGresAttDesc;
|
||||||
|
tuples : PPPGresAttValue;
|
||||||
|
tupArrSize : longint;
|
||||||
|
resultStatus : TExecStatusType;
|
||||||
|
cmdStatus : array[0..(CMDSTATUS_LEN)-1] of char;
|
||||||
|
binary : longint;
|
||||||
|
conn : PPGconn;
|
||||||
|
end;
|
||||||
|
PPGresult= ^TPGresult;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PPostgresPollingStatusType = ^PostgresPollingStatusType;
|
||||||
|
PostgresPollingStatusType = (PGRES_POLLING_FAILED := 0,PGRES_POLLING_READING,
|
||||||
|
PGRES_POLLING_WRITING,PGRES_POLLING_OK,
|
||||||
|
PGRES_POLLING_ACTIVE);
|
||||||
|
|
||||||
|
|
||||||
|
PPGTransactionStatusType = ^PGTransactionStatusType;
|
||||||
|
PGTransactionStatusType = (PQTRANS_IDLE,PQTRANS_ACTIVE,PQTRANS_INTRANS,
|
||||||
|
PQTRANS_INERROR,PQTRANS_UNKNOWN);
|
||||||
|
|
||||||
|
PPGVerbosity = ^PGVerbosity;
|
||||||
|
PGVerbosity = (PQERRORS_TERSE,PQERRORS_DEFAULT,PQERRORS_VERBOSE);
|
||||||
|
|
||||||
|
PpgNotify = ^pgNotify;
|
||||||
|
pgNotify = record
|
||||||
|
relname : Pchar;
|
||||||
|
be_pid : longint;
|
||||||
|
extra : Pchar;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ Function types for notice-handling callbacks }
|
||||||
|
PQnoticeReceiver = procedure (arg:pointer; res:PPGresult);cdecl;
|
||||||
|
PQnoticeProcessor = procedure (arg:pointer; message:Pchar);cdecl;
|
||||||
|
{ Print options for PQprint() }
|
||||||
|
Ppqbool = ^pqbool;
|
||||||
|
pqbool = char;
|
||||||
|
|
||||||
|
P_PQprintOpt = ^_PQprintOpt;
|
||||||
|
_PQprintOpt = record
|
||||||
|
header : pqbool;
|
||||||
|
align : pqbool;
|
||||||
|
standard : pqbool;
|
||||||
|
html3 : pqbool;
|
||||||
|
expanded : pqbool;
|
||||||
|
pager : pqbool;
|
||||||
|
fieldSep : Pchar;
|
||||||
|
tableOpt : Pchar;
|
||||||
|
caption : Pchar;
|
||||||
|
fieldName : ^Pchar;
|
||||||
|
end;
|
||||||
|
PQprintOpt = _PQprintOpt;
|
||||||
|
PPQprintOpt = ^PQprintOpt;
|
||||||
|
|
||||||
|
{ ----------------
|
||||||
|
* Structure for the conninfo parameter definitions returned by PQconndefaults
|
||||||
|
*
|
||||||
|
* All fields except "val" point at static strings which must not be altered.
|
||||||
|
* "val" is either NULL or a malloc'd current-value string. PQconninfoFree()
|
||||||
|
* will release both the val strings and the PQconninfoOption array itself.
|
||||||
|
* ----------------
|
||||||
|
}
|
||||||
|
|
||||||
|
P_PQconninfoOption = ^_PQconninfoOption;
|
||||||
|
_PQconninfoOption = record
|
||||||
|
keyword : Pchar;
|
||||||
|
envvar : Pchar;
|
||||||
|
compiled : Pchar;
|
||||||
|
val : Pchar;
|
||||||
|
_label : Pchar;
|
||||||
|
dispchar : Pchar;
|
||||||
|
dispsize : longint;
|
||||||
|
end;
|
||||||
|
PQconninfoOption = _PQconninfoOption;
|
||||||
|
PPQconninfoOption = ^PQconninfoOption;
|
||||||
|
{ ----------------
|
||||||
|
* PQArgBlock -- structure for PQfn() arguments
|
||||||
|
* ----------------
|
||||||
|
}
|
||||||
|
{ can't use void (dec compiler barfs) }
|
||||||
|
|
||||||
|
PPQArgBlock = ^PQArgBlock;
|
||||||
|
PQArgBlock = record
|
||||||
|
len : longint;
|
||||||
|
isint : longint;
|
||||||
|
u : record
|
||||||
|
case longint of
|
||||||
|
0 : ( ptr : Plongint );
|
||||||
|
1 : ( integer : longint );
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user