1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2026-01-14 03:04:39 +01:00

Major plugin refactor and cleanup.

Switched to POCO library for unified platform/library interface.
Deprecated the external module API. It was creating more problems than solving.
Removed most built-in libraries in favor of system libraries for easier maintenance.
Cleaned and secured code with help from static analyzers.
This commit is contained in:
Sandu Liviu Catalin
2021-01-30 08:51:39 +02:00
parent e0e34b4030
commit 4a6bfc086c
6219 changed files with 1209835 additions and 454916 deletions

View File

@@ -0,0 +1,22 @@
#! /bin/sh
#
# makedepend.SunCC
#
# Create dependency file, Sun Forte C++ version
# Usage: makedepend.SunCC source target dir1 dir2 dir3 dir4 flags...
#
source=$1
shift
target=$1
shift
dir1=$1
shift
dir2=$1
shift
dir3=$1
shift
dir4=$1
shift
CC -xM1 $@ $source | sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" >$target

25
vendor/POCO/build/script/makedepend.aCC vendored Normal file
View File

@@ -0,0 +1,25 @@
#! /bin/sh
#
# makedepend.aCC
#
# Create dependency file, HP ANSI C++ version
# Usage: makedepend.gcc source target dir1 dir2 dir3 dir4 flags...
#
source=$1
shift
target=$1
shift
dir1=$1
shift
dir2=$1
shift
dir3=$1
shift
dir4=$1
shift
tmpfile=`basename $target`
aCC -E +maked $@ $source >/dev/null
sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" <$tmpfile >$target
rm $tmpfile

View File

@@ -0,0 +1,29 @@
#! /bin/bash
#
# makedepend.clang
#
# Create dependency file, Clang version
# Usage: makedepend.clang source target dir1 dir2 dir3 dir4 flags...
#
source=$1
shift
target=$1
shift
dir1=$1
shift
dir2=$1
shift
dir3=$1
shift
dir4=$1
shift
ext=${source##*.}
if [ "$ext" = "c" ] ; then
CLANG=clang
else
CLANG=clang++
fi
$CLANG -MM $@ $source | sed "s#\(.*\.o\):#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1:#" >$target

22
vendor/POCO/build/script/makedepend.cxx vendored Normal file
View File

@@ -0,0 +1,22 @@
#! /bin/sh
#
# makedepend.cxx
#
# Create dependency file, Compaq C++ version
# Usage: makedepend.gcc source target dir1 dir2 dir3 dir4 flags...
#
source=$1
shift
target=$1
shift
dir1=$1
shift
dir2=$1
shift
dir3=$1
shift
dir4=$1
shift
cxx -M $@ $source | sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" >$target

22
vendor/POCO/build/script/makedepend.gcc vendored Normal file
View File

@@ -0,0 +1,22 @@
#! /bin/sh
#
# makedepend.gcc
#
# Create dependency file, GCC version
# Usage: makedepend.gcc source target dir1 dir2 dir3 dir4 flags...
#
source=$1
shift
target=$1
shift
dir1=$1
shift
dir2=$1
shift
dir3=$1
shift
dir4=$1
shift
$CC -MM $@ $source | sed "s#\(.*\.o\):#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1:#" >$target

21
vendor/POCO/build/script/makedepend.qcc vendored Normal file
View File

@@ -0,0 +1,21 @@
#! /bin/sh
#
# makedepend.gcc
#
# Create dependency file, QNX Neutrino QCC version
# Usage: makedepend.qcc source target dir1 dir2 dir3 dir4 flags...
#
source=$1
shift
target=$1
shift
dir1=$1
shift
dir2=$1
shift
dir3=$1
shift
dir4=$1
shift
$CC -E -Wp,-MM $@ $source | sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" >$target

31
vendor/POCO/build/script/makedepend.xlC vendored Normal file
View File

@@ -0,0 +1,31 @@
#! /bin/sh
#
#
# makedepend.xlC
#
# Create dependency file, xlC version
# Usage: makedepend.xlC source target dir1 dir2 dir3 dir4 flags...
#
source=$1
shift
target=$1
shift
dir1=$1
shift
dir2=$1
shift
dir3=$1
shift
dir4=$1
shift
cwd=`pwd`
cd `dirname $target`
$CXX -qmakedep -E -w $@ $cwd/$source >/dev/null
ufile=`basename $source`
ufile=`echo $ufile | sed "s#\.cpp#\.u#"`
cat $ufile | sort | uniq | grep -v '/usr/include' | grep -v '/usr/vacpp' | sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" >$target

25
vendor/POCO/build/script/makeldpath vendored Normal file
View File

@@ -0,0 +1,25 @@
#! /bin/sh
#
# makeldpath
#
# Create a LD_LIBRARY_PATH for all project libraries.
#
if [ "$POCO_BASE" == "" ] ; then
echo $0": POCO_BASE is not set."
exit 1
fi
projectList=`cat ${POCO_BASE}/components`
OSNAME=`uname`
OSARCH=`uname -m | tr " /" "_-"`
for proj in $projectList ;
do
path=${POCO_BASE}/${proj}/lib/${OSNAME}/${OSARCH}
echo $path
if [ -d $path ] ; then
echo -n ":"$path
fi
done

17
vendor/POCO/build/script/projname vendored Normal file
View File

@@ -0,0 +1,17 @@
#! /bin/sh
#
# projname
#
# Usage: projname PROJECT_BASE
#
# Extract the project name from the current path
# NOTE: the cd $PROJECT_BASE is necessary to resolve symbolic links,
# ditto is the kinda strange sh -c pwd
#
PROJECT_BASE=$1
cdir=`sh -c pwd`
cd $PROJECT_BASE
projbase=`sh -c pwd`
cd "$cdir"
sh -c pwd | sed "s:^$projbase::" | sed "s:^/::"

74
vendor/POCO/build/script/runtests.cmd vendored Normal file
View File

@@ -0,0 +1,74 @@
@echo off
rem
rem A script for running the POCO testsuites.
rem
rem usage: runtests [64]
rem
rem If the environment variable EXCLUDE_TESTS is set, containing
rem a space-separated list of project names (as found in the
rem components file), these tests will be skipped.
rem
setlocal EnableDelayedExpansion
set TESTRUNNER=TestSuite.exe
set TESTRUNNERARGS=/B:TestSuite.out
set BINDIR=bin
if "%1"=="64" (
set BINDIR=bin64
)
set runs=0
set failures=0
set failedTests=
set status=0
set excluded=0
for /f %%C in ('findstr /R "." components') do (
set excluded=0
for %%X in (%EXCLUDE_TESTS%) do (
if "%%X"=="%%C" (
set excluded=1
)
)
if !excluded!==0 (
if exist %%C (
if exist %%C\testsuite (
if exist %%C\testsuite\%BINDIR%\%TESTRUNNER% (
echo.
echo.
echo ****************************************
echo *** %%C
echo ****************************************
echo.
set /a runs=!runs! + 1
set dir=%CD%
cd %%C\testsuite
%BINDIR%\%TESTRUNNER% %TESTRUNNERARGS%
if !ERRORLEVEL! neq 0 (
set /a failures=!failures! + 1
set failedTests=!failedTests! %%C
set status=1
)
if exist TestSuite.out (
type TestSuite.out
)
cd !dir!
)
)
)
)
)
echo.
echo.
echo !runs! runs, !failures! failed.
echo.
for %%F in (!failedTests!) do (
echo Failed: %%F
)
echo.
exit /b !status!

111
vendor/POCO/build/script/runtests.sh vendored Normal file
View File

@@ -0,0 +1,111 @@
#! /bin/sh
#
# A script for running the POCO testsuites.
#
# usage: runtests [component [test] ]
#
# If the environment variable EXCLUDE_TESTS is set, containing
# a space-separated list of project names (as found in the
# components file), these tests will be skipped.
#
# Cygwin specific setup.
# ----------------------
# On Cygwin, Unix IPC are provided by a separate process daemon
# named cygserver, which should be started once before running any
# test from Foundation.
# 1/ Open a separate Cygwin terminal with Administrator privilege
# 2/ run the command: cygserver-configure
# 3/ Start the cygserver: nohup /usr/sbin/cygserver &
# 4/ close the separate terminal
# 5/ run the Foundation tests: build/script/runtests.sh Foundation
#
if [ "$POCO_BASE" = "" ] ; then
POCO_BASE=`pwd`
fi
if [ "$POCO_BUILD" = "" ] ; then
POCO_BUILD=$POCO_BASE
fi
TESTRUNNER=./testrunner
if [ "$1" = "" ] ; then
components=`cat $POCO_BASE/components`
else
components=$1
fi
if [ "$2" = "" ] ; then
TESTRUNNERARGS=-all
else
TESTRUNNERARGS=$2
fi
if [ "$OSARCH" = "" ] ; then
OSARCH=`uname -m | tr ' /' _-`
fi
if [ "$OSNAME" = "" ] ; then
OSNAME=`uname`
case $OSNAME in
CYGWIN*)
OSNAME=CYGWIN
TESTRUNNER=$TESTRUNNER.exe
PATH=$POCO_BUILD/lib/$OSNAME/$OSARCH:$PATH
;;
MINGW*)
OSNAME=MinGW ;;
esac
fi
BINDIR="bin/$OSNAME/$OSARCH/"
IGNORE="-ignore $POCO_BASE/cppignore.lnx"
runs=0
failures=0
failedTests=""
status=0
for comp in $components ;
do
excluded=0
for excl in $EXCLUDE_TESTS ;
do
if [ "$excl" = "$comp" ] ; then
excluded=1
fi
done
if [ $excluded -eq 0 ] ; then
if [ -d "$POCO_BUILD/$comp/testsuite/$BINDIR" ] ; then
if [ -x "$POCO_BUILD/$comp/testsuite/$BINDIR/$TESTRUNNER" ] ; then
echo ""
echo ""
echo "****************************************"
echo "*** $OSNAME $OSARCH $comp"
echo "****************************************"
echo ""
runs=`expr $runs + 1`
sh -c "cd $POCO_BUILD/$comp/testsuite/$BINDIR && PATH=.:$PATH && LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH $TESTRUNNER $IGNORE $TESTRUNNERARGS"
if [ $? -ne 0 ] ; then
failures=`expr $failures + 1`
failedTests="$failedTests $comp"
status=1
fi
fi
fi
fi
done
echo ""
echo ""
echo "$runs runs, $failures failed."
echo ""
for test in $failedTests ;
do
echo "Failed: $test"
done
echo ""
exit $status

95
vendor/POCO/build/script/runtests2.cmd vendored Normal file
View File

@@ -0,0 +1,95 @@
@echo off
rem
rem $Id$
rem
rem A script for running the POCO testsuites.
rem
rem usage: runtests2 [-64] [-d ] [component [test]]
rem
rem component : the component under test
rem test : the test as part of the component
rem If the environment variable EXCLUDE_TESTS is set, containing
rem a space-separated list of project names (as found in the
rem components file), these tests will be skipped.
rem
setlocal EnableDelayedExpansion
set TESTRUNNERARGS=-all
set TESTCOMPONENTS='C:\Windows\System32\findstr.exe /R "." components'
set BINDIR=bin
if "%1"=="-64" (
set BINDIR=bin64
shift
)
if "%1" =="-d" (
set DEBUG=d
shift
)
set PATH=%POCO_BASE%\%BINDIR%;%PATH%
set IGNORE=-ignore %POCO_BASE%\cppignore.win
if not "%1" == "" (
set TESTCOMPONENTS="%1"
if not "%2" == "" (
set TESTRUNNERARGS=%2
)
)
set TESTRUNNER=TestSuite%DEBUG%.exe
set runs=0
set failures=0
set failedTests=
set status=0
for /f %%C in ( %TESTCOMPONENTS% ) do (
set excluded=0
for %%X in (%EXCLUDE_TESTS%) do (
if "%%X"=="%%C" (
set excluded=1
)
)
if !excluded!==0 (
if exist %%C (
if exist %%C\testsuite (
if exist %%C\testsuite\%BINDIR%\%TESTRUNNER% (
echo.
echo.
echo ****************************************
echo *** %%C
echo ****************************************
echo.
set /a runs=!runs! + 1
set dir=%CD%
cd %%C\testsuite
echo %BINDIR%\%TESTRUNNER% %IGNORE% %TESTRUNNERARGS%
%BINDIR%\%TESTRUNNER% %IGNORE% %TESTRUNNERARGS%
if !ERRORLEVEL! neq 0 (
set /a failures=!failures! + 1
set failedTests=!failedTests! %%C
set status=1
)
cd !dir!
)
)
)
)
)
echo.
echo.
echo !runs! runs, !failures! failed.
echo.
for %%F in (!failedTests!) do (
echo Failed: %%F
)
echo.
exit /b !status!

26
vendor/POCO/build/script/shlibln vendored Normal file
View File

@@ -0,0 +1,26 @@
#! /bin/sh
#
# shlibln
#
# Create a symbolic link for a shared library
#
if [ $# -ne 2 ] ; then
echo "usage: $0:t file link"
exit 1
fi
source="$1"
target="$2"
sourcedir=`dirname "$source"`
targetdir=`dirname "$target"`
if [ "$sourcedir" = "$targetdir" ] ; then
source=`basename $source`
fi
if [ "$1" != "$2" ] ; then
ln -sf "$source" "$target"
fi

171
vendor/POCO/build/script/vxprogen vendored Normal file
View File

@@ -0,0 +1,171 @@
#
# vxprogen
#
# Project file generator for WindRiver Tornado 2.2/VxWorks 5.5
#
# Usage: vxprogen <buildspec>...
#
# The tool must be started from a project directory
# (e.g. $POCO_BASE/Foundation). The build specification
# file must be located in the vx directory within
# the project directory, named vx.build.
# One or more build specification names can be specified.
#
# The environment variable POCO_BASE must be set.
#
if [ "$1" = "" ] ; then
echo "usage: $0 <buildspec>..."
exit 0
fi
if [ "$POCO_BASE" = "" ] ; then
echo "Fatal error: POCO_BASE not set. Exiting."
exit 1
fi
if [ ! -d "$POCO_BASE" ] ; then
echo "Fatal error: POCO_BASE does not contain a valid path to a directory. Exiting."
exit 1
fi
pwd=`pwd`
buildfile=`basename $pwd`.vxbuild
if [ ! -f $buildfile ] ; then
echo "Fatal error: vx/vx.build not found. Exiting."
exit 1
fi
builds=""
while [ "$1" != "" ] ; do
if [ ! -f "$POCO_BASE/build/vxconfig/$1" ] ; then
echo "Fatal error: no build specification file for $1 found. Exiting."
exit 1
fi
builds="$builds $1"
current=$1
shift
done
source $buildfile
out=vx/${TARGET}.wpj
mkdir -p vx
echo "Document file - DO NOT EDIT" >$out
echo "" >>$out
buildvars="
MACRO_AR
MACRO_ARCHIVE
MACRO_AS
MACRO_CC
MACRO_CC_ARCH_SPEC
MACRO_CFLAGS
MACRO_CFLAGS_AS
MACRO_CPP
MACRO_HEX_FLAGS
MACRO_LD
MACRO_LDFLAGS
MACRO_LD_PARTIAL
MACRO_LD_PARTIAL_FLAGS
MACRO_NM
MACRO_OPTION_DEFINE_MACRO
MACRO_OPTION_DEPEND
MACRO_OPTION_GENERATE_DEPENDENCY_FILE
MACRO_OPTION_INCLUDE_DIR
MACRO_OPTION_LANG_C
MACRO_OPTION_UNDEFINE_MACRO
MACRO_POST_BUILD_RULE
MACRO_PRJ_LIBS
MACRO_SIZE
MACRO_TOOL_FAMILY
RO_DEPEND_PATH
TC
"
for build in $builds ; do
source $POCO_BASE/build/vxconfig/$build
echo "<BEGIN> BUILD_${BUILD}_BUILDRULE" >>$out
echo "${TARGET}.out" >>$out
echo "<END>" >>$out
echo "" >>$out
for buildvar in $buildvars ; do
echo "<BEGIN> BUILD_${BUILD}_${buildvar}" >>$out
eval echo \"\$$buildvar\" >>$out
echo "<END>" >>$out
echo "" >>$out
done
done
echo "<BEGIN> BUILD_RULE_archive" >>$out
echo "" >>$out
echo "<END>" >>$out
echo "" >>$out
echo "<BEGIN> BUILD_RULE_${TARGET}.out" >>$out
echo "" >>$out
echo "<END>" >>$out
echo "" >>$out
echo "<BEGIN> BUILD_RULE_${TARGET}.pl" >>$out
echo "" >>$out
echo "<END>" >>$out
echo "" >>$out
echo "<BEGIN> BUILD_RULE_objects" >>$out
echo "" >>$out
echo "<END>" >>$out
echo "" >>$out
echo "<BEGIN> BUILD__CURRENT" >>$out
echo "$current" >>$out
echo "<END>" >>$out
echo "" >>$out
echo "<BEGIN> BUILD__LIST" >>$out
echo $builds >>$out
echo "<END>" >>$out
echo "" >>$out
echo "<BEGIN> CORE_INFO_TYPE" >>$out
echo "::prj_vxApp" >>$out
echo "<END>" >>$out
echo "" >>$out
echo "<BEGIN> CORE_INFO_VERSION" >>$out
echo "2.2" >>$out
echo "<END>" >>$out
echo "" >>$out
for src in $SOURCES ; do
echo "<BEGIN> FILE_\$(PRJ_DIR)/../src/${src}_objects" >>$out
echo "${src%.*}.o" >>$out
echo "<END>" >>$out
echo "" >>$out
echo "<BEGIN> FILE_\$(PRJ_DIR)/../src/${src}_tool" >>$out
echo "C/C++ compiler" >>$out
echo "<END>" >>$out
echo "" >>$out
done
echo "<BEGIN> PROJECT_FILES" >>$out
prefix=""
for src in $SOURCES ; do
echo -n "$prefix\$(PRJ_DIR)/../src/$src" >>$out
prefix=" \\
"
done
echo "" >>$out
echo "<END>" >>$out
echo "" >>$out
echo "<BEGIN> userComments" >>$out
echo "Generated on `date`" >>$out
echo "<END>" >>$out
echo "" >>$out