Skip to content
Permalink
Browse files

Merge changes from 'origin/master' into network-improvements. Added c…

…ore-changes entry.
  • Loading branch information...
frozenblit committed Aug 26, 2019
2 parents 94dbd9f + 691d330 commit ff9f415bd093bc76ffda0018c3924da05ea68b93
@@ -32,21 +32,21 @@ matrix:
compiler: clang
addons:
apt:
sources: ['llvm-toolchain-trusty-6.0', 'ubuntu-toolchain-r-test']
packages: ['clang-6.0', 'libstdc++6', 'libstdc++-7-dev', 'kwstyle']
env: CXX_P=clang++-6.0 CC_P=clang-6.0 NOPCH=0
sources: ['llvm-toolchain-trusty-7', 'ubuntu-toolchain-r-test']
packages: ['clang-7', 'libstdc++6', 'libstdc++-6-dev', 'kwstyle']
env: CXX_P=clang++-7 CC_P=clang-7 NOPCH=0

- os: linux
compiler: clang
addons:
apt:
sources: ['llvm-toolchain-trusty-6.0', 'ubuntu-toolchain-r-test']
packages: ['clang-6.0', 'libstdc++6', 'libstdc++-7-dev']
env: CXX_P=clang++-6.0 CC_P=clang-6.0 NOPCH=1
sources: ['llvm-toolchain-trusty-7', 'ubuntu-toolchain-r-test']
packages: ['clang-7', 'libstdc++6', 'libstdc++-6-dev']
env: CXX_P=clang++-7 CC_P=clang-7 NOPCH=1

before_install:
- cd bin-build
- wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip
- wget https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip
- unzip ninja-linux.zip
- chmod +x ninja
- export PATH=$TRAVIS_BUILD_DIR/bin-build:$PATH
@@ -2,9 +2,19 @@
<ESCRIPT>
<header>
<topic>Latest Core Changes</topic>
<datemodified>07-12-2019</datemodified>
<datemodified>08-26-2019</datemodified>
</header>
<version name="POL100">
<entry>
<date>08-26-2019</date>
<author>Nando:</author>
<change type="Changed">Improved how the debug, www and aux servers handle connections. They should be faster and more stable now. Minor issues fixed.</change>
</entry>
<entry>
<date>08-21-2019</date>
<author>DevGIB:</author>
<change type="Fixed">Missing default on GetProcess( pid ), this is now GetProcess( pid:= 0 ) to align with docs and functionallity. Please update your os.em file and recompile.</change>
</entry>
<entry>
<date>07-12-2019</date>
<author>DevGIB:</author>
@@ -13,24 +13,24 @@
<constant>const SCRIPTOPT_AUXSVC_ASSUME_STRING := 5;</constant>
</fileheader>

<function name="GetProcess">
<function name="GetProcess">
<prototype>GetProcess(pid := 0)</prototype>
<parameter name="pid" value="Integer process ID of a script (optional)" />
<explain>Gets a script process object for the given script's PID.</explain>
<explain>If no PID is supplied uses PID of parent script.</explain>
<explain>If no PID is supplied uses PID of the current script.</explain>
<return>A Script object</return>
<error>"Process not found"</error>
<error>"Invalid parameter type"</error>
<related>Script</related>
</function>

<function name="GetPid">
<function name="GetPid">
<prototype>GetPid()</prototype>
<explain>Returns the Process ID for this script.</explain>
<return>Integer Process ID</return>
</function>

<function name="Unload_Scripts">
<function name="Unload_Scripts">
<prototype>Unload_Scripts(scriptname := "")</prototype>
<parameter name="scriptname" value="String filename of script without extension (optional)" />
<explain>unload scripts from the script cache (they will be reloaded from disk on demand) currently running scripts will continue as normal.</explain>
@@ -263,8 +263,8 @@ const SCRIPTOPT_CAN_ACCESS_OFFLINE_MOBILES := 4;</code></explain>
<code>
Example: create a POST request to a REST endpoint with custom header:

HTTPRequest("http://localhost:3000/","POST", struct{
data := "{\"stuff1\":[1,2,35]}",
HTTPRequest("http://localhost:3000/","POST", struct{
data := "{\"stuff1\":[1,2,35]}",
headers := struct{
"Content-Type" := "application/json"
}
@@ -286,7 +286,7 @@ int EScriptProgram::write( const char* fname )

BSCRIPT_MODULE_HDR modhdr;
memset( &modhdr, 0, sizeof modhdr );
strzcpy( modhdr.modulename, module->modulename.get().c_str(), sizeof modhdr.modulename );
Clib::stracpy( modhdr.modulename, module->modulename.get().c_str(), sizeof modhdr.modulename );
modhdr.nfuncs = static_cast<unsigned int>( module->used_functions.size() );
fwrite( &modhdr, sizeof modhdr, 1, fp );
for ( auto& module_func : module->used_functions )
@@ -295,7 +295,7 @@ int EScriptProgram::write( const char* fname )
memset( &func, 0, sizeof func );
passert( module_func->used );

strzcpy( func.funcname, module_func->name.get().c_str(), sizeof func.funcname );
Clib::stracpy( func.funcname, module_func->name.get().c_str(), sizeof func.funcname );
func.nargs = static_cast<unsigned char>( module_func->nargs );

fwrite( &func, sizeof func, 1, fp );
@@ -320,7 +320,7 @@ int EScriptProgram::write( const char* fname )
fwrite( &sechdr, sizeof sechdr, 1, fp );
for ( auto& elem : exported_functions )
{
strzcpy( bef.funcname, elem.name.c_str(), sizeof bef.funcname );
Clib::stracpy( bef.funcname, elem.name.c_str(), sizeof bef.funcname );
bef.nargs = elem.nargs;
bef.PC = elem.PC;
fwrite( &bef, sizeof bef, 1, fp );
@@ -600,5 +600,5 @@ size_t EScriptProgram::sizeEstimate() const

return size;
}
}
}
} // namespace Bscript
} // namespace Pol
@@ -463,8 +463,7 @@ bool Executor::getObjArrayParam( unsigned param, ObjArray*& pobjarr )

void* Executor::getApplicPtrParam( unsigned param, const BApplicObjType* pointer_type )
{
BApplicPtr* ap =
EXPLICIT_CAST( BApplicPtr*, BObjectImp* )( getParamImp( param, BObjectImp::OTApplicPtr ) );
auto ap = static_cast<BApplicPtr*>( getParamImp( param, BObjectImp::OTApplicPtr ) );
if ( ap == nullptr )
return nullptr;

@@ -487,8 +486,7 @@ void* Executor::getApplicPtrParam( unsigned param, const BApplicObjType* pointer

BApplicObjBase* Executor::getApplicObjParam( unsigned param, const BApplicObjType* object_type )
{
BApplicObjBase* aob = EXPLICIT_CAST(
BApplicObjBase*, BObjectImp* )( getParamImp( param, BObjectImp::OTApplicObj ) );
auto aob = static_cast<BApplicObjBase*>( getParamImp( param, BObjectImp::OTApplicObj ) );
if ( aob == nullptr )
return nullptr;

@@ -21,7 +21,6 @@
* Specify what you want to cast to, and
* what you think you're casting from.
*/
#define EXPLICIT_CAST( totype, fromtype ) ( totype )

#define ms_to_clocks( ms ) ( ms * CLOCKS_PER_SEC / 1000 )
namespace Pol
@@ -150,19 +149,7 @@ inline std::tm localtime( const std::time_t& t )
#endif
return result;
}
}
#define strzcpy Clib::stracpy

#define STRCPY( a, b ) strncpy( a, b, sizeof a )
#define STRNCPY( a, b ) strncpy( a, b, sizeof a )
#define STRPCPY( a, b ) \
Clib: \
strpcpy( a, b, sizeof a )
#define STRACPY( a, b ) \
Clib: \
stracpy( a, b, sizeof a )
#define MEMCLR( a ) memset( &a, 0, sizeof a )
#define MEMCPY( a, b ) memcpy( &a, &b, sizeof a )
}
} // namespace Clib
} // namespace Pol

#endif // CLIB_CLIB_H
@@ -64,7 +64,7 @@ char* fullmerge( char* path )

char* mergeFnExt( char* fname )
{
strzcpy( fname, temp_fname, MAXFILE );
stracpy( fname, temp_fname, MAXFILE );
strncat( fname, temp_ext, MAXEXT - 1 );
return fname;
}
@@ -290,5 +290,5 @@ int moveFileNoRep( const char* src, const char* dst )
return inner_move( src, dst, replaceOk );
}
#endif
}
}
} // namespace Clib
} // namespace Pol
@@ -30,13 +30,13 @@ int forspec( const char* spec, void ( *func )( const char* pathname ) )
do
{
++nProc;
strzcpy( fname, find.cFileName, lenleft );
stracpy( fname, find.cFileName, lenleft );
if ( func != nullptr )
( *func )( fullpath );
} while ( FindNextFile( hFind, &find ) );
FindClose( hFind );
}
return nProc;
}
}
}
} // namespace Clib
} // namespace Pol

0 comments on commit ff9f415

Please sign in to comment.
You can’t perform that action at this time.