📄 mysqldrivers.hpp
字号:
// Borland C++ Builder
// Copyright (c) 1995, 2002 by Borland Software Corporation
// All rights reserved
// (DO NOT EDIT: machine generated header) 'MySQLDrivers.pas' rev: 6.00
#ifndef MySQLDriversHPP
#define MySQLDriversHPP
#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Windows.hpp> // Pascal unit
#include <DB.hpp> // Pascal unit
#include <Classes.hpp> // Pascal unit
#include <SysUtils.hpp> // Pascal unit
#include <SysInit.hpp> // Pascal unit
#include <System.hpp> // Pascal unit
//-- user supplied -----------------------------------------------------------
namespace Mysqldrivers
{
//-- type declarations -------------------------------------------------------
typedef Byte enum_field_types;
#pragma pack(push, 1)
struct TMYSQL_FIELD
{
char *name;
char *org_name;
char *table;
char *org_table;
char *db;
char *catalog;
char *def;
unsigned length;
unsigned max_length;
unsigned name_length;
unsigned org_name_length;
unsigned table_length;
unsigned org_table_length;
unsigned db_length;
unsigned catalog_length;
unsigned def_length;
unsigned flags;
unsigned decimals;
unsigned charsetnr;
enum_field_types _type;
} ;
#pragma pack(pop)
typedef char *TMYSQL_ROW[536870911];
typedef char * *PMYSQL_ROW;
typedef unsigned TMYSQL_LENGTHS[536870911];
typedef unsigned *PMYSQL_LENGTHS;
#pragma option push -b-
enum 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_OPT_LOCAL_INFILE, MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT, MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT, MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH, MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT };
#pragma option pop
class DELPHICLASS TMySQLBase;
class PASCALIMPLEMENTATION TMySQLBase : public Classes::TPersistent
{
typedef Classes::TPersistent inherited;
private:
void *FConnection;
bool FDriverLoaded;
int FClientVer;
int FServerVer;
AnsiString FReserved;
void * __stdcall (*mysql_init)(void * mysql);
int __stdcall (*mysql_options)(void * mysql, mysql_option option, const char * arg);
void * __stdcall (*mysql_real_connect)(void * mysql, const char * host, const char * user, const char * passwd, const char * db, unsigned port, const char * unix_socket, unsigned clientflag);
void __stdcall (*mysql_close)(void * sock);
unsigned __stdcall (*mysql_errno)(void * mysql);
char * __stdcall (*mysql_error)(void * mysql);
char * __stdcall (*mysql_get_host_info)(void * mysql);
char * __stdcall (*mysql_get_client_info)(void);
char * __stdcall (*mysql_get_server_info)(void * mysql);
unsigned __stdcall (*mysql_get_proto_info)(void * mysql);
int __stdcall (*mysql_ping)(void * mysql);
unsigned __stdcall (*mysql_thread_id)(void * mysql);
int __stdcall (*mysql_kill)(void * mysql, unsigned pid);
char * __stdcall (*mysql_info)(void * mysql);
int __stdcall (*mysql_create_db)(void * mysql, const char * DB);
int __stdcall (*mysql_select_db)(void * mysql, const char * db);
int __stdcall (*mysql_drop_db)(void * mysql, const char * DB);
int __stdcall (*mysql_real_query)(void * mysql, const char * q, unsigned length);
void * __stdcall (*mysql_use_result)(void * mysql);
void __stdcall (*mysql_free_result)(void * res);
unsigned __stdcall (*mysql_num_fields)(void * res);
__int64 __stdcall (*mysql_num_rows)(void * res);
PMYSQL_LENGTHS __stdcall (*mysql_fetch_lengths)(void * res);
void * __stdcall (*mysql_fetch_field)(void * res);
PMYSQL_ROW __stdcall (*mysql_fetch_row)(void * res);
unsigned __stdcall (*mysql_real_escape_string)(void * mysql, char * _to, const char * from, unsigned length);
__int64 __stdcall (*mysql_insert_id)(void * mysql);
int __stdcall (*mysql_refresh)(void * mysql, unsigned refresh_options);
__int64 __stdcall (*mysql_affected_rows)(void * mysql);
protected:
Classes::TStrings* FOptions;
virtual void * __fastcall GetConnection(void);
virtual void __fastcall SetOptions(Classes::TStrings* Value);
virtual void __fastcall Load(void);
virtual void __fastcall UnLoad(void);
virtual void __fastcall BindProc(void * &Proc, int Handle, const AnsiString Name);
virtual void __fastcall Bind(void);
public:
__fastcall virtual TMySQLBase(const AnsiString AOptions);
__fastcall virtual ~TMySQLBase(void);
virtual int __fastcall ErrorNo(void * Conn);
virtual AnsiString __fastcall ErrorMsg(void * Conn);
virtual void * __fastcall Open(const AnsiString AHost = "localhost", const AnsiString AUser = "root", const AnsiString APass = "", const int APort = 0xcea, const int AOptions = 0x0, const AnsiString ADB = "");
virtual AnsiString __fastcall Info();
virtual void __fastcall Close(void * &Conn);
virtual AnsiString __fastcall ClientInfo();
virtual AnsiString __fastcall HostInfo(void * Conn);
virtual AnsiString __fastcall ServerInfo(void * Conn);
virtual unsigned __fastcall ProtoInfo(void * Conn);
virtual bool __fastcall Ping(void * Conn);
virtual unsigned __fastcall ThreadID(void * Conn);
virtual void __fastcall Kill(void * Conn, const unsigned PID);
virtual AnsiString __fastcall QueryInfo(void * Conn);
virtual bool __fastcall CreateDatabase(void * Conn, const AnsiString DB = "");
virtual bool __fastcall SelectDatabase(void * Conn, const AnsiString DB = "");
virtual bool __fastcall DropDatabase(void * Conn, const AnsiString DB = "");
virtual void * __fastcall OpenQuery(void * Conn, const AnsiString SQL = "");
virtual void __fastcall CloseQuery(void * &Res);
virtual unsigned __fastcall RetrieveColCount(void * Res);
virtual __int64 __fastcall RetrieveRowCount(void * Res);
virtual TMYSQL_FIELD __fastcall RetrieveField(void * Res);
virtual PMYSQL_ROW __fastcall RetrieveRow(void * Res);
virtual PMYSQL_LENGTHS __fastcall RetrieveRowFieldLenghts(void * Res);
virtual AnsiString __fastcall EscapeStr(const AnsiString Value);
virtual bool __fastcall QuoteIdentifier(const AnsiString Value = "");
virtual AnsiString __fastcall FormatIdentifier(const AnsiString Value = "");
virtual bool __fastcall IsReservedWord(const AnsiString Value = "");
virtual AnsiString __fastcall LastInsertID(void * Conn);
virtual AnsiString __fastcall AffectedRows(void * Conn);
virtual bool __fastcall Refresh(void * Conn, const int AOptions = 0x0);
__property void * Connection = {read=GetConnection};
__property int ClientVer = {read=FClientVer, nodefault};
__property int ServerVer = {read=FServerVer, nodefault};
__property bool DriverLoad = {read=FDriverLoaded, nodefault};
__property Classes::TStrings* Options = {read=FOptions, write=FOptions};
};
class DELPHICLASS TMySQLDirect;
class PASCALIMPLEMENTATION TMySQLDirect : public TMySQLBase
{
typedef TMySQLBase inherited;
protected:
virtual void __fastcall Bind(void);
__published:
__property Classes::TStrings* Options = {read=FOptions, write=SetOptions};
public:
#pragma option push -w-inl
/* TMySQLBase.Create */ inline __fastcall virtual TMySQLDirect(const AnsiString AOptions) : TMySQLBase(AOptions) { }
#pragma option pop
#pragma option push -w-inl
/* TMySQLBase.Destroy */ inline __fastcall virtual ~TMySQLDirect(void) { }
#pragma option pop
};
class DELPHICLASS TMySQLLibrary;
class PASCALIMPLEMENTATION TMySQLLibrary : public TMySQLBase
{
typedef TMySQLBase inherited;
private:
AnsiString FClientDLL;
unsigned FDLLHandle;
protected:
virtual AnsiString __fastcall GetClientDLL();
virtual void __fastcall Load(void);
virtual void __fastcall UnLoad(void);
virtual void __fastcall Bind(void);
public:
__fastcall virtual TMySQLLibrary(const AnsiString AOptions);
__fastcall virtual ~TMySQLLibrary(void);
__property unsigned DLLHandle = {read=FDLLHandle, write=FDLLHandle, nodefault};
__published:
__property AnsiString ClientDLL = {read=GetClientDLL, write=FClientDLL};
__property Classes::TStrings* Options = {read=FOptions, write=SetOptions};
};
class DELPHICLASS TMySQLEmbedded;
class PASCALIMPLEMENTATION TMySQLEmbedded : public TMySQLLibrary
{
typedef TMySQLLibrary inherited;
private:
int __stdcall (*mysql_server_init)(int argc, void * argv, void * groups);
void __stdcall (*mysql_server_end)(void);
protected:
virtual AnsiString __fastcall GetClientDLL();
virtual void __fastcall Load(void);
virtual void __fastcall UnLoad(void);
virtual void __fastcall Bind(void);
__published:
__property Classes::TStrings* Options = {read=FOptions, write=SetOptions};
public:
#pragma option push -w-inl
/* TMySQLLibrary.Create */ inline __fastcall virtual TMySQLEmbedded(const AnsiString AOptions) : TMySQLLibrary(AOptions) { }
#pragma option pop
#pragma option push -w-inl
/* TMySQLLibrary.Destroy */ inline __fastcall virtual ~TMySQLEmbedded(void) { }
#pragma option pop
};
class DELPHICLASS EMySQLError;
class PASCALIMPLEMENTATION EMySQLError : public Db::EDatabaseError
{
typedef Db::EDatabaseError inherited;
protected:
int FNo;
public:
__fastcall EMySQLError(int Error, AnsiString Msg);
__property int Error = {read=FNo, nodefault};
public:
#pragma option push -w-inl
/* Exception.CreateFmt */ inline __fastcall EMySQLError(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size) : Db::EDatabaseError(Msg, Args, Args_Size) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateRes */ inline __fastcall EMySQLError(int Ident)/* overload */ : Db::EDatabaseError(Ident) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResFmt */ inline __fastcall EMySQLError(int Ident, const System::TVarRec * Args, const int Args_Size)/* overload */ : Db::EDatabaseError(Ident, Args, Args_Size) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateHelp */ inline __fastcall EMySQLError(const AnsiString Msg, int AHelpContext) : Db::EDatabaseError(Msg, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateFmtHelp */ inline __fastcall EMySQLError(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size, int AHelpContext) : Db::EDatabaseError(Msg, Args, Args_Size, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResHelp */ inline __fastcall EMySQLError(int Ident, int AHelpContext)/* overload */ : Db::EDatabaseError(Ident, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResFmtHelp */ inline __fastcall EMySQLError(System::PResStringRec ResStringRec, const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Db::EDatabaseError(ResStringRec, Args, Args_Size, AHelpContext) { }
#pragma option pop
public:
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~EMySQLError(void) { }
#pragma option pop
};
//-- var, const, procedure ---------------------------------------------------
static const Shortint NOT_NULL_FLAG = 0x1;
static const Shortint PRI_KEY_FLAG = 0x2;
static const Shortint UNIQUE_KEY_FLAG = 0x4;
static const Shortint MULTIPLE_KEY_FLAG = 0x8;
static const Shortint BLOB_FLAG = 0x10;
static const Shortint UNSIGNED_FLAG = 0x20;
static const Shortint ZEROFILL_FLAG = 0x40;
static const Byte BINARY_FLAG = 0x80;
static const Word ENUM_FLAG = 0x100;
static const Word AUTO_INCREMENT_FLAG = 0x200;
static const Word TIMESTAMP_FLAG = 0x400;
static const Word SET_FLAG = 0x800;
static const Word NUM_FLAG = 0x8000;
static const Word PART_KEY_FLAG = 0x4000;
static const Word GROUP_FLAG = 0x8000;
static const int UNIQUE_FLAG = 0x10000;
static const Shortint REFRESH_GRANT = 0x1;
static const Shortint REFRESH_LOG = 0x2;
static const Shortint REFRESH_TABLES = 0x4;
static const Shortint REFRESH_HOSTS = 0x8;
static const Shortint REFRESH_STATUS = 0x10;
static const Shortint REFRESH_THREADS = 0x20;
static const Shortint REFRESH_SLAVE = 0x40;
static const Byte REFRESH_MASTER = 0x80;
static const Word REFRESH_READ_LOCK = 0x4000;
static const Word REFRESH_FAST = 0x8000;
static const Shortint CLIENT_LONG_PASSWORD = 0x1;
static const Shortint CLIENT_FOUND_ROWS = 0x2;
static const Shortint CLIENT_LONG_FLAG = 0x4;
static const Shortint CLIENT_CONNECT_WITH_DB = 0x8;
static const Shortint CLIENT_NO_SCHEMA = 0x10;
static const Shortint CLIENT_COMPRESS = 0x20;
static const Shortint CLIENT_ODBC = 0x40;
static const Byte CLIENT_LOCAL_FILES = 0x80;
static const Word CLIENT_IGNORE_SPACE = 0x100;
static const Word CLIENT_PROTOCOL_41 = 0x200;
static const Word CLIENT_INTERACTIVE = 0x400;
static const Word CLIENT_SSL = 0x800;
static const Word CLIENT_IGNORE_SIGPIPE = 0x1000;
static const Word CLIENT_TRANSACTIONS = 0x2000;
static const Word CLIENT_RESERVED = 0x4000;
static const Word CLIENT_SECURE_CONNECTION = 0x8000;
static const int CLIENT_MULTI_QUERIES = 0x10000;
static const int CLIENT_MULTI_STATEMENTS = 0x10000;
static const int CLIENT_MULTI_RESULTS = 0x20000;
static const Shortint SERVER_STATUS_IN_TRANS = 0x1;
static const Shortint SERVER_STATUS_AUTOCOMMIT = 0x2;
static const Shortint SERVER_STATUS_MORE_RESULTS = 0x4;
static const Shortint SERVER_MORE_RESULTS_EXISTS = 0x8;
static const Byte MYSQL_ERRMSG_SIZE = 0xc8;
static const Shortint NET_READ_TIMEOUT = 0x1e;
static const Shortint NET_WRITE_TIMEOUT = 0x3c;
static const Word NET_WAIT_TIMEOUT = 0x7080;
static const Word MAX_BLOB_WIDTH = 0x2000;
extern PACKAGE unsigned packet_error;
static const Shortint FIELD_TYPE_DECIMAL = 0x0;
static const Shortint FIELD_TYPE_TINY = 0x1;
static const Shortint FIELD_TYPE_SHORT = 0x2;
static const Shortint FIELD_TYPE_LONG = 0x3;
static const Shortint FIELD_TYPE_FLOAT = 0x4;
static const Shortint FIELD_TYPE_DOUBLE = 0x5;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -