mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-07 13:57:48 +00:00
GEEKING
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
#include "SQLite3ClientPlugin.h"
|
||||
#include "MessageIdentifiers.h"
|
||||
#include "BitStream.h"
|
||||
|
||||
using namespace RakNet;
|
||||
|
||||
void SQLite3PluginResultInterface_Printf::_sqlite3_exec(
|
||||
RakNet::RakString inputStatement,
|
||||
unsigned int queryId,
|
||||
RakNet::RakString dbIdentifier,
|
||||
const SQLite3Table &table,
|
||||
RakNet::RakString errorMsg)
|
||||
{
|
||||
|
||||
if (errorMsg.IsEmpty()==false)
|
||||
{
|
||||
printf("Error for query: %s\n", inputStatement.C_String());
|
||||
printf("%s\n", errorMsg.C_String());
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int idx;
|
||||
for (idx=0; idx < table.columnNames.Size(); idx++)
|
||||
printf("%s ", table.columnNames[idx].C_String());
|
||||
printf("\n");
|
||||
if (table.rows.Size()==0)
|
||||
{
|
||||
printf("<NO ROWS>\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (idx=0; idx < table.rows.Size(); idx++)
|
||||
{
|
||||
unsigned int idx2;
|
||||
for (idx2=0; idx2 < table.rows[idx]->entries.Size(); idx2++)
|
||||
printf("%s ", table.rows[idx]->entries[idx2].C_String());
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
void SQLite3PluginResultInterface_Printf::OnUnknownDBIdentifier(
|
||||
RakNet::RakString inputStatement,
|
||||
unsigned int queryId,
|
||||
RakNet::RakString dbIdentifier)
|
||||
{
|
||||
printf("Unknown DB %s\n", dbIdentifier.C_String());
|
||||
}
|
||||
SQLite3ClientPlugin::SQLite3ClientPlugin()
|
||||
{
|
||||
nextQueryId=0;
|
||||
}
|
||||
SQLite3ClientPlugin::~SQLite3ClientPlugin()
|
||||
{
|
||||
}
|
||||
void SQLite3ClientPlugin::AddResultHandler(SQLite3PluginResultInterface *res)
|
||||
{
|
||||
resultHandlers.Push(res,_FILE_AND_LINE_);
|
||||
}
|
||||
void SQLite3ClientPlugin::RemoveResultHandler(SQLite3PluginResultInterface *res)
|
||||
{
|
||||
unsigned int idx = resultHandlers.GetIndexOf(res);
|
||||
if (idx!=-1)
|
||||
resultHandlers.RemoveAtIndex(idx);
|
||||
}
|
||||
void SQLite3ClientPlugin::ClearResultHandlers(void)
|
||||
{
|
||||
resultHandlers.Clear(true,_FILE_AND_LINE_);
|
||||
}
|
||||
unsigned int SQLite3ClientPlugin::_sqlite3_exec(RakNet::RakString dbIdentifier, RakNet::RakString inputStatement,
|
||||
PacketPriority priority, PacketReliability reliability, char orderingChannel, const SystemAddress &systemAddress)
|
||||
{
|
||||
RakNet::BitStream bsOut;
|
||||
bsOut.Write((MessageID)ID_SQLite3_EXEC);
|
||||
bsOut.Write(nextQueryId);
|
||||
bsOut.Write(dbIdentifier);
|
||||
bsOut.Write(inputStatement);
|
||||
bsOut.Write(true);
|
||||
SendUnified(&bsOut, priority,reliability,orderingChannel,systemAddress,false);
|
||||
++nextQueryId;
|
||||
return nextQueryId-1;
|
||||
}
|
||||
|
||||
PluginReceiveResult SQLite3ClientPlugin::OnReceive(Packet *packet)
|
||||
{
|
||||
switch (packet->data[0])
|
||||
{
|
||||
case ID_SQLite3_EXEC:
|
||||
{
|
||||
unsigned int queryId;
|
||||
RakNet::RakString dbIdentifier;
|
||||
RakNet::RakString inputStatement;
|
||||
RakNet::BitStream bsIn(packet->data, packet->length, false);
|
||||
bsIn.IgnoreBytes(sizeof(MessageID));
|
||||
bsIn.Read(queryId);
|
||||
bsIn.Read(dbIdentifier);
|
||||
bsIn.Read(inputStatement);
|
||||
bool isRequest;
|
||||
bsIn.Read(isRequest);
|
||||
if (isRequest)
|
||||
{
|
||||
// Server code
|
||||
RakAssert(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Client code
|
||||
RakNet::RakString errorMsgStr;
|
||||
SQLite3Table inputTable;
|
||||
|
||||
// Read it
|
||||
bsIn.Read(errorMsgStr);
|
||||
inputTable.Deserialize(&bsIn);
|
||||
|
||||
unsigned int idx;
|
||||
for (idx=0; idx < resultHandlers.Size(); idx++)
|
||||
resultHandlers[idx]->_sqlite3_exec(inputStatement, queryId, dbIdentifier, inputTable,errorMsgStr);
|
||||
}
|
||||
|
||||
return RR_STOP_PROCESSING_AND_DEALLOCATE;
|
||||
}
|
||||
break;
|
||||
case ID_SQLite3_UNKNOWN_DB:
|
||||
{
|
||||
unsigned int queryId;
|
||||
RakNet::RakString dbIdentifier;
|
||||
RakNet::RakString inputStatement;
|
||||
RakNet::BitStream bsIn(packet->data, packet->length, false);
|
||||
bsIn.IgnoreBytes(sizeof(MessageID));
|
||||
bsIn.Read(queryId);
|
||||
bsIn.Read(dbIdentifier);
|
||||
bsIn.Read(inputStatement);
|
||||
unsigned int idx;
|
||||
for (idx=0; idx < resultHandlers.Size(); idx++)
|
||||
resultHandlers[idx]->OnUnknownDBIdentifier(inputStatement, queryId, dbIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
return RR_CONTINUE_PROCESSING;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
/// \file
|
||||
/// \brief Contains code to call sqlite3_exec over a network that does not support shared file handles.
|
||||
///
|
||||
/// This file is part of RakNet Copyright 2003 Jenkins Software LLC
|
||||
///
|
||||
/// Usage of RakNet is subject to the appropriate license agreement.
|
||||
|
||||
|
||||
#ifndef ___SQLITE_3_CLIENT_PLUGIN_H
|
||||
#define ___SQLITE_3_CLIENT_PLUGIN_H
|
||||
|
||||
#include "RakNetTypes.h"
|
||||
#include "Export.h"
|
||||
#include "PluginInterface2.h"
|
||||
#include "PacketPriority.h"
|
||||
#include "SocketIncludes.h"
|
||||
#include "DS_Multilist.h"
|
||||
#include "RakString.h"
|
||||
#include "SQLite3PluginCommon.h"
|
||||
|
||||
class RakPeerInterface;
|
||||
|
||||
namespace RakNet
|
||||
{
|
||||
|
||||
/// \brief Handles results of calls to SQLite3Plugin::_sqlite3_exec()
|
||||
/// Results from calling SQLite3Plugin::_sqlite3_exec() are handled in this callback.
|
||||
/// You should implement the callback, and let the plugin know about it via SQLite3Plugin::AddResultHandler()
|
||||
/// Be sure to call SQLite3Plugin::RemoveResultHandler() or SQLite3Plugin::ClearResultHandlers() if you delete the callback
|
||||
/// \ingroup SQL_LITE_3_PLUGIN
|
||||
class SQLite3PluginResultInterface
|
||||
{
|
||||
public:
|
||||
|
||||
/// Query executed, possibly returning data or an error message
|
||||
///
|
||||
/// \param[out] inputStatement Passed to SQLite3Plugin::_sqlite3_exec
|
||||
/// \param[out] queryId Returned from SQLite3Plugin::_sqlite3_exec
|
||||
/// \param[out] dbIdentifier Passed to SQLite3Plugin::_sqlite3_exec
|
||||
/// \param[out] table Result of call to _sqlite3_exec, should that statement return a result
|
||||
/// \param[out] errorMsg If _sqlite3_exec failed, then the error message is here, and table will be empty
|
||||
/// \ingroup SQL_LITE_3_PLUGIN
|
||||
virtual void _sqlite3_exec(
|
||||
RakNet::RakString inputStatement,
|
||||
unsigned int queryId,
|
||||
RakNet::RakString dbIdentifier,
|
||||
const SQLite3Table &table,
|
||||
RakNet::RakString errorMsg)=0;
|
||||
|
||||
/// dbIdentifier is unknown on the remote system
|
||||
///
|
||||
/// \param[out] inputStatement Passed to SQLite3Plugin::_sqlite3_exec
|
||||
/// \param[out] queryId Returned from SQLite3Plugin::_sqlite3_exec
|
||||
/// \param[out] dbIdentifier Passed to SQLite3Plugin::_sqlite3_exec
|
||||
/// \ingroup SQL_LITE_3_PLUGIN
|
||||
virtual void OnUnknownDBIdentifier(
|
||||
RakNet::RakString inputStatement,
|
||||
unsigned int queryId,
|
||||
RakNet::RakString dbIdentifier)=0;
|
||||
};
|
||||
|
||||
/// Sample callback implementation that just prints to the screen the results
|
||||
/// \ingroup SQL_LITE_3_PLUGIN
|
||||
class SQLite3PluginResultInterface_Printf : public SQLite3PluginResultInterface
|
||||
{
|
||||
virtual void _sqlite3_exec(
|
||||
RakNet::RakString inputStatement,
|
||||
unsigned int queryId,
|
||||
RakNet::RakString dbIdentifier,
|
||||
const SQLite3Table &table,
|
||||
RakNet::RakString errorMsg);
|
||||
|
||||
virtual void OnUnknownDBIdentifier(
|
||||
RakNet::RakString inputStatement,
|
||||
unsigned int queryId,
|
||||
RakNet::RakString dbIdentifier);
|
||||
};
|
||||
|
||||
/// SQLite version 3 supports remote calls via networked file handles, but not over the regular internet
|
||||
/// This plugin will serialize calls to and results from sqlite3_exec
|
||||
/// That's all it does - any remote system can execute SQL queries.
|
||||
/// Intended as a starting platform to derive from for more advanced functionality (security over who can query, etc).
|
||||
/// Compatible as a plugin with both RakPeerInterface and PacketizedTCP
|
||||
/// \ingroup SQL_LITE_3_PLUGIN
|
||||
class RAK_DLL_EXPORT SQLite3ClientPlugin : public PluginInterface2
|
||||
{
|
||||
public:
|
||||
SQLite3ClientPlugin();
|
||||
virtual ~SQLite3ClientPlugin();
|
||||
|
||||
/// Add an interface to get callbacks for results
|
||||
/// Up to user to make sure the pointer is valid through the lifetime of use
|
||||
void AddResultHandler(SQLite3PluginResultInterface *res);
|
||||
void RemoveResultHandler(SQLite3PluginResultInterface *res);
|
||||
void ClearResultHandlers(void);
|
||||
|
||||
/// Execute a statement on the remote system
|
||||
/// \note Don't forget to escape your input strings. RakString::SQLEscape() is available for this.
|
||||
/// \param[in] dbIdentifier Which database to use, added with AddDBHandle()
|
||||
/// \param[in] inputStatement SQL statement to execute
|
||||
/// \param[in] priority See RakPeerInterface::Send()
|
||||
/// \param[in] reliability See RakPeerInterface::Send()
|
||||
/// \param[in] orderingChannel See RakPeerInterface::Send()
|
||||
/// \param[in] systemAddress See RakPeerInterface::Send()
|
||||
/// \return Query ID. Will be returned in _sqlite3_exec
|
||||
unsigned int _sqlite3_exec(RakNet::RakString dbIdentifier, RakNet::RakString inputStatement,
|
||||
PacketPriority priority, PacketReliability reliability, char orderingChannel, const SystemAddress &systemAddress);
|
||||
|
||||
/// \internal For plugin handling
|
||||
virtual PluginReceiveResult OnReceive(Packet *packet);
|
||||
|
||||
// List of result handlers added with AddResultHandler()
|
||||
DataStructures::List<SQLite3PluginResultInterface *> resultHandlers;
|
||||
// Each query returns a numeric id if you want it. This tracks what id to assign next. Increments sequentially.
|
||||
unsigned int nextQueryId;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,56 @@
|
||||
#include "SQLite3PluginCommon.h"
|
||||
|
||||
|
||||
SQLite3Table::SQLite3Table()
|
||||
{
|
||||
|
||||
}
|
||||
SQLite3Table::~SQLite3Table()
|
||||
{
|
||||
for (unsigned int i=0; i < rows.Size(); i++)
|
||||
RakNet::OP_DELETE(rows[i],_FILE_AND_LINE_);
|
||||
}
|
||||
|
||||
void SQLite3Table::Serialize(RakNet::BitStream *bitStream)
|
||||
{
|
||||
bitStream->Write(columnNames.Size());
|
||||
unsigned int idx1, idx2;
|
||||
for (idx1=0; idx1 < columnNames.Size(); idx1++)
|
||||
bitStream->Write(columnNames[idx1]);
|
||||
bitStream->Write(rows.Size());
|
||||
for (idx1=0; idx1 < rows.Size(); idx1++)
|
||||
{
|
||||
for (idx2=0; idx2 < rows[idx1]->entries.Size(); idx2++)
|
||||
{
|
||||
bitStream->Write(rows[idx1]->entries[idx2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
void SQLite3Table::Deserialize(RakNet::BitStream *bitStream)
|
||||
{
|
||||
for (unsigned int i=0; i < rows.Size(); i++)
|
||||
RakNet::OP_DELETE(rows[i],_FILE_AND_LINE_);
|
||||
rows.Clear(true,_FILE_AND_LINE_);
|
||||
columnNames.Clear(true , _FILE_AND_LINE_ );
|
||||
|
||||
unsigned int numColumns, numRows;
|
||||
bitStream->Read(numColumns);
|
||||
unsigned int idx1,idx2;
|
||||
RakNet::RakString inputStr;
|
||||
for (idx1=0; idx1 < numColumns; idx1++)
|
||||
{
|
||||
bitStream->Read(inputStr);
|
||||
columnNames.Push(inputStr, _FILE_AND_LINE_ );
|
||||
}
|
||||
bitStream->Read(numRows);
|
||||
for (idx1=0; idx1 < numRows; idx1++)
|
||||
{
|
||||
SQLite3Row *row = RakNet::OP_NEW<SQLite3Row>(_FILE_AND_LINE_);
|
||||
rows.Push(row,_FILE_AND_LINE_);
|
||||
for (idx2=0; idx2 < numColumns; idx2++)
|
||||
{
|
||||
bitStream->Read(inputStr);
|
||||
row->entries.Push(inputStr, _FILE_AND_LINE_ );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef __SQL_LITE_3_PLUGIN_COMMON_H
|
||||
#define __SQL_LITE_3_PLUGIN_COMMON_H
|
||||
|
||||
#include "DS_Multilist.h"
|
||||
#include "RakString.h"
|
||||
#include "BitStream.h"
|
||||
|
||||
/// \defgroup SQL_LITE_3_PLUGIN SQLite3Plugin
|
||||
/// \brief Code to transmit SQLite3 commands across the network
|
||||
/// \details
|
||||
/// \ingroup PLUGINS_GROUP
|
||||
|
||||
/// Contains a result row, which is just an array of strings
|
||||
/// \ingroup SQL_LITE_3_PLUGIN
|
||||
struct SQLite3Row
|
||||
{
|
||||
DataStructures::List<RakNet::RakString> entries;
|
||||
};
|
||||
|
||||
/// Contains a result table, which is an array of column name strings, followed by an array of SQLite3Row
|
||||
/// \ingroup SQL_LITE_3_PLUGIN
|
||||
struct SQLite3Table
|
||||
{
|
||||
SQLite3Table();
|
||||
~SQLite3Table();
|
||||
void Serialize(RakNet::BitStream *bitStream);
|
||||
void Deserialize(RakNet::BitStream *bitStream);
|
||||
|
||||
DataStructures::List<RakNet::RakString> columnNames;
|
||||
DataStructures::List<SQLite3Row*> rows;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,360 @@
|
||||
#include "SQLiteClientLoggerPlugin.h"
|
||||
#include "MessageIdentifiers.h"
|
||||
#include "PacketizedTCP.h"
|
||||
#include "GetTime.h"
|
||||
|
||||
static const char COLUMN_NAMES_DELIMITER=',';
|
||||
static const int MAX_COLUMN_NAMES_LENGTH=512;
|
||||
|
||||
using namespace RakNet;
|
||||
|
||||
SQLiteClientLoggerPlugin* SQLiteClientLoggerPlugin::logger;
|
||||
|
||||
|
||||
SQLiteClientLoggerPlugin::SQLiteClientLoggerPlugin()
|
||||
{
|
||||
logger=this;
|
||||
tickCount=0;
|
||||
recursiveCheck=false;
|
||||
memoryConstraint=0;
|
||||
}
|
||||
SQLiteClientLoggerPlugin::~SQLiteClientLoggerPlugin()
|
||||
{
|
||||
if (logger==this)
|
||||
logger=0;
|
||||
}
|
||||
void SQLiteClientLoggerPlugin::SetServerParameters(const SystemAddress &systemAddress, RakNet::RakString _dbIdentifier)
|
||||
{
|
||||
serverAddress=systemAddress;
|
||||
dbIdentifier=_dbIdentifier;
|
||||
}
|
||||
void SQLiteClientLoggerPlugin::SetMemoryConstraint(unsigned int constraint)
|
||||
{
|
||||
memoryConstraint=constraint;
|
||||
}
|
||||
void SQLiteClientLoggerPlugin::IncrementAutoTickCount(void)
|
||||
{
|
||||
tickCount++;
|
||||
}
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const ParameterListHelper ¶meterList )
|
||||
{
|
||||
if (recursiveCheck==true)
|
||||
return SQLLR_RECURSION;
|
||||
recursiveCheck=true;
|
||||
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, parameterList.paramCount);
|
||||
// int i;
|
||||
//for (i=0; i < parameterList.paramCount; i++)
|
||||
// parameterList.parms[i].Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=1)
|
||||
parameterList.p0.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=2)
|
||||
parameterList.p1.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=3)
|
||||
parameterList.p2.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=4)
|
||||
parameterList.p3.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=5)
|
||||
parameterList.p4.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=6)
|
||||
parameterList.p5.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=7)
|
||||
parameterList.p6.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=8)
|
||||
parameterList.p7.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=9)
|
||||
parameterList.p8.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=10)
|
||||
parameterList.p9.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=11)
|
||||
parameterList.p10.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=12)
|
||||
parameterList.p11.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=13)
|
||||
parameterList.p12.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=14)
|
||||
parameterList.p13.Serialize(&bitStream);
|
||||
if (parameterList.paramCount>=15)
|
||||
parameterList.p14.Serialize(&bitStream);
|
||||
|
||||
|
||||
if (memoryConstraint!=0 && packetizedTCP)
|
||||
{
|
||||
if (packetizedTCP->GetOutgoingDataBufferSize(serverAddress)+bitStream.GetNumberOfBytesUsed()>=memoryConstraint)
|
||||
{
|
||||
recursiveCheck=false;
|
||||
return SQLLR_WOULD_EXCEED_MEMORY_CONSTRAINT;
|
||||
}
|
||||
}
|
||||
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
recursiveCheck=false;
|
||||
return SQLLR_OK;
|
||||
}
|
||||
/*
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line )
|
||||
{
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, 0);
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
return SQLLR_OK;
|
||||
}
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1 )
|
||||
{
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, 1);
|
||||
p1->Serialize(&bitStream);
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
return SQLLR_OK;
|
||||
}
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2 )
|
||||
{
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, 2);
|
||||
p1->Serialize(&bitStream);
|
||||
p2->Serialize(&bitStream);
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
return SQLLR_OK;
|
||||
}
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3 )
|
||||
{
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, 3);
|
||||
p1->Serialize(&bitStream);
|
||||
p2->Serialize(&bitStream);
|
||||
p3->Serialize(&bitStream);
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
return SQLLR_OK;
|
||||
}
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4 )
|
||||
{
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, 4);
|
||||
p1->Serialize(&bitStream);
|
||||
p2->Serialize(&bitStream);
|
||||
p3->Serialize(&bitStream);
|
||||
p4->Serialize(&bitStream);
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
return SQLLR_OK;
|
||||
}
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5 )
|
||||
{
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, 5);
|
||||
p1->Serialize(&bitStream);
|
||||
p2->Serialize(&bitStream);
|
||||
p3->Serialize(&bitStream);
|
||||
p4->Serialize(&bitStream);
|
||||
p5->Serialize(&bitStream);
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
return SQLLR_OK;
|
||||
}
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6 )
|
||||
{
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, 6);
|
||||
p1->Serialize(&bitStream);
|
||||
p2->Serialize(&bitStream);
|
||||
p3->Serialize(&bitStream);
|
||||
p4->Serialize(&bitStream);
|
||||
p5->Serialize(&bitStream);
|
||||
p6->Serialize(&bitStream);
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
return SQLLR_OK;
|
||||
}
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6, const LogParameter *p7 )
|
||||
{
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, 7);
|
||||
p1->Serialize(&bitStream);
|
||||
p2->Serialize(&bitStream);
|
||||
p3->Serialize(&bitStream);
|
||||
p4->Serialize(&bitStream);
|
||||
p5->Serialize(&bitStream);
|
||||
p6->Serialize(&bitStream);
|
||||
p7->Serialize(&bitStream);
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
return SQLLR_OK;
|
||||
}
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6, const LogParameter *p7, const LogParameter *p8 )
|
||||
{
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, 8);
|
||||
p1->Serialize(&bitStream);
|
||||
p2->Serialize(&bitStream);
|
||||
p3->Serialize(&bitStream);
|
||||
p4->Serialize(&bitStream);
|
||||
p5->Serialize(&bitStream);
|
||||
p6->Serialize(&bitStream);
|
||||
p7->Serialize(&bitStream);
|
||||
p8->Serialize(&bitStream);
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
return SQLLR_OK;
|
||||
}
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6, const LogParameter *p7, const LogParameter *p8, const LogParameter *p9 )
|
||||
{
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, 9);
|
||||
p1->Serialize(&bitStream);
|
||||
p2->Serialize(&bitStream);
|
||||
p3->Serialize(&bitStream);
|
||||
p4->Serialize(&bitStream);
|
||||
p5->Serialize(&bitStream);
|
||||
p6->Serialize(&bitStream);
|
||||
p7->Serialize(&bitStream);
|
||||
p8->Serialize(&bitStream);
|
||||
p9->Serialize(&bitStream);
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
return SQLLR_OK;
|
||||
}
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6, const LogParameter *p7, const LogParameter *p8, const LogParameter *p9, const LogParameter *p10 )
|
||||
{
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, 10);
|
||||
p1->Serialize(&bitStream);
|
||||
p2->Serialize(&bitStream);
|
||||
p3->Serialize(&bitStream);
|
||||
p4->Serialize(&bitStream);
|
||||
p5->Serialize(&bitStream);
|
||||
p6->Serialize(&bitStream);
|
||||
p7->Serialize(&bitStream);
|
||||
p8->Serialize(&bitStream);
|
||||
p9->Serialize(&bitStream);
|
||||
p10->Serialize(&bitStream);
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
return SQLLR_OK;
|
||||
}
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6, const LogParameter *p7, const LogParameter *p8, const LogParameter *p9, const LogParameter *p10, const LogParameter *p11 )
|
||||
{
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, 11);
|
||||
p1->Serialize(&bitStream);
|
||||
p2->Serialize(&bitStream);
|
||||
p3->Serialize(&bitStream);
|
||||
p4->Serialize(&bitStream);
|
||||
p5->Serialize(&bitStream);
|
||||
p6->Serialize(&bitStream);
|
||||
p7->Serialize(&bitStream);
|
||||
p8->Serialize(&bitStream);
|
||||
p9->Serialize(&bitStream);
|
||||
p10->Serialize(&bitStream);
|
||||
p11->Serialize(&bitStream);
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
return SQLLR_OK;
|
||||
}
|
||||
SQLLogResult SQLiteClientLoggerPlugin::SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6, const LogParameter *p7, const LogParameter *p8, const LogParameter *p9, const LogParameter *p10, const LogParameter *p11, const LogParameter *p12 )
|
||||
{
|
||||
RakNet::BitStream bitStream;
|
||||
SerializeHeader(&bitStream, isFunctionCall, tableName, columnNames, file, line, 12);
|
||||
p1->Serialize(&bitStream);
|
||||
p2->Serialize(&bitStream);
|
||||
p3->Serialize(&bitStream);
|
||||
p4->Serialize(&bitStream);
|
||||
p5->Serialize(&bitStream);
|
||||
p6->Serialize(&bitStream);
|
||||
p7->Serialize(&bitStream);
|
||||
p8->Serialize(&bitStream);
|
||||
p9->Serialize(&bitStream);
|
||||
p10->Serialize(&bitStream);
|
||||
p11->Serialize(&bitStream);
|
||||
p12->Serialize(&bitStream);
|
||||
SendUnified(&bitStream, LOW_PRIORITY, RELIABLE_ORDERED, 1, serverAddress, false);
|
||||
return SQLLR_OK;
|
||||
}
|
||||
*/
|
||||
SQLLogResult SQLiteClientLoggerPlugin::CheckQuery(bool isFunction, const char *tableName, const char *columnNames, int numParameters)
|
||||
{
|
||||
(void) isFunction;
|
||||
|
||||
if (recursiveCheck==true)
|
||||
return SQLLR_RECURSION;
|
||||
|
||||
if (tableName==0 || tableName[0]==0)
|
||||
return SQLLR_TABLE_NAME_BLANK;
|
||||
if (isFunction==true)
|
||||
return SQLLR_OK;
|
||||
|
||||
if (columnNames==0 || columnNames[0]==0)
|
||||
{
|
||||
if (numParameters==0)
|
||||
return SQLLR_OK;
|
||||
return SQLLR_TABLE_DESCRIPTOR_FORMAT_WRONG_PARAMETER_COUNT;
|
||||
}
|
||||
|
||||
recursiveCheck=true;
|
||||
|
||||
if (dbIdentifier.IsEmpty())
|
||||
{
|
||||
recursiveCheck=false;
|
||||
return SQLLR_NO_DATABASE_SET;
|
||||
}
|
||||
|
||||
unsigned int parameterCount=1;
|
||||
unsigned int columnNamesIndex=0;
|
||||
for (columnNamesIndex=1; columnNamesIndex < 512 && columnNames[columnNamesIndex]; columnNamesIndex++)
|
||||
{
|
||||
if (columnNames[columnNamesIndex]==COLUMN_NAMES_DELIMITER)
|
||||
{
|
||||
if (columnNames[columnNamesIndex-1]==COLUMN_NAMES_DELIMITER)
|
||||
{
|
||||
recursiveCheck=false;
|
||||
return SQLLR_TABLE_DESCRIPTOR_FORMAT_INVALID_SYNTAX;
|
||||
}
|
||||
parameterCount++;
|
||||
}
|
||||
}
|
||||
|
||||
recursiveCheck=false;
|
||||
if (columnNamesIndex==MAX_COLUMN_NAMES_LENGTH)
|
||||
{
|
||||
return SQLLR_COLUMN_NAMES_NOT_TERMINATED;
|
||||
}
|
||||
|
||||
if (parameterCount!=numParameters)
|
||||
{
|
||||
return SQLLR_TABLE_DESCRIPTOR_FORMAT_WRONG_PARAMETER_COUNT;
|
||||
}
|
||||
|
||||
return SQLLR_OK;
|
||||
}
|
||||
|
||||
void SQLiteClientLoggerPlugin::SerializeHeader(RakNet::BitStream *bitStream, bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, unsigned char parameterCount ) const
|
||||
{
|
||||
bitStream->Write((MessageID) ID_SQLLITE_LOGGER);
|
||||
bitStream->Write(dbIdentifier);
|
||||
bitStream->Write(tableName);
|
||||
bitStream->Write(line);
|
||||
bitStream->Write(file);
|
||||
bitStream->Write(tickCount);
|
||||
bitStream->Write(RakNet::GetTimeMS());
|
||||
bitStream->Write(isFunctionCall);
|
||||
bitStream->Write(parameterCount);
|
||||
if (isFunctionCall==false && parameterCount>=1)
|
||||
{
|
||||
int stringIndices[64];
|
||||
int strIndex=0;
|
||||
stringIndices[strIndex++]=0;
|
||||
char columnNamesCopy[MAX_COLUMN_NAMES_LENGTH];
|
||||
RakAssert(strlen(columnNames)<MAX_COLUMN_NAMES_LENGTH);
|
||||
strncpy(columnNamesCopy, columnNames, MAX_COLUMN_NAMES_LENGTH);
|
||||
columnNamesCopy[MAX_COLUMN_NAMES_LENGTH-1]=0;
|
||||
for (int i=0; columnNamesCopy[i]; i++)
|
||||
{
|
||||
if (columnNamesCopy[i]==COLUMN_NAMES_DELIMITER)
|
||||
{
|
||||
columnNamesCopy[i]=0;
|
||||
stringIndices[strIndex++]=i+1;
|
||||
}
|
||||
}
|
||||
RakAssert(strIndex==parameterCount);
|
||||
for (int i=0; i < parameterCount; i++)
|
||||
{
|
||||
bitStream->Write((char*)columnNamesCopy + stringIndices[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
void SQLiteClientLoggerPlugin::Update(void)
|
||||
{
|
||||
SQLite3ClientPlugin::Update();
|
||||
}
|
||||
@@ -0,0 +1,498 @@
|
||||
/// \file
|
||||
/// \brief Contains utility functions to write logs, which are then sent to a connected instance of SQLite3ServerLoggerPlugin
|
||||
///
|
||||
/// This file is part of RakNet Copyright 2003 Jenkins Software LLC
|
||||
///
|
||||
/// Usage of RakNet is subject to the appropriate license agreement.
|
||||
|
||||
|
||||
#ifndef ___SQLITE_CLIENT_LOGGER_PLUGIN_H
|
||||
#define ___SQLITE_CLIENT_LOGGER_PLUGIN_H
|
||||
|
||||
#include "SQLite3ClientPlugin.h"
|
||||
#include "SQLiteLoggerCommon.h"
|
||||
|
||||
// return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line);
|
||||
|
||||
// If you get Error 2 error C2275: 'RakNet::SQLiteClientLoggerPlugin::ParameterListHelper' : illegal use of this type as an expression
|
||||
// Either:
|
||||
// 1. You forgot to write the TABLE_DESCRIPTOR
|
||||
// 2. You forgot to put the parameter list in parenthesis
|
||||
#define rakSqlLog(TABLE_DESCRIPTOR, COLUMN_NAMES, PARAMETER_LIST) RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, TABLE_DESCRIPTOR, COLUMN_NAMES, _FILE_AND_LINE_, RakNet::SQLiteClientLoggerPlugin::ParameterListHelper PARAMETER_LIST)
|
||||
#define rakFnLog(TABLE_DESCRIPTOR, PARAMETER_LIST) RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, TABLE_DESCRIPTOR, 0, _FILE_AND_LINE_, RakNet::SQLiteClientLoggerPlugin::ParameterListHelper PARAMETER_LIST)
|
||||
|
||||
|
||||
namespace RakNet
|
||||
{
|
||||
/// \ingroup SQL_LITE_3_PLUGIN
|
||||
/// \brief Result codes for logging
|
||||
enum SQLLogResult
|
||||
{
|
||||
/// OK
|
||||
SQLLR_OK,
|
||||
|
||||
/// Didn't instantiate SQLiteClientLoggerPlugin
|
||||
SQLLR_NOT_INSTANTIATED,
|
||||
|
||||
/// Didn't call SQLiteClientLoggerPlugin::SetServerParameters
|
||||
SQLLR_NO_DATABASE_SET,
|
||||
|
||||
/// String passed for column names unreasonably long (set by MAX_COLUMN_NAMES_LENGTH)
|
||||
SQLLR_COLUMN_NAMES_NOT_TERMINATED,
|
||||
|
||||
/// tableName parameter is blank
|
||||
SQLLR_TABLE_NAME_BLANK,
|
||||
|
||||
/// Syntax of column names doesn't make sense. Should be column1,column2,column3,...
|
||||
SQLLR_TABLE_DESCRIPTOR_FORMAT_INVALID_SYNTAX,
|
||||
|
||||
/// Syntax of column names indicated n columns, but actual number of parameters != n
|
||||
SQLLR_TABLE_DESCRIPTOR_FORMAT_WRONG_PARAMETER_COUNT,
|
||||
|
||||
/// Logging when already in a log function
|
||||
SQLLR_RECURSION,
|
||||
|
||||
/// Out of memory. See SQLiteClientLoggerPlugin::SetMemoryConstraint
|
||||
SQLLR_WOULD_EXCEED_MEMORY_CONSTRAINT
|
||||
};
|
||||
|
||||
/// \brief Contains utility functions to write logs, which are then sent to a connected instance of SQLite3ServerLoggerPlugin
|
||||
/// \details Connect with RakPeerInterface or PacketizedTCP first, then use the sqlLog or functionLog to write logs.
|
||||
/// Don't use this class directly, except to call SetServerParameters()
|
||||
/// \ingroup SQL_LITE_3_PLUGIN
|
||||
class RAK_DLL_EXPORT SQLiteClientLoggerPlugin : public SQLite3ClientPlugin
|
||||
{
|
||||
public:
|
||||
SQLiteClientLoggerPlugin();
|
||||
virtual ~SQLiteClientLoggerPlugin();
|
||||
|
||||
/// Required to use the system. Call SetServerParameters() before calling sqlLog() or functionLog()
|
||||
/// systemAddress Address of the server we are already connected to
|
||||
/// _dbIdentifier session identifier. If the server is using CREATE_SHARED_NAMED_DB_HANDLE or CREATE_EACH_NAMED_DB_HANDLE then this is the name of the created file. Otherwise, it is the dbIdentifier passed to SQLite3ServerPlugin::AddDBHandle();
|
||||
void SetServerParameters(const SystemAddress &systemAddress, RakNet::RakString _dbIdentifier);
|
||||
|
||||
/// Every entry in the table has a tick count
|
||||
/// Call this function to increment it by one
|
||||
void IncrementAutoTickCount(void);
|
||||
|
||||
/// If the amount of data buffered to go out on TCP exceeds this amount, then the log is aborted rather than sent
|
||||
/// This is only used when sending through TCP
|
||||
/// \param[in] constraint Use 0 for unlimited. Otherwise specify the amount in bytes
|
||||
void SetMemoryConstraint(unsigned int constraint);
|
||||
|
||||
// ---------------------------------- INTERNAL -------------------------------
|
||||
SQLLogResult CheckQuery(bool isFunction, const char *tableName, const char *columnNames, int numParameters);
|
||||
|
||||
struct ParameterListHelper
|
||||
{
|
||||
ParameterListHelper() : paramCount(0) {}
|
||||
|
||||
template <class T1>
|
||||
ParameterListHelper(const T1 &t1) : p0(t1), paramCount(1) {}
|
||||
|
||||
template <class T1, class T2>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2) : p0(t1), p1(t2), paramCount(2) {}
|
||||
|
||||
template <class T1, class T2, class T3>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2, const T3 &t3) : p0(t1), p1(t2), p2(t3), paramCount(3) {}
|
||||
|
||||
template <class T1, class T2, class T3, class T4>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4) : p0(t1), p1(t2), p2(t3), p3(t4), paramCount(4) {}
|
||||
|
||||
template <class T1, class T2, class T3, class T4, class T5>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5) : p0(t1), p1(t2), p2(t3), p3(t4), p4(t5), paramCount(5) {}
|
||||
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6) : p0(t1), p1(t2), p2(t3), p3(t4), p4(t5), p5(t6), paramCount(6) {}
|
||||
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7) : p0(t1), p1(t2), p2(t3), p3(t4), p4(t5), p5(t6), p6(t7), paramCount(7) {}
|
||||
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8) : p0(t1), p1(t2), p2(t3), p3(t4), p4(t5), p5(t6), p6(t7), p7(t8), paramCount(8) {}
|
||||
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8, const T9 &t9) : p0(t1), p1(t2), p2(t3), p3(t4), p4(t5), p5(t6), p6(t7), p7(t8), p8(t9), paramCount(9) {}
|
||||
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8, const T9 &t9, const T10 &t10) : p0(t1), p1(t2), p2(t3), p3(t4), p4(t5), p5(t6), p6(t7), p7(t8), p8(t9), p9(t10), paramCount(10) {}
|
||||
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8, const T9 &t9, const T10 &t10, const T11 &t11) : p0(t1), p1(t2), p2(t3), p3(t4), p4(t5), p5(t6), p6(t7), p7(t8), p8(t9), p9(t10), p10(t11), paramCount(11) {}
|
||||
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8, const T9 &t9, const T10 &t10, const T11 &t11, const T12 &t12) : p0(t1), p1(t2), p2(t3), p3(t4), p4(t5), p5(t6), p6(t7), p7(t8), p8(t9), p9(t10), p10(t11), p11(t12), paramCount(12) {}
|
||||
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8, const T9 &t9, const T10 &t10, const T11 &t11, const T12 &t12, const T13 &t13) : p0(t1), p1(t2), p2(t3), p3(t4), p4(t5), p5(t6), p6(t7), p7(t8), p8(t9), p9(t10), p10(t11), p11(t12), p12(t13), paramCount(13) {}
|
||||
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8, const T9 &t9, const T10 &t10, const T11 &t11, const T12 &t12, const T13 &t13, const T14 &t14) : p0(t1), p1(t2), p2(t3), p3(t4), p4(t5), p5(t6), p6(t7), p7(t8), p8(t9), p9(t10), p10(t11), p11(t12), p12(t13), p13(t14), paramCount(14) {}
|
||||
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15>
|
||||
ParameterListHelper(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8, const T9 &t9, const T10 &t10, const T11 &t11, const T12 &t12, const T13 &t13, const T14 &t14, const T15 &t15) : p0(t1), p1(t2), p2(t3), p3(t4), p4(t5), p5(t6), p6(t7), p7(t8), p8(t9), p9(t10), p10(t11), p11(t12), p12(t13), p13(t14), p14(t15), paramCount(15) {}
|
||||
|
||||
// Array doesn't work - no constructor initialization
|
||||
//const LogParameter parms[12];
|
||||
const LogParameter p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14;
|
||||
const int paramCount;
|
||||
};
|
||||
|
||||
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const ParameterListHelper ¶meterList );
|
||||
|
||||
/*
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line );
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1 );
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2 );
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3 );
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4 );
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5 );
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6 );
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6, const LogParameter *p7 );
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6, const LogParameter *p7, const LogParameter *p8 );
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6, const LogParameter *p7, const LogParameter *p8, const LogParameter *p9 );
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6, const LogParameter *p7, const LogParameter *p8, const LogParameter *p9, const LogParameter *p10 );
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6, const LogParameter *p7, const LogParameter *p8, const LogParameter *p9, const LogParameter *p10, const LogParameter *p11 );
|
||||
SQLLogResult SqlLog( bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, const LogParameter *p1, const LogParameter *p2, const LogParameter *p3, const LogParameter *p4, const LogParameter *p5, const LogParameter *p6, const LogParameter *p7, const LogParameter *p8, const LogParameter *p9, const LogParameter *p10, const LogParameter *p11, const LogParameter *p12 );
|
||||
*/
|
||||
|
||||
static RakNet::SQLLogResult __sqlLogInternal(bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line, const ParameterListHelper ¶meterList )
|
||||
{
|
||||
if (logger==0) return SQLLR_NOT_INSTANTIATED;
|
||||
SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,parameterList.paramCount); if (r!=SQLLR_OK) return r;
|
||||
r = logger->SqlLog(isFunction, tableName, columnNames, file, line, parameterList);
|
||||
return r;
|
||||
}
|
||||
|
||||
/*
|
||||
static RakNet::SQLLogResult __sqlLogInternal( bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line )
|
||||
{
|
||||
if (logger==0) return RakNet::SQLLR_NOT_INSTANTIATED;
|
||||
RakNet::SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,0); if (r!=RakNet::SQLLR_OK) return r;
|
||||
return logger->SqlLog(isFunction, tableName, columnNames, file, line);
|
||||
}
|
||||
template <class T1>
|
||||
static RakNet::SQLLogResult __sqlLogInternal(bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line, const T1 &arg1 )
|
||||
{
|
||||
if (logger==0) return SQLLR_NOT_INSTANTIATED;
|
||||
SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,1); if (r!=SQLLR_OK) return r;
|
||||
return logger->SqlLog(isFunction, tableName, columnNames, file, line
|
||||
,&LogParameter(arg1)
|
||||
);
|
||||
}
|
||||
template <class T1, class T2>
|
||||
static RakNet::SQLLogResult __sqlLogInternal(bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2 )
|
||||
{
|
||||
if (logger==0) return SQLLR_NOT_INSTANTIATED;
|
||||
SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,2); if (r!=SQLLR_OK) return r;
|
||||
return logger->SqlLog(isFunction, tableName, columnNames, file, line
|
||||
,&LogParameter(arg1)
|
||||
,&LogParameter(arg2)
|
||||
);
|
||||
}
|
||||
template <class T1, class T2, class T3>
|
||||
static RakNet::SQLLogResult __sqlLogInternal(bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3 )
|
||||
{
|
||||
if (logger==0) return SQLLR_NOT_INSTANTIATED;
|
||||
SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,3); if (r!=SQLLR_OK) return r;
|
||||
return logger->SqlLog(isFunction, tableName, columnNames, file, line
|
||||
,&LogParameter(arg1)
|
||||
,&LogParameter(arg2)
|
||||
,&LogParameter(arg3)
|
||||
);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4>
|
||||
static RakNet::SQLLogResult __sqlLogInternal(bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4 )
|
||||
{
|
||||
if (logger==0) return SQLLR_NOT_INSTANTIATED;
|
||||
SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,4); if (r!=SQLLR_OK) return r;
|
||||
return logger->SqlLog(isFunction, tableName, columnNames, file, line
|
||||
,&LogParameter(arg1)
|
||||
,&LogParameter(arg2)
|
||||
,&LogParameter(arg3)
|
||||
,&LogParameter(arg4)
|
||||
);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5>
|
||||
static RakNet::SQLLogResult __sqlLogInternal(bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5 )
|
||||
{
|
||||
if (logger==0) return SQLLR_NOT_INSTANTIATED;
|
||||
SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,5); if (r!=SQLLR_OK) return r;
|
||||
return logger->SqlLog(isFunction, tableName, columnNames, file, line
|
||||
,&LogParameter(arg1)
|
||||
,&LogParameter(arg2)
|
||||
,&LogParameter(arg3)
|
||||
,&LogParameter(arg4)
|
||||
,&LogParameter(arg5)
|
||||
);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6>
|
||||
static RakNet::SQLLogResult __sqlLogInternal(bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6 )
|
||||
{
|
||||
if (logger==0) return SQLLR_NOT_INSTANTIATED;
|
||||
SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,6); if (r!=SQLLR_OK) return r;
|
||||
return logger->SqlLog(isFunction, tableName, columnNames, file, line
|
||||
,&LogParameter(arg1)
|
||||
,&LogParameter(arg2)
|
||||
,&LogParameter(arg3)
|
||||
,&LogParameter(arg4)
|
||||
,&LogParameter(arg5)
|
||||
,&LogParameter(arg6)
|
||||
);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7>
|
||||
static RakNet::SQLLogResult __sqlLogInternal(bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7 )
|
||||
{
|
||||
if (logger==0) return SQLLR_NOT_INSTANTIATED;
|
||||
SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,7); if (r!=SQLLR_OK) return r;
|
||||
return logger->SqlLog(isFunction, tableName, columnNames, file, line
|
||||
,&LogParameter(arg1)
|
||||
,&LogParameter(arg2)
|
||||
,&LogParameter(arg3)
|
||||
,&LogParameter(arg4)
|
||||
,&LogParameter(arg5)
|
||||
,&LogParameter(arg6)
|
||||
,&LogParameter(arg7)
|
||||
);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
|
||||
static RakNet::SQLLogResult __sqlLogInternal(bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8 )
|
||||
{
|
||||
if (logger==0) return SQLLR_NOT_INSTANTIATED;
|
||||
SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,8); if (r!=SQLLR_OK) return r;
|
||||
return logger->SqlLog(isFunction, tableName, columnNames, file, line
|
||||
,&LogParameter(arg1)
|
||||
,&LogParameter(arg2)
|
||||
,&LogParameter(arg3)
|
||||
,&LogParameter(arg4)
|
||||
,&LogParameter(arg5)
|
||||
,&LogParameter(arg6)
|
||||
,&LogParameter(arg7)
|
||||
,&LogParameter(arg8)
|
||||
);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
|
||||
static RakNet::SQLLogResult __sqlLogInternal(bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9 )
|
||||
{
|
||||
if (logger==0) return SQLLR_NOT_INSTANTIATED;
|
||||
SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,9); if (r!=SQLLR_OK) return r;
|
||||
return logger->SqlLog(isFunction, tableName, columnNames, file, line
|
||||
,&LogParameter(arg1)
|
||||
,&LogParameter(arg2)
|
||||
,&LogParameter(arg3)
|
||||
,&LogParameter(arg4)
|
||||
,&LogParameter(arg5)
|
||||
,&LogParameter(arg6)
|
||||
,&LogParameter(arg7)
|
||||
,&LogParameter(arg8)
|
||||
,&LogParameter(arg9)
|
||||
);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
|
||||
static RakNet::SQLLogResult __sqlLogInternal(bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9, const T10 &arg10 )
|
||||
{
|
||||
if (logger==0) return SQLLR_NOT_INSTANTIATED;
|
||||
SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,10); if (r!=SQLLR_OK) return r;
|
||||
return logger->SqlLog(isFunction, tableName, columnNames, file, line
|
||||
,&LogParameter(arg1)
|
||||
,&LogParameter(arg2)
|
||||
,&LogParameter(arg3)
|
||||
,&LogParameter(arg4)
|
||||
,&LogParameter(arg5)
|
||||
,&LogParameter(arg6)
|
||||
,&LogParameter(arg7)
|
||||
,&LogParameter(arg8)
|
||||
,&LogParameter(arg9)
|
||||
,&LogParameter(arg10)
|
||||
);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
|
||||
static RakNet::SQLLogResult __sqlLogInternal(bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9, const T10 &arg10, const T11 &arg11 )
|
||||
{
|
||||
if (logger==0) return SQLLR_NOT_INSTANTIATED;
|
||||
SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,11); if (r!=SQLLR_OK) return r;
|
||||
return logger->SqlLog(isFunction, tableName, columnNames, file, line
|
||||
,&LogParameter(arg1)
|
||||
,&LogParameter(arg2)
|
||||
,&LogParameter(arg3)
|
||||
,&LogParameter(arg4)
|
||||
,&LogParameter(arg5)
|
||||
,&LogParameter(arg6)
|
||||
,&LogParameter(arg7)
|
||||
,&LogParameter(arg8)
|
||||
,&LogParameter(arg9)
|
||||
,&LogParameter(arg10)
|
||||
,&LogParameter(arg11)
|
||||
);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
|
||||
static RakNet::SQLLogResult __sqlLogInternal(bool isFunction, const char *tableName, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9, const T10 &arg10, const T11 &arg11, const T12 &arg12 )
|
||||
{
|
||||
if (logger==0) return SQLLR_NOT_INSTANTIATED;
|
||||
SQLLogResult r = logger->CheckQuery(isFunction, tableName, columnNames,12); if (r!=SQLLR_OK) return r;
|
||||
return logger->SqlLog(isFunction, tableName, columnNames, file, line
|
||||
,&LogParameter(arg1)
|
||||
,&LogParameter(arg2)
|
||||
,&LogParameter(arg3)
|
||||
,&LogParameter(arg4)
|
||||
,&LogParameter(arg5)
|
||||
,&LogParameter(arg6)
|
||||
,&LogParameter(arg7)
|
||||
,&LogParameter(arg8)
|
||||
,&LogParameter(arg9)
|
||||
,&LogParameter(arg10)
|
||||
,&LogParameter(arg11)
|
||||
,&LogParameter(arg12)
|
||||
);
|
||||
}
|
||||
*/
|
||||
|
||||
virtual void Update(void);
|
||||
|
||||
static SQLiteClientLoggerPlugin* logger;
|
||||
|
||||
|
||||
protected:
|
||||
void SerializeHeader(RakNet::BitStream *bitStream, bool isFunctionCall, const char *tableName, const char *columnNames, const char *file, const int line, unsigned char parameterCount ) const;
|
||||
|
||||
SystemAddress serverAddress;
|
||||
RakNet::RakString dbIdentifier;
|
||||
uint32_t tickCount;
|
||||
bool recursiveCheck;
|
||||
unsigned int memoryConstraint;
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
RakNet::SQLLogResult __sqlLog(const char *tableDescriptor, const char *columnNames, const char *file, const int line )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line);
|
||||
}
|
||||
template <class T1>
|
||||
RakNet::SQLLogResult __sqlLog(const char *tableDescriptor, const char *columnNames, const char *file, const int line, const T1 &arg1 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line, arg1);
|
||||
}
|
||||
template <class T1, class T2>
|
||||
RakNet::SQLLogResult __sqlLog(const char *tableDescriptor, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line, arg1, arg2);
|
||||
}
|
||||
template <class T1, class T2, class T3>
|
||||
RakNet::SQLLogResult __sqlLog(const char *tableDescriptor, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line, arg1, arg2, arg3);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4>
|
||||
RakNet::SQLLogResult __sqlLog(const char *tableDescriptor, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line, arg1, arg2, arg3, arg4);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5>
|
||||
RakNet::SQLLogResult __sqlLog(const char *tableDescriptor, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line, arg1, arg2, arg3, arg4, arg5);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6>
|
||||
RakNet::SQLLogResult __sqlLog(const char *tableDescriptor, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line, arg1, arg2, arg3, arg4, arg5, arg6);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7>
|
||||
RakNet::SQLLogResult __sqlLog(const char *tableDescriptor, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
|
||||
RakNet::SQLLogResult __sqlLog(const char *tableDescriptor, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
|
||||
RakNet::SQLLogResult __sqlLog(const char *tableDescriptor, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
|
||||
RakNet::SQLLogResult __sqlLog(const char *tableDescriptor, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9, const T10 &arg10 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
|
||||
RakNet::SQLLogResult __sqlLog(const char *tableDescriptor, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9, const T10 &arg10, const T11 &arg11 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
|
||||
RakNet::SQLLogResult __sqlLog(const char *tableDescriptor, const char *columnNames, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9, const T10 &arg10, const T11 &arg11, const T12 &arg12 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(false, tableDescriptor, columnNames, file, line, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
|
||||
}
|
||||
// TODO - Add _FILE_AND_LINE_ automatically somehow or this is nearly useless
|
||||
RakNet::SQLLogResult __functionLog(const char *functionName, const char *file, const int line )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, functionName, 0, file, line);
|
||||
}
|
||||
template <class T1>
|
||||
RakNet::SQLLogResult __functionLog(const char *functionName, const char *file, const int line, const T1 &arg1 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, functionName, 0, file, line, arg1);
|
||||
}
|
||||
template <class T1, class T2>
|
||||
RakNet::SQLLogResult __functionLog(const char *functionName, const char *file, const int line, const T1 &arg1, const T2 &arg2 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, functionName, 0, file, line, arg1, arg2);
|
||||
}
|
||||
template <class T1, class T2, class T3>
|
||||
RakNet::SQLLogResult __functionLog(const char *functionName, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, functionName, 0, file, line, arg1, arg2, arg3);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4>
|
||||
RakNet::SQLLogResult __functionLog(const char *functionName, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, functionName, 0, file, line, arg1, arg2, arg3, arg4);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5>
|
||||
RakNet::SQLLogResult __functionLog(const char *functionName, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, functionName, 0, file, line, arg1, arg2, arg3, arg4, arg5);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6>
|
||||
RakNet::SQLLogResult __functionLog(const char *functionName, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, functionName, 0, file, line, arg1, arg2, arg3, arg4, arg5, arg6);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7>
|
||||
RakNet::SQLLogResult __functionLog(const char *functionName, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, functionName, 0, file, line, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
|
||||
RakNet::SQLLogResult __functionLog(const char *functionName, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, functionName, 0, file, line, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
|
||||
RakNet::SQLLogResult __functionLog(const char *functionName, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, functionName, 0, file, line, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10>
|
||||
RakNet::SQLLogResult __functionLog(const char *functionName, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9, const T10 &arg10 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, functionName, 0, file, line, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11>
|
||||
RakNet::SQLLogResult __functionLog(const char *functionName, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9, const T10 &arg10, const T11 &arg11 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, functionName, 0, file, line, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
|
||||
}
|
||||
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12>
|
||||
RakNet::SQLLogResult __functionLog(const char *functionName, const char *file, const int line, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const T6 &arg6, const T7 &arg7, const T8 &arg8, const T9 &arg9, const T10 &arg10, const T11 &arg11, const T12 &arg12 )
|
||||
{
|
||||
return RakNet::SQLiteClientLoggerPlugin::__sqlLogInternal(true, functionName, 0, file, line, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
@@ -0,0 +1,169 @@
|
||||
#include "SQLiteLoggerCommon.h"
|
||||
#include "BitStream.h"
|
||||
|
||||
using namespace RakNet;
|
||||
|
||||
static const char *sqlDataTypeNames[SQLLPDT_COUNT] =
|
||||
{
|
||||
"INTEGER",
|
||||
"INTEGER",
|
||||
"NUMERIC",
|
||||
"TEXT",
|
||||
"BLOB",
|
||||
"BLOB",
|
||||
};
|
||||
|
||||
extern "C" const char *GetSqlDataTypeName(SQLLoggerPrimaryDataType idx) {return sqlDataTypeNames[(int)idx];}
|
||||
|
||||
void LogParameter::Serialize(RakNet::BitStream *bs) const
|
||||
{
|
||||
unsigned char c = type;
|
||||
bs->Write(c);
|
||||
bs->Write(size);
|
||||
switch (type)
|
||||
{
|
||||
case SQLLPDT_POINTER:
|
||||
case SQLLPDT_BLOB:
|
||||
case SQLLPDT_TEXT:
|
||||
bs->WriteAlignedBytes(data.ucptr, size);
|
||||
break;
|
||||
case SQLLPDT_IMAGE:
|
||||
bs->WriteAlignedBytes(data.ucptr, size);
|
||||
bs->Write(imageWidth);
|
||||
bs->Write(imageHeight);
|
||||
bs->Write(linePitch);
|
||||
bs->Write(input_components);
|
||||
bs->Write(compressionMode);
|
||||
break;
|
||||
case SQLLPDT_REAL:
|
||||
case SQLLPDT_INTEGER:
|
||||
{
|
||||
bs->WriteAlignedBytes((const unsigned char*) &data, size);
|
||||
bs->EndianSwapBytes(bs->GetNumberOfBytesUsed()-size,size);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
bool LogParameter::Deserialize(RakNet::BitStream *bs)
|
||||
{
|
||||
bool b;
|
||||
unsigned char c;
|
||||
bs->Read(c);
|
||||
type=(SQLLoggerPrimaryDataType)c;
|
||||
b=bs->Read(size);
|
||||
if (size==0)
|
||||
{
|
||||
data.vptr=0;
|
||||
return b;
|
||||
}
|
||||
switch (type)
|
||||
{
|
||||
case SQLLPDT_POINTER:
|
||||
case SQLLPDT_BLOB:
|
||||
case SQLLPDT_TEXT:
|
||||
data.vptr=rakMalloc_Ex(size,_FILE_AND_LINE_);
|
||||
b=bs->ReadAlignedBytes(data.ucptr, size);
|
||||
break;
|
||||
case SQLLPDT_IMAGE:
|
||||
data.vptr=rakMalloc_Ex(size,_FILE_AND_LINE_);
|
||||
bs->ReadAlignedBytes(data.ucptr, size);
|
||||
bs->Read(imageWidth);
|
||||
bs->Read(imageHeight);
|
||||
bs->Read(linePitch);
|
||||
bs->Read(input_components);
|
||||
b=bs->Read(compressionMode);
|
||||
break;
|
||||
case SQLLPDT_REAL:
|
||||
case SQLLPDT_INTEGER:
|
||||
{
|
||||
b=bs->ReadAlignedBytes((unsigned char*) &data, size);
|
||||
if (bs->DoEndianSwap())
|
||||
bs->ReverseBytesInPlace((unsigned char *)&data, size);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return b;
|
||||
}
|
||||
void LogParameter::DoNotFree(void)
|
||||
{
|
||||
type=SQLLPDT_COUNT;
|
||||
}
|
||||
void LogParameter::Free(void)
|
||||
{
|
||||
if (type==SQLLPDT_BLOB || type==SQLLPDT_TEXT || type==SQLLPDT_IMAGE || type==SQLLPDT_POINTER)
|
||||
Free(data.vptr);
|
||||
}
|
||||
void LogParameter::Free(void *v)
|
||||
{
|
||||
rakFree_Ex(v,_FILE_AND_LINE_);
|
||||
}
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
// 18 bytes
|
||||
struct TGAHEADER {
|
||||
char idlength;
|
||||
char colourmaptype;
|
||||
char datatypecode;
|
||||
short int colourmaporigin;
|
||||
short int colourmaplength;
|
||||
char colourmapdepth;
|
||||
short int x_origin;
|
||||
short int y_origin;
|
||||
short width;
|
||||
short height;
|
||||
char bitsperpixel;
|
||||
char imagedescriptor;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
void RGBImageBlob::SaveToTGA(const char *filename)
|
||||
{
|
||||
// DirectX Color format in memory is BGRA, and written as such to disk.
|
||||
// Written to disk is the correct side up (point of triangle facing up, as it should). However, TGA displays this incorrectly (upside down)
|
||||
// TGA color format, on disk, is BGRA.
|
||||
// DXT compressor input format is ARGB.
|
||||
|
||||
// http://local.wasp.uwa.edu.au/~pbourke/dataformats/tga/
|
||||
FILE *fptr = fopen(filename, "wb");
|
||||
TGAHEADER h;
|
||||
memset(&h,0,sizeof(h));
|
||||
h.datatypecode=2;
|
||||
h.width=imageWidth;
|
||||
if (BitStream::IsBigEndian()==true)
|
||||
BitStream::ReverseBytesInPlace((unsigned char*) &h.width,sizeof(h.width));
|
||||
h.height=imageHeight;
|
||||
if (BitStream::IsBigEndian()==true)
|
||||
BitStream::ReverseBytesInPlace((unsigned char*) &h.height,sizeof(h.height));
|
||||
h.bitsperpixel=input_components*8;
|
||||
|
||||
// TGAs have a flag indicating if they are upside down or right side up
|
||||
// Be sure to set right side up.
|
||||
// http://www.gamedev.net/community/forums/topic.asp?topic_id=42001
|
||||
h.imagedescriptor=(1<<5);
|
||||
|
||||
fwrite(&h,1,sizeof(h),fptr);
|
||||
|
||||
/*
|
||||
putc(0,fptr);
|
||||
putc(0,fptr);
|
||||
putc(2,fptr);
|
||||
putc(0,fptr); putc(0,fptr);
|
||||
putc(0,fptr); putc(0,fptr);
|
||||
putc(0,fptr);
|
||||
putc(0,fptr); putc(0,fptr);
|
||||
putc(0,fptr); putc(0,fptr);
|
||||
putc((imageWidth & 0x00FF),fptr);
|
||||
putc((imageWidth & 0xFF00) / 256,fptr);
|
||||
putc((imageHeight & 0x00FF),fptr);
|
||||
putc((imageHeight & 0xFF00) / 256,fptr);
|
||||
putc(input_components*8,fptr);
|
||||
putc(0,fptr);
|
||||
*/
|
||||
|
||||
|
||||
for (int row=0; row < imageHeight; row++)
|
||||
{
|
||||
fwrite((char*) data+row*linePitch, input_components, imageWidth, fptr);
|
||||
}
|
||||
fclose(fptr);
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
#ifndef _SQLITE_LOGGER_COMMON_H
|
||||
#define _SQLITE_LOGGER_COMMON_H
|
||||
|
||||
#include <string.h>
|
||||
#include "NativeTypes.h"
|
||||
|
||||
namespace RakNet
|
||||
{
|
||||
class BitStream;
|
||||
|
||||
enum SQLLoggerPrimaryDataType
|
||||
{
|
||||
SQLLPDT_POINTER,
|
||||
SQLLPDT_INTEGER,
|
||||
SQLLPDT_REAL,
|
||||
SQLLPDT_TEXT,
|
||||
SQLLPDT_BLOB,
|
||||
SQLLPDT_IMAGE,
|
||||
SQLLPDT_COUNT,
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
const char *GetSqlDataTypeName(SQLLoggerPrimaryDataType idx);
|
||||
};
|
||||
|
||||
struct BlobDescriptor
|
||||
{
|
||||
BlobDescriptor() {}
|
||||
BlobDescriptor(void *_data, int _size) : data(_data), size(_size) {}
|
||||
void *data;
|
||||
int size;
|
||||
};
|
||||
struct RGBImageBlob
|
||||
{
|
||||
enum ImageBlobCompressionMode
|
||||
{
|
||||
// Fast to compress and read back (1-5 milliseconds to compress depending on image size, server must have NVidia based 3d card)
|
||||
DXT,
|
||||
// Good storage, slow to compress (about 20 milliseconds for 320x200 on my system).
|
||||
JPG
|
||||
};
|
||||
RGBImageBlob() {data=0; imageWidth=0; imageHeight=0; linePitch=0; input_components=0; compressionMode=DXT; sourceFormatIsBGRA=true;}
|
||||
RGBImageBlob(void *_data, uint16_t _imageWidth, uint16_t _imageHeight, uint16_t _linePitch, unsigned char _input_components, bool _sourceFormatIsBGRA=true, ImageBlobCompressionMode mode=DXT) : data(_data), imageWidth(_imageWidth), imageHeight(_imageHeight), linePitch(_linePitch), input_components(_input_components),sourceFormatIsBGRA(_sourceFormatIsBGRA),compressionMode((unsigned char) mode) {}
|
||||
// This is just for testing
|
||||
void SaveToTGA(const char *filename);
|
||||
void *data;
|
||||
uint16_t imageWidth;
|
||||
uint16_t imageHeight;
|
||||
uint16_t linePitch; // bytes per row, may be larger than image width, in which case the excess is discarded
|
||||
unsigned char input_components; // 3 for RGB, 4 for RGBA
|
||||
unsigned char compressionMode;
|
||||
bool sourceFormatIsBGRA; // If true, then G and B will be swapped on the server so that the input is RGBA. This is necessary with Direct3D9
|
||||
};
|
||||
|
||||
#define MAX_SQLLITE_LOGGER_PARAMETERS 12
|
||||
|
||||
struct LogParameter
|
||||
{
|
||||
LogParameter() {}
|
||||
|
||||
/*
|
||||
template <class T> LogParameter(const T t) : type(SQLLPDT_UNKNOWN), size(sizeof(t)), data(&t) {}
|
||||
template <> LogParameter(const void *t) : type(SQLLPDT_POINTER), size(sizeof(t)), data(&t) {}
|
||||
template <> LogParameter(const unsigned char t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(&t) {}
|
||||
template <> LogParameter(const char t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(&t) {}
|
||||
template <> LogParameter(const unsigned int t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(&t) {}
|
||||
template <> LogParameter(const int t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(&t) {}
|
||||
template <> LogParameter(const unsigned short t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(&t) {}
|
||||
template <> LogParameter(const short t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(&t) {}
|
||||
template <> LogParameter(const unsigned long long t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(&t) {}
|
||||
template <> LogParameter(const long long t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(&t) {}
|
||||
template <> LogParameter(const float t) : type(SQLLPDT_REAL), size(sizeof(t)), data(&t) {}
|
||||
template <> LogParameter(const double t) : type(SQLLPDT_REAL), size(sizeof(t)), data(&t) {}
|
||||
template <> LogParameter(const unsigned char *&t) : type(SQLLPDT_TEXT), size((uint32_t) strlen((const char*) t)), data(t) {}
|
||||
template <> LogParameter(const char *t) : type(SQLLPDT_TEXT), size((uint32_t) strlen(t)), data(t) {}
|
||||
template <> LogParameter(const BlobDescriptor *t) : type(SQLLPDT_BLOB), size(t->size), data(t->data) {}
|
||||
template <> LogParameter(const RGBImageBlob *t) : type(SQLLPDT_IMAGE), size(t->size), data(t->data), imageDescriptorFormat(t->imageDescriptorFormat), bytesPerPixel(t->bytesPerPixel), imageWidth(t->imageWidth) {}
|
||||
template <> LogParameter(const BlobDescriptor t) : type(SQLLPDT_BLOB), size(t.size), data(t.data) {}
|
||||
template <> LogParameter(const RGBImageBlob t) : type(SQLLPDT_IMAGE), size(t.size), data(t.data), imageDescriptorFormat(t.imageDescriptorFormat), bytesPerPixel(t.bytesPerPixel), imageWidth(t.imageWidth) {}
|
||||
*/
|
||||
|
||||
LogParameter(void *t) : type(SQLLPDT_POINTER), size(sizeof(t)), data(t) {}
|
||||
LogParameter(unsigned char t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(t) {}
|
||||
LogParameter(char t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(t) {}
|
||||
LogParameter(unsigned int t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(t) {}
|
||||
LogParameter(int t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(t) {}
|
||||
LogParameter(unsigned short t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(t) {}
|
||||
LogParameter(short t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(t) {}
|
||||
LogParameter(unsigned long long t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(t) {}
|
||||
LogParameter(long long t) : type(SQLLPDT_INTEGER), size(sizeof(t)), data(t) {}
|
||||
LogParameter(float t) : type(SQLLPDT_REAL), size(sizeof(t)), data(t) {}
|
||||
LogParameter(double t) : type(SQLLPDT_REAL), size(sizeof(t)), data(t) {}
|
||||
LogParameter(unsigned char *t) : type(SQLLPDT_TEXT), size((uint32_t) strlen((const char*) t)), data(t) {}
|
||||
LogParameter(char *t) : type(SQLLPDT_TEXT), size((uint32_t) strlen(t)), data(t) {}
|
||||
LogParameter(const char t[]) : type(SQLLPDT_TEXT), size((uint32_t) strlen(t)), data(t) {}
|
||||
LogParameter(const unsigned char t[]) : type(SQLLPDT_TEXT), size((uint32_t) strlen((const char*) t)), data(t) {}
|
||||
LogParameter(BlobDescriptor *t) : type(SQLLPDT_BLOB), size(t->size), data(t->data) {}
|
||||
LogParameter(RGBImageBlob *t) : type(SQLLPDT_IMAGE), size(t->linePitch*t->imageHeight), data(t->data), imageWidth(t->imageWidth), imageHeight(t->imageHeight), linePitch(t->linePitch), input_components(t->input_components), compressionMode(t->compressionMode), sourceFormatIsBGRA(t->sourceFormatIsBGRA) {}
|
||||
LogParameter(BlobDescriptor t) : type(SQLLPDT_BLOB), size(t.size), data(t.data) {}
|
||||
LogParameter(RGBImageBlob t) : type(SQLLPDT_IMAGE), size(t.linePitch*t.imageHeight), data(t.data), imageWidth(t.imageWidth), imageHeight(t.imageHeight), linePitch(t.linePitch), input_components(t.input_components), compressionMode(t.compressionMode), sourceFormatIsBGRA(t.sourceFormatIsBGRA) {}
|
||||
|
||||
SQLLoggerPrimaryDataType type;
|
||||
uint32_t size;
|
||||
|
||||
union DataUnion
|
||||
{
|
||||
DataUnion() {}
|
||||
DataUnion(void *t) : vptr(t) {}
|
||||
DataUnion(unsigned char t) : c(t) {}
|
||||
DataUnion(char t) : c(t) {}
|
||||
DataUnion(unsigned int t) : i(t) {}
|
||||
DataUnion(int t) : i(t) {}
|
||||
DataUnion(unsigned short t) : s(t) {}
|
||||
DataUnion(short t) : s(t) {}
|
||||
DataUnion(unsigned long long t) : ll(t) {}
|
||||
DataUnion(long long t) : ll(t) {}
|
||||
DataUnion(float t) : f(t) {}
|
||||
DataUnion(double t) : d(t) {}
|
||||
DataUnion(unsigned char *t) : ucptr(t) {}
|
||||
DataUnion(char *t) : cptr(t) {}
|
||||
DataUnion(const char t[]) : cptr((char*) t) {}
|
||||
DataUnion(const unsigned char t[]) : cptr((char*) t) {}
|
||||
DataUnion(BlobDescriptor *t) : vptr(t->data) {}
|
||||
DataUnion(RGBImageBlob *t) : vptr(t->data) {}
|
||||
DataUnion(const BlobDescriptor &t) : vptr(t.data) {}
|
||||
DataUnion(const RGBImageBlob &t) : vptr(t.data) {}
|
||||
|
||||
void *vptr;
|
||||
char c;
|
||||
int i;
|
||||
short s;
|
||||
long long ll;
|
||||
float f;
|
||||
double d;
|
||||
char *cptr;
|
||||
unsigned char *ucptr;
|
||||
};
|
||||
DataUnion data;
|
||||
|
||||
// Only used for SQLLPDT_IMAGE
|
||||
uint16_t imageWidth;
|
||||
uint16_t imageHeight;
|
||||
uint16_t linePitch; // Pitch is bytes per row
|
||||
unsigned char input_components; // Bytes per pixel
|
||||
unsigned char compressionMode;
|
||||
bool sourceFormatIsBGRA;
|
||||
|
||||
void Serialize(RakNet::BitStream *bs) const;
|
||||
// Don't forget to deallocate after calling Deserialize
|
||||
bool Deserialize(RakNet::BitStream *bs);
|
||||
void DoNotFree(void);
|
||||
void Free(void);
|
||||
static void Free(void *v);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,380 @@
|
||||
/*
|
||||
** 2006 June 7
|
||||
**
|
||||
** The author disclaims copyright to this source code. In place of
|
||||
** a legal notice, here is a blessing:
|
||||
**
|
||||
** May you do good and not evil.
|
||||
** May you find forgiveness for yourself and forgive others.
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** This header file defines the SQLite interface for use by
|
||||
** shared libraries that want to be imported as extensions into
|
||||
** an SQLite instance. Shared libraries that intend to be loaded
|
||||
** as extensions by SQLite should #include this file instead of
|
||||
** sqlite3.h.
|
||||
**
|
||||
** @(#) $Id: sqlite3ext.h,v 1.25 2008/10/12 00:27:54 shane Exp $
|
||||
*/
|
||||
#ifndef _SQLite3EXT_H_
|
||||
#define _SQLite3EXT_H_
|
||||
#include "sqlite3.h"
|
||||
|
||||
typedef struct sqlite3_api_routines sqlite3_api_routines;
|
||||
|
||||
/*
|
||||
** The following structure holds pointers to all of the SQLite API
|
||||
** routines.
|
||||
**
|
||||
** WARNING: In order to maintain backwards compatibility, add new
|
||||
** interfaces to the end of this structure only. If you insert new
|
||||
** interfaces in the middle of this structure, then older different
|
||||
** versions of SQLite will not be able to load each others' shared
|
||||
** libraries!
|
||||
*/
|
||||
struct sqlite3_api_routines {
|
||||
void * (*aggregate_context)(sqlite3_context*,int nBytes);
|
||||
int (*aggregate_count)(sqlite3_context*);
|
||||
int (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*));
|
||||
int (*bind_double)(sqlite3_stmt*,int,double);
|
||||
int (*bind_int)(sqlite3_stmt*,int,int);
|
||||
int (*bind_int64)(sqlite3_stmt*,int,sqlite_int64);
|
||||
int (*bind_null)(sqlite3_stmt*,int);
|
||||
int (*bind_parameter_count)(sqlite3_stmt*);
|
||||
int (*bind_parameter_index)(sqlite3_stmt*,const char*zName);
|
||||
const char * (*bind_parameter_name)(sqlite3_stmt*,int);
|
||||
int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*));
|
||||
int (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*));
|
||||
int (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*);
|
||||
int (*busy_handler)(sqlite3*,int(*)(void*,int),void*);
|
||||
int (*busy_timeout)(sqlite3*,int ms);
|
||||
int (*changes)(sqlite3*);
|
||||
int (*close)(sqlite3*);
|
||||
int (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*,int eTextRep,const char*));
|
||||
int (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*,int eTextRep,const void*));
|
||||
const void * (*column_blob)(sqlite3_stmt*,int iCol);
|
||||
int (*column_bytes)(sqlite3_stmt*,int iCol);
|
||||
int (*column_bytes16)(sqlite3_stmt*,int iCol);
|
||||
int (*column_count)(sqlite3_stmt*pStmt);
|
||||
const char * (*column_database_name)(sqlite3_stmt*,int);
|
||||
const void * (*column_database_name16)(sqlite3_stmt*,int);
|
||||
const char * (*column_decltype)(sqlite3_stmt*,int i);
|
||||
const void * (*column_decltype16)(sqlite3_stmt*,int);
|
||||
double (*column_double)(sqlite3_stmt*,int iCol);
|
||||
int (*column_int)(sqlite3_stmt*,int iCol);
|
||||
sqlite_int64 (*column_int64)(sqlite3_stmt*,int iCol);
|
||||
const char * (*column_name)(sqlite3_stmt*,int);
|
||||
const void * (*column_name16)(sqlite3_stmt*,int);
|
||||
const char * (*column_origin_name)(sqlite3_stmt*,int);
|
||||
const void * (*column_origin_name16)(sqlite3_stmt*,int);
|
||||
const char * (*column_table_name)(sqlite3_stmt*,int);
|
||||
const void * (*column_table_name16)(sqlite3_stmt*,int);
|
||||
const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);
|
||||
const void * (*column_text16)(sqlite3_stmt*,int iCol);
|
||||
int (*column_type)(sqlite3_stmt*,int iCol);
|
||||
sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol);
|
||||
void * (*commit_hook)(sqlite3*,int(*)(void*),void*);
|
||||
int (*complete)(const char*sql);
|
||||
int (*complete16)(const void*sql);
|
||||
int (*create_collation)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*));
|
||||
int (*create_collation16)(sqlite3*,const void*,int,void*,int(*)(void*,int,const void*,int,const void*));
|
||||
int (*create_function)(sqlite3*,const char*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*));
|
||||
int (*create_function16)(sqlite3*,const void*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*));
|
||||
int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);
|
||||
int (*data_count)(sqlite3_stmt*pStmt);
|
||||
sqlite3 * (*db_handle)(sqlite3_stmt*);
|
||||
int (*declare_vtab)(sqlite3*,const char*);
|
||||
int (*enable_shared_cache)(int);
|
||||
int (*errcode)(sqlite3*db);
|
||||
const char * (*errmsg)(sqlite3*);
|
||||
const void * (*errmsg16)(sqlite3*);
|
||||
int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**);
|
||||
int (*expired)(sqlite3_stmt*);
|
||||
int (*finalize)(sqlite3_stmt*pStmt);
|
||||
void (*free)(void*);
|
||||
void (*free_table)(char**result);
|
||||
int (*get_autocommit)(sqlite3*);
|
||||
void * (*get_auxdata)(sqlite3_context*,int);
|
||||
int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**);
|
||||
int (*global_recover)(void);
|
||||
void (*interruptx)(sqlite3*);
|
||||
sqlite_int64 (*last_insert_rowid)(sqlite3*);
|
||||
const char * (*libversion)(void);
|
||||
int (*libversion_number)(void);
|
||||
void *(*malloc)(int);
|
||||
char * (*mprintf)(const char*,...);
|
||||
int (*open)(const char*,sqlite3**);
|
||||
int (*open16)(const void*,sqlite3**);
|
||||
int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
|
||||
int (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
|
||||
void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*);
|
||||
void (*progress_handler)(sqlite3*,int,int(*)(void*),void*);
|
||||
void *(*realloc)(void*,int);
|
||||
int (*reset)(sqlite3_stmt*pStmt);
|
||||
void (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*));
|
||||
void (*result_double)(sqlite3_context*,double);
|
||||
void (*result_error)(sqlite3_context*,const char*,int);
|
||||
void (*result_error16)(sqlite3_context*,const void*,int);
|
||||
void (*result_int)(sqlite3_context*,int);
|
||||
void (*result_int64)(sqlite3_context*,sqlite_int64);
|
||||
void (*result_null)(sqlite3_context*);
|
||||
void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*));
|
||||
void (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*));
|
||||
void (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*));
|
||||
void (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*));
|
||||
void (*result_value)(sqlite3_context*,sqlite3_value*);
|
||||
void * (*rollback_hook)(sqlite3*,void(*)(void*),void*);
|
||||
int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,const char*,const char*),void*);
|
||||
void (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*));
|
||||
char * (*snprintf)(int,char*,const char*,...);
|
||||
int (*step)(sqlite3_stmt*);
|
||||
int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,char const**,char const**,int*,int*,int*);
|
||||
void (*thread_cleanup)(void);
|
||||
int (*total_changes)(sqlite3*);
|
||||
void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*);
|
||||
int (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*);
|
||||
void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,sqlite_int64),void*);
|
||||
void * (*user_data)(sqlite3_context*);
|
||||
const void * (*value_blob)(sqlite3_value*);
|
||||
int (*value_bytes)(sqlite3_value*);
|
||||
int (*value_bytes16)(sqlite3_value*);
|
||||
double (*value_double)(sqlite3_value*);
|
||||
int (*value_int)(sqlite3_value*);
|
||||
sqlite_int64 (*value_int64)(sqlite3_value*);
|
||||
int (*value_numeric_type)(sqlite3_value*);
|
||||
const unsigned char * (*value_text)(sqlite3_value*);
|
||||
const void * (*value_text16)(sqlite3_value*);
|
||||
const void * (*value_text16be)(sqlite3_value*);
|
||||
const void * (*value_text16le)(sqlite3_value*);
|
||||
int (*value_type)(sqlite3_value*);
|
||||
char *(*vmprintf)(const char*,va_list);
|
||||
/* Added ??? */
|
||||
int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
|
||||
/* Added by 3.3.13 */
|
||||
int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
|
||||
int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
|
||||
int (*clear_bindings)(sqlite3_stmt*);
|
||||
/* Added by 3.4.1 */
|
||||
int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,void (*xDestroy)(void *));
|
||||
/* Added by 3.5.0 */
|
||||
int (*bind_zeroblob)(sqlite3_stmt*,int,int);
|
||||
int (*blob_bytes)(sqlite3_blob*);
|
||||
int (*blob_close)(sqlite3_blob*);
|
||||
int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,int,sqlite3_blob**);
|
||||
int (*blob_read)(sqlite3_blob*,void*,int,int);
|
||||
int (*blob_write)(sqlite3_blob*,const void*,int,int);
|
||||
int (*create_collation_v2)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*),void(*)(void*));
|
||||
int (*file_control)(sqlite3*,const char*,int,void*);
|
||||
sqlite3_int64 (*memory_highwater)(int);
|
||||
sqlite3_int64 (*memory_used)(void);
|
||||
sqlite3_mutex *(*mutex_alloc)(int);
|
||||
void (*mutex_enter)(sqlite3_mutex*);
|
||||
void (*mutex_free)(sqlite3_mutex*);
|
||||
void (*mutex_leave)(sqlite3_mutex*);
|
||||
int (*mutex_try)(sqlite3_mutex*);
|
||||
int (*open_v2)(const char*,sqlite3**,int,const char*);
|
||||
int (*release_memory)(int);
|
||||
void (*result_error_nomem)(sqlite3_context*);
|
||||
void (*result_error_toobig)(sqlite3_context*);
|
||||
int (*sleep)(int);
|
||||
void (*soft_heap_limit)(int);
|
||||
sqlite3_vfs *(*vfs_find)(const char*);
|
||||
int (*vfs_register)(sqlite3_vfs*,int);
|
||||
int (*vfs_unregister)(sqlite3_vfs*);
|
||||
int (*xthreadsafe)(void);
|
||||
void (*result_zeroblob)(sqlite3_context*,int);
|
||||
void (*result_error_code)(sqlite3_context*,int);
|
||||
int (*test_control)(int, ...);
|
||||
void (*randomness)(int,void*);
|
||||
sqlite3 *(*context_db_handle)(sqlite3_context*);
|
||||
int (*extended_result_codes)(sqlite3*,int);
|
||||
int (*limit)(sqlite3*,int,int);
|
||||
sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*);
|
||||
const char *(*sql)(sqlite3_stmt*);
|
||||
int (*status)(int,int*,int*,int);
|
||||
};
|
||||
|
||||
/*
|
||||
** The following macros redefine the API routines so that they are
|
||||
** redirected throught the global sqlite3_api structure.
|
||||
**
|
||||
** This header file is also used by the loadext.c source file
|
||||
** (part of the main SQLite library - not an extension) so that
|
||||
** it can get access to the sqlite3_api_routines structure
|
||||
** definition. But the main library does not want to redefine
|
||||
** the API. So the redefinition macros are only valid if the
|
||||
** SQLITE_CORE macros is undefined.
|
||||
*/
|
||||
#ifndef SQLITE_CORE
|
||||
#define sqlite3_aggregate_context sqlite3_api->aggregate_context
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
#define sqlite3_aggregate_count sqlite3_api->aggregate_count
|
||||
#endif
|
||||
#define sqlite3_bind_blob sqlite3_api->bind_blob
|
||||
#define sqlite3_bind_double sqlite3_api->bind_double
|
||||
#define sqlite3_bind_int sqlite3_api->bind_int
|
||||
#define sqlite3_bind_int64 sqlite3_api->bind_int64
|
||||
#define sqlite3_bind_null sqlite3_api->bind_null
|
||||
#define sqlite3_bind_parameter_count sqlite3_api->bind_parameter_count
|
||||
#define sqlite3_bind_parameter_index sqlite3_api->bind_parameter_index
|
||||
#define sqlite3_bind_parameter_name sqlite3_api->bind_parameter_name
|
||||
#define sqlite3_bind_text sqlite3_api->bind_text
|
||||
#define sqlite3_bind_text16 sqlite3_api->bind_text16
|
||||
#define sqlite3_bind_value sqlite3_api->bind_value
|
||||
#define sqlite3_busy_handler sqlite3_api->busy_handler
|
||||
#define sqlite3_busy_timeout sqlite3_api->busy_timeout
|
||||
#define sqlite3_changes sqlite3_api->changes
|
||||
#define sqlite3_close sqlite3_api->close
|
||||
#define sqlite3_collation_needed sqlite3_api->collation_needed
|
||||
#define sqlite3_collation_needed16 sqlite3_api->collation_needed16
|
||||
#define sqlite3_column_blob sqlite3_api->column_blob
|
||||
#define sqlite3_column_bytes sqlite3_api->column_bytes
|
||||
#define sqlite3_column_bytes16 sqlite3_api->column_bytes16
|
||||
#define sqlite3_column_count sqlite3_api->column_count
|
||||
#define sqlite3_column_database_name sqlite3_api->column_database_name
|
||||
#define sqlite3_column_database_name16 sqlite3_api->column_database_name16
|
||||
#define sqlite3_column_decltype sqlite3_api->column_decltype
|
||||
#define sqlite3_column_decltype16 sqlite3_api->column_decltype16
|
||||
#define sqlite3_column_double sqlite3_api->column_double
|
||||
#define sqlite3_column_int sqlite3_api->column_int
|
||||
#define sqlite3_column_int64 sqlite3_api->column_int64
|
||||
#define sqlite3_column_name sqlite3_api->column_name
|
||||
#define sqlite3_column_name16 sqlite3_api->column_name16
|
||||
#define sqlite3_column_origin_name sqlite3_api->column_origin_name
|
||||
#define sqlite3_column_origin_name16 sqlite3_api->column_origin_name16
|
||||
#define sqlite3_column_table_name sqlite3_api->column_table_name
|
||||
#define sqlite3_column_table_name16 sqlite3_api->column_table_name16
|
||||
#define sqlite3_column_text sqlite3_api->column_text
|
||||
#define sqlite3_column_text16 sqlite3_api->column_text16
|
||||
#define sqlite3_column_type sqlite3_api->column_type
|
||||
#define sqlite3_column_value sqlite3_api->column_value
|
||||
#define sqlite3_commit_hook sqlite3_api->commit_hook
|
||||
#define sqlite3_complete sqlite3_api->complete
|
||||
#define sqlite3_complete16 sqlite3_api->complete16
|
||||
#define sqlite3_create_collation sqlite3_api->create_collation
|
||||
#define sqlite3_create_collation16 sqlite3_api->create_collation16
|
||||
#define sqlite3_create_function sqlite3_api->create_function
|
||||
#define sqlite3_create_function16 sqlite3_api->create_function16
|
||||
#define sqlite3_create_module sqlite3_api->create_module
|
||||
#define sqlite3_create_module_v2 sqlite3_api->create_module_v2
|
||||
#define sqlite3_data_count sqlite3_api->data_count
|
||||
#define sqlite3_db_handle sqlite3_api->db_handle
|
||||
#define sqlite3_declare_vtab sqlite3_api->declare_vtab
|
||||
#define sqlite3_enable_shared_cache sqlite3_api->enable_shared_cache
|
||||
#define sqlite3_errcode sqlite3_api->errcode
|
||||
#define sqlite3_errmsg sqlite3_api->errmsg
|
||||
#define sqlite3_errmsg16 sqlite3_api->errmsg16
|
||||
#define sqlite3_exec sqlite3_api->exec
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
#define sqlite3_expired sqlite3_api->expired
|
||||
#endif
|
||||
#define sqlite3_finalize sqlite3_api->finalize
|
||||
#define sqlite3_free sqlite3_api->free
|
||||
#define sqlite3_free_table sqlite3_api->free_table
|
||||
#define sqlite3_get_autocommit sqlite3_api->get_autocommit
|
||||
#define sqlite3_get_auxdata sqlite3_api->get_auxdata
|
||||
#define sqlite3_get_table sqlite3_api->get_table
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
#define sqlite3_global_recover sqlite3_api->global_recover
|
||||
#endif
|
||||
#define sqlite3_interrupt sqlite3_api->interruptx
|
||||
#define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid
|
||||
#define sqlite3_libversion sqlite3_api->libversion
|
||||
#define sqlite3_libversion_number sqlite3_api->libversion_number
|
||||
#define sqlite3_malloc sqlite3_api->malloc
|
||||
#define sqlite3_mprintf sqlite3_api->mprintf
|
||||
#define sqlite3_open sqlite3_api->open
|
||||
#define sqlite3_open16 sqlite3_api->open16
|
||||
#define sqlite3_prepare sqlite3_api->prepare
|
||||
#define sqlite3_prepare16 sqlite3_api->prepare16
|
||||
#define sqlite3_prepare_v2 sqlite3_api->prepare_v2
|
||||
#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
|
||||
#define sqlite3_profile sqlite3_api->profile
|
||||
#define sqlite3_progress_handler sqlite3_api->progress_handler
|
||||
#define sqlite3_realloc sqlite3_api->realloc
|
||||
#define sqlite3_reset sqlite3_api->reset
|
||||
#define sqlite3_result_blob sqlite3_api->result_blob
|
||||
#define sqlite3_result_double sqlite3_api->result_double
|
||||
#define sqlite3_result_error sqlite3_api->result_error
|
||||
#define sqlite3_result_error16 sqlite3_api->result_error16
|
||||
#define sqlite3_result_int sqlite3_api->result_int
|
||||
#define sqlite3_result_int64 sqlite3_api->result_int64
|
||||
#define sqlite3_result_null sqlite3_api->result_null
|
||||
#define sqlite3_result_text sqlite3_api->result_text
|
||||
#define sqlite3_result_text16 sqlite3_api->result_text16
|
||||
#define sqlite3_result_text16be sqlite3_api->result_text16be
|
||||
#define sqlite3_result_text16le sqlite3_api->result_text16le
|
||||
#define sqlite3_result_value sqlite3_api->result_value
|
||||
#define sqlite3_rollback_hook sqlite3_api->rollback_hook
|
||||
#define sqlite3_set_authorizer sqlite3_api->set_authorizer
|
||||
#define sqlite3_set_auxdata sqlite3_api->set_auxdata
|
||||
#define sqlite3_snprintf sqlite3_api->snprintf
|
||||
#define sqlite3_step sqlite3_api->step
|
||||
#define sqlite3_table_column_metadata sqlite3_api->table_column_metadata
|
||||
#define sqlite3_thread_cleanup sqlite3_api->thread_cleanup
|
||||
#define sqlite3_total_changes sqlite3_api->total_changes
|
||||
#define sqlite3_trace sqlite3_api->trace
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
#define sqlite3_transfer_bindings sqlite3_api->transfer_bindings
|
||||
#endif
|
||||
#define sqlite3_update_hook sqlite3_api->update_hook
|
||||
#define sqlite3_user_data sqlite3_api->user_data
|
||||
#define sqlite3_value_blob sqlite3_api->value_blob
|
||||
#define sqlite3_value_bytes sqlite3_api->value_bytes
|
||||
#define sqlite3_value_bytes16 sqlite3_api->value_bytes16
|
||||
#define sqlite3_value_double sqlite3_api->value_double
|
||||
#define sqlite3_value_int sqlite3_api->value_int
|
||||
#define sqlite3_value_int64 sqlite3_api->value_int64
|
||||
#define sqlite3_value_numeric_type sqlite3_api->value_numeric_type
|
||||
#define sqlite3_value_text sqlite3_api->value_text
|
||||
#define sqlite3_value_text16 sqlite3_api->value_text16
|
||||
#define sqlite3_value_text16be sqlite3_api->value_text16be
|
||||
#define sqlite3_value_text16le sqlite3_api->value_text16le
|
||||
#define sqlite3_value_type sqlite3_api->value_type
|
||||
#define sqlite3_vmprintf sqlite3_api->vmprintf
|
||||
#define sqlite3_overload_function sqlite3_api->overload_function
|
||||
#define sqlite3_prepare_v2 sqlite3_api->prepare_v2
|
||||
#define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
|
||||
#define sqlite3_clear_bindings sqlite3_api->clear_bindings
|
||||
#define sqlite3_bind_zeroblob sqlite3_api->bind_zeroblob
|
||||
#define sqlite3_blob_bytes sqlite3_api->blob_bytes
|
||||
#define sqlite3_blob_close sqlite3_api->blob_close
|
||||
#define sqlite3_blob_open sqlite3_api->blob_open
|
||||
#define sqlite3_blob_read sqlite3_api->blob_read
|
||||
#define sqlite3_blob_write sqlite3_api->blob_write
|
||||
#define sqlite3_create_collation_v2 sqlite3_api->create_collation_v2
|
||||
#define sqlite3_file_control sqlite3_api->file_control
|
||||
#define sqlite3_memory_highwater sqlite3_api->memory_highwater
|
||||
#define sqlite3_memory_used sqlite3_api->memory_used
|
||||
#define sqlite3_mutex_alloc sqlite3_api->mutex_alloc
|
||||
#define sqlite3_mutex_enter sqlite3_api->mutex_enter
|
||||
#define sqlite3_mutex_free sqlite3_api->mutex_free
|
||||
#define sqlite3_mutex_leave sqlite3_api->mutex_leave
|
||||
#define sqlite3_mutex_try sqlite3_api->mutex_try
|
||||
#define sqlite3_open_v2 sqlite3_api->open_v2
|
||||
#define sqlite3_release_memory sqlite3_api->release_memory
|
||||
#define sqlite3_result_error_nomem sqlite3_api->result_error_nomem
|
||||
#define sqlite3_result_error_toobig sqlite3_api->result_error_toobig
|
||||
#define sqlite3_sleep sqlite3_api->sleep
|
||||
#define sqlite3_soft_heap_limit sqlite3_api->soft_heap_limit
|
||||
#define sqlite3_vfs_find sqlite3_api->vfs_find
|
||||
#define sqlite3_vfs_register sqlite3_api->vfs_register
|
||||
#define sqlite3_vfs_unregister sqlite3_api->vfs_unregister
|
||||
#define sqlite3_threadsafe sqlite3_api->xthreadsafe
|
||||
#define sqlite3_result_zeroblob sqlite3_api->result_zeroblob
|
||||
#define sqlite3_result_error_code sqlite3_api->result_error_code
|
||||
#define sqlite3_test_control sqlite3_api->test_control
|
||||
#define sqlite3_randomness sqlite3_api->randomness
|
||||
#define sqlite3_context_db_handle sqlite3_api->context_db_handle
|
||||
#define sqlite3_extended_result_codes sqlite3_api->extended_result_codes
|
||||
#define sqlite3_limit sqlite3_api->limit
|
||||
#define sqlite3_next_stmt sqlite3_api->next_stmt
|
||||
#define sqlite3_sql sqlite3_api->sql
|
||||
#define sqlite3_status sqlite3_api->status
|
||||
#endif /* SQLITE_CORE */
|
||||
|
||||
#define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api = 0;
|
||||
#define SQLITE_EXTENSION_INIT2(v) sqlite3_api = v;
|
||||
|
||||
#endif /* _SQLite3EXT_H_ */
|
||||
Reference in New Issue
Block a user