* base removed

git-svn-id: trunk@10063 -
This commit is contained in:
marco 2008-01-27 17:32:57 +00:00
parent 8053cf057e
commit dc56d1c82d
14 changed files with 0 additions and 3478 deletions

12
.gitattributes vendored
View File

@ -868,18 +868,6 @@ packages/aspell/examples/example.pas svneol=native#text/plain
packages/aspell/fpmake.pp svneol=native#text/plain
packages/aspell/src/aspell.pp svneol=native#text/plain
packages/aspell/src/scheck.pp svneol=native#text/plain
packages/base/Makefile svneol=native#text/plain
packages/base/Makefile.fpc svneol=native#text/plain
packages/base/mysql/ver322/mysql.pp svneol=native#text/plain
packages/base/mysql/ver322/mysql_com.pp svneol=native#text/plain
packages/base/mysql/ver322/mysql_version.pp svneol=native#text/plain
packages/base/mysql/ver323/mysql.pp svneol=native#text/plain
packages/base/mysql/ver323/mysql_com.pp svneol=native#text/plain
packages/base/mysql/ver323/mysql_version.pp svneol=native#text/plain
packages/base/mysql/ver323/mysqls.pp svneol=native#text/plain
packages/base/mysql/ver40/mysql.pp svneol=native#text/plain
packages/base/mysql/ver40/mysql_com.pp svneol=native#text/plain
packages/base/mysql/ver40/mysql_version.pp svneol=native#text/plain
packages/bfd/Makefile svneol=native#text/plain
packages/bfd/Makefile.fpc svneol=native#text/plain
packages/bfd/fpmake.pp svneol=native#text/plain

35
.gitignore vendored
View File

@ -215,41 +215,6 @@ packages/amunits/src/utilunits/*.ppu
packages/amunits/src/utilunits/*.s
packages/amunits/src/utilunits/fpcmade.*
packages/amunits/src/utilunits/units
packages/base/*.bak
packages/base/*.exe
packages/base/*.o
packages/base/*.ppu
packages/base/*.s
packages/base/fpcmade.*
packages/base/mysql/*.bak
packages/base/mysql/*.exe
packages/base/mysql/*.o
packages/base/mysql/*.ppu
packages/base/mysql/*.s
packages/base/mysql/fpcmade.*
packages/base/mysql/units
packages/base/mysql/ver322/*.bak
packages/base/mysql/ver322/*.exe
packages/base/mysql/ver322/*.o
packages/base/mysql/ver322/*.ppu
packages/base/mysql/ver322/*.s
packages/base/mysql/ver322/fpcmade.*
packages/base/mysql/ver322/units
packages/base/mysql/ver323/*.bak
packages/base/mysql/ver323/*.exe
packages/base/mysql/ver323/*.o
packages/base/mysql/ver323/*.ppu
packages/base/mysql/ver323/*.s
packages/base/mysql/ver323/fpcmade.*
packages/base/mysql/ver323/units
packages/base/mysql/ver40/*.bak
packages/base/mysql/ver40/*.exe
packages/base/mysql/ver40/*.o
packages/base/mysql/ver40/*.ppu
packages/base/mysql/ver40/*.s
packages/base/mysql/ver40/fpcmade.*
packages/base/mysql/ver40/units
packages/base/units
packages/fcl-base/examples/*.bak
packages/fcl-base/examples/*.exe
packages/fcl-base/examples/*.o

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +0,0 @@
#
# Makefile.fpc for Free Pascal Packages
#
[target]
[install]
fpcpackage=y
fpcsubdir=packages/base
[default]
fpcdir=../..

View File

@ -1,323 +0,0 @@
unit mysql;
{
Import unit for the mysql header files.
Translated form the original mysql.h by Michael Van Canneyt
(michael@tfdec1.fys.kuleuven.ac.be)
}
interface
uses mysql_com;
{$ifdef win32}
Const mysqllib = 'libmysql';
{$else}
Const mysqllib = 'mysqlclient';
{$endif}
{$ifndef win32}
{$linklib c}
{$linklib m}
{$endif}
{ All is 4-byte aligned on my machine. }
{$packrecords 4}
type
my_bool = byte;
gptr = pchar;
Socket = Longint;
PCardinal = ^Cardinal;
{$ifdef Unix}
Var
mysql_port : cardinal; external name 'mysql_port';
mysql_unix_port : pchar; external name 'mysql_unix_port';
{$endif}
{
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG)
#define IS_NUM(t) ((t) <= FIELD_TYPE_INT24)
}
Type
st_mysql_field = record
name : Pchar; { Name of column }
table : pchar; { Table of column if column was a field }
def: pchar; { Default value (set by mysql_list_fields) }
ftype : enum_field_types; { Type of field. See mysql_com.h for types }
length : cardinal; { Width of column }
max_length : cardinal; { Max width of selected set }
flags : cardinal; { Div flags }
decimals : cardinal; { Number of decimals in field }
end;
TMYSQL_FIELD = st_mysql_field;
PMYSQL_FIELD = ^TMYSQL_FIELD;
TMYSQL_ROW = PPchar; { return data as array of strings }
TMYSQL_FIELD_OFFSET = cardinal; { offset to current field }
{$ifndef oldmysql}
my_ulonglong=qword;
{$else}
my_longlong=cardinal;
{$endif}
PST_MYSQL_Rows = ^st_mysql_rows;
st_mysql_rows = Record
next : pst_mysql_rows; { list of rows }
Data : TMYSQL_ROW;
end;
TMYSQL_ROWS = st_mysql_rows;
PMYSQL_ROWS = ^TMYSQL_ROWS;
TMYSQL_ROW_OFFSET = PMYSQL_ROWS; { offset to current row }
st_mysql_data = record
rows : my_ulonglong;
fields : cardinal;
data : PMYSQL_ROWS;
alloc : TMEM_ROOT;
end;
TMYSQL_DATA = st_mysql_data;
PMYSQL_DATA = ^TMYSQL_DATA;
st_mysql_options = record
connect_timeout,client_flag : cardinal;
compress,named_pipe : my_bool;
port : cardinal;
host,init_command,user,password,unix_socket,db : pchar;
my_cnf_file,my_cnf_group : pchar;
end;
mysql_status = (MYSQL_STATUS_READY,
MYSQL_STATUS_GET_RESULT,
MYSQL_STATUS_USE_RESULT);
st_mysql = Record
NET : TNET; { Communication parameters }
host,user,passwd,unix_socket,server_version,host_info,
info,db : pchar;
port,client_flag,server_capabilities : cardinal;
protocol_version : cardinal;
field_count : cardinal;
thread_id : cardinal; { Id for connection in server }
affected_rows : my_ulonglong;
insert_id : my_ulonglong; { id if insert on table with NEXTNR }
extra_info : my_ulonglong; { Used by mysqlshow }
packet_length : cardinal;
status : mysql_status;
fields : PMYSQL_FIELD;
field_alloc : TMEM_ROOT;
free_me : my_bool; { If free in mysql_close }
reconnect : my_bool; { set to 1 if automatic reconnect }
options : st_mysql_options;
end;
TMYSQL = st_mysql;
PMYSQL = ^TMYSQL;
st_mysql_res = record
row_count : my_ulonglong;
field_count, current_field : cardinal;
fields : PMYSQL_FIELD;
data : PMYSQL_DATA;
data_cursor : PMYSQL_ROWS;
field_alloc : TMEM_ROOT;
row : TMYSQL_ROW; { If unbuffered read }
current_row : TMYSQL_ROW; { buffer to current row }
lengths : pcardinal; { column lengths of current row }
handle : PMYSQL; { for unbuffered reads }
eof : my_bool; { Used my mysql_fetch_row }
end;
TMYSQL_RES = st_mysql_res;
PMYSQL_RES = ^TMYSQL_RES;
{ Translated Macros }
Function mysql_num_rows (res : PMYSQL_RES) : my_ulonglong;
Function mysql_num_fields(res : PMYSQL_RES) : Cardinal;
Function mysql_eof(res : PMYSQL_RES) : my_bool;
Function mysql_fetch_field_direct(res : PMYSQL_RES; fieldnr : Cardinal) : TMYSQL_FIELD;
Function mysql_fetch_fields(res : PMYSQL_RES) : PMYSQL_FIELD;
Function mysql_row_tell(res : PMYSQL_RES) : PMYSQL_ROWS;
Function mysql_field_tell(res : PMYSQL_RES) : Cardinal;
Function mysql_affected_rows(mysql : PMYSQL): my_ulonglong;
Function mysql_insert_id(mysql : PMYSQL): my_ulonglong;
Function mysql_errno(mysql : PMYSQL) : Cardinal;
Function mysql_info(mysql : PMYSQL): Pchar;
Function mysql_reload(mysql : PMYSQL) : Longint;
Function mysql_thread_id(mysql : PMYSQL) : Cardinal;
Function mysql_error(mysql : PMYSQL) : pchar;
{ Original functions }
Function mysql_connect (mysql : PMYSQL; host,user,passwd: pchar) : PMYSQL; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_real_connect (mysql : PMYSQL; const host,user,passwd : pchar;
port : cardinal;
unix_socket : pchar;
clientflag : cardinal) : PMYSQL;{$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_close(sock : PMYSQL) : longint; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_select_db(MYSQL : PMYSQL; db : Pchar) : longint; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_query(mysql : PMYSQL; q : pchar) : longint; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_real_query(mysql : PMYSQL; q : Pchar; length : longint) : longint; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_create_db(mysql : PMYSQL; db : pchar) : longint; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_drop_db(mysql : PMYSQL; DB : Pchar) : longint; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_shutdown(mysql : PMYSQL) : longint; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_dump_debug_info(mysql : PMYSQL) : longint; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_refresh(mysql : PMYSQL; refresh_options : cardinal) : longint; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_kill(mysql : PMYSQL; pid : Cardinal) : longint; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_stat(mysql : PMYSQL) : Pchar; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_get_server_info(mysql : PMYSQL) : pchar; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_get_client_info : pchar; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_get_host_info(mysql : PMYSQL) : pchar; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_get_proto_info(mysql : PMYSQL) : Cardinal; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_list_dbs(mysql : PMYSQL;wild : Pchar) : PMYSQL_RES; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_list_tables(mysql : PMYSQL;Wild : Pchar) : PMYSQL_RES; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_list_fields(mysql : PMYSQL; table,wild : pchar) : PMYSQL_RES; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_list_processes(mysql : PMYSQL) : PMYSQL_RES; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_store_result(mysql : PMYSQL) : PMYSQL_RES; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_use_result(mysql : PMYSQL) : PMYSQL_RES; {$ifdef win32} stdcall {$else} cdecl {$endif};
Procedure mysql_free_result(res : PMYSQL_RES);{$ifdef win32} stdcall {$else} cdecl {$endif};
Procedure mysql_data_seek(mysql : PMYSQL_RES; offs : cardinal);{$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_row_seek(mysql : PMYSQL_RES; Offs: TMYSQL_ROW_OFFSET): TMYSQL_ROW_OFFSET; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_field_seek(musql : PMYSQL_RES;offs : TMYSQL_FIELD_OFFSET): TMYSQL_FIELD_OFFSET; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_fetch_row(mysql : PMYSQL_RES) : TMYSQL_ROW; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_fetch_lengths(mysql : PMYSQL_RES) : PCardinal; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_fetch_field(handle : PMYSQL_RES) : PMYSQL_FIELD; {$ifdef win32} stdcall {$else} cdecl {$endif};
Function mysql_escape_string(escto,escfrom : pchar; length : Cardinal) : cardinal; {$ifdef win32} stdcall {$else} cdecl {$endif};
Procedure mysql_debug(debug : pchar);{$ifdef win32} stdcall {$else} cdecl {$endif};
implementation
function mysql_connect (mysql : PMYSQL; host,user,passwd: pchar) : PMYSQL;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_connect';
function mysql_real_connect (mysql : PMYSQL; const host,user,passwd : pchar;
port : cardinal;
unix_socket : pchar;
clientflag : cardinal) : PMYSQL;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib;
function mysql_close(sock : PMYSQL) : longint ;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_close';
function mysql_select_db(MYSQL : PMYSQL; db : Pchar) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_select_db';
function mysql_query(mysql : PMYSQL; q : pchar) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_query';
function mysql_real_query(mysql : PMYSQL; q : Pchar; length : longint) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_real_query';
function mysql_create_db(mysql : PMYSQL; db : pchar) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_create_db';
Function mysql_drop_db(mysql : PMYSQL; DB : Pchar) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_drop_db';
Function mysql_shutdown(mysql : PMYSQL) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_shutdown';
Function mysql_dump_debug_info(mysql : PMYSQL) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_dump_debug_info';
Function mysql_refresh(mysql : PMYSQL; refresh_options : cardinal) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_refresh';
Function mysql_kill(mysql : PMYSQL; pid : Cardinal) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_kill';
Function mysql_stat(mysql : PMYSQL) : Pchar;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_stat';
Function mysql_get_server_info(mysql : PMYSQL) : pchar;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_get_server_info';
Function mysql_get_client_info : pchar;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib;
Function mysql_get_host_info(mysql : PMYSQL) : pchar;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_get_host_info';
Function mysql_get_proto_info(mysql : PMYSQL) : Cardinal;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_get_proto_info';
Function mysql_list_dbs(mysql : PMYSQL;wild : Pchar) : PMYSQL_RES;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_list_dbs';
Function mysql_list_tables(mysql : PMYSQL;Wild : Pchar) : PMYSQL_RES;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_list_tables';
Function mysql_list_fields(mysql : PMYSQL; table,wild : pchar) : PMYSQL_RES;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_list_fields';
Function mysql_list_processes(mysql : PMYSQL) : PMYSQL_RES;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_list_processes';
Function mysql_store_result(mysql : PMYSQL) : PMYSQL_RES;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_store_result';
Function mysql_use_result(mysql : PMYSQL) : PMYSQL_RES;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_use_result';
Procedure mysql_free_result(res : PMYSQL_RES);{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_free_result';
Procedure mysql_data_seek(mysql : PMYSQL_RES; offs : cardinal);{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_data_seek';
Function mysql_row_seek(mysql : PMYSQL_RES; Offs: TMYSQL_ROW_OFFSET): TMYSQL_ROW_OFFSET;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_row_seek';
Function mysql_field_seek(musql : PMYSQL_RES;offs : TMYSQL_FIELD_OFFSET): TMYSQL_FIELD_OFFSET;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_field_seek';
function mysql_fetch_row(mysql : PMYSQL_RES) : TMYSQL_ROW;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_fetch_row';
function mysql_fetch_lengths(mysql : PMYSQL_RES) : PCardinal;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_fetch_lengths';
function mysql_fetch_field(handle : PMYSQL_RES) : PMYSQL_FIELD;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_fetch_field';
Function mysql_escape_string(escto,escfrom : pchar; length : Cardinal) : cardinal;{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_escape_string';
Procedure mysql_debug(debug : pchar);{$ifdef win32} stdcall {$else} cdecl {$endif}; external mysqllib name 'mysql_debug';
Function mysql_error(mysql : PMYSQL) : pchar;
begin
mysql_error:=mysql^.net.last_error
end;
Function mysql_num_rows (res : PMYSQL_RES) : my_ulonglong;
begin
mysql_num_rows:=res^.row_count
end;
Function mysql_num_fields(res : PMYSQL_RES) : Cardinal;
begin
mysql_num_fields:=res^.field_count
end;
Function mysql_eof(res : PMYSQL_RES) : my_bool;
begin
mysql_eof:=res^.eof
end;
Function mysql_fetch_field_direct(res : PMYSQL_RES; fieldnr : Cardinal) : TMYSQL_FIELD;
begin
mysql_fetch_field_direct:=res^.fields[fieldnr];
end;
Function mysql_fetch_fields(res : PMYSQL_RES) : PMYSQL_FIELD;
begin
mysql_fetch_fields:=res^.fields
end;
Function mysql_row_tell(res : PMYSQL_RES) : PMYSQL_ROWS;
begin
mysql_row_tell:=res^.data_cursor
end;
Function mysql_field_tell(res : PMYSQL_RES) : Cardinal;
begin
mysql_field_tell:=res^.current_field
end;
Function mysql_affected_rows(mysql : PMYSQL): my_ulonglong;
begin
mysql_affected_rows:=mysql^.affected_rows
end;
Function mysql_insert_id(mysql : PMYSQL): my_ulonglong;
begin
mysql_insert_id:=mysql^.insert_id
end;
Function mysql_errno(mysql : PMYSQL) : Cardinal;
begin
mysql_errno:=mysql^.net.last_errno
end;
Function mysql_info(mysql : PMYSQL): Pchar;
begin
mysql_info:=mysql^.info
end;
Function mysql_reload(mysql : PMYSQL) : Longint;
begin
mysql_reload:=mysql_refresh(mysql,REFRESH_GRANT)
end;
Function mysql_thread_id(mysql : PMysql) : Cardinal;
begin
mysql_thread_id:=mysql^.thread_id
end;
end.

View File

@ -1,224 +0,0 @@
unit mysql_com;
interface
{$ifndef win32}
{$linklib mysqlclient}
{$linklib m}
{$linklib c}
{$endif}
{
Common definition between mysql server & client
}
{$packrecords 4}
{ Extra types introduced for pascal }
Type
pbyte = ^byte;
pcardinal = ^cardinal;
Socket = longint;
my_bool = byte;
Const
NAME_LEN = 64 ; { Field/table name length }
LOCAL_HOST : pchar = 'localhost' ;
MYSQL_PORT = 3306; { Alloced by ISI for MySQL }
MYSQL_UNIX_ADDR : pchar = '/tmp/mysql.sock';
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);
Const
NOT_NULL_FLAG = 1; { Field can't be NULL }
PRI_KEY_FLAG = 2; { Field is part of a primary key }
UNIQUE_KEY_FLAG = 4; { Field is part of a unique key }
MULTIPLE_KEY_FLAG = 8; { Field is part of a key }
BLOB_FLAG = 16; { Field is a blob }
UNSIGNED_FLAG = 32; { Field is unsigned }
ZEROFILL_FLAG = 64; { Field is zerofill }
BINARY_FLAG = 128;
{ The following are only sent to new clients }
ENUM_FLAG = 256; { field is an enum }
AUTO_INCREMENT_FLAG = 512; { field is a autoincrement field }
TIMESTAMP_FLAG = 1024; { Field is a timestamp }
PART_KEY_FLAG = 16384; { Intern; Part of some key }
GROUP_FLAG = 32768; { Intern group field }
REFRESH_GRANT = 1; { Refresh grant tables }
REFRESH_LOG = 2; { Start on new log file }
REFRESH_TABLES = 4; { close all tables }
CLIENT_LONG_PASSWORD = 1; { new more secure passwords }
CLIENT_FOUND_ROWS = 2; { Found instead of affected rows }
CLIENT_LONG_FLAG = 4; { Get all column flags }
Type
pst_used_mem = ^st_used_mem;
st_used_mem = record { struct for once_alloc }
next : pst_used_mem; { Next block in use }
left : cardinal; { memory left in block }
size : cardinal; { size of block }
end;
TUSED_MEM = st_used_mem;
PUSED_MEM = ^TUSED_MEM;
TError_handler = Procedure;
st_mem_root = record
free : PUSED_MEM;
used : PUSED_MEM;
min_malloc : cardinal;
block_size : cardinal;
error_handler : TERROR_Handler;
end;
TMEM_ROOT = st_mem_root;
PMEM_ROOT = ^TMEM_ROOT;
Const
MYSQL_ERRMSG_SIZE = 200;
Type
net_type = (NET_TYPE_TCPIP, NET_TYPE_SOCKET, NETTYPE_NAMEDPIPE);
st_net = record
nettype : net_type; //DT
fd : Socket;
fcntl : Longint;
buff,buff_end,write_pos,read_pos : Pchar;//DT
last_error : array [0..MYSQL_ERRMSG_SIZE-1] of char;
last_errno,max_packet,timeout,pkt_nr : Cardinal;
error,return_errno : my_bool;
compress : my_bool; //DT
remain_in_buf,r_length, buf_length, where_b : cardinal; //DT
more : my_bool;//DT
save_char : char; //DT
end;
TNET = st_net;
PNET = ^TNET;
Const
packet_error : longint = -1;
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_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);
Const
FIELD_TYPE_CHAR = FIELD_TYPE_TINY; { For compability }
FIELD_TYPE_INTERVAL = FIELD_TYPE_ENUM; { For compability }
Procedure sql_free (root : PMEM_ROOT);{$ifdef win32} stdcall {$else} cdecl {$endif};
Procedure init_alloc_root (root: PMEM_ROOT;block_size : Cardinal);{$ifdef win32} stdcall {$else} cdecl {$endif};
Function sql_alloc_first_block(root : PMEM_ROOT) : my_bool;{$ifdef win32} stdcall {$else} cdecl {$endif};
Function sql_alloc_root(mem_root : PMEM_ROOT;len : Cardinal) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif};
Function sql_strdup_root(root : PMEM_ROOT;st : pchar) : pchar;{$ifdef win32} stdcall {$else} cdecl {$endif};
Function sql_memdup_root(root: PMEM_ROOT;st : pchar; len : Cardinal): longint;{$ifdef win32} stdcall {$else} cdecl {$endif};
{
extern unsigned long max_allowed_packet;
extern unsigned long net_buffer_length;
}
{
#define net_new_transaction(net) ((net)->pkt_nr=0)
}
Function my_net_init(net :PNET; fd : Socket) : Longint;{$ifdef win32} stdcall {$else} cdecl {$endif};
procedure net_end(net : PNET);{$ifdef win32} stdcall {$else} cdecl {$endif};
Procedure net_clear(net : PNET);{$ifdef win32} stdcall {$else} cdecl {$endif};
Function net_flush(net : PNET) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif};
Function my_net_write(net : PNET;packet : pbyte;len : cardinal) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif};
Function net_write_command(net : PNET; command : char;packet : pbyte;len : cardinal) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif};
Function net_real_write(net : PNET;packet : pbyte; len : Cardinal) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif};
Function my_net_read(net : PNET) : Cardinal;{$ifdef win32} stdcall {$else} cdecl {$endif};
Type
TRand_struct = record
seed,seed2,max_value : Cardinal;
max_value_dbl : double;
end;
PRand_struct = ^TRand_struct;
{ The following is for user defined functions }
Item_result = (STRING_RESULT,REAL_RESULT,INT_RESULT);
st_udf_args = record
arg_count : cardinal; { Number of arguments }
arg_type : ^Item_result; { Pointer to item_results }
args : ppchar; { Pointer to argument }
lengths : PCardinal; { Length of string arguments }
end;
TUDF_ARGS = st_udf_args;
PUDPF_ARGS = ^TUDF_ARGS;
{ This holds information about the result }
st_udf_init = record
maybe_null : my_bool; { 1 if function can return NULL }
decimals : cardinal; { for real functions }
max_length : Cardinal; { For string functions }
ptr : PChar; { free pointer for function data }
end;
TUDF_INIT = st_udf_init;
PUDF_INIT = TUDF_INIT;
{ Prototypes to password functions }
procedure randominit(rand : Prand_struct; seed1,seed2 : Cardinal);{$ifdef win32} stdcall {$else} cdecl {$endif};
Function rnd(rand : Prand_struct) : double;{$ifdef win32} stdcall {$else} cdecl {$endif};
procedure make_scrambled_password(toarg, passwd : Pchar);{$ifdef win32} stdcall {$else} cdecl {$endif};
procedure get_salt_from_password(res : pcardinal; password : pchar);{$ifdef win32} stdcall {$else} cdecl {$endif};
procedure scramble(toarg,message,password : pchar; old_ver : my_bool);{$ifdef win32} stdcall {$else} cdecl {$endif};
function check_scramble(scramble,message : pchar; salt : cardinal;old_ver:my_bool) : my_bool;{$ifdef win32} stdcall {$else} cdecl {$endif};
function get_tty_password(opt_message: pchar) : pchar;{$ifdef win32} stdcall {$else} cdecl {$endif};
{
#define NULL_LENGTH ((unsigned long) ~0) { For net_store_length }
}
implementation
Procedure sql_free (root : PMEM_ROOT);{$ifdef win32} stdcall {$else} cdecl {$endif};external;
Procedure init_alloc_root (root: PMEM_ROOT;block_size : Cardinal);{$ifdef win32} stdcall {$else} cdecl {$endif};external;
Function sql_alloc_first_block(root : PMEM_ROOT) : my_bool;{$ifdef win32} stdcall {$else} cdecl {$endif};external;
Function sql_alloc_root(mem_root : PMEM_ROOT;len : Cardinal) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif};external;
Function sql_strdup_root(root : PMEM_ROOT;st : pchar) : pchar;{$ifdef win32} stdcall {$else} cdecl {$endif};external;
Function sql_memdup_root(root: PMEM_ROOT;st : pchar; len : Cardinal) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif};external;
Function my_net_init(net :PNET; fd : Socket) : Longint;{$ifdef win32} stdcall {$else} cdecl {$endif};external;
procedure net_end(net : PNET);{$ifdef win32} stdcall {$else} cdecl {$endif};external;
Procedure net_clear(net : PNET);{$ifdef win32} stdcall {$else} cdecl {$endif};external;
Function net_flush(net : PNET) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif};external;
Function my_net_write(net : PNET;packet : pbyte;len : cardinal) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif};external;
Function net_write_command(net : PNET; command : char;packet : pbyte;len : cardinal) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif};external;
Function net_real_write(net : PNET;packet : pbyte; len : Cardinal) : longint;{$ifdef win32} stdcall {$else} cdecl {$endif};external;
Function my_net_read(net : PNET) : Cardinal;{$ifdef win32} stdcall {$else} cdecl {$endif};external;
procedure randominit(rand : Prand_struct; seed1,seed2 : Cardinal);{$ifdef win32} stdcall {$else} cdecl {$endif};external;
Function rnd(rand : Prand_struct) : double;{$ifdef win32} stdcall {$else} cdecl {$endif};external;
procedure make_scrambled_password(toarg, passwd : Pchar);{$ifdef win32} stdcall {$else} cdecl {$endif};external;
procedure get_salt_from_password(res : pcardinal; password : pchar);{$ifdef win32} stdcall {$else} cdecl {$endif};external;
procedure scramble(toarg,message,password : pchar; old_ver : my_bool);{$ifdef win32} stdcall {$else} cdecl {$endif};external;
function check_scramble(scramble,message : pchar; salt : cardinal;old_ver:my_bool) : my_bool;{$ifdef win32} stdcall {$else} cdecl {$endif};external;
function get_tty_password(opt_message: pchar) : pchar;{$ifdef win32} stdcall {$else} cdecl {$endif};external;
end.

View File

@ -1,19 +0,0 @@
unit mysql_version;
{
Translated from mysql_version.h by Michael Van Canneyt
(michael@tfdec1.fys.kuleuven.ac.be)
}
interface
{ Version numbers for protocol & mysqld }
Const
MYSQL_SERVER_VERSION : pchar ='3.21.28-gamma';
FRM_VER = 6;
MYSQL_VERSION_ID =32128;
implementation
end.

View File

@ -1,376 +0,0 @@
unit mysql;
{$undef use_mysql_321} { if undefined, use mysql 3.23 interface }
{
Import unit for the mysql header files.
Translated form the original mysql.h by Michael Van Canneyt
(michael@tfdec1.fys.kuleuven.ac.be)
updated to mysql version 3.23 header files by Bernhard Steffen
(bernhard.steffen@gmx.net)
}
{$r+,i+,o+}
interface
uses mysql_com, mysql_version;
{$ifdef win32}
Const mysqllib = 'libmysql';
{$else}
Const mysqllib = 'mysqlclient';
{$endif}
{$ifndef win32}
{$linklib c}
{$linklib m}
{$linklib mysqlclient}
{$endif}
{$packrecords C}
type
my_bool = byte;
gptr = pchar;
Socket = Longint;
PCardinal = ^Cardinal;
{$ifdef linux}
Var
mysql_port : cardinal; external name 'mysql_port';
mysql_unix_port : pchar; external name 'mysql_unix_port';
{$endif}
{$ifdef darwin}
Var
mysql_port : cardinal; external mysqllib name 'mysql_port';
mysql_unix_port : pchar; external mysqllib name 'mysql_unix_port';
{$endif}
{
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG)
#define IS_NUM(t) ((t) <= FIELD_TYPE_INT24)
}
Type
st_mysql_field = record
name : Pchar; { Name of column }
table : pchar; { Table of column if column was a field }
def: pchar; { Default value (set by mysql_list_fields) }
ftype : enum_field_types; { Type of field. See mysql_com.h for types }
length : cardinal; { Width of column }
max_length : cardinal; { Max width of selected set }
flags : cardinal; { Div flags }
decimals : cardinal; { Number of decimals in field }
end;
TMYSQL_FIELD = st_mysql_field;
PMYSQL_FIELD = ^TMYSQL_FIELD;
TMYSQL_ROW = PPchar; { return data as array of strings }
TMYSQL_FIELD_OFFSET = cardinal; { offset to current field }
{$ifndef oldmysql}
my_ulonglong=qword;
{$else}
my_longlong=cardinal;
{$endif}
PST_MYSQL_Rows = ^st_mysql_rows;
st_mysql_rows = Record
next : pst_mysql_rows; { list of rows }
Data : TMYSQL_ROW;
end;
TMYSQL_ROWS = st_mysql_rows;
PMYSQL_ROWS = ^TMYSQL_ROWS;
TMYSQL_ROW_OFFSET = PMYSQL_ROWS; { offset to current row }
st_mysql_data = record
rows : my_ulonglong;
fields : cardinal;
data : PMYSQL_ROWS;
alloc : TMEM_ROOT;
end;
TMYSQL_DATA = st_mysql_data;
PMYSQL_DATA = ^TMYSQL_DATA;
st_mysql_options = record
connect_timeout,client_flag : cardinal;
compress,named_pipe : my_bool;
port : cardinal;
host,init_command,user,password,unix_socket,db : pchar;
my_cnf_file,my_cnf_group : pchar;
{$ifndef use_mysql_321}
charset_dir, charset_name : pchar;
use_ssl : my_bool;
ssl_key, ssl_cert, ssl_ca, ssl_capath : pchar;
{$endif}
end;
{$ifndef use_mysql_321}
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);
{$endif}
mysql_status = (MYSQL_STATUS_READY,
MYSQL_STATUS_GET_RESULT,
MYSQL_STATUS_USE_RESULT);
{$ifndef use_mysql_321}
(*
charset_info_st = Record
number : cardinal;
name : pchar;
ctype : pointer {uchar*};
to_lower : pointer {uchar*};
to_upper : pointer {uchar*};
sort_order : pointer {uchar*};
strxfrm_multiply : cardinal;
{ einige nicht näher definierte Felder }
a, strxfrm, strnncoll, strnxfrm, like_range : pointer;
mbmaxlen : cardinal;
ismbchar, ismbhead, mbcharlen : pointer;
end;
*)
{$endif}
st_mysql = Record
NET : TNET; { Communication parameters }
{$ifndef use_mysql_321}
connector_fd : gptr;
{$endif}
host,user,passwd,unix_socket,server_version,host_info,
info,db : pchar;
port,client_flag,server_capabilities : cardinal;
protocol_version : cardinal;
field_count : cardinal;
{$ifndef use_mysql_321}
server_status : cardinal;
{$endif}
thread_id : cardinal; { Id for connection in server }
affected_rows : my_ulonglong;
insert_id : my_ulonglong; { id if insert on table with NEXTNR }
extra_info : my_ulonglong; { Used by mysqlshow }
packet_length : cardinal;
status : mysql_status;
fields : PMYSQL_FIELD;
field_alloc : TMEM_ROOT;
free_me : my_bool; { If free in mysql_close }
reconnect : my_bool; { set to 1 if automatic reconnect }
options : st_mysql_options;
{$ifndef use_mysql_321}
scramble_buf : array[0..8] of char;
charset : pointer { struct charset_info_st};
server_language : cardinal;
{$endif}
end;
TMYSQL = st_mysql;
PMYSQL = ^TMYSQL;
st_mysql_res = record
row_count : my_ulonglong;
field_count, current_field : cardinal;
fields : PMYSQL_FIELD;
data : PMYSQL_DATA;
data_cursor : PMYSQL_ROWS;
field_alloc : TMEM_ROOT;
row : TMYSQL_ROW; { If unbuffered read }
current_row : TMYSQL_ROW; { buffer to current row }
lengths : pcardinal; { column lengths of current row }
handle : PMYSQL; { for unbuffered reads }
eof : my_bool; { Used my mysql_fetch_row }
end;
TMYSQL_RES = st_mysql_res;
PMYSQL_RES = ^TMYSQL_RES;
{ Translated Macros }
Function mysql_num_rows (res : PMYSQL_RES) : my_ulonglong;
Function mysql_num_fields(res : PMYSQL_RES) : Cardinal;
Function mysql_eof(res : PMYSQL_RES) : my_bool;
Function mysql_fetch_field_direct(res : PMYSQL_RES; fieldnr : Cardinal) : TMYSQL_FIELD;
Function mysql_fetch_fields(res : PMYSQL_RES) : PMYSQL_FIELD;
Function mysql_row_tell(res : PMYSQL_RES) : PMYSQL_ROWS;
Function mysql_field_tell(res : PMYSQL_RES) : Cardinal;
Function mysql_affected_rows(mysql : PMYSQL): my_ulonglong;
Function mysql_insert_id(mysql : PMYSQL): my_ulonglong;
Function mysql_errno(mysql : PMYSQL) : Cardinal;
Function mysql_info(mysql : PMYSQL): Pchar;
Function mysql_reload(mysql : PMYSQL) : Longint;
Function mysql_thread_id(mysql : PMYSQL) : Cardinal;
Function mysql_error(mysql : PMYSQL) : pchar;
{ Original functions }
Function mysql_connect (mysql : PMYSQL; host,user,passwd: pchar) : PMYSQL; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_real_connect (mysql : PMYSQL; const host,user,passwd : pchar;
port : cardinal;
unix_socket : pchar;
clientflag : cardinal) : PMYSQL;{$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_close(sock : PMYSQL) : longint; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_select_db(MYSQL : PMYSQL; db : Pchar) : longint; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_query(mysql : PMYSQL; q : pchar) : longint; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_real_query(mysql : PMYSQL; q : Pchar; length : longint) : longint; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_create_db(mysql : PMYSQL; db : pchar) : longint; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_drop_db(mysql : PMYSQL; DB : Pchar) : longint; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_shutdown(mysql : PMYSQL) : longint; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_dump_debug_info(mysql : PMYSQL) : longint; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_refresh(mysql : PMYSQL; refresh_options : cardinal) : longint; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_kill(mysql : PMYSQL; pid : Cardinal) : longint; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_stat(mysql : PMYSQL) : Pchar; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_get_server_info(mysql : PMYSQL) : pchar; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_get_client_info : pchar; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_get_host_info(mysql : PMYSQL) : pchar; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_get_proto_info(mysql : PMYSQL) : Cardinal; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_list_dbs(mysql : PMYSQL;wild : Pchar) : PMYSQL_RES; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_list_tables(mysql : PMYSQL;Wild : Pchar) : PMYSQL_RES; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_list_fields(mysql : PMYSQL; table,wild : pchar) : PMYSQL_RES; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_list_processes(mysql : PMYSQL) : PMYSQL_RES; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_store_result(mysql : PMYSQL) : PMYSQL_RES; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_use_result(mysql : PMYSQL) : PMYSQL_RES; {$ifdef win32}stdcall{$else}cdecl{$endif};
Procedure mysql_free_result(res : PMYSQL_RES);{$ifdef win32}stdcall{$else}cdecl{$endif};
Procedure mysql_data_seek(mysql : PMYSQL_RES; offs : cardinal);{$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_row_seek(mysql : PMYSQL_RES; Offs: TMYSQL_ROW_OFFSET): TMYSQL_ROW_OFFSET; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_field_seek(musql : PMYSQL_RES;offs : TMYSQL_FIELD_OFFSET): TMYSQL_FIELD_OFFSET; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_fetch_row(mysql : PMYSQL_RES) : TMYSQL_ROW; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_fetch_lengths(mysql : PMYSQL_RES) : PCardinal; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_fetch_field(handle : PMYSQL_RES) : PMYSQL_FIELD; {$ifdef win32}stdcall{$else}cdecl{$endif};
Function mysql_escape_string(escto,escfrom : pchar; length : Cardinal) : cardinal; {$ifdef win32}stdcall{$else}cdecl{$endif};
Procedure mysql_debug(debug : pchar);{$ifdef win32}stdcall{$else}cdecl{$endif};
implementation
function mysql_connect (mysql : PMYSQL; host,user,passwd: pchar) : PMYSQL;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_connect';
function mysql_real_connect (mysql : PMYSQL; const host,user,passwd : pchar;
port : cardinal;
unix_socket : pchar;
clientflag : cardinal) : PMYSQL;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib;
function mysql_close(sock : PMYSQL) : longint ;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_close';
function mysql_select_db(MYSQL : PMYSQL; db : Pchar) : longint;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_select_db';
function mysql_query(mysql : PMYSQL; q : pchar) : longint;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_query';
function mysql_real_query(mysql : PMYSQL; q : Pchar; length : longint) : longint;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_real_query';
function mysql_create_db(mysql : PMYSQL; db : pchar) : longint;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_create_db';
Function mysql_drop_db(mysql : PMYSQL; DB : Pchar) : longint;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_drop_db';
Function mysql_shutdown(mysql : PMYSQL) : longint;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_shutdown';
Function mysql_dump_debug_info(mysql : PMYSQL) : longint;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_dump_debug_info';
Function mysql_refresh(mysql : PMYSQL; refresh_options : cardinal) : longint;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_refresh';
Function mysql_kill(mysql : PMYSQL; pid : Cardinal) : longint;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_kill';
Function mysql_stat(mysql : PMYSQL) : Pchar;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_stat';
Function mysql_get_server_info(mysql : PMYSQL) : pchar;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_get_server_info';
Function mysql_get_client_info : pchar;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib;
Function mysql_get_host_info(mysql : PMYSQL) : pchar;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_get_host_info';
Function mysql_get_proto_info(mysql : PMYSQL) : Cardinal;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_get_proto_info';
Function mysql_list_dbs(mysql : PMYSQL;wild : Pchar) : PMYSQL_RES;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_list_dbs';
Function mysql_list_tables(mysql : PMYSQL;Wild : Pchar) : PMYSQL_RES;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_list_tables';
Function mysql_list_fields(mysql : PMYSQL; table,wild : pchar) : PMYSQL_RES;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_list_fields';
Function mysql_list_processes(mysql : PMYSQL) : PMYSQL_RES;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_list_processes';
Function mysql_store_result(mysql : PMYSQL) : PMYSQL_RES;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_store_result';
Function mysql_use_result(mysql : PMYSQL) : PMYSQL_RES;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_use_result';
Procedure mysql_free_result(res : PMYSQL_RES);{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_free_result';
Procedure mysql_data_seek(mysql : PMYSQL_RES; offs : cardinal);{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_data_seek';
Function mysql_row_seek(mysql : PMYSQL_RES; Offs: TMYSQL_ROW_OFFSET): TMYSQL_ROW_OFFSET;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_row_seek';
Function mysql_field_seek(musql : PMYSQL_RES;offs : TMYSQL_FIELD_OFFSET): TMYSQL_FIELD_OFFSET;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_field_seek';
function mysql_fetch_row(mysql : PMYSQL_RES) : TMYSQL_ROW;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_fetch_row';
function mysql_fetch_lengths(mysql : PMYSQL_RES) : PCardinal;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_fetch_lengths';
function mysql_fetch_field(handle : PMYSQL_RES) : PMYSQL_FIELD;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_fetch_field';
Function mysql_escape_string(escto,escfrom : pchar; length : Cardinal) : cardinal;{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_escape_string';
Procedure mysql_debug(debug : pchar);{$ifdef win32}stdcall{$else}cdecl{$endif}; external mysqllib name 'mysql_debug';
Function mysql_error(mysql : PMYSQL) : pchar;
begin
mysql_error:=mysql^.net.last_error
end;
Function mysql_num_rows (res : PMYSQL_RES) : my_ulonglong;
begin
mysql_num_rows:=res^.row_count
end;
Function mysql_num_fields(res : PMYSQL_RES) : Cardinal;
begin
mysql_num_fields:=res^.field_count
end;
Function mysql_eof(res : PMYSQL_RES) : my_bool;
begin
mysql_eof:=res^.eof
end;
Function mysql_fetch_field_direct(res : PMYSQL_RES; fieldnr : Cardinal) : TMYSQL_FIELD;
begin
mysql_fetch_field_direct:=res^.fields[fieldnr];
end;
Function mysql_fetch_fields(res : PMYSQL_RES) : PMYSQL_FIELD;
begin
mysql_fetch_fields:=res^.fields
end;
Function mysql_row_tell(res : PMYSQL_RES) : PMYSQL_ROWS;
begin
mysql_row_tell:=res^.data_cursor
end;
Function mysql_field_tell(res : PMYSQL_RES) : Cardinal;
begin
mysql_field_tell:=res^.current_field
end;
Function mysql_affected_rows(mysql : PMYSQL): my_ulonglong;
begin
mysql_affected_rows:=mysql^.affected_rows
end;
Function mysql_insert_id(mysql : PMYSQL): my_ulonglong;
begin
mysql_insert_id:=mysql^.insert_id
end;
Function mysql_errno(mysql : PMYSQL) : Cardinal;
begin
mysql_errno:=mysql^.net.last_errno
end;
Function mysql_info(mysql : PMYSQL): Pchar;
begin
mysql_info:=mysql^.info
end;
Function mysql_reload(mysql : PMYSQL) : Longint;
begin
mysql_reload:=mysql_refresh(mysql,REFRESH_GRANT)
end;
Function mysql_thread_id(mysql : PMysql) : Cardinal;
begin
mysql_thread_id:=mysql^.thread_id
end;
end.

View File

@ -1,291 +0,0 @@
unit mysql_com;
{$undef use_mysql_321} { if undefined, use mysql 3.23 interface }
{ updated to match version 3.23 header files of mysql by Bernhard Steffen
(bernhard.steffen@gmx.net)
}
interface
uses
mysql_version;
{$ifdef win32}
Const mysqllib = 'libmysql';
{$else}
Const mysqllib = 'mysqlclient';
{$endif}
{$ifndef win32}
{$linklib c}
{$linklib m}
{$linklib mysqlclient}
{$endif}
{$r+,i+,o+}
{
Common definition between mysql server & client
}
{$packrecords 4}
{ Extra types introduced for pascal }
Type
pbyte = ^byte;
pcardinal = ^cardinal;
Socket = longint;
my_bool = byte;
Const
NAME_LEN = 64 ; { Field/table name length }
LOCAL_HOST : pchar = 'localhost' ;
MYSQL_PORT = 3306; { Alloced by ISI for MySQL }
MYSQL_UNIX_ADDR : pchar = '/tmp/mysql.sock';
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);
Const
NOT_NULL_FLAG = 1; { Field can't be NULL }
PRI_KEY_FLAG = 2; { Field is part of a primary key }
UNIQUE_KEY_FLAG = 4; { Field is part of a unique key }
MULTIPLE_KEY_FLAG = 8; { Field is part of a key }
BLOB_FLAG = 16; { Field is a blob }
UNSIGNED_FLAG = 32; { Field is unsigned }
ZEROFILL_FLAG = 64; { Field is zerofill }
BINARY_FLAG = 128;
{ The following are only sent to new clients }
ENUM_FLAG = 256; { field is an enum }
AUTO_INCREMENT_FLAG = 512; { field is a autoincrement field }
TIMESTAMP_FLAG = 1024; { Field is a timestamp }
PART_KEY_FLAG = 16384; { Intern; Part of some key }
GROUP_FLAG = 32768; { Intern group field }
{$ifndef use_mysql_321}
UNIQUE_FLAG = 65536; { Intern: Used by sql_yacc }
{$endif}
REFRESH_GRANT = 1; { Refresh grant tables }
REFRESH_LOG = 2; { Start on new log file }
REFRESH_TABLES = 4; { close all tables }
{$ifndef use_mysql_321}
REFRESH_HOSTS = 8; { Flush host cache }
REFRESH_STATUS = 16; { Flush status variables }
REFRESH_THREADS = 32; { Flush status variables }
REFRESH_SLAVE = 64; { Reset master info and restart slave
thread }
REFRESH_MASTER = 128; { Remove all bin logs in the index
and truncate the index }
{$endif}
{$ifndef use_mysql_321}
{ The following can't be set with mysql_refresh() }
REFRESH_READ_LOCK = 16384; { Lock tables for read }
REFRESH_FAST = 32768; { Intern flag }
{$endif}
CLIENT_LONG_PASSWORD = 1; { new more secure passwords }
CLIENT_FOUND_ROWS = 2; { Found instead of affected rows }
CLIENT_LONG_FLAG = 4; { Get all column flags }
{$ifndef use_mysql_321}
CLIENT_CONNECT_WITH_DB = 8; { One can specify db on connect }
CLIENT_NO_SCHEMA = 16; { Don't allow database.table.column }
CLIENT_COMPRESS = 32; { Can use compression protocol }
CLIENT_ODBC = 64; { Odbc client }
CLIENT_LOCAL_FILES = 128; { Can use LOAD DATA LOCAL }
CLIENT_IGNORE_SPACE = 256; { Ignore spaces before '(' }
CLIENT_CHANGE_USER = 512; { Support the mysql_change_user() }
CLIENT_INTERACTIVE = 1024; { This is an interactive client }
CLIENT_SSL = 2048; { Switch to SSL after handshake }
CLIENT_IGNORE_SIGPIPE = 4096; { IGNORE sigpipes }
CLIENT_TRANSACTIONS = 8192; { Client knows about transactions }
SERVER_STATUS_IN_TRANS = 1; { Transaction has started }
SERVER_STATUS_AUTOCOMMIT = 2; { Server in auto_commit mode }
{$endif}
MYSQL_ERRMSG_SIZE = 200;
NET_READ_TIMEOUT = 30; { Timeout on read }
NET_WRITE_TIMEOUT = 60; { Timeout on write }
NET_WAIT_TIMEOUT = 8*60*60; { Wait for new query }
Type
pst_used_mem = ^st_used_mem;
st_used_mem = record { struct for once_alloc }
next : pst_used_mem; { Next block in use }
left : cardinal; { memory left in block }
size : cardinal; { size of block }
end;
TUSED_MEM = st_used_mem;
PUSED_MEM = ^TUSED_MEM;
TError_handler = Procedure;
st_mem_root = record
free : PUSED_MEM;
used : PUSED_MEM;
{$ifndef use_mysql_321}
pre_alloc: PUSED_MEM;
{$endif use_mysql_321}
min_malloc : cardinal;
block_size : cardinal;
error_handler : TERROR_Handler;
end;
TMEM_ROOT = st_mem_root;
PMEM_ROOT = ^TMEM_ROOT;
Type
net_type = (NET_TYPE_TCPIP, NET_TYPE_SOCKET, NETTYPE_NAMEDPIPE);
st_net = record
nettype : net_type; //DT
fd : Socket;
fcntl : Longint;
buff,buff_end,write_pos,read_pos : Pchar;//DT
last_error : array [0..MYSQL_ERRMSG_SIZE-1] of char;
last_errno,max_packet,timeout,pkt_nr : Cardinal;
error,return_errno : my_bool;
compress : my_bool; //DT
{$ifndef use_mysql_321}
no_send_ok : my_bool;
{$endif}
remain_in_buf,r_length, buf_length, where_b : cardinal; //DT
{$ifndef use_mysql_321}
return_status : ^Cardinal;
reading_or_writing : my_bool;
{$else}
more : my_bool;//DT
{$endif}
save_char : char; //DT
end;
TNET = st_net;
PNET = ^TNET;
Const
packet_error : longint = -1;
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,
{$ifndef use_mysql_321}
FIELD_TYPE_YEAR,
FIELD_TYPE_NEWDATE,
{$endif}
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);
Const
FIELD_TYPE_CHAR = FIELD_TYPE_TINY; { For compability }
FIELD_TYPE_INTERVAL = FIELD_TYPE_ENUM; { For compability }
Procedure sql_free (root : PMEM_ROOT);stdcall;
Procedure init_alloc_root (root: PMEM_ROOT;block_size : Cardinal);stdcall;
Function sql_alloc_first_block(root : PMEM_ROOT) : my_bool;stdcall;
Function sql_alloc_root(mem_root : PMEM_ROOT;len : Cardinal) : longint;stdcall;
Function sql_strdup_root(root : PMEM_ROOT;st : pchar) : pchar;stdcall;
Function sql_memdup_root(root: PMEM_ROOT;st : pchar; len : Cardinal): longint;stdcall;
{
extern unsigned long max_allowed_packet;
extern unsigned long net_buffer_length;
}
{
#define net_new_transaction(net) ((net)->pkt_nr=0)
}
Function my_net_init(net :PNET; fd : Socket) : Longint;stdcall;
procedure net_end(net : PNET);stdcall;
Procedure net_clear(net : PNET);stdcall;
Function net_flush(net : PNET) : longint;stdcall;
Function my_net_write(net : PNET;packet : pbyte;len : cardinal) : longint;stdcall;
Function net_write_command(net : PNET; command : char;packet : pbyte;len : cardinal) : longint;stdcall;
Function net_real_write(net : PNET;packet : pbyte; len : Cardinal) : longint;stdcall;
Function my_net_read(net : PNET) : Cardinal;stdcall;
Type
TRand_struct = record
seed,seed2,max_value : Cardinal;
max_value_dbl : double;
end;
PRand_struct = ^TRand_struct;
{ The following is for user defined functions }
Item_result = (STRING_RESULT,REAL_RESULT,INT_RESULT);
st_udf_args = record
arg_count : cardinal; { Number of arguments }
arg_type : ^Item_result; { Pointer to item_results }
args : ppchar; { Pointer to argument }
lengths : PCardinal; { Length of string arguments }
end;
TUDF_ARGS = st_udf_args;
PUDPF_ARGS = ^TUDF_ARGS;
{ This holds information about the result }
st_udf_init = record
maybe_null : my_bool; { 1 if function can return NULL }
decimals : cardinal; { for real functions }
max_length : Cardinal; { For string functions }
ptr : PChar; { free pointer for function data }
end;
TUDF_INIT = st_udf_init;
PUDF_INIT = TUDF_INIT;
{ Prototypes to password functions }
procedure randominit(rand : Prand_struct; seed1,seed2 : Cardinal);stdcall;
Function rnd(rand : Prand_struct) : double;stdcall;
procedure make_scrambled_password(toarg, passwd : Pchar);stdcall;
procedure get_salt_from_password(res : pcardinal; password : pchar);stdcall;
procedure scramble(toarg,message,password : pchar; old_ver : my_bool);stdcall;
function check_scramble(scramble,message : pchar; salt : cardinal;old_ver:my_bool) : my_bool;stdcall;
function get_tty_password(opt_message: pchar) : pchar;stdcall;
{
#define NULL_LENGTH ((unsigned long) ~0) { For net_store_length }
}
implementation
Procedure sql_free (root : PMEM_ROOT);stdcall;external;
Procedure init_alloc_root (root: PMEM_ROOT;block_size : Cardinal);stdcall;external;
Function sql_alloc_first_block(root : PMEM_ROOT) : my_bool;stdcall;external;
Function sql_alloc_root(mem_root : PMEM_ROOT;len : Cardinal) : longint;stdcall;external;
Function sql_strdup_root(root : PMEM_ROOT;st : pchar) : pchar;stdcall;external;
Function sql_memdup_root(root: PMEM_ROOT;st : pchar; len : Cardinal) : longint;stdcall;external;
Function my_net_init(net :PNET; fd : Socket) : Longint;stdcall;external;
procedure net_end(net : PNET);stdcall;external;
Procedure net_clear(net : PNET);stdcall;external;
Function net_flush(net : PNET) : longint;stdcall;external;
Function my_net_write(net : PNET;packet : pbyte;len : cardinal) : longint;stdcall;external;
Function net_write_command(net : PNET; command : char;packet : pbyte;len : cardinal) : longint;stdcall;external;
Function net_real_write(net : PNET;packet : pbyte; len : Cardinal) : longint;stdcall;external;
Function my_net_read(net : PNET) : Cardinal;stdcall;external;
procedure randominit(rand : Prand_struct; seed1,seed2 : Cardinal);stdcall;external;
Function rnd(rand : Prand_struct) : double;stdcall;external;
procedure make_scrambled_password(toarg, passwd : Pchar);stdcall;external;
procedure get_salt_from_password(res : pcardinal; password : pchar);stdcall;external;
procedure scramble(toarg,message,password : pchar; old_ver : my_bool);stdcall;external;
function check_scramble(scramble,message : pchar; salt : cardinal;old_ver:my_bool) : my_bool;stdcall;external;
function get_tty_password(opt_message: pchar) : pchar;stdcall;external;
end.

View File

@ -1,32 +0,0 @@
unit mysql_version;
{$undef use_mysql_321} { if undefined, use mysql 3.23 interface }
{
Translated from mysql_version.h by Michael Van Canneyt
(michael@tfdec1.fys.kuleuven.ac.be)
updated to match version 3.23 header files of mysql by Bernhard Steffen
(bernhard.steffen@gmx.net)
}
interface
{ Version numbers for protocol & mysqld }
Const
{$ifdef use_mysql_321}
MYSQL_SERVER_VERSION : pchar ='3.21.28-gamma';
FRM_VER = 6;
MYSQL_VERSION_ID =32128;
{$else}
MYSQL_SERVER_VERSION : pchar ='3.23.34';
FRM_VER = 6; { ??? }
MYSQL_VERSION_ID =32334;
{$endif}
implementation
end.

View File

@ -1,18 +0,0 @@
program mysqls;
uses mysql,mysql_com;
begin
Writeln('PASCAL');
Writeln ('MYSQL : ',sizeof(TMYSQL),' options : ',sizeof(st_mysql_options));
writeln ('MYSQL_DATA : ',sizeof(TMYSQL_DATA));
writeln ('MYSQL_ROWS : ',sizeof(TMYSQL_ROWS));
writeln ('MYSQL_ROW : ',sizeof(TMYSQL_ROW));
writeln ('MYSQL_FIELD : ',sizeof(TMYSQL_FIELD));
writeln ('MYSQL_RES : ',sizeof(TMYSQL_RES));
writeln ('MEM_ROOT : ',sizeof(TMEM_ROOT));
writeln ('my_bool : ',sizeof(my_bool));
writeln ('TNET : ',sizeof(TNET),' TNET.nettype : ',SizeOf(net_type));
writeln ('USED_MEM : ',sizeof(TUSED_MEM));
end.

View File

@ -1,409 +0,0 @@
unit mysql;
interface
uses mysql_com;
{
Automatically converted by H2Pas 0.99.15 from mysql.ph
The following command line parameters were used:
-p
-D
-l
mysqlclient
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
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 }
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;
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';
procedure mysql_server_end;cdecl;external External_library name 'mysql_server_end';
function mysql_thread_init:my_bool;cdecl;external External_library name 'mysql_thread_init';
procedure mysql_thread_end;cdecl;external External_library name 'mysql_thread_end';
function mysql_num_rows(res:PMYSQL_RES):my_ulonglong;cdecl;external External_library name 'mysql_num_rows';
function mysql_num_fields(res:PMYSQL_RES):dword;cdecl;external External_library name 'mysql_num_fields';
function mysql_eof(res:PMYSQL_RES):my_bool;cdecl;external External_library name 'mysql_eof';
function mysql_fetch_field_direct(res:PMYSQL_RES; fieldnr:dword):PMYSQL_FIELD;cdecl;external External_library name 'mysql_fetch_field_direct';
function mysql_fetch_fields(res:PMYSQL_RES):PMYSQL_FIELD;cdecl;external External_library name 'mysql_fetch_fields';
function mysql_row_tell(res:PMYSQL_RES):PMYSQL_ROWS;cdecl;external External_library name 'mysql_row_tell';
function mysql_field_tell(res:PMYSQL_RES):dword;cdecl;external External_library name 'mysql_field_tell';
function mysql_field_count(mysql:PMYSQL):dword;cdecl;external External_library name 'mysql_field_count';
function mysql_affected_rows(mysql:PMYSQL):my_ulonglong;cdecl;external External_library name 'mysql_affected_rows';
function mysql_insert_id(mysql:PMYSQL):my_ulonglong;cdecl;external External_library name 'mysql_insert_id';
function mysql_errno(mysql:PMYSQL):dword;cdecl;external External_library name 'mysql_errno';
function mysql_error(mysql:PMYSQL):Pchar;cdecl;external External_library name 'mysql_error';
function mysql_info(mysql:PMYSQL):Pchar;cdecl;external External_library name 'mysql_info';
function mysql_thread_id(mysql:PMYSQL):dword;cdecl;external External_library name 'mysql_thread_id';
function mysql_character_set_name(mysql:PMYSQL):Pchar;cdecl;external External_library name 'mysql_character_set_name';
function mysql_init(mysql:PMYSQL):PMYSQL;cdecl;external External_library name 'mysql_init';
function mysql_ssl_set(mysql:PMYSQL; key:Pchar; cert:Pchar; ca:Pchar; capath:Pchar;
cipher:Pchar):longint;cdecl;external External_library name 'mysql_ssl_set';
function mysql_ssl_clear(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_ssl_clear';
function mysql_change_user(mysql:PMYSQL; user:Pchar; passwd:Pchar; db:Pchar):my_bool;cdecl;external External_library name 'mysql_change_user';
function mysql_real_connect(mysql:PMYSQL; host:Pchar; user:Pchar; passwd:Pchar; db:Pchar;
port:dword; unix_socket:Pchar; clientflag:dword):PMYSQL;cdecl;external External_library name 'mysql_real_connect';
procedure mysql_close(sock:PMYSQL);cdecl;external External_library name 'mysql_close';
function mysql_select_db(mysql:PMYSQL; db:Pchar):longint;cdecl;external External_library name 'mysql_select_db';
function mysql_query(mysql:PMYSQL; q:Pchar):longint;cdecl;external External_library name 'mysql_query';
function mysql_send_query(mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;external External_library name 'mysql_send_query';
function mysql_read_query_result(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_read_query_result';
function mysql_real_query(mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;external External_library name 'mysql_real_query';
function mysql_master_query(mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;external External_library name 'mysql_master_query';
function mysql_master_send_query(mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;external External_library name 'mysql_master_send_query';
function mysql_slave_query(mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;external External_library name 'mysql_slave_query';
function mysql_slave_send_query(mysql:PMYSQL; q:Pchar; length:dword):longint;cdecl;external External_library name 'mysql_slave_send_query';
procedure mysql_enable_rpl_parse(mysql:PMYSQL);cdecl;external External_library name 'mysql_enable_rpl_parse';
procedure mysql_disable_rpl_parse(mysql:PMYSQL);cdecl;external External_library name 'mysql_disable_rpl_parse';
function mysql_rpl_parse_enabled(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_rpl_parse_enabled';
procedure mysql_enable_reads_from_master(mysql:PMYSQL);cdecl;external External_library name 'mysql_enable_reads_from_master';
procedure mysql_disable_reads_from_master(mysql:PMYSQL);cdecl;external External_library name 'mysql_disable_reads_from_master';
function mysql_reads_from_master_enabled(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_reads_from_master_enabled';
(* error
enum mysql_rpl_type mysql_rpl_query_type(const char* q, int len);
in declaration at line 291 *)
function mysql_rpl_probe(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_rpl_probe';
function mysql_set_master(mysql:PMYSQL; host:Pchar; port:dword; user:Pchar; passwd:Pchar):longint;cdecl;external External_library name 'mysql_set_master';
function mysql_add_slave(mysql:PMYSQL; host:Pchar; port:dword; user:Pchar; passwd:Pchar):longint;cdecl;external External_library name 'mysql_add_slave';
function mysql_shutdown(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_shutdown';
function mysql_dump_debug_info(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_dump_debug_info';
function mysql_refresh(mysql:PMYSQL; refresh_options:dword):longint;cdecl;external External_library name 'mysql_refresh';
function mysql_kill(mysql:PMYSQL; pid:dword):longint;cdecl;external External_library name 'mysql_kill';
function mysql_ping(mysql:PMYSQL):longint;cdecl;external External_library name 'mysql_ping';
function mysql_stat(mysql:PMYSQL):Pchar;cdecl;external External_library name 'mysql_stat';
function mysql_get_server_info(mysql:PMYSQL):Pchar;cdecl;external External_library name 'mysql_get_server_info';
function mysql_get_client_info:Pchar;cdecl;external External_library name 'mysql_get_client_info';
function mysql_get_host_info(mysql:PMYSQL):Pchar;cdecl;external External_library name 'mysql_get_host_info';
function mysql_get_proto_info(mysql:PMYSQL):dword;cdecl;external External_library name 'mysql_get_proto_info';
function mysql_list_dbs(mysql:PMYSQL; wild:Pchar):PMYSQL_RES;cdecl;external External_library name 'mysql_list_dbs';
function mysql_list_tables(mysql:PMYSQL; wild:Pchar):PMYSQL_RES;cdecl;external External_library name 'mysql_list_tables';
function mysql_list_fields(mysql:PMYSQL; table:Pchar; wild:Pchar):PMYSQL_RES;cdecl;external External_library name 'mysql_list_fields';
function mysql_list_processes(mysql:PMYSQL):PMYSQL_RES;cdecl;external External_library name 'mysql_list_processes';
function mysql_store_result(mysql:PMYSQL):PMYSQL_RES;cdecl;external External_library name 'mysql_store_result';
function mysql_use_result(mysql:PMYSQL):PMYSQL_RES;cdecl;external External_library name 'mysql_use_result';
function mysql_options(mysql:PMYSQL; option:mysql_option; arg:Pchar):longint;cdecl;external External_library name 'mysql_options';
procedure mysql_free_result(result:PMYSQL_RES);cdecl;external External_library name 'mysql_free_result';
procedure mysql_data_seek(result:PMYSQL_RES; offset:my_ulonglong);cdecl;external External_library name 'mysql_data_seek';
function mysql_row_seek(result:PMYSQL_RES; _para2:MYSQL_ROW_OFFSET):MYSQL_ROW_OFFSET;cdecl;external External_library name 'mysql_row_seek';
function mysql_field_seek(result:PMYSQL_RES; offset:MYSQL_FIELD_OFFSET):MYSQL_FIELD_OFFSET;cdecl;external External_library name 'mysql_field_seek';
function mysql_fetch_row(result:PMYSQL_RES):MYSQL_ROW;cdecl;external External_library name 'mysql_fetch_row';
function mysql_fetch_lengths(result:PMYSQL_RES):Pdword;cdecl;external External_library name 'mysql_fetch_lengths';
function mysql_fetch_field(result:PMYSQL_RES):PMYSQL_FIELD;cdecl;external External_library name 'mysql_fetch_field';
function mysql_escape_string(_to:Pchar; from:Pchar; from_length:dword):dword;cdecl;external External_library name 'mysql_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';
Type
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';
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_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';
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_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 net_safe_read(mysql:PMYSQL):dword;cdecl;external External_library name 'net_safe_read';
implementation
function IS_PRI_KEY(n : longint) : Boolean;
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.

View File

@ -1,336 +0,0 @@
unit mysql_com;
interface
{
Automatically converted by H2Pas 0.99.15 from mysql_com.ph
The following command line parameters were used:
-p
-D
-l
mysqlclient
mysql_com.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;
{ Extra manually added types }
PVIO = Pointer;
My_socket = longint;
my_bool = byte;
pppchar = ^PPChar;
gptr = Pointer;
{$PACKRECORDS C}
{ 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 }
{
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';
procedure net_end(net:PNET);cdecl;external External_library name 'net_end';
procedure net_clear(net:PNET);cdecl;external External_library name 'net_clear';
function net_flush(net:PNET):longint;cdecl;external External_library name 'net_flush';
(* Const before type ignored *)
function my_net_write(net:PNET; packet:Pchar; len:dword):longint;cdecl;external External_library name 'my_net_write';
(* Const before type ignored *)
function net_write_command(net:PNET; command:byte; packet:Pchar; len:dword):longint;cdecl;external External_library name 'net_write_command';
(* Const before type ignored *)
function net_real_write(net:PNET; packet:Pchar; len:dword):longint;cdecl;external External_library name 'net_real_write';
function my_net_read(net:PNET):dword;cdecl;external External_library name 'my_net_read';
{ 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);
}
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';
function rnd(_para1:Prand_struct):double;cdecl;external External_library name 'rnd';
(* Const before type ignored *)
procedure make_scrambled_password(_to:Pchar; password:Pchar);cdecl;external External_library name 'make_scrambled_password';
(* Const before type ignored *)
procedure get_salt_from_password(res:Pdword; password:Pchar);cdecl;external External_library name 'get_salt_from_password';
procedure make_password_from_salt(_to:Pchar; hash_res:Pdword);cdecl;external External_library name 'make_password_from_salt';
(* Const before type ignored *)
(* Const before type ignored *)
function scramble(_to:Pchar; message:Pchar; password:Pchar; old_ver:my_bool):Pchar;cdecl;external External_library name 'scramble';
(* Const before type ignored *)
(* Const before type ignored *)
function check_scramble(_para1:Pchar; message:Pchar; salt:Pdword; old_ver:my_bool):my_bool;cdecl;external External_library name 'check_scramble';
function get_tty_password(opt_message:Pchar):Pchar;cdecl;external External_library name 'get_tty_password';
(* Const before type ignored *)
procedure hash_password(result:Pdword; password:Pchar);cdecl;external External_library name 'hash_password';
{ Some other useful functions }
procedure my_init;cdecl;external External_library name 'my_init';
(* Const before type ignored *)
(* Const before type ignored *)
procedure load_defaults(conf_file:Pchar; groups:PPchar; argc:Plongint; argv:PPPchar);cdecl;external External_library name 'load_defaults';
function my_thread_init:my_bool;cdecl;external External_library name 'my_thread_init';
procedure my_thread_end;cdecl;external External_library name 'my_thread_end';
{ For net_store_length }
{ was #define dname def_expr }
function NULL_LENGTH : dword;
implementation
{ was #define dname def_expr }
function packet_error : longint;
{ return type might be wrong }
begin
packet_error:= not (dword(0));
end;
{ was #define dname def_expr }
function NULL_LENGTH : dword;
begin
NULL_LENGTH:=dword( not (0));
end;
end.

View File

@ -1,46 +0,0 @@
unit mysql_version;
interface
{
Automatically converted by H2Pas 0.99.15 from mysql_version.ph
The following command line parameters were used:
-p
-D
-l
mysqlclient
mysql_version.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 Abandoned 1996, 1999, 2001 MySQL AB
This file is public domain and comes with NO WARRANTY of any kind }
{ Version numbers for protocol & mysqld }
const
PROTOCOL_VERSION = 10;
MYSQL_SERVER_VERSION = '4.0.1-alpha';
MYSQL_SERVER_SUFFIX = '-max';
FRM_VER = 6;
MYSQL_VERSION_ID = 40001;
MYSQL_PORT = 3306;
MYSQL_UNIX_ADDR = '/tmp/mysql.sock';
{ mysqld compile time options }
MYSQL_CHARSET = 'latin1';
implementation
end.