Normalize all the line endings
This commit is contained in:
244
.cproject
244
.cproject
@@ -1,123 +1,123 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||||
<cconfiguration id="cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978">
|
<cconfiguration id="cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978">
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||||
<externalSettings/>
|
<externalSettings/>
|
||||||
<extensions>
|
<extensions>
|
||||||
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"/>
|
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
<configuration artifactName="stubser" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978" name="Debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="cdt.managedbuild.config.gnu.cygwin.exe.debug" preannouncebuildStep="Git version header" prebuildStep="../resources/version.sh -d">
|
<configuration artifactName="stubser" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978" name="Debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="cdt.managedbuild.config.gnu.cygwin.exe.debug" preannouncebuildStep="Git version header" prebuildStep="../resources/version.sh -d">
|
||||||
<folderInfo id="cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978." name="/" resourcePath="">
|
<folderInfo id="cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978." name="/" resourcePath="">
|
||||||
<toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.exe.debug.1911704982" name="Cygwin GCC" superClass="cdt.managedbuild.toolchain.gnu.cygwin.exe.debug">
|
<toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.exe.debug.1911704982" name="Cygwin GCC" superClass="cdt.managedbuild.toolchain.gnu.cygwin.exe.debug">
|
||||||
<targetPlatform id="cdt.managedbuild.target.gnu.platform.cygwin.exe.debug.417099056" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.cygwin.exe.debug"/>
|
<targetPlatform id="cdt.managedbuild.target.gnu.platform.cygwin.exe.debug.417099056" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.cygwin.exe.debug"/>
|
||||||
<builder buildPath="${workspace_loc:/stubi}/Debug" id="cdt.managedbuild.target.gnu.builder.cygwin.exe.debug.1341361607" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.cygwin.exe.debug"/>
|
<builder buildPath="${workspace_loc:/stubi}/Debug" id="cdt.managedbuild.target.gnu.builder.cygwin.exe.debug.1341361607" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.cygwin.exe.debug"/>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.debug.518707357" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.debug">
|
<tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.debug.518707357" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.debug">
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1228923598" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1228923598" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.698019963" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
|
<tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.698019963" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.debug.1903523299" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.debug">
|
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.debug.1903523299" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.debug">
|
||||||
<option id="gnu.cpp.compiler.cygwin.exe.debug.option.optimization.level.1935693909" name="Optimization Level" superClass="gnu.cpp.compiler.cygwin.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
|
<option id="gnu.cpp.compiler.cygwin.exe.debug.option.optimization.level.1935693909" name="Optimization Level" superClass="gnu.cpp.compiler.cygwin.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
|
||||||
<option id="gnu.cpp.compiler.cygwin.exe.debug.option.debugging.level.967738241" name="Debug Level" superClass="gnu.cpp.compiler.cygwin.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
<option id="gnu.cpp.compiler.cygwin.exe.debug.option.debugging.level.967738241" name="Debug Level" superClass="gnu.cpp.compiler.cygwin.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug.75372444" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug">
|
<tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug.75372444" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug">
|
||||||
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.cygwin.exe.debug.option.optimization.level.1758127696" name="Optimization Level" superClass="gnu.c.compiler.cygwin.exe.debug.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
|
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.cygwin.exe.debug.option.optimization.level.1758127696" name="Optimization Level" superClass="gnu.c.compiler.cygwin.exe.debug.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
|
||||||
<option id="gnu.c.compiler.cygwin.exe.debug.option.debugging.level.196472971" name="Debug Level" superClass="gnu.c.compiler.cygwin.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
|
<option id="gnu.c.compiler.cygwin.exe.debug.option.debugging.level.196472971" name="Debug Level" superClass="gnu.c.compiler.cygwin.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
|
||||||
<option id="gnu.c.compiler.option.include.paths.1914441723" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
<option id="gnu.c.compiler.option.include.paths.1914441723" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/ext}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/ext}""/>
|
||||||
</option>
|
</option>
|
||||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.2046516674" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
<option id="gnu.c.compiler.option.preprocessor.def.symbols.2046516674" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="_DEBUG_OUTPUT=1"/>
|
<listOptionValue builtIn="false" value="_DEBUG_OUTPUT=1"/>
|
||||||
</option>
|
</option>
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1850965" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
|
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1850965" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.debug.1913673353" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.debug">
|
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.debug.1913673353" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.debug">
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.994259447" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.994259447" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
</inputType>
|
</inputType>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.debug.794081126" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.debug"/>
|
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.debug.794081126" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.debug"/>
|
||||||
</toolChain>
|
</toolChain>
|
||||||
</folderInfo>
|
</folderInfo>
|
||||||
<sourceEntries>
|
<sourceEntries>
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||||
</sourceEntries>
|
</sourceEntries>
|
||||||
</configuration>
|
</configuration>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||||
</cconfiguration>
|
</cconfiguration>
|
||||||
<cconfiguration id="cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233">
|
<cconfiguration id="cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233">
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||||
<externalSettings/>
|
<externalSettings/>
|
||||||
<extensions>
|
<extensions>
|
||||||
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"/>
|
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233" name="Release" optionalBuildProperties="" parent="cdt.managedbuild.config.gnu.cygwin.exe.release" postannouncebuildStep="-- Copy release to bin folder --" postbuildStep="cp -f stubser.exe c:\cygwin\bin" preannouncebuildStep="Git version header" prebuildStep="../resources/version.sh">
|
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233" name="Release" optionalBuildProperties="" parent="cdt.managedbuild.config.gnu.cygwin.exe.release" postannouncebuildStep="-- Copy release to bin folder --" postbuildStep="cp -f stubser.exe c:\cygwin\bin" preannouncebuildStep="Git version header" prebuildStep="../resources/version.sh">
|
||||||
<folderInfo id="cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233." name="/" resourcePath="">
|
<folderInfo id="cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233." name="/" resourcePath="">
|
||||||
<toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.exe.release.213504424" name="Cygwin GCC" superClass="cdt.managedbuild.toolchain.gnu.cygwin.exe.release">
|
<toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.exe.release.213504424" name="Cygwin GCC" superClass="cdt.managedbuild.toolchain.gnu.cygwin.exe.release">
|
||||||
<targetPlatform id="cdt.managedbuild.target.gnu.platform.cygwin.exe.release.1771726366" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.cygwin.exe.release"/>
|
<targetPlatform id="cdt.managedbuild.target.gnu.platform.cygwin.exe.release.1771726366" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.cygwin.exe.release"/>
|
||||||
<builder buildPath="${workspace_loc:/stubi}/Release" id="cdt.managedbuild.target.gnu.builder.cygwin.exe.release.1401457693" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.cygwin.exe.release"/>
|
<builder buildPath="${workspace_loc:/stubi}/Release" id="cdt.managedbuild.target.gnu.builder.cygwin.exe.release.1401457693" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.cygwin.exe.release"/>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.release.414454857" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.release">
|
<tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.release.414454857" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.release">
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1199022435" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1199022435" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.237095479" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
|
<tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.237095479" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.release.1684919419" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.release">
|
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.release.1684919419" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.release">
|
||||||
<option id="gnu.cpp.compiler.cygwin.exe.release.option.optimization.level.1663626866" name="Optimization Level" superClass="gnu.cpp.compiler.cygwin.exe.release.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
|
<option id="gnu.cpp.compiler.cygwin.exe.release.option.optimization.level.1663626866" name="Optimization Level" superClass="gnu.cpp.compiler.cygwin.exe.release.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
|
||||||
<option id="gnu.cpp.compiler.cygwin.exe.release.option.debugging.level.1650973862" name="Debug Level" superClass="gnu.cpp.compiler.cygwin.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
|
<option id="gnu.cpp.compiler.cygwin.exe.release.option.debugging.level.1650973862" name="Debug Level" superClass="gnu.cpp.compiler.cygwin.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release.1463094971" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release">
|
<tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release.1463094971" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release">
|
||||||
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.cygwin.exe.release.option.optimization.level.1258615624" name="Optimization Level" superClass="gnu.c.compiler.cygwin.exe.release.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
|
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.cygwin.exe.release.option.optimization.level.1258615624" name="Optimization Level" superClass="gnu.c.compiler.cygwin.exe.release.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
|
||||||
<option id="gnu.c.compiler.cygwin.exe.release.option.debugging.level.929161689" name="Debug Level" superClass="gnu.c.compiler.cygwin.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>
|
<option id="gnu.c.compiler.cygwin.exe.release.option.debugging.level.929161689" name="Debug Level" superClass="gnu.c.compiler.cygwin.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>
|
||||||
<option id="gnu.c.compiler.option.include.paths.816204774" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
<option id="gnu.c.compiler.option.include.paths.816204774" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/ext}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/ext}""/>
|
||||||
</option>
|
</option>
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.257656751" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
|
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.257656751" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.release.1085070010" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.release">
|
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.release.1085070010" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.release">
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.746881963" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.746881963" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
</inputType>
|
</inputType>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.release.656504450" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.release"/>
|
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.release.656504450" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.release"/>
|
||||||
</toolChain>
|
</toolChain>
|
||||||
</folderInfo>
|
</folderInfo>
|
||||||
<sourceEntries>
|
<sourceEntries>
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||||
</sourceEntries>
|
</sourceEntries>
|
||||||
</configuration>
|
</configuration>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||||
</cconfiguration>
|
</cconfiguration>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
<project id="stubi.cdt.managedbuild.target.gnu.cygwin.exe.207306528" name="Executable" projectType="cdt.managedbuild.target.gnu.cygwin.exe"/>
|
<project id="stubi.cdt.managedbuild.target.gnu.cygwin.exe.207306528" name="Executable" projectType="cdt.managedbuild.target.gnu.cygwin.exe"/>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="scannerConfiguration">
|
<storageModule moduleId="scannerConfiguration">
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978;cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug.75372444;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1850965">
|
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978;cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug.75372444;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1850965">
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
</scannerConfigBuildInfo>
|
</scannerConfigBuildInfo>
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233;cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release.1463094971;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.257656751">
|
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233;cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release.1463094971;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.257656751">
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
</scannerConfigBuildInfo>
|
</scannerConfigBuildInfo>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||||
<storageModule moduleId="refreshScope"/>
|
<storageModule moduleId="refreshScope"/>
|
||||||
</cproject>
|
</cproject>
|
52
.project
52
.project
@@ -1,26 +1,26 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<projectDescription>
|
<projectDescription>
|
||||||
<name>stubser</name>
|
<name>stubser</name>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||||
<triggers>clean,full,incremental,</triggers>
|
<triggers>clean,full,incremental,</triggers>
|
||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||||
<triggers>full,incremental,</triggers>
|
<triggers>full,incremental,</triggers>
|
||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978/CYGWIN_HOME/delimiter=;
|
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978/CYGWIN_HOME/delimiter=;
|
||||||
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978/CYGWIN_HOME/operation=replace
|
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978/CYGWIN_HOME/operation=replace
|
||||||
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978/CYGWIN_HOME/value=C\:\\cygwin
|
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978/CYGWIN_HOME/value=C\:\\cygwin
|
||||||
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978/append=true
|
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978/append=true
|
||||||
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978/appendContributed=true
|
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.debug.384908978/appendContributed=true
|
||||||
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233/CYGWIN_HOME/delimiter=;
|
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233/CYGWIN_HOME/delimiter=;
|
||||||
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233/CYGWIN_HOME/operation=replace
|
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233/CYGWIN_HOME/operation=replace
|
||||||
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233/CYGWIN_HOME/value=C\:\\cygwin
|
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233/CYGWIN_HOME/value=C\:\\cygwin
|
||||||
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233/append=true
|
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233/append=true
|
||||||
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233/appendContributed=true
|
environment/project/cdt.managedbuild.config.gnu.cygwin.exe.release.1204024233/appendContributed=true
|
||||||
|
176
src/ext/debug.h
176
src/ext/debug.h
@@ -1,88 +1,88 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file debug.h
|
* @file debug.h
|
||||||
* @brief Helper for debug output
|
* @brief Helper for debug output
|
||||||
*
|
*
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: mst\n
|
* Module: mst\n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 08.06.2016
|
* @date 08.06.2016
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
#ifndef _DEBUG_H_INCLUDED
|
#ifndef _DEBUG_H_INCLUDED
|
||||||
#define _DEBUG_H_INCLUDED
|
#define _DEBUG_H_INCLUDED
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define isDebugLevel(dflag) (_DEBUG_OUTPUT >= dflag)
|
#define isDebugLevel(dflag) (_DEBUG_OUTPUT >= dflag)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief extract only filename from __FILE__ without base path
|
* @brief extract only filename from __FILE__ without base path
|
||||||
*/
|
*/
|
||||||
#define _DEBUG_FILENAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
|
#define _DEBUG_FILENAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Debug assert helper macro
|
* @brief Debug assert helper macro
|
||||||
* @param cond condition for output
|
* @param cond condition for output
|
||||||
* @param dflag eDebugLevel required to print output
|
* @param dflag eDebugLevel required to print output
|
||||||
* @param format format same as for printf
|
* @param format format same as for printf
|
||||||
* @param args arguments for printf
|
* @param args arguments for printf
|
||||||
*
|
*
|
||||||
* Condition as string is appended to the output.\n
|
* Condition as string is appended to the output.\n
|
||||||
* e.g. DEBUG_LOG_ASSERT(i >= 1, DEBUG_LEVEL_INFO, "Not allowed");\n
|
* e.g. DEBUG_LOG_ASSERT(i >= 1, DEBUG_LEVEL_INFO, "Not allowed");\n
|
||||||
* New line must be appended manually
|
* New line must be appended manually
|
||||||
*/
|
*/
|
||||||
#ifdef _DEBUG_OUTPUT
|
#ifdef _DEBUG_OUTPUT
|
||||||
#define DEBUG_LOG_ASSERT(cond, dflag, format, args...) do { if(isDebugLevel(dflag) && (cond)) \
|
#define DEBUG_LOG_ASSERT(cond, dflag, format, args...) do { if(isDebugLevel(dflag) && (cond)) \
|
||||||
printf("%s:%d:%s():(" #cond "): " format, \
|
printf("%s:%d:%s():(" #cond "): " format, \
|
||||||
_DEBUG_FILENAME, __LINE__, __func__, ##args); } \
|
_DEBUG_FILENAME, __LINE__, __func__, ##args); } \
|
||||||
while (0)
|
while (0)
|
||||||
#else
|
#else
|
||||||
#define DEBUG_LOG_ASSERT(cond, dflag, format, args...) do{/* nothing */}while(0)
|
#define DEBUG_LOG_ASSERT(cond, dflag, format, args...) do{/* nothing */}while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Debug output helper macro
|
* @brief Debug output helper macro
|
||||||
* @param dflag eDebugLevel required to print output
|
* @param dflag eDebugLevel required to print output
|
||||||
* @param format format same as for printf
|
* @param format format same as for printf
|
||||||
* @param args arguments for printf
|
* @param args arguments for printf
|
||||||
*
|
*
|
||||||
* New line must be appended manually
|
* New line must be appended manually
|
||||||
*/
|
*/
|
||||||
#ifdef _DEBUG_OUTPUT
|
#ifdef _DEBUG_OUTPUT
|
||||||
#define DEBUG_LOG(dflag, format, args...) do { if(isDebugLevel(dflag)) \
|
#define DEBUG_LOG(dflag, format, args...) do { if(isDebugLevel(dflag)) \
|
||||||
printf("%s:%d:%s(): " format, \
|
printf("%s:%d:%s(): " format, \
|
||||||
_DEBUG_FILENAME, __LINE__, __func__, ##args); } \
|
_DEBUG_FILENAME, __LINE__, __func__, ##args); } \
|
||||||
while (0)
|
while (0)
|
||||||
#else
|
#else
|
||||||
#define DEBUG_LOG(dflag, format, args...) do{/* nothing */}while(0)
|
#define DEBUG_LOG(dflag, format, args...) do{/* nothing */}while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Debug output helper macro to append text without addition information
|
* @brief Debug output helper macro to append text without addition information
|
||||||
* @param dflag eDebugLevel required to print output
|
* @param dflag eDebugLevel required to print output
|
||||||
* @param format format same as for printf
|
* @param format format same as for printf
|
||||||
* @param args arguments for printf
|
* @param args arguments for printf
|
||||||
*
|
*
|
||||||
* New line must be appended manually
|
* New line must be appended manually
|
||||||
*/
|
*/
|
||||||
#ifdef _DEBUG_OUTPUT
|
#ifdef _DEBUG_OUTPUT
|
||||||
#define DEBUG_LOG_APPEND(dflag, format, args...) do { if(isDebugLevel(dflag)) \
|
#define DEBUG_LOG_APPEND(dflag, format, args...) do { if(isDebugLevel(dflag)) \
|
||||||
printf(format, ##args); } \
|
printf(format, ##args); } \
|
||||||
while (0)
|
while (0)
|
||||||
#else
|
#else
|
||||||
#define DEBUG_LOG_APPEND(dflag, format, args...) do{/* nothing */}while(0)
|
#define DEBUG_LOG_APPEND(dflag, format, args...) do{/* nothing */}while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum _EDEBUGLEVEL
|
typedef enum _EDEBUGLEVEL
|
||||||
{
|
{
|
||||||
DEBUG_LEVEL_ALWAYS = 0, /* DEBUG_LOGs are visible regardless of DEBUG_LEVEL */
|
DEBUG_LEVEL_ALWAYS = 0, /* DEBUG_LOGs are visible regardless of DEBUG_LEVEL */
|
||||||
DEBUG_LEVEL_INFO = 1, /* Visible when application started with -v */
|
DEBUG_LEVEL_INFO = 1, /* Visible when application started with -v */
|
||||||
DEBUG_LEVEL_WARNING = 2, /* Visible when application started with -vv */
|
DEBUG_LEVEL_WARNING = 2, /* Visible when application started with -vv */
|
||||||
DEBUG_LEVEL_ERROR = 3,
|
DEBUG_LEVEL_ERROR = 3,
|
||||||
/* Visible when application started with -vvv */
|
/* Visible when application started with -vvv */
|
||||||
} eDebugLevel;
|
} eDebugLevel;
|
||||||
|
|
||||||
#endif /* #ifndef _DEBUG_H_INCLUDED */
|
#endif /* #ifndef _DEBUG_H_INCLUDED */
|
||||||
|
@@ -1,79 +1,79 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file xmalloc.c
|
* @file xmalloc.c
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 28.02.2017
|
* @date 28.02.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
#include "xtypes.h"
|
#include "xtypes.h"
|
||||||
|
|
||||||
void* xmalloc(size_t size)
|
void* xmalloc(size_t size)
|
||||||
{
|
{
|
||||||
void *value = malloc(size);
|
void *value = malloc(size);
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
perror("virtual memory exhausted");
|
perror("virtual memory exhausted");
|
||||||
else
|
else
|
||||||
memset(value, 0, size);
|
memset(value, 0, size);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* xmallocStrlcpy(char **aDest, char *aSource, size_t aSize)
|
char* xmallocStrlcpy(char **aDest, char *aSource, size_t aSize)
|
||||||
{
|
{
|
||||||
if (NULL == aSource || 0 == aSize)
|
if (NULL == aSource || 0 == aSize)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (NULL != *aDest)
|
if (NULL != *aDest)
|
||||||
{
|
{
|
||||||
*aDest = (char*) realloc(*aDest, aSize + 1);
|
*aDest = (char*) realloc(*aDest, aSize + 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*aDest = (char*) xmalloc(aSize + 1);
|
*aDest = (char*) xmalloc(aSize + 1);
|
||||||
}
|
}
|
||||||
if (NULL != *aDest)
|
if (NULL != *aDest)
|
||||||
{
|
{
|
||||||
(void) strlcpy(*aDest, aSource, aSize + 1);
|
(void) strlcpy(*aDest, aSource, aSize + 1);
|
||||||
}
|
}
|
||||||
return *aDest;
|
return *aDest;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* xmallocStrlcat(char **aDest, char *aSource, size_t aSize)
|
char* xmallocStrlcat(char **aDest, char *aSource, size_t aSize)
|
||||||
{
|
{
|
||||||
size_t newSize = 0;
|
size_t newSize = 0;
|
||||||
if (NULL == aSource || 0 == aSize)
|
if (NULL == aSource || 0 == aSize)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (NULL != *aDest)
|
if (NULL != *aDest)
|
||||||
{
|
{
|
||||||
newSize = strlen(*aDest) + aSize + 1;
|
newSize = strlen(*aDest) + aSize + 1;
|
||||||
*aDest = (char*) realloc(*aDest, newSize);
|
*aDest = (char*) realloc(*aDest, newSize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newSize = aSize + 1;
|
newSize = aSize + 1;
|
||||||
*aDest = (char*) xmalloc(newSize);
|
*aDest = (char*) xmalloc(newSize);
|
||||||
}
|
}
|
||||||
if (NULL != *aDest)
|
if (NULL != *aDest)
|
||||||
{
|
{
|
||||||
(void) strlcat(*aDest, aSource, newSize);
|
(void) strlcat(*aDest, aSource, newSize);
|
||||||
}
|
}
|
||||||
return *aDest;
|
return *aDest;
|
||||||
}
|
}
|
||||||
|
|
||||||
void xfree(void **aDest)
|
void xfree(void **aDest)
|
||||||
{
|
{
|
||||||
free(*aDest);
|
free(*aDest);
|
||||||
*aDest = NULL;
|
*aDest = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,24 +1,24 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file xmalloc.h
|
* @file xmalloc.h
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 28.02.2017
|
* @date 28.02.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef EXT_XMALLOC_H_
|
#ifndef EXT_XMALLOC_H_
|
||||||
#define EXT_XMALLOC_H_
|
#define EXT_XMALLOC_H_
|
||||||
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
void *xmalloc(size_t size);
|
void *xmalloc(size_t size);
|
||||||
void xfree(void**);
|
void xfree(void**);
|
||||||
char* xmallocStrlcpy(char **aDest, char *aSource, size_t aSize);
|
char* xmallocStrlcpy(char **aDest, char *aSource, size_t aSize);
|
||||||
char* xmallocStrlcat(char **aDest, char *aSource, size_t aSize);
|
char* xmallocStrlcat(char **aDest, char *aSource, size_t aSize);
|
||||||
|
|
||||||
#endif /* EXT_XMALLOC_H_ */
|
#endif /* EXT_XMALLOC_H_ */
|
||||||
|
@@ -1,22 +1,22 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file xregex.h
|
* @file xregex.h
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 01.03.2017
|
* @date 01.03.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef EXT_XREGEX_H_
|
#ifndef EXT_XREGEX_H_
|
||||||
#define EXT_XREGEX_H_
|
#define EXT_XREGEX_H_
|
||||||
|
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
|
|
||||||
#define XREGEX_IS_MATCHGROUP(groupArray, groupIndex) (groupArray[groupIndex].rm_so < groupArray[groupIndex].rm_eo && 0 <= groupArray[groupIndex].rm_so)
|
#define XREGEX_IS_MATCHGROUP(groupArray, groupIndex) (groupArray[groupIndex].rm_so < groupArray[groupIndex].rm_eo && 0 <= groupArray[groupIndex].rm_so)
|
||||||
#define XREGEX_SIZEOF_MATCHGROUP(groupArray, groupIndex) (size_t) (groupArray[groupIndex].rm_eo - groupArray[groupIndex].rm_so)
|
#define XREGEX_SIZEOF_MATCHGROUP(groupArray, groupIndex) (size_t) (groupArray[groupIndex].rm_eo - groupArray[groupIndex].rm_so)
|
||||||
|
|
||||||
#endif /* EXT_XREGEX_H_ */
|
#endif /* EXT_XREGEX_H_ */
|
||||||
|
@@ -1,154 +1,154 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file xstring.c
|
* @file xstring.c
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 27.02.2017
|
* @date 27.02.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
#include "xtypes.h"
|
#include "xtypes.h"
|
||||||
#include "xstring.h"
|
#include "xstring.h"
|
||||||
#include "ctype.h"
|
#include "ctype.h"
|
||||||
|
|
||||||
char* gnu_basename(char *path)
|
char* gnu_basename(char *path)
|
||||||
{
|
{
|
||||||
char *baseWin = strrchr(path, '\\');
|
char *baseWin = strrchr(path, '\\');
|
||||||
char *base = strrchr(path, '/');
|
char *base = strrchr(path, '/');
|
||||||
if (baseWin > base)
|
if (baseWin > base)
|
||||||
{
|
{
|
||||||
base = baseWin;
|
base = baseWin;
|
||||||
}
|
}
|
||||||
return base ? base + 1 : path;
|
return base ? base + 1 : path;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t xStrCount(char *aStr, char aC)
|
uint32_t xStrCount(char *aStr, char aC)
|
||||||
{
|
{
|
||||||
uint32_t count = 0;
|
uint32_t count = 0;
|
||||||
char *temp = NULL;
|
char *temp = NULL;
|
||||||
|
|
||||||
if (NULL == aStr)
|
if (NULL == aStr)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
temp = aStr;
|
temp = aStr;
|
||||||
|
|
||||||
while (*temp)
|
while (*temp)
|
||||||
{
|
{
|
||||||
if (aC == *temp)
|
if (aC == *temp)
|
||||||
{
|
{
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
temp++;
|
temp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Trim leading and trailing whitespaces
|
* @brief Trim leading and trailing whitespaces
|
||||||
* @param [in] *str Input string
|
* @param [in] *str Input string
|
||||||
* @retval char* pointer to the trimmed substring
|
* @retval char* pointer to the trimmed substring
|
||||||
*
|
*
|
||||||
* @details
|
* @details
|
||||||
* This function returns a pointer to a substring of the original string.
|
* This function returns a pointer to a substring of the original string.
|
||||||
* If the given string was allocated dynamically, the caller must not overwrite
|
* If the given string was allocated dynamically, the caller must not overwrite
|
||||||
* that pointer with the returned value, since the original pointer must be
|
* that pointer with the returned value, since the original pointer must be
|
||||||
* deallocated using the same allocator with which it was allocated. The return
|
* deallocated using the same allocator with which it was allocated. The return
|
||||||
* value must NOT be deallocated using free() etc.
|
* value must NOT be deallocated using free() etc.
|
||||||
*/
|
*/
|
||||||
char* strntrimStatic(char *aStr, size_t aMaxLength)
|
char* strntrimStatic(char *aStr, size_t aMaxLength)
|
||||||
{
|
{
|
||||||
char *end;
|
char *end;
|
||||||
|
|
||||||
// Trim leading space
|
// Trim leading space
|
||||||
while (isspace((unsigned char)*aStr) && 0 < aMaxLength)
|
while (isspace((unsigned char)*aStr) && 0 < aMaxLength)
|
||||||
{
|
{
|
||||||
if (--aMaxLength > 0)
|
if (--aMaxLength > 0)
|
||||||
{
|
{
|
||||||
++aStr;
|
++aStr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// All spaces at termination or end of max length
|
// All spaces at termination or end of max length
|
||||||
if (*aStr == '\0' || 0 == aMaxLength)
|
if (*aStr == '\0' || 0 == aMaxLength)
|
||||||
{
|
{
|
||||||
return aStr;
|
return aStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trim trailing space
|
// Trim trailing space
|
||||||
if (strlen(aStr) >= aMaxLength)
|
if (strlen(aStr) >= aMaxLength)
|
||||||
{
|
{
|
||||||
end = aStr + aMaxLength - 1;
|
end = aStr + aMaxLength - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
end = aStr + strlen(aStr) - 1;
|
end = aStr + strlen(aStr) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (end > aStr && isspace((unsigned char )*end))
|
while (end > aStr && isspace((unsigned char )*end))
|
||||||
{
|
{
|
||||||
end--;
|
end--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write new null terminator (if length is enough)
|
// Write new null terminator (if length is enough)
|
||||||
if (end < (aStr + aMaxLength - 1))
|
if (end < (aStr + aMaxLength - 1))
|
||||||
{
|
{
|
||||||
*(end + 1) = '\0';
|
*(end + 1) = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
return aStr;
|
return aStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void xStringTrim(char *aStr, size_t aMaxLength)
|
void xStringTrim(char *aStr, size_t aMaxLength)
|
||||||
{
|
{
|
||||||
char *start;
|
char *start;
|
||||||
char *end;
|
char *end;
|
||||||
|
|
||||||
if (NULL == aStr)
|
if (NULL == aStr)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
start = aStr;
|
start = aStr;
|
||||||
// Trim leading space
|
// Trim leading space
|
||||||
while (isspace((unsigned char)*aStr) && 0 < aMaxLength)
|
while (isspace((unsigned char)*aStr) && 0 < aMaxLength)
|
||||||
{
|
{
|
||||||
if (--aMaxLength > 0)
|
if (--aMaxLength > 0)
|
||||||
{
|
{
|
||||||
++aStr;
|
++aStr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// All spaces at termination or end of max length
|
// All spaces at termination or end of max length
|
||||||
if (*aStr == '\0' || 0 == aMaxLength)
|
if (*aStr == '\0' || 0 == aMaxLength)
|
||||||
{
|
{
|
||||||
start = '\0';
|
start = '\0';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) strlcpy(start, aStr, strlen(aStr) + 1);
|
(void) strlcpy(start, aStr, strlen(aStr) + 1);
|
||||||
|
|
||||||
// Trim trailing space
|
// Trim trailing space
|
||||||
if (strlen(start) >= aMaxLength)
|
if (strlen(start) >= aMaxLength)
|
||||||
{
|
{
|
||||||
end = start + aMaxLength - 1;
|
end = start + aMaxLength - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
end = start + strlen(start) - 1;
|
end = start + strlen(start) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (end > start && isspace((unsigned char )*end))
|
while (end > start && isspace((unsigned char )*end))
|
||||||
{
|
{
|
||||||
end--;
|
end--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write new null terminator (if length is enough)
|
// Write new null terminator (if length is enough)
|
||||||
if (end < (start + aMaxLength - 1))
|
if (end < (start + aMaxLength - 1))
|
||||||
{
|
{
|
||||||
*(end + 1) = '\0';
|
*(end + 1) = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,23 +1,23 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file xstring.h
|
* @file xstring.h
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 27.02.2017
|
* @date 27.02.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
#ifndef XSTRING_H_
|
#ifndef XSTRING_H_
|
||||||
#define XSTRING_H_
|
#define XSTRING_H_
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
char* gnu_basename(char *path);
|
char* gnu_basename(char *path);
|
||||||
uint32_t xStrCount(char *aStr, char aC);
|
uint32_t xStrCount(char *aStr, char aC);
|
||||||
char* strntrimStatic(char *aStr, size_t aMaxLength);
|
char* strntrimStatic(char *aStr, size_t aMaxLength);
|
||||||
void xStringTrim(char *aStr, size_t aMaxLength);
|
void xStringTrim(char *aStr, size_t aMaxLength);
|
||||||
|
|
||||||
#endif /* XSTRING_H_ */
|
#endif /* XSTRING_H_ */
|
||||||
|
@@ -1,32 +1,32 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file xtime.h
|
* @file xtime.h
|
||||||
* @brief Provides additional definitions for working with delays
|
* @brief Provides additional definitions for working with delays
|
||||||
*
|
*
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: mst\n
|
* Module: mst\n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 08.06.2016
|
* @date 08.06.2016
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
#ifndef XTIME_H_
|
#ifndef XTIME_H_
|
||||||
#define XTIME_H_
|
#define XTIME_H_
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
/*! @brief Convert milliseconds to nanoseconds */
|
/*! @brief Convert milliseconds to nanoseconds */
|
||||||
#define XTIME_MSTONS(milliseconds) (milliseconds * 1000000L)
|
#define XTIME_MSTONS(milliseconds) (milliseconds * 1000000L)
|
||||||
/*! @brief Convert microseconds to nanoseconds */
|
/*! @brief Convert microseconds to nanoseconds */
|
||||||
#define XTIME_USTONS(microseconds) (microseconds * 1000L)
|
#define XTIME_USTONS(microseconds) (microseconds * 1000L)
|
||||||
/*! @brief Convert nanoseconds to milliseconds*/
|
/*! @brief Convert nanoseconds to milliseconds*/
|
||||||
#define XTIME_NSTOMS(nanoseconds) (nanoseconds / 1000000L)
|
#define XTIME_NSTOMS(nanoseconds) (nanoseconds / 1000000L)
|
||||||
/*! @brief Convert nanoseconds to microseconds*/
|
/*! @brief Convert nanoseconds to microseconds*/
|
||||||
#define XTIME_NSTOUS(nanoseconds) (nanoseconds / 1000L)
|
#define XTIME_NSTOUS(nanoseconds) (nanoseconds / 1000L)
|
||||||
|
|
||||||
/*! @brief Only microseconds up to 1000000 are supported */
|
/*! @brief Only microseconds up to 1000000 are supported */
|
||||||
#define XTIME_TIMESPEC_US(seconds, microseconds) (const struct timespec[]){{seconds, XTIME_USTONS(microseconds)}}
|
#define XTIME_TIMESPEC_US(seconds, microseconds) (const struct timespec[]){{seconds, XTIME_USTONS(microseconds)}}
|
||||||
/*! @brief Only milliseconds up to 1000 are supported */
|
/*! @brief Only milliseconds up to 1000 are supported */
|
||||||
#define XTIME_TIMESPEC_MS(seconds, milliseconds) (const struct timespec[]){{seconds, XTIME_MSTONS(milliseconds)}}
|
#define XTIME_TIMESPEC_MS(seconds, milliseconds) (const struct timespec[]){{seconds, XTIME_MSTONS(milliseconds)}}
|
||||||
|
|
||||||
#endif /* XTIME_H_ */
|
#endif /* XTIME_H_ */
|
||||||
|
@@ -1,41 +1,41 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file xtypes.h
|
* @file xtypes.h
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 27.02.2017
|
* @date 27.02.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef XTYPES_H_
|
#ifndef XTYPES_H_
|
||||||
#define XTYPES_H_
|
#define XTYPES_H_
|
||||||
|
|
||||||
#include <stddef.h> // definition of NULL
|
#include <stddef.h> // definition of NULL
|
||||||
#include <stdint.h> // fixed width types
|
#include <stdint.h> // fixed width types
|
||||||
#include <stdbool.h> // definition of bool
|
#include <stdbool.h> // definition of bool
|
||||||
|
|
||||||
#define STRINGIZE_2(s) #s
|
#define STRINGIZE_2(s) #s
|
||||||
/*!
|
/*!
|
||||||
* @brief Stringify the content of a definition
|
* @brief Stringify the content of a definition
|
||||||
* @details
|
* @details
|
||||||
* Usage example:
|
* Usage example:
|
||||||
* @code
|
* @code
|
||||||
#define VERSION_MAJOR 4
|
#define VERSION_MAJOR 4
|
||||||
#define VERSION_MINOR 47
|
#define VERSION_MINOR 47
|
||||||
|
|
||||||
#define VERSION_STRING "v" STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR)
|
#define VERSION_STRING "v" STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR)
|
||||||
@endcode
|
@endcode
|
||||||
*/
|
*/
|
||||||
#define STRINGIZE(s) STRINGIZE_2(s)
|
#define STRINGIZE(s) STRINGIZE_2(s)
|
||||||
|
|
||||||
#if defined(UNIT_TEST) || defined(_DEBUG)
|
#if defined(UNIT_TEST) || defined(_DEBUG)
|
||||||
#define STATIC
|
#define STATIC
|
||||||
#else
|
#else
|
||||||
#define STATIC static
|
#define STATIC static
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* XTYPES_H_ */
|
#endif /* XTYPES_H_ */
|
||||||
|
444
src/main.c
444
src/main.c
@@ -1,222 +1,222 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file main.c
|
* @file main.c
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 27.02.2017
|
* @date 27.02.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ftw.h>
|
#include <ftw.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
#include "xregex.h"
|
#include "xregex.h"
|
||||||
#include "xtypes.h"
|
#include "xtypes.h"
|
||||||
#include "xstring.h"
|
#include "xstring.h"
|
||||||
#include "stubser/stubser_if.h"
|
#include "stubser/stubser_if.h"
|
||||||
|
|
||||||
/* POSIX.1 says each process has at least 20 file descriptors.
|
/* POSIX.1 says each process has at least 20 file descriptors.
|
||||||
* Three of those belong to the standard streams.
|
* Three of those belong to the standard streams.
|
||||||
* Here, we use a conservative estimate of 15 available;
|
* Here, we use a conservative estimate of 15 available;
|
||||||
* assuming we use at most two for other uses in this program,
|
* assuming we use at most two for other uses in this program,
|
||||||
* we should never run into any problems.
|
* we should never run into any problems.
|
||||||
* Most trees are shallower than that, so it is efficient.
|
* Most trees are shallower than that, so it is efficient.
|
||||||
* Deeper trees are traversed fine, just a bit slower.
|
* Deeper trees are traversed fine, just a bit slower.
|
||||||
* (Linux allows typically hundreds to thousands of open files,
|
* (Linux allows typically hundreds to thousands of open files,
|
||||||
* so you'll probably never see any issues even if you used
|
* so you'll probably never see any issues even if you used
|
||||||
* a much higher value, say a couple of hundred, but
|
* a much higher value, say a couple of hundred, but
|
||||||
* 15 is a safe, reasonable value.)
|
* 15 is a safe, reasonable value.)
|
||||||
*/
|
*/
|
||||||
#ifndef USE_FDS
|
#ifndef USE_FDS
|
||||||
#define USE_FDS 15
|
#define USE_FDS 15
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MAIN_MAX_MATCHGROUP_FILENAME 2
|
#define MAIN_MAX_MATCHGROUP_FILENAME 2
|
||||||
#define MAIN_CFILE_PATTERN "^(.*)\\.+[cC]$"
|
#define MAIN_CFILE_PATTERN "^(.*)\\.+[cC]$"
|
||||||
|
|
||||||
STATIC regex_t main_regXcFile;
|
STATIC regex_t main_regXcFile;
|
||||||
STATIC bool main_recurse = false;
|
STATIC bool main_recurse = false;
|
||||||
STATIC char* main_outputDir = NULL;
|
STATIC char* main_outputDir = NULL;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Using regular expressions to scan for c files, extract filename without suffix and start stub creation
|
* @brief Using regular expressions to scan for c files, extract filename without suffix and start stub creation
|
||||||
* @details
|
* @details
|
||||||
* @par Parameter
|
* @par Parameter
|
||||||
* See gnu libc documentation for details (Data Type: __nftw_func_t).
|
* See gnu libc documentation for details (Data Type: __nftw_func_t).
|
||||||
*/
|
*/
|
||||||
int evaluateEntry(const char *filepath, const struct stat *info, const int typeflag, struct FTW *pathinfo)
|
int evaluateEntry(const char *filepath, const struct stat *info, const int typeflag, struct FTW *pathinfo)
|
||||||
{
|
{
|
||||||
regmatch_t matchGroup[MAIN_MAX_MATCHGROUP_FILENAME];
|
regmatch_t matchGroup[MAIN_MAX_MATCHGROUP_FILENAME];
|
||||||
char *noSuffix = NULL;
|
char *noSuffix = NULL;
|
||||||
if (!main_recurse && 1 < pathinfo->level)
|
if (!main_recurse && 1 < pathinfo->level)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (typeflag != FTW_F)
|
if (typeflag != FTW_F)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 != regexec(&main_regXcFile, gnu_basename((char*) filepath), MAIN_MAX_MATCHGROUP_FILENAME, matchGroup, 0))
|
if (0 != regexec(&main_regXcFile, gnu_basename((char*) filepath), MAIN_MAX_MATCHGROUP_FILENAME, matchGroup, 0))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XREGEX_IS_MATCHGROUP(matchGroup, 1))
|
if (XREGEX_IS_MATCHGROUP(matchGroup, 1))
|
||||||
{
|
{
|
||||||
xmallocStrlcpy(&noSuffix, &gnu_basename((char*) filepath)[matchGroup[1].rm_so], XREGEX_SIZEOF_MATCHGROUP(matchGroup, 1));
|
xmallocStrlcpy(&noSuffix, &gnu_basename((char*) filepath)[matchGroup[1].rm_so], XREGEX_SIZEOF_MATCHGROUP(matchGroup, 1));
|
||||||
if (NULL != noSuffix)
|
if (NULL != noSuffix)
|
||||||
{
|
{
|
||||||
stubser_createStub((char*) filepath, noSuffix, main_outputDir);
|
stubser_createStub((char*) filepath, noSuffix, main_outputDir);
|
||||||
}
|
}
|
||||||
free(noSuffix);
|
free(noSuffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Scan given directory recursively
|
* @brief Scan given directory recursively
|
||||||
*/
|
*/
|
||||||
int evaluateDirectoryTree(const char * const dirpath)
|
int evaluateDirectoryTree(const char * const dirpath)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
/* Invalid directory path? */
|
/* Invalid directory path? */
|
||||||
if (dirpath == NULL || *dirpath == '\0')
|
if (dirpath == NULL || *dirpath == '\0')
|
||||||
return errno = EINVAL;
|
return errno = EINVAL;
|
||||||
|
|
||||||
result = nftw(dirpath, evaluateEntry, USE_FDS, FTW_PHYS);
|
result = nftw(dirpath, evaluateEntry, USE_FDS, FTW_PHYS);
|
||||||
if (result >= 0)
|
if (result >= 0)
|
||||||
errno = result;
|
errno = result;
|
||||||
|
|
||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
void printUsage(char *aAppName)
|
void printUsage(char *aAppName)
|
||||||
{
|
{
|
||||||
printf("%s version: %s\n", aAppName, GITVERSION);
|
printf("%s version: %s\n", aAppName, GITVERSION);
|
||||||
printf("Create stub c-files and c-header from c files for CUnit.\n\n");
|
printf("Create stub c-files and c-header from c files for CUnit.\n\n");
|
||||||
printf("Usage:\n");
|
printf("Usage:\n");
|
||||||
printf(" %s [options] [source dir] <target dir>\n", aAppName);
|
printf(" %s [options] [source dir] <target dir>\n", aAppName);
|
||||||
printf("\nOptions:\n");
|
printf("\nOptions:\n");
|
||||||
printf(" -h, --help \tShow usage\n");
|
printf(" -h, --help \tShow usage\n");
|
||||||
printf(" -r, --recurse\tSearch source Dir recursively\n");
|
printf(" -r, --recurse\tSearch source Dir recursively\n");
|
||||||
printf(" --version \tShow version\n");
|
printf(" --version \tShow version\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Search (optionally recursive) for c file and create stubs
|
* @brief Search (optionally recursive) for c file and create stubs
|
||||||
* @param [in] argc Amount of command line arguments
|
* @param [in] argc Amount of command line arguments
|
||||||
* @param [in] **argv Array of arguments
|
* @param [in] **argv Array of arguments
|
||||||
* @retval EXIT_SUCCESS stubs created successfully
|
* @retval EXIT_SUCCESS stubs created successfully
|
||||||
* @retval EXIT_FAILURE error with arguments or input
|
* @retval EXIT_FAILURE error with arguments or input
|
||||||
*/
|
*/
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int ret = EXIT_FAILURE;
|
int ret = EXIT_FAILURE;
|
||||||
int outputDirIndex = 0;
|
int outputDirIndex = 0;
|
||||||
uint8_t dirs = 0;
|
uint8_t dirs = 0;
|
||||||
|
|
||||||
if (regcomp(&main_regXcFile, MAIN_CFILE_PATTERN, REG_EXTENDED | REG_NEWLINE))
|
if (regcomp(&main_regXcFile, MAIN_CFILE_PATTERN, REG_EXTENDED | REG_NEWLINE))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s.\n", strerror(errno));
|
fprintf(stderr, "%s.\n", strerror(errno));
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
goto l_main_end;
|
goto l_main_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
{
|
{
|
||||||
printUsage(gnu_basename(argv[0]));
|
printUsage(gnu_basename(argv[0]));
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
goto l_main_end;
|
goto l_main_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
// evaluate command line parameter
|
// evaluate command line parameter
|
||||||
for (i = 1; i < argc && i < 4; ++i)
|
for (i = 1; i < argc && i < 4; ++i)
|
||||||
{
|
{
|
||||||
if (NULL != strstr(argv[i], "-r") || NULL != strstr(argv[i], "--recurse"))
|
if (NULL != strstr(argv[i], "-r") || NULL != strstr(argv[i], "--recurse"))
|
||||||
{
|
{
|
||||||
main_recurse = true;
|
main_recurse = true;
|
||||||
}
|
}
|
||||||
else if (NULL != strstr(argv[i], "--version"))
|
else if (NULL != strstr(argv[i], "--version"))
|
||||||
{
|
{
|
||||||
printf("%s version: %s", gnu_basename(argv[0]), GITVERSION);
|
printf("%s version: %s", gnu_basename(argv[0]), GITVERSION);
|
||||||
goto l_main_end;
|
goto l_main_end;
|
||||||
}
|
}
|
||||||
else if (NULL != strstr(argv[i], "-h") || NULL != strstr(argv[i], "--help"))
|
else if (NULL != strstr(argv[i], "-h") || NULL != strstr(argv[i], "--help"))
|
||||||
{
|
{
|
||||||
printUsage(gnu_basename(argv[0]));
|
printUsage(gnu_basename(argv[0]));
|
||||||
goto l_main_end;
|
goto l_main_end;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
outputDirIndex = i;
|
outputDirIndex = i;
|
||||||
++dirs;
|
++dirs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == outputDirIndex)
|
if (0 == outputDirIndex)
|
||||||
{
|
{
|
||||||
// only options; no output directory provided
|
// only options; no output directory provided
|
||||||
printUsage(gnu_basename(argv[0]));
|
printUsage(gnu_basename(argv[0]));
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
goto l_main_end;
|
goto l_main_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 > mkdir(argv[outputDirIndex], S_IRWXU))
|
if (0 > mkdir(argv[outputDirIndex], S_IRWXU))
|
||||||
{
|
{
|
||||||
// output directory not available
|
// output directory not available
|
||||||
if (EEXIST != errno)
|
if (EEXIST != errno)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s.\n", strerror(errno));
|
fprintf(stderr, "%s.\n", strerror(errno));
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
goto l_main_end;
|
goto l_main_end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xmallocStrlcpy(&main_outputDir, argv[outputDirIndex], strlen(argv[outputDirIndex]) + 1);
|
xmallocStrlcpy(&main_outputDir, argv[outputDirIndex], strlen(argv[outputDirIndex]) + 1);
|
||||||
if (NULL == main_outputDir)
|
if (NULL == main_outputDir)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s.\n", strerror(errno));
|
fprintf(stderr, "%s.\n", strerror(errno));
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
goto l_main_end;
|
goto l_main_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (1 == dirs)
|
if (1 == dirs)
|
||||||
{
|
{
|
||||||
// only output provided; input will be "."
|
// only output provided; input will be "."
|
||||||
if (evaluateDirectoryTree("."))
|
if (evaluateDirectoryTree("."))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s.\n", strerror(errno));
|
fprintf(stderr, "%s.\n", strerror(errno));
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
goto l_main_end;
|
goto l_main_end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// take input directory from arguments
|
// take input directory from arguments
|
||||||
if (evaluateDirectoryTree(argv[outputDirIndex - 1]))
|
if (evaluateDirectoryTree(argv[outputDirIndex - 1]))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s.\n", strerror(errno));
|
fprintf(stderr, "%s.\n", strerror(errno));
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
goto l_main_end;
|
goto l_main_end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = EXIT_SUCCESS;
|
ret = EXIT_SUCCESS;
|
||||||
|
|
||||||
l_main_end: // label for ending main
|
l_main_end: // label for ending main
|
||||||
|
|
||||||
free(main_outputDir);
|
free(main_outputDir);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@@ -1,163 +1,163 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file cfile.c
|
* @file cfile.c
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 08.03.2017
|
* @date 08.03.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "xtypes.h"
|
#include "xtypes.h"
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
#include "cfile_if.h"
|
#include "cfile_if.h"
|
||||||
|
|
||||||
cfile_variable_t* cfile_newVariable(cfile_variableList_t *aList)
|
cfile_variable_t* cfile_newVariable(cfile_variableList_t *aList)
|
||||||
{
|
{
|
||||||
cfile_variable_t *new = NULL;
|
cfile_variable_t *new = NULL;
|
||||||
|
|
||||||
if (NULL == aList)
|
if (NULL == aList)
|
||||||
{
|
{
|
||||||
perror("Null pointer");
|
perror("Null pointer");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
new = (cfile_variable_t*) xmalloc(sizeof(cfile_variable_t));
|
new = (cfile_variable_t*) xmalloc(sizeof(cfile_variable_t));
|
||||||
memset(new, 0, sizeof(cfile_variable_t));
|
memset(new, 0, sizeof(cfile_variable_t));
|
||||||
|
|
||||||
if (NULL == aList->head)
|
if (NULL == aList->head)
|
||||||
{
|
{
|
||||||
aList->head = new;
|
aList->head = new;
|
||||||
aList->current = new;
|
aList->current = new;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aList->current->next = new;
|
aList->current->next = new;
|
||||||
aList->current = new;
|
aList->current = new;
|
||||||
}
|
}
|
||||||
++aList->amount;
|
++aList->amount;
|
||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
int8_t cfile_freeVariables(cfile_variableList_t *aVariable)
|
int8_t cfile_freeVariables(cfile_variableList_t *aVariable)
|
||||||
{
|
{
|
||||||
cfile_variable_t *work = NULL;
|
cfile_variable_t *work = NULL;
|
||||||
cfile_variable_t *next = NULL;
|
cfile_variable_t *next = NULL;
|
||||||
|
|
||||||
if (NULL == aVariable)
|
if (NULL == aVariable)
|
||||||
{
|
{
|
||||||
perror("Null pointer");
|
perror("Null pointer");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
work = aVariable->head;
|
work = aVariable->head;
|
||||||
|
|
||||||
while (work)
|
while (work)
|
||||||
{
|
{
|
||||||
next = work->next;
|
next = work->next;
|
||||||
free(work->dataType);
|
free(work->dataType);
|
||||||
free(work->name);
|
free(work->name);
|
||||||
free(work);
|
free(work);
|
||||||
work = next;
|
work = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
aVariable->amount = 0;
|
aVariable->amount = 0;
|
||||||
aVariable->head = NULL;
|
aVariable->head = NULL;
|
||||||
aVariable->current = NULL;
|
aVariable->current = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cfile_free(cfile_t *aCfile)
|
void cfile_free(cfile_t *aCfile)
|
||||||
{
|
{
|
||||||
cfile_freeVariables(&aCfile->variables);
|
cfile_freeVariables(&aCfile->variables);
|
||||||
cfunction_freeList(&aCfile->functions);
|
cfunction_freeList(&aCfile->functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cfile_print(cfile_t *aCfile)
|
void cfile_print(cfile_t *aCfile)
|
||||||
{
|
{
|
||||||
cfile_variable_t *work = NULL;
|
cfile_variable_t *work = NULL;
|
||||||
|
|
||||||
if (NULL == aCfile)
|
if (NULL == aCfile)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
work = aCfile->variables.head;
|
work = aCfile->variables.head;
|
||||||
|
|
||||||
while (work)
|
while (work)
|
||||||
{
|
{
|
||||||
printf("[ cva]%d:<%s> (%s) %s %s\n", work->type, work->prefix, work->dataType, work->name, work->array);
|
printf("[ cva]%d:<%s> (%s) %s %s\n", work->type, work->prefix, work->dataType, work->name, work->array);
|
||||||
work = work->next;
|
work = work->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
cfunction_printList(&aCfile->functions);
|
cfunction_printList(&aCfile->functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Checks if at least one function uses a variable parameter list
|
* @brief Checks if at least one function uses a variable parameter list
|
||||||
* @retval -2 Null pointer parameter
|
* @retval -2 Null pointer parameter
|
||||||
* @retval -1 Has no va_list
|
* @retval -1 Has no va_list
|
||||||
* @retval 0 At least on va_list
|
* @retval 0 At least on va_list
|
||||||
*/
|
*/
|
||||||
int8_t cfile_hasVaList(cfile_t *aFile)
|
int8_t cfile_hasVaList(cfile_t *aFile)
|
||||||
{
|
{
|
||||||
cfunction_t *function = aFile->functions.head;
|
cfunction_t *function = aFile->functions.head;
|
||||||
cfunction_parameterList_t *paraList = NULL;
|
cfunction_parameterList_t *paraList = NULL;
|
||||||
cfunction_parameter_t *parameter;
|
cfunction_parameter_t *parameter;
|
||||||
if (NULL == aFile)
|
if (NULL == aFile)
|
||||||
{
|
{
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
while(function)
|
while(function)
|
||||||
{
|
{
|
||||||
paraList = &function->parameter;
|
paraList = &function->parameter;
|
||||||
parameter = paraList->head;
|
parameter = paraList->head;
|
||||||
while(parameter)
|
while(parameter)
|
||||||
{
|
{
|
||||||
if (CPARAMETER_TYPE_VARIABLE == parameter->type)
|
if (CPARAMETER_TYPE_VARIABLE == parameter->type)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
parameter = parameter->next;
|
parameter = parameter->next;
|
||||||
}
|
}
|
||||||
function = function->next;
|
function = function->next;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Checks if at least one variable or function parameter is a pointer
|
* @brief Checks if at least one variable or function parameter is a pointer
|
||||||
* @retval -2 Null pointer parameter
|
* @retval -2 Null pointer parameter
|
||||||
* @retval -1 Has no pointer
|
* @retval -1 Has no pointer
|
||||||
* @retval 0 At least on pointer
|
* @retval 0 At least on pointer
|
||||||
*/
|
*/
|
||||||
int8_t cfile_hasPointerParameter(cfile_t *aFile)
|
int8_t cfile_hasPointerParameter(cfile_t *aFile)
|
||||||
{
|
{
|
||||||
cfunction_t *function = aFile->functions.head;
|
cfunction_t *function = aFile->functions.head;
|
||||||
cfunction_parameterList_t *paraList = NULL;
|
cfunction_parameterList_t *paraList = NULL;
|
||||||
cfunction_parameter_t *parameter;
|
cfunction_parameter_t *parameter;
|
||||||
if (NULL == aFile)
|
if (NULL == aFile)
|
||||||
{
|
{
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
while(function)
|
while(function)
|
||||||
{
|
{
|
||||||
paraList = &function->parameter;
|
paraList = &function->parameter;
|
||||||
parameter = paraList->head;
|
parameter = paraList->head;
|
||||||
while(parameter)
|
while(parameter)
|
||||||
{
|
{
|
||||||
if (NULL != strstr(parameter->dataType, "*") || NULL != parameter->array)
|
if (NULL != strstr(parameter->dataType, "*") || NULL != parameter->array)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
parameter = parameter->next;
|
parameter = parameter->next;
|
||||||
}
|
}
|
||||||
function = function->next;
|
function = function->next;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@@ -1,76 +1,76 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file cfile_if.h
|
* @file cfile_if.h
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 08.03.2017
|
* @date 08.03.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STUBSER_CFILE_IF_H_
|
#ifndef STUBSER_CFILE_IF_H_
|
||||||
#define STUBSER_CFILE_IF_H_
|
#define STUBSER_CFILE_IF_H_
|
||||||
|
|
||||||
#include "cfunction_if.h"
|
#include "cfunction_if.h"
|
||||||
|
|
||||||
#define CVARIABLE_CHECK_TYPE(var, type) (type == (var & type))
|
#define CVARIABLE_CHECK_TYPE(var, type) (type == (var & type))
|
||||||
#define CVARIABLE_SET_TYPE(var, type) do{\
|
#define CVARIABLE_SET_TYPE(var, type) do{\
|
||||||
var &= ~type; \
|
var &= ~type; \
|
||||||
var |= type; \
|
var |= type; \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
/*! @brief Type of variable definition for bit field usage */
|
/*! @brief Type of variable definition for bit field usage */
|
||||||
typedef enum _CFILE_VARIABLE_TYPE_T
|
typedef enum _CFILE_VARIABLE_TYPE_T
|
||||||
{
|
{
|
||||||
CVARIABLE_TYPE_UNDEF = 0, /*!< @brief undefined */
|
CVARIABLE_TYPE_UNDEF = 0, /*!< @brief undefined */
|
||||||
CVARIABLE_TYPE_REGULAR = 0x01, /*!< @brief Regular C variable definition */
|
CVARIABLE_TYPE_REGULAR = 0x01, /*!< @brief Regular C variable definition */
|
||||||
CVARIABLE_TYPE_STATIC = 0x02, /*!< @brief Static C variable definition */
|
CVARIABLE_TYPE_STATIC = 0x02, /*!< @brief Static C variable definition */
|
||||||
CVARIABLE_TYPE_EXTERN = 0x04, /*!< @brief External C variable definition */
|
CVARIABLE_TYPE_EXTERN = 0x04, /*!< @brief External C variable definition */
|
||||||
CVARIABLE_TYPE_FUPTR = 0x08, /*!< @brief Function pointer as variable */
|
CVARIABLE_TYPE_FUPTR = 0x08, /*!< @brief Function pointer as variable */
|
||||||
CVARIABLE_TYPE_CONST = 0x10, /*!< @brief Const C variable */
|
CVARIABLE_TYPE_CONST = 0x10, /*!< @brief Const C variable */
|
||||||
CVARIABLE_TYPE_LAST_ENUM
|
CVARIABLE_TYPE_LAST_ENUM
|
||||||
} cfile_variable_type_t;
|
} cfile_variable_type_t;
|
||||||
|
|
||||||
/*! @brief Parameter list node */
|
/*! @brief Parameter list node */
|
||||||
typedef struct _CFILE_VARIABLE_T
|
typedef struct _CFILE_VARIABLE_T
|
||||||
{
|
{
|
||||||
cfile_variable_type_t type;
|
cfile_variable_type_t type;
|
||||||
char* prefix; /*!< @brief variable prefix (e.g. static) */
|
char* prefix; /*!< @brief variable prefix (e.g. static) */
|
||||||
char* dataType; /*!< @brief data type */
|
char* dataType; /*!< @brief data type */
|
||||||
char* name; /*!< @brief name */
|
char* name; /*!< @brief name */
|
||||||
char* array; /*!< @brief array information (e.g. [10] or [DEF_MAX]) */
|
char* array; /*!< @brief array information (e.g. [10] or [DEF_MAX]) */
|
||||||
struct _CFILE_VARIABLE_T *next;
|
struct _CFILE_VARIABLE_T *next;
|
||||||
} cfile_variable_t;
|
} cfile_variable_t;
|
||||||
|
|
||||||
/*! @brief parameter array */
|
/*! @brief parameter array */
|
||||||
typedef struct _CFILE_VARIABLE_LIST_T
|
typedef struct _CFILE_VARIABLE_LIST_T
|
||||||
{
|
{
|
||||||
uint8_t amount;
|
uint8_t amount;
|
||||||
cfile_variable_t *head;
|
cfile_variable_t *head;
|
||||||
cfile_variable_t *current;
|
cfile_variable_t *current;
|
||||||
} cfile_variableList_t;
|
} cfile_variableList_t;
|
||||||
|
|
||||||
/*! @brief brief_description */
|
/*! @brief brief_description */
|
||||||
typedef struct _CFILE_T
|
typedef struct _CFILE_T
|
||||||
{
|
{
|
||||||
cfile_variableList_t variables; /*! @brief C variables */
|
cfile_variableList_t variables; /*! @brief C variables */
|
||||||
cfunction_list_t functions; /*!< @brief C functions */
|
cfunction_list_t functions; /*!< @brief C functions */
|
||||||
} cfile_t;
|
} cfile_t;
|
||||||
|
|
||||||
#define CFILE_T_DEFAULT {\
|
#define CFILE_T_DEFAULT {\
|
||||||
.variables.amount = 0, \
|
.variables.amount = 0, \
|
||||||
.variables.head = NULL, \
|
.variables.head = NULL, \
|
||||||
.variables.current = NULL, \
|
.variables.current = NULL, \
|
||||||
.functions = CFUNCTION_LIST_DEFAULT }
|
.functions = CFUNCTION_LIST_DEFAULT }
|
||||||
|
|
||||||
cfile_variable_t* cfile_newVariable(cfile_variableList_t *aList);
|
cfile_variable_t* cfile_newVariable(cfile_variableList_t *aList);
|
||||||
int8_t cfile_freeVariables(cfile_variableList_t *aVariable);
|
int8_t cfile_freeVariables(cfile_variableList_t *aVariable);
|
||||||
void cfile_free(cfile_t *aCfile);
|
void cfile_free(cfile_t *aCfile);
|
||||||
void cfile_print(cfile_t *aCfile);
|
void cfile_print(cfile_t *aCfile);
|
||||||
int8_t cfile_hasVaList(cfile_t *aFile);
|
int8_t cfile_hasVaList(cfile_t *aFile);
|
||||||
int8_t cfile_hasPointerParameter(cfile_t *aFile);
|
int8_t cfile_hasPointerParameter(cfile_t *aFile);
|
||||||
|
|
||||||
#endif /* STUBSER_CFILE_IF_H_ */
|
#endif /* STUBSER_CFILE_IF_H_ */
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,21 +1,21 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file cfile_parser_if.h
|
* @file cfile_parser_if.h
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 28.02.2017
|
* @date 28.02.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STUBSER_CFILE_PARSER_IF_H_
|
#ifndef STUBSER_CFILE_PARSER_IF_H_
|
||||||
#define STUBSER_CFILE_PARSER_IF_H_
|
#define STUBSER_CFILE_PARSER_IF_H_
|
||||||
|
|
||||||
#define CPARS_ELEMENT_CONST "const"
|
#define CPARS_ELEMENT_CONST "const"
|
||||||
|
|
||||||
uint32_t cfile_parser(char *aPath, cfile_t *aList);
|
uint32_t cfile_parser(char *aPath, cfile_t *aList);
|
||||||
|
|
||||||
#endif /* STUBSER_CFILE_PARSER_IF_H_ */
|
#endif /* STUBSER_CFILE_PARSER_IF_H_ */
|
||||||
|
@@ -1,57 +1,57 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file cfile_parser_loc.h
|
* @file cfile_parser_loc.h
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 28.02.2017
|
* @date 28.02.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
#ifndef STUBSER_CFILE_PARSER_LOC_H_
|
#ifndef STUBSER_CFILE_PARSER_LOC_H_
|
||||||
#define STUBSER_CFILE_PARSER_LOC_H_
|
#define STUBSER_CFILE_PARSER_LOC_H_
|
||||||
|
|
||||||
#define CFILE_PARSER_MAX_REGEX_MATCHING_GROUPS 10
|
#define CFILE_PARSER_MAX_REGEX_MATCHING_GROUPS 10
|
||||||
|
|
||||||
#define CPARS_LINE_ENDING "\r\n"
|
#define CPARS_LINE_ENDING "\r\n"
|
||||||
#define CPARS_COMMENT_INLINE "//"
|
#define CPARS_COMMENT_INLINE "//"
|
||||||
#define CPARS_COMMENT_BLOCK_START "/*"
|
#define CPARS_COMMENT_BLOCK_START "/*"
|
||||||
#define CPARS_COMMENT_BLOCK_END "*/"
|
#define CPARS_COMMENT_BLOCK_END "*/"
|
||||||
|
|
||||||
#define CPARS_PROTOTYPE_END_C ';'
|
#define CPARS_PROTOTYPE_END_C ';'
|
||||||
#define CPARS_PREFIX_STATIC_S "static"
|
#define CPARS_PREFIX_STATIC_S "static"
|
||||||
#define CPARS_PREFIX_STATIC2_S "STATIC"
|
#define CPARS_PREFIX_STATIC2_S "STATIC"
|
||||||
#define CPARS_PREFIX_EXTERN_S "extern"
|
#define CPARS_PREFIX_EXTERN_S "extern"
|
||||||
|
|
||||||
#define CPARS_EXPRESSION_BASE "^[[:blank:]]*([ _\\*[:alnum:]]*[[:blank:]]+\\**)([_\\*[:alnum:]]+)"
|
#define CPARS_EXPRESSION_BASE "^[[:blank:]]*([ _\\*[:alnum:]]*[[:blank:]]+\\**)([_\\*[:alnum:]]+)"
|
||||||
#define CPARS_REGEX_FUNCTIONPOINTER "^[[:blank:]]*([ _\\*[:alnum:]]* +\\**)\\(([_\\*[:alnum:]]+)\\)(\\([^\\)]*\\))"
|
#define CPARS_REGEX_FUNCTIONPOINTER "^[[:blank:]]*([ _\\*[:alnum:]]* +\\**)\\(([_\\*[:alnum:]]+)\\)(\\([^\\)]*\\))"
|
||||||
|
|
||||||
#define FUNCTION_BASE CPARS_EXPRESSION_BASE "[[:blank:]]*\\([[:blank:]]*"
|
#define FUNCTION_BASE CPARS_EXPRESSION_BASE "[[:blank:]]*\\([[:blank:]]*"
|
||||||
#define CPARS_REGEX_FUNCTION FUNCTION_BASE "(.*)\\)[[:blank:]\\{\\};]+[[:blank:]]*"
|
#define CPARS_REGEX_FUNCTION FUNCTION_BASE "(.*)\\)[[:blank:]\\{\\};]+[[:blank:]]*"
|
||||||
#define CPARS_REGEX_VARIABLE CPARS_EXPRESSION_BASE "[[:blank:]]*(\\[*[^;=,]*)[[:blank:]]*(\\[*[^;=]*[;=])"
|
#define CPARS_REGEX_VARIABLE CPARS_EXPRESSION_BASE "[[:blank:]]*(\\[*[^;=,]*)[[:blank:]]*(\\[*[^;=]*[;=])"
|
||||||
#define CPARS_REGEX_PARAMETER CPARS_EXPRESSION_BASE "[[:blank:]]*(\\[*[^;=]*)"
|
#define CPARS_REGEX_PARAMETER CPARS_EXPRESSION_BASE "[[:blank:]]*(\\[*[^;=]*)"
|
||||||
#define CPARS_STRCMP_PARAMETER_VARIABLE "..."
|
#define CPARS_STRCMP_PARAMETER_VARIABLE "..."
|
||||||
#define CPARS_REGEX_PARAMETER_FUPTR_SEPA "\\([^\\,)]*(,)" // function pointer parameter separation
|
#define CPARS_REGEX_PARAMETER_FUPTR_SEPA "\\([^\\,)]*(,)" // function pointer parameter separation
|
||||||
#define CPARS_REGEX_PREFIX "("CPARS_PREFIX_EXTERN_S"|EXTERN|"CPARS_PREFIX_STATIC_S"|STATIC|volatile|near|far)[[:blank:]]*(.*)"
|
#define CPARS_REGEX_PREFIX "("CPARS_PREFIX_EXTERN_S"|EXTERN|"CPARS_PREFIX_STATIC_S"|STATIC|volatile|near|far)[[:blank:]]*(.*)"
|
||||||
|
|
||||||
#define CPARS_EXPRESSION_START "^[[:blank:]]*([A-Za-z\\_][\\_\\*[:alnum:]]*)"
|
#define CPARS_EXPRESSION_START "^[[:blank:]]*([A-Za-z\\_][\\_\\*[:alnum:]]*)"
|
||||||
#define CPARS_EXPRESSION_END "[[:blank:]]*([\\};]+)"
|
#define CPARS_EXPRESSION_END "[[:blank:]]*([\\};]+)"
|
||||||
|
|
||||||
#define CPARS_WARNING_START " W-> "
|
#define CPARS_WARNING_START " W-> "
|
||||||
|
|
||||||
#define CFILE_PARSER_IS_MATCHGROUP_FUNCTION(matchGroup) (XREGEX_IS_MATCHGROUP(matchGroup, 1) && XREGEX_IS_MATCHGROUP(matchGroup, 2))
|
#define CFILE_PARSER_IS_MATCHGROUP_FUNCTION(matchGroup) (XREGEX_IS_MATCHGROUP(matchGroup, 1) && XREGEX_IS_MATCHGROUP(matchGroup, 2))
|
||||||
|
|
||||||
/*! @brief Type of function definition */
|
/*! @brief Type of function definition */
|
||||||
typedef enum _CELEMENT_TYPE_T
|
typedef enum _CELEMENT_TYPE_T
|
||||||
{
|
{
|
||||||
CELEMENT_TYPE_UNDEF = 0, /*!< @brief undefined */
|
CELEMENT_TYPE_UNDEF = 0, /*!< @brief undefined */
|
||||||
CELEMENT_TYPE_INCLUDE = 1, /*!< @brief C #include */
|
CELEMENT_TYPE_INCLUDE = 1, /*!< @brief C #include */
|
||||||
CELEMENT_TYPE_DEFINE = 2, /*!< @brief C #define */
|
CELEMENT_TYPE_DEFINE = 2, /*!< @brief C #define */
|
||||||
CELEMENT_TYPE_VARIABLE = 3, /*!< @brief Prototype C variable definition */
|
CELEMENT_TYPE_VARIABLE = 3, /*!< @brief Prototype C variable definition */
|
||||||
CELEMENT_TYPE_FUNCTION = 4, /*!< @brief Prototype C function definition */
|
CELEMENT_TYPE_FUNCTION = 4, /*!< @brief Prototype C function definition */
|
||||||
CELEMENT_TYPE_LAST_ENUM
|
CELEMENT_TYPE_LAST_ENUM
|
||||||
} celement_type_t;
|
} celement_type_t;
|
||||||
|
|
||||||
#endif /* STUBSER_CFILE_PARSER_LOC_H_ */
|
#endif /* STUBSER_CFILE_PARSER_LOC_H_ */
|
||||||
|
@@ -1,152 +1,152 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file cfile_parser_worker.c
|
* @file cfile_parser_worker.c
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 09.03.2017
|
* @date 09.03.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "xtypes.h"
|
#include "xtypes.h"
|
||||||
#include "xregex.h"
|
#include "xregex.h"
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "cfile_parser_loc.h"
|
#include "cfile_parser_loc.h"
|
||||||
#include "cfile_parser_worker_loc.h"
|
#include "cfile_parser_worker_loc.h"
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief String block detection using regular expressions
|
* @brief String block detection using regular expressions
|
||||||
* @attention Recursive function (calls itself to find block end on same line)
|
* @attention Recursive function (calls itself to find block end on same line)
|
||||||
* @param [out] **aOutput Matched group content across multiple calls (will be allocated as needed)
|
* @param [out] **aOutput Matched group content across multiple calls (will be allocated as needed)
|
||||||
* @param [in,out] **aInput Char pointer to search string (will be moved to position after match)
|
* @param [in,out] **aInput Char pointer to search string (will be moved to position after match)
|
||||||
* @param [in] *aStart Regular expression defining block start
|
* @param [in] *aStart Regular expression defining block start
|
||||||
* @param [in] *aEnd Regular expression defining block end
|
* @param [in] *aEnd Regular expression defining block end
|
||||||
* @param [out] *aBlockDepth Current depth of parsing
|
* @param [out] *aBlockDepth Current depth of parsing
|
||||||
* @param [in] aMultiLevel false - starts within block are ignored
|
* @param [in] aMultiLevel false - starts within block are ignored
|
||||||
* @return Matched string and various information about the parsing
|
* @return Matched string and various information about the parsing
|
||||||
* @retval uint32_t amount of warnings during parser run
|
* @retval uint32_t amount of warnings during parser run
|
||||||
*
|
*
|
||||||
* @details
|
* @details
|
||||||
* - Parsing done when (match && 0 == aBlockDepth)
|
* - Parsing done when (match && 0 == aBlockDepth)
|
||||||
* - Orphan end markers are ignored and skipped.
|
* - Orphan end markers are ignored and skipped.
|
||||||
*/
|
*/
|
||||||
uint32_t regExWorker(char **aOutput, char **aInput, const regex_t *aStart, const regex_t *aEnd, uint8_t *aBlockDepth, bool aMultiLevel)
|
uint32_t regExWorker(char **aOutput, char **aInput, const regex_t *aStart, const regex_t *aEnd, uint8_t *aBlockDepth, bool aMultiLevel)
|
||||||
{
|
{
|
||||||
uint32_t warningCounter = 0;
|
uint32_t warningCounter = 0;
|
||||||
regmatch_t matchStart[2];
|
regmatch_t matchStart[2];
|
||||||
regmatch_t matchEnd[2];
|
regmatch_t matchEnd[2];
|
||||||
regmatch_t *match = NULL;
|
regmatch_t *match = NULL;
|
||||||
char *begin = NULL;
|
char *begin = NULL;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
|
|
||||||
if (!**aInput || NULL == *aInput)
|
if (!**aInput || NULL == *aInput)
|
||||||
{
|
{
|
||||||
if (*aBlockDepth)
|
if (*aBlockDepth)
|
||||||
{
|
{
|
||||||
xmallocStrlcat(aOutput, " ", 2);
|
xmallocStrlcat(aOutput, " ", 2);
|
||||||
}
|
}
|
||||||
*aInput = NULL;
|
*aInput = NULL;
|
||||||
goto regExWorker_end;
|
goto regExWorker_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
// start
|
// start
|
||||||
if (0 == regexec(aStart, *aInput, 2, matchStart, REG_NOTEOL) && XREGEX_IS_MATCHGROUP(matchStart, 1))
|
if (0 == regexec(aStart, *aInput, 2, matchStart, REG_NOTEOL) && XREGEX_IS_MATCHGROUP(matchStart, 1))
|
||||||
{
|
{
|
||||||
match = matchStart;
|
match = matchStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
// end < start
|
// end < start
|
||||||
if (0 == regexec(aEnd, *aInput, 2, matchEnd, REG_NOTEOL) && XREGEX_IS_MATCHGROUP(matchEnd, 1))
|
if (0 == regexec(aEnd, *aInput, 2, matchEnd, REG_NOTEOL) && XREGEX_IS_MATCHGROUP(matchEnd, 1))
|
||||||
{
|
{
|
||||||
if (match && match->rm_so > matchEnd[1].rm_so)
|
if (match && match->rm_so > matchEnd[1].rm_so)
|
||||||
{
|
{
|
||||||
match = matchEnd;
|
match = matchEnd;
|
||||||
}
|
}
|
||||||
else if (!match)
|
else if (!match)
|
||||||
{
|
{
|
||||||
match = matchEnd;
|
match = matchEnd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*aBlockDepth)
|
if (*aBlockDepth)
|
||||||
{
|
{
|
||||||
begin = *aInput;
|
begin = *aInput;
|
||||||
size = strlen(*aInput);
|
size = strlen(*aInput);
|
||||||
if (!match)
|
if (!match)
|
||||||
{
|
{
|
||||||
// complete line within block
|
// complete line within block
|
||||||
*aInput += strlen(*aInput);
|
*aInput += strlen(*aInput);
|
||||||
goto regExWorker_end;
|
goto regExWorker_end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
begin = NULL;
|
begin = NULL;
|
||||||
// no findings
|
// no findings
|
||||||
if (!match)
|
if (!match)
|
||||||
{
|
{
|
||||||
// skip remaining character within line without match
|
// skip remaining character within line without match
|
||||||
*aInput += strlen(*aInput);
|
*aInput += strlen(*aInput);
|
||||||
goto regExWorker_end;
|
goto regExWorker_end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match == matchStart)
|
if (match == matchStart)
|
||||||
{
|
{
|
||||||
if ((*aBlockDepth && aMultiLevel) || 0 == *aBlockDepth)
|
if ((*aBlockDepth && aMultiLevel) || 0 == *aBlockDepth)
|
||||||
{
|
{
|
||||||
DEBUG_LOG_APPEND(2, "[ CEs]");
|
DEBUG_LOG_APPEND(2, "[ CEs]");
|
||||||
++*aBlockDepth;
|
++*aBlockDepth;
|
||||||
size = XREGEX_SIZEOF_MATCHGROUP(match, 1);
|
size = XREGEX_SIZEOF_MATCHGROUP(match, 1);
|
||||||
//begin = *aInput + match[1].rm_eo; // don't include start marker in result
|
//begin = *aInput + match[1].rm_eo; // don't include start marker in result
|
||||||
begin = *aInput + match[1].rm_so; // include start marker in result
|
begin = *aInput + match[1].rm_so; // include start marker in result
|
||||||
*aInput += match[1].rm_eo;
|
*aInput += match[1].rm_eo;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// ignore starts within block
|
// ignore starts within block
|
||||||
size = match->rm_eo;
|
size = match->rm_eo;
|
||||||
*aInput += match->rm_eo;
|
*aInput += match->rm_eo;
|
||||||
}
|
}
|
||||||
goto regExWorker_end;
|
goto regExWorker_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match == matchEnd)
|
if (match == matchEnd)
|
||||||
{
|
{
|
||||||
DEBUG_LOG_APPEND(2, "[ CEe]");
|
DEBUG_LOG_APPEND(2, "[ CEe]");
|
||||||
//size = match[1].rm_so; // don't include end marker in result
|
//size = match[1].rm_so; // don't include end marker in result
|
||||||
size = match[1].rm_eo; // include end marker in result
|
size = match[1].rm_eo; // include end marker in result
|
||||||
*aInput += match[1].rm_eo;
|
*aInput += match[1].rm_eo;
|
||||||
if (0 < *aBlockDepth)
|
if (0 < *aBlockDepth)
|
||||||
{
|
{
|
||||||
--*aBlockDepth;
|
--*aBlockDepth;
|
||||||
}
|
}
|
||||||
// TODO orphan end markers
|
// TODO orphan end markers
|
||||||
// must be evaluated depending on expression
|
// must be evaluated depending on expression
|
||||||
// e.g. array[]={}; -> must have } and ;
|
// e.g. array[]={}; -> must have } and ;
|
||||||
// function{} -> must not have ;
|
// function{} -> must not have ;
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// // orphan end marker
|
// // orphan end marker
|
||||||
// ++warningCounter;
|
// ++warningCounter;
|
||||||
// }
|
// }
|
||||||
goto regExWorker_end;
|
goto regExWorker_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
regExWorker_end:
|
regExWorker_end:
|
||||||
|
|
||||||
if (begin)
|
if (begin)
|
||||||
{
|
{
|
||||||
xmallocStrlcat(aOutput, begin, size);
|
xmallocStrlcat(aOutput, begin, size);
|
||||||
if (*aBlockDepth)
|
if (*aBlockDepth)
|
||||||
{
|
{
|
||||||
warningCounter += regExWorker(aOutput, aInput, aStart, aEnd, aBlockDepth, aMultiLevel);
|
warningCounter += regExWorker(aOutput, aInput, aStart, aEnd, aBlockDepth, aMultiLevel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return warningCounter;
|
return warningCounter;
|
||||||
}
|
}
|
||||||
|
@@ -1,19 +1,19 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file cfile_parser_worker_loc.h
|
* @file cfile_parser_worker_loc.h
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 09.03.2017
|
* @date 09.03.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STUBSER_CFILE_PARSER_WORKER_LOC_H_
|
#ifndef STUBSER_CFILE_PARSER_WORKER_LOC_H_
|
||||||
#define STUBSER_CFILE_PARSER_WORKER_LOC_H_
|
#define STUBSER_CFILE_PARSER_WORKER_LOC_H_
|
||||||
|
|
||||||
uint32_t regExWorker(char **aOutput, char **aInput, const regex_t *aStart, const regex_t *aEnd, uint8_t *aBlockDepth, bool aMultiLevel);
|
uint32_t regExWorker(char **aOutput, char **aInput, const regex_t *aStart, const regex_t *aEnd, uint8_t *aBlockDepth, bool aMultiLevel);
|
||||||
|
|
||||||
#endif /* STUBSER_CFILE_PARSER_WORKER_LOC_H_ */
|
#endif /* STUBSER_CFILE_PARSER_WORKER_LOC_H_ */
|
||||||
|
@@ -1,172 +1,172 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file cfunction.c
|
* @file cfunction.c
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 28.02.2017
|
* @date 28.02.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "xtypes.h"
|
#include "xtypes.h"
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
#include "cfunction_if.h"
|
#include "cfunction_if.h"
|
||||||
|
|
||||||
cfunction_t* cfunction_addNewFunction(cfunction_list_t *aList)
|
cfunction_t* cfunction_addNewFunction(cfunction_list_t *aList)
|
||||||
{
|
{
|
||||||
cfunction_t *new = NULL;
|
cfunction_t *new = NULL;
|
||||||
|
|
||||||
if (NULL == aList)
|
if (NULL == aList)
|
||||||
{
|
{
|
||||||
perror("Null pointer");
|
perror("Null pointer");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
new = (cfunction_t*) xmalloc(sizeof(cfunction_t));
|
new = (cfunction_t*) xmalloc(sizeof(cfunction_t));
|
||||||
memset(new, 0, sizeof(cfunction_t));
|
memset(new, 0, sizeof(cfunction_t));
|
||||||
|
|
||||||
if (NULL == aList->head)
|
if (NULL == aList->head)
|
||||||
{
|
{
|
||||||
aList->amount = 0;
|
aList->amount = 0;
|
||||||
aList->head = new;
|
aList->head = new;
|
||||||
aList->current = new;
|
aList->current = new;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aList->current->next = new;
|
aList->current->next = new;
|
||||||
aList->current = new;
|
aList->current = new;
|
||||||
}
|
}
|
||||||
++aList->amount;
|
++aList->amount;
|
||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
cfunction_parameter_t* cfunction_newParameter(cfunction_parameterList_t *aList)
|
cfunction_parameter_t* cfunction_newParameter(cfunction_parameterList_t *aList)
|
||||||
{
|
{
|
||||||
cfunction_parameter_t *new = NULL;
|
cfunction_parameter_t *new = NULL;
|
||||||
|
|
||||||
if (NULL == aList)
|
if (NULL == aList)
|
||||||
{
|
{
|
||||||
perror("Null pointer");
|
perror("Null pointer");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
new = (cfunction_parameter_t*) xmalloc(sizeof(cfunction_parameter_t));
|
new = (cfunction_parameter_t*) xmalloc(sizeof(cfunction_parameter_t));
|
||||||
memset(new, 0, sizeof(cfunction_parameter_t));
|
memset(new, 0, sizeof(cfunction_parameter_t));
|
||||||
|
|
||||||
if (NULL == aList->head)
|
if (NULL == aList->head)
|
||||||
{
|
{
|
||||||
aList->amount = 0;
|
aList->amount = 0;
|
||||||
aList->head = new;
|
aList->head = new;
|
||||||
aList->current = new;
|
aList->current = new;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aList->current->next = new;
|
aList->current->next = new;
|
||||||
aList->current = new;
|
aList->current = new;
|
||||||
}
|
}
|
||||||
++aList->amount;
|
++aList->amount;
|
||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC int8_t cfunction_freeParameter(struct _CFUNCTION_PARAMETER_LIST_T *aParameter)
|
STATIC int8_t cfunction_freeParameter(struct _CFUNCTION_PARAMETER_LIST_T *aParameter)
|
||||||
{
|
{
|
||||||
cfunction_parameter_t *work = NULL;
|
cfunction_parameter_t *work = NULL;
|
||||||
cfunction_parameter_t *next = NULL;
|
cfunction_parameter_t *next = NULL;
|
||||||
|
|
||||||
if (NULL == aParameter)
|
if (NULL == aParameter)
|
||||||
{
|
{
|
||||||
perror("Null pointer");
|
perror("Null pointer");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
work = aParameter->head;
|
work = aParameter->head;
|
||||||
|
|
||||||
while (work)
|
while (work)
|
||||||
{
|
{
|
||||||
next = work->next;
|
next = work->next;
|
||||||
free(work->dataType);
|
free(work->dataType);
|
||||||
free(work->name);
|
free(work->name);
|
||||||
free(work);
|
free(work);
|
||||||
work = next;
|
work = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
aParameter->head = NULL;
|
aParameter->head = NULL;
|
||||||
aParameter->current = NULL;
|
aParameter->current = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int8_t cfunction_freeFunction(cfunction_t **aFunction)
|
int8_t cfunction_freeFunction(cfunction_t **aFunction)
|
||||||
{
|
{
|
||||||
cfunction_t *work = *aFunction;
|
cfunction_t *work = *aFunction;
|
||||||
|
|
||||||
if (NULL == aFunction || NULL == *aFunction)
|
if (NULL == aFunction || NULL == *aFunction)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(work->prefix);
|
free(work->prefix);
|
||||||
free(work->dataType);
|
free(work->dataType);
|
||||||
free(work->name);
|
free(work->name);
|
||||||
cfunction_freeParameter(&work->parameter);
|
cfunction_freeParameter(&work->parameter);
|
||||||
free(work);
|
free(work);
|
||||||
|
|
||||||
*aFunction = NULL;
|
*aFunction = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int8_t cfunction_freeList(cfunction_list_t *aList)
|
int8_t cfunction_freeList(cfunction_list_t *aList)
|
||||||
{
|
{
|
||||||
cfunction_t *work = NULL;
|
cfunction_t *work = NULL;
|
||||||
cfunction_t *next = NULL;
|
cfunction_t *next = NULL;
|
||||||
|
|
||||||
if (NULL == aList)
|
if (NULL == aList)
|
||||||
{
|
{
|
||||||
perror("Null pointer");
|
perror("Null pointer");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
work = aList->head;
|
work = aList->head;
|
||||||
|
|
||||||
while (work)
|
while (work)
|
||||||
{
|
{
|
||||||
next = work->next;
|
next = work->next;
|
||||||
cfunction_freeFunction(&work);
|
cfunction_freeFunction(&work);
|
||||||
work = next;
|
work = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
aList->head = NULL;
|
aList->head = NULL;
|
||||||
aList->current = NULL;
|
aList->current = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cfunction_printList(cfunction_list_t *aList)
|
void cfunction_printList(cfunction_list_t *aList)
|
||||||
{
|
{
|
||||||
cfunction_t *work = aList->head;
|
cfunction_t *work = aList->head;
|
||||||
cfunction_parameter_t *param = NULL;
|
cfunction_parameter_t *param = NULL;
|
||||||
|
|
||||||
if (NULL == aList)
|
if (NULL == aList)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (work)
|
while (work)
|
||||||
{
|
{
|
||||||
param = work->parameter.head;
|
param = work->parameter.head;
|
||||||
printf("[ cfu]%d:<%s> (%s) %s [%d] ", work->type, work->prefix, work->dataType, work->name, work->parameter.amount);
|
printf("[ cfu]%d:<%s> (%s) %s [%d] ", work->type, work->prefix, work->dataType, work->name, work->parameter.amount);
|
||||||
while (param)
|
while (param)
|
||||||
{
|
{
|
||||||
printf("%d(%s)%s%s%s", param->type, param->dataType, param->name, (param->array ? param->array : ""), (param->next ? "," : ""));
|
printf("%d(%s)%s%s%s", param->type, param->dataType, param->name, (param->array ? param->array : ""), (param->next ? "," : ""));
|
||||||
param = param->next;
|
param = param->next;
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
work = work->next;
|
work = work->next;
|
||||||
}
|
}
|
||||||
printf(" %d Functions\n", aList->amount);
|
printf(" %d Functions\n", aList->amount);
|
||||||
}
|
}
|
||||||
|
@@ -1,86 +1,86 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file cfunction_if.h
|
* @file cfunction_if.h
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 28.02.2017
|
* @date 28.02.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STUBSER_CFUNCTION_IF_H_
|
#ifndef STUBSER_CFUNCTION_IF_H_
|
||||||
#define STUBSER_CFUNCTION_IF_H_
|
#define STUBSER_CFUNCTION_IF_H_
|
||||||
|
|
||||||
/*! @brief Type of function definition */
|
/*! @brief Type of function definition */
|
||||||
typedef enum _CFUNCTION_TYPE_T
|
typedef enum _CFUNCTION_TYPE_T
|
||||||
{
|
{
|
||||||
CFUNCTION_TYPE_UNDEF = 0, /*!< @brief undefined */
|
CFUNCTION_TYPE_UNDEF = 0, /*!< @brief undefined */
|
||||||
CFUNCTION_TYPE_REGULAR = 1, /*!< @brief Regular C function definition */
|
CFUNCTION_TYPE_REGULAR = 1, /*!< @brief Regular C function definition */
|
||||||
CFUNCTION_TYPE_STATIC = 2, /*!< @brief Static C function definition */
|
CFUNCTION_TYPE_STATIC = 2, /*!< @brief Static C function definition */
|
||||||
CFUNCTION_TYPE_PROTO = 3, /*!< @brief Prototype C function definition */
|
CFUNCTION_TYPE_PROTO = 3, /*!< @brief Prototype C function definition */
|
||||||
CFUNCTION_TYPE_EXTERN = 4, /*!< @brief External C function definition */
|
CFUNCTION_TYPE_EXTERN = 4, /*!< @brief External C function definition */
|
||||||
CFUNCTION_TYPE_LAST_ENUM
|
CFUNCTION_TYPE_LAST_ENUM
|
||||||
} cfunction_type_t;
|
} cfunction_type_t;
|
||||||
|
|
||||||
/*! @brief Type of function definition */
|
/*! @brief Type of function definition */
|
||||||
typedef enum _CPARAMETER_TYPE_T
|
typedef enum _CPARAMETER_TYPE_T
|
||||||
{
|
{
|
||||||
CPARAMETER_TYPE_UNDEF = 0, /*!< @brief undefined */
|
CPARAMETER_TYPE_UNDEF = 0, /*!< @brief undefined */
|
||||||
CPARAMETER_TYPE_REGULAR = 1, /*!< @brief Regular C function parameter */
|
CPARAMETER_TYPE_REGULAR = 1, /*!< @brief Regular C function parameter */
|
||||||
CPARAMETER_TYPE_FUNCPTR = 2, /*!< @brief Function pointer as parameter */
|
CPARAMETER_TYPE_FUNCPTR = 2, /*!< @brief Function pointer as parameter */
|
||||||
CPARAMETER_TYPE_VARIABLE = 3, /*!< @brief Variable parameter list */
|
CPARAMETER_TYPE_VARIABLE = 3, /*!< @brief Variable parameter list */
|
||||||
CPARAMETER_TYPE_LAST_ENUM
|
CPARAMETER_TYPE_LAST_ENUM
|
||||||
} cparameter_type_t;
|
} cparameter_type_t;
|
||||||
|
|
||||||
/*! @brief Parameter list node */
|
/*! @brief Parameter list node */
|
||||||
typedef struct _CFUNCTION_PARAMETER_T
|
typedef struct _CFUNCTION_PARAMETER_T
|
||||||
{
|
{
|
||||||
cparameter_type_t type; /*!< @brief Parameter type */
|
cparameter_type_t type; /*!< @brief Parameter type */
|
||||||
char* dataType; /*!< @brief data type */
|
char* dataType; /*!< @brief data type */
|
||||||
char* name; /*!< @brief name */
|
char* name; /*!< @brief name */
|
||||||
char* array; /*!< @brief array information (e.g. [10] or [DEF_MAX]) */
|
char* array; /*!< @brief array information (e.g. [10] or [DEF_MAX]) */
|
||||||
struct _CFUNCTION_PARAMETER_T *next;
|
struct _CFUNCTION_PARAMETER_T *next;
|
||||||
} cfunction_parameter_t;
|
} cfunction_parameter_t;
|
||||||
|
|
||||||
/*! @brief parameter array */
|
/*! @brief parameter array */
|
||||||
typedef struct _CFUNCTION_PARAMETER_LIST_T
|
typedef struct _CFUNCTION_PARAMETER_LIST_T
|
||||||
{
|
{
|
||||||
uint8_t amount;
|
uint8_t amount;
|
||||||
cfunction_parameter_t *head;
|
cfunction_parameter_t *head;
|
||||||
cfunction_parameter_t *current;
|
cfunction_parameter_t *current;
|
||||||
} cfunction_parameterList_t;
|
} cfunction_parameterList_t;
|
||||||
|
|
||||||
/*! @brief brief_description */
|
/*! @brief brief_description */
|
||||||
typedef struct _CFUNCTION_T
|
typedef struct _CFUNCTION_T
|
||||||
{
|
{
|
||||||
cfunction_type_t type;
|
cfunction_type_t type;
|
||||||
char *prefix; /*!< @brief prefix like static or extern */
|
char *prefix; /*!< @brief prefix like static or extern */
|
||||||
char *dataType; /*!< @brief return type */
|
char *dataType; /*!< @brief return type */
|
||||||
char *name; /*!< @brief name */
|
char *name; /*!< @brief name */
|
||||||
cfunction_parameterList_t parameter;/*!< @brief parameter array */
|
cfunction_parameterList_t parameter;/*!< @brief parameter array */
|
||||||
struct _CFUNCTION_T *next;
|
struct _CFUNCTION_T *next;
|
||||||
} cfunction_t;
|
} cfunction_t;
|
||||||
|
|
||||||
/*! @brief Dynamic function list */
|
/*! @brief Dynamic function list */
|
||||||
typedef struct _CFUNCTION_LIST_T
|
typedef struct _CFUNCTION_LIST_T
|
||||||
{
|
{
|
||||||
uint16_t amount;
|
uint16_t amount;
|
||||||
cfunction_t *head;
|
cfunction_t *head;
|
||||||
cfunction_t *current;
|
cfunction_t *current;
|
||||||
} cfunction_list_t;
|
} cfunction_list_t;
|
||||||
|
|
||||||
#define CFUNCTION_LIST_DEFAULT {\
|
#define CFUNCTION_LIST_DEFAULT {\
|
||||||
.amount = 0, \
|
.amount = 0, \
|
||||||
.head = NULL, \
|
.head = NULL, \
|
||||||
.current = NULL }
|
.current = NULL }
|
||||||
|
|
||||||
cfunction_t* cfunction_addNewFunction(cfunction_list_t *aList);
|
cfunction_t* cfunction_addNewFunction(cfunction_list_t *aList);
|
||||||
cfunction_parameter_t* cfunction_newParameter(cfunction_parameterList_t *aList);
|
cfunction_parameter_t* cfunction_newParameter(cfunction_parameterList_t *aList);
|
||||||
int8_t cfunction_freeFunction(cfunction_t **aFunction);
|
int8_t cfunction_freeFunction(cfunction_t **aFunction);
|
||||||
int8_t cfunction_freeList(cfunction_list_t *aList);
|
int8_t cfunction_freeList(cfunction_list_t *aList);
|
||||||
void cfunction_printList(cfunction_list_t *aList);
|
void cfunction_printList(cfunction_list_t *aList);
|
||||||
|
|
||||||
#endif /* STUBSER_CFUNCTION_IF_H_ */
|
#endif /* STUBSER_CFUNCTION_IF_H_ */
|
||||||
|
@@ -1,19 +1,19 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file stubser_if.h
|
* @file stubser_if.h
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 27.02.2017
|
* @date 27.02.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STUBSER_STUBSER_IF_H_
|
#ifndef STUBSER_STUBSER_IF_H_
|
||||||
#define STUBSER_STUBSER_IF_H_
|
#define STUBSER_STUBSER_IF_H_
|
||||||
|
|
||||||
int stubser_createStub(char *path, char* aNoSuffix, char *aOutput);
|
int stubser_createStub(char *path, char* aNoSuffix, char *aOutput);
|
||||||
|
|
||||||
#endif /* STUBSER_STUBSER_IF_H_ */
|
#endif /* STUBSER_STUBSER_IF_H_ */
|
||||||
|
@@ -1,76 +1,76 @@
|
|||||||
/*!
|
/*!
|
||||||
* @file stubser_loc.h
|
* @file stubser_loc.h
|
||||||
* @brief
|
* @brief
|
||||||
* @details
|
* @details
|
||||||
* Project: \n
|
* Project: \n
|
||||||
* Subsystem: \n
|
* Subsystem: \n
|
||||||
* Module: \n
|
* Module: \n
|
||||||
* Code: GNU-C\n
|
* Code: GNU-C\n
|
||||||
*
|
*
|
||||||
* @date 04.03.2017
|
* @date 04.03.2017
|
||||||
* @author Martin Winkler
|
* @author Martin Winkler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STUBSER_STUBSER_LOC_H_
|
#ifndef STUBSER_STUBSER_LOC_H_
|
||||||
#define STUBSER_STUBSER_LOC_H_
|
#define STUBSER_STUBSER_LOC_H_
|
||||||
|
|
||||||
#define NEWLINES "\r\n"
|
#define NEWLINES "\r\n"
|
||||||
#define NEWLINE(output) fputs(NEWLINES, output)
|
#define NEWLINE(output) fputs(NEWLINES, output)
|
||||||
#define NCHECK(string) (NULL == string ? "" : string)
|
#define NCHECK(string) (NULL == string ? "" : string)
|
||||||
|
|
||||||
// Maximum amount of instances within test subject functions
|
// Maximum amount of instances within test subject functions
|
||||||
#define STUB_INSTANCES_AMOUNT 32
|
#define STUB_INSTANCES_AMOUNT 32
|
||||||
|
|
||||||
#define STUB_START_S1 "// ---------------------------------------------->" NEWLINES \
|
#define STUB_START_S1 "// ---------------------------------------------->" NEWLINES \
|
||||||
"/* Start of stub %s() */"
|
"/* Start of stub %s() */"
|
||||||
#define STUB_END_S1 "/* End of stub %s() */" NEWLINES \
|
#define STUB_END_S1 "/* End of stub %s() */" NEWLINES \
|
||||||
"// ----------------------------------------------<%s"
|
"// ----------------------------------------------<%s"
|
||||||
|
|
||||||
#define STUBINSTANCE_AMOUNT_S1 "STUB_INSTANCES_AMOUNT_%s" //STUB_INSTANCES_AMOUNT_modulfunction_1
|
#define STUBINSTANCE_AMOUNT_S1 "STUB_INSTANCES_AMOUNT_%s" //STUB_INSTANCES_AMOUNT_modulfunction_1
|
||||||
#define STUBPARAMETER_TYPEDEF_S1 "stubparameter_t_%s" // stubparameter_t_modulfunction_1
|
#define STUBPARAMETER_TYPEDEF_S1 "stubparameter_t_%s" // stubparameter_t_modulfunction_1
|
||||||
#define STUBPARAMETER_STRUCT_S1 "stubparameter_%s" // stubparameter_modulfunction_1
|
#define STUBPARAMETER_STRUCT_S1 "stubparameter_%s" // stubparameter_modulfunction_1
|
||||||
#define STUBPARAMETER_PARAM_S1 "parameter_%c" // "stubparameter_modulfunction_1".parameter_a
|
#define STUBPARAMETER_PARAM_S1 "parameter_%c" // "stubparameter_modulfunction_1".parameter_a
|
||||||
#define STUBPARAMETER_CALLTEST_S "stubCallTest"
|
#define STUBPARAMETER_CALLTEST_S "stubCallTest"
|
||||||
#define STUBPARAMETER_POINTERHANDLING_S "stubPointerHandling"
|
#define STUBPARAMETER_POINTERHANDLING_S "stubPointerHandling"
|
||||||
#define STUBPARAMETER_POINTERHANDLING_ENUM_S "stub_parameter_pointer_handling_t"
|
#define STUBPARAMETER_POINTERHANDLING_ENUM_S "stub_parameter_pointer_handling_t"
|
||||||
#define STUBPARAMETER_POINTERHANDLING_ADDRESS_S "STUB_PARAMETER_POINTER_HANDLING_ADDRESS"
|
#define STUBPARAMETER_POINTERHANDLING_ADDRESS_S "STUB_PARAMETER_POINTER_HANDLING_ADDRESS"
|
||||||
#define STUBPARAMETER_POINTERHANDLING_CONTENT_S "STUB_PARAMETER_POINTER_HANDLING_CONTENT"
|
#define STUBPARAMETER_POINTERHANDLING_CONTENT_S "STUB_PARAMETER_POINTER_HANDLING_CONTENT"
|
||||||
#define STUBPARAMETER_POINTERHANDLING_INJECT_S "STUB_PARAMETER_POINTER_HANDLING_INJECT"
|
#define STUBPARAMETER_POINTERHANDLING_INJECT_S "STUB_PARAMETER_POINTER_HANDLING_INJECT"
|
||||||
#define STUBPARAMETER_RETURN_S "returnValue" // "stubparameter_modulfunction_1".returnValue
|
#define STUBPARAMETER_RETURN_S "returnValue" // "stubparameter_modulfunction_1".returnValue
|
||||||
#define STUBINSTANCE_S1 "stubInstance_%s" // stubInstance_modulfunction_1
|
#define STUBINSTANCE_S1 "stubInstance_%s" // stubInstance_modulfunction_1
|
||||||
#define STUBINSTANCE_DATATYPE_S "uint8_t"
|
#define STUBINSTANCE_DATATYPE_S "uint8_t"
|
||||||
#define STUBINIT_PARAM_INSTANCE_S "aInstance"
|
#define STUBINIT_PARAM_INSTANCE_S "aInstance"
|
||||||
#define STUBINIT_PARAM_CALLTEST_S "aStubCallTest"
|
#define STUBINIT_PARAM_CALLTEST_S "aStubCallTest"
|
||||||
#define STUBINIT_PARAM_PARAMETER_S1 "aParameter_%c" // aParameter_a
|
#define STUBINIT_PARAM_PARAMETER_S1 "aParameter_%c" // aParameter_a
|
||||||
#define STUBINIT_PARAM_RETURN_S "aReturnValue"
|
#define STUBINIT_PARAM_RETURN_S "aReturnValue"
|
||||||
#define STUBINIT_PARAM_POINTERHANDLING_S "aPointerHandling"
|
#define STUBINIT_PARAM_POINTERHANDLING_S "aPointerHandling"
|
||||||
|
|
||||||
#define STUBDEFAULT_PARAMETER_INDEX_CHAR 'a'
|
#define STUBDEFAULT_PARAMETER_INDEX_CHAR 'a'
|
||||||
#define STUBDEFAULT_VALUE_FUNCTIONPOINTER_S "0xAA"
|
#define STUBDEFAULT_VALUE_FUNCTIONPOINTER_S "0xAA"
|
||||||
#define STUBDEFAULT_VALUE_POINTER_S1 "%s_testData" // stubfilename_testData
|
#define STUBDEFAULT_VALUE_POINTER_S1 "%s_testData" // stubfilename_testData
|
||||||
#define STUBDEFAULT_VALUE_POINTERSIZE_S "1"
|
#define STUBDEFAULT_VALUE_POINTERSIZE_S "1"
|
||||||
#define STUBDEFAULT_VALUE_VARIABLE_S "0xAA"
|
#define STUBDEFAULT_VALUE_VARIABLE_S "0xAA"
|
||||||
|
|
||||||
#define STUBFUNCTION_USER_INITEXPECTED_S1 "stub_%s_user_initExpected" // stub_testfunction_initExpected
|
#define STUBFUNCTION_USER_INITEXPECTED_S1 "stub_%s_user_initExpected" // stub_testfunction_initExpected
|
||||||
#define STUBFUNCTION_USER_INITGLOBALS_S1 "stub_%s_user_initGlobals" // stub_testfunction_initGlobals
|
#define STUBFUNCTION_USER_INITGLOBALS_S1 "stub_%s_user_initGlobals" // stub_testfunction_initGlobals
|
||||||
#define STUBFUNCTION_USER_CHECK_S1 "stub_%s_user_checkGlobals" // stub_testfunction_checkGlobals
|
#define STUBFUNCTION_USER_CHECK_S1 "stub_%s_user_checkGlobals" // stub_testfunction_checkGlobals
|
||||||
|
|
||||||
#define STUBFUNCTION_INITEXPECTED_S1 "stub_%s_initExpected" // stub_testfunction_initExpected
|
#define STUBFUNCTION_INITEXPECTED_S1 "stub_%s_initExpected" // stub_testfunction_initExpected
|
||||||
#define STUBFUNCTION_INITGLOBALS_S1 "stub_%s_initGlobals" // stub_testfunction_initGlobals
|
#define STUBFUNCTION_INITGLOBALS_S1 "stub_%s_initGlobals" // stub_testfunction_initGlobals
|
||||||
#define STUBFUNCTION_CHECK_S1 "stub_%s_checkGlobals" // stub_testfunction_checkGlobals
|
#define STUBFUNCTION_CHECK_S1 "stub_%s_checkGlobals" // stub_testfunction_checkGlobals
|
||||||
#define STUBFUNCTION_INIT_S1 "stub_%s_init" // stub_testfunction_init
|
#define STUBFUNCTION_INIT_S1 "stub_%s_init" // stub_testfunction_init
|
||||||
#define STUBVARIABLE_EXPECTED_S1 "%s_expected" // variable_expected
|
#define STUBVARIABLE_EXPECTED_S1 "%s_expected" // variable_expected
|
||||||
|
|
||||||
#define STUB_CONSOLE_GOBACK "\033[2K\r"
|
#define STUB_CONSOLE_GOBACK "\033[2K\r"
|
||||||
#define STUB_CONSOLE_RUN "[ ]"
|
#define STUB_CONSOLE_RUN "[ ]"
|
||||||
#define STUB_CONSOLE_OK "[ OK ]"
|
#define STUB_CONSOLE_OK "[ OK ]"
|
||||||
#define STUB_CONSOLE_WARN "[WARN]"
|
#define STUB_CONSOLE_WARN "[WARN]"
|
||||||
#define STUB_CONSOLE_FAIL "[FAIL]"
|
#define STUB_CONSOLE_FAIL "[FAIL]"
|
||||||
#define STUB_CONSOLE_PARSE_ERROR_S2 "\n" STUB_CONSOLE_WARN " %s parsing with %d warnings (check output manually)"
|
#define STUB_CONSOLE_PARSE_ERROR_S2 "\n" STUB_CONSOLE_WARN " %s parsing with %d warnings (check output manually)"
|
||||||
#define STUB_CONSOLE_PARSE_RUN_S1 STUB_CONSOLE_RUN " %s parsing..."
|
#define STUB_CONSOLE_PARSE_RUN_S1 STUB_CONSOLE_RUN " %s parsing..."
|
||||||
#define STUB_CONSOLE_PARSE_OK_S1 STUB_CONSOLE_GOBACK STUB_CONSOLE_OK " %s parsing..."
|
#define STUB_CONSOLE_PARSE_OK_S1 STUB_CONSOLE_GOBACK STUB_CONSOLE_OK " %s parsing..."
|
||||||
#define STUB_CONSOLE_CREATE_ERROR_S2 "...stub creation failed\n"STUB_CONSOLE_FAIL " %s creation failed (%d)\n"
|
#define STUB_CONSOLE_CREATE_ERROR_S2 "...stub creation failed\n"STUB_CONSOLE_FAIL " %s creation failed (%d)\n"
|
||||||
#define STUB_CONSOLE_CREATE_OK_S1 "...stub created > %s\n"
|
#define STUB_CONSOLE_CREATE_OK_S1 "...stub created > %s\n"
|
||||||
|
|
||||||
#define STUB_REGEX_STD_DATATYPE "(^|[^_[:alnum:]])([ui]+nt[0-9]{1,2}_t|char|uchar|word[12346]{2}|int[12346]{0,2}|byte)([^_[:alnum:]]|$)"
|
#define STUB_REGEX_STD_DATATYPE "(^|[^_[:alnum:]])([ui]+nt[0-9]{1,2}_t|char|uchar|word[12346]{2}|int[12346]{0,2}|byte)([^_[:alnum:]]|$)"
|
||||||
#endif /* STUBSER_STUBSER_LOC_H_ */
|
#endif /* STUBSER_STUBSER_LOC_H_ */
|
||||||
|
Reference in New Issue
Block a user