amxmodx/dlls/mysqlx/mysql2_header.h

58 lines
1.2 KiB
C
Raw Normal View History

2006-04-23 05:10:06 +04:00
#ifndef _INCLUDE_AMXMODX_MYSQL2_HEADER_H
#define _INCLUDE_AMXMODX_MYSQL2_HEADER_H
#include "MysqlDriver.h"
#include "amxxmodule.h"
#include "ThreadSupport.h"
#include "ThreadWorker.h"
#define MYSQL2_THREADED
struct AmxQueryInfo
{
AmxQueryInfo() : opt_ptr(NULL) { };
2006-04-23 05:10:06 +04:00
IQuery *pQuery;
QueryInfo info;
char error[255];
char *opt_ptr;
2006-04-23 05:10:06 +04:00
};
enum HandleType
{
Handle_Invalid = -1,
Handle_Connection = 0,
Handle_Database,
Handle_Query,
Handle_OldDb,
Handle_OldResult,
2006-04-23 05:10:06 +04:00
};
struct SQL_Connection
{
char *host;
char *user;
char *pass;
char *db;
int port;
unsigned int max_timeout;
2006-04-23 05:10:06 +04:00
};
typedef void (*FREEHANDLE)(void *, unsigned int);
unsigned int MakeHandle(void *ptr, HandleType type, FREEHANDLE f);
void *GetHandle(unsigned int num, HandleType type);
bool FreeHandle(unsigned int num);
void FreeAllHandles(HandleType type);
void FreeHandleTable();
2006-05-08 01:40:12 +04:00
void ShutdownThreading();
2006-05-19 05:54:28 +04:00
int SetMysqlAffinity(AMX *amx);
2006-04-23 05:10:06 +04:00
extern AMX_NATIVE_INFO g_BaseSqlNatives[];
extern AMX_NATIVE_INFO g_ThreadSqlNatives[];
extern AMX_NATIVE_INFO g_OldCompatNatives[];
2006-04-23 05:10:06 +04:00
extern MainThreader g_Threader;
extern ThreadWorker *g_pWorker;
extern SourceMod::MysqlDriver g_Mysql;
#endif //_INCLUDE_AMXMODX_MYSQL2_HEADER_H