/// <Summary> /// Field descriptor /// </Summary> [StructLayout (LayoutKind. Sequential)] // "3.23.32", 4.0.1-alpha Internal class MYSQL_FIELD_VERSION_3: IMYSQL_FIELD { /// <Summary> /// Name of column /// </Summary>Public string name; /// <Summary> /// Table of column if column was a field /// </Summary> Public string table; // Public string org_table;/* Org table name if table was an alias */ // Public string db;/* Database for table */ /// <Summary> /// Def /// </Summary> Public string def; /// <Summary> /// Length /// </Summary> Public long length; /// <Summary> /// Max_length /// </Summary> Public long max_length; /// <Summary> /// Div flags /// </Summary> Public uint flags; /// <Summary> /// Number of decimals in field /// </Summary> Public uint decimals; /// <Summary> /// Type of field. Se mysql_com.h for types /// </Summary> Public uint type; /// <Summary> /// Name /// </Summary> Public string Name { Get {return name ;} } /// <Summary> /// Type /// </Summary> Public uint Type { Get {return type ;} } /// <Summary> /// Max_Length /// </Summary> Public long Max_Length { Get {return max_length ;} } } /// <Summary> /// Field descriptor /// </Summary> [StructLayout (LayoutKind. Sequential)] Internal class MYSQL_FIELD_VERSION_5: IMYSQL_FIELD { /// <Summary> /// Name of column /// </Summary> Public string name; /// <Summary> /// Original column name, if an alias /// </Summary> Public string org_name; /// <Summary> /// Table of column if column was a field /// </Summary> Public string table; /// <Summary> /// Org table name if table was an alias /// </Summary> Public string org_table; /// <Summary> /// Database for table /// </Summary> Public string db; /// <Summary> /// Catalog for table /// </Summary> // Public string catalog; /// <Summary> /// Def /// </Summary> Public string def; /// <Summary> /// Length /// </Summary> Public long length; /// <Summary> /// Max_length /// </Summary> Public long max_length; /// <Summary> /// Name_length /// </Summary> // Public uint name_length; /// <Summary> /// Org_name_length /// </Summary> Public uint org_name_length; /// <Summary> /// Table_length /// </Summary> Public uint table_length; /// <Summary> /// Org_table_length /// </Summary> Public uint org_table_length; /// <Summary> /// Db_length /// </Summary> Public uint db_length; /// <Summary> /// Catalog_length /// </Summary> Public uint catalog_length; /// <Summary> /// Def_length /// </Summary> Public uint def_length; /// <Summary> /// Div flags /// </Summary> Public uint flags; /// <Summary> /// Number of decimals in field /// </Summary> Public uint decimals; /// <Summary> /// Character set /// </Summary> Public uint charsetnr; /// <Summary> /// Type of field. Se mysql_com.h for types /// </Summary> Public uint type; /// <Summary> /// Name /// </Summary> Public string Name { Get {return name ;} } /// <Summary> /// Type /// </Summary> Public uint Type { Get {return type ;} } /// <Summary> /// Max_Length /// </Summary> Public long Max_Length { Get {return max_length ;} } } // [StructLayout (LayoutKind. Explicit)] Public enum 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, Field_type_geometry= 255 }; /// <Summary> /// C prototypes warpper for mysqllib. /// </Summary> Internal class cprototypes { [Dllimport ("libmysql. dll", entrypoint = "mysql_init")] Unsafe public static extern void * mysql_init (void * must_be_null ); [Dllimport ("libmysql. dll", entrypoint = "mysql_close")] Unsafe public static extern void mysql_close (void * handle ); // Begin addition 2004-07-01 by Alex seewald // Enables us to call mysql_option to activate compression and timeout [Dllimport ("libmysql. dll", entrypoint = "mysql_options")] Unsafe public static extern void mysql_options (void * mysql, uint option, uint * value ); // End addition 2004-07-01 By Alex Seewald [DllImport ("libmySQL. dll", EntryPoint = "mysql_real_connect")] Unsafe public static extern void * mysql_real_connect (void * mysql, string host, string user, string passwd, string db, uint port, string unix_socket, int client_flag ); [DllImport ("libmySQL. dll", EntryPoint = "mysql_query")] Unsafe public static extern int mysql_query (void * mysql, string query ); [DllImport ("libmySQL. dll", EntryPoint = "mysql_store_result")] Unsafe public static extern void * mysql_store_result (void * mysql ); [DllImport ("libmySQL. dll", EntryPoint = "mysql_free_result")] Unsafe public static extern void mysql_free_result (void * result ); [DllImport ("libmySQL. dll", EntryPoint = "mysql_errno")] Unsafe public static extern uint mysql_errno (void * mysql ); [DllImport ("libmySQL. dll", EntryPoint = "mysql_error")] Unsafe public static extern string mysql_error (void * mysql ); [DllImport ("libmySQL. dll", EntryPoint = "mysql_field_count")] Unsafe public static extern uint mysql_field_count (void * mysql ); [DllImport ("libmySQL. dll", EntryPoint = "mysql_affected_rows")] Unsafe public static extern ulong mysql_affected_rows (void * mysql ); [DllImport ("libmySQL. dll", EntryPoint = "mysql_num_fields")] Unsafe public static extern uint mysql_num_fields (void * result ); [DllImport ("libmySQL. dll", EntryPoint = "mysql_num_rows")] Unsafe public static extern ulong mysql_num_rows (void * result ); [DllImport ("libmySQL. dll", EntryPoint = "mysql_fetch_field_direct")] Unsafe public static extern IntPtr mysql_fetch_field_direct (void * result, uint fieldnr ); /// <Returns> Returns a string that represents the client library version </returns> [DllImport ("libmySQL. dll", CharSet = System. Runtime. InteropServices. CharSet. Ansi, EntryPoint = "mysql_get_client_info", ExactSpelling = true)] Public static extern string GetClientInfo (); [DllImport ("libmySQL. dll", EntryPoint = "mysql_fetch_row")] Unsafe public static extern IntPtr mysql_fetch_row (void * result ); [DllImport ("libmySQL. dll", EntryPoint = "mysql_select_db")] Unsafe public static extern int mysql_select_db (void * mysql, string dbname ); [DllImport ("libmySQL. dll", EntryPoint = "mysql_fetch_lengths")] Unsafe public static extern UInt32 * mysql_fetch_lengths (void * result ); } } |