mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-01-31 09:57:14 +01:00
Adjust names of exported module functions to not use the names from previous implementation.
This commit is contained in:
parent
9874bbe1dc
commit
78f5ef7811
@ -31,7 +31,7 @@ static HSQUIRRELVM GetSquirrelVM()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
static SQRESULT SqEx_LoadScript(const SQChar * filepath, SQBool delay)
|
static SQRESULT SqModImpl_LoadScript(const SQChar * filepath, SQBool delay)
|
||||||
{
|
{
|
||||||
// Attempt to add the specified script to the load queue
|
// Attempt to add the specified script to the load queue
|
||||||
if (Core::Get().LoadScript(filepath, delay))
|
if (Core::Get().LoadScript(filepath, delay))
|
||||||
@ -43,7 +43,7 @@ static SQRESULT SqEx_LoadScript(const SQChar * filepath, SQBool delay)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
static SQRESULT SqEx_GetSLongValue(HSQUIRRELVM vm, SQInteger idx, Int64 * num)
|
static SQRESULT SqModImpl_GetSLongValue(HSQUIRRELVM vm, SQInteger idx, Int64 * num)
|
||||||
{
|
{
|
||||||
// Validate the specified number pointer and value type
|
// Validate the specified number pointer and value type
|
||||||
if (!num)
|
if (!num)
|
||||||
@ -100,7 +100,7 @@ static SQRESULT SqEx_GetSLongValue(HSQUIRRELVM vm, SQInteger idx, Int64 * num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
static SQRESULT SqEx_PushSLongObject(HSQUIRRELVM vm, Int64 num)
|
static SQRESULT SqModImpl_PushSLongObject(HSQUIRRELVM vm, Int64 num)
|
||||||
{
|
{
|
||||||
// Attempt to push the requested instance
|
// Attempt to push the requested instance
|
||||||
try
|
try
|
||||||
@ -117,7 +117,7 @@ static SQRESULT SqEx_PushSLongObject(HSQUIRRELVM vm, Int64 num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
static SQRESULT SqEx_GetULongValue(HSQUIRRELVM vm, SQInteger idx, Uint64 * num)
|
static SQRESULT SqModImpl_GetULongValue(HSQUIRRELVM vm, SQInteger idx, Uint64 * num)
|
||||||
{
|
{
|
||||||
// Validate the specified number pointer and value type
|
// Validate the specified number pointer and value type
|
||||||
if (!num)
|
if (!num)
|
||||||
@ -174,7 +174,7 @@ static SQRESULT SqEx_GetULongValue(HSQUIRRELVM vm, SQInteger idx, Uint64 * num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
static SQRESULT SqEx_PushULongObject(HSQUIRRELVM vm, Uint64 num)
|
static SQRESULT SqModImpl_PushULongObject(HSQUIRRELVM vm, Uint64 num)
|
||||||
{
|
{
|
||||||
// Attempt to push the requested instance
|
// Attempt to push the requested instance
|
||||||
try
|
try
|
||||||
@ -191,19 +191,19 @@ static SQRESULT SqEx_PushULongObject(HSQUIRRELVM vm, Uint64 num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQBool SqEx_ValidDate(uint16_t year, uint8_t month, uint8_t day)
|
SQBool SqModImpl_ValidDate(uint16_t year, uint8_t month, uint8_t day)
|
||||||
{
|
{
|
||||||
return Chrono::ValidDate(year, month, day);
|
return Chrono::ValidDate(year, month, day);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQBool SqEx_IsLeapYear(uint16_t year)
|
SQBool SqModImpl_IsLeapYear(uint16_t year)
|
||||||
{
|
{
|
||||||
return Chrono::IsLeapYear(year);
|
return Chrono::IsLeapYear(year);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
static SQRESULT SqEx_GetTimestamp(HSQUIRRELVM vm, SQInteger idx, Int64 * num)
|
static SQRESULT SqModImpl_GetTimestamp(HSQUIRRELVM vm, SQInteger idx, Int64 * num)
|
||||||
{
|
{
|
||||||
// Validate the specified number pointer and value type
|
// Validate the specified number pointer and value type
|
||||||
if (!num)
|
if (!num)
|
||||||
@ -260,7 +260,7 @@ static SQRESULT SqEx_GetTimestamp(HSQUIRRELVM vm, SQInteger idx, Int64 * num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
static SQRESULT SqEx_PushTimestamp(HSQUIRRELVM vm, Int64 num)
|
static SQRESULT SqModImpl_PushTimestamp(HSQUIRRELVM vm, Int64 num)
|
||||||
{
|
{
|
||||||
// Attempt to push the requested instance
|
// Attempt to push the requested instance
|
||||||
try
|
try
|
||||||
@ -277,7 +277,7 @@ static SQRESULT SqEx_PushTimestamp(HSQUIRRELVM vm, Int64 num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQRESULT SqEx_GetDate(HSQUIRRELVM vm, SQInteger idx, uint16_t * year, uint8_t * month, uint8_t * day)
|
SQRESULT SqModImpl_GetDate(HSQUIRRELVM vm, SQInteger idx, uint16_t * year, uint8_t * month, uint8_t * day)
|
||||||
{
|
{
|
||||||
// Is this an instance that we can treat as a Date type?
|
// Is this an instance that we can treat as a Date type?
|
||||||
if (sq_gettype(vm, idx) == OT_INSTANCE)
|
if (sq_gettype(vm, idx) == OT_INSTANCE)
|
||||||
@ -318,7 +318,7 @@ SQRESULT SqEx_GetDate(HSQUIRRELVM vm, SQInteger idx, uint16_t * year, uint8_t *
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQRESULT SqEx_PushDate(HSQUIRRELVM vm, uint16_t year, uint8_t month, uint8_t day)
|
SQRESULT SqModImpl_PushDate(HSQUIRRELVM vm, uint16_t year, uint8_t month, uint8_t day)
|
||||||
{
|
{
|
||||||
// Attempt to push the requested instance
|
// Attempt to push the requested instance
|
||||||
try
|
try
|
||||||
@ -335,7 +335,7 @@ SQRESULT SqEx_PushDate(HSQUIRRELVM vm, uint16_t year, uint8_t month, uint8_t day
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQRESULT SqEx_GetTime(HSQUIRRELVM vm, SQInteger idx, uint8_t * hour, uint8_t * minute,
|
SQRESULT SqModImpl_GetTime(HSQUIRRELVM vm, SQInteger idx, uint8_t * hour, uint8_t * minute,
|
||||||
uint8_t * second, uint16_t * millisecond)
|
uint8_t * second, uint16_t * millisecond)
|
||||||
{
|
{
|
||||||
// Is this an instance that we can treat as a Time type?
|
// Is this an instance that we can treat as a Time type?
|
||||||
@ -382,7 +382,7 @@ SQRESULT SqEx_GetTime(HSQUIRRELVM vm, SQInteger idx, uint8_t * hour, uint8_t * m
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQRESULT SqEx_PushTime(HSQUIRRELVM vm, uint8_t hour, uint8_t minute, uint8_t second,
|
SQRESULT SqModImpl_PushTime(HSQUIRRELVM vm, uint8_t hour, uint8_t minute, uint8_t second,
|
||||||
uint16_t millisecond)
|
uint16_t millisecond)
|
||||||
{
|
{
|
||||||
// Attempt to push the requested instance
|
// Attempt to push the requested instance
|
||||||
@ -400,7 +400,7 @@ SQRESULT SqEx_PushTime(HSQUIRRELVM vm, uint8_t hour, uint8_t minute, uint8_t sec
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQRESULT SqEx_GetDatetime(HSQUIRRELVM vm, SQInteger idx, uint16_t * year, uint8_t * month, uint8_t * day,
|
SQRESULT SqModImpl_GetDatetime(HSQUIRRELVM vm, SQInteger idx, uint16_t * year, uint8_t * month, uint8_t * day,
|
||||||
uint8_t * hour, uint8_t * minute, uint8_t * second, uint16_t * millisecond)
|
uint8_t * hour, uint8_t * minute, uint8_t * second, uint16_t * millisecond)
|
||||||
{
|
{
|
||||||
// Is this an instance that we can treat as a Date-time type?
|
// Is this an instance that we can treat as a Date-time type?
|
||||||
@ -462,7 +462,7 @@ SQRESULT SqEx_GetDatetime(HSQUIRRELVM vm, SQInteger idx, uint16_t * year, uint8_
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQRESULT SqEx_PushDatetime(HSQUIRRELVM vm, uint16_t year, uint8_t month, uint8_t day,
|
SQRESULT SqModImpl_PushDatetime(HSQUIRRELVM vm, uint16_t year, uint8_t month, uint8_t day,
|
||||||
uint8_t hour, uint8_t minute, uint8_t second, uint16_t millisecond)
|
uint8_t hour, uint8_t minute, uint8_t second, uint16_t millisecond)
|
||||||
{
|
{
|
||||||
// Attempt to push the requested instance
|
// Attempt to push the requested instance
|
||||||
@ -480,7 +480,7 @@ SQRESULT SqEx_PushDatetime(HSQUIRRELVM vm, uint16_t year, uint8_t month, uint8_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQRESULT SqEx_PushBuffer(HSQUIRRELVM vm, SQInteger size, SQInteger cursor)
|
SQRESULT SqModImpl_PushBuffer(HSQUIRRELVM vm, SQInteger size, SQInteger cursor)
|
||||||
{
|
{
|
||||||
// Attempt to push the requested instance
|
// Attempt to push the requested instance
|
||||||
try
|
try
|
||||||
@ -497,7 +497,7 @@ SQRESULT SqEx_PushBuffer(HSQUIRRELVM vm, SQInteger size, SQInteger cursor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQRESULT SqEx_PushBufferData(HSQUIRRELVM vm, const char * data, SQInteger size, SQInteger cursor)
|
SQRESULT SqModImpl_PushBufferData(HSQUIRRELVM vm, const char * data, SQInteger size, SQInteger cursor)
|
||||||
{
|
{
|
||||||
// Attempt to push the requested instance
|
// Attempt to push the requested instance
|
||||||
try
|
try
|
||||||
@ -514,7 +514,7 @@ SQRESULT SqEx_PushBufferData(HSQUIRRELVM vm, const char * data, SQInteger size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQRESULT SqEx_GetBufferInfo(HSQUIRRELVM vm, SQInteger idx, const char ** ptr, SQInteger * size, SQInteger * cursor)
|
SQRESULT SqModImpl_GetBufferInfo(HSQUIRRELVM vm, SQInteger idx, const char ** ptr, SQInteger * size, SQInteger * cursor)
|
||||||
{
|
{
|
||||||
// Attempt to obtain the requested information
|
// Attempt to obtain the requested information
|
||||||
try
|
try
|
||||||
@ -568,7 +568,7 @@ SQRESULT SqEx_GetBufferInfo(HSQUIRRELVM vm, SQInteger idx, const char ** ptr, SQ
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
const char * SqEx_GetBufferData(HSQUIRRELVM vm, SQInteger idx)
|
const char * SqModImpl_GetBufferData(HSQUIRRELVM vm, SQInteger idx)
|
||||||
{
|
{
|
||||||
// Attempt to obtain the requested information
|
// Attempt to obtain the requested information
|
||||||
try
|
try
|
||||||
@ -590,7 +590,7 @@ const char * SqEx_GetBufferData(HSQUIRRELVM vm, SQInteger idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQInteger SqEx_GetBufferSize(HSQUIRRELVM vm, SQInteger idx)
|
SQInteger SqModImpl_GetBufferSize(HSQUIRRELVM vm, SQInteger idx)
|
||||||
{
|
{
|
||||||
// Attempt to obtain the requested information
|
// Attempt to obtain the requested information
|
||||||
try
|
try
|
||||||
@ -612,7 +612,7 @@ SQInteger SqEx_GetBufferSize(HSQUIRRELVM vm, SQInteger idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQInteger SqEx_GetBufferCursor(HSQUIRRELVM vm, SQInteger idx)
|
SQInteger SqModImpl_GetBufferCursor(HSQUIRRELVM vm, SQInteger idx)
|
||||||
{
|
{
|
||||||
// Attempt to obtain the requested information
|
// Attempt to obtain the requested information
|
||||||
try
|
try
|
||||||
@ -665,32 +665,32 @@ static int32_t SqExport_PopulateModuleAPI(HSQMODAPI api, size_t size)
|
|||||||
api->LogSFtl = LogSFtl;
|
api->LogSFtl = LogSFtl;
|
||||||
|
|
||||||
//script loading
|
//script loading
|
||||||
api->LoadScript = SqEx_LoadScript;
|
api->LoadScript = SqModImpl_LoadScript;
|
||||||
|
|
||||||
//numeric utilities
|
//numeric utilities
|
||||||
api->GetSLongValue = SqEx_GetSLongValue;
|
api->GetSLongValue = SqModImpl_GetSLongValue;
|
||||||
api->PushSLongObject = SqEx_PushSLongObject;
|
api->PushSLongObject = SqModImpl_PushSLongObject;
|
||||||
api->GetULongValue = SqEx_GetULongValue;
|
api->GetULongValue = SqModImpl_GetULongValue;
|
||||||
api->PushULongObject = SqEx_PushULongObject;
|
api->PushULongObject = SqModImpl_PushULongObject;
|
||||||
|
|
||||||
//time utilities
|
//time utilities
|
||||||
api->GetCurrentSysTime = Chrono::GetCurrentSysTime;
|
api->GetCurrentSysTime = Chrono::GetCurrentSysTime;
|
||||||
api->GetEpochTimeMicro = Chrono::GetEpochTimeMicro;
|
api->GetEpochTimeMicro = Chrono::GetEpochTimeMicro;
|
||||||
api->GetEpochTimeMilli = Chrono::GetEpochTimeMilli;
|
api->GetEpochTimeMilli = Chrono::GetEpochTimeMilli;
|
||||||
api->ValidDate = SqEx_ValidDate;
|
api->ValidDate = SqModImpl_ValidDate;
|
||||||
api->IsLeapYear = SqEx_IsLeapYear;
|
api->IsLeapYear = SqModImpl_IsLeapYear;
|
||||||
api->DaysInYear = Chrono::DaysInYear;
|
api->DaysInYear = Chrono::DaysInYear;
|
||||||
api->DaysInMonth = Chrono::DaysInMonth;
|
api->DaysInMonth = Chrono::DaysInMonth;
|
||||||
api->DayOfYear = Chrono::DayOfYear;
|
api->DayOfYear = Chrono::DayOfYear;
|
||||||
api->DateRangeToSeconds = Chrono::DateRangeToSeconds;
|
api->DateRangeToSeconds = Chrono::DateRangeToSeconds;
|
||||||
api->GetTimestamp = SqEx_GetTimestamp;
|
api->GetTimestamp = SqModImpl_GetTimestamp;
|
||||||
api->PushTimestamp = SqEx_PushTimestamp;
|
api->PushTimestamp = SqModImpl_PushTimestamp;
|
||||||
api->GetDate = SqEx_GetDate;
|
api->GetDate = SqModImpl_GetDate;
|
||||||
api->PushDate = SqEx_PushDate;
|
api->PushDate = SqModImpl_PushDate;
|
||||||
api->GetTime = SqEx_GetTime;
|
api->GetTime = SqModImpl_GetTime;
|
||||||
api->PushTime = SqEx_PushTime;
|
api->PushTime = SqModImpl_PushTime;
|
||||||
api->GetDatetime = SqEx_GetDatetime;
|
api->GetDatetime = SqModImpl_GetDatetime;
|
||||||
api->PushDatetime = SqEx_PushDatetime;
|
api->PushDatetime = SqModImpl_PushDatetime;
|
||||||
|
|
||||||
//stack utilities
|
//stack utilities
|
||||||
api->PopStackInteger = PopStackInteger;
|
api->PopStackInteger = PopStackInteger;
|
||||||
@ -699,12 +699,12 @@ static int32_t SqExport_PopulateModuleAPI(HSQMODAPI api, size_t size)
|
|||||||
api->PopStackULong = PopStackULong;
|
api->PopStackULong = PopStackULong;
|
||||||
|
|
||||||
//buffer utilities
|
//buffer utilities
|
||||||
api->PushBuffer = SqEx_PushBuffer;
|
api->PushBuffer = SqModImpl_PushBuffer;
|
||||||
api->PushBufferData = SqEx_PushBufferData;
|
api->PushBufferData = SqModImpl_PushBufferData;
|
||||||
api->GetBufferInfo = SqEx_GetBufferInfo;
|
api->GetBufferInfo = SqModImpl_GetBufferInfo;
|
||||||
api->GetBufferData = SqEx_GetBufferData;
|
api->GetBufferData = SqModImpl_GetBufferData;
|
||||||
api->GetBufferSize = SqEx_GetBufferSize;
|
api->GetBufferSize = SqModImpl_GetBufferSize;
|
||||||
api->GetBufferCursor = SqEx_GetBufferCursor;
|
api->GetBufferCursor = SqModImpl_GetBufferCursor;
|
||||||
|
|
||||||
return 1; // Successfully populated!
|
return 1; // Successfully populated!
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user