mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
Merge branch 'master' of https://github.com/iSLC/VCMP-SqMod
This commit is contained in:
commit
038a0a5d5f
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,6 +4,7 @@
|
|||||||
*.so
|
*.so
|
||||||
|
|
||||||
# Directories
|
# Directories
|
||||||
|
.*
|
||||||
/bin/*
|
/bin/*
|
||||||
/lib/
|
/lib/
|
||||||
/obj/
|
/obj/
|
||||||
|
48
CMakeLists.txt
Normal file
48
CMakeLists.txt
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.0.2)
|
||||||
|
project(SqMod)
|
||||||
|
|
||||||
|
# Tell CMake where to find our scripts
|
||||||
|
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
|
# Several plugin options
|
||||||
|
option(BUILTIN_RUNTIMES "Include the MinGW runtime into the binary itself." ON)
|
||||||
|
option(FORCE_32BIT_BIN "Create a 32-bit executable binary if the compiler defaults to 64-bit." OFF)
|
||||||
|
option(ENABLE_MYSQL "Enable the MySQL library." OFF)
|
||||||
|
|
||||||
|
# Default to c++14 standard
|
||||||
|
if(CMAKE_VERSION VERSION_LESS "3.1")
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# Apparently the above does not work with cmake from on debian 8
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
|
# Try the standard method as well
|
||||||
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Default to release mode
|
||||||
|
set(CMAKE_BUILD_TYPE "Release")
|
||||||
|
|
||||||
|
# Include mingw runntime into the binary
|
||||||
|
if (GCC OR MINGW)
|
||||||
|
if(BUILTIN_RUNTIMES)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Enable position independent code
|
||||||
|
if (UNIX)
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
endif()
|
||||||
|
# Include VCMP library
|
||||||
|
add_subdirectory(vcmp)
|
||||||
|
# Include Squirrel library
|
||||||
|
add_subdirectory(squirrel)
|
||||||
|
# Include Squat library
|
||||||
|
add_subdirectory(sqrat)
|
||||||
|
# Include SDK library
|
||||||
|
add_subdirectory(sdk)
|
||||||
|
# Include Module library
|
||||||
|
add_subdirectory(module)
|
222
Makefile
222
Makefile
@ -1,222 +0,0 @@
|
|||||||
export SQ_BASEDIR=$(CURDIR)
|
|
||||||
export SQ_MAKE = make
|
|
||||||
export SQ_C_COMPILER = gcc
|
|
||||||
export SQ_PP_COMPILER = g++
|
|
||||||
export SQ_C_LINKER_STATIC = ar
|
|
||||||
export SQ_PP_LINKER_STATIC = ar
|
|
||||||
export SQ_C_LINKER_DYNAMIC = gcc
|
|
||||||
export SQ_PP_LINKER_DYNAMIC = g++
|
|
||||||
export SQ_TARGET_NAME_PREFIX
|
|
||||||
export SQ_C_OPTIONS = -Wall -Wextra -Wno-error -Wno-implicit-fallthrough
|
|
||||||
export SQ_PP_OPTIONS = -std=c++14
|
|
||||||
export SQ_STATIC_LINKER_OPTIONS = -rc -s
|
|
||||||
export SQ_DYNAMIC_LINKER_OPTIONS = -shared
|
|
||||||
export SQ_DYNAMIC_LINKER_OPTIONS_
|
|
||||||
export SQ_DEFINES
|
|
||||||
export SQ_INCLUDES
|
|
||||||
export SQ_LIBRARIES
|
|
||||||
export SQ_MAKE_THREADS = 1
|
|
||||||
export SQ_DEBUG_POSTFIX
|
|
||||||
|
|
||||||
SQ_MAKE += -j$(SQ_MAKE_THREADS)
|
|
||||||
|
|
||||||
ifndef SQ_TARGET_NAME_PREFIX
|
|
||||||
SQ_TARGET_NAME_PREFIX = mod_
|
|
||||||
endif
|
|
||||||
|
|
||||||
export SQ_PLAT
|
|
||||||
export SQ_ARCH
|
|
||||||
export SQ_COMP
|
|
||||||
export SQ_BEXT
|
|
||||||
export SQ_OEXT = o
|
|
||||||
export SQ_LEXT = a
|
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
|
||||||
SQ_PLAT = win
|
|
||||||
SQ_COMP = mingw
|
|
||||||
SQ_BEXT = dll
|
|
||||||
|
|
||||||
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
|
|
||||||
SQ_ARCH = 64
|
|
||||||
else
|
|
||||||
SQ_ARCH = 32
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
SQ_PLAT = linux
|
|
||||||
SQ_COMP = gcc
|
|
||||||
SQ_BEXT = so
|
|
||||||
|
|
||||||
UNAME_P := $(shell uname -p)
|
|
||||||
ifeq ($(UNAME_P),x86_64)
|
|
||||||
SQ_ARCH = 64
|
|
||||||
else
|
|
||||||
SQ_ARCH = 32
|
|
||||||
endif
|
|
||||||
UNAME_M := $(shell uname -m)
|
|
||||||
ifeq ($(UNAME_M),x86_64)
|
|
||||||
SQ_ARCH = 64
|
|
||||||
else
|
|
||||||
SQ_ARCH = 32
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef ARCH
|
|
||||||
SQ_ARCH = $(ARCH)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef DEBUG
|
|
||||||
SQ_DEBUG_POSTFIX = -d
|
|
||||||
endif
|
|
||||||
|
|
||||||
export SQ_INCDIR=$(SQ_BASEDIR)/include
|
|
||||||
export SQ_SHRDIR=$(SQ_BASEDIR)/shared
|
|
||||||
export SQ_MODDIR=$(SQ_BASEDIR)/modules
|
|
||||||
export SQ_EXTDIR=$(SQ_BASEDIR)/external
|
|
||||||
export SQ_BASE_CFGDIR=$(SQ_BASEDIR)/config
|
|
||||||
export SQ_BASE_LIBDIR=$(SQ_BASEDIR)/lib
|
|
||||||
export SQ_BASE_OBJDIR=$(SQ_BASEDIR)/obj
|
|
||||||
export SQ_BASE_BINDIR=$(SQ_BASEDIR)/bin
|
|
||||||
export SQ_CFGDIR=$(SQ_BASE_CFGDIR)/$(SQ_COMP)$(SQ_ARCH)
|
|
||||||
export SQ_LIBDIR=$(SQ_BASE_LIBDIR)/$(SQ_COMP)$(SQ_ARCH)
|
|
||||||
export SQ_OBJDIR=$(SQ_BASE_OBJDIR)/$(SQ_COMP)$(SQ_ARCH)
|
|
||||||
export SQ_BINDIR=$(SQ_BASE_BINDIR)/$(SQ_PLAT)$(SQ_ARCH)$(SQ_DEBUG_POSTFIX)
|
|
||||||
export SQ_OUTDIR=
|
|
||||||
|
|
||||||
ifdef STANDALONE
|
|
||||||
SQ_OUTDIR = $(SQ_BINDIR)/standalone
|
|
||||||
SQ_C_OPTIONS += -static-libgcc -static-libstdc++ -enable-static
|
|
||||||
else
|
|
||||||
SQ_OUTDIR = $(SQ_BINDIR)
|
|
||||||
endif
|
|
||||||
|
|
||||||
SQ_INCLUDES += -I"$(SQ_INCDIR)" -I"$(SQ_EXTDIR)/Common" -I"$(SQ_SHRDIR)" -I"$(SQ_BASE_CFGDIR)/common" -I"$(SQ_CFGDIR)"
|
|
||||||
|
|
||||||
ifndef DEBUG
|
|
||||||
SQ_DEFINES += -DNDEBUG
|
|
||||||
SQ_C_OPTIONS += -O3
|
|
||||||
SQ_DYNAMIC_LINKER_OPTIONS_ += -s
|
|
||||||
else
|
|
||||||
SQ_DEFINES += -D_DEBUG
|
|
||||||
SQ_C_OPTIONS += -g
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(SQ_PLAT),win)
|
|
||||||
SQ_DYNAMIC_LINKER_OPTIONS += -Wl,--dll
|
|
||||||
else
|
|
||||||
SQ_DEFINES += -DLINUX
|
|
||||||
SQ_C_OPTIONS += -fPIC
|
|
||||||
SQ_DYNAMIC_LINKER_OPTIONS += -Wl,-Bsymbolic
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(SQ_ARCH),64)
|
|
||||||
SQ_DEFINES += -D_SQ64
|
|
||||||
SQ_C_OPTIONS += -m64
|
|
||||||
SQ_DYNAMIC_LINKER_OPTIONS_ += -m64
|
|
||||||
else
|
|
||||||
SQ_C_OPTIONS += -m32
|
|
||||||
SQ_DYNAMIC_LINKER_OPTIONS_ += -m32
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef STANDALONE
|
|
||||||
ifeq ($(SQ_PLAT),win)
|
|
||||||
SQ_DYNAMIC_LINKER_OPTIONS_ += -static
|
|
||||||
else
|
|
||||||
SQ_DYNAMIC_LINKER_OPTIONS_ += -Bstatic
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
SQ_DEFINES += -DSCRAT_USE_EXCEPTION -DSCRAT_USE_CXX11_OPTIMIZATIONS
|
|
||||||
|
|
||||||
.PHONY := all
|
|
||||||
|
|
||||||
export SQ_TARGET
|
|
||||||
|
|
||||||
ifdef BUILD
|
|
||||||
SQ_TARGET += build
|
|
||||||
endif
|
|
||||||
ifdef LINK
|
|
||||||
SQ_TARGET += link
|
|
||||||
endif
|
|
||||||
ifdef DEFAULT
|
|
||||||
SQ_TARGET = default
|
|
||||||
endif
|
|
||||||
ifdef CLEAN
|
|
||||||
SQ_TARGET += clean
|
|
||||||
endif
|
|
||||||
|
|
||||||
all: folders mod_squirrel mod_sqlite mod_xml mod_mmdb mod_irc mod_mysql
|
|
||||||
|
|
||||||
mod_squirrel:
|
|
||||||
cd $(SQ_BASEDIR)/source; $(SQ_MAKE) $(SQ_TARGET)
|
|
||||||
|
|
||||||
mod_sqlite:
|
|
||||||
cd $(SQ_MODDIR)/sqlite; $(SQ_MAKE) $(SQ_TARGET)
|
|
||||||
|
|
||||||
mod_xml:
|
|
||||||
cd $(SQ_MODDIR)/xml; $(SQ_MAKE) $(SQ_TARGET)
|
|
||||||
|
|
||||||
mod_mmdb:
|
|
||||||
cd $(SQ_MODDIR)/mmdb; $(SQ_MAKE) $(SQ_TARGET)
|
|
||||||
|
|
||||||
mod_irc:
|
|
||||||
cd $(SQ_MODDIR)/irc; $(SQ_MAKE) $(SQ_TARGET)
|
|
||||||
|
|
||||||
mod_mysql:
|
|
||||||
cd $(SQ_MODDIR)/mysql; $(SQ_MAKE) $(SQ_TARGET)
|
|
||||||
|
|
||||||
mod_sample:
|
|
||||||
cd $(SQ_MODDIR)/sample; $(SQ_MAKE) $(SQ_TARGET)
|
|
||||||
|
|
||||||
build:
|
|
||||||
cd $(SQ_MODDIR)/sqlite; $(SQ_MAKE) build
|
|
||||||
cd $(SQ_MODDIR)/xml; $(SQ_MAKE) build
|
|
||||||
cd $(SQ_MODDIR)/mmdb; $(SQ_MAKE) build
|
|
||||||
cd $(SQ_MODDIR)/irc; $(SQ_MAKE) build
|
|
||||||
cd $(SQ_MODDIR)/mysql; $(SQ_MAKE) build
|
|
||||||
cd source; $(SQ_MAKE) build
|
|
||||||
|
|
||||||
link:
|
|
||||||
cd $(SQ_MODDIR)/sqlite; $(SQ_MAKE) link
|
|
||||||
cd $(SQ_MODDIR)/xml; $(SQ_MAKE) link
|
|
||||||
cd $(SQ_MODDIR)/mmdb; $(SQ_MAKE) link
|
|
||||||
cd $(SQ_MODDIR)/irc; $(SQ_MAKE) link
|
|
||||||
cd $(SQ_MODDIR)/mysql; $(SQ_MAKE) link
|
|
||||||
cd source; $(SQ_MAKE) link
|
|
||||||
|
|
||||||
clean:
|
|
||||||
cd $(SQ_MODDIR)/sqlite; $(SQ_MAKE) clean
|
|
||||||
cd $(SQ_MODDIR)/xml; $(SQ_MAKE) clean
|
|
||||||
cd $(SQ_MODDIR)/mmdb; $(SQ_MAKE) clean
|
|
||||||
cd $(SQ_MODDIR)/irc; $(SQ_MAKE) clean
|
|
||||||
cd $(SQ_MODDIR)/mysql; $(SQ_MAKE) clean
|
|
||||||
cd source; $(SQ_MAKE) clean
|
|
||||||
|
|
||||||
folders:
|
|
||||||
mkdir -p $(SQ_LIBDIR)
|
|
||||||
mkdir -p $(SQ_OUTDIR)
|
|
||||||
mkdir -p $(SQ_OBJDIR)
|
|
||||||
mkdir -p $(SQ_OBJDIR)/source/Base
|
|
||||||
mkdir -p $(SQ_OBJDIR)/source/Entity
|
|
||||||
mkdir -p $(SQ_OBJDIR)/source/Misc
|
|
||||||
mkdir -p $(SQ_OBJDIR)/source/Library/Chrono
|
|
||||||
mkdir -p $(SQ_OBJDIR)/source/Library/Crypt
|
|
||||||
mkdir -p $(SQ_OBJDIR)/source/Library/IO
|
|
||||||
mkdir -p $(SQ_OBJDIR)/source/Library/Numeric
|
|
||||||
mkdir -p $(SQ_OBJDIR)/source/Library/System
|
|
||||||
mkdir -p $(SQ_OBJDIR)/source/Library/Utils
|
|
||||||
mkdir -p $(SQ_OBJDIR)/shared/Base
|
|
||||||
mkdir -p $(SQ_OBJDIR)/external/Common
|
|
||||||
mkdir -p $(SQ_OBJDIR)/external/B64
|
|
||||||
mkdir -p $(SQ_OBJDIR)/external/Hash
|
|
||||||
mkdir -p $(SQ_OBJDIR)/external/LibIRC
|
|
||||||
mkdir -p $(SQ_OBJDIR)/external/MaxmindDB
|
|
||||||
mkdir -p $(SQ_OBJDIR)/external/PUGIXML
|
|
||||||
mkdir -p $(SQ_OBJDIR)/external/SQLite
|
|
||||||
mkdir -p $(SQ_OBJDIR)/external/Squirrel/Lib
|
|
||||||
mkdir -p $(SQ_OBJDIR)/modules/irc
|
|
||||||
mkdir -p $(SQ_OBJDIR)/modules/mmdb/Handle
|
|
||||||
mkdir -p $(SQ_OBJDIR)/modules/mysql/Handle
|
|
||||||
mkdir -p $(SQ_OBJDIR)/modules/mysql/Wrapper
|
|
||||||
mkdir -p $(SQ_OBJDIR)/modules/sqlite/Handle
|
|
||||||
mkdir -p $(SQ_OBJDIR)/modules/xml/Handle
|
|
||||||
mkdir -p $(SQ_OBJDIR)/modules/xml/Wrapper
|
|
@ -1,17 +0,0 @@
|
|||||||
// Compute the path to the scripts folder (use the `ScriptFolder` option from `sqmod.ini`)
|
|
||||||
ScriptsPath <- SqSysPath.Working().Append(SqCore.GetOption("ScriptFolder"));
|
|
||||||
// Log it for debug purposes
|
|
||||||
SqLog.Inf("Booting script from: %s", ScriptsPath.String);
|
|
||||||
// Load the command manager
|
|
||||||
SqCore.LoadScript(true, SqSysPath(ScriptsPath.String).Append("cmd.nut"));
|
|
||||||
// Load event scripts (delay them `true` since we don't need them executed right away)
|
|
||||||
SqCore.LoadScript(true, SqSysPath(ScriptsPath.String).Append("events").Append("blip.nut"));
|
|
||||||
SqCore.LoadScript(true, SqSysPath(ScriptsPath.String).Append("events").Append("checkpoint.nut"));
|
|
||||||
SqCore.LoadScript(true, SqSysPath(ScriptsPath.String).Append("events").Append("custom.nut"));
|
|
||||||
SqCore.LoadScript(true, SqSysPath(ScriptsPath.String).Append("events").Append("keybind.nut"));
|
|
||||||
SqCore.LoadScript(true, SqSysPath(ScriptsPath.String).Append("events").Append("object.nut"));
|
|
||||||
SqCore.LoadScript(true, SqSysPath(ScriptsPath.String).Append("events").Append("pickup.nut"));
|
|
||||||
SqCore.LoadScript(true, SqSysPath(ScriptsPath.String).Append("events").Append("player.nut"));
|
|
||||||
SqCore.LoadScript(true, SqSysPath(ScriptsPath.String).Append("events").Append("server.nut"));
|
|
||||||
SqCore.LoadScript(true, SqSysPath(ScriptsPath.String).Append("events").Append("vehicle.nut"));
|
|
||||||
// Load command scripts (delay them `true` since we don't need them executed right away)
|
|
103
bin/demo/cmd.nut
103
bin/demo/cmd.nut
@ -1,103 +0,0 @@
|
|||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* We need a command manager to be able to create and manage commands.
|
|
||||||
* We also store it in the root table to make it accessible in other scripts.
|
|
||||||
*/
|
|
||||||
g_Cmd <- SqCmd.Manager();
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* This is our global function we give to the command manager to tell whether someone is allowed
|
|
||||||
* or not to execute a certain function. If this function returns false, the command is ignored
|
|
||||||
*/
|
|
||||||
g_Cmd.BindAuth(this, function(player, command) {
|
|
||||||
// I guess we can use the default authority level to make the decision :/
|
|
||||||
return (player.Authority >= command.Authority);
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* General purpose error handler for a command manager.
|
|
||||||
* Otherwise the player doesn't know why a command failed.
|
|
||||||
*/
|
|
||||||
g_Cmd.BindFail(this, function(type, msg, payload) {
|
|
||||||
// Retrieve the player that executed the command
|
|
||||||
local player = g_Cmd.Invoker;
|
|
||||||
// See if the invoker even exists
|
|
||||||
if (!player || typeof(player) != "SqPlayer") {
|
|
||||||
return; // No one to report!
|
|
||||||
}
|
|
||||||
// Let players know how to get in contact with the owner
|
|
||||||
local contact = SqCore.GetOptionOr("OwnerContact", "no.email@to.me");
|
|
||||||
// Identify the error type
|
|
||||||
switch (type) {
|
|
||||||
// The command failed for unknown reasons
|
|
||||||
case SqCmdErr.Unknown: {
|
|
||||||
player.Message("Unable to execute the command for reasons unknown");
|
|
||||||
player.Message("=> Please contact the owner: %s", contact);
|
|
||||||
} break;
|
|
||||||
// The command failed to execute because there was nothing to execute
|
|
||||||
case SqCmdErr.EmptyCommand: {
|
|
||||||
player.Message("Cannot execute an empty command");
|
|
||||||
} break;
|
|
||||||
// The command failed to execute because the command name was invalid after processing
|
|
||||||
case SqCmdErr.InvalidCommand: {
|
|
||||||
player.Message("The specified command name is invalid");
|
|
||||||
} break;
|
|
||||||
// The command failed to execute because there was a syntax error in the arguments
|
|
||||||
case SqCmdErr.SyntaxError: {
|
|
||||||
player.Message("There was a syntax error in argument: %d", payload);
|
|
||||||
} break;
|
|
||||||
// The command failed to execute because there was no such command
|
|
||||||
case SqCmdErr.UnknownCommand: {
|
|
||||||
player.Message("The specified command does no exist");
|
|
||||||
} break;
|
|
||||||
// The command failed to execute because the it's currently suspended
|
|
||||||
case SqCmdErr.ListenerSuspended: {
|
|
||||||
player.Message("The requested command is currently suspended");
|
|
||||||
} break;
|
|
||||||
// The command failed to execute because the invoker does not have the proper authority
|
|
||||||
case SqCmdErr.InsufficientAuth: {
|
|
||||||
player.Message("You don't have the proper authority to execute this command");
|
|
||||||
} break;
|
|
||||||
// The command failed to execute because there was no callback to handle the execution
|
|
||||||
case SqCmdErr.MissingExecuter: {
|
|
||||||
player.Message("The specified command is not being processed");
|
|
||||||
} break;
|
|
||||||
// The command was unable to execute because the argument limit was not reached
|
|
||||||
case SqCmdErr.IncompleteArgs: {
|
|
||||||
player.Message("The specified command requires at least %d arguments", payload);
|
|
||||||
} break;
|
|
||||||
// The command was unable to execute because the argument limit was exceeded
|
|
||||||
case SqCmdErr.ExtraneousArgs: {
|
|
||||||
player.Message("The specified command requires no more than %d arguments", payload);
|
|
||||||
} break;
|
|
||||||
// Command was unable to execute due to argument type mismatch
|
|
||||||
case SqCmdErr.UnsupportedArg: {
|
|
||||||
player.Message("Argument %d requires a different type than the one you specified", payload);
|
|
||||||
} break;
|
|
||||||
// The command arguments contained more data than the internal buffer can handle
|
|
||||||
case SqCmdErr.BufferOverflow: {
|
|
||||||
player.Message("An internal error occurred and the execution was aborted");
|
|
||||||
player.Message("=> Please contact the owner: %s", contact);
|
|
||||||
} break;
|
|
||||||
// The command failed to complete execution due to a runtime exception
|
|
||||||
case SqCmdErr.ExecutionFailed: {
|
|
||||||
player.Message("The command failed to complete the execution properly");
|
|
||||||
player.Message("=> Please contact the owner: %s", contact);
|
|
||||||
} break;
|
|
||||||
// The command completed the execution but returned a negative result
|
|
||||||
case SqCmdErr.ExecutionAborted: {
|
|
||||||
player.Message("The command execution was aborted and therefore had no effect");
|
|
||||||
} break;
|
|
||||||
// The post execution callback failed to execute due to a runtime exception
|
|
||||||
case SqCmdErr.PostProcessingFailed: {
|
|
||||||
player.Message("The command post-processing stage failed to complete properly");
|
|
||||||
player.Message("=> Please contact the owner: %s", contact);
|
|
||||||
} break;
|
|
||||||
// The callback that was supposed to deal with the failure also failed due to a runtime exception
|
|
||||||
case SqCmdErr.UnresolvedFailure: {
|
|
||||||
player.Message("Unable to resolve the failures during command execution");
|
|
||||||
player.Message("=> Please contact the owner: %s", contact);
|
|
||||||
} break;
|
|
||||||
// Something bad happened and no one knows what
|
|
||||||
default: {
|
|
||||||
SqLog.Inf("Command failed to execute because [%s][%s]", msg, ""+payload);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
@ -1,19 +0,0 @@
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: BlipCreated
|
|
||||||
*/
|
|
||||||
SqCore.On().BlipCreated.Connect(function(/*SqBlip*/ blip, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: BlipDestroyed
|
|
||||||
*/
|
|
||||||
SqCore.On().BlipDestroyed.Connect(function(/*SqBlip*/ blip, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: BlipCustom
|
|
||||||
*/
|
|
||||||
SqCore.On().BlipCustom.Connect(function(/*SqBlip*/ blip, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
@ -1,49 +0,0 @@
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: CheckpointCreated
|
|
||||||
*/
|
|
||||||
SqCore.On().CheckpointCreated.Connect(function(/*SqCheckpoint*/ checkpoint, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: CheckpointDestroyed
|
|
||||||
*/
|
|
||||||
SqCore.On().CheckpointDestroyed.Connect(function(/*SqCheckpoint*/ checkpoint, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: CheckpointCustom
|
|
||||||
*/
|
|
||||||
SqCore.On().CheckpointCustom.Connect(function(/*SqCheckpoint*/ checkpoint, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: CheckpointStream
|
|
||||||
*/
|
|
||||||
SqCore.On().CheckpointStream.Connect(function(/*SqPlayer*/ client, /*SqCheckpoint*/ checkpoint, /*bool*/ is_deleted) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: CheckpointEntered
|
|
||||||
*/
|
|
||||||
SqCore.On().CheckpointEntered.Connect(function(/*SqCheckpoint*/ checkpoint, /*SqPlayer*/ player) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: CheckpointExited
|
|
||||||
*/
|
|
||||||
SqCore.On().CheckpointExited.Connect(function(/*SqCheckpoint*/ checkpoint, /*SqPlayer*/ player) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: CheckpointWorld
|
|
||||||
*/
|
|
||||||
SqCore.On().CheckpointWorld.Connect(function(/*SqCheckpoint*/ checkpoint, /*int*/ old_world, /*int*/ new_world) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: CheckpointRadius
|
|
||||||
*/
|
|
||||||
SqCore.On().CheckpointRadius.Connect(function(/*SqCheckpoint*/ checkpoint, /*float*/ old_radius, /*float*/ new_radius) {
|
|
||||||
|
|
||||||
});
|
|
@ -1,6 +0,0 @@
|
|||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: CustomEvent
|
|
||||||
*/
|
|
||||||
SqCore.On().CustomEvent.Connect(function(/*int*/ group, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
@ -1,19 +0,0 @@
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: KeybindCreated
|
|
||||||
*/
|
|
||||||
SqCore.On().KeybindCreated.Connect(function(/*SqKeybind*/ keybind, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: KeybindDestroyed
|
|
||||||
*/
|
|
||||||
SqCore.On().KeybindDestroyed.Connect(function(/*SqKeybind*/ keybind, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: KeybindCustom
|
|
||||||
*/
|
|
||||||
SqCore.On().KeybindCustom.Connect(function(/*SqKeybind*/ keybind, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
@ -1,55 +0,0 @@
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ObjectCreated
|
|
||||||
*/
|
|
||||||
SqCore.On().ObjectCreated.Connect(function(/*SqObject*/ object, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ObjectDestroyed
|
|
||||||
*/
|
|
||||||
SqCore.On().ObjectDestroyed.Connect(function(/*SqObject*/ object, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ObjectCustom
|
|
||||||
*/
|
|
||||||
SqCore.On().ObjectCustom.Connect(function(/*SqObject*/ object, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ObjectStream
|
|
||||||
*/
|
|
||||||
SqCore.On().ObjectStream.Connect(function(/*SqPlayer*/ client, /*SqObject*/ object, /*bool*/ is_deleted) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ObjectShot
|
|
||||||
*/
|
|
||||||
SqCore.On().ObjectShot.Connect(function(/*SqObject*/ object, /*SqPlayer*/ player, /*int*/ weapon_id) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ObjectTouched
|
|
||||||
*/
|
|
||||||
SqCore.On().ObjectTouched.Connect(function(/*SqObject*/ object, /*SqPlayer*/ player) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ObjectWorld
|
|
||||||
*/
|
|
||||||
SqCore.On().ObjectWorld.Connect(function(/*SqObject*/ object, /*int*/ old_world, /*int*/ new_world) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ObjectAlpha
|
|
||||||
*/
|
|
||||||
SqCore.On().ObjectAlpha.Connect(function(/*SqObject*/ object, /*int*/ old_alpha, /*int*/ new_alpha, /*int*/ time) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ObjectReport
|
|
||||||
*/
|
|
||||||
SqCore.On().ObjectReport.Connect(function(/*SqObject*/ object, /*bool*/ old_status, /*bool*/ new_status, /*bool*/ touched) {
|
|
||||||
|
|
||||||
});
|
|
@ -1,73 +0,0 @@
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PickupCreated
|
|
||||||
*/
|
|
||||||
SqCore.On().PickupCreated.Connect(function(/*SqPickup*/ pickup, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PickupDestroyed
|
|
||||||
*/
|
|
||||||
SqCore.On().PickupDestroyed.Connect(function(/*SqPickup*/ pickup, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PickupCustom
|
|
||||||
*/
|
|
||||||
SqCore.On().PickupCustom.Connect(function(/*SqPickup*/ pickup, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PickupStream
|
|
||||||
*/
|
|
||||||
SqCore.On().PickupStream.Connect(function(/*SqPlayer*/ client, /*SqPickup*/ pickup, /*bool*/ is_deleted) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PickupClaimed
|
|
||||||
*/
|
|
||||||
SqCore.On().PickupClaimed.Connect(function(/*SqPickup*/ pickup, /*SqPlayer*/ player) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PickupCollected
|
|
||||||
*/
|
|
||||||
SqCore.On().PickupCollected.Connect(function(/*SqPickup*/ pickup, /*SqPlayer*/ player) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PickupRespawn
|
|
||||||
*/
|
|
||||||
SqCore.On().PickupRespawn.Connect(function(/*SqPickup*/ pickup) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PickupWorld
|
|
||||||
*/
|
|
||||||
SqCore.On().PickupWorld.Connect(function(/*SqPickup*/ pickup, /*int*/ old_world, /*int*/ new_world) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PickupAlpha
|
|
||||||
*/
|
|
||||||
SqCore.On().PickupAlpha.Connect(function(/*SqPickup*/ pickup, /*int*/ old_alpha, /*int*/ new_alpha) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PickupAutomatic
|
|
||||||
*/
|
|
||||||
SqCore.On().PickupAutomatic.Connect(function(/*SqPickup*/ pickup, /*bool*/ old_status, /*bool*/ new_status) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PickupAutoTimer
|
|
||||||
*/
|
|
||||||
SqCore.On().PickupAutoTimer.Connect(function(/*SqPickup*/ pickup, /*int*/ old_timer, /*int*/ new_timer) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PickupOption
|
|
||||||
*/
|
|
||||||
SqCore.On().PickupOption.Connect(function(/*SqPickup*/ pickup, /*int*/ option_id, /*bool*/ value, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
@ -1,427 +0,0 @@
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerCreated
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerCreated.Connect(function(/*SqPlayer*/ player, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerDestroyed
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerDestroyed.Connect(function(/*SqPlayer*/ player, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerCustom
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerCustom.Connect(function(/*SqPlayer*/ player, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerStream
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerStream.Connect(function(/*SqPlayer*/ client, /*SqPlayer*/ player, /*bool*/ is_deleted) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerRequestClass
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerRequestClass.Connect(function(/*SqPlayer*/ player, offset) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerRequestSpawn
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerRequestSpawn.Connect(function(/*SqPlayer*/ player) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerSpawn
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerSpawn.Connect(function(/*SqPlayer*/ player) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerWasted
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerWasted.Connect(function(/*SqPlayer*/ player, /*int*/ reason) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerKilled
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerKilled.Connect(function(/*SqPlayer*/ player, /*SqPlayer*/ killer, /*int*/ reason, /*int*/ body_part, /*bool*/ team_kill) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerEmbarking
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerEmbarking.Connect(function(/*SqPlayer*/ player, /*SqVehicle*/ vehicle, /*int*/ slot) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerEmbarked
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerEmbarked.Connect(function(/*SqPlayer*/ player, /*SqVehicle*/ vehicle, /*int*/ slot) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerDisembark
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerDisembark.Connect(function(/*SqPlayer*/ player, /*SqVehicle*/ vehicle) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerRename
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerRename.Connect(function(/*SqPlayer*/ player, /*string*/ old_name, /*string*/ new_name) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerState
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerState.Connect(function(/*SqPlayer*/ player, /*int*/ old_state, /*int*/ new_state) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: StateNone
|
|
||||||
*/
|
|
||||||
SqCore.On().StateNone.Connect(function(/*SqPlayer*/ player, /*int*/ old_state) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: StateNormal
|
|
||||||
*/
|
|
||||||
SqCore.On().StateNormal.Connect(function(/*SqPlayer*/ player, /*int*/ old_state) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: StateAim
|
|
||||||
*/
|
|
||||||
SqCore.On().StateAim.Connect(function(/*SqPlayer*/ player, /*int*/ old_state) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: StateDriver
|
|
||||||
*/
|
|
||||||
SqCore.On().StateDriver.Connect(function(/*SqPlayer*/ player, /*int*/ old_state) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: StatePassenger
|
|
||||||
*/
|
|
||||||
SqCore.On().StatePassenger.Connect(function(/*SqPlayer*/ player, /*int*/ old_state) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: StateEnterDriver
|
|
||||||
*/
|
|
||||||
SqCore.On().StateEnterDriver.Connect(function(/*SqPlayer*/ player, /*int*/ old_state) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: StateEnterPassenger
|
|
||||||
*/
|
|
||||||
SqCore.On().StateEnterPassenger.Connect(function(/*SqPlayer*/ player, /*int*/ old_state) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: StateExit
|
|
||||||
*/
|
|
||||||
SqCore.On().StateExit.Connect(function(/*SqPlayer*/ player, /*int*/ old_state) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: StateUnspawned
|
|
||||||
*/
|
|
||||||
SqCore.On().StateUnspawned.Connect(function(/*SqPlayer*/ player, /*int*/ old_state) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerAction
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerAction.Connect(function(/*SqPlayer*/ player, /*int*/ old_action, /*int*/ new_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ActionNone
|
|
||||||
*/
|
|
||||||
SqCore.On().ActionNone.Connect(function(/*SqPlayer*/ player, /*int*/ old_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ActionNormal
|
|
||||||
*/
|
|
||||||
SqCore.On().ActionNormal.Connect(function(/*SqPlayer*/ player, /*int*/ old_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ActionAiming
|
|
||||||
*/
|
|
||||||
SqCore.On().ActionAiming.Connect(function(/*SqPlayer*/ player, /*int*/ old_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ActionShooting
|
|
||||||
*/
|
|
||||||
SqCore.On().ActionShooting.Connect(function(/*SqPlayer*/ player, /*int*/ old_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ActionJumping
|
|
||||||
*/
|
|
||||||
SqCore.On().ActionJumping.Connect(function(/*SqPlayer*/ player, /*int*/ old_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ActionLieDown
|
|
||||||
*/
|
|
||||||
SqCore.On().ActionLieDown.Connect(function(/*SqPlayer*/ player, /*int*/ old_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ActionGettingUp
|
|
||||||
*/
|
|
||||||
SqCore.On().ActionGettingUp.Connect(function(/*SqPlayer*/ player, /*int*/ old_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ActionJumpVehicle
|
|
||||||
*/
|
|
||||||
SqCore.On().ActionJumpVehicle.Connect(function(/*SqPlayer*/ player, /*int*/ old_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ActionDriving
|
|
||||||
*/
|
|
||||||
SqCore.On().ActionDriving.Connect(function(/*SqPlayer*/ player, /*int*/ old_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ActionDying
|
|
||||||
*/
|
|
||||||
SqCore.On().ActionDying.Connect(function(/*SqPlayer*/ player, /*int*/ old_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ActionWasted
|
|
||||||
*/
|
|
||||||
SqCore.On().ActionWasted.Connect(function(/*SqPlayer*/ player, /*int*/ old_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ActionEmbarking
|
|
||||||
*/
|
|
||||||
SqCore.On().ActionEmbarking.Connect(function(/*SqPlayer*/ player, /*int*/ old_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ActionDisembarking
|
|
||||||
*/
|
|
||||||
SqCore.On().ActionDisembarking.Connect(function(/*SqPlayer*/ player, /*int*/ old_action) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerBurning
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerBurning.Connect(function(/*SqPlayer*/ player, /*bool*/ is_on_fire) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerCrouching
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerCrouching.Connect(function(/*SqPlayer*/ player, /*bool*/ is_crouching) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerGameKeys
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerGameKeys.Connect(function(/*SqPlayer*/ player, /*int*/ old_keys, /*int*/ new_keys) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerStartTyping
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerStartTyping.Connect(function(/*SqPlayer*/ player) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerStopTyping
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerStopTyping.Connect(function(/*SqPlayer*/ player) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerAway
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerAway.Connect(function(/*SqPlayer*/ player, /*bool*/ is_away) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerMessage
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerMessage.Connect(function(/*SqPlayer*/ player, /*string*/ message) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerCommand
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerCommand.Connect(function(/*SqPlayer*/ player, /*string*/ message) {
|
|
||||||
g_Cmd.Run(player, command); // Forward this command to the command manager
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerPrivateMessage
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerPrivateMessage.Connect(function(/*SqPlayer*/ player, /*SqPlayer*/ target_player, /*string*/ message) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerKeyPress
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerKeyPress.Connect(function(/*SqPlayer*/ player, /*SqKeybind*/ bind) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerKeyRelease
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerKeyRelease.Connect(function(/*SqPlayer*/ player, /*SqKeybind*/ bind) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerSpectate
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerSpectate.Connect(function(/*SqPlayer*/ player, /*SqPlayer*/ target_player) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerUnspectate
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerUnspectate.Connect(function(/*SqPlayer*/ player) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerCrashreport
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerCrashreport.Connect(function(/*SqPlayer*/ player, /*string*/ report) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerModuleList
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerModuleList.Connect(function(/*SqPlayer*/ player, /*string*/ list) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ClientScriptData
|
|
||||||
*/
|
|
||||||
SqCore.On().ClientScriptData.Connect(function(/*SqPlayer*/ player, /*SqBuffer*/ data, /*int*/ size) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerUpdate
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerUpdate.Connect(function(/*SqPlayer*/ player, /*int*/ update_type) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerHealth
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerHealth.Connect(function(/*SqPlayer*/ player, /*float*/ old_health, /*float*/ new_health) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerArmour
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerArmour.Connect(function(/*SqPlayer*/ player, /*float*/ old_armour, /*float*/ new_armour) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerWeapon
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerWeapon.Connect(function(/*SqPlayer*/ player, /*int*/ old_weapon, /*int*/ new_weapon) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerHeading
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerHeading.Connect(function(/*SqPlayer*/ player, /*float*/ old_heading, /*float*/ new_heading) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerPosition
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerPosition.Connect(function(/*SqPlayer*/ player, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerOption
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerOption.Connect(function(/*SqPlayer*/ player, /*int*/ option_id, /*bool*/ value, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerAdmin
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerAdmin.Connect(function(/*SqPlayer*/ player, /*bool*/ old_status, /*bool*/ new_status) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerWorld
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerWorld.Connect(function(/*SqPlayer*/ player, /*int*/ old_world, /*int*/ new_world, /*bool*/ secondary) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerTeam
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerTeam.Connect(function(/*SqPlayer*/ player, /*int*/ old_team, /*int*/ new_team) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerSkin
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerSkin.Connect(function(/*SqPlayer*/ player, /*int*/ old_skin, /*int*/ new_skin) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerMoney
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerMoney.Connect(function(/*SqPlayer*/ player, /*int*/ old_money, /*int*/ new_money) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerScore
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerScore.Connect(function(/*SqPlayer*/ player, /*int*/ old_score, /*int*/ new_score) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerWantedLevel
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerWantedLevel.Connect(function(/*SqPlayer*/ player, /*int*/ old_level, /*int*/ new_level) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerImmunity
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerImmunity.Connect(function(/*SqPlayer*/ player, /*int*/ old_immunity, /*int*/ new_immunity) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerAlpha
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerAlpha.Connect(function(/*SqPlayer*/ player, /*int*/ old_alpha, /*int*/ new_alpha, /*int*/ fade) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerEnterArea
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerEnterArea.Connect(function(/*SqPlayer*/ player, /*SqArea*/ area) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: PlayerLeaveArea
|
|
||||||
*/
|
|
||||||
SqCore.On().PlayerLeaveArea.Connect(function(/*SqPlayer*/ player, /*SqArea*/ area) {
|
|
||||||
|
|
||||||
});
|
|
@ -1,55 +0,0 @@
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ServerStartup
|
|
||||||
*/
|
|
||||||
SqCore.On().ServerStartup.Connect(function(/*...*/) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ServerShutdown
|
|
||||||
*/
|
|
||||||
SqCore.On().ServerShutdown.Connect(function(/*...*/) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ServerFrame
|
|
||||||
*/
|
|
||||||
SqCore.On().ServerFrame.Connect(function(/*float*/ elapsed_time) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: IncomingConnection
|
|
||||||
*/
|
|
||||||
SqCore.On().IncomingConnection.Connect(function(/*string*/ player_name, /*int*/ name_buffer_size, /*string*/ user_password, /*string*/ ip_address) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: EntityPool
|
|
||||||
*/
|
|
||||||
SqCore.On().EntityPool.Connect(function(/*int*/ entity_type, /*Sq[Entity]*/ entity, /*bool*/ is_deleted) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: EntityStream
|
|
||||||
*/
|
|
||||||
SqCore.On().EntityStream.Connect(function(/*SqPlayer*/ player, /*Sq[Entity]*/ entity, /*int*/ entity_type, /*bool*/ is_deleted) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ServerOption
|
|
||||||
*/
|
|
||||||
SqCore.On().ServerOption.Connect(function(/*int*/ option, /*bool*/ value, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ScriptReload
|
|
||||||
*/
|
|
||||||
SqCore.On().ScriptReload.Connect(function(/*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: ScriptLoaded
|
|
||||||
*/
|
|
||||||
SqCore.On().ScriptLoaded.Connect(function(/*...*/) {
|
|
||||||
|
|
||||||
});
|
|
@ -1,127 +0,0 @@
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleCreated
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleCreated.Connect(function(/*SqVehicle*/ vehicle, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleDestroyed
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleDestroyed.Connect(function(/*SqVehicle*/ vehicle, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleCustom
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleCustom.Connect(function(/*SqVehicle*/ vehicle, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleStream
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleStream.Connect(function(/*SqPlayer*/ client, /*SqVehicle*/ vehicle, /*bool*/ is_deleted) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleExplode
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleExplode.Connect(function(/*SqVehicle*/ vehicle) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleRespawn
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleRespawn.Connect(function(/*SqVehicle*/ vehicle) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleUpdate
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleUpdate.Connect(function(/*SqVehicle*/ vehicle, /*int*/ update_type) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleColor
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleColor.Connect(function(/*SqVehicle*/ vehicle, /*int*/ changed) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleHealth
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleHealth.Connect(function(/*SqVehicle*/ vehicle, /*float*/ old_health, /*float*/ new_health) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehiclePosition
|
|
||||||
*/
|
|
||||||
SqCore.On().VehiclePosition.Connect(function(/*SqVehicle*/ vehicle) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleRotation
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleRotation.Connect(function(/*SqVehicle*/ vehicle) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleOption
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleOption.Connect(function(/*SqVehicle*/ vehicle, /*int*/ option_id, /*bool*/ value, /*int*/ header, /*object*/ payload) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleWorld
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleWorld.Connect(function(/*SqVehicle*/ vehicle, /*int*/ old_world, /*int*/ new_world) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleImmunity
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleImmunity.Connect(function(/*SqVehicle*/ vehicle, /*int*/ old_immunity, /*int*/ new_immunity) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehiclePartStatus
|
|
||||||
*/
|
|
||||||
SqCore.On().VehiclePartStatus.Connect(function(/*SqVehicle*/ vehicle, /*int*/ part, /*int*/ old_status, /*int*/ new_status) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleTyreStatus
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleTyreStatus.Connect(function(/*SqVehicle*/ vehicle, /*int*/ tyre, /*int*/ old_status, /*int*/ new_status) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleDamageData
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleDamageData.Connect(function(/*SqVehicle*/ vehicle, /*int*/ old_data, /*int*/ new_data) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleRadio
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleRadio.Connect(function(/*SqVehicle*/ vehicle, /*int*/ old_radio, /*int*/ new_radio) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleHandlingRule
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleHandlingRule.Connect(function(/*SqVehicle*/ vehicle, /*int*/ rule, /*float*/ old_data, /*float*/ new_data) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleEnterArea
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleEnterArea.Connect(function(/*SqVehicle*/ vehicle, /*SqArea*/ area) {
|
|
||||||
|
|
||||||
});
|
|
||||||
/* --------------------------------------------------------------------------------------------------------------------
|
|
||||||
* Bind to global event: VehicleLeaveArea
|
|
||||||
*/
|
|
||||||
SqCore.On().VehicleLeaveArea.Connect(function(/*SqVehicle*/ vehicle, /*SqArea*/ area) {
|
|
||||||
|
|
||||||
});
|
|
453
cbp/ModIRC.cbp
453
cbp/ModIRC.cbp
@ -1,453 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_project_file>
|
|
||||||
<FileVersion major="1" minor="6" />
|
|
||||||
<Project>
|
|
||||||
<Option title="Mod IRC" />
|
|
||||||
<Option pch_mode="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Build>
|
|
||||||
<Target title="Win32 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/mod_irc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-DWIN32" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/mod_irc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-DWIN32" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/mod_irc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-DWIN32" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/mod_irc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-DWIN32" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/mod_irc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/mod_irc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/mod_irc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/mod_irc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/standalone/mod_irc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-DWIN32" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/standalone/mod_irc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-DWIN32" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/standalone/mod_irc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-DWIN32" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/standalone/mod_irc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-DWIN32" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/standalone/mod_irc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/standalone/mod_irc32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/standalone/mod_irc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/standalone/mod_irc64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
</Build>
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-Wextra" />
|
|
||||||
<Add option="-Wall" />
|
|
||||||
<Add option="-std=c++14" />
|
|
||||||
<Add option="-DSQMOD_PLUGIN_API" />
|
|
||||||
<Add option="-DSCRAT_USE_EXCEPTIONS" />
|
|
||||||
<Add option="-DSCRAT_USE_CXX11_OPTIMIZATIONS" />
|
|
||||||
<Add directory="../external/LibIRC" />
|
|
||||||
<Add directory="../shared" />
|
|
||||||
<Add directory="../include" />
|
|
||||||
<Add directory="../config/common" />
|
|
||||||
<Add directory="../modules/irc" />
|
|
||||||
</Compiler>
|
|
||||||
<Unit filename="../external/LibIRC/libircclient.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
<Option compiler="gcc" use="1" buildCommand="$compiler -Wno-unused-parameter -Wno-sign-compare -Wno-type-limits $options $includes -c $file -o $object" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../modules/irc/Common.cpp" />
|
|
||||||
<Unit filename="../modules/irc/Common.hpp" />
|
|
||||||
<Unit filename="../modules/irc/Constants.cpp" />
|
|
||||||
<Unit filename="../modules/irc/Module.cpp" />
|
|
||||||
<Unit filename="../modules/irc/Session.cpp" />
|
|
||||||
<Unit filename="../modules/irc/Session.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Module.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Utility.hpp" />
|
|
||||||
<Unit filename="../shared/SqMod.cpp" />
|
|
||||||
<Extensions>
|
|
||||||
<code_completion />
|
|
||||||
<envvars />
|
|
||||||
<debugger />
|
|
||||||
<lib_finder disable_auto="1" />
|
|
||||||
</Extensions>
|
|
||||||
</Project>
|
|
||||||
</CodeBlocks_project_file>
|
|
440
cbp/ModJSON.cbp
440
cbp/ModJSON.cbp
@ -1,440 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_project_file>
|
|
||||||
<FileVersion major="1" minor="6" />
|
|
||||||
<Project>
|
|
||||||
<Option title="Mod JSON" />
|
|
||||||
<Option pch_mode="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Build>
|
|
||||||
<Target title="Win32 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/mod_json32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/mod_json32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/mod_json64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/mod_json64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/mod_json32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/mod_json32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/mod_json64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/mod_json64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/standalone/mod_json32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/standalone/mod_json32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/standalone/mod_json64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/standalone/mod_json64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/standalone/mod_json32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/standalone/mod_json32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/standalone/mod_json64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/standalone/mod_json64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
</Build>
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-Wextra" />
|
|
||||||
<Add option="-Wall" />
|
|
||||||
<Add option="-std=c++14" />
|
|
||||||
<Add option="-DSQMOD_PLUGIN_API" />
|
|
||||||
<Add option="-DSCRAT_USE_EXCEPTIONS" />
|
|
||||||
<Add option="-DSCRAT_USE_CXX11_OPTIMIZATIONS" />
|
|
||||||
<Add directory="../modules/json" />
|
|
||||||
<Add directory="../shared" />
|
|
||||||
<Add directory="../include" />
|
|
||||||
<Add directory="../config/common" />
|
|
||||||
<Add directory="../external/Jansson" />
|
|
||||||
</Compiler>
|
|
||||||
<Unit filename="../modules/json/Common.cpp" />
|
|
||||||
<Unit filename="../modules/json/Common.hpp" />
|
|
||||||
<Unit filename="../modules/json/JArray.cpp" />
|
|
||||||
<Unit filename="../modules/json/JArray.hpp" />
|
|
||||||
<Unit filename="../modules/json/JObject.cpp" />
|
|
||||||
<Unit filename="../modules/json/JObject.hpp" />
|
|
||||||
<Unit filename="../modules/json/JValue.cpp" />
|
|
||||||
<Unit filename="../modules/json/JValue.hpp" />
|
|
||||||
<Unit filename="../modules/json/Library.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
<Option compiler="gcc" use="1" buildCommand="$compiler -Wno-unused-function -Wno-maybe-uninitialized $options $includes -c $file -o $object" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../modules/json/Module.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Module.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Utility.hpp" />
|
|
||||||
<Unit filename="../shared/SqMod.cpp" />
|
|
||||||
<Extensions>
|
|
||||||
<code_completion />
|
|
||||||
<envvars />
|
|
||||||
<debugger />
|
|
||||||
<lib_finder disable_auto="1" />
|
|
||||||
</Extensions>
|
|
||||||
</Project>
|
|
||||||
</CodeBlocks_project_file>
|
|
466
cbp/ModMMDB.cbp
466
cbp/ModMMDB.cbp
@ -1,466 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_project_file>
|
|
||||||
<FileVersion major="1" minor="6" />
|
|
||||||
<Project>
|
|
||||||
<Option title="Mod MMDB" />
|
|
||||||
<Option pch_mode="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Build>
|
|
||||||
<Target title="Win32 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/mod_mmdb32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/mod_mmdb32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/mod_mmdb64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/mod_mmdb64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/mod_mmdb32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/mod_mmdb32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/mod_mmdb64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/mod_mmdb64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/standalone/mod_mmdb32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/standalone/mod_mmdb32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/standalone/mod_mmdb64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/standalone/mod_mmdb64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/standalone/mod_mmdb32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/standalone/mod_mmdb32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/standalone/mod_mmdb64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/standalone/mod_mmdb64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
</Build>
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-Wextra" />
|
|
||||||
<Add option="-Wall" />
|
|
||||||
<Add option="-std=c++14" />
|
|
||||||
<Add option="-std=c99" />
|
|
||||||
<Add option="-DSQMOD_PLUGIN_API" />
|
|
||||||
<Add option="-DSCRAT_USE_EXCEPTIONS" />
|
|
||||||
<Add option="-DSCRAT_USE_CXX11_OPTIMIZATIONS" />
|
|
||||||
<Add directory="../modules/mmdb" />
|
|
||||||
<Add directory="../shared" />
|
|
||||||
<Add directory="../include" />
|
|
||||||
<Add directory="../config/common" />
|
|
||||||
<Add directory="../external/MaxmindDB" />
|
|
||||||
</Compiler>
|
|
||||||
<Unit filename="../external/MaxmindDB/data-pool.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../external/MaxmindDB/data-pool.h" />
|
|
||||||
<Unit filename="../external/MaxmindDB/maxminddb.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
<Option compiler="gcc" use="1" buildCommand="$compiler -Wno-unused-parameter -Wno-sign-compare $options $includes -c $file -o $object" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../modules/mmdb/Common.cpp" />
|
|
||||||
<Unit filename="../modules/mmdb/Common.hpp" />
|
|
||||||
<Unit filename="../modules/mmdb/Database.cpp" />
|
|
||||||
<Unit filename="../modules/mmdb/Database.hpp" />
|
|
||||||
<Unit filename="../modules/mmdb/Description.cpp" />
|
|
||||||
<Unit filename="../modules/mmdb/Description.hpp" />
|
|
||||||
<Unit filename="../modules/mmdb/EntryData.cpp" />
|
|
||||||
<Unit filename="../modules/mmdb/EntryData.hpp" />
|
|
||||||
<Unit filename="../modules/mmdb/EntryDataList.cpp" />
|
|
||||||
<Unit filename="../modules/mmdb/EntryDataList.hpp" />
|
|
||||||
<Unit filename="../modules/mmdb/Handle/Database.cpp" />
|
|
||||||
<Unit filename="../modules/mmdb/Handle/Database.hpp" />
|
|
||||||
<Unit filename="../modules/mmdb/LookupResult.cpp" />
|
|
||||||
<Unit filename="../modules/mmdb/LookupResult.hpp" />
|
|
||||||
<Unit filename="../modules/mmdb/Metadata.cpp" />
|
|
||||||
<Unit filename="../modules/mmdb/Metadata.hpp" />
|
|
||||||
<Unit filename="../modules/mmdb/Module.cpp" />
|
|
||||||
<Unit filename="../modules/mmdb/SearchNode.cpp" />
|
|
||||||
<Unit filename="../modules/mmdb/SearchNode.hpp" />
|
|
||||||
<Unit filename="../modules/mmdb/SockAddr.cpp" />
|
|
||||||
<Unit filename="../modules/mmdb/SockAddr.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Module.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Utility.hpp" />
|
|
||||||
<Unit filename="../shared/SqMod.cpp" />
|
|
||||||
<Extensions>
|
|
||||||
<code_completion />
|
|
||||||
<envvars />
|
|
||||||
<debugger />
|
|
||||||
<lib_finder disable_auto="1" />
|
|
||||||
<fortran_project />
|
|
||||||
</Extensions>
|
|
||||||
</Project>
|
|
||||||
</CodeBlocks_project_file>
|
|
@ -1,462 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_project_file>
|
|
||||||
<FileVersion major="1" minor="6" />
|
|
||||||
<Project>
|
|
||||||
<Option title="Mod Mongoose" />
|
|
||||||
<Option pch_mode="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Build>
|
|
||||||
<Target title="Win32 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/mod_mg32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/mod_mg32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/mod_mg64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/mod_mg64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/mod_mg32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/mod_mg32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/mod_mg64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/mod_mg64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/standalone/mod_mg32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/standalone/mod_mg32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/standalone/mod_mg64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/standalone/mod_mg64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/standalone/mod_mg32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/standalone/mod_mg32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/standalone/mod_mg64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/standalone/mod_mg64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
</Build>
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-Wextra" />
|
|
||||||
<Add option="-Wall" />
|
|
||||||
<Add option="-std=c++14" />
|
|
||||||
<Add option="-DSQMOD_PLUGIN_API" />
|
|
||||||
<Add option="-DSCRAT_USE_EXCEPTIONS" />
|
|
||||||
<Add option="-DSCRAT_USE_CXX11_OPTIMIZATIONS" />
|
|
||||||
<Add option="-DMG_ENABLE_THREADS" />
|
|
||||||
<Add option="-DMG_ENABLE_DNS_SERVER" />
|
|
||||||
<Add option="-DMG_DISABLE_DAV" />
|
|
||||||
<Add option="-DCS_DISABLE_STDIO" />
|
|
||||||
<Add directory="../modules/mg" />
|
|
||||||
<Add directory="../shared" />
|
|
||||||
<Add directory="../include" />
|
|
||||||
<Add directory="../config/common" />
|
|
||||||
</Compiler>
|
|
||||||
<Unit filename="../external/Mongoose/mongoose.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
<Option compiler="gcc" use="1" buildCommand="$compiler -Wno-type-limits -Wno-unused-parameter -Wno-format $options $includes -c $file -o $object\n" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../include/mongoose.h" />
|
|
||||||
<Unit filename="../modules/mg/Common.cpp" />
|
|
||||||
<Unit filename="../modules/mg/Common.hpp" />
|
|
||||||
<Unit filename="../modules/mg/Connection.cpp" />
|
|
||||||
<Unit filename="../modules/mg/Connection.hpp" />
|
|
||||||
<Unit filename="../modules/mg/HTTP.cpp" />
|
|
||||||
<Unit filename="../modules/mg/HTTP.hpp" />
|
|
||||||
<Unit filename="../modules/mg/Handles.cpp" />
|
|
||||||
<Unit filename="../modules/mg/Handles.hpp" />
|
|
||||||
<Unit filename="../modules/mg/Manager.cpp" />
|
|
||||||
<Unit filename="../modules/mg/Manager.hpp" />
|
|
||||||
<Unit filename="../modules/mg/Message.cpp" />
|
|
||||||
<Unit filename="../modules/mg/Message.hpp" />
|
|
||||||
<Unit filename="../modules/mg/Module.cpp" />
|
|
||||||
<Unit filename="../modules/mg/Options.cpp" />
|
|
||||||
<Unit filename="../modules/mg/Options.hpp" />
|
|
||||||
<Unit filename="../modules/mg/String.cpp" />
|
|
||||||
<Unit filename="../modules/mg/String.hpp" />
|
|
||||||
<Unit filename="../modules/mg/WebSocket.cpp" />
|
|
||||||
<Unit filename="../modules/mg/WebSocket.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Module.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Utility.hpp" />
|
|
||||||
<Unit filename="../shared/SqMod.cpp" />
|
|
||||||
<Extensions>
|
|
||||||
<code_completion />
|
|
||||||
<envvars />
|
|
||||||
<debugger />
|
|
||||||
<lib_finder disable_auto="1" />
|
|
||||||
</Extensions>
|
|
||||||
</Project>
|
|
||||||
</CodeBlocks_project_file>
|
|
495
cbp/ModMySQL.cbp
495
cbp/ModMySQL.cbp
@ -1,495 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_project_file>
|
|
||||||
<FileVersion major="1" minor="6" />
|
|
||||||
<Project>
|
|
||||||
<Option title="Mod MySQL" />
|
|
||||||
<Option pch_mode="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Build>
|
|
||||||
<Target title="Win32 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/mod_mysql32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
<Add directory="../config/mingw32/mysql" />
|
|
||||||
<Add directory="../include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add library="mysql" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/mod_mysql32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
<Add directory="../config/mingw32/mysql" />
|
|
||||||
<Add directory="../include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add library="mysql" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/mod_mysql64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
<Add directory="../config/mingw64/mysql" />
|
|
||||||
<Add directory="../include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add library="mysql" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/mod_mysql64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
<Add directory="../config/mingw64/mysql" />
|
|
||||||
<Add directory="../include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add library="mysql" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/mod_mysql32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
<Add directory="/usr/include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add library="mysqlclient" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/mod_mysql32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
<Add directory="/usr/include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add library="mysqlclient" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/mod_mysql64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
<Add directory="/usr/include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add library="mysqlclient" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/mod_mysql64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
<Add directory="/usr/include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add library="mysqlclient" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/standalone/mod_mysql32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
<Add directory="../config/mingw32/mysql" />
|
|
||||||
<Add directory="../include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="mysql" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/standalone/mod_mysql32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
<Add directory="../config/mingw32/mysql" />
|
|
||||||
<Add directory="../include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="mysql" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/standalone/mod_mysql64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
<Add directory="../config/mingw64/mysql" />
|
|
||||||
<Add directory="../include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="mysql" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/standalone/mod_mysql64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
<Add directory="../config/mingw64/mysql" />
|
|
||||||
<Add directory="../include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="mysql" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/standalone/mod_mysql32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
<Add directory="/usr/include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add library="mysqlclient" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/standalone/mod_mysql32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
<Add directory="/usr/include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add library="mysqlclient" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/standalone/mod_mysql64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
<Add directory="/usr/include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add library="mysqlclient" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/standalone/mod_mysql64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
<Add directory="/usr/include/mysql" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add library="mysqlclient" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
</Build>
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-Wextra" />
|
|
||||||
<Add option="-Wall" />
|
|
||||||
<Add option="-std=c++14" />
|
|
||||||
<Add option="-DSQMOD_PLUGIN_API" />
|
|
||||||
<Add option="-DSCRAT_USE_EXCEPTIONS" />
|
|
||||||
<Add option="-DSCRAT_USE_CXX11_OPTIMIZATIONS" />
|
|
||||||
<Add directory="../modules/mysql" />
|
|
||||||
<Add directory="../shared" />
|
|
||||||
<Add directory="../include" />
|
|
||||||
<Add directory="../config/common" />
|
|
||||||
</Compiler>
|
|
||||||
<Unit filename="../modules/mysql/Account.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Account.hpp" />
|
|
||||||
<Unit filename="../modules/mysql/Common.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Common.hpp" />
|
|
||||||
<Unit filename="../modules/mysql/Connection.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Connection.hpp" />
|
|
||||||
<Unit filename="../modules/mysql/Convert.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Convert.hpp" />
|
|
||||||
<Unit filename="../modules/mysql/Field.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Field.hpp" />
|
|
||||||
<Unit filename="../modules/mysql/Handle/Connection.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Handle/Connection.hpp" />
|
|
||||||
<Unit filename="../modules/mysql/Handle/ResultSet.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Handle/ResultSet.hpp" />
|
|
||||||
<Unit filename="../modules/mysql/Handle/Statement.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Handle/Statement.hpp" />
|
|
||||||
<Unit filename="../modules/mysql/Module.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Parameter.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Parameter.hpp" />
|
|
||||||
<Unit filename="../modules/mysql/ResultSet.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/ResultSet.hpp" />
|
|
||||||
<Unit filename="../modules/mysql/Savepoint.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Savepoint.hpp" />
|
|
||||||
<Unit filename="../modules/mysql/Statement.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Statement.hpp" />
|
|
||||||
<Unit filename="../modules/mysql/Transaction.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Transaction.hpp" />
|
|
||||||
<Unit filename="../modules/mysql/Wrapper/CharsetInfo.cpp" />
|
|
||||||
<Unit filename="../modules/mysql/Wrapper/CharsetInfo.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Module.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Utility.hpp" />
|
|
||||||
<Unit filename="../shared/SqMod.cpp" />
|
|
||||||
<Extensions>
|
|
||||||
<code_completion />
|
|
||||||
<envvars />
|
|
||||||
<debugger />
|
|
||||||
<lib_finder disable_auto="1" />
|
|
||||||
</Extensions>
|
|
||||||
</Project>
|
|
||||||
</CodeBlocks_project_file>
|
|
@ -1,454 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_project_file>
|
|
||||||
<FileVersion major="1" minor="6" />
|
|
||||||
<Project>
|
|
||||||
<Option title="Mod SQLite" />
|
|
||||||
<Option pch_mode="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Build>
|
|
||||||
<Target title="Win32 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/mod_sqlite32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/mod_sqlite32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/mod_sqlite64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/mod_sqlite64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/mod_sqlite32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/mod_sqlite32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/mod_sqlite64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/mod_sqlite64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/standalone/mod_sqlite32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/standalone/mod_sqlite32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/standalone/mod_sqlite64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/standalone/mod_sqlite64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/standalone/mod_sqlite32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/standalone/mod_sqlite32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/standalone/mod_sqlite64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/standalone/mod_sqlite64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
</Build>
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-Wextra" />
|
|
||||||
<Add option="-Wall" />
|
|
||||||
<Add option="-std=c++14" />
|
|
||||||
<Add option="-DSQMOD_PLUGIN_API" />
|
|
||||||
<Add option="-DSCRAT_USE_EXCEPTIONS" />
|
|
||||||
<Add option="-DSCRAT_USE_CXX11_OPTIMIZATIONS" />
|
|
||||||
<Add option="-DSQLITE_ENABLE_FTS3=1" />
|
|
||||||
<Add option="-DSQLITE_ENABLE_FTS4=1" />
|
|
||||||
<Add option="-DSQLITE_ENABLE_FTS5=1" />
|
|
||||||
<Add option="-DSQLITE_ENABLE_JSON1=1" />
|
|
||||||
<Add option="-DSQLITE_ENABLE_RTREE=1" />
|
|
||||||
<Add directory="../modules/sqlite" />
|
|
||||||
<Add directory="../shared" />
|
|
||||||
<Add directory="../include" />
|
|
||||||
<Add directory="../config/common" />
|
|
||||||
</Compiler>
|
|
||||||
<Unit filename="../external/SQLite/sqlite3.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
<Option compiler="gcc" use="1" buildCommand="$compiler -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-sign-compare $options $includes -c $file -o $object" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../modules/sqlite/Column.cpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Column.hpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Common.cpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Common.hpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Connection.cpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Connection.hpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Constants.cpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Handle/Connection.cpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Handle/Connection.hpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Handle/Statement.cpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Handle/Statement.hpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Module.cpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Parameter.cpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Parameter.hpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Statement.cpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Statement.hpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Transaction.cpp" />
|
|
||||||
<Unit filename="../modules/sqlite/Transaction.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Module.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Utility.hpp" />
|
|
||||||
<Unit filename="../shared/SqMod.cpp" />
|
|
||||||
<Extensions>
|
|
||||||
<code_completion />
|
|
||||||
<envvars />
|
|
||||||
<debugger />
|
|
||||||
<lib_finder disable_auto="1" />
|
|
||||||
<fortran_project />
|
|
||||||
</Extensions>
|
|
||||||
</Project>
|
|
||||||
</CodeBlocks_project_file>
|
|
@ -1,429 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_project_file>
|
|
||||||
<FileVersion major="1" minor="6" />
|
|
||||||
<Project>
|
|
||||||
<Option title="Mod Sample" />
|
|
||||||
<Option pch_mode="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Build>
|
|
||||||
<Target title="Win32 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/mod_sample32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/mod_sample32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/mod_sample64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/mod_sample64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/mod_sample32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/mod_sample32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/mod_sample64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/mod_sample64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/standalone/mod_sample32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/standalone/mod_sample32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/standalone/mod_sample64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/standalone/mod_sample64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/standalone/mod_sample32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/standalone/mod_sample32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/standalone/mod_sample64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/standalone/mod_sample64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
</Build>
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-Wextra" />
|
|
||||||
<Add option="-Wall" />
|
|
||||||
<Add option="-std=c++14" />
|
|
||||||
<Add option="-DSQMOD_PLUGIN_API" />
|
|
||||||
<Add option="-DSCRAT_USE_EXCEPTIONS" />
|
|
||||||
<Add option="-DSCRAT_USE_CXX11_OPTIMIZATIONS" />
|
|
||||||
<Add directory="../modules/sample" />
|
|
||||||
<Add directory="../shared" />
|
|
||||||
<Add directory="../include" />
|
|
||||||
<Add directory="../config/common" />
|
|
||||||
</Compiler>
|
|
||||||
<Unit filename="../modules/sample/Common.cpp" />
|
|
||||||
<Unit filename="../modules/sample/Common.hpp" />
|
|
||||||
<Unit filename="../modules/sample/Module.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Module.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Utility.hpp" />
|
|
||||||
<Unit filename="../shared/SqMod.cpp" />
|
|
||||||
<Extensions>
|
|
||||||
<code_completion />
|
|
||||||
<envvars />
|
|
||||||
<debugger />
|
|
||||||
<lib_finder disable_auto="1" />
|
|
||||||
</Extensions>
|
|
||||||
</Project>
|
|
||||||
</CodeBlocks_project_file>
|
|
442
cbp/ModXML.cbp
442
cbp/ModXML.cbp
@ -1,442 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_project_file>
|
|
||||||
<FileVersion major="1" minor="6" />
|
|
||||||
<Project>
|
|
||||||
<Option title="Mod XML" />
|
|
||||||
<Option pch_mode="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Build>
|
|
||||||
<Target title="Win32 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/mod_xml32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/mod_xml32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/mod_xml64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/mod_xml64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/mod_xml32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/mod_xml32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/mod_xml64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/mod_xml64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/standalone/mod_xml32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/standalone/mod_xml32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/standalone/mod_xml64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/standalone/mod_xml64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/standalone/mod_xml32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/standalone/mod_xml32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/standalone/mod_xml64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/standalone/mod_xml64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
</Build>
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-Wall" />
|
|
||||||
<Add option="-std=c++14" />
|
|
||||||
<Add option="-DSQMOD_PLUGIN_API" />
|
|
||||||
<Add option="-DSCRAT_USE_EXCEPTIONS" />
|
|
||||||
<Add option="-DSCRAT_USE_CXX11_OPTIMIZATIONS" />
|
|
||||||
<Add directory="../modules/xml" />
|
|
||||||
<Add directory="../shared" />
|
|
||||||
<Add directory="../include" />
|
|
||||||
<Add directory="../config/common" />
|
|
||||||
</Compiler>
|
|
||||||
<Unit filename="../external/PUGIXML/pugixml.cpp" />
|
|
||||||
<Unit filename="../modules/xml/Attribute.cpp" />
|
|
||||||
<Unit filename="../modules/xml/Attribute.hpp" />
|
|
||||||
<Unit filename="../modules/xml/Common.cpp" />
|
|
||||||
<Unit filename="../modules/xml/Common.hpp" />
|
|
||||||
<Unit filename="../modules/xml/Document.cpp" />
|
|
||||||
<Unit filename="../modules/xml/Document.hpp" />
|
|
||||||
<Unit filename="../modules/xml/Handle/Document.cpp" />
|
|
||||||
<Unit filename="../modules/xml/Handle/Document.hpp" />
|
|
||||||
<Unit filename="../modules/xml/Module.cpp" />
|
|
||||||
<Unit filename="../modules/xml/Node.cpp" />
|
|
||||||
<Unit filename="../modules/xml/Node.hpp" />
|
|
||||||
<Unit filename="../modules/xml/Text.cpp" />
|
|
||||||
<Unit filename="../modules/xml/Text.hpp" />
|
|
||||||
<Unit filename="../modules/xml/Wrapper/ParseResult.cpp" />
|
|
||||||
<Unit filename="../modules/xml/Wrapper/ParseResult.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Module.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Utility.hpp" />
|
|
||||||
<Unit filename="../shared/SqMod.cpp" />
|
|
||||||
<Extensions>
|
|
||||||
<code_completion />
|
|
||||||
<envvars />
|
|
||||||
<debugger />
|
|
||||||
<lib_finder disable_auto="1" />
|
|
||||||
<fortran_project />
|
|
||||||
</Extensions>
|
|
||||||
</Project>
|
|
||||||
</CodeBlocks_project_file>
|
|
591
cbp/Module.cbp
591
cbp/Module.cbp
@ -1,591 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_project_file>
|
|
||||||
<FileVersion major="1" minor="6" />
|
|
||||||
<Project>
|
|
||||||
<Option title="Module" />
|
|
||||||
<Option pch_mode="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Build>
|
|
||||||
<Target title="Win32 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/mod_squirrel32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/mod_squirrel32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/mod_squirrel64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Dynamic">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/mod_squirrel64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/mod_squirrel32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/mod_squirrel32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/mod_squirrel64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Dynamic">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/mod_squirrel64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/standalone/mod_squirrel32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/standalone/mod_squirrel32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/standalone/mod_squirrel64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Standalone">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/standalone/mod_squirrel64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static" />
|
|
||||||
<Add library="Ws2_32" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='cmd /c copy /Y "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)..\bin\plugins\$(TARGET_OUTPUT_BASENAME).dll"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/standalone/mod_squirrel32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/standalone/mod_squirrel32" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/standalone/mod_squirrel64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Standalone">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/standalone/mod_squirrel64" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="3" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-static-libgcc" />
|
|
||||||
<Add option="-static-libstdc++" />
|
|
||||||
<Add option="-enable-static" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-Bstatic" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
<ExtraCommands>
|
|
||||||
<Add after='/bin/cp -rf "$(PROJECT_DIR)$(TARGET_OUTPUT_FILE)" "$(PROJECT_DIR)../bin/plugins/$(TARGET_OUTPUT_BASENAME).so"' />
|
|
||||||
</ExtraCommands>
|
|
||||||
</Target>
|
|
||||||
</Build>
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-Wextra" />
|
|
||||||
<Add option="-Wall" />
|
|
||||||
<Add option="-std=c++14" />
|
|
||||||
<Add option="-DSCRAT_USE_EXCEPTIONS" />
|
|
||||||
<Add option="-DSCRAT_USE_CXX11_OPTIMIZATIONS" />
|
|
||||||
<Add directory="../source" />
|
|
||||||
<Add directory="../shared" />
|
|
||||||
<Add directory="../include" />
|
|
||||||
<Add directory="../config/common" />
|
|
||||||
<Add directory="../external/Common" />
|
|
||||||
<Add directory="../external/Hash" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add library="squirrel" />
|
|
||||||
</Linker>
|
|
||||||
<Unit filename="../external/B64/decode.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../external/B64/encode.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../external/Common/aes256.cpp" />
|
|
||||||
<Unit filename="../external/Common/byte_order.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../external/Common/whirlpool.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../external/Common/whirlpool_sbox.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="../external/Hash/crc32.cpp" />
|
|
||||||
<Unit filename="../external/Hash/crc32.h" />
|
|
||||||
<Unit filename="../external/Hash/digest.cpp" />
|
|
||||||
<Unit filename="../external/Hash/hash.h" />
|
|
||||||
<Unit filename="../external/Hash/hmac.h" />
|
|
||||||
<Unit filename="../external/Hash/keccak.cpp" />
|
|
||||||
<Unit filename="../external/Hash/keccak.h" />
|
|
||||||
<Unit filename="../external/Hash/md5.cpp" />
|
|
||||||
<Unit filename="../external/Hash/md5.h" />
|
|
||||||
<Unit filename="../external/Hash/sha1.cpp" />
|
|
||||||
<Unit filename="../external/Hash/sha1.h" />
|
|
||||||
<Unit filename="../external/Hash/sha256.cpp" />
|
|
||||||
<Unit filename="../external/Hash/sha256.h" />
|
|
||||||
<Unit filename="../external/Hash/sha3.cpp" />
|
|
||||||
<Unit filename="../external/Hash/sha3.h" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Buffer.hpp" />
|
|
||||||
<Unit filename="../shared/Base/Plugin.cpp" />
|
|
||||||
<Unit filename="../shared/Base/Utility.hpp" />
|
|
||||||
<Unit filename="../source/Base/AABB.cpp" />
|
|
||||||
<Unit filename="../source/Base/AABB.hpp" />
|
|
||||||
<Unit filename="../source/Base/Algo.cpp" />
|
|
||||||
<Unit filename="../source/Base/Algo.hpp" />
|
|
||||||
<Unit filename="../source/Base/Circle.cpp" />
|
|
||||||
<Unit filename="../source/Base/Circle.hpp" />
|
|
||||||
<Unit filename="../source/Base/Color3.cpp" />
|
|
||||||
<Unit filename="../source/Base/Color3.hpp" />
|
|
||||||
<Unit filename="../source/Base/Color4.cpp" />
|
|
||||||
<Unit filename="../source/Base/Color4.hpp" />
|
|
||||||
<Unit filename="../source/Base/Quaternion.cpp" />
|
|
||||||
<Unit filename="../source/Base/Quaternion.hpp" />
|
|
||||||
<Unit filename="../source/Base/ScriptSrc.cpp" />
|
|
||||||
<Unit filename="../source/Base/ScriptSrc.hpp" />
|
|
||||||
<Unit filename="../source/Base/Shared.cpp" />
|
|
||||||
<Unit filename="../source/Base/Shared.hpp" />
|
|
||||||
<Unit filename="../source/Base/Sphere.cpp" />
|
|
||||||
<Unit filename="../source/Base/Sphere.hpp" />
|
|
||||||
<Unit filename="../source/Base/Vector2.cpp" />
|
|
||||||
<Unit filename="../source/Base/Vector2.hpp" />
|
|
||||||
<Unit filename="../source/Base/Vector2i.cpp" />
|
|
||||||
<Unit filename="../source/Base/Vector2i.hpp" />
|
|
||||||
<Unit filename="../source/Base/Vector3.cpp" />
|
|
||||||
<Unit filename="../source/Base/Vector3.hpp" />
|
|
||||||
<Unit filename="../source/Base/Vector4.cpp" />
|
|
||||||
<Unit filename="../source/Base/Vector4.hpp" />
|
|
||||||
<Unit filename="../source/Core.cpp" />
|
|
||||||
<Unit filename="../source/Core.hpp" />
|
|
||||||
<Unit filename="../source/Core/Entity.inc" />
|
|
||||||
<Unit filename="../source/Core/Events.inc" />
|
|
||||||
<Unit filename="../source/Core/Funcs.inc" />
|
|
||||||
<Unit filename="../source/Core/Inst.inc" />
|
|
||||||
<Unit filename="../source/Core/Utils.inc" />
|
|
||||||
<Unit filename="../source/Entity/Blip.cpp" />
|
|
||||||
<Unit filename="../source/Entity/Blip.hpp" />
|
|
||||||
<Unit filename="../source/Entity/Checkpoint.cpp" />
|
|
||||||
<Unit filename="../source/Entity/Checkpoint.hpp" />
|
|
||||||
<Unit filename="../source/Entity/Keybind.cpp" />
|
|
||||||
<Unit filename="../source/Entity/Keybind.hpp" />
|
|
||||||
<Unit filename="../source/Entity/Object.cpp" />
|
|
||||||
<Unit filename="../source/Entity/Object.hpp" />
|
|
||||||
<Unit filename="../source/Entity/Pickup.cpp" />
|
|
||||||
<Unit filename="../source/Entity/Pickup.hpp" />
|
|
||||||
<Unit filename="../source/Entity/Player.cpp" />
|
|
||||||
<Unit filename="../source/Entity/Player.hpp" />
|
|
||||||
<Unit filename="../source/Entity/Vehicle.cpp" />
|
|
||||||
<Unit filename="../source/Entity/Vehicle.hpp" />
|
|
||||||
<Unit filename="../source/Library/Chrono.cpp" />
|
|
||||||
<Unit filename="../source/Library/Chrono.hpp" />
|
|
||||||
<Unit filename="../source/Library/Chrono/Date.cpp" />
|
|
||||||
<Unit filename="../source/Library/Chrono/Date.hpp" />
|
|
||||||
<Unit filename="../source/Library/Chrono/Datetime.cpp" />
|
|
||||||
<Unit filename="../source/Library/Chrono/Datetime.hpp" />
|
|
||||||
<Unit filename="../source/Library/Chrono/Time.cpp" />
|
|
||||||
<Unit filename="../source/Library/Chrono/Time.hpp" />
|
|
||||||
<Unit filename="../source/Library/Chrono/Timer.cpp" />
|
|
||||||
<Unit filename="../source/Library/Chrono/Timer.hpp" />
|
|
||||||
<Unit filename="../source/Library/Chrono/Timestamp.cpp" />
|
|
||||||
<Unit filename="../source/Library/Chrono/Timestamp.hpp" />
|
|
||||||
<Unit filename="../source/Library/Crypt.cpp" />
|
|
||||||
<Unit filename="../source/Library/Crypt.hpp" />
|
|
||||||
<Unit filename="../source/Library/Crypt/AES.cpp" />
|
|
||||||
<Unit filename="../source/Library/Crypt/AES.hpp" />
|
|
||||||
<Unit filename="../source/Library/Crypt/Hash.cpp" />
|
|
||||||
<Unit filename="../source/Library/Crypt/Hash.hpp" />
|
|
||||||
<Unit filename="../source/Library/IO.cpp" />
|
|
||||||
<Unit filename="../source/Library/IO.hpp" />
|
|
||||||
<Unit filename="../source/Library/IO/File.cpp" />
|
|
||||||
<Unit filename="../source/Library/IO/File.hpp" />
|
|
||||||
<Unit filename="../source/Library/IO/INI.cpp" />
|
|
||||||
<Unit filename="../source/Library/IO/INI.hpp" />
|
|
||||||
<Unit filename="../source/Library/Numeric.cpp" />
|
|
||||||
<Unit filename="../source/Library/Numeric.hpp" />
|
|
||||||
<Unit filename="../source/Library/Numeric/LongInt.cpp" />
|
|
||||||
<Unit filename="../source/Library/Numeric/LongInt.hpp" />
|
|
||||||
<Unit filename="../source/Library/Numeric/Math.cpp" />
|
|
||||||
<Unit filename="../source/Library/Numeric/Math.hpp" />
|
|
||||||
<Unit filename="../source/Library/Numeric/Random.cpp" />
|
|
||||||
<Unit filename="../source/Library/Numeric/Random.hpp" />
|
|
||||||
<Unit filename="../source/Library/String.cpp" />
|
|
||||||
<Unit filename="../source/Library/String.hpp" />
|
|
||||||
<Unit filename="../source/Library/System.cpp" />
|
|
||||||
<Unit filename="../source/Library/System.hpp" />
|
|
||||||
<Unit filename="../source/Library/System/Dir.cpp" />
|
|
||||||
<Unit filename="../source/Library/System/Dir.hpp" />
|
|
||||||
<Unit filename="../source/Library/System/Environment.cpp" />
|
|
||||||
<Unit filename="../source/Library/System/Environment.hpp" />
|
|
||||||
<Unit filename="../source/Library/System/Path.cpp" />
|
|
||||||
<Unit filename="../source/Library/System/Path.hpp" />
|
|
||||||
<Unit filename="../source/Library/Utils.cpp" />
|
|
||||||
<Unit filename="../source/Library/Utils.hpp" />
|
|
||||||
<Unit filename="../source/Library/Utils/Buffer.cpp" />
|
|
||||||
<Unit filename="../source/Library/Utils/Buffer.hpp" />
|
|
||||||
<Unit filename="../source/Logger.cpp" />
|
|
||||||
<Unit filename="../source/Logger.hpp" />
|
|
||||||
<Unit filename="../source/Main.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Areas.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Areas.hpp" />
|
|
||||||
<Unit filename="../source/Misc/Broadcast.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Command.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Command.hpp" />
|
|
||||||
<Unit filename="../source/Misc/Constants.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Exports.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Functions.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Functions.hpp" />
|
|
||||||
<Unit filename="../source/Misc/Model.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Model.hpp" />
|
|
||||||
<Unit filename="../source/Misc/Player.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Player.hpp" />
|
|
||||||
<Unit filename="../source/Misc/Register.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Routine.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Routine.hpp" />
|
|
||||||
<Unit filename="../source/Misc/Signal.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Signal.hpp" />
|
|
||||||
<Unit filename="../source/Misc/Tasks.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Tasks.hpp" />
|
|
||||||
<Unit filename="../source/Misc/Vehicle.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Vehicle.hpp" />
|
|
||||||
<Unit filename="../source/Misc/Weapon.cpp" />
|
|
||||||
<Unit filename="../source/Misc/Weapon.hpp" />
|
|
||||||
<Unit filename="../source/Register.cpp" />
|
|
||||||
<Unit filename="../source/SqBase.hpp" />
|
|
||||||
<Extensions>
|
|
||||||
<code_completion />
|
|
||||||
<envvars />
|
|
||||||
<debugger />
|
|
||||||
<lib_finder disable_auto="1" />
|
|
||||||
<fortran_project />
|
|
||||||
</Extensions>
|
|
||||||
</Project>
|
|
||||||
</CodeBlocks_project_file>
|
|
181
cbp/Sandbox.cbp
181
cbp/Sandbox.cbp
@ -1,181 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_project_file>
|
|
||||||
<FileVersion major="1" minor="6" />
|
|
||||||
<Project>
|
|
||||||
<Option title="Sandbox" />
|
|
||||||
<Option pch_mode="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Build>
|
|
||||||
<Target title="Win32 Debug Executable">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32-d/sbox" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32-d/" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="1" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/mingw32-d" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Executable">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win32/sbox" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win32/" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="1" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/mingw32" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Executable">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64-d/sbox" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64-d/" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="1" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/mingw64-d" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Executable">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../bin/win64/sbox" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/win64/" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="1" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/mingw64" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Executable">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32-d/sbox" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32-d/" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="1" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32-d" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Executable">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux32/sbox" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux32/" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="1" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add directory="../lib/gcc32" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Executable">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64-d/sbox" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64-d/" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="1" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64-d" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Executable">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../bin/linux64/sbox" prefix_auto="0" extension_auto="1" />
|
|
||||||
<Option working_dir="../bin/linux64/" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="1" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add directory="../lib/gcc64" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
</Build>
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-Wextra" />
|
|
||||||
<Add option="-Wall" />
|
|
||||||
<Add option="-std=c++14" />
|
|
||||||
<Add directory="../include" />
|
|
||||||
<Add directory="../sandbox" />
|
|
||||||
<Add directory="../source" />
|
|
||||||
<Add directory="../shared" />
|
|
||||||
<Add directory="../config/common" />
|
|
||||||
<Add directory="../external/Common" />
|
|
||||||
<Add directory="../external/Hash" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add library="squirrel" />
|
|
||||||
</Linker>
|
|
||||||
<Unit filename="../sandbox/main.cpp" />
|
|
||||||
<Extensions>
|
|
||||||
<code_completion />
|
|
||||||
<envvars />
|
|
||||||
<debugger />
|
|
||||||
<lib_finder disable_auto="1" />
|
|
||||||
</Extensions>
|
|
||||||
</Project>
|
|
||||||
</CodeBlocks_project_file>
|
|
228
cbp/Squirrel.cbp
228
cbp/Squirrel.cbp
@ -1,228 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_project_file>
|
|
||||||
<FileVersion major="1" minor="6" />
|
|
||||||
<Project>
|
|
||||||
<Option title="Squirrel" />
|
|
||||||
<Option pch_mode="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Build>
|
|
||||||
<Target title="Win32 Debug Static">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../lib/mingw32-d/squirrel" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="" />
|
|
||||||
<Option object_output="../obj/mingw32-d/" />
|
|
||||||
<Option type="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Option createDefFile="1" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win32 Release Static">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../lib/mingw32/squirrel" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="" />
|
|
||||||
<Option object_output="../obj/mingw32/" />
|
|
||||||
<Option type="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Option createDefFile="1" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-fexpensive-optimizations" />
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/mingw32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Debug Static">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../lib/mingw64-d/squirrel" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="" />
|
|
||||||
<Option object_output="../obj/mingw64-d/" />
|
|
||||||
<Option type="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Option createDefFile="1" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Win64 Release Static">
|
|
||||||
<Option platforms="Windows;" />
|
|
||||||
<Option output="../lib/mingw64/squirrel" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="" />
|
|
||||||
<Option object_output="../obj/mingw64/" />
|
|
||||||
<Option type="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Option createDefFile="1" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-fexpensive-optimizations" />
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/mingw64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Debug Static">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../lib/gcc32-d/squirrel" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="" />
|
|
||||||
<Option object_output="../obj/gcc32-d/" />
|
|
||||||
<Option type="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Option createDefFile="1" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m32" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux32 Release Static">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../lib/gcc32/squirrel" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="" />
|
|
||||||
<Option object_output="../obj/gcc32/" />
|
|
||||||
<Option type="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Option createDefFile="1" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-fexpensive-optimizations" />
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add directory="../config/gcc32" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m32" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Debug Static">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../lib/gcc64-d/squirrel" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="" />
|
|
||||||
<Option object_output="../obj/gcc64-d/" />
|
|
||||||
<Option type="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Option createDefFile="1" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-g" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-D_DEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-m64" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
<Target title="Linux64 Release Static">
|
|
||||||
<Option platforms="Unix;" />
|
|
||||||
<Option output="../lib/gcc64/squirrel" prefix_auto="1" extension_auto="1" />
|
|
||||||
<Option working_dir="" />
|
|
||||||
<Option object_output="../obj/gcc64/" />
|
|
||||||
<Option type="2" />
|
|
||||||
<Option compiler="gcc" />
|
|
||||||
<Option createDefFile="1" />
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-fexpensive-optimizations" />
|
|
||||||
<Add option="-O3" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
<Add option="-fPIC" />
|
|
||||||
<Add option="-DNDEBUG" />
|
|
||||||
<Add option="-D_SQ64" />
|
|
||||||
<Add directory="../config/gcc64" />
|
|
||||||
</Compiler>
|
|
||||||
<Linker>
|
|
||||||
<Add option="-s" />
|
|
||||||
<Add option="-m64" />
|
|
||||||
</Linker>
|
|
||||||
</Target>
|
|
||||||
</Build>
|
|
||||||
<Compiler>
|
|
||||||
<Add option="-Wall" />
|
|
||||||
<Add option="-fno-exceptions" />
|
|
||||||
<Add option="-fno-rtti" />
|
|
||||||
<Add option="-fno-strict-aliasing" />
|
|
||||||
<Add option="-Wno-format" />
|
|
||||||
<Add option="-Wno-unused-variable" />
|
|
||||||
<Add option="-Wno-unused-but-set-variable" />
|
|
||||||
<Add option="-DGARBAGE_COLLECTOR" />
|
|
||||||
<Add directory="../include" />
|
|
||||||
<Add directory="../config/common" />
|
|
||||||
</Compiler>
|
|
||||||
<Unit filename="../external/Squirrel/Lib/sqstdaux.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/Lib/sqstdblob.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/Lib/sqstdblobimpl.h" />
|
|
||||||
<Unit filename="../external/Squirrel/Lib/sqstdio.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/Lib/sqstdmath.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/Lib/sqstdrex.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/Lib/sqstdstream.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/Lib/sqstdstream.h" />
|
|
||||||
<Unit filename="../external/Squirrel/Lib/sqstdstring.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/Lib/sqstdsystem.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqapi.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqapiex.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqarray.h" />
|
|
||||||
<Unit filename="../external/Squirrel/sqbaselib.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqclass.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqclass.h" />
|
|
||||||
<Unit filename="../external/Squirrel/sqclosure.h" />
|
|
||||||
<Unit filename="../external/Squirrel/sqcompiler.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqcompiler.h" />
|
|
||||||
<Unit filename="../external/Squirrel/sqdebug.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqfuncproto.h" />
|
|
||||||
<Unit filename="../external/Squirrel/sqfuncstate.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqfuncstate.h" />
|
|
||||||
<Unit filename="../external/Squirrel/sqlexer.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqlexer.h" />
|
|
||||||
<Unit filename="../external/Squirrel/sqmem.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqobject.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqobject.h" />
|
|
||||||
<Unit filename="../external/Squirrel/sqopcodes.h" />
|
|
||||||
<Unit filename="../external/Squirrel/sqpcheader.h" />
|
|
||||||
<Unit filename="../external/Squirrel/sqstate.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqstate.h" />
|
|
||||||
<Unit filename="../external/Squirrel/sqstring.h" />
|
|
||||||
<Unit filename="../external/Squirrel/sqtable.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqtable.h" />
|
|
||||||
<Unit filename="../external/Squirrel/squserdata.h" />
|
|
||||||
<Unit filename="../external/Squirrel/squtils.h" />
|
|
||||||
<Unit filename="../external/Squirrel/sqvm.cpp" />
|
|
||||||
<Unit filename="../external/Squirrel/sqvm.h" />
|
|
||||||
<Extensions>
|
|
||||||
<code_completion />
|
|
||||||
<envvars />
|
|
||||||
<debugger />
|
|
||||||
<fortran_project />
|
|
||||||
</Extensions>
|
|
||||||
</Project>
|
|
||||||
</CodeBlocks_project_file>
|
|
@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
||||||
<CodeBlocks_workspace_file>
|
|
||||||
<Workspace title="SqMod">
|
|
||||||
<Project filename="Squirrel.cbp" />
|
|
||||||
<Project filename="Module.cbp" />
|
|
||||||
<Project filename="ModIRC.cbp" />
|
|
||||||
<Project filename="ModXML.cbp" />
|
|
||||||
<Project filename="ModSQLite.cbp" />
|
|
||||||
<Project filename="ModMySQL.cbp" />
|
|
||||||
<Project filename="ModMMDB.cbp" />
|
|
||||||
</Workspace>
|
|
||||||
</CodeBlocks_workspace_file>
|
|
220
cmake/FindMySQL.cmake
Normal file
220
cmake/FindMySQL.cmake
Normal file
@ -0,0 +1,220 @@
|
|||||||
|
#
|
||||||
|
# This module is designed to find/handle mysql(client) library
|
||||||
|
#
|
||||||
|
# Requirements:
|
||||||
|
# - CMake >= 2.8.3 (for new version of find_package_handle_standard_args)
|
||||||
|
#
|
||||||
|
# The following variables will be defined for your use:
|
||||||
|
# - MYSQL_INCLUDE_DIRS : mysql(client) include directory
|
||||||
|
# - MYSQL_LIBRARIES : mysql(client) libraries
|
||||||
|
# - MYSQL_VERSION : complete version of mysql(client) (x.y.z)
|
||||||
|
# - MYSQL_VERSION_MAJOR : major version of mysql(client)
|
||||||
|
# - MYSQL_VERSION_MINOR : minor version of mysql(client)
|
||||||
|
# - MYSQL_VERSION_PATCH : patch version of mysql(client)
|
||||||
|
#
|
||||||
|
# How to use:
|
||||||
|
# 1) Copy this file in the root of your project source directory
|
||||||
|
# 2) Then, tell CMake to search this non-standard module in your project directory by adding to your CMakeLists.txt:
|
||||||
|
# set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
|
||||||
|
# 3) Finally call find_package(MySQL) once
|
||||||
|
#
|
||||||
|
# Here is a complete sample to build an executable:
|
||||||
|
#
|
||||||
|
# set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
|
||||||
|
#
|
||||||
|
# find_package(MySQL REQUIRED) # Note: name is case sensitive
|
||||||
|
#
|
||||||
|
# add_executable(myapp myapp.c)
|
||||||
|
# include_directories(${MYSQL_INCLUDE_DIRS})
|
||||||
|
# target_link_libraries(myapp ${MYSQL_LIBRARIES})
|
||||||
|
# # with CMake >= 3.0.0, the last two lines can be replaced by the following
|
||||||
|
# target_link_libraries(myapp MySQL::MySQL) # Note: case also matters here
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright (c) 2013-2016, julp
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
#=============================================================================
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 2.8.3)
|
||||||
|
|
||||||
|
# "As of MySQL 5.7.9, MySQL distributions contain a mysqlclient.pc file that provides information about MySQL configuration for use by the pkg-config command."
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
|
||||||
|
########## Private ##########
|
||||||
|
if(NOT DEFINED MYSQL_PUBLIC_VAR_NS)
|
||||||
|
set(MYSQL_PUBLIC_VAR_NS "MYSQL")
|
||||||
|
endif(NOT DEFINED MYSQL_PUBLIC_VAR_NS)
|
||||||
|
if(NOT DEFINED MYSQL_PRIVATE_VAR_NS)
|
||||||
|
set(MYSQL_PRIVATE_VAR_NS "_${MYSQL_PUBLIC_VAR_NS}")
|
||||||
|
endif(NOT DEFINED MYSQL_PRIVATE_VAR_NS)
|
||||||
|
if(NOT DEFINED PC_MYSQL_PRIVATE_VAR_NS)
|
||||||
|
set(PC_MYSQL_PRIVATE_VAR_NS "_PC${PC_MYSQL_PRIVATE_VAR_NS}")
|
||||||
|
endif(NOT DEFINED PC_MYSQL_PRIVATE_VAR_NS)
|
||||||
|
|
||||||
|
# Alias all MySQL_FIND_X variables to MYSQL_FIND_X
|
||||||
|
# Workaround for find_package: no way to force case of variable's names it creates (I don't want to change MY coding standard)
|
||||||
|
set(${MYSQL_PRIVATE_VAR_NS}_FIND_PKG_PREFIX "MySQL")
|
||||||
|
get_directory_property(${MYSQL_PRIVATE_VAR_NS}_CURRENT_VARIABLES VARIABLES)
|
||||||
|
foreach(${MYSQL_PRIVATE_VAR_NS}_VARNAME ${${MYSQL_PRIVATE_VAR_NS}_CURRENT_VARIABLES})
|
||||||
|
if(${MYSQL_PRIVATE_VAR_NS}_VARNAME MATCHES "^${${MYSQL_PRIVATE_VAR_NS}_FIND_PKG_PREFIX}")
|
||||||
|
string(REGEX REPLACE "^${${MYSQL_PRIVATE_VAR_NS}_FIND_PKG_PREFIX}" "${MYSQL_PUBLIC_VAR_NS}" ${MYSQL_PRIVATE_VAR_NS}_NORMALIZED_VARNAME ${${MYSQL_PRIVATE_VAR_NS}_VARNAME})
|
||||||
|
set(${${MYSQL_PRIVATE_VAR_NS}_NORMALIZED_VARNAME} ${${${MYSQL_PRIVATE_VAR_NS}_VARNAME}})
|
||||||
|
endif(${MYSQL_PRIVATE_VAR_NS}_VARNAME MATCHES "^${${MYSQL_PRIVATE_VAR_NS}_FIND_PKG_PREFIX}")
|
||||||
|
endforeach(${MYSQL_PRIVATE_VAR_NS}_VARNAME)
|
||||||
|
|
||||||
|
macro(_mysql_set_dotted_version VERSION_STRING)
|
||||||
|
set(${MYSQL_PUBLIC_VAR_NS}_VERSION "${VERSION_STRING}")
|
||||||
|
string(REGEX MATCHALL "[0-9]+" ${MYSQL_PRIVATE_VAR_NS}_VERSION_PARTS ${VERSION_STRING})
|
||||||
|
list(GET ${MYSQL_PRIVATE_VAR_NS}_VERSION_PARTS 0 ${MYSQL_PUBLIC_VAR_NS}_VERSION_MAJOR)
|
||||||
|
list(GET ${MYSQL_PRIVATE_VAR_NS}_VERSION_PARTS 1 ${MYSQL_PUBLIC_VAR_NS}_VERSION_MINOR)
|
||||||
|
list(GET ${MYSQL_PRIVATE_VAR_NS}_VERSION_PARTS 2 ${MYSQL_PUBLIC_VAR_NS}_VERSION_PATCH)
|
||||||
|
endmacro(_mysql_set_dotted_version)
|
||||||
|
|
||||||
|
########## Public ##########
|
||||||
|
if(PKG_CONFIG_FOUND)
|
||||||
|
pkg_check_modules(${PC_MYSQL_PRIVATE_VAR_NS} "mysqlclient" QUIET)
|
||||||
|
if(${PC_MYSQL_PRIVATE_VAR_NS}_FOUND)
|
||||||
|
if(${PC_MYSQL_PRIVATE_VAR_NS}_VERSION)
|
||||||
|
_mysql_set_dotted_version("${${PC_MYSQL_PRIVATE_VAR_NS}_VERSION}")
|
||||||
|
endif(${PC_MYSQL_PRIVATE_VAR_NS}_VERSION)
|
||||||
|
endif(${PC_MYSQL_PRIVATE_VAR_NS}_FOUND)
|
||||||
|
endif(PKG_CONFIG_FOUND)
|
||||||
|
|
||||||
|
find_program(${MYSQL_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE mysql_config)
|
||||||
|
if(${MYSQL_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
|
||||||
|
execute_process(OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND ${${MYSQL_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE ${MYSQL_PUBLIC_VAR_NS}_MYSQL_CONFIG_C_FLAGS)
|
||||||
|
execute_process(OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND ${${MYSQL_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --version OUTPUT_VARIABLE ${MYSQL_PUBLIC_VAR_NS}_MYSQL_CONFIG_VERSION)
|
||||||
|
execute_process(OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND ${${MYSQL_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --variable=pkglibdir OUTPUT_VARIABLE ${MYSQL_PUBLIC_VAR_NS}_MYSQL_CONFIG_LIBRARY_DIR)
|
||||||
|
execute_process(OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND ${${MYSQL_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --variable=pkgincludedir OUTPUT_VARIABLE ${MYSQL_PUBLIC_VAR_NS}_MYSQL_CONFIG_INCLUDE_DIR)
|
||||||
|
# execute_process(OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND ${${MYSQL_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --plugindir OUTPUT_VARIABLE ${MYSQL_PUBLIC_VAR_NS}_MYSQL_CONFIG_PLUGIN_DIR)
|
||||||
|
# execute_process(OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND ${${MYSQL_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --socket OUTPUT_VARIABLE ${MYSQL_PUBLIC_VAR_NS}_MYSQL_CONFIG_SOCKET)
|
||||||
|
# execute_process(OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND ${${MYSQL_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --port OUTPUT_VARIABLE ${MYSQL_PUBLIC_VAR_NS}_MYSQL_CONFIG_PORT)
|
||||||
|
# execute_process(OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND ${${MYSQL_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --libmysqld-libs OUTPUT_VARIABLE ${MYSQL_PUBLIC_VAR_NS}_MYSQL_CONFIG_LIBRARY_EMBEDDED)
|
||||||
|
|
||||||
|
_mysql_set_dotted_version("${${MYSQL_PUBLIC_VAR_NS}_MYSQL_CONFIG_VERSION}")
|
||||||
|
endif(${MYSQL_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
|
||||||
|
|
||||||
|
find_path(
|
||||||
|
${MYSQL_PUBLIC_VAR_NS}_INCLUDE_DIR
|
||||||
|
NAMES mysql_version.h
|
||||||
|
PATH_SUFFIXES include mysql
|
||||||
|
PATHS ${${PC_MYSQL_PRIVATE_VAR_NS}_INCLUDE_DIRS} ${${MYSQL_PUBLIC_VAR_NS}_MYSQL_CONFIG_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
include(SelectLibraryConfigurations)
|
||||||
|
# "On Windows, the static library is mysqlclient.lib and the dynamic library is libmysql.dll. Windows distributions also include libmysql.lib, a static import library needed for using the dynamic library."
|
||||||
|
set(${MYSQL_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "mysqld mysqlclientd")
|
||||||
|
set(${MYSQL_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "mysql mysqlclient")
|
||||||
|
|
||||||
|
find_library(
|
||||||
|
${MYSQL_PUBLIC_VAR_NS}_LIBRARY_RELEASE
|
||||||
|
NAMES ${${MYSQL_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES}
|
||||||
|
DOC "Release library for mysqlclient"
|
||||||
|
)
|
||||||
|
find_library(
|
||||||
|
${MYSQL_PUBLIC_VAR_NS}_LIBRARY_DEBUG
|
||||||
|
NAMES ${${MYSQL_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES}
|
||||||
|
DOC "Debug library for mysqlclient"
|
||||||
|
)
|
||||||
|
|
||||||
|
select_library_configurations("${MYSQL_PUBLIC_VAR_NS}")
|
||||||
|
else(MSVC)
|
||||||
|
# "On Unix (and Unix-like) sytems, the static library is libmysqlclient.a. The dynamic library is libmysqlclient.so on most Unix systems and libmysqlclient.dylib on OS X."
|
||||||
|
find_library(
|
||||||
|
${MYSQL_PUBLIC_VAR_NS}_LIBRARY
|
||||||
|
NAMES mysqlclient
|
||||||
|
PATHS ${${PC_MYSQL_PRIVATE_VAR_NS}_LIBRARY_DIRS} ${${MYSQL_PUBLIC_VAR_NS}_MYSQL_CONFIG_LIBRARY_DIR}
|
||||||
|
)
|
||||||
|
endif(MSVC)
|
||||||
|
|
||||||
|
if(${MYSQL_PUBLIC_VAR_NS}_INCLUDE_DIR AND NOT ${MYSQL_PUBLIC_VAR_NS}_VERSION)
|
||||||
|
file(STRINGS "${${MYSQL_PUBLIC_VAR_NS}_INCLUDE_DIR}/mysql_version.h" ${MYSQL_PRIVATE_VAR_NS}_VERSION_NUMBER_DEFINITION LIMIT_COUNT 1 REGEX ".*#[ \t]*define[ \t]*MYSQL_VERSION_ID[ \t]*[0-9]+.*")
|
||||||
|
string(REGEX REPLACE ".*# *define +MYSQL_VERSION_ID +([0-9]+).*" "\\1" ${MYSQL_PRIVATE_VAR_NS}_VERSION_NUMBER ${${MYSQL_PRIVATE_VAR_NS}_VERSION_NUMBER_DEFINITION})
|
||||||
|
|
||||||
|
math(EXPR ${MYSQL_PUBLIC_VAR_NS}_VERSION_MAJOR "${${MYSQL_PRIVATE_VAR_NS}_VERSION_NUMBER} / 10000")
|
||||||
|
math(EXPR ${MYSQL_PUBLIC_VAR_NS}_VERSION_MINOR "(${${MYSQL_PRIVATE_VAR_NS}_VERSION_NUMBER} - ${${MYSQL_PUBLIC_VAR_NS}_VERSION_MAJOR} * 10000) / 100")
|
||||||
|
math(EXPR ${MYSQL_PUBLIC_VAR_NS}_VERSION_PATCH "${${MYSQL_PRIVATE_VAR_NS}_VERSION_NUMBER} - ${${MYSQL_PUBLIC_VAR_NS}_VERSION_MAJOR} * 10000 - ${${MYSQL_PUBLIC_VAR_NS}_VERSION_MINOR} * 100")
|
||||||
|
set(${MYSQL_PUBLIC_VAR_NS}_VERSION "${${MYSQL_PUBLIC_VAR_NS}_VERSION_MAJOR}.${${MYSQL_PUBLIC_VAR_NS}_VERSION_MINOR}.${${MYSQL_PUBLIC_VAR_NS}_VERSION_PATCH}")
|
||||||
|
endif(${MYSQL_PUBLIC_VAR_NS}_INCLUDE_DIR AND NOT ${MYSQL_PUBLIC_VAR_NS}_VERSION)
|
||||||
|
|
||||||
|
# Check find_package arguments
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
if(${MYSQL_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${MYSQL_PUBLIC_VAR_NS}_FIND_QUIETLY)
|
||||||
|
find_package_handle_standard_args(
|
||||||
|
${MYSQL_PUBLIC_VAR_NS}
|
||||||
|
REQUIRED_VARS ${MYSQL_PUBLIC_VAR_NS}_LIBRARY ${MYSQL_PUBLIC_VAR_NS}_INCLUDE_DIR
|
||||||
|
VERSION_VAR ${MYSQL_PUBLIC_VAR_NS}_VERSION
|
||||||
|
)
|
||||||
|
else(${MYSQL_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${MYSQL_PUBLIC_VAR_NS}_FIND_QUIETLY)
|
||||||
|
find_package_handle_standard_args(${MYSQL_PUBLIC_VAR_NS} "Could NOT find mysql(client)" ${MYSQL_PUBLIC_VAR_NS}_LIBRARY ${MYSQL_PUBLIC_VAR_NS}_INCLUDE_DIR)
|
||||||
|
endif(${MYSQL_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${MYSQL_PUBLIC_VAR_NS}_FIND_QUIETLY)
|
||||||
|
|
||||||
|
if(${MYSQL_PUBLIC_VAR_NS}_FOUND)
|
||||||
|
# <deprecated>
|
||||||
|
# for compatibility with previous versions, alias old MYSQL_(MAJOR|MINOR|PATCH)_VERSION to MYSQL_VERSION_$1
|
||||||
|
set(${MYSQL_PUBLIC_VAR_NS}_MAJOR_VERSION ${${MYSQL_PUBLIC_VAR_NS}_VERSION_MAJOR})
|
||||||
|
set(${MYSQL_PUBLIC_VAR_NS}_MINOR_VERSION ${${MYSQL_PUBLIC_VAR_NS}_VERSION_MINOR})
|
||||||
|
set(${MYSQL_PUBLIC_VAR_NS}_PATCH_VERSION ${${MYSQL_PUBLIC_VAR_NS}_VERSION_PATCH})
|
||||||
|
# </deprecated>
|
||||||
|
set(${MYSQL_PUBLIC_VAR_NS}_LIBRARIES ${${MYSQL_PUBLIC_VAR_NS}_LIBRARY})
|
||||||
|
set(${MYSQL_PUBLIC_VAR_NS}_INCLUDE_DIRS ${${MYSQL_PUBLIC_VAR_NS}_INCLUDE_DIR})
|
||||||
|
if(CMAKE_VERSION VERSION_GREATER "3.0.0")
|
||||||
|
if(NOT TARGET MySQL::MySQL)
|
||||||
|
add_library(MySQL::MySQL UNKNOWN IMPORTED)
|
||||||
|
endif(NOT TARGET MySQL::MySQL)
|
||||||
|
if(${MYSQL_PUBLIC_VAR_NS}_LIBRARY_RELEASE)
|
||||||
|
set_property(TARGET MySQL::MySQL APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||||
|
set_target_properties(MySQL::MySQL PROPERTIES IMPORTED_LOCATION_RELEASE "${${MYSQL_PUBLIC_VAR_NS}_LIBRARY_RELEASE}")
|
||||||
|
endif(${MYSQL_PUBLIC_VAR_NS}_LIBRARY_RELEASE)
|
||||||
|
if(${MYSQL_PUBLIC_VAR_NS}_LIBRARY_DEBUG)
|
||||||
|
set_property(TARGET MySQL::MySQL APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||||
|
set_target_properties(MySQL::MySQL PROPERTIES IMPORTED_LOCATION_DEBUG "${${MYSQL_PUBLIC_VAR_NS}_LIBRARY_DEBUG}")
|
||||||
|
endif(${MYSQL_PUBLIC_VAR_NS}_LIBRARY_DEBUG)
|
||||||
|
if(${MYSQL_PUBLIC_VAR_NS}_LIBRARY)
|
||||||
|
set_target_properties(MySQL::MySQL PROPERTIES IMPORTED_LOCATION "${${MYSQL_PUBLIC_VAR_NS}_LIBRARY}")
|
||||||
|
endif(${MYSQL_PUBLIC_VAR_NS}_LIBRARY)
|
||||||
|
set_target_properties(MySQL::MySQL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${${MYSQL_PUBLIC_VAR_NS}_INCLUDE_DIR}")
|
||||||
|
endif(CMAKE_VERSION VERSION_GREATER "3.0.0")
|
||||||
|
endif(${MYSQL_PUBLIC_VAR_NS}_FOUND)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
${MYSQL_PUBLIC_VAR_NS}_INCLUDE_DIR
|
||||||
|
${MYSQL_PUBLIC_VAR_NS}_LIBRARY
|
||||||
|
)
|
||||||
|
|
||||||
|
########## <debug> ##########
|
||||||
|
|
||||||
|
if(${MYSQL_PUBLIC_VAR_NS}_DEBUG)
|
||||||
|
|
||||||
|
function(mysql_debug _VARNAME)
|
||||||
|
if(DEFINED ${MYSQL_PUBLIC_VAR_NS}_${_VARNAME})
|
||||||
|
message("${MYSQL_PUBLIC_VAR_NS}_${_VARNAME} = ${${MYSQL_PUBLIC_VAR_NS}_${_VARNAME}}")
|
||||||
|
else(DEFINED ${MYSQL_PUBLIC_VAR_NS}_${_VARNAME})
|
||||||
|
message("${MYSQL_PUBLIC_VAR_NS}_${_VARNAME} = <UNDEFINED>")
|
||||||
|
endif(DEFINED ${MYSQL_PUBLIC_VAR_NS}_${_VARNAME})
|
||||||
|
endfunction(mysql_debug)
|
||||||
|
|
||||||
|
# IN (args)
|
||||||
|
mysql_debug("FIND_REQUIRED")
|
||||||
|
mysql_debug("FIND_QUIETLY")
|
||||||
|
mysql_debug("FIND_VERSION")
|
||||||
|
# OUT
|
||||||
|
# Linking
|
||||||
|
mysql_debug("INCLUDE_DIRS")
|
||||||
|
mysql_debug("LIBRARIES")
|
||||||
|
# Version
|
||||||
|
mysql_debug("VERSION_MAJOR")
|
||||||
|
mysql_debug("VERSION_MINOR")
|
||||||
|
mysql_debug("VERSION_PATCH")
|
||||||
|
mysql_debug("VERSION")
|
||||||
|
|
||||||
|
endif(${MYSQL_PUBLIC_VAR_NS}_DEBUG)
|
||||||
|
|
||||||
|
########## </debug> ##########
|
@ -1,51 +0,0 @@
|
|||||||
#ifndef MAXMINDDB_CONFIG_H
|
|
||||||
#define MAXMINDDB_CONFIG_H
|
|
||||||
|
|
||||||
#ifndef MMDB_UINT128_USING_MODE
|
|
||||||
/* Define as 1 if we we use unsigned int __atribute__ ((__mode__(TI))) for uint128 values */
|
|
||||||
#if __x86_64__
|
|
||||||
#define MMDB_UINT128_USING_MODE 1
|
|
||||||
#else
|
|
||||||
#define MMDB_UINT128_USING_MODE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef MMDB_UINT128_IS_BYTE_ARRAY
|
|
||||||
/* Define as 1 if we don't have an unsigned __int128 type */\
|
|
||||||
#if __x86_64__
|
|
||||||
#undef MMDB_UINT128_IS_BYTE_ARRAY
|
|
||||||
#else
|
|
||||||
#define MMDB_UINT128_IS_BYTE_ARRAY 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Name of package */
|
|
||||||
#define PACKAGE "libmaxminddb"
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#define PACKAGE_BUGREPORT "support@maxmind.com"
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#define PACKAGE_NAME "libmaxminddb"
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#define PACKAGE_STRING "libmaxminddb 1.4.2"
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#define PACKAGE_TARNAME "libmaxminddb"
|
|
||||||
|
|
||||||
/* Define to the home page for this package. */
|
|
||||||
#define PACKAGE_URL ""
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#define PACKAGE_VERSION "1.4.2"
|
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#define VERSION "1.4.2"
|
|
||||||
|
|
||||||
#endif /* MAXMINDDB_CONFIG_H */
|
|
@ -1,110 +0,0 @@
|
|||||||
/* src/config.h. Generated from config.h.in by configure. */
|
|
||||||
/* include/config.h.in. Generated from configure.in by autoheader. */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
|
||||||
/* #undef HAVE_GETADDRINFO */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `gethostbyname_r' function. */
|
|
||||||
#define HAVE_GETHOSTBYNAME_R 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `inet_ntoa' function. */
|
|
||||||
#define HAVE_INET_NTOA 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `inet_pton' function. */
|
|
||||||
/* #undef HAVE_INET_PTON */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `localtime_r' function. */
|
|
||||||
#define HAVE_LOCALTIME_R 1
|
|
||||||
|
|
||||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
|
||||||
to 0 otherwise. */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
|
||||||
#define HAVE_MEMORY_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `socket' function. */
|
|
||||||
#define HAVE_SOCKET 1
|
|
||||||
|
|
||||||
/* Define to 1 if `stat' has the bug that it succeeds when given the
|
|
||||||
zero-length file name argument. */
|
|
||||||
/* #undef HAVE_STAT_EMPTY_STRING_BUG */
|
|
||||||
|
|
||||||
/* Define to 1 if stdbool.h conforms to C99. */
|
|
||||||
#define HAVE_STDBOOL_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#define HAVE_STDLIB_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#define HAVE_STRINGS_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
|
||||||
#define HAVE_SYS_SELECT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
|
||||||
#define HAVE_SYS_SOCKET_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#define HAVE_SYS_STAT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#define HAVE_UNISTD_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if the system has the type `_Bool'. */
|
|
||||||
#define HAVE__BOOL 1
|
|
||||||
|
|
||||||
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
|
|
||||||
slash. */
|
|
||||||
#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#define PACKAGE_BUGREPORT "gyunaev@ulduzsoft.com"
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#define PACKAGE_NAME "libircclient"
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#define PACKAGE_STRING "libircclient 1.3"
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#define PACKAGE_TARNAME "libircclient"
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#define PACKAGE_VERSION "1.3"
|
|
||||||
|
|
||||||
/* Define to the type of arg 1 for `select'. */
|
|
||||||
#define SELECT_TYPE_ARG1 int
|
|
||||||
|
|
||||||
/* Define to the type of args 2, 3 and 4 for `select'. */
|
|
||||||
#define SELECT_TYPE_ARG234 (fd_set *)
|
|
||||||
|
|
||||||
/* Define to the type of arg 5 for `select'. */
|
|
||||||
#define SELECT_TYPE_ARG5 (struct timeval *)
|
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
|
|
||||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
|
||||||
#define TIME_WITH_SYS_TIME 1
|
|
||||||
|
|
||||||
/* Define to empty if `const' does not conform to ANSI C. */
|
|
||||||
/* #undef const */
|
|
||||||
|
|
||||||
/* Define to rpl_malloc if the replacement function should be used. */
|
|
||||||
/* #undef malloc */
|
|
||||||
|
|
||||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
|
||||||
/* #undef size_t */
|
|
@ -1,195 +0,0 @@
|
|||||||
/* include/maxminddb_config.h. Generated from maxminddb_config.h.in by configure. */
|
|
||||||
#ifndef MAXMINDDB_CONFIG_H
|
|
||||||
#define MAXMINDDB_CONFIG_H
|
|
||||||
/* config.h. Generated from config.h.in by configure. */
|
|
||||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
|
||||||
#define HAVE_ARPA_INET_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <assert.h> header file. */
|
|
||||||
#define HAVE_ASSERT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if the system has the type `boolean'. */
|
|
||||||
/* #undef HAVE_BOOLEAN */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
|
||||||
#define HAVE_DLFCN_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
|
||||||
#define HAVE_FCNTL_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getpagesize' function. */
|
|
||||||
#define HAVE_GETPAGESIZE 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <libgen.h> header file. */
|
|
||||||
#define HAVE_LIBGEN_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
|
||||||
to 0 otherwise. */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <math.h> header file. */
|
|
||||||
#define HAVE_MATH_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
|
||||||
#define HAVE_MEMORY_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have a working `mmap' system call. */
|
|
||||||
#define HAVE_MMAP 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <netdb.h> header file. */
|
|
||||||
#define HAVE_NETDB_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
|
||||||
#define HAVE_NETINET_IN_H 1
|
|
||||||
|
|
||||||
/* Has an open_memstream() function */
|
|
||||||
#define HAVE_OPEN_MEMSTREAM 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdarg.h> header file. */
|
|
||||||
#define HAVE_STDARG_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdbool.h> header file. */
|
|
||||||
#define HAVE_STDBOOL_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdio.h> header file. */
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#define HAVE_STDLIB_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#define HAVE_STRINGS_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/mman.h> header file. */
|
|
||||||
#define HAVE_SYS_MMAN_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
|
||||||
#define HAVE_SYS_PARAM_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
|
||||||
#define HAVE_SYS_SOCKET_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#define HAVE_SYS_STAT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
|
||||||
#define HAVE_SYS_TIME_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#define HAVE_UNISTD_H 1
|
|
||||||
|
|
||||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
|
||||||
*/
|
|
||||||
#define LT_OBJDIR ".libs/"
|
|
||||||
|
|
||||||
/* Missing the unsigned __int128 type */
|
|
||||||
#define MMDB_UINT128_IS_BYTE_ARRAY 1
|
|
||||||
|
|
||||||
/* int128 types are available with __attribute__((mode(TI))) */
|
|
||||||
/* #undef MMDB_UINT128_USING_MODE */
|
|
||||||
|
|
||||||
/* Name of package */
|
|
||||||
#define PACKAGE "libmaxminddb"
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#define PACKAGE_BUGREPORT "support@maxmind.com"
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#define PACKAGE_NAME "libmaxminddb"
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#define PACKAGE_STRING "libmaxminddb 1.4.2"
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#define PACKAGE_TARNAME "libmaxminddb"
|
|
||||||
|
|
||||||
/* Define to the home page for this package. */
|
|
||||||
#define PACKAGE_URL ""
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#define PACKAGE_VERSION "1.4.2"
|
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#define VERSION "1.4.2"
|
|
||||||
|
|
||||||
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
|
|
||||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
|
||||||
#define below would cause a syntax error. */
|
|
||||||
/* #undef _UINT32_T */
|
|
||||||
|
|
||||||
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
|
|
||||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
|
||||||
#define below would cause a syntax error. */
|
|
||||||
/* #undef _UINT64_T */
|
|
||||||
|
|
||||||
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
|
|
||||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
|
||||||
#define below would cause a syntax error. */
|
|
||||||
/* #undef _UINT8_T */
|
|
||||||
|
|
||||||
/* Define to rpl_malloc if the replacement function should be used. */
|
|
||||||
/* #undef malloc */
|
|
||||||
|
|
||||||
/* Define to `long int' if <sys/types.h> does not define. */
|
|
||||||
/* #undef off_t */
|
|
||||||
|
|
||||||
/* Define to the equivalent of the C99 'restrict' keyword, or to
|
|
||||||
nothing if this is not supported. Do not define if restrict is
|
|
||||||
supported directly. */
|
|
||||||
#define restrict __restrict
|
|
||||||
/* Work around a bug in Sun C++: it does not support _Restrict or
|
|
||||||
__restrict__, even though the corresponding Sun C compiler ends up with
|
|
||||||
"#define restrict _Restrict" or "#define restrict __restrict__" in the
|
|
||||||
previous line. Perhaps some future version of Sun C++ will work with
|
|
||||||
restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
|
|
||||||
#if defined __SUNPRO_CC && !defined __RESTRICT
|
|
||||||
# define _Restrict
|
|
||||||
# define __restrict__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
|
||||||
/* #undef size_t */
|
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> does not define. */
|
|
||||||
/* #undef ssize_t */
|
|
||||||
|
|
||||||
/* Define to the type of an unsigned integer type of width exactly 32 bits if
|
|
||||||
such a type exists and the standard includes do not define it. */
|
|
||||||
/* #undef uint32_t */
|
|
||||||
|
|
||||||
/* Define to the type of an unsigned integer type of width exactly 64 bits if
|
|
||||||
such a type exists and the standard includes do not define it. */
|
|
||||||
/* #undef uint64_t */
|
|
||||||
|
|
||||||
/* Define to the type of an unsigned integer type of width exactly 8 bits if
|
|
||||||
such a type exists and the standard includes do not define it. */
|
|
||||||
/* #undef uint8_t */
|
|
||||||
|
|
||||||
#ifndef MMDB_UINT128_USING_MODE
|
|
||||||
/* Define as 1 if we we use unsigned int __atribute__ ((__mode__(TI))) for uint128 values */
|
|
||||||
#define MMDB_UINT128_USING_MODE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef MMDB_UINT128_IS_BYTE_ARRAY
|
|
||||||
/* Define as 1 if we don't have an unsigned __int128 type */
|
|
||||||
#define MMDB_UINT128_IS_BYTE_ARRAY 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* MAXMINDDB_CONFIG_H */
|
|
@ -1,110 +0,0 @@
|
|||||||
/* src/config.h. Generated from config.h.in by configure. */
|
|
||||||
/* include/config.h.in. Generated from configure.in by autoheader. */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
|
||||||
/* #undef HAVE_GETADDRINFO */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `gethostbyname_r' function. */
|
|
||||||
#define HAVE_GETHOSTBYNAME_R 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `inet_ntoa' function. */
|
|
||||||
#define HAVE_INET_NTOA 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `inet_pton' function. */
|
|
||||||
/* #undef HAVE_INET_PTON */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `localtime_r' function. */
|
|
||||||
#define HAVE_LOCALTIME_R 1
|
|
||||||
|
|
||||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
|
||||||
to 0 otherwise. */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
|
||||||
#define HAVE_MEMORY_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `socket' function. */
|
|
||||||
#define HAVE_SOCKET 1
|
|
||||||
|
|
||||||
/* Define to 1 if `stat' has the bug that it succeeds when given the
|
|
||||||
zero-length file name argument. */
|
|
||||||
/* #undef HAVE_STAT_EMPTY_STRING_BUG */
|
|
||||||
|
|
||||||
/* Define to 1 if stdbool.h conforms to C99. */
|
|
||||||
#define HAVE_STDBOOL_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#define HAVE_STDLIB_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#define HAVE_STRINGS_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
|
||||||
#define HAVE_SYS_SELECT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
|
||||||
#define HAVE_SYS_SOCKET_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#define HAVE_SYS_STAT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#define HAVE_UNISTD_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if the system has the type `_Bool'. */
|
|
||||||
#define HAVE__BOOL 1
|
|
||||||
|
|
||||||
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
|
|
||||||
slash. */
|
|
||||||
#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#define PACKAGE_BUGREPORT "gyunaev@ulduzsoft.com"
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#define PACKAGE_NAME "libircclient"
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#define PACKAGE_STRING "libircclient 1.3"
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#define PACKAGE_TARNAME "libircclient"
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#define PACKAGE_VERSION "1.3"
|
|
||||||
|
|
||||||
/* Define to the type of arg 1 for `select'. */
|
|
||||||
#define SELECT_TYPE_ARG1 int
|
|
||||||
|
|
||||||
/* Define to the type of args 2, 3 and 4 for `select'. */
|
|
||||||
#define SELECT_TYPE_ARG234 (fd_set *)
|
|
||||||
|
|
||||||
/* Define to the type of arg 5 for `select'. */
|
|
||||||
#define SELECT_TYPE_ARG5 (struct timeval *)
|
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
|
|
||||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
|
||||||
#define TIME_WITH_SYS_TIME 1
|
|
||||||
|
|
||||||
/* Define to empty if `const' does not conform to ANSI C. */
|
|
||||||
/* #undef const */
|
|
||||||
|
|
||||||
/* Define to rpl_malloc if the replacement function should be used. */
|
|
||||||
/* #undef malloc */
|
|
||||||
|
|
||||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
|
||||||
/* #undef size_t */
|
|
@ -1,195 +0,0 @@
|
|||||||
/* include/maxminddb_config.h. Generated from maxminddb_config.h.in by configure. */
|
|
||||||
#ifndef MAXMINDDB_CONFIG_H
|
|
||||||
#define MAXMINDDB_CONFIG_H
|
|
||||||
/* config.h. Generated from config.h.in by configure. */
|
|
||||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
|
||||||
#define HAVE_ARPA_INET_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <assert.h> header file. */
|
|
||||||
#define HAVE_ASSERT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if the system has the type `boolean'. */
|
|
||||||
/* #undef HAVE_BOOLEAN */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
|
||||||
#define HAVE_DLFCN_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
|
||||||
#define HAVE_FCNTL_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getpagesize' function. */
|
|
||||||
#define HAVE_GETPAGESIZE 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <libgen.h> header file. */
|
|
||||||
#define HAVE_LIBGEN_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
|
||||||
to 0 otherwise. */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <math.h> header file. */
|
|
||||||
#define HAVE_MATH_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
|
||||||
#define HAVE_MEMORY_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have a working `mmap' system call. */
|
|
||||||
#define HAVE_MMAP 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <netdb.h> header file. */
|
|
||||||
#define HAVE_NETDB_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
|
||||||
#define HAVE_NETINET_IN_H 1
|
|
||||||
|
|
||||||
/* Has an open_memstream() function */
|
|
||||||
#define HAVE_OPEN_MEMSTREAM 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdarg.h> header file. */
|
|
||||||
#define HAVE_STDARG_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdbool.h> header file. */
|
|
||||||
#define HAVE_STDBOOL_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdio.h> header file. */
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#define HAVE_STDLIB_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#define HAVE_STRINGS_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/mman.h> header file. */
|
|
||||||
#define HAVE_SYS_MMAN_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
|
||||||
#define HAVE_SYS_PARAM_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
|
||||||
#define HAVE_SYS_SOCKET_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#define HAVE_SYS_STAT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
|
||||||
#define HAVE_SYS_TIME_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#define HAVE_UNISTD_H 1
|
|
||||||
|
|
||||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
|
||||||
*/
|
|
||||||
#define LT_OBJDIR ".libs/"
|
|
||||||
|
|
||||||
/* Missing the unsigned __int128 type */
|
|
||||||
#define MMDB_UINT128_IS_BYTE_ARRAY 0
|
|
||||||
|
|
||||||
/* int128 types are available with __attribute__((mode(TI))) */
|
|
||||||
/* #undef MMDB_UINT128_USING_MODE */
|
|
||||||
|
|
||||||
/* Name of package */
|
|
||||||
#define PACKAGE "libmaxminddb"
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#define PACKAGE_BUGREPORT "support@maxmind.com"
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#define PACKAGE_NAME "libmaxminddb"
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#define PACKAGE_STRING "libmaxminddb 1.4.2"
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#define PACKAGE_TARNAME "libmaxminddb"
|
|
||||||
|
|
||||||
/* Define to the home page for this package. */
|
|
||||||
#define PACKAGE_URL ""
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#define PACKAGE_VERSION "1.4.2"
|
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#define VERSION "1.4.2"
|
|
||||||
|
|
||||||
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
|
|
||||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
|
||||||
#define below would cause a syntax error. */
|
|
||||||
/* #undef _UINT32_T */
|
|
||||||
|
|
||||||
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
|
|
||||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
|
||||||
#define below would cause a syntax error. */
|
|
||||||
/* #undef _UINT64_T */
|
|
||||||
|
|
||||||
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
|
|
||||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
|
||||||
#define below would cause a syntax error. */
|
|
||||||
/* #undef _UINT8_T */
|
|
||||||
|
|
||||||
/* Define to rpl_malloc if the replacement function should be used. */
|
|
||||||
/* #undef malloc */
|
|
||||||
|
|
||||||
/* Define to `long int' if <sys/types.h> does not define. */
|
|
||||||
/* #undef off_t */
|
|
||||||
|
|
||||||
/* Define to the equivalent of the C99 'restrict' keyword, or to
|
|
||||||
nothing if this is not supported. Do not define if restrict is
|
|
||||||
supported directly. */
|
|
||||||
#define restrict __restrict
|
|
||||||
/* Work around a bug in Sun C++: it does not support _Restrict or
|
|
||||||
__restrict__, even though the corresponding Sun C compiler ends up with
|
|
||||||
"#define restrict _Restrict" or "#define restrict __restrict__" in the
|
|
||||||
previous line. Perhaps some future version of Sun C++ will work with
|
|
||||||
restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
|
|
||||||
#if defined __SUNPRO_CC && !defined __RESTRICT
|
|
||||||
# define _Restrict
|
|
||||||
# define __restrict__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
|
||||||
/* #undef size_t */
|
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> does not define. */
|
|
||||||
/* #undef ssize_t */
|
|
||||||
|
|
||||||
/* Define to the type of an unsigned integer type of width exactly 32 bits if
|
|
||||||
such a type exists and the standard includes do not define it. */
|
|
||||||
/* #undef uint32_t */
|
|
||||||
|
|
||||||
/* Define to the type of an unsigned integer type of width exactly 64 bits if
|
|
||||||
such a type exists and the standard includes do not define it. */
|
|
||||||
/* #undef uint64_t */
|
|
||||||
|
|
||||||
/* Define to the type of an unsigned integer type of width exactly 8 bits if
|
|
||||||
such a type exists and the standard includes do not define it. */
|
|
||||||
/* #undef uint8_t */
|
|
||||||
|
|
||||||
#ifndef MMDB_UINT128_USING_MODE
|
|
||||||
/* Define as 1 if we we use unsigned int __atribute__ ((__mode__(TI))) for uint128 values */
|
|
||||||
#define MMDB_UINT128_USING_MODE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef MMDB_UINT128_IS_BYTE_ARRAY
|
|
||||||
/* Define as 1 if we don't have an unsigned __int128 type */
|
|
||||||
#define MMDB_UINT128_IS_BYTE_ARRAY 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* MAXMINDDB_CONFIG_H */
|
|
@ -1,110 +0,0 @@
|
|||||||
/* src/config.h. Generated from config.h.in by configure. */
|
|
||||||
/* include/config.h.in. Generated from configure.in by autoheader. */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
|
||||||
/* #undef HAVE_GETADDRINFO */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `gethostbyname_r' function. */
|
|
||||||
/* #undef HAVE_GETHOSTBYNAME_R */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `inet_ntoa' function. */
|
|
||||||
/* #undef HAVE_INET_NTOA */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `inet_pton' function. */
|
|
||||||
/* #undef HAVE_INET_PTON */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `localtime_r' function. */
|
|
||||||
/* #undef HAVE_LOCALTIME_R */
|
|
||||||
|
|
||||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
|
||||||
to 0 otherwise. */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
|
||||||
#define HAVE_MEMORY_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `socket' function. */
|
|
||||||
/* #undef HAVE_SOCKET */
|
|
||||||
|
|
||||||
/* Define to 1 if `stat' has the bug that it succeeds when given the
|
|
||||||
zero-length file name argument. */
|
|
||||||
/* #undef HAVE_STAT_EMPTY_STRING_BUG */
|
|
||||||
|
|
||||||
/* Define to 1 if stdbool.h conforms to C99. */
|
|
||||||
#define HAVE_STDBOOL_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#define HAVE_STDLIB_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#define HAVE_STRINGS_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
|
||||||
/* #undef HAVE_SYS_SELECT_H */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
|
||||||
/* #undef HAVE_SYS_SOCKET_H */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#define HAVE_SYS_STAT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#define HAVE_UNISTD_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if the system has the type `_Bool'. */
|
|
||||||
#define HAVE__BOOL 1
|
|
||||||
|
|
||||||
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
|
|
||||||
slash. */
|
|
||||||
/* #undef LSTAT_FOLLOWS_SLASHED_SYMLINK */
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#define PACKAGE_BUGREPORT "gyunaev@ulduzsoft.com"
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#define PACKAGE_NAME "libircclient"
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#define PACKAGE_STRING "libircclient 1.3"
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#define PACKAGE_TARNAME "libircclient"
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#define PACKAGE_VERSION "1.3"
|
|
||||||
|
|
||||||
/* Define to the type of arg 1 for `select'. */
|
|
||||||
#define SELECT_TYPE_ARG1 int
|
|
||||||
|
|
||||||
/* Define to the type of args 2, 3 and 4 for `select'. */
|
|
||||||
#define SELECT_TYPE_ARG234 (int *)
|
|
||||||
|
|
||||||
/* Define to the type of arg 5 for `select'. */
|
|
||||||
#define SELECT_TYPE_ARG5 (struct timeval *)
|
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
|
|
||||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
|
||||||
#define TIME_WITH_SYS_TIME 1
|
|
||||||
|
|
||||||
/* Define to empty if `const' does not conform to ANSI C. */
|
|
||||||
/* #undef const */
|
|
||||||
|
|
||||||
/* Define to rpl_malloc if the replacement function should be used. */
|
|
||||||
/* #undef malloc */
|
|
||||||
|
|
||||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
|
||||||
/* #undef size_t */
|
|
@ -1,14 +0,0 @@
|
|||||||
#ifndef _ENDIAN_H_
|
|
||||||
#define _ENDIAN_H_
|
|
||||||
|
|
||||||
#if defined(__MINGW32__) || defined(__MINGW64__)
|
|
||||||
// Workaround for MinGW and it's lack of <endian.h> file
|
|
||||||
#define __BYTE_ORDER __BYTE_ORDER__
|
|
||||||
#define __LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
|
|
||||||
#define __BIG_ENDIAN __ORDER_BIG_ENDIAN__
|
|
||||||
#elif !defined(_MSC_VER)
|
|
||||||
// Just include the system file
|
|
||||||
#include <endian.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // _ENDIAN_H_
|
|
@ -1,110 +0,0 @@
|
|||||||
/* src/config.h. Generated from config.h.in by configure. */
|
|
||||||
/* include/config.h.in. Generated from configure.in by autoheader. */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
|
||||||
/* #undef HAVE_GETADDRINFO */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `gethostbyname_r' function. */
|
|
||||||
/* #undef HAVE_GETHOSTBYNAME_R */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `inet_ntoa' function. */
|
|
||||||
/* #undef HAVE_INET_NTOA */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `inet_pton' function. */
|
|
||||||
/* #undef HAVE_INET_PTON */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `localtime_r' function. */
|
|
||||||
/* #undef HAVE_LOCALTIME_R */
|
|
||||||
|
|
||||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
|
||||||
to 0 otherwise. */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
|
||||||
#define HAVE_MEMORY_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `socket' function. */
|
|
||||||
/* #undef HAVE_SOCKET */
|
|
||||||
|
|
||||||
/* Define to 1 if `stat' has the bug that it succeeds when given the
|
|
||||||
zero-length file name argument. */
|
|
||||||
/* #undef HAVE_STAT_EMPTY_STRING_BUG */
|
|
||||||
|
|
||||||
/* Define to 1 if stdbool.h conforms to C99. */
|
|
||||||
#define HAVE_STDBOOL_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#define HAVE_STDLIB_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#define HAVE_STRINGS_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
|
||||||
/* #undef HAVE_SYS_SELECT_H */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
|
||||||
/* #undef HAVE_SYS_SOCKET_H */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#define HAVE_SYS_STAT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#define HAVE_UNISTD_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if the system has the type `_Bool'. */
|
|
||||||
#define HAVE__BOOL 1
|
|
||||||
|
|
||||||
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
|
|
||||||
slash. */
|
|
||||||
/* #undef LSTAT_FOLLOWS_SLASHED_SYMLINK */
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#define PACKAGE_BUGREPORT "gyunaev@ulduzsoft.com"
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#define PACKAGE_NAME "libircclient"
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#define PACKAGE_STRING "libircclient 1.3"
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#define PACKAGE_TARNAME "libircclient"
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#define PACKAGE_VERSION "1.3"
|
|
||||||
|
|
||||||
/* Define to the type of arg 1 for `select'. */
|
|
||||||
#define SELECT_TYPE_ARG1 int
|
|
||||||
|
|
||||||
/* Define to the type of args 2, 3 and 4 for `select'. */
|
|
||||||
#define SELECT_TYPE_ARG234 (int *)
|
|
||||||
|
|
||||||
/* Define to the type of arg 5 for `select'. */
|
|
||||||
#define SELECT_TYPE_ARG5 (struct timeval *)
|
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
|
|
||||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
|
||||||
#define TIME_WITH_SYS_TIME 1
|
|
||||||
|
|
||||||
/* Define to empty if `const' does not conform to ANSI C. */
|
|
||||||
/* #undef const */
|
|
||||||
|
|
||||||
/* Define to rpl_malloc if the replacement function should be used. */
|
|
||||||
/* #undef malloc */
|
|
||||||
|
|
||||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
|
||||||
/* #undef size_t */
|
|
467
external/Jansson/dump.c
vendored
467
external/Jansson/dump.c
vendored
@ -1,467 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
|
||||||
*
|
|
||||||
* Jansson is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the MIT license. See LICENSE for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _GNU_SOURCE
|
|
||||||
#define _GNU_SOURCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#include "jansson.h"
|
|
||||||
#include "jansson_private.h"
|
|
||||||
#include "strbuffer.h"
|
|
||||||
#include "utf.h"
|
|
||||||
|
|
||||||
#define MAX_INTEGER_STR_LENGTH 100
|
|
||||||
#define MAX_REAL_STR_LENGTH 100
|
|
||||||
|
|
||||||
#define FLAGS_TO_INDENT(f) ((f) & 0x1F)
|
|
||||||
#define FLAGS_TO_PRECISION(f) (((f) >> 11) & 0x1F)
|
|
||||||
|
|
||||||
struct object_key {
|
|
||||||
size_t serial;
|
|
||||||
const char *key;
|
|
||||||
};
|
|
||||||
|
|
||||||
static int dump_to_strbuffer(const char *buffer, size_t size, void *data)
|
|
||||||
{
|
|
||||||
return strbuffer_append_bytes((strbuffer_t *)data, buffer, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int dump_to_file(const char *buffer, size_t size, void *data)
|
|
||||||
{
|
|
||||||
FILE *dest = (FILE *)data;
|
|
||||||
if(fwrite(buffer, size, 1, dest) != 1)
|
|
||||||
return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 32 spaces (the maximum indentation size) */
|
|
||||||
static const char whitespace[] = " ";
|
|
||||||
|
|
||||||
static int dump_indent(size_t flags, int depth, int space, json_dump_callback_t dump, void *data)
|
|
||||||
{
|
|
||||||
if(FLAGS_TO_INDENT(flags) > 0)
|
|
||||||
{
|
|
||||||
unsigned int ws_count = FLAGS_TO_INDENT(flags), n_spaces = depth * ws_count;
|
|
||||||
|
|
||||||
if(dump("\n", 1, data))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
while(n_spaces > 0)
|
|
||||||
{
|
|
||||||
int cur_n = n_spaces < sizeof whitespace - 1 ? n_spaces : sizeof whitespace - 1;
|
|
||||||
|
|
||||||
if(dump(whitespace, cur_n, data))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
n_spaces -= cur_n;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(space && !(flags & JSON_COMPACT))
|
|
||||||
{
|
|
||||||
return dump(" ", 1, data);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int dump_string(const char *str, size_t len, json_dump_callback_t dump, void *data, size_t flags)
|
|
||||||
{
|
|
||||||
const char *pos, *end, *lim;
|
|
||||||
int32_t codepoint;
|
|
||||||
|
|
||||||
if(dump("\"", 1, data))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
end = pos = str;
|
|
||||||
lim = str + len;
|
|
||||||
while(1)
|
|
||||||
{
|
|
||||||
const char *text;
|
|
||||||
char seq[13];
|
|
||||||
int length;
|
|
||||||
|
|
||||||
while(end < lim)
|
|
||||||
{
|
|
||||||
end = utf8_iterate(pos, lim - pos, &codepoint);
|
|
||||||
if(!end)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
/* mandatory escape or control char */
|
|
||||||
if(codepoint == '\\' || codepoint == '"' || codepoint < 0x20)
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* slash */
|
|
||||||
if((flags & JSON_ESCAPE_SLASH) && codepoint == '/')
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* non-ASCII */
|
|
||||||
if((flags & JSON_ENSURE_ASCII) && codepoint > 0x7F)
|
|
||||||
break;
|
|
||||||
|
|
||||||
pos = end;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(pos != str) {
|
|
||||||
if(dump(str, pos - str, data))
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(end == pos)
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* handle \, /, ", and control codes */
|
|
||||||
length = 2;
|
|
||||||
switch(codepoint)
|
|
||||||
{
|
|
||||||
case '\\': text = "\\\\"; break;
|
|
||||||
case '\"': text = "\\\""; break;
|
|
||||||
case '\b': text = "\\b"; break;
|
|
||||||
case '\f': text = "\\f"; break;
|
|
||||||
case '\n': text = "\\n"; break;
|
|
||||||
case '\r': text = "\\r"; break;
|
|
||||||
case '\t': text = "\\t"; break;
|
|
||||||
case '/': text = "\\/"; break;
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
/* codepoint is in BMP */
|
|
||||||
if(codepoint < 0x10000)
|
|
||||||
{
|
|
||||||
snprintf(seq, sizeof(seq), "\\u%04X", (unsigned int)codepoint);
|
|
||||||
length = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* not in BMP -> construct a UTF-16 surrogate pair */
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int32_t first, last;
|
|
||||||
|
|
||||||
codepoint -= 0x10000;
|
|
||||||
first = 0xD800 | ((codepoint & 0xffc00) >> 10);
|
|
||||||
last = 0xDC00 | (codepoint & 0x003ff);
|
|
||||||
|
|
||||||
snprintf(seq, sizeof(seq), "\\u%04X\\u%04X", (unsigned int)first, (unsigned int)last);
|
|
||||||
length = 12;
|
|
||||||
}
|
|
||||||
|
|
||||||
text = seq;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(dump(text, length, data))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
str = pos = end;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dump("\"", 1, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int object_key_compare_keys(const void *key1, const void *key2)
|
|
||||||
{
|
|
||||||
return strcmp(((const struct object_key *)key1)->key,
|
|
||||||
((const struct object_key *)key2)->key);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int object_key_compare_serials(const void *key1, const void *key2)
|
|
||||||
{
|
|
||||||
size_t a = ((const struct object_key *)key1)->serial;
|
|
||||||
size_t b = ((const struct object_key *)key2)->serial;
|
|
||||||
|
|
||||||
return a < b ? -1 : a == b ? 0 : 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int do_dump(const json_t *json, size_t flags, int depth,
|
|
||||||
json_dump_callback_t dump, void *data)
|
|
||||||
{
|
|
||||||
if(!json)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
switch(json_typeof(json)) {
|
|
||||||
case JSON_NULL:
|
|
||||||
return dump("null", 4, data);
|
|
||||||
|
|
||||||
case JSON_TRUE:
|
|
||||||
return dump("true", 4, data);
|
|
||||||
|
|
||||||
case JSON_FALSE:
|
|
||||||
return dump("false", 5, data);
|
|
||||||
|
|
||||||
case JSON_INTEGER:
|
|
||||||
{
|
|
||||||
char buffer[MAX_INTEGER_STR_LENGTH];
|
|
||||||
int size;
|
|
||||||
|
|
||||||
size = snprintf(buffer, MAX_INTEGER_STR_LENGTH,
|
|
||||||
"%" JSON_INTEGER_FORMAT,
|
|
||||||
json_integer_value(json));
|
|
||||||
if(size < 0 || size >= MAX_INTEGER_STR_LENGTH)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return dump(buffer, size, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
case JSON_REAL:
|
|
||||||
{
|
|
||||||
char buffer[MAX_REAL_STR_LENGTH];
|
|
||||||
int size;
|
|
||||||
double value = json_real_value(json);
|
|
||||||
|
|
||||||
size = jsonp_dtostr(buffer, MAX_REAL_STR_LENGTH, value,
|
|
||||||
FLAGS_TO_PRECISION(flags));
|
|
||||||
if(size < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return dump(buffer, size, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
case JSON_STRING:
|
|
||||||
return dump_string(json_string_value(json), json_string_length(json), dump, data, flags);
|
|
||||||
|
|
||||||
case JSON_ARRAY:
|
|
||||||
{
|
|
||||||
size_t n;
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
json_array_t *array;
|
|
||||||
|
|
||||||
/* detect circular references */
|
|
||||||
array = json_to_array(json);
|
|
||||||
if(array->visited)
|
|
||||||
goto array_error;
|
|
||||||
array->visited = 1;
|
|
||||||
|
|
||||||
n = json_array_size(json);
|
|
||||||
|
|
||||||
if(dump("[", 1, data))
|
|
||||||
goto array_error;
|
|
||||||
if(n == 0) {
|
|
||||||
array->visited = 0;
|
|
||||||
return dump("]", 1, data);
|
|
||||||
}
|
|
||||||
if(dump_indent(flags, depth + 1, 0, dump, data))
|
|
||||||
goto array_error;
|
|
||||||
|
|
||||||
for(i = 0; i < n; ++i) {
|
|
||||||
if(do_dump(json_array_get(json, i), flags, depth + 1,
|
|
||||||
dump, data))
|
|
||||||
goto array_error;
|
|
||||||
|
|
||||||
if(i < n - 1)
|
|
||||||
{
|
|
||||||
if(dump(",", 1, data) ||
|
|
||||||
dump_indent(flags, depth + 1, 1, dump, data))
|
|
||||||
goto array_error;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(dump_indent(flags, depth, 0, dump, data))
|
|
||||||
goto array_error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
array->visited = 0;
|
|
||||||
return dump("]", 1, data);
|
|
||||||
|
|
||||||
array_error:
|
|
||||||
array->visited = 0;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
case JSON_OBJECT:
|
|
||||||
{
|
|
||||||
json_object_t *object;
|
|
||||||
void *iter;
|
|
||||||
const char *separator;
|
|
||||||
int separator_length;
|
|
||||||
|
|
||||||
if(flags & JSON_COMPACT) {
|
|
||||||
separator = ":";
|
|
||||||
separator_length = 1;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
separator = ": ";
|
|
||||||
separator_length = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* detect circular references */
|
|
||||||
object = json_to_object(json);
|
|
||||||
if(object->visited)
|
|
||||||
goto object_error;
|
|
||||||
object->visited = 1;
|
|
||||||
|
|
||||||
iter = json_object_iter((json_t *)json);
|
|
||||||
|
|
||||||
if(dump("{", 1, data))
|
|
||||||
goto object_error;
|
|
||||||
if(!iter) {
|
|
||||||
object->visited = 0;
|
|
||||||
return dump("}", 1, data);
|
|
||||||
}
|
|
||||||
if(dump_indent(flags, depth + 1, 0, dump, data))
|
|
||||||
goto object_error;
|
|
||||||
|
|
||||||
if(flags & JSON_SORT_KEYS || flags & JSON_PRESERVE_ORDER)
|
|
||||||
{
|
|
||||||
struct object_key *keys;
|
|
||||||
size_t size, i;
|
|
||||||
int (*cmp_func)(const void *, const void *);
|
|
||||||
|
|
||||||
size = json_object_size(json);
|
|
||||||
keys = jsonp_malloc(size * sizeof(struct object_key));
|
|
||||||
if(!keys)
|
|
||||||
goto object_error;
|
|
||||||
|
|
||||||
i = 0;
|
|
||||||
while(iter)
|
|
||||||
{
|
|
||||||
keys[i].serial = hashtable_iter_serial(iter);
|
|
||||||
keys[i].key = json_object_iter_key(iter);
|
|
||||||
iter = json_object_iter_next((json_t *)json, iter);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
assert(i == size);
|
|
||||||
|
|
||||||
if(flags & JSON_SORT_KEYS)
|
|
||||||
cmp_func = object_key_compare_keys;
|
|
||||||
else
|
|
||||||
cmp_func = object_key_compare_serials;
|
|
||||||
|
|
||||||
qsort(keys, size, sizeof(struct object_key), cmp_func);
|
|
||||||
|
|
||||||
for(i = 0; i < size; i++)
|
|
||||||
{
|
|
||||||
const char *key;
|
|
||||||
json_t *value;
|
|
||||||
|
|
||||||
key = keys[i].key;
|
|
||||||
value = json_object_get(json, key);
|
|
||||||
assert(value);
|
|
||||||
|
|
||||||
dump_string(key, strlen(key), dump, data, flags);
|
|
||||||
if(dump(separator, separator_length, data) ||
|
|
||||||
do_dump(value, flags, depth + 1, dump, data))
|
|
||||||
{
|
|
||||||
jsonp_free(keys);
|
|
||||||
goto object_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(i < size - 1)
|
|
||||||
{
|
|
||||||
if(dump(",", 1, data) ||
|
|
||||||
dump_indent(flags, depth + 1, 1, dump, data))
|
|
||||||
{
|
|
||||||
jsonp_free(keys);
|
|
||||||
goto object_error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(dump_indent(flags, depth, 0, dump, data))
|
|
||||||
{
|
|
||||||
jsonp_free(keys);
|
|
||||||
goto object_error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
jsonp_free(keys);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Don't sort keys */
|
|
||||||
|
|
||||||
while(iter)
|
|
||||||
{
|
|
||||||
void *next = json_object_iter_next((json_t *)json, iter);
|
|
||||||
const char *key = json_object_iter_key(iter);
|
|
||||||
|
|
||||||
dump_string(key, strlen(key), dump, data, flags);
|
|
||||||
if(dump(separator, separator_length, data) ||
|
|
||||||
do_dump(json_object_iter_value(iter), flags, depth + 1,
|
|
||||||
dump, data))
|
|
||||||
goto object_error;
|
|
||||||
|
|
||||||
if(next)
|
|
||||||
{
|
|
||||||
if(dump(",", 1, data) ||
|
|
||||||
dump_indent(flags, depth + 1, 1, dump, data))
|
|
||||||
goto object_error;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(dump_indent(flags, depth, 0, dump, data))
|
|
||||||
goto object_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
iter = next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object->visited = 0;
|
|
||||||
return dump("}", 1, data);
|
|
||||||
|
|
||||||
object_error:
|
|
||||||
object->visited = 0;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
/* not reached */
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
char *json_dumps(const json_t *json, size_t flags)
|
|
||||||
{
|
|
||||||
strbuffer_t strbuff;
|
|
||||||
char *result;
|
|
||||||
|
|
||||||
if(strbuffer_init(&strbuff))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if(json_dump_callback(json, dump_to_strbuffer, (void *)&strbuff, flags))
|
|
||||||
result = NULL;
|
|
||||||
else
|
|
||||||
result = jsonp_strdup(strbuffer_value(&strbuff));
|
|
||||||
|
|
||||||
strbuffer_close(&strbuff);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
int json_dumpf(const json_t *json, FILE *output, size_t flags)
|
|
||||||
{
|
|
||||||
return json_dump_callback(json, dump_to_file, (void *)output, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
int json_dump_file(const json_t *json, const char *path, size_t flags)
|
|
||||||
{
|
|
||||||
int result;
|
|
||||||
|
|
||||||
FILE *output = fopen(path, "w");
|
|
||||||
if(!output)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
result = json_dumpf(json, output, flags);
|
|
||||||
|
|
||||||
fclose(output);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
int json_dump_callback(const json_t *json, json_dump_callback_t callback, void *data, size_t flags)
|
|
||||||
{
|
|
||||||
if(!(flags & JSON_ENCODE_ANY)) {
|
|
||||||
if(!json_is_array(json) && !json_is_object(json))
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return do_dump(json, flags, 0, callback, data);
|
|
||||||
}
|
|
63
external/Jansson/error.c
vendored
63
external/Jansson/error.c
vendored
@ -1,63 +0,0 @@
|
|||||||
#include <string.h>
|
|
||||||
#include "jansson_private.h"
|
|
||||||
|
|
||||||
void jsonp_error_init(json_error_t *error, const char *source)
|
|
||||||
{
|
|
||||||
if(error)
|
|
||||||
{
|
|
||||||
error->text[0] = '\0';
|
|
||||||
error->line = -1;
|
|
||||||
error->column = -1;
|
|
||||||
error->position = 0;
|
|
||||||
if(source)
|
|
||||||
jsonp_error_set_source(error, source);
|
|
||||||
else
|
|
||||||
error->source[0] = '\0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void jsonp_error_set_source(json_error_t *error, const char *source)
|
|
||||||
{
|
|
||||||
size_t length;
|
|
||||||
|
|
||||||
if(!error || !source)
|
|
||||||
return;
|
|
||||||
|
|
||||||
length = strlen(source);
|
|
||||||
if(length < JSON_ERROR_SOURCE_LENGTH)
|
|
||||||
strncpy(error->source, source, length + 1);
|
|
||||||
else {
|
|
||||||
size_t extra = length - JSON_ERROR_SOURCE_LENGTH + 4;
|
|
||||||
strncpy(error->source, "...", 3);
|
|
||||||
strncpy(error->source + 3, source + extra, length - extra + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void jsonp_error_set(json_error_t *error, int line, int column,
|
|
||||||
size_t position, const char *msg, ...)
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
|
|
||||||
va_start(ap, msg);
|
|
||||||
jsonp_error_vset(error, line, column, position, msg, ap);
|
|
||||||
va_end(ap);
|
|
||||||
}
|
|
||||||
|
|
||||||
void jsonp_error_vset(json_error_t *error, int line, int column,
|
|
||||||
size_t position, const char *msg, va_list ap)
|
|
||||||
{
|
|
||||||
if(!error)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(error->text[0] != '\0') {
|
|
||||||
/* error already set */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
error->line = line;
|
|
||||||
error->column = column;
|
|
||||||
error->position = (int)position;
|
|
||||||
|
|
||||||
vsnprintf(error->text, JSON_ERROR_TEXT_LENGTH, msg, ap);
|
|
||||||
error->text[JSON_ERROR_TEXT_LENGTH - 1] = '\0';
|
|
||||||
}
|
|
356
external/Jansson/hashtable.c
vendored
356
external/Jansson/hashtable.c
vendored
@ -1,356 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the MIT license. See LICENSE for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
|
||||||
#include <jansson_private_config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#if HAVE_STDINT_H
|
|
||||||
#include <stdint.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <jansson_config.h> /* for JSON_INLINE */
|
|
||||||
#include "jansson_private.h" /* for container_of() */
|
|
||||||
#include "hashtable.h"
|
|
||||||
|
|
||||||
#ifndef INITIAL_HASHTABLE_ORDER
|
|
||||||
#define INITIAL_HASHTABLE_ORDER 3
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct hashtable_list list_t;
|
|
||||||
typedef struct hashtable_pair pair_t;
|
|
||||||
typedef struct hashtable_bucket bucket_t;
|
|
||||||
|
|
||||||
extern volatile uint32_t hashtable_seed;
|
|
||||||
|
|
||||||
/* Implementation of the hash function */
|
|
||||||
#include "lookup3.h"
|
|
||||||
|
|
||||||
#define list_to_pair(list_) container_of(list_, pair_t, list)
|
|
||||||
#define hash_str(key) ((size_t)hashlittle((key), strlen(key), hashtable_seed))
|
|
||||||
|
|
||||||
static JSON_INLINE void list_init(list_t *list)
|
|
||||||
{
|
|
||||||
list->next = list;
|
|
||||||
list->prev = list;
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSON_INLINE void list_insert(list_t *list, list_t *node)
|
|
||||||
{
|
|
||||||
node->next = list;
|
|
||||||
node->prev = list->prev;
|
|
||||||
list->prev->next = node;
|
|
||||||
list->prev = node;
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSON_INLINE void list_remove(list_t *list)
|
|
||||||
{
|
|
||||||
list->prev->next = list->next;
|
|
||||||
list->next->prev = list->prev;
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSON_INLINE int bucket_is_empty(hashtable_t *hashtable, bucket_t *bucket)
|
|
||||||
{
|
|
||||||
return bucket->first == &hashtable->list && bucket->first == bucket->last;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void insert_to_bucket(hashtable_t *hashtable, bucket_t *bucket,
|
|
||||||
list_t *list)
|
|
||||||
{
|
|
||||||
if(bucket_is_empty(hashtable, bucket))
|
|
||||||
{
|
|
||||||
list_insert(&hashtable->list, list);
|
|
||||||
bucket->first = bucket->last = list;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
list_insert(bucket->first, list);
|
|
||||||
bucket->first = list;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static pair_t *hashtable_find_pair(hashtable_t *hashtable, bucket_t *bucket,
|
|
||||||
const char *key, size_t hash)
|
|
||||||
{
|
|
||||||
list_t *list;
|
|
||||||
pair_t *pair;
|
|
||||||
|
|
||||||
if(bucket_is_empty(hashtable, bucket))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
list = bucket->first;
|
|
||||||
while(1)
|
|
||||||
{
|
|
||||||
pair = list_to_pair(list);
|
|
||||||
if(pair->hash == hash && strcmp(pair->key, key) == 0)
|
|
||||||
return pair;
|
|
||||||
|
|
||||||
if(list == bucket->last)
|
|
||||||
break;
|
|
||||||
|
|
||||||
list = list->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* returns 0 on success, -1 if key was not found */
|
|
||||||
static int hashtable_do_del(hashtable_t *hashtable,
|
|
||||||
const char *key, size_t hash)
|
|
||||||
{
|
|
||||||
pair_t *pair;
|
|
||||||
bucket_t *bucket;
|
|
||||||
size_t index;
|
|
||||||
|
|
||||||
index = hash & hashmask(hashtable->order);
|
|
||||||
bucket = &hashtable->buckets[index];
|
|
||||||
|
|
||||||
pair = hashtable_find_pair(hashtable, bucket, key, hash);
|
|
||||||
if(!pair)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if(&pair->list == bucket->first && &pair->list == bucket->last)
|
|
||||||
bucket->first = bucket->last = &hashtable->list;
|
|
||||||
|
|
||||||
else if(&pair->list == bucket->first)
|
|
||||||
bucket->first = pair->list.next;
|
|
||||||
|
|
||||||
else if(&pair->list == bucket->last)
|
|
||||||
bucket->last = pair->list.prev;
|
|
||||||
|
|
||||||
list_remove(&pair->list);
|
|
||||||
json_decref(pair->value);
|
|
||||||
|
|
||||||
jsonp_free(pair);
|
|
||||||
hashtable->size--;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void hashtable_do_clear(hashtable_t *hashtable)
|
|
||||||
{
|
|
||||||
list_t *list, *next;
|
|
||||||
pair_t *pair;
|
|
||||||
|
|
||||||
for(list = hashtable->list.next; list != &hashtable->list; list = next)
|
|
||||||
{
|
|
||||||
next = list->next;
|
|
||||||
pair = list_to_pair(list);
|
|
||||||
json_decref(pair->value);
|
|
||||||
jsonp_free(pair);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int hashtable_do_rehash(hashtable_t *hashtable)
|
|
||||||
{
|
|
||||||
list_t *list, *next;
|
|
||||||
pair_t *pair;
|
|
||||||
size_t i, index, new_size;
|
|
||||||
|
|
||||||
jsonp_free(hashtable->buckets);
|
|
||||||
|
|
||||||
hashtable->order++;
|
|
||||||
new_size = hashsize(hashtable->order);
|
|
||||||
|
|
||||||
hashtable->buckets = jsonp_malloc(new_size * sizeof(bucket_t));
|
|
||||||
if(!hashtable->buckets)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
for(i = 0; i < hashsize(hashtable->order); i++)
|
|
||||||
{
|
|
||||||
hashtable->buckets[i].first = hashtable->buckets[i].last =
|
|
||||||
&hashtable->list;
|
|
||||||
}
|
|
||||||
|
|
||||||
list = hashtable->list.next;
|
|
||||||
list_init(&hashtable->list);
|
|
||||||
|
|
||||||
for(; list != &hashtable->list; list = next) {
|
|
||||||
next = list->next;
|
|
||||||
pair = list_to_pair(list);
|
|
||||||
index = pair->hash % new_size;
|
|
||||||
insert_to_bucket(hashtable, &hashtable->buckets[index], &pair->list);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int hashtable_init(hashtable_t *hashtable)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
hashtable->size = 0;
|
|
||||||
hashtable->order = INITIAL_HASHTABLE_ORDER;
|
|
||||||
hashtable->buckets = jsonp_malloc(hashsize(hashtable->order) * sizeof(bucket_t));
|
|
||||||
if(!hashtable->buckets)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
list_init(&hashtable->list);
|
|
||||||
|
|
||||||
for(i = 0; i < hashsize(hashtable->order); i++)
|
|
||||||
{
|
|
||||||
hashtable->buckets[i].first = hashtable->buckets[i].last =
|
|
||||||
&hashtable->list;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void hashtable_close(hashtable_t *hashtable)
|
|
||||||
{
|
|
||||||
hashtable_do_clear(hashtable);
|
|
||||||
jsonp_free(hashtable->buckets);
|
|
||||||
}
|
|
||||||
|
|
||||||
int hashtable_set(hashtable_t *hashtable,
|
|
||||||
const char *key, size_t serial,
|
|
||||||
json_t *value)
|
|
||||||
{
|
|
||||||
pair_t *pair;
|
|
||||||
bucket_t *bucket;
|
|
||||||
size_t hash, index;
|
|
||||||
|
|
||||||
/* rehash if the load ratio exceeds 1 */
|
|
||||||
if(hashtable->size >= hashsize(hashtable->order))
|
|
||||||
if(hashtable_do_rehash(hashtable))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
hash = hash_str(key);
|
|
||||||
index = hash & hashmask(hashtable->order);
|
|
||||||
bucket = &hashtable->buckets[index];
|
|
||||||
pair = hashtable_find_pair(hashtable, bucket, key, hash);
|
|
||||||
|
|
||||||
if(pair)
|
|
||||||
{
|
|
||||||
json_decref(pair->value);
|
|
||||||
pair->value = value;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* offsetof(...) returns the size of pair_t without the last,
|
|
||||||
flexible member. This way, the correct amount is
|
|
||||||
allocated. */
|
|
||||||
|
|
||||||
size_t len = strlen(key);
|
|
||||||
if(len >= (size_t)-1 - offsetof(pair_t, key)) {
|
|
||||||
/* Avoid an overflow if the key is very long */
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
pair = jsonp_malloc(offsetof(pair_t, key) + len + 1);
|
|
||||||
if(!pair)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
pair->hash = hash;
|
|
||||||
pair->serial = serial;
|
|
||||||
strncpy(pair->key, key, len + 1);
|
|
||||||
pair->value = value;
|
|
||||||
list_init(&pair->list);
|
|
||||||
|
|
||||||
insert_to_bucket(hashtable, bucket, &pair->list);
|
|
||||||
|
|
||||||
hashtable->size++;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *hashtable_get(hashtable_t *hashtable, const char *key)
|
|
||||||
{
|
|
||||||
pair_t *pair;
|
|
||||||
size_t hash;
|
|
||||||
bucket_t *bucket;
|
|
||||||
|
|
||||||
hash = hash_str(key);
|
|
||||||
bucket = &hashtable->buckets[hash & hashmask(hashtable->order)];
|
|
||||||
|
|
||||||
pair = hashtable_find_pair(hashtable, bucket, key, hash);
|
|
||||||
if(!pair)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return pair->value;
|
|
||||||
}
|
|
||||||
|
|
||||||
int hashtable_del(hashtable_t *hashtable, const char *key)
|
|
||||||
{
|
|
||||||
size_t hash = hash_str(key);
|
|
||||||
return hashtable_do_del(hashtable, key, hash);
|
|
||||||
}
|
|
||||||
|
|
||||||
void hashtable_clear(hashtable_t *hashtable)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
hashtable_do_clear(hashtable);
|
|
||||||
|
|
||||||
for(i = 0; i < hashsize(hashtable->order); i++)
|
|
||||||
{
|
|
||||||
hashtable->buckets[i].first = hashtable->buckets[i].last =
|
|
||||||
&hashtable->list;
|
|
||||||
}
|
|
||||||
|
|
||||||
list_init(&hashtable->list);
|
|
||||||
hashtable->size = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *hashtable_iter(hashtable_t *hashtable)
|
|
||||||
{
|
|
||||||
return hashtable_iter_next(hashtable, &hashtable->list);
|
|
||||||
}
|
|
||||||
|
|
||||||
void *hashtable_iter_at(hashtable_t *hashtable, const char *key)
|
|
||||||
{
|
|
||||||
pair_t *pair;
|
|
||||||
size_t hash;
|
|
||||||
bucket_t *bucket;
|
|
||||||
|
|
||||||
hash = hash_str(key);
|
|
||||||
bucket = &hashtable->buckets[hash & hashmask(hashtable->order)];
|
|
||||||
|
|
||||||
pair = hashtable_find_pair(hashtable, bucket, key, hash);
|
|
||||||
if(!pair)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return &pair->list;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *hashtable_iter_next(hashtable_t *hashtable, void *iter)
|
|
||||||
{
|
|
||||||
list_t *list = (list_t *)iter;
|
|
||||||
if(list->next == &hashtable->list)
|
|
||||||
return NULL;
|
|
||||||
return list->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *hashtable_iter_key(void *iter)
|
|
||||||
{
|
|
||||||
pair_t *pair = list_to_pair((list_t *)iter);
|
|
||||||
return pair->key;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t hashtable_iter_serial(void *iter)
|
|
||||||
{
|
|
||||||
pair_t *pair = list_to_pair((list_t *)iter);
|
|
||||||
return pair->serial;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *hashtable_iter_value(void *iter)
|
|
||||||
{
|
|
||||||
pair_t *pair = list_to_pair((list_t *)iter);
|
|
||||||
return pair->value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void hashtable_iter_set(void *iter, json_t *value)
|
|
||||||
{
|
|
||||||
pair_t *pair = list_to_pair((list_t *)iter);
|
|
||||||
|
|
||||||
json_decref(pair->value);
|
|
||||||
pair->value = value;
|
|
||||||
}
|
|
184
external/Jansson/hashtable.h
vendored
184
external/Jansson/hashtable.h
vendored
@ -1,184 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the MIT license. See LICENSE for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef HASHTABLE_H
|
|
||||||
#define HASHTABLE_H
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "jansson.h"
|
|
||||||
|
|
||||||
struct hashtable_list {
|
|
||||||
struct hashtable_list *prev;
|
|
||||||
struct hashtable_list *next;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* "pair" may be a bit confusing a name, but think of it as a
|
|
||||||
key-value pair. In this case, it just encodes some extra data,
|
|
||||||
too */
|
|
||||||
struct hashtable_pair {
|
|
||||||
struct hashtable_list list;
|
|
||||||
size_t hash;
|
|
||||||
json_t *value;
|
|
||||||
size_t serial;
|
|
||||||
char key[1];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct hashtable_bucket {
|
|
||||||
struct hashtable_list *first;
|
|
||||||
struct hashtable_list *last;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct hashtable {
|
|
||||||
size_t size;
|
|
||||||
struct hashtable_bucket *buckets;
|
|
||||||
size_t order; /* hashtable has pow(2, order) buckets */
|
|
||||||
struct hashtable_list list;
|
|
||||||
} hashtable_t;
|
|
||||||
|
|
||||||
|
|
||||||
#define hashtable_key_to_iter(key_) \
|
|
||||||
(&(container_of(key_, struct hashtable_pair, key)->list))
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hashtable_init - Initialize a hashtable object
|
|
||||||
*
|
|
||||||
* @hashtable: The (statically allocated) hashtable object
|
|
||||||
*
|
|
||||||
* Initializes a statically allocated hashtable object. The object
|
|
||||||
* should be cleared with hashtable_close when it's no longer used.
|
|
||||||
*
|
|
||||||
* Returns 0 on success, -1 on error (out of memory).
|
|
||||||
*/
|
|
||||||
int hashtable_init(hashtable_t *hashtable);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hashtable_close - Release all resources used by a hashtable object
|
|
||||||
*
|
|
||||||
* @hashtable: The hashtable
|
|
||||||
*
|
|
||||||
* Destroys a statically allocated hashtable object.
|
|
||||||
*/
|
|
||||||
void hashtable_close(hashtable_t *hashtable);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hashtable_set - Add/modify value in hashtable
|
|
||||||
*
|
|
||||||
* @hashtable: The hashtable object
|
|
||||||
* @key: The key
|
|
||||||
* @serial: For addition order of keys
|
|
||||||
* @value: The value
|
|
||||||
*
|
|
||||||
* If a value with the given key already exists, its value is replaced
|
|
||||||
* with the new value. Value is "stealed" in the sense that hashtable
|
|
||||||
* doesn't increment its refcount but decreases the refcount when the
|
|
||||||
* value is no longer needed.
|
|
||||||
*
|
|
||||||
* Returns 0 on success, -1 on failure (out of memory).
|
|
||||||
*/
|
|
||||||
int hashtable_set(hashtable_t *hashtable,
|
|
||||||
const char *key, size_t serial,
|
|
||||||
json_t *value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hashtable_get - Get a value associated with a key
|
|
||||||
*
|
|
||||||
* @hashtable: The hashtable object
|
|
||||||
* @key: The key
|
|
||||||
*
|
|
||||||
* Returns value if it is found, or NULL otherwise.
|
|
||||||
*/
|
|
||||||
void *hashtable_get(hashtable_t *hashtable, const char *key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hashtable_del - Remove a value from the hashtable
|
|
||||||
*
|
|
||||||
* @hashtable: The hashtable object
|
|
||||||
* @key: The key
|
|
||||||
*
|
|
||||||
* Returns 0 on success, or -1 if the key was not found.
|
|
||||||
*/
|
|
||||||
int hashtable_del(hashtable_t *hashtable, const char *key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hashtable_clear - Clear hashtable
|
|
||||||
*
|
|
||||||
* @hashtable: The hashtable object
|
|
||||||
*
|
|
||||||
* Removes all items from the hashtable.
|
|
||||||
*/
|
|
||||||
void hashtable_clear(hashtable_t *hashtable);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hashtable_iter - Iterate over hashtable
|
|
||||||
*
|
|
||||||
* @hashtable: The hashtable object
|
|
||||||
*
|
|
||||||
* Returns an opaque iterator to the first element in the hashtable.
|
|
||||||
* The iterator should be passed to hashtable_iter_* functions.
|
|
||||||
* The hashtable items are not iterated over in any particular order.
|
|
||||||
*
|
|
||||||
* There's no need to free the iterator in any way. The iterator is
|
|
||||||
* valid as long as the item that is referenced by the iterator is not
|
|
||||||
* deleted. Other values may be added or deleted. In particular,
|
|
||||||
* hashtable_iter_next() may be called on an iterator, and after that
|
|
||||||
* the key/value pair pointed by the old iterator may be deleted.
|
|
||||||
*/
|
|
||||||
void *hashtable_iter(hashtable_t *hashtable);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hashtable_iter_at - Return an iterator at a specific key
|
|
||||||
*
|
|
||||||
* @hashtable: The hashtable object
|
|
||||||
* @key: The key that the iterator should point to
|
|
||||||
*
|
|
||||||
* Like hashtable_iter() but returns an iterator pointing to a
|
|
||||||
* specific key.
|
|
||||||
*/
|
|
||||||
void *hashtable_iter_at(hashtable_t *hashtable, const char *key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hashtable_iter_next - Advance an iterator
|
|
||||||
*
|
|
||||||
* @hashtable: The hashtable object
|
|
||||||
* @iter: The iterator
|
|
||||||
*
|
|
||||||
* Returns a new iterator pointing to the next element in the
|
|
||||||
* hashtable or NULL if the whole hastable has been iterated over.
|
|
||||||
*/
|
|
||||||
void *hashtable_iter_next(hashtable_t *hashtable, void *iter);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hashtable_iter_key - Retrieve the key pointed by an iterator
|
|
||||||
*
|
|
||||||
* @iter: The iterator
|
|
||||||
*/
|
|
||||||
void *hashtable_iter_key(void *iter);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hashtable_iter_serial - Retrieve the serial number pointed to by an iterator
|
|
||||||
*
|
|
||||||
* @iter: The iterator
|
|
||||||
*/
|
|
||||||
size_t hashtable_iter_serial(void *iter);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hashtable_iter_value - Retrieve the value pointed by an iterator
|
|
||||||
*
|
|
||||||
* @iter: The iterator
|
|
||||||
*/
|
|
||||||
void *hashtable_iter_value(void *iter);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hashtable_iter_set - Set the value pointed by an iterator
|
|
||||||
*
|
|
||||||
* @iter: The iterator
|
|
||||||
* @value: The value to set
|
|
||||||
*/
|
|
||||||
void hashtable_iter_set(void *iter, json_t *value);
|
|
||||||
|
|
||||||
#endif
|
|
277
external/Jansson/hashtable_seed.c
vendored
277
external/Jansson/hashtable_seed.c
vendored
@ -1,277 +0,0 @@
|
|||||||
/* Generate sizeof(uint32_t) bytes of as random data as possible to seed
|
|
||||||
the hash function.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <jansson_private_config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_STDINT_H
|
|
||||||
#include <stdint.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
|
||||||
#include <fcntl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_SCHED_H
|
|
||||||
#include <sched.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_STAT_H
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TIME_H
|
|
||||||
#include <sys/time.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
|
||||||
#include <sys/types.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(_WIN32)
|
|
||||||
/* For GetModuleHandle(), GetProcAddress() and GetCurrentProcessId() */
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "jansson.h"
|
|
||||||
|
|
||||||
|
|
||||||
static uint32_t buf_to_uint32(char *data) {
|
|
||||||
size_t i;
|
|
||||||
uint32_t result = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < sizeof(uint32_t); i++)
|
|
||||||
result = (result << 8) | (unsigned char)data[i];
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* /dev/urandom */
|
|
||||||
#if !defined(_WIN32) && defined(USE_URANDOM)
|
|
||||||
static int seed_from_urandom(uint32_t *seed) {
|
|
||||||
/* Use unbuffered I/O if we have open(), close() and read(). Otherwise
|
|
||||||
fall back to fopen() */
|
|
||||||
|
|
||||||
char data[sizeof(uint32_t)];
|
|
||||||
int ok;
|
|
||||||
|
|
||||||
#if defined(HAVE_OPEN) && defined(HAVE_CLOSE) && defined(HAVE_READ)
|
|
||||||
int urandom;
|
|
||||||
urandom = open("/dev/urandom", O_RDONLY);
|
|
||||||
if (urandom == -1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
ok = read(urandom, data, sizeof(uint32_t)) == sizeof(uint32_t);
|
|
||||||
close(urandom);
|
|
||||||
#else
|
|
||||||
FILE *urandom;
|
|
||||||
|
|
||||||
urandom = fopen("/dev/urandom", "rb");
|
|
||||||
if (!urandom)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
ok = fread(data, 1, sizeof(uint32_t), urandom) == sizeof(uint32_t);
|
|
||||||
fclose(urandom);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!ok)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
*seed = buf_to_uint32(data);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Windows Crypto API */
|
|
||||||
#if defined(_WIN32) && defined(USE_WINDOWS_CRYPTOAPI)
|
|
||||||
#include <wincrypt.h>
|
|
||||||
|
|
||||||
typedef BOOL (WINAPI *CRYPTACQUIRECONTEXTA)(HCRYPTPROV *phProv, LPCSTR pszContainer, LPCSTR pszProvider, DWORD dwProvType, DWORD dwFlags);
|
|
||||||
typedef BOOL (WINAPI *CRYPTGENRANDOM)(HCRYPTPROV hProv, DWORD dwLen, BYTE *pbBuffer);
|
|
||||||
typedef BOOL (WINAPI *CRYPTRELEASECONTEXT)(HCRYPTPROV hProv, DWORD dwFlags);
|
|
||||||
|
|
||||||
static int seed_from_windows_cryptoapi(uint32_t *seed)
|
|
||||||
{
|
|
||||||
HINSTANCE hAdvAPI32 = NULL;
|
|
||||||
CRYPTACQUIRECONTEXTA pCryptAcquireContext = NULL;
|
|
||||||
CRYPTGENRANDOM pCryptGenRandom = NULL;
|
|
||||||
CRYPTRELEASECONTEXT pCryptReleaseContext = NULL;
|
|
||||||
HCRYPTPROV hCryptProv = 0;
|
|
||||||
BYTE data[sizeof(uint32_t)];
|
|
||||||
int ok;
|
|
||||||
|
|
||||||
hAdvAPI32 = GetModuleHandle(TEXT("advapi32.dll"));
|
|
||||||
if(hAdvAPI32 == NULL)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
pCryptAcquireContext = (CRYPTACQUIRECONTEXTA)GetProcAddress(hAdvAPI32, "CryptAcquireContextA");
|
|
||||||
if (!pCryptAcquireContext)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
pCryptGenRandom = (CRYPTGENRANDOM)GetProcAddress(hAdvAPI32, "CryptGenRandom");
|
|
||||||
if (!pCryptGenRandom)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
pCryptReleaseContext = (CRYPTRELEASECONTEXT)GetProcAddress(hAdvAPI32, "CryptReleaseContext");
|
|
||||||
if (!pCryptReleaseContext)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (!pCryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
ok = pCryptGenRandom(hCryptProv, sizeof(uint32_t), data);
|
|
||||||
pCryptReleaseContext(hCryptProv, 0);
|
|
||||||
|
|
||||||
if (!ok)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
*seed = buf_to_uint32((char *)data);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* gettimeofday() and getpid() */
|
|
||||||
static int seed_from_timestamp_and_pid(uint32_t *seed) {
|
|
||||||
#ifdef HAVE_GETTIMEOFDAY
|
|
||||||
/* XOR of seconds and microseconds */
|
|
||||||
struct timeval tv;
|
|
||||||
gettimeofday(&tv, NULL);
|
|
||||||
*seed = (uint32_t)tv.tv_sec ^ (uint32_t)tv.tv_usec;
|
|
||||||
#else
|
|
||||||
/* Seconds only */
|
|
||||||
*seed = (uint32_t)time(NULL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* XOR with PID for more randomness */
|
|
||||||
#if defined(_WIN32)
|
|
||||||
*seed ^= (uint32_t)GetCurrentProcessId();
|
|
||||||
#elif defined(HAVE_GETPID)
|
|
||||||
*seed ^= (uint32_t)getpid();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint32_t generate_seed() {
|
|
||||||
uint32_t seed;
|
|
||||||
int done = 0;
|
|
||||||
|
|
||||||
#if !defined(_WIN32) && defined(USE_URANDOM)
|
|
||||||
if (!done && seed_from_urandom(&seed) == 0)
|
|
||||||
done = 1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(_WIN32) && defined(USE_WINDOWS_CRYPTOAPI)
|
|
||||||
if (!done && seed_from_windows_cryptoapi(&seed) == 0)
|
|
||||||
done = 1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!done) {
|
|
||||||
/* Fall back to timestamp and PID if no better randomness is
|
|
||||||
available */
|
|
||||||
seed_from_timestamp_and_pid(&seed);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Make sure the seed is never zero */
|
|
||||||
if (seed == 0)
|
|
||||||
seed = 1;
|
|
||||||
|
|
||||||
return seed;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
volatile uint32_t hashtable_seed = 0;
|
|
||||||
|
|
||||||
#if defined(HAVE_ATOMIC_BUILTINS) && (defined(HAVE_SCHED_YIELD) || !defined(_WIN32))
|
|
||||||
static volatile char seed_initialized = 0;
|
|
||||||
|
|
||||||
void json_object_seed(size_t seed) {
|
|
||||||
uint32_t new_seed = (uint32_t)seed;
|
|
||||||
|
|
||||||
if (hashtable_seed == 0) {
|
|
||||||
if (__atomic_test_and_set(&seed_initialized, __ATOMIC_RELAXED) == 0) {
|
|
||||||
/* Do the seeding ourselves */
|
|
||||||
if (new_seed == 0)
|
|
||||||
new_seed = generate_seed();
|
|
||||||
|
|
||||||
__atomic_store_n(&hashtable_seed, new_seed, __ATOMIC_RELEASE);
|
|
||||||
} else {
|
|
||||||
/* Wait for another thread to do the seeding */
|
|
||||||
do {
|
|
||||||
#ifdef HAVE_SCHED_YIELD
|
|
||||||
sched_yield();
|
|
||||||
#endif
|
|
||||||
} while(__atomic_load_n(&hashtable_seed, __ATOMIC_ACQUIRE) == 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#elif defined(HAVE_SYNC_BUILTINS) && (defined(HAVE_SCHED_YIELD) || !defined(_WIN32))
|
|
||||||
void json_object_seed(size_t seed) {
|
|
||||||
uint32_t new_seed = (uint32_t)seed;
|
|
||||||
|
|
||||||
if (hashtable_seed == 0) {
|
|
||||||
if (new_seed == 0) {
|
|
||||||
/* Explicit synchronization fences are not supported by the
|
|
||||||
__sync builtins, so every thread getting here has to
|
|
||||||
generate the seed value.
|
|
||||||
*/
|
|
||||||
new_seed = generate_seed();
|
|
||||||
}
|
|
||||||
|
|
||||||
do {
|
|
||||||
if (__sync_bool_compare_and_swap(&hashtable_seed, 0, new_seed)) {
|
|
||||||
/* We were the first to seed */
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
/* Wait for another thread to do the seeding */
|
|
||||||
#ifdef HAVE_SCHED_YIELD
|
|
||||||
sched_yield();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
} while(hashtable_seed == 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#elif defined(_WIN32)
|
|
||||||
static long seed_initialized = 0;
|
|
||||||
void json_object_seed(size_t seed) {
|
|
||||||
uint32_t new_seed = (uint32_t)seed;
|
|
||||||
|
|
||||||
if (hashtable_seed == 0) {
|
|
||||||
if (InterlockedIncrement(&seed_initialized) == 1) {
|
|
||||||
/* Do the seeding ourselves */
|
|
||||||
if (new_seed == 0)
|
|
||||||
new_seed = generate_seed();
|
|
||||||
|
|
||||||
hashtable_seed = new_seed;
|
|
||||||
} else {
|
|
||||||
/* Wait for another thread to do the seeding */
|
|
||||||
do {
|
|
||||||
SwitchToThread();
|
|
||||||
} while (hashtable_seed == 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
/* Fall back to a thread-unsafe version */
|
|
||||||
void json_object_seed(size_t seed) {
|
|
||||||
uint32_t new_seed = (uint32_t)seed;
|
|
||||||
|
|
||||||
if (hashtable_seed == 0) {
|
|
||||||
if (new_seed == 0)
|
|
||||||
new_seed = generate_seed();
|
|
||||||
|
|
||||||
hashtable_seed = new_seed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
70
external/Jansson/jansson.def
vendored
70
external/Jansson/jansson.def
vendored
@ -1,70 +0,0 @@
|
|||||||
EXPORTS
|
|
||||||
json_delete
|
|
||||||
json_true
|
|
||||||
json_false
|
|
||||||
json_null
|
|
||||||
json_string
|
|
||||||
json_stringn
|
|
||||||
json_string_nocheck
|
|
||||||
json_stringn_nocheck
|
|
||||||
json_string_value
|
|
||||||
json_string_length
|
|
||||||
json_string_set
|
|
||||||
json_string_setn
|
|
||||||
json_string_set_nocheck
|
|
||||||
json_string_setn_nocheck
|
|
||||||
json_integer
|
|
||||||
json_integer_value
|
|
||||||
json_integer_set
|
|
||||||
json_real
|
|
||||||
json_real_value
|
|
||||||
json_real_set
|
|
||||||
json_number_value
|
|
||||||
json_array
|
|
||||||
json_array_size
|
|
||||||
json_array_get
|
|
||||||
json_array_set_new
|
|
||||||
json_array_append_new
|
|
||||||
json_array_insert_new
|
|
||||||
json_array_remove
|
|
||||||
json_array_clear
|
|
||||||
json_array_extend
|
|
||||||
json_object
|
|
||||||
json_object_size
|
|
||||||
json_object_get
|
|
||||||
json_object_set_new
|
|
||||||
json_object_set_new_nocheck
|
|
||||||
json_object_del
|
|
||||||
json_object_clear
|
|
||||||
json_object_update
|
|
||||||
json_object_update_existing
|
|
||||||
json_object_update_missing
|
|
||||||
json_object_iter
|
|
||||||
json_object_iter_at
|
|
||||||
json_object_iter_next
|
|
||||||
json_object_iter_key
|
|
||||||
json_object_iter_value
|
|
||||||
json_object_iter_set_new
|
|
||||||
json_object_key_to_iter
|
|
||||||
json_object_seed
|
|
||||||
json_dumps
|
|
||||||
json_dumpf
|
|
||||||
json_dump_file
|
|
||||||
json_dump_callback
|
|
||||||
json_loads
|
|
||||||
json_loadb
|
|
||||||
json_loadf
|
|
||||||
json_load_file
|
|
||||||
json_load_callback
|
|
||||||
json_equal
|
|
||||||
json_copy
|
|
||||||
json_deep_copy
|
|
||||||
json_pack
|
|
||||||
json_pack_ex
|
|
||||||
json_vpack_ex
|
|
||||||
json_unpack
|
|
||||||
json_unpack_ex
|
|
||||||
json_vunpack_ex
|
|
||||||
json_set_alloc_funcs
|
|
||||||
json_get_alloc_funcs
|
|
||||||
|
|
298
external/Jansson/jansson.h
vendored
298
external/Jansson/jansson.h
vendored
@ -1,298 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
|
||||||
*
|
|
||||||
* Jansson is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the MIT license. See LICENSE for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef JANSSON_H
|
|
||||||
#define JANSSON_H
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h> /* for size_t */
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#include "jansson_config.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* version */
|
|
||||||
|
|
||||||
#define JANSSON_MAJOR_VERSION 2
|
|
||||||
#define JANSSON_MINOR_VERSION 7
|
|
||||||
#define JANSSON_MICRO_VERSION 0
|
|
||||||
|
|
||||||
/* Micro version is omitted if it's 0 */
|
|
||||||
#define JANSSON_VERSION "2.7"
|
|
||||||
|
|
||||||
/* Version as a 3-byte hex number, e.g. 0x010201 == 1.2.1. Use this
|
|
||||||
for numeric comparisons, e.g. #if JANSSON_VERSION_HEX >= ... */
|
|
||||||
#define JANSSON_VERSION_HEX ((JANSSON_MAJOR_VERSION << 16) | \
|
|
||||||
(JANSSON_MINOR_VERSION << 8) | \
|
|
||||||
(JANSSON_MICRO_VERSION << 0))
|
|
||||||
|
|
||||||
|
|
||||||
/* types */
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
JSON_OBJECT,
|
|
||||||
JSON_ARRAY,
|
|
||||||
JSON_STRING,
|
|
||||||
JSON_INTEGER,
|
|
||||||
JSON_REAL,
|
|
||||||
JSON_TRUE,
|
|
||||||
JSON_FALSE,
|
|
||||||
JSON_NULL
|
|
||||||
} json_type;
|
|
||||||
|
|
||||||
typedef struct json_t {
|
|
||||||
json_type type;
|
|
||||||
size_t refcount;
|
|
||||||
} json_t;
|
|
||||||
|
|
||||||
#ifndef JANSSON_USING_CMAKE /* disabled if using cmake */
|
|
||||||
#if JSON_INTEGER_IS_LONG_LONG
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define JSON_INTEGER_FORMAT "I64d"
|
|
||||||
#else
|
|
||||||
#define JSON_INTEGER_FORMAT "lld"
|
|
||||||
#endif
|
|
||||||
typedef long long json_int_t;
|
|
||||||
#else
|
|
||||||
#define JSON_INTEGER_FORMAT "ld"
|
|
||||||
typedef long json_int_t;
|
|
||||||
#endif /* JSON_INTEGER_IS_LONG_LONG */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define json_typeof(json) ((json)->type)
|
|
||||||
#define json_is_object(json) ((json) && json_typeof(json) == JSON_OBJECT)
|
|
||||||
#define json_is_array(json) ((json) && json_typeof(json) == JSON_ARRAY)
|
|
||||||
#define json_is_string(json) ((json) && json_typeof(json) == JSON_STRING)
|
|
||||||
#define json_is_integer(json) ((json) && json_typeof(json) == JSON_INTEGER)
|
|
||||||
#define json_is_real(json) ((json) && json_typeof(json) == JSON_REAL)
|
|
||||||
#define json_is_number(json) (json_is_integer(json) || json_is_real(json))
|
|
||||||
#define json_is_true(json) ((json) && json_typeof(json) == JSON_TRUE)
|
|
||||||
#define json_is_false(json) ((json) && json_typeof(json) == JSON_FALSE)
|
|
||||||
#define json_boolean_value json_is_true
|
|
||||||
#define json_is_boolean(json) (json_is_true(json) || json_is_false(json))
|
|
||||||
#define json_is_null(json) ((json) && json_typeof(json) == JSON_NULL)
|
|
||||||
|
|
||||||
/* construction, destruction, reference counting */
|
|
||||||
|
|
||||||
json_t *json_object(void);
|
|
||||||
json_t *json_array(void);
|
|
||||||
json_t *json_string(const char *value);
|
|
||||||
json_t *json_stringn(const char *value, size_t len);
|
|
||||||
json_t *json_string_nocheck(const char *value);
|
|
||||||
json_t *json_stringn_nocheck(const char *value, size_t len);
|
|
||||||
json_t *json_integer(json_int_t value);
|
|
||||||
json_t *json_real(double value);
|
|
||||||
json_t *json_true(void);
|
|
||||||
json_t *json_false(void);
|
|
||||||
#define json_boolean(val) ((val) ? json_true() : json_false())
|
|
||||||
json_t *json_null(void);
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
json_t *json_incref(json_t *json)
|
|
||||||
{
|
|
||||||
if(json && json->refcount != (size_t)-1)
|
|
||||||
++json->refcount;
|
|
||||||
return json;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* do not call json_delete directly */
|
|
||||||
void json_delete(json_t *json);
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
void json_decref(json_t *json)
|
|
||||||
{
|
|
||||||
if(json && json->refcount != (size_t)-1 && --json->refcount == 0)
|
|
||||||
json_delete(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* error reporting */
|
|
||||||
|
|
||||||
#define JSON_ERROR_TEXT_LENGTH 160
|
|
||||||
#define JSON_ERROR_SOURCE_LENGTH 80
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int line;
|
|
||||||
int column;
|
|
||||||
int position;
|
|
||||||
char source[JSON_ERROR_SOURCE_LENGTH];
|
|
||||||
char text[JSON_ERROR_TEXT_LENGTH];
|
|
||||||
} json_error_t;
|
|
||||||
|
|
||||||
|
|
||||||
/* getters, setters, manipulation */
|
|
||||||
|
|
||||||
void json_object_seed(size_t seed);
|
|
||||||
size_t json_object_size(const json_t *object);
|
|
||||||
json_t *json_object_get(const json_t *object, const char *key);
|
|
||||||
int json_object_set_new(json_t *object, const char *key, json_t *value);
|
|
||||||
int json_object_set_new_nocheck(json_t *object, const char *key, json_t *value);
|
|
||||||
int json_object_del(json_t *object, const char *key);
|
|
||||||
int json_object_clear(json_t *object);
|
|
||||||
int json_object_update(json_t *object, json_t *other);
|
|
||||||
int json_object_update_existing(json_t *object, json_t *other);
|
|
||||||
int json_object_update_missing(json_t *object, json_t *other);
|
|
||||||
void *json_object_iter(json_t *object);
|
|
||||||
void *json_object_iter_at(json_t *object, const char *key);
|
|
||||||
void *json_object_key_to_iter(const char *key);
|
|
||||||
void *json_object_iter_next(json_t *object, void *iter);
|
|
||||||
const char *json_object_iter_key(void *iter);
|
|
||||||
json_t *json_object_iter_value(void *iter);
|
|
||||||
int json_object_iter_set_new(json_t *object, void *iter, json_t *value);
|
|
||||||
|
|
||||||
#define json_object_foreach(object, key, value) \
|
|
||||||
for(key = json_object_iter_key(json_object_iter(object)); \
|
|
||||||
key && (value = json_object_iter_value(json_object_key_to_iter(key))); \
|
|
||||||
key = json_object_iter_key(json_object_iter_next(object, json_object_key_to_iter(key))))
|
|
||||||
|
|
||||||
#define json_object_foreach_safe(object, n, key, value) \
|
|
||||||
for(key = json_object_iter_key(json_object_iter(object)), \
|
|
||||||
n = json_object_iter_next(object, json_object_key_to_iter(key)); \
|
|
||||||
key && (value = json_object_iter_value(json_object_key_to_iter(key))); \
|
|
||||||
key = json_object_iter_key(n), \
|
|
||||||
n = json_object_iter_next(object, json_object_key_to_iter(key)))
|
|
||||||
|
|
||||||
#define json_array_foreach(array, index, value) \
|
|
||||||
for(index = 0; \
|
|
||||||
index < json_array_size(array) && (value = json_array_get(array, index)); \
|
|
||||||
index++)
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
int json_object_set(json_t *object, const char *key, json_t *value)
|
|
||||||
{
|
|
||||||
return json_object_set_new(object, key, json_incref(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
int json_object_set_nocheck(json_t *object, const char *key, json_t *value)
|
|
||||||
{
|
|
||||||
return json_object_set_new_nocheck(object, key, json_incref(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
int json_object_iter_set(json_t *object, void *iter, json_t *value)
|
|
||||||
{
|
|
||||||
return json_object_iter_set_new(object, iter, json_incref(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t json_array_size(const json_t *array);
|
|
||||||
json_t *json_array_get(const json_t *array, size_t index);
|
|
||||||
int json_array_set_new(json_t *array, size_t index, json_t *value);
|
|
||||||
int json_array_append_new(json_t *array, json_t *value);
|
|
||||||
int json_array_insert_new(json_t *array, size_t index, json_t *value);
|
|
||||||
int json_array_remove(json_t *array, size_t index);
|
|
||||||
int json_array_clear(json_t *array);
|
|
||||||
int json_array_extend(json_t *array, json_t *other);
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
int json_array_set(json_t *array, size_t ind, json_t *value)
|
|
||||||
{
|
|
||||||
return json_array_set_new(array, ind, json_incref(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
int json_array_append(json_t *array, json_t *value)
|
|
||||||
{
|
|
||||||
return json_array_append_new(array, json_incref(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
int json_array_insert(json_t *array, size_t ind, json_t *value)
|
|
||||||
{
|
|
||||||
return json_array_insert_new(array, ind, json_incref(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *json_string_value(const json_t *string);
|
|
||||||
size_t json_string_length(const json_t *string);
|
|
||||||
json_int_t json_integer_value(const json_t *integer);
|
|
||||||
double json_real_value(const json_t *real);
|
|
||||||
double json_number_value(const json_t *json);
|
|
||||||
|
|
||||||
int json_string_set(json_t *string, const char *value);
|
|
||||||
int json_string_setn(json_t *string, const char *value, size_t len);
|
|
||||||
int json_string_set_nocheck(json_t *string, const char *value);
|
|
||||||
int json_string_setn_nocheck(json_t *string, const char *value, size_t len);
|
|
||||||
int json_integer_set(json_t *integer, json_int_t value);
|
|
||||||
int json_real_set(json_t *real, double value);
|
|
||||||
|
|
||||||
/* pack, unpack */
|
|
||||||
|
|
||||||
json_t *json_pack(const char *fmt, ...);
|
|
||||||
json_t *json_pack_ex(json_error_t *error, size_t flags, const char *fmt, ...);
|
|
||||||
json_t *json_vpack_ex(json_error_t *error, size_t flags, const char *fmt, va_list ap);
|
|
||||||
|
|
||||||
#define JSON_VALIDATE_ONLY 0x1
|
|
||||||
#define JSON_STRICT 0x2
|
|
||||||
|
|
||||||
int json_unpack(json_t *root, const char *fmt, ...);
|
|
||||||
int json_unpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, ...);
|
|
||||||
int json_vunpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, va_list ap);
|
|
||||||
|
|
||||||
|
|
||||||
/* equality */
|
|
||||||
|
|
||||||
int json_equal(json_t *value1, json_t *value2);
|
|
||||||
|
|
||||||
|
|
||||||
/* copying */
|
|
||||||
|
|
||||||
json_t *json_copy(json_t *value);
|
|
||||||
json_t *json_deep_copy(const json_t *value);
|
|
||||||
|
|
||||||
|
|
||||||
/* decoding */
|
|
||||||
|
|
||||||
#define JSON_REJECT_DUPLICATES 0x1
|
|
||||||
#define JSON_DISABLE_EOF_CHECK 0x2
|
|
||||||
#define JSON_DECODE_ANY 0x4
|
|
||||||
#define JSON_DECODE_INT_AS_REAL 0x8
|
|
||||||
#define JSON_ALLOW_NUL 0x10
|
|
||||||
|
|
||||||
typedef size_t (*json_load_callback_t)(void *buffer, size_t buflen, void *data);
|
|
||||||
|
|
||||||
json_t *json_loads(const char *input, size_t flags, json_error_t *error);
|
|
||||||
json_t *json_loadb(const char *buffer, size_t buflen, size_t flags, json_error_t *error);
|
|
||||||
json_t *json_loadf(FILE *input, size_t flags, json_error_t *error);
|
|
||||||
json_t *json_load_file(const char *path, size_t flags, json_error_t *error);
|
|
||||||
json_t *json_load_callback(json_load_callback_t callback, void *data, size_t flags, json_error_t *error);
|
|
||||||
|
|
||||||
|
|
||||||
/* encoding */
|
|
||||||
|
|
||||||
#define JSON_MAX_INDENT 0x1F
|
|
||||||
#define JSON_INDENT(n) ((n) & JSON_MAX_INDENT)
|
|
||||||
#define JSON_COMPACT 0x20
|
|
||||||
#define JSON_ENSURE_ASCII 0x40
|
|
||||||
#define JSON_SORT_KEYS 0x80
|
|
||||||
#define JSON_PRESERVE_ORDER 0x100
|
|
||||||
#define JSON_ENCODE_ANY 0x200
|
|
||||||
#define JSON_ESCAPE_SLASH 0x400
|
|
||||||
#define JSON_REAL_PRECISION(n) (((n) & 0x1F) << 11)
|
|
||||||
|
|
||||||
typedef int (*json_dump_callback_t)(const char *buffer, size_t size, void *data);
|
|
||||||
|
|
||||||
char *json_dumps(const json_t *json, size_t flags);
|
|
||||||
int json_dumpf(const json_t *json, FILE *output, size_t flags);
|
|
||||||
int json_dump_file(const json_t *json, const char *path, size_t flags);
|
|
||||||
int json_dump_callback(const json_t *json, json_dump_callback_t callback, void *data, size_t flags);
|
|
||||||
|
|
||||||
/* custom memory allocation */
|
|
||||||
|
|
||||||
typedef void *(*json_malloc_t)(size_t);
|
|
||||||
typedef void (*json_free_t)(void *);
|
|
||||||
|
|
||||||
void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn);
|
|
||||||
void json_get_alloc_funcs(json_malloc_t *malloc_fn, json_free_t *free_fn);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
109
external/Jansson/jansson_private.h
vendored
109
external/Jansson/jansson_private.h
vendored
@ -1,109 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
|
||||||
*
|
|
||||||
* Jansson is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the MIT license. See LICENSE for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef JANSSON_PRIVATE_H
|
|
||||||
#define JANSSON_PRIVATE_H
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include "jansson.h"
|
|
||||||
#include "hashtable.h"
|
|
||||||
#include "strbuffer.h"
|
|
||||||
|
|
||||||
#define container_of(ptr_, type_, member_) \
|
|
||||||
((type_ *)((char *)ptr_ - offsetof(type_, member_)))
|
|
||||||
|
|
||||||
/* On some platforms, max() may already be defined */
|
|
||||||
#ifndef max
|
|
||||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* va_copy is a C99 feature. In C89 implementations, it's sometimes
|
|
||||||
available as __va_copy. If not, memcpy() should do the trick. */
|
|
||||||
#ifndef va_copy
|
|
||||||
#ifdef __va_copy
|
|
||||||
#define va_copy __va_copy
|
|
||||||
#else
|
|
||||||
#define va_copy(a, b) memcpy(&(a), &(b), sizeof(va_list))
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
json_t json;
|
|
||||||
hashtable_t hashtable;
|
|
||||||
size_t serial;
|
|
||||||
int visited;
|
|
||||||
} json_object_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
json_t json;
|
|
||||||
size_t size;
|
|
||||||
size_t entries;
|
|
||||||
json_t **table;
|
|
||||||
int visited;
|
|
||||||
} json_array_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
json_t json;
|
|
||||||
char *value;
|
|
||||||
size_t length;
|
|
||||||
} json_string_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
json_t json;
|
|
||||||
double value;
|
|
||||||
} json_real_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
json_t json;
|
|
||||||
json_int_t value;
|
|
||||||
} json_integer_t;
|
|
||||||
|
|
||||||
#define json_to_object(json_) container_of(json_, json_object_t, json)
|
|
||||||
#define json_to_array(json_) container_of(json_, json_array_t, json)
|
|
||||||
#define json_to_string(json_) container_of(json_, json_string_t, json)
|
|
||||||
#define json_to_real(json_) container_of(json_, json_real_t, json)
|
|
||||||
#define json_to_integer(json_) container_of(json_, json_integer_t, json)
|
|
||||||
|
|
||||||
/* Create a string by taking ownership of an existing buffer */
|
|
||||||
json_t *jsonp_stringn_nocheck_own(const char *value, size_t len);
|
|
||||||
|
|
||||||
/* Error message formatting */
|
|
||||||
void jsonp_error_init(json_error_t *error, const char *source);
|
|
||||||
void jsonp_error_set_source(json_error_t *error, const char *source);
|
|
||||||
void jsonp_error_set(json_error_t *error, int line, int column,
|
|
||||||
size_t position, const char *msg, ...);
|
|
||||||
void jsonp_error_vset(json_error_t *error, int line, int column,
|
|
||||||
size_t position, const char *msg, va_list ap);
|
|
||||||
|
|
||||||
/* Locale independent string<->double conversions */
|
|
||||||
int jsonp_strtod(strbuffer_t *strbuffer, double *out);
|
|
||||||
int jsonp_dtostr(char *buffer, size_t size, double value, int prec);
|
|
||||||
|
|
||||||
/* Wrappers for custom memory functions */
|
|
||||||
void* jsonp_malloc(size_t size);
|
|
||||||
void jsonp_free(void *ptr);
|
|
||||||
char *jsonp_strndup(const char *str, size_t length);
|
|
||||||
char *jsonp_strdup(const char *str);
|
|
||||||
char *jsonp_strndup(const char *str, size_t len);
|
|
||||||
|
|
||||||
|
|
||||||
/* Windows compatibility */
|
|
||||||
#if defined(_WIN32) || defined(WIN32)
|
|
||||||
# if defined(_MSC_VER) /* MS compiller */
|
|
||||||
# if (_MSC_VER < 1900) && !defined(snprintf) /* snprintf not defined yet & not introduced */
|
|
||||||
# define snprintf _snprintf
|
|
||||||
# endif
|
|
||||||
# if (_MSC_VER < 1500) && !defined(vsnprintf) /* vsnprintf not defined yet & not introduced */
|
|
||||||
# define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
|
|
||||||
# endif
|
|
||||||
# else /* Other Windows compiller, old definition */
|
|
||||||
# define snprintf _snprintf
|
|
||||||
# define vsnprintf _vsnprintf
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
1110
external/Jansson/load.c
vendored
1110
external/Jansson/load.c
vendored
File diff suppressed because it is too large
Load Diff
381
external/Jansson/lookup3.h
vendored
381
external/Jansson/lookup3.h
vendored
@ -1,381 +0,0 @@
|
|||||||
/*
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
lookup3.c, by Bob Jenkins, May 2006, Public Domain.
|
|
||||||
|
|
||||||
These are functions for producing 32-bit hashes for hash table lookup.
|
|
||||||
hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final()
|
|
||||||
are externally useful functions. Routines to test the hash are included
|
|
||||||
if SELF_TEST is defined. You can use this free for any purpose. It's in
|
|
||||||
the public domain. It has no warranty.
|
|
||||||
|
|
||||||
You probably want to use hashlittle(). hashlittle() and hashbig()
|
|
||||||
hash byte arrays. hashlittle() is is faster than hashbig() on
|
|
||||||
little-endian machines. Intel and AMD are little-endian machines.
|
|
||||||
On second thought, you probably want hashlittle2(), which is identical to
|
|
||||||
hashlittle() except it returns two 32-bit hashes for the price of one.
|
|
||||||
You could implement hashbig2() if you wanted but I haven't bothered here.
|
|
||||||
|
|
||||||
If you want to find a hash of, say, exactly 7 integers, do
|
|
||||||
a = i1; b = i2; c = i3;
|
|
||||||
mix(a,b,c);
|
|
||||||
a += i4; b += i5; c += i6;
|
|
||||||
mix(a,b,c);
|
|
||||||
a += i7;
|
|
||||||
final(a,b,c);
|
|
||||||
then use c as the hash value. If you have a variable length array of
|
|
||||||
4-byte integers to hash, use hashword(). If you have a byte array (like
|
|
||||||
a character string), use hashlittle(). If you have several byte arrays, or
|
|
||||||
a mix of things, see the comments above hashlittle().
|
|
||||||
|
|
||||||
Why is this so big? I read 12 bytes at a time into 3 4-byte integers,
|
|
||||||
then mix those integers. This is fast (you can do a lot more thorough
|
|
||||||
mixing with 12*3 instructions on 3 integers than you can with 3 instructions
|
|
||||||
on 1 byte), but shoehorning those bytes into integers efficiently is messy.
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <jansson_private_config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_STDINT_H
|
|
||||||
#include <stdint.h> /* defines uint32_t etc */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_PARAM_H
|
|
||||||
#include <sys/param.h> /* attempt to define endianness */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_ENDIAN_H
|
|
||||||
# include <endian.h> /* attempt to define endianness */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* My best guess at if you are big-endian or little-endian. This may
|
|
||||||
* need adjustment.
|
|
||||||
*/
|
|
||||||
#if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \
|
|
||||||
__BYTE_ORDER == __LITTLE_ENDIAN) || \
|
|
||||||
(defined(i386) || defined(__i386__) || defined(__i486__) || \
|
|
||||||
defined(__i586__) || defined(__i686__) || defined(vax) || defined(MIPSEL))
|
|
||||||
# define HASH_LITTLE_ENDIAN 1
|
|
||||||
# define HASH_BIG_ENDIAN 0
|
|
||||||
#elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && \
|
|
||||||
__BYTE_ORDER == __BIG_ENDIAN) || \
|
|
||||||
(defined(sparc) || defined(POWERPC) || defined(mc68000) || defined(sel))
|
|
||||||
# define HASH_LITTLE_ENDIAN 0
|
|
||||||
# define HASH_BIG_ENDIAN 1
|
|
||||||
#else
|
|
||||||
# define HASH_LITTLE_ENDIAN 0
|
|
||||||
# define HASH_BIG_ENDIAN 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define hashsize(n) ((uint32_t)1<<(n))
|
|
||||||
#define hashmask(n) (hashsize(n)-1)
|
|
||||||
#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
|
|
||||||
|
|
||||||
/*
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
mix -- mix 3 32-bit values reversibly.
|
|
||||||
|
|
||||||
This is reversible, so any information in (a,b,c) before mix() is
|
|
||||||
still in (a,b,c) after mix().
|
|
||||||
|
|
||||||
If four pairs of (a,b,c) inputs are run through mix(), or through
|
|
||||||
mix() in reverse, there are at least 32 bits of the output that
|
|
||||||
are sometimes the same for one pair and different for another pair.
|
|
||||||
This was tested for:
|
|
||||||
* pairs that differed by one bit, by two bits, in any combination
|
|
||||||
of top bits of (a,b,c), or in any combination of bottom bits of
|
|
||||||
(a,b,c).
|
|
||||||
* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed
|
|
||||||
the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
|
|
||||||
is commonly produced by subtraction) look like a single 1-bit
|
|
||||||
difference.
|
|
||||||
* the base values were pseudorandom, all zero but one bit set, or
|
|
||||||
all zero plus a counter that starts at zero.
|
|
||||||
|
|
||||||
Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that
|
|
||||||
satisfy this are
|
|
||||||
4 6 8 16 19 4
|
|
||||||
9 15 3 18 27 15
|
|
||||||
14 9 3 7 17 3
|
|
||||||
Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing
|
|
||||||
for "differ" defined as + with a one-bit base and a two-bit delta. I
|
|
||||||
used http://burtleburtle.net/bob/hash/avalanche.html to choose
|
|
||||||
the operations, constants, and arrangements of the variables.
|
|
||||||
|
|
||||||
This does not achieve avalanche. There are input bits of (a,b,c)
|
|
||||||
that fail to affect some output bits of (a,b,c), especially of a. The
|
|
||||||
most thoroughly mixed value is c, but it doesn't really even achieve
|
|
||||||
avalanche in c.
|
|
||||||
|
|
||||||
This allows some parallelism. Read-after-writes are good at doubling
|
|
||||||
the number of bits affected, so the goal of mixing pulls in the opposite
|
|
||||||
direction as the goal of parallelism. I did what I could. Rotates
|
|
||||||
seem to cost as much as shifts on every machine I could lay my hands
|
|
||||||
on, and rotates are much kinder to the top and bottom bits, so I used
|
|
||||||
rotates.
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define mix(a,b,c) \
|
|
||||||
{ \
|
|
||||||
a -= c; a ^= rot(c, 4); c += b; \
|
|
||||||
b -= a; b ^= rot(a, 6); a += c; \
|
|
||||||
c -= b; c ^= rot(b, 8); b += a; \
|
|
||||||
a -= c; a ^= rot(c,16); c += b; \
|
|
||||||
b -= a; b ^= rot(a,19); a += c; \
|
|
||||||
c -= b; c ^= rot(b, 4); b += a; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
final -- final mixing of 3 32-bit values (a,b,c) into c
|
|
||||||
|
|
||||||
Pairs of (a,b,c) values differing in only a few bits will usually
|
|
||||||
produce values of c that look totally different. This was tested for
|
|
||||||
* pairs that differed by one bit, by two bits, in any combination
|
|
||||||
of top bits of (a,b,c), or in any combination of bottom bits of
|
|
||||||
(a,b,c).
|
|
||||||
* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed
|
|
||||||
the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
|
|
||||||
is commonly produced by subtraction) look like a single 1-bit
|
|
||||||
difference.
|
|
||||||
* the base values were pseudorandom, all zero but one bit set, or
|
|
||||||
all zero plus a counter that starts at zero.
|
|
||||||
|
|
||||||
These constants passed:
|
|
||||||
14 11 25 16 4 14 24
|
|
||||||
12 14 25 16 4 14 24
|
|
||||||
and these came close:
|
|
||||||
4 8 15 26 3 22 24
|
|
||||||
10 8 15 26 3 22 24
|
|
||||||
11 8 15 26 3 22 24
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define final(a,b,c) \
|
|
||||||
{ \
|
|
||||||
c ^= b; c -= rot(b,14); \
|
|
||||||
a ^= c; a -= rot(c,11); \
|
|
||||||
b ^= a; b -= rot(a,25); \
|
|
||||||
c ^= b; c -= rot(b,16); \
|
|
||||||
a ^= c; a -= rot(c,4); \
|
|
||||||
b ^= a; b -= rot(a,14); \
|
|
||||||
c ^= b; c -= rot(b,24); \
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
hashlittle() -- hash a variable-length key into a 32-bit value
|
|
||||||
k : the key (the unaligned variable-length array of bytes)
|
|
||||||
length : the length of the key, counting by bytes
|
|
||||||
initval : can be any 4-byte value
|
|
||||||
Returns a 32-bit value. Every bit of the key affects every bit of
|
|
||||||
the return value. Two keys differing by one or two bits will have
|
|
||||||
totally different hash values.
|
|
||||||
|
|
||||||
The best hash table sizes are powers of 2. There is no need to do
|
|
||||||
mod a prime (mod is sooo slow!). If you need less than 32 bits,
|
|
||||||
use a bitmask. For example, if you need only 10 bits, do
|
|
||||||
h = (h & hashmask(10));
|
|
||||||
In which case, the hash table should have hashsize(10) elements.
|
|
||||||
|
|
||||||
If you are hashing n strings (uint8_t **)k, do it like this:
|
|
||||||
for (i=0, h=0; i<n; ++i) h = hashlittle( k[i], len[i], h);
|
|
||||||
|
|
||||||
By Bob Jenkins, 2006. bob_jenkins@burtleburtle.net. You may use this
|
|
||||||
code any way you wish, private, educational, or commercial. It's free.
|
|
||||||
|
|
||||||
Use for hash table lookup, or anything where one collision in 2^^32 is
|
|
||||||
acceptable. Do NOT use for cryptographic purposes.
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
static uint32_t hashlittle(const void *key, size_t length, uint32_t initval)
|
|
||||||
{
|
|
||||||
uint32_t a,b,c; /* internal state */
|
|
||||||
union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */
|
|
||||||
|
|
||||||
/* Set up the internal state */
|
|
||||||
a = b = c = 0xdeadbeef + ((uint32_t)length) + initval;
|
|
||||||
|
|
||||||
u.ptr = key;
|
|
||||||
if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
|
|
||||||
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
|
|
||||||
|
|
||||||
/* Detect Valgrind or AddressSanitizer */
|
|
||||||
#ifdef VALGRIND
|
|
||||||
# define NO_MASKING_TRICK 1
|
|
||||||
#else
|
|
||||||
# if defined(__has_feature) /* Clang */
|
|
||||||
# if __has_feature(address_sanitizer) /* is ASAN enabled? */
|
|
||||||
# define NO_MASKING_TRICK 1
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# if defined(__SANITIZE_ADDRESS__) /* GCC 4.8.x, is ASAN enabled? */
|
|
||||||
# define NO_MASKING_TRICK 1
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NO_MASKING_TRICK
|
|
||||||
const uint8_t *k8;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
|
|
||||||
while (length > 12)
|
|
||||||
{
|
|
||||||
a += k[0];
|
|
||||||
b += k[1];
|
|
||||||
c += k[2];
|
|
||||||
mix(a,b,c);
|
|
||||||
length -= 12;
|
|
||||||
k += 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------- handle the last (probably partial) block */
|
|
||||||
/*
|
|
||||||
* "k[2]&0xffffff" actually reads beyond the end of the string, but
|
|
||||||
* then masks off the part it's not allowed to read. Because the
|
|
||||||
* string is aligned, the masked-off tail is in the same word as the
|
|
||||||
* rest of the string. Every machine with memory protection I've seen
|
|
||||||
* does it on word boundaries, so is OK with this. But VALGRIND will
|
|
||||||
* still catch it and complain. The masking trick does make the hash
|
|
||||||
* noticably faster for short strings (like English words).
|
|
||||||
*/
|
|
||||||
#ifndef NO_MASKING_TRICK
|
|
||||||
|
|
||||||
switch(length)
|
|
||||||
{
|
|
||||||
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
|
|
||||||
case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break;
|
|
||||||
case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break;
|
|
||||||
case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break;
|
|
||||||
case 8 : b+=k[1]; a+=k[0]; break;
|
|
||||||
case 7 : b+=k[1]&0xffffff; a+=k[0]; break;
|
|
||||||
case 6 : b+=k[1]&0xffff; a+=k[0]; break;
|
|
||||||
case 5 : b+=k[1]&0xff; a+=k[0]; break;
|
|
||||||
case 4 : a+=k[0]; break;
|
|
||||||
case 3 : a+=k[0]&0xffffff; break;
|
|
||||||
case 2 : a+=k[0]&0xffff; break;
|
|
||||||
case 1 : a+=k[0]&0xff; break;
|
|
||||||
case 0 : return c; /* zero length strings require no mixing */
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* make valgrind happy */
|
|
||||||
|
|
||||||
k8 = (const uint8_t *)k;
|
|
||||||
switch(length)
|
|
||||||
{
|
|
||||||
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
|
|
||||||
case 11: c+=((uint32_t)k8[10])<<16; /* fall through */
|
|
||||||
case 10: c+=((uint32_t)k8[9])<<8; /* fall through */
|
|
||||||
case 9 : c+=k8[8]; /* fall through */
|
|
||||||
case 8 : b+=k[1]; a+=k[0]; break;
|
|
||||||
case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */
|
|
||||||
case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */
|
|
||||||
case 5 : b+=k8[4]; /* fall through */
|
|
||||||
case 4 : a+=k[0]; break;
|
|
||||||
case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */
|
|
||||||
case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */
|
|
||||||
case 1 : a+=k8[0]; break;
|
|
||||||
case 0 : return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* !valgrind */
|
|
||||||
|
|
||||||
} else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
|
|
||||||
const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */
|
|
||||||
const uint8_t *k8;
|
|
||||||
|
|
||||||
/*--------------- all but last block: aligned reads and different mixing */
|
|
||||||
while (length > 12)
|
|
||||||
{
|
|
||||||
a += k[0] + (((uint32_t)k[1])<<16);
|
|
||||||
b += k[2] + (((uint32_t)k[3])<<16);
|
|
||||||
c += k[4] + (((uint32_t)k[5])<<16);
|
|
||||||
mix(a,b,c);
|
|
||||||
length -= 12;
|
|
||||||
k += 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------- handle the last (probably partial) block */
|
|
||||||
k8 = (const uint8_t *)k;
|
|
||||||
switch(length)
|
|
||||||
{
|
|
||||||
case 12: c+=k[4]+(((uint32_t)k[5])<<16);
|
|
||||||
b+=k[2]+(((uint32_t)k[3])<<16);
|
|
||||||
a+=k[0]+(((uint32_t)k[1])<<16);
|
|
||||||
break;
|
|
||||||
case 11: c+=((uint32_t)k8[10])<<16; /* fall through */
|
|
||||||
case 10: c+=k[4];
|
|
||||||
b+=k[2]+(((uint32_t)k[3])<<16);
|
|
||||||
a+=k[0]+(((uint32_t)k[1])<<16);
|
|
||||||
break;
|
|
||||||
case 9 : c+=k8[8]; /* fall through */
|
|
||||||
case 8 : b+=k[2]+(((uint32_t)k[3])<<16);
|
|
||||||
a+=k[0]+(((uint32_t)k[1])<<16);
|
|
||||||
break;
|
|
||||||
case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */
|
|
||||||
case 6 : b+=k[2];
|
|
||||||
a+=k[0]+(((uint32_t)k[1])<<16);
|
|
||||||
break;
|
|
||||||
case 5 : b+=k8[4]; /* fall through */
|
|
||||||
case 4 : a+=k[0]+(((uint32_t)k[1])<<16);
|
|
||||||
break;
|
|
||||||
case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */
|
|
||||||
case 2 : a+=k[0];
|
|
||||||
break;
|
|
||||||
case 1 : a+=k8[0];
|
|
||||||
break;
|
|
||||||
case 0 : return c; /* zero length requires no mixing */
|
|
||||||
}
|
|
||||||
|
|
||||||
} else { /* need to read the key one byte at a time */
|
|
||||||
const uint8_t *k = (const uint8_t *)key;
|
|
||||||
|
|
||||||
/*--------------- all but the last block: affect some 32 bits of (a,b,c) */
|
|
||||||
while (length > 12)
|
|
||||||
{
|
|
||||||
a += k[0];
|
|
||||||
a += ((uint32_t)k[1])<<8;
|
|
||||||
a += ((uint32_t)k[2])<<16;
|
|
||||||
a += ((uint32_t)k[3])<<24;
|
|
||||||
b += k[4];
|
|
||||||
b += ((uint32_t)k[5])<<8;
|
|
||||||
b += ((uint32_t)k[6])<<16;
|
|
||||||
b += ((uint32_t)k[7])<<24;
|
|
||||||
c += k[8];
|
|
||||||
c += ((uint32_t)k[9])<<8;
|
|
||||||
c += ((uint32_t)k[10])<<16;
|
|
||||||
c += ((uint32_t)k[11])<<24;
|
|
||||||
mix(a,b,c);
|
|
||||||
length -= 12;
|
|
||||||
k += 12;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*-------------------------------- last block: affect all 32 bits of (c) */
|
|
||||||
switch(length) /* all the case statements fall through */
|
|
||||||
{
|
|
||||||
case 12: c+=((uint32_t)k[11])<<24;
|
|
||||||
case 11: c+=((uint32_t)k[10])<<16;
|
|
||||||
case 10: c+=((uint32_t)k[9])<<8;
|
|
||||||
case 9 : c+=k[8];
|
|
||||||
case 8 : b+=((uint32_t)k[7])<<24;
|
|
||||||
case 7 : b+=((uint32_t)k[6])<<16;
|
|
||||||
case 6 : b+=((uint32_t)k[5])<<8;
|
|
||||||
case 5 : b+=k[4];
|
|
||||||
case 4 : a+=((uint32_t)k[3])<<24;
|
|
||||||
case 3 : a+=((uint32_t)k[2])<<16;
|
|
||||||
case 2 : a+=((uint32_t)k[1])<<8;
|
|
||||||
case 1 : a+=k[0];
|
|
||||||
break;
|
|
||||||
case 0 : return c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final(a,b,c);
|
|
||||||
return c;
|
|
||||||
}
|
|
69
external/Jansson/memory.c
vendored
69
external/Jansson/memory.c
vendored
@ -1,69 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
|
||||||
* Copyright (c) 2011-2012 Basile Starynkevitch <basile@starynkevitch.net>
|
|
||||||
*
|
|
||||||
* Jansson is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the MIT license. See LICENSE for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "jansson.h"
|
|
||||||
#include "jansson_private.h"
|
|
||||||
|
|
||||||
/* C89 allows these to be macros */
|
|
||||||
#undef malloc
|
|
||||||
#undef free
|
|
||||||
|
|
||||||
/* memory function pointers */
|
|
||||||
static json_malloc_t do_malloc = malloc;
|
|
||||||
static json_free_t do_free = free;
|
|
||||||
|
|
||||||
void *jsonp_malloc(size_t size)
|
|
||||||
{
|
|
||||||
if(!size)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return (*do_malloc)(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void jsonp_free(void *ptr)
|
|
||||||
{
|
|
||||||
if(!ptr)
|
|
||||||
return;
|
|
||||||
|
|
||||||
(*do_free)(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
char *jsonp_strdup(const char *str)
|
|
||||||
{
|
|
||||||
return jsonp_strndup(str, strlen(str));
|
|
||||||
}
|
|
||||||
|
|
||||||
char *jsonp_strndup(const char *str, size_t len)
|
|
||||||
{
|
|
||||||
char *new_str;
|
|
||||||
|
|
||||||
new_str = jsonp_malloc(len + 1);
|
|
||||||
if(!new_str)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
memcpy(new_str, str, len);
|
|
||||||
new_str[len] = '\0';
|
|
||||||
return new_str;
|
|
||||||
}
|
|
||||||
|
|
||||||
void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn)
|
|
||||||
{
|
|
||||||
do_malloc = malloc_fn;
|
|
||||||
do_free = free_fn;
|
|
||||||
}
|
|
||||||
|
|
||||||
void json_get_alloc_funcs(json_malloc_t *malloc_fn, json_free_t *free_fn)
|
|
||||||
{
|
|
||||||
if (malloc_fn)
|
|
||||||
*malloc_fn = do_malloc;
|
|
||||||
if (free_fn)
|
|
||||||
*free_fn = do_free;
|
|
||||||
}
|
|
871
external/Jansson/pack_unpack.c
vendored
871
external/Jansson/pack_unpack.c
vendored
@ -1,871 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
|
||||||
* Copyright (c) 2011-2012 Graeme Smecher <graeme.smecher@mail.mcgill.ca>
|
|
||||||
*
|
|
||||||
* Jansson is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the MIT license. See LICENSE for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include "jansson.h"
|
|
||||||
#include "jansson_private.h"
|
|
||||||
#include "utf.h"
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int line;
|
|
||||||
int column;
|
|
||||||
size_t pos;
|
|
||||||
char token;
|
|
||||||
} token_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
const char *start;
|
|
||||||
const char *fmt;
|
|
||||||
token_t prev_token;
|
|
||||||
token_t token;
|
|
||||||
token_t next_token;
|
|
||||||
json_error_t *error;
|
|
||||||
size_t flags;
|
|
||||||
int line;
|
|
||||||
int column;
|
|
||||||
size_t pos;
|
|
||||||
} scanner_t;
|
|
||||||
|
|
||||||
#define token(scanner) ((scanner)->token.token)
|
|
||||||
|
|
||||||
static const char * const type_names[] = {
|
|
||||||
"object",
|
|
||||||
"array",
|
|
||||||
"string",
|
|
||||||
"integer",
|
|
||||||
"real",
|
|
||||||
"true",
|
|
||||||
"false",
|
|
||||||
"null"
|
|
||||||
};
|
|
||||||
|
|
||||||
#define type_name(x) type_names[json_typeof(x)]
|
|
||||||
|
|
||||||
static const char unpack_value_starters[] = "{[siIbfFOon";
|
|
||||||
|
|
||||||
static void scanner_init(scanner_t *s, json_error_t *error,
|
|
||||||
size_t flags, const char *fmt)
|
|
||||||
{
|
|
||||||
s->error = error;
|
|
||||||
s->flags = flags;
|
|
||||||
s->fmt = s->start = fmt;
|
|
||||||
memset(&s->prev_token, 0, sizeof(token_t));
|
|
||||||
memset(&s->token, 0, sizeof(token_t));
|
|
||||||
memset(&s->next_token, 0, sizeof(token_t));
|
|
||||||
s->line = 1;
|
|
||||||
s->column = 0;
|
|
||||||
s->pos = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void next_token(scanner_t *s)
|
|
||||||
{
|
|
||||||
const char *t;
|
|
||||||
s->prev_token = s->token;
|
|
||||||
|
|
||||||
if(s->next_token.line) {
|
|
||||||
s->token = s->next_token;
|
|
||||||
s->next_token.line = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
t = s->fmt;
|
|
||||||
s->column++;
|
|
||||||
s->pos++;
|
|
||||||
|
|
||||||
/* skip space and ignored chars */
|
|
||||||
while(*t == ' ' || *t == '\t' || *t == '\n' || *t == ',' || *t == ':') {
|
|
||||||
if(*t == '\n') {
|
|
||||||
s->line++;
|
|
||||||
s->column = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
s->column++;
|
|
||||||
|
|
||||||
s->pos++;
|
|
||||||
t++;
|
|
||||||
}
|
|
||||||
|
|
||||||
s->token.token = *t;
|
|
||||||
s->token.line = s->line;
|
|
||||||
s->token.column = s->column;
|
|
||||||
s->token.pos = s->pos;
|
|
||||||
|
|
||||||
t++;
|
|
||||||
s->fmt = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void prev_token(scanner_t *s)
|
|
||||||
{
|
|
||||||
s->next_token = s->token;
|
|
||||||
s->token = s->prev_token;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void set_error(scanner_t *s, const char *source, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
va_start(ap, fmt);
|
|
||||||
|
|
||||||
jsonp_error_vset(s->error, s->token.line, s->token.column, s->token.pos,
|
|
||||||
fmt, ap);
|
|
||||||
|
|
||||||
jsonp_error_set_source(s->error, source);
|
|
||||||
|
|
||||||
va_end(ap);
|
|
||||||
}
|
|
||||||
|
|
||||||
static json_t *pack(scanner_t *s, va_list *ap);
|
|
||||||
|
|
||||||
|
|
||||||
/* ours will be set to 1 if jsonp_free() must be called for the result
|
|
||||||
afterwards */
|
|
||||||
static char *read_string(scanner_t *s, va_list *ap,
|
|
||||||
const char *purpose, size_t *out_len, int *ours)
|
|
||||||
{
|
|
||||||
char t;
|
|
||||||
strbuffer_t strbuff;
|
|
||||||
const char *str;
|
|
||||||
size_t length;
|
|
||||||
|
|
||||||
next_token(s);
|
|
||||||
t = token(s);
|
|
||||||
prev_token(s);
|
|
||||||
|
|
||||||
if(t != '#' && t != '%' && t != '+') {
|
|
||||||
/* Optimize the simple case */
|
|
||||||
str = va_arg(*ap, const char *);
|
|
||||||
|
|
||||||
if(!str) {
|
|
||||||
set_error(s, "<args>", "NULL string argument");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
length = strlen(str);
|
|
||||||
|
|
||||||
if(!utf8_check_string(str, length)) {
|
|
||||||
set_error(s, "<args>", "Invalid UTF-8 %s", purpose);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
*out_len = length;
|
|
||||||
*ours = 0;
|
|
||||||
return (char *)str;
|
|
||||||
}
|
|
||||||
|
|
||||||
strbuffer_init(&strbuff);
|
|
||||||
|
|
||||||
while(1) {
|
|
||||||
str = va_arg(*ap, const char *);
|
|
||||||
if(!str) {
|
|
||||||
set_error(s, "<args>", "NULL string argument");
|
|
||||||
strbuffer_close(&strbuff);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
next_token(s);
|
|
||||||
|
|
||||||
if(token(s) == '#') {
|
|
||||||
length = va_arg(*ap, int);
|
|
||||||
}
|
|
||||||
else if(token(s) == '%') {
|
|
||||||
length = va_arg(*ap, size_t);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
prev_token(s);
|
|
||||||
length = strlen(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(strbuffer_append_bytes(&strbuff, str, length) == -1) {
|
|
||||||
set_error(s, "<internal>", "Out of memory");
|
|
||||||
strbuffer_close(&strbuff);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
next_token(s);
|
|
||||||
if(token(s) != '+') {
|
|
||||||
prev_token(s);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!utf8_check_string(strbuff.value, strbuff.length)) {
|
|
||||||
set_error(s, "<args>", "Invalid UTF-8 %s", purpose);
|
|
||||||
strbuffer_close(&strbuff);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
*out_len = strbuff.length;
|
|
||||||
*ours = 1;
|
|
||||||
return strbuffer_steal_value(&strbuff);
|
|
||||||
}
|
|
||||||
|
|
||||||
static json_t *pack_object(scanner_t *s, va_list *ap)
|
|
||||||
{
|
|
||||||
json_t *object = json_object();
|
|
||||||
next_token(s);
|
|
||||||
|
|
||||||
while(token(s) != '}') {
|
|
||||||
char *key;
|
|
||||||
size_t len;
|
|
||||||
int ours;
|
|
||||||
json_t *value;
|
|
||||||
|
|
||||||
if(!token(s)) {
|
|
||||||
set_error(s, "<format>", "Unexpected end of format string");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(token(s) != 's') {
|
|
||||||
set_error(s, "<format>", "Expected format 's', got '%c'", token(s));
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
key = read_string(s, ap, "object key", &len, &ours);
|
|
||||||
if(!key)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
next_token(s);
|
|
||||||
|
|
||||||
value = pack(s, ap);
|
|
||||||
if(!value) {
|
|
||||||
if(ours)
|
|
||||||
jsonp_free(key);
|
|
||||||
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(json_object_set_new_nocheck(object, key, value)) {
|
|
||||||
set_error(s, "<internal>", "Unable to add key \"%s\"", key);
|
|
||||||
if(ours)
|
|
||||||
jsonp_free(key);
|
|
||||||
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ours)
|
|
||||||
jsonp_free(key);
|
|
||||||
|
|
||||||
next_token(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
return object;
|
|
||||||
|
|
||||||
error:
|
|
||||||
json_decref(object);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static json_t *pack_array(scanner_t *s, va_list *ap)
|
|
||||||
{
|
|
||||||
json_t *array = json_array();
|
|
||||||
next_token(s);
|
|
||||||
|
|
||||||
while(token(s) != ']') {
|
|
||||||
json_t *value;
|
|
||||||
|
|
||||||
if(!token(s)) {
|
|
||||||
set_error(s, "<format>", "Unexpected end of format string");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
value = pack(s, ap);
|
|
||||||
if(!value)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if(json_array_append_new(array, value)) {
|
|
||||||
set_error(s, "<internal>", "Unable to append to array");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
next_token(s);
|
|
||||||
}
|
|
||||||
return array;
|
|
||||||
|
|
||||||
error:
|
|
||||||
json_decref(array);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static json_t *pack_string(scanner_t *s, va_list *ap)
|
|
||||||
{
|
|
||||||
char *str;
|
|
||||||
size_t len;
|
|
||||||
int ours;
|
|
||||||
int nullable;
|
|
||||||
|
|
||||||
next_token(s);
|
|
||||||
nullable = token(s) == '?';
|
|
||||||
if (!nullable)
|
|
||||||
prev_token(s);
|
|
||||||
|
|
||||||
str = read_string(s, ap, "string", &len, &ours);
|
|
||||||
if (!str) {
|
|
||||||
return nullable ? json_null() : NULL;
|
|
||||||
} else if (ours) {
|
|
||||||
return jsonp_stringn_nocheck_own(str, len);
|
|
||||||
} else {
|
|
||||||
return json_stringn_nocheck(str, len);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static json_t *pack(scanner_t *s, va_list *ap)
|
|
||||||
{
|
|
||||||
switch(token(s)) {
|
|
||||||
case '{':
|
|
||||||
return pack_object(s, ap);
|
|
||||||
|
|
||||||
case '[':
|
|
||||||
return pack_array(s, ap);
|
|
||||||
|
|
||||||
case 's': /* string */
|
|
||||||
return pack_string(s, ap);
|
|
||||||
|
|
||||||
case 'n': /* null */
|
|
||||||
return json_null();
|
|
||||||
|
|
||||||
case 'b': /* boolean */
|
|
||||||
return va_arg(*ap, int) ? json_true() : json_false();
|
|
||||||
|
|
||||||
case 'i': /* integer from int */
|
|
||||||
return json_integer(va_arg(*ap, int));
|
|
||||||
|
|
||||||
case 'I': /* integer from json_int_t */
|
|
||||||
return json_integer(va_arg(*ap, json_int_t));
|
|
||||||
|
|
||||||
case 'f': /* real */
|
|
||||||
return json_real(va_arg(*ap, double));
|
|
||||||
|
|
||||||
case 'O': /* a json_t object; increments refcount */
|
|
||||||
{
|
|
||||||
int nullable;
|
|
||||||
json_t *json;
|
|
||||||
|
|
||||||
next_token(s);
|
|
||||||
nullable = token(s) == '?';
|
|
||||||
if (!nullable)
|
|
||||||
prev_token(s);
|
|
||||||
|
|
||||||
json = va_arg(*ap, json_t *);
|
|
||||||
if (!json && nullable) {
|
|
||||||
return json_null();
|
|
||||||
} else {
|
|
||||||
return json_incref(json);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
case 'o': /* a json_t object; doesn't increment refcount */
|
|
||||||
{
|
|
||||||
int nullable;
|
|
||||||
json_t *json;
|
|
||||||
|
|
||||||
next_token(s);
|
|
||||||
nullable = token(s) == '?';
|
|
||||||
if (!nullable)
|
|
||||||
prev_token(s);
|
|
||||||
|
|
||||||
json = va_arg(*ap, json_t *);
|
|
||||||
if (!json && nullable) {
|
|
||||||
return json_null();
|
|
||||||
} else {
|
|
||||||
return json;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
set_error(s, "<format>", "Unexpected format character '%c'",
|
|
||||||
token(s));
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int unpack(scanner_t *s, json_t *root, va_list *ap);
|
|
||||||
|
|
||||||
static int unpack_object(scanner_t *s, json_t *root, va_list *ap)
|
|
||||||
{
|
|
||||||
int ret = -1;
|
|
||||||
int strict = 0;
|
|
||||||
int gotopt = 0;
|
|
||||||
|
|
||||||
/* Use a set (emulated by a hashtable) to check that all object
|
|
||||||
keys are accessed. Checking that the correct number of keys
|
|
||||||
were accessed is not enough, as the same key can be unpacked
|
|
||||||
multiple times.
|
|
||||||
*/
|
|
||||||
hashtable_t key_set;
|
|
||||||
|
|
||||||
if(hashtable_init(&key_set)) {
|
|
||||||
set_error(s, "<internal>", "Out of memory");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(root && !json_is_object(root)) {
|
|
||||||
set_error(s, "<validation>", "Expected object, got %s",
|
|
||||||
type_name(root));
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
next_token(s);
|
|
||||||
|
|
||||||
while(token(s) != '}') {
|
|
||||||
const char *key;
|
|
||||||
json_t *value;
|
|
||||||
int opt = 0;
|
|
||||||
|
|
||||||
if(strict != 0) {
|
|
||||||
set_error(s, "<format>", "Expected '}' after '%c', got '%c'",
|
|
||||||
(strict == 1 ? '!' : '*'), token(s));
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!token(s)) {
|
|
||||||
set_error(s, "<format>", "Unexpected end of format string");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(token(s) == '!' || token(s) == '*') {
|
|
||||||
strict = (token(s) == '!' ? 1 : -1);
|
|
||||||
next_token(s);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(token(s) != 's') {
|
|
||||||
set_error(s, "<format>", "Expected format 's', got '%c'", token(s));
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
key = va_arg(*ap, const char *);
|
|
||||||
if(!key) {
|
|
||||||
set_error(s, "<args>", "NULL object key");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
next_token(s);
|
|
||||||
|
|
||||||
if(token(s) == '?') {
|
|
||||||
opt = gotopt = 1;
|
|
||||||
next_token(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!root) {
|
|
||||||
/* skipping */
|
|
||||||
value = NULL;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
value = json_object_get(root, key);
|
|
||||||
if(!value && !opt) {
|
|
||||||
set_error(s, "<validation>", "Object item not found: %s", key);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(unpack(s, value, ap))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
hashtable_set(&key_set, key, 0, json_null());
|
|
||||||
next_token(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(strict == 0 && (s->flags & JSON_STRICT))
|
|
||||||
strict = 1;
|
|
||||||
|
|
||||||
if(root && strict == 1) {
|
|
||||||
/* We need to check that all non optional items have been parsed */
|
|
||||||
const char *key;
|
|
||||||
int have_unrecognized_keys = 0;
|
|
||||||
strbuffer_t unrecognized_keys;
|
|
||||||
json_t *value;
|
|
||||||
long unpacked = 0;
|
|
||||||
if (gotopt) {
|
|
||||||
/* We have optional keys, we need to iter on each key */
|
|
||||||
json_object_foreach(root, key, value) {
|
|
||||||
if(!hashtable_get(&key_set, key)) {
|
|
||||||
unpacked++;
|
|
||||||
|
|
||||||
/* Save unrecognized keys for the error message */
|
|
||||||
if (!have_unrecognized_keys) {
|
|
||||||
strbuffer_init(&unrecognized_keys);
|
|
||||||
have_unrecognized_keys = 1;
|
|
||||||
} else {
|
|
||||||
strbuffer_append_bytes(&unrecognized_keys, ", ", 2);
|
|
||||||
}
|
|
||||||
strbuffer_append_bytes(&unrecognized_keys, key, strlen(key));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* No optional keys, we can just compare the number of items */
|
|
||||||
unpacked = (long)json_object_size(root) - (long)key_set.size;
|
|
||||||
}
|
|
||||||
if (unpacked) {
|
|
||||||
if (!gotopt) {
|
|
||||||
/* Save unrecognized keys for the error message */
|
|
||||||
json_object_foreach(root, key, value) {
|
|
||||||
if(!hashtable_get(&key_set, key)) {
|
|
||||||
if (!have_unrecognized_keys) {
|
|
||||||
strbuffer_init(&unrecognized_keys);
|
|
||||||
have_unrecognized_keys = 1;
|
|
||||||
} else {
|
|
||||||
strbuffer_append_bytes(&unrecognized_keys, ", ", 2);
|
|
||||||
}
|
|
||||||
strbuffer_append_bytes(&unrecognized_keys, key, strlen(key));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set_error(s, "<validation>",
|
|
||||||
"%li object item(s) left unpacked: %s",
|
|
||||||
unpacked, strbuffer_value(&unrecognized_keys));
|
|
||||||
strbuffer_close(&unrecognized_keys);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = 0;
|
|
||||||
|
|
||||||
out:
|
|
||||||
hashtable_close(&key_set);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int unpack_array(scanner_t *s, json_t *root, va_list *ap)
|
|
||||||
{
|
|
||||||
size_t i = 0;
|
|
||||||
int strict = 0;
|
|
||||||
|
|
||||||
if(root && !json_is_array(root)) {
|
|
||||||
set_error(s, "<validation>", "Expected array, got %s", type_name(root));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
next_token(s);
|
|
||||||
|
|
||||||
while(token(s) != ']') {
|
|
||||||
json_t *value;
|
|
||||||
|
|
||||||
if(strict != 0) {
|
|
||||||
set_error(s, "<format>", "Expected ']' after '%c', got '%c'",
|
|
||||||
(strict == 1 ? '!' : '*'),
|
|
||||||
token(s));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!token(s)) {
|
|
||||||
set_error(s, "<format>", "Unexpected end of format string");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(token(s) == '!' || token(s) == '*') {
|
|
||||||
strict = (token(s) == '!' ? 1 : -1);
|
|
||||||
next_token(s);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!strchr(unpack_value_starters, token(s))) {
|
|
||||||
set_error(s, "<format>", "Unexpected format character '%c'",
|
|
||||||
token(s));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!root) {
|
|
||||||
/* skipping */
|
|
||||||
value = NULL;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
value = json_array_get(root, i);
|
|
||||||
if(!value) {
|
|
||||||
set_error(s, "<validation>", "Array index %lu out of range",
|
|
||||||
(unsigned long)i);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(unpack(s, value, ap))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
next_token(s);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(strict == 0 && (s->flags & JSON_STRICT))
|
|
||||||
strict = 1;
|
|
||||||
|
|
||||||
if(root && strict == 1 && i != json_array_size(root)) {
|
|
||||||
long diff = (long)json_array_size(root) - (long)i;
|
|
||||||
set_error(s, "<validation>", "%li array item(s) left unpacked", diff);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int unpack(scanner_t *s, json_t *root, va_list *ap)
|
|
||||||
{
|
|
||||||
switch(token(s))
|
|
||||||
{
|
|
||||||
case '{':
|
|
||||||
return unpack_object(s, root, ap);
|
|
||||||
|
|
||||||
case '[':
|
|
||||||
return unpack_array(s, root, ap);
|
|
||||||
|
|
||||||
case 's':
|
|
||||||
if(root && !json_is_string(root)) {
|
|
||||||
set_error(s, "<validation>", "Expected string, got %s",
|
|
||||||
type_name(root));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!(s->flags & JSON_VALIDATE_ONLY)) {
|
|
||||||
const char **str_target;
|
|
||||||
size_t *len_target = NULL;
|
|
||||||
|
|
||||||
str_target = va_arg(*ap, const char **);
|
|
||||||
if(!str_target) {
|
|
||||||
set_error(s, "<args>", "NULL string argument");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
next_token(s);
|
|
||||||
|
|
||||||
if(token(s) == '%') {
|
|
||||||
len_target = va_arg(*ap, size_t *);
|
|
||||||
if(!len_target) {
|
|
||||||
set_error(s, "<args>", "NULL string length argument");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
prev_token(s);
|
|
||||||
|
|
||||||
if(root) {
|
|
||||||
*str_target = json_string_value(root);
|
|
||||||
if(len_target)
|
|
||||||
*len_target = json_string_length(root);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case 'i':
|
|
||||||
if(root && !json_is_integer(root)) {
|
|
||||||
set_error(s, "<validation>", "Expected integer, got %s",
|
|
||||||
type_name(root));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!(s->flags & JSON_VALIDATE_ONLY)) {
|
|
||||||
int *target = va_arg(*ap, int*);
|
|
||||||
if(root)
|
|
||||||
*target = (int)json_integer_value(root);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case 'I':
|
|
||||||
if(root && !json_is_integer(root)) {
|
|
||||||
set_error(s, "<validation>", "Expected integer, got %s",
|
|
||||||
type_name(root));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!(s->flags & JSON_VALIDATE_ONLY)) {
|
|
||||||
json_int_t *target = va_arg(*ap, json_int_t*);
|
|
||||||
if(root)
|
|
||||||
*target = json_integer_value(root);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case 'b':
|
|
||||||
if(root && !json_is_boolean(root)) {
|
|
||||||
set_error(s, "<validation>", "Expected true or false, got %s",
|
|
||||||
type_name(root));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!(s->flags & JSON_VALIDATE_ONLY)) {
|
|
||||||
int *target = va_arg(*ap, int*);
|
|
||||||
if(root)
|
|
||||||
*target = json_is_true(root);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case 'f':
|
|
||||||
if(root && !json_is_real(root)) {
|
|
||||||
set_error(s, "<validation>", "Expected real, got %s",
|
|
||||||
type_name(root));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!(s->flags & JSON_VALIDATE_ONLY)) {
|
|
||||||
double *target = va_arg(*ap, double*);
|
|
||||||
if(root)
|
|
||||||
*target = json_real_value(root);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case 'F':
|
|
||||||
if(root && !json_is_number(root)) {
|
|
||||||
set_error(s, "<validation>", "Expected real or integer, got %s",
|
|
||||||
type_name(root));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!(s->flags & JSON_VALIDATE_ONLY)) {
|
|
||||||
double *target = va_arg(*ap, double*);
|
|
||||||
if(root)
|
|
||||||
*target = json_number_value(root);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case 'O':
|
|
||||||
if(root && !(s->flags & JSON_VALIDATE_ONLY))
|
|
||||||
json_incref(root);
|
|
||||||
/* Fall through */
|
|
||||||
|
|
||||||
case 'o':
|
|
||||||
if(!(s->flags & JSON_VALIDATE_ONLY)) {
|
|
||||||
json_t **target = va_arg(*ap, json_t**);
|
|
||||||
if(root)
|
|
||||||
*target = root;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case 'n':
|
|
||||||
/* Never assign, just validate */
|
|
||||||
if(root && !json_is_null(root)) {
|
|
||||||
set_error(s, "<validation>", "Expected null, got %s",
|
|
||||||
type_name(root));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
default:
|
|
||||||
set_error(s, "<format>", "Unexpected format character '%c'",
|
|
||||||
token(s));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
json_t *json_vpack_ex(json_error_t *error, size_t flags,
|
|
||||||
const char *fmt, va_list ap)
|
|
||||||
{
|
|
||||||
scanner_t s;
|
|
||||||
va_list ap_copy;
|
|
||||||
json_t *value;
|
|
||||||
|
|
||||||
if(!fmt || !*fmt) {
|
|
||||||
jsonp_error_init(error, "<format>");
|
|
||||||
jsonp_error_set(error, -1, -1, 0, "NULL or empty format string");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
jsonp_error_init(error, NULL);
|
|
||||||
|
|
||||||
scanner_init(&s, error, flags, fmt);
|
|
||||||
next_token(&s);
|
|
||||||
|
|
||||||
va_copy(ap_copy, ap);
|
|
||||||
value = pack(&s, &ap_copy);
|
|
||||||
va_end(ap_copy);
|
|
||||||
|
|
||||||
if(!value)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
next_token(&s);
|
|
||||||
if(token(&s)) {
|
|
||||||
json_decref(value);
|
|
||||||
set_error(&s, "<format>", "Garbage after format string");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
json_t *json_pack_ex(json_error_t *error, size_t flags, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
json_t *value;
|
|
||||||
va_list ap;
|
|
||||||
|
|
||||||
va_start(ap, fmt);
|
|
||||||
value = json_vpack_ex(error, flags, fmt, ap);
|
|
||||||
va_end(ap);
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
json_t *json_pack(const char *fmt, ...)
|
|
||||||
{
|
|
||||||
json_t *value;
|
|
||||||
va_list ap;
|
|
||||||
|
|
||||||
va_start(ap, fmt);
|
|
||||||
value = json_vpack_ex(NULL, 0, fmt, ap);
|
|
||||||
va_end(ap);
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
int json_vunpack_ex(json_t *root, json_error_t *error, size_t flags,
|
|
||||||
const char *fmt, va_list ap)
|
|
||||||
{
|
|
||||||
scanner_t s;
|
|
||||||
va_list ap_copy;
|
|
||||||
|
|
||||||
if(!root) {
|
|
||||||
jsonp_error_init(error, "<root>");
|
|
||||||
jsonp_error_set(error, -1, -1, 0, "NULL root value");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!fmt || !*fmt) {
|
|
||||||
jsonp_error_init(error, "<format>");
|
|
||||||
jsonp_error_set(error, -1, -1, 0, "NULL or empty format string");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
jsonp_error_init(error, NULL);
|
|
||||||
|
|
||||||
scanner_init(&s, error, flags, fmt);
|
|
||||||
next_token(&s);
|
|
||||||
|
|
||||||
va_copy(ap_copy, ap);
|
|
||||||
if(unpack(&s, root, &ap_copy)) {
|
|
||||||
va_end(ap_copy);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
va_end(ap_copy);
|
|
||||||
|
|
||||||
next_token(&s);
|
|
||||||
if(token(&s)) {
|
|
||||||
set_error(&s, "<format>", "Garbage after format string");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int json_unpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
va_list ap;
|
|
||||||
|
|
||||||
va_start(ap, fmt);
|
|
||||||
ret = json_vunpack_ex(root, error, flags, fmt, ap);
|
|
||||||
va_end(ap);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int json_unpack(json_t *root, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
va_list ap;
|
|
||||||
|
|
||||||
va_start(ap, fmt);
|
|
||||||
ret = json_vunpack_ex(root, NULL, 0, fmt, ap);
|
|
||||||
va_end(ap);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
111
external/Jansson/strbuffer.c
vendored
111
external/Jansson/strbuffer.c
vendored
@ -1,111 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
|
||||||
*
|
|
||||||
* Jansson is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the MIT license. See LICENSE for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _GNU_SOURCE
|
|
||||||
#define _GNU_SOURCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "jansson_private.h"
|
|
||||||
#include "strbuffer.h"
|
|
||||||
|
|
||||||
#define STRBUFFER_MIN_SIZE 16
|
|
||||||
#define STRBUFFER_FACTOR 2
|
|
||||||
#define STRBUFFER_SIZE_MAX ((size_t)-1)
|
|
||||||
|
|
||||||
int strbuffer_init(strbuffer_t *strbuff)
|
|
||||||
{
|
|
||||||
strbuff->size = STRBUFFER_MIN_SIZE;
|
|
||||||
strbuff->length = 0;
|
|
||||||
|
|
||||||
strbuff->value = jsonp_malloc(strbuff->size);
|
|
||||||
if(!strbuff->value)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
/* initialize to empty */
|
|
||||||
strbuff->value[0] = '\0';
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void strbuffer_close(strbuffer_t *strbuff)
|
|
||||||
{
|
|
||||||
if(strbuff->value)
|
|
||||||
jsonp_free(strbuff->value);
|
|
||||||
|
|
||||||
strbuff->size = 0;
|
|
||||||
strbuff->length = 0;
|
|
||||||
strbuff->value = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void strbuffer_clear(strbuffer_t *strbuff)
|
|
||||||
{
|
|
||||||
strbuff->length = 0;
|
|
||||||
strbuff->value[0] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *strbuffer_value(const strbuffer_t *strbuff)
|
|
||||||
{
|
|
||||||
return strbuff->value;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *strbuffer_steal_value(strbuffer_t *strbuff)
|
|
||||||
{
|
|
||||||
char *result = strbuff->value;
|
|
||||||
strbuff->value = NULL;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
int strbuffer_append_byte(strbuffer_t *strbuff, char byte)
|
|
||||||
{
|
|
||||||
return strbuffer_append_bytes(strbuff, &byte, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
int strbuffer_append_bytes(strbuffer_t *strbuff, const char *data, size_t size)
|
|
||||||
{
|
|
||||||
if(size >= strbuff->size - strbuff->length)
|
|
||||||
{
|
|
||||||
size_t new_size;
|
|
||||||
char *new_value;
|
|
||||||
|
|
||||||
/* avoid integer overflow */
|
|
||||||
if (strbuff->size > STRBUFFER_SIZE_MAX / STRBUFFER_FACTOR
|
|
||||||
|| size > STRBUFFER_SIZE_MAX - 1
|
|
||||||
|| strbuff->length > STRBUFFER_SIZE_MAX - 1 - size)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
new_size = max(strbuff->size * STRBUFFER_FACTOR,
|
|
||||||
strbuff->length + size + 1);
|
|
||||||
|
|
||||||
new_value = jsonp_malloc(new_size);
|
|
||||||
if(!new_value)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
memcpy(new_value, strbuff->value, strbuff->length);
|
|
||||||
|
|
||||||
jsonp_free(strbuff->value);
|
|
||||||
strbuff->value = new_value;
|
|
||||||
strbuff->size = new_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(strbuff->value + strbuff->length, data, size);
|
|
||||||
strbuff->length += size;
|
|
||||||
strbuff->value[strbuff->length] = '\0';
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
char strbuffer_pop(strbuffer_t *strbuff)
|
|
||||||
{
|
|
||||||
if(strbuff->length > 0) {
|
|
||||||
char c = strbuff->value[--strbuff->length];
|
|
||||||
strbuff->value[strbuff->length] = '\0';
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return '\0';
|
|
||||||
}
|
|
34
external/Jansson/strbuffer.h
vendored
34
external/Jansson/strbuffer.h
vendored
@ -1,34 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
|
||||||
*
|
|
||||||
* Jansson is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the MIT license. See LICENSE for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef STRBUFFER_H
|
|
||||||
#define STRBUFFER_H
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *value;
|
|
||||||
size_t length; /* bytes used */
|
|
||||||
size_t size; /* bytes allocated */
|
|
||||||
} strbuffer_t;
|
|
||||||
|
|
||||||
int strbuffer_init(strbuffer_t *strbuff);
|
|
||||||
void strbuffer_close(strbuffer_t *strbuff);
|
|
||||||
|
|
||||||
void strbuffer_clear(strbuffer_t *strbuff);
|
|
||||||
|
|
||||||
const char *strbuffer_value(const strbuffer_t *strbuff);
|
|
||||||
|
|
||||||
/* Steal the value and close the strbuffer */
|
|
||||||
char *strbuffer_steal_value(strbuffer_t *strbuff);
|
|
||||||
|
|
||||||
int strbuffer_append_byte(strbuffer_t *strbuff, char byte);
|
|
||||||
int strbuffer_append_bytes(strbuffer_t *strbuff, const char *data, size_t size);
|
|
||||||
|
|
||||||
char strbuffer_pop(strbuffer_t *strbuff);
|
|
||||||
|
|
||||||
#endif
|
|
145
external/Jansson/strconv.c
vendored
145
external/Jansson/strconv.c
vendored
@ -1,145 +0,0 @@
|
|||||||
#include <assert.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <math.h>
|
|
||||||
#ifdef __MINGW32__
|
|
||||||
#undef __NO_ISOCEXT /* ensure stdlib.h will declare prototypes for mingw own 'strtod' replacement, called '__strtod' */
|
|
||||||
#endif
|
|
||||||
#include "jansson_private.h"
|
|
||||||
#include "strbuffer.h"
|
|
||||||
|
|
||||||
/* need jansson_private_config.h to get the correct snprintf */
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <jansson_private_config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
|
||||||
#define strtod __strtod
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if JSON_HAVE_LOCALECONV
|
|
||||||
#include <locale.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
- This code assumes that the decimal separator is exactly one
|
|
||||||
character.
|
|
||||||
|
|
||||||
- If setlocale() is called by another thread between the call to
|
|
||||||
localeconv() and the call to sprintf() or strtod(), the result may
|
|
||||||
be wrong. setlocale() is not thread-safe and should not be used
|
|
||||||
this way. Multi-threaded programs should use uselocale() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void to_locale(strbuffer_t *strbuffer)
|
|
||||||
{
|
|
||||||
const char *point;
|
|
||||||
char *pos;
|
|
||||||
|
|
||||||
point = localeconv()->decimal_point;
|
|
||||||
if(*point == '.') {
|
|
||||||
/* No conversion needed */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
pos = strchr(strbuffer->value, '.');
|
|
||||||
if(pos)
|
|
||||||
*pos = *point;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void from_locale(char *buffer)
|
|
||||||
{
|
|
||||||
const char *point;
|
|
||||||
char *pos;
|
|
||||||
|
|
||||||
point = localeconv()->decimal_point;
|
|
||||||
if(*point == '.') {
|
|
||||||
/* No conversion needed */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
pos = strchr(buffer, *point);
|
|
||||||
if(pos)
|
|
||||||
*pos = '.';
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int jsonp_strtod(strbuffer_t *strbuffer, double *out)
|
|
||||||
{
|
|
||||||
double value;
|
|
||||||
char *end;
|
|
||||||
|
|
||||||
#if JSON_HAVE_LOCALECONV
|
|
||||||
to_locale(strbuffer);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
value = strtod(strbuffer->value, &end);
|
|
||||||
assert(end == strbuffer->value + strbuffer->length);
|
|
||||||
|
|
||||||
if((value == HUGE_VAL || value == -HUGE_VAL) && errno == ERANGE) {
|
|
||||||
/* Overflow */
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
*out = value;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int jsonp_dtostr(char *buffer, size_t size, double value, int precision)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
char *start, *end;
|
|
||||||
size_t length;
|
|
||||||
|
|
||||||
if (precision == 0)
|
|
||||||
precision = 17;
|
|
||||||
|
|
||||||
ret = snprintf(buffer, size, "%.*g", precision, value);
|
|
||||||
if(ret < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
length = (size_t)ret;
|
|
||||||
if(length >= size)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
#if JSON_HAVE_LOCALECONV
|
|
||||||
from_locale(buffer);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Make sure there's a dot or 'e' in the output. Otherwise
|
|
||||||
a real is converted to an integer when decoding */
|
|
||||||
if(strchr(buffer, '.') == NULL &&
|
|
||||||
strchr(buffer, 'e') == NULL)
|
|
||||||
{
|
|
||||||
if(length + 3 >= size) {
|
|
||||||
/* No space to append ".0" */
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
buffer[length] = '.';
|
|
||||||
buffer[length + 1] = '0';
|
|
||||||
buffer[length + 2] = '\0';
|
|
||||||
length += 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Remove leading '+' from positive exponent. Also remove leading
|
|
||||||
zeros from exponents (added by some printf() implementations) */
|
|
||||||
start = strchr(buffer, 'e');
|
|
||||||
if(start) {
|
|
||||||
start++;
|
|
||||||
end = start + 1;
|
|
||||||
|
|
||||||
if(*start == '-')
|
|
||||||
start++;
|
|
||||||
|
|
||||||
while(*end == '0')
|
|
||||||
end++;
|
|
||||||
|
|
||||||
if(end != start) {
|
|
||||||
memmove(start, end, length - (size_t)(end - buffer));
|
|
||||||
length -= (size_t)(end - start);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (int)length;
|
|
||||||
}
|
|
187
external/Jansson/utf.c
vendored
187
external/Jansson/utf.c
vendored
@ -1,187 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
|
||||||
*
|
|
||||||
* Jansson is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the MIT license. See LICENSE for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include "utf.h"
|
|
||||||
|
|
||||||
int utf8_encode(int32_t codepoint, char *buffer, size_t *size)
|
|
||||||
{
|
|
||||||
if(codepoint < 0)
|
|
||||||
return -1;
|
|
||||||
else if(codepoint < 0x80)
|
|
||||||
{
|
|
||||||
buffer[0] = (char)codepoint;
|
|
||||||
*size = 1;
|
|
||||||
}
|
|
||||||
else if(codepoint < 0x800)
|
|
||||||
{
|
|
||||||
buffer[0] = 0xC0 + ((codepoint & 0x7C0) >> 6);
|
|
||||||
buffer[1] = 0x80 + ((codepoint & 0x03F));
|
|
||||||
*size = 2;
|
|
||||||
}
|
|
||||||
else if(codepoint < 0x10000)
|
|
||||||
{
|
|
||||||
buffer[0] = 0xE0 + ((codepoint & 0xF000) >> 12);
|
|
||||||
buffer[1] = 0x80 + ((codepoint & 0x0FC0) >> 6);
|
|
||||||
buffer[2] = 0x80 + ((codepoint & 0x003F));
|
|
||||||
*size = 3;
|
|
||||||
}
|
|
||||||
else if(codepoint <= 0x10FFFF)
|
|
||||||
{
|
|
||||||
buffer[0] = 0xF0 + ((codepoint & 0x1C0000) >> 18);
|
|
||||||
buffer[1] = 0x80 + ((codepoint & 0x03F000) >> 12);
|
|
||||||
buffer[2] = 0x80 + ((codepoint & 0x000FC0) >> 6);
|
|
||||||
buffer[3] = 0x80 + ((codepoint & 0x00003F));
|
|
||||||
*size = 4;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t utf8_check_first(char byte)
|
|
||||||
{
|
|
||||||
unsigned char u = (unsigned char)byte;
|
|
||||||
|
|
||||||
if(u < 0x80)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if(0x80 <= u && u <= 0xBF) {
|
|
||||||
/* second, third or fourth byte of a multi-byte
|
|
||||||
sequence, i.e. a "continuation byte" */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else if(u == 0xC0 || u == 0xC1) {
|
|
||||||
/* overlong encoding of an ASCII byte */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else if(0xC2 <= u && u <= 0xDF) {
|
|
||||||
/* 2-byte sequence */
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(0xE0 <= u && u <= 0xEF) {
|
|
||||||
/* 3-byte sequence */
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
else if(0xF0 <= u && u <= 0xF4) {
|
|
||||||
/* 4-byte sequence */
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
else { /* u >= 0xF5 */
|
|
||||||
/* Restricted (start of 4-, 5- or 6-byte sequence) or invalid
|
|
||||||
UTF-8 */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t utf8_check_full(const char *buffer, size_t size, int32_t *codepoint)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
int32_t value = 0;
|
|
||||||
unsigned char u = (unsigned char)buffer[0];
|
|
||||||
|
|
||||||
if(size == 2)
|
|
||||||
{
|
|
||||||
value = u & 0x1F;
|
|
||||||
}
|
|
||||||
else if(size == 3)
|
|
||||||
{
|
|
||||||
value = u & 0xF;
|
|
||||||
}
|
|
||||||
else if(size == 4)
|
|
||||||
{
|
|
||||||
value = u & 0x7;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
for(i = 1; i < size; i++)
|
|
||||||
{
|
|
||||||
u = (unsigned char)buffer[i];
|
|
||||||
|
|
||||||
if(u < 0x80 || u > 0xBF) {
|
|
||||||
/* not a continuation byte */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
value = (value << 6) + (u & 0x3F);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(value > 0x10FFFF) {
|
|
||||||
/* not in Unicode range */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(0xD800 <= value && value <= 0xDFFF) {
|
|
||||||
/* invalid code point (UTF-16 surrogate halves) */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
else if((size == 2 && value < 0x80) ||
|
|
||||||
(size == 3 && value < 0x800) ||
|
|
||||||
(size == 4 && value < 0x10000)) {
|
|
||||||
/* overlong encoding */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(codepoint)
|
|
||||||
*codepoint = value;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *utf8_iterate(const char *buffer, size_t bufsize, int32_t *codepoint)
|
|
||||||
{
|
|
||||||
size_t count;
|
|
||||||
int32_t value;
|
|
||||||
|
|
||||||
if(!bufsize)
|
|
||||||
return buffer;
|
|
||||||
|
|
||||||
count = utf8_check_first(buffer[0]);
|
|
||||||
if(count <= 0)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if(count == 1)
|
|
||||||
value = (unsigned char)buffer[0];
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(count > bufsize || !utf8_check_full(buffer, count, &value))
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(codepoint)
|
|
||||||
*codepoint = value;
|
|
||||||
|
|
||||||
return buffer + count;
|
|
||||||
}
|
|
||||||
|
|
||||||
int utf8_check_string(const char *string, size_t length)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
for(i = 0; i < length; i++)
|
|
||||||
{
|
|
||||||
size_t count = utf8_check_first(string[i]);
|
|
||||||
if(count == 0)
|
|
||||||
return 0;
|
|
||||||
else if(count > 1)
|
|
||||||
{
|
|
||||||
if(count > length - i)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if(!utf8_check_full(&string[i], count, NULL))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
i += count - 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
27
external/Jansson/utf.h
vendored
27
external/Jansson/utf.h
vendored
@ -1,27 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
|
||||||
*
|
|
||||||
* Jansson is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the MIT license. See LICENSE for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef UTF_H
|
|
||||||
#define UTF_H
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <jansson_private_config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_STDINT_H
|
|
||||||
#include <stdint.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int utf8_encode(int32_t codepoint, char *buffer, size_t *size);
|
|
||||||
|
|
||||||
size_t utf8_check_first(char byte);
|
|
||||||
size_t utf8_check_full(const char *buffer, size_t size, int32_t *codepoint);
|
|
||||||
const char *utf8_iterate(const char *buffer, size_t size, int32_t *codepoint);
|
|
||||||
|
|
||||||
int utf8_check_string(const char *string, size_t length);
|
|
||||||
|
|
||||||
#endif
|
|
1048
external/Jansson/value.c
vendored
1048
external/Jansson/value.c
vendored
File diff suppressed because it is too large
Load Diff
388
external/LibIRC/colors.c
vendored
388
external/LibIRC/colors.c
vendored
@ -1,388 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
#define LIBIRC_COLORPARSER_BOLD (1<<1)
|
|
||||||
#define LIBIRC_COLORPARSER_UNDERLINE (1<<2)
|
|
||||||
#define LIBIRC_COLORPARSER_REVERSE (1<<3)
|
|
||||||
#define LIBIRC_COLORPARSER_COLOR (1<<4)
|
|
||||||
|
|
||||||
#define LIBIRC_COLORPARSER_MAXCOLORS 15
|
|
||||||
|
|
||||||
|
|
||||||
static const char * color_replacement_table[] =
|
|
||||||
{
|
|
||||||
"WHITE",
|
|
||||||
"BLACK",
|
|
||||||
"DARKBLUE",
|
|
||||||
"DARKGREEN",
|
|
||||||
"RED",
|
|
||||||
"BROWN",
|
|
||||||
"PURPLE",
|
|
||||||
"OLIVE",
|
|
||||||
"YELLOW",
|
|
||||||
"GREEN",
|
|
||||||
"TEAL",
|
|
||||||
"CYAN",
|
|
||||||
"BLUE",
|
|
||||||
"MAGENTA",
|
|
||||||
"DARKGRAY",
|
|
||||||
"LIGHTGRAY",
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static inline void libirc_colorparser_addorcat (char ** destline, unsigned int * destlen, const char * str)
|
|
||||||
{
|
|
||||||
unsigned int len = strlen(str);
|
|
||||||
|
|
||||||
if ( *destline )
|
|
||||||
{
|
|
||||||
strcpy (*destline, str);
|
|
||||||
*destline += len;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
*destlen += len;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void libirc_colorparser_applymask (unsigned int * mask,
|
|
||||||
char ** destline, unsigned int * destlen,
|
|
||||||
unsigned int bitmask, const char * start, const char * end)
|
|
||||||
{
|
|
||||||
if ( (*mask & bitmask) != 0 )
|
|
||||||
{
|
|
||||||
*mask &= ~bitmask;
|
|
||||||
libirc_colorparser_addorcat (destline, destlen, end);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
*mask |= bitmask;
|
|
||||||
libirc_colorparser_addorcat (destline, destlen, start);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void libirc_colorparser_applycolor (unsigned int * mask,
|
|
||||||
char ** destline, unsigned int * destlen,
|
|
||||||
unsigned int colorid, unsigned int bgcolorid)
|
|
||||||
{
|
|
||||||
const char * end = "[/COLOR]";
|
|
||||||
char startbuf[64];
|
|
||||||
|
|
||||||
if ( bgcolorid != 0 )
|
|
||||||
sprintf (startbuf, "[COLOR=%s/%s]", color_replacement_table[colorid], color_replacement_table[bgcolorid]);
|
|
||||||
else
|
|
||||||
sprintf (startbuf, "[COLOR=%s]", color_replacement_table[colorid]);
|
|
||||||
|
|
||||||
if ( (*mask & LIBIRC_COLORPARSER_COLOR) != 0 )
|
|
||||||
libirc_colorparser_addorcat (destline, destlen, end);
|
|
||||||
|
|
||||||
*mask |= LIBIRC_COLORPARSER_COLOR;
|
|
||||||
libirc_colorparser_addorcat (destline, destlen, startbuf);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void libirc_colorparser_closetags (unsigned int * mask,
|
|
||||||
char ** destline, unsigned int * destlen)
|
|
||||||
{
|
|
||||||
if ( *mask & LIBIRC_COLORPARSER_BOLD )
|
|
||||||
libirc_colorparser_applymask (mask, destline, destlen, LIBIRC_COLORPARSER_BOLD, 0, "[/B]");
|
|
||||||
|
|
||||||
if ( *mask & LIBIRC_COLORPARSER_UNDERLINE )
|
|
||||||
libirc_colorparser_applymask (mask, destline, destlen, LIBIRC_COLORPARSER_UNDERLINE, 0, "[/U]");
|
|
||||||
|
|
||||||
if ( *mask & LIBIRC_COLORPARSER_REVERSE )
|
|
||||||
libirc_colorparser_applymask (mask, destline, destlen, LIBIRC_COLORPARSER_REVERSE, 0, "[/I]");
|
|
||||||
|
|
||||||
if ( *mask & LIBIRC_COLORPARSER_COLOR )
|
|
||||||
libirc_colorparser_applymask (mask, destline, destlen, LIBIRC_COLORPARSER_COLOR, 0, "[/COLOR]");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* IRC to [code] color conversion. Or strip.
|
|
||||||
*/
|
|
||||||
static char * libirc_colorparser_irc2code (const char * source, int strip)
|
|
||||||
{
|
|
||||||
unsigned int mask = 0, destlen = 0;
|
|
||||||
char * destline = 0, *d = 0;
|
|
||||||
const char *p;
|
|
||||||
int current_bg = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* There will be two passes. First pass calculates the total length of
|
|
||||||
* the destination string. The second pass allocates memory for the string,
|
|
||||||
* and fills it.
|
|
||||||
*/
|
|
||||||
while ( destline == 0 ) // destline will be set after the 2nd pass
|
|
||||||
{
|
|
||||||
if ( destlen > 0 )
|
|
||||||
{
|
|
||||||
// This is the 2nd pass; allocate memory.
|
|
||||||
if ( (destline = malloc (destlen)) == 0 )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
d = destline;
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( p = source; *p; p++ )
|
|
||||||
{
|
|
||||||
switch (*p)
|
|
||||||
{
|
|
||||||
case 0x02: // bold
|
|
||||||
if ( strip )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
libirc_colorparser_applymask (&mask, &d, &destlen, LIBIRC_COLORPARSER_BOLD, "[B]", "[/B]");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x1F: // underline
|
|
||||||
if ( strip )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
libirc_colorparser_applymask (&mask, &d, &destlen, LIBIRC_COLORPARSER_UNDERLINE, "[U]", "[/U]");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x16: // reverse
|
|
||||||
if ( strip )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
libirc_colorparser_applymask (&mask, &d, &destlen, LIBIRC_COLORPARSER_REVERSE, "[I]", "[/I]");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x0F: // reset colors
|
|
||||||
if ( strip )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
libirc_colorparser_closetags (&mask, &d, &destlen);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x03: // set color
|
|
||||||
if ( isdigit (p[1]) )
|
|
||||||
{
|
|
||||||
// Parse
|
|
||||||
int bgcolor = -1, color = p[1] - 0x30;
|
|
||||||
p++;
|
|
||||||
|
|
||||||
if ( isdigit (p[1]) )
|
|
||||||
{
|
|
||||||
color = color * 10 + (p[1] - 0x30);
|
|
||||||
p++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If there is a comma, search for the following
|
|
||||||
// background color
|
|
||||||
if ( p[1] == ',' && isdigit (p[2]) )
|
|
||||||
{
|
|
||||||
bgcolor = p[2] - 0x30;
|
|
||||||
p += 2;
|
|
||||||
|
|
||||||
if ( isdigit (p[1]) )
|
|
||||||
{
|
|
||||||
bgcolor = bgcolor * 10 + (p[1] - 0x30);
|
|
||||||
p++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for range
|
|
||||||
if ( color <= LIBIRC_COLORPARSER_MAXCOLORS
|
|
||||||
&& bgcolor <= LIBIRC_COLORPARSER_MAXCOLORS )
|
|
||||||
{
|
|
||||||
if ( strip )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ( bgcolor != -1 )
|
|
||||||
current_bg = bgcolor;
|
|
||||||
|
|
||||||
libirc_colorparser_applycolor (&mask, &d, &destlen, color, current_bg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
if ( destline )
|
|
||||||
*d++ = *p;
|
|
||||||
else
|
|
||||||
destlen++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Close all the opened tags
|
|
||||||
libirc_colorparser_closetags (&mask, &d, &destlen);
|
|
||||||
destlen++; // for 0-terminator
|
|
||||||
}
|
|
||||||
|
|
||||||
*d = '\0';
|
|
||||||
return destline;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int libirc_colorparser_colorlookup (const char * color)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
for ( i = 0; color_replacement_table[i]; i++ )
|
|
||||||
if ( !strcmp (color, color_replacement_table[i]) )
|
|
||||||
return i;
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* [code] to IRC color conversion.
|
|
||||||
*/
|
|
||||||
char * irc_color_convert_to_mirc (const char * source, void * (*memory_allocator)(size_t))
|
|
||||||
{
|
|
||||||
unsigned int destlen = 0;
|
|
||||||
char * destline = 0, *d = 0;
|
|
||||||
const char *p1, *p2, *cur;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* There will be two passes. First pass calculates the total length of
|
|
||||||
* the destination string. The second pass allocates memory for the string,
|
|
||||||
* and fills it.
|
|
||||||
*/
|
|
||||||
while ( destline == 0 ) // destline will be set after the 2nd pass
|
|
||||||
{
|
|
||||||
if ( destlen > 0 )
|
|
||||||
{
|
|
||||||
// This is the 2nd pass; allocate memory.
|
|
||||||
if ( (destline = memory_allocator (destlen)) == 0 )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
d = destline;
|
|
||||||
}
|
|
||||||
|
|
||||||
cur = source;
|
|
||||||
while ( (p1 = strchr (cur, '[')) != 0 )
|
|
||||||
{
|
|
||||||
const char * replacedval = 0;
|
|
||||||
p2 = 0;
|
|
||||||
|
|
||||||
// Check if the closing bracket is available after p1
|
|
||||||
// and the tag length is suitable
|
|
||||||
if ( p1[1] != '\0'
|
|
||||||
&& (p2 = strchr (p1, ']')) != 0
|
|
||||||
&& (p2 - p1) > 1
|
|
||||||
&& (p2 - p1) < 31 )
|
|
||||||
{
|
|
||||||
// Get the tag
|
|
||||||
char tagbuf[32];
|
|
||||||
int taglen = p2 - p1 - 1;
|
|
||||||
|
|
||||||
memcpy (tagbuf, p1 + 1, taglen);
|
|
||||||
tagbuf[taglen] = '\0';
|
|
||||||
|
|
||||||
if ( !strcmp (tagbuf, "/COLOR") )
|
|
||||||
replacedval = "\x0F";
|
|
||||||
else if ( strstr (tagbuf, "COLOR=") == tagbuf )
|
|
||||||
{
|
|
||||||
int color, bgcolor = -2;
|
|
||||||
char * bcol;
|
|
||||||
|
|
||||||
bcol = strchr (tagbuf + 6, '/');
|
|
||||||
|
|
||||||
if ( bcol )
|
|
||||||
{
|
|
||||||
*bcol++ = '\0';
|
|
||||||
bgcolor = libirc_colorparser_colorlookup (bcol);
|
|
||||||
}
|
|
||||||
|
|
||||||
color = libirc_colorparser_colorlookup (tagbuf + 6);
|
|
||||||
|
|
||||||
if ( color != -1 && bgcolor == -2 )
|
|
||||||
{
|
|
||||||
sprintf (tagbuf, "\x03%02d", color);
|
|
||||||
replacedval = tagbuf;
|
|
||||||
}
|
|
||||||
else if ( color != -1 && bgcolor >= 0 )
|
|
||||||
{
|
|
||||||
sprintf (tagbuf, "\x03%02d,%02d", color, bgcolor);
|
|
||||||
replacedval = tagbuf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ( !strcmp (tagbuf, "B") || !strcmp (tagbuf, "/B") )
|
|
||||||
replacedval = "\x02";
|
|
||||||
else if ( !strcmp (tagbuf, "U") || !strcmp (tagbuf, "/U") )
|
|
||||||
replacedval = "\x1F";
|
|
||||||
else if ( !strcmp (tagbuf, "I") || !strcmp (tagbuf, "/I") )
|
|
||||||
replacedval = "\x16";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( replacedval )
|
|
||||||
{
|
|
||||||
// add a part before the tag
|
|
||||||
int partlen = p1 - cur;
|
|
||||||
|
|
||||||
if ( destline )
|
|
||||||
{
|
|
||||||
memcpy (d, cur, partlen);
|
|
||||||
d += partlen;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
destlen += partlen;
|
|
||||||
|
|
||||||
// Add the replacement
|
|
||||||
libirc_colorparser_addorcat (&d, &destlen, replacedval);
|
|
||||||
|
|
||||||
// And move the pointer
|
|
||||||
cur = p2 + 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// add a whole part before the end tag
|
|
||||||
int partlen;
|
|
||||||
|
|
||||||
if ( !p2 )
|
|
||||||
p2 = cur + strlen(cur);
|
|
||||||
|
|
||||||
partlen = p2 - cur + 1;
|
|
||||||
|
|
||||||
if ( destline )
|
|
||||||
{
|
|
||||||
memcpy (d, cur, partlen);
|
|
||||||
d += partlen;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
destlen += partlen;
|
|
||||||
|
|
||||||
// And move the pointer
|
|
||||||
cur = p2 + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the rest of string
|
|
||||||
libirc_colorparser_addorcat (&d, &destlen, cur);
|
|
||||||
destlen++; // for 0-terminator
|
|
||||||
}
|
|
||||||
|
|
||||||
*d = '\0';
|
|
||||||
return destline;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char * irc_color_strip_from_mirc (const char * message)
|
|
||||||
{
|
|
||||||
return libirc_colorparser_irc2code (message, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char * irc_color_convert_from_mirc (const char * message)
|
|
||||||
{
|
|
||||||
return libirc_colorparser_irc2code (message, 0);
|
|
||||||
}
|
|
892
external/LibIRC/dcc.c
vendored
892
external/LibIRC/dcc.c
vendored
@ -1,892 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define LIBIRC_DCC_CHAT 1
|
|
||||||
#define LIBIRC_DCC_SENDFILE 2
|
|
||||||
#define LIBIRC_DCC_RECVFILE 3
|
|
||||||
|
|
||||||
|
|
||||||
static irc_dcc_session_t * libirc_find_dcc_session (irc_session_t * session, irc_dcc_t dccid, int lock_list)
|
|
||||||
{
|
|
||||||
irc_dcc_session_t * s, *found = 0;
|
|
||||||
|
|
||||||
if ( lock_list )
|
|
||||||
libirc_mutex_lock (&session->mutex_dcc);
|
|
||||||
|
|
||||||
for ( s = session->dcc_sessions; s; s = s->next )
|
|
||||||
{
|
|
||||||
if ( s->id == dccid )
|
|
||||||
{
|
|
||||||
found = s;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( found == 0 && lock_list )
|
|
||||||
libirc_mutex_unlock (&session->mutex_dcc);
|
|
||||||
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void libirc_dcc_destroy_nolock (irc_session_t * session, irc_dcc_t dccid)
|
|
||||||
{
|
|
||||||
irc_dcc_session_t * dcc = libirc_find_dcc_session (session, dccid, 0);
|
|
||||||
|
|
||||||
if ( dcc )
|
|
||||||
{
|
|
||||||
if ( dcc->sock >= 0 )
|
|
||||||
socket_close (&dcc->sock);
|
|
||||||
|
|
||||||
dcc->state = LIBIRC_STATE_REMOVED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void libirc_remove_dcc_session (irc_session_t * session, irc_dcc_session_t * dcc, int lock_list)
|
|
||||||
{
|
|
||||||
if ( dcc->sock >= 0 )
|
|
||||||
socket_close (&dcc->sock);
|
|
||||||
|
|
||||||
if ( dcc->dccsend_file_fp )
|
|
||||||
fclose (dcc->dccsend_file_fp);
|
|
||||||
|
|
||||||
dcc->dccsend_file_fp = 0;
|
|
||||||
|
|
||||||
libirc_mutex_destroy (&dcc->mutex_outbuf);
|
|
||||||
|
|
||||||
if ( lock_list )
|
|
||||||
libirc_mutex_lock (&session->mutex_dcc);
|
|
||||||
|
|
||||||
if ( session->dcc_sessions != dcc )
|
|
||||||
{
|
|
||||||
irc_dcc_session_t * s;
|
|
||||||
for ( s = session->dcc_sessions; s; s = s->next )
|
|
||||||
{
|
|
||||||
if ( s->next == dcc )
|
|
||||||
{
|
|
||||||
s->next = dcc->next;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
session->dcc_sessions = dcc->next;
|
|
||||||
|
|
||||||
if ( lock_list )
|
|
||||||
libirc_mutex_unlock (&session->mutex_dcc);
|
|
||||||
|
|
||||||
free (dcc);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void libirc_dcc_add_descriptors (irc_session_t * ircsession, fd_set *in_set, fd_set *out_set, int * maxfd)
|
|
||||||
{
|
|
||||||
irc_dcc_session_t * dcc, *dcc_next;
|
|
||||||
time_t now = time (0);
|
|
||||||
|
|
||||||
libirc_mutex_lock (&ircsession->mutex_dcc);
|
|
||||||
|
|
||||||
// Preprocessing DCC list:
|
|
||||||
// - ask DCC send callbacks for data;
|
|
||||||
// - remove unused DCC structures
|
|
||||||
for ( dcc = ircsession->dcc_sessions; dcc; dcc = dcc_next )
|
|
||||||
{
|
|
||||||
dcc_next = dcc->next;
|
|
||||||
|
|
||||||
// Remove timed-out sessions
|
|
||||||
if ( (dcc->state == LIBIRC_STATE_CONNECTING
|
|
||||||
|| dcc->state == LIBIRC_STATE_INIT
|
|
||||||
|| dcc->state == LIBIRC_STATE_LISTENING)
|
|
||||||
&& now - dcc->timeout > ircsession->dcc_timeout )
|
|
||||||
{
|
|
||||||
// Inform the caller about DCC timeout.
|
|
||||||
// Do not inform when state is LIBIRC_STATE_INIT - session
|
|
||||||
// was initiated from someone else, and callbacks aren't set yet.
|
|
||||||
if ( dcc->state != LIBIRC_STATE_INIT )
|
|
||||||
{
|
|
||||||
libirc_mutex_unlock (&ircsession->mutex_dcc);
|
|
||||||
|
|
||||||
if ( dcc->cb )
|
|
||||||
(*dcc->cb)(ircsession, dcc->id, LIBIRC_ERR_TIMEOUT, dcc->ctx, 0, 0);
|
|
||||||
|
|
||||||
libirc_mutex_lock (&ircsession->mutex_dcc);
|
|
||||||
}
|
|
||||||
|
|
||||||
libirc_remove_dcc_session (ircsession, dcc, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If we're sending file, and the output buffer is empty, we need
|
|
||||||
* to provide some data.
|
|
||||||
*/
|
|
||||||
if ( dcc->state == LIBIRC_STATE_CONNECTED
|
|
||||||
&& dcc->dccmode == LIBIRC_DCC_SENDFILE
|
|
||||||
&& dcc->dccsend_file_fp
|
|
||||||
&& dcc->outgoing_offset == 0 )
|
|
||||||
{
|
|
||||||
int len = fread (dcc->outgoing_buf, 1, sizeof (dcc->outgoing_buf), dcc->dccsend_file_fp);
|
|
||||||
|
|
||||||
if ( len <= 0 )
|
|
||||||
{
|
|
||||||
int err = (len < 0 ? LIBIRC_ERR_READ : 0);
|
|
||||||
|
|
||||||
libirc_mutex_unlock (&ircsession->mutex_dcc);
|
|
||||||
|
|
||||||
(*dcc->cb)(ircsession, dcc->id, err, dcc->ctx, 0, 0);
|
|
||||||
libirc_mutex_lock (&ircsession->mutex_dcc);
|
|
||||||
libirc_dcc_destroy_nolock (ircsession, dcc->id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
dcc->outgoing_offset = len;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clean up unused sessions
|
|
||||||
if ( dcc->state == LIBIRC_STATE_REMOVED )
|
|
||||||
libirc_remove_dcc_session (ircsession, dcc, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( dcc = ircsession->dcc_sessions; dcc; dcc = dcc->next )
|
|
||||||
{
|
|
||||||
switch (dcc->state)
|
|
||||||
{
|
|
||||||
case LIBIRC_STATE_LISTENING:
|
|
||||||
// While listening, only in_set descriptor should be set
|
|
||||||
libirc_add_to_set (dcc->sock, in_set, maxfd);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LIBIRC_STATE_CONNECTING:
|
|
||||||
// While connection, only out_set descriptor should be set
|
|
||||||
libirc_add_to_set (dcc->sock, out_set, maxfd);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LIBIRC_STATE_CONNECTED:
|
|
||||||
// Add input descriptor if there is space in input buffer
|
|
||||||
// and it is DCC chat (during DCC send, there is nothing to recv)
|
|
||||||
if ( dcc->incoming_offset < sizeof(dcc->incoming_buf) - 1 )
|
|
||||||
libirc_add_to_set (dcc->sock, in_set, maxfd);
|
|
||||||
|
|
||||||
// Add output descriptor if there is something in output buffer
|
|
||||||
libirc_mutex_lock (&dcc->mutex_outbuf);
|
|
||||||
|
|
||||||
if ( dcc->outgoing_offset > 0 )
|
|
||||||
libirc_add_to_set (dcc->sock, out_set, maxfd);
|
|
||||||
|
|
||||||
libirc_mutex_unlock (&dcc->mutex_outbuf);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LIBIRC_STATE_CONFIRM_SIZE:
|
|
||||||
/*
|
|
||||||
* If we're receiving file, then WE should confirm the transferred
|
|
||||||
* part (so we have to sent data). But if we're sending the file,
|
|
||||||
* then RECEIVER should confirm the packet, so we have to receive
|
|
||||||
* data.
|
|
||||||
*
|
|
||||||
* We don't need to LOCK_DCC_OUTBUF - during file transfer, buffers
|
|
||||||
* can't change asynchronously.
|
|
||||||
*/
|
|
||||||
if ( dcc->dccmode == LIBIRC_DCC_RECVFILE && dcc->outgoing_offset > 0 )
|
|
||||||
libirc_add_to_set (dcc->sock, out_set, maxfd);
|
|
||||||
|
|
||||||
if ( dcc->dccmode == LIBIRC_DCC_SENDFILE && dcc->incoming_offset < 4 )
|
|
||||||
libirc_add_to_set (dcc->sock, in_set, maxfd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
libirc_mutex_unlock (&ircsession->mutex_dcc);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void libirc_dcc_process_descriptors (irc_session_t * ircsession, fd_set *in_set, fd_set *out_set)
|
|
||||||
{
|
|
||||||
irc_dcc_session_t * dcc;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* We need to use such a complex scheme here, because on every callback
|
|
||||||
* a number of DCC sessions could be destroyed.
|
|
||||||
*/
|
|
||||||
libirc_mutex_lock (&ircsession->mutex_dcc);
|
|
||||||
|
|
||||||
for ( dcc = ircsession->dcc_sessions; dcc; dcc = dcc->next )
|
|
||||||
{
|
|
||||||
if ( dcc->state == LIBIRC_STATE_LISTENING
|
|
||||||
&& FD_ISSET (dcc->sock, in_set) )
|
|
||||||
{
|
|
||||||
socklen_t len = sizeof(dcc->remote_addr);
|
|
||||||
int nsock, err = 0;
|
|
||||||
|
|
||||||
// New connection is available; accept it.
|
|
||||||
if ( socket_accept (&dcc->sock, (socket_t*)&nsock, (struct sockaddr *) &dcc->remote_addr, &len) )
|
|
||||||
err = LIBIRC_ERR_ACCEPT;
|
|
||||||
|
|
||||||
// On success, change the active socket and change the state
|
|
||||||
if ( err == 0 )
|
|
||||||
{
|
|
||||||
// close the listen socket, and replace it by a newly
|
|
||||||
// accepted
|
|
||||||
socket_close (&dcc->sock);
|
|
||||||
dcc->sock = nsock;
|
|
||||||
dcc->state = LIBIRC_STATE_CONNECTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If this is DCC chat, inform the caller about accept()
|
|
||||||
// success or failure.
|
|
||||||
// Otherwise (DCC send) there is no reason.
|
|
||||||
if ( dcc->dccmode == LIBIRC_DCC_CHAT )
|
|
||||||
{
|
|
||||||
libirc_mutex_unlock (&ircsession->mutex_dcc);
|
|
||||||
(*dcc->cb)(ircsession, dcc->id, err, dcc->ctx, 0, 0);
|
|
||||||
libirc_mutex_lock (&ircsession->mutex_dcc);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( err )
|
|
||||||
libirc_dcc_destroy_nolock (ircsession, dcc->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( dcc->state == LIBIRC_STATE_CONNECTING
|
|
||||||
&& FD_ISSET (dcc->sock, out_set) )
|
|
||||||
{
|
|
||||||
// Now we have to determine whether the socket is connected
|
|
||||||
// or the connect is failed
|
|
||||||
struct sockaddr_in saddr;
|
|
||||||
socklen_t slen = sizeof(saddr);
|
|
||||||
int err = 0;
|
|
||||||
|
|
||||||
if ( getpeername (dcc->sock, (struct sockaddr*)&saddr, &slen) < 0 )
|
|
||||||
err = LIBIRC_ERR_CONNECT;
|
|
||||||
|
|
||||||
// On success, change the state
|
|
||||||
if ( err == 0 )
|
|
||||||
dcc->state = LIBIRC_STATE_CONNECTED;
|
|
||||||
|
|
||||||
// If this is DCC chat, inform the caller about connect()
|
|
||||||
// success or failure.
|
|
||||||
// Otherwise (DCC send) there is no reason.
|
|
||||||
if ( dcc->dccmode == LIBIRC_DCC_CHAT )
|
|
||||||
{
|
|
||||||
libirc_mutex_unlock (&ircsession->mutex_dcc);
|
|
||||||
(*dcc->cb)(ircsession, dcc->id, err, dcc->ctx, 0, 0);
|
|
||||||
libirc_mutex_lock (&ircsession->mutex_dcc);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( err )
|
|
||||||
libirc_dcc_destroy_nolock (ircsession, dcc->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( dcc->state == LIBIRC_STATE_CONNECTED
|
|
||||||
|| dcc->state == LIBIRC_STATE_CONFIRM_SIZE )
|
|
||||||
{
|
|
||||||
if ( FD_ISSET (dcc->sock, in_set) )
|
|
||||||
{
|
|
||||||
int length, offset = 0, err = 0;
|
|
||||||
|
|
||||||
unsigned int amount = sizeof (dcc->incoming_buf) - dcc->incoming_offset;
|
|
||||||
|
|
||||||
length = socket_recv (&dcc->sock, dcc->incoming_buf + dcc->incoming_offset, amount);
|
|
||||||
|
|
||||||
if ( length < 0 )
|
|
||||||
{
|
|
||||||
err = LIBIRC_ERR_READ;
|
|
||||||
}
|
|
||||||
else if ( length == 0 )
|
|
||||||
{
|
|
||||||
err = LIBIRC_ERR_CLOSED;
|
|
||||||
|
|
||||||
if ( dcc->dccsend_file_fp )
|
|
||||||
{
|
|
||||||
fclose (dcc->dccsend_file_fp);
|
|
||||||
dcc->dccsend_file_fp = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dcc->incoming_offset += length;
|
|
||||||
|
|
||||||
if ( dcc->dccmode != LIBIRC_DCC_CHAT )
|
|
||||||
offset = dcc->incoming_offset;
|
|
||||||
else
|
|
||||||
offset = libirc_findcrorlf (dcc->incoming_buf, dcc->incoming_offset);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* In LIBIRC_STATE_CONFIRM_SIZE state we don't call any
|
|
||||||
* callbacks (except there is an error). We just receive
|
|
||||||
* the data, and compare it with the amount sent.
|
|
||||||
*/
|
|
||||||
if ( dcc->state == LIBIRC_STATE_CONFIRM_SIZE )
|
|
||||||
{
|
|
||||||
if ( dcc->dccmode != LIBIRC_DCC_SENDFILE )
|
|
||||||
abort();
|
|
||||||
|
|
||||||
if ( dcc->incoming_offset == 4 )
|
|
||||||
{
|
|
||||||
// The order is big-endian
|
|
||||||
const unsigned char * bptr = (const unsigned char *) dcc->incoming_buf;
|
|
||||||
unsigned int received_size = (bptr[0] << 24) | (bptr[1] << 16) | (bptr[2] << 8) | bptr[3];
|
|
||||||
|
|
||||||
// Sent size confirmed
|
|
||||||
if ( dcc->file_confirm_offset == received_size )
|
|
||||||
{
|
|
||||||
dcc->state = LIBIRC_STATE_CONNECTED;
|
|
||||||
dcc->incoming_offset = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
err = LIBIRC_ERR_WRITE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* If it is DCC_CHAT, we send a 0-terminated string
|
|
||||||
* (which is smaller than offset). Otherwise we send
|
|
||||||
* a full buffer.
|
|
||||||
*/
|
|
||||||
libirc_mutex_unlock (&ircsession->mutex_dcc);
|
|
||||||
|
|
||||||
if ( dcc->dccmode != LIBIRC_DCC_CHAT )
|
|
||||||
{
|
|
||||||
if ( dcc->dccmode != LIBIRC_DCC_RECVFILE )
|
|
||||||
abort();
|
|
||||||
|
|
||||||
(*dcc->cb)(ircsession, dcc->id, err, dcc->ctx, dcc->incoming_buf, offset);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If the session is not terminated in callback,
|
|
||||||
* put the sent amount into the sent_packet_size_net_byteorder
|
|
||||||
*/
|
|
||||||
if ( dcc->state != LIBIRC_STATE_REMOVED )
|
|
||||||
{
|
|
||||||
dcc->state = LIBIRC_STATE_CONFIRM_SIZE;
|
|
||||||
dcc->file_confirm_offset += offset;
|
|
||||||
|
|
||||||
// Store as big endian
|
|
||||||
dcc->outgoing_buf[0] = (char) dcc->file_confirm_offset >> 24;
|
|
||||||
dcc->outgoing_buf[1] = (char) dcc->file_confirm_offset >> 16;
|
|
||||||
dcc->outgoing_buf[2] = (char) dcc->file_confirm_offset >> 8;
|
|
||||||
dcc->outgoing_buf[3] = (char) dcc->file_confirm_offset;
|
|
||||||
dcc->outgoing_offset = 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
(*dcc->cb)(ircsession, dcc->id, err, dcc->ctx, dcc->incoming_buf, strlen(dcc->incoming_buf));
|
|
||||||
|
|
||||||
libirc_mutex_lock (&ircsession->mutex_dcc);
|
|
||||||
|
|
||||||
if ( dcc->incoming_offset - offset > 0 )
|
|
||||||
memmove (dcc->incoming_buf, dcc->incoming_buf + offset, dcc->incoming_offset - offset);
|
|
||||||
|
|
||||||
dcc->incoming_offset -= offset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If error arises somewhere above, we inform the caller
|
|
||||||
* of failure, and destroy this session.
|
|
||||||
*/
|
|
||||||
if ( err )
|
|
||||||
{
|
|
||||||
libirc_mutex_unlock (&ircsession->mutex_dcc);
|
|
||||||
(*dcc->cb)(ircsession, dcc->id, err, dcc->ctx, 0, 0);
|
|
||||||
libirc_mutex_lock (&ircsession->mutex_dcc);
|
|
||||||
libirc_dcc_destroy_nolock (ircsession, dcc->id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Session might be closed (with sock = -1) after the in_set
|
|
||||||
* processing, so before out_set processing we should check
|
|
||||||
* for this case
|
|
||||||
*/
|
|
||||||
if ( dcc->state == LIBIRC_STATE_REMOVED )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Write bit set - we can send() something, and it won't block.
|
|
||||||
*/
|
|
||||||
if ( FD_ISSET (dcc->sock, out_set) )
|
|
||||||
{
|
|
||||||
int length, offset, err = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Because in some cases outgoing_buf could be changed
|
|
||||||
* asynchronously (by another thread), we should lock
|
|
||||||
* it.
|
|
||||||
*/
|
|
||||||
libirc_mutex_lock (&dcc->mutex_outbuf);
|
|
||||||
|
|
||||||
offset = dcc->outgoing_offset;
|
|
||||||
|
|
||||||
if ( offset > 0 )
|
|
||||||
{
|
|
||||||
length = socket_send (&dcc->sock, dcc->outgoing_buf, offset);
|
|
||||||
|
|
||||||
if ( length < 0 )
|
|
||||||
err = LIBIRC_ERR_WRITE;
|
|
||||||
else if ( length == 0 )
|
|
||||||
err = LIBIRC_ERR_CLOSED;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* If this was DCC_SENDFILE, and we just sent a packet,
|
|
||||||
* change the state to wait for confirmation (and store
|
|
||||||
* sent packet size)
|
|
||||||
*/
|
|
||||||
if ( dcc->state == LIBIRC_STATE_CONNECTED
|
|
||||||
&& dcc->dccmode == LIBIRC_DCC_SENDFILE )
|
|
||||||
{
|
|
||||||
dcc->file_confirm_offset += offset;
|
|
||||||
dcc->state = LIBIRC_STATE_CONFIRM_SIZE;
|
|
||||||
|
|
||||||
libirc_mutex_unlock (&ircsession->mutex_dcc);
|
|
||||||
libirc_mutex_unlock (&dcc->mutex_outbuf);
|
|
||||||
(*dcc->cb)(ircsession, dcc->id, err, dcc->ctx, 0, offset);
|
|
||||||
libirc_mutex_lock (&ircsession->mutex_dcc);
|
|
||||||
libirc_mutex_lock (&dcc->mutex_outbuf);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( dcc->outgoing_offset - length > 0 )
|
|
||||||
memmove (dcc->outgoing_buf, dcc->outgoing_buf + length, dcc->outgoing_offset - length);
|
|
||||||
|
|
||||||
dcc->outgoing_offset -= length;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If we just sent the confirmation data, change state
|
|
||||||
* back.
|
|
||||||
*/
|
|
||||||
if ( dcc->state == LIBIRC_STATE_CONFIRM_SIZE
|
|
||||||
&& dcc->dccmode == LIBIRC_DCC_RECVFILE
|
|
||||||
&& dcc->outgoing_offset == 0 )
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* If the file is already received, we should inform
|
|
||||||
* the caller, and close the session.
|
|
||||||
*/
|
|
||||||
if ( dcc->received_file_size == dcc->file_confirm_offset )
|
|
||||||
{
|
|
||||||
libirc_mutex_unlock (&ircsession->mutex_dcc);
|
|
||||||
libirc_mutex_unlock (&dcc->mutex_outbuf);
|
|
||||||
(*dcc->cb)(ircsession, dcc->id, 0, dcc->ctx, 0, 0);
|
|
||||||
libirc_dcc_destroy_nolock (ircsession, dcc->id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Continue to receive the file */
|
|
||||||
dcc->state = LIBIRC_STATE_CONNECTED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
libirc_mutex_unlock (&dcc->mutex_outbuf);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If error arises somewhere above, we inform the caller
|
|
||||||
* of failure, and destroy this session.
|
|
||||||
*/
|
|
||||||
if ( err )
|
|
||||||
{
|
|
||||||
libirc_mutex_unlock (&ircsession->mutex_dcc);
|
|
||||||
(*dcc->cb)(ircsession, dcc->id, err, dcc->ctx, 0, 0);
|
|
||||||
libirc_mutex_lock (&ircsession->mutex_dcc);
|
|
||||||
|
|
||||||
libirc_dcc_destroy_nolock (ircsession, dcc->id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
libirc_mutex_unlock (&ircsession->mutex_dcc);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int libirc_new_dcc_session (irc_session_t * session, unsigned long ip, unsigned short port, int dccmode, void * ctx, irc_dcc_session_t ** pdcc)
|
|
||||||
{
|
|
||||||
irc_dcc_session_t * dcc = malloc (sizeof(irc_dcc_session_t));
|
|
||||||
|
|
||||||
if ( !dcc )
|
|
||||||
return LIBIRC_ERR_NOMEM;
|
|
||||||
|
|
||||||
// setup
|
|
||||||
memset (dcc, 0, sizeof(irc_dcc_session_t));
|
|
||||||
|
|
||||||
dcc->dccsend_file_fp = 0;
|
|
||||||
|
|
||||||
if ( libirc_mutex_init (&dcc->mutex_outbuf) )
|
|
||||||
goto cleanup_exit_error;
|
|
||||||
|
|
||||||
if ( socket_create (PF_INET, SOCK_STREAM, &dcc->sock) )
|
|
||||||
goto cleanup_exit_error;
|
|
||||||
|
|
||||||
if ( !ip )
|
|
||||||
{
|
|
||||||
unsigned long arg = 1;
|
|
||||||
|
|
||||||
setsockopt (dcc->sock, SOL_SOCKET, SO_REUSEADDR, (char*)&arg, sizeof(arg));
|
|
||||||
|
|
||||||
#if defined (ENABLE_IPV6)
|
|
||||||
if ( session->flags & SESSIONFL_USES_IPV6 )
|
|
||||||
{
|
|
||||||
struct sockaddr_in6 saddr6;
|
|
||||||
|
|
||||||
memset (&saddr6, 0, sizeof(saddr6));
|
|
||||||
saddr6.sin6_family = AF_INET6;
|
|
||||||
memcpy (&saddr6.sin6_addr, &session->local_addr6, sizeof(session->local_addr6));
|
|
||||||
saddr6.sin6_port = htons (0);
|
|
||||||
|
|
||||||
if ( bind (dcc->sock, (struct sockaddr *) &saddr6, sizeof(saddr6)) < 0 )
|
|
||||||
goto cleanup_exit_error;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
struct sockaddr_in saddr;
|
|
||||||
memset (&saddr, 0, sizeof(saddr));
|
|
||||||
saddr.sin_family = AF_INET;
|
|
||||||
memcpy (&saddr.sin_addr, &session->local_addr, sizeof(session->local_addr));
|
|
||||||
saddr.sin_port = htons (0);
|
|
||||||
|
|
||||||
if ( bind (dcc->sock, (struct sockaddr *) &saddr, sizeof(saddr)) < 0 )
|
|
||||||
goto cleanup_exit_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( listen (dcc->sock, 5) < 0 )
|
|
||||||
goto cleanup_exit_error;
|
|
||||||
|
|
||||||
dcc->state = LIBIRC_STATE_LISTENING;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// make socket non-blocking, so connect() call won't block
|
|
||||||
if ( socket_make_nonblocking (&dcc->sock) )
|
|
||||||
goto cleanup_exit_error;
|
|
||||||
|
|
||||||
memset (&dcc->remote_addr, 0, sizeof(dcc->remote_addr));
|
|
||||||
dcc->remote_addr.sin_family = AF_INET;
|
|
||||||
dcc->remote_addr.sin_addr.s_addr = htonl (ip); // what idiot came up with idea to send IP address in host-byteorder?
|
|
||||||
dcc->remote_addr.sin_port = htons(port);
|
|
||||||
|
|
||||||
dcc->state = LIBIRC_STATE_INIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
dcc->dccmode = dccmode;
|
|
||||||
dcc->ctx = ctx;
|
|
||||||
time (&dcc->timeout);
|
|
||||||
|
|
||||||
// and store it
|
|
||||||
libirc_mutex_lock (&session->mutex_dcc);
|
|
||||||
|
|
||||||
dcc->id = session->dcc_last_id++;
|
|
||||||
dcc->next = session->dcc_sessions;
|
|
||||||
session->dcc_sessions = dcc;
|
|
||||||
|
|
||||||
libirc_mutex_unlock (&session->mutex_dcc);
|
|
||||||
|
|
||||||
*pdcc = dcc;
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
cleanup_exit_error:
|
|
||||||
if ( dcc->sock >= 0 )
|
|
||||||
socket_close (&dcc->sock);
|
|
||||||
|
|
||||||
free (dcc);
|
|
||||||
return LIBIRC_ERR_SOCKET;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int irc_dcc_destroy (irc_session_t * session, irc_dcc_t dccid)
|
|
||||||
{
|
|
||||||
// This function doesn't actually destroy the session; it just changes
|
|
||||||
// its state to "removed" and closes the socket. The memory is actually
|
|
||||||
// freed after the processing loop.
|
|
||||||
irc_dcc_session_t * dcc = libirc_find_dcc_session (session, dccid, 1);
|
|
||||||
|
|
||||||
if ( !dcc )
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if ( dcc->sock >= 0 )
|
|
||||||
socket_close (&dcc->sock);
|
|
||||||
|
|
||||||
dcc->state = LIBIRC_STATE_REMOVED;
|
|
||||||
|
|
||||||
libirc_mutex_unlock (&session->mutex_dcc);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int irc_dcc_chat (irc_session_t * session, void * ctx, const char * nick, irc_dcc_callback_t callback, irc_dcc_t * dccid)
|
|
||||||
{
|
|
||||||
struct sockaddr_in saddr;
|
|
||||||
socklen_t len = sizeof(saddr);
|
|
||||||
char cmdbuf[128], notbuf[128];
|
|
||||||
irc_dcc_session_t * dcc;
|
|
||||||
int err;
|
|
||||||
|
|
||||||
if ( session->state != LIBIRC_STATE_CONNECTED )
|
|
||||||
{
|
|
||||||
session->lasterror = LIBIRC_ERR_STATE;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = libirc_new_dcc_session (session, 0, 0, LIBIRC_DCC_CHAT, ctx, &dcc);
|
|
||||||
|
|
||||||
if ( err )
|
|
||||||
{
|
|
||||||
session->lasterror = err;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( getsockname (dcc->sock, (struct sockaddr*) &saddr, &len) < 0 )
|
|
||||||
{
|
|
||||||
session->lasterror = LIBIRC_ERR_SOCKET;
|
|
||||||
libirc_remove_dcc_session (session, dcc, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
sprintf (notbuf, "DCC Chat (%s)", inet_ntoa (saddr.sin_addr));
|
|
||||||
sprintf (cmdbuf, "DCC CHAT chat %lu %u", (unsigned long) ntohl (saddr.sin_addr.s_addr), ntohs (saddr.sin_port));
|
|
||||||
|
|
||||||
if ( irc_cmd_notice (session, nick, notbuf)
|
|
||||||
|| irc_cmd_ctcp_request (session, nick, cmdbuf) )
|
|
||||||
{
|
|
||||||
libirc_remove_dcc_session (session, dcc, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
*dccid = dcc->id;
|
|
||||||
dcc->cb = callback;
|
|
||||||
dcc->dccmode = LIBIRC_DCC_CHAT;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int irc_dcc_msg (irc_session_t * session, irc_dcc_t dccid, const char * text)
|
|
||||||
{
|
|
||||||
irc_dcc_session_t * dcc = libirc_find_dcc_session (session, dccid, 1);
|
|
||||||
|
|
||||||
if ( !dcc )
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if ( dcc->dccmode != LIBIRC_DCC_CHAT )
|
|
||||||
{
|
|
||||||
session->lasterror = LIBIRC_ERR_INVAL;
|
|
||||||
libirc_mutex_unlock (&session->mutex_dcc);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( (strlen(text) + 2) >= (sizeof(dcc->outgoing_buf) - dcc->outgoing_offset) )
|
|
||||||
{
|
|
||||||
session->lasterror = LIBIRC_ERR_NOMEM;
|
|
||||||
libirc_mutex_unlock (&session->mutex_dcc);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
libirc_mutex_lock (&dcc->mutex_outbuf);
|
|
||||||
|
|
||||||
strcpy (dcc->outgoing_buf + dcc->outgoing_offset, text);
|
|
||||||
dcc->outgoing_offset += strlen (text);
|
|
||||||
dcc->outgoing_buf[dcc->outgoing_offset++] = 0x0D;
|
|
||||||
dcc->outgoing_buf[dcc->outgoing_offset++] = 0x0A;
|
|
||||||
|
|
||||||
libirc_mutex_unlock (&dcc->mutex_outbuf);
|
|
||||||
libirc_mutex_unlock (&session->mutex_dcc);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void libirc_dcc_request (irc_session_t * session, const char * nick, const char * req)
|
|
||||||
{
|
|
||||||
char filenamebuf[256];
|
|
||||||
unsigned long ip, size;
|
|
||||||
unsigned short port;
|
|
||||||
|
|
||||||
if ( sscanf (req, "DCC CHAT chat %lu %hu", &ip, &port) == 2 )
|
|
||||||
{
|
|
||||||
if ( session->callbacks.event_dcc_chat_req )
|
|
||||||
{
|
|
||||||
irc_dcc_session_t * dcc;
|
|
||||||
|
|
||||||
int err = libirc_new_dcc_session (session, ip, port, LIBIRC_DCC_CHAT, 0, &dcc);
|
|
||||||
if ( err )
|
|
||||||
{
|
|
||||||
session->lasterror = err;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
(*session->callbacks.event_dcc_chat_req) (session,
|
|
||||||
nick,
|
|
||||||
inet_ntoa (dcc->remote_addr.sin_addr),
|
|
||||||
dcc->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if ( sscanf (req, "DCC SEND %s %lu %hu %lu", filenamebuf, &ip, &port, &size) == 4 )
|
|
||||||
{
|
|
||||||
if ( session->callbacks.event_dcc_send_req )
|
|
||||||
{
|
|
||||||
irc_dcc_session_t * dcc;
|
|
||||||
|
|
||||||
int err = libirc_new_dcc_session (session, ip, port, LIBIRC_DCC_RECVFILE, 0, &dcc);
|
|
||||||
if ( err )
|
|
||||||
{
|
|
||||||
session->lasterror = err;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
(*session->callbacks.event_dcc_send_req) (session,
|
|
||||||
nick,
|
|
||||||
inet_ntoa (dcc->remote_addr.sin_addr),
|
|
||||||
filenamebuf,
|
|
||||||
size,
|
|
||||||
dcc->id);
|
|
||||||
|
|
||||||
dcc->received_file_size = size;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#if defined (ENABLE_DEBUG)
|
|
||||||
fprintf (stderr, "BUG: Unhandled DCC message: %s\n", req);
|
|
||||||
abort();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int irc_dcc_accept (irc_session_t * session, irc_dcc_t dccid, void * ctx, irc_dcc_callback_t callback)
|
|
||||||
{
|
|
||||||
irc_dcc_session_t * dcc = libirc_find_dcc_session (session, dccid, 1);
|
|
||||||
|
|
||||||
if ( !dcc )
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if ( dcc->state != LIBIRC_STATE_INIT )
|
|
||||||
{
|
|
||||||
session->lasterror = LIBIRC_ERR_STATE;
|
|
||||||
libirc_mutex_unlock (&session->mutex_dcc);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
dcc->cb = callback;
|
|
||||||
dcc->ctx = ctx;
|
|
||||||
|
|
||||||
// Initiate the connect
|
|
||||||
if ( socket_connect (&dcc->sock, (struct sockaddr *) &dcc->remote_addr, sizeof(dcc->remote_addr)) )
|
|
||||||
{
|
|
||||||
libirc_dcc_destroy_nolock (session, dccid);
|
|
||||||
libirc_mutex_unlock (&session->mutex_dcc);
|
|
||||||
session->lasterror = LIBIRC_ERR_CONNECT;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
dcc->state = LIBIRC_STATE_CONNECTING;
|
|
||||||
libirc_mutex_unlock (&session->mutex_dcc);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int irc_dcc_decline (irc_session_t * session, irc_dcc_t dccid)
|
|
||||||
{
|
|
||||||
irc_dcc_session_t * dcc = libirc_find_dcc_session (session, dccid, 1);
|
|
||||||
|
|
||||||
if ( !dcc )
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if ( dcc->state != LIBIRC_STATE_INIT )
|
|
||||||
{
|
|
||||||
session->lasterror = LIBIRC_ERR_STATE;
|
|
||||||
libirc_mutex_unlock (&session->mutex_dcc);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
libirc_dcc_destroy_nolock (session, dccid);
|
|
||||||
libirc_mutex_unlock (&session->mutex_dcc);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int irc_dcc_sendfile (irc_session_t * session, void * ctx, const char * nick, const char * filename, irc_dcc_callback_t callback, irc_dcc_t * dccid)
|
|
||||||
{
|
|
||||||
struct sockaddr_in saddr;
|
|
||||||
socklen_t len = sizeof(saddr);
|
|
||||||
char cmdbuf[128], notbuf[128];
|
|
||||||
irc_dcc_session_t * dcc;
|
|
||||||
const char * p;
|
|
||||||
int err;
|
|
||||||
long filesize;
|
|
||||||
|
|
||||||
if ( !session || !dccid || !filename || !callback )
|
|
||||||
{
|
|
||||||
session->lasterror = LIBIRC_ERR_INVAL;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( session->state != LIBIRC_STATE_CONNECTED )
|
|
||||||
{
|
|
||||||
session->lasterror = LIBIRC_ERR_STATE;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( (err = libirc_new_dcc_session (session, 0, 0, LIBIRC_DCC_SENDFILE, ctx, &dcc)) != 0 )
|
|
||||||
{
|
|
||||||
session->lasterror = err;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( (dcc->dccsend_file_fp = fopen (filename, "rb")) == 0 )
|
|
||||||
{
|
|
||||||
libirc_remove_dcc_session (session, dcc, 1);
|
|
||||||
session->lasterror = LIBIRC_ERR_OPENFILE;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get file length */
|
|
||||||
if ( fseek (dcc->dccsend_file_fp, 0, SEEK_END)
|
|
||||||
|| (filesize = ftell (dcc->dccsend_file_fp)) == -1
|
|
||||||
|| fseek (dcc->dccsend_file_fp, 0, SEEK_SET) )
|
|
||||||
{
|
|
||||||
libirc_remove_dcc_session (session, dcc, 1);
|
|
||||||
session->lasterror = LIBIRC_ERR_NODCCSEND;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( getsockname (dcc->sock, (struct sockaddr*) &saddr, &len) < 0 )
|
|
||||||
{
|
|
||||||
libirc_remove_dcc_session (session, dcc, 1);
|
|
||||||
session->lasterror = LIBIRC_ERR_SOCKET;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove path from the filename
|
|
||||||
if ( (p = strrchr (filename, '\\')) == 0
|
|
||||||
&& (p = strrchr (filename, '/')) == 0 )
|
|
||||||
p = filename;
|
|
||||||
else
|
|
||||||
p++; // skip directory slash
|
|
||||||
|
|
||||||
sprintf (notbuf, "DCC Send %s (%s)", p, inet_ntoa (saddr.sin_addr));
|
|
||||||
sprintf (cmdbuf, "DCC SEND %s %lu %u %ld", p, (unsigned long) ntohl (saddr.sin_addr.s_addr), ntohs (saddr.sin_port), filesize);
|
|
||||||
|
|
||||||
if ( irc_cmd_notice (session, nick, notbuf)
|
|
||||||
|| irc_cmd_ctcp_request (session, nick, cmdbuf) )
|
|
||||||
{
|
|
||||||
libirc_remove_dcc_session (session, dcc, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
*dccid = dcc->id;
|
|
||||||
dcc->cb = callback;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
54
external/LibIRC/dcc.h
vendored
54
external/LibIRC/dcc.h
vendored
@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef INCLUDE_IRC_DCC_H
|
|
||||||
#define INCLUDE_IRC_DCC_H
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This structure keeps the state of a single DCC connection.
|
|
||||||
*/
|
|
||||||
struct irc_dcc_session_s
|
|
||||||
{
|
|
||||||
irc_dcc_session_t * next;
|
|
||||||
|
|
||||||
irc_dcc_t id;
|
|
||||||
void * ctx;
|
|
||||||
socket_t sock; /*!< DCC socket */
|
|
||||||
int dccmode; /*!< Boolean value to differ chat vs send
|
|
||||||
requests. Changes the cb behavior - when
|
|
||||||
it is chat, data is sent by lines with
|
|
||||||
stripped CRLFs. In file mode, the data
|
|
||||||
is sent as-is */
|
|
||||||
int state;
|
|
||||||
time_t timeout;
|
|
||||||
|
|
||||||
FILE * dccsend_file_fp;
|
|
||||||
unsigned int received_file_size;
|
|
||||||
unsigned int file_confirm_offset;
|
|
||||||
|
|
||||||
struct sockaddr_in remote_addr;
|
|
||||||
|
|
||||||
char incoming_buf[LIBIRC_DCC_BUFFER_SIZE];
|
|
||||||
unsigned int incoming_offset;
|
|
||||||
|
|
||||||
char outgoing_buf[LIBIRC_DCC_BUFFER_SIZE];
|
|
||||||
unsigned int outgoing_offset;
|
|
||||||
port_mutex_t mutex_outbuf;
|
|
||||||
|
|
||||||
irc_dcc_callback_t cb;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* INCLUDE_IRC_DCC_H */
|
|
54
external/LibIRC/errors.c
vendored
54
external/LibIRC/errors.c
vendored
@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static const char * libirc_strerror[LIBIRC_ERR_MAX] =
|
|
||||||
{
|
|
||||||
"No error",
|
|
||||||
"Invalid argument",
|
|
||||||
"Host not resolved",
|
|
||||||
"Socket error",
|
|
||||||
"Could not connect",
|
|
||||||
"Remote connection closed",
|
|
||||||
"Out of memory",
|
|
||||||
"Could not accept new connection",
|
|
||||||
"Object not found",
|
|
||||||
"Could not DCC send this object",
|
|
||||||
"Read error",
|
|
||||||
"Write error",
|
|
||||||
"Illegal operation for this state",
|
|
||||||
"Timeout error",
|
|
||||||
"Could not open file",
|
|
||||||
"IRC session terminated",
|
|
||||||
"IPv6 not supported",
|
|
||||||
"SSL not supported",
|
|
||||||
"SSL initialization failed",
|
|
||||||
"SSL connection failed",
|
|
||||||
"SSL certificate verify failed",
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
int irc_errno (irc_session_t * session)
|
|
||||||
{
|
|
||||||
return session->lasterror;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const char * irc_strerror (int ircerrno)
|
|
||||||
{
|
|
||||||
if ( ircerrno >= 0 && ircerrno < LIBIRC_ERR_MAX )
|
|
||||||
return libirc_strerror[ircerrno];
|
|
||||||
else
|
|
||||||
return "Invalid irc_errno value";
|
|
||||||
}
|
|
||||||
|
|
1258
external/LibIRC/libircclient.c
vendored
1258
external/LibIRC/libircclient.c
vendored
File diff suppressed because it is too large
Load Diff
36
external/LibIRC/params.h
vendored
36
external/LibIRC/params.h
vendored
@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef INCLUDE_IRC_PARAMS_H
|
|
||||||
#define INCLUDE_IRC_PARAMS_H
|
|
||||||
|
|
||||||
|
|
||||||
#define LIBIRC_VERSION_HIGH 1
|
|
||||||
#define LIBIRC_VERSION_LOW 8
|
|
||||||
|
|
||||||
#define LIBIRC_BUFFER_SIZE 1024
|
|
||||||
#define LIBIRC_DCC_BUFFER_SIZE 1024
|
|
||||||
|
|
||||||
#define LIBIRC_STATE_INIT 0
|
|
||||||
#define LIBIRC_STATE_LISTENING 1
|
|
||||||
#define LIBIRC_STATE_CONNECTING 2
|
|
||||||
#define LIBIRC_STATE_CONNECTED 3
|
|
||||||
#define LIBIRC_STATE_DISCONNECTED 4
|
|
||||||
#define LIBIRC_STATE_CONFIRM_SIZE 5 // Used only by DCC send to confirm the amount of sent data
|
|
||||||
#define LIBIRC_STATE_REMOVED 10 // this state is used only in DCC
|
|
||||||
|
|
||||||
|
|
||||||
#define SSL_PREFIX '#'
|
|
||||||
|
|
||||||
#endif /* INCLUDE_IRC_PARAMS_H */
|
|
156
external/LibIRC/portable.c
vendored
156
external/LibIRC/portable.c
vendored
@ -1,156 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined (_WIN32)
|
|
||||||
#include "ircconfig.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
#if defined (ENABLE_THREADS)
|
|
||||||
#include <pthread.h>
|
|
||||||
typedef pthread_mutex_t port_mutex_t;
|
|
||||||
|
|
||||||
#if !defined (PTHREAD_MUTEX_RECURSIVE) && defined (PTHREAD_MUTEX_RECURSIVE_NP)
|
|
||||||
#define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#include <winsock2.h>
|
|
||||||
#include <ws2tcpip.h>
|
|
||||||
#include <windows.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
#if defined (ENABLE_THREADS)
|
|
||||||
typedef CRITICAL_SECTION port_mutex_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define inline
|
|
||||||
#define snprintf _snprintf
|
|
||||||
#define vsnprintf _vsnprintf
|
|
||||||
#define strncasecmp _strnicmp
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if defined (ENABLE_SSL)
|
|
||||||
#include <openssl/ssl.h>
|
|
||||||
#include <openssl/err.h>
|
|
||||||
#include <openssl/rand.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if defined (ENABLE_THREADS)
|
|
||||||
static inline int libirc_mutex_init (port_mutex_t * mutex)
|
|
||||||
{
|
|
||||||
#if defined (_WIN32)
|
|
||||||
InitializeCriticalSection (mutex);
|
|
||||||
return 0;
|
|
||||||
#elif defined (PTHREAD_MUTEX_RECURSIVE)
|
|
||||||
pthread_mutexattr_t attr;
|
|
||||||
|
|
||||||
return (pthread_mutexattr_init (&attr)
|
|
||||||
|| pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE)
|
|
||||||
|| pthread_mutex_init (mutex, &attr));
|
|
||||||
#else /* !defined (PTHREAD_MUTEX_RECURSIVE) */
|
|
||||||
|
|
||||||
return pthread_mutex_init (mutex, 0);
|
|
||||||
|
|
||||||
#endif /* defined (_WIN32) */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static inline void libirc_mutex_destroy (port_mutex_t * mutex)
|
|
||||||
{
|
|
||||||
#if defined (_WIN32)
|
|
||||||
DeleteCriticalSection (mutex);
|
|
||||||
#else
|
|
||||||
pthread_mutex_destroy (mutex);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static inline void libirc_mutex_lock (port_mutex_t * mutex)
|
|
||||||
{
|
|
||||||
#if defined (_WIN32)
|
|
||||||
EnterCriticalSection (mutex);
|
|
||||||
#else
|
|
||||||
pthread_mutex_lock (mutex);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static inline void libirc_mutex_unlock (port_mutex_t * mutex)
|
|
||||||
{
|
|
||||||
#if defined (_WIN32)
|
|
||||||
LeaveCriticalSection (mutex);
|
|
||||||
#else
|
|
||||||
pthread_mutex_unlock (mutex);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
typedef void * port_mutex_t;
|
|
||||||
|
|
||||||
static inline int libirc_mutex_init (port_mutex_t * mutex) { return 0; }
|
|
||||||
static inline void libirc_mutex_destroy (port_mutex_t * mutex) {}
|
|
||||||
static inline void libirc_mutex_lock (port_mutex_t * mutex) {}
|
|
||||||
static inline void libirc_mutex_unlock (port_mutex_t * mutex) {}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Stub for WIN32 dll to initialize winsock API
|
|
||||||
*/
|
|
||||||
#if defined (WIN32_DLL)
|
|
||||||
BOOL WINAPI DllMain (HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved)
|
|
||||||
{
|
|
||||||
WORD wVersionRequested = MAKEWORD (1, 1);
|
|
||||||
WSADATA wsaData;
|
|
||||||
|
|
||||||
switch(fdwReason)
|
|
||||||
{
|
|
||||||
case DLL_PROCESS_ATTACH:
|
|
||||||
if ( WSAStartup (wVersionRequested, &wsaData) != 0 )
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
DisableThreadLibraryCalls (hinstDll);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DLL_PROCESS_DETACH:
|
|
||||||
WSACleanup();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
#endif
|
|
79
external/LibIRC/session.h
vendored
79
external/LibIRC/session.h
vendored
@ -1,79 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef INCLUDE_IRC_SESSION_H
|
|
||||||
#define INCLUDE_IRC_SESSION_H
|
|
||||||
|
|
||||||
|
|
||||||
#include "params.h"
|
|
||||||
#include "dcc.h"
|
|
||||||
#include "libirc_events.h"
|
|
||||||
|
|
||||||
|
|
||||||
// Session flags
|
|
||||||
#define SESSIONFL_MOTD_RECEIVED (0x00000001)
|
|
||||||
#define SESSIONFL_SSL_CONNECTION (0x00000002)
|
|
||||||
#define SESSIONFL_SSL_WRITE_WANTS_READ (0x00000004)
|
|
||||||
#define SESSIONFL_SSL_READ_WANTS_WRITE (0x00000008)
|
|
||||||
#define SESSIONFL_USES_IPV6 (0x00000010)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct irc_session_s
|
|
||||||
{
|
|
||||||
void * ctx;
|
|
||||||
int dcc_timeout;
|
|
||||||
|
|
||||||
int options;
|
|
||||||
int lasterror;
|
|
||||||
|
|
||||||
char incoming_buf[LIBIRC_BUFFER_SIZE];
|
|
||||||
unsigned int incoming_offset;
|
|
||||||
|
|
||||||
char outgoing_buf[LIBIRC_BUFFER_SIZE];
|
|
||||||
unsigned int outgoing_offset;
|
|
||||||
port_mutex_t mutex_session;
|
|
||||||
|
|
||||||
socket_t sock;
|
|
||||||
int state;
|
|
||||||
int flags;
|
|
||||||
|
|
||||||
char * server;
|
|
||||||
char * server_password;
|
|
||||||
char * realname;
|
|
||||||
char * username;
|
|
||||||
char * nick;
|
|
||||||
char * ctcp_version;
|
|
||||||
|
|
||||||
#if defined( ENABLE_IPV6 )
|
|
||||||
struct in6_addr local_addr6;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct in_addr local_addr;
|
|
||||||
irc_dcc_t dcc_last_id;
|
|
||||||
irc_dcc_session_t * dcc_sessions;
|
|
||||||
port_mutex_t mutex_dcc;
|
|
||||||
|
|
||||||
irc_callbacks_t callbacks;
|
|
||||||
|
|
||||||
#if defined (ENABLE_SSL)
|
|
||||||
SSL * ssl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* INCLUDE_IRC_SESSION_H */
|
|
159
external/LibIRC/sockets.c
vendored
159
external/LibIRC/sockets.c
vendored
@ -1,159 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The sockets interface was moved out to simplify going OpenSSL integration.
|
|
||||||
*/
|
|
||||||
#if !defined (_WIN32)
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
#define IS_SOCKET_ERROR(a) ((a)<0)
|
|
||||||
typedef int socket_t;
|
|
||||||
|
|
||||||
#else
|
|
||||||
#include <winsock2.h>
|
|
||||||
#include <ws2tcpip.h>
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#define IS_SOCKET_ERROR(a) ((a)==SOCKET_ERROR)
|
|
||||||
|
|
||||||
#if !defined(EWOULDBLOCK)
|
|
||||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
|
||||||
#endif
|
|
||||||
#if !defined(EINPROGRESS)
|
|
||||||
#define EINPROGRESS WSAEINPROGRESS
|
|
||||||
#endif
|
|
||||||
#if !defined(EINTR)
|
|
||||||
#define EINTR WSAEINTR
|
|
||||||
#endif
|
|
||||||
#if !defined(EAGAIN)
|
|
||||||
#define EAGAIN EWOULDBLOCK
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef SOCKET socket_t;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef INADDR_NONE
|
|
||||||
#define INADDR_NONE 0xFFFFFFFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static int socket_error()
|
|
||||||
{
|
|
||||||
#if !defined (_WIN32)
|
|
||||||
return errno;
|
|
||||||
#else
|
|
||||||
return WSAGetLastError();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int socket_create (int domain, int type, socket_t * sock)
|
|
||||||
{
|
|
||||||
*sock = socket (domain, type, 0);
|
|
||||||
return IS_SOCKET_ERROR(*sock) ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int socket_make_nonblocking (socket_t * sock)
|
|
||||||
{
|
|
||||||
#if !defined (_WIN32)
|
|
||||||
return fcntl (*sock, F_SETFL, fcntl (*sock, F_GETFL,0 ) | O_NONBLOCK) != 0;
|
|
||||||
#else
|
|
||||||
unsigned long mode = 0;
|
|
||||||
return ioctlsocket (*sock, FIONBIO, &mode) == SOCKET_ERROR;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int socket_close (socket_t * sock)
|
|
||||||
{
|
|
||||||
#if !defined (_WIN32)
|
|
||||||
close (*sock);
|
|
||||||
#else
|
|
||||||
closesocket (*sock);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
*sock = -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int socket_connect (socket_t * sock, const struct sockaddr *saddr, socklen_t len)
|
|
||||||
{
|
|
||||||
while ( 1 )
|
|
||||||
{
|
|
||||||
if ( connect (*sock, saddr, len) < 0 )
|
|
||||||
{
|
|
||||||
if ( socket_error() == EINTR )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ( socket_error() != EINPROGRESS && socket_error() != EWOULDBLOCK )
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int socket_accept (socket_t * sock, socket_t * newsock, struct sockaddr *saddr, socklen_t * len)
|
|
||||||
{
|
|
||||||
while ( IS_SOCKET_ERROR(*newsock = accept (*sock, saddr, len)) )
|
|
||||||
{
|
|
||||||
if ( socket_error() == EINTR )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int socket_recv (socket_t * sock, void * buf, size_t len)
|
|
||||||
{
|
|
||||||
int length;
|
|
||||||
|
|
||||||
while ( (length = recv (*sock, buf, len, 0)) < 0 )
|
|
||||||
{
|
|
||||||
int err = socket_error();
|
|
||||||
|
|
||||||
if ( err != EINTR && err != EAGAIN )
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int socket_send (socket_t * sock, const void *buf, size_t len)
|
|
||||||
{
|
|
||||||
int length;
|
|
||||||
|
|
||||||
while ( (length = send (*sock, buf, len, 0)) < 0 )
|
|
||||||
{
|
|
||||||
int err = socket_error();
|
|
||||||
|
|
||||||
if ( err != EINTR && err != EAGAIN )
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return length;
|
|
||||||
}
|
|
390
external/LibIRC/ssl.c
vendored
390
external/LibIRC/ssl.c
vendored
@ -1,390 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#if defined (ENABLE_SSL)
|
|
||||||
|
|
||||||
// Nonzero if OpenSSL has been initialized
|
|
||||||
static SSL_CTX * ssl_context = 0;
|
|
||||||
|
|
||||||
#if defined (_WIN32)
|
|
||||||
#include <windows.h>
|
|
||||||
// This array will store all of the mutexes available to OpenSSL
|
|
||||||
static CRITICAL_SECTION * mutex_buf = 0;
|
|
||||||
|
|
||||||
// OpenSSL callback to utilize static locks
|
|
||||||
static void cb_openssl_locking_function( int mode, int n, const char * file, int line )
|
|
||||||
{
|
|
||||||
if ( mode & CRYPTO_LOCK)
|
|
||||||
EnterCriticalSection( &mutex_buf[n] );
|
|
||||||
else
|
|
||||||
LeaveCriticalSection( &mutex_buf[n] );
|
|
||||||
}
|
|
||||||
|
|
||||||
// OpenSSL callback to get the thread ID
|
|
||||||
static unsigned long cb_openssl_id_function(void)
|
|
||||||
{
|
|
||||||
return ((unsigned long) GetCurrentThreadId() );
|
|
||||||
}
|
|
||||||
|
|
||||||
static int alloc_mutexes( unsigned int total )
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
// Enable thread safety in OpenSSL
|
|
||||||
mutex_buf = (CRITICAL_SECTION*) malloc( total * sizeof(CRITICAL_SECTION) );
|
|
||||||
|
|
||||||
if ( !mutex_buf )
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
for ( i = 0; i < total; i++)
|
|
||||||
InitializeCriticalSection( &(mutex_buf[i]) );
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
// This array will store all of the mutexes available to OpenSSL
|
|
||||||
static pthread_mutex_t * mutex_buf = 0;
|
|
||||||
|
|
||||||
// OpenSSL callback to utilize static locks
|
|
||||||
static void cb_openssl_locking_function( int mode, int n, const char * file, int line )
|
|
||||||
{
|
|
||||||
(void)file;
|
|
||||||
(void)line;
|
|
||||||
|
|
||||||
if ( mode & CRYPTO_LOCK)
|
|
||||||
pthread_mutex_lock( &mutex_buf[n] );
|
|
||||||
else
|
|
||||||
pthread_mutex_unlock( &mutex_buf[n] );
|
|
||||||
}
|
|
||||||
|
|
||||||
// OpenSSL callback to get the thread ID
|
|
||||||
static unsigned long cb_openssl_id_function()
|
|
||||||
{
|
|
||||||
return ((unsigned long) pthread_self() );
|
|
||||||
}
|
|
||||||
|
|
||||||
static int alloc_mutexes( unsigned int total )
|
|
||||||
{
|
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
// Enable thread safety in OpenSSL
|
|
||||||
mutex_buf = (pthread_mutex_t*) malloc( total * sizeof(pthread_mutex_t) );
|
|
||||||
|
|
||||||
if ( !mutex_buf )
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
for ( i = 0; i < total; i++)
|
|
||||||
pthread_mutex_init( &(mutex_buf[i]), 0 );
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int ssl_init_context( irc_session_t * session )
|
|
||||||
{
|
|
||||||
// Load the strings and init the library
|
|
||||||
SSL_load_error_strings();
|
|
||||||
|
|
||||||
// Enable thread safety in OpenSSL
|
|
||||||
if ( alloc_mutexes( CRYPTO_num_locks() ) )
|
|
||||||
return LIBIRC_ERR_NOMEM;
|
|
||||||
|
|
||||||
// Register our callbacks
|
|
||||||
CRYPTO_set_id_callback( cb_openssl_id_function );
|
|
||||||
CRYPTO_set_locking_callback( cb_openssl_locking_function );
|
|
||||||
|
|
||||||
// Init it
|
|
||||||
if ( !SSL_library_init() )
|
|
||||||
return LIBIRC_ERR_SSL_INIT_FAILED;
|
|
||||||
|
|
||||||
if ( RAND_status() == 0 )
|
|
||||||
return LIBIRC_ERR_SSL_INIT_FAILED;
|
|
||||||
|
|
||||||
// Create an SSL context; currently a single context is used for all connections
|
|
||||||
ssl_context = SSL_CTX_new( SSLv23_method() );
|
|
||||||
|
|
||||||
if ( !ssl_context )
|
|
||||||
return LIBIRC_ERR_SSL_INIT_FAILED;
|
|
||||||
|
|
||||||
// Disable SSLv2 as it is unsecure
|
|
||||||
if ( (SSL_CTX_set_options( ssl_context, SSL_OP_NO_SSLv2) & SSL_OP_NO_SSLv2) == 0 )
|
|
||||||
return LIBIRC_ERR_SSL_INIT_FAILED;
|
|
||||||
|
|
||||||
// Enable only strong ciphers
|
|
||||||
if ( SSL_CTX_set_cipher_list( ssl_context, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH" ) != 1 )
|
|
||||||
return LIBIRC_ERR_SSL_INIT_FAILED;
|
|
||||||
|
|
||||||
// Set the verification
|
|
||||||
if ( session->options & LIBIRC_OPTION_SSL_NO_VERIFY )
|
|
||||||
SSL_CTX_set_verify( ssl_context, SSL_VERIFY_NONE, 0 );
|
|
||||||
else
|
|
||||||
SSL_CTX_set_verify( ssl_context, SSL_VERIFY_PEER, 0 );
|
|
||||||
|
|
||||||
// Disable session caching
|
|
||||||
SSL_CTX_set_session_cache_mode( ssl_context, SSL_SESS_CACHE_OFF );
|
|
||||||
|
|
||||||
// Enable SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER so we can move the buffer during sending
|
|
||||||
SSL_CTX_set_mode( ssl_context, SSL_CTX_get_mode(ssl_context) | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER | SSL_MODE_ENABLE_PARTIAL_WRITE );
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if defined (_WIN32)
|
|
||||||
#define SSLINIT_LOCK_MUTEX(a) WaitForSingleObject( a, INFINITE )
|
|
||||||
#define SSLINIT_UNLOCK_MUTEX(a) ReleaseMutex( a )
|
|
||||||
#else
|
|
||||||
#define SSLINIT_LOCK_MUTEX(a) pthread_mutex_lock( &a )
|
|
||||||
#define SSLINIT_UNLOCK_MUTEX(a) pthread_mutex_unlock( &a )
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Initializes the SSL context. Must be called after the socket is created.
|
|
||||||
static int ssl_init( irc_session_t * session )
|
|
||||||
{
|
|
||||||
static int ssl_context_initialized = 0;
|
|
||||||
|
|
||||||
#if defined (_WIN32)
|
|
||||||
static HANDLE initmutex = 0;
|
|
||||||
|
|
||||||
// First time run? Create the mutex
|
|
||||||
if ( initmutex == 0 )
|
|
||||||
{
|
|
||||||
HANDLE m = CreateMutex( 0, FALSE, 0 );
|
|
||||||
|
|
||||||
// Now we check if the mutex has already been created by another thread performing the init concurrently.
|
|
||||||
// If it was, we close our mutex and use the original one. This could be done synchronously by using the
|
|
||||||
// InterlockedCompareExchangePointer function.
|
|
||||||
if ( InterlockedCompareExchangePointer( &m, m, 0 ) != 0 )
|
|
||||||
CloseHandle( m );
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static pthread_mutex_t initmutex = PTHREAD_MUTEX_INITIALIZER;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// This initialization needs to be performed only once. The problem is that it is called from
|
|
||||||
// irc_connect() and this function may be called simultaneously from different threads. So we have
|
|
||||||
// to use mutex on Linux because it allows static mutex initialization. Windows doesn't, so here
|
|
||||||
// we do the sabre dance around it.
|
|
||||||
SSLINIT_LOCK_MUTEX( initmutex );
|
|
||||||
|
|
||||||
if ( ssl_context_initialized == 0 )
|
|
||||||
{
|
|
||||||
int res = ssl_init_context( session );
|
|
||||||
|
|
||||||
if ( res )
|
|
||||||
{
|
|
||||||
SSLINIT_UNLOCK_MUTEX( initmutex );
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
ssl_context_initialized = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
SSLINIT_UNLOCK_MUTEX( initmutex );
|
|
||||||
|
|
||||||
// Get the SSL context
|
|
||||||
session->ssl = SSL_new( ssl_context );
|
|
||||||
|
|
||||||
if ( !session->ssl )
|
|
||||||
return LIBIRC_ERR_SSL_INIT_FAILED;
|
|
||||||
|
|
||||||
// Let OpenSSL use our socket
|
|
||||||
if ( SSL_set_fd( session->ssl, session->sock) != 1 )
|
|
||||||
return LIBIRC_ERR_SSL_INIT_FAILED;
|
|
||||||
|
|
||||||
// Since we're connecting on our own, tell openssl about it
|
|
||||||
SSL_set_connect_state( session->ssl );
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ssl_handle_error( irc_session_t * session, int ssl_error )
|
|
||||||
{
|
|
||||||
if ( ERR_GET_LIB(ssl_error) == ERR_LIB_SSL )
|
|
||||||
{
|
|
||||||
if ( ERR_GET_REASON(ssl_error) == SSL_R_CERTIFICATE_VERIFY_FAILED )
|
|
||||||
{
|
|
||||||
session->lasterror = LIBIRC_ERR_SSL_CERT_VERIFY_FAILED;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ERR_GET_REASON(ssl_error) == SSL_R_UNKNOWN_PROTOCOL )
|
|
||||||
{
|
|
||||||
session->lasterror = LIBIRC_ERR_CONNECT_SSL_FAILED;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined (ENABLE_DEBUG)
|
|
||||||
if ( IS_DEBUG_ENABLED(session) )
|
|
||||||
fprintf (stderr, "[DEBUG] SSL error: %s\n\t(%d, %d)\n",
|
|
||||||
ERR_error_string( ssl_error, NULL), ERR_GET_LIB( ssl_error), ERR_GET_REASON(ssl_error) );
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static int ssl_recv( irc_session_t * session )
|
|
||||||
{
|
|
||||||
int count;
|
|
||||||
unsigned int amount = (sizeof (session->incoming_buf) - 1) - session->incoming_offset;
|
|
||||||
|
|
||||||
ERR_clear_error();
|
|
||||||
|
|
||||||
// Read up to m_bufferLength bytes
|
|
||||||
count = SSL_read( session->ssl, session->incoming_buf + session->incoming_offset, amount );
|
|
||||||
|
|
||||||
if ( count > 0 )
|
|
||||||
return count;
|
|
||||||
else if ( count == 0 )
|
|
||||||
return -1; // remote connection closed
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int ssl_error = SSL_get_error( session->ssl, count );
|
|
||||||
|
|
||||||
// Handle SSL error since not all of them are actually errors
|
|
||||||
switch ( ssl_error )
|
|
||||||
{
|
|
||||||
case SSL_ERROR_WANT_READ:
|
|
||||||
// This is not really an error. We received something, but
|
|
||||||
// OpenSSL gave nothing to us because all it read was
|
|
||||||
// internal data. Repeat the same read.
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case SSL_ERROR_WANT_WRITE:
|
|
||||||
// This is not really an error. We received something, but
|
|
||||||
// now OpenSSL needs to send the data before returning any
|
|
||||||
// data to us (like negotiations). This means we'd need
|
|
||||||
// to wait for WRITE event, but call SSL_read() again.
|
|
||||||
session->flags |= SESSIONFL_SSL_READ_WANTS_WRITE;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This is an SSL error, handle it
|
|
||||||
ssl_handle_error( session, ERR_get_error() );
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int ssl_send( irc_session_t * session )
|
|
||||||
{
|
|
||||||
int count;
|
|
||||||
ERR_clear_error();
|
|
||||||
|
|
||||||
count = SSL_write( session->ssl, session->outgoing_buf, session->outgoing_offset );
|
|
||||||
|
|
||||||
if ( count > 0 )
|
|
||||||
return count;
|
|
||||||
else if ( count == 0 )
|
|
||||||
return -1;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int ssl_error = SSL_get_error( session->ssl, count );
|
|
||||||
|
|
||||||
switch ( ssl_error )
|
|
||||||
{
|
|
||||||
case SSL_ERROR_WANT_READ:
|
|
||||||
// This is not really an error. We sent some internal OpenSSL data,
|
|
||||||
// but now it needs to read more data before it can send anything.
|
|
||||||
// Thus we wait for READ event, but will call SSL_write() again.
|
|
||||||
session->flags |= SESSIONFL_SSL_WRITE_WANTS_READ;
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case SSL_ERROR_WANT_WRITE:
|
|
||||||
// This is not really an error. We sent some data, but now OpenSSL
|
|
||||||
// wants to send some internal data before sending ours.
|
|
||||||
// Repeat the same write.
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This is an SSL error, handle it
|
|
||||||
ssl_handle_error( session, ERR_get_error() );
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// Handles both SSL and non-SSL reads.
|
|
||||||
// Returns -1 in case there is an error and socket should be closed/connection terminated
|
|
||||||
// Returns 0 in case there is a temporary error and the call should be retried (SSL_WANTS_WRITE case)
|
|
||||||
// Returns a positive number if we actually read something
|
|
||||||
static int session_socket_read( irc_session_t * session )
|
|
||||||
{
|
|
||||||
int length;
|
|
||||||
|
|
||||||
#if defined (ENABLE_SSL)
|
|
||||||
if ( session->ssl )
|
|
||||||
{
|
|
||||||
// Yes, I know this is tricky
|
|
||||||
if ( session->flags & SESSIONFL_SSL_READ_WANTS_WRITE )
|
|
||||||
{
|
|
||||||
session->flags &= ~SESSIONFL_SSL_READ_WANTS_WRITE;
|
|
||||||
ssl_send( session );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ssl_recv( session );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
length = socket_recv( &session->sock,
|
|
||||||
session->incoming_buf + session->incoming_offset,
|
|
||||||
(sizeof (session->incoming_buf) - 1) - session->incoming_offset );
|
|
||||||
|
|
||||||
// There is no "retry" errors for regular sockets
|
|
||||||
if ( length <= 0 )
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handles both SSL and non-SSL writes.
|
|
||||||
// Returns -1 in case there is an error and socket should be closed/connection terminated
|
|
||||||
// Returns 0 in case there is a temporary error and the call should be retried (SSL_WANTS_WRITE case)
|
|
||||||
// Returns a positive number if we actually sent something
|
|
||||||
static int session_socket_write( irc_session_t * session )
|
|
||||||
{
|
|
||||||
int length;
|
|
||||||
|
|
||||||
#if defined (ENABLE_SSL)
|
|
||||||
if ( session->ssl )
|
|
||||||
{
|
|
||||||
// Yep
|
|
||||||
if ( session->flags & SESSIONFL_SSL_WRITE_WANTS_READ )
|
|
||||||
{
|
|
||||||
session->flags &= ~SESSIONFL_SSL_WRITE_WANTS_READ;
|
|
||||||
ssl_recv( session );
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ssl_send( session );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
length = socket_send (&session->sock, session->outgoing_buf, session->outgoing_offset);
|
|
||||||
|
|
||||||
// There is no "retry" errors for regular sockets
|
|
||||||
if ( length <= 0 )
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return length;
|
|
||||||
}
|
|
130
external/LibIRC/utils.c
vendored
130
external/LibIRC/utils.c
vendored
@ -1,130 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void libirc_add_to_set (int fd, fd_set *set, int * maxfd)
|
|
||||||
{
|
|
||||||
FD_SET (fd, set);
|
|
||||||
|
|
||||||
if ( *maxfd < fd )
|
|
||||||
*maxfd = fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined (ENABLE_DEBUG)
|
|
||||||
static void libirc_dump_data (const char * prefix, const char * buf, unsigned int length)
|
|
||||||
{
|
|
||||||
printf ("%s: ", prefix);
|
|
||||||
for ( ; length > 0; length -- )
|
|
||||||
printf ("%c", *buf++);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Finds a separator (\x0D\x0A), which separates two lines.
|
|
||||||
*/
|
|
||||||
static int libirc_findcrlf (const char * buf, int length)
|
|
||||||
{
|
|
||||||
int offset = 0;
|
|
||||||
for ( ; offset < length; offset++ )
|
|
||||||
{
|
|
||||||
if ( buf[offset] == 0x0D && offset < length - 1 && buf[offset+1] == 0x0A )
|
|
||||||
return offset;
|
|
||||||
if ( buf[offset] == 0x0A)
|
|
||||||
return offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int libirc_findcrlf_offset(const char *buf, int offset, const int length)
|
|
||||||
{
|
|
||||||
for(; offset < length; offset++)
|
|
||||||
{
|
|
||||||
if(buf[offset] != 0x0D && buf[offset] != 0x0A)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int libirc_findcrorlf (char * buf, int length)
|
|
||||||
{
|
|
||||||
int offset = 0;
|
|
||||||
for ( ; offset < length; offset++ )
|
|
||||||
{
|
|
||||||
if ( buf[offset] == 0x0D || buf[offset] == 0x0A )
|
|
||||||
{
|
|
||||||
buf[offset++] = '\0';
|
|
||||||
|
|
||||||
if ( offset < (length - 1)
|
|
||||||
&& (buf[offset] == 0x0D || buf[offset] == 0x0A) )
|
|
||||||
offset++;
|
|
||||||
|
|
||||||
return offset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void libirc_event_ctcp_internal (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count)
|
|
||||||
{
|
|
||||||
(void)event;
|
|
||||||
(void)count;
|
|
||||||
|
|
||||||
if ( origin )
|
|
||||||
{
|
|
||||||
char nickbuf[128], textbuf[256];
|
|
||||||
irc_target_get_nick (origin, nickbuf, sizeof(nickbuf));
|
|
||||||
|
|
||||||
if ( strstr (params[0], "PING") == params[0] )
|
|
||||||
irc_cmd_ctcp_reply (session, nickbuf, params[0]);
|
|
||||||
else if ( !strcmp (params[0], "VERSION") )
|
|
||||||
{
|
|
||||||
if ( !session->ctcp_version )
|
|
||||||
{
|
|
||||||
unsigned int high, low;
|
|
||||||
irc_get_version (&high, &low);
|
|
||||||
|
|
||||||
snprintf (textbuf, sizeof (textbuf), "VERSION libircclient by Georgy Yunaev ver.%d.%d", high, low);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
snprintf (textbuf, sizeof (textbuf), "VERSION %s", session->ctcp_version);
|
|
||||||
|
|
||||||
irc_cmd_ctcp_reply (session, nickbuf, textbuf);
|
|
||||||
}
|
|
||||||
else if ( !strcmp (params[0], "FINGER") )
|
|
||||||
{
|
|
||||||
sprintf (textbuf, "FINGER %s (%s) Idle 0 seconds",
|
|
||||||
session->username ? session->username : "nobody",
|
|
||||||
session->realname ? session->realname : "noname");
|
|
||||||
|
|
||||||
irc_cmd_ctcp_reply (session, nickbuf, textbuf);
|
|
||||||
}
|
|
||||||
else if ( !strcmp (params[0], "TIME") )
|
|
||||||
{
|
|
||||||
time_t now = time(0);
|
|
||||||
|
|
||||||
#if defined (ENABLE_THREADS) && defined (HAVE_LOCALTIME_R)
|
|
||||||
struct tm tmtmp, *ltime = localtime_r (&now, &tmtmp);
|
|
||||||
#else
|
|
||||||
struct tm * ltime = localtime (&now);
|
|
||||||
#endif
|
|
||||||
strftime (textbuf, sizeof(textbuf), "%a %b %d %H:%M:%S %Z %Y", ltime);
|
|
||||||
irc_cmd_ctcp_reply (session, nickbuf, textbuf);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,298 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org>
|
|
||||||
*
|
|
||||||
* Jansson is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the MIT license. See LICENSE for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef JANSSON_H
|
|
||||||
#define JANSSON_H
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h> /* for size_t */
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#include "jansson_config.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* version */
|
|
||||||
|
|
||||||
#define JANSSON_MAJOR_VERSION 2
|
|
||||||
#define JANSSON_MINOR_VERSION 7
|
|
||||||
#define JANSSON_MICRO_VERSION 0
|
|
||||||
|
|
||||||
/* Micro version is omitted if it's 0 */
|
|
||||||
#define JANSSON_VERSION "2.7"
|
|
||||||
|
|
||||||
/* Version as a 3-byte hex number, e.g. 0x010201 == 1.2.1. Use this
|
|
||||||
for numeric comparisons, e.g. #if JANSSON_VERSION_HEX >= ... */
|
|
||||||
#define JANSSON_VERSION_HEX ((JANSSON_MAJOR_VERSION << 16) | \
|
|
||||||
(JANSSON_MINOR_VERSION << 8) | \
|
|
||||||
(JANSSON_MICRO_VERSION << 0))
|
|
||||||
|
|
||||||
|
|
||||||
/* types */
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
JSON_OBJECT,
|
|
||||||
JSON_ARRAY,
|
|
||||||
JSON_STRING,
|
|
||||||
JSON_INTEGER,
|
|
||||||
JSON_REAL,
|
|
||||||
JSON_TRUE,
|
|
||||||
JSON_FALSE,
|
|
||||||
JSON_NULL
|
|
||||||
} json_type;
|
|
||||||
|
|
||||||
typedef struct json_t {
|
|
||||||
json_type type;
|
|
||||||
size_t refcount;
|
|
||||||
} json_t;
|
|
||||||
|
|
||||||
#ifndef JANSSON_USING_CMAKE /* disabled if using cmake */
|
|
||||||
#if JSON_INTEGER_IS_LONG_LONG
|
|
||||||
#if defined(_WIN32) || defined(WIN32)
|
|
||||||
#define JSON_INTEGER_FORMAT "I64d"
|
|
||||||
#else
|
|
||||||
#define JSON_INTEGER_FORMAT "lld"
|
|
||||||
#endif
|
|
||||||
typedef long long json_int_t;
|
|
||||||
#else
|
|
||||||
#define JSON_INTEGER_FORMAT "ld"
|
|
||||||
typedef long json_int_t;
|
|
||||||
#endif /* JSON_INTEGER_IS_LONG_LONG */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define json_typeof(json) ((json)->type)
|
|
||||||
#define json_is_object(json) ((json) && json_typeof(json) == JSON_OBJECT)
|
|
||||||
#define json_is_array(json) ((json) && json_typeof(json) == JSON_ARRAY)
|
|
||||||
#define json_is_string(json) ((json) && json_typeof(json) == JSON_STRING)
|
|
||||||
#define json_is_integer(json) ((json) && json_typeof(json) == JSON_INTEGER)
|
|
||||||
#define json_is_real(json) ((json) && json_typeof(json) == JSON_REAL)
|
|
||||||
#define json_is_number(json) (json_is_integer(json) || json_is_real(json))
|
|
||||||
#define json_is_true(json) ((json) && json_typeof(json) == JSON_TRUE)
|
|
||||||
#define json_is_false(json) ((json) && json_typeof(json) == JSON_FALSE)
|
|
||||||
#define json_boolean_value json_is_true
|
|
||||||
#define json_is_boolean(json) (json_is_true(json) || json_is_false(json))
|
|
||||||
#define json_is_null(json) ((json) && json_typeof(json) == JSON_NULL)
|
|
||||||
|
|
||||||
/* construction, destruction, reference counting */
|
|
||||||
|
|
||||||
json_t *json_object(void);
|
|
||||||
json_t *json_array(void);
|
|
||||||
json_t *json_string(const char *value);
|
|
||||||
json_t *json_stringn(const char *value, size_t len);
|
|
||||||
json_t *json_string_nocheck(const char *value);
|
|
||||||
json_t *json_stringn_nocheck(const char *value, size_t len);
|
|
||||||
json_t *json_integer(json_int_t value);
|
|
||||||
json_t *json_real(double value);
|
|
||||||
json_t *json_true(void);
|
|
||||||
json_t *json_false(void);
|
|
||||||
#define json_boolean(val) ((val) ? json_true() : json_false())
|
|
||||||
json_t *json_null(void);
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
json_t *json_incref(json_t *json)
|
|
||||||
{
|
|
||||||
if(json && json->refcount != (size_t)-1)
|
|
||||||
++json->refcount;
|
|
||||||
return json;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* do not call json_delete directly */
|
|
||||||
void json_delete(json_t *json);
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
void json_decref(json_t *json)
|
|
||||||
{
|
|
||||||
if(json && json->refcount != (size_t)-1 && --json->refcount == 0)
|
|
||||||
json_delete(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* error reporting */
|
|
||||||
|
|
||||||
#define JSON_ERROR_TEXT_LENGTH 160
|
|
||||||
#define JSON_ERROR_SOURCE_LENGTH 80
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int line;
|
|
||||||
int column;
|
|
||||||
int position;
|
|
||||||
char source[JSON_ERROR_SOURCE_LENGTH];
|
|
||||||
char text[JSON_ERROR_TEXT_LENGTH];
|
|
||||||
} json_error_t;
|
|
||||||
|
|
||||||
|
|
||||||
/* getters, setters, manipulation */
|
|
||||||
|
|
||||||
void json_object_seed(size_t seed);
|
|
||||||
size_t json_object_size(const json_t *object);
|
|
||||||
json_t *json_object_get(const json_t *object, const char *key);
|
|
||||||
int json_object_set_new(json_t *object, const char *key, json_t *value);
|
|
||||||
int json_object_set_new_nocheck(json_t *object, const char *key, json_t *value);
|
|
||||||
int json_object_del(json_t *object, const char *key);
|
|
||||||
int json_object_clear(json_t *object);
|
|
||||||
int json_object_update(json_t *object, json_t *other);
|
|
||||||
int json_object_update_existing(json_t *object, json_t *other);
|
|
||||||
int json_object_update_missing(json_t *object, json_t *other);
|
|
||||||
void *json_object_iter(json_t *object);
|
|
||||||
void *json_object_iter_at(json_t *object, const char *key);
|
|
||||||
void *json_object_key_to_iter(const char *key);
|
|
||||||
void *json_object_iter_next(json_t *object, void *iter);
|
|
||||||
const char *json_object_iter_key(void *iter);
|
|
||||||
json_t *json_object_iter_value(void *iter);
|
|
||||||
int json_object_iter_set_new(json_t *object, void *iter, json_t *value);
|
|
||||||
|
|
||||||
#define json_object_foreach(object, key, value) \
|
|
||||||
for(key = json_object_iter_key(json_object_iter(object)); \
|
|
||||||
key && (value = json_object_iter_value(json_object_key_to_iter(key))); \
|
|
||||||
key = json_object_iter_key(json_object_iter_next(object, json_object_key_to_iter(key))))
|
|
||||||
|
|
||||||
#define json_object_foreach_safe(object, n, key, value) \
|
|
||||||
for(key = json_object_iter_key(json_object_iter(object)), \
|
|
||||||
n = json_object_iter_next(object, json_object_key_to_iter(key)); \
|
|
||||||
key && (value = json_object_iter_value(json_object_key_to_iter(key))); \
|
|
||||||
key = json_object_iter_key(n), \
|
|
||||||
n = json_object_iter_next(object, json_object_key_to_iter(key)))
|
|
||||||
|
|
||||||
#define json_array_foreach(array, index, value) \
|
|
||||||
for(index = 0; \
|
|
||||||
index < json_array_size(array) && (value = json_array_get(array, index)); \
|
|
||||||
index++)
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
int json_object_set(json_t *object, const char *key, json_t *value)
|
|
||||||
{
|
|
||||||
return json_object_set_new(object, key, json_incref(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
int json_object_set_nocheck(json_t *object, const char *key, json_t *value)
|
|
||||||
{
|
|
||||||
return json_object_set_new_nocheck(object, key, json_incref(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
int json_object_iter_set(json_t *object, void *iter, json_t *value)
|
|
||||||
{
|
|
||||||
return json_object_iter_set_new(object, iter, json_incref(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t json_array_size(const json_t *array);
|
|
||||||
json_t *json_array_get(const json_t *array, size_t index);
|
|
||||||
int json_array_set_new(json_t *array, size_t index, json_t *value);
|
|
||||||
int json_array_append_new(json_t *array, json_t *value);
|
|
||||||
int json_array_insert_new(json_t *array, size_t index, json_t *value);
|
|
||||||
int json_array_remove(json_t *array, size_t index);
|
|
||||||
int json_array_clear(json_t *array);
|
|
||||||
int json_array_extend(json_t *array, json_t *other);
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
int json_array_set(json_t *array, size_t ind, json_t *value)
|
|
||||||
{
|
|
||||||
return json_array_set_new(array, ind, json_incref(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
int json_array_append(json_t *array, json_t *value)
|
|
||||||
{
|
|
||||||
return json_array_append_new(array, json_incref(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSON_INLINE
|
|
||||||
int json_array_insert(json_t *array, size_t ind, json_t *value)
|
|
||||||
{
|
|
||||||
return json_array_insert_new(array, ind, json_incref(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *json_string_value(const json_t *string);
|
|
||||||
size_t json_string_length(const json_t *string);
|
|
||||||
json_int_t json_integer_value(const json_t *integer);
|
|
||||||
double json_real_value(const json_t *real);
|
|
||||||
double json_number_value(const json_t *json);
|
|
||||||
|
|
||||||
int json_string_set(json_t *string, const char *value);
|
|
||||||
int json_string_setn(json_t *string, const char *value, size_t len);
|
|
||||||
int json_string_set_nocheck(json_t *string, const char *value);
|
|
||||||
int json_string_setn_nocheck(json_t *string, const char *value, size_t len);
|
|
||||||
int json_integer_set(json_t *integer, json_int_t value);
|
|
||||||
int json_real_set(json_t *real, double value);
|
|
||||||
|
|
||||||
/* pack, unpack */
|
|
||||||
|
|
||||||
json_t *json_pack(const char *fmt, ...);
|
|
||||||
json_t *json_pack_ex(json_error_t *error, size_t flags, const char *fmt, ...);
|
|
||||||
json_t *json_vpack_ex(json_error_t *error, size_t flags, const char *fmt, va_list ap);
|
|
||||||
|
|
||||||
#define JSON_VALIDATE_ONLY 0x1
|
|
||||||
#define JSON_STRICT 0x2
|
|
||||||
|
|
||||||
int json_unpack(json_t *root, const char *fmt, ...);
|
|
||||||
int json_unpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, ...);
|
|
||||||
int json_vunpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, va_list ap);
|
|
||||||
|
|
||||||
|
|
||||||
/* equality */
|
|
||||||
|
|
||||||
int json_equal(json_t *value1, json_t *value2);
|
|
||||||
|
|
||||||
|
|
||||||
/* copying */
|
|
||||||
|
|
||||||
json_t *json_copy(json_t *value);
|
|
||||||
json_t *json_deep_copy(const json_t *value);
|
|
||||||
|
|
||||||
|
|
||||||
/* decoding */
|
|
||||||
|
|
||||||
#define JSON_REJECT_DUPLICATES 0x1
|
|
||||||
#define JSON_DISABLE_EOF_CHECK 0x2
|
|
||||||
#define JSON_DECODE_ANY 0x4
|
|
||||||
#define JSON_DECODE_INT_AS_REAL 0x8
|
|
||||||
#define JSON_ALLOW_NUL 0x10
|
|
||||||
|
|
||||||
typedef size_t (*json_load_callback_t)(void *buffer, size_t buflen, void *data);
|
|
||||||
|
|
||||||
json_t *json_loads(const char *input, size_t flags, json_error_t *error);
|
|
||||||
json_t *json_loadb(const char *buffer, size_t buflen, size_t flags, json_error_t *error);
|
|
||||||
json_t *json_loadf(FILE *input, size_t flags, json_error_t *error);
|
|
||||||
json_t *json_load_file(const char *path, size_t flags, json_error_t *error);
|
|
||||||
json_t *json_load_callback(json_load_callback_t callback, void *data, size_t flags, json_error_t *error);
|
|
||||||
|
|
||||||
|
|
||||||
/* encoding */
|
|
||||||
|
|
||||||
#define JSON_MAX_INDENT 0x1F
|
|
||||||
#define JSON_INDENT(n) ((n) & JSON_MAX_INDENT)
|
|
||||||
#define JSON_COMPACT 0x20
|
|
||||||
#define JSON_ENSURE_ASCII 0x40
|
|
||||||
#define JSON_SORT_KEYS 0x80
|
|
||||||
#define JSON_PRESERVE_ORDER 0x100
|
|
||||||
#define JSON_ENCODE_ANY 0x200
|
|
||||||
#define JSON_ESCAPE_SLASH 0x400
|
|
||||||
#define JSON_REAL_PRECISION(n) (((n) & 0x1F) << 11)
|
|
||||||
|
|
||||||
typedef int (*json_dump_callback_t)(const char *buffer, size_t size, void *data);
|
|
||||||
|
|
||||||
char *json_dumps(const json_t *json, size_t flags);
|
|
||||||
int json_dumpf(const json_t *json, FILE *output, size_t flags);
|
|
||||||
int json_dump_file(const json_t *json, const char *path, size_t flags);
|
|
||||||
int json_dump_callback(const json_t *json, json_dump_callback_t callback, void *data, size_t flags);
|
|
||||||
|
|
||||||
/* custom memory allocation */
|
|
||||||
|
|
||||||
typedef void *(*json_malloc_t)(size_t);
|
|
||||||
typedef void (*json_free_t)(void *);
|
|
||||||
|
|
||||||
void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn);
|
|
||||||
void json_get_alloc_funcs(json_malloc_t *malloc_fn, json_free_t *free_fn);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2010-2014 Petri Lehtinen <petri@digip.org>
|
|
||||||
*
|
|
||||||
* Jansson is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the MIT license. See LICENSE for details.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* This file specifies a part of the site-specific configuration for
|
|
||||||
* Jansson, namely those things that affect the public API in
|
|
||||||
* jansson.h.
|
|
||||||
*
|
|
||||||
* The CMake system will generate the jansson_config.h file and
|
|
||||||
* copy it to the build and install directories.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef JANSSON_CONFIG_H
|
|
||||||
#define JANSSON_CONFIG_H
|
|
||||||
|
|
||||||
/* Define this so that we can disable scattered automake configuration in source files */
|
|
||||||
#ifndef JANSSON_USING_CMAKE
|
|
||||||
#define JANSSON_USING_CMAKE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Note: when using cmake, JSON_INTEGER_IS_LONG_LONG is not defined nor used,
|
|
||||||
* as we will also check for __int64 etc types.
|
|
||||||
* (the definition was used in the automake system) */
|
|
||||||
|
|
||||||
/* Bring in the cmake-detected defines */
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
/* #undef HAVE_INTTYPES_H */
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
|
|
||||||
/* Include our standard type header for the integer typedef */
|
|
||||||
|
|
||||||
#if defined(HAVE_STDINT_H)
|
|
||||||
# include <stdint.h>
|
|
||||||
#elif defined(HAVE_INTTYPES_H)
|
|
||||||
# include <inttypes.h>
|
|
||||||
#elif defined(HAVE_SYS_TYPES_H)
|
|
||||||
# include <sys/types.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* If your compiler supports the inline keyword in C, JSON_INLINE is
|
|
||||||
defined to `inline', otherwise empty. In C++, the inline is always
|
|
||||||
supported. */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#define JSON_INLINE inline
|
|
||||||
#else
|
|
||||||
#define JSON_INLINE inline
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define json_int_t long long
|
|
||||||
#define json_strtoint strtoll
|
|
||||||
#if defined(_WIN32) || defined(WIN32)
|
|
||||||
#define JSON_INTEGER_FORMAT "I64d"
|
|
||||||
#else
|
|
||||||
#define JSON_INTEGER_FORMAT "lld"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If locale.h and localeconv() are available, define to 1, otherwise to 0. */
|
|
||||||
#define JSON_HAVE_LOCALECONV 1
|
|
||||||
|
|
||||||
|
|
||||||
/* Maximum recursion depth for parsing JSON input.
|
|
||||||
This limits the depth of e.g. array-within-array constructions. */
|
|
||||||
#define JSON_PARSER_MAX_DEPTH 2048
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,53 +0,0 @@
|
|||||||
#define HAVE_ENDIAN_H 1
|
|
||||||
#define HAVE_FCNTL_H 1
|
|
||||||
#define HAVE_SCHED_H 1
|
|
||||||
#define HAVE_UNISTD_H 1
|
|
||||||
#define HAVE_SYS_PARAM_H 1
|
|
||||||
#define HAVE_SYS_STAT_H 1
|
|
||||||
#define HAVE_SYS_TIME_H 1
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
|
|
||||||
#define HAVE_CLOSE 1
|
|
||||||
#define HAVE_GETPID 1
|
|
||||||
#define HAVE_GETTIMEOFDAY 1
|
|
||||||
#define HAVE_OPEN 1
|
|
||||||
#define HAVE_READ 1
|
|
||||||
#define HAVE_SCHED_YIELD 1
|
|
||||||
|
|
||||||
#define HAVE_SYNC_BUILTINS 1
|
|
||||||
#define HAVE_ATOMIC_BUILTINS 1
|
|
||||||
|
|
||||||
#define HAVE_LOCALE_H 1
|
|
||||||
#define HAVE_SETLOCALE 1
|
|
||||||
|
|
||||||
#define HAVE_INT32_T 1
|
|
||||||
#ifndef HAVE_INT32_T
|
|
||||||
# define int32_t int32_t
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAVE_UINT32_T 1
|
|
||||||
#ifndef HAVE_UINT32_T
|
|
||||||
# define uint32_t uint32_t
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAVE_UINT16_T 1
|
|
||||||
#ifndef HAVE_UINT16_T
|
|
||||||
# define uint16_t uint16_t
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAVE_UINT8_T 1
|
|
||||||
#ifndef HAVE_UINT8_T
|
|
||||||
# define uint8_t uint8_t
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAVE_SSIZE_T 1
|
|
||||||
|
|
||||||
#ifndef HAVE_SSIZE_T
|
|
||||||
# define ssize_t
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define USE_URANDOM 1
|
|
||||||
#define USE_WINDOWS_CRYPTOAPI 1
|
|
||||||
|
|
||||||
#define INITIAL_HASHTABLE_ORDER 3
|
|
@ -1,235 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef INCLUDE_IRC_ERRORS_H
|
|
||||||
#define INCLUDE_IRC_ERRORS_H
|
|
||||||
|
|
||||||
#ifndef IN_INCLUDE_LIBIRC_H
|
|
||||||
#error This file should not be included directly, include just libircclient.h
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*! brief No error
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_OK 0
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Invalid argument
|
|
||||||
*
|
|
||||||
* An invalid value was given for one of the arguments to a function.
|
|
||||||
* For example, supplying the NULL value for \a channel argument of
|
|
||||||
* irc_cmd_join() produces LIBIRC_ERR_INVAL error. You should fix the code.
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_INVAL 1
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Could not resolve host.
|
|
||||||
*
|
|
||||||
* The host name supplied for irc_connect() function could not be resolved
|
|
||||||
* into valid IP address. Usually means that host name is invalid.
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_RESOLV 2
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Could not create socket.
|
|
||||||
*
|
|
||||||
* The new socket could not be created or made non-blocking. Usually means
|
|
||||||
* that the server is out of resources, or (rarely :) a bug in libircclient.
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_SOCKET 3
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Could not connect.
|
|
||||||
*
|
|
||||||
* The socket could not connect to the IRC server, or to the destination DCC
|
|
||||||
* part. Usually means that either the IRC server is down or its address is
|
|
||||||
* invalid. For DCC the reason usually is the firewall on your or destination
|
|
||||||
* computer, which refuses DCC transfer.
|
|
||||||
*
|
|
||||||
* \sa irc_run irc_connect
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_CONNECT 4
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Connection closed by remote peer.
|
|
||||||
*
|
|
||||||
* The IRC connection was closed by the IRC server (which could mean that an
|
|
||||||
* IRC operator just have banned you from the server :)), or the DCC connection
|
|
||||||
* was closed by remote peer - for example, the other side just quits his mIrc.
|
|
||||||
* Usually it is not an error.
|
|
||||||
*
|
|
||||||
* \sa irc_run irc_connect irc_dcc_callback_t
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_CLOSED 5
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Out of memory
|
|
||||||
*
|
|
||||||
* There are two possible reasons for this error. First is that memory could
|
|
||||||
* not be allocated for libircclient use, and this error usually is fatal.
|
|
||||||
* Second reason is that the command queue (which keeps command ready to be
|
|
||||||
* sent to the IRC server) is full, and could not accept more commands yet.
|
|
||||||
* In this case you should just wait, and repeat the command later.
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_NOMEM 6
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Could not accept new connection
|
|
||||||
*
|
|
||||||
* A DCC chat/send connection from the remote peer could not be accepted.
|
|
||||||
* Either the connection was just terminated before it is accepted, or there
|
|
||||||
* is a bug in libircclient.
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_ACCEPT 7
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Could not send this
|
|
||||||
*
|
|
||||||
* A \a filename supplied to irc_dcc_sendfile() could not be sent. Either is
|
|
||||||
* is not a file (a directory or a socket, for example), or it is not readable. *
|
|
||||||
*
|
|
||||||
* \sa LIBIRC_ERR_OPENFILE
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_NODCCSEND 9
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Could not read DCC file or socket
|
|
||||||
*
|
|
||||||
* Either a DCC file could not be read (for example, was truncated during
|
|
||||||
* sending), or a DCC socket returns a read error, which usually means that
|
|
||||||
* the network connection is terminated.
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_READ 10
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Could not write DCC file or socket
|
|
||||||
*
|
|
||||||
* Either a DCC file could not be written (for example, there is no free space
|
|
||||||
* on disk), or a DCC socket returns a write error, which usually means that
|
|
||||||
* the network connection is terminated.
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_WRITE 11
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Invalid state
|
|
||||||
*
|
|
||||||
* The function is called when it is not allowed to be called. For example,
|
|
||||||
* irc_cmd_join() was called before the connection to IRC server succeed, and
|
|
||||||
* ::event_connect is called.
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_STATE 12
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Operation timed out
|
|
||||||
*
|
|
||||||
* The DCC request is timed out.
|
|
||||||
* There is a timer for each DCC request, which tracks connecting, accepting
|
|
||||||
* and non-accepted/declined DCC requests. For every request this timer
|
|
||||||
* is currently 60 seconds. If the DCC request was not connected, accepted
|
|
||||||
* or declined during this time, it will be terminated with this error.
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_TIMEOUT 13
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Could not open file for DCC send
|
|
||||||
*
|
|
||||||
* The file specified in irc_dcc_sendfile() could not be opened.
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_OPENFILE 14
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief IRC server connection terminated
|
|
||||||
*
|
|
||||||
* The connection to the IRC server was terminated - possibly, by network
|
|
||||||
* error. Try to irc_connect() again.
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_TERMINATED 15
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief IPv6 not supported
|
|
||||||
*
|
|
||||||
* The function which requires IPv6 support was called, but the IPv6 support was not compiled
|
|
||||||
* into the application
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_NOIPV6 16
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief SSL not supported
|
|
||||||
*
|
|
||||||
* The SSL connection was required but the library was not compiled with SSL support
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_SSL_NOT_SUPPORTED 17
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief SSL initialization failed
|
|
||||||
*
|
|
||||||
* The SSL connection was required but the library was not compiled with SSL support
|
|
||||||
*
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_SSL_INIT_FAILED 18
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief SSL connection failed
|
|
||||||
*
|
|
||||||
* SSL handshare failed when attempting to connect to the server. Typically this means you're trying
|
|
||||||
* to use SSL but attempting to connect to a non-SSL port.
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_CONNECT_SSL_FAILED 19
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief SSL certificate verify failed
|
|
||||||
*
|
|
||||||
* The server is using the self-signed certificate. Use LIBIRC_OPTION_SSL_NO_VERIFY option to connect to it.
|
|
||||||
* \ingroup errorcodes
|
|
||||||
*/
|
|
||||||
#define LIBIRC_ERR_SSL_CERT_VERIFY_FAILED 20
|
|
||||||
|
|
||||||
|
|
||||||
// Internal max error value count.
|
|
||||||
// If you added more errors, add them to errors.c too!
|
|
||||||
#define LIBIRC_ERR_MAX 21
|
|
||||||
|
|
||||||
#endif /* INCLUDE_IRC_ERRORS_H */
|
|
@ -1,389 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef INCLUDE_IRC_EVENTS_H
|
|
||||||
#define INCLUDE_IRC_EVENTS_H
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef IN_INCLUDE_LIBIRC_H
|
|
||||||
#error This file should not be included directly, include just libircclient.h
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \fn typedef void (*irc_event_callback_t) (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count)
|
|
||||||
* \brief A most common event callback
|
|
||||||
*
|
|
||||||
* \param session the session, which generates an event
|
|
||||||
* \param event the text name of the event. Useful in case you use a single
|
|
||||||
* event handler for several events simultaneously.
|
|
||||||
* \param origin the originator of the event. See the note below.
|
|
||||||
* \param params a list of event params. Depending on the event nature, it
|
|
||||||
* could have zero or more params. The actual number of params
|
|
||||||
* is specified in count. None of the params can be NULL, but
|
|
||||||
* 'params' pointer itself could be NULL for some events.
|
|
||||||
* \param count the total number of params supplied.
|
|
||||||
*
|
|
||||||
* Every event generates a callback. This callback is generated by most events.
|
|
||||||
* Depending on the event nature, it can provide zero or more params. For each
|
|
||||||
* event, the number of provided params is fixed, and their meaning is
|
|
||||||
* described.
|
|
||||||
*
|
|
||||||
* Every event has origin, though the \a origin variable may be NULL, which
|
|
||||||
* means that event origin is unknown. The origin usually looks like
|
|
||||||
* nick!host\@ircserver, i.e. like tim!home\@irc.krasnogorsk.ru. Such origins
|
|
||||||
* can not be used in IRC commands, and need to be stripped (i.e. host and
|
|
||||||
* server part should be cut off) before using. This can be done either
|
|
||||||
* explicitly, by calling irc_target_get_nick(), or implicitly for all the
|
|
||||||
* events - by setting the #LIBIRC_OPTION_STRIPNICKS option with irc_option_set().
|
|
||||||
*
|
|
||||||
* \ingroup events
|
|
||||||
*/
|
|
||||||
typedef void (*irc_event_callback_t) (irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count);
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \fn typedef void (*irc_eventcode_callback_t) (irc_session_t * session, unsigned int event, const char * origin, const char ** params, unsigned int count)
|
|
||||||
* \brief A numeric event callback
|
|
||||||
*
|
|
||||||
* \param session the session, which generates an event
|
|
||||||
* \param event the numeric code of the event. Useful in case you use a
|
|
||||||
* single event handler for several events simultaneously.
|
|
||||||
* \param origin the originator of the event. See the note below.
|
|
||||||
* \param params a list of event params. Depending on the event nature, it
|
|
||||||
* could have zero or more params. The actual number of params
|
|
||||||
* is specified in count. None of the params can be NULL, but
|
|
||||||
* 'params' pointer itself could be NULL for some events.
|
|
||||||
* \param count the total number of params supplied.
|
|
||||||
*
|
|
||||||
* Most times in reply to your actions the IRC server generates numeric
|
|
||||||
* callbacks. Most of them are error codes, and some of them mark list start
|
|
||||||
* and list stop markers. Every code has its own set of params; for details
|
|
||||||
* you can either experiment, or read RFC 1459.
|
|
||||||
*
|
|
||||||
* Every event has origin, though the \a origin variable may be NULL, which
|
|
||||||
* means that event origin is unknown. The origin usually looks like
|
|
||||||
* nick!host\@ircserver, i.e. like tim!home\@irc.krasnogorsk.ru. Such origins
|
|
||||||
* can not be used in IRC commands, and need to be stripped (i.e. host and
|
|
||||||
* server part should be cut off) before using. This can be done either
|
|
||||||
* explicitly, by calling irc_target_get_nick(), or implicitly for all the
|
|
||||||
* events - by setting the #LIBIRC_OPTION_STRIPNICKS option with irc_option_set().
|
|
||||||
*
|
|
||||||
* \ingroup events
|
|
||||||
*/
|
|
||||||
typedef void (*irc_eventcode_callback_t) (irc_session_t * session, unsigned int event, const char * origin, const char ** params, unsigned int count);
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \fn typedef void (*irc_event_dcc_chat_t) (irc_session_t * session, const char * nick, const char * addr, irc_dcc_t dccid)
|
|
||||||
* \brief A remote DCC CHAT request callback
|
|
||||||
*
|
|
||||||
* \param session the session, which generates an event
|
|
||||||
* \param nick the person who requested DCC CHAT with you.
|
|
||||||
* \param addr the person's IP address in decimal-dot notation.
|
|
||||||
* \param dccid an id associated with this request. Use it in calls to
|
|
||||||
* irc_dcc_accept() or irc_dcc_decline().
|
|
||||||
*
|
|
||||||
* This callback is called when someone requests DCC CHAT with you. In respond
|
|
||||||
* you should call either irc_dcc_accept() to accept chat request, or
|
|
||||||
* irc_dcc_decline() to decline chat request.
|
|
||||||
*
|
|
||||||
* \sa irc_dcc_accept or irc_dcc_decline
|
|
||||||
* \ingroup events
|
|
||||||
*/
|
|
||||||
typedef void (*irc_event_dcc_chat_t) (irc_session_t * session, const char * nick, const char * addr, irc_dcc_t dccid);
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \fn typedef void (*irc_event_dcc_send_t) (irc_session_t * session, const char * nick, const char * addr, const char * filename, unsigned long size, irc_dcc_t dccid)
|
|
||||||
* \brief A remote DCC CHAT request callback
|
|
||||||
*
|
|
||||||
* \param session the session, which generates an event
|
|
||||||
* \param nick the person who requested DCC CHAT with you.
|
|
||||||
* \param addr the person's IP address in decimal-dot notation.
|
|
||||||
* \param filename the sent filename.
|
|
||||||
* \param size the filename size.
|
|
||||||
* \param dccid an id associated with this request. Use it in calls to
|
|
||||||
* irc_dcc_accept() or irc_dcc_decline().
|
|
||||||
*
|
|
||||||
* This callback is called when someone wants to send a file to you using
|
|
||||||
* DCC SEND. As with chat, in respond you should call either irc_dcc_accept()
|
|
||||||
* to accept this request and receive the file, or irc_dcc_decline() to
|
|
||||||
* decline this request.
|
|
||||||
*
|
|
||||||
* \sa irc_dcc_accept or irc_dcc_decline
|
|
||||||
* \ingroup events
|
|
||||||
*/
|
|
||||||
typedef void (*irc_event_dcc_send_t) (irc_session_t * session, const char * nick, const char * addr, const char * filename, unsigned long size, irc_dcc_t dccid);
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Event callbacks structure.
|
|
||||||
*
|
|
||||||
* All the communication with the IRC network is based on events. Generally
|
|
||||||
* speaking, event is anything generated by someone else in the network,
|
|
||||||
* or by the IRC server itself. "Someone sends you a message", "Someone
|
|
||||||
* has joined the channel", "Someone has quits IRC" - all these messages
|
|
||||||
* are events.
|
|
||||||
*
|
|
||||||
* Every event has its own event handler, which is called when the
|
|
||||||
* appropriate event is received. You don't have to define all the event
|
|
||||||
* handlers; define only the handlers for the events you need to intercept.
|
|
||||||
*
|
|
||||||
* Most event callbacks are the types of ::irc_event_callback_t. There are
|
|
||||||
* also events, which generate ::irc_eventcode_callback_t,
|
|
||||||
* ::irc_event_dcc_chat_t and ::irc_event_dcc_send_t callbacks.
|
|
||||||
*
|
|
||||||
* \ingroup events
|
|
||||||
*/
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
/*!
|
|
||||||
* The "on_connect" event is triggered when the client successfully
|
|
||||||
* connects to the server, and could send commands to the server.
|
|
||||||
* No extra params supplied; \a params is 0.
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_connect;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "nick" event is triggered when the client receives a NICK message,
|
|
||||||
* meaning that someone (including you) on a channel with the client has
|
|
||||||
* changed their nickname.
|
|
||||||
*
|
|
||||||
* \param origin the person, who changes the nick. Note that it can be you!
|
|
||||||
* \param params[0] mandatory, contains the new nick.
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_nick;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "quit" event is triggered upon receipt of a QUIT message, which
|
|
||||||
* means that someone on a channel with the client has disconnected.
|
|
||||||
*
|
|
||||||
* \param origin the person, who is disconnected
|
|
||||||
* \param params[0] optional, contains the reason message (user-specified).
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_quit;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "join" event is triggered upon receipt of a JOIN message, which
|
|
||||||
* means that someone has entered a channel that the client is on.
|
|
||||||
*
|
|
||||||
* \param origin the person, who joins the channel. By comparing it with
|
|
||||||
* your own nickname, you can check whether your JOIN
|
|
||||||
* command succeed.
|
|
||||||
* \param params[0] mandatory, contains the channel name.
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_join;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "part" event is triggered upon receipt of a PART message, which
|
|
||||||
* means that someone has left a channel that the client is on.
|
|
||||||
*
|
|
||||||
* \param origin the person, who leaves the channel. By comparing it with
|
|
||||||
* your own nickname, you can check whether your PART
|
|
||||||
* command succeed.
|
|
||||||
* \param params[0] mandatory, contains the channel name.
|
|
||||||
* \param params[1] optional, contains the reason message (user-defined).
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_part;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "mode" event is triggered upon receipt of a channel MODE message,
|
|
||||||
* which means that someone on a channel with the client has changed the
|
|
||||||
* channel's parameters.
|
|
||||||
*
|
|
||||||
* \param origin the person, who changed the channel mode.
|
|
||||||
* \param params[0] mandatory, contains the channel name.
|
|
||||||
* \param params[1] mandatory, contains the changed channel mode, like
|
|
||||||
* '+t', '-i' and so on.
|
|
||||||
* \param params[2] optional, contains the mode argument (for example, a
|
|
||||||
* key for +k mode, or user who got the channel operator status for
|
|
||||||
* +o mode)
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_mode;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "umode" event is triggered upon receipt of a user MODE message,
|
|
||||||
* which means that your user mode has been changed.
|
|
||||||
*
|
|
||||||
* \param origin the person, who changed the channel mode.
|
|
||||||
* \param params[0] mandatory, contains the user changed mode, like
|
|
||||||
* '+t', '-i' and so on.
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_umode;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "topic" event is triggered upon receipt of a TOPIC message, which
|
|
||||||
* means that someone on a channel with the client has changed the
|
|
||||||
* channel's topic.
|
|
||||||
*
|
|
||||||
* \param origin the person, who changes the channel topic.
|
|
||||||
* \param params[0] mandatory, contains the channel name.
|
|
||||||
* \param params[1] optional, contains the new topic.
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_topic;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "kick" event is triggered upon receipt of a KICK message, which
|
|
||||||
* means that someone on a channel with the client (or possibly the
|
|
||||||
* client itself!) has been forcibly ejected.
|
|
||||||
*
|
|
||||||
* \param origin the person, who kicked the poor.
|
|
||||||
* \param params[0] mandatory, contains the channel name.
|
|
||||||
* \param params[0] optional, contains the nick of kicked person.
|
|
||||||
* \param params[1] optional, contains the kick text
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_kick;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "channel" event is triggered upon receipt of a PRIVMSG message
|
|
||||||
* to an entire channel, which means that someone on a channel with
|
|
||||||
* the client has said something aloud. Your own messages don't trigger
|
|
||||||
* PRIVMSG event.
|
|
||||||
*
|
|
||||||
* \param origin the person, who generates the message.
|
|
||||||
* \param params[0] mandatory, contains the channel name.
|
|
||||||
* \param params[1] optional, contains the message text
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_channel;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "privmsg" event is triggered upon receipt of a PRIVMSG message
|
|
||||||
* which is addressed to one or more clients, which means that someone
|
|
||||||
* is sending the client a private message.
|
|
||||||
*
|
|
||||||
* \param origin the person, who generates the message.
|
|
||||||
* \param params[0] mandatory, contains your nick.
|
|
||||||
* \param params[1] optional, contains the message text
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_privmsg;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "notice" event is triggered upon receipt of a NOTICE message
|
|
||||||
* which means that someone has sent the client a public or private
|
|
||||||
* notice. According to RFC 1459, the only difference between NOTICE
|
|
||||||
* and PRIVMSG is that you should NEVER automatically reply to NOTICE
|
|
||||||
* messages. Unfortunately, this rule is frequently violated by IRC
|
|
||||||
* servers itself - for example, NICKSERV messages require reply, and
|
|
||||||
* are NOTICEs.
|
|
||||||
*
|
|
||||||
* \param origin the person, who generates the message.
|
|
||||||
* \param params[0] mandatory, contains the target nick name.
|
|
||||||
* \param params[1] optional, contains the message text
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_notice;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "channel_notice" event is triggered upon receipt of a NOTICE
|
|
||||||
* message which means that someone has sent the client a public
|
|
||||||
* notice. According to RFC 1459, the only difference between NOTICE
|
|
||||||
* and PRIVMSG is that you should NEVER automatically reply to NOTICE
|
|
||||||
* messages. Unfortunately, this rule is frequently violated by IRC
|
|
||||||
* servers itself - for example, NICKSERV messages require reply, and
|
|
||||||
* are NOTICEs.
|
|
||||||
*
|
|
||||||
* \param origin the person, who generates the message.
|
|
||||||
* \param params[0] mandatory, contains the channel name.
|
|
||||||
* \param params[1] optional, contains the message text
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_channel_notice;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "invite" event is triggered upon receipt of an INVITE message,
|
|
||||||
* which means that someone is permitting the client's entry into a +i
|
|
||||||
* channel.
|
|
||||||
*
|
|
||||||
* \param origin the person, who INVITEs you.
|
|
||||||
* \param params[0] mandatory, contains your nick.
|
|
||||||
* \param params[1] mandatory, contains the channel name you're invited into.
|
|
||||||
*
|
|
||||||
* \sa irc_cmd_invite irc_cmd_chanmode_invite
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_invite;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "ctcp" event is triggered when the client receives the CTCP
|
|
||||||
* request. By default, the built-in CTCP request handler is used. The
|
|
||||||
* build-in handler automatically replies on most CTCP messages, so you
|
|
||||||
* will rarely need to override it.
|
|
||||||
*
|
|
||||||
* \param origin the person, who generates the message.
|
|
||||||
* \param params[0] mandatory, the complete CTCP message, including its
|
|
||||||
* arguments.
|
|
||||||
*
|
|
||||||
* Mirc generates PING, FINGER, VERSION, TIME and ACTION messages,
|
|
||||||
* check the source code of \c libirc_event_ctcp_internal function to
|
|
||||||
* see how to write your own CTCP request handler. Also you may find
|
|
||||||
* useful this question in FAQ: \ref faq4
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_ctcp_req;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "ctcp" event is triggered when the client receives the CTCP reply.
|
|
||||||
*
|
|
||||||
* \param origin the person, who generates the message.
|
|
||||||
* \param params[0] mandatory, the CTCP message itself with its arguments.
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_ctcp_rep;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "action" event is triggered when the client receives the CTCP
|
|
||||||
* ACTION message. These messages usually looks like:\n
|
|
||||||
* \code
|
|
||||||
* [23:32:55] * Tim gonna sleep.
|
|
||||||
* \endcode
|
|
||||||
*
|
|
||||||
* \param origin the person, who generates the message.
|
|
||||||
* \param params[0] mandatory, the ACTION message.
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_ctcp_action;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "unknown" event is triggered upon receipt of any number of
|
|
||||||
* unclassifiable miscellaneous messages, which aren't handled by the
|
|
||||||
* library.
|
|
||||||
*/
|
|
||||||
irc_event_callback_t event_unknown;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "numeric" event is triggered upon receipt of any numeric response
|
|
||||||
* from the server. There is a lot of such responses, see the full list
|
|
||||||
* here: \ref rfcnumbers.
|
|
||||||
*
|
|
||||||
* See the params in ::irc_eventcode_callback_t specification.
|
|
||||||
*/
|
|
||||||
irc_eventcode_callback_t event_numeric;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "dcc chat" event is triggered when someone requests a DCC CHAT from
|
|
||||||
* you.
|
|
||||||
*
|
|
||||||
* See the params in ::irc_event_dcc_chat_t specification.
|
|
||||||
*/
|
|
||||||
irc_event_dcc_chat_t event_dcc_chat_req;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The "dcc chat" event is triggered when someone wants to send a file
|
|
||||||
* to you via DCC SEND request.
|
|
||||||
*
|
|
||||||
* See the params in ::irc_event_dcc_send_t specification.
|
|
||||||
*/
|
|
||||||
irc_event_dcc_send_t event_dcc_send_req;
|
|
||||||
|
|
||||||
|
|
||||||
} irc_callbacks_t;
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* INCLUDE_IRC_EVENTS_H */
|
|
@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
||||||
* License for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef INCLUDE_IRC_OPTIONS_H
|
|
||||||
#define INCLUDE_IRC_OPTIONS_H
|
|
||||||
|
|
||||||
#ifndef IN_INCLUDE_LIBIRC_H
|
|
||||||
#error This file should not be included directly, include just libircclient.h
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* enables additional debug output
|
|
||||||
* \ingroup options
|
|
||||||
*/
|
|
||||||
#define LIBIRC_OPTION_DEBUG (1 << 1)
|
|
||||||
|
|
||||||
/*! \brief allows to strip origins automatically.
|
|
||||||
*
|
|
||||||
* For every IRC server event, the event origin is sent in standard form:
|
|
||||||
* nick!host\@ircserver, i.e. like tim!home\@irc.freenet.org. Such origins
|
|
||||||
* can not be used in IRC commands, and need to be stripped (i.e. host and
|
|
||||||
* server part should be cut off) before using. This can be done either
|
|
||||||
* explicitly, by calling irc_target_get_nick(), or implicitly for all the
|
|
||||||
* events - by setting this option with irc_option_set().
|
|
||||||
* \ingroup options
|
|
||||||
*/
|
|
||||||
#define LIBIRC_OPTION_STRIPNICKS (1 << 2)
|
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Disables the certificate verification for SSL connections
|
|
||||||
*
|
|
||||||
* By default the SSL connection authenticy is ensured by verifying that the certificate
|
|
||||||
* presented by the server is signed by a known trusted certificate authority. Since those
|
|
||||||
* typically cost money, some IRC servers use the self-signed certificates. They provide the
|
|
||||||
* benefits of the SSL connection but since they are not signed by the Certificate Authority,
|
|
||||||
* their authencity cannot be verified. This option, if set, disables the certificate
|
|
||||||
* verification - the library will accept any certificate presented by the server.
|
|
||||||
*
|
|
||||||
* This option must be set before the irc_connect function is called.
|
|
||||||
* \ingroup options
|
|
||||||
*/
|
|
||||||
#define LIBIRC_OPTION_SSL_NO_VERIFY (1 << 3)
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* INCLUDE_IRC_OPTIONS_H */
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -19,21 +19,21 @@ const AABB AABB::MAX = AABB(HUGE_VALF, -HUGE_VALF);
|
|||||||
SQChar AABB::Delim = ',';
|
SQChar AABB::Delim = ',';
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB::AABB()
|
AABB::AABB() noexcept
|
||||||
: min(HUGE_VALF), max(-HUGE_VALF)
|
: min(HUGE_VALF), max(-HUGE_VALF)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB::AABB(Value mins, Value maxs)
|
AABB::AABB(Value mins, Value maxs) noexcept
|
||||||
: min(mins), max(maxs)
|
: min(mins), max(maxs)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB::AABB(Value xv, Value yv, Value zv)
|
AABB::AABB(Value xv, Value yv, Value zv) noexcept
|
||||||
: min(xv, yv, zv)
|
: min(xv, yv, zv)
|
||||||
, max(xv, yv, zv)
|
, max(xv, yv, zv)
|
||||||
{
|
{
|
||||||
@ -41,14 +41,14 @@ AABB::AABB(Value xv, Value yv, Value zv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB::AABB(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax)
|
AABB::AABB(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax) noexcept
|
||||||
: min(xmin, ymin, zmin), max(xmax, ymax, zmax)
|
: min(xmin, ymin, zmin), max(xmax, ymax, zmax)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB::AABB(const Vector3 & vmin, const Vector3 & vmax)
|
AABB::AABB(const Vector3 & vmin, const Vector3 & vmax) noexcept
|
||||||
: min(vmin), max(vmax)
|
: min(vmin), max(vmax)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -158,7 +158,7 @@ AABB & AABB::operator -- ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator ++ (int)
|
AABB AABB::operator ++ (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
AABB state(*this);
|
AABB state(*this);
|
||||||
++min;
|
++min;
|
||||||
@ -167,7 +167,7 @@ AABB AABB::operator ++ (int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator -- (int)
|
AABB AABB::operator -- (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
AABB state(*this);
|
AABB state(*this);
|
||||||
--min;
|
--min;
|
||||||
@ -178,73 +178,73 @@ AABB AABB::operator -- (int)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator + (const AABB & b) const
|
AABB AABB::operator + (const AABB & b) const
|
||||||
{
|
{
|
||||||
return AABB(min + b.min, max + b.max);
|
return {min + b.min, max + b.max};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator - (const AABB & b) const
|
AABB AABB::operator - (const AABB & b) const
|
||||||
{
|
{
|
||||||
return AABB(min - b.min, max - b.max);
|
return AABB{min - b.min, max - b.max};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator * (const AABB & b) const
|
AABB AABB::operator * (const AABB & b) const
|
||||||
{
|
{
|
||||||
return AABB(min * b.min, max * b.max);
|
return AABB{min * b.min, max * b.max};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator / (const AABB & b) const
|
AABB AABB::operator / (const AABB & b) const
|
||||||
{
|
{
|
||||||
return AABB(min / b.min, max / b.max);
|
return AABB{min / b.min, max / b.max};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator % (const AABB & b) const
|
AABB AABB::operator % (const AABB & b) const
|
||||||
{
|
{
|
||||||
return AABB(min % b.min, max % b.max);
|
return AABB{min % b.min, max % b.max};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator + (Value s) const
|
AABB AABB::operator + (Value s) const
|
||||||
{
|
{
|
||||||
return AABB(min + s, max + s);
|
return AABB{min + s, max + s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator - (Value s) const
|
AABB AABB::operator - (Value s) const
|
||||||
{
|
{
|
||||||
return AABB(min - s, max - s);
|
return AABB{min - s, max - s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator * (Value s) const
|
AABB AABB::operator * (Value s) const
|
||||||
{
|
{
|
||||||
return AABB(min * s, max * s);
|
return AABB{min * s, max * s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator / (Value s) const
|
AABB AABB::operator / (Value s) const
|
||||||
{
|
{
|
||||||
return AABB(min / s, max / s);
|
return AABB{min / s, max / s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator % (Value s) const
|
AABB AABB::operator % (Value s) const
|
||||||
{
|
{
|
||||||
return AABB(min % s, max % s);
|
return AABB{min % s, max % s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator + () const
|
AABB AABB::operator + () const
|
||||||
{
|
{
|
||||||
return AABB(min.Abs(), max.Abs());
|
return AABB{min.Abs(), max.Abs()};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
AABB AABB::operator - () const
|
AABB AABB::operator - () const
|
||||||
{
|
{
|
||||||
return AABB(-min, -max);
|
return AABB{-min, -max};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -764,56 +764,11 @@ const AABB & AABB::GetEx(SQChar delim, StackStrF & str)
|
|||||||
return box;
|
return box;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const AABB & GetAABB()
|
|
||||||
{
|
|
||||||
static AABB box;
|
|
||||||
box.Clear();
|
|
||||||
return box;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const AABB & GetAABB(Float32 mins, Float32 maxs)
|
|
||||||
{
|
|
||||||
static AABB box;
|
|
||||||
box.DefineScalar(mins, maxs);
|
|
||||||
return box;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const AABB & GetAABB(Float32 xv, Float32 yv, Float32 zv)
|
|
||||||
{
|
|
||||||
static AABB box;
|
|
||||||
box.DefineVector3Ex(xv, yv, zv);
|
|
||||||
return box;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const AABB & GetAABB(Float32 xmin, Float32 ymin, Float32 zmin, Float32 xmax, Float32 ymax, Float32 zmax)
|
|
||||||
{
|
|
||||||
static AABB box;
|
|
||||||
box.DefineAllVector3Ex(xmin, ymin, zmin, xmax, ymax, zmax);
|
|
||||||
return box;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const AABB & GetAABB(const Vector3 & vmin, const Vector3 & vmax)
|
|
||||||
{
|
|
||||||
static AABB box;
|
|
||||||
box.DefineAllVector3(vmin, vmax);
|
|
||||||
return box;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const AABB & GetAABB(const AABB & o)
|
|
||||||
{
|
|
||||||
static AABB box;
|
|
||||||
box.DefineAABB(o);
|
|
||||||
return box;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||||
void Register_AABB(HSQUIRRELVM vm)
|
void Register_AABB(HSQUIRRELVM vm)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
{
|
{
|
||||||
typedef AABB::Value Val;
|
typedef AABB::Value Val;
|
||||||
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef _BASE_AABB_HPP_
|
#pragma once
|
||||||
#define _BASE_AABB_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include "Base/Vector3.hpp"
|
#include "Base/Vector3.hpp"
|
||||||
@ -37,40 +36,40 @@ struct AABB
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct with zero size.
|
* Construct with zero size.
|
||||||
*/
|
*/
|
||||||
AABB();
|
AABB() noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a an equally sized and perfectly shaped box from scalar values.
|
* Construct a an equally sized and perfectly shaped box from scalar values.
|
||||||
*/
|
*/
|
||||||
explicit AABB(Value mins, Value maxs);
|
explicit AABB(Value mins, Value maxs) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a an equally sized but imperfectly shaped box from individual components of a
|
* Construct a an equally sized but imperfectly shaped box from individual components of a
|
||||||
* three-dimensional point.
|
* three-dimensional point.
|
||||||
*/
|
*/
|
||||||
AABB(Value xv, Value yv, Value zv);
|
AABB(Value xv, Value yv, Value zv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a an unequally sized and imperfectly shaped box from individual components of two
|
* Construct a an unequally sized and imperfectly shaped box from individual components of two
|
||||||
* three-dimensional points.
|
* three-dimensional points.
|
||||||
*/
|
*/
|
||||||
AABB(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax);
|
AABB(Value xmin, Value ymin, Value zmin, Value xmax, Value ymax, Value zmax) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a an unequally sized and imperfectly shaped box from two three-dimensional
|
* Construct a an unequally sized and imperfectly shaped box from two three-dimensional
|
||||||
* vectors representing two three-dimensional points.
|
* vectors representing two three-dimensional points.
|
||||||
*/
|
*/
|
||||||
AABB(const Vector3 & vmin, const Vector3 & vmax);
|
AABB(const Vector3 & vmin, const Vector3 & vmax) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy constructor.
|
* Copy constructor.
|
||||||
*/
|
*/
|
||||||
AABB(const AABB & o) = default;
|
AABB(const AABB & o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Move constructor.
|
* Move constructor.
|
||||||
*/
|
*/
|
||||||
AABB(AABB && o) = default;
|
AABB(AABB && o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Destructor.
|
* Destructor.
|
||||||
@ -155,12 +154,12 @@ struct AABB
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-increment operator.
|
* Post-increment operator.
|
||||||
*/
|
*/
|
||||||
AABB operator ++ (int);
|
AABB operator ++ (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-decrement operator.
|
* Post-decrement operator.
|
||||||
*/
|
*/
|
||||||
AABB operator -- (int);
|
AABB operator -- (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Addition operator.
|
* Addition operator.
|
||||||
@ -270,7 +269,7 @@ struct AABB
|
|||||||
*/
|
*/
|
||||||
Int32 Cmp(SQInteger s) const
|
Int32 Cmp(SQInteger s) const
|
||||||
{
|
{
|
||||||
const Value v = static_cast< Value >(s);
|
const auto v = static_cast< Value >(s);
|
||||||
return Cmp(AABB(v, v, v, v, v, v));
|
return Cmp(AABB(v, v, v, v, v, v));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,7 +278,7 @@ struct AABB
|
|||||||
*/
|
*/
|
||||||
Int32 Cmp(bool s) const
|
Int32 Cmp(bool s) const
|
||||||
{
|
{
|
||||||
const Value v = static_cast< Value >(s);
|
const auto v = static_cast< Value >(s);
|
||||||
return Cmp(AABB(v, v, v, v, v, v));
|
return Cmp(AABB(v, v, v, v, v, v));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,7 +287,7 @@ struct AABB
|
|||||||
*/
|
*/
|
||||||
Int32 Cmp(std::nullptr_t) const
|
Int32 Cmp(std::nullptr_t) const
|
||||||
{
|
{
|
||||||
const Value v = static_cast< Value >(0);
|
const auto v = static_cast< Value >(0);
|
||||||
return Cmp(AABB(v, v, v, v, v, v));
|
return Cmp(AABB(v, v, v, v, v, v));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -479,5 +478,3 @@ struct AABB
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_AABB_HPP_
|
|
@ -17,11 +17,11 @@ namespace SqMod {
|
|||||||
inline unsigned int NextPow2(unsigned int num)
|
inline unsigned int NextPow2(unsigned int num)
|
||||||
{
|
{
|
||||||
--num;
|
--num;
|
||||||
num |= num >> 1;
|
num |= num >> 1u;
|
||||||
num |= num >> 2;
|
num |= num >> 2u;
|
||||||
num |= num >> 4;
|
num |= num >> 4u;
|
||||||
num |= num >> 8;
|
num |= num >> 8u;
|
||||||
num |= num >> 16;
|
num |= num >> 16u;
|
||||||
return ++num;
|
return ++num;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,10 +41,10 @@ void ThrowMemExcept(const char * msg, ...)
|
|||||||
// Check for formatting errors
|
// Check for formatting errors
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
throw Sqrat::Exception(_SC("Unknown memory error"));
|
throw Sqrat::Exception(_SC("Unknown memory error")); // NOLINT(hicpp-exception-baseclass,cert-err60-cpp)
|
||||||
}
|
}
|
||||||
// Throw the actual exception
|
// Throw the actual exception
|
||||||
throw Sqrat::Exception(buffer);
|
throw Sqrat::Exception(buffer); // NOLINT(hicpp-exception-baseclass,cert-err60-cpp)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
@ -53,7 +53,7 @@ void ThrowMemExcept(const char * msg, ...)
|
|||||||
static Buffer::Pointer AllocMem(Buffer::SzType size)
|
static Buffer::Pointer AllocMem(Buffer::SzType size)
|
||||||
{
|
{
|
||||||
// Attempt to allocate memory directly
|
// Attempt to allocate memory directly
|
||||||
Buffer::Pointer ptr = reinterpret_cast< Buffer::Pointer >(std::malloc(size));
|
auto ptr = reinterpret_cast< Buffer::Pointer >(std::malloc(size));
|
||||||
// Validate the allocated memory
|
// Validate the allocated memory
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
{
|
{
|
||||||
@ -103,7 +103,7 @@ private:
|
|||||||
/* ----------------------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------------------
|
||||||
* Base constructor.
|
* Base constructor.
|
||||||
*/
|
*/
|
||||||
Node(Node * next)
|
explicit Node(Node * next)
|
||||||
: mCap(0)
|
: mCap(0)
|
||||||
, mPtr(nullptr)
|
, mPtr(nullptr)
|
||||||
, mNext(next)
|
, mNext(next)
|
||||||
@ -282,10 +282,13 @@ private:
|
|||||||
{
|
{
|
||||||
ThrowMemExcept("Attempting to push invalid node");
|
ThrowMemExcept("Attempting to push invalid node");
|
||||||
}
|
}
|
||||||
// Demote the current head node
|
else
|
||||||
node->mNext = s_Nodes;
|
{
|
||||||
// Promote as the head node
|
// Demote the current head node
|
||||||
s_Nodes = node;
|
node->mNext = s_Nodes;
|
||||||
|
// Promote as the head node
|
||||||
|
s_Nodes = node;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -400,7 +403,7 @@ Buffer::~Buffer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Buffer & Buffer::operator = (const Buffer & o)
|
Buffer & Buffer::operator = (const Buffer & o) // NOLINT(cert-oop54-cpp)
|
||||||
{
|
{
|
||||||
if (m_Ptr != o.m_Ptr)
|
if (m_Ptr != o.m_Ptr)
|
||||||
{
|
{
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef _BASE_BUFFER_HPP_
|
#pragma once
|
||||||
#define _BASE_BUFFER_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
@ -53,7 +52,7 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Default constructor (null).
|
* Default constructor (null).
|
||||||
*/
|
*/
|
||||||
MemRef()
|
MemRef() noexcept
|
||||||
: m_Ptr(s_Mem.m_Ptr)
|
: m_Ptr(s_Mem.m_Ptr)
|
||||||
, m_Ref(s_Mem.m_Ref)
|
, m_Ref(s_Mem.m_Ref)
|
||||||
{
|
{
|
||||||
@ -63,7 +62,7 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy constructor.
|
* Copy constructor.
|
||||||
*/
|
*/
|
||||||
MemRef(const MemRef & o)
|
MemRef(const MemRef & o) noexcept
|
||||||
: m_Ptr(o.m_Ptr)
|
: m_Ptr(o.m_Ptr)
|
||||||
, m_Ref(o.m_Ref)
|
, m_Ref(o.m_Ref)
|
||||||
|
|
||||||
@ -74,7 +73,7 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Move constructor.
|
* Move constructor.
|
||||||
*/
|
*/
|
||||||
MemRef(MemRef && o)
|
MemRef(MemRef && o) noexcept
|
||||||
: m_Ptr(o.m_Ptr), m_Ref(o.m_Ref)
|
: m_Ptr(o.m_Ptr), m_Ref(o.m_Ref)
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -93,7 +92,7 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy assignment operator.
|
* Copy assignment operator.
|
||||||
*/
|
*/
|
||||||
MemRef & operator = (const MemRef & o)
|
MemRef & operator = (const MemRef & o) noexcept // NOLINT(bugprone-unhandled-self-assignment,cert-oop54-cpp)
|
||||||
{
|
{
|
||||||
if (m_Ptr != o.m_Ptr)
|
if (m_Ptr != o.m_Ptr)
|
||||||
{
|
{
|
||||||
@ -108,7 +107,7 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Move assignment operator.
|
* Move assignment operator.
|
||||||
*/
|
*/
|
||||||
MemRef & operator = (MemRef && o)
|
MemRef & operator = (MemRef && o) noexcept
|
||||||
{
|
{
|
||||||
if (m_Ptr != o.m_Ptr)
|
if (m_Ptr != o.m_Ptr)
|
||||||
{
|
{
|
||||||
@ -140,9 +139,9 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Implicit conversion to boolean for use in boolean operations.
|
* Implicit conversion to boolean for use in boolean operations.
|
||||||
*/
|
*/
|
||||||
operator bool () const
|
operator bool () const // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
{
|
{
|
||||||
return m_Ptr;
|
return static_cast<bool>(m_Ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
@ -204,11 +203,11 @@ private:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct and take ownership of the specified buffer.
|
* Construct and take ownership of the specified buffer.
|
||||||
*/
|
*/
|
||||||
Buffer(Pointer & ptr, SzType & cap, SzType & cur, const MemRef & mem)
|
Buffer(Pointer & ptr, SzType & cap, SzType & cur, MemRef mem)
|
||||||
: m_Ptr(ptr)
|
: m_Ptr(ptr)
|
||||||
, m_Cap(cap)
|
, m_Cap(cap)
|
||||||
, m_Cur(cur)
|
, m_Cur(cur)
|
||||||
, m_Mem(mem)
|
, m_Mem(std::move(mem))
|
||||||
{
|
{
|
||||||
ptr = nullptr;
|
ptr = nullptr;
|
||||||
cap = 0;
|
cap = 0;
|
||||||
@ -240,7 +239,7 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Explicit size constructor.
|
* Explicit size constructor.
|
||||||
*/
|
*/
|
||||||
Buffer(SzType size)
|
explicit Buffer(SzType size)
|
||||||
: m_Ptr(nullptr)
|
: m_Ptr(nullptr)
|
||||||
, m_Cap(0)
|
, m_Cap(0)
|
||||||
, m_Cur(0)
|
, m_Cur(0)
|
||||||
@ -297,11 +296,11 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Move constructor.
|
* Move constructor.
|
||||||
*/
|
*/
|
||||||
Buffer(Buffer && o)
|
Buffer(Buffer && o) noexcept
|
||||||
: m_Ptr(o.m_Ptr)
|
: m_Ptr(o.m_Ptr)
|
||||||
, m_Cap(o.m_Cap)
|
, m_Cap(o.m_Cap)
|
||||||
, m_Cur(o.m_Cur)
|
, m_Cur(o.m_Cur)
|
||||||
, m_Mem(o.m_Mem)
|
, m_Mem(std::forward< MemRef >(o.m_Mem))
|
||||||
{
|
{
|
||||||
o.m_Ptr = nullptr;
|
o.m_Ptr = nullptr;
|
||||||
}
|
}
|
||||||
@ -319,7 +318,7 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy assignment operator.
|
* Copy assignment operator.
|
||||||
*/
|
*/
|
||||||
Buffer & operator = (Buffer && o)
|
Buffer & operator = (Buffer && o) noexcept
|
||||||
{
|
{
|
||||||
if (m_Ptr != o.m_Ptr)
|
if (m_Ptr != o.m_Ptr)
|
||||||
{
|
{
|
||||||
@ -387,7 +386,7 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Implicit conversion to boolean.
|
* Implicit conversion to boolean.
|
||||||
*/
|
*/
|
||||||
operator bool () const
|
explicit operator bool () const // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
{
|
{
|
||||||
return (m_Ptr != nullptr);
|
return (m_Ptr != nullptr);
|
||||||
}
|
}
|
||||||
@ -1022,5 +1021,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_BUFFER_HPP_
|
|
@ -22,28 +22,28 @@ const Circle Circle::MAX = Circle(std::numeric_limits< Circle::Value >::max());
|
|||||||
SQChar Circle::Delim = ',';
|
SQChar Circle::Delim = ',';
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle::Circle()
|
Circle::Circle() noexcept
|
||||||
: pos(0.0, 0.0), rad(0.0)
|
: pos(0.0, 0.0), rad(0.0)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle::Circle(Value rv)
|
Circle::Circle(Value rv) noexcept
|
||||||
: pos(0.0, 0.0), rad(rv)
|
: pos(0.0, 0.0), rad(rv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle::Circle(const Vector2 & pv, Value rv)
|
Circle::Circle(const Vector2 & pv, Value rv) noexcept
|
||||||
: pos(pv), rad(rv)
|
: pos(pv), rad(rv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle::Circle(Value xv, Value yv, Value rv)
|
Circle::Circle(Value xv, Value yv, Value rv) noexcept
|
||||||
: pos(xv, yv), rad(rv)
|
: pos(xv, yv), rad(rv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -191,7 +191,7 @@ Circle & Circle::operator -- ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator ++ (int)
|
Circle Circle::operator ++ (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Circle state(*this);
|
Circle state(*this);
|
||||||
++pos;
|
++pos;
|
||||||
@ -200,7 +200,7 @@ Circle Circle::operator ++ (int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator -- (int)
|
Circle Circle::operator -- (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Circle state(*this);
|
Circle state(*this);
|
||||||
--pos;
|
--pos;
|
||||||
@ -211,103 +211,103 @@ Circle Circle::operator -- (int)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator + (const Circle & c) const
|
Circle Circle::operator + (const Circle & c) const
|
||||||
{
|
{
|
||||||
return Circle(pos + c.pos, rad + c.rad);
|
return {pos + c.pos, rad + c.rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator - (const Circle & c) const
|
Circle Circle::operator - (const Circle & c) const
|
||||||
{
|
{
|
||||||
return Circle(pos - c.pos, rad - c.rad);
|
return {pos - c.pos, rad - c.rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator * (const Circle & c) const
|
Circle Circle::operator * (const Circle & c) const
|
||||||
{
|
{
|
||||||
return Circle(pos * c.pos, rad * c.rad);
|
return {pos * c.pos, rad * c.rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator / (const Circle & c) const
|
Circle Circle::operator / (const Circle & c) const
|
||||||
{
|
{
|
||||||
return Circle(pos / c.pos, rad / c.rad);
|
return {pos / c.pos, rad / c.rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator % (const Circle & c) const
|
Circle Circle::operator % (const Circle & c) const
|
||||||
{
|
{
|
||||||
return Circle(pos % c.pos, std::fmod(rad, c.rad));
|
return {pos % c.pos, std::fmod(rad, c.rad)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator + (Value r) const
|
Circle Circle::operator + (Value r) const
|
||||||
{
|
{
|
||||||
return Circle(rad + r);
|
return {rad + r};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator - (Value r) const
|
Circle Circle::operator - (Value r) const
|
||||||
{
|
{
|
||||||
return Circle(rad - r);
|
return {rad - r};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator * (Value r) const
|
Circle Circle::operator * (Value r) const
|
||||||
{
|
{
|
||||||
return Circle(rad * r);
|
return {rad * r};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator / (Value r) const
|
Circle Circle::operator / (Value r) const
|
||||||
{
|
{
|
||||||
return Circle(rad / r);
|
return {rad / r};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator % (Value r) const
|
Circle Circle::operator % (Value r) const
|
||||||
{
|
{
|
||||||
return Circle(std::fmod(rad, r));
|
return {std::fmod(rad, r)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator + (const Vector2 & p) const
|
Circle Circle::operator + (const Vector2 & p) const
|
||||||
{
|
{
|
||||||
return Circle(pos + p, rad);
|
return {pos + p, rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator - (const Vector2 & p) const
|
Circle Circle::operator - (const Vector2 & p) const
|
||||||
{
|
{
|
||||||
return Circle(pos - p, rad);
|
return {pos - p, rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator * (const Vector2 & p) const
|
Circle Circle::operator * (const Vector2 & p) const
|
||||||
{
|
{
|
||||||
return Circle(pos * p, rad);
|
return {pos * p, rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator / (const Vector2 & p) const
|
Circle Circle::operator / (const Vector2 & p) const
|
||||||
{
|
{
|
||||||
return Circle(pos / p, rad);
|
return {pos / p, rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator % (const Vector2 & p) const
|
Circle Circle::operator % (const Vector2 & p) const
|
||||||
{
|
{
|
||||||
return Circle(pos % p, rad);
|
return {pos % p, rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator + () const
|
Circle Circle::operator + () const
|
||||||
{
|
{
|
||||||
return Circle(pos.Abs(), std::fabs(rad));
|
return {pos.Abs(), std::fabs(rad)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::operator - () const
|
Circle Circle::operator - () const
|
||||||
{
|
{
|
||||||
return Circle(-pos, -rad);
|
return {-pos, -rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -464,7 +464,7 @@ void Circle::Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value rmin
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Circle Circle::Abs() const
|
Circle Circle::Abs() const
|
||||||
{
|
{
|
||||||
return Circle(pos.Abs(), std::fabs(rad));
|
return {pos.Abs(), std::fabs(rad)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -495,48 +495,11 @@ const Circle & Circle::GetEx(SQChar delim, StackStrF & str)
|
|||||||
return circle;
|
return circle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Circle & GetCircle()
|
|
||||||
{
|
|
||||||
static Circle circle;
|
|
||||||
circle.Clear();
|
|
||||||
return circle;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Circle & GetCircle(Float32 rv)
|
|
||||||
{
|
|
||||||
static Circle circle;
|
|
||||||
circle.SetRadius(rv);
|
|
||||||
return circle;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Circle & GetCircle(const Vector2 & pv, Float32 rv)
|
|
||||||
{
|
|
||||||
static Circle circle;
|
|
||||||
circle.SetValues(pv, rv);
|
|
||||||
return circle;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Circle & GetCircle(Float32 xv, Float32 yv, Float32 rv)
|
|
||||||
{
|
|
||||||
static Circle circle;
|
|
||||||
circle.SetCircleEx(xv, yv, rv);
|
|
||||||
return circle;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Circle & GetCircle(const Circle & o)
|
|
||||||
{
|
|
||||||
static Circle circle;
|
|
||||||
circle.SetCircle(o);
|
|
||||||
return circle;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||||
void Register_Circle(HSQUIRRELVM vm)
|
void Register_Circle(HSQUIRRELVM vm)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
{
|
{
|
||||||
typedef Circle::Value Val;
|
typedef Circle::Value Val;
|
||||||
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef _BASE_CIRCLE_HPP_
|
#pragma once
|
||||||
#define _BASE_CIRCLE_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include "SqBase.hpp"
|
#include "SqBase.hpp"
|
||||||
@ -39,32 +38,32 @@ struct Circle
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Default constructor.
|
* Default constructor.
|
||||||
*/
|
*/
|
||||||
Circle();
|
Circle() noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a circle at position 0,0 using the specified radius.
|
* Construct a circle at position 0,0 using the specified radius.
|
||||||
*/
|
*/
|
||||||
explicit Circle(Value rv);
|
Circle(Value rv) noexcept; // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a circle at the specified position using the specified radius.
|
* Construct a circle at the specified position using the specified radius.
|
||||||
*/
|
*/
|
||||||
Circle(const Vector2 & pv, Value rv);
|
Circle(const Vector2 & pv, Value rv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a circle at the specified position using the specified radius.
|
* Construct a circle at the specified position using the specified radius.
|
||||||
*/
|
*/
|
||||||
Circle(Value xv, Value yv, Value rv);
|
Circle(Value xv, Value yv, Value rv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy constructor.
|
* Copy constructor.
|
||||||
*/
|
*/
|
||||||
Circle(const Circle & o) = default;
|
Circle(const Circle & o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Move constructor.
|
* Move constructor.
|
||||||
*/
|
*/
|
||||||
Circle(Circle && o) = default;
|
Circle(Circle && o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Destructor.
|
* Destructor.
|
||||||
@ -179,12 +178,12 @@ struct Circle
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-increment operator.
|
* Post-increment operator.
|
||||||
*/
|
*/
|
||||||
Circle operator ++ (int);
|
Circle operator ++ (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-decrement operator.
|
* Post-decrement operator.
|
||||||
*/
|
*/
|
||||||
Circle operator -- (int);
|
Circle operator -- (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Addition operator.
|
* Addition operator.
|
||||||
@ -424,5 +423,3 @@ struct Circle
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_CIRCLE_HPP_
|
|
@ -23,28 +23,28 @@ const Color3 Color3::MAX = Color3(std::numeric_limits< Color3::Value >::max());
|
|||||||
SQChar Color3::Delim = ',';
|
SQChar Color3::Delim = ',';
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3::Color3()
|
Color3::Color3() noexcept
|
||||||
: r(0), g(0), b(0)
|
: r(0), g(0), b(0)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3::Color3(Value sv)
|
Color3::Color3(Value sv) noexcept
|
||||||
: r(sv), g(sv), b(sv)
|
: r(sv), g(sv), b(sv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3::Color3(Value rv, Value gv, Value bv)
|
Color3::Color3(Value rv, Value gv, Value bv) noexcept
|
||||||
: r(rv), g(gv), b(bv)
|
: r(rv), g(gv), b(bv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3::Color3(Value rv, Value gv, Value bv, Value /*av*/)
|
Color3::Color3(Value rv, Value gv, Value bv, Value /*av*/) noexcept
|
||||||
: r(rv), g(gv), b(bv)
|
: r(rv), g(gv), b(bv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -267,7 +267,7 @@ Color3 & Color3::operator -- ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator ++ (int)
|
Color3 Color3::operator ++ (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Color3 state(*this);
|
Color3 state(*this);
|
||||||
++r;
|
++r;
|
||||||
@ -277,7 +277,7 @@ Color3 Color3::operator ++ (int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator -- (int)
|
Color3 Color3::operator -- (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Color3 state(*this);
|
Color3 state(*this);
|
||||||
--r;
|
--r;
|
||||||
@ -289,139 +289,139 @@ Color3 Color3::operator -- (int)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator + (const Color3 & c) const
|
Color3 Color3::operator + (const Color3 & c) const
|
||||||
{
|
{
|
||||||
return Color3(r + c.r, g + c.g, b + c.b);
|
return {static_cast<Value>(r + c.r), static_cast<Value>(g + c.g), static_cast<Value>(b + c.b)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator - (const Color3 & c) const
|
Color3 Color3::operator - (const Color3 & c) const
|
||||||
{
|
{
|
||||||
return Color3(r - c.r, g - c.g, b - c.b);
|
return {static_cast<Value>(r - c.r), static_cast<Value>(g - c.g), static_cast<Value>(b - c.b)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator * (const Color3 & c) const
|
Color3 Color3::operator * (const Color3 & c) const
|
||||||
{
|
{
|
||||||
return Color3(r * c.r, g * c.g, b * c.b);
|
return {static_cast<Value>(r * c.r), static_cast<Value>(g * c.g), static_cast<Value>(b * c.b)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator / (const Color3 & c) const
|
Color3 Color3::operator / (const Color3 & c) const
|
||||||
{
|
{
|
||||||
return Color3(r / c.r, g / c.g, b / c.b);
|
return {static_cast<Value>(r / c.r), static_cast<Value>(g / c.g), static_cast<Value>(b / c.b)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator % (const Color3 & c) const
|
Color3 Color3::operator % (const Color3 & c) const
|
||||||
{
|
{
|
||||||
return Color3(r % c.r, g % c.g, b % c.b);
|
return {static_cast<Value>(r % c.r), static_cast<Value>(g % c.g), static_cast<Value>(b % c.b)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator & (const Color3 & c) const
|
Color3 Color3::operator & (const Color3 & c) const
|
||||||
{
|
{
|
||||||
return Color3(r & c.r, g & c.g, b & c.b);
|
return {static_cast<Value>(r & c.r), static_cast<Value>(g & c.g), static_cast<Value>(b & c.b)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator | (const Color3 & c) const
|
Color3 Color3::operator | (const Color3 & c) const
|
||||||
{
|
{
|
||||||
return Color3(r | c.r, g | c.g, b | c.b);
|
return {static_cast<Value>(r | c.r), static_cast<Value>(g | c.g), static_cast<Value>(b | c.b)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator ^ (const Color3 & c) const
|
Color3 Color3::operator ^ (const Color3 & c) const
|
||||||
{
|
{
|
||||||
return Color3(r ^ c.r, g ^ c.g, b ^ c.b);
|
return {static_cast<Value>(r ^ c.r), static_cast<Value>(g ^ c.g), static_cast<Value>(b ^ c.b)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator << (const Color3 & c) const
|
Color3 Color3::operator << (const Color3 & c) const
|
||||||
{
|
{
|
||||||
return Color3(r << c.r, g << c.g, b << c.b);
|
return {static_cast<Value>(r << c.r), static_cast<Value>(g << c.g), static_cast<Value>(b << c.b)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator >> (const Color3 & c) const
|
Color3 Color3::operator >> (const Color3 & c) const
|
||||||
{
|
{
|
||||||
return Color3(r >> c.r, g >> c.g, b >> c.b);
|
return {static_cast<Value>(r >> c.r), static_cast<Value>(g >> c.g), static_cast<Value>(b >> c.b)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator + (Value s) const
|
Color3 Color3::operator + (Value s) const
|
||||||
{
|
{
|
||||||
return Color3(r + s, g + s, b + s);
|
return {static_cast<Value>(r + s), static_cast<Value>(g + s), static_cast<Value>(b + s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator - (Value s) const
|
Color3 Color3::operator - (Value s) const
|
||||||
{
|
{
|
||||||
return Color3(r - s, g - s, b - s);
|
return {static_cast<Value>(r - s), static_cast<Value>(g - s), static_cast<Value>(b - s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator * (Value s) const
|
Color3 Color3::operator * (Value s) const
|
||||||
{
|
{
|
||||||
return Color3(r * s, g * s, b * s);
|
return {static_cast<Value>(r * s), static_cast<Value>(g * s), static_cast<Value>(b * s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator / (Value s) const
|
Color3 Color3::operator / (Value s) const
|
||||||
{
|
{
|
||||||
return Color3(r / s, g / s, b / s);
|
return {static_cast<Value>(r / s), static_cast<Value>(g / s), static_cast<Value>(b / s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator % (Value s) const
|
Color3 Color3::operator % (Value s) const
|
||||||
{
|
{
|
||||||
return Color3(r % s, g % s, b % s);
|
return {static_cast<Value>(r % s), static_cast<Value>(g % s), static_cast<Value>(b % s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator & (Value s) const
|
Color3 Color3::operator & (Value s) const
|
||||||
{
|
{
|
||||||
return Color3(r & s, g & s, b & s);
|
return {static_cast<Value>(r & s), static_cast<Value>(g & s), static_cast<Value>(b & s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator | (Value s) const
|
Color3 Color3::operator | (Value s) const
|
||||||
{
|
{
|
||||||
return Color3(r | s, g | s, b | s);
|
return {static_cast<Value>(r | s), static_cast<Value>(g | s), static_cast<Value>(b | s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator ^ (Value s) const
|
Color3 Color3::operator ^ (Value s) const
|
||||||
{
|
{
|
||||||
return Color3(r ^ s, g ^ s, b ^ s);
|
return {static_cast<Value>(r ^ s), static_cast<Value>(g ^ s), static_cast<Value>(b ^ s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator << (Value s) const
|
Color3 Color3::operator << (Value s) const
|
||||||
{
|
{
|
||||||
return Color3(r << s, g << s, b << s);
|
return {static_cast<Value>(r << s), static_cast<Value>(g << s), static_cast<Value>(b << s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator >> (Value s) const
|
Color3 Color3::operator >> (Value s) const
|
||||||
{
|
{
|
||||||
return Color3(r >> s, g >> s, b >> s);
|
return {static_cast<Value>(r >> s), static_cast<Value>(g >> s), static_cast<Value>(b >> s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator + () const
|
Color3 Color3::operator + () const
|
||||||
{
|
{
|
||||||
return Color3(r, g, b);
|
return {r, g, b};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator - () const
|
Color3 Color3::operator - () const
|
||||||
{
|
{
|
||||||
return Color3(0, 0, 0);
|
return {0, 0, 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3 Color3::operator ~ () const
|
Color3 Color3::operator ~ () const
|
||||||
{
|
{
|
||||||
return Color3(~r, ~g, ~b);
|
return {static_cast<Value>(~r), static_cast<Value>(~g), static_cast<Value>(~b)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -463,7 +463,7 @@ bool Color3::operator >= (const Color3 & c) const
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color3::operator Color4 () const
|
Color3::operator Color4 () const
|
||||||
{
|
{
|
||||||
return Color4(r, g, b);
|
return {r, g, b};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -544,43 +544,43 @@ void Color3::SetName(StackStrF & name)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Uint32 Color3::GetRGB() const
|
Uint32 Color3::GetRGB() const
|
||||||
{
|
{
|
||||||
return Uint32(r << 16 | g << 8 | b);
|
return Uint32(r << 16u | g << 8u | b); // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void Color3::SetRGB(Uint32 p)
|
void Color3::SetRGB(Uint32 p)
|
||||||
{
|
{
|
||||||
r = static_cast< Value >((p >> 16) & 0xFF);
|
r = static_cast< Value >((p >> 16u) & 0xFFu);
|
||||||
g = static_cast< Value >((p >> 8) & 0xFF);
|
g = static_cast< Value >((p >> 8u) & 0xFFu);
|
||||||
b = static_cast< Value >((p) & 0xFF);
|
b = static_cast< Value >((p) & 0xFFu);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Uint32 Color3::GetRGBA() const
|
Uint32 Color3::GetRGBA() const
|
||||||
{
|
{
|
||||||
return Uint32(r << 24 | g << 16 | b << 8 | 0x00);
|
return Uint32(r << 24u | g << 16u | b << 8u | 0u); // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void Color3::SetRGBA(Uint32 p)
|
void Color3::SetRGBA(Uint32 p)
|
||||||
{
|
{
|
||||||
r = static_cast< Value >((p >> 24) & 0xFF);
|
r = static_cast< Value >((p >> 24u) & 0xFFu);
|
||||||
g = static_cast< Value >((p >> 16) & 0xFF);
|
g = static_cast< Value >((p >> 16u) & 0xFFu);
|
||||||
b = static_cast< Value >((p >> 8) & 0xFF);
|
b = static_cast< Value >((p >> 8u) & 0xFFu);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Uint32 Color3::GetARGB() const
|
Uint32 Color3::GetARGB() const
|
||||||
{
|
{
|
||||||
return Uint32(0x00 << 24 | r << 16 | g << 8 | b);
|
return Uint32(0u << 24u | r << 16u | g << 8u | b); // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void Color3::SetARGB(Uint32 p)
|
void Color3::SetARGB(Uint32 p)
|
||||||
{
|
{
|
||||||
r = static_cast< Value >((p >> 16) & 0xFF);
|
r = static_cast< Value >((p >> 16u) & 0xFFu);
|
||||||
g = static_cast< Value >((p >> 8) & 0xFF);
|
g = static_cast< Value >((p >> 8u) & 0xFFu);
|
||||||
b = static_cast< Value >((p) & 0xFF);
|
b = static_cast< Value >((p) & 0xFFu);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -668,40 +668,11 @@ const Color3 & Color3::GetEx(SQChar delim, StackStrF & str)
|
|||||||
return col;
|
return col;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Color3 & GetColor3()
|
|
||||||
{
|
|
||||||
static Color3 col;
|
|
||||||
col.Clear();
|
|
||||||
return col;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Color3 & GetColor3(Uint8 sv)
|
|
||||||
{
|
|
||||||
static Color3 col;
|
|
||||||
col.SetScalar(sv);
|
|
||||||
return col;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Color3 & GetColor3(Uint8 rv, Uint8 gv, Uint8 bv)
|
|
||||||
{
|
|
||||||
static Color3 col;
|
|
||||||
col.SetColor3Ex(rv, gv, bv);
|
|
||||||
return col;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Color3 & GetColor3(const Color3 & o)
|
|
||||||
{
|
|
||||||
static Color3 col;
|
|
||||||
col.SetColor3(o);
|
|
||||||
return col;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||||
void Register_Color3(HSQUIRRELVM vm)
|
void Register_Color3(HSQUIRRELVM vm)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
{
|
{
|
||||||
typedef Color3::Value Val;
|
typedef Color3::Value Val;
|
||||||
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef _BASE_COLOR3_HPP_
|
#pragma once
|
||||||
#define _BASE_COLOR3_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include "SqBase.hpp"
|
#include "SqBase.hpp"
|
||||||
@ -37,32 +36,32 @@ struct Color3
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Default constructor.
|
* Default constructor.
|
||||||
*/
|
*/
|
||||||
Color3();
|
Color3() noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a color with all components with the same specified color.
|
* Construct a color with all components with the same specified color.
|
||||||
*/
|
*/
|
||||||
explicit Color3(Value sv);
|
explicit Color3(Value sv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct with individually specified red, green and blue colors.
|
* Construct with individually specified red, green and blue colors.
|
||||||
*/
|
*/
|
||||||
Color3(Value rv, Value gv, Value bv);
|
Color3(Value rv, Value gv, Value bv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct with individually specified red, green, blue and alpha colors.
|
* Construct with individually specified red, green, blue and alpha colors.
|
||||||
*/
|
*/
|
||||||
Color3(Value rv, Value gv, Value bv, Value av);
|
Color3(Value rv, Value gv, Value bv, Value av) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy constructor.
|
* Copy constructor.
|
||||||
*/
|
*/
|
||||||
Color3(const Color3 & o) = default;
|
Color3(const Color3 & o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Move constructor.
|
* Move constructor.
|
||||||
*/
|
*/
|
||||||
Color3(Color3 && o) = default;
|
Color3(Color3 && o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Destructor.
|
* Destructor.
|
||||||
@ -202,12 +201,12 @@ struct Color3
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-increment operator.
|
* Post-increment operator.
|
||||||
*/
|
*/
|
||||||
Color3 operator ++ (int);
|
Color3 operator ++ (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-decrement operator.
|
* Post-decrement operator.
|
||||||
*/
|
*/
|
||||||
Color3 operator -- (int);
|
Color3 operator -- (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Addition operator.
|
* Addition operator.
|
||||||
@ -357,7 +356,7 @@ struct Color3
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Implicit conversion to transparent color.
|
* Implicit conversion to transparent color.
|
||||||
*/
|
*/
|
||||||
operator Color4 () const;
|
operator Color4 () const; // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Used by the script engine to compare two instances of this type.
|
* Used by the script engine to compare two instances of this type.
|
||||||
@ -511,5 +510,3 @@ struct Color3
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_COLOR3_HPP_
|
|
@ -23,28 +23,28 @@ const Color4 Color4::MAX = Color4(std::numeric_limits< Color4::Value >::max());
|
|||||||
SQChar Color4::Delim = ',';
|
SQChar Color4::Delim = ',';
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4::Color4()
|
Color4::Color4() noexcept
|
||||||
: r(0), g(0), b(0), a(0)
|
: r(0), g(0), b(0), a(0)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4::Color4(Value sv)
|
Color4::Color4(Value sv) noexcept
|
||||||
: r(sv), g(sv), b(sv), a(0)
|
: r(sv), g(sv), b(sv), a(0)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4::Color4(Value rv, Value gv, Value bv)
|
Color4::Color4(Value rv, Value gv, Value bv) noexcept
|
||||||
: r(rv), g(gv), b(bv), a(0)
|
: r(rv), g(gv), b(bv), a(0)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4::Color4(Value rv, Value gv, Value bv, Value av)
|
Color4::Color4(Value rv, Value gv, Value bv, Value av) noexcept
|
||||||
: r(rv), g(gv), b(bv), a(av)
|
: r(rv), g(gv), b(bv), a(av)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -290,7 +290,7 @@ Color4 & Color4::operator -- ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator ++ (int)
|
Color4 Color4::operator ++ (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Color4 state(*this);
|
Color4 state(*this);
|
||||||
++r;
|
++r;
|
||||||
@ -301,7 +301,7 @@ Color4 Color4::operator ++ (int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator -- (int)
|
Color4 Color4::operator -- (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Color4 state(*this);
|
Color4 state(*this);
|
||||||
--r;
|
--r;
|
||||||
@ -314,139 +314,139 @@ Color4 Color4::operator -- (int)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator + (const Color4 & c) const
|
Color4 Color4::operator + (const Color4 & c) const
|
||||||
{
|
{
|
||||||
return Color4(r + c.r, g + c.g, b + c.b, a + c.a);
|
return {static_cast<Value>(r + c.r), static_cast<Value>(g + c.g), static_cast<Value>(b + c.b), static_cast<Value>(a + c.a)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator - (const Color4 & c) const
|
Color4 Color4::operator - (const Color4 & c) const
|
||||||
{
|
{
|
||||||
return Color4(r - c.r, g - c.g, b - c.b, a - c.a);
|
return {static_cast<Value>(r - c.r), static_cast<Value>(g - c.g), static_cast<Value>(b - c.b), static_cast<Value>(a - c.a)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator * (const Color4 & c) const
|
Color4 Color4::operator * (const Color4 & c) const
|
||||||
{
|
{
|
||||||
return Color4(r * c.r, g * c.g, b * c.b, a * c.a);
|
return {static_cast<Value>(r * c.r), static_cast<Value>(g * c.g), static_cast<Value>(b * c.b), static_cast<Value>(a * c.a)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator / (const Color4 & c) const
|
Color4 Color4::operator / (const Color4 & c) const
|
||||||
{
|
{
|
||||||
return Color4(r / c.r, g / c.g, b / c.b, a / c.a);
|
return {static_cast<Value>(r / c.r), static_cast<Value>(g / c.g), static_cast<Value>(b / c.b), static_cast<Value>(a / c.a)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator % (const Color4 & c) const
|
Color4 Color4::operator % (const Color4 & c) const
|
||||||
{
|
{
|
||||||
return Color4(r % c.r, g % c.g, b % c.b, a % c.a);
|
return {static_cast<Value>(r % c.r), static_cast<Value>(g % c.g), static_cast<Value>(b % c.b), static_cast<Value>(a % c.a)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator & (const Color4 & c) const
|
Color4 Color4::operator & (const Color4 & c) const
|
||||||
{
|
{
|
||||||
return Color4(r & c.r, g & c.g, b & c.b, a & c.a);
|
return {static_cast<Value>(r & c.r), static_cast<Value>(g & c.g), static_cast<Value>(b & c.b), static_cast<Value>(a & c.a)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator | (const Color4 & c) const
|
Color4 Color4::operator | (const Color4 & c) const
|
||||||
{
|
{
|
||||||
return Color4(r | c.r, g | c.g, b | c.b, a | c.a);
|
return {static_cast<Value>(r | c.r), static_cast<Value>(g | c.g), static_cast<Value>(b | c.b), static_cast<Value>(a | c.a)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator ^ (const Color4 & c) const
|
Color4 Color4::operator ^ (const Color4 & c) const
|
||||||
{
|
{
|
||||||
return Color4(r ^ c.r, g ^ c.g, b ^ c.b, a ^ c.a);
|
return {static_cast<Value>(r ^ c.r), static_cast<Value>(g ^ c.g), static_cast<Value>(b ^ c.b), static_cast<Value>(a ^ c.a)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator << (const Color4 & c) const
|
Color4 Color4::operator << (const Color4 & c) const
|
||||||
{
|
{
|
||||||
return Color4(r << c.r, g << c.g, b << c.b, a << c.a);
|
return {static_cast<Value>(r << c.r), static_cast<Value>(g << c.g), static_cast<Value>(b << c.b), static_cast<Value>(a << c.a)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator >> (const Color4 & c) const
|
Color4 Color4::operator >> (const Color4 & c) const
|
||||||
{
|
{
|
||||||
return Color4(r >> c.r, g >> c.g, b >> c.b, a >> c.a);
|
return {static_cast<Value>(r >> c.r), static_cast<Value>(g >> c.g), static_cast<Value>(b >> c.b), static_cast<Value>(a >> c.a)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator + (Value s) const
|
Color4 Color4::operator + (Value s) const
|
||||||
{
|
{
|
||||||
return Color4(r + s, g + s, b + s, a + s);
|
return {static_cast<Value>(r + s), static_cast<Value>(g + s), static_cast<Value>(b + s), static_cast<Value>(a + s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator - (Value s) const
|
Color4 Color4::operator - (Value s) const
|
||||||
{
|
{
|
||||||
return Color4(r - s, g - s, b - s, a - s);
|
return {static_cast<Value>(r - s), static_cast<Value>(g - s), static_cast<Value>(b - s), static_cast<Value>(a - s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator * (Value s) const
|
Color4 Color4::operator * (Value s) const
|
||||||
{
|
{
|
||||||
return Color4(r * s, g * s, b * s, a * s);
|
return {static_cast<Value>(r * s), static_cast<Value>(g * s), static_cast<Value>(b * s), static_cast<Value>(a * s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator / (Value s) const
|
Color4 Color4::operator / (Value s) const
|
||||||
{
|
{
|
||||||
return Color4(r / s, g / s, b / s, a / s);
|
return {static_cast<Value>(r / s), static_cast<Value>(g / s), static_cast<Value>(b / s), static_cast<Value>(a / s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator % (Value s) const
|
Color4 Color4::operator % (Value s) const
|
||||||
{
|
{
|
||||||
return Color4(r % s, g % s, b % s, a % s);
|
return {static_cast<Value>(r % s), static_cast<Value>(g % s), static_cast<Value>(b % s), static_cast<Value>(a % s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator & (Value s) const
|
Color4 Color4::operator & (Value s) const
|
||||||
{
|
{
|
||||||
return Color4(r & s, g & s, b & s, a & s);
|
return {static_cast<Value>(r & s), static_cast<Value>(g & s), static_cast<Value>(b & s), static_cast<Value>(a & s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator | (Value s) const
|
Color4 Color4::operator | (Value s) const
|
||||||
{
|
{
|
||||||
return Color4(r | s, g | s, b | s, a | s);
|
return {static_cast<Value>(r | s), static_cast<Value>(g | s), static_cast<Value>(b | s), static_cast<Value>(a | s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator ^ (Value s) const
|
Color4 Color4::operator ^ (Value s) const
|
||||||
{
|
{
|
||||||
return Color4(r ^ s, g ^ s, b ^ s, a ^ s);
|
return {static_cast<Value>(r ^ s), static_cast<Value>(g ^ s), static_cast<Value>(b ^ s), static_cast<Value>(a ^ s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator << (Value s) const
|
Color4 Color4::operator << (Value s) const
|
||||||
{
|
{
|
||||||
return Color4(r << s, g << s, b << s, a << s);
|
return {static_cast<Value>(r << s), static_cast<Value>(g << s), static_cast<Value>(b << s), static_cast<Value>(a << s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator >> (Value s) const
|
Color4 Color4::operator >> (Value s) const
|
||||||
{
|
{
|
||||||
return Color4(r >> s, g >> s, b >> s, a >> s);
|
return {static_cast<Value>(r >> s), static_cast<Value>(g >> s), static_cast<Value>(b >> s), static_cast<Value>(a >> s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator + () const
|
Color4 Color4::operator + () const
|
||||||
{
|
{
|
||||||
return Color4(r, g, b, a);
|
return {r, g, b, a};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator - () const
|
Color4 Color4::operator - () const
|
||||||
{
|
{
|
||||||
return Color4(0, 0, 0, 0);
|
return {0, 0, 0, 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4 Color4::operator ~ () const
|
Color4 Color4::operator ~ () const
|
||||||
{
|
{
|
||||||
return Color4(~r, ~g, ~b, ~a);
|
return {static_cast<Value>(~r), static_cast<Value>(~g), static_cast<Value>(~b), static_cast<Value>(~a)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -488,7 +488,7 @@ bool Color4::operator >= (const Color4 & c) const
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Color4::operator Color3 () const
|
Color4::operator Color3 () const
|
||||||
{
|
{
|
||||||
return Color3(r, g, b);
|
return {r, g, b};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -573,45 +573,45 @@ void Color4::SetName(StackStrF & name)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Uint32 Color4::GetRGB() const
|
Uint32 Color4::GetRGB() const
|
||||||
{
|
{
|
||||||
return Uint32(r << 16 | g << 8 | b);
|
return Uint32(r << 16u | g << 8u | b); // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void Color4::SetRGB(Uint32 p)
|
void Color4::SetRGB(Uint32 p)
|
||||||
{
|
{
|
||||||
r = static_cast< Value >((p >> 16) & 0xFF);
|
r = static_cast< Value >((p >> 16u) & 0xFFu);
|
||||||
g = static_cast< Value >((p >> 8) & 0xFF);
|
g = static_cast< Value >((p >> 8u) & 0xFFu);
|
||||||
b = static_cast< Value >((p) & 0xFF);
|
b = static_cast< Value >((p) & 0xFFu);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Uint32 Color4::GetRGBA() const
|
Uint32 Color4::GetRGBA() const
|
||||||
{
|
{
|
||||||
return Uint32(r << 24 | g << 16 | b << 8 | a);
|
return Uint32(r << 24u | g << 16u | b << 8u | a); // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void Color4::SetRGBA(Uint32 p)
|
void Color4::SetRGBA(Uint32 p)
|
||||||
{
|
{
|
||||||
r = static_cast< Value >((p >> 24) & 0xFF);
|
r = static_cast< Value >((p >> 24u) & 0xFFu);
|
||||||
g = static_cast< Value >((p >> 16) & 0xFF);
|
g = static_cast< Value >((p >> 16u) & 0xFFu);
|
||||||
b = static_cast< Value >((p >> 8) & 0xFF);
|
b = static_cast< Value >((p >> 8u) & 0xFFu);
|
||||||
a = static_cast< Value >((p) & 0xFF);
|
a = static_cast< Value >((p) & 0xFFu);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Uint32 Color4::GetARGB() const
|
Uint32 Color4::GetARGB() const
|
||||||
{
|
{
|
||||||
return Uint32(a << 24 | r << 16 | g << 8 | b);
|
return Uint32(a << 24u | r << 16u | g << 8u | b); // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void Color4::SetARGB(Uint32 p)
|
void Color4::SetARGB(Uint32 p)
|
||||||
{
|
{
|
||||||
a = static_cast< Value >((p >> 24) & 0xFF);
|
a = static_cast< Value >((p >> 24u) & 0xFFu);
|
||||||
r = static_cast< Value >((p >> 16) & 0xFF);
|
r = static_cast< Value >((p >> 16u) & 0xFFu);
|
||||||
g = static_cast< Value >((p >> 8) & 0xFF);
|
g = static_cast< Value >((p >> 8u) & 0xFFu);
|
||||||
b = static_cast< Value >((p) & 0xFF);
|
b = static_cast< Value >((p) & 0xFFu);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -705,48 +705,11 @@ const Color4 & Color4::GetEx(SQChar delim, StackStrF & str)
|
|||||||
return col;
|
return col;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Color4 & GetColor4()
|
|
||||||
{
|
|
||||||
static Color4 col;
|
|
||||||
col.Clear();
|
|
||||||
return col;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Color4 & GetColor4(Uint8 sv)
|
|
||||||
{
|
|
||||||
static Color4 col;
|
|
||||||
col.SetScalar(sv);
|
|
||||||
return col;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Color4 & GetColor4(Uint8 rv, Uint8 gv, Uint8 bv)
|
|
||||||
{
|
|
||||||
static Color4 col;
|
|
||||||
col.SetColor3Ex(rv, gv, bv);
|
|
||||||
return col;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Color4 & GetColor4(Uint8 rv, Uint8 gv, Uint8 bv, Uint8 av)
|
|
||||||
{
|
|
||||||
static Color4 col;
|
|
||||||
col.SetColor4Ex(rv, gv, bv, av);
|
|
||||||
return col;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Color4 & GetColor4(const Color4 & o)
|
|
||||||
{
|
|
||||||
static Color4 col;
|
|
||||||
col.SetColor4(o);
|
|
||||||
return col;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||||
void Register_Color4(HSQUIRRELVM vm)
|
void Register_Color4(HSQUIRRELVM vm)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
{
|
{
|
||||||
typedef Color4::Value Val;
|
typedef Color4::Value Val;
|
||||||
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef _BASE_COLOR4_HPP_
|
#pragma once
|
||||||
#define _BASE_COLOR4_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include "SqBase.hpp"
|
#include "SqBase.hpp"
|
||||||
@ -37,32 +36,32 @@ struct Color4
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Default constructor.
|
* Default constructor.
|
||||||
*/
|
*/
|
||||||
Color4();
|
Color4() noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a color with all components with the same specified color.
|
* Construct a color with all components with the same specified color.
|
||||||
*/
|
*/
|
||||||
explicit Color4(Value sv);
|
explicit Color4(Value sv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct with individually specified red, green and blue colors.
|
* Construct with individually specified red, green and blue colors.
|
||||||
*/
|
*/
|
||||||
Color4(Value rv, Value gv, Value bv);
|
Color4(Value rv, Value gv, Value bv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct with individually specified red, green, blue and alpha colors.
|
* Construct with individually specified red, green, blue and alpha colors.
|
||||||
*/
|
*/
|
||||||
Color4(Value rv, Value gv, Value bv, Value av);
|
Color4(Value rv, Value gv, Value bv, Value av) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy constructor.
|
* Copy constructor.
|
||||||
*/
|
*/
|
||||||
Color4(const Color4 & o) = default;
|
Color4(const Color4 & o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Move constructor.
|
* Move constructor.
|
||||||
*/
|
*/
|
||||||
Color4(Color4 && o) = default;
|
Color4(Color4 && o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Destructor.
|
* Destructor.
|
||||||
@ -202,12 +201,12 @@ struct Color4
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-increment operator.
|
* Post-increment operator.
|
||||||
*/
|
*/
|
||||||
Color4 operator ++ (int);
|
Color4 operator ++ (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-decrement operator.
|
* Post-decrement operator.
|
||||||
*/
|
*/
|
||||||
Color4 operator -- (int);
|
Color4 operator -- (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Addition operator.
|
* Addition operator.
|
||||||
@ -357,7 +356,7 @@ struct Color4
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Implicit conversion to opaque color.
|
* Implicit conversion to opaque color.
|
||||||
*/
|
*/
|
||||||
operator Color3 () const;
|
operator Color3 () const; // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Used by the script engine to compare two instances of this type.
|
* Used by the script engine to compare two instances of this type.
|
||||||
@ -511,5 +510,3 @@ struct Color4
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_COLOR4_HPP_
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef _BASE_DYNARG_HPP_
|
#pragma once
|
||||||
#define _BASE_DYNARG_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
namespace SqMod {
|
namespace SqMod {
|
||||||
@ -399,7 +398,10 @@ template < typename F, typename U, typename... Ts > SQInteger SqDynArgFwd(HSQUIR
|
|||||||
return sq_throwerror(vm, "Unknown error occurred during comparison");
|
return sq_throwerror(vm, "Unknown error occurred during comparison");
|
||||||
}
|
}
|
||||||
// We shouldn't really reach this point but something must be returned
|
// We shouldn't really reach this point but something must be returned
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma ide diagnostic ignored "OCDFAInspection"
|
||||||
return sq_throwerror(vm, "Operation encountered unknown behavior");
|
return sq_throwerror(vm, "Operation encountered unknown behavior");
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
@ -414,7 +416,7 @@ template < typename T > struct SqDynArgCmpFn
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Base constructor. (required)
|
* Base constructor. (required)
|
||||||
*/
|
*/
|
||||||
SqDynArgCmpFn(HSQUIRRELVM vm)
|
explicit SqDynArgCmpFn(HSQUIRRELVM vm)
|
||||||
: mVM(vm), mVar(vm, 1)
|
: mVM(vm), mVar(vm, 1)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -423,7 +425,7 @@ template < typename T > struct SqDynArgCmpFn
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Implicit conversion to boolean. (required)
|
* Implicit conversion to boolean. (required)
|
||||||
*/
|
*/
|
||||||
operator bool () const
|
operator bool () const // NOLINT(hicpp-explicit-conversions,google-explicit-constructor)
|
||||||
{
|
{
|
||||||
return (mVar.value != nullptr);
|
return (mVar.value != nullptr);
|
||||||
}
|
}
|
||||||
@ -481,7 +483,7 @@ template < typename T > struct SqDynArgAddFn
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Base constructor. (required)
|
* Base constructor. (required)
|
||||||
*/
|
*/
|
||||||
SqDynArgAddFn(HSQUIRRELVM vm)
|
explicit SqDynArgAddFn(HSQUIRRELVM vm)
|
||||||
: mVM(vm), mVar(vm, 1)
|
: mVM(vm), mVar(vm, 1)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -490,7 +492,7 @@ template < typename T > struct SqDynArgAddFn
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Implicit conversion to boolean. (required)
|
* Implicit conversion to boolean. (required)
|
||||||
*/
|
*/
|
||||||
operator bool () const
|
operator bool () const // NOLINT(hicpp-explicit-conversions,google-explicit-constructor)
|
||||||
{
|
{
|
||||||
return (mVar.value != nullptr);
|
return (mVar.value != nullptr);
|
||||||
}
|
}
|
||||||
@ -548,7 +550,7 @@ template < typename T > struct SqDynArgSubFn
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Base constructor. (required)
|
* Base constructor. (required)
|
||||||
*/
|
*/
|
||||||
SqDynArgSubFn(HSQUIRRELVM vm)
|
explicit SqDynArgSubFn(HSQUIRRELVM vm)
|
||||||
: mVM(vm), mVar(vm, 1)
|
: mVM(vm), mVar(vm, 1)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -557,7 +559,7 @@ template < typename T > struct SqDynArgSubFn
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Implicit conversion to boolean. (required)
|
* Implicit conversion to boolean. (required)
|
||||||
*/
|
*/
|
||||||
operator bool () const
|
operator bool () const // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
{
|
{
|
||||||
return (mVar.value != nullptr);
|
return (mVar.value != nullptr);
|
||||||
}
|
}
|
||||||
@ -615,7 +617,7 @@ template < typename T > struct SqDynArgMulFn
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Base constructor. (required)
|
* Base constructor. (required)
|
||||||
*/
|
*/
|
||||||
SqDynArgMulFn(HSQUIRRELVM vm)
|
explicit SqDynArgMulFn(HSQUIRRELVM vm)
|
||||||
: mVM(vm), mVar(vm, 1)
|
: mVM(vm), mVar(vm, 1)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -624,7 +626,7 @@ template < typename T > struct SqDynArgMulFn
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Implicit conversion to boolean. (required)
|
* Implicit conversion to boolean. (required)
|
||||||
*/
|
*/
|
||||||
operator bool () const
|
operator bool () const // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
{
|
{
|
||||||
return (mVar.value != nullptr);
|
return (mVar.value != nullptr);
|
||||||
}
|
}
|
||||||
@ -682,7 +684,7 @@ template < typename T > struct SqDynArgDivFn
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Base constructor. (required)
|
* Base constructor. (required)
|
||||||
*/
|
*/
|
||||||
SqDynArgDivFn(HSQUIRRELVM vm)
|
explicit SqDynArgDivFn(HSQUIRRELVM vm)
|
||||||
: mVM(vm), mVar(vm, 1)
|
: mVM(vm), mVar(vm, 1)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -691,7 +693,7 @@ template < typename T > struct SqDynArgDivFn
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Implicit conversion to boolean. (required)
|
* Implicit conversion to boolean. (required)
|
||||||
*/
|
*/
|
||||||
operator bool () const
|
operator bool () const // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
{
|
{
|
||||||
return (mVar.value != nullptr);
|
return (mVar.value != nullptr);
|
||||||
}
|
}
|
||||||
@ -749,7 +751,7 @@ template < typename T > struct SqDynArgModFn
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Base constructor. (required)
|
* Base constructor. (required)
|
||||||
*/
|
*/
|
||||||
SqDynArgModFn(HSQUIRRELVM vm)
|
explicit SqDynArgModFn(HSQUIRRELVM vm)
|
||||||
: mVM(vm), mVar(vm, 1)
|
: mVM(vm), mVar(vm, 1)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -758,7 +760,7 @@ template < typename T > struct SqDynArgModFn
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Implicit conversion to boolean. (required)
|
* Implicit conversion to boolean. (required)
|
||||||
*/
|
*/
|
||||||
operator bool () const
|
operator bool () const // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
{
|
{
|
||||||
return (mVar.value != nullptr);
|
return (mVar.value != nullptr);
|
||||||
}
|
}
|
||||||
@ -805,5 +807,3 @@ template < typename T > struct SqDynArgModFn
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_DYNARG_HPP_
|
|
@ -28,28 +28,28 @@ const Quaternion Quaternion::IDENTITY(1.0, 0.0, 0.0, 0.0);
|
|||||||
SQChar Quaternion::Delim = ',';
|
SQChar Quaternion::Delim = ',';
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion::Quaternion()
|
Quaternion::Quaternion() noexcept
|
||||||
: x(0.0), y(0.0), z(0.0), w(0.0)
|
: x(0.0), y(0.0), z(0.0), w(0.0)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion::Quaternion(Value sv)
|
Quaternion::Quaternion(Value sv) noexcept
|
||||||
: x(sv), y(sv), z(sv), w(sv)
|
: x(sv), y(sv), z(sv), w(sv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion::Quaternion(Value xv, Value yv, Value zv)
|
Quaternion::Quaternion(Value xv, Value yv, Value zv) noexcept
|
||||||
: x(xv), y(yv), z(zv), w(0.0)
|
: x(xv), y(yv), z(zv), w(0.0)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion::Quaternion(Value xv, Value yv, Value zv, Value wv)
|
Quaternion::Quaternion(Value xv, Value yv, Value zv, Value wv) noexcept
|
||||||
: x(xv), y(yv), z(zv), w(wv)
|
: x(xv), y(yv), z(zv), w(wv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -206,7 +206,7 @@ Quaternion & Quaternion::operator -- ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator ++ (int)
|
Quaternion Quaternion::operator ++ (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Quaternion state(*this);
|
Quaternion state(*this);
|
||||||
++x;
|
++x;
|
||||||
@ -217,7 +217,7 @@ Quaternion Quaternion::operator ++ (int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator -- (int)
|
Quaternion Quaternion::operator -- (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Quaternion state(*this);
|
Quaternion state(*this);
|
||||||
--x;
|
--x;
|
||||||
@ -230,73 +230,73 @@ Quaternion Quaternion::operator -- (int)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator + (const Quaternion & q) const
|
Quaternion Quaternion::operator + (const Quaternion & q) const
|
||||||
{
|
{
|
||||||
return Quaternion(x + q.x, y + q.y, z + q.z, w + q.w);
|
return {x + q.x, y + q.y, z + q.z, w + q.w};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator + (Value s) const
|
Quaternion Quaternion::operator + (Value s) const
|
||||||
{
|
{
|
||||||
return Quaternion(x + s, y + s, z + s, w + s);
|
return {x + s, y + s, z + s, w + s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator - (const Quaternion & q) const
|
Quaternion Quaternion::operator - (const Quaternion & q) const
|
||||||
{
|
{
|
||||||
return Quaternion(x - q.x, y - q.y, z - q.z, w - q.w);
|
return {x - q.x, y - q.y, z - q.z, w - q.w};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator - (Value s) const
|
Quaternion Quaternion::operator - (Value s) const
|
||||||
{
|
{
|
||||||
return Quaternion(x - s, y - s, z - s, w - s);
|
return {x - s, y - s, z - s, w - s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator * (const Quaternion & q) const
|
Quaternion Quaternion::operator * (const Quaternion & q) const
|
||||||
{
|
{
|
||||||
return Quaternion(x * q.x, y * q.y, z * q.z, w * q.w);
|
return {x * q.x, y * q.y, z * q.z, w * q.w};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator * (Value s) const
|
Quaternion Quaternion::operator * (Value s) const
|
||||||
{
|
{
|
||||||
return Quaternion(x * s, y * s, z * s, w * s);
|
return {x * s, y * s, z * s, w * s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator / (const Quaternion & q) const
|
Quaternion Quaternion::operator / (const Quaternion & q) const
|
||||||
{
|
{
|
||||||
return Quaternion(x / q.x, y / q.y, z / q.z, w / q.w);
|
return {x / q.x, y / q.y, z / q.z, w / q.w};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator / (Value s) const
|
Quaternion Quaternion::operator / (Value s) const
|
||||||
{
|
{
|
||||||
return Quaternion(x / s, y / s, z / s, w / s);
|
return {x / s, y / s, z / s, w / s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator % (const Quaternion & q) const
|
Quaternion Quaternion::operator % (const Quaternion & q) const
|
||||||
{
|
{
|
||||||
return Quaternion(std::fmod(x, q.x), std::fmod(y, q.y), std::fmod(z, q.z), std::fmod(w, q.w));
|
return {std::fmod(x, q.x), std::fmod(y, q.y), std::fmod(z, q.z), std::fmod(w, q.w)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator % (Value s) const
|
Quaternion Quaternion::operator % (Value s) const
|
||||||
{
|
{
|
||||||
return Quaternion(std::fmod(x, s), std::fmod(y, s), std::fmod(z, s), std::fmod(w, s));
|
return {std::fmod(x, s), std::fmod(y, s), std::fmod(z, s), std::fmod(w, s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator + () const
|
Quaternion Quaternion::operator + () const
|
||||||
{
|
{
|
||||||
return Quaternion(std::fabs(x), std::fabs(y), std::fabs(z), std::fabs(w));
|
return {std::fabs(x), std::fabs(y), std::fabs(z), std::fabs(w)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::operator - () const
|
Quaternion Quaternion::operator - () const
|
||||||
{
|
{
|
||||||
return Quaternion(-x, -y, -z, -w);
|
return {-x, -y, -z, -w};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -476,7 +476,7 @@ void Quaternion::Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::Abs() const
|
Quaternion Quaternion::Abs() const
|
||||||
{
|
{
|
||||||
return Quaternion(std::fabs(x), std::fabs(y), std::fabs(z), std::fabs(w));
|
return {std::fabs(x), std::fabs(y), std::fabs(z), std::fabs(w)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -500,7 +500,7 @@ Quaternion::Value Quaternion::DotProduct(const Quaternion & quat) const
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Quaternion Quaternion::Conjugate() const
|
Quaternion Quaternion::Conjugate() const
|
||||||
{
|
{
|
||||||
return Quaternion(-x, -y, -z, w);;
|
return {-x, -y, -z, w};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -610,35 +610,35 @@ Vector3 Quaternion::ToEuler() const
|
|||||||
|
|
||||||
if (EpsEq(test, 1.0))
|
if (EpsEq(test, 1.0))
|
||||||
{
|
{
|
||||||
return Vector3(
|
return {
|
||||||
// bank = rotation about x-axis
|
// bank = rotation about x-axis
|
||||||
STOVAL(0.0),
|
STOVAL(0.0),
|
||||||
// attitude = rotation about y-axis
|
// attitude = rotation about y-axis
|
||||||
STOVAL(SQMOD_PI64 / 2.0),
|
STOVAL(SQMOD_PI64 / 2.0),
|
||||||
// heading = rotation about z-axis
|
// heading = rotation about z-axis
|
||||||
STOVAL(-2.0 * std::atan2(x, w))
|
STOVAL(-2.0 * std::atan2(x, w))
|
||||||
);
|
};
|
||||||
}
|
}
|
||||||
else if (EpsEq(test, -1.0))
|
else if (EpsEq(test, -1.0))
|
||||||
{
|
{
|
||||||
return Vector3(
|
return {
|
||||||
// bank = rotation about x-axis
|
// bank = rotation about x-axis
|
||||||
STOVAL(0.0),
|
STOVAL(0.0),
|
||||||
// attitude = rotation about y-axis
|
// attitude = rotation about y-axis
|
||||||
STOVAL(SQMOD_PI64 / -2.0),
|
STOVAL(SQMOD_PI64 / -2.0),
|
||||||
// heading = rotation about z-axis
|
// heading = rotation about z-axis
|
||||||
STOVAL(2.0 * std::atan2(x, w))
|
STOVAL(2.0 * std::atan2(x, w))
|
||||||
);
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return Vector3(
|
return {
|
||||||
// bank = rotation about x-axis
|
// bank = rotation about x-axis
|
||||||
STOVAL(std::atan2(2.0 * ((y * z) + (x * w)), (-sqx - sqy + sqz + sqw))),
|
STOVAL(std::atan2(2.0 * ((y * z) + (x * w)), (-sqx - sqy + sqz + sqw))),
|
||||||
// attitude = rotation about y-axis
|
// attitude = rotation about y-axis
|
||||||
STOVAL(std::asin(Clamp(test, -1.0, 1.0))),
|
STOVAL(std::asin(Clamp(test, -1.0, 1.0))),
|
||||||
// heading = rotation about z-axis
|
// heading = rotation about z-axis
|
||||||
STOVAL(std::atan2(2.0 * ((x * y) + (z * w)), (sqx - sqy - sqz + sqw)))
|
STOVAL(std::atan2(2.0 * ((x * y) + (z * w)), (sqx - sqy - sqz + sqw)))
|
||||||
);
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -742,48 +742,11 @@ const Quaternion & Quaternion::GetEx(SQChar delim, StackStrF & str)
|
|||||||
return quat;
|
return quat;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Quaternion & GetQuaternion()
|
|
||||||
{
|
|
||||||
static Quaternion quat;
|
|
||||||
quat.Clear();
|
|
||||||
return quat;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Quaternion & GetQuaternion(Float32 sv)
|
|
||||||
{
|
|
||||||
static Quaternion quat;
|
|
||||||
quat.SetScalar(sv);
|
|
||||||
return quat;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Quaternion & GetQuaternion(Float32 xv, Float32 yv, Float32 zv)
|
|
||||||
{
|
|
||||||
static Quaternion quat;
|
|
||||||
quat.SetVector3Ex(xv, yv, zv);
|
|
||||||
return quat;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Quaternion & GetQuaternion(Float32 xv, Float32 yv, Float32 zv, Float32 wv)
|
|
||||||
{
|
|
||||||
static Quaternion quat;
|
|
||||||
quat.SetQuaternionEx(xv, yv, zv, wv);
|
|
||||||
return quat;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Quaternion & GetQuaternion(const Quaternion & o)
|
|
||||||
{
|
|
||||||
static Quaternion quat;
|
|
||||||
quat.SetQuaternion(o);
|
|
||||||
return quat;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||||
void Register_Quaternion(HSQUIRRELVM vm)
|
void Register_Quaternion(HSQUIRRELVM vm)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
{
|
{
|
||||||
typedef Quaternion::Value Val;
|
typedef Quaternion::Value Val;
|
||||||
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef _BASE_QUATERNION_HPP_
|
#pragma once
|
||||||
#define _BASE_QUATERNION_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include "SqBase.hpp"
|
#include "SqBase.hpp"
|
||||||
@ -38,32 +37,32 @@ struct Quaternion
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Default constructor.
|
* Default constructor.
|
||||||
*/
|
*/
|
||||||
Quaternion();
|
Quaternion() noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct from scalar value.
|
* Construct from scalar value.
|
||||||
*/
|
*/
|
||||||
explicit Quaternion(Value sv);
|
explicit Quaternion(Value sv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct from Euler angles (in degrees.)
|
* Construct from Euler angles (in degrees.)
|
||||||
*/
|
*/
|
||||||
Quaternion(Value xv, Value yv, Value zv);
|
Quaternion(Value xv, Value yv, Value zv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct from individual values.
|
* Construct from individual values.
|
||||||
*/
|
*/
|
||||||
Quaternion(Value xv, Value yv, Value zv, Value wv);
|
Quaternion(Value xv, Value yv, Value zv, Value wv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy constructor.
|
* Copy constructor.
|
||||||
*/
|
*/
|
||||||
Quaternion(const Quaternion & o) = default;
|
Quaternion(const Quaternion & o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Move constructor.
|
* Move constructor.
|
||||||
*/
|
*/
|
||||||
Quaternion(Quaternion && o) = default;
|
Quaternion(Quaternion && o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Destructor.
|
* Destructor.
|
||||||
@ -158,12 +157,12 @@ struct Quaternion
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-increment operator.
|
* Post-increment operator.
|
||||||
*/
|
*/
|
||||||
Quaternion operator ++ (int);
|
Quaternion operator ++ (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-decrement operator.
|
* Post-decrement operator.
|
||||||
*/
|
*/
|
||||||
Quaternion operator -- (int);
|
Quaternion operator -- (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Addition operator.
|
* Addition operator.
|
||||||
@ -452,5 +451,3 @@ struct Quaternion
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_QUATERNION_HPP_
|
|
@ -22,7 +22,7 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Default constructor.
|
* Default constructor.
|
||||||
*/
|
*/
|
||||||
FileHandle(CSStr path)
|
explicit FileHandle(CSStr path)
|
||||||
: mFile(std::fopen(path, "rb"))
|
: mFile(std::fopen(path, "rb"))
|
||||||
{
|
{
|
||||||
if (!mFile)
|
if (!mFile)
|
||||||
@ -65,7 +65,7 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Implicit conversion to the managed file handle.
|
* Implicit conversion to the managed file handle.
|
||||||
*/
|
*/
|
||||||
operator std::FILE * ()
|
operator std::FILE * () // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
{
|
{
|
||||||
return mFile;
|
return mFile;
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Implicit conversion to the managed file handle.
|
* Implicit conversion to the managed file handle.
|
||||||
*/
|
*/
|
||||||
operator std::FILE * () const
|
operator std::FILE * () const // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
{
|
{
|
||||||
return mFile;
|
return mFile;
|
||||||
}
|
}
|
||||||
@ -99,11 +99,11 @@ void ScriptSrc::Process()
|
|||||||
return; // Probably an empty file or compiled script
|
return; // Probably an empty file or compiled script
|
||||||
}
|
}
|
||||||
// Allocate enough space to hold the file data
|
// Allocate enough space to hold the file data
|
||||||
mData.resize(length, 0);
|
mData.resize(static_cast< size_t >(length), 0);
|
||||||
// Go back to the beginning
|
// Go back to the beginning
|
||||||
std::fseek(fp, 0, SEEK_SET);
|
std::fseek(fp, 0, SEEK_SET);
|
||||||
// Read the file contents into allocated data
|
// Read the file contents into allocated data
|
||||||
std::fread(&mData[0], 1, length, fp);
|
std::fread(&mData[0], 1, static_cast< size_t >(length), fp);
|
||||||
// Where the last line ended
|
// Where the last line ended
|
||||||
size_t line_start = 0, line_end = 0;
|
size_t line_start = 0, line_end = 0;
|
||||||
// Process the file data and locate new lines
|
// Process the file data and locate new lines
|
||||||
@ -113,7 +113,7 @@ void ScriptSrc::Process()
|
|||||||
if (*itr == '\n')
|
if (*itr == '\n')
|
||||||
{
|
{
|
||||||
// Extract the line length
|
// Extract the line length
|
||||||
line_end = std::distance(mData.cbegin(), itr);
|
line_end = static_cast< size_t >(std::distance(mData.cbegin(), itr));
|
||||||
// Store the beginning of the line
|
// Store the beginning of the line
|
||||||
mLine.emplace_back(line_start, line_end);
|
mLine.emplace_back(line_start, line_end);
|
||||||
// Advance to the next line
|
// Advance to the next line
|
||||||
@ -127,7 +127,7 @@ void ScriptSrc::Process()
|
|||||||
if (*(++itr) == '\n')
|
if (*(++itr) == '\n')
|
||||||
{
|
{
|
||||||
// Extract the line length
|
// Extract the line length
|
||||||
line_end = std::distance(mData.cbegin(), itr)-1;
|
line_end = static_cast< size_t >(std::distance(mData.cbegin(), itr) - 1);
|
||||||
// Store the beginning of the line
|
// Store the beginning of the line
|
||||||
mLine.emplace_back(line_start, line_end);
|
mLine.emplace_back(line_start, line_end);
|
||||||
// Advance to the next line
|
// Advance to the next line
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef _BASE_SCRIPTSRC_HPP_
|
#pragma once
|
||||||
#define _BASE_SCRIPTSRC_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include "Base/Utility.hpp"
|
#include "Base/Utility.hpp"
|
||||||
@ -79,5 +78,3 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_SCRIPTSRC_HPP_
|
|
@ -3,15 +3,12 @@
|
|||||||
#include "Base/Buffer.hpp"
|
#include "Base/Buffer.hpp"
|
||||||
#include "Base/Color3.hpp"
|
#include "Base/Color3.hpp"
|
||||||
#include "Library/Numeric/Random.hpp"
|
#include "Library/Numeric/Random.hpp"
|
||||||
#include "Library/Numeric/LongInt.hpp"
|
|
||||||
#include "Library/String.hpp"
|
#include "Library/String.hpp"
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <cstdio>
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#ifdef SQMOD_OS_WINDOWS
|
#ifdef SQMOD_OS_WINDOWS
|
||||||
@ -166,49 +163,6 @@ static const Color3 SQ_Color_List[] =
|
|||||||
Color3(154, 205, 50)
|
Color3(154, 205, 50)
|
||||||
};
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const SLongInt & GetSLongInt()
|
|
||||||
{
|
|
||||||
static SLongInt l;
|
|
||||||
l.SetNum(0);
|
|
||||||
return l;
|
|
||||||
}
|
|
||||||
|
|
||||||
const SLongInt & GetSLongInt(Int64 n)
|
|
||||||
{
|
|
||||||
static SLongInt l;
|
|
||||||
l.SetNum(n);
|
|
||||||
return l;
|
|
||||||
}
|
|
||||||
|
|
||||||
const SLongInt & GetSLongInt(CSStr s)
|
|
||||||
{
|
|
||||||
static SLongInt l;
|
|
||||||
l = s;
|
|
||||||
return l;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ULongInt & GetULongInt()
|
|
||||||
{
|
|
||||||
static ULongInt l;
|
|
||||||
l.SetNum(0);
|
|
||||||
return l;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ULongInt & GetULongInt(Uint64 n)
|
|
||||||
{
|
|
||||||
static ULongInt l;
|
|
||||||
l.SetNum(n);
|
|
||||||
return l;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ULongInt & GetULongInt(CSStr s)
|
|
||||||
{
|
|
||||||
static ULongInt l;
|
|
||||||
l = s;
|
|
||||||
return l;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
bool NameFilterCheck(CSStr filter, CSStr name)
|
bool NameFilterCheck(CSStr filter, CSStr name)
|
||||||
{
|
{
|
||||||
@ -371,22 +325,22 @@ Color3 GetColorStr(CSStr name)
|
|||||||
switch (b)
|
switch (b)
|
||||||
{
|
{
|
||||||
// [Al]iceBlue
|
// [Al]iceBlue
|
||||||
case 'l': return Color3(240, 248, 255);
|
case 'l': return {240, 248, 255};
|
||||||
// [Aq]ua[m]arine
|
// [Aq]ua[m]arine
|
||||||
case 'm': return Color3(127, 255, 212);
|
case 'm': return {127, 255, 212};
|
||||||
// [An]tiqueWhite
|
// [An]tiqueWhite
|
||||||
case 'n': return Color3(250, 235, 215);
|
case 'n': return {250, 235, 215};
|
||||||
// [Aq]ua
|
// [Aq]ua
|
||||||
// [Aq]uamarine
|
// [Aq]uamarine
|
||||||
case 'q':
|
case 'q':
|
||||||
// [Aq]u[a]
|
// [Aq]u[a]
|
||||||
if (d == 'a') return Color3(0, 255, 255);
|
if (d == 'a') return {0, 255, 255};
|
||||||
// [Aq]ua[m]arin[e]
|
// [Aq]ua[m]arin[e]
|
||||||
else if (d == 'e' || (len > 4 && str[4] == 'm')) return Color3(127, 255, 212);
|
else if (d == 'e' || (len > 4 && str[4] == 'm')) return {127, 255, 212};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [Az]ure
|
// [Az]ure
|
||||||
case 'z': return Color3(240, 255, 255);
|
case 'z': return {240, 255, 255};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
default: return Color3::NIL;
|
default: return Color3::NIL;
|
||||||
}
|
}
|
||||||
@ -402,32 +356,32 @@ Color3 GetColorStr(CSStr name)
|
|||||||
switch (b)
|
switch (b)
|
||||||
{
|
{
|
||||||
// [B]lanched[A]lmond
|
// [B]lanched[A]lmond
|
||||||
case 'a': return Color3(255, 235, 205);
|
case 'a': return {255, 235, 205};
|
||||||
// [Be]ige
|
// [Be]ige
|
||||||
case 'e': return Color3(245, 245, 220);
|
case 'e': return {245, 245, 220};
|
||||||
// [Bi]sque
|
// [Bi]sque
|
||||||
case 'i': return Color3(255, 228, 196);
|
case 'i': return {255, 228, 196};
|
||||||
// [Bl]ack
|
// [Bl]ack
|
||||||
// [Bl]anchedAlmond
|
// [Bl]anchedAlmond
|
||||||
// [Bl]ue
|
// [Bl]ue
|
||||||
// [Bl]ueViolet
|
// [Bl]ueViolet
|
||||||
case 'l':
|
case 'l':
|
||||||
// [Bl]a[ck]
|
// [Bl]a[ck]
|
||||||
if (d == 'k' || d == 'c') return Color3(0, 0, 0);
|
if (d == 'k' || d == 'c') return {0, 0, 0};
|
||||||
// [Bl]anched[A]lmon[d]
|
// [Bl]anched[A]lmon[d]
|
||||||
else if (d == 'd' || (len > 8 && str[8] == 'a')) return Color3(255, 235, 205);
|
else if (d == 'd' || (len > 8 && str[8] == 'a')) return {255, 235, 205};
|
||||||
// [Bl]u[e]
|
// [Bl]u[e]
|
||||||
else if (d == 'e') return Color3(0, 0, 255);
|
else if (d == 'e') return {0, 0, 255};
|
||||||
// [Bl]ue[V]iole[t]
|
// [Bl]ue[V]iole[t]
|
||||||
else if (d == 't' || (len > 4 && str[4] == 'v')) return Color3(138, 43, 226);
|
else if (d == 't' || (len > 4 && str[4] == 'v')) return {138, 43, 226};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [Br]own
|
// [Br]own
|
||||||
case 'r': return Color3(165, 42, 42);
|
case 'r': return {165, 42, 42};
|
||||||
// [Bu]rlyWood
|
// [Bu]rlyWood
|
||||||
case 'u': return Color3(222, 184, 135);
|
case 'u': return {222, 184, 135};
|
||||||
// [B]lue[V]iolet
|
// [B]lue[V]iolet
|
||||||
case 'v': return Color3(138, 43, 226);
|
case 'v': return {138, 43, 226};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
default: return Color3::NIL;
|
default: return Color3::NIL;
|
||||||
}
|
}
|
||||||
@ -443,14 +397,14 @@ Color3 GetColorStr(CSStr name)
|
|||||||
switch (b)
|
switch (b)
|
||||||
{
|
{
|
||||||
// [Ca]detBlue
|
// [Ca]detBlue
|
||||||
case 'a': return Color3(95, 158, 160);
|
case 'a': return {95, 158, 160};
|
||||||
// [Ch]artreuse
|
// [Ch]artreuse
|
||||||
// [Ch]ocolate
|
// [Ch]ocolate
|
||||||
case 'h':
|
case 'h':
|
||||||
// [Ch]artreuse
|
// [Ch]artreuse
|
||||||
if (c == 'a') return Color3(127, 255, 0);
|
if (c == 'a') return {127, 255, 0};
|
||||||
// [Ch]ocolate
|
// [Ch]ocolate
|
||||||
else if (c == 'o') return Color3(210, 105, 30);
|
else if (c == 'o') return {210, 105, 30};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [Co]ral
|
// [Co]ral
|
||||||
@ -458,17 +412,17 @@ Color3 GetColorStr(CSStr name)
|
|||||||
// [Co]rnsilk
|
// [Co]rnsilk
|
||||||
case 'o':
|
case 'o':
|
||||||
// [Co]ra[l]
|
// [Co]ra[l]
|
||||||
if (d == 'l') return Color3(255, 127, 80);
|
if (d == 'l') return {255, 127, 80};
|
||||||
// [Co]rnflower[B]lu[e]
|
// [Co]rnflower[B]lu[e]
|
||||||
else if (d == 'e' || (len > 10 && str[10] == 'b')) return Color3(100, 149, 237);
|
else if (d == 'e' || (len > 10 && str[10] == 'b')) return {100, 149, 237};
|
||||||
// [Co]rnsil[k]
|
// [Co]rnsil[k]
|
||||||
else if (d == 'k') return Color3(255, 248, 220);
|
else if (d == 'k') return {255, 248, 220};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [Cr]imson
|
// [Cr]imson
|
||||||
case 'r': return Color3(220, 20, 60);
|
case 'r': return {220, 20, 60};
|
||||||
// [Cy]an
|
// [Cy]an
|
||||||
case 'y': return Color3(0, 255, 255);
|
case 'y': return {0, 255, 255};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
default: return Color3::NIL;
|
default: return Color3::NIL;
|
||||||
}
|
}
|
||||||
@ -495,13 +449,13 @@ Color3 GetColorStr(CSStr name)
|
|||||||
// [D]odgerBlue
|
// [D]odgerBlue
|
||||||
case 'd':
|
case 'd':
|
||||||
// [Di]mGray
|
// [Di]mGray
|
||||||
if (b == 'i' || b == 'g') return Color3(105, 105, 105);
|
if (b == 'i' || b == 'g') return {105, 105, 105};
|
||||||
// [Do]dgerBlue
|
// [Do]dgerBlue
|
||||||
else if (b == 'o' || b == 'b') return Color3(30, 144, 255);
|
else if (b == 'o' || b == 'b') return {30, 144, 255};
|
||||||
// [De]ep[P]in[k]
|
// [De]ep[P]in[k]
|
||||||
else if (b == 'e' && (d == 'k' || (len > 4 && str[4] == 'p'))) return Color3(255, 20, 147);
|
else if (b == 'e' && (d == 'k' || (len > 4 && str[4] == 'p'))) return {255, 20, 147};
|
||||||
// [De]ep[S]kyBlu[e]
|
// [De]ep[S]kyBlu[e]
|
||||||
else if (b == 'e' && (d == 'e' || (len > 4 && str[4] == 's'))) return Color3(0, 191, 255);
|
else if (b == 'e' && (d == 'e' || (len > 4 && str[4] == 's'))) return {0, 191, 255};
|
||||||
// [Da]rkBlue
|
// [Da]rkBlue
|
||||||
// [Da]rkCyan
|
// [Da]rkCyan
|
||||||
// [Da]rkGoldenRod
|
// [Da]rkGoldenRod
|
||||||
@ -521,39 +475,39 @@ Color3 GetColorStr(CSStr name)
|
|||||||
// [Da]rkViolet
|
// [Da]rkViolet
|
||||||
else if (b == 'a') {
|
else if (b == 'a') {
|
||||||
// [Da]rk[B]lue
|
// [Da]rk[B]lue
|
||||||
if (c == 'b' || (len > 4 && str[4] == 'b')) return Color3(0, 0, 139);
|
if (c == 'b' || (len > 4 && str[4] == 'b')) return {0, 0, 139};
|
||||||
// [Da]rk[C]yan
|
// [Da]rk[C]yan
|
||||||
else if (c == 'c' || (len > 4 && str[4] == 'c')) return Color3(0, 139, 139);
|
else if (c == 'c' || (len > 4 && str[4] == 'c')) return {0, 139, 139};
|
||||||
// [Da]rk[Go]ldenRo[d]
|
// [Da]rk[Go]ldenRo[d]
|
||||||
else if ((len > 4 && str[4] == 'g') && (d == 'd' || d == 'o')) return Color3(184, 134, 11);
|
else if ((len > 4 && str[4] == 'g') && (d == 'd' || d == 'o')) return {184, 134, 11};
|
||||||
// [Da]rk[G]r[ay]
|
// [Da]rk[G]r[ay]
|
||||||
else if ((len > 4 && str[4] == 'g') && (d == 'y' || d == 'a')) return Color3(169, 169, 169);
|
else if ((len > 4 && str[4] == 'g') && (d == 'y' || d == 'a')) return {169, 169, 169};
|
||||||
// [Da]rk[G]r[een]
|
// [Da]rk[G]r[een]
|
||||||
else if ((len > 4 && str[4] == 'g') && (d == 'n' || d == 'e')) return Color3(0, 100, 0);
|
else if ((len > 4 && str[4] == 'g') && (d == 'n' || d == 'e')) return {0, 100, 0};
|
||||||
// [Da]rk[K]hak[i]
|
// [Da]rk[K]hak[i]
|
||||||
else if (d == 'i' || c == 'k' || (len > 4 && str[4] == 'k')) return Color3(189, 183, 107);
|
else if (d == 'i' || c == 'k' || (len > 4 && str[4] == 'k')) return {189, 183, 107};
|
||||||
// [Da]rk[M]agent[a]
|
// [Da]rk[M]agent[a]
|
||||||
else if (d == 'a' || c == 'm' || (len > 4 && str[4] == 'm')) return Color3(139, 0, 139);
|
else if (d == 'a' || c == 'm' || (len > 4 && str[4] == 'm')) return {139, 0, 139};
|
||||||
// [Da]rk[O]liveGr[een]
|
// [Da]rk[O]liveGr[een]
|
||||||
else if ((len > 4 && str[4] == 'o') && (d == 'n' || d == 'e')) return Color3(85, 107, 47);
|
else if ((len > 4 && str[4] == 'o') && (d == 'n' || d == 'e')) return {85, 107, 47};
|
||||||
// [Da]rk[O]r[a]ng[e]
|
// [Da]rk[O]r[a]ng[e]
|
||||||
else if ((len > 4 && str[4] == 'o') && (d == 'e' || d == 'a')) return Color3(255, 140, 0);
|
else if ((len > 4 && str[4] == 'o') && (d == 'e' || d == 'a')) return {255, 140, 0};
|
||||||
// [Da]rk[O]r[c]hi[d]
|
// [Da]rk[O]r[c]hi[d]
|
||||||
else if ((len > 4 && str[4] == 'o') && (d == 'd' || d == 'c')) return Color3(153, 50, 204);
|
else if ((len > 4 && str[4] == 'o') && (d == 'd' || d == 'c')) return {153, 50, 204};
|
||||||
// [Da]rk[R]ed
|
// [Da]rk[R]ed
|
||||||
else if (len > 4 && str[4] == 'r') return Color3(139, 0, 0);
|
else if (len > 4 && str[4] == 'r') return {139, 0, 0};
|
||||||
// [Da]rk[Sa]lmon
|
// [Da]rk[Sa]lmon
|
||||||
else if (len > 5 && str[4] == 's' && str[5] == 'a') return Color3(233, 150, 122);
|
else if (len > 5 && str[4] == 's' && str[5] == 'a') return {233, 150, 122};
|
||||||
// [Da]rk[Se]aGreen
|
// [Da]rk[Se]aGreen
|
||||||
else if (len > 5 && str[4] == 's' && str[5] == 'e') return Color3(143, 188, 143);
|
else if (len > 5 && str[4] == 's' && str[5] == 'e') return {143, 188, 143};
|
||||||
// [Da]rk[S]lateBlu[e]
|
// [Da]rk[S]lateBlu[e]
|
||||||
else if ((len > 4 && str[4] == 's') && (d == 'e' || d == 'b')) return Color3(72, 61, 139);
|
else if ((len > 4 && str[4] == 's') && (d == 'e' || d == 'b')) return {72, 61, 139};
|
||||||
// [Da]rk[S]lateGra[y]
|
// [Da]rk[S]lateGra[y]
|
||||||
else if ((len > 4 && str[4] == 's') && (d == 'y' || d == 'g')) return Color3(47, 79, 79);
|
else if ((len > 4 && str[4] == 's') && (d == 'y' || d == 'g')) return {47, 79, 79};
|
||||||
// [Da]rk[T]urquoise
|
// [Da]rk[T]urquoise
|
||||||
else if (c == 't' || (len > 4 && str[4] == 't')) return Color3(0, 206, 209);
|
else if (c == 't' || (len > 4 && str[4] == 't')) return {0, 206, 209};
|
||||||
// [Da]rk[V]iolet
|
// [Da]rk[V]iolet
|
||||||
else if (c == 'v' || (len > 4 && str[4] == 'v')) return Color3(148, 0, 211);
|
else if (c == 'v' || (len > 4 && str[4] == 'v')) return {148, 0, 211};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// Default to blank
|
// Default to blank
|
||||||
@ -567,15 +521,15 @@ Color3 GetColorStr(CSStr name)
|
|||||||
{
|
{
|
||||||
// [Fi]re[B]rick
|
// [Fi]re[B]rick
|
||||||
case 'i':
|
case 'i':
|
||||||
case 'b': return Color3(178, 34, 34);
|
case 'b': return {178, 34, 34};
|
||||||
// [Fl]oral[W]hite
|
// [Fl]oral[W]hite
|
||||||
case 'l':
|
case 'l':
|
||||||
case 'w': return Color3(255, 250, 240);
|
case 'w': return {255, 250, 240};
|
||||||
// [Fo]rest[G]reen
|
// [Fo]rest[G]reen
|
||||||
case 'o':
|
case 'o':
|
||||||
case 'g': return Color3(34, 139, 34);
|
case 'g': return {34, 139, 34};
|
||||||
// [Fu]chsia
|
// [Fu]chsia
|
||||||
case 'u': return Color3(255, 0, 255);
|
case 'u': return {255, 0, 255};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
default: return Color3::NIL;
|
default: return Color3::NIL;
|
||||||
}
|
}
|
||||||
@ -588,28 +542,28 @@ Color3 GetColorStr(CSStr name)
|
|||||||
// [G]reenYellow
|
// [G]reenYellow
|
||||||
case 'g':
|
case 'g':
|
||||||
// [Ga]insboro
|
// [Ga]insboro
|
||||||
if (b == 'a') return Color3(220, 220, 220);
|
if (b == 'a') return {220, 220, 220};
|
||||||
// [Gh]ost[W]hite
|
// [Gh]ost[W]hite
|
||||||
else if (b == 'h' || b == 'w') return Color3(248, 248, 255);
|
else if (b == 'h' || b == 'w') return {248, 248, 255};
|
||||||
// [Go]ld[e]n[R]od
|
// [Go]ld[e]n[R]od
|
||||||
else if (len > 4 && (str[4] == 'e' || str[4] == 'r')) return Color3(218, 165, 32);
|
else if (len > 4 && (str[4] == 'e' || str[4] == 'r')) return {218, 165, 32};
|
||||||
// [Go]l[d]
|
// [Go]l[d]
|
||||||
else if (b == 'o' && d == 'd') return Color3(255, 215, 0);
|
else if (b == 'o' && d == 'd') return {255, 215, 0};
|
||||||
// [Gray]
|
// [Gray]
|
||||||
else if (b == 'r' && (d == 'y' || d == 'a')) return Color3(128, 128, 128);
|
else if (b == 'r' && (d == 'y' || d == 'a')) return {128, 128, 128};
|
||||||
// [Gr]een
|
// [Gr]een
|
||||||
else if (b == 'r' && d == 'n') return Color3(0, 128, 0);
|
else if (b == 'r' && d == 'n') return {0, 128, 0};
|
||||||
// [Gr]eenYellow
|
// [Gr]eenYellow
|
||||||
else if (b == 'r' && (d == 'w' || (len > 5 && str[5] == 'y'))) return Color3(173, 255, 47);
|
else if (b == 'r' && (d == 'w' || (len > 5 && str[5] == 'y'))) return {173, 255, 47};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [H]oneyDew
|
// [H]oneyDew
|
||||||
// [H]otPink
|
// [H]otPink
|
||||||
case 'h':
|
case 'h':
|
||||||
// [H]o[n]ey[D]e[w]
|
// [H]o[n]ey[D]e[w]
|
||||||
if (d == 'w' || c == 'n' || (len > 5 && str[5] == 'd')) return Color3(240, 255, 240);
|
if (d == 'w' || c == 'n' || (len > 5 && str[5] == 'd')) return {240, 255, 240};
|
||||||
// [H]o[tP]in[k]
|
// [H]o[tP]in[k]
|
||||||
else if (d == 'k' || c == 't' || (len > 3 && str[3] == 'p')) return Color3(255, 105, 180);
|
else if (d == 'k' || c == 't' || (len > 3 && str[3] == 'p')) return {255, 105, 180};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [I]ndianRed
|
// [I]ndianRed
|
||||||
@ -617,15 +571,15 @@ Color3 GetColorStr(CSStr name)
|
|||||||
// [I]vory
|
// [I]vory
|
||||||
case 'i':
|
case 'i':
|
||||||
// [In]dian[R]e[d]
|
// [In]dian[R]e[d]
|
||||||
if (b == 'n' && (d == 'd' || d == 'r')) return Color3(205, 92, 92);
|
if (b == 'n' && (d == 'd' || d == 'r')) return {205, 92, 92};
|
||||||
// [In]di[go]
|
// [In]di[go]
|
||||||
else if (b == 'n' && (d == 'o' || d == 'g')) return Color3(75, 0, 130);
|
else if (b == 'n' && (d == 'o' || d == 'g')) return {75, 0, 130};
|
||||||
// [I]vory
|
// [I]vory
|
||||||
else if (b == 'v') return Color3(255, 255, 240);
|
else if (b == 'v') return {255, 255, 240};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [K]haki
|
// [K]haki
|
||||||
case 'k': return Color3(240, 230, 140);
|
case 'k': return {240, 230, 140};
|
||||||
// [L]avender
|
// [L]avender
|
||||||
// [L]avenderBlush
|
// [L]avenderBlush
|
||||||
// [L]awnGreen
|
// [L]awnGreen
|
||||||
@ -648,19 +602,19 @@ Color3 GetColorStr(CSStr name)
|
|||||||
// [L]inen
|
// [L]inen
|
||||||
case 'l':
|
case 'l':
|
||||||
// [La]vende[r]
|
// [La]vende[r]
|
||||||
if (b == 'a' && d == 'r') return Color3(230, 230, 250);
|
if (b == 'a' && d == 'r') return {230, 230, 250};
|
||||||
// [La]vender[B]lus[h]
|
// [La]vender[B]lus[h]
|
||||||
else if (b == 'a' && (d == 'h' || d == 'b')) return Color3(255, 240, 245);
|
else if (b == 'a' && (d == 'h' || d == 'b')) return {255, 240, 245};
|
||||||
// [Law]n[G]ree[n]
|
// [Law]n[G]ree[n]
|
||||||
else if (b == 'g' || (b == 'a' && (c == 'w' || d == 'n'))) return Color3(124, 252, 0);
|
else if (b == 'g' || (b == 'a' && (c == 'w' || d == 'n'))) return {124, 252, 0};
|
||||||
// [Le]mon[C]hiffon
|
// [Le]mon[C]hiffon
|
||||||
else if (b == 'e' || b == 'c') return Color3(255, 250, 205);
|
else if (b == 'e' || b == 'c') return {255, 250, 205};
|
||||||
// [Li]me[G]reen
|
// [Li]me[G]reen
|
||||||
else if (b == 'g' || (b == 'i' && (len > 4 && str[4] == 'g'))) return Color3(50, 205, 50);
|
else if (b == 'g' || (b == 'i' && (len > 4 && str[4] == 'g'))) return {50, 205, 50};
|
||||||
// [Lime]
|
// [Lime]
|
||||||
else if (b == 'i' && c == 'm' && d == 'e') return Color3(0, 255, 0);
|
else if (b == 'i' && c == 'm' && d == 'e') return {0, 255, 0};
|
||||||
// [Lin]e[n]
|
// [Lin]e[n]
|
||||||
else if (b == 'i' && (c == 'n' || d == 'n')) return Color3(250, 240, 230);
|
else if (b == 'i' && (c == 'n' || d == 'n')) return {250, 240, 230};
|
||||||
// [Li]ghtBlue
|
// [Li]ghtBlue
|
||||||
// [Li]ghtCoral
|
// [Li]ghtCoral
|
||||||
// [Li]ghtCyan
|
// [Li]ghtCyan
|
||||||
@ -676,31 +630,31 @@ Color3 GetColorStr(CSStr name)
|
|||||||
// [Li]ghtYellow
|
// [Li]ghtYellow
|
||||||
else if (b == 'i') {
|
else if (b == 'i') {
|
||||||
// [Li]ght[B]lue
|
// [Li]ght[B]lue
|
||||||
if (len > 5 && str[5] == 'b') return Color3(173, 216, 230);
|
if (len > 5 && str[5] == 'b') return {173, 216, 230};
|
||||||
// [Li]ght[Co]ra[l]
|
// [Li]ght[Co]ra[l]
|
||||||
else if ((len > 5 && str[5] == 'c') && (d == 'l' || d == 'o')) return Color3(240, 128, 128);
|
else if ((len > 5 && str[5] == 'c') && (d == 'l' || d == 'o')) return {240, 128, 128};
|
||||||
// [Li]ght[Cy]a[n]
|
// [Li]ght[Cy]a[n]
|
||||||
else if ((len > 5 && str[5] == 'c') && (d == 'n' || d == 'y')) return Color3(224, 255, 255);
|
else if ((len > 5 && str[5] == 'c') && (d == 'n' || d == 'y')) return {224, 255, 255};
|
||||||
// [Li]ght[Go]ldenRodYello[w]
|
// [Li]ght[Go]ldenRodYello[w]
|
||||||
else if ((len > 5 && str[5] == 'g') && (d == 'w' || d == 'o')) return Color3(250, 250, 210);
|
else if ((len > 5 && str[5] == 'g') && (d == 'w' || d == 'o')) return {250, 250, 210};
|
||||||
// [Li]ght[G]r[ay]
|
// [Li]ght[G]r[ay]
|
||||||
else if ((len > 5 && str[5] == 'g') && (d == 'y' || d == 'a')) return Color3(211, 211, 211);
|
else if ((len > 5 && str[5] == 'g') && (d == 'y' || d == 'a')) return {211, 211, 211};
|
||||||
// [Li]ght[G]r[een]
|
// [Li]ght[G]r[een]
|
||||||
else if ((len > 5 && str[5] == 'g') && (d == 'n' || d == 'e')) return Color3(144, 238, 144);
|
else if ((len > 5 && str[5] == 'g') && (d == 'n' || d == 'e')) return {144, 238, 144};
|
||||||
// [Li]ght[P]ink
|
// [Li]ght[P]ink
|
||||||
else if (len > 5 && str[5] == 'p') return Color3(255, 182, 193);
|
else if (len > 5 && str[5] == 'p') return {255, 182, 193};
|
||||||
// [Li]ght[Sa]lmon
|
// [Li]ght[Sa]lmon
|
||||||
else if (len > 6 && str[5] == 's' && str[5] == 'a') return Color3(255, 160, 122);
|
else if (len > 6 && str[5] == 's' && str[5] == 'a') return {255, 160, 122};
|
||||||
// [Li]ght[Se]aGreen
|
// [Li]ght[Se]aGreen
|
||||||
else if (len > 6 && str[5] == 's' && str[5] == 'e') return Color3(32, 178, 170);
|
else if (len > 6 && str[5] == 's' && str[5] == 'e') return {32, 178, 170};
|
||||||
// [Li]ght[Sk]yBlue
|
// [Li]ght[Sk]yBlue
|
||||||
else if (len > 6 && str[5] == 's' && str[5] == 'k') return Color3(135, 206, 250);
|
else if (len > 6 && str[5] == 's' && str[5] == 'k') return {135, 206, 250};
|
||||||
// [Li]ght[Sl]ateGray
|
// [Li]ght[Sl]ateGray
|
||||||
else if (len > 6 && str[5] == 's' && str[5] == 'l') return Color3(119, 136, 153);
|
else if (len > 6 && str[5] == 's' && str[5] == 'l') return {119, 136, 153};
|
||||||
// [Li]ght[St]eelBlue
|
// [Li]ght[St]eelBlue
|
||||||
else if (len > 6 && str[5] == 's' && str[5] == 't') return Color3(176, 196, 222);
|
else if (len > 6 && str[5] == 's' && str[5] == 't') return {176, 196, 222};
|
||||||
// [Li]ght[Y]ellow
|
// [Li]ght[Y]ellow
|
||||||
else if (len > 5 && str[5] == 'y') return Color3(255, 255, 224);
|
else if (len > 5 && str[5] == 'y') return {255, 255, 224};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// Default to blank
|
// Default to blank
|
||||||
@ -722,9 +676,9 @@ Color3 GetColorStr(CSStr name)
|
|||||||
// [M]occasin
|
// [M]occasin
|
||||||
case 'm':
|
case 'm':
|
||||||
// [Ma]genta
|
// [Ma]genta
|
||||||
if (b == 'a' && (c == 'a' || d == 'a')) return Color3(255, 0, 255);
|
if (b == 'a' && (c == 'a' || d == 'a')) return {255, 0, 255};
|
||||||
// [Ma]roon
|
// [Ma]roon
|
||||||
else if (b == 'a' && (c == 'r' || d == 'n' || d == 'o')) return Color3(128, 0, 0);
|
else if (b == 'a' && (c == 'r' || d == 'n' || d == 'o')) return {128, 0, 0};
|
||||||
// [Me]diumAquaMarine
|
// [Me]diumAquaMarine
|
||||||
// [Me]diumBlue
|
// [Me]diumBlue
|
||||||
// [Me]diumOrchid
|
// [Me]diumOrchid
|
||||||
@ -736,43 +690,43 @@ Color3 GetColorStr(CSStr name)
|
|||||||
// [Me]diumVioletRed
|
// [Me]diumVioletRed
|
||||||
else if (b == 'e') {
|
else if (b == 'e') {
|
||||||
// [Me]dium[A]quaMarine
|
// [Me]dium[A]quaMarine
|
||||||
if (c == 'a' || (len > 6 && str[6] == 'a')) return Color3(102, 205, 170);
|
if (c == 'a' || (len > 6 && str[6] == 'a')) return {102, 205, 170};
|
||||||
// [Me]dium[B]lue
|
// [Me]dium[B]lue
|
||||||
else if (c == 'b' || (len > 6 && str[6] == 'b')) return Color3(0, 0, 205);
|
else if (c == 'b' || (len > 6 && str[6] == 'b')) return {0, 0, 205};
|
||||||
// [Me]dium[O]rchid
|
// [Me]dium[O]rchid
|
||||||
else if (c == 'o' || (len > 6 && str[6] == 'o')) return Color3(186, 85, 211);
|
else if (c == 'o' || (len > 6 && str[6] == 'o')) return {186, 85, 211};
|
||||||
// [Me]dium[P]urple
|
// [Me]dium[P]urple
|
||||||
else if (c == 'p' || (len > 6 && str[6] == 'p')) return Color3(147, 112, 219);
|
else if (c == 'p' || (len > 6 && str[6] == 'p')) return {147, 112, 219};
|
||||||
// [Me]dium[T]urquoise
|
// [Me]dium[T]urquoise
|
||||||
else if (c == 't' || (len > 6 && str[6] == 't')) return Color3(72, 209, 204);
|
else if (c == 't' || (len > 6 && str[6] == 't')) return {72, 209, 204};
|
||||||
// [Me]dium[V]ioletRed
|
// [Me]dium[V]ioletRed
|
||||||
else if (c == 'v' || (len > 6 && str[6] == 'v')) return Color3(199, 21, 133);
|
else if (c == 'v' || (len > 6 && str[6] == 'v')) return {199, 21, 133};
|
||||||
// [Me]dium[Se]aGreen
|
// [Me]dium[Se]aGreen
|
||||||
else if (len > 7 && str[6] == 's' && str[7] == 'e') return Color3(60, 179, 113);
|
else if (len > 7 && str[6] == 's' && str[7] == 'e') return {60, 179, 113};
|
||||||
// [Me]dium[Sl]ateBlue
|
// [Me]dium[Sl]ateBlue
|
||||||
else if (len > 7 && str[6] == 's' && str[7] == 'l') return Color3(123, 104, 238);
|
else if (len > 7 && str[6] == 's' && str[7] == 'l') return {123, 104, 238};
|
||||||
// [Me]dium[Sp]ringGreen
|
// [Me]dium[Sp]ringGreen
|
||||||
else if (len > 7 && str[6] == 's' && str[7] == 'p') return Color3(0, 250, 154);
|
else if (len > 7 && str[6] == 's' && str[7] == 'p') return {0, 250, 154};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
}
|
}
|
||||||
// [Mi]dnightBlue
|
// [Mi]dnightBlue
|
||||||
else if (b == 'i' && c == 'd') return Color3(25, 25, 112);
|
else if (b == 'i' && c == 'd') return {25, 25, 112};
|
||||||
// [Mi]ntCream
|
// [Mi]ntCream
|
||||||
else if (b == 'i' && c == 'n') return Color3(245, 255, 250);
|
else if (b == 'i' && c == 'n') return {245, 255, 250};
|
||||||
// [Mi]styRose
|
// [Mi]styRose
|
||||||
else if (b == 'i' && c == 's') return Color3(255, 228, 225);
|
else if (b == 'i' && c == 's') return {255, 228, 225};
|
||||||
// [Mo]ccasin
|
// [Mo]ccasin
|
||||||
else if (b == 'o') return Color3(255, 228, 181);
|
else if (b == 'o') return {255, 228, 181};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [N]avajoWhite
|
// [N]avajoWhite
|
||||||
// [N]avy
|
// [N]avy
|
||||||
case 'n':
|
case 'n':
|
||||||
// [Na]vajo[W]hite
|
// [Na]vajo[W]hite
|
||||||
if (c == 'v' || c == 'w') return Color3(255, 222, 173);
|
if (c == 'v' || c == 'w') return {255, 222, 173};
|
||||||
// [Na]v[y]
|
// [Na]v[y]
|
||||||
else if (c == 'a' || d == 'y') return Color3(0, 0, 128);
|
else if (c == 'a' || d == 'y') return {0, 0, 128};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [O]ldLace
|
// [O]ldLace
|
||||||
@ -783,17 +737,17 @@ Color3 GetColorStr(CSStr name)
|
|||||||
// [O]rchid
|
// [O]rchid
|
||||||
case 'o':
|
case 'o':
|
||||||
// [Old]Lace
|
// [Old]Lace
|
||||||
if (b == 'l' && c == 'd') return Color3(253, 245, 230);
|
if (b == 'l' && c == 'd') return {253, 245, 230};
|
||||||
// [Ol]ive[D]ra[b]
|
// [Ol]ive[D]ra[b]
|
||||||
else if (b == 'l' && (d == 'b' || d == 'd')) return Color3(107, 142, 35);
|
else if (b == 'l' && (d == 'b' || d == 'd')) return {107, 142, 35};
|
||||||
// [Ol]iv[e]
|
// [Ol]iv[e]
|
||||||
else if (b == 'l' && d == 'e') return Color3(128, 128, 0);
|
else if (b == 'l' && d == 'e') return {128, 128, 0};
|
||||||
// [Or]ange[R]e[d]
|
// [Or]ange[R]e[d]
|
||||||
else if (b == 'r' && (d == 'd' || d == 'r')) return Color3(255, 69, 0);
|
else if (b == 'r' && (d == 'd' || d == 'r')) return {255, 69, 0};
|
||||||
// [Or]ang[e]
|
// [Or]ang[e]
|
||||||
else if (b == 'r' && d == 'e') return Color3(255, 165, 0);
|
else if (b == 'r' && d == 'e') return {255, 165, 0};
|
||||||
// [Orc]hid
|
// [Orc]hid
|
||||||
else if (d == 'c') return Color3(218, 112, 214);
|
else if (d == 'c') return {218, 112, 214};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [P]aleGoldenRod
|
// [P]aleGoldenRod
|
||||||
@ -809,27 +763,27 @@ Color3 GetColorStr(CSStr name)
|
|||||||
// [P]urple
|
// [P]urple
|
||||||
case 'p':
|
case 'p':
|
||||||
// [Pu]rple
|
// [Pu]rple
|
||||||
if (b == 'u') return Color3(128, 0, 128);
|
if (b == 'u') return {128, 0, 128};
|
||||||
// [Po]wderBlue
|
// [Po]wderBlue
|
||||||
else if (b == 'o') return Color3(176, 224, 230);
|
else if (b == 'o') return {176, 224, 230};
|
||||||
// [Pi]nk
|
// [Pi]nk
|
||||||
else if (b == 'i') return Color3(255, 192, 203);
|
else if (b == 'i') return {255, 192, 203};
|
||||||
// [Pl]um
|
// [Pl]um
|
||||||
else if (b == 'l') return Color3(221, 160, 221);
|
else if (b == 'l') return {221, 160, 221};
|
||||||
// [Pea]chPuff
|
// [Pea]chPuff
|
||||||
else if (b == 'e' && c == 'a') return Color3(255, 218, 185);
|
else if (b == 'e' && c == 'a') return {255, 218, 185};
|
||||||
// [Per]u
|
// [Per]u
|
||||||
else if (b == 'e' && c == 'r') return Color3(205, 133, 63);
|
else if (b == 'e' && c == 'r') return {205, 133, 63};
|
||||||
// [Pa]payaWhip
|
// [Pa]payaWhip
|
||||||
else if (b == 'a' && c == 'p') return Color3(255, 239, 213);
|
else if (b == 'a' && c == 'p') return {255, 239, 213};
|
||||||
// [Pa]le[Go]ldenRod
|
// [Pa]le[Go]ldenRod
|
||||||
else if (b == 'a' && (len > 5 && str[4] == 'g' && str[5] == 'o')) return Color3(238, 232, 170);
|
else if (b == 'a' && (len > 5 && str[4] == 'g' && str[5] == 'o')) return {238, 232, 170};
|
||||||
// [Pa]le[Gr]een
|
// [Pa]le[Gr]een
|
||||||
else if (b == 'a' && (len > 5 && str[4] == 'g' && str[5] == 'r')) return Color3(152, 251, 152);
|
else if (b == 'a' && (len > 5 && str[4] == 'g' && str[5] == 'r')) return {152, 251, 152};
|
||||||
// [Pa]le[T]urquoise
|
// [Pa]le[T]urquoise
|
||||||
else if (b == 'a' && (len > 4 && str[4] == 't')) return Color3(175, 238, 238);
|
else if (b == 'a' && (len > 4 && str[4] == 't')) return {175, 238, 238};
|
||||||
// [Pa]le[V]ioletRed
|
// [Pa]le[V]ioletRed
|
||||||
else if (b == 'a' && (len > 4 && str[4] == 'v')) return Color3(219, 112, 147);
|
else if (b == 'a' && (len > 4 && str[4] == 'v')) return {219, 112, 147};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [R]ed
|
// [R]ed
|
||||||
@ -837,11 +791,11 @@ Color3 GetColorStr(CSStr name)
|
|||||||
// [R]oyalBlue
|
// [R]oyalBlue
|
||||||
case 'r':
|
case 'r':
|
||||||
// [Re]d
|
// [Re]d
|
||||||
if (b == 'e') return Color3(255, 0, 0);
|
if (b == 'e') return {255, 0, 0};
|
||||||
// [Ros]yBrown
|
// [Ros]yBrown
|
||||||
else if (b == 'o' && c == 's') return Color3(188, 143, 143);
|
else if (b == 'o' && c == 's') return {188, 143, 143};
|
||||||
// [Roy]alBlue
|
// [Roy]alBlue
|
||||||
else if (b == 'o' && c == 'y') return Color3(65, 105, 225);
|
else if (b == 'o' && c == 'y') return {65, 105, 225};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [S]addleBrown
|
// [S]addleBrown
|
||||||
@ -859,31 +813,31 @@ Color3 GetColorStr(CSStr name)
|
|||||||
// [S]teelBlue
|
// [S]teelBlue
|
||||||
case 's':
|
case 's':
|
||||||
// [Sad]dleBrown
|
// [Sad]dleBrown
|
||||||
if (b == 'a' && c == 'd') return Color3(139, 69, 19);
|
if (b == 'a' && c == 'd') return {139, 69, 19};
|
||||||
// [Sal]mon
|
// [Sal]mon
|
||||||
else if (b == 'a' && c == 'l') return Color3(250, 128, 114);
|
else if (b == 'a' && c == 'l') return {250, 128, 114};
|
||||||
// [San]dyBrown
|
// [San]dyBrown
|
||||||
else if (b == 'a' && c == 'n') return Color3(244, 164, 96);
|
else if (b == 'a' && c == 'n') return {244, 164, 96};
|
||||||
// [Se]a[G]reen
|
// [Se]a[G]reen
|
||||||
else if (b == 'e' && d == 'g') return Color3(46, 139, 87);
|
else if (b == 'e' && d == 'g') return {46, 139, 87};
|
||||||
// [Se]a[S]hell
|
// [Se]a[S]hell
|
||||||
else if (b == 'e' && d == 's') return Color3(255, 245, 238);
|
else if (b == 'e' && d == 's') return {255, 245, 238};
|
||||||
// [Sie]nna
|
// [Sie]nna
|
||||||
else if (b == 'i' && c == 'e') return Color3(160, 82, 45);
|
else if (b == 'i' && c == 'e') return {160, 82, 45};
|
||||||
// [Sil]ver
|
// [Sil]ver
|
||||||
else if (b == 'i' && c == 'l') return Color3(192, 192, 192);
|
else if (b == 'i' && c == 'l') return {192, 192, 192};
|
||||||
// [Sk]yBlue
|
// [Sk]yBlue
|
||||||
else if (b == 'k') return Color3(135, 206, 235);
|
else if (b == 'k') return {135, 206, 235};
|
||||||
// [Sl]ateBlue
|
// [Sl]ateBlue
|
||||||
else if (b == 'l' && (d == 'e' || (len > 5 && str[5] == 'b'))) return Color3(106, 90, 205);
|
else if (b == 'l' && (d == 'e' || (len > 5 && str[5] == 'b'))) return {106, 90, 205};
|
||||||
// [Sl]ateGray
|
// [Sl]ateGray
|
||||||
else if (b == 'l' && (d == 'y' || (len > 5 && str[5] == 'g'))) return Color3(112, 128, 144);
|
else if (b == 'l' && (d == 'y' || (len > 5 && str[5] == 'g'))) return {112, 128, 144};
|
||||||
// [Sn]ow
|
// [Sn]ow
|
||||||
else if (b == 'n') return Color3(255, 250, 250);
|
else if (b == 'n') return {255, 250, 250};
|
||||||
// [Sp]ringGreen
|
// [Sp]ringGreen
|
||||||
else if (b == 'p') return Color3(0, 255, 127);
|
else if (b == 'p') return {0, 255, 127};
|
||||||
// [St]eelBlue
|
// [St]eelBlue
|
||||||
else if (b == 't') return Color3(70, 130, 180);
|
else if (b == 't') return {70, 130, 180};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [T]an
|
// [T]an
|
||||||
@ -895,39 +849,39 @@ Color3 GetColorStr(CSStr name)
|
|||||||
switch(b)
|
switch(b)
|
||||||
{
|
{
|
||||||
// [Ta]n
|
// [Ta]n
|
||||||
case 'a': return Color3(210, 180, 140);
|
case 'a': return {210, 180, 140};
|
||||||
// [Te]al
|
// [Te]al
|
||||||
case 'e': return Color3(0, 128, 128);
|
case 'e': return {0, 128, 128};
|
||||||
// [Th]istle
|
// [Th]istle
|
||||||
case 'h': return Color3(216, 191, 216);
|
case 'h': return {216, 191, 216};
|
||||||
// [To]mato
|
// [To]mato
|
||||||
case 'o': return Color3(255, 99, 71);
|
case 'o': return {255, 99, 71};
|
||||||
// [Tu]rquoise
|
// [Tu]rquoise
|
||||||
case 'u': return Color3(64, 224, 208);
|
case 'u': return {64, 224, 208};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
default: return Color3::NIL;
|
default: return Color3::NIL;
|
||||||
}
|
}
|
||||||
// [V]iolet
|
// [V]iolet
|
||||||
case 'v': return Color3(238, 130, 238);
|
case 'v': return {238, 130, 238};
|
||||||
// [W]heat
|
// [W]heat
|
||||||
// [W]hite
|
// [W]hite
|
||||||
// [W]hiteSmoke
|
// [W]hiteSmoke
|
||||||
case 'w':
|
case 'w':
|
||||||
// [Wh]eat
|
// [Wh]eat
|
||||||
if (b == 'h' && c == 'e') return Color3(245, 222, 179);
|
if (b == 'h' && c == 'e') return {245, 222, 179};
|
||||||
// [Wh]ite[S]moke
|
// [Wh]ite[S]moke
|
||||||
else if (b == 'h' && (len > 5 && str[5] == 's')) return Color3(245, 245, 245);
|
else if (b == 'h' && (len > 5 && str[5] == 's')) return {245, 245, 245};
|
||||||
// [Whi]te
|
// [Whi]te
|
||||||
else if (b == 'h' && c == 'i') return Color3(255, 255, 255);
|
else if (b == 'h' && c == 'i') return {255, 255, 255};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// [Y]ellow
|
// [Y]ellow
|
||||||
// [Y]ellowGreen
|
// [Y]ellowGreen
|
||||||
case 'y':
|
case 'y':
|
||||||
// [Ye]llow[G]reen
|
// [Ye]llow[G]reen
|
||||||
if (b == 'e' && (len > 6 && str[6] == 'g')) return Color3(154, 205, 50);
|
if (b == 'e' && (len > 6 && str[6] == 'g')) return {154, 205, 50};
|
||||||
// [Yel]low
|
// [Yel]low
|
||||||
else if (b == 'e' && c == 'l') return Color3(255, 255, 0);
|
else if (b == 'e' && c == 'l') return {255, 255, 0};
|
||||||
// Default to blank
|
// Default to blank
|
||||||
else return Color3::NIL;
|
else return Color3::NIL;
|
||||||
// Default to blank
|
// Default to blank
|
||||||
@ -963,8 +917,8 @@ void SqThrowLastF(CSStr msg, ...)
|
|||||||
LPSTR msg_buff = nullptr;
|
LPSTR msg_buff = nullptr;
|
||||||
// Attempt to obtain the error message
|
// Attempt to obtain the error message
|
||||||
const std::size_t size = FormatMessageA(
|
const std::size_t size = FormatMessageA(
|
||||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, // NOLINT(hicpp-signed-bitwise)
|
||||||
nullptr, error_num, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
nullptr, error_num, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // NOLINT(hicpp-signed-bitwise)
|
||||||
reinterpret_cast< LPSTR >(&msg_buff), 0, nullptr);
|
reinterpret_cast< LPSTR >(&msg_buff), 0, nullptr);
|
||||||
// Copy the message buffer before freeing it
|
// Copy the message buffer before freeing it
|
||||||
std::string message(msg_buff, size);
|
std::string message(msg_buff, size);
|
||||||
@ -981,7 +935,7 @@ void SqThrowLastF(CSStr msg, ...)
|
|||||||
static SQInteger SqPackRGB(SQInteger r, SQInteger g, SQInteger b)
|
static SQInteger SqPackRGB(SQInteger r, SQInteger g, SQInteger b)
|
||||||
{
|
{
|
||||||
return static_cast< Int32 >(SQMOD_PACK_RGB(
|
return static_cast< Int32 >(SQMOD_PACK_RGB(
|
||||||
ConvTo< Uint8 >::From(r),
|
ConvTo< Uint8 >::From(r), // NOLINT(hicpp-signed-bitwise)
|
||||||
ConvTo< Uint8 >::From(g),
|
ConvTo< Uint8 >::From(g),
|
||||||
ConvTo< Uint8 >::From(b)
|
ConvTo< Uint8 >::From(b)
|
||||||
));
|
));
|
||||||
@ -991,7 +945,7 @@ static SQInteger SqPackRGB(SQInteger r, SQInteger g, SQInteger b)
|
|||||||
static SQInteger SqPackRGBA(SQInteger r, SQInteger g, SQInteger b, SQInteger a)
|
static SQInteger SqPackRGBA(SQInteger r, SQInteger g, SQInteger b, SQInteger a)
|
||||||
{
|
{
|
||||||
return static_cast< Int32 >(SQMOD_PACK_RGBA(
|
return static_cast< Int32 >(SQMOD_PACK_RGBA(
|
||||||
ConvTo< Uint8 >::From(r),
|
ConvTo< Uint8 >::From(r), // NOLINT(hicpp-signed-bitwise)
|
||||||
ConvTo< Uint8 >::From(g),
|
ConvTo< Uint8 >::From(g),
|
||||||
ConvTo< Uint8 >::From(b),
|
ConvTo< Uint8 >::From(b),
|
||||||
ConvTo< Uint8 >::From(a)
|
ConvTo< Uint8 >::From(a)
|
||||||
@ -1002,7 +956,7 @@ static SQInteger SqPackRGBA(SQInteger r, SQInteger g, SQInteger b, SQInteger a)
|
|||||||
static SQInteger SqPackARGB(SQInteger r, SQInteger g, SQInteger b, SQInteger a)
|
static SQInteger SqPackARGB(SQInteger r, SQInteger g, SQInteger b, SQInteger a)
|
||||||
{
|
{
|
||||||
return static_cast< Int32 >(SQMOD_PACK_ARGB(
|
return static_cast< Int32 >(SQMOD_PACK_ARGB(
|
||||||
ConvTo< Uint8 >::From(a),
|
ConvTo< Uint8 >::From(a), // NOLINT(hicpp-signed-bitwise)
|
||||||
ConvTo< Uint8 >::From(r),
|
ConvTo< Uint8 >::From(r),
|
||||||
ConvTo< Uint8 >::From(g),
|
ConvTo< Uint8 >::From(g),
|
||||||
ConvTo< Uint8 >::From(b)
|
ConvTo< Uint8 >::From(b)
|
||||||
@ -1038,7 +992,7 @@ static SQInteger SqNameFilterCheck(HSQUIRRELVM vm)
|
|||||||
return name.mRes; // Propagate the error!
|
return name.mRes; // Propagate the error!
|
||||||
}
|
}
|
||||||
// Make the comparison and push the result on the stack
|
// Make the comparison and push the result on the stack
|
||||||
sq_pushbool(vm, NameFilterCheck(filter.mPtr, name.mPtr));
|
sq_pushbool(vm, static_cast< SQBool >(NameFilterCheck(filter.mPtr, name.mPtr)));
|
||||||
// Specify that we have a return value on the stack
|
// Specify that we have a return value on the stack
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1072,7 +1026,7 @@ static SQInteger SqNameFilterCheckInsensitive(HSQUIRRELVM vm)
|
|||||||
return name.mRes; // Propagate the error!
|
return name.mRes; // Propagate the error!
|
||||||
}
|
}
|
||||||
// Make the comparison and push the result on the stack
|
// Make the comparison and push the result on the stack
|
||||||
sq_pushbool(vm, NameFilterCheckInsensitive(filter.mPtr, name.mPtr));
|
sq_pushbool(vm, static_cast< SQBool >(NameFilterCheckInsensitive(filter.mPtr, name.mPtr)));
|
||||||
// Specify that we have a return value on the stack
|
// Specify that we have a return value on the stack
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef _BASE_SHARED_HPP_
|
#pragma once
|
||||||
#define _BASE_SHARED_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include "Base/Utility.hpp"
|
#include "Base/Utility.hpp"
|
||||||
@ -91,113 +90,6 @@ extern bool cLogSWrn(bool exp, CCStr fmt, ...) SQMOD_FORMAT_ATTR(printf, 2, 3);
|
|||||||
extern bool cLogSErr(bool exp, CCStr fmt, ...) SQMOD_FORMAT_ATTR(printf, 2, 3);
|
extern bool cLogSErr(bool exp, CCStr fmt, ...) SQMOD_FORMAT_ATTR(printf, 2, 3);
|
||||||
extern bool cLogSFtl(bool exp, CCStr fmt, ...) SQMOD_FORMAT_ATTR(printf, 2, 3);
|
extern bool cLogSFtl(bool exp, CCStr fmt, ...) SQMOD_FORMAT_ATTR(printf, 2, 3);
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Get a persistent AABB instance with the given values.
|
|
||||||
*/
|
|
||||||
extern const AABB & GetAABB();
|
|
||||||
extern const AABB & GetAABB(Float32 mins, Float32 maxs);
|
|
||||||
extern const AABB & GetAABB(Float32 xv, Float32 yv, Float32 zv);
|
|
||||||
extern const AABB & GetAABB(Float32 xmin, Float32 ymin, Float32 zmin, Float32 xmax, Float32 ymax, Float32 zmax);
|
|
||||||
extern const AABB & GetAABB(const Vector3 & vmin, const Vector3 & vmax);
|
|
||||||
extern const AABB & GetAABB(const AABB & o);
|
|
||||||
extern const AABB & GetAABB(AABB && o);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Get a persistent Circle instance with the given values.
|
|
||||||
*/
|
|
||||||
extern const Circle & GetCircle();
|
|
||||||
extern const Circle & GetCircle(Float32 rv);
|
|
||||||
extern const Circle & GetCircle(const Vector2 & pv, Float32 rv);
|
|
||||||
extern const Circle & GetCircle(Float32 xv, Float32 yv, Float32 rv);
|
|
||||||
extern const Circle & GetCircle(const Circle & o);
|
|
||||||
extern const Circle & GetCircle(Circle && o);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Get a persistent Color3 instance with the given values.
|
|
||||||
*/
|
|
||||||
extern const Color3 & GetColor3();
|
|
||||||
extern const Color3 & GetColor3(Uint8 sv);
|
|
||||||
extern const Color3 & GetColor3(Uint8 rv, Uint8 gv, Uint8 bv);
|
|
||||||
extern const Color3 & GetColor3(const Color3 & o);
|
|
||||||
extern const Color3 & GetColor3(Color3 && o);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Get a persistent Color4 instance with the given values.
|
|
||||||
*/
|
|
||||||
extern const Color4 & GetColor4();
|
|
||||||
extern const Color4 & GetColor4(Uint8 sv);
|
|
||||||
extern const Color4 & GetColor4(Uint8 rv, Uint8 gv, Uint8 bv);
|
|
||||||
extern const Color4 & GetColor4(Uint8 rv, Uint8 gv, Uint8 bv, Uint8 av);
|
|
||||||
extern const Color4 & GetColor4(const Color4 & o);
|
|
||||||
extern const Color4 & GetColor4(Color4 && o);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Get a persistent Quaternion instance with the given values.
|
|
||||||
*/
|
|
||||||
extern const Quaternion & GetQuaternion();
|
|
||||||
extern const Quaternion & GetQuaternion(Float32 sv);
|
|
||||||
extern const Quaternion & GetQuaternion(Float32 xv, Float32 yv, Float32 zv);
|
|
||||||
extern const Quaternion & GetQuaternion(Float32 xv, Float32 yv, Float32 zv, Float32 wv);
|
|
||||||
extern const Quaternion & GetQuaternion(const Quaternion & o);
|
|
||||||
extern const Quaternion & GetQuaternion(Quaternion && o);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Get a persistent Sphere instance with the given values.
|
|
||||||
*/
|
|
||||||
extern const Sphere & GetSphere();
|
|
||||||
extern const Sphere & GetSphere(Float32 rv);
|
|
||||||
extern const Sphere & GetSphere(const Vector3 & pv, Float32 rv);
|
|
||||||
extern const Sphere & GetSphere(Float32 xv, Float32 yv, Float32 zv, Float32 rv);
|
|
||||||
extern const Sphere & GetSphere(const Sphere & o);
|
|
||||||
extern const Sphere & GetSphere(Sphere && o);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Get a persistent Vector2 instance with the given values.
|
|
||||||
*/
|
|
||||||
extern const Vector2 & GetVector2();
|
|
||||||
extern const Vector2 & GetVector2(Float32 sv);
|
|
||||||
extern const Vector2 & GetVector2(Float32 xv, Float32 yv);
|
|
||||||
extern const Vector2 & GetVector2(const Vector2 & o);
|
|
||||||
extern const Vector2 & GetVector2(Vector2 && o);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Get a persistent Vector2i instance with the given values.
|
|
||||||
*/
|
|
||||||
extern const Vector2i & GetVector2i();
|
|
||||||
extern const Vector2i & GetVector2i(Int32 sv);
|
|
||||||
extern const Vector2i & GetVector2i(Int32 xv, Int32 yv);
|
|
||||||
extern const Vector2i & GetVector2i(const Vector2i & o);
|
|
||||||
extern const Vector2i & GetVector2i(Vector2i && o);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Get a persistent Vector3 instance with the given values.
|
|
||||||
*/
|
|
||||||
extern const Vector3 & GetVector3();
|
|
||||||
extern const Vector3 & GetVector3(Float32 sv);
|
|
||||||
extern const Vector3 & GetVector3(Float32 xv, Float32 yv, Float32 zv);
|
|
||||||
extern const Vector3 & GetVector3(const Vector3 & o);
|
|
||||||
extern const Vector3 & GetVector3(Vector3 && o);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Get a persistent Vector4 instance with the given values.
|
|
||||||
*/
|
|
||||||
extern const Vector4 & GetVector4();
|
|
||||||
extern const Vector4 & GetVector4(Float32 sv);
|
|
||||||
extern const Vector4 & GetVector4(Float32 xv, Float32 yv, Float32 zv);
|
|
||||||
extern const Vector4 & GetVector4(Float32 xv, Float32 yv, Float32 zv, Float32 wv);
|
|
||||||
extern const Vector4 & GetVector4(const Vector4 & o);
|
|
||||||
extern const Vector4 & GetVector4(Vector4 && o);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Get a persistent LongInt instance with the given values.
|
|
||||||
*/
|
|
||||||
const SLongInt & GetSLongInt();
|
|
||||||
const SLongInt & GetSLongInt(Int64 n);
|
|
||||||
const SLongInt & GetSLongInt(CSStr s);
|
|
||||||
const ULongInt & GetULongInt();
|
|
||||||
const ULongInt & GetULongInt(Uint64 n);
|
|
||||||
const ULongInt & GetULongInt(CSStr s);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
* Initialize a signal instance into the specified pair.
|
* Initialize a signal instance into the specified pair.
|
||||||
*/
|
*/
|
||||||
@ -255,5 +147,3 @@ template < typename T > inline void SqSetDelimiter(SQInteger c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_SHARED_HPP_
|
|
@ -22,28 +22,28 @@ const Sphere Sphere::MAX = Sphere(std::numeric_limits< Sphere::Value >::max());
|
|||||||
SQChar Sphere::Delim = ',';
|
SQChar Sphere::Delim = ',';
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere::Sphere()
|
Sphere::Sphere() noexcept
|
||||||
: pos(0.0), rad(0.0)
|
: pos(0.0), rad(0.0)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere::Sphere(Value rv)
|
Sphere::Sphere(Value rv) noexcept
|
||||||
: pos(0.0), rad(rv)
|
: pos(0.0), rad(rv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere::Sphere(const Vector3 & pv, Value rv)
|
Sphere::Sphere(const Vector3 & pv, Value rv) noexcept
|
||||||
: pos(pv), rad(rv)
|
: pos(pv), rad(rv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere::Sphere(Value xv, Value yv, Value zv, Value rv)
|
Sphere::Sphere(Value xv, Value yv, Value zv, Value rv) noexcept
|
||||||
: pos(xv, yv, zv), rad(rv)
|
: pos(xv, yv, zv), rad(rv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -191,7 +191,7 @@ Sphere & Sphere::operator -- ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator ++ (int)
|
Sphere Sphere::operator ++ (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Sphere state(*this);
|
Sphere state(*this);
|
||||||
++pos;
|
++pos;
|
||||||
@ -200,7 +200,7 @@ Sphere Sphere::operator ++ (int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator -- (int)
|
Sphere Sphere::operator -- (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Sphere state(*this);
|
Sphere state(*this);
|
||||||
--pos;
|
--pos;
|
||||||
@ -211,103 +211,103 @@ Sphere Sphere::operator -- (int)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator + (const Sphere & s) const
|
Sphere Sphere::operator + (const Sphere & s) const
|
||||||
{
|
{
|
||||||
return Sphere(pos + s.pos, rad + s.rad);
|
return {pos + s.pos, rad + s.rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator - (const Sphere & s) const
|
Sphere Sphere::operator - (const Sphere & s) const
|
||||||
{
|
{
|
||||||
return Sphere(pos - s.pos, rad - s.rad);
|
return {pos - s.pos, rad - s.rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator * (const Sphere & s) const
|
Sphere Sphere::operator * (const Sphere & s) const
|
||||||
{
|
{
|
||||||
return Sphere(pos * s.pos, rad * s.rad);
|
return {pos * s.pos, rad * s.rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator / (const Sphere & s) const
|
Sphere Sphere::operator / (const Sphere & s) const
|
||||||
{
|
{
|
||||||
return Sphere(pos / s.pos, rad / s.rad);
|
return {pos / s.pos, rad / s.rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator % (const Sphere & s) const
|
Sphere Sphere::operator % (const Sphere & s) const
|
||||||
{
|
{
|
||||||
return Sphere(pos % s.pos, std::fmod(rad, s.rad));
|
return {pos % s.pos, std::fmod(rad, s.rad)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator + (Value r) const
|
Sphere Sphere::operator + (Value r) const
|
||||||
{
|
{
|
||||||
return Sphere(rad + r);
|
return {rad + r};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator - (Value r) const
|
Sphere Sphere::operator - (Value r) const
|
||||||
{
|
{
|
||||||
return Sphere(rad - r);
|
return {rad - r};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator * (Value r) const
|
Sphere Sphere::operator * (Value r) const
|
||||||
{
|
{
|
||||||
return Sphere(rad * r);
|
return {rad * r};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator / (Value r) const
|
Sphere Sphere::operator / (Value r) const
|
||||||
{
|
{
|
||||||
return Sphere(rad / r);
|
return {rad / r};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator % (Value r) const
|
Sphere Sphere::operator % (Value r) const
|
||||||
{
|
{
|
||||||
return Sphere(std::fmod(rad, r));
|
return {std::fmod(rad, r)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator + (const Vector3 & p) const
|
Sphere Sphere::operator + (const Vector3 & p) const
|
||||||
{
|
{
|
||||||
return Sphere(pos + p, rad);
|
return {pos + p, rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator - (const Vector3 & p) const
|
Sphere Sphere::operator - (const Vector3 & p) const
|
||||||
{
|
{
|
||||||
return Sphere(pos - p, rad);
|
return {pos - p, rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator * (const Vector3 & p) const
|
Sphere Sphere::operator * (const Vector3 & p) const
|
||||||
{
|
{
|
||||||
return Sphere(pos * p, rad);
|
return {pos * p, rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator / (const Vector3 & p) const
|
Sphere Sphere::operator / (const Vector3 & p) const
|
||||||
{
|
{
|
||||||
return Sphere(pos / p, rad);
|
return {pos / p, rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator % (const Vector3 & p) const
|
Sphere Sphere::operator % (const Vector3 & p) const
|
||||||
{
|
{
|
||||||
return Sphere(pos % p, rad);
|
return {pos % p, rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator + () const
|
Sphere Sphere::operator + () const
|
||||||
{
|
{
|
||||||
return Sphere(pos.Abs(), std::fabs(rad));
|
return {pos.Abs(), std::fabs(rad)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::operator - () const
|
Sphere Sphere::operator - () const
|
||||||
{
|
{
|
||||||
return Sphere(-pos, -rad);
|
return {-pos, -rad};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -464,7 +464,7 @@ void Sphere::Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value zmin
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Sphere Sphere::Abs() const
|
Sphere Sphere::Abs() const
|
||||||
{
|
{
|
||||||
return Sphere(pos.Abs(), std::fabs(rad));
|
return {pos.Abs(), std::fabs(rad)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -496,48 +496,11 @@ const Sphere & Sphere::GetEx(SQChar delim, StackStrF & str)
|
|||||||
return sphere;
|
return sphere;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Sphere & GetSphere()
|
|
||||||
{
|
|
||||||
static Sphere sphere;
|
|
||||||
sphere.Clear();
|
|
||||||
return sphere;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Sphere & GetSphere(Float32 rv)
|
|
||||||
{
|
|
||||||
static Sphere sphere;
|
|
||||||
sphere.SetRadius(rv);
|
|
||||||
return sphere;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Sphere & GetSphere(const Vector3 & pv, Float32 rv)
|
|
||||||
{
|
|
||||||
static Sphere sphere;
|
|
||||||
sphere.SetValues(pv, rv);
|
|
||||||
return sphere;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Sphere & GetSphere(Float32 xv, Float32 yv, Float32 zv, Float32 rv)
|
|
||||||
{
|
|
||||||
static Sphere sphere;
|
|
||||||
sphere.SetSphereEx(xv, yv, zv, rv);
|
|
||||||
return sphere;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Sphere & GetSphere(const Sphere & o)
|
|
||||||
{
|
|
||||||
static Sphere sphere;
|
|
||||||
sphere.SetSphere(o);
|
|
||||||
return sphere;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||||
void Register_Sphere(HSQUIRRELVM vm)
|
void Register_Sphere(HSQUIRRELVM vm)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
{
|
{
|
||||||
typedef Sphere::Value Val;
|
typedef Sphere::Value Val;
|
||||||
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef _BASE_SPHERE_HPP_
|
#pragma once
|
||||||
#define _BASE_SPHERE_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include "SqBase.hpp"
|
#include "SqBase.hpp"
|
||||||
@ -39,32 +38,32 @@ struct Sphere
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Default constructor.
|
* Default constructor.
|
||||||
*/
|
*/
|
||||||
Sphere();
|
Sphere() noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a sphere at position 0,0,0 using the specified radius.
|
* Construct a sphere at position 0,0,0 using the specified radius.
|
||||||
*/
|
*/
|
||||||
explicit Sphere(Value rv);
|
Sphere(Value rv) noexcept; // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a sphere at the specified position using the specified radius.
|
* Construct a sphere at the specified position using the specified radius.
|
||||||
*/
|
*/
|
||||||
Sphere(const Vector3 & pv, Value rv);
|
Sphere(const Vector3 & pv, Value rv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a sphere at the specified position using the specified radius.
|
* Construct a sphere at the specified position using the specified radius.
|
||||||
*/
|
*/
|
||||||
Sphere(Value xv, Value yv, Value zv, Value rv);
|
Sphere(Value xv, Value yv, Value zv, Value rv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy constructor.
|
* Copy constructor.
|
||||||
*/
|
*/
|
||||||
Sphere(const Sphere & o) = default;
|
Sphere(const Sphere & o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Move constructor.
|
* Move constructor.
|
||||||
*/
|
*/
|
||||||
Sphere(Sphere && o) = default;
|
Sphere(Sphere && o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Destructor.
|
* Destructor.
|
||||||
@ -179,12 +178,12 @@ struct Sphere
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-increment operator.
|
* Post-increment operator.
|
||||||
*/
|
*/
|
||||||
Sphere operator ++ (int);
|
Sphere operator ++ (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-decrement operator.
|
* Post-decrement operator.
|
||||||
*/
|
*/
|
||||||
Sphere operator -- (int);
|
Sphere operator -- (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Addition operator.
|
* Addition operator.
|
||||||
@ -423,5 +422,3 @@ struct Sphere
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_SPHERE_HPP_
|
|
@ -16,10 +16,8 @@
|
|||||||
#endif // SQMOD_OS_WINDOWS
|
#endif // SQMOD_OS_WINDOWS
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#ifndef SQMOD_PLUGIN_API
|
#include <sqstdstring.h>
|
||||||
#include "Library/Numeric/LongInt.hpp"
|
#include "Library/Numeric/LongInt.hpp"
|
||||||
#include <sqstdstring.h>
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
namespace SqMod {
|
namespace SqMod {
|
||||||
@ -60,7 +58,7 @@ static inline void OutputMessageImpl(CCStr msg, va_list args)
|
|||||||
SetConsoleTextAttribute(hstdout, FOREGROUND_GREEN);
|
SetConsoleTextAttribute(hstdout, FOREGROUND_GREEN);
|
||||||
std::printf("[SQMOD] ");
|
std::printf("[SQMOD] ");
|
||||||
|
|
||||||
SetConsoleTextAttribute(hstdout, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_INTENSITY);
|
SetConsoleTextAttribute(hstdout, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_INTENSITY); // NOLINT(hicpp-signed-bitwise)
|
||||||
std::vprintf(msg, args);
|
std::vprintf(msg, args);
|
||||||
std::puts("");
|
std::puts("");
|
||||||
|
|
||||||
@ -82,10 +80,10 @@ static inline void OutputErrorImpl(CCStr msg, va_list args)
|
|||||||
|
|
||||||
CONSOLE_SCREEN_BUFFER_INFO csb_before;
|
CONSOLE_SCREEN_BUFFER_INFO csb_before;
|
||||||
GetConsoleScreenBufferInfo( hstdout, &csb_before);
|
GetConsoleScreenBufferInfo( hstdout, &csb_before);
|
||||||
SetConsoleTextAttribute(hstdout, FOREGROUND_RED | FOREGROUND_INTENSITY);
|
SetConsoleTextAttribute(hstdout, FOREGROUND_RED | FOREGROUND_INTENSITY); // NOLINT(hicpp-signed-bitwise)
|
||||||
std::printf("[SQMOD] ");
|
std::printf("[SQMOD] ");
|
||||||
|
|
||||||
SetConsoleTextAttribute(hstdout, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_INTENSITY);
|
SetConsoleTextAttribute(hstdout, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_INTENSITY); // NOLINT(hicpp-signed-bitwise)
|
||||||
std::vprintf(msg, args);
|
std::vprintf(msg, args);
|
||||||
std::puts("");
|
std::puts("");
|
||||||
|
|
||||||
@ -152,7 +150,7 @@ void SqThrowF(CSStr str, ...)
|
|||||||
// Finalize the argument list
|
// Finalize the argument list
|
||||||
va_end(args);
|
va_end(args);
|
||||||
// Throw the exception with the resulted message
|
// Throw the exception with the resulted message
|
||||||
throw Sqrat::Exception(g_Buffer);
|
throw Sqrat::Exception(g_Buffer); // NOLINT(hicpp-exception-baseclass,cert-err60-cpp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -239,9 +237,9 @@ bool SToB(CSStr str)
|
|||||||
}
|
}
|
||||||
// Add the null terminator
|
// Add the null terminator
|
||||||
buffer[i] = '\0';
|
buffer[i] = '\0';
|
||||||
// Compare the lowercase string and return the result
|
// Compare the lowercase string and return the result
|
||||||
return (std::strcmp(buffer, "true") == 0 || std::strcmp(buffer, "yes") == 0 ||
|
return std::strcmp(buffer, "true") == 0 || std::strcmp(buffer, "yes") == 0 ||
|
||||||
std::strcmp(buffer, "on") == 0 || std::strcmp(buffer, "1") == 0) ? true : false;
|
std::strcmp(buffer, "on") == 0 || std::strcmp(buffer, "1") == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -589,12 +587,12 @@ CSStr ConvNum< bool >::ToStr(bool v)
|
|||||||
|
|
||||||
bool ConvNum< bool >::FromStr(CSStr s)
|
bool ConvNum< bool >::FromStr(CSStr s)
|
||||||
{
|
{
|
||||||
return (std::strcmp(s, "true") == 0) ? true : false;
|
return std::strcmp(s, "true") == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConvNum< bool >::FromStr(CSStr s, Int32 /*base*/)
|
bool ConvNum< bool >::FromStr(CSStr s, Int32 /*base*/)
|
||||||
{
|
{
|
||||||
return (std::strcmp(s, "true") == 0) ? true : false;
|
return std::strcmp(s, "true") == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -642,7 +640,7 @@ String SqTypeName(HSQUIRRELVM vm, SQInteger idx)
|
|||||||
return _SC("unknown");
|
return _SC("unknown");
|
||||||
}
|
}
|
||||||
// Return the obtained string value
|
// Return the obtained string value
|
||||||
return String(val.mPtr, val.mLen);
|
return String(val.mPtr, static_cast< size_t >(val.mLen));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -672,361 +670,9 @@ Object BufferToStrObj(const Buffer & b, Uint32 size)
|
|||||||
return Var< Object >(DefaultVM::Get(), -1).value;
|
return Var< Object >(DefaultVM::Get(), -1).value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
Object MakeSLongObj(Int64 value)
|
|
||||||
{
|
|
||||||
// Obtain the default virtual machine
|
|
||||||
HSQUIRRELVM vm = DefaultVM::Get();
|
|
||||||
// Obtain the initial stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
// Push a long integer instance with the requested value on the stack
|
|
||||||
SqMod_PushSLongObject(vm, value);
|
|
||||||
#else
|
|
||||||
// Transform the specified value into a script object
|
|
||||||
PushVar< SLongInt >(vm, SLongInt(value));
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
// Obtain the object from the stack and return it
|
|
||||||
return Var< Object >(vm, -1).value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
Object MakeULongObj(Uint64 value)
|
|
||||||
{
|
|
||||||
// Obtain the default virtual machine
|
|
||||||
HSQUIRRELVM vm = DefaultVM::Get();
|
|
||||||
// Obtain the initial stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
// Push a long integer instance with the requested value on the stack
|
|
||||||
SqMod_PushULongObject(vm, value);
|
|
||||||
#else
|
|
||||||
// Transform the specified value into a script object
|
|
||||||
PushVar< ULongInt >(vm, ULongInt(value));
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
// Obtain the object from the stack and return it
|
|
||||||
return Var< Object >(vm, -1).value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
Object MakeSLongObj(HSQUIRRELVM vm, Int64 value)
|
|
||||||
{
|
|
||||||
// Obtain the initial stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
// Push a long integer instance with the requested value on the stack
|
|
||||||
SqMod_PushSLongObject(vm, value);
|
|
||||||
#else
|
|
||||||
// Transform the specified value into a script object
|
|
||||||
PushVar< SLongInt >(vm, SLongInt(value));
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
// Obtain the object from the stack and return it
|
|
||||||
return Var< Object >(vm, -1).value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
Object MakeULongObj(HSQUIRRELVM vm, Uint64 value)
|
|
||||||
{
|
|
||||||
// Obtain the initial stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
// Push a long integer instance with the requested value on the stack
|
|
||||||
SqMod_PushULongObject(vm, value);
|
|
||||||
#else
|
|
||||||
// Transform the specified value into a script object
|
|
||||||
PushVar< ULongInt >(vm, ULongInt(value));
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
// Obtain the object from the stack and return it
|
|
||||||
return Var< Object >(vm, -1).value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
Int64 FetchSLongObjVal(const Object & value)
|
|
||||||
{
|
|
||||||
// Grab the associated object virtual machine
|
|
||||||
HSQUIRRELVM vm = value.GetVM();
|
|
||||||
// Obtain the initial stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
// Push the specified object onto the stack
|
|
||||||
Var< const Object & >::push(vm, value);
|
|
||||||
// Retrieve and return the object value from the stack
|
|
||||||
return PopStackSLong(vm, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
Uint64 FetchULongObjVal(const Object & value)
|
|
||||||
{
|
|
||||||
// Grab the associated object virtual machine
|
|
||||||
HSQUIRRELVM vm = value.GetVM();
|
|
||||||
// Obtain the initial stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
// Push the specified object onto the stack
|
|
||||||
Var< const Object & >::push(vm, value);
|
|
||||||
// Retrieve and return the object value from the stack
|
|
||||||
return PopStackSLong(vm, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
SQRESULT FetchDateObjVal(const Object & value, Uint16 & year, Uint8 & month, Uint8 & day)
|
|
||||||
{
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
// Grab the associated object virtual machine
|
|
||||||
HSQUIRRELVM vm = value.GetVM();
|
|
||||||
// Remember the current stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
// Push the specified object onto the stack
|
|
||||||
Var< const Object & >::push(vm, value);
|
|
||||||
// Grab the date components from the date instance
|
|
||||||
return SqMod_GetDate(vm, -1, &year, &month, &day);
|
|
||||||
#else
|
|
||||||
STHROWF("This method is only available in modules");
|
|
||||||
// Should not reach this point
|
|
||||||
return SQ_ERROR;
|
|
||||||
// Avoid unused parameter warnings
|
|
||||||
SQMOD_UNUSED_VAR(value);
|
|
||||||
SQMOD_UNUSED_VAR(year);
|
|
||||||
SQMOD_UNUSED_VAR(month);
|
|
||||||
SQMOD_UNUSED_VAR(day);
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
CSStr FetchDateObjStr(const Object & value)
|
|
||||||
{
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
static SQChar buffer[32];
|
|
||||||
// Grab the associated object virtual machine
|
|
||||||
HSQUIRRELVM vm = value.GetVM();
|
|
||||||
// Remember the current stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
// Push the specified object onto the stack
|
|
||||||
Var< const Object & >::push(vm, value);
|
|
||||||
// Grab the date instance as a string
|
|
||||||
StackStrF val(vm, -1);
|
|
||||||
// Validate the result
|
|
||||||
if (SQ_FAILED(val.Proc(false)))
|
|
||||||
{
|
|
||||||
return _SC("1000-01-01");
|
|
||||||
}
|
|
||||||
// Copy the string into the common buffer
|
|
||||||
std::strncpy(buffer, val.mPtr, sizeof(buffer));
|
|
||||||
// Return the obtained string
|
|
||||||
return buffer;
|
|
||||||
#else
|
|
||||||
STHROWF("This method is only available in modules");
|
|
||||||
// Should not reach this point
|
|
||||||
return nullptr;
|
|
||||||
// Avoid unused parameter warnings
|
|
||||||
SQMOD_UNUSED_VAR(value);
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
SQRESULT FetchTimeObjVal(const Object & value, Uint8 & hour, Uint8 & minute, Uint8 & second)
|
|
||||||
{
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
// Grab the associated object virtual machine
|
|
||||||
HSQUIRRELVM vm = value.GetVM();
|
|
||||||
// Remember the current stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
// Push the specified object onto the stack
|
|
||||||
Var< const Object & >::push(vm, value);
|
|
||||||
// Grab the date components from the date instance
|
|
||||||
return SqMod_GetTime(vm, -1, &hour, &minute, &second, nullptr);
|
|
||||||
#else
|
|
||||||
STHROWF("This method is only available in modules");
|
|
||||||
// Should not reach this point
|
|
||||||
return SQ_ERROR;
|
|
||||||
// Avoid unused parameter warnings
|
|
||||||
SQMOD_UNUSED_VAR(value);
|
|
||||||
SQMOD_UNUSED_VAR(hour);
|
|
||||||
SQMOD_UNUSED_VAR(minute);
|
|
||||||
SQMOD_UNUSED_VAR(second);
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
SQRESULT FetchTimeObjVal(const Object & value, Uint8 & hour, Uint8 & minute, Uint8 & second, Uint16 & millisecond)
|
|
||||||
{
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
// Grab the associated object virtual machine
|
|
||||||
HSQUIRRELVM vm = value.GetVM();
|
|
||||||
// Remember the current stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
// Push the specified object onto the stack
|
|
||||||
Var< const Object & >::push(vm, value);
|
|
||||||
// Grab the date components from the date instance
|
|
||||||
return SqMod_GetTime(vm, -1, &hour, &minute, &second, &millisecond);
|
|
||||||
#else
|
|
||||||
STHROWF("This method is only available in modules");
|
|
||||||
// Should not reach this point
|
|
||||||
return SQ_ERROR;
|
|
||||||
// Avoid unused parameter warnings
|
|
||||||
SQMOD_UNUSED_VAR(value);
|
|
||||||
SQMOD_UNUSED_VAR(hour);
|
|
||||||
SQMOD_UNUSED_VAR(minute);
|
|
||||||
SQMOD_UNUSED_VAR(second);
|
|
||||||
SQMOD_UNUSED_VAR(millisecond);
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
CSStr FetchTimeObjStr(const Object & value)
|
|
||||||
{
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
static SQChar buffer[32];
|
|
||||||
// Grab the associated object virtual machine
|
|
||||||
HSQUIRRELVM vm = value.GetVM();
|
|
||||||
// Remember the current stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
// Push the specified object onto the stack
|
|
||||||
Var< const Object & >::push(vm, value);
|
|
||||||
// Grab the time instance as a string
|
|
||||||
StackStrF val(vm, -1);
|
|
||||||
// Validate the result
|
|
||||||
if (SQ_FAILED(val.Proc(false)))
|
|
||||||
{
|
|
||||||
return _SC("00:00:00");
|
|
||||||
}
|
|
||||||
// Copy the string into the common buffer
|
|
||||||
std::strncpy(buffer, val.mPtr, sizeof(buffer));
|
|
||||||
// Remove the millisecond part from the string, if any
|
|
||||||
buffer[8] = '\0';
|
|
||||||
// Return the obtained string
|
|
||||||
return buffer;
|
|
||||||
#else
|
|
||||||
STHROWF("This method is only available in modules");
|
|
||||||
// Should not reach this point
|
|
||||||
return nullptr;
|
|
||||||
// Avoid unused parameter warnings
|
|
||||||
SQMOD_UNUSED_VAR(value);
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
Int32 FetchTimeObjSeconds(const Object & value)
|
|
||||||
{
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
// Grab the associated object virtual machine
|
|
||||||
HSQUIRRELVM vm = value.GetVM();
|
|
||||||
// Remember the current stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
// Push the specified object onto the stack
|
|
||||||
Var< const Object & >::push(vm, value);
|
|
||||||
// The time components
|
|
||||||
uint8_t h = 0, m = 0, s = 0;
|
|
||||||
// Grab the time components from the time instance
|
|
||||||
if (SQ_FAILED(SqMod_GetTime(vm, -1, &h, &m, &s, nullptr)))
|
|
||||||
{
|
|
||||||
STHROWF("Unable to obtain the time info");
|
|
||||||
}
|
|
||||||
// Return the number of seconds in the specified time
|
|
||||||
return ((h * (60 * 60)) + (m * 60) + s);
|
|
||||||
#else
|
|
||||||
STHROWF("This method is only available in modules");
|
|
||||||
// Should not reach this point
|
|
||||||
return 0;
|
|
||||||
// Avoid unused parameter warnings
|
|
||||||
SQMOD_UNUSED_VAR(value);
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
SQRESULT FetchDatetimeObjVal(const Object & value, Uint16 & year, Uint8 & month, Uint8 & day, Uint8 & hour,
|
|
||||||
Uint8 & minute, Uint8 & second)
|
|
||||||
{
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
// Grab the associated object virtual machine
|
|
||||||
HSQUIRRELVM vm = value.GetVM();
|
|
||||||
// Remember the current stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
// Push the specified object onto the stack
|
|
||||||
Var< const Object & >::push(vm, value);
|
|
||||||
// Grab the date components from the date instance
|
|
||||||
return SqMod_GetDatetime(vm, -1, &year, &month, &day, &hour, &minute, &second, nullptr);
|
|
||||||
#else
|
|
||||||
STHROWF("This method is only available in modules");
|
|
||||||
// Should not reach this point
|
|
||||||
return SQ_ERROR;
|
|
||||||
// Avoid unused parameter warnings
|
|
||||||
SQMOD_UNUSED_VAR(value);
|
|
||||||
SQMOD_UNUSED_VAR(year);
|
|
||||||
SQMOD_UNUSED_VAR(month);
|
|
||||||
SQMOD_UNUSED_VAR(day);
|
|
||||||
SQMOD_UNUSED_VAR(hour);
|
|
||||||
SQMOD_UNUSED_VAR(minute);
|
|
||||||
SQMOD_UNUSED_VAR(second);
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
SQRESULT FetchDatetimeObjVal(const Object & value, Uint16 & year, Uint8 & month, Uint8 & day, Uint8 & hour,
|
|
||||||
Uint8 & minute, Uint8 & second, Uint16 & millisecond)
|
|
||||||
{
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
// Grab the associated object virtual machine
|
|
||||||
HSQUIRRELVM vm = value.GetVM();
|
|
||||||
// Remember the current stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
// Push the specified object onto the stack
|
|
||||||
Var< const Object & >::push(vm, value);
|
|
||||||
// Grab the date components from the date instance
|
|
||||||
return SqMod_GetDatetime(vm, -1, &year, &month, &day, &hour, &minute, &second, &millisecond);
|
|
||||||
#else
|
|
||||||
STHROWF("This method is only available in modules");
|
|
||||||
// Should not reach this point
|
|
||||||
return SQ_ERROR;
|
|
||||||
// Avoid unused parameter warnings
|
|
||||||
SQMOD_UNUSED_VAR(value);
|
|
||||||
SQMOD_UNUSED_VAR(year);
|
|
||||||
SQMOD_UNUSED_VAR(month);
|
|
||||||
SQMOD_UNUSED_VAR(day);
|
|
||||||
SQMOD_UNUSED_VAR(hour);
|
|
||||||
SQMOD_UNUSED_VAR(minute);
|
|
||||||
SQMOD_UNUSED_VAR(second);
|
|
||||||
SQMOD_UNUSED_VAR(millisecond);
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
CSStr FetchDatetimeObjStr(const Object & value)
|
|
||||||
{
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
static SQChar buffer[32];
|
|
||||||
// Grab the associated object virtual machine
|
|
||||||
HSQUIRRELVM vm = value.GetVM();
|
|
||||||
// Remember the current stack size
|
|
||||||
const StackGuard sg(vm);
|
|
||||||
// Push the specified object onto the stack
|
|
||||||
Var< const Object & >::push(vm, value);
|
|
||||||
// Grab the date-time instance as a string
|
|
||||||
StackStrF val(vm, -1);
|
|
||||||
// Validate the result
|
|
||||||
if (SQ_FAILED(val.Proc(false)))
|
|
||||||
{
|
|
||||||
return _SC("1000-01-01 00:00:00");
|
|
||||||
}
|
|
||||||
// Copy the string into the common buffer
|
|
||||||
std::strncpy(buffer, val.mPtr, sizeof(buffer));
|
|
||||||
// Remove the millisecond part from the string, if any
|
|
||||||
buffer[19] = '\0';
|
|
||||||
// Return the obtained string
|
|
||||||
return buffer;
|
|
||||||
#else
|
|
||||||
STHROWF("This method is only available in modules");
|
|
||||||
// Should not reach this point
|
|
||||||
return nullptr;
|
|
||||||
// Avoid unused parameter warnings
|
|
||||||
SQMOD_UNUSED_VAR(value);
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQInteger PopStackInteger(HSQUIRRELVM vm, SQInteger idx)
|
SQInteger PopStackInteger(HSQUIRRELVM vm, SQInteger idx)
|
||||||
{
|
{
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
return SqMod_PopStackInteger(vm, idx);
|
|
||||||
#else
|
|
||||||
// Identify which type must be extracted
|
// Identify which type must be extracted
|
||||||
switch (sq_gettype(vm, idx))
|
switch (sq_gettype(vm, idx))
|
||||||
{
|
{
|
||||||
@ -1035,19 +681,19 @@ SQInteger PopStackInteger(HSQUIRRELVM vm, SQInteger idx)
|
|||||||
SQInteger val;
|
SQInteger val;
|
||||||
sq_getinteger(vm, idx, &val);
|
sq_getinteger(vm, idx, &val);
|
||||||
return val;
|
return val;
|
||||||
} break;
|
}
|
||||||
case OT_FLOAT:
|
case OT_FLOAT:
|
||||||
{
|
{
|
||||||
SQFloat val;
|
SQFloat val;
|
||||||
sq_getfloat(vm, idx, &val);
|
sq_getfloat(vm, idx, &val);
|
||||||
return ConvTo< SQInteger >::From(val);
|
return ConvTo< SQInteger >::From(val);
|
||||||
} break;
|
}
|
||||||
case OT_BOOL:
|
case OT_BOOL:
|
||||||
{
|
{
|
||||||
SQBool val;
|
SQBool val;
|
||||||
sq_getbool(vm, idx, &val);
|
sq_getbool(vm, idx, &val);
|
||||||
return static_cast< SQInteger >(val);
|
return static_cast< SQInteger >(val);
|
||||||
} break;
|
}
|
||||||
case OT_STRING:
|
case OT_STRING:
|
||||||
{
|
{
|
||||||
CSStr val = nullptr;
|
CSStr val = nullptr;
|
||||||
@ -1055,15 +701,15 @@ SQInteger PopStackInteger(HSQUIRRELVM vm, SQInteger idx)
|
|||||||
if (SQ_SUCCEEDED(sq_getstring(vm, idx, &val)) && val != nullptr && *val != '\0')
|
if (SQ_SUCCEEDED(sq_getstring(vm, idx, &val)) && val != nullptr && *val != '\0')
|
||||||
{
|
{
|
||||||
return ConvTo< SQInteger >::From(std::strtoll(val, nullptr, 10));
|
return ConvTo< SQInteger >::From(std::strtoll(val, nullptr, 10));
|
||||||
}
|
} else break;
|
||||||
} break;
|
}
|
||||||
case OT_ARRAY:
|
case OT_ARRAY:
|
||||||
case OT_TABLE:
|
case OT_TABLE:
|
||||||
case OT_CLASS:
|
case OT_CLASS:
|
||||||
case OT_USERDATA:
|
case OT_USERDATA:
|
||||||
{
|
{
|
||||||
return sq_getsize(vm, idx);
|
return sq_getsize(vm, idx);
|
||||||
} break;
|
}
|
||||||
case OT_INSTANCE:
|
case OT_INSTANCE:
|
||||||
{
|
{
|
||||||
// Attempt to treat the value as a signed long instance
|
// Attempt to treat the value as a signed long instance
|
||||||
@ -1086,20 +732,16 @@ SQInteger PopStackInteger(HSQUIRRELVM vm, SQInteger idx)
|
|||||||
}
|
}
|
||||||
// Attempt to get the size of the instance as a fall back
|
// Attempt to get the size of the instance as a fall back
|
||||||
return sq_getsize(vm, idx);
|
return sq_getsize(vm, idx);
|
||||||
} break;
|
}
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
// Default to 0
|
// Default to 0
|
||||||
return 0;
|
return 0;
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SQFloat PopStackFloat(HSQUIRRELVM vm, SQInteger idx)
|
SQFloat PopStackFloat(HSQUIRRELVM vm, SQInteger idx)
|
||||||
{
|
{
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
return SqMod_PopStackFloat(vm, idx);
|
|
||||||
#else
|
|
||||||
// Identify which type must be extracted
|
// Identify which type must be extracted
|
||||||
switch (sq_gettype(vm, idx))
|
switch (sq_gettype(vm, idx))
|
||||||
{
|
{
|
||||||
@ -1108,19 +750,19 @@ SQFloat PopStackFloat(HSQUIRRELVM vm, SQInteger idx)
|
|||||||
SQFloat val;
|
SQFloat val;
|
||||||
sq_getfloat(vm, idx, &val);
|
sq_getfloat(vm, idx, &val);
|
||||||
return val;
|
return val;
|
||||||
} break;
|
}
|
||||||
case OT_INTEGER:
|
case OT_INTEGER:
|
||||||
{
|
{
|
||||||
SQInteger val;
|
SQInteger val;
|
||||||
sq_getinteger(vm, idx, &val);
|
sq_getinteger(vm, idx, &val);
|
||||||
return ConvTo< SQFloat >::From(val);
|
return ConvTo< SQFloat >::From(val);
|
||||||
} break;
|
}
|
||||||
case OT_BOOL:
|
case OT_BOOL:
|
||||||
{
|
{
|
||||||
SQBool val;
|
SQBool val;
|
||||||
sq_getbool(vm, idx, &val);
|
sq_getbool(vm, idx, &val);
|
||||||
return ConvTo< SQFloat >::From(val);
|
return ConvTo< SQFloat >::From(val);
|
||||||
} break;
|
}
|
||||||
case OT_STRING:
|
case OT_STRING:
|
||||||
{
|
{
|
||||||
CSStr val = nullptr;
|
CSStr val = nullptr;
|
||||||
@ -1132,15 +774,15 @@ SQFloat PopStackFloat(HSQUIRRELVM vm, SQInteger idx)
|
|||||||
#else
|
#else
|
||||||
return std::strtof(val, nullptr);
|
return std::strtof(val, nullptr);
|
||||||
#endif // SQUSEDOUBLE
|
#endif // SQUSEDOUBLE
|
||||||
}
|
} else break;
|
||||||
} break;
|
}
|
||||||
case OT_ARRAY:
|
case OT_ARRAY:
|
||||||
case OT_TABLE:
|
case OT_TABLE:
|
||||||
case OT_CLASS:
|
case OT_CLASS:
|
||||||
case OT_USERDATA:
|
case OT_USERDATA:
|
||||||
{
|
{
|
||||||
return ConvTo< SQFloat >::From(sq_getsize(vm, idx));
|
return ConvTo< SQFloat >::From(sq_getsize(vm, idx));
|
||||||
} break;
|
}
|
||||||
case OT_INSTANCE:
|
case OT_INSTANCE:
|
||||||
{
|
{
|
||||||
// Attempt to treat the value as a signed long instance
|
// Attempt to treat the value as a signed long instance
|
||||||
@ -1163,292 +805,11 @@ SQFloat PopStackFloat(HSQUIRRELVM vm, SQInteger idx)
|
|||||||
}
|
}
|
||||||
// Attempt to get the size of the instance as a fall back
|
// Attempt to get the size of the instance as a fall back
|
||||||
return ConvTo< SQFloat >::From(sq_getsize(vm, idx));
|
return ConvTo< SQFloat >::From(sq_getsize(vm, idx));
|
||||||
} break;
|
}
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
// Default to 0
|
// Default to 0
|
||||||
return 0.0;
|
return 0.0;
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
Int64 PopStackSLong(HSQUIRRELVM vm, SQInteger idx)
|
|
||||||
{
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
return SqMod_PopStackSLong(vm, idx);
|
|
||||||
#else
|
|
||||||
// Identify which type must be extracted
|
|
||||||
switch (sq_gettype(vm, idx))
|
|
||||||
{
|
|
||||||
case OT_INTEGER:
|
|
||||||
{
|
|
||||||
SQInteger val;
|
|
||||||
sq_getinteger(vm, idx, &val);
|
|
||||||
return static_cast< Int64 >(val);
|
|
||||||
} break;
|
|
||||||
case OT_FLOAT:
|
|
||||||
{
|
|
||||||
SQFloat val;
|
|
||||||
sq_getfloat(vm, idx, &val);
|
|
||||||
return ConvTo< Int64 >::From(val);
|
|
||||||
} break;
|
|
||||||
case OT_BOOL:
|
|
||||||
{
|
|
||||||
SQBool val;
|
|
||||||
sq_getbool(vm, idx, &val);
|
|
||||||
return static_cast< Int64 >(val);
|
|
||||||
} break;
|
|
||||||
case OT_STRING:
|
|
||||||
{
|
|
||||||
CSStr val = nullptr;
|
|
||||||
// Attempt to retrieve and convert the string
|
|
||||||
if (SQ_SUCCEEDED(sq_getstring(vm, idx, &val)) && val != nullptr && *val != '\0')
|
|
||||||
{
|
|
||||||
return std::strtoll(val, nullptr, 10);
|
|
||||||
}
|
|
||||||
} break;
|
|
||||||
case OT_ARRAY:
|
|
||||||
case OT_TABLE:
|
|
||||||
case OT_CLASS:
|
|
||||||
case OT_USERDATA:
|
|
||||||
{
|
|
||||||
return static_cast< Int64 >(sq_getsize(vm, idx));
|
|
||||||
} break;
|
|
||||||
case OT_INSTANCE:
|
|
||||||
{
|
|
||||||
// Attempt to treat the value as a signed long instance
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return Var< const SLongInt & >(vm, idx).value.GetNum();
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
// Just ignore it...
|
|
||||||
}
|
|
||||||
// Attempt to treat the value as a unsigned long instance
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return ConvTo< Int64 >::From(Var< const ULongInt & >(vm, idx).value.GetNum());
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
// Just ignore it...
|
|
||||||
}
|
|
||||||
// Attempt to get the size of the instance as a fall back
|
|
||||||
return static_cast< Int64 >(sq_getsize(vm, idx));
|
|
||||||
} break;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
// Default to 0
|
|
||||||
return 0;
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
Uint64 PopStackULong(HSQUIRRELVM vm, SQInteger idx)
|
|
||||||
{
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
return SqMod_PopStackULong(vm, idx);
|
|
||||||
#else
|
|
||||||
// Identify which type must be extracted
|
|
||||||
switch (sq_gettype(vm, idx))
|
|
||||||
{
|
|
||||||
case OT_INTEGER:
|
|
||||||
{
|
|
||||||
SQInteger val;
|
|
||||||
sq_getinteger(vm, idx, &val);
|
|
||||||
return ConvTo< Uint64 >::From(val);
|
|
||||||
} break;
|
|
||||||
case OT_FLOAT:
|
|
||||||
{
|
|
||||||
SQFloat val;
|
|
||||||
sq_getfloat(vm, idx, &val);
|
|
||||||
return ConvTo< Uint64 >::From(val);
|
|
||||||
} break;
|
|
||||||
case OT_BOOL:
|
|
||||||
{
|
|
||||||
SQBool val;
|
|
||||||
sq_getbool(vm, idx, &val);
|
|
||||||
return ConvTo< Uint64 >::From(val);
|
|
||||||
} break;
|
|
||||||
case OT_STRING:
|
|
||||||
{
|
|
||||||
CSStr val = nullptr;
|
|
||||||
// Attempt to retrieve and convert the string
|
|
||||||
if (SQ_SUCCEEDED(sq_getstring(vm, idx, &val)) && val != nullptr && *val != '\0')
|
|
||||||
{
|
|
||||||
return std::strtoull(val, nullptr, 10);
|
|
||||||
}
|
|
||||||
} break;
|
|
||||||
case OT_ARRAY:
|
|
||||||
case OT_TABLE:
|
|
||||||
case OT_CLASS:
|
|
||||||
case OT_USERDATA:
|
|
||||||
{
|
|
||||||
return ConvTo< Uint64 >::From(sq_getsize(vm, idx));
|
|
||||||
} break;
|
|
||||||
case OT_INSTANCE:
|
|
||||||
{
|
|
||||||
// Attempt to treat the value as a signed long instance
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return ConvTo< Uint64 >::From(Var< const SLongInt & >(vm, idx).value.GetNum());
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
// Just ignore it...
|
|
||||||
}
|
|
||||||
// Attempt to treat the value as a unsigned long instance
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return Var< const ULongInt & >(vm, idx).value.GetNum();
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
// Just ignore it...
|
|
||||||
}
|
|
||||||
// Attempt to get the size of the instance as a fall back
|
|
||||||
return ConvTo< Uint64 >::From(sq_getsize(vm, idx));
|
|
||||||
} break;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
// Default to 0
|
|
||||||
return 0;
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
bool CheckModuleAPIVer(CCStr ver, CCStr mod)
|
|
||||||
{
|
|
||||||
// Obtain the numeric representation of the API version
|
|
||||||
const LongI vernum = std::strtol(ver, nullptr, 10);
|
|
||||||
// Check against version mismatch
|
|
||||||
if (vernum == SQMOD_API_VER)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// Log the incident
|
|
||||||
OutputError("API version mismatch on %s", mod);
|
|
||||||
OutputMessage("=> Requested: %ld Have: %ld", vernum, SQMOD_API_VER);
|
|
||||||
// Invoker should not attempt to communicate through the module API
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
bool CheckModuleOrder(PluginFuncs * vcapi, Uint32 mod_id, CCStr mod)
|
|
||||||
{
|
|
||||||
// Make sure a valid server API was provided
|
|
||||||
if (!vcapi)
|
|
||||||
{
|
|
||||||
OutputError("Invalid pointer to server API structure");
|
|
||||||
// Validation failed!
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Attempt to find the host plug-in identifier
|
|
||||||
const int plugin_id = vcapi->FindPlugin(SQMOD_HOST_NAME);
|
|
||||||
// See if our module was loaded after the host plug-in
|
|
||||||
if (plugin_id < 0)
|
|
||||||
{
|
|
||||||
OutputError("%s: could find the host plug-in", mod);
|
|
||||||
// Validation failed!
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Should never reach this point but just in case
|
|
||||||
else if (static_cast< Uint32 >(plugin_id) > mod_id)
|
|
||||||
{
|
|
||||||
OutputError("%s: loaded after the host plug-in", mod);
|
|
||||||
// Validation failed!
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Loaded in the correct order
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
void ImportModuleAPI(PluginFuncs * vcapi, CCStr mod)
|
|
||||||
{
|
|
||||||
// Make sure a valid server API was provided
|
|
||||||
if (!vcapi)
|
|
||||||
{
|
|
||||||
STHROWF("%s: Invalid pointer to server API structure", mod);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t exports_struct_size;
|
|
||||||
|
|
||||||
// Attempt to find the host plug-in identifier
|
|
||||||
int plugin_id = vcapi->FindPlugin(SQMOD_HOST_NAME);
|
|
||||||
// Validate the obtained plug-in identifier
|
|
||||||
if (plugin_id < 0)
|
|
||||||
{
|
|
||||||
STHROWF("%s: Unable to obtain the host plug-in identifier", mod);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Attempt to retrieve the host plug-in exports
|
|
||||||
const void ** raw_plugin_exports = vcapi->GetPluginExports(plugin_id, &exports_struct_size);
|
|
||||||
// See if the size of the exports structure matches
|
|
||||||
if (exports_struct_size <= 0)
|
|
||||||
{
|
|
||||||
STHROWF("%s: Incompatible host plug-in exports structure", mod);
|
|
||||||
}
|
|
||||||
// See if we have any exports from the host plug-in
|
|
||||||
else if (raw_plugin_exports == nullptr)
|
|
||||||
{
|
|
||||||
STHROWF("%s: Unable to obtain pointer host plug-in exports", mod);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Obtain pointer to the exports structure
|
|
||||||
const SQMODEXPORTS * plugin_exports = *reinterpret_cast< const SQMODEXPORTS ** >(raw_plugin_exports);
|
|
||||||
// See if we have a valid pointer to the exports structure
|
|
||||||
if (plugin_exports == nullptr)
|
|
||||||
{
|
|
||||||
STHROWF("%s: Invalid pointer to host plug-in exports structure", mod);
|
|
||||||
}
|
|
||||||
else if (plugin_exports->PopulateModuleAPI == nullptr || plugin_exports->PopulateSquirrelAPI == nullptr)
|
|
||||||
{
|
|
||||||
STHROWF("%s: Invalid pointer to host plug-in import functions", mod);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepare a structure to obtain the module API
|
|
||||||
SQMODAPI sqmodapi;
|
|
||||||
// Attempt to populate the structure
|
|
||||||
switch (plugin_exports->PopulateModuleAPI(&sqmodapi, sizeof(SQMODAPI)))
|
|
||||||
{
|
|
||||||
case -1: STHROWF("%s: Incompatible module API structure", mod);
|
|
||||||
// fall through
|
|
||||||
case 0: STHROWF("%s: Invalid pointer to module API structure", mod);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepare a structure to obtain the squirrel API
|
|
||||||
SQLIBAPI sqlibapi;
|
|
||||||
// Attempt to populate the structure
|
|
||||||
switch (plugin_exports->PopulateSquirrelAPI(&sqlibapi, sizeof(SQLIBAPI)))
|
|
||||||
{
|
|
||||||
case -1: STHROWF("%s: Incompatible squirrel API structure", mod);
|
|
||||||
// fall through
|
|
||||||
case 0: STHROWF("%s: Invalid pointer to squirrel API structure", mod);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Attempt to expand the obtained API
|
|
||||||
if (!sqmod_api_expand(&sqmodapi))
|
|
||||||
{
|
|
||||||
// Collapse the API first
|
|
||||||
sqmod_api_collapse();
|
|
||||||
// Now it's safe to throw the exception
|
|
||||||
STHROWF("%s: Unable to expand module API structure", mod);
|
|
||||||
}
|
|
||||||
else if (!sqlib_api_expand(&sqlibapi))
|
|
||||||
{
|
|
||||||
// Collapse the API first
|
|
||||||
sqmod_api_collapse();
|
|
||||||
sqlib_api_collapse();
|
|
||||||
// Now it's safe to throw the exception
|
|
||||||
STHROWF("%s: Unable to expand module API structure", mod);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
@ -1,14 +1,8 @@
|
|||||||
#ifndef _BASE_UTILITY_HPP_
|
#pragma once
|
||||||
#define _BASE_UTILITY_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#ifdef SQMOD_PLUGIN_API
|
#include <SqBase.hpp>
|
||||||
#include <ModBase.hpp>
|
#include <vcmp.h>
|
||||||
#include <SqMod.h>
|
|
||||||
#else
|
|
||||||
#include <SqBase.hpp>
|
|
||||||
#include <vcmp.h>
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
@ -149,11 +143,11 @@ String & NullString();
|
|||||||
inline Uint32 NextPow2(Uint32 num)
|
inline Uint32 NextPow2(Uint32 num)
|
||||||
{
|
{
|
||||||
--num;
|
--num;
|
||||||
num |= num >> 1;
|
num |= num >> 1u;
|
||||||
num |= num >> 2;
|
num |= num >> 2u;
|
||||||
num |= num >> 4;
|
num |= num >> 4u;
|
||||||
num |= num >> 8;
|
num |= num >> 8u;
|
||||||
num |= num >> 16;
|
num |= num >> 16u;
|
||||||
return ++num;
|
return ++num;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,33 +194,33 @@ template < > struct EpsCmp< float, float > {
|
|||||||
* Perform an equality comparison between two real values taking into account floating point issues.
|
* Perform an equality comparison between two real values taking into account floating point issues.
|
||||||
*/
|
*/
|
||||||
template < > struct EpsCmp< double, double > {
|
template < > struct EpsCmp< double, double > {
|
||||||
static inline bool EQ(const double & a, const double & b) { return fabs(a - b) <= 0.000000001d; }
|
static inline bool EQ(const double & a, const double & b) { return fabs(a - b) <= 0.000000001; }
|
||||||
static inline bool LT(const double & a, const double & b) { return !EQ(a, b) && (a - b) < 0.000000001d; }
|
static inline bool LT(const double & a, const double & b) { return !EQ(a, b) && (a - b) < 0.000000001; }
|
||||||
static inline bool GT(const double & a, const double & b) { return !EQ(a, b) && (a - b) > 0.000000001d; }
|
static inline bool GT(const double & a, const double & b) { return !EQ(a, b) && (a - b) > 0.000000001; }
|
||||||
static inline bool LE(const double & a, const double & b) { return EQ(a, b) || (a - b) < 0.000000001d; }
|
static inline bool LE(const double & a, const double & b) { return EQ(a, b) || (a - b) < 0.000000001; }
|
||||||
static inline bool GE(const double & a, const double & b) { return EQ(a, b) || (a - b) > 0.000000001d; }
|
static inline bool GE(const double & a, const double & b) { return EQ(a, b) || (a - b) > 0.000000001; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
* Perform an equality comparison between two real values taking into account floating point issues.
|
* Perform an equality comparison between two real values taking into account floating point issues.
|
||||||
*/
|
*/
|
||||||
template < > struct EpsCmp< float, double > {
|
template < > struct EpsCmp< float, double > {
|
||||||
static inline bool EQ(const float & a, const double & b) { return fabs(static_cast< double >(a) - b) <= 0.000001d; }
|
static inline bool EQ(const float & a, const double & b) { return fabs(static_cast< double >(a) - b) <= 0.000001; }
|
||||||
static inline bool LT(const float & a, const double & b) { return !EQ(a, b) && (static_cast< double >(a) - b) < 0.000001d; }
|
static inline bool LT(const float & a, const double & b) { return !EQ(a, b) && (static_cast< double >(a) - b) < 0.000001; }
|
||||||
static inline bool GT(const float & a, const double & b) { return !EQ(a, b) && (static_cast< double >(a) - b) > 0.000001d; }
|
static inline bool GT(const float & a, const double & b) { return !EQ(a, b) && (static_cast< double >(a) - b) > 0.000001; }
|
||||||
static inline bool LE(const float & a, const double & b) { return EQ(a, b) || (static_cast< double >(a) - b) < 0.000001d; }
|
static inline bool LE(const float & a, const double & b) { return EQ(a, b) || (static_cast< double >(a) - b) < 0.000001; }
|
||||||
static inline bool GE(const float & a, const double & b) { return EQ(a, b) || (static_cast< double >(a) - b) > 0.000001d; }
|
static inline bool GE(const float & a, const double & b) { return EQ(a, b) || (static_cast< double >(a) - b) > 0.000001; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
* Perform an equality comparison between two real values taking into account floating point issues.
|
* Perform an equality comparison between two real values taking into account floating point issues.
|
||||||
*/
|
*/
|
||||||
template < > struct EpsCmp< double, float > {
|
template < > struct EpsCmp< double, float > {
|
||||||
static inline bool EQ(const double & a, const float & b) { return fabs(a - static_cast< double >(b)) <= 0.000001d; }
|
static inline bool EQ(const double & a, const float & b) { return fabs(a - static_cast< double >(b)) <= 0.000001; }
|
||||||
static inline bool LT(const double & a, const float & b) { return !EQ(a, b) && (a - static_cast< double >(b)) < 0.000001d; }
|
static inline bool LT(const double & a, const float & b) { return !EQ(a, b) && (a - static_cast< double >(b)) < 0.000001; }
|
||||||
static inline bool GT(const double & a, const float & b) { return !EQ(a, b) && (a - static_cast< double >(b)) > 0.000001d; }
|
static inline bool GT(const double & a, const float & b) { return !EQ(a, b) && (a - static_cast< double >(b)) > 0.000001; }
|
||||||
static inline bool LE(const double & a, const float & b) { return EQ(a, b) || (a - static_cast< double >(b)) < 0.000001d; }
|
static inline bool LE(const double & a, const float & b) { return EQ(a, b) || (a - static_cast< double >(b)) < 0.000001; }
|
||||||
static inline bool GE(const double & a, const float & b) { return EQ(a, b) || (a - static_cast< double >(b)) > 0.000001d; }
|
static inline bool GE(const double & a, const float & b) { return EQ(a, b) || (a - static_cast< double >(b)) > 0.000001; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
@ -255,22 +249,22 @@ template < typename T > struct EpsCmp< T, float > {
|
|||||||
* Perform an equality comparison between two real values taking into account floating point issues.
|
* Perform an equality comparison between two real values taking into account floating point issues.
|
||||||
*/
|
*/
|
||||||
template < typename T > struct EpsCmp< double, T > {
|
template < typename T > struct EpsCmp< double, T > {
|
||||||
static inline bool EQ(const double & a, const T & b) { return fabs(a - static_cast< double >(b)) <= 0.000000001d; }
|
static inline bool EQ(const double & a, const T & b) { return fabs(a - static_cast< double >(b)) <= 0.000000001; }
|
||||||
static inline bool LT(const double & a, const T & b) { return !EQ(a, b) && (a - static_cast< double >(b)) < 0.000000001d; }
|
static inline bool LT(const double & a, const T & b) { return !EQ(a, b) && (a - static_cast< double >(b)) < 0.000000001; }
|
||||||
static inline bool GT(const double & a, const T & b) { return !EQ(a, b) && (a - static_cast< double >(b)) > 0.000000001d; }
|
static inline bool GT(const double & a, const T & b) { return !EQ(a, b) && (a - static_cast< double >(b)) > 0.000000001; }
|
||||||
static inline bool LE(const double & a, const T & b) { return EQ(a, b) || (a - static_cast< double >(b)) < 0.000000001d; }
|
static inline bool LE(const double & a, const T & b) { return EQ(a, b) || (a - static_cast< double >(b)) < 0.000000001; }
|
||||||
static inline bool GE(const double & a, const T & b) { return EQ(a, b) || (a - static_cast< double >(b)) > 0.000000001d; }
|
static inline bool GE(const double & a, const T & b) { return EQ(a, b) || (a - static_cast< double >(b)) > 0.000000001; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
* Perform an equality comparison between two real values taking into account floating point issues.
|
* Perform an equality comparison between two real values taking into account floating point issues.
|
||||||
*/
|
*/
|
||||||
template < typename T > struct EpsCmp< T, double > {
|
template < typename T > struct EpsCmp< T, double > {
|
||||||
static inline bool EQ(const T & a, const double & b) { return fabs(static_cast< double >(a) - b) <= 0.000000001d; }
|
static inline bool EQ(const T & a, const double & b) { return fabs(static_cast< double >(a) - b) <= 0.000000001; }
|
||||||
static inline bool LT(const T & a, const double & b) { return !EQ(a, b) && (static_cast< double >(a) - b) < 0.000000001d; }
|
static inline bool LT(const T & a, const double & b) { return !EQ(a, b) && (static_cast< double >(a) - b) < 0.000000001; }
|
||||||
static inline bool GT(const T & a, const double & b) { return !EQ(a, b) && (static_cast< double >(a) - b) > 0.000000001d; }
|
static inline bool GT(const T & a, const double & b) { return !EQ(a, b) && (static_cast< double >(a) - b) > 0.000000001; }
|
||||||
static inline bool LE(const T & a, const double & b) { return EQ(a, b) || (static_cast< double >(a) - b) < 0.000000001d; }
|
static inline bool LE(const T & a, const double & b) { return EQ(a, b) || (static_cast< double >(a) - b) < 0.000000001; }
|
||||||
static inline bool GE(const T & a, const double & b) { return EQ(a, b) || (static_cast< double >(a) - b) > 0.000000001d; }
|
static inline bool GE(const T & a, const double & b) { return EQ(a, b) || (static_cast< double >(a) - b) > 0.000000001; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
@ -1287,7 +1281,7 @@ public:
|
|||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
* Base constructor.
|
* Base constructor.
|
||||||
*/
|
*/
|
||||||
IsCType(CTypeFn fn)
|
explicit IsCType(CTypeFn fn)
|
||||||
: m_Fn(fn)
|
: m_Fn(fn)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -1320,7 +1314,7 @@ public:
|
|||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
* Base constructor.
|
* Base constructor.
|
||||||
*/
|
*/
|
||||||
IsNotCType(CTypeFn fn)
|
explicit IsNotCType(CTypeFn fn)
|
||||||
: m_Fn(fn)
|
: m_Fn(fn)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -1477,83 +1471,6 @@ Object BufferToStrObj(const Buffer & b);
|
|||||||
*/
|
*/
|
||||||
Object BufferToStrObj(const Buffer & b, Uint32 size);
|
Object BufferToStrObj(const Buffer & b, Uint32 size);
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Create a signed long integer instance from an integer.
|
|
||||||
*/
|
|
||||||
Object MakeSLongObj(Int64 value);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Create a unsigned long integer instance from an integer.
|
|
||||||
*/
|
|
||||||
Object MakeULongObj(Uint64 value);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Create a signed long integer instance from an integer.
|
|
||||||
*/
|
|
||||||
Object MakeSLongObj(HSQUIRRELVM vm, Int64 value);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Create a unsigned long integer instance from an integer.
|
|
||||||
*/
|
|
||||||
Object MakeULongObj(HSQUIRRELVM vm, Uint64 value);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Retrieve a signed 64 bit integer from an signed long integer instance.
|
|
||||||
*/
|
|
||||||
Int64 FetchSLongObjVal(const Object & value);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Retrieve a unsigned 64 bit integer from an unsigned long integer instance.
|
|
||||||
*/
|
|
||||||
Uint64 FetchULongObjVal(const Object & value);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Retrieve the date components from a date instance.
|
|
||||||
*/
|
|
||||||
SQRESULT FetchDateObjVal(const Object & value, Uint16 & year, Uint8 & month, Uint8 & day);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Retrieve the date components from a date instance as a string.
|
|
||||||
*/
|
|
||||||
CSStr FetchDateObjStr(const Object & value);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Retrieve the time components from a date instance.
|
|
||||||
*/
|
|
||||||
SQRESULT FetchTimeObjVal(const Object & value, Uint8 & hour, Uint8 & minute, Uint8 & second);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Retrieve the time components from a date instance.
|
|
||||||
*/
|
|
||||||
SQRESULT FetchTimeObjVal(const Object & value, Uint8 & hour, Uint8 & minute, Uint8 & second, Uint16 & millisecond);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Retrieve the time components from a date instance as a string.
|
|
||||||
*/
|
|
||||||
CSStr FetchTimeObjStr(const Object & value);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Retrieve the time components from a date instance as the number of seconds.
|
|
||||||
*/
|
|
||||||
Int32 FetchTimeObjSeconds(const Object & value);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Retrieve the date-time components from a date-time instance.
|
|
||||||
*/
|
|
||||||
SQRESULT FetchDatetimeObjVal(const Object & value, Uint16 & year, Uint8 & month, Uint8 & day, Uint8 & hour,
|
|
||||||
Uint8 & minute, Uint8 & second);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Retrieve the date-time components from a date-time instance.
|
|
||||||
*/
|
|
||||||
SQRESULT FetchDatetimeObjVal(const Object & value, Uint16 & year, Uint8 & month, Uint8 & day, Uint8 & hour,
|
|
||||||
Uint8 & minute, Uint8 & second, Uint16 & millisecond);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Retrieve the date-time components from a date-time instance as a string.
|
|
||||||
*/
|
|
||||||
CSStr FetchDatetimeObjStr(const Object & value);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
* Attempt to pop the value at the specified index on the stack as a native integer.
|
* Attempt to pop the value at the specified index on the stack as a native integer.
|
||||||
*/
|
*/
|
||||||
@ -1564,36 +1481,4 @@ SQInteger PopStackInteger(HSQUIRRELVM vm, SQInteger idx);
|
|||||||
*/
|
*/
|
||||||
SQFloat PopStackFloat(HSQUIRRELVM vm, SQInteger idx);
|
SQFloat PopStackFloat(HSQUIRRELVM vm, SQInteger idx);
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Attempt to pop the value at the specified index on the stack as a signed long integer.
|
|
||||||
*/
|
|
||||||
Int64 PopStackSLong(HSQUIRRELVM vm, SQInteger idx);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Attempt to pop the value at the specified index on the stack as an unsigned long integer.
|
|
||||||
*/
|
|
||||||
Uint64 PopStackULong(HSQUIRRELVM vm, SQInteger idx);
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
#ifdef SQMOD_PLUGIN_API
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Validate the module API to make sure we don't run into issues.
|
|
||||||
*/
|
|
||||||
bool CheckModuleAPIVer(CCStr ver, CCStr mod);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Make sure that the module was loaded after the host plug-in.
|
|
||||||
*/
|
|
||||||
bool CheckModuleOrder(PluginFuncs * vcapi, Uint32 mod_id, CCStr mod);
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
|
||||||
* Used by the modules to import the API from the host plug-in.
|
|
||||||
*/
|
|
||||||
void ImportModuleAPI(PluginFuncs * vcapi, CCStr mod);
|
|
||||||
|
|
||||||
#endif // SQMOD_PLUGIN_API
|
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_UTILITY_HPP_
|
|
@ -23,21 +23,21 @@ const Vector2 Vector2::MAX = Vector2(std::numeric_limits< Vector2::Value >::max(
|
|||||||
SQChar Vector2::Delim = ',';
|
SQChar Vector2::Delim = ',';
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2::Vector2()
|
Vector2::Vector2() noexcept
|
||||||
: x(0.0), y(0.0)
|
: x(0.0), y(0.0)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2::Vector2(Value sv)
|
Vector2::Vector2(Value sv) noexcept
|
||||||
: x(sv), y(sv)
|
: x(sv), y(sv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2::Vector2(Value xv, Value yv)
|
Vector2::Vector2(Value xv, Value yv) noexcept
|
||||||
: x(xv), y(yv)
|
: x(xv), y(yv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -156,7 +156,7 @@ Vector2 & Vector2::operator -- ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator ++ (int)
|
Vector2 Vector2::operator ++ (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Vector2 state(*this);
|
Vector2 state(*this);
|
||||||
++x;
|
++x;
|
||||||
@ -165,7 +165,7 @@ Vector2 Vector2::operator ++ (int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator -- (int)
|
Vector2 Vector2::operator -- (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Vector2 state(*this);
|
Vector2 state(*this);
|
||||||
--x;
|
--x;
|
||||||
@ -176,73 +176,73 @@ Vector2 Vector2::operator -- (int)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator + (const Vector2 & v) const
|
Vector2 Vector2::operator + (const Vector2 & v) const
|
||||||
{
|
{
|
||||||
return Vector2(x + v.x, y + v.y);
|
return {x + v.x, y + v.y};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator - (const Vector2 & v) const
|
Vector2 Vector2::operator - (const Vector2 & v) const
|
||||||
{
|
{
|
||||||
return Vector2(x - v.x, y - v.y);
|
return {x - v.x, y - v.y};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator * (const Vector2 & v) const
|
Vector2 Vector2::operator * (const Vector2 & v) const
|
||||||
{
|
{
|
||||||
return Vector2(x * v.x, y * v.y);
|
return {x * v.x, y * v.y};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator / (const Vector2 & v) const
|
Vector2 Vector2::operator / (const Vector2 & v) const
|
||||||
{
|
{
|
||||||
return Vector2(x / v.x, y / v.y);
|
return {x / v.x, y / v.y};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator % (const Vector2 & v) const
|
Vector2 Vector2::operator % (const Vector2 & v) const
|
||||||
{
|
{
|
||||||
return Vector2(std::fmod(x, v.x), std::fmod(y, v.y));
|
return {std::fmod(x, v.x), std::fmod(y, v.y)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator + (Value s) const
|
Vector2 Vector2::operator + (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2(x + s, y + s);
|
return {x + s, y + s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator - (Value s) const
|
Vector2 Vector2::operator - (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2(x - s, y - s);
|
return {x - s, y - s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator * (Value s) const
|
Vector2 Vector2::operator * (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2(x * s, y * s);
|
return {x * s, y * s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator / (Value s) const
|
Vector2 Vector2::operator / (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2(x / s, y / s);
|
return {x / s, y / s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator % (Value s) const
|
Vector2 Vector2::operator % (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2(std::fmod(x, s), std::fmod(y, s));
|
return {std::fmod(x, s), std::fmod(y, s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator + () const
|
Vector2 Vector2::operator + () const
|
||||||
{
|
{
|
||||||
return Vector2(std::fabs(x), std::fabs(y));
|
return {std::fabs(x), std::fabs(y)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::operator - () const
|
Vector2 Vector2::operator - () const
|
||||||
{
|
{
|
||||||
return Vector2(-x, -y);
|
return {-x, -y};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -372,7 +372,7 @@ void Vector2::Generate(Value xmin, Value xmax, Value ymin, Value ymax)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2 Vector2::Abs() const
|
Vector2 Vector2::Abs() const
|
||||||
{
|
{
|
||||||
return Vector2(std::fabs(x), std::fabs(y));
|
return {std::fabs(x), std::fabs(y)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -402,40 +402,11 @@ const Vector2 & Vector2::GetEx(SQChar delim, StackStrF & str)
|
|||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector2 & GetVector2()
|
|
||||||
{
|
|
||||||
static Vector2 vec;
|
|
||||||
vec.Clear();
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector2 & GetVector2(Float32 sv)
|
|
||||||
{
|
|
||||||
static Vector2 vec;
|
|
||||||
vec.SetScalar(sv);
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector2 & GetVector2(Float32 xv, Float32 yv)
|
|
||||||
{
|
|
||||||
static Vector2 vec;
|
|
||||||
vec.SetVector2Ex(xv, yv);
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector2 & GetVector2(const Vector2 & o)
|
|
||||||
{
|
|
||||||
static Vector2 vec;
|
|
||||||
vec.SetVector2(o);
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||||
void Register_Vector2(HSQUIRRELVM vm)
|
void Register_Vector2(HSQUIRRELVM vm)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
{
|
{
|
||||||
typedef Vector2::Value Val;
|
typedef Vector2::Value Val;
|
||||||
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef _BASE_VECTOR2_HPP_
|
#pragma once
|
||||||
#define _BASE_VECTOR2_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include "SqBase.hpp"
|
#include "SqBase.hpp"
|
||||||
@ -37,27 +36,27 @@ struct Vector2
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Default constructor.
|
* Default constructor.
|
||||||
*/
|
*/
|
||||||
Vector2();
|
Vector2() noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a vector with the same scalar value for all components.
|
* Construct a vector with the same scalar value for all components.
|
||||||
*/
|
*/
|
||||||
explicit Vector2(Value sv);
|
explicit Vector2(Value sv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a vector with the specified component values.
|
* Construct a vector with the specified component values.
|
||||||
*/
|
*/
|
||||||
Vector2(Value xv, Value yv);
|
Vector2(Value xv, Value yv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy constructor.
|
* Copy constructor.
|
||||||
*/
|
*/
|
||||||
Vector2(const Vector2 & o) = default;
|
Vector2(const Vector2 & o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Move constructor.
|
* Move constructor.
|
||||||
*/
|
*/
|
||||||
Vector2(Vector2 && o) = default;
|
Vector2(Vector2 && o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Destructor.
|
* Destructor.
|
||||||
@ -79,11 +78,6 @@ struct Vector2
|
|||||||
*/
|
*/
|
||||||
Vector2 & operator = (Value s);
|
Vector2 & operator = (Value s);
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
|
||||||
* String assignment operator.
|
|
||||||
*/
|
|
||||||
Vector2 & operator = (CSStr values);
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Integral two-dimensional vector assignment.
|
* Integral two-dimensional vector assignment.
|
||||||
*/
|
*/
|
||||||
@ -152,12 +146,12 @@ struct Vector2
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-increment operator.
|
* Post-increment operator.
|
||||||
*/
|
*/
|
||||||
Vector2 operator ++ (int);
|
Vector2 operator ++ (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-decrement operator.
|
* Post-decrement operator.
|
||||||
*/
|
*/
|
||||||
Vector2 operator -- (int);
|
Vector2 operator -- (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Addition operator.
|
* Addition operator.
|
||||||
@ -356,5 +350,3 @@ struct Vector2
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_VECTOR2_HPP_
|
|
@ -23,21 +23,21 @@ const Vector2i Vector2i::MAX = Vector2i(std::numeric_limits< Vector2i::Value >::
|
|||||||
SQChar Vector2i::Delim = ',';
|
SQChar Vector2i::Delim = ',';
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i::Vector2i()
|
Vector2i::Vector2i() noexcept
|
||||||
: x(0), y(0)
|
: x(0), y(0)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i::Vector2i(Value sv)
|
Vector2i::Vector2i(Value sv) noexcept
|
||||||
: x(sv), y(sv)
|
: x(sv), y(sv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i::Vector2i(Value xv, Value yv)
|
Vector2i::Vector2i(Value xv, Value yv) noexcept
|
||||||
: x(xv), y(yv)
|
: x(xv), y(yv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -102,40 +102,40 @@ Vector2i & Vector2i::operator %= (const Vector2i & v)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i & Vector2i::operator &= (const Vector2i & v)
|
Vector2i & Vector2i::operator &= (const Vector2i & v)
|
||||||
{
|
{
|
||||||
x &= v.x;
|
x &= v.x; // NOLINT(hicpp-signed-bitwise)
|
||||||
y &= v.y;
|
y &= v.y; // NOLINT(hicpp-signed-bitwise)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i & Vector2i::operator |= (const Vector2i & v)
|
Vector2i & Vector2i::operator |= (const Vector2i & v)
|
||||||
{
|
{
|
||||||
x |= v.x;
|
x |= v.x; // NOLINT(hicpp-signed-bitwise)
|
||||||
y |= v.y;
|
y |= v.y; // NOLINT(hicpp-signed-bitwise)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i & Vector2i::operator ^= (const Vector2i & v)
|
Vector2i & Vector2i::operator ^= (const Vector2i & v)
|
||||||
{
|
{
|
||||||
x ^= v.x;
|
x ^= v.x; // NOLINT(hicpp-signed-bitwise)
|
||||||
y ^= v.y;
|
y ^= v.y; // NOLINT(hicpp-signed-bitwise)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i & Vector2i::operator <<= (const Vector2i & v)
|
Vector2i & Vector2i::operator <<= (const Vector2i & v)
|
||||||
{
|
{
|
||||||
x <<= v.x;
|
x <<= v.x; // NOLINT(hicpp-signed-bitwise)
|
||||||
y <<= v.y;
|
y <<= v.y; // NOLINT(hicpp-signed-bitwise)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i & Vector2i::operator >>= (const Vector2i & v)
|
Vector2i & Vector2i::operator >>= (const Vector2i & v)
|
||||||
{
|
{
|
||||||
x >>= v.x;
|
x >>= v.x; // NOLINT(hicpp-signed-bitwise)
|
||||||
y >>= v.y;
|
y >>= v.y; // NOLINT(hicpp-signed-bitwise)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,16 +182,16 @@ Vector2i & Vector2i::operator %= (Value s)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i & Vector2i::operator &= (Value s)
|
Vector2i & Vector2i::operator &= (Value s)
|
||||||
{
|
{
|
||||||
x &= s;
|
x &= s; // NOLINT(hicpp-signed-bitwise)
|
||||||
y &= s;
|
y &= s; // NOLINT(hicpp-signed-bitwise)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i & Vector2i::operator |= (Value s)
|
Vector2i & Vector2i::operator |= (Value s)
|
||||||
{
|
{
|
||||||
x |= s;
|
x |= s; // NOLINT(hicpp-signed-bitwise)
|
||||||
y |= s;
|
y |= s; // NOLINT(hicpp-signed-bitwise)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,16 +206,16 @@ Vector2i & Vector2i::operator ^= (Value s)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i & Vector2i::operator <<= (Value s)
|
Vector2i & Vector2i::operator <<= (Value s)
|
||||||
{
|
{
|
||||||
x <<= s;
|
x <<= s; // NOLINT(hicpp-signed-bitwise)
|
||||||
y <<= s;
|
y <<= s; // NOLINT(hicpp-signed-bitwise)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i & Vector2i::operator >>= (Value s)
|
Vector2i & Vector2i::operator >>= (Value s)
|
||||||
{
|
{
|
||||||
x >>= s;
|
x >>= s; // NOLINT(hicpp-signed-bitwise)
|
||||||
y >>= s;
|
y >>= s; // NOLINT(hicpp-signed-bitwise)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ Vector2i & Vector2i::operator -- ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator ++ (int)
|
Vector2i Vector2i::operator ++ (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Vector2i state(*this);
|
Vector2i state(*this);
|
||||||
++x;
|
++x;
|
||||||
@ -245,7 +245,7 @@ Vector2i Vector2i::operator ++ (int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator -- (int)
|
Vector2i Vector2i::operator -- (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Vector2i state(*this);
|
Vector2i state(*this);
|
||||||
--x;
|
--x;
|
||||||
@ -256,139 +256,139 @@ Vector2i Vector2i::operator -- (int)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator + (const Vector2i & v) const
|
Vector2i Vector2i::operator + (const Vector2i & v) const
|
||||||
{
|
{
|
||||||
return Vector2i(x + v.x, y + v.y);
|
return {x + v.x, y + v.y};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator - (const Vector2i & v) const
|
Vector2i Vector2i::operator - (const Vector2i & v) const
|
||||||
{
|
{
|
||||||
return Vector2i(x - v.x, y - v.y);
|
return {x - v.x, y - v.y};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator * (const Vector2i & v) const
|
Vector2i Vector2i::operator * (const Vector2i & v) const
|
||||||
{
|
{
|
||||||
return Vector2i(x * v.x, y * v.y);
|
return {x * v.x, y * v.y};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator / (const Vector2i & v) const
|
Vector2i Vector2i::operator / (const Vector2i & v) const
|
||||||
{
|
{
|
||||||
return Vector2i(x / v.x, y / v.y);
|
return {x / v.x, y / v.y};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator % (const Vector2i & v) const
|
Vector2i Vector2i::operator % (const Vector2i & v) const
|
||||||
{
|
{
|
||||||
return Vector2i(x % v.x, y % v.y);
|
return {x % v.x, y % v.y};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator & (const Vector2i & v) const
|
Vector2i Vector2i::operator & (const Vector2i & v) const
|
||||||
{
|
{
|
||||||
return Vector2i(x & v.x, y & v.y);
|
return {x & v.x, y & v.y}; // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator | (const Vector2i & v) const
|
Vector2i Vector2i::operator | (const Vector2i & v) const
|
||||||
{
|
{
|
||||||
return Vector2i(x | v.x, y | v.y);
|
return {x | v.x, y | v.y}; // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator ^ (const Vector2i & v) const
|
Vector2i Vector2i::operator ^ (const Vector2i & v) const
|
||||||
{
|
{
|
||||||
return Vector2i(x ^ v.x, y ^ v.y);
|
return {x ^ v.x, y ^ v.y}; // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator << (const Vector2i & v) const
|
Vector2i Vector2i::operator << (const Vector2i & v) const
|
||||||
{
|
{
|
||||||
return Vector2i(x << v.x, y << v.y);
|
return {x << v.x, y << v.y}; // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator >> (const Vector2i & v) const
|
Vector2i Vector2i::operator >> (const Vector2i & v) const
|
||||||
{
|
{
|
||||||
return Vector2i(x >> v.x, y >> v.y);
|
return {x >> v.x, y >> v.y}; // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator + (Value s) const
|
Vector2i Vector2i::operator + (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2i(x + s, y + s);
|
return {x + s, y + s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator - (Value s) const
|
Vector2i Vector2i::operator - (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2i(x - s, y - s);
|
return {x - s, y - s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator * (Value s) const
|
Vector2i Vector2i::operator * (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2i(x * s, y * s);
|
return {x * s, y * s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator / (Value s) const
|
Vector2i Vector2i::operator / (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2i(x / s, y / s);
|
return {x / s, y / s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator % (Value s) const
|
Vector2i Vector2i::operator % (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2i(x % s, y % s);
|
return {x % s, y % s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator & (Value s) const
|
Vector2i Vector2i::operator & (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2i(x & s, y & s);
|
return {x & s, y & s}; // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator | (Value s) const
|
Vector2i Vector2i::operator | (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2i(x | s, y | s);
|
return {x | s, y | s}; // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator ^ (Value s) const
|
Vector2i Vector2i::operator ^ (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2i(x ^ s, y ^ s);
|
return {x ^ s, y ^ s}; // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator << (Value s) const
|
Vector2i Vector2i::operator << (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2i(x < s, y < s);
|
return {x << s, y << s}; // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator >> (Value s) const
|
Vector2i Vector2i::operator >> (Value s) const
|
||||||
{
|
{
|
||||||
return Vector2i(x >> s, y >> s);
|
return {x >> s, y >> s}; // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator + () const
|
Vector2i Vector2i::operator + () const
|
||||||
{
|
{
|
||||||
return Vector2i(std::abs(x), std::abs(y));
|
return {std::abs(x), std::abs(y)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator - () const
|
Vector2i Vector2i::operator - () const
|
||||||
{
|
{
|
||||||
return Vector2i(-x, -y);
|
return {-x, -y};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::operator ~ () const
|
Vector2i Vector2i::operator ~ () const
|
||||||
{
|
{
|
||||||
return Vector2i(~x, ~y);
|
return {~x, ~y}; // NOLINT(hicpp-signed-bitwise)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -518,7 +518,7 @@ void Vector2i::Generate(Value xmin, Value xmax, Value ymin, Value ymax)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector2i Vector2i::Abs() const
|
Vector2i Vector2i::Abs() const
|
||||||
{
|
{
|
||||||
return Vector2i(std::abs(x), std::abs(y));
|
return {std::abs(x), std::abs(y)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -548,40 +548,11 @@ const Vector2i & Vector2i::GetEx(SQChar delim, StackStrF & str)
|
|||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector2i & GetVector2i()
|
|
||||||
{
|
|
||||||
static Vector2i vec;
|
|
||||||
vec.Clear();
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector2i & GetVector2i(Int32 sv)
|
|
||||||
{
|
|
||||||
static Vector2i vec;
|
|
||||||
vec.SetScalar(sv);
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector2i & GetVector2i(Int32 xv, Int32 yv)
|
|
||||||
{
|
|
||||||
static Vector2i vec;
|
|
||||||
vec.SetVector2iEx(xv, yv);
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector2i & GetVector2i(const Vector2i & o)
|
|
||||||
{
|
|
||||||
static Vector2i vec;
|
|
||||||
vec.SetVector2i(o);
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||||
void Register_Vector2i(HSQUIRRELVM vm)
|
void Register_Vector2i(HSQUIRRELVM vm)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
{
|
{
|
||||||
typedef Vector2i::Value Val;
|
typedef Vector2i::Value Val;
|
||||||
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef _BASE_VECTOR2I_HPP_
|
#pragma once
|
||||||
#define _BASE_VECTOR2I_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include "SqBase.hpp"
|
#include "SqBase.hpp"
|
||||||
@ -37,27 +36,27 @@ struct Vector2i
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Default constructor.
|
* Default constructor.
|
||||||
*/
|
*/
|
||||||
Vector2i();
|
Vector2i() noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a vector with the same scalar value for all components.
|
* Construct a vector with the same scalar value for all components.
|
||||||
*/
|
*/
|
||||||
explicit Vector2i(Value sv);
|
explicit Vector2i(Value sv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a vector with the specified component values.
|
* Construct a vector with the specified component values.
|
||||||
*/
|
*/
|
||||||
Vector2i(Value xv, Value yv);
|
Vector2i(Value xv, Value yv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy constructor.
|
* Copy constructor.
|
||||||
*/
|
*/
|
||||||
Vector2i(const Vector2i & o) = default;
|
Vector2i(const Vector2i & o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy constructor.
|
* Copy constructor.
|
||||||
*/
|
*/
|
||||||
Vector2i(Vector2i && o) = default;
|
Vector2i(Vector2i && o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Destructor.
|
* Destructor.
|
||||||
@ -197,12 +196,12 @@ struct Vector2i
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-increment operator.
|
* Post-increment operator.
|
||||||
*/
|
*/
|
||||||
Vector2i operator ++ (int);
|
Vector2i operator ++ (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-decrement operator.
|
* Post-decrement operator.
|
||||||
*/
|
*/
|
||||||
Vector2i operator -- (int);
|
Vector2i operator -- (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Addition operator.
|
* Addition operator.
|
||||||
@ -457,5 +456,3 @@ struct Vector2i
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_VECTOR2I_HPP_
|
|
@ -34,21 +34,21 @@ const Vector3 Vector3::ONE(STOVAL(1.0), STOVAL(1.0), STOVAL(1.0));
|
|||||||
SQChar Vector3::Delim = ',';
|
SQChar Vector3::Delim = ',';
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3::Vector3()
|
Vector3::Vector3() noexcept
|
||||||
: x(0.0), y(0.0), z(0.0)
|
: x(0.0), y(0.0), z(0.0)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3::Vector3(Value sv)
|
Vector3::Vector3(Value sv) noexcept
|
||||||
: x(sv), y(sv), z(sv)
|
: x(sv), y(sv), z(sv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3::Vector3(Value xv, Value yv, Value zv)
|
Vector3::Vector3(Value xv, Value yv, Value zv) noexcept
|
||||||
: x(xv), y(yv), z(zv)
|
: x(xv), y(yv), z(zv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -190,7 +190,7 @@ Vector3 & Vector3::operator -- ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator ++ (int)
|
Vector3 Vector3::operator ++ (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Vector3 state(*this);
|
Vector3 state(*this);
|
||||||
++x;
|
++x;
|
||||||
@ -200,7 +200,7 @@ Vector3 Vector3::operator ++ (int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator -- (int)
|
Vector3 Vector3::operator -- (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Vector3 state(*this);
|
Vector3 state(*this);
|
||||||
--x;
|
--x;
|
||||||
@ -212,73 +212,73 @@ Vector3 Vector3::operator -- (int)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator + (const Vector3 & v) const
|
Vector3 Vector3::operator + (const Vector3 & v) const
|
||||||
{
|
{
|
||||||
return Vector3(x + v.x, y + v.y, z + v.z);
|
return {x + v.x, y + v.y, z + v.z};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator - (const Vector3 & v) const
|
Vector3 Vector3::operator - (const Vector3 & v) const
|
||||||
{
|
{
|
||||||
return Vector3(x - v.x, y - v.y, z - v.z);
|
return {x - v.x, y - v.y, z - v.z};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator * (const Vector3 & v) const
|
Vector3 Vector3::operator * (const Vector3 & v) const
|
||||||
{
|
{
|
||||||
return Vector3(x * v.x, y * v.y, z * v.z);
|
return {x * v.x, y * v.y, z * v.z};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator / (const Vector3 & v) const
|
Vector3 Vector3::operator / (const Vector3 & v) const
|
||||||
{
|
{
|
||||||
return Vector3(x / v.x, y / v.y, z / v.z);
|
return {x / v.x, y / v.y, z / v.z};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator % (const Vector3 & v) const
|
Vector3 Vector3::operator % (const Vector3 & v) const
|
||||||
{
|
{
|
||||||
return Vector3(std::fmod(x, v.x), std::fmod(y, v.y), std::fmod(z, v.z));
|
return {std::fmod(x, v.x), std::fmod(y, v.y), std::fmod(z, v.z)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator + (Value s) const
|
Vector3 Vector3::operator + (Value s) const
|
||||||
{
|
{
|
||||||
return Vector3(x + s, y + s, z + s);
|
return {x + s, y + s, z + s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator - (Value s) const
|
Vector3 Vector3::operator - (Value s) const
|
||||||
{
|
{
|
||||||
return Vector3(x - s, y - s, z - s);
|
return {x - s, y - s, z - s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator * (Value s) const
|
Vector3 Vector3::operator * (Value s) const
|
||||||
{
|
{
|
||||||
return Vector3(x * s, y * s, z * s);
|
return {x * s, y * s, z * s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator / (Value s) const
|
Vector3 Vector3::operator / (Value s) const
|
||||||
{
|
{
|
||||||
return Vector3(x / s, y / s, z / s);
|
return {x / s, y / s, z / s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator % (Value s) const
|
Vector3 Vector3::operator % (Value s) const
|
||||||
{
|
{
|
||||||
return Vector3(std::fmod(x, s), std::fmod(y, s), std::fmod(z, s));
|
return {std::fmod(x, s), std::fmod(y, s), std::fmod(z, s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator + () const
|
Vector3 Vector3::operator + () const
|
||||||
{
|
{
|
||||||
return Vector3(std::fabs(x), std::fabs(y), std::fabs(z));
|
return {std::fabs(x), std::fabs(y), std::fabs(z)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::operator - () const
|
Vector3 Vector3::operator - () const
|
||||||
{
|
{
|
||||||
return Vector3(-x, -y, -z);
|
return {-x, -y, -z};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -457,7 +457,7 @@ void Vector3::Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value zmi
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::Abs() const
|
Vector3 Vector3::Abs() const
|
||||||
{
|
{
|
||||||
return Vector3(std::fabs(x), std::fabs(y), std::fabs(z));
|
return {std::fabs(x), std::fabs(y), std::fabs(z)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -538,7 +538,7 @@ Vector3::Value Vector3::AbsDotProduct(const Vector3 & vec) const
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector3 Vector3::CrossProduct(const Vector3 & vec) const
|
Vector3 Vector3::CrossProduct(const Vector3 & vec) const
|
||||||
{
|
{
|
||||||
return Vector3((y * vec.z) - (z * vec.y), (z * vec.x) - (x * vec.z), (x * vec.y) - (y * vec.x));
|
return {(y * vec.z) - (z * vec.y), (z * vec.x) - (x * vec.z), (x * vec.y) - (y * vec.x)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -578,11 +578,11 @@ void Vector3::Interpolate(const Vector3 & a, const Vector3 & b, Value d)
|
|||||||
Vector3 Vector3::Interpolated(const Vector3 & vec, Value d) const
|
Vector3 Vector3::Interpolated(const Vector3 & vec, Value d) const
|
||||||
{
|
{
|
||||||
const Float64 inv = 1.0 - d;
|
const Float64 inv = 1.0 - d;
|
||||||
return Vector3(
|
return {
|
||||||
STOVAL((vec.x * inv) + (x * d)),
|
STOVAL((vec.x * inv) + (x * d)),
|
||||||
STOVAL((vec.y * inv) + (y * d)),
|
STOVAL((vec.y * inv) + (y * d)),
|
||||||
STOVAL((vec.z * inv) + (z * d))
|
STOVAL((vec.z * inv) + (z * d))
|
||||||
);
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -656,40 +656,11 @@ const Vector3 & Vector3::GetEx(SQChar delim, StackStrF & str)
|
|||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector3 & GetVector3()
|
|
||||||
{
|
|
||||||
static Vector3 vec;
|
|
||||||
vec.Clear();
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector3 & GetVector3(Float32 sv)
|
|
||||||
{
|
|
||||||
static Vector3 vec;
|
|
||||||
vec.SetScalar(sv);
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector3 & GetVector3(Float32 xv, Float32 yv, Float32 zv)
|
|
||||||
{
|
|
||||||
static Vector3 vec;
|
|
||||||
vec.SetVector3Ex(xv, yv, zv);
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector3 & GetVector3(const Vector3 & o)
|
|
||||||
{
|
|
||||||
static Vector3 vec;
|
|
||||||
vec.SetVector3(o);
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||||
void Register_Vector3(HSQUIRRELVM vm)
|
void Register_Vector3(HSQUIRRELVM vm)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
{
|
{
|
||||||
typedef Vector3::Value Val;
|
typedef Vector3::Value Val;
|
||||||
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef _BASE_VECTOR3_HPP_
|
#pragma once
|
||||||
#define _BASE_VECTOR3_HPP_
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
#include "SqBase.hpp"
|
#include "SqBase.hpp"
|
||||||
@ -44,27 +43,27 @@ struct Vector3
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Default constructor.
|
* Default constructor.
|
||||||
*/
|
*/
|
||||||
Vector3();
|
Vector3() noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a vector with the same scalar value for all components.
|
* Construct a vector with the same scalar value for all components.
|
||||||
*/
|
*/
|
||||||
explicit Vector3(Value sv);
|
explicit Vector3(Value sv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Construct a vector with the specified component values.
|
* Construct a vector with the specified component values.
|
||||||
*/
|
*/
|
||||||
Vector3(Value xv, Value yv, Value zv);
|
Vector3(Value xv, Value yv, Value zv) noexcept;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy constructor.
|
* Copy constructor.
|
||||||
*/
|
*/
|
||||||
Vector3(const Vector3 & o) = default;
|
Vector3(const Vector3 & o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Copy constructor.
|
* Copy constructor.
|
||||||
*/
|
*/
|
||||||
Vector3(Vector3 && o) = default;
|
Vector3(Vector3 && o) noexcept = default;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Destructor.
|
* Destructor.
|
||||||
@ -159,12 +158,12 @@ struct Vector3
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-increment operator.
|
* Post-increment operator.
|
||||||
*/
|
*/
|
||||||
Vector3 operator ++ (int);
|
Vector3 operator ++ (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Post-decrement operator.
|
* Post-decrement operator.
|
||||||
*/
|
*/
|
||||||
Vector3 operator -- (int);
|
Vector3 operator -- (int); // NOLINT(cert-dcl21-cpp)
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Addition operator.
|
* Addition operator.
|
||||||
@ -503,5 +502,3 @@ struct Vector3
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace:: SqMod
|
} // Namespace:: SqMod
|
||||||
|
|
||||||
#endif // _BASE_VECTOR3_HPP_
|
|
@ -24,28 +24,28 @@ const Vector4 Vector4::MAX = Vector4(std::numeric_limits< Vector4::Value >::max(
|
|||||||
SQChar Vector4::Delim = ',';
|
SQChar Vector4::Delim = ',';
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4::Vector4()
|
Vector4::Vector4() noexcept
|
||||||
: x(0.0), y(0.0), z(0.0), w(0.0)
|
: x(0.0), y(0.0), z(0.0), w(0.0)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4::Vector4(Value sv)
|
Vector4::Vector4(Value sv) noexcept
|
||||||
: x(sv), y(sv), z(sv), w(sv)
|
: x(sv), y(sv), z(sv), w(sv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4::Vector4(Value xv, Value yv, Value zv)
|
Vector4::Vector4(Value xv, Value yv, Value zv) noexcept
|
||||||
: x(xv), y(yv), z(zv), w(0.0)
|
: x(xv), y(yv), z(zv), w(0.0)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4::Vector4(Value xv, Value yv, Value zv, Value wv)
|
Vector4::Vector4(Value xv, Value yv, Value zv, Value wv) noexcept
|
||||||
: x(xv), y(yv), z(zv), w(wv)
|
: x(xv), y(yv), z(zv), w(wv)
|
||||||
{
|
{
|
||||||
/* ... */
|
/* ... */
|
||||||
@ -201,7 +201,7 @@ Vector4 & Vector4::operator -- ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator ++ (int)
|
Vector4 Vector4::operator ++ (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Vector4 state(*this);
|
Vector4 state(*this);
|
||||||
++x;
|
++x;
|
||||||
@ -212,7 +212,7 @@ Vector4 Vector4::operator ++ (int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator -- (int)
|
Vector4 Vector4::operator -- (int) // NOLINT(cert-dcl21-cpp)
|
||||||
{
|
{
|
||||||
Vector4 state(*this);
|
Vector4 state(*this);
|
||||||
--x;
|
--x;
|
||||||
@ -225,73 +225,73 @@ Vector4 Vector4::operator -- (int)
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator + (const Vector4 & v) const
|
Vector4 Vector4::operator + (const Vector4 & v) const
|
||||||
{
|
{
|
||||||
return Vector4(x + v.x, y + v.y, z + v.z, w + v.w);
|
return {x + v.x, y + v.y, z + v.z, w + v.w};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator - (const Vector4 & v) const
|
Vector4 Vector4::operator - (const Vector4 & v) const
|
||||||
{
|
{
|
||||||
return Vector4(x - v.x, y - v.y, z - v.z, w - v.w);
|
return {x - v.x, y - v.y, z - v.z, w - v.w};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator * (const Vector4 & v) const
|
Vector4 Vector4::operator * (const Vector4 & v) const
|
||||||
{
|
{
|
||||||
return Vector4(x * v.x, y * v.y, z * v.z, w * v.w);
|
return {x * v.x, y * v.y, z * v.z, w * v.w};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator / (const Vector4 & v) const
|
Vector4 Vector4::operator / (const Vector4 & v) const
|
||||||
{
|
{
|
||||||
return Vector4(x / v.x, y / v.y, z / v.z, w / v.w);
|
return {x / v.x, y / v.y, z / v.z, w / v.w};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator % (const Vector4 & v) const
|
Vector4 Vector4::operator % (const Vector4 & v) const
|
||||||
{
|
{
|
||||||
return Vector4(std::fmod(x, v.x), std::fmod(y, v.y), std::fmod(z, v.z), std::fmod(w, v.w));
|
return {std::fmod(x, v.x), std::fmod(y, v.y), std::fmod(z, v.z), std::fmod(w, v.w)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator + (Value s) const
|
Vector4 Vector4::operator + (Value s) const
|
||||||
{
|
{
|
||||||
return Vector4(x + s, y + s, z + s, w + s);
|
return {x + s, y + s, z + s, w + s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator - (Value s) const
|
Vector4 Vector4::operator - (Value s) const
|
||||||
{
|
{
|
||||||
return Vector4(x - s, y - s, z - s, w - s);
|
return {x - s, y - s, z - s, w - s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator * (Value s) const
|
Vector4 Vector4::operator * (Value s) const
|
||||||
{
|
{
|
||||||
return Vector4(x * s, y * s, z * s, w * s);
|
return {x * s, y * s, z * s, w * s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator / (Value s) const
|
Vector4 Vector4::operator / (Value s) const
|
||||||
{
|
{
|
||||||
return Vector4(x / s, y / s, z / s, w / s);
|
return {x / s, y / s, z / s, w / s};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator % (Value s) const
|
Vector4 Vector4::operator % (Value s) const
|
||||||
{
|
{
|
||||||
return Vector4(std::fmod(x, s), std::fmod(y, s), std::fmod(z, s), std::fmod(w, s));
|
return {std::fmod(x, s), std::fmod(y, s), std::fmod(z, s), std::fmod(w, s)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator + () const
|
Vector4 Vector4::operator + () const
|
||||||
{
|
{
|
||||||
return Vector4(std::fabs(x), std::fabs(y), std::fabs(z), std::fabs(w));
|
return {std::fabs(x), std::fabs(y), std::fabs(z), std::fabs(w)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::operator - () const
|
Vector4 Vector4::operator - () const
|
||||||
{
|
{
|
||||||
return Vector4(-x, -y, -z, -w);
|
return {-x, -y, -z, -w};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -461,7 +461,7 @@ void Vector4::Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value zmi
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Vector4 Vector4::Abs() const
|
Vector4 Vector4::Abs() const
|
||||||
{
|
{
|
||||||
return Vector4(std::fabs(x), std::fabs(y), std::fabs(z), std::fabs(w));
|
return {std::fabs(x), std::fabs(y), std::fabs(z), std::fabs(w)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -493,48 +493,11 @@ const Vector4 & Vector4::GetEx(SQChar delim, StackStrF & str)
|
|||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector4 & GetVector4()
|
|
||||||
{
|
|
||||||
static Vector4 vec;
|
|
||||||
vec.Clear();
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector4 & GetVector4(Float32 sv)
|
|
||||||
{
|
|
||||||
static Vector4 vec;
|
|
||||||
vec.SetScalar(sv);
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector4 & GetVector4(Float32 xv, Float32 yv, Float32 zv)
|
|
||||||
{
|
|
||||||
static Vector4 vec;
|
|
||||||
vec.SetVector3Ex(xv, yv, zv);
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector4 & GetVector4(Float32 xv, Float32 yv, Float32 zv, Float32 wv)
|
|
||||||
{
|
|
||||||
static Vector4 vec;
|
|
||||||
vec.SetVector4Ex(xv, yv, zv, wv);
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
const Vector4 & GetVector4(const Vector4 & o)
|
|
||||||
{
|
|
||||||
static Vector4 vec;
|
|
||||||
vec.SetVector4(o);
|
|
||||||
return vec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||||
void Register_Vector4(HSQUIRRELVM vm)
|
void Register_Vector4(HSQUIRRELVM vm)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
{
|
{
|
||||||
typedef Vector4::Value Val;
|
typedef Vector4::Value Val;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user