Index: /EcnlProtoTool/trunk/busybox/.cproject
===================================================================
--- /EcnlProtoTool/trunk/busybox/.cproject	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/.cproject	(revision 447)
@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+	<storageModule moduleId="org.eclipse.cdt.core.settings">
+		<cconfiguration id="com.renesas.cdt.managedbuild.gcc.rz.configuration.debug.lib.811193569">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.renesas.cdt.managedbuild.gcc.rz.configuration.debug.lib.811193569" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+				<externalSettings>
+					<externalSetting>
+						<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/busybox"/>
+						<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/busybox/Debug"/>
+						<entry flags="RESOLVED" kind="libraryFile" name="busybox" srcPrefixMapping="" srcRootPath=""/>
+					</externalSetting>
+				</externalSettings>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.ELF" 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.GmakeErrorParser" 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"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="com.renesas.cdt.managedbuild.core.toolchainInfo">
+				<option id="toolchain.id" value="gcc-arm-embedded"/>
+				<option id="toolchain.version" value="6.3.1.20170620"/>
+				<option id="toolchain.enable" value="false"/>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf *.lst *.lis *.lpp *.map" description="" id="com.renesas.cdt.managedbuild.gcc.rz.configuration.debug.lib.811193569" name="Debug" parent="com.renesas.cdt.managedbuild.gcc.rz.configuration.debug.lib">
+					<folderInfo id="com.renesas.cdt.managedbuild.gcc.rz.configuration.debug.lib.811193569." name="/" resourcePath="">
+						<toolChain id="com.renesas.cdt.managedbuild.gcc.rz.toolChain.debug.lib.900170870" name="GCC for Renesas RZ" superClass="com.renesas.cdt.managedbuild.gcc.rz.toolChain.debug.lib">
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.optimizationLevel.1823818412" name="Optimization Level" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.optimizationLevel" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.debug" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.messagelenght.119596776" name="Message length (-fmessage-length=0)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.messagelenght" useByScannerDiscovery="true" value="true" valueType="boolean"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.signedchar.404536599" name="'char' is signed (-fsigned-char)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.signedchar" useByScannerDiscovery="true" value="true" valueType="boolean"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.functionsection.346376845" name="Function sections (-ffunction-sections)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.functionsection" useByScannerDiscovery="true" value="true" valueType="boolean"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.datasections.529602262" name="Data sections (-fdata-sections)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.datasections" useByScannerDiscovery="true" value="true" valueType="boolean"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.1212218668" name="Debug level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level" useByScannerDiscovery="true"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.1491051397" name="Debug format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format" useByScannerDiscovery="true"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.1032109198" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" useByScannerDiscovery="false" value="GNU Tools for ARM Embedded Processors" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.89324408" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.architecture" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.arm" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.family.885929964" name="ARM family" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.family" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.mcpu.cortex-a9" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.instructionset.1891015944" name="Instruction set" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.instructionset" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.arm" valueType="enumerated"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix.160632008" name="Prefix" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix" useByScannerDiscovery="false" value="arm-none-eabi-" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.c.767599732" name="C compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.c" useByScannerDiscovery="false" value="gcc" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp.2012649499" name="C++ compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp" useByScannerDiscovery="false" value="g++" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar.1481245690" name="Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar" useByScannerDiscovery="false" value="ar" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy.466072484" name="Hex/Bin converter" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy" useByScannerDiscovery="false" value="objcopy" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump.391110864" name="Listing generator" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump" useByScannerDiscovery="false" value="objdump" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.size.1326500646" name="Size command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.size" useByScannerDiscovery="false" value="size" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.make.1416506880" name="Build command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.make" useByScannerDiscovery="false" value="make" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm.955325477" name="Remove command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm" useByScannerDiscovery="false" value="rm" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.1910230589" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.1525014650" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.createlibgen.809754758" name="Create libgen" superClass="com.renesas.cdt.managedbuild.gcc.rz.createlibgen" useByScannerDiscovery="false" value="false" valueType="boolean"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.architecture.1500186707" name="Architecture" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.architecture" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.arch.armv7-a" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.deviceName.992448103" name="Device name" superClass="com.renesas.cdt.managedbuild.gcc.rz.deviceName" useByScannerDiscovery="false" value="R7S721001" valueType="string"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.floatunit.1657411174" name="FPU Type" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.floatunit" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.vfpv3d16" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.floatabi.84061055" name="Float ABI" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.floatabi" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.hard" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.thumb.971532331" name="Thumb interwork (-mthumb-interwork)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.thumb" useByScannerDiscovery="true" value="true" valueType="boolean"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.endian.1891191190" name="Endianness" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.endian" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.endianness.little" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.warnStack.158915610" name="Warn if stack size exceeds the limit, in bytes (-Wstack-usage)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.warnStack" useByScannerDiscovery="false" value="100" valueType="string"/>
+							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.124867826" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
+							<builder buildPath="${workspace_loc:/busybox}/Debug" id="com.renesas.cdt.managedbuild.gcc.rz.builder.44442865" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="GCC for Renesas Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.renesas.cdt.managedbuild.gcc.rz.builder"/>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.assembler.939900191" name="Cross ARM GNU Assembler" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.assembler">
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.1347451550" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.1171809416" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.compiler.c.771732781" name="Cross ARM C Compiler" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.compiler.c">
+								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.gcc.rz.option.compiler.include.1129190627" name="Include paths (-I)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.compiler.include" useByScannerDiscovery="false" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/musl-1.1.18/include}&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/src&quot;"/>
+								</option>
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.nostdinc.1618750523" name="Do not search system directories (-nostdinc)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.nostdinc" useByScannerDiscovery="true" value="true" valueType="boolean"/>
+								<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.75342646" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.compiler.cpp.734723488" name="Cross ARM C++ Compiler" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.compiler.cpp"/>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.linker.c.299251289" name="Cross ARM C Linker" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.linker.c">
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections.1247253454" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.renesas.cdt.managedbuild.gcc.rz.archives.includePath.1962000389" name="Standard archive search directories (-L)" superClass="com.renesas.cdt.managedbuild.gcc.rz.archives.includePath" valueType="libPaths"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.linker.cpp.1418242920" name="Cross ARM C++ Linker" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.linker.cpp">
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections.1392179543" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.renesas.cdt.managedbuild.gcc.rz.archives.cpp.includePath.1322515227" name="Standard archive search directories (-L)" superClass="com.renesas.cdt.managedbuild.gcc.rz.archives.cpp.includePath" valueType="libPaths"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.archiver.2099800185" name="Cross ARM GNU Archiver" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.archiver"/>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.flash.1189479810" name="Cross ARM GNU Create Flash Image" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.flash">
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.1488010943" name="Output file format (-O)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.srec" valueType="enumerated"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.listing.1388721327" name="Cross ARM GNU Create Listing" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.listing">
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source.392291410" name="Display source (--source|-S)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders.1245597673" name="Display all headers (--all-headers|-x)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle.366497520" name="Demangle names (--demangle|-C)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers.686270457" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide.764390402" name="Wide lines (--wide|-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.size.700591131" name="Cross ARM GNU Print Size" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.size">
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format.1949336996" name="Size format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format" useByScannerDiscovery="false"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.libgen.846305699" name="Library Generator" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.libgen">
+								<option id="com.renesas.cdt.managedbuild.gcc.rz.option.selectlibrary.648500937" name="Select Library" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.selectlibrary" useByScannerDiscovery="true" value="com.renesas.cdt.managedbuild.gcc.core.option.librarygenerator.settings.selectLibrary.newLib" valueType="enumerated"/>
+								<option id="com.renesas.cdt.managedbuild.gcc.rz.option.libraryType.234030321" name="Library type" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.libraryType" useByScannerDiscovery="true" value="com.renesas.cdt.managedbuild.gcc.core.option.librarygenerator.settings.libraryType.preBuilt" valueType="enumerated"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="com.renesas.cdt.managedbuild.gcc.rz.configuration.release.lib.1934247118">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.renesas.cdt.managedbuild.gcc.rz.configuration.release.lib.1934247118" moduleId="org.eclipse.cdt.core.settings" name="Release">
+				<externalSettings>
+					<externalSetting>
+						<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/busybox"/>
+						<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/busybox/Release"/>
+						<entry flags="RESOLVED" kind="libraryFile" name="busybox" srcPrefixMapping="" srcRootPath=""/>
+					</externalSetting>
+				</externalSettings>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.ELF" 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.GmakeErrorParser" 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"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="com.renesas.cdt.managedbuild.core.toolchainInfo">
+				<option id="toolchain.id" value="gcc-arm-embedded"/>
+				<option id="toolchain.version" value="6.3.1.20170620"/>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf *.lst *.lis *.lpp *.map" description="" id="com.renesas.cdt.managedbuild.gcc.rz.configuration.release.lib.1934247118" name="Release" parent="com.renesas.cdt.managedbuild.gcc.rz.configuration.release.lib">
+					<folderInfo id="com.renesas.cdt.managedbuild.gcc.rz.configuration.release.lib.1934247118." name="/" resourcePath="">
+						<toolChain id="com.renesas.cdt.managedbuild.gcc.rz.toolChain.release.lib.1961451384" name="GCC for Renesas RZ" superClass="com.renesas.cdt.managedbuild.gcc.rz.toolChain.release.lib">
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.optimizationLevel.1882973619" name="Optimization Level" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.optimizationLevel" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.size" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.messagelenght.161745559" name="Message length (-fmessage-length=0)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.messagelenght" useByScannerDiscovery="true" value="true" valueType="boolean"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.signedchar.54800699" name="'char' is signed (-fsigned-char)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.signedchar" useByScannerDiscovery="true" value="true" valueType="boolean"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.functionsection.1230741294" name="Function sections (-ffunction-sections)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.functionsection" useByScannerDiscovery="true" value="true" valueType="boolean"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.datasections.1315864134" name="Data sections (-fdata-sections)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.datasections" useByScannerDiscovery="true" value="true" valueType="boolean"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.627746010" name="Debug level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level" useByScannerDiscovery="true"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.2085713167" name="Debug format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format" useByScannerDiscovery="true"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.273519535" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" useByScannerDiscovery="false" value="GNU Tools for ARM Embedded Processors" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.1856011103" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.architecture" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.arm" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.family.612759596" name="ARM family" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.family" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.mcpu.cortex-a9" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.instructionset.534813081" name="Instruction set" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.instructionset" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.instructionset.arm" valueType="enumerated"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix.2053390115" name="Prefix" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix" useByScannerDiscovery="false" value="arm-none-eabi-" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.c.1078592035" name="C compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.c" useByScannerDiscovery="false" value="gcc" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp.1908460399" name="C++ compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp" useByScannerDiscovery="false" value="g++" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar.163350812" name="Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar" useByScannerDiscovery="false" value="ar" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy.849360742" name="Hex/Bin converter" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy" useByScannerDiscovery="false" value="objcopy" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump.1701127265" name="Listing generator" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump" useByScannerDiscovery="false" value="objdump" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.size.323560350" name="Size command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.size" useByScannerDiscovery="false" value="size" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.make.1206617258" name="Build command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.make" useByScannerDiscovery="false" value="make" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm.604920955" name="Remove command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm" useByScannerDiscovery="false" value="rm" valueType="string"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.497665547" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+							<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.1548308094" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.createlibgen.634117003" name="Create libgen" superClass="com.renesas.cdt.managedbuild.gcc.rz.createlibgen" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.architecture.711254577" name="Architecture" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.architecture" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.arch.armv7-a" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.deviceName.398081142" name="Device name" superClass="com.renesas.cdt.managedbuild.gcc.rz.deviceName" useByScannerDiscovery="false" value="R7S721001" valueType="string"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.floatunit.724062697" name="FPU Type" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.floatunit" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.vfpv3d16" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.floatabi.222146338" name="Float ABI" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.floatabi" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.hard" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.thumb.732191201" name="Thumb interwork (-mthumb-interwork)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.thumb" useByScannerDiscovery="true" value="true" valueType="boolean"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.endian.882250928" name="Endianness" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.endian" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.endianness.little" valueType="enumerated"/>
+							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.warnStack.872199064" name="Warn if stack size exceeds the limit, in bytes (-Wstack-usage)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.warnStack" useByScannerDiscovery="false" value="100" valueType="string"/>
+							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.817376314" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
+							<builder buildPath="${workspace_loc:/busybox}/Release" id="com.renesas.cdt.managedbuild.gcc.rz.builder.278797338" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="GCC for Renesas Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.renesas.cdt.managedbuild.gcc.rz.builder"/>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.assembler.290501187" name="Cross ARM GNU Assembler" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.assembler">
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.1009510782" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.509728699" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.compiler.c.1811522430" name="Cross ARM C Compiler" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.compiler.c">
+								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.gcc.rz.option.compiler.include.1880360404" name="Include paths (-I)" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.compiler.include" useByScannerDiscovery="false" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/src&quot;"/>
+								</option>
+								<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.668929886" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.compiler.cpp.1354637021" name="Cross ARM C++ Compiler" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.compiler.cpp"/>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.linker.c.1857713635" name="Cross ARM C Linker" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.linker.c">
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections.1260355160" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.renesas.cdt.managedbuild.gcc.rz.archives.includePath.951366679" name="Standard archive search directories (-L)" superClass="com.renesas.cdt.managedbuild.gcc.rz.archives.includePath" valueType="libPaths"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.linker.cpp.1601596840" name="Cross ARM C++ Linker" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.linker.cpp">
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections.326084451" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.renesas.cdt.managedbuild.gcc.rz.archives.cpp.includePath.1991016915" name="Standard archive search directories (-L)" superClass="com.renesas.cdt.managedbuild.gcc.rz.archives.cpp.includePath" valueType="libPaths"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.archiver.1428277049" name="Cross ARM GNU Archiver" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.archiver"/>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.flash.1153656922" name="Cross ARM GNU Create Flash Image" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.flash">
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.1240074906" name="Output file format (-O)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice" useByScannerDiscovery="false" value="ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.srec" valueType="enumerated"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.listing.1626823186" name="Cross ARM GNU Create Listing" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.listing">
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source.653479282" name="Display source (--source|-S)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders.1419472832" name="Display all headers (--all-headers|-x)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle.589923323" name="Demangle names (--demangle|-C)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers.284960229" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide.1445209041" name="Wide lines (--wide|-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide" useByScannerDiscovery="false" value="true" valueType="boolean"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.size.1400022104" name="Cross ARM GNU Print Size" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.size">
+								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format.1877320501" name="Size format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format" useByScannerDiscovery="false"/>
+							</tool>
+							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.libgen.156662466" name="Library Generator" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.libgen">
+								<option id="com.renesas.cdt.managedbuild.gcc.rz.option.selectlibrary.2053553341" name="Select Library" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.selectlibrary" useByScannerDiscovery="true" value="com.renesas.cdt.managedbuild.gcc.core.option.librarygenerator.settings.selectLibrary.newLib" valueType="enumerated"/>
+								<option id="com.renesas.cdt.managedbuild.gcc.rz.option.libraryType.703243681" name="Library type" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.libraryType" useByScannerDiscovery="true" value="com.renesas.cdt.managedbuild.gcc.core.option.librarygenerator.settings.libraryType.preBuilt" valueType="enumerated"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+	</storageModule>
+	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+		<project id="busybox.com.renesas.cdt.managedbuild.gcc.rz.target.lib.1630293870" name="static ã©ã¤ãã©ãªã¼" projectType="com.renesas.cdt.managedbuild.gcc.rz.target.lib"/>
+	</storageModule>
+	<storageModule moduleId="scannerConfiguration">
+		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		<scannerConfigBuildInfo instanceId="com.renesas.cdt.managedbuild.gcc.rz.configuration.release.lib.1934247118;com.renesas.cdt.managedbuild.gcc.rz.configuration.release.lib.1934247118.;com.renesas.cdt.managedbuild.gcc.rz.tool.compiler.c.1811522430;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.668929886">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="com.renesas.cdt.managedbuild.gcc.rz.configuration.debug.lib.811193569;com.renesas.cdt.managedbuild.gcc.rz.configuration.debug.lib.811193569.;com.renesas.cdt.managedbuild.gcc.rz.tool.compiler.c.771732781;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.75342646">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		</scannerConfigBuildInfo>
+	</storageModule>
+	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+	<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
+	<storageModule moduleId="refreshScope"/>
+</cproject>
Index: /EcnlProtoTool/trunk/busybox/.project
===================================================================
--- /EcnlProtoTool/trunk/busybox/.project	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/.project	(revision 447)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>busybox</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+			<triggers>clean,full,incremental,</triggers>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+			<triggers>full,incremental,</triggers>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
Index: /EcnlProtoTool/trunk/busybox/AUTHORS
===================================================================
--- /EcnlProtoTool/trunk/busybox/AUTHORS	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/AUTHORS	(revision 447)
@@ -0,0 +1,180 @@
+List of the authors of code contained in BusyBox.
+
+If you have code in BusyBox, you should be listed here.  If you should be
+listed, or the description of what you have done needs more detail, or is
+incorrect, _please_ let me know.
+
+ -Erik
+
+-----------
+
+Peter Willis <psyphreak@phreaker.net>
+    eject
+
+Emanuele Aina <emanuele.aina@tiscali.it>
+    run-parts
+
+Erik Andersen <andersen@codepoet.org>
+    Tons of new stuff, major rewrite of most of the
+    core apps, tons of new apps as noted in header files.
+    Lots of tedious effort writing these boring docs that
+    nobody is going to actually read.
+
+Laurence Anderson <l.d.anderson@warwick.ac.uk>
+    rpm2cpio, unzip, get_header_cpio, read_gz interface, rpm
+
+Jeff Angielski <jeff@theptrgroup.com>
+    ftpput, ftpget
+
+Enrik Berkhan <Enrik.Berkhan@inka.de>
+    setconsole
+
+Jim Bauer <jfbauer@nfr.com>
+    modprobe shell dependency
+
+Edward Betts <edward@debian.org>
+    expr, hostid, logname, whoami
+
+John Beppu <beppu@codepoet.org>
+    du, nslookup, sort
+
+David Brownell <dbrownell@users.sourceforge.net>
+    zcip
+
+Brian Candler <B.Candler@pobox.com>
+    tiny-ls(ls)
+
+Randolph Chung <tausq@debian.org>
+    fbset, ping, hostname
+
+Dave Cinege <dcinege@psychosis.com>
+    more(v2), makedevs, dutmp, modularization, auto links file,
+    various fixes, Linux Router Project maintenance
+
+Jordan Crouse <jordan@cosmicpenguin.net>
+    ipcalc
+
+Magnus Damm <damm@opensource.se>
+    tftp client
+    insmod powerpc support
+
+Larry Doolittle <ldoolitt@recycle.lbl.gov>
+    pristine source directory compilation, lots of patches and fixes.
+
+Glenn Engel <glenne@engel.org>
+    httpd
+
+Gennady Feldman <gfeldman@gena01.com>
+    Sysklogd (single threaded syslogd, IPC Circular buffer support,
+    logread), various fixes.
+
+Robert Griebl <sandman@handhelds.org>
+    modprobe, hwclock, suid/sgid handling, tinylogin integration
+    many bugfixes and enhancements
+
+Karl M. Hegbloom <karlheg@debian.org>
+    cp_mv.c, the test suite, various fixes to utility.c, &c.
+
+Daniel Jacobowitz <dan@debian.org>
+    mktemp.c
+
+Matt Kraai <kraai@alumni.cmu.edu>
+    documentation, bugfixes, test suite
+
+Rob Landley <rob@landley.net>
+    Became busybox maintainer in 2006.
+
+    sed (major rewrite in 2003, and I now maintain the thing)
+    bunzip2 (complete from-scratch rewrite, then mjn3 optimized the result)
+    sort (more or less from scratch rewrite in 2004, I now maintain it)
+    mount (rewrite in 2005, I maintain the new one)
+
+Stephan Linz <linz@li-pro.net>
+    ipcalc, Red Hat equivalence
+
+John Lombardo <john@deltanet.com>
+    tr
+
+Glenn McGrath <glenn.l.mcgrath@gmail.com>
+    Common unarchiving code and unarchiving applets, ifupdown, ftpgetput,
+    nameif, sed, patch, fold, install, uudecode.
+    Various bugfixes, review and apply numerous patches.
+
+Manuel Novoa III <mjn3@codepoet.org>
+    cat, head, mkfifo, mknod, rmdir, sleep, tee, tty, uniq, usleep, wc, yes,
+    mesg, vconfig, nice, renice,
+    make_directory, parse_mode, dirname, mode_string,
+    get_last_path_component, simplify_path, and a number trivial libbb routines
+
+    also bug fixes, partial rewrites, and size optimizations in
+    ash, basename, cal, cmp, cp, df, du, echo, env, ln, logname, md5sum, mkdir,
+    mv, realpath, rm, sort, tail, touch, uname, watch, arith, human_readable,
+    interface, dutmp, ifconfig, route
+
+Vladimir Oleynik <dzo@simtreas.ru>
+    cmdedit; bb_mkdep, xargs(current), httpd(current);
+    ports: ash, crond, fdisk (initial, unmaintained now), inetd, stty, traceroute,
+    top;
+    locale, various fixes
+    and irreconcilable critic of everything not perfect.
+
+Bruce Perens <bruce@pixar.com>
+    Original author of BusyBox in 1995, 1996. Some of his code can
+    still be found hiding here and there...
+
+Rodney Radford <rradford@mindspring.com>
+    ipcs, ipcrm
+
+Tim Riker <Tim@Rikers.org>
+    bug fixes, member of fan club
+
+Kent Robotti <robotti@metconnect.com>
+    reset, tons and tons of bug reports and patches.
+
+Chip Rosenthal <chip@unicom.com>, <crosenth@covad.com>
+    wget - Contributed by permission of Covad Communications
+
+Pavel Roskin <proski@gnu.org>
+    Lots of bugs fixes and patches.
+
+Gyepi Sam <gyepi@praxis-sw.com>
+    Remote logging feature for syslogd
+
+Rob Sullivan <cogito.ergo.cogito@gmail.com>
+    comm
+
+Linus Torvalds
+    mkswap, fsck.minix, mkfs.minix
+
+Linus Walleij
+    fbset and fbsplash config RGBA parsing
+    rewrite of mdev helper to create devices from /sys/dev
+
+Mark Whitley <markw@codepoet.org>
+    grep, sed, cut, xargs(previous),
+    style-guide, new-applet-HOWTO, bug fixes, etc.
+
+Charles P. Wright <cpwright@villagenet.com>
+    gzip, mini-netcat(nc)
+
+Enrique Zanardi <ezanardi@ull.es>
+    tarcat (since removed), loadkmap, various fixes, Debian maintenance
+
+Tito Ragusa <farmatito@tiscali.it>
+    devfsd and size optimizations in strings, openvt, chvt, deallocvt, hdparm,
+    fdformat, lsattr, chattr, id and eject.
+
+Paul Fox <pgf@foxharp.boston.ma.us>
+    vi editing mode for ash, various other patches/fixes
+
+Roberto A. Foglietta <me@roberto.foglietta.name>
+    port: dnsd
+
+Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+    misc
+
+Mike Frysinger <vapier@gentoo.org>
+    initial e2fsprogs, printenv, setarch, sum, misc
+
+Jie Zhang <jie.zhang@analog.com>
+    fixed two bugs in msh and hush (exitcode of killed processes)
Index: /EcnlProtoTool/trunk/busybox/LICENSE
===================================================================
--- /EcnlProtoTool/trunk/busybox/LICENSE	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/LICENSE	(revision 447)
@@ -0,0 +1,353 @@
+--- A note on GPL versions
+
+BusyBox is distributed under version 2 of the General Public License (included
+in its entirety, below).  Version 2 is the only version of this license which
+this version of BusyBox (or modified versions derived from this one) may be
+distributed under.
+
+------------------------------------------------------------------------
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Index: /EcnlProtoTool/trunk/busybox/README
===================================================================
--- /EcnlProtoTool/trunk/busybox/README	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/README	(revision 447)
@@ -0,0 +1,204 @@
+Please see the LICENSE file for details on copying and usage.
+Please refer to the INSTALL file for instructions on how to build.
+
+What is busybox:
+
+  BusyBox combines tiny versions of many common UNIX utilities into a single
+  small executable.  It provides minimalist replacements for most of the
+  utilities you usually find in bzip2, coreutils, dhcp, diffutils, e2fsprogs,
+  file, findutils, gawk, grep, inetutils, less, modutils, net-tools, procps,
+  sed, shadow, sysklogd, sysvinit, tar, util-linux, and vim.  The utilities
+  in BusyBox often have fewer options than their full-featured cousins;
+  however, the options that are included provide the expected functionality
+  and behave very much like their larger counterparts.
+
+  BusyBox has been written with size-optimization and limited resources in
+  mind, both to produce small binaries and to reduce run-time memory usage.
+  Busybox is also extremely modular so you can easily include or exclude
+  commands (or features) at compile time.  This makes it easy to customize
+  embedded systems; to create a working system, just add /dev, /etc, and a
+  Linux kernel.  Busybox (usually together with uClibc) has also been used as
+  a component of "thin client" desktop systems, live-CD distributions, rescue
+  disks, installers, and so on.
+
+  BusyBox provides a fairly complete POSIX environment for any small system,
+  both embedded environments and more full featured systems concerned about
+  space.  Busybox is slowly working towards implementing the full Single Unix
+  Specification V3 (http://www.opengroup.org/onlinepubs/009695399/), but isn't
+  there yet (and for size reasons will probably support at most UTF-8 for
+  internationalization).  We are also interested in passing the Linux Test
+  Project (http://ltp.sourceforge.net).
+
+----------------
+
+Using busybox:
+
+  BusyBox is extremely configurable.  This allows you to include only the
+  components and options you need, thereby reducing binary size.  Run 'make
+  config' or 'make menuconfig' to select the functionality that you wish to
+  enable.  (See 'make help' for more commands.)
+
+  The behavior of busybox is determined by the name it's called under: as
+  "cp" it behaves like cp, as "sed" it behaves like sed, and so on.  Called
+  as "busybox" it takes the second argument as the name of the applet to
+  run (I.E. "./busybox ls -l /proc").
+
+  The "standalone shell" mode is an easy way to try out busybox; this is a
+  command shell that calls the built-in applets without needing them to be
+  installed in the path.  (Note that this requires /proc to be mounted, if
+  testing from a boot floppy or in a chroot environment.)
+
+  The build automatically generates a file "busybox.links", which is used by
+  'make install' to create symlinks to the BusyBox binary for all compiled in
+  commands.  This uses the CONFIG_PREFIX environment variable to specify
+  where to install, and installs hardlinks or symlinks depending
+  on the configuration preferences.  (You can also manually run
+  the install script at "applets/install.sh").
+
+----------------
+
+Downloading the current source code:
+
+  Source for the latest released version, as well as daily snapshots, can always
+  be downloaded from
+
+    http://busybox.net/downloads/
+
+  You can browse the up to the minute source code and change history online.
+
+    http://git.busybox.net/busybox/
+
+  Anonymous GIT access is available.  For instructions, check out:
+
+    http://www.busybox.net/source.html
+
+  For those that are actively contributing and would like to check files in,
+  see:
+
+    http://busybox.net/developer.html
+
+  The developers also have a bug and patch tracking system
+  (https://bugs.busybox.net) although posting a bug/patch to the mailing list
+  is generally a faster way of getting it fixed, and the complete archive of
+  what happened is the git changelog.
+
+  Note: if you want to compile busybox in a busybox environment you must
+  select CONFIG_DESKTOP.
+
+----------------
+
+Getting help:
+
+  when you find you need help, you can check out the busybox mailing list
+  archives at http://busybox.net/lists/busybox/ or even join
+  the mailing list if you are interested.
+
+----------------
+
+Bugs:
+
+  if you find bugs, please submit a detailed bug report to the busybox mailing
+  list at busybox@busybox.net.  a well-written bug report should include a
+  transcript of a shell session that demonstrates the bad behavior and enables
+  anyone else to duplicate the bug on their own machine. the following is such
+  an example:
+
+    to: busybox@busybox.net
+    from: diligent@testing.linux.org
+    subject: /bin/date doesn't work
+
+    package: busybox
+    version: 1.00
+
+    when i execute busybox 'date' it produces unexpected results.
+    with gnu date i get the following output:
+
+	$ date
+	fri oct  8 14:19:41 mdt 2004
+
+    but when i use busybox date i get this instead:
+
+	$ date
+	illegal instruction
+
+    i am using debian unstable, kernel version 2.4.25-vrs2 on a netwinder,
+    and the latest uclibc from cvs.
+
+	-diligent
+
+  note the careful description and use of examples showing not only what
+  busybox does, but also a counter example showing what an equivalent app
+  does (or pointing to the text of a relevant standard).  Bug reports lacking
+  such detail may never be fixed...  Thanks for understanding.
+
+----------------
+
+Portability:
+
+  Busybox is developed and tested on Linux 2.4 and 2.6 kernels, compiled
+  with gcc (the unit-at-a-time optimizations in version 3.4 and later are
+  worth upgrading to get, but older versions should work), and linked against
+  uClibc (0.9.27 or greater) or glibc (2.2 or greater).  In such an
+  environment, the full set of busybox features should work, and if
+  anything doesn't we want to know about it so we can fix it.
+
+  There are many other environments out there, in which busybox may build
+  and run just fine.  We just don't test them.  Since busybox consists of a
+  large number of more or less independent applets, portability is a question
+  of which features work where.  Some busybox applets (such as cat and rm) are
+  highly portable and likely to work just about anywhere, while others (such as
+  insmod and losetup) require recent Linux kernels with recent C libraries.
+
+  Earlier versions of Linux and glibc may or may not work, for any given
+  configuration.  Linux 2.2 or earlier should mostly work (there's still
+  some support code in things like mount.c) but this is no longer regularly
+  tested, and inherently won't support certain features (such as long files
+  and --bind mounts).  The same is true for glibc 2.0 and 2.1: expect a higher
+  testing and debugging burden using such old infrastructure.  (The busybox
+  developers are not very interested in supporting these older versions, but
+  will probably accept small self-contained patches to fix simple problems.)
+
+  Some environments are not recommended.  Early versions of uClibc were buggy
+  and missing many features: upgrade.  Linking against libc5 or dietlibc is
+  not supported and not interesting to the busybox developers.  (The first is
+  obsolete and has no known size or feature advantages over uClibc, the second
+  has known bugs that its developers have actively refused to fix.)  Ancient
+  Linux kernels (2.0.x and earlier) are similarly uninteresting.
+
+  In theory it's possible to use Busybox under other operating systems (such as
+  MacOS X, Solaris, Cygwin, or the BSD Fork Du Jour).  This generally involves
+  a different kernel and a different C library at the same time.  While it
+  should be possible to port the majority of the code to work in one of
+  these environments, don't be surprised if it doesn't work out of the box.  If
+  you're into that sort of thing, start small (selecting just a few applets)
+  and work your way up.
+
+  In 2005 Shaun Jackman has ported busybox to a combination of newlib
+  and libgloss, and some of his patches have been integrated.
+
+Supported hardware:
+
+  BusyBox in general will build on any architecture supported by gcc.  We
+  support both 32 and 64 bit platforms, and both big and little endian
+  systems.
+
+  Under 2.4 Linux kernels, kernel module loading was implemented in a
+  platform-specific manner.  Busybox's insmod utility has been reported to
+  work under ARM, CRIS, H8/300, x86, ia64, x86_64, m68k, MIPS, PowerPC, S390,
+  SH3/4/5, Sparc, and v850e.  Anything else probably won't work.
+
+  The module loading mechanism for the 2.6 kernel is much more generic, and
+  we believe 2.6.x kernel module loading support should work on all
+  architectures supported by the kernel.
+
+----------------
+
+Please feed suggestions, bug reports, insults, and bribes back to the busybox
+mailing list:
+
+	busybox@busybox.net
+
+and/or maintainer:
+
+	Denys Vlasenko
+	<vda.linux@googlemail.com>
Index: /EcnlProtoTool/trunk/busybox/src/autoconf.h
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/autoconf.h	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/autoconf.h	(revision 447)
@@ -0,0 +1,7098 @@
+/*
+ * Automatically generated C config: don't edit
+ * Busybox version: 1.26.2
+ */
+#define AUTOCONF_TIMESTAMP "2017-03-19 23:38:35 DST"
+
+#define CONFIG_HAVE_DOT_CONFIG 1
+#define ENABLE_HAVE_DOT_CONFIG 1
+#ifdef MAKE_SUID
+# define IF_HAVE_DOT_CONFIG(...) __VA_ARGS__ "CONFIG_HAVE_DOT_CONFIG"
+#else
+# define IF_HAVE_DOT_CONFIG(...) __VA_ARGS__
+#endif
+#define IF_NOT_HAVE_DOT_CONFIG(...)
+
+/*
+ * Busybox Settings
+ */
+#undef CONFIG_DESKTOP
+#define ENABLE_DESKTOP 0
+# define IF_DESKTOP(...)
+#define IF_NOT_DESKTOP(...) __VA_ARGS__
+#define CONFIG_EXTRA_COMPAT 1
+#define ENABLE_EXTRA_COMPAT 1
+#ifdef MAKE_SUID
+# define IF_EXTRA_COMPAT(...) __VA_ARGS__ "CONFIG_EXTRA_COMPAT"
+#else
+# define IF_EXTRA_COMPAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_EXTRA_COMPAT(...)
+#define CONFIG_INCLUDE_SUSv2 1
+#define ENABLE_INCLUDE_SUSv2 1
+#ifdef MAKE_SUID
+# define IF_INCLUDE_SUSv2(...) __VA_ARGS__ "CONFIG_INCLUDE_SUSv2"
+#else
+# define IF_INCLUDE_SUSv2(...) __VA_ARGS__
+#endif
+#define IF_NOT_INCLUDE_SUSv2(...)
+#undef CONFIG_USE_PORTABLE_CODE
+#define ENABLE_USE_PORTABLE_CODE 0
+#define IF_USE_PORTABLE_CODE(...)
+#define IF_NOT_USE_PORTABLE_CODE(...) __VA_ARGS__
+#define CONFIG_PLATFORM_LINUX 1
+#define ENABLE_PLATFORM_LINUX 1
+#ifdef MAKE_SUID
+# define IF_PLATFORM_LINUX(...) __VA_ARGS__ "CONFIG_PLATFORM_LINUX"
+#else
+# define IF_PLATFORM_LINUX(...) __VA_ARGS__
+#endif
+#define IF_NOT_PLATFORM_LINUX(...)
+#define CONFIG_SHOW_USAGE 1
+#define ENABLE_SHOW_USAGE 1
+#ifdef MAKE_SUID
+# define IF_SHOW_USAGE(...) __VA_ARGS__ "CONFIG_SHOW_USAGE"
+#else
+# define IF_SHOW_USAGE(...) __VA_ARGS__
+#endif
+#define IF_NOT_SHOW_USAGE(...)
+#define CONFIG_FEATURE_VERBOSE_USAGE 1
+#define ENABLE_FEATURE_VERBOSE_USAGE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VERBOSE_USAGE(...) __VA_ARGS__ "CONFIG_FEATURE_VERBOSE_USAGE"
+#else
+# define IF_FEATURE_VERBOSE_USAGE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VERBOSE_USAGE(...)
+#define CONFIG_FEATURE_COMPRESS_USAGE 1
+#define ENABLE_FEATURE_COMPRESS_USAGE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_COMPRESS_USAGE(...) __VA_ARGS__ "CONFIG_FEATURE_COMPRESS_USAGE"
+#else
+# define IF_FEATURE_COMPRESS_USAGE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_COMPRESS_USAGE(...)
+#define CONFIG_BUSYBOX 1
+#define ENABLE_BUSYBOX 1
+#ifdef MAKE_SUID
+# define IF_BUSYBOX(...) __VA_ARGS__ "CONFIG_BUSYBOX"
+#else
+# define IF_BUSYBOX(...) __VA_ARGS__
+#endif
+#define IF_NOT_BUSYBOX(...)
+#define CONFIG_FEATURE_INSTALLER 1
+#define ENABLE_FEATURE_INSTALLER 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_INSTALLER(...) __VA_ARGS__ "CONFIG_FEATURE_INSTALLER"
+#else
+# define IF_FEATURE_INSTALLER(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_INSTALLER(...)
+#undef CONFIG_INSTALL_NO_USR
+#define ENABLE_INSTALL_NO_USR 0
+#define IF_INSTALL_NO_USR(...)
+#define IF_NOT_INSTALL_NO_USR(...) __VA_ARGS__
+#undef CONFIG_PAM
+#define ENABLE_PAM 0
+#define IF_PAM(...)
+#define IF_NOT_PAM(...) __VA_ARGS__
+#define CONFIG_LONG_OPTS 1
+#define ENABLE_LONG_OPTS 1
+#ifdef MAKE_SUID
+# define IF_LONG_OPTS(...) __VA_ARGS__ "CONFIG_LONG_OPTS"
+#else
+# define IF_LONG_OPTS(...) __VA_ARGS__
+#endif
+#define IF_NOT_LONG_OPTS(...)
+#define CONFIG_FEATURE_DEVPTS 1
+#define ENABLE_FEATURE_DEVPTS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DEVPTS(...) __VA_ARGS__ "CONFIG_FEATURE_DEVPTS"
+#else
+# define IF_FEATURE_DEVPTS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DEVPTS(...)
+#undef CONFIG_FEATURE_CLEAN_UP
+#define ENABLE_FEATURE_CLEAN_UP 0
+#define IF_FEATURE_CLEAN_UP(...)
+#define IF_NOT_FEATURE_CLEAN_UP(...) __VA_ARGS__
+#define CONFIG_FEATURE_UTMP 1
+#define ENABLE_FEATURE_UTMP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_UTMP(...) __VA_ARGS__ "CONFIG_FEATURE_UTMP"
+#else
+# define IF_FEATURE_UTMP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_UTMP(...)
+#define CONFIG_FEATURE_WTMP 1
+#define ENABLE_FEATURE_WTMP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_WTMP(...) __VA_ARGS__ "CONFIG_FEATURE_WTMP"
+#else
+# define IF_FEATURE_WTMP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_WTMP(...)
+#define CONFIG_FEATURE_PIDFILE 1
+#define ENABLE_FEATURE_PIDFILE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_PIDFILE(...) __VA_ARGS__ "CONFIG_FEATURE_PIDFILE"
+#else
+# define IF_FEATURE_PIDFILE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_PIDFILE(...)
+#define CONFIG_PID_FILE_PATH "/var/run"
+#define ENABLE_PID_FILE_PATH 1
+#ifdef MAKE_SUID
+# define IF_PID_FILE_PATH(...) __VA_ARGS__ "CONFIG_PID_FILE_PATH"
+#else
+# define IF_PID_FILE_PATH(...) __VA_ARGS__
+#endif
+#define IF_NOT_PID_FILE_PATH(...)
+#define CONFIG_FEATURE_SUID 1
+#define ENABLE_FEATURE_SUID 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SUID(...) __VA_ARGS__ "CONFIG_FEATURE_SUID"
+#else
+# define IF_FEATURE_SUID(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SUID(...)
+#define CONFIG_FEATURE_SUID_CONFIG 1
+#define ENABLE_FEATURE_SUID_CONFIG 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SUID_CONFIG(...) __VA_ARGS__ "CONFIG_FEATURE_SUID_CONFIG"
+#else
+# define IF_FEATURE_SUID_CONFIG(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SUID_CONFIG(...)
+#define CONFIG_FEATURE_SUID_CONFIG_QUIET 1
+#define ENABLE_FEATURE_SUID_CONFIG_QUIET 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SUID_CONFIG_QUIET(...) __VA_ARGS__ "CONFIG_FEATURE_SUID_CONFIG_QUIET"
+#else
+# define IF_FEATURE_SUID_CONFIG_QUIET(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SUID_CONFIG_QUIET(...)
+#undef CONFIG_SELINUX
+#define ENABLE_SELINUX 0
+#define IF_SELINUX(...)
+#define IF_NOT_SELINUX(...) __VA_ARGS__
+#define CONFIG_FEATURE_PREFER_APPLETS 1
+#define ENABLE_FEATURE_PREFER_APPLETS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_PREFER_APPLETS(...) __VA_ARGS__ "CONFIG_FEATURE_PREFER_APPLETS"
+#else
+# define IF_FEATURE_PREFER_APPLETS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_PREFER_APPLETS(...)
+#define CONFIG_BUSYBOX_EXEC_PATH "/proc/self/exe"
+#define ENABLE_BUSYBOX_EXEC_PATH 1
+#ifdef MAKE_SUID
+# define IF_BUSYBOX_EXEC_PATH(...) __VA_ARGS__ "CONFIG_BUSYBOX_EXEC_PATH"
+#else
+# define IF_BUSYBOX_EXEC_PATH(...) __VA_ARGS__
+#endif
+#define IF_NOT_BUSYBOX_EXEC_PATH(...)
+#define CONFIG_FEATURE_SYSLOG 1
+#define ENABLE_FEATURE_SYSLOG 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SYSLOG(...) __VA_ARGS__ "CONFIG_FEATURE_SYSLOG"
+#else
+# define IF_FEATURE_SYSLOG(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SYSLOG(...)
+#define CONFIG_FEATURE_HAVE_RPC 1
+#define ENABLE_FEATURE_HAVE_RPC 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HAVE_RPC(...) __VA_ARGS__ "CONFIG_FEATURE_HAVE_RPC"
+#else
+# define IF_FEATURE_HAVE_RPC(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HAVE_RPC(...)
+
+/*
+ * Build Options
+ */
+#undef CONFIG_STATIC
+#define ENABLE_STATIC 0
+#define IF_STATIC(...)
+#define IF_NOT_STATIC(...) __VA_ARGS__
+#undef CONFIG_PIE
+#define ENABLE_PIE 0
+#define IF_PIE(...)
+#define IF_NOT_PIE(...) __VA_ARGS__
+#define CONFIG_NOMMU 1
+#define ENABLE_NOMMU 1
+#ifdef MAKE_SUID
+# define IF_NOMMU(...) __VA_ARGS__ "CONFIG_NOMMU"
+#else
+# define IF_NOMMU(...) __VA_ARGS__
+#endif
+#define IF_NOT_NOMMU(...)
+#undef CONFIG_BUILD_LIBBUSYBOX
+#define ENABLE_BUILD_LIBBUSYBOX 0
+#define IF_BUILD_LIBBUSYBOX(...)
+#define IF_NOT_BUILD_LIBBUSYBOX(...) __VA_ARGS__
+#undef CONFIG_FEATURE_INDIVIDUAL
+#define ENABLE_FEATURE_INDIVIDUAL 0
+#define IF_FEATURE_INDIVIDUAL(...)
+#define IF_NOT_FEATURE_INDIVIDUAL(...) __VA_ARGS__
+#undef CONFIG_FEATURE_SHARED_BUSYBOX
+#define ENABLE_FEATURE_SHARED_BUSYBOX 0
+#define IF_FEATURE_SHARED_BUSYBOX(...)
+#define IF_NOT_FEATURE_SHARED_BUSYBOX(...) __VA_ARGS__
+#define CONFIG_LFS 1
+#define ENABLE_LFS 1
+#ifdef MAKE_SUID
+# define IF_LFS(...) __VA_ARGS__ "CONFIG_LFS"
+#else
+# define IF_LFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_LFS(...)
+#define CONFIG_CROSS_COMPILER_PREFIX ""
+#define ENABLE_CROSS_COMPILER_PREFIX 1
+#ifdef MAKE_SUID
+# define IF_CROSS_COMPILER_PREFIX(...) __VA_ARGS__ "CONFIG_CROSS_COMPILER_PREFIX"
+#else
+# define IF_CROSS_COMPILER_PREFIX(...) __VA_ARGS__
+#endif
+#define IF_NOT_CROSS_COMPILER_PREFIX(...)
+#define CONFIG_SYSROOT ""
+#define ENABLE_SYSROOT 1
+#ifdef MAKE_SUID
+# define IF_SYSROOT(...) __VA_ARGS__ "CONFIG_SYSROOT"
+#else
+# define IF_SYSROOT(...) __VA_ARGS__
+#endif
+#define IF_NOT_SYSROOT(...)
+#define CONFIG_EXTRA_CFLAGS ""
+#define ENABLE_EXTRA_CFLAGS 1
+#ifdef MAKE_SUID
+# define IF_EXTRA_CFLAGS(...) __VA_ARGS__ "CONFIG_EXTRA_CFLAGS"
+#else
+# define IF_EXTRA_CFLAGS(...) __VA_ARGS__
+#endif
+#define IF_NOT_EXTRA_CFLAGS(...)
+#define CONFIG_EXTRA_LDFLAGS ""
+#define ENABLE_EXTRA_LDFLAGS 1
+#ifdef MAKE_SUID
+# define IF_EXTRA_LDFLAGS(...) __VA_ARGS__ "CONFIG_EXTRA_LDFLAGS"
+#else
+# define IF_EXTRA_LDFLAGS(...) __VA_ARGS__
+#endif
+#define IF_NOT_EXTRA_LDFLAGS(...)
+#define CONFIG_EXTRA_LDLIBS ""
+#define ENABLE_EXTRA_LDLIBS 1
+#ifdef MAKE_SUID
+# define IF_EXTRA_LDLIBS(...) __VA_ARGS__ "CONFIG_EXTRA_LDLIBS"
+#else
+# define IF_EXTRA_LDLIBS(...) __VA_ARGS__
+#endif
+#define IF_NOT_EXTRA_LDLIBS(...)
+
+/*
+ * Installation Options ("make install" behavior)
+ */
+#define CONFIG_INSTALL_APPLET_SYMLINKS 1
+#define ENABLE_INSTALL_APPLET_SYMLINKS 1
+#ifdef MAKE_SUID
+# define IF_INSTALL_APPLET_SYMLINKS(...) __VA_ARGS__ "CONFIG_INSTALL_APPLET_SYMLINKS"
+#else
+# define IF_INSTALL_APPLET_SYMLINKS(...) __VA_ARGS__
+#endif
+#define IF_NOT_INSTALL_APPLET_SYMLINKS(...)
+#undef CONFIG_INSTALL_APPLET_HARDLINKS
+#define ENABLE_INSTALL_APPLET_HARDLINKS 0
+#define IF_INSTALL_APPLET_HARDLINKS(...)
+#define IF_NOT_INSTALL_APPLET_HARDLINKS(...) __VA_ARGS__
+#undef CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS
+#define ENABLE_INSTALL_APPLET_SCRIPT_WRAPPERS 0
+#define IF_INSTALL_APPLET_SCRIPT_WRAPPERS(...)
+#define IF_NOT_INSTALL_APPLET_SCRIPT_WRAPPERS(...) __VA_ARGS__
+#undef CONFIG_INSTALL_APPLET_DONT
+#define ENABLE_INSTALL_APPLET_DONT 0
+#define IF_INSTALL_APPLET_DONT(...)
+#define IF_NOT_INSTALL_APPLET_DONT(...) __VA_ARGS__
+#undef CONFIG_INSTALL_SH_APPLET_SYMLINK
+#define ENABLE_INSTALL_SH_APPLET_SYMLINK 0
+#define IF_INSTALL_SH_APPLET_SYMLINK(...)
+#define IF_NOT_INSTALL_SH_APPLET_SYMLINK(...) __VA_ARGS__
+#undef CONFIG_INSTALL_SH_APPLET_HARDLINK
+#define ENABLE_INSTALL_SH_APPLET_HARDLINK 0
+#define IF_INSTALL_SH_APPLET_HARDLINK(...)
+#define IF_NOT_INSTALL_SH_APPLET_HARDLINK(...) __VA_ARGS__
+#undef CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER
+#define ENABLE_INSTALL_SH_APPLET_SCRIPT_WRAPPER 0
+#define IF_INSTALL_SH_APPLET_SCRIPT_WRAPPER(...)
+#define IF_NOT_INSTALL_SH_APPLET_SCRIPT_WRAPPER(...) __VA_ARGS__
+#define CONFIG_PREFIX "./_install"
+#define ENABLE_PREFIX 1
+#ifdef MAKE_SUID
+# define IF_PREFIX(...) __VA_ARGS__ "CONFIG_PREFIX"
+#else
+# define IF_PREFIX(...) __VA_ARGS__
+#endif
+#define IF_NOT_PREFIX(...)
+
+/*
+ * Debugging Options
+ */
+#undef CONFIG_DEBUG
+#define ENABLE_DEBUG 0
+#define IF_DEBUG(...)
+#define IF_NOT_DEBUG(...) __VA_ARGS__
+#undef CONFIG_DEBUG_PESSIMIZE
+#define ENABLE_DEBUG_PESSIMIZE 0
+#define IF_DEBUG_PESSIMIZE(...)
+#define IF_NOT_DEBUG_PESSIMIZE(...) __VA_ARGS__
+#undef CONFIG_DEBUG_SANITIZE
+#define ENABLE_DEBUG_SANITIZE 0
+#define IF_DEBUG_SANITIZE(...)
+#define IF_NOT_DEBUG_SANITIZE(...) __VA_ARGS__
+#undef CONFIG_UNIT_TEST
+#define ENABLE_UNIT_TEST 0
+#define IF_UNIT_TEST(...)
+#define IF_NOT_UNIT_TEST(...) __VA_ARGS__
+#undef CONFIG_WERROR
+#define ENABLE_WERROR 0
+#define IF_WERROR(...)
+#define IF_NOT_WERROR(...) __VA_ARGS__
+#define CONFIG_NO_DEBUG_LIB 1
+#define ENABLE_NO_DEBUG_LIB 1
+#ifdef MAKE_SUID
+# define IF_NO_DEBUG_LIB(...) __VA_ARGS__ "CONFIG_NO_DEBUG_LIB"
+#else
+# define IF_NO_DEBUG_LIB(...) __VA_ARGS__
+#endif
+#define IF_NOT_NO_DEBUG_LIB(...)
+#undef CONFIG_DMALLOC
+#define ENABLE_DMALLOC 0
+#define IF_DMALLOC(...)
+#define IF_NOT_DMALLOC(...) __VA_ARGS__
+#undef CONFIG_EFENCE
+#define ENABLE_EFENCE 0
+#define IF_EFENCE(...)
+#define IF_NOT_EFENCE(...) __VA_ARGS__
+
+/*
+ * Busybox Library Tuning
+ */
+#undef CONFIG_FEATURE_USE_BSS_TAIL
+#define ENABLE_FEATURE_USE_BSS_TAIL 0
+#define IF_FEATURE_USE_BSS_TAIL(...)
+#define IF_NOT_FEATURE_USE_BSS_TAIL(...) __VA_ARGS__
+#define CONFIG_FEATURE_RTMINMAX 1
+#define ENABLE_FEATURE_RTMINMAX 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_RTMINMAX(...) __VA_ARGS__ "CONFIG_FEATURE_RTMINMAX"
+#else
+# define IF_FEATURE_RTMINMAX(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_RTMINMAX(...)
+#define CONFIG_FEATURE_BUFFERS_USE_MALLOC 1
+#define ENABLE_FEATURE_BUFFERS_USE_MALLOC 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_BUFFERS_USE_MALLOC(...) __VA_ARGS__ "CONFIG_FEATURE_BUFFERS_USE_MALLOC"
+#else
+# define IF_FEATURE_BUFFERS_USE_MALLOC(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_BUFFERS_USE_MALLOC(...)
+#undef CONFIG_FEATURE_BUFFERS_GO_ON_STACK
+#define ENABLE_FEATURE_BUFFERS_GO_ON_STACK 0
+#define IF_FEATURE_BUFFERS_GO_ON_STACK(...)
+#define IF_NOT_FEATURE_BUFFERS_GO_ON_STACK(...) __VA_ARGS__
+#undef CONFIG_FEATURE_BUFFERS_GO_IN_BSS
+#define ENABLE_FEATURE_BUFFERS_GO_IN_BSS 0
+#define IF_FEATURE_BUFFERS_GO_IN_BSS(...)
+#define IF_NOT_FEATURE_BUFFERS_GO_IN_BSS(...) __VA_ARGS__
+#define CONFIG_PASSWORD_MINLEN 6
+#define ENABLE_PASSWORD_MINLEN 1
+#ifdef MAKE_SUID
+# define IF_PASSWORD_MINLEN(...) __VA_ARGS__ "CONFIG_PASSWORD_MINLEN"
+#else
+# define IF_PASSWORD_MINLEN(...) __VA_ARGS__
+#endif
+#define IF_NOT_PASSWORD_MINLEN(...)
+#define CONFIG_MD5_SMALL 1
+#define ENABLE_MD5_SMALL 1
+#ifdef MAKE_SUID
+# define IF_MD5_SMALL(...) __VA_ARGS__ "CONFIG_MD5_SMALL"
+#else
+# define IF_MD5_SMALL(...) __VA_ARGS__
+#endif
+#define IF_NOT_MD5_SMALL(...)
+#define CONFIG_SHA3_SMALL 1
+#define ENABLE_SHA3_SMALL 1
+#ifdef MAKE_SUID
+# define IF_SHA3_SMALL(...) __VA_ARGS__ "CONFIG_SHA3_SMALL"
+#else
+# define IF_SHA3_SMALL(...) __VA_ARGS__
+#endif
+#define IF_NOT_SHA3_SMALL(...)
+#define CONFIG_FEATURE_FAST_TOP 1
+#define ENABLE_FEATURE_FAST_TOP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FAST_TOP(...) __VA_ARGS__ "CONFIG_FEATURE_FAST_TOP"
+#else
+# define IF_FEATURE_FAST_TOP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FAST_TOP(...)
+#define CONFIG_FEATURE_ETC_NETWORKS 1
+#define ENABLE_FEATURE_ETC_NETWORKS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_ETC_NETWORKS(...) __VA_ARGS__ "CONFIG_FEATURE_ETC_NETWORKS"
+#else
+# define IF_FEATURE_ETC_NETWORKS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_ETC_NETWORKS(...)
+#define CONFIG_FEATURE_USE_TERMIOS 1
+#define ENABLE_FEATURE_USE_TERMIOS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_USE_TERMIOS(...) __VA_ARGS__ "CONFIG_FEATURE_USE_TERMIOS"
+#else
+# define IF_FEATURE_USE_TERMIOS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_USE_TERMIOS(...)
+#define CONFIG_FEATURE_EDITING 1
+#define ENABLE_FEATURE_EDITING 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_EDITING(...) __VA_ARGS__ "CONFIG_FEATURE_EDITING"
+#else
+# define IF_FEATURE_EDITING(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_EDITING(...)
+#define CONFIG_FEATURE_EDITING_MAX_LEN 1024
+#define ENABLE_FEATURE_EDITING_MAX_LEN 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_EDITING_MAX_LEN(...) __VA_ARGS__ "CONFIG_FEATURE_EDITING_MAX_LEN"
+#else
+# define IF_FEATURE_EDITING_MAX_LEN(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_EDITING_MAX_LEN(...)
+#define CONFIG_FEATURE_EDITING_VI 1
+#define ENABLE_FEATURE_EDITING_VI 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_EDITING_VI(...) __VA_ARGS__ "CONFIG_FEATURE_EDITING_VI"
+#else
+# define IF_FEATURE_EDITING_VI(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_EDITING_VI(...)
+#define CONFIG_FEATURE_EDITING_HISTORY 15
+#define ENABLE_FEATURE_EDITING_HISTORY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_EDITING_HISTORY(...) __VA_ARGS__ "CONFIG_FEATURE_EDITING_HISTORY"
+#else
+# define IF_FEATURE_EDITING_HISTORY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_EDITING_HISTORY(...)
+#undef CONFIG_FEATURE_EDITING_SAVEHISTORY
+#define ENABLE_FEATURE_EDITING_SAVEHISTORY 0
+#define IF_FEATURE_EDITING_SAVEHISTORY(...)
+#define IF_NOT_FEATURE_EDITING_SAVEHISTORY(...) __VA_ARGS__
+#undef CONFIG_FEATURE_EDITING_SAVE_ON_EXIT
+#define ENABLE_FEATURE_EDITING_SAVE_ON_EXIT 0
+#define IF_FEATURE_EDITING_SAVE_ON_EXIT(...)
+#define IF_NOT_FEATURE_EDITING_SAVE_ON_EXIT(...) __VA_ARGS__
+#define CONFIG_FEATURE_REVERSE_SEARCH 1
+#define ENABLE_FEATURE_REVERSE_SEARCH 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_REVERSE_SEARCH(...) __VA_ARGS__ "CONFIG_FEATURE_REVERSE_SEARCH"
+#else
+# define IF_FEATURE_REVERSE_SEARCH(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_REVERSE_SEARCH(...)
+#define CONFIG_FEATURE_TAB_COMPLETION 1
+#define ENABLE_FEATURE_TAB_COMPLETION 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TAB_COMPLETION(...) __VA_ARGS__ "CONFIG_FEATURE_TAB_COMPLETION"
+#else
+# define IF_FEATURE_TAB_COMPLETION(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TAB_COMPLETION(...)
+#define CONFIG_FEATURE_USERNAME_COMPLETION 1
+#define ENABLE_FEATURE_USERNAME_COMPLETION 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_USERNAME_COMPLETION(...) __VA_ARGS__ "CONFIG_FEATURE_USERNAME_COMPLETION"
+#else
+# define IF_FEATURE_USERNAME_COMPLETION(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_USERNAME_COMPLETION(...)
+#define CONFIG_FEATURE_EDITING_FANCY_PROMPT 1
+#define ENABLE_FEATURE_EDITING_FANCY_PROMPT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_EDITING_FANCY_PROMPT(...) __VA_ARGS__ "CONFIG_FEATURE_EDITING_FANCY_PROMPT"
+#else
+# define IF_FEATURE_EDITING_FANCY_PROMPT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_EDITING_FANCY_PROMPT(...)
+#define CONFIG_FEATURE_EDITING_ASK_TERMINAL 1
+#define ENABLE_FEATURE_EDITING_ASK_TERMINAL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_EDITING_ASK_TERMINAL(...) __VA_ARGS__ "CONFIG_FEATURE_EDITING_ASK_TERMINAL"
+#else
+# define IF_FEATURE_EDITING_ASK_TERMINAL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_EDITING_ASK_TERMINAL(...)
+#undef CONFIG_LOCALE_SUPPORT
+#define ENABLE_LOCALE_SUPPORT 0
+#define IF_LOCALE_SUPPORT(...)
+#define IF_NOT_LOCALE_SUPPORT(...) __VA_ARGS__
+#undef CONFIG_UNICODE_SUPPORT
+#define ENABLE_UNICODE_SUPPORT 0
+#define IF_UNICODE_SUPPORT(...)
+#define IF_NOT_UNICODE_SUPPORT(...) __VA_ARGS__
+#undef CONFIG_UNICODE_USING_LOCALE
+#define ENABLE_UNICODE_USING_LOCALE 0
+#define IF_UNICODE_USING_LOCALE(...)
+#define IF_NOT_UNICODE_USING_LOCALE(...) __VA_ARGS__
+#undef CONFIG_FEATURE_CHECK_UNICODE_IN_ENV
+#define ENABLE_FEATURE_CHECK_UNICODE_IN_ENV 0
+#define IF_FEATURE_CHECK_UNICODE_IN_ENV(...)
+#define IF_NOT_FEATURE_CHECK_UNICODE_IN_ENV(...) __VA_ARGS__
+#define CONFIG_SUBST_WCHAR 0
+#define ENABLE_SUBST_WCHAR 1
+#ifdef MAKE_SUID
+# define IF_SUBST_WCHAR(...) __VA_ARGS__ "CONFIG_SUBST_WCHAR"
+#else
+# define IF_SUBST_WCHAR(...) __VA_ARGS__
+#endif
+#define IF_NOT_SUBST_WCHAR(...)
+#define CONFIG_LAST_SUPPORTED_WCHAR 0
+#define ENABLE_LAST_SUPPORTED_WCHAR 1
+#ifdef MAKE_SUID
+# define IF_LAST_SUPPORTED_WCHAR(...) __VA_ARGS__ "CONFIG_LAST_SUPPORTED_WCHAR"
+#else
+# define IF_LAST_SUPPORTED_WCHAR(...) __VA_ARGS__
+#endif
+#define IF_NOT_LAST_SUPPORTED_WCHAR(...)
+#undef CONFIG_UNICODE_COMBINING_WCHARS
+#define ENABLE_UNICODE_COMBINING_WCHARS 0
+#define IF_UNICODE_COMBINING_WCHARS(...)
+#define IF_NOT_UNICODE_COMBINING_WCHARS(...) __VA_ARGS__
+#undef CONFIG_UNICODE_WIDE_WCHARS
+#define ENABLE_UNICODE_WIDE_WCHARS 0
+#define IF_UNICODE_WIDE_WCHARS(...)
+#define IF_NOT_UNICODE_WIDE_WCHARS(...) __VA_ARGS__
+#undef CONFIG_UNICODE_BIDI_SUPPORT
+#define ENABLE_UNICODE_BIDI_SUPPORT 0
+#define IF_UNICODE_BIDI_SUPPORT(...)
+#define IF_NOT_UNICODE_BIDI_SUPPORT(...) __VA_ARGS__
+#undef CONFIG_UNICODE_NEUTRAL_TABLE
+#define ENABLE_UNICODE_NEUTRAL_TABLE 0
+#define IF_UNICODE_NEUTRAL_TABLE(...)
+#define IF_NOT_UNICODE_NEUTRAL_TABLE(...) __VA_ARGS__
+#undef CONFIG_UNICODE_PRESERVE_BROKEN
+#define ENABLE_UNICODE_PRESERVE_BROKEN 0
+#define IF_UNICODE_PRESERVE_BROKEN(...)
+#define IF_NOT_UNICODE_PRESERVE_BROKEN(...) __VA_ARGS__
+#define CONFIG_FEATURE_NON_POSIX_CP 1
+#define ENABLE_FEATURE_NON_POSIX_CP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_NON_POSIX_CP(...) __VA_ARGS__ "CONFIG_FEATURE_NON_POSIX_CP"
+#else
+# define IF_FEATURE_NON_POSIX_CP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_NON_POSIX_CP(...)
+#define CONFIG_FEATURE_VERBOSE_CP_MESSAGE 1
+#define ENABLE_FEATURE_VERBOSE_CP_MESSAGE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VERBOSE_CP_MESSAGE(...) __VA_ARGS__ "CONFIG_FEATURE_VERBOSE_CP_MESSAGE"
+#else
+# define IF_FEATURE_VERBOSE_CP_MESSAGE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VERBOSE_CP_MESSAGE(...)
+#undef CONFIG_FEATURE_USE_SENDFILE
+#define ENABLE_FEATURE_USE_SENDFILE 0
+#define IF_FEATURE_USE_SENDFILE(...)
+#define IF_NOT_FEATURE_USE_SENDFILE(...) __VA_ARGS__
+#define CONFIG_FEATURE_COPYBUF_KB 1
+#define ENABLE_FEATURE_COPYBUF_KB 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_COPYBUF_KB(...) __VA_ARGS__ "CONFIG_FEATURE_COPYBUF_KB"
+#else
+# define IF_FEATURE_COPYBUF_KB(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_COPYBUF_KB(...)
+#define CONFIG_FEATURE_SKIP_ROOTFS 1
+#define ENABLE_FEATURE_SKIP_ROOTFS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SKIP_ROOTFS(...) __VA_ARGS__ "CONFIG_FEATURE_SKIP_ROOTFS"
+#else
+# define IF_FEATURE_SKIP_ROOTFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SKIP_ROOTFS(...)
+#undef CONFIG_MONOTONIC_SYSCALL
+#define ENABLE_MONOTONIC_SYSCALL 0
+#define IF_MONOTONIC_SYSCALL(...)
+#define IF_NOT_MONOTONIC_SYSCALL(...) __VA_ARGS__
+#define CONFIG_IOCTL_HEX2STR_ERROR 1
+#define ENABLE_IOCTL_HEX2STR_ERROR 1
+#ifdef MAKE_SUID
+# define IF_IOCTL_HEX2STR_ERROR(...) __VA_ARGS__ "CONFIG_IOCTL_HEX2STR_ERROR"
+#else
+# define IF_IOCTL_HEX2STR_ERROR(...) __VA_ARGS__
+#endif
+#define IF_NOT_IOCTL_HEX2STR_ERROR(...)
+#define CONFIG_FEATURE_HWIB 1
+#define ENABLE_FEATURE_HWIB 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HWIB(...) __VA_ARGS__ "CONFIG_FEATURE_HWIB"
+#else
+# define IF_FEATURE_HWIB(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HWIB(...)
+
+/*
+ * Applets
+ */
+
+/*
+ * Archival Utilities
+ */
+#define CONFIG_FEATURE_SEAMLESS_XZ 1
+#define ENABLE_FEATURE_SEAMLESS_XZ 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SEAMLESS_XZ(...) __VA_ARGS__ "CONFIG_FEATURE_SEAMLESS_XZ"
+#else
+# define IF_FEATURE_SEAMLESS_XZ(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SEAMLESS_XZ(...)
+#define CONFIG_FEATURE_SEAMLESS_LZMA 1
+#define ENABLE_FEATURE_SEAMLESS_LZMA 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SEAMLESS_LZMA(...) __VA_ARGS__ "CONFIG_FEATURE_SEAMLESS_LZMA"
+#else
+# define IF_FEATURE_SEAMLESS_LZMA(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SEAMLESS_LZMA(...)
+#define CONFIG_FEATURE_SEAMLESS_BZ2 1
+#define ENABLE_FEATURE_SEAMLESS_BZ2 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SEAMLESS_BZ2(...) __VA_ARGS__ "CONFIG_FEATURE_SEAMLESS_BZ2"
+#else
+# define IF_FEATURE_SEAMLESS_BZ2(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SEAMLESS_BZ2(...)
+#define CONFIG_FEATURE_SEAMLESS_GZ 1
+#define ENABLE_FEATURE_SEAMLESS_GZ 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SEAMLESS_GZ(...) __VA_ARGS__ "CONFIG_FEATURE_SEAMLESS_GZ"
+#else
+# define IF_FEATURE_SEAMLESS_GZ(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SEAMLESS_GZ(...)
+#define CONFIG_FEATURE_SEAMLESS_Z 1
+#define ENABLE_FEATURE_SEAMLESS_Z 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SEAMLESS_Z(...) __VA_ARGS__ "CONFIG_FEATURE_SEAMLESS_Z"
+#else
+# define IF_FEATURE_SEAMLESS_Z(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SEAMLESS_Z(...)
+#define CONFIG_AR 1
+#define ENABLE_AR 1
+#ifdef MAKE_SUID
+# define IF_AR(...) __VA_ARGS__ "CONFIG_AR"
+#else
+# define IF_AR(...) __VA_ARGS__
+#endif
+#define IF_NOT_AR(...)
+#define CONFIG_FEATURE_AR_LONG_FILENAMES 1
+#define ENABLE_FEATURE_AR_LONG_FILENAMES 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_AR_LONG_FILENAMES(...) __VA_ARGS__ "CONFIG_FEATURE_AR_LONG_FILENAMES"
+#else
+# define IF_FEATURE_AR_LONG_FILENAMES(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_AR_LONG_FILENAMES(...)
+#define CONFIG_FEATURE_AR_CREATE 1
+#define ENABLE_FEATURE_AR_CREATE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_AR_CREATE(...) __VA_ARGS__ "CONFIG_FEATURE_AR_CREATE"
+#else
+# define IF_FEATURE_AR_CREATE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_AR_CREATE(...)
+#define CONFIG_UNCOMPRESS 1
+#define ENABLE_UNCOMPRESS 1
+#ifdef MAKE_SUID
+# define IF_UNCOMPRESS(...) __VA_ARGS__ "CONFIG_UNCOMPRESS"
+#else
+# define IF_UNCOMPRESS(...) __VA_ARGS__
+#endif
+#define IF_NOT_UNCOMPRESS(...)
+#define CONFIG_GUNZIP 1
+#define ENABLE_GUNZIP 1
+#ifdef MAKE_SUID
+# define IF_GUNZIP(...) __VA_ARGS__ "CONFIG_GUNZIP"
+#else
+# define IF_GUNZIP(...) __VA_ARGS__
+#endif
+#define IF_NOT_GUNZIP(...)
+#define CONFIG_ZCAT 1
+#define ENABLE_ZCAT 1
+#ifdef MAKE_SUID
+# define IF_ZCAT(...) __VA_ARGS__ "CONFIG_ZCAT"
+#else
+# define IF_ZCAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_ZCAT(...)
+#define CONFIG_FEATURE_GUNZIP_LONG_OPTIONS 1
+#define ENABLE_FEATURE_GUNZIP_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_GUNZIP_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_GUNZIP_LONG_OPTIONS"
+#else
+# define IF_FEATURE_GUNZIP_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_GUNZIP_LONG_OPTIONS(...)
+#define CONFIG_BUNZIP2 1
+#define ENABLE_BUNZIP2 1
+#ifdef MAKE_SUID
+# define IF_BUNZIP2(...) __VA_ARGS__ "CONFIG_BUNZIP2"
+#else
+# define IF_BUNZIP2(...) __VA_ARGS__
+#endif
+#define IF_NOT_BUNZIP2(...)
+#define CONFIG_BZCAT 1
+#define ENABLE_BZCAT 1
+#ifdef MAKE_SUID
+# define IF_BZCAT(...) __VA_ARGS__ "CONFIG_BZCAT"
+#else
+# define IF_BZCAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_BZCAT(...)
+#define CONFIG_UNLZMA 1
+#define ENABLE_UNLZMA 1
+#ifdef MAKE_SUID
+# define IF_UNLZMA(...) __VA_ARGS__ "CONFIG_UNLZMA"
+#else
+# define IF_UNLZMA(...) __VA_ARGS__
+#endif
+#define IF_NOT_UNLZMA(...)
+#define CONFIG_LZCAT 1
+#define ENABLE_LZCAT 1
+#ifdef MAKE_SUID
+# define IF_LZCAT(...) __VA_ARGS__ "CONFIG_LZCAT"
+#else
+# define IF_LZCAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_LZCAT(...)
+#define CONFIG_LZMA 1
+#define ENABLE_LZMA 1
+#ifdef MAKE_SUID
+# define IF_LZMA(...) __VA_ARGS__ "CONFIG_LZMA"
+#else
+# define IF_LZMA(...) __VA_ARGS__
+#endif
+#define IF_NOT_LZMA(...)
+#define CONFIG_FEATURE_LZMA_FAST 1
+#define ENABLE_FEATURE_LZMA_FAST 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LZMA_FAST(...) __VA_ARGS__ "CONFIG_FEATURE_LZMA_FAST"
+#else
+# define IF_FEATURE_LZMA_FAST(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LZMA_FAST(...)
+#define CONFIG_UNXZ 1
+#define ENABLE_UNXZ 1
+#ifdef MAKE_SUID
+# define IF_UNXZ(...) __VA_ARGS__ "CONFIG_UNXZ"
+#else
+# define IF_UNXZ(...) __VA_ARGS__
+#endif
+#define IF_NOT_UNXZ(...)
+#define CONFIG_XZCAT 1
+#define ENABLE_XZCAT 1
+#ifdef MAKE_SUID
+# define IF_XZCAT(...) __VA_ARGS__ "CONFIG_XZCAT"
+#else
+# define IF_XZCAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_XZCAT(...)
+#define CONFIG_XZ 1
+#define ENABLE_XZ 1
+#ifdef MAKE_SUID
+# define IF_XZ(...) __VA_ARGS__ "CONFIG_XZ"
+#else
+# define IF_XZ(...) __VA_ARGS__
+#endif
+#define IF_NOT_XZ(...)
+#define CONFIG_BZIP2 1
+#define ENABLE_BZIP2 1
+#ifdef MAKE_SUID
+# define IF_BZIP2(...) __VA_ARGS__ "CONFIG_BZIP2"
+#else
+# define IF_BZIP2(...) __VA_ARGS__
+#endif
+#define IF_NOT_BZIP2(...)
+#define CONFIG_CPIO 1
+#define ENABLE_CPIO 1
+#ifdef MAKE_SUID
+# define IF_CPIO(...) __VA_ARGS__ "CONFIG_CPIO"
+#else
+# define IF_CPIO(...) __VA_ARGS__
+#endif
+#define IF_NOT_CPIO(...)
+#define CONFIG_FEATURE_CPIO_O 1
+#define ENABLE_FEATURE_CPIO_O 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CPIO_O(...) __VA_ARGS__ "CONFIG_FEATURE_CPIO_O"
+#else
+# define IF_FEATURE_CPIO_O(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CPIO_O(...)
+#define CONFIG_FEATURE_CPIO_P 1
+#define ENABLE_FEATURE_CPIO_P 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CPIO_P(...) __VA_ARGS__ "CONFIG_FEATURE_CPIO_P"
+#else
+# define IF_FEATURE_CPIO_P(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CPIO_P(...)
+#define CONFIG_DPKG 1
+#define ENABLE_DPKG 1
+#ifdef MAKE_SUID
+# define IF_DPKG(...) __VA_ARGS__ "CONFIG_DPKG"
+#else
+# define IF_DPKG(...) __VA_ARGS__
+#endif
+#define IF_NOT_DPKG(...)
+#define CONFIG_DPKG_DEB 1
+#define ENABLE_DPKG_DEB 1
+#ifdef MAKE_SUID
+# define IF_DPKG_DEB(...) __VA_ARGS__ "CONFIG_DPKG_DEB"
+#else
+# define IF_DPKG_DEB(...) __VA_ARGS__
+#endif
+#define IF_NOT_DPKG_DEB(...)
+#define CONFIG_GZIP 1
+#define ENABLE_GZIP 1
+#ifdef MAKE_SUID
+# define IF_GZIP(...) __VA_ARGS__ "CONFIG_GZIP"
+#else
+# define IF_GZIP(...) __VA_ARGS__
+#endif
+#define IF_NOT_GZIP(...)
+#define CONFIG_FEATURE_GZIP_LONG_OPTIONS 1
+#define ENABLE_FEATURE_GZIP_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_GZIP_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_GZIP_LONG_OPTIONS"
+#else
+# define IF_FEATURE_GZIP_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_GZIP_LONG_OPTIONS(...)
+#define CONFIG_GZIP_FAST 0
+#define ENABLE_GZIP_FAST 1
+#ifdef MAKE_SUID
+# define IF_GZIP_FAST(...) __VA_ARGS__ "CONFIG_GZIP_FAST"
+#else
+# define IF_GZIP_FAST(...) __VA_ARGS__
+#endif
+#define IF_NOT_GZIP_FAST(...)
+#undef CONFIG_FEATURE_GZIP_LEVELS
+#define ENABLE_FEATURE_GZIP_LEVELS 0
+#define IF_FEATURE_GZIP_LEVELS(...)
+#define IF_NOT_FEATURE_GZIP_LEVELS(...) __VA_ARGS__
+#define CONFIG_LZOP 1
+#define ENABLE_LZOP 1
+#ifdef MAKE_SUID
+# define IF_LZOP(...) __VA_ARGS__ "CONFIG_LZOP"
+#else
+# define IF_LZOP(...) __VA_ARGS__
+#endif
+#define IF_NOT_LZOP(...)
+#define CONFIG_UNLZOP 1
+#define ENABLE_UNLZOP 1
+#ifdef MAKE_SUID
+# define IF_UNLZOP(...) __VA_ARGS__ "CONFIG_UNLZOP"
+#else
+# define IF_UNLZOP(...) __VA_ARGS__
+#endif
+#define IF_NOT_UNLZOP(...)
+#define CONFIG_LZOPCAT 1
+#define ENABLE_LZOPCAT 1
+#ifdef MAKE_SUID
+# define IF_LZOPCAT(...) __VA_ARGS__ "CONFIG_LZOPCAT"
+#else
+# define IF_LZOPCAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_LZOPCAT(...)
+#define CONFIG_LZOP_COMPR_HIGH 1
+#define ENABLE_LZOP_COMPR_HIGH 1
+#ifdef MAKE_SUID
+# define IF_LZOP_COMPR_HIGH(...) __VA_ARGS__ "CONFIG_LZOP_COMPR_HIGH"
+#else
+# define IF_LZOP_COMPR_HIGH(...) __VA_ARGS__
+#endif
+#define IF_NOT_LZOP_COMPR_HIGH(...)
+#define CONFIG_RPM 1
+#define ENABLE_RPM 1
+#ifdef MAKE_SUID
+# define IF_RPM(...) __VA_ARGS__ "CONFIG_RPM"
+#else
+# define IF_RPM(...) __VA_ARGS__
+#endif
+#define IF_NOT_RPM(...)
+#define CONFIG_RPM2CPIO 1
+#define ENABLE_RPM2CPIO 1
+#ifdef MAKE_SUID
+# define IF_RPM2CPIO(...) __VA_ARGS__ "CONFIG_RPM2CPIO"
+#else
+# define IF_RPM2CPIO(...) __VA_ARGS__
+#endif
+#define IF_NOT_RPM2CPIO(...)
+#define CONFIG_TAR 1
+#define ENABLE_TAR 1
+#ifdef MAKE_SUID
+# define IF_TAR(...) __VA_ARGS__ "CONFIG_TAR"
+#else
+# define IF_TAR(...) __VA_ARGS__
+#endif
+#define IF_NOT_TAR(...)
+#define CONFIG_FEATURE_TAR_CREATE 1
+#define ENABLE_FEATURE_TAR_CREATE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TAR_CREATE(...) __VA_ARGS__ "CONFIG_FEATURE_TAR_CREATE"
+#else
+# define IF_FEATURE_TAR_CREATE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TAR_CREATE(...)
+#define CONFIG_FEATURE_TAR_AUTODETECT 1
+#define ENABLE_FEATURE_TAR_AUTODETECT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TAR_AUTODETECT(...) __VA_ARGS__ "CONFIG_FEATURE_TAR_AUTODETECT"
+#else
+# define IF_FEATURE_TAR_AUTODETECT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TAR_AUTODETECT(...)
+#define CONFIG_FEATURE_TAR_FROM 1
+#define ENABLE_FEATURE_TAR_FROM 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TAR_FROM(...) __VA_ARGS__ "CONFIG_FEATURE_TAR_FROM"
+#else
+# define IF_FEATURE_TAR_FROM(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TAR_FROM(...)
+#define CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY 1
+#define ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TAR_OLDGNU_COMPATIBILITY(...) __VA_ARGS__ "CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY"
+#else
+# define IF_FEATURE_TAR_OLDGNU_COMPATIBILITY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TAR_OLDGNU_COMPATIBILITY(...)
+#define CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY 1
+#define ENABLE_FEATURE_TAR_OLDSUN_COMPATIBILITY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TAR_OLDSUN_COMPATIBILITY(...) __VA_ARGS__ "CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY"
+#else
+# define IF_FEATURE_TAR_OLDSUN_COMPATIBILITY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TAR_OLDSUN_COMPATIBILITY(...)
+#define CONFIG_FEATURE_TAR_GNU_EXTENSIONS 1
+#define ENABLE_FEATURE_TAR_GNU_EXTENSIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TAR_GNU_EXTENSIONS(...) __VA_ARGS__ "CONFIG_FEATURE_TAR_GNU_EXTENSIONS"
+#else
+# define IF_FEATURE_TAR_GNU_EXTENSIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TAR_GNU_EXTENSIONS(...)
+#define CONFIG_FEATURE_TAR_LONG_OPTIONS 1
+#define ENABLE_FEATURE_TAR_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TAR_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_TAR_LONG_OPTIONS"
+#else
+# define IF_FEATURE_TAR_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TAR_LONG_OPTIONS(...)
+#define CONFIG_FEATURE_TAR_TO_COMMAND 1
+#define ENABLE_FEATURE_TAR_TO_COMMAND 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TAR_TO_COMMAND(...) __VA_ARGS__ "CONFIG_FEATURE_TAR_TO_COMMAND"
+#else
+# define IF_FEATURE_TAR_TO_COMMAND(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TAR_TO_COMMAND(...)
+#define CONFIG_FEATURE_TAR_UNAME_GNAME 1
+#define ENABLE_FEATURE_TAR_UNAME_GNAME 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TAR_UNAME_GNAME(...) __VA_ARGS__ "CONFIG_FEATURE_TAR_UNAME_GNAME"
+#else
+# define IF_FEATURE_TAR_UNAME_GNAME(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TAR_UNAME_GNAME(...)
+#define CONFIG_FEATURE_TAR_NOPRESERVE_TIME 1
+#define ENABLE_FEATURE_TAR_NOPRESERVE_TIME 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TAR_NOPRESERVE_TIME(...) __VA_ARGS__ "CONFIG_FEATURE_TAR_NOPRESERVE_TIME"
+#else
+# define IF_FEATURE_TAR_NOPRESERVE_TIME(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TAR_NOPRESERVE_TIME(...)
+#undef CONFIG_FEATURE_TAR_SELINUX
+#define ENABLE_FEATURE_TAR_SELINUX 0
+#define IF_FEATURE_TAR_SELINUX(...)
+#define IF_NOT_FEATURE_TAR_SELINUX(...) __VA_ARGS__
+#define CONFIG_UNZIP 1
+#define ENABLE_UNZIP 1
+#ifdef MAKE_SUID
+# define IF_UNZIP(...) __VA_ARGS__ "CONFIG_UNZIP"
+#else
+# define IF_UNZIP(...) __VA_ARGS__
+#endif
+#define IF_NOT_UNZIP(...)
+
+/*
+ * Coreutils
+ */
+#define CONFIG_BASENAME 1
+#define ENABLE_BASENAME 1
+#ifdef MAKE_SUID
+# define IF_BASENAME(...) __VA_ARGS__ "CONFIG_BASENAME"
+#else
+# define IF_BASENAME(...) __VA_ARGS__
+#endif
+#define IF_NOT_BASENAME(...)
+#define CONFIG_CAL 1
+#define ENABLE_CAL 1
+#ifdef MAKE_SUID
+# define IF_CAL(...) __VA_ARGS__ "CONFIG_CAL"
+#else
+# define IF_CAL(...) __VA_ARGS__
+#endif
+#define IF_NOT_CAL(...)
+#define CONFIG_CAT 1
+#define ENABLE_CAT 1
+#ifdef MAKE_SUID
+# define IF_CAT(...) __VA_ARGS__ "CONFIG_CAT"
+#else
+# define IF_CAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_CAT(...)
+#define CONFIG_CATV 1
+#define ENABLE_CATV 1
+#ifdef MAKE_SUID
+# define IF_CATV(...) __VA_ARGS__ "CONFIG_CATV"
+#else
+# define IF_CATV(...) __VA_ARGS__
+#endif
+#define IF_NOT_CATV(...)
+#define CONFIG_CHGRP 1
+#define ENABLE_CHGRP 1
+#ifdef MAKE_SUID
+# define IF_CHGRP(...) __VA_ARGS__ "CONFIG_CHGRP"
+#else
+# define IF_CHGRP(...) __VA_ARGS__
+#endif
+#define IF_NOT_CHGRP(...)
+#define CONFIG_CHMOD 1
+#define ENABLE_CHMOD 1
+#ifdef MAKE_SUID
+# define IF_CHMOD(...) __VA_ARGS__ "CONFIG_CHMOD"
+#else
+# define IF_CHMOD(...) __VA_ARGS__
+#endif
+#define IF_NOT_CHMOD(...)
+#define CONFIG_CHOWN 1
+#define ENABLE_CHOWN 1
+#ifdef MAKE_SUID
+# define IF_CHOWN(...) __VA_ARGS__ "CONFIG_CHOWN"
+#else
+# define IF_CHOWN(...) __VA_ARGS__
+#endif
+#define IF_NOT_CHOWN(...)
+#define CONFIG_FEATURE_CHOWN_LONG_OPTIONS 1
+#define ENABLE_FEATURE_CHOWN_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CHOWN_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_CHOWN_LONG_OPTIONS"
+#else
+# define IF_FEATURE_CHOWN_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CHOWN_LONG_OPTIONS(...)
+#define CONFIG_CHROOT 1
+#define ENABLE_CHROOT 1
+#ifdef MAKE_SUID
+# define IF_CHROOT(...) __VA_ARGS__ "CONFIG_CHROOT"
+#else
+# define IF_CHROOT(...) __VA_ARGS__
+#endif
+#define IF_NOT_CHROOT(...)
+#define CONFIG_CKSUM 1
+#define ENABLE_CKSUM 1
+#ifdef MAKE_SUID
+# define IF_CKSUM(...) __VA_ARGS__ "CONFIG_CKSUM"
+#else
+# define IF_CKSUM(...) __VA_ARGS__
+#endif
+#define IF_NOT_CKSUM(...)
+#define CONFIG_COMM 1
+#define ENABLE_COMM 1
+#ifdef MAKE_SUID
+# define IF_COMM(...) __VA_ARGS__ "CONFIG_COMM"
+#else
+# define IF_COMM(...) __VA_ARGS__
+#endif
+#define IF_NOT_COMM(...)
+#define CONFIG_CP 1
+#define ENABLE_CP 1
+#ifdef MAKE_SUID
+# define IF_CP(...) __VA_ARGS__ "CONFIG_CP"
+#else
+# define IF_CP(...) __VA_ARGS__
+#endif
+#define IF_NOT_CP(...)
+#define CONFIG_FEATURE_CP_LONG_OPTIONS 1
+#define ENABLE_FEATURE_CP_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CP_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_CP_LONG_OPTIONS"
+#else
+# define IF_FEATURE_CP_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CP_LONG_OPTIONS(...)
+#define CONFIG_CUT 1
+#define ENABLE_CUT 1
+#ifdef MAKE_SUID
+# define IF_CUT(...) __VA_ARGS__ "CONFIG_CUT"
+#else
+# define IF_CUT(...) __VA_ARGS__
+#endif
+#define IF_NOT_CUT(...)
+#define CONFIG_DATE 1
+#define ENABLE_DATE 1
+#ifdef MAKE_SUID
+# define IF_DATE(...) __VA_ARGS__ "CONFIG_DATE"
+#else
+# define IF_DATE(...) __VA_ARGS__
+#endif
+#define IF_NOT_DATE(...)
+#define CONFIG_FEATURE_DATE_ISOFMT 1
+#define ENABLE_FEATURE_DATE_ISOFMT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DATE_ISOFMT(...) __VA_ARGS__ "CONFIG_FEATURE_DATE_ISOFMT"
+#else
+# define IF_FEATURE_DATE_ISOFMT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DATE_ISOFMT(...)
+#undef CONFIG_FEATURE_DATE_NANO
+#define ENABLE_FEATURE_DATE_NANO 0
+#define IF_FEATURE_DATE_NANO(...)
+#define IF_NOT_FEATURE_DATE_NANO(...) __VA_ARGS__
+#define CONFIG_FEATURE_DATE_COMPAT 1
+#define ENABLE_FEATURE_DATE_COMPAT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DATE_COMPAT(...) __VA_ARGS__ "CONFIG_FEATURE_DATE_COMPAT"
+#else
+# define IF_FEATURE_DATE_COMPAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DATE_COMPAT(...)
+#define CONFIG_DD 1
+#define ENABLE_DD 1
+#ifdef MAKE_SUID
+# define IF_DD(...) __VA_ARGS__ "CONFIG_DD"
+#else
+# define IF_DD(...) __VA_ARGS__
+#endif
+#define IF_NOT_DD(...)
+#define CONFIG_FEATURE_DD_SIGNAL_HANDLING 1
+#define ENABLE_FEATURE_DD_SIGNAL_HANDLING 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DD_SIGNAL_HANDLING(...) __VA_ARGS__ "CONFIG_FEATURE_DD_SIGNAL_HANDLING"
+#else
+# define IF_FEATURE_DD_SIGNAL_HANDLING(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DD_SIGNAL_HANDLING(...)
+#define CONFIG_FEATURE_DD_THIRD_STATUS_LINE 1
+#define ENABLE_FEATURE_DD_THIRD_STATUS_LINE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DD_THIRD_STATUS_LINE(...) __VA_ARGS__ "CONFIG_FEATURE_DD_THIRD_STATUS_LINE"
+#else
+# define IF_FEATURE_DD_THIRD_STATUS_LINE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DD_THIRD_STATUS_LINE(...)
+#define CONFIG_FEATURE_DD_IBS_OBS 1
+#define ENABLE_FEATURE_DD_IBS_OBS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DD_IBS_OBS(...) __VA_ARGS__ "CONFIG_FEATURE_DD_IBS_OBS"
+#else
+# define IF_FEATURE_DD_IBS_OBS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DD_IBS_OBS(...)
+#define CONFIG_FEATURE_DD_STATUS 1
+#define ENABLE_FEATURE_DD_STATUS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DD_STATUS(...) __VA_ARGS__ "CONFIG_FEATURE_DD_STATUS"
+#else
+# define IF_FEATURE_DD_STATUS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DD_STATUS(...)
+#define CONFIG_DF 1
+#define ENABLE_DF 1
+#ifdef MAKE_SUID
+# define IF_DF(...) __VA_ARGS__ "CONFIG_DF"
+#else
+# define IF_DF(...) __VA_ARGS__
+#endif
+#define IF_NOT_DF(...)
+#define CONFIG_FEATURE_DF_FANCY 1
+#define ENABLE_FEATURE_DF_FANCY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DF_FANCY(...) __VA_ARGS__ "CONFIG_FEATURE_DF_FANCY"
+#else
+# define IF_FEATURE_DF_FANCY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DF_FANCY(...)
+#define CONFIG_DIRNAME 1
+#define ENABLE_DIRNAME 1
+#ifdef MAKE_SUID
+# define IF_DIRNAME(...) __VA_ARGS__ "CONFIG_DIRNAME"
+#else
+# define IF_DIRNAME(...) __VA_ARGS__
+#endif
+#define IF_NOT_DIRNAME(...)
+#define CONFIG_DOS2UNIX 1
+#define ENABLE_DOS2UNIX 1
+#ifdef MAKE_SUID
+# define IF_DOS2UNIX(...) __VA_ARGS__ "CONFIG_DOS2UNIX"
+#else
+# define IF_DOS2UNIX(...) __VA_ARGS__
+#endif
+#define IF_NOT_DOS2UNIX(...)
+#define CONFIG_UNIX2DOS 1
+#define ENABLE_UNIX2DOS 1
+#ifdef MAKE_SUID
+# define IF_UNIX2DOS(...) __VA_ARGS__ "CONFIG_UNIX2DOS"
+#else
+# define IF_UNIX2DOS(...) __VA_ARGS__
+#endif
+#define IF_NOT_UNIX2DOS(...)
+#define CONFIG_DU 1
+#define ENABLE_DU 1
+#ifdef MAKE_SUID
+# define IF_DU(...) __VA_ARGS__ "CONFIG_DU"
+#else
+# define IF_DU(...) __VA_ARGS__
+#endif
+#define IF_NOT_DU(...)
+#define CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K 1
+#define ENABLE_FEATURE_DU_DEFAULT_BLOCKSIZE_1K 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(...) __VA_ARGS__ "CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K"
+#else
+# define IF_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(...)
+#define CONFIG_ECHO 1
+#define ENABLE_ECHO 1
+#ifdef MAKE_SUID
+# define IF_ECHO(...) __VA_ARGS__ "CONFIG_ECHO"
+#else
+# define IF_ECHO(...) __VA_ARGS__
+#endif
+#define IF_NOT_ECHO(...)
+#define CONFIG_FEATURE_FANCY_ECHO 1
+#define ENABLE_FEATURE_FANCY_ECHO 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FANCY_ECHO(...) __VA_ARGS__ "CONFIG_FEATURE_FANCY_ECHO"
+#else
+# define IF_FEATURE_FANCY_ECHO(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FANCY_ECHO(...)
+#define CONFIG_ENV 1
+#define ENABLE_ENV 1
+#ifdef MAKE_SUID
+# define IF_ENV(...) __VA_ARGS__ "CONFIG_ENV"
+#else
+# define IF_ENV(...) __VA_ARGS__
+#endif
+#define IF_NOT_ENV(...)
+#define CONFIG_FEATURE_ENV_LONG_OPTIONS 1
+#define ENABLE_FEATURE_ENV_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_ENV_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_ENV_LONG_OPTIONS"
+#else
+# define IF_FEATURE_ENV_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_ENV_LONG_OPTIONS(...)
+#define CONFIG_EXPAND 1
+#define ENABLE_EXPAND 1
+#ifdef MAKE_SUID
+# define IF_EXPAND(...) __VA_ARGS__ "CONFIG_EXPAND"
+#else
+# define IF_EXPAND(...) __VA_ARGS__
+#endif
+#define IF_NOT_EXPAND(...)
+#define CONFIG_FEATURE_EXPAND_LONG_OPTIONS 1
+#define ENABLE_FEATURE_EXPAND_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_EXPAND_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_EXPAND_LONG_OPTIONS"
+#else
+# define IF_FEATURE_EXPAND_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_EXPAND_LONG_OPTIONS(...)
+#define CONFIG_UNEXPAND 1
+#define ENABLE_UNEXPAND 1
+#ifdef MAKE_SUID
+# define IF_UNEXPAND(...) __VA_ARGS__ "CONFIG_UNEXPAND"
+#else
+# define IF_UNEXPAND(...) __VA_ARGS__
+#endif
+#define IF_NOT_UNEXPAND(...)
+#define CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS 1
+#define ENABLE_FEATURE_UNEXPAND_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_UNEXPAND_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS"
+#else
+# define IF_FEATURE_UNEXPAND_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_UNEXPAND_LONG_OPTIONS(...)
+#define CONFIG_EXPR 1
+#define ENABLE_EXPR 1
+#ifdef MAKE_SUID
+# define IF_EXPR(...) __VA_ARGS__ "CONFIG_EXPR"
+#else
+# define IF_EXPR(...) __VA_ARGS__
+#endif
+#define IF_NOT_EXPR(...)
+#define CONFIG_EXPR_MATH_SUPPORT_64 1
+#define ENABLE_EXPR_MATH_SUPPORT_64 1
+#ifdef MAKE_SUID
+# define IF_EXPR_MATH_SUPPORT_64(...) __VA_ARGS__ "CONFIG_EXPR_MATH_SUPPORT_64"
+#else
+# define IF_EXPR_MATH_SUPPORT_64(...) __VA_ARGS__
+#endif
+#define IF_NOT_EXPR_MATH_SUPPORT_64(...)
+#define CONFIG_FALSE 1
+#define ENABLE_FALSE 1
+#ifdef MAKE_SUID
+# define IF_FALSE(...) __VA_ARGS__ "CONFIG_FALSE"
+#else
+# define IF_FALSE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FALSE(...)
+#define CONFIG_FOLD 1
+#define ENABLE_FOLD 1
+#ifdef MAKE_SUID
+# define IF_FOLD(...) __VA_ARGS__ "CONFIG_FOLD"
+#else
+# define IF_FOLD(...) __VA_ARGS__
+#endif
+#define IF_NOT_FOLD(...)
+#define CONFIG_FSYNC 1
+#define ENABLE_FSYNC 1
+#ifdef MAKE_SUID
+# define IF_FSYNC(...) __VA_ARGS__ "CONFIG_FSYNC"
+#else
+# define IF_FSYNC(...) __VA_ARGS__
+#endif
+#define IF_NOT_FSYNC(...)
+#define CONFIG_HEAD 1
+#define ENABLE_HEAD 1
+#ifdef MAKE_SUID
+# define IF_HEAD(...) __VA_ARGS__ "CONFIG_HEAD"
+#else
+# define IF_HEAD(...) __VA_ARGS__
+#endif
+#define IF_NOT_HEAD(...)
+#define CONFIG_FEATURE_FANCY_HEAD 1
+#define ENABLE_FEATURE_FANCY_HEAD 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FANCY_HEAD(...) __VA_ARGS__ "CONFIG_FEATURE_FANCY_HEAD"
+#else
+# define IF_FEATURE_FANCY_HEAD(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FANCY_HEAD(...)
+#define CONFIG_HOSTID 1
+#define ENABLE_HOSTID 1
+#ifdef MAKE_SUID
+# define IF_HOSTID(...) __VA_ARGS__ "CONFIG_HOSTID"
+#else
+# define IF_HOSTID(...) __VA_ARGS__
+#endif
+#define IF_NOT_HOSTID(...)
+#define CONFIG_ID 1
+#define ENABLE_ID 1
+#ifdef MAKE_SUID
+# define IF_ID(...) __VA_ARGS__ "CONFIG_ID"
+#else
+# define IF_ID(...) __VA_ARGS__
+#endif
+#define IF_NOT_ID(...)
+#define CONFIG_GROUPS 1
+#define ENABLE_GROUPS 1
+#ifdef MAKE_SUID
+# define IF_GROUPS(...) __VA_ARGS__ "CONFIG_GROUPS"
+#else
+# define IF_GROUPS(...) __VA_ARGS__
+#endif
+#define IF_NOT_GROUPS(...)
+#define CONFIG_INSTALL 1
+#define ENABLE_INSTALL 1
+#ifdef MAKE_SUID
+# define IF_INSTALL(...) __VA_ARGS__ "CONFIG_INSTALL"
+#else
+# define IF_INSTALL(...) __VA_ARGS__
+#endif
+#define IF_NOT_INSTALL(...)
+#define CONFIG_FEATURE_INSTALL_LONG_OPTIONS 1
+#define ENABLE_FEATURE_INSTALL_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_INSTALL_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_INSTALL_LONG_OPTIONS"
+#else
+# define IF_FEATURE_INSTALL_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_INSTALL_LONG_OPTIONS(...)
+#define CONFIG_LN 1
+#define ENABLE_LN 1
+#ifdef MAKE_SUID
+# define IF_LN(...) __VA_ARGS__ "CONFIG_LN"
+#else
+# define IF_LN(...) __VA_ARGS__
+#endif
+#define IF_NOT_LN(...)
+#define CONFIG_LOGNAME 1
+#define ENABLE_LOGNAME 1
+#ifdef MAKE_SUID
+# define IF_LOGNAME(...) __VA_ARGS__ "CONFIG_LOGNAME"
+#else
+# define IF_LOGNAME(...) __VA_ARGS__
+#endif
+#define IF_NOT_LOGNAME(...)
+#define CONFIG_LS 1
+#define ENABLE_LS 1
+#ifdef MAKE_SUID
+# define IF_LS(...) __VA_ARGS__ "CONFIG_LS"
+#else
+# define IF_LS(...) __VA_ARGS__
+#endif
+#define IF_NOT_LS(...)
+#define CONFIG_FEATURE_LS_FILETYPES 1
+#define ENABLE_FEATURE_LS_FILETYPES 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LS_FILETYPES(...) __VA_ARGS__ "CONFIG_FEATURE_LS_FILETYPES"
+#else
+# define IF_FEATURE_LS_FILETYPES(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LS_FILETYPES(...)
+#define CONFIG_FEATURE_LS_FOLLOWLINKS 1
+#define ENABLE_FEATURE_LS_FOLLOWLINKS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LS_FOLLOWLINKS(...) __VA_ARGS__ "CONFIG_FEATURE_LS_FOLLOWLINKS"
+#else
+# define IF_FEATURE_LS_FOLLOWLINKS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LS_FOLLOWLINKS(...)
+#define CONFIG_FEATURE_LS_RECURSIVE 1
+#define ENABLE_FEATURE_LS_RECURSIVE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LS_RECURSIVE(...) __VA_ARGS__ "CONFIG_FEATURE_LS_RECURSIVE"
+#else
+# define IF_FEATURE_LS_RECURSIVE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LS_RECURSIVE(...)
+#define CONFIG_FEATURE_LS_SORTFILES 1
+#define ENABLE_FEATURE_LS_SORTFILES 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LS_SORTFILES(...) __VA_ARGS__ "CONFIG_FEATURE_LS_SORTFILES"
+#else
+# define IF_FEATURE_LS_SORTFILES(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LS_SORTFILES(...)
+#define CONFIG_FEATURE_LS_TIMESTAMPS 1
+#define ENABLE_FEATURE_LS_TIMESTAMPS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LS_TIMESTAMPS(...) __VA_ARGS__ "CONFIG_FEATURE_LS_TIMESTAMPS"
+#else
+# define IF_FEATURE_LS_TIMESTAMPS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LS_TIMESTAMPS(...)
+#define CONFIG_FEATURE_LS_USERNAME 1
+#define ENABLE_FEATURE_LS_USERNAME 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LS_USERNAME(...) __VA_ARGS__ "CONFIG_FEATURE_LS_USERNAME"
+#else
+# define IF_FEATURE_LS_USERNAME(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LS_USERNAME(...)
+#define CONFIG_FEATURE_LS_COLOR 1
+#define ENABLE_FEATURE_LS_COLOR 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LS_COLOR(...) __VA_ARGS__ "CONFIG_FEATURE_LS_COLOR"
+#else
+# define IF_FEATURE_LS_COLOR(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LS_COLOR(...)
+#define CONFIG_FEATURE_LS_COLOR_IS_DEFAULT 1
+#define ENABLE_FEATURE_LS_COLOR_IS_DEFAULT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LS_COLOR_IS_DEFAULT(...) __VA_ARGS__ "CONFIG_FEATURE_LS_COLOR_IS_DEFAULT"
+#else
+# define IF_FEATURE_LS_COLOR_IS_DEFAULT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LS_COLOR_IS_DEFAULT(...)
+#define CONFIG_MD5SUM 1
+#define ENABLE_MD5SUM 1
+#ifdef MAKE_SUID
+# define IF_MD5SUM(...) __VA_ARGS__ "CONFIG_MD5SUM"
+#else
+# define IF_MD5SUM(...) __VA_ARGS__
+#endif
+#define IF_NOT_MD5SUM(...)
+#define CONFIG_SHA1SUM 1
+#define ENABLE_SHA1SUM 1
+#ifdef MAKE_SUID
+# define IF_SHA1SUM(...) __VA_ARGS__ "CONFIG_SHA1SUM"
+#else
+# define IF_SHA1SUM(...) __VA_ARGS__
+#endif
+#define IF_NOT_SHA1SUM(...)
+#define CONFIG_SHA256SUM 1
+#define ENABLE_SHA256SUM 1
+#ifdef MAKE_SUID
+# define IF_SHA256SUM(...) __VA_ARGS__ "CONFIG_SHA256SUM"
+#else
+# define IF_SHA256SUM(...) __VA_ARGS__
+#endif
+#define IF_NOT_SHA256SUM(...)
+#define CONFIG_SHA512SUM 1
+#define ENABLE_SHA512SUM 1
+#ifdef MAKE_SUID
+# define IF_SHA512SUM(...) __VA_ARGS__ "CONFIG_SHA512SUM"
+#else
+# define IF_SHA512SUM(...) __VA_ARGS__
+#endif
+#define IF_NOT_SHA512SUM(...)
+#define CONFIG_SHA3SUM 1
+#define ENABLE_SHA3SUM 1
+#ifdef MAKE_SUID
+# define IF_SHA3SUM(...) __VA_ARGS__ "CONFIG_SHA3SUM"
+#else
+# define IF_SHA3SUM(...) __VA_ARGS__
+#endif
+#define IF_NOT_SHA3SUM(...)
+
+/*
+ * Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum
+ */
+#define CONFIG_FEATURE_MD5_SHA1_SUM_CHECK 1
+#define ENABLE_FEATURE_MD5_SHA1_SUM_CHECK 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MD5_SHA1_SUM_CHECK(...) __VA_ARGS__ "CONFIG_FEATURE_MD5_SHA1_SUM_CHECK"
+#else
+# define IF_FEATURE_MD5_SHA1_SUM_CHECK(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MD5_SHA1_SUM_CHECK(...)
+#define CONFIG_MKDIR 1
+#define ENABLE_MKDIR 1
+#ifdef MAKE_SUID
+# define IF_MKDIR(...) __VA_ARGS__ "CONFIG_MKDIR"
+#else
+# define IF_MKDIR(...) __VA_ARGS__
+#endif
+#define IF_NOT_MKDIR(...)
+#define CONFIG_FEATURE_MKDIR_LONG_OPTIONS 1
+#define ENABLE_FEATURE_MKDIR_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MKDIR_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_MKDIR_LONG_OPTIONS"
+#else
+# define IF_FEATURE_MKDIR_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MKDIR_LONG_OPTIONS(...)
+#define CONFIG_MKFIFO 1
+#define ENABLE_MKFIFO 1
+#ifdef MAKE_SUID
+# define IF_MKFIFO(...) __VA_ARGS__ "CONFIG_MKFIFO"
+#else
+# define IF_MKFIFO(...) __VA_ARGS__
+#endif
+#define IF_NOT_MKFIFO(...)
+#define CONFIG_MKNOD 1
+#define ENABLE_MKNOD 1
+#ifdef MAKE_SUID
+# define IF_MKNOD(...) __VA_ARGS__ "CONFIG_MKNOD"
+#else
+# define IF_MKNOD(...) __VA_ARGS__
+#endif
+#define IF_NOT_MKNOD(...)
+#define CONFIG_MV 1
+#define ENABLE_MV 1
+#ifdef MAKE_SUID
+# define IF_MV(...) __VA_ARGS__ "CONFIG_MV"
+#else
+# define IF_MV(...) __VA_ARGS__
+#endif
+#define IF_NOT_MV(...)
+#define CONFIG_FEATURE_MV_LONG_OPTIONS 1
+#define ENABLE_FEATURE_MV_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MV_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_MV_LONG_OPTIONS"
+#else
+# define IF_FEATURE_MV_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MV_LONG_OPTIONS(...)
+#define CONFIG_NICE 1
+#define ENABLE_NICE 1
+#ifdef MAKE_SUID
+# define IF_NICE(...) __VA_ARGS__ "CONFIG_NICE"
+#else
+# define IF_NICE(...) __VA_ARGS__
+#endif
+#define IF_NOT_NICE(...)
+#define CONFIG_NOHUP 1
+#define ENABLE_NOHUP 1
+#ifdef MAKE_SUID
+# define IF_NOHUP(...) __VA_ARGS__ "CONFIG_NOHUP"
+#else
+# define IF_NOHUP(...) __VA_ARGS__
+#endif
+#define IF_NOT_NOHUP(...)
+#define CONFIG_OD 1
+#define ENABLE_OD 1
+#ifdef MAKE_SUID
+# define IF_OD(...) __VA_ARGS__ "CONFIG_OD"
+#else
+# define IF_OD(...) __VA_ARGS__
+#endif
+#define IF_NOT_OD(...)
+#define CONFIG_PRINTENV 1
+#define ENABLE_PRINTENV 1
+#ifdef MAKE_SUID
+# define IF_PRINTENV(...) __VA_ARGS__ "CONFIG_PRINTENV"
+#else
+# define IF_PRINTENV(...) __VA_ARGS__
+#endif
+#define IF_NOT_PRINTENV(...)
+#define CONFIG_PRINTF 1
+#define ENABLE_PRINTF 1
+#ifdef MAKE_SUID
+# define IF_PRINTF(...) __VA_ARGS__ "CONFIG_PRINTF"
+#else
+# define IF_PRINTF(...) __VA_ARGS__
+#endif
+#define IF_NOT_PRINTF(...)
+#define CONFIG_PWD 1
+#define ENABLE_PWD 1
+#ifdef MAKE_SUID
+# define IF_PWD(...) __VA_ARGS__ "CONFIG_PWD"
+#else
+# define IF_PWD(...) __VA_ARGS__
+#endif
+#define IF_NOT_PWD(...)
+#define CONFIG_READLINK 1
+#define ENABLE_READLINK 1
+#ifdef MAKE_SUID
+# define IF_READLINK(...) __VA_ARGS__ "CONFIG_READLINK"
+#else
+# define IF_READLINK(...) __VA_ARGS__
+#endif
+#define IF_NOT_READLINK(...)
+#define CONFIG_FEATURE_READLINK_FOLLOW 1
+#define ENABLE_FEATURE_READLINK_FOLLOW 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_READLINK_FOLLOW(...) __VA_ARGS__ "CONFIG_FEATURE_READLINK_FOLLOW"
+#else
+# define IF_FEATURE_READLINK_FOLLOW(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_READLINK_FOLLOW(...)
+#define CONFIG_REALPATH 1
+#define ENABLE_REALPATH 1
+#ifdef MAKE_SUID
+# define IF_REALPATH(...) __VA_ARGS__ "CONFIG_REALPATH"
+#else
+# define IF_REALPATH(...) __VA_ARGS__
+#endif
+#define IF_NOT_REALPATH(...)
+#define CONFIG_RM 1
+#define ENABLE_RM 1
+#ifdef MAKE_SUID
+# define IF_RM(...) __VA_ARGS__ "CONFIG_RM"
+#else
+# define IF_RM(...) __VA_ARGS__
+#endif
+#define IF_NOT_RM(...)
+#define CONFIG_RMDIR 1
+#define ENABLE_RMDIR 1
+#ifdef MAKE_SUID
+# define IF_RMDIR(...) __VA_ARGS__ "CONFIG_RMDIR"
+#else
+# define IF_RMDIR(...) __VA_ARGS__
+#endif
+#define IF_NOT_RMDIR(...)
+#define CONFIG_FEATURE_RMDIR_LONG_OPTIONS 1
+#define ENABLE_FEATURE_RMDIR_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_RMDIR_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_RMDIR_LONG_OPTIONS"
+#else
+# define IF_FEATURE_RMDIR_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_RMDIR_LONG_OPTIONS(...)
+#define CONFIG_SEQ 1
+#define ENABLE_SEQ 1
+#ifdef MAKE_SUID
+# define IF_SEQ(...) __VA_ARGS__ "CONFIG_SEQ"
+#else
+# define IF_SEQ(...) __VA_ARGS__
+#endif
+#define IF_NOT_SEQ(...)
+#define CONFIG_SHUF 1
+#define ENABLE_SHUF 1
+#ifdef MAKE_SUID
+# define IF_SHUF(...) __VA_ARGS__ "CONFIG_SHUF"
+#else
+# define IF_SHUF(...) __VA_ARGS__
+#endif
+#define IF_NOT_SHUF(...)
+#define CONFIG_SLEEP 1
+#define ENABLE_SLEEP 1
+#ifdef MAKE_SUID
+# define IF_SLEEP(...) __VA_ARGS__ "CONFIG_SLEEP"
+#else
+# define IF_SLEEP(...) __VA_ARGS__
+#endif
+#define IF_NOT_SLEEP(...)
+#define CONFIG_FEATURE_FANCY_SLEEP 1
+#define ENABLE_FEATURE_FANCY_SLEEP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FANCY_SLEEP(...) __VA_ARGS__ "CONFIG_FEATURE_FANCY_SLEEP"
+#else
+# define IF_FEATURE_FANCY_SLEEP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FANCY_SLEEP(...)
+#define CONFIG_FEATURE_FLOAT_SLEEP 1
+#define ENABLE_FEATURE_FLOAT_SLEEP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FLOAT_SLEEP(...) __VA_ARGS__ "CONFIG_FEATURE_FLOAT_SLEEP"
+#else
+# define IF_FEATURE_FLOAT_SLEEP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FLOAT_SLEEP(...)
+#define CONFIG_SORT 1
+#define ENABLE_SORT 1
+#ifdef MAKE_SUID
+# define IF_SORT(...) __VA_ARGS__ "CONFIG_SORT"
+#else
+# define IF_SORT(...) __VA_ARGS__
+#endif
+#define IF_NOT_SORT(...)
+#define CONFIG_FEATURE_SORT_BIG 1
+#define ENABLE_FEATURE_SORT_BIG 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SORT_BIG(...) __VA_ARGS__ "CONFIG_FEATURE_SORT_BIG"
+#else
+# define IF_FEATURE_SORT_BIG(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SORT_BIG(...)
+#define CONFIG_SPLIT 1
+#define ENABLE_SPLIT 1
+#ifdef MAKE_SUID
+# define IF_SPLIT(...) __VA_ARGS__ "CONFIG_SPLIT"
+#else
+# define IF_SPLIT(...) __VA_ARGS__
+#endif
+#define IF_NOT_SPLIT(...)
+#define CONFIG_FEATURE_SPLIT_FANCY 1
+#define ENABLE_FEATURE_SPLIT_FANCY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SPLIT_FANCY(...) __VA_ARGS__ "CONFIG_FEATURE_SPLIT_FANCY"
+#else
+# define IF_FEATURE_SPLIT_FANCY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SPLIT_FANCY(...)
+#define CONFIG_STAT 1
+#define ENABLE_STAT 1
+#ifdef MAKE_SUID
+# define IF_STAT(...) __VA_ARGS__ "CONFIG_STAT"
+#else
+# define IF_STAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_STAT(...)
+#define CONFIG_FEATURE_STAT_FORMAT 1
+#define ENABLE_FEATURE_STAT_FORMAT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_STAT_FORMAT(...) __VA_ARGS__ "CONFIG_FEATURE_STAT_FORMAT"
+#else
+# define IF_FEATURE_STAT_FORMAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_STAT_FORMAT(...)
+#define CONFIG_FEATURE_STAT_FILESYSTEM 1
+#define ENABLE_FEATURE_STAT_FILESYSTEM 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_STAT_FILESYSTEM(...) __VA_ARGS__ "CONFIG_FEATURE_STAT_FILESYSTEM"
+#else
+# define IF_FEATURE_STAT_FILESYSTEM(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_STAT_FILESYSTEM(...)
+#define CONFIG_STTY 1
+#define ENABLE_STTY 1
+#ifdef MAKE_SUID
+# define IF_STTY(...) __VA_ARGS__ "CONFIG_STTY"
+#else
+# define IF_STTY(...) __VA_ARGS__
+#endif
+#define IF_NOT_STTY(...)
+#define CONFIG_SUM 1
+#define ENABLE_SUM 1
+#ifdef MAKE_SUID
+# define IF_SUM(...) __VA_ARGS__ "CONFIG_SUM"
+#else
+# define IF_SUM(...) __VA_ARGS__
+#endif
+#define IF_NOT_SUM(...)
+#define CONFIG_SYNC 1
+#define ENABLE_SYNC 1
+#ifdef MAKE_SUID
+# define IF_SYNC(...) __VA_ARGS__ "CONFIG_SYNC"
+#else
+# define IF_SYNC(...) __VA_ARGS__
+#endif
+#define IF_NOT_SYNC(...)
+#define CONFIG_FEATURE_SYNC_FANCY 1
+#define ENABLE_FEATURE_SYNC_FANCY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SYNC_FANCY(...) __VA_ARGS__ "CONFIG_FEATURE_SYNC_FANCY"
+#else
+# define IF_FEATURE_SYNC_FANCY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SYNC_FANCY(...)
+#define CONFIG_TAC 1
+#define ENABLE_TAC 1
+#ifdef MAKE_SUID
+# define IF_TAC(...) __VA_ARGS__ "CONFIG_TAC"
+#else
+# define IF_TAC(...) __VA_ARGS__
+#endif
+#define IF_NOT_TAC(...)
+#define CONFIG_TAIL 1
+#define ENABLE_TAIL 1
+#ifdef MAKE_SUID
+# define IF_TAIL(...) __VA_ARGS__ "CONFIG_TAIL"
+#else
+# define IF_TAIL(...) __VA_ARGS__
+#endif
+#define IF_NOT_TAIL(...)
+#define CONFIG_FEATURE_FANCY_TAIL 1
+#define ENABLE_FEATURE_FANCY_TAIL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FANCY_TAIL(...) __VA_ARGS__ "CONFIG_FEATURE_FANCY_TAIL"
+#else
+# define IF_FEATURE_FANCY_TAIL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FANCY_TAIL(...)
+#define CONFIG_TEE 1
+#define ENABLE_TEE 1
+#ifdef MAKE_SUID
+# define IF_TEE(...) __VA_ARGS__ "CONFIG_TEE"
+#else
+# define IF_TEE(...) __VA_ARGS__
+#endif
+#define IF_NOT_TEE(...)
+#define CONFIG_FEATURE_TEE_USE_BLOCK_IO 1
+#define ENABLE_FEATURE_TEE_USE_BLOCK_IO 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TEE_USE_BLOCK_IO(...) __VA_ARGS__ "CONFIG_FEATURE_TEE_USE_BLOCK_IO"
+#else
+# define IF_FEATURE_TEE_USE_BLOCK_IO(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TEE_USE_BLOCK_IO(...)
+#define CONFIG_TEST 1
+#define ENABLE_TEST 1
+#ifdef MAKE_SUID
+# define IF_TEST(...) __VA_ARGS__ "CONFIG_TEST"
+#else
+# define IF_TEST(...) __VA_ARGS__
+#endif
+#define IF_NOT_TEST(...)
+#define CONFIG_TEST1 1
+#define ENABLE_TEST1 1
+#ifdef MAKE_SUID
+# define IF_TEST1(...) __VA_ARGS__ "CONFIG_TEST1"
+#else
+# define IF_TEST1(...) __VA_ARGS__
+#endif
+#define IF_NOT_TEST1(...)
+#define CONFIG_TEST2 1
+#define ENABLE_TEST2 1
+#ifdef MAKE_SUID
+# define IF_TEST2(...) __VA_ARGS__ "CONFIG_TEST2"
+#else
+# define IF_TEST2(...) __VA_ARGS__
+#endif
+#define IF_NOT_TEST2(...)
+#define CONFIG_FEATURE_TEST_64 1
+#define ENABLE_FEATURE_TEST_64 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TEST_64(...) __VA_ARGS__ "CONFIG_FEATURE_TEST_64"
+#else
+# define IF_FEATURE_TEST_64(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TEST_64(...)
+#define CONFIG_TOUCH 1
+#define ENABLE_TOUCH 1
+#ifdef MAKE_SUID
+# define IF_TOUCH(...) __VA_ARGS__ "CONFIG_TOUCH"
+#else
+# define IF_TOUCH(...) __VA_ARGS__
+#endif
+#define IF_NOT_TOUCH(...)
+#define CONFIG_FEATURE_TOUCH_NODEREF 1
+#define ENABLE_FEATURE_TOUCH_NODEREF 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TOUCH_NODEREF(...) __VA_ARGS__ "CONFIG_FEATURE_TOUCH_NODEREF"
+#else
+# define IF_FEATURE_TOUCH_NODEREF(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TOUCH_NODEREF(...)
+#define CONFIG_FEATURE_TOUCH_SUSV3 1
+#define ENABLE_FEATURE_TOUCH_SUSV3 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TOUCH_SUSV3(...) __VA_ARGS__ "CONFIG_FEATURE_TOUCH_SUSV3"
+#else
+# define IF_FEATURE_TOUCH_SUSV3(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TOUCH_SUSV3(...)
+#define CONFIG_TR 1
+#define ENABLE_TR 1
+#ifdef MAKE_SUID
+# define IF_TR(...) __VA_ARGS__ "CONFIG_TR"
+#else
+# define IF_TR(...) __VA_ARGS__
+#endif
+#define IF_NOT_TR(...)
+#define CONFIG_FEATURE_TR_CLASSES 1
+#define ENABLE_FEATURE_TR_CLASSES 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TR_CLASSES(...) __VA_ARGS__ "CONFIG_FEATURE_TR_CLASSES"
+#else
+# define IF_FEATURE_TR_CLASSES(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TR_CLASSES(...)
+#define CONFIG_FEATURE_TR_EQUIV 1
+#define ENABLE_FEATURE_TR_EQUIV 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TR_EQUIV(...) __VA_ARGS__ "CONFIG_FEATURE_TR_EQUIV"
+#else
+# define IF_FEATURE_TR_EQUIV(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TR_EQUIV(...)
+#define CONFIG_TRUE 1
+#define ENABLE_TRUE 1
+#ifdef MAKE_SUID
+# define IF_TRUE(...) __VA_ARGS__ "CONFIG_TRUE"
+#else
+# define IF_TRUE(...) __VA_ARGS__
+#endif
+#define IF_NOT_TRUE(...)
+#define CONFIG_TRUNCATE 1
+#define ENABLE_TRUNCATE 1
+#ifdef MAKE_SUID
+# define IF_TRUNCATE(...) __VA_ARGS__ "CONFIG_TRUNCATE"
+#else
+# define IF_TRUNCATE(...) __VA_ARGS__
+#endif
+#define IF_NOT_TRUNCATE(...)
+#define CONFIG_TTY 1
+#define ENABLE_TTY 1
+#ifdef MAKE_SUID
+# define IF_TTY(...) __VA_ARGS__ "CONFIG_TTY"
+#else
+# define IF_TTY(...) __VA_ARGS__
+#endif
+#define IF_NOT_TTY(...)
+#define CONFIG_UNAME 1
+#define ENABLE_UNAME 1
+#ifdef MAKE_SUID
+# define IF_UNAME(...) __VA_ARGS__ "CONFIG_UNAME"
+#else
+# define IF_UNAME(...) __VA_ARGS__
+#endif
+#define IF_NOT_UNAME(...)
+#define CONFIG_UNAME_OSNAME "GNU/Linux"
+#define ENABLE_UNAME_OSNAME 1
+#ifdef MAKE_SUID
+# define IF_UNAME_OSNAME(...) __VA_ARGS__ "CONFIG_UNAME_OSNAME"
+#else
+# define IF_UNAME_OSNAME(...) __VA_ARGS__
+#endif
+#define IF_NOT_UNAME_OSNAME(...)
+#define CONFIG_UNIQ 1
+#define ENABLE_UNIQ 1
+#ifdef MAKE_SUID
+# define IF_UNIQ(...) __VA_ARGS__ "CONFIG_UNIQ"
+#else
+# define IF_UNIQ(...) __VA_ARGS__
+#endif
+#define IF_NOT_UNIQ(...)
+#define CONFIG_UNLINK 1
+#define ENABLE_UNLINK 1
+#ifdef MAKE_SUID
+# define IF_UNLINK(...) __VA_ARGS__ "CONFIG_UNLINK"
+#else
+# define IF_UNLINK(...) __VA_ARGS__
+#endif
+#define IF_NOT_UNLINK(...)
+#define CONFIG_USLEEP 1
+#define ENABLE_USLEEP 1
+#ifdef MAKE_SUID
+# define IF_USLEEP(...) __VA_ARGS__ "CONFIG_USLEEP"
+#else
+# define IF_USLEEP(...) __VA_ARGS__
+#endif
+#define IF_NOT_USLEEP(...)
+#define CONFIG_UUDECODE 1
+#define ENABLE_UUDECODE 1
+#ifdef MAKE_SUID
+# define IF_UUDECODE(...) __VA_ARGS__ "CONFIG_UUDECODE"
+#else
+# define IF_UUDECODE(...) __VA_ARGS__
+#endif
+#define IF_NOT_UUDECODE(...)
+#define CONFIG_BASE64 1
+#define ENABLE_BASE64 1
+#ifdef MAKE_SUID
+# define IF_BASE64(...) __VA_ARGS__ "CONFIG_BASE64"
+#else
+# define IF_BASE64(...) __VA_ARGS__
+#endif
+#define IF_NOT_BASE64(...)
+#define CONFIG_UUENCODE 1
+#define ENABLE_UUENCODE 1
+#ifdef MAKE_SUID
+# define IF_UUENCODE(...) __VA_ARGS__ "CONFIG_UUENCODE"
+#else
+# define IF_UUENCODE(...) __VA_ARGS__
+#endif
+#define IF_NOT_UUENCODE(...)
+#define CONFIG_WC 1
+#define ENABLE_WC 1
+#ifdef MAKE_SUID
+# define IF_WC(...) __VA_ARGS__ "CONFIG_WC"
+#else
+# define IF_WC(...) __VA_ARGS__
+#endif
+#define IF_NOT_WC(...)
+#define CONFIG_FEATURE_WC_LARGE 1
+#define ENABLE_FEATURE_WC_LARGE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_WC_LARGE(...) __VA_ARGS__ "CONFIG_FEATURE_WC_LARGE"
+#else
+# define IF_FEATURE_WC_LARGE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_WC_LARGE(...)
+#define CONFIG_WHO 1
+#define ENABLE_WHO 1
+#ifdef MAKE_SUID
+# define IF_WHO(...) __VA_ARGS__ "CONFIG_WHO"
+#else
+# define IF_WHO(...) __VA_ARGS__
+#endif
+#define IF_NOT_WHO(...)
+#define CONFIG_USERS 1
+#define ENABLE_USERS 1
+#ifdef MAKE_SUID
+# define IF_USERS(...) __VA_ARGS__ "CONFIG_USERS"
+#else
+# define IF_USERS(...) __VA_ARGS__
+#endif
+#define IF_NOT_USERS(...)
+#define CONFIG_WHOAMI 1
+#define ENABLE_WHOAMI 1
+#ifdef MAKE_SUID
+# define IF_WHOAMI(...) __VA_ARGS__ "CONFIG_WHOAMI"
+#else
+# define IF_WHOAMI(...) __VA_ARGS__
+#endif
+#define IF_NOT_WHOAMI(...)
+#define CONFIG_YES 1
+#define ENABLE_YES 1
+#ifdef MAKE_SUID
+# define IF_YES(...) __VA_ARGS__ "CONFIG_YES"
+#else
+# define IF_YES(...) __VA_ARGS__
+#endif
+#define IF_NOT_YES(...)
+
+/*
+ * Common options
+ */
+#define CONFIG_FEATURE_VERBOSE 1
+#define ENABLE_FEATURE_VERBOSE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VERBOSE(...) __VA_ARGS__ "CONFIG_FEATURE_VERBOSE"
+#else
+# define IF_FEATURE_VERBOSE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VERBOSE(...)
+
+/*
+ * Common options for cp and mv
+ */
+#define CONFIG_FEATURE_PRESERVE_HARDLINKS 1
+#define ENABLE_FEATURE_PRESERVE_HARDLINKS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_PRESERVE_HARDLINKS(...) __VA_ARGS__ "CONFIG_FEATURE_PRESERVE_HARDLINKS"
+#else
+# define IF_FEATURE_PRESERVE_HARDLINKS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_PRESERVE_HARDLINKS(...)
+
+/*
+ * Common options for ls, more and telnet
+ */
+#define CONFIG_FEATURE_AUTOWIDTH 1
+#define ENABLE_FEATURE_AUTOWIDTH 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_AUTOWIDTH(...) __VA_ARGS__ "CONFIG_FEATURE_AUTOWIDTH"
+#else
+# define IF_FEATURE_AUTOWIDTH(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_AUTOWIDTH(...)
+
+/*
+ * Common options for df, du, ls
+ */
+#define CONFIG_FEATURE_HUMAN_READABLE 1
+#define ENABLE_FEATURE_HUMAN_READABLE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HUMAN_READABLE(...) __VA_ARGS__ "CONFIG_FEATURE_HUMAN_READABLE"
+#else
+# define IF_FEATURE_HUMAN_READABLE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HUMAN_READABLE(...)
+
+/*
+ * Console Utilities
+ */
+#define CONFIG_CHVT 1
+#define ENABLE_CHVT 1
+#ifdef MAKE_SUID
+# define IF_CHVT(...) __VA_ARGS__ "CONFIG_CHVT"
+#else
+# define IF_CHVT(...) __VA_ARGS__
+#endif
+#define IF_NOT_CHVT(...)
+#define CONFIG_CLEAR 1
+#define ENABLE_CLEAR 1
+#ifdef MAKE_SUID
+# define IF_CLEAR(...) __VA_ARGS__ "CONFIG_CLEAR"
+#else
+# define IF_CLEAR(...) __VA_ARGS__
+#endif
+#define IF_NOT_CLEAR(...)
+#define CONFIG_DEALLOCVT 1
+#define ENABLE_DEALLOCVT 1
+#ifdef MAKE_SUID
+# define IF_DEALLOCVT(...) __VA_ARGS__ "CONFIG_DEALLOCVT"
+#else
+# define IF_DEALLOCVT(...) __VA_ARGS__
+#endif
+#define IF_NOT_DEALLOCVT(...)
+#define CONFIG_DUMPKMAP 1
+#define ENABLE_DUMPKMAP 1
+#ifdef MAKE_SUID
+# define IF_DUMPKMAP(...) __VA_ARGS__ "CONFIG_DUMPKMAP"
+#else
+# define IF_DUMPKMAP(...) __VA_ARGS__
+#endif
+#define IF_NOT_DUMPKMAP(...)
+#define CONFIG_FGCONSOLE 1
+#define ENABLE_FGCONSOLE 1
+#ifdef MAKE_SUID
+# define IF_FGCONSOLE(...) __VA_ARGS__ "CONFIG_FGCONSOLE"
+#else
+# define IF_FGCONSOLE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FGCONSOLE(...)
+#define CONFIG_KBD_MODE 1
+#define ENABLE_KBD_MODE 1
+#ifdef MAKE_SUID
+# define IF_KBD_MODE(...) __VA_ARGS__ "CONFIG_KBD_MODE"
+#else
+# define IF_KBD_MODE(...) __VA_ARGS__
+#endif
+#define IF_NOT_KBD_MODE(...)
+#define CONFIG_LOADFONT 1
+#define ENABLE_LOADFONT 1
+#ifdef MAKE_SUID
+# define IF_LOADFONT(...) __VA_ARGS__ "CONFIG_LOADFONT"
+#else
+# define IF_LOADFONT(...) __VA_ARGS__
+#endif
+#define IF_NOT_LOADFONT(...)
+#define CONFIG_SETFONT 1
+#define ENABLE_SETFONT 1
+#ifdef MAKE_SUID
+# define IF_SETFONT(...) __VA_ARGS__ "CONFIG_SETFONT"
+#else
+# define IF_SETFONT(...) __VA_ARGS__
+#endif
+#define IF_NOT_SETFONT(...)
+#define CONFIG_FEATURE_SETFONT_TEXTUAL_MAP 1
+#define ENABLE_FEATURE_SETFONT_TEXTUAL_MAP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SETFONT_TEXTUAL_MAP(...) __VA_ARGS__ "CONFIG_FEATURE_SETFONT_TEXTUAL_MAP"
+#else
+# define IF_FEATURE_SETFONT_TEXTUAL_MAP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SETFONT_TEXTUAL_MAP(...)
+#define CONFIG_DEFAULT_SETFONT_DIR ""
+#define ENABLE_DEFAULT_SETFONT_DIR 1
+#ifdef MAKE_SUID
+# define IF_DEFAULT_SETFONT_DIR(...) __VA_ARGS__ "CONFIG_DEFAULT_SETFONT_DIR"
+#else
+# define IF_DEFAULT_SETFONT_DIR(...) __VA_ARGS__
+#endif
+#define IF_NOT_DEFAULT_SETFONT_DIR(...)
+
+/*
+ * Common options for loadfont and setfont
+ */
+#define CONFIG_FEATURE_LOADFONT_PSF2 1
+#define ENABLE_FEATURE_LOADFONT_PSF2 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LOADFONT_PSF2(...) __VA_ARGS__ "CONFIG_FEATURE_LOADFONT_PSF2"
+#else
+# define IF_FEATURE_LOADFONT_PSF2(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LOADFONT_PSF2(...)
+#define CONFIG_FEATURE_LOADFONT_RAW 1
+#define ENABLE_FEATURE_LOADFONT_RAW 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LOADFONT_RAW(...) __VA_ARGS__ "CONFIG_FEATURE_LOADFONT_RAW"
+#else
+# define IF_FEATURE_LOADFONT_RAW(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LOADFONT_RAW(...)
+#define CONFIG_LOADKMAP 1
+#define ENABLE_LOADKMAP 1
+#ifdef MAKE_SUID
+# define IF_LOADKMAP(...) __VA_ARGS__ "CONFIG_LOADKMAP"
+#else
+# define IF_LOADKMAP(...) __VA_ARGS__
+#endif
+#define IF_NOT_LOADKMAP(...)
+#define CONFIG_OPENVT 1
+#define ENABLE_OPENVT 1
+#ifdef MAKE_SUID
+# define IF_OPENVT(...) __VA_ARGS__ "CONFIG_OPENVT"
+#else
+# define IF_OPENVT(...) __VA_ARGS__
+#endif
+#define IF_NOT_OPENVT(...)
+#define CONFIG_RESET 1
+#define ENABLE_RESET 1
+#ifdef MAKE_SUID
+# define IF_RESET(...) __VA_ARGS__ "CONFIG_RESET"
+#else
+# define IF_RESET(...) __VA_ARGS__
+#endif
+#define IF_NOT_RESET(...)
+#define CONFIG_RESIZE 1
+#define ENABLE_RESIZE 1
+#ifdef MAKE_SUID
+# define IF_RESIZE(...) __VA_ARGS__ "CONFIG_RESIZE"
+#else
+# define IF_RESIZE(...) __VA_ARGS__
+#endif
+#define IF_NOT_RESIZE(...)
+#define CONFIG_FEATURE_RESIZE_PRINT 1
+#define ENABLE_FEATURE_RESIZE_PRINT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_RESIZE_PRINT(...) __VA_ARGS__ "CONFIG_FEATURE_RESIZE_PRINT"
+#else
+# define IF_FEATURE_RESIZE_PRINT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_RESIZE_PRINT(...)
+#define CONFIG_SETCONSOLE 1
+#define ENABLE_SETCONSOLE 1
+#ifdef MAKE_SUID
+# define IF_SETCONSOLE(...) __VA_ARGS__ "CONFIG_SETCONSOLE"
+#else
+# define IF_SETCONSOLE(...) __VA_ARGS__
+#endif
+#define IF_NOT_SETCONSOLE(...)
+#define CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS 1
+#define ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SETCONSOLE_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS"
+#else
+# define IF_FEATURE_SETCONSOLE_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SETCONSOLE_LONG_OPTIONS(...)
+#define CONFIG_SETKEYCODES 1
+#define ENABLE_SETKEYCODES 1
+#ifdef MAKE_SUID
+# define IF_SETKEYCODES(...) __VA_ARGS__ "CONFIG_SETKEYCODES"
+#else
+# define IF_SETKEYCODES(...) __VA_ARGS__
+#endif
+#define IF_NOT_SETKEYCODES(...)
+#define CONFIG_SETLOGCONS 1
+#define ENABLE_SETLOGCONS 1
+#ifdef MAKE_SUID
+# define IF_SETLOGCONS(...) __VA_ARGS__ "CONFIG_SETLOGCONS"
+#else
+# define IF_SETLOGCONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_SETLOGCONS(...)
+#define CONFIG_SHOWKEY 1
+#define ENABLE_SHOWKEY 1
+#ifdef MAKE_SUID
+# define IF_SHOWKEY(...) __VA_ARGS__ "CONFIG_SHOWKEY"
+#else
+# define IF_SHOWKEY(...) __VA_ARGS__
+#endif
+#define IF_NOT_SHOWKEY(...)
+
+/*
+ * Debian Utilities
+ */
+#define CONFIG_MKTEMP 1
+#define ENABLE_MKTEMP 1
+#ifdef MAKE_SUID
+# define IF_MKTEMP(...) __VA_ARGS__ "CONFIG_MKTEMP"
+#else
+# define IF_MKTEMP(...) __VA_ARGS__
+#endif
+#define IF_NOT_MKTEMP(...)
+#define CONFIG_PIPE_PROGRESS 1
+#define ENABLE_PIPE_PROGRESS 1
+#ifdef MAKE_SUID
+# define IF_PIPE_PROGRESS(...) __VA_ARGS__ "CONFIG_PIPE_PROGRESS"
+#else
+# define IF_PIPE_PROGRESS(...) __VA_ARGS__
+#endif
+#define IF_NOT_PIPE_PROGRESS(...)
+#define CONFIG_RUN_PARTS 1
+#define ENABLE_RUN_PARTS 1
+#ifdef MAKE_SUID
+# define IF_RUN_PARTS(...) __VA_ARGS__ "CONFIG_RUN_PARTS"
+#else
+# define IF_RUN_PARTS(...) __VA_ARGS__
+#endif
+#define IF_NOT_RUN_PARTS(...)
+#define CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS 1
+#define ENABLE_FEATURE_RUN_PARTS_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_RUN_PARTS_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS"
+#else
+# define IF_FEATURE_RUN_PARTS_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_RUN_PARTS_LONG_OPTIONS(...)
+#define CONFIG_FEATURE_RUN_PARTS_FANCY 1
+#define ENABLE_FEATURE_RUN_PARTS_FANCY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_RUN_PARTS_FANCY(...) __VA_ARGS__ "CONFIG_FEATURE_RUN_PARTS_FANCY"
+#else
+# define IF_FEATURE_RUN_PARTS_FANCY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_RUN_PARTS_FANCY(...)
+#define CONFIG_START_STOP_DAEMON 1
+#define ENABLE_START_STOP_DAEMON 1
+#ifdef MAKE_SUID
+# define IF_START_STOP_DAEMON(...) __VA_ARGS__ "CONFIG_START_STOP_DAEMON"
+#else
+# define IF_START_STOP_DAEMON(...) __VA_ARGS__
+#endif
+#define IF_NOT_START_STOP_DAEMON(...)
+#define CONFIG_FEATURE_START_STOP_DAEMON_FANCY 1
+#define ENABLE_FEATURE_START_STOP_DAEMON_FANCY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_START_STOP_DAEMON_FANCY(...) __VA_ARGS__ "CONFIG_FEATURE_START_STOP_DAEMON_FANCY"
+#else
+# define IF_FEATURE_START_STOP_DAEMON_FANCY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_START_STOP_DAEMON_FANCY(...)
+#define CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS 1
+#define ENABLE_FEATURE_START_STOP_DAEMON_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_START_STOP_DAEMON_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS"
+#else
+# define IF_FEATURE_START_STOP_DAEMON_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_START_STOP_DAEMON_LONG_OPTIONS(...)
+#define CONFIG_WHICH 1
+#define ENABLE_WHICH 1
+#ifdef MAKE_SUID
+# define IF_WHICH(...) __VA_ARGS__ "CONFIG_WHICH"
+#else
+# define IF_WHICH(...) __VA_ARGS__
+#endif
+#define IF_NOT_WHICH(...)
+
+/*
+ * Editors
+ */
+#define CONFIG_AWK 1
+#define ENABLE_AWK 1
+#ifdef MAKE_SUID
+# define IF_AWK(...) __VA_ARGS__ "CONFIG_AWK"
+#else
+# define IF_AWK(...) __VA_ARGS__
+#endif
+#define IF_NOT_AWK(...)
+#define CONFIG_FEATURE_AWK_LIBM 1
+#define ENABLE_FEATURE_AWK_LIBM 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_AWK_LIBM(...) __VA_ARGS__ "CONFIG_FEATURE_AWK_LIBM"
+#else
+# define IF_FEATURE_AWK_LIBM(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_AWK_LIBM(...)
+#define CONFIG_FEATURE_AWK_GNU_EXTENSIONS 1
+#define ENABLE_FEATURE_AWK_GNU_EXTENSIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_AWK_GNU_EXTENSIONS(...) __VA_ARGS__ "CONFIG_FEATURE_AWK_GNU_EXTENSIONS"
+#else
+# define IF_FEATURE_AWK_GNU_EXTENSIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_AWK_GNU_EXTENSIONS(...)
+#define CONFIG_CMP 1
+#define ENABLE_CMP 1
+#ifdef MAKE_SUID
+# define IF_CMP(...) __VA_ARGS__ "CONFIG_CMP"
+#else
+# define IF_CMP(...) __VA_ARGS__
+#endif
+#define IF_NOT_CMP(...)
+#define CONFIG_DIFF 1
+#define ENABLE_DIFF 1
+#ifdef MAKE_SUID
+# define IF_DIFF(...) __VA_ARGS__ "CONFIG_DIFF"
+#else
+# define IF_DIFF(...) __VA_ARGS__
+#endif
+#define IF_NOT_DIFF(...)
+#define CONFIG_FEATURE_DIFF_LONG_OPTIONS 1
+#define ENABLE_FEATURE_DIFF_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DIFF_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_DIFF_LONG_OPTIONS"
+#else
+# define IF_FEATURE_DIFF_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DIFF_LONG_OPTIONS(...)
+#define CONFIG_FEATURE_DIFF_DIR 1
+#define ENABLE_FEATURE_DIFF_DIR 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DIFF_DIR(...) __VA_ARGS__ "CONFIG_FEATURE_DIFF_DIR"
+#else
+# define IF_FEATURE_DIFF_DIR(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DIFF_DIR(...)
+#define CONFIG_ED 1
+#define ENABLE_ED 1
+#ifdef MAKE_SUID
+# define IF_ED(...) __VA_ARGS__ "CONFIG_ED"
+#else
+# define IF_ED(...) __VA_ARGS__
+#endif
+#define IF_NOT_ED(...)
+#define CONFIG_PATCH 1
+#define ENABLE_PATCH 1
+#ifdef MAKE_SUID
+# define IF_PATCH(...) __VA_ARGS__ "CONFIG_PATCH"
+#else
+# define IF_PATCH(...) __VA_ARGS__
+#endif
+#define IF_NOT_PATCH(...)
+#define CONFIG_SED 1
+#define ENABLE_SED 1
+#ifdef MAKE_SUID
+# define IF_SED(...) __VA_ARGS__ "CONFIG_SED"
+#else
+# define IF_SED(...) __VA_ARGS__
+#endif
+#define IF_NOT_SED(...)
+#define CONFIG_VI 1
+#define ENABLE_VI 1
+#ifdef MAKE_SUID
+# define IF_VI(...) __VA_ARGS__ "CONFIG_VI"
+#else
+# define IF_VI(...) __VA_ARGS__
+#endif
+#define IF_NOT_VI(...)
+#define CONFIG_FEATURE_VI_MAX_LEN 4096
+#define ENABLE_FEATURE_VI_MAX_LEN 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_MAX_LEN(...) __VA_ARGS__ "CONFIG_FEATURE_VI_MAX_LEN"
+#else
+# define IF_FEATURE_VI_MAX_LEN(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_MAX_LEN(...)
+#define CONFIG_FEATURE_VI_8BIT 1
+#define ENABLE_FEATURE_VI_8BIT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_8BIT(...) __VA_ARGS__ "CONFIG_FEATURE_VI_8BIT"
+#else
+# define IF_FEATURE_VI_8BIT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_8BIT(...)
+#define CONFIG_FEATURE_VI_COLON 1
+#define ENABLE_FEATURE_VI_COLON 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_COLON(...) __VA_ARGS__ "CONFIG_FEATURE_VI_COLON"
+#else
+# define IF_FEATURE_VI_COLON(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_COLON(...)
+#define CONFIG_FEATURE_VI_YANKMARK 1
+#define ENABLE_FEATURE_VI_YANKMARK 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_YANKMARK(...) __VA_ARGS__ "CONFIG_FEATURE_VI_YANKMARK"
+#else
+# define IF_FEATURE_VI_YANKMARK(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_YANKMARK(...)
+#define CONFIG_FEATURE_VI_SEARCH 1
+#define ENABLE_FEATURE_VI_SEARCH 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_SEARCH(...) __VA_ARGS__ "CONFIG_FEATURE_VI_SEARCH"
+#else
+# define IF_FEATURE_VI_SEARCH(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_SEARCH(...)
+#undef CONFIG_FEATURE_VI_REGEX_SEARCH
+#define ENABLE_FEATURE_VI_REGEX_SEARCH 0
+#define IF_FEATURE_VI_REGEX_SEARCH(...)
+#define IF_NOT_FEATURE_VI_REGEX_SEARCH(...) __VA_ARGS__
+#undef CONFIG_FEATURE_VI_USE_SIGNALS
+#define ENABLE_FEATURE_VI_USE_SIGNALS 0
+#define IF_FEATURE_VI_USE_SIGNALS(...)
+#define IF_NOT_FEATURE_VI_USE_SIGNALS(...) __VA_ARGS__
+#define CONFIG_FEATURE_VI_DOT_CMD 1
+#define ENABLE_FEATURE_VI_DOT_CMD 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_DOT_CMD(...) __VA_ARGS__ "CONFIG_FEATURE_VI_DOT_CMD"
+#else
+# define IF_FEATURE_VI_DOT_CMD(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_DOT_CMD(...)
+#define CONFIG_FEATURE_VI_READONLY 1
+#define ENABLE_FEATURE_VI_READONLY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_READONLY(...) __VA_ARGS__ "CONFIG_FEATURE_VI_READONLY"
+#else
+# define IF_FEATURE_VI_READONLY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_READONLY(...)
+#define CONFIG_FEATURE_VI_SETOPTS 1
+#define ENABLE_FEATURE_VI_SETOPTS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_SETOPTS(...) __VA_ARGS__ "CONFIG_FEATURE_VI_SETOPTS"
+#else
+# define IF_FEATURE_VI_SETOPTS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_SETOPTS(...)
+#define CONFIG_FEATURE_VI_SET 1
+#define ENABLE_FEATURE_VI_SET 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_SET(...) __VA_ARGS__ "CONFIG_FEATURE_VI_SET"
+#else
+# define IF_FEATURE_VI_SET(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_SET(...)
+#define CONFIG_FEATURE_VI_WIN_RESIZE 1
+#define ENABLE_FEATURE_VI_WIN_RESIZE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_WIN_RESIZE(...) __VA_ARGS__ "CONFIG_FEATURE_VI_WIN_RESIZE"
+#else
+# define IF_FEATURE_VI_WIN_RESIZE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_WIN_RESIZE(...)
+#define CONFIG_FEATURE_VI_ASK_TERMINAL 1
+#define ENABLE_FEATURE_VI_ASK_TERMINAL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_ASK_TERMINAL(...) __VA_ARGS__ "CONFIG_FEATURE_VI_ASK_TERMINAL"
+#else
+# define IF_FEATURE_VI_ASK_TERMINAL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_ASK_TERMINAL(...)
+#define CONFIG_FEATURE_VI_UNDO 1
+#define ENABLE_FEATURE_VI_UNDO 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_UNDO(...) __VA_ARGS__ "CONFIG_FEATURE_VI_UNDO"
+#else
+# define IF_FEATURE_VI_UNDO(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_UNDO(...)
+#define CONFIG_FEATURE_VI_UNDO_QUEUE 1
+#define ENABLE_FEATURE_VI_UNDO_QUEUE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_UNDO_QUEUE(...) __VA_ARGS__ "CONFIG_FEATURE_VI_UNDO_QUEUE"
+#else
+# define IF_FEATURE_VI_UNDO_QUEUE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_UNDO_QUEUE(...)
+#define CONFIG_FEATURE_VI_UNDO_QUEUE_MAX 256
+#define ENABLE_FEATURE_VI_UNDO_QUEUE_MAX 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VI_UNDO_QUEUE_MAX(...) __VA_ARGS__ "CONFIG_FEATURE_VI_UNDO_QUEUE_MAX"
+#else
+# define IF_FEATURE_VI_UNDO_QUEUE_MAX(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VI_UNDO_QUEUE_MAX(...)
+#define CONFIG_FEATURE_ALLOW_EXEC 1
+#define ENABLE_FEATURE_ALLOW_EXEC 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_ALLOW_EXEC(...) __VA_ARGS__ "CONFIG_FEATURE_ALLOW_EXEC"
+#else
+# define IF_FEATURE_ALLOW_EXEC(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_ALLOW_EXEC(...)
+
+/*
+ * Finding Utilities
+ */
+#define CONFIG_FIND 1
+#define ENABLE_FIND 1
+#ifdef MAKE_SUID
+# define IF_FIND(...) __VA_ARGS__ "CONFIG_FIND"
+#else
+# define IF_FIND(...) __VA_ARGS__
+#endif
+#define IF_NOT_FIND(...)
+#define CONFIG_FEATURE_FIND_PRINT0 1
+#define ENABLE_FEATURE_FIND_PRINT0 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_PRINT0(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_PRINT0"
+#else
+# define IF_FEATURE_FIND_PRINT0(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_PRINT0(...)
+#define CONFIG_FEATURE_FIND_MTIME 1
+#define ENABLE_FEATURE_FIND_MTIME 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_MTIME(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_MTIME"
+#else
+# define IF_FEATURE_FIND_MTIME(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_MTIME(...)
+#define CONFIG_FEATURE_FIND_MMIN 1
+#define ENABLE_FEATURE_FIND_MMIN 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_MMIN(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_MMIN"
+#else
+# define IF_FEATURE_FIND_MMIN(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_MMIN(...)
+#define CONFIG_FEATURE_FIND_PERM 1
+#define ENABLE_FEATURE_FIND_PERM 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_PERM(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_PERM"
+#else
+# define IF_FEATURE_FIND_PERM(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_PERM(...)
+#define CONFIG_FEATURE_FIND_TYPE 1
+#define ENABLE_FEATURE_FIND_TYPE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_TYPE(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_TYPE"
+#else
+# define IF_FEATURE_FIND_TYPE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_TYPE(...)
+#define CONFIG_FEATURE_FIND_XDEV 1
+#define ENABLE_FEATURE_FIND_XDEV 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_XDEV(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_XDEV"
+#else
+# define IF_FEATURE_FIND_XDEV(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_XDEV(...)
+#define CONFIG_FEATURE_FIND_MAXDEPTH 1
+#define ENABLE_FEATURE_FIND_MAXDEPTH 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_MAXDEPTH(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_MAXDEPTH"
+#else
+# define IF_FEATURE_FIND_MAXDEPTH(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_MAXDEPTH(...)
+#define CONFIG_FEATURE_FIND_NEWER 1
+#define ENABLE_FEATURE_FIND_NEWER 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_NEWER(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_NEWER"
+#else
+# define IF_FEATURE_FIND_NEWER(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_NEWER(...)
+#define CONFIG_FEATURE_FIND_INUM 1
+#define ENABLE_FEATURE_FIND_INUM 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_INUM(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_INUM"
+#else
+# define IF_FEATURE_FIND_INUM(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_INUM(...)
+#define CONFIG_FEATURE_FIND_EXEC 1
+#define ENABLE_FEATURE_FIND_EXEC 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_EXEC(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_EXEC"
+#else
+# define IF_FEATURE_FIND_EXEC(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_EXEC(...)
+#define CONFIG_FEATURE_FIND_EXEC_PLUS 1
+#define ENABLE_FEATURE_FIND_EXEC_PLUS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_EXEC_PLUS(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_EXEC_PLUS"
+#else
+# define IF_FEATURE_FIND_EXEC_PLUS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_EXEC_PLUS(...)
+#define CONFIG_FEATURE_FIND_USER 1
+#define ENABLE_FEATURE_FIND_USER 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_USER(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_USER"
+#else
+# define IF_FEATURE_FIND_USER(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_USER(...)
+#define CONFIG_FEATURE_FIND_GROUP 1
+#define ENABLE_FEATURE_FIND_GROUP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_GROUP(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_GROUP"
+#else
+# define IF_FEATURE_FIND_GROUP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_GROUP(...)
+#define CONFIG_FEATURE_FIND_NOT 1
+#define ENABLE_FEATURE_FIND_NOT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_NOT(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_NOT"
+#else
+# define IF_FEATURE_FIND_NOT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_NOT(...)
+#define CONFIG_FEATURE_FIND_DEPTH 1
+#define ENABLE_FEATURE_FIND_DEPTH 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_DEPTH(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_DEPTH"
+#else
+# define IF_FEATURE_FIND_DEPTH(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_DEPTH(...)
+#define CONFIG_FEATURE_FIND_PAREN 1
+#define ENABLE_FEATURE_FIND_PAREN 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_PAREN(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_PAREN"
+#else
+# define IF_FEATURE_FIND_PAREN(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_PAREN(...)
+#define CONFIG_FEATURE_FIND_SIZE 1
+#define ENABLE_FEATURE_FIND_SIZE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_SIZE(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_SIZE"
+#else
+# define IF_FEATURE_FIND_SIZE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_SIZE(...)
+#define CONFIG_FEATURE_FIND_PRUNE 1
+#define ENABLE_FEATURE_FIND_PRUNE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_PRUNE(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_PRUNE"
+#else
+# define IF_FEATURE_FIND_PRUNE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_PRUNE(...)
+#define CONFIG_FEATURE_FIND_DELETE 1
+#define ENABLE_FEATURE_FIND_DELETE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_DELETE(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_DELETE"
+#else
+# define IF_FEATURE_FIND_DELETE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_DELETE(...)
+#define CONFIG_FEATURE_FIND_PATH 1
+#define ENABLE_FEATURE_FIND_PATH 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_PATH(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_PATH"
+#else
+# define IF_FEATURE_FIND_PATH(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_PATH(...)
+#define CONFIG_FEATURE_FIND_REGEX 1
+#define ENABLE_FEATURE_FIND_REGEX 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_REGEX(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_REGEX"
+#else
+# define IF_FEATURE_FIND_REGEX(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_REGEX(...)
+#undef CONFIG_FEATURE_FIND_CONTEXT
+#define ENABLE_FEATURE_FIND_CONTEXT 0
+#define IF_FEATURE_FIND_CONTEXT(...)
+#define IF_NOT_FEATURE_FIND_CONTEXT(...) __VA_ARGS__
+#define CONFIG_FEATURE_FIND_LINKS 1
+#define ENABLE_FEATURE_FIND_LINKS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FIND_LINKS(...) __VA_ARGS__ "CONFIG_FEATURE_FIND_LINKS"
+#else
+# define IF_FEATURE_FIND_LINKS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FIND_LINKS(...)
+#define CONFIG_GREP 1
+#define ENABLE_GREP 1
+#ifdef MAKE_SUID
+# define IF_GREP(...) __VA_ARGS__ "CONFIG_GREP"
+#else
+# define IF_GREP(...) __VA_ARGS__
+#endif
+#define IF_NOT_GREP(...)
+#define CONFIG_EGREP 1
+#define ENABLE_EGREP 1
+#ifdef MAKE_SUID
+# define IF_EGREP(...) __VA_ARGS__ "CONFIG_EGREP"
+#else
+# define IF_EGREP(...) __VA_ARGS__
+#endif
+#define IF_NOT_EGREP(...)
+#define CONFIG_FGREP 1
+#define ENABLE_FGREP 1
+#ifdef MAKE_SUID
+# define IF_FGREP(...) __VA_ARGS__ "CONFIG_FGREP"
+#else
+# define IF_FGREP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FGREP(...)
+#define CONFIG_FEATURE_GREP_CONTEXT 1
+#define ENABLE_FEATURE_GREP_CONTEXT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_GREP_CONTEXT(...) __VA_ARGS__ "CONFIG_FEATURE_GREP_CONTEXT"
+#else
+# define IF_FEATURE_GREP_CONTEXT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_GREP_CONTEXT(...)
+#define CONFIG_XARGS 1
+#define ENABLE_XARGS 1
+#ifdef MAKE_SUID
+# define IF_XARGS(...) __VA_ARGS__ "CONFIG_XARGS"
+#else
+# define IF_XARGS(...) __VA_ARGS__
+#endif
+#define IF_NOT_XARGS(...)
+#define CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION 1
+#define ENABLE_FEATURE_XARGS_SUPPORT_CONFIRMATION 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_XARGS_SUPPORT_CONFIRMATION(...) __VA_ARGS__ "CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION"
+#else
+# define IF_FEATURE_XARGS_SUPPORT_CONFIRMATION(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_XARGS_SUPPORT_CONFIRMATION(...)
+#define CONFIG_FEATURE_XARGS_SUPPORT_QUOTES 1
+#define ENABLE_FEATURE_XARGS_SUPPORT_QUOTES 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_XARGS_SUPPORT_QUOTES(...) __VA_ARGS__ "CONFIG_FEATURE_XARGS_SUPPORT_QUOTES"
+#else
+# define IF_FEATURE_XARGS_SUPPORT_QUOTES(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_XARGS_SUPPORT_QUOTES(...)
+#define CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT 1
+#define ENABLE_FEATURE_XARGS_SUPPORT_TERMOPT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_XARGS_SUPPORT_TERMOPT(...) __VA_ARGS__ "CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT"
+#else
+# define IF_FEATURE_XARGS_SUPPORT_TERMOPT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_XARGS_SUPPORT_TERMOPT(...)
+#define CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM 1
+#define ENABLE_FEATURE_XARGS_SUPPORT_ZERO_TERM 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_XARGS_SUPPORT_ZERO_TERM(...) __VA_ARGS__ "CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM"
+#else
+# define IF_FEATURE_XARGS_SUPPORT_ZERO_TERM(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_XARGS_SUPPORT_ZERO_TERM(...)
+#define CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR 1
+#define ENABLE_FEATURE_XARGS_SUPPORT_REPL_STR 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_XARGS_SUPPORT_REPL_STR(...) __VA_ARGS__ "CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR"
+#else
+# define IF_FEATURE_XARGS_SUPPORT_REPL_STR(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_XARGS_SUPPORT_REPL_STR(...)
+
+/*
+ * Init Utilities
+ */
+#define CONFIG_BOOTCHARTD 1
+#define ENABLE_BOOTCHARTD 1
+#ifdef MAKE_SUID
+# define IF_BOOTCHARTD(...) __VA_ARGS__ "CONFIG_BOOTCHARTD"
+#else
+# define IF_BOOTCHARTD(...) __VA_ARGS__
+#endif
+#define IF_NOT_BOOTCHARTD(...)
+#define CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER 1
+#define ENABLE_FEATURE_BOOTCHARTD_BLOATED_HEADER 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_BOOTCHARTD_BLOATED_HEADER(...) __VA_ARGS__ "CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER"
+#else
+# define IF_FEATURE_BOOTCHARTD_BLOATED_HEADER(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_BOOTCHARTD_BLOATED_HEADER(...)
+#define CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE 1
+#define ENABLE_FEATURE_BOOTCHARTD_CONFIG_FILE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_BOOTCHARTD_CONFIG_FILE(...) __VA_ARGS__ "CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE"
+#else
+# define IF_FEATURE_BOOTCHARTD_CONFIG_FILE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_BOOTCHARTD_CONFIG_FILE(...)
+#define CONFIG_HALT 1
+#define ENABLE_HALT 1
+#ifdef MAKE_SUID
+# define IF_HALT(...) __VA_ARGS__ "CONFIG_HALT"
+#else
+# define IF_HALT(...) __VA_ARGS__
+#endif
+#define IF_NOT_HALT(...)
+#define CONFIG_POWEROFF 1
+#define ENABLE_POWEROFF 1
+#ifdef MAKE_SUID
+# define IF_POWEROFF(...) __VA_ARGS__ "CONFIG_POWEROFF"
+#else
+# define IF_POWEROFF(...) __VA_ARGS__
+#endif
+#define IF_NOT_POWEROFF(...)
+#define CONFIG_REBOOT 1
+#define ENABLE_REBOOT 1
+#ifdef MAKE_SUID
+# define IF_REBOOT(...) __VA_ARGS__ "CONFIG_REBOOT"
+#else
+# define IF_REBOOT(...) __VA_ARGS__
+#endif
+#define IF_NOT_REBOOT(...)
+#undef CONFIG_FEATURE_CALL_TELINIT
+#define ENABLE_FEATURE_CALL_TELINIT 0
+#define IF_FEATURE_CALL_TELINIT(...)
+#define IF_NOT_FEATURE_CALL_TELINIT(...) __VA_ARGS__
+#define CONFIG_TELINIT_PATH ""
+#define ENABLE_TELINIT_PATH 1
+#ifdef MAKE_SUID
+# define IF_TELINIT_PATH(...) __VA_ARGS__ "CONFIG_TELINIT_PATH"
+#else
+# define IF_TELINIT_PATH(...) __VA_ARGS__
+#endif
+#define IF_NOT_TELINIT_PATH(...)
+#define CONFIG_INIT 1
+#define ENABLE_INIT 1
+#ifdef MAKE_SUID
+# define IF_INIT(...) __VA_ARGS__ "CONFIG_INIT"
+#else
+# define IF_INIT(...) __VA_ARGS__
+#endif
+#define IF_NOT_INIT(...)
+#define CONFIG_LINUXRC 1
+#define ENABLE_LINUXRC 1
+#ifdef MAKE_SUID
+# define IF_LINUXRC(...) __VA_ARGS__ "CONFIG_LINUXRC"
+#else
+# define IF_LINUXRC(...) __VA_ARGS__
+#endif
+#define IF_NOT_LINUXRC(...)
+#define CONFIG_FEATURE_USE_INITTAB 1
+#define ENABLE_FEATURE_USE_INITTAB 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_USE_INITTAB(...) __VA_ARGS__ "CONFIG_FEATURE_USE_INITTAB"
+#else
+# define IF_FEATURE_USE_INITTAB(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_USE_INITTAB(...)
+#define CONFIG_FEATURE_KILL_REMOVED 1
+#define ENABLE_FEATURE_KILL_REMOVED 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_KILL_REMOVED(...) __VA_ARGS__ "CONFIG_FEATURE_KILL_REMOVED"
+#else
+# define IF_FEATURE_KILL_REMOVED(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_KILL_REMOVED(...)
+#define CONFIG_FEATURE_KILL_DELAY 1
+#define ENABLE_FEATURE_KILL_DELAY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_KILL_DELAY(...) __VA_ARGS__ "CONFIG_FEATURE_KILL_DELAY"
+#else
+# define IF_FEATURE_KILL_DELAY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_KILL_DELAY(...)
+#define CONFIG_FEATURE_INIT_SCTTY 1
+#define ENABLE_FEATURE_INIT_SCTTY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_INIT_SCTTY(...) __VA_ARGS__ "CONFIG_FEATURE_INIT_SCTTY"
+#else
+# define IF_FEATURE_INIT_SCTTY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_INIT_SCTTY(...)
+#define CONFIG_FEATURE_INIT_SYSLOG 1
+#define ENABLE_FEATURE_INIT_SYSLOG 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_INIT_SYSLOG(...) __VA_ARGS__ "CONFIG_FEATURE_INIT_SYSLOG"
+#else
+# define IF_FEATURE_INIT_SYSLOG(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_INIT_SYSLOG(...)
+#define CONFIG_FEATURE_EXTRA_QUIET 1
+#define ENABLE_FEATURE_EXTRA_QUIET 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_EXTRA_QUIET(...) __VA_ARGS__ "CONFIG_FEATURE_EXTRA_QUIET"
+#else
+# define IF_FEATURE_EXTRA_QUIET(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_EXTRA_QUIET(...)
+#define CONFIG_FEATURE_INIT_COREDUMPS 1
+#define ENABLE_FEATURE_INIT_COREDUMPS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_INIT_COREDUMPS(...) __VA_ARGS__ "CONFIG_FEATURE_INIT_COREDUMPS"
+#else
+# define IF_FEATURE_INIT_COREDUMPS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_INIT_COREDUMPS(...)
+#define CONFIG_INIT_TERMINAL_TYPE "linux"
+#define ENABLE_INIT_TERMINAL_TYPE 1
+#ifdef MAKE_SUID
+# define IF_INIT_TERMINAL_TYPE(...) __VA_ARGS__ "CONFIG_INIT_TERMINAL_TYPE"
+#else
+# define IF_INIT_TERMINAL_TYPE(...) __VA_ARGS__
+#endif
+#define IF_NOT_INIT_TERMINAL_TYPE(...)
+#define CONFIG_FEATURE_INIT_MODIFY_CMDLINE 1
+#define ENABLE_FEATURE_INIT_MODIFY_CMDLINE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_INIT_MODIFY_CMDLINE(...) __VA_ARGS__ "CONFIG_FEATURE_INIT_MODIFY_CMDLINE"
+#else
+# define IF_FEATURE_INIT_MODIFY_CMDLINE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_INIT_MODIFY_CMDLINE(...)
+#define CONFIG_MESG 1
+#define ENABLE_MESG 1
+#ifdef MAKE_SUID
+# define IF_MESG(...) __VA_ARGS__ "CONFIG_MESG"
+#else
+# define IF_MESG(...) __VA_ARGS__
+#endif
+#define IF_NOT_MESG(...)
+#define CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP 1
+#define ENABLE_FEATURE_MESG_ENABLE_ONLY_GROUP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MESG_ENABLE_ONLY_GROUP(...) __VA_ARGS__ "CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP"
+#else
+# define IF_FEATURE_MESG_ENABLE_ONLY_GROUP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MESG_ENABLE_ONLY_GROUP(...)
+
+/*
+ * Login/Password Management Utilities
+ */
+#undef CONFIG_FEATURE_SHADOWPASSWDS
+#define ENABLE_FEATURE_SHADOWPASSWDS 0
+#define IF_FEATURE_SHADOWPASSWDS(...)
+#define IF_NOT_FEATURE_SHADOWPASSWDS(...) __VA_ARGS__
+#undef CONFIG_USE_BB_PWD_GRP
+#define ENABLE_USE_BB_PWD_GRP 0
+#define IF_USE_BB_PWD_GRP(...)
+#define IF_NOT_USE_BB_PWD_GRP(...) __VA_ARGS__
+#undef CONFIG_USE_BB_SHADOW
+#define ENABLE_USE_BB_SHADOW 0
+#define IF_USE_BB_SHADOW(...)
+#define IF_NOT_USE_BB_SHADOW(...) __VA_ARGS__
+#undef CONFIG_USE_BB_CRYPT
+#define ENABLE_USE_BB_CRYPT 0
+#define IF_USE_BB_CRYPT(...)
+#define IF_NOT_USE_BB_CRYPT(...) __VA_ARGS__
+#undef CONFIG_USE_BB_CRYPT_SHA
+#define ENABLE_USE_BB_CRYPT_SHA 0
+#define IF_USE_BB_CRYPT_SHA(...)
+#define IF_NOT_USE_BB_CRYPT_SHA(...) __VA_ARGS__
+#undef CONFIG_ADD_SHELL
+#define ENABLE_ADD_SHELL 0
+#define IF_ADD_SHELL(...)
+#define IF_NOT_ADD_SHELL(...) __VA_ARGS__
+#undef CONFIG_REMOVE_SHELL
+#define ENABLE_REMOVE_SHELL 0
+#define IF_REMOVE_SHELL(...)
+#define IF_NOT_REMOVE_SHELL(...) __VA_ARGS__
+#undef CONFIG_ADDGROUP
+#define ENABLE_ADDGROUP 0
+#define IF_ADDGROUP(...)
+#define IF_NOT_ADDGROUP(...) __VA_ARGS__
+#undef CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS
+#define ENABLE_FEATURE_ADDGROUP_LONG_OPTIONS 0
+#define IF_FEATURE_ADDGROUP_LONG_OPTIONS(...)
+#define IF_NOT_FEATURE_ADDGROUP_LONG_OPTIONS(...) __VA_ARGS__
+#undef CONFIG_FEATURE_ADDUSER_TO_GROUP
+#define ENABLE_FEATURE_ADDUSER_TO_GROUP 0
+#define IF_FEATURE_ADDUSER_TO_GROUP(...)
+#define IF_NOT_FEATURE_ADDUSER_TO_GROUP(...) __VA_ARGS__
+#undef CONFIG_ADDUSER
+#define ENABLE_ADDUSER 0
+#define IF_ADDUSER(...)
+#define IF_NOT_ADDUSER(...) __VA_ARGS__
+#undef CONFIG_FEATURE_ADDUSER_LONG_OPTIONS
+#define ENABLE_FEATURE_ADDUSER_LONG_OPTIONS 0
+#define IF_FEATURE_ADDUSER_LONG_OPTIONS(...)
+#define IF_NOT_FEATURE_ADDUSER_LONG_OPTIONS(...) __VA_ARGS__
+#undef CONFIG_FEATURE_CHECK_NAMES
+#define ENABLE_FEATURE_CHECK_NAMES 0
+#define IF_FEATURE_CHECK_NAMES(...)
+#define IF_NOT_FEATURE_CHECK_NAMES(...) __VA_ARGS__
+#define CONFIG_LAST_ID 0
+#define ENABLE_LAST_ID 1
+#ifdef MAKE_SUID
+# define IF_LAST_ID(...) __VA_ARGS__ "CONFIG_LAST_ID"
+#else
+# define IF_LAST_ID(...) __VA_ARGS__
+#endif
+#define IF_NOT_LAST_ID(...)
+#define CONFIG_FIRST_SYSTEM_ID 0
+#define ENABLE_FIRST_SYSTEM_ID 1
+#ifdef MAKE_SUID
+# define IF_FIRST_SYSTEM_ID(...) __VA_ARGS__ "CONFIG_FIRST_SYSTEM_ID"
+#else
+# define IF_FIRST_SYSTEM_ID(...) __VA_ARGS__
+#endif
+#define IF_NOT_FIRST_SYSTEM_ID(...)
+#define CONFIG_LAST_SYSTEM_ID 0
+#define ENABLE_LAST_SYSTEM_ID 1
+#ifdef MAKE_SUID
+# define IF_LAST_SYSTEM_ID(...) __VA_ARGS__ "CONFIG_LAST_SYSTEM_ID"
+#else
+# define IF_LAST_SYSTEM_ID(...) __VA_ARGS__
+#endif
+#define IF_NOT_LAST_SYSTEM_ID(...)
+#undef CONFIG_CHPASSWD
+#define ENABLE_CHPASSWD 0
+#define IF_CHPASSWD(...)
+#define IF_NOT_CHPASSWD(...) __VA_ARGS__
+#define CONFIG_FEATURE_DEFAULT_PASSWD_ALGO ""
+#define ENABLE_FEATURE_DEFAULT_PASSWD_ALGO 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DEFAULT_PASSWD_ALGO(...) __VA_ARGS__ "CONFIG_FEATURE_DEFAULT_PASSWD_ALGO"
+#else
+# define IF_FEATURE_DEFAULT_PASSWD_ALGO(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DEFAULT_PASSWD_ALGO(...)
+#undef CONFIG_CRYPTPW
+#define ENABLE_CRYPTPW 0
+#define IF_CRYPTPW(...)
+#define IF_NOT_CRYPTPW(...) __VA_ARGS__
+#undef CONFIG_MKPASSWD
+#define ENABLE_MKPASSWD 0
+#define IF_MKPASSWD(...)
+#define IF_NOT_MKPASSWD(...) __VA_ARGS__
+#undef CONFIG_DELUSER
+#define ENABLE_DELUSER 0
+#define IF_DELUSER(...)
+#define IF_NOT_DELUSER(...) __VA_ARGS__
+#undef CONFIG_DELGROUP
+#define ENABLE_DELGROUP 0
+#define IF_DELGROUP(...)
+#define IF_NOT_DELGROUP(...) __VA_ARGS__
+#undef CONFIG_FEATURE_DEL_USER_FROM_GROUP
+#define ENABLE_FEATURE_DEL_USER_FROM_GROUP 0
+#define IF_FEATURE_DEL_USER_FROM_GROUP(...)
+#define IF_NOT_FEATURE_DEL_USER_FROM_GROUP(...) __VA_ARGS__
+#undef CONFIG_GETTY
+#define ENABLE_GETTY 0
+#define IF_GETTY(...)
+#define IF_NOT_GETTY(...) __VA_ARGS__
+#undef CONFIG_LOGIN
+#define ENABLE_LOGIN 0
+#define IF_LOGIN(...)
+#define IF_NOT_LOGIN(...) __VA_ARGS__
+#undef CONFIG_LOGIN_SESSION_AS_CHILD
+#define ENABLE_LOGIN_SESSION_AS_CHILD 0
+#define IF_LOGIN_SESSION_AS_CHILD(...)
+#define IF_NOT_LOGIN_SESSION_AS_CHILD(...) __VA_ARGS__
+#undef CONFIG_LOGIN_SCRIPTS
+#define ENABLE_LOGIN_SCRIPTS 0
+#define IF_LOGIN_SCRIPTS(...)
+#define IF_NOT_LOGIN_SCRIPTS(...) __VA_ARGS__
+#undef CONFIG_FEATURE_NOLOGIN
+#define ENABLE_FEATURE_NOLOGIN 0
+#define IF_FEATURE_NOLOGIN(...)
+#define IF_NOT_FEATURE_NOLOGIN(...) __VA_ARGS__
+#undef CONFIG_FEATURE_SECURETTY
+#define ENABLE_FEATURE_SECURETTY 0
+#define IF_FEATURE_SECURETTY(...)
+#define IF_NOT_FEATURE_SECURETTY(...) __VA_ARGS__
+#undef CONFIG_PASSWD
+#define ENABLE_PASSWD 0
+#define IF_PASSWD(...)
+#define IF_NOT_PASSWD(...) __VA_ARGS__
+#undef CONFIG_FEATURE_PASSWD_WEAK_CHECK
+#define ENABLE_FEATURE_PASSWD_WEAK_CHECK 0
+#define IF_FEATURE_PASSWD_WEAK_CHECK(...)
+#define IF_NOT_FEATURE_PASSWD_WEAK_CHECK(...) __VA_ARGS__
+#undef CONFIG_SU
+#define ENABLE_SU 0
+#define IF_SU(...)
+#define IF_NOT_SU(...) __VA_ARGS__
+#undef CONFIG_FEATURE_SU_SYSLOG
+#define ENABLE_FEATURE_SU_SYSLOG 0
+#define IF_FEATURE_SU_SYSLOG(...)
+#define IF_NOT_FEATURE_SU_SYSLOG(...) __VA_ARGS__
+#undef CONFIG_FEATURE_SU_CHECKS_SHELLS
+#define ENABLE_FEATURE_SU_CHECKS_SHELLS 0
+#define IF_FEATURE_SU_CHECKS_SHELLS(...)
+#define IF_NOT_FEATURE_SU_CHECKS_SHELLS(...) __VA_ARGS__
+#undef CONFIG_SULOGIN
+#define ENABLE_SULOGIN 0
+#define IF_SULOGIN(...)
+#define IF_NOT_SULOGIN(...) __VA_ARGS__
+#undef CONFIG_VLOCK
+#define ENABLE_VLOCK 0
+#define IF_VLOCK(...)
+#define IF_NOT_VLOCK(...) __VA_ARGS__
+
+/*
+ * Linux Ext2 FS Progs
+ */
+#undef CONFIG_CHATTR
+#define ENABLE_CHATTR 0
+#define IF_CHATTR(...)
+#define IF_NOT_CHATTR(...) __VA_ARGS__
+#undef CONFIG_FSCK
+#define ENABLE_FSCK 0
+#define IF_FSCK(...)
+#define IF_NOT_FSCK(...) __VA_ARGS__
+#undef CONFIG_LSATTR
+#define ENABLE_LSATTR 0
+#define IF_LSATTR(...)
+#define IF_NOT_LSATTR(...) __VA_ARGS__
+#undef CONFIG_TUNE2FS
+#define ENABLE_TUNE2FS 0
+#define IF_TUNE2FS(...)
+#define IF_NOT_TUNE2FS(...) __VA_ARGS__
+
+/*
+ * Linux Module Utilities
+ */
+#define CONFIG_MODPROBE_SMALL 1
+#define ENABLE_MODPROBE_SMALL 1
+#ifdef MAKE_SUID
+# define IF_MODPROBE_SMALL(...) __VA_ARGS__ "CONFIG_MODPROBE_SMALL"
+#else
+# define IF_MODPROBE_SMALL(...) __VA_ARGS__
+#endif
+#define IF_NOT_MODPROBE_SMALL(...)
+#undef CONFIG_DEPMOD
+#define ENABLE_DEPMOD 0
+#define IF_DEPMOD(...)
+#define IF_NOT_DEPMOD(...) __VA_ARGS__
+#undef CONFIG_INSMOD
+#define ENABLE_INSMOD 0
+#define IF_INSMOD(...)
+#define IF_NOT_INSMOD(...) __VA_ARGS__
+#undef CONFIG_LSMOD
+#define ENABLE_LSMOD 0
+#define IF_LSMOD(...)
+#define IF_NOT_LSMOD(...) __VA_ARGS__
+#undef CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT
+#define ENABLE_FEATURE_LSMOD_PRETTY_2_6_OUTPUT 0
+#define IF_FEATURE_LSMOD_PRETTY_2_6_OUTPUT(...)
+#define IF_NOT_FEATURE_LSMOD_PRETTY_2_6_OUTPUT(...) __VA_ARGS__
+#define CONFIG_MODINFO 1
+#define ENABLE_MODINFO 1
+#ifdef MAKE_SUID
+# define IF_MODINFO(...) __VA_ARGS__ "CONFIG_MODINFO"
+#else
+# define IF_MODINFO(...) __VA_ARGS__
+#endif
+#define IF_NOT_MODINFO(...)
+#define CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE 1
+#define ENABLE_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE(...) __VA_ARGS__ "CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE"
+#else
+# define IF_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE(...)
+#define CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED 1
+#define ENABLE_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED(...) __VA_ARGS__ "CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED"
+#else
+# define IF_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED(...)
+#undef CONFIG_MODPROBE
+#define ENABLE_MODPROBE 0
+#define IF_MODPROBE(...)
+#define IF_NOT_MODPROBE(...) __VA_ARGS__
+#undef CONFIG_FEATURE_MODPROBE_BLACKLIST
+#define ENABLE_FEATURE_MODPROBE_BLACKLIST 0
+#define IF_FEATURE_MODPROBE_BLACKLIST(...)
+#define IF_NOT_FEATURE_MODPROBE_BLACKLIST(...) __VA_ARGS__
+#undef CONFIG_RMMOD
+#define ENABLE_RMMOD 0
+#define IF_RMMOD(...)
+#define IF_NOT_RMMOD(...) __VA_ARGS__
+
+/*
+ * Options common to multiple modutils
+ */
+#undef CONFIG_FEATURE_2_4_MODULES
+#define ENABLE_FEATURE_2_4_MODULES 0
+#define IF_FEATURE_2_4_MODULES(...)
+#define IF_NOT_FEATURE_2_4_MODULES(...) __VA_ARGS__
+#define CONFIG_FEATURE_INSMOD_TRY_MMAP 1
+#define ENABLE_FEATURE_INSMOD_TRY_MMAP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_INSMOD_TRY_MMAP(...) __VA_ARGS__ "CONFIG_FEATURE_INSMOD_TRY_MMAP"
+#else
+# define IF_FEATURE_INSMOD_TRY_MMAP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_INSMOD_TRY_MMAP(...)
+#undef CONFIG_FEATURE_INSMOD_VERSION_CHECKING
+#define ENABLE_FEATURE_INSMOD_VERSION_CHECKING 0
+#define IF_FEATURE_INSMOD_VERSION_CHECKING(...)
+#define IF_NOT_FEATURE_INSMOD_VERSION_CHECKING(...) __VA_ARGS__
+#undef CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS
+#define ENABLE_FEATURE_INSMOD_KSYMOOPS_SYMBOLS 0
+#define IF_FEATURE_INSMOD_KSYMOOPS_SYMBOLS(...)
+#define IF_NOT_FEATURE_INSMOD_KSYMOOPS_SYMBOLS(...) __VA_ARGS__
+#undef CONFIG_FEATURE_INSMOD_LOADINKMEM
+#define ENABLE_FEATURE_INSMOD_LOADINKMEM 0
+#define IF_FEATURE_INSMOD_LOADINKMEM(...)
+#define IF_NOT_FEATURE_INSMOD_LOADINKMEM(...) __VA_ARGS__
+#undef CONFIG_FEATURE_INSMOD_LOAD_MAP
+#define ENABLE_FEATURE_INSMOD_LOAD_MAP 0
+#define IF_FEATURE_INSMOD_LOAD_MAP(...)
+#define IF_NOT_FEATURE_INSMOD_LOAD_MAP(...) __VA_ARGS__
+#undef CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL
+#define ENABLE_FEATURE_INSMOD_LOAD_MAP_FULL 0
+#define IF_FEATURE_INSMOD_LOAD_MAP_FULL(...)
+#define IF_NOT_FEATURE_INSMOD_LOAD_MAP_FULL(...) __VA_ARGS__
+#undef CONFIG_FEATURE_CHECK_TAINTED_MODULE
+#define ENABLE_FEATURE_CHECK_TAINTED_MODULE 0
+#define IF_FEATURE_CHECK_TAINTED_MODULE(...)
+#define IF_NOT_FEATURE_CHECK_TAINTED_MODULE(...) __VA_ARGS__
+#undef CONFIG_FEATURE_MODUTILS_ALIAS
+#define ENABLE_FEATURE_MODUTILS_ALIAS 0
+#define IF_FEATURE_MODUTILS_ALIAS(...)
+#define IF_NOT_FEATURE_MODUTILS_ALIAS(...) __VA_ARGS__
+#undef CONFIG_FEATURE_MODUTILS_SYMBOLS
+#define ENABLE_FEATURE_MODUTILS_SYMBOLS 0
+#define IF_FEATURE_MODUTILS_SYMBOLS(...)
+#define IF_NOT_FEATURE_MODUTILS_SYMBOLS(...) __VA_ARGS__
+#define CONFIG_DEFAULT_MODULES_DIR "/lib/modules"
+#define ENABLE_DEFAULT_MODULES_DIR 1
+#ifdef MAKE_SUID
+# define IF_DEFAULT_MODULES_DIR(...) __VA_ARGS__ "CONFIG_DEFAULT_MODULES_DIR"
+#else
+# define IF_DEFAULT_MODULES_DIR(...) __VA_ARGS__
+#endif
+#define IF_NOT_DEFAULT_MODULES_DIR(...)
+#define CONFIG_DEFAULT_DEPMOD_FILE "modules.dep"
+#define ENABLE_DEFAULT_DEPMOD_FILE 1
+#ifdef MAKE_SUID
+# define IF_DEFAULT_DEPMOD_FILE(...) __VA_ARGS__ "CONFIG_DEFAULT_DEPMOD_FILE"
+#else
+# define IF_DEFAULT_DEPMOD_FILE(...) __VA_ARGS__
+#endif
+#define IF_NOT_DEFAULT_DEPMOD_FILE(...)
+
+/*
+ * Linux System Utilities
+ */
+#undef CONFIG_ACPID
+#define ENABLE_ACPID 0
+#define IF_ACPID(...)
+#define IF_NOT_ACPID(...) __VA_ARGS__
+#undef CONFIG_FEATURE_ACPID_COMPAT
+#define ENABLE_FEATURE_ACPID_COMPAT 0
+#define IF_FEATURE_ACPID_COMPAT(...)
+#define IF_NOT_FEATURE_ACPID_COMPAT(...) __VA_ARGS__
+#define CONFIG_BLKDISCARD 1
+#define ENABLE_BLKDISCARD 1
+#ifdef MAKE_SUID
+# define IF_BLKDISCARD(...) __VA_ARGS__ "CONFIG_BLKDISCARD"
+#else
+# define IF_BLKDISCARD(...) __VA_ARGS__
+#endif
+#define IF_NOT_BLKDISCARD(...)
+#define CONFIG_BLKID 1
+#define ENABLE_BLKID 1
+#ifdef MAKE_SUID
+# define IF_BLKID(...) __VA_ARGS__ "CONFIG_BLKID"
+#else
+# define IF_BLKID(...) __VA_ARGS__
+#endif
+#define IF_NOT_BLKID(...)
+#undef CONFIG_FEATURE_BLKID_TYPE
+#define ENABLE_FEATURE_BLKID_TYPE 0
+#define IF_FEATURE_BLKID_TYPE(...)
+#define IF_NOT_FEATURE_BLKID_TYPE(...) __VA_ARGS__
+#define CONFIG_BLOCKDEV 1
+#define ENABLE_BLOCKDEV 1
+#ifdef MAKE_SUID
+# define IF_BLOCKDEV(...) __VA_ARGS__ "CONFIG_BLOCKDEV"
+#else
+# define IF_BLOCKDEV(...) __VA_ARGS__
+#endif
+#define IF_NOT_BLOCKDEV(...)
+#define CONFIG_DMESG 1
+#define ENABLE_DMESG 1
+#ifdef MAKE_SUID
+# define IF_DMESG(...) __VA_ARGS__ "CONFIG_DMESG"
+#else
+# define IF_DMESG(...) __VA_ARGS__
+#endif
+#define IF_NOT_DMESG(...)
+#define CONFIG_FEATURE_DMESG_PRETTY 1
+#define ENABLE_FEATURE_DMESG_PRETTY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DMESG_PRETTY(...) __VA_ARGS__ "CONFIG_FEATURE_DMESG_PRETTY"
+#else
+# define IF_FEATURE_DMESG_PRETTY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DMESG_PRETTY(...)
+#define CONFIG_FATATTR 1
+#define ENABLE_FATATTR 1
+#ifdef MAKE_SUID
+# define IF_FATATTR(...) __VA_ARGS__ "CONFIG_FATATTR"
+#else
+# define IF_FATATTR(...) __VA_ARGS__
+#endif
+#define IF_NOT_FATATTR(...)
+#define CONFIG_FBSET 1
+#define ENABLE_FBSET 1
+#ifdef MAKE_SUID
+# define IF_FBSET(...) __VA_ARGS__ "CONFIG_FBSET"
+#else
+# define IF_FBSET(...) __VA_ARGS__
+#endif
+#define IF_NOT_FBSET(...)
+#define CONFIG_FEATURE_FBSET_FANCY 1
+#define ENABLE_FEATURE_FBSET_FANCY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FBSET_FANCY(...) __VA_ARGS__ "CONFIG_FEATURE_FBSET_FANCY"
+#else
+# define IF_FEATURE_FBSET_FANCY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FBSET_FANCY(...)
+#define CONFIG_FEATURE_FBSET_READMODE 1
+#define ENABLE_FEATURE_FBSET_READMODE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FBSET_READMODE(...) __VA_ARGS__ "CONFIG_FEATURE_FBSET_READMODE"
+#else
+# define IF_FEATURE_FBSET_READMODE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FBSET_READMODE(...)
+#define CONFIG_FDFORMAT 1
+#define ENABLE_FDFORMAT 1
+#ifdef MAKE_SUID
+# define IF_FDFORMAT(...) __VA_ARGS__ "CONFIG_FDFORMAT"
+#else
+# define IF_FDFORMAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FDFORMAT(...)
+#define CONFIG_FDISK 1
+#define ENABLE_FDISK 1
+#ifdef MAKE_SUID
+# define IF_FDISK(...) __VA_ARGS__ "CONFIG_FDISK"
+#else
+# define IF_FDISK(...) __VA_ARGS__
+#endif
+#define IF_NOT_FDISK(...)
+#undef CONFIG_FDISK_SUPPORT_LARGE_DISKS
+#define ENABLE_FDISK_SUPPORT_LARGE_DISKS 0
+#define IF_FDISK_SUPPORT_LARGE_DISKS(...)
+#define IF_NOT_FDISK_SUPPORT_LARGE_DISKS(...) __VA_ARGS__
+#define CONFIG_FEATURE_FDISK_WRITABLE 1
+#define ENABLE_FEATURE_FDISK_WRITABLE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FDISK_WRITABLE(...) __VA_ARGS__ "CONFIG_FEATURE_FDISK_WRITABLE"
+#else
+# define IF_FEATURE_FDISK_WRITABLE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FDISK_WRITABLE(...)
+#define CONFIG_FEATURE_AIX_LABEL 1
+#define ENABLE_FEATURE_AIX_LABEL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_AIX_LABEL(...) __VA_ARGS__ "CONFIG_FEATURE_AIX_LABEL"
+#else
+# define IF_FEATURE_AIX_LABEL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_AIX_LABEL(...)
+#define CONFIG_FEATURE_SGI_LABEL 1
+#define ENABLE_FEATURE_SGI_LABEL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SGI_LABEL(...) __VA_ARGS__ "CONFIG_FEATURE_SGI_LABEL"
+#else
+# define IF_FEATURE_SGI_LABEL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SGI_LABEL(...)
+#define CONFIG_FEATURE_SUN_LABEL 1
+#define ENABLE_FEATURE_SUN_LABEL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SUN_LABEL(...) __VA_ARGS__ "CONFIG_FEATURE_SUN_LABEL"
+#else
+# define IF_FEATURE_SUN_LABEL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SUN_LABEL(...)
+#define CONFIG_FEATURE_OSF_LABEL 1
+#define ENABLE_FEATURE_OSF_LABEL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_OSF_LABEL(...) __VA_ARGS__ "CONFIG_FEATURE_OSF_LABEL"
+#else
+# define IF_FEATURE_OSF_LABEL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_OSF_LABEL(...)
+#undef CONFIG_FEATURE_GPT_LABEL
+#define ENABLE_FEATURE_GPT_LABEL 0
+#define IF_FEATURE_GPT_LABEL(...)
+#define IF_NOT_FEATURE_GPT_LABEL(...) __VA_ARGS__
+#define CONFIG_FEATURE_FDISK_ADVANCED 1
+#define ENABLE_FEATURE_FDISK_ADVANCED 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FDISK_ADVANCED(...) __VA_ARGS__ "CONFIG_FEATURE_FDISK_ADVANCED"
+#else
+# define IF_FEATURE_FDISK_ADVANCED(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FDISK_ADVANCED(...)
+#define CONFIG_FINDFS 1
+#define ENABLE_FINDFS 1
+#ifdef MAKE_SUID
+# define IF_FINDFS(...) __VA_ARGS__ "CONFIG_FINDFS"
+#else
+# define IF_FINDFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FINDFS(...)
+#define CONFIG_FLOCK 1
+#define ENABLE_FLOCK 1
+#ifdef MAKE_SUID
+# define IF_FLOCK(...) __VA_ARGS__ "CONFIG_FLOCK"
+#else
+# define IF_FLOCK(...) __VA_ARGS__
+#endif
+#define IF_NOT_FLOCK(...)
+#define CONFIG_FDFLUSH 1
+#define ENABLE_FDFLUSH 1
+#ifdef MAKE_SUID
+# define IF_FDFLUSH(...) __VA_ARGS__ "CONFIG_FDFLUSH"
+#else
+# define IF_FDFLUSH(...) __VA_ARGS__
+#endif
+#define IF_NOT_FDFLUSH(...)
+#define CONFIG_FREERAMDISK 1
+#define ENABLE_FREERAMDISK 1
+#ifdef MAKE_SUID
+# define IF_FREERAMDISK(...) __VA_ARGS__ "CONFIG_FREERAMDISK"
+#else
+# define IF_FREERAMDISK(...) __VA_ARGS__
+#endif
+#define IF_NOT_FREERAMDISK(...)
+#define CONFIG_FSCK_MINIX 1
+#define ENABLE_FSCK_MINIX 1
+#ifdef MAKE_SUID
+# define IF_FSCK_MINIX(...) __VA_ARGS__ "CONFIG_FSCK_MINIX"
+#else
+# define IF_FSCK_MINIX(...) __VA_ARGS__
+#endif
+#define IF_NOT_FSCK_MINIX(...)
+#define CONFIG_FSTRIM 1
+#define ENABLE_FSTRIM 1
+#ifdef MAKE_SUID
+# define IF_FSTRIM(...) __VA_ARGS__ "CONFIG_FSTRIM"
+#else
+# define IF_FSTRIM(...) __VA_ARGS__
+#endif
+#define IF_NOT_FSTRIM(...)
+#define CONFIG_GETOPT 1
+#define ENABLE_GETOPT 1
+#ifdef MAKE_SUID
+# define IF_GETOPT(...) __VA_ARGS__ "CONFIG_GETOPT"
+#else
+# define IF_GETOPT(...) __VA_ARGS__
+#endif
+#define IF_NOT_GETOPT(...)
+#define CONFIG_FEATURE_GETOPT_LONG 1
+#define ENABLE_FEATURE_GETOPT_LONG 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_GETOPT_LONG(...) __VA_ARGS__ "CONFIG_FEATURE_GETOPT_LONG"
+#else
+# define IF_FEATURE_GETOPT_LONG(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_GETOPT_LONG(...)
+#define CONFIG_HEXDUMP 1
+#define ENABLE_HEXDUMP 1
+#ifdef MAKE_SUID
+# define IF_HEXDUMP(...) __VA_ARGS__ "CONFIG_HEXDUMP"
+#else
+# define IF_HEXDUMP(...) __VA_ARGS__
+#endif
+#define IF_NOT_HEXDUMP(...)
+#define CONFIG_FEATURE_HEXDUMP_REVERSE 1
+#define ENABLE_FEATURE_HEXDUMP_REVERSE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HEXDUMP_REVERSE(...) __VA_ARGS__ "CONFIG_FEATURE_HEXDUMP_REVERSE"
+#else
+# define IF_FEATURE_HEXDUMP_REVERSE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HEXDUMP_REVERSE(...)
+#define CONFIG_HD 1
+#define ENABLE_HD 1
+#ifdef MAKE_SUID
+# define IF_HD(...) __VA_ARGS__ "CONFIG_HD"
+#else
+# define IF_HD(...) __VA_ARGS__
+#endif
+#define IF_NOT_HD(...)
+#define CONFIG_HWCLOCK 1
+#define ENABLE_HWCLOCK 1
+#ifdef MAKE_SUID
+# define IF_HWCLOCK(...) __VA_ARGS__ "CONFIG_HWCLOCK"
+#else
+# define IF_HWCLOCK(...) __VA_ARGS__
+#endif
+#define IF_NOT_HWCLOCK(...)
+#define CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS 1
+#define ENABLE_FEATURE_HWCLOCK_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HWCLOCK_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS"
+#else
+# define IF_FEATURE_HWCLOCK_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HWCLOCK_LONG_OPTIONS(...)
+#define CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS 1
+#define ENABLE_FEATURE_HWCLOCK_ADJTIME_FHS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HWCLOCK_ADJTIME_FHS(...) __VA_ARGS__ "CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS"
+#else
+# define IF_FEATURE_HWCLOCK_ADJTIME_FHS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HWCLOCK_ADJTIME_FHS(...)
+#define CONFIG_IPCRM 1
+#define ENABLE_IPCRM 1
+#ifdef MAKE_SUID
+# define IF_IPCRM(...) __VA_ARGS__ "CONFIG_IPCRM"
+#else
+# define IF_IPCRM(...) __VA_ARGS__
+#endif
+#define IF_NOT_IPCRM(...)
+#define CONFIG_IPCS 1
+#define ENABLE_IPCS 1
+#ifdef MAKE_SUID
+# define IF_IPCS(...) __VA_ARGS__ "CONFIG_IPCS"
+#else
+# define IF_IPCS(...) __VA_ARGS__
+#endif
+#define IF_NOT_IPCS(...)
+#define CONFIG_LOSETUP 1
+#define ENABLE_LOSETUP 1
+#ifdef MAKE_SUID
+# define IF_LOSETUP(...) __VA_ARGS__ "CONFIG_LOSETUP"
+#else
+# define IF_LOSETUP(...) __VA_ARGS__
+#endif
+#define IF_NOT_LOSETUP(...)
+#define CONFIG_LSPCI 1
+#define ENABLE_LSPCI 1
+#ifdef MAKE_SUID
+# define IF_LSPCI(...) __VA_ARGS__ "CONFIG_LSPCI"
+#else
+# define IF_LSPCI(...) __VA_ARGS__
+#endif
+#define IF_NOT_LSPCI(...)
+#define CONFIG_LSUSB 1
+#define ENABLE_LSUSB 1
+#ifdef MAKE_SUID
+# define IF_LSUSB(...) __VA_ARGS__ "CONFIG_LSUSB"
+#else
+# define IF_LSUSB(...) __VA_ARGS__
+#endif
+#define IF_NOT_LSUSB(...)
+#define CONFIG_MDEV 1
+#define ENABLE_MDEV 1
+#ifdef MAKE_SUID
+# define IF_MDEV(...) __VA_ARGS__ "CONFIG_MDEV"
+#else
+# define IF_MDEV(...) __VA_ARGS__
+#endif
+#define IF_NOT_MDEV(...)
+#define CONFIG_FEATURE_MDEV_CONF 1
+#define ENABLE_FEATURE_MDEV_CONF 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MDEV_CONF(...) __VA_ARGS__ "CONFIG_FEATURE_MDEV_CONF"
+#else
+# define IF_FEATURE_MDEV_CONF(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MDEV_CONF(...)
+#define CONFIG_FEATURE_MDEV_RENAME 1
+#define ENABLE_FEATURE_MDEV_RENAME 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MDEV_RENAME(...) __VA_ARGS__ "CONFIG_FEATURE_MDEV_RENAME"
+#else
+# define IF_FEATURE_MDEV_RENAME(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MDEV_RENAME(...)
+#define CONFIG_FEATURE_MDEV_RENAME_REGEXP 1
+#define ENABLE_FEATURE_MDEV_RENAME_REGEXP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MDEV_RENAME_REGEXP(...) __VA_ARGS__ "CONFIG_FEATURE_MDEV_RENAME_REGEXP"
+#else
+# define IF_FEATURE_MDEV_RENAME_REGEXP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MDEV_RENAME_REGEXP(...)
+#define CONFIG_FEATURE_MDEV_EXEC 1
+#define ENABLE_FEATURE_MDEV_EXEC 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MDEV_EXEC(...) __VA_ARGS__ "CONFIG_FEATURE_MDEV_EXEC"
+#else
+# define IF_FEATURE_MDEV_EXEC(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MDEV_EXEC(...)
+#define CONFIG_FEATURE_MDEV_LOAD_FIRMWARE 1
+#define ENABLE_FEATURE_MDEV_LOAD_FIRMWARE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MDEV_LOAD_FIRMWARE(...) __VA_ARGS__ "CONFIG_FEATURE_MDEV_LOAD_FIRMWARE"
+#else
+# define IF_FEATURE_MDEV_LOAD_FIRMWARE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MDEV_LOAD_FIRMWARE(...)
+#define CONFIG_MKE2FS 1
+#define ENABLE_MKE2FS 1
+#ifdef MAKE_SUID
+# define IF_MKE2FS(...) __VA_ARGS__ "CONFIG_MKE2FS"
+#else
+# define IF_MKE2FS(...) __VA_ARGS__
+#endif
+#define IF_NOT_MKE2FS(...)
+#define CONFIG_MKFS_EXT2 1
+#define ENABLE_MKFS_EXT2 1
+#ifdef MAKE_SUID
+# define IF_MKFS_EXT2(...) __VA_ARGS__ "CONFIG_MKFS_EXT2"
+#else
+# define IF_MKFS_EXT2(...) __VA_ARGS__
+#endif
+#define IF_NOT_MKFS_EXT2(...)
+#define CONFIG_MKFS_MINIX 1
+#define ENABLE_MKFS_MINIX 1
+#ifdef MAKE_SUID
+# define IF_MKFS_MINIX(...) __VA_ARGS__ "CONFIG_MKFS_MINIX"
+#else
+# define IF_MKFS_MINIX(...) __VA_ARGS__
+#endif
+#define IF_NOT_MKFS_MINIX(...)
+#define CONFIG_FEATURE_MINIX2 1
+#define ENABLE_FEATURE_MINIX2 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MINIX2(...) __VA_ARGS__ "CONFIG_FEATURE_MINIX2"
+#else
+# define IF_FEATURE_MINIX2(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MINIX2(...)
+#define CONFIG_MKFS_REISER 1
+#define ENABLE_MKFS_REISER 1
+#ifdef MAKE_SUID
+# define IF_MKFS_REISER(...) __VA_ARGS__ "CONFIG_MKFS_REISER"
+#else
+# define IF_MKFS_REISER(...) __VA_ARGS__
+#endif
+#define IF_NOT_MKFS_REISER(...)
+#define CONFIG_MKDOSFS 1
+#define ENABLE_MKDOSFS 1
+#ifdef MAKE_SUID
+# define IF_MKDOSFS(...) __VA_ARGS__ "CONFIG_MKDOSFS"
+#else
+# define IF_MKDOSFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_MKDOSFS(...)
+#define CONFIG_MKFS_VFAT 1
+#define ENABLE_MKFS_VFAT 1
+#ifdef MAKE_SUID
+# define IF_MKFS_VFAT(...) __VA_ARGS__ "CONFIG_MKFS_VFAT"
+#else
+# define IF_MKFS_VFAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_MKFS_VFAT(...)
+#define CONFIG_MKSWAP 1
+#define ENABLE_MKSWAP 1
+#ifdef MAKE_SUID
+# define IF_MKSWAP(...) __VA_ARGS__ "CONFIG_MKSWAP"
+#else
+# define IF_MKSWAP(...) __VA_ARGS__
+#endif
+#define IF_NOT_MKSWAP(...)
+#define CONFIG_FEATURE_MKSWAP_UUID 1
+#define ENABLE_FEATURE_MKSWAP_UUID 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MKSWAP_UUID(...) __VA_ARGS__ "CONFIG_FEATURE_MKSWAP_UUID"
+#else
+# define IF_FEATURE_MKSWAP_UUID(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MKSWAP_UUID(...)
+#define CONFIG_MORE 1
+#define ENABLE_MORE 1
+#ifdef MAKE_SUID
+# define IF_MORE(...) __VA_ARGS__ "CONFIG_MORE"
+#else
+# define IF_MORE(...) __VA_ARGS__
+#endif
+#define IF_NOT_MORE(...)
+#define CONFIG_MOUNT 1
+#define ENABLE_MOUNT 1
+#ifdef MAKE_SUID
+# define IF_MOUNT(...) __VA_ARGS__ "CONFIG_MOUNT"
+#else
+# define IF_MOUNT(...) __VA_ARGS__
+#endif
+#define IF_NOT_MOUNT(...)
+#define CONFIG_FEATURE_MOUNT_FAKE 1
+#define ENABLE_FEATURE_MOUNT_FAKE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MOUNT_FAKE(...) __VA_ARGS__ "CONFIG_FEATURE_MOUNT_FAKE"
+#else
+# define IF_FEATURE_MOUNT_FAKE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MOUNT_FAKE(...)
+#define CONFIG_FEATURE_MOUNT_VERBOSE 1
+#define ENABLE_FEATURE_MOUNT_VERBOSE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MOUNT_VERBOSE(...) __VA_ARGS__ "CONFIG_FEATURE_MOUNT_VERBOSE"
+#else
+# define IF_FEATURE_MOUNT_VERBOSE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MOUNT_VERBOSE(...)
+#define CONFIG_FEATURE_MOUNT_HELPERS 1
+#define ENABLE_FEATURE_MOUNT_HELPERS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MOUNT_HELPERS(...) __VA_ARGS__ "CONFIG_FEATURE_MOUNT_HELPERS"
+#else
+# define IF_FEATURE_MOUNT_HELPERS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MOUNT_HELPERS(...)
+#define CONFIG_FEATURE_MOUNT_LABEL 1
+#define ENABLE_FEATURE_MOUNT_LABEL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MOUNT_LABEL(...) __VA_ARGS__ "CONFIG_FEATURE_MOUNT_LABEL"
+#else
+# define IF_FEATURE_MOUNT_LABEL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MOUNT_LABEL(...)
+#define CONFIG_FEATURE_MOUNT_NFS 1
+#define ENABLE_FEATURE_MOUNT_NFS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MOUNT_NFS(...) __VA_ARGS__ "CONFIG_FEATURE_MOUNT_NFS"
+#else
+# define IF_FEATURE_MOUNT_NFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MOUNT_NFS(...)
+#define CONFIG_FEATURE_MOUNT_CIFS 1
+#define ENABLE_FEATURE_MOUNT_CIFS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MOUNT_CIFS(...) __VA_ARGS__ "CONFIG_FEATURE_MOUNT_CIFS"
+#else
+# define IF_FEATURE_MOUNT_CIFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MOUNT_CIFS(...)
+#define CONFIG_FEATURE_MOUNT_FLAGS 1
+#define ENABLE_FEATURE_MOUNT_FLAGS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MOUNT_FLAGS(...) __VA_ARGS__ "CONFIG_FEATURE_MOUNT_FLAGS"
+#else
+# define IF_FEATURE_MOUNT_FLAGS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MOUNT_FLAGS(...)
+#define CONFIG_FEATURE_MOUNT_FSTAB 1
+#define ENABLE_FEATURE_MOUNT_FSTAB 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MOUNT_FSTAB(...) __VA_ARGS__ "CONFIG_FEATURE_MOUNT_FSTAB"
+#else
+# define IF_FEATURE_MOUNT_FSTAB(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MOUNT_FSTAB(...)
+#define CONFIG_FEATURE_MOUNT_OTHERTAB 1
+#define ENABLE_FEATURE_MOUNT_OTHERTAB 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MOUNT_OTHERTAB(...) __VA_ARGS__ "CONFIG_FEATURE_MOUNT_OTHERTAB"
+#else
+# define IF_FEATURE_MOUNT_OTHERTAB(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MOUNT_OTHERTAB(...)
+#define CONFIG_NSENTER 1
+#define ENABLE_NSENTER 1
+#ifdef MAKE_SUID
+# define IF_NSENTER(...) __VA_ARGS__ "CONFIG_NSENTER"
+#else
+# define IF_NSENTER(...) __VA_ARGS__
+#endif
+#define IF_NOT_NSENTER(...)
+#define CONFIG_FEATURE_NSENTER_LONG_OPTS 1
+#define ENABLE_FEATURE_NSENTER_LONG_OPTS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_NSENTER_LONG_OPTS(...) __VA_ARGS__ "CONFIG_FEATURE_NSENTER_LONG_OPTS"
+#else
+# define IF_FEATURE_NSENTER_LONG_OPTS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_NSENTER_LONG_OPTS(...)
+#define CONFIG_PIVOT_ROOT 1
+#define ENABLE_PIVOT_ROOT 1
+#ifdef MAKE_SUID
+# define IF_PIVOT_ROOT(...) __VA_ARGS__ "CONFIG_PIVOT_ROOT"
+#else
+# define IF_PIVOT_ROOT(...) __VA_ARGS__
+#endif
+#define IF_NOT_PIVOT_ROOT(...)
+#define CONFIG_RDATE 1
+#define ENABLE_RDATE 1
+#ifdef MAKE_SUID
+# define IF_RDATE(...) __VA_ARGS__ "CONFIG_RDATE"
+#else
+# define IF_RDATE(...) __VA_ARGS__
+#endif
+#define IF_NOT_RDATE(...)
+#define CONFIG_RDEV 1
+#define ENABLE_RDEV 1
+#ifdef MAKE_SUID
+# define IF_RDEV(...) __VA_ARGS__ "CONFIG_RDEV"
+#else
+# define IF_RDEV(...) __VA_ARGS__
+#endif
+#define IF_NOT_RDEV(...)
+#define CONFIG_READPROFILE 1
+#define ENABLE_READPROFILE 1
+#ifdef MAKE_SUID
+# define IF_READPROFILE(...) __VA_ARGS__ "CONFIG_READPROFILE"
+#else
+# define IF_READPROFILE(...) __VA_ARGS__
+#endif
+#define IF_NOT_READPROFILE(...)
+#define CONFIG_REV 1
+#define ENABLE_REV 1
+#ifdef MAKE_SUID
+# define IF_REV(...) __VA_ARGS__ "CONFIG_REV"
+#else
+# define IF_REV(...) __VA_ARGS__
+#endif
+#define IF_NOT_REV(...)
+#define CONFIG_RTCWAKE 1
+#define ENABLE_RTCWAKE 1
+#ifdef MAKE_SUID
+# define IF_RTCWAKE(...) __VA_ARGS__ "CONFIG_RTCWAKE"
+#else
+# define IF_RTCWAKE(...) __VA_ARGS__
+#endif
+#define IF_NOT_RTCWAKE(...)
+#define CONFIG_SCRIPT 1
+#define ENABLE_SCRIPT 1
+#ifdef MAKE_SUID
+# define IF_SCRIPT(...) __VA_ARGS__ "CONFIG_SCRIPT"
+#else
+# define IF_SCRIPT(...) __VA_ARGS__
+#endif
+#define IF_NOT_SCRIPT(...)
+#define CONFIG_SCRIPTREPLAY 1
+#define ENABLE_SCRIPTREPLAY 1
+#ifdef MAKE_SUID
+# define IF_SCRIPTREPLAY(...) __VA_ARGS__ "CONFIG_SCRIPTREPLAY"
+#else
+# define IF_SCRIPTREPLAY(...) __VA_ARGS__
+#endif
+#define IF_NOT_SCRIPTREPLAY(...)
+#define CONFIG_SETARCH 1
+#define ENABLE_SETARCH 1
+#ifdef MAKE_SUID
+# define IF_SETARCH(...) __VA_ARGS__ "CONFIG_SETARCH"
+#else
+# define IF_SETARCH(...) __VA_ARGS__
+#endif
+#define IF_NOT_SETARCH(...)
+#define CONFIG_LINUX32 1
+#define ENABLE_LINUX32 1
+#ifdef MAKE_SUID
+# define IF_LINUX32(...) __VA_ARGS__ "CONFIG_LINUX32"
+#else
+# define IF_LINUX32(...) __VA_ARGS__
+#endif
+#define IF_NOT_LINUX32(...)
+#define CONFIG_LINUX64 1
+#define ENABLE_LINUX64 1
+#ifdef MAKE_SUID
+# define IF_LINUX64(...) __VA_ARGS__ "CONFIG_LINUX64"
+#else
+# define IF_LINUX64(...) __VA_ARGS__
+#endif
+#define IF_NOT_LINUX64(...)
+#define CONFIG_SWAPON 1
+#define ENABLE_SWAPON 1
+#ifdef MAKE_SUID
+# define IF_SWAPON(...) __VA_ARGS__ "CONFIG_SWAPON"
+#else
+# define IF_SWAPON(...) __VA_ARGS__
+#endif
+#define IF_NOT_SWAPON(...)
+#define CONFIG_FEATURE_SWAPON_DISCARD 1
+#define ENABLE_FEATURE_SWAPON_DISCARD 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SWAPON_DISCARD(...) __VA_ARGS__ "CONFIG_FEATURE_SWAPON_DISCARD"
+#else
+# define IF_FEATURE_SWAPON_DISCARD(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SWAPON_DISCARD(...)
+#define CONFIG_FEATURE_SWAPON_PRI 1
+#define ENABLE_FEATURE_SWAPON_PRI 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SWAPON_PRI(...) __VA_ARGS__ "CONFIG_FEATURE_SWAPON_PRI"
+#else
+# define IF_FEATURE_SWAPON_PRI(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SWAPON_PRI(...)
+#define CONFIG_SWAPOFF 1
+#define ENABLE_SWAPOFF 1
+#ifdef MAKE_SUID
+# define IF_SWAPOFF(...) __VA_ARGS__ "CONFIG_SWAPOFF"
+#else
+# define IF_SWAPOFF(...) __VA_ARGS__
+#endif
+#define IF_NOT_SWAPOFF(...)
+#define CONFIG_SWITCH_ROOT 1
+#define ENABLE_SWITCH_ROOT 1
+#ifdef MAKE_SUID
+# define IF_SWITCH_ROOT(...) __VA_ARGS__ "CONFIG_SWITCH_ROOT"
+#else
+# define IF_SWITCH_ROOT(...) __VA_ARGS__
+#endif
+#define IF_NOT_SWITCH_ROOT(...)
+#define CONFIG_UEVENT 1
+#define ENABLE_UEVENT 1
+#ifdef MAKE_SUID
+# define IF_UEVENT(...) __VA_ARGS__ "CONFIG_UEVENT"
+#else
+# define IF_UEVENT(...) __VA_ARGS__
+#endif
+#define IF_NOT_UEVENT(...)
+#define CONFIG_UMOUNT 1
+#define ENABLE_UMOUNT 1
+#ifdef MAKE_SUID
+# define IF_UMOUNT(...) __VA_ARGS__ "CONFIG_UMOUNT"
+#else
+# define IF_UMOUNT(...) __VA_ARGS__
+#endif
+#define IF_NOT_UMOUNT(...)
+#define CONFIG_FEATURE_UMOUNT_ALL 1
+#define ENABLE_FEATURE_UMOUNT_ALL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_UMOUNT_ALL(...) __VA_ARGS__ "CONFIG_FEATURE_UMOUNT_ALL"
+#else
+# define IF_FEATURE_UMOUNT_ALL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_UMOUNT_ALL(...)
+#undef CONFIG_UNSHARE
+#define ENABLE_UNSHARE 0
+#define IF_UNSHARE(...)
+#define IF_NOT_UNSHARE(...) __VA_ARGS__
+
+/*
+ * Common options for mount/umount
+ */
+#define CONFIG_FEATURE_MOUNT_LOOP 1
+#define ENABLE_FEATURE_MOUNT_LOOP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MOUNT_LOOP(...) __VA_ARGS__ "CONFIG_FEATURE_MOUNT_LOOP"
+#else
+# define IF_FEATURE_MOUNT_LOOP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MOUNT_LOOP(...)
+#define CONFIG_FEATURE_MOUNT_LOOP_CREATE 1
+#define ENABLE_FEATURE_MOUNT_LOOP_CREATE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MOUNT_LOOP_CREATE(...) __VA_ARGS__ "CONFIG_FEATURE_MOUNT_LOOP_CREATE"
+#else
+# define IF_FEATURE_MOUNT_LOOP_CREATE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MOUNT_LOOP_CREATE(...)
+#undef CONFIG_FEATURE_MTAB_SUPPORT
+#define ENABLE_FEATURE_MTAB_SUPPORT 0
+#define IF_FEATURE_MTAB_SUPPORT(...)
+#define IF_NOT_FEATURE_MTAB_SUPPORT(...) __VA_ARGS__
+#define CONFIG_VOLUMEID 1
+#define ENABLE_VOLUMEID 1
+#ifdef MAKE_SUID
+# define IF_VOLUMEID(...) __VA_ARGS__ "CONFIG_VOLUMEID"
+#else
+# define IF_VOLUMEID(...) __VA_ARGS__
+#endif
+#define IF_NOT_VOLUMEID(...)
+
+/*
+ * Filesystem/Volume identification
+ */
+#define CONFIG_FEATURE_VOLUMEID_BCACHE 1
+#define ENABLE_FEATURE_VOLUMEID_BCACHE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_BCACHE(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_BCACHE"
+#else
+# define IF_FEATURE_VOLUMEID_BCACHE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_BCACHE(...)
+#define CONFIG_FEATURE_VOLUMEID_BTRFS 1
+#define ENABLE_FEATURE_VOLUMEID_BTRFS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_BTRFS(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_BTRFS"
+#else
+# define IF_FEATURE_VOLUMEID_BTRFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_BTRFS(...)
+#define CONFIG_FEATURE_VOLUMEID_CRAMFS 1
+#define ENABLE_FEATURE_VOLUMEID_CRAMFS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_CRAMFS(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_CRAMFS"
+#else
+# define IF_FEATURE_VOLUMEID_CRAMFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_CRAMFS(...)
+#define CONFIG_FEATURE_VOLUMEID_EXFAT 1
+#define ENABLE_FEATURE_VOLUMEID_EXFAT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_EXFAT(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_EXFAT"
+#else
+# define IF_FEATURE_VOLUMEID_EXFAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_EXFAT(...)
+#define CONFIG_FEATURE_VOLUMEID_EXT 1
+#define ENABLE_FEATURE_VOLUMEID_EXT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_EXT(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_EXT"
+#else
+# define IF_FEATURE_VOLUMEID_EXT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_EXT(...)
+#define CONFIG_FEATURE_VOLUMEID_F2FS 1
+#define ENABLE_FEATURE_VOLUMEID_F2FS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_F2FS(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_F2FS"
+#else
+# define IF_FEATURE_VOLUMEID_F2FS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_F2FS(...)
+#define CONFIG_FEATURE_VOLUMEID_FAT 1
+#define ENABLE_FEATURE_VOLUMEID_FAT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_FAT(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_FAT"
+#else
+# define IF_FEATURE_VOLUMEID_FAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_FAT(...)
+#define CONFIG_FEATURE_VOLUMEID_HFS 1
+#define ENABLE_FEATURE_VOLUMEID_HFS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_HFS(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_HFS"
+#else
+# define IF_FEATURE_VOLUMEID_HFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_HFS(...)
+#define CONFIG_FEATURE_VOLUMEID_ISO9660 1
+#define ENABLE_FEATURE_VOLUMEID_ISO9660 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_ISO9660(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_ISO9660"
+#else
+# define IF_FEATURE_VOLUMEID_ISO9660(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_ISO9660(...)
+#define CONFIG_FEATURE_VOLUMEID_JFS 1
+#define ENABLE_FEATURE_VOLUMEID_JFS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_JFS(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_JFS"
+#else
+# define IF_FEATURE_VOLUMEID_JFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_JFS(...)
+#define CONFIG_FEATURE_VOLUMEID_LINUXRAID 1
+#define ENABLE_FEATURE_VOLUMEID_LINUXRAID 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_LINUXRAID(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_LINUXRAID"
+#else
+# define IF_FEATURE_VOLUMEID_LINUXRAID(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_LINUXRAID(...)
+#define CONFIG_FEATURE_VOLUMEID_LINUXSWAP 1
+#define ENABLE_FEATURE_VOLUMEID_LINUXSWAP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_LINUXSWAP(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_LINUXSWAP"
+#else
+# define IF_FEATURE_VOLUMEID_LINUXSWAP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_LINUXSWAP(...)
+#define CONFIG_FEATURE_VOLUMEID_LUKS 1
+#define ENABLE_FEATURE_VOLUMEID_LUKS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_LUKS(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_LUKS"
+#else
+# define IF_FEATURE_VOLUMEID_LUKS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_LUKS(...)
+#define CONFIG_FEATURE_VOLUMEID_NILFS 1
+#define ENABLE_FEATURE_VOLUMEID_NILFS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_NILFS(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_NILFS"
+#else
+# define IF_FEATURE_VOLUMEID_NILFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_NILFS(...)
+#define CONFIG_FEATURE_VOLUMEID_NTFS 1
+#define ENABLE_FEATURE_VOLUMEID_NTFS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_NTFS(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_NTFS"
+#else
+# define IF_FEATURE_VOLUMEID_NTFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_NTFS(...)
+#define CONFIG_FEATURE_VOLUMEID_OCFS2 1
+#define ENABLE_FEATURE_VOLUMEID_OCFS2 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_OCFS2(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_OCFS2"
+#else
+# define IF_FEATURE_VOLUMEID_OCFS2(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_OCFS2(...)
+#define CONFIG_FEATURE_VOLUMEID_REISERFS 1
+#define ENABLE_FEATURE_VOLUMEID_REISERFS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_REISERFS(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_REISERFS"
+#else
+# define IF_FEATURE_VOLUMEID_REISERFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_REISERFS(...)
+#define CONFIG_FEATURE_VOLUMEID_ROMFS 1
+#define ENABLE_FEATURE_VOLUMEID_ROMFS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_ROMFS(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_ROMFS"
+#else
+# define IF_FEATURE_VOLUMEID_ROMFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_ROMFS(...)
+#undef CONFIG_FEATURE_VOLUMEID_SQUASHFS
+#define ENABLE_FEATURE_VOLUMEID_SQUASHFS 0
+#define IF_FEATURE_VOLUMEID_SQUASHFS(...)
+#define IF_NOT_FEATURE_VOLUMEID_SQUASHFS(...) __VA_ARGS__
+#define CONFIG_FEATURE_VOLUMEID_SYSV 1
+#define ENABLE_FEATURE_VOLUMEID_SYSV 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_SYSV(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_SYSV"
+#else
+# define IF_FEATURE_VOLUMEID_SYSV(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_SYSV(...)
+#define CONFIG_FEATURE_VOLUMEID_UBIFS 1
+#define ENABLE_FEATURE_VOLUMEID_UBIFS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_UBIFS(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_UBIFS"
+#else
+# define IF_FEATURE_VOLUMEID_UBIFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_UBIFS(...)
+#define CONFIG_FEATURE_VOLUMEID_UDF 1
+#define ENABLE_FEATURE_VOLUMEID_UDF 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_UDF(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_UDF"
+#else
+# define IF_FEATURE_VOLUMEID_UDF(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_UDF(...)
+#define CONFIG_FEATURE_VOLUMEID_XFS 1
+#define ENABLE_FEATURE_VOLUMEID_XFS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_VOLUMEID_XFS(...) __VA_ARGS__ "CONFIG_FEATURE_VOLUMEID_XFS"
+#else
+# define IF_FEATURE_VOLUMEID_XFS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_VOLUMEID_XFS(...)
+
+/*
+ * Miscellaneous Utilities
+ */
+#define CONFIG_ADJTIMEX 1
+#define ENABLE_ADJTIMEX 1
+#ifdef MAKE_SUID
+# define IF_ADJTIMEX(...) __VA_ARGS__ "CONFIG_ADJTIMEX"
+#else
+# define IF_ADJTIMEX(...) __VA_ARGS__
+#endif
+#define IF_NOT_ADJTIMEX(...)
+#define CONFIG_BBCONFIG 1
+#define ENABLE_BBCONFIG 1
+#ifdef MAKE_SUID
+# define IF_BBCONFIG(...) __VA_ARGS__ "CONFIG_BBCONFIG"
+#else
+# define IF_BBCONFIG(...) __VA_ARGS__
+#endif
+#define IF_NOT_BBCONFIG(...)
+#define CONFIG_FEATURE_COMPRESS_BBCONFIG 1
+#define ENABLE_FEATURE_COMPRESS_BBCONFIG 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_COMPRESS_BBCONFIG(...) __VA_ARGS__ "CONFIG_FEATURE_COMPRESS_BBCONFIG"
+#else
+# define IF_FEATURE_COMPRESS_BBCONFIG(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_COMPRESS_BBCONFIG(...)
+#define CONFIG_BEEP 1
+#define ENABLE_BEEP 1
+#ifdef MAKE_SUID
+# define IF_BEEP(...) __VA_ARGS__ "CONFIG_BEEP"
+#else
+# define IF_BEEP(...) __VA_ARGS__
+#endif
+#define IF_NOT_BEEP(...)
+#define CONFIG_FEATURE_BEEP_FREQ 4000
+#define ENABLE_FEATURE_BEEP_FREQ 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_BEEP_FREQ(...) __VA_ARGS__ "CONFIG_FEATURE_BEEP_FREQ"
+#else
+# define IF_FEATURE_BEEP_FREQ(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_BEEP_FREQ(...)
+#define CONFIG_FEATURE_BEEP_LENGTH_MS 30
+#define ENABLE_FEATURE_BEEP_LENGTH_MS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_BEEP_LENGTH_MS(...) __VA_ARGS__ "CONFIG_FEATURE_BEEP_LENGTH_MS"
+#else
+# define IF_FEATURE_BEEP_LENGTH_MS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_BEEP_LENGTH_MS(...)
+#define CONFIG_CHAT 1
+#define ENABLE_CHAT 1
+#ifdef MAKE_SUID
+# define IF_CHAT(...) __VA_ARGS__ "CONFIG_CHAT"
+#else
+# define IF_CHAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_CHAT(...)
+#define CONFIG_FEATURE_CHAT_NOFAIL 1
+#define ENABLE_FEATURE_CHAT_NOFAIL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CHAT_NOFAIL(...) __VA_ARGS__ "CONFIG_FEATURE_CHAT_NOFAIL"
+#else
+# define IF_FEATURE_CHAT_NOFAIL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CHAT_NOFAIL(...)
+#define CONFIG_FEATURE_CHAT_TTY_HIFI 1
+#define ENABLE_FEATURE_CHAT_TTY_HIFI 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CHAT_TTY_HIFI(...) __VA_ARGS__ "CONFIG_FEATURE_CHAT_TTY_HIFI"
+#else
+# define IF_FEATURE_CHAT_TTY_HIFI(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CHAT_TTY_HIFI(...)
+#define CONFIG_FEATURE_CHAT_IMPLICIT_CR 1
+#define ENABLE_FEATURE_CHAT_IMPLICIT_CR 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CHAT_IMPLICIT_CR(...) __VA_ARGS__ "CONFIG_FEATURE_CHAT_IMPLICIT_CR"
+#else
+# define IF_FEATURE_CHAT_IMPLICIT_CR(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CHAT_IMPLICIT_CR(...)
+#define CONFIG_FEATURE_CHAT_SWALLOW_OPTS 1
+#define ENABLE_FEATURE_CHAT_SWALLOW_OPTS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CHAT_SWALLOW_OPTS(...) __VA_ARGS__ "CONFIG_FEATURE_CHAT_SWALLOW_OPTS"
+#else
+# define IF_FEATURE_CHAT_SWALLOW_OPTS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CHAT_SWALLOW_OPTS(...)
+#define CONFIG_FEATURE_CHAT_SEND_ESCAPES 1
+#define ENABLE_FEATURE_CHAT_SEND_ESCAPES 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CHAT_SEND_ESCAPES(...) __VA_ARGS__ "CONFIG_FEATURE_CHAT_SEND_ESCAPES"
+#else
+# define IF_FEATURE_CHAT_SEND_ESCAPES(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CHAT_SEND_ESCAPES(...)
+#define CONFIG_FEATURE_CHAT_VAR_ABORT_LEN 1
+#define ENABLE_FEATURE_CHAT_VAR_ABORT_LEN 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CHAT_VAR_ABORT_LEN(...) __VA_ARGS__ "CONFIG_FEATURE_CHAT_VAR_ABORT_LEN"
+#else
+# define IF_FEATURE_CHAT_VAR_ABORT_LEN(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CHAT_VAR_ABORT_LEN(...)
+#define CONFIG_FEATURE_CHAT_CLR_ABORT 1
+#define ENABLE_FEATURE_CHAT_CLR_ABORT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CHAT_CLR_ABORT(...) __VA_ARGS__ "CONFIG_FEATURE_CHAT_CLR_ABORT"
+#else
+# define IF_FEATURE_CHAT_CLR_ABORT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CHAT_CLR_ABORT(...)
+#define CONFIG_CHRT 1
+#define ENABLE_CHRT 1
+#ifdef MAKE_SUID
+# define IF_CHRT(...) __VA_ARGS__ "CONFIG_CHRT"
+#else
+# define IF_CHRT(...) __VA_ARGS__
+#endif
+#define IF_NOT_CHRT(...)
+#define CONFIG_CONSPY 1
+#define ENABLE_CONSPY 1
+#ifdef MAKE_SUID
+# define IF_CONSPY(...) __VA_ARGS__ "CONFIG_CONSPY"
+#else
+# define IF_CONSPY(...) __VA_ARGS__
+#endif
+#define IF_NOT_CONSPY(...)
+#define CONFIG_CROND 1
+#define ENABLE_CROND 1
+#ifdef MAKE_SUID
+# define IF_CROND(...) __VA_ARGS__ "CONFIG_CROND"
+#else
+# define IF_CROND(...) __VA_ARGS__
+#endif
+#define IF_NOT_CROND(...)
+#define CONFIG_FEATURE_CROND_D 1
+#define ENABLE_FEATURE_CROND_D 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CROND_D(...) __VA_ARGS__ "CONFIG_FEATURE_CROND_D"
+#else
+# define IF_FEATURE_CROND_D(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CROND_D(...)
+#define CONFIG_FEATURE_CROND_CALL_SENDMAIL 1
+#define ENABLE_FEATURE_CROND_CALL_SENDMAIL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CROND_CALL_SENDMAIL(...) __VA_ARGS__ "CONFIG_FEATURE_CROND_CALL_SENDMAIL"
+#else
+# define IF_FEATURE_CROND_CALL_SENDMAIL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CROND_CALL_SENDMAIL(...)
+#define CONFIG_FEATURE_CROND_DIR "/var/spool/cron"
+#define ENABLE_FEATURE_CROND_DIR 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_CROND_DIR(...) __VA_ARGS__ "CONFIG_FEATURE_CROND_DIR"
+#else
+# define IF_FEATURE_CROND_DIR(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_CROND_DIR(...)
+#define CONFIG_CRONTAB 1
+#define ENABLE_CRONTAB 1
+#ifdef MAKE_SUID
+# define IF_CRONTAB(...) __VA_ARGS__ "CONFIG_CRONTAB"
+#else
+# define IF_CRONTAB(...) __VA_ARGS__
+#endif
+#define IF_NOT_CRONTAB(...)
+#define CONFIG_DC 1
+#define ENABLE_DC 1
+#ifdef MAKE_SUID
+# define IF_DC(...) __VA_ARGS__ "CONFIG_DC"
+#else
+# define IF_DC(...) __VA_ARGS__
+#endif
+#define IF_NOT_DC(...)
+#define CONFIG_FEATURE_DC_LIBM 1
+#define ENABLE_FEATURE_DC_LIBM 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_DC_LIBM(...) __VA_ARGS__ "CONFIG_FEATURE_DC_LIBM"
+#else
+# define IF_FEATURE_DC_LIBM(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_DC_LIBM(...)
+#undef CONFIG_DEVFSD
+#define ENABLE_DEVFSD 0
+#define IF_DEVFSD(...)
+#define IF_NOT_DEVFSD(...) __VA_ARGS__
+#undef CONFIG_DEVFSD_MODLOAD
+#define ENABLE_DEVFSD_MODLOAD 0
+#define IF_DEVFSD_MODLOAD(...)
+#define IF_NOT_DEVFSD_MODLOAD(...) __VA_ARGS__
+#undef CONFIG_DEVFSD_FG_NP
+#define ENABLE_DEVFSD_FG_NP 0
+#define IF_DEVFSD_FG_NP(...)
+#define IF_NOT_DEVFSD_FG_NP(...) __VA_ARGS__
+#undef CONFIG_DEVFSD_VERBOSE
+#define ENABLE_DEVFSD_VERBOSE 0
+#define IF_DEVFSD_VERBOSE(...)
+#define IF_NOT_DEVFSD_VERBOSE(...) __VA_ARGS__
+#undef CONFIG_FEATURE_DEVFS
+#define ENABLE_FEATURE_DEVFS 0
+#define IF_FEATURE_DEVFS(...)
+#define IF_NOT_FEATURE_DEVFS(...) __VA_ARGS__
+#define CONFIG_DEVMEM 1
+#define ENABLE_DEVMEM 1
+#ifdef MAKE_SUID
+# define IF_DEVMEM(...) __VA_ARGS__ "CONFIG_DEVMEM"
+#else
+# define IF_DEVMEM(...) __VA_ARGS__
+#endif
+#define IF_NOT_DEVMEM(...)
+#define CONFIG_EJECT 1
+#define ENABLE_EJECT 1
+#ifdef MAKE_SUID
+# define IF_EJECT(...) __VA_ARGS__ "CONFIG_EJECT"
+#else
+# define IF_EJECT(...) __VA_ARGS__
+#endif
+#define IF_NOT_EJECT(...)
+#define CONFIG_FEATURE_EJECT_SCSI 1
+#define ENABLE_FEATURE_EJECT_SCSI 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_EJECT_SCSI(...) __VA_ARGS__ "CONFIG_FEATURE_EJECT_SCSI"
+#else
+# define IF_FEATURE_EJECT_SCSI(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_EJECT_SCSI(...)
+#define CONFIG_FBSPLASH 1
+#define ENABLE_FBSPLASH 1
+#ifdef MAKE_SUID
+# define IF_FBSPLASH(...) __VA_ARGS__ "CONFIG_FBSPLASH"
+#else
+# define IF_FBSPLASH(...) __VA_ARGS__
+#endif
+#define IF_NOT_FBSPLASH(...)
+#undef CONFIG_FLASH_ERASEALL
+#define ENABLE_FLASH_ERASEALL 0
+#define IF_FLASH_ERASEALL(...)
+#define IF_NOT_FLASH_ERASEALL(...) __VA_ARGS__
+#undef CONFIG_FLASH_LOCK
+#define ENABLE_FLASH_LOCK 0
+#define IF_FLASH_LOCK(...)
+#define IF_NOT_FLASH_LOCK(...) __VA_ARGS__
+#undef CONFIG_FLASH_UNLOCK
+#define ENABLE_FLASH_UNLOCK 0
+#define IF_FLASH_UNLOCK(...)
+#define IF_NOT_FLASH_UNLOCK(...) __VA_ARGS__
+#define CONFIG_FLASHCP 1
+#define ENABLE_FLASHCP 1
+#ifdef MAKE_SUID
+# define IF_FLASHCP(...) __VA_ARGS__ "CONFIG_FLASHCP"
+#else
+# define IF_FLASHCP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FLASHCP(...)
+#define CONFIG_HDPARM 1
+#define ENABLE_HDPARM 1
+#ifdef MAKE_SUID
+# define IF_HDPARM(...) __VA_ARGS__ "CONFIG_HDPARM"
+#else
+# define IF_HDPARM(...) __VA_ARGS__
+#endif
+#define IF_NOT_HDPARM(...)
+#define CONFIG_FEATURE_HDPARM_GET_IDENTITY 1
+#define ENABLE_FEATURE_HDPARM_GET_IDENTITY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HDPARM_GET_IDENTITY(...) __VA_ARGS__ "CONFIG_FEATURE_HDPARM_GET_IDENTITY"
+#else
+# define IF_FEATURE_HDPARM_GET_IDENTITY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HDPARM_GET_IDENTITY(...)
+#define CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF 1
+#define ENABLE_FEATURE_HDPARM_HDIO_SCAN_HWIF 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HDPARM_HDIO_SCAN_HWIF(...) __VA_ARGS__ "CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF"
+#else
+# define IF_FEATURE_HDPARM_HDIO_SCAN_HWIF(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HDPARM_HDIO_SCAN_HWIF(...)
+#define CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF 1
+#define ENABLE_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF(...) __VA_ARGS__ "CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF"
+#else
+# define IF_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF(...)
+#define CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET 1
+#define ENABLE_FEATURE_HDPARM_HDIO_DRIVE_RESET 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HDPARM_HDIO_DRIVE_RESET(...) __VA_ARGS__ "CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET"
+#else
+# define IF_FEATURE_HDPARM_HDIO_DRIVE_RESET(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HDPARM_HDIO_DRIVE_RESET(...)
+#define CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF 1
+#define ENABLE_FEATURE_HDPARM_HDIO_TRISTATE_HWIF 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(...) __VA_ARGS__ "CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF"
+#else
+# define IF_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HDPARM_HDIO_TRISTATE_HWIF(...)
+#define CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA 1
+#define ENABLE_FEATURE_HDPARM_HDIO_GETSET_DMA 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HDPARM_HDIO_GETSET_DMA(...) __VA_ARGS__ "CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA"
+#else
+# define IF_FEATURE_HDPARM_HDIO_GETSET_DMA(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HDPARM_HDIO_GETSET_DMA(...)
+#define CONFIG_I2CGET 1
+#define ENABLE_I2CGET 1
+#ifdef MAKE_SUID
+# define IF_I2CGET(...) __VA_ARGS__ "CONFIG_I2CGET"
+#else
+# define IF_I2CGET(...) __VA_ARGS__
+#endif
+#define IF_NOT_I2CGET(...)
+#define CONFIG_I2CSET 1
+#define ENABLE_I2CSET 1
+#ifdef MAKE_SUID
+# define IF_I2CSET(...) __VA_ARGS__ "CONFIG_I2CSET"
+#else
+# define IF_I2CSET(...) __VA_ARGS__
+#endif
+#define IF_NOT_I2CSET(...)
+#define CONFIG_I2CDUMP 1
+#define ENABLE_I2CDUMP 1
+#ifdef MAKE_SUID
+# define IF_I2CDUMP(...) __VA_ARGS__ "CONFIG_I2CDUMP"
+#else
+# define IF_I2CDUMP(...) __VA_ARGS__
+#endif
+#define IF_NOT_I2CDUMP(...)
+#define CONFIG_I2CDETECT 1
+#define ENABLE_I2CDETECT 1
+#ifdef MAKE_SUID
+# define IF_I2CDETECT(...) __VA_ARGS__ "CONFIG_I2CDETECT"
+#else
+# define IF_I2CDETECT(...) __VA_ARGS__
+#endif
+#define IF_NOT_I2CDETECT(...)
+#define CONFIG_INOTIFYD 1
+#define ENABLE_INOTIFYD 1
+#ifdef MAKE_SUID
+# define IF_INOTIFYD(...) __VA_ARGS__ "CONFIG_INOTIFYD"
+#else
+# define IF_INOTIFYD(...) __VA_ARGS__
+#endif
+#define IF_NOT_INOTIFYD(...)
+#define CONFIG_IONICE 1
+#define ENABLE_IONICE 1
+#ifdef MAKE_SUID
+# define IF_IONICE(...) __VA_ARGS__ "CONFIG_IONICE"
+#else
+# define IF_IONICE(...) __VA_ARGS__
+#endif
+#define IF_NOT_IONICE(...)
+#define CONFIG_LAST 1
+#define ENABLE_LAST 1
+#ifdef MAKE_SUID
+# define IF_LAST(...) __VA_ARGS__ "CONFIG_LAST"
+#else
+# define IF_LAST(...) __VA_ARGS__
+#endif
+#define IF_NOT_LAST(...)
+#undef CONFIG_FEATURE_LAST_FANCY
+#define ENABLE_FEATURE_LAST_FANCY 0
+#define IF_FEATURE_LAST_FANCY(...)
+#define IF_NOT_FEATURE_LAST_FANCY(...) __VA_ARGS__
+#define CONFIG_LESS 1
+#define ENABLE_LESS 1
+#ifdef MAKE_SUID
+# define IF_LESS(...) __VA_ARGS__ "CONFIG_LESS"
+#else
+# define IF_LESS(...) __VA_ARGS__
+#endif
+#define IF_NOT_LESS(...)
+#define CONFIG_FEATURE_LESS_MAXLINES 9999999
+#define ENABLE_FEATURE_LESS_MAXLINES 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LESS_MAXLINES(...) __VA_ARGS__ "CONFIG_FEATURE_LESS_MAXLINES"
+#else
+# define IF_FEATURE_LESS_MAXLINES(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LESS_MAXLINES(...)
+#define CONFIG_FEATURE_LESS_BRACKETS 1
+#define ENABLE_FEATURE_LESS_BRACKETS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LESS_BRACKETS(...) __VA_ARGS__ "CONFIG_FEATURE_LESS_BRACKETS"
+#else
+# define IF_FEATURE_LESS_BRACKETS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LESS_BRACKETS(...)
+#define CONFIG_FEATURE_LESS_FLAGS 1
+#define ENABLE_FEATURE_LESS_FLAGS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LESS_FLAGS(...) __VA_ARGS__ "CONFIG_FEATURE_LESS_FLAGS"
+#else
+# define IF_FEATURE_LESS_FLAGS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LESS_FLAGS(...)
+#define CONFIG_FEATURE_LESS_TRUNCATE 1
+#define ENABLE_FEATURE_LESS_TRUNCATE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LESS_TRUNCATE(...) __VA_ARGS__ "CONFIG_FEATURE_LESS_TRUNCATE"
+#else
+# define IF_FEATURE_LESS_TRUNCATE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LESS_TRUNCATE(...)
+#define CONFIG_FEATURE_LESS_MARKS 1
+#define ENABLE_FEATURE_LESS_MARKS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LESS_MARKS(...) __VA_ARGS__ "CONFIG_FEATURE_LESS_MARKS"
+#else
+# define IF_FEATURE_LESS_MARKS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LESS_MARKS(...)
+#define CONFIG_FEATURE_LESS_REGEXP 1
+#define ENABLE_FEATURE_LESS_REGEXP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LESS_REGEXP(...) __VA_ARGS__ "CONFIG_FEATURE_LESS_REGEXP"
+#else
+# define IF_FEATURE_LESS_REGEXP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LESS_REGEXP(...)
+#define CONFIG_FEATURE_LESS_WINCH 1
+#define ENABLE_FEATURE_LESS_WINCH 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LESS_WINCH(...) __VA_ARGS__ "CONFIG_FEATURE_LESS_WINCH"
+#else
+# define IF_FEATURE_LESS_WINCH(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LESS_WINCH(...)
+#define CONFIG_FEATURE_LESS_ASK_TERMINAL 1
+#define ENABLE_FEATURE_LESS_ASK_TERMINAL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LESS_ASK_TERMINAL(...) __VA_ARGS__ "CONFIG_FEATURE_LESS_ASK_TERMINAL"
+#else
+# define IF_FEATURE_LESS_ASK_TERMINAL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LESS_ASK_TERMINAL(...)
+#define CONFIG_FEATURE_LESS_DASHCMD 1
+#define ENABLE_FEATURE_LESS_DASHCMD 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LESS_DASHCMD(...) __VA_ARGS__ "CONFIG_FEATURE_LESS_DASHCMD"
+#else
+# define IF_FEATURE_LESS_DASHCMD(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LESS_DASHCMD(...)
+#define CONFIG_FEATURE_LESS_LINENUMS 1
+#define ENABLE_FEATURE_LESS_LINENUMS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LESS_LINENUMS(...) __VA_ARGS__ "CONFIG_FEATURE_LESS_LINENUMS"
+#else
+# define IF_FEATURE_LESS_LINENUMS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LESS_LINENUMS(...)
+#define CONFIG_MAKEDEVS 1
+#define ENABLE_MAKEDEVS 1
+#ifdef MAKE_SUID
+# define IF_MAKEDEVS(...) __VA_ARGS__ "CONFIG_MAKEDEVS"
+#else
+# define IF_MAKEDEVS(...) __VA_ARGS__
+#endif
+#define IF_NOT_MAKEDEVS(...)
+#undef CONFIG_FEATURE_MAKEDEVS_LEAF
+#define ENABLE_FEATURE_MAKEDEVS_LEAF 0
+#define IF_FEATURE_MAKEDEVS_LEAF(...)
+#define IF_NOT_FEATURE_MAKEDEVS_LEAF(...) __VA_ARGS__
+#define CONFIG_FEATURE_MAKEDEVS_TABLE 1
+#define ENABLE_FEATURE_MAKEDEVS_TABLE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MAKEDEVS_TABLE(...) __VA_ARGS__ "CONFIG_FEATURE_MAKEDEVS_TABLE"
+#else
+# define IF_FEATURE_MAKEDEVS_TABLE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MAKEDEVS_TABLE(...)
+#define CONFIG_MAN 1
+#define ENABLE_MAN 1
+#ifdef MAKE_SUID
+# define IF_MAN(...) __VA_ARGS__ "CONFIG_MAN"
+#else
+# define IF_MAN(...) __VA_ARGS__
+#endif
+#define IF_NOT_MAN(...)
+#define CONFIG_MICROCOM 1
+#define ENABLE_MICROCOM 1
+#ifdef MAKE_SUID
+# define IF_MICROCOM(...) __VA_ARGS__ "CONFIG_MICROCOM"
+#else
+# define IF_MICROCOM(...) __VA_ARGS__
+#endif
+#define IF_NOT_MICROCOM(...)
+#define CONFIG_MOUNTPOINT 1
+#define ENABLE_MOUNTPOINT 1
+#ifdef MAKE_SUID
+# define IF_MOUNTPOINT(...) __VA_ARGS__ "CONFIG_MOUNTPOINT"
+#else
+# define IF_MOUNTPOINT(...) __VA_ARGS__
+#endif
+#define IF_NOT_MOUNTPOINT(...)
+#define CONFIG_MT 1
+#define ENABLE_MT 1
+#ifdef MAKE_SUID
+# define IF_MT(...) __VA_ARGS__ "CONFIG_MT"
+#else
+# define IF_MT(...) __VA_ARGS__
+#endif
+#define IF_NOT_MT(...)
+#define CONFIG_NANDWRITE 1
+#define ENABLE_NANDWRITE 1
+#ifdef MAKE_SUID
+# define IF_NANDWRITE(...) __VA_ARGS__ "CONFIG_NANDWRITE"
+#else
+# define IF_NANDWRITE(...) __VA_ARGS__
+#endif
+#define IF_NOT_NANDWRITE(...)
+#define CONFIG_NANDDUMP 1
+#define ENABLE_NANDDUMP 1
+#ifdef MAKE_SUID
+# define IF_NANDDUMP(...) __VA_ARGS__ "CONFIG_NANDDUMP"
+#else
+# define IF_NANDDUMP(...) __VA_ARGS__
+#endif
+#define IF_NOT_NANDDUMP(...)
+#define CONFIG_RAIDAUTORUN 1
+#define ENABLE_RAIDAUTORUN 1
+#ifdef MAKE_SUID
+# define IF_RAIDAUTORUN(...) __VA_ARGS__ "CONFIG_RAIDAUTORUN"
+#else
+# define IF_RAIDAUTORUN(...) __VA_ARGS__
+#endif
+#define IF_NOT_RAIDAUTORUN(...)
+#define CONFIG_READAHEAD 1
+#define ENABLE_READAHEAD 1
+#ifdef MAKE_SUID
+# define IF_READAHEAD(...) __VA_ARGS__ "CONFIG_READAHEAD"
+#else
+# define IF_READAHEAD(...) __VA_ARGS__
+#endif
+#define IF_NOT_READAHEAD(...)
+#undef CONFIG_RFKILL
+#define ENABLE_RFKILL 0
+#define IF_RFKILL(...)
+#define IF_NOT_RFKILL(...) __VA_ARGS__
+#define CONFIG_RUNLEVEL 1
+#define ENABLE_RUNLEVEL 1
+#ifdef MAKE_SUID
+# define IF_RUNLEVEL(...) __VA_ARGS__ "CONFIG_RUNLEVEL"
+#else
+# define IF_RUNLEVEL(...) __VA_ARGS__
+#endif
+#define IF_NOT_RUNLEVEL(...)
+#define CONFIG_RX 1
+#define ENABLE_RX 1
+#ifdef MAKE_SUID
+# define IF_RX(...) __VA_ARGS__ "CONFIG_RX"
+#else
+# define IF_RX(...) __VA_ARGS__
+#endif
+#define IF_NOT_RX(...)
+#define CONFIG_SETSERIAL 1
+#define ENABLE_SETSERIAL 1
+#ifdef MAKE_SUID
+# define IF_SETSERIAL(...) __VA_ARGS__ "CONFIG_SETSERIAL"
+#else
+# define IF_SETSERIAL(...) __VA_ARGS__
+#endif
+#define IF_NOT_SETSERIAL(...)
+#define CONFIG_SETSID 1
+#define ENABLE_SETSID 1
+#ifdef MAKE_SUID
+# define IF_SETSID(...) __VA_ARGS__ "CONFIG_SETSID"
+#else
+# define IF_SETSID(...) __VA_ARGS__
+#endif
+#define IF_NOT_SETSID(...)
+#define CONFIG_STRINGS 1
+#define ENABLE_STRINGS 1
+#ifdef MAKE_SUID
+# define IF_STRINGS(...) __VA_ARGS__ "CONFIG_STRINGS"
+#else
+# define IF_STRINGS(...) __VA_ARGS__
+#endif
+#define IF_NOT_STRINGS(...)
+#define CONFIG_TASKSET 1
+#define ENABLE_TASKSET 1
+#ifdef MAKE_SUID
+# define IF_TASKSET(...) __VA_ARGS__ "CONFIG_TASKSET"
+#else
+# define IF_TASKSET(...) __VA_ARGS__
+#endif
+#define IF_NOT_TASKSET(...)
+#define CONFIG_FEATURE_TASKSET_FANCY 1
+#define ENABLE_FEATURE_TASKSET_FANCY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TASKSET_FANCY(...) __VA_ARGS__ "CONFIG_FEATURE_TASKSET_FANCY"
+#else
+# define IF_FEATURE_TASKSET_FANCY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TASKSET_FANCY(...)
+#define CONFIG_TIME 1
+#define ENABLE_TIME 1
+#ifdef MAKE_SUID
+# define IF_TIME(...) __VA_ARGS__ "CONFIG_TIME"
+#else
+# define IF_TIME(...) __VA_ARGS__
+#endif
+#define IF_NOT_TIME(...)
+#define CONFIG_TIMEOUT 1
+#define ENABLE_TIMEOUT 1
+#ifdef MAKE_SUID
+# define IF_TIMEOUT(...) __VA_ARGS__ "CONFIG_TIMEOUT"
+#else
+# define IF_TIMEOUT(...) __VA_ARGS__
+#endif
+#define IF_NOT_TIMEOUT(...)
+#define CONFIG_TTYSIZE 1
+#define ENABLE_TTYSIZE 1
+#ifdef MAKE_SUID
+# define IF_TTYSIZE(...) __VA_ARGS__ "CONFIG_TTYSIZE"
+#else
+# define IF_TTYSIZE(...) __VA_ARGS__
+#endif
+#define IF_NOT_TTYSIZE(...)
+#define CONFIG_UBIATTACH 1
+#define ENABLE_UBIATTACH 1
+#ifdef MAKE_SUID
+# define IF_UBIATTACH(...) __VA_ARGS__ "CONFIG_UBIATTACH"
+#else
+# define IF_UBIATTACH(...) __VA_ARGS__
+#endif
+#define IF_NOT_UBIATTACH(...)
+#define CONFIG_UBIDETACH 1
+#define ENABLE_UBIDETACH 1
+#ifdef MAKE_SUID
+# define IF_UBIDETACH(...) __VA_ARGS__ "CONFIG_UBIDETACH"
+#else
+# define IF_UBIDETACH(...) __VA_ARGS__
+#endif
+#define IF_NOT_UBIDETACH(...)
+#define CONFIG_UBIMKVOL 1
+#define ENABLE_UBIMKVOL 1
+#ifdef MAKE_SUID
+# define IF_UBIMKVOL(...) __VA_ARGS__ "CONFIG_UBIMKVOL"
+#else
+# define IF_UBIMKVOL(...) __VA_ARGS__
+#endif
+#define IF_NOT_UBIMKVOL(...)
+#define CONFIG_UBIRMVOL 1
+#define ENABLE_UBIRMVOL 1
+#ifdef MAKE_SUID
+# define IF_UBIRMVOL(...) __VA_ARGS__ "CONFIG_UBIRMVOL"
+#else
+# define IF_UBIRMVOL(...) __VA_ARGS__
+#endif
+#define IF_NOT_UBIRMVOL(...)
+#define CONFIG_UBIRSVOL 1
+#define ENABLE_UBIRSVOL 1
+#ifdef MAKE_SUID
+# define IF_UBIRSVOL(...) __VA_ARGS__ "CONFIG_UBIRSVOL"
+#else
+# define IF_UBIRSVOL(...) __VA_ARGS__
+#endif
+#define IF_NOT_UBIRSVOL(...)
+#define CONFIG_UBIUPDATEVOL 1
+#define ENABLE_UBIUPDATEVOL 1
+#ifdef MAKE_SUID
+# define IF_UBIUPDATEVOL(...) __VA_ARGS__ "CONFIG_UBIUPDATEVOL"
+#else
+# define IF_UBIUPDATEVOL(...) __VA_ARGS__
+#endif
+#define IF_NOT_UBIUPDATEVOL(...)
+#define CONFIG_UBIRENAME 1
+#define ENABLE_UBIRENAME 1
+#ifdef MAKE_SUID
+# define IF_UBIRENAME(...) __VA_ARGS__ "CONFIG_UBIRENAME"
+#else
+# define IF_UBIRENAME(...) __VA_ARGS__
+#endif
+#define IF_NOT_UBIRENAME(...)
+#define CONFIG_VOLNAME 1
+#define ENABLE_VOLNAME 1
+#ifdef MAKE_SUID
+# define IF_VOLNAME(...) __VA_ARGS__ "CONFIG_VOLNAME"
+#else
+# define IF_VOLNAME(...) __VA_ARGS__
+#endif
+#define IF_NOT_VOLNAME(...)
+#define CONFIG_WALL 1
+#define ENABLE_WALL 1
+#ifdef MAKE_SUID
+# define IF_WALL(...) __VA_ARGS__ "CONFIG_WALL"
+#else
+# define IF_WALL(...) __VA_ARGS__
+#endif
+#define IF_NOT_WALL(...)
+#define CONFIG_WATCHDOG 1
+#define ENABLE_WATCHDOG 1
+#ifdef MAKE_SUID
+# define IF_WATCHDOG(...) __VA_ARGS__ "CONFIG_WATCHDOG"
+#else
+# define IF_WATCHDOG(...) __VA_ARGS__
+#endif
+#define IF_NOT_WATCHDOG(...)
+
+/*
+ * Networking Utilities
+ */
+#define CONFIG_FEATURE_IPV6 1
+#define ENABLE_FEATURE_IPV6 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IPV6(...) __VA_ARGS__ "CONFIG_FEATURE_IPV6"
+#else
+# define IF_FEATURE_IPV6(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IPV6(...)
+#define CONFIG_FEATURE_UNIX_LOCAL 1
+#define ENABLE_FEATURE_UNIX_LOCAL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_UNIX_LOCAL(...) __VA_ARGS__ "CONFIG_FEATURE_UNIX_LOCAL"
+#else
+# define IF_FEATURE_UNIX_LOCAL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_UNIX_LOCAL(...)
+#define CONFIG_FEATURE_PREFER_IPV4_ADDRESS 1
+#define ENABLE_FEATURE_PREFER_IPV4_ADDRESS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_PREFER_IPV4_ADDRESS(...) __VA_ARGS__ "CONFIG_FEATURE_PREFER_IPV4_ADDRESS"
+#else
+# define IF_FEATURE_PREFER_IPV4_ADDRESS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_PREFER_IPV4_ADDRESS(...)
+#define CONFIG_VERBOSE_RESOLUTION_ERRORS 1
+#define ENABLE_VERBOSE_RESOLUTION_ERRORS 1
+#ifdef MAKE_SUID
+# define IF_VERBOSE_RESOLUTION_ERRORS(...) __VA_ARGS__ "CONFIG_VERBOSE_RESOLUTION_ERRORS"
+#else
+# define IF_VERBOSE_RESOLUTION_ERRORS(...) __VA_ARGS__
+#endif
+#define IF_NOT_VERBOSE_RESOLUTION_ERRORS(...)
+#define CONFIG_ARP 1
+#define ENABLE_ARP 1
+#ifdef MAKE_SUID
+# define IF_ARP(...) __VA_ARGS__ "CONFIG_ARP"
+#else
+# define IF_ARP(...) __VA_ARGS__
+#endif
+#define IF_NOT_ARP(...)
+#define CONFIG_ARPING 1
+#define ENABLE_ARPING 1
+#ifdef MAKE_SUID
+# define IF_ARPING(...) __VA_ARGS__ "CONFIG_ARPING"
+#else
+# define IF_ARPING(...) __VA_ARGS__
+#endif
+#define IF_NOT_ARPING(...)
+#define CONFIG_BRCTL 1
+#define ENABLE_BRCTL 1
+#ifdef MAKE_SUID
+# define IF_BRCTL(...) __VA_ARGS__ "CONFIG_BRCTL"
+#else
+# define IF_BRCTL(...) __VA_ARGS__
+#endif
+#define IF_NOT_BRCTL(...)
+#define CONFIG_FEATURE_BRCTL_FANCY 1
+#define ENABLE_FEATURE_BRCTL_FANCY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_BRCTL_FANCY(...) __VA_ARGS__ "CONFIG_FEATURE_BRCTL_FANCY"
+#else
+# define IF_FEATURE_BRCTL_FANCY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_BRCTL_FANCY(...)
+#define CONFIG_FEATURE_BRCTL_SHOW 1
+#define ENABLE_FEATURE_BRCTL_SHOW 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_BRCTL_SHOW(...) __VA_ARGS__ "CONFIG_FEATURE_BRCTL_SHOW"
+#else
+# define IF_FEATURE_BRCTL_SHOW(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_BRCTL_SHOW(...)
+#define CONFIG_DNSD 1
+#define ENABLE_DNSD 1
+#ifdef MAKE_SUID
+# define IF_DNSD(...) __VA_ARGS__ "CONFIG_DNSD"
+#else
+# define IF_DNSD(...) __VA_ARGS__
+#endif
+#define IF_NOT_DNSD(...)
+#define CONFIG_ETHER_WAKE 1
+#define ENABLE_ETHER_WAKE 1
+#ifdef MAKE_SUID
+# define IF_ETHER_WAKE(...) __VA_ARGS__ "CONFIG_ETHER_WAKE"
+#else
+# define IF_ETHER_WAKE(...) __VA_ARGS__
+#endif
+#define IF_NOT_ETHER_WAKE(...)
+#define CONFIG_FTPD 1
+#define ENABLE_FTPD 1
+#ifdef MAKE_SUID
+# define IF_FTPD(...) __VA_ARGS__ "CONFIG_FTPD"
+#else
+# define IF_FTPD(...) __VA_ARGS__
+#endif
+#define IF_NOT_FTPD(...)
+#define CONFIG_FEATURE_FTPD_WRITE 1
+#define ENABLE_FEATURE_FTPD_WRITE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FTPD_WRITE(...) __VA_ARGS__ "CONFIG_FEATURE_FTPD_WRITE"
+#else
+# define IF_FEATURE_FTPD_WRITE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FTPD_WRITE(...)
+#define CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST 1
+#define ENABLE_FEATURE_FTPD_ACCEPT_BROKEN_LIST 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FTPD_ACCEPT_BROKEN_LIST(...) __VA_ARGS__ "CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST"
+#else
+# define IF_FEATURE_FTPD_ACCEPT_BROKEN_LIST(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FTPD_ACCEPT_BROKEN_LIST(...)
+#define CONFIG_FEATURE_FTPD_AUTHENTICATION 1
+#define ENABLE_FEATURE_FTPD_AUTHENTICATION 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FTPD_AUTHENTICATION(...) __VA_ARGS__ "CONFIG_FEATURE_FTPD_AUTHENTICATION"
+#else
+# define IF_FEATURE_FTPD_AUTHENTICATION(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FTPD_AUTHENTICATION(...)
+#define CONFIG_FTPGET 1
+#define ENABLE_FTPGET 1
+#ifdef MAKE_SUID
+# define IF_FTPGET(...) __VA_ARGS__ "CONFIG_FTPGET"
+#else
+# define IF_FTPGET(...) __VA_ARGS__
+#endif
+#define IF_NOT_FTPGET(...)
+#define CONFIG_FTPPUT 1
+#define ENABLE_FTPPUT 1
+#ifdef MAKE_SUID
+# define IF_FTPPUT(...) __VA_ARGS__ "CONFIG_FTPPUT"
+#else
+# define IF_FTPPUT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FTPPUT(...)
+#define CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS 1
+#define ENABLE_FEATURE_FTPGETPUT_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FTPGETPUT_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS"
+#else
+# define IF_FEATURE_FTPGETPUT_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS(...)
+#define CONFIG_HOSTNAME 1
+#define ENABLE_HOSTNAME 1
+#ifdef MAKE_SUID
+# define IF_HOSTNAME(...) __VA_ARGS__ "CONFIG_HOSTNAME"
+#else
+# define IF_HOSTNAME(...) __VA_ARGS__
+#endif
+#define IF_NOT_HOSTNAME(...)
+#define CONFIG_DNSDOMAINNAME 1
+#define ENABLE_DNSDOMAINNAME 1
+#ifdef MAKE_SUID
+# define IF_DNSDOMAINNAME(...) __VA_ARGS__ "CONFIG_DNSDOMAINNAME"
+#else
+# define IF_DNSDOMAINNAME(...) __VA_ARGS__
+#endif
+#define IF_NOT_DNSDOMAINNAME(...)
+#define CONFIG_HTTPD 1
+#define ENABLE_HTTPD 1
+#ifdef MAKE_SUID
+# define IF_HTTPD(...) __VA_ARGS__ "CONFIG_HTTPD"
+#else
+# define IF_HTTPD(...) __VA_ARGS__
+#endif
+#define IF_NOT_HTTPD(...)
+#define CONFIG_FEATURE_HTTPD_RANGES 1
+#define ENABLE_FEATURE_HTTPD_RANGES 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HTTPD_RANGES(...) __VA_ARGS__ "CONFIG_FEATURE_HTTPD_RANGES"
+#else
+# define IF_FEATURE_HTTPD_RANGES(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HTTPD_RANGES(...)
+#define CONFIG_FEATURE_HTTPD_SETUID 1
+#define ENABLE_FEATURE_HTTPD_SETUID 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HTTPD_SETUID(...) __VA_ARGS__ "CONFIG_FEATURE_HTTPD_SETUID"
+#else
+# define IF_FEATURE_HTTPD_SETUID(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HTTPD_SETUID(...)
+#define CONFIG_FEATURE_HTTPD_BASIC_AUTH 1
+#define ENABLE_FEATURE_HTTPD_BASIC_AUTH 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HTTPD_BASIC_AUTH(...) __VA_ARGS__ "CONFIG_FEATURE_HTTPD_BASIC_AUTH"
+#else
+# define IF_FEATURE_HTTPD_BASIC_AUTH(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HTTPD_BASIC_AUTH(...)
+#define CONFIG_FEATURE_HTTPD_AUTH_MD5 1
+#define ENABLE_FEATURE_HTTPD_AUTH_MD5 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HTTPD_AUTH_MD5(...) __VA_ARGS__ "CONFIG_FEATURE_HTTPD_AUTH_MD5"
+#else
+# define IF_FEATURE_HTTPD_AUTH_MD5(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HTTPD_AUTH_MD5(...)
+#define CONFIG_FEATURE_HTTPD_CGI 1
+#define ENABLE_FEATURE_HTTPD_CGI 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HTTPD_CGI(...) __VA_ARGS__ "CONFIG_FEATURE_HTTPD_CGI"
+#else
+# define IF_FEATURE_HTTPD_CGI(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HTTPD_CGI(...)
+#define CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR 1
+#define ENABLE_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR(...) __VA_ARGS__ "CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR"
+#else
+# define IF_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR(...)
+#define CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV 1
+#define ENABLE_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV(...) __VA_ARGS__ "CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV"
+#else
+# define IF_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV(...)
+#define CONFIG_FEATURE_HTTPD_ENCODE_URL_STR 1
+#define ENABLE_FEATURE_HTTPD_ENCODE_URL_STR 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HTTPD_ENCODE_URL_STR(...) __VA_ARGS__ "CONFIG_FEATURE_HTTPD_ENCODE_URL_STR"
+#else
+# define IF_FEATURE_HTTPD_ENCODE_URL_STR(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HTTPD_ENCODE_URL_STR(...)
+#define CONFIG_FEATURE_HTTPD_ERROR_PAGES 1
+#define ENABLE_FEATURE_HTTPD_ERROR_PAGES 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HTTPD_ERROR_PAGES(...) __VA_ARGS__ "CONFIG_FEATURE_HTTPD_ERROR_PAGES"
+#else
+# define IF_FEATURE_HTTPD_ERROR_PAGES(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HTTPD_ERROR_PAGES(...)
+#define CONFIG_FEATURE_HTTPD_PROXY 1
+#define ENABLE_FEATURE_HTTPD_PROXY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HTTPD_PROXY(...) __VA_ARGS__ "CONFIG_FEATURE_HTTPD_PROXY"
+#else
+# define IF_FEATURE_HTTPD_PROXY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HTTPD_PROXY(...)
+#define CONFIG_FEATURE_HTTPD_GZIP 1
+#define ENABLE_FEATURE_HTTPD_GZIP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_HTTPD_GZIP(...) __VA_ARGS__ "CONFIG_FEATURE_HTTPD_GZIP"
+#else
+# define IF_FEATURE_HTTPD_GZIP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_HTTPD_GZIP(...)
+#define CONFIG_IFCONFIG 1
+#define ENABLE_IFCONFIG 1
+#ifdef MAKE_SUID
+# define IF_IFCONFIG(...) __VA_ARGS__ "CONFIG_IFCONFIG"
+#else
+# define IF_IFCONFIG(...) __VA_ARGS__
+#endif
+#define IF_NOT_IFCONFIG(...)
+#define CONFIG_FEATURE_IFCONFIG_STATUS 1
+#define ENABLE_FEATURE_IFCONFIG_STATUS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IFCONFIG_STATUS(...) __VA_ARGS__ "CONFIG_FEATURE_IFCONFIG_STATUS"
+#else
+# define IF_FEATURE_IFCONFIG_STATUS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IFCONFIG_STATUS(...)
+#define CONFIG_FEATURE_IFCONFIG_SLIP 1
+#define ENABLE_FEATURE_IFCONFIG_SLIP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IFCONFIG_SLIP(...) __VA_ARGS__ "CONFIG_FEATURE_IFCONFIG_SLIP"
+#else
+# define IF_FEATURE_IFCONFIG_SLIP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IFCONFIG_SLIP(...)
+#define CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ 1
+#define ENABLE_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ(...) __VA_ARGS__ "CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ"
+#else
+# define IF_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ(...)
+#define CONFIG_FEATURE_IFCONFIG_HW 1
+#define ENABLE_FEATURE_IFCONFIG_HW 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IFCONFIG_HW(...) __VA_ARGS__ "CONFIG_FEATURE_IFCONFIG_HW"
+#else
+# define IF_FEATURE_IFCONFIG_HW(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IFCONFIG_HW(...)
+#define CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS 1
+#define ENABLE_FEATURE_IFCONFIG_BROADCAST_PLUS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IFCONFIG_BROADCAST_PLUS(...) __VA_ARGS__ "CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS"
+#else
+# define IF_FEATURE_IFCONFIG_BROADCAST_PLUS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IFCONFIG_BROADCAST_PLUS(...)
+#define CONFIG_IFENSLAVE 1
+#define ENABLE_IFENSLAVE 1
+#ifdef MAKE_SUID
+# define IF_IFENSLAVE(...) __VA_ARGS__ "CONFIG_IFENSLAVE"
+#else
+# define IF_IFENSLAVE(...) __VA_ARGS__
+#endif
+#define IF_NOT_IFENSLAVE(...)
+#define CONFIG_IFPLUGD 1
+#define ENABLE_IFPLUGD 1
+#ifdef MAKE_SUID
+# define IF_IFPLUGD(...) __VA_ARGS__ "CONFIG_IFPLUGD"
+#else
+# define IF_IFPLUGD(...) __VA_ARGS__
+#endif
+#define IF_NOT_IFPLUGD(...)
+#define CONFIG_IFUP 1
+#define ENABLE_IFUP 1
+#ifdef MAKE_SUID
+# define IF_IFUP(...) __VA_ARGS__ "CONFIG_IFUP"
+#else
+# define IF_IFUP(...) __VA_ARGS__
+#endif
+#define IF_NOT_IFUP(...)
+#define CONFIG_IFDOWN 1
+#define ENABLE_IFDOWN 1
+#ifdef MAKE_SUID
+# define IF_IFDOWN(...) __VA_ARGS__ "CONFIG_IFDOWN"
+#else
+# define IF_IFDOWN(...) __VA_ARGS__
+#endif
+#define IF_NOT_IFDOWN(...)
+#define CONFIG_IFUPDOWN_IFSTATE_PATH "/var/run/ifstate"
+#define ENABLE_IFUPDOWN_IFSTATE_PATH 1
+#ifdef MAKE_SUID
+# define IF_IFUPDOWN_IFSTATE_PATH(...) __VA_ARGS__ "CONFIG_IFUPDOWN_IFSTATE_PATH"
+#else
+# define IF_IFUPDOWN_IFSTATE_PATH(...) __VA_ARGS__
+#endif
+#define IF_NOT_IFUPDOWN_IFSTATE_PATH(...)
+#define CONFIG_FEATURE_IFUPDOWN_IP 1
+#define ENABLE_FEATURE_IFUPDOWN_IP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IFUPDOWN_IP(...) __VA_ARGS__ "CONFIG_FEATURE_IFUPDOWN_IP"
+#else
+# define IF_FEATURE_IFUPDOWN_IP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IFUPDOWN_IP(...)
+#define CONFIG_FEATURE_IFUPDOWN_IPV4 1
+#define ENABLE_FEATURE_IFUPDOWN_IPV4 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IFUPDOWN_IPV4(...) __VA_ARGS__ "CONFIG_FEATURE_IFUPDOWN_IPV4"
+#else
+# define IF_FEATURE_IFUPDOWN_IPV4(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IFUPDOWN_IPV4(...)
+#define CONFIG_FEATURE_IFUPDOWN_IPV6 1
+#define ENABLE_FEATURE_IFUPDOWN_IPV6 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IFUPDOWN_IPV6(...) __VA_ARGS__ "CONFIG_FEATURE_IFUPDOWN_IPV6"
+#else
+# define IF_FEATURE_IFUPDOWN_IPV6(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IFUPDOWN_IPV6(...)
+#define CONFIG_FEATURE_IFUPDOWN_MAPPING 1
+#define ENABLE_FEATURE_IFUPDOWN_MAPPING 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IFUPDOWN_MAPPING(...) __VA_ARGS__ "CONFIG_FEATURE_IFUPDOWN_MAPPING"
+#else
+# define IF_FEATURE_IFUPDOWN_MAPPING(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IFUPDOWN_MAPPING(...)
+#define CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP 1
+#define ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IFUPDOWN_EXTERNAL_DHCP(...) __VA_ARGS__ "CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP"
+#else
+# define IF_FEATURE_IFUPDOWN_EXTERNAL_DHCP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IFUPDOWN_EXTERNAL_DHCP(...)
+#define CONFIG_INETD 1
+#define ENABLE_INETD 1
+#ifdef MAKE_SUID
+# define IF_INETD(...) __VA_ARGS__ "CONFIG_INETD"
+#else
+# define IF_INETD(...) __VA_ARGS__
+#endif
+#define IF_NOT_INETD(...)
+#define CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO 1
+#define ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_ECHO 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_INETD_SUPPORT_BUILTIN_ECHO(...) __VA_ARGS__ "CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO"
+#else
+# define IF_FEATURE_INETD_SUPPORT_BUILTIN_ECHO(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_INETD_SUPPORT_BUILTIN_ECHO(...)
+#define CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD 1
+#define ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD(...) __VA_ARGS__ "CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD"
+#else
+# define IF_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD(...)
+#define CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME 1
+#define ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_TIME 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_INETD_SUPPORT_BUILTIN_TIME(...) __VA_ARGS__ "CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME"
+#else
+# define IF_FEATURE_INETD_SUPPORT_BUILTIN_TIME(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_INETD_SUPPORT_BUILTIN_TIME(...)
+#define CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME 1
+#define ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME(...) __VA_ARGS__ "CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME"
+#else
+# define IF_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME(...)
+#define CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN 1
+#define ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN(...) __VA_ARGS__ "CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN"
+#else
+# define IF_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN(...)
+#define CONFIG_FEATURE_INETD_RPC 1
+#define ENABLE_FEATURE_INETD_RPC 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_INETD_RPC(...) __VA_ARGS__ "CONFIG_FEATURE_INETD_RPC"
+#else
+# define IF_FEATURE_INETD_RPC(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_INETD_RPC(...)
+#define CONFIG_IP 1
+#define ENABLE_IP 1
+#ifdef MAKE_SUID
+# define IF_IP(...) __VA_ARGS__ "CONFIG_IP"
+#else
+# define IF_IP(...) __VA_ARGS__
+#endif
+#define IF_NOT_IP(...)
+#define CONFIG_IPADDR 1
+#define ENABLE_IPADDR 1
+#ifdef MAKE_SUID
+# define IF_IPADDR(...) __VA_ARGS__ "CONFIG_IPADDR"
+#else
+# define IF_IPADDR(...) __VA_ARGS__
+#endif
+#define IF_NOT_IPADDR(...)
+#define CONFIG_IPLINK 1
+#define ENABLE_IPLINK 1
+#ifdef MAKE_SUID
+# define IF_IPLINK(...) __VA_ARGS__ "CONFIG_IPLINK"
+#else
+# define IF_IPLINK(...) __VA_ARGS__
+#endif
+#define IF_NOT_IPLINK(...)
+#define CONFIG_IPROUTE 1
+#define ENABLE_IPROUTE 1
+#ifdef MAKE_SUID
+# define IF_IPROUTE(...) __VA_ARGS__ "CONFIG_IPROUTE"
+#else
+# define IF_IPROUTE(...) __VA_ARGS__
+#endif
+#define IF_NOT_IPROUTE(...)
+#define CONFIG_IPTUNNEL 1
+#define ENABLE_IPTUNNEL 1
+#ifdef MAKE_SUID
+# define IF_IPTUNNEL(...) __VA_ARGS__ "CONFIG_IPTUNNEL"
+#else
+# define IF_IPTUNNEL(...) __VA_ARGS__
+#endif
+#define IF_NOT_IPTUNNEL(...)
+#define CONFIG_IPRULE 1
+#define ENABLE_IPRULE 1
+#ifdef MAKE_SUID
+# define IF_IPRULE(...) __VA_ARGS__ "CONFIG_IPRULE"
+#else
+# define IF_IPRULE(...) __VA_ARGS__
+#endif
+#define IF_NOT_IPRULE(...)
+#define CONFIG_IPNEIGH 1
+#define ENABLE_IPNEIGH 1
+#ifdef MAKE_SUID
+# define IF_IPNEIGH(...) __VA_ARGS__ "CONFIG_IPNEIGH"
+#else
+# define IF_IPNEIGH(...) __VA_ARGS__
+#endif
+#define IF_NOT_IPNEIGH(...)
+#define CONFIG_FEATURE_IP_ADDRESS 1
+#define ENABLE_FEATURE_IP_ADDRESS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IP_ADDRESS(...) __VA_ARGS__ "CONFIG_FEATURE_IP_ADDRESS"
+#else
+# define IF_FEATURE_IP_ADDRESS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IP_ADDRESS(...)
+#define CONFIG_FEATURE_IP_LINK 1
+#define ENABLE_FEATURE_IP_LINK 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IP_LINK(...) __VA_ARGS__ "CONFIG_FEATURE_IP_LINK"
+#else
+# define IF_FEATURE_IP_LINK(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IP_LINK(...)
+#define CONFIG_FEATURE_IP_ROUTE 1
+#define ENABLE_FEATURE_IP_ROUTE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IP_ROUTE(...) __VA_ARGS__ "CONFIG_FEATURE_IP_ROUTE"
+#else
+# define IF_FEATURE_IP_ROUTE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IP_ROUTE(...)
+#define CONFIG_FEATURE_IP_ROUTE_DIR "/etc/iproute2"
+#define ENABLE_FEATURE_IP_ROUTE_DIR 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IP_ROUTE_DIR(...) __VA_ARGS__ "CONFIG_FEATURE_IP_ROUTE_DIR"
+#else
+# define IF_FEATURE_IP_ROUTE_DIR(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IP_ROUTE_DIR(...)
+#define CONFIG_FEATURE_IP_TUNNEL 1
+#define ENABLE_FEATURE_IP_TUNNEL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IP_TUNNEL(...) __VA_ARGS__ "CONFIG_FEATURE_IP_TUNNEL"
+#else
+# define IF_FEATURE_IP_TUNNEL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IP_TUNNEL(...)
+#define CONFIG_FEATURE_IP_RULE 1
+#define ENABLE_FEATURE_IP_RULE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IP_RULE(...) __VA_ARGS__ "CONFIG_FEATURE_IP_RULE"
+#else
+# define IF_FEATURE_IP_RULE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IP_RULE(...)
+#define CONFIG_FEATURE_IP_NEIGH 1
+#define ENABLE_FEATURE_IP_NEIGH 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IP_NEIGH(...) __VA_ARGS__ "CONFIG_FEATURE_IP_NEIGH"
+#else
+# define IF_FEATURE_IP_NEIGH(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IP_NEIGH(...)
+#define CONFIG_FEATURE_IP_RARE_PROTOCOLS 1
+#define ENABLE_FEATURE_IP_RARE_PROTOCOLS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IP_RARE_PROTOCOLS(...) __VA_ARGS__ "CONFIG_FEATURE_IP_RARE_PROTOCOLS"
+#else
+# define IF_FEATURE_IP_RARE_PROTOCOLS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IP_RARE_PROTOCOLS(...)
+#define CONFIG_IPCALC 1
+#define ENABLE_IPCALC 1
+#ifdef MAKE_SUID
+# define IF_IPCALC(...) __VA_ARGS__ "CONFIG_IPCALC"
+#else
+# define IF_IPCALC(...) __VA_ARGS__
+#endif
+#define IF_NOT_IPCALC(...)
+#define CONFIG_FEATURE_IPCALC_FANCY 1
+#define ENABLE_FEATURE_IPCALC_FANCY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IPCALC_FANCY(...) __VA_ARGS__ "CONFIG_FEATURE_IPCALC_FANCY"
+#else
+# define IF_FEATURE_IPCALC_FANCY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IPCALC_FANCY(...)
+#define CONFIG_FEATURE_IPCALC_LONG_OPTIONS 1
+#define ENABLE_FEATURE_IPCALC_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IPCALC_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_IPCALC_LONG_OPTIONS"
+#else
+# define IF_FEATURE_IPCALC_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IPCALC_LONG_OPTIONS(...)
+#define CONFIG_FAKEIDENTD 1
+#define ENABLE_FAKEIDENTD 1
+#ifdef MAKE_SUID
+# define IF_FAKEIDENTD(...) __VA_ARGS__ "CONFIG_FAKEIDENTD"
+#else
+# define IF_FAKEIDENTD(...) __VA_ARGS__
+#endif
+#define IF_NOT_FAKEIDENTD(...)
+#define CONFIG_NAMEIF 1
+#define ENABLE_NAMEIF 1
+#ifdef MAKE_SUID
+# define IF_NAMEIF(...) __VA_ARGS__ "CONFIG_NAMEIF"
+#else
+# define IF_NAMEIF(...) __VA_ARGS__
+#endif
+#define IF_NOT_NAMEIF(...)
+#define CONFIG_FEATURE_NAMEIF_EXTENDED 1
+#define ENABLE_FEATURE_NAMEIF_EXTENDED 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_NAMEIF_EXTENDED(...) __VA_ARGS__ "CONFIG_FEATURE_NAMEIF_EXTENDED"
+#else
+# define IF_FEATURE_NAMEIF_EXTENDED(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_NAMEIF_EXTENDED(...)
+#define CONFIG_NBDCLIENT 1
+#define ENABLE_NBDCLIENT 1
+#ifdef MAKE_SUID
+# define IF_NBDCLIENT(...) __VA_ARGS__ "CONFIG_NBDCLIENT"
+#else
+# define IF_NBDCLIENT(...) __VA_ARGS__
+#endif
+#define IF_NOT_NBDCLIENT(...)
+#define CONFIG_NC 1
+#define ENABLE_NC 1
+#ifdef MAKE_SUID
+# define IF_NC(...) __VA_ARGS__ "CONFIG_NC"
+#else
+# define IF_NC(...) __VA_ARGS__
+#endif
+#define IF_NOT_NC(...)
+#define CONFIG_NC_SERVER 1
+#define ENABLE_NC_SERVER 1
+#ifdef MAKE_SUID
+# define IF_NC_SERVER(...) __VA_ARGS__ "CONFIG_NC_SERVER"
+#else
+# define IF_NC_SERVER(...) __VA_ARGS__
+#endif
+#define IF_NOT_NC_SERVER(...)
+#define CONFIG_NC_EXTRA 1
+#define ENABLE_NC_EXTRA 1
+#ifdef MAKE_SUID
+# define IF_NC_EXTRA(...) __VA_ARGS__ "CONFIG_NC_EXTRA"
+#else
+# define IF_NC_EXTRA(...) __VA_ARGS__
+#endif
+#define IF_NOT_NC_EXTRA(...)
+#undef CONFIG_NC_110_COMPAT
+#define ENABLE_NC_110_COMPAT 0
+#define IF_NC_110_COMPAT(...)
+#define IF_NOT_NC_110_COMPAT(...) __VA_ARGS__
+#define CONFIG_NETSTAT 1
+#define ENABLE_NETSTAT 1
+#ifdef MAKE_SUID
+# define IF_NETSTAT(...) __VA_ARGS__ "CONFIG_NETSTAT"
+#else
+# define IF_NETSTAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_NETSTAT(...)
+#define CONFIG_FEATURE_NETSTAT_WIDE 1
+#define ENABLE_FEATURE_NETSTAT_WIDE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_NETSTAT_WIDE(...) __VA_ARGS__ "CONFIG_FEATURE_NETSTAT_WIDE"
+#else
+# define IF_FEATURE_NETSTAT_WIDE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_NETSTAT_WIDE(...)
+#define CONFIG_FEATURE_NETSTAT_PRG 1
+#define ENABLE_FEATURE_NETSTAT_PRG 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_NETSTAT_PRG(...) __VA_ARGS__ "CONFIG_FEATURE_NETSTAT_PRG"
+#else
+# define IF_FEATURE_NETSTAT_PRG(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_NETSTAT_PRG(...)
+#define CONFIG_NSLOOKUP 1
+#define ENABLE_NSLOOKUP 1
+#ifdef MAKE_SUID
+# define IF_NSLOOKUP(...) __VA_ARGS__ "CONFIG_NSLOOKUP"
+#else
+# define IF_NSLOOKUP(...) __VA_ARGS__
+#endif
+#define IF_NOT_NSLOOKUP(...)
+#define CONFIG_NTPD 1
+#define ENABLE_NTPD 1
+#ifdef MAKE_SUID
+# define IF_NTPD(...) __VA_ARGS__ "CONFIG_NTPD"
+#else
+# define IF_NTPD(...) __VA_ARGS__
+#endif
+#define IF_NOT_NTPD(...)
+#define CONFIG_FEATURE_NTPD_SERVER 1
+#define ENABLE_FEATURE_NTPD_SERVER 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_NTPD_SERVER(...) __VA_ARGS__ "CONFIG_FEATURE_NTPD_SERVER"
+#else
+# define IF_FEATURE_NTPD_SERVER(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_NTPD_SERVER(...)
+#define CONFIG_FEATURE_NTPD_CONF 1
+#define ENABLE_FEATURE_NTPD_CONF 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_NTPD_CONF(...) __VA_ARGS__ "CONFIG_FEATURE_NTPD_CONF"
+#else
+# define IF_FEATURE_NTPD_CONF(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_NTPD_CONF(...)
+#define CONFIG_PING 1
+#define ENABLE_PING 1
+#ifdef MAKE_SUID
+# define IF_PING(...) __VA_ARGS__ "CONFIG_PING"
+#else
+# define IF_PING(...) __VA_ARGS__
+#endif
+#define IF_NOT_PING(...)
+#define CONFIG_PING6 1
+#define ENABLE_PING6 1
+#ifdef MAKE_SUID
+# define IF_PING6(...) __VA_ARGS__ "CONFIG_PING6"
+#else
+# define IF_PING6(...) __VA_ARGS__
+#endif
+#define IF_NOT_PING6(...)
+#define CONFIG_FEATURE_FANCY_PING 1
+#define ENABLE_FEATURE_FANCY_PING 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_FANCY_PING(...) __VA_ARGS__ "CONFIG_FEATURE_FANCY_PING"
+#else
+# define IF_FEATURE_FANCY_PING(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_FANCY_PING(...)
+#define CONFIG_PSCAN 1
+#define ENABLE_PSCAN 1
+#ifdef MAKE_SUID
+# define IF_PSCAN(...) __VA_ARGS__ "CONFIG_PSCAN"
+#else
+# define IF_PSCAN(...) __VA_ARGS__
+#endif
+#define IF_NOT_PSCAN(...)
+#define CONFIG_ROUTE 1
+#define ENABLE_ROUTE 1
+#ifdef MAKE_SUID
+# define IF_ROUTE(...) __VA_ARGS__ "CONFIG_ROUTE"
+#else
+# define IF_ROUTE(...) __VA_ARGS__
+#endif
+#define IF_NOT_ROUTE(...)
+#define CONFIG_SLATTACH 1
+#define ENABLE_SLATTACH 1
+#ifdef MAKE_SUID
+# define IF_SLATTACH(...) __VA_ARGS__ "CONFIG_SLATTACH"
+#else
+# define IF_SLATTACH(...) __VA_ARGS__
+#endif
+#define IF_NOT_SLATTACH(...)
+#define CONFIG_TCPSVD 1
+#define ENABLE_TCPSVD 1
+#ifdef MAKE_SUID
+# define IF_TCPSVD(...) __VA_ARGS__ "CONFIG_TCPSVD"
+#else
+# define IF_TCPSVD(...) __VA_ARGS__
+#endif
+#define IF_NOT_TCPSVD(...)
+#define CONFIG_UDPSVD 1
+#define ENABLE_UDPSVD 1
+#ifdef MAKE_SUID
+# define IF_UDPSVD(...) __VA_ARGS__ "CONFIG_UDPSVD"
+#else
+# define IF_UDPSVD(...) __VA_ARGS__
+#endif
+#define IF_NOT_UDPSVD(...)
+#define CONFIG_TELNET 1
+#define ENABLE_TELNET 1
+#ifdef MAKE_SUID
+# define IF_TELNET(...) __VA_ARGS__ "CONFIG_TELNET"
+#else
+# define IF_TELNET(...) __VA_ARGS__
+#endif
+#define IF_NOT_TELNET(...)
+#define CONFIG_FEATURE_TELNET_TTYPE 1
+#define ENABLE_FEATURE_TELNET_TTYPE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TELNET_TTYPE(...) __VA_ARGS__ "CONFIG_FEATURE_TELNET_TTYPE"
+#else
+# define IF_FEATURE_TELNET_TTYPE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TELNET_TTYPE(...)
+#define CONFIG_FEATURE_TELNET_AUTOLOGIN 1
+#define ENABLE_FEATURE_TELNET_AUTOLOGIN 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TELNET_AUTOLOGIN(...) __VA_ARGS__ "CONFIG_FEATURE_TELNET_AUTOLOGIN"
+#else
+# define IF_FEATURE_TELNET_AUTOLOGIN(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TELNET_AUTOLOGIN(...)
+#define CONFIG_TELNETD 1
+#define ENABLE_TELNETD 1
+#ifdef MAKE_SUID
+# define IF_TELNETD(...) __VA_ARGS__ "CONFIG_TELNETD"
+#else
+# define IF_TELNETD(...) __VA_ARGS__
+#endif
+#define IF_NOT_TELNETD(...)
+#define CONFIG_FEATURE_TELNETD_STANDALONE 1
+#define ENABLE_FEATURE_TELNETD_STANDALONE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TELNETD_STANDALONE(...) __VA_ARGS__ "CONFIG_FEATURE_TELNETD_STANDALONE"
+#else
+# define IF_FEATURE_TELNETD_STANDALONE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TELNETD_STANDALONE(...)
+#define CONFIG_FEATURE_TELNETD_INETD_WAIT 1
+#define ENABLE_FEATURE_TELNETD_INETD_WAIT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TELNETD_INETD_WAIT(...) __VA_ARGS__ "CONFIG_FEATURE_TELNETD_INETD_WAIT"
+#else
+# define IF_FEATURE_TELNETD_INETD_WAIT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TELNETD_INETD_WAIT(...)
+#define CONFIG_TFTP 1
+#define ENABLE_TFTP 1
+#ifdef MAKE_SUID
+# define IF_TFTP(...) __VA_ARGS__ "CONFIG_TFTP"
+#else
+# define IF_TFTP(...) __VA_ARGS__
+#endif
+#define IF_NOT_TFTP(...)
+#define CONFIG_TFTPD 1
+#define ENABLE_TFTPD 1
+#ifdef MAKE_SUID
+# define IF_TFTPD(...) __VA_ARGS__ "CONFIG_TFTPD"
+#else
+# define IF_TFTPD(...) __VA_ARGS__
+#endif
+#define IF_NOT_TFTPD(...)
+
+/*
+ * Common options for tftp/tftpd
+ */
+#define CONFIG_FEATURE_TFTP_GET 1
+#define ENABLE_FEATURE_TFTP_GET 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TFTP_GET(...) __VA_ARGS__ "CONFIG_FEATURE_TFTP_GET"
+#else
+# define IF_FEATURE_TFTP_GET(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TFTP_GET(...)
+#define CONFIG_FEATURE_TFTP_PUT 1
+#define ENABLE_FEATURE_TFTP_PUT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TFTP_PUT(...) __VA_ARGS__ "CONFIG_FEATURE_TFTP_PUT"
+#else
+# define IF_FEATURE_TFTP_PUT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TFTP_PUT(...)
+#define CONFIG_FEATURE_TFTP_BLOCKSIZE 1
+#define ENABLE_FEATURE_TFTP_BLOCKSIZE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TFTP_BLOCKSIZE(...) __VA_ARGS__ "CONFIG_FEATURE_TFTP_BLOCKSIZE"
+#else
+# define IF_FEATURE_TFTP_BLOCKSIZE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TFTP_BLOCKSIZE(...)
+#define CONFIG_FEATURE_TFTP_PROGRESS_BAR 1
+#define ENABLE_FEATURE_TFTP_PROGRESS_BAR 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TFTP_PROGRESS_BAR(...) __VA_ARGS__ "CONFIG_FEATURE_TFTP_PROGRESS_BAR"
+#else
+# define IF_FEATURE_TFTP_PROGRESS_BAR(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TFTP_PROGRESS_BAR(...)
+#define CONFIG_TFTP_DEBUG 1
+#define ENABLE_TFTP_DEBUG 1
+#ifdef MAKE_SUID
+# define IF_TFTP_DEBUG(...) __VA_ARGS__ "CONFIG_TFTP_DEBUG"
+#else
+# define IF_TFTP_DEBUG(...) __VA_ARGS__
+#endif
+#define IF_NOT_TFTP_DEBUG(...)
+#define CONFIG_TRACEROUTE 1
+#define ENABLE_TRACEROUTE 1
+#ifdef MAKE_SUID
+# define IF_TRACEROUTE(...) __VA_ARGS__ "CONFIG_TRACEROUTE"
+#else
+# define IF_TRACEROUTE(...) __VA_ARGS__
+#endif
+#define IF_NOT_TRACEROUTE(...)
+#define CONFIG_TRACEROUTE6 1
+#define ENABLE_TRACEROUTE6 1
+#ifdef MAKE_SUID
+# define IF_TRACEROUTE6(...) __VA_ARGS__ "CONFIG_TRACEROUTE6"
+#else
+# define IF_TRACEROUTE6(...) __VA_ARGS__
+#endif
+#define IF_NOT_TRACEROUTE6(...)
+#define CONFIG_FEATURE_TRACEROUTE_VERBOSE 1
+#define ENABLE_FEATURE_TRACEROUTE_VERBOSE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TRACEROUTE_VERBOSE(...) __VA_ARGS__ "CONFIG_FEATURE_TRACEROUTE_VERBOSE"
+#else
+# define IF_FEATURE_TRACEROUTE_VERBOSE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TRACEROUTE_VERBOSE(...)
+#define CONFIG_FEATURE_TRACEROUTE_USE_ICMP 1
+#define ENABLE_FEATURE_TRACEROUTE_USE_ICMP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TRACEROUTE_USE_ICMP(...) __VA_ARGS__ "CONFIG_FEATURE_TRACEROUTE_USE_ICMP"
+#else
+# define IF_FEATURE_TRACEROUTE_USE_ICMP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TRACEROUTE_USE_ICMP(...)
+#define CONFIG_TUNCTL 1
+#define ENABLE_TUNCTL 1
+#ifdef MAKE_SUID
+# define IF_TUNCTL(...) __VA_ARGS__ "CONFIG_TUNCTL"
+#else
+# define IF_TUNCTL(...) __VA_ARGS__
+#endif
+#define IF_NOT_TUNCTL(...)
+#define CONFIG_FEATURE_TUNCTL_UG 1
+#define ENABLE_FEATURE_TUNCTL_UG 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TUNCTL_UG(...) __VA_ARGS__ "CONFIG_FEATURE_TUNCTL_UG"
+#else
+# define IF_FEATURE_TUNCTL_UG(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TUNCTL_UG(...)
+#define CONFIG_VCONFIG 1
+#define ENABLE_VCONFIG 1
+#ifdef MAKE_SUID
+# define IF_VCONFIG(...) __VA_ARGS__ "CONFIG_VCONFIG"
+#else
+# define IF_VCONFIG(...) __VA_ARGS__
+#endif
+#define IF_NOT_VCONFIG(...)
+#define CONFIG_WGET 1
+#define ENABLE_WGET 1
+#ifdef MAKE_SUID
+# define IF_WGET(...) __VA_ARGS__ "CONFIG_WGET"
+#else
+# define IF_WGET(...) __VA_ARGS__
+#endif
+#define IF_NOT_WGET(...)
+#define CONFIG_FEATURE_WGET_STATUSBAR 1
+#define ENABLE_FEATURE_WGET_STATUSBAR 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_WGET_STATUSBAR(...) __VA_ARGS__ "CONFIG_FEATURE_WGET_STATUSBAR"
+#else
+# define IF_FEATURE_WGET_STATUSBAR(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_WGET_STATUSBAR(...)
+#define CONFIG_FEATURE_WGET_AUTHENTICATION 1
+#define ENABLE_FEATURE_WGET_AUTHENTICATION 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_WGET_AUTHENTICATION(...) __VA_ARGS__ "CONFIG_FEATURE_WGET_AUTHENTICATION"
+#else
+# define IF_FEATURE_WGET_AUTHENTICATION(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_WGET_AUTHENTICATION(...)
+#define CONFIG_FEATURE_WGET_LONG_OPTIONS 1
+#define ENABLE_FEATURE_WGET_LONG_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_WGET_LONG_OPTIONS(...) __VA_ARGS__ "CONFIG_FEATURE_WGET_LONG_OPTIONS"
+#else
+# define IF_FEATURE_WGET_LONG_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_WGET_LONG_OPTIONS(...)
+#define CONFIG_FEATURE_WGET_TIMEOUT 1
+#define ENABLE_FEATURE_WGET_TIMEOUT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_WGET_TIMEOUT(...) __VA_ARGS__ "CONFIG_FEATURE_WGET_TIMEOUT"
+#else
+# define IF_FEATURE_WGET_TIMEOUT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_WGET_TIMEOUT(...)
+#define CONFIG_FEATURE_WGET_OPENSSL 1
+#define ENABLE_FEATURE_WGET_OPENSSL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_WGET_OPENSSL(...) __VA_ARGS__ "CONFIG_FEATURE_WGET_OPENSSL"
+#else
+# define IF_FEATURE_WGET_OPENSSL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_WGET_OPENSSL(...)
+#define CONFIG_FEATURE_WGET_SSL_HELPER 1
+#define ENABLE_FEATURE_WGET_SSL_HELPER 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_WGET_SSL_HELPER(...) __VA_ARGS__ "CONFIG_FEATURE_WGET_SSL_HELPER"
+#else
+# define IF_FEATURE_WGET_SSL_HELPER(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_WGET_SSL_HELPER(...)
+#define CONFIG_WHOIS 1
+#define ENABLE_WHOIS 1
+#ifdef MAKE_SUID
+# define IF_WHOIS(...) __VA_ARGS__ "CONFIG_WHOIS"
+#else
+# define IF_WHOIS(...) __VA_ARGS__
+#endif
+#define IF_NOT_WHOIS(...)
+#define CONFIG_ZCIP 1
+#define ENABLE_ZCIP 1
+#ifdef MAKE_SUID
+# define IF_ZCIP(...) __VA_ARGS__ "CONFIG_ZCIP"
+#else
+# define IF_ZCIP(...) __VA_ARGS__
+#endif
+#define IF_NOT_ZCIP(...)
+#undef CONFIG_UDHCPC6
+#define ENABLE_UDHCPC6 0
+#define IF_UDHCPC6(...)
+#define IF_NOT_UDHCPC6(...) __VA_ARGS__
+#define CONFIG_UDHCPD 1
+#define ENABLE_UDHCPD 1
+#ifdef MAKE_SUID
+# define IF_UDHCPD(...) __VA_ARGS__ "CONFIG_UDHCPD"
+#else
+# define IF_UDHCPD(...) __VA_ARGS__
+#endif
+#define IF_NOT_UDHCPD(...)
+#define CONFIG_DHCPRELAY 1
+#define ENABLE_DHCPRELAY 1
+#ifdef MAKE_SUID
+# define IF_DHCPRELAY(...) __VA_ARGS__ "CONFIG_DHCPRELAY"
+#else
+# define IF_DHCPRELAY(...) __VA_ARGS__
+#endif
+#define IF_NOT_DHCPRELAY(...)
+#define CONFIG_DUMPLEASES 1
+#define ENABLE_DUMPLEASES 1
+#ifdef MAKE_SUID
+# define IF_DUMPLEASES(...) __VA_ARGS__ "CONFIG_DUMPLEASES"
+#else
+# define IF_DUMPLEASES(...) __VA_ARGS__
+#endif
+#define IF_NOT_DUMPLEASES(...)
+#define CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY 1
+#define ENABLE_FEATURE_UDHCPD_WRITE_LEASES_EARLY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_UDHCPD_WRITE_LEASES_EARLY(...) __VA_ARGS__ "CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY"
+#else
+# define IF_FEATURE_UDHCPD_WRITE_LEASES_EARLY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_UDHCPD_WRITE_LEASES_EARLY(...)
+#undef CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC
+#define ENABLE_FEATURE_UDHCPD_BASE_IP_ON_MAC 0
+#define IF_FEATURE_UDHCPD_BASE_IP_ON_MAC(...)
+#define IF_NOT_FEATURE_UDHCPD_BASE_IP_ON_MAC(...) __VA_ARGS__
+#define CONFIG_DHCPD_LEASES_FILE "/var/lib/misc/udhcpd.leases"
+#define ENABLE_DHCPD_LEASES_FILE 1
+#ifdef MAKE_SUID
+# define IF_DHCPD_LEASES_FILE(...) __VA_ARGS__ "CONFIG_DHCPD_LEASES_FILE"
+#else
+# define IF_DHCPD_LEASES_FILE(...) __VA_ARGS__
+#endif
+#define IF_NOT_DHCPD_LEASES_FILE(...)
+#define CONFIG_UDHCPC 1
+#define ENABLE_UDHCPC 1
+#ifdef MAKE_SUID
+# define IF_UDHCPC(...) __VA_ARGS__ "CONFIG_UDHCPC"
+#else
+# define IF_UDHCPC(...) __VA_ARGS__
+#endif
+#define IF_NOT_UDHCPC(...)
+#define CONFIG_FEATURE_UDHCPC_ARPING 1
+#define ENABLE_FEATURE_UDHCPC_ARPING 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_UDHCPC_ARPING(...) __VA_ARGS__ "CONFIG_FEATURE_UDHCPC_ARPING"
+#else
+# define IF_FEATURE_UDHCPC_ARPING(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_UDHCPC_ARPING(...)
+#define CONFIG_FEATURE_UDHCPC_SANITIZEOPT 1
+#define ENABLE_FEATURE_UDHCPC_SANITIZEOPT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_UDHCPC_SANITIZEOPT(...) __VA_ARGS__ "CONFIG_FEATURE_UDHCPC_SANITIZEOPT"
+#else
+# define IF_FEATURE_UDHCPC_SANITIZEOPT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_UDHCPC_SANITIZEOPT(...)
+#define CONFIG_FEATURE_UDHCP_PORT 1
+#define ENABLE_FEATURE_UDHCP_PORT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_UDHCP_PORT(...) __VA_ARGS__ "CONFIG_FEATURE_UDHCP_PORT"
+#else
+# define IF_FEATURE_UDHCP_PORT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_UDHCP_PORT(...)
+#define CONFIG_UDHCP_DEBUG 9
+#define ENABLE_UDHCP_DEBUG 1
+#ifdef MAKE_SUID
+# define IF_UDHCP_DEBUG(...) __VA_ARGS__ "CONFIG_UDHCP_DEBUG"
+#else
+# define IF_UDHCP_DEBUG(...) __VA_ARGS__
+#endif
+#define IF_NOT_UDHCP_DEBUG(...)
+#define CONFIG_FEATURE_UDHCP_RFC3397 1
+#define ENABLE_FEATURE_UDHCP_RFC3397 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_UDHCP_RFC3397(...) __VA_ARGS__ "CONFIG_FEATURE_UDHCP_RFC3397"
+#else
+# define IF_FEATURE_UDHCP_RFC3397(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_UDHCP_RFC3397(...)
+#define CONFIG_FEATURE_UDHCP_8021Q 1
+#define ENABLE_FEATURE_UDHCP_8021Q 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_UDHCP_8021Q(...) __VA_ARGS__ "CONFIG_FEATURE_UDHCP_8021Q"
+#else
+# define IF_FEATURE_UDHCP_8021Q(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_UDHCP_8021Q(...)
+#define CONFIG_UDHCPC_DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
+#define ENABLE_UDHCPC_DEFAULT_SCRIPT 1
+#ifdef MAKE_SUID
+# define IF_UDHCPC_DEFAULT_SCRIPT(...) __VA_ARGS__ "CONFIG_UDHCPC_DEFAULT_SCRIPT"
+#else
+# define IF_UDHCPC_DEFAULT_SCRIPT(...) __VA_ARGS__
+#endif
+#define IF_NOT_UDHCPC_DEFAULT_SCRIPT(...)
+#define CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS 80
+#define ENABLE_UDHCPC_SLACK_FOR_BUGGY_SERVERS 1
+#ifdef MAKE_SUID
+# define IF_UDHCPC_SLACK_FOR_BUGGY_SERVERS(...) __VA_ARGS__ "CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS"
+#else
+# define IF_UDHCPC_SLACK_FOR_BUGGY_SERVERS(...) __VA_ARGS__
+#endif
+#define IF_NOT_UDHCPC_SLACK_FOR_BUGGY_SERVERS(...)
+#define CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS "-R -n"
+#define ENABLE_IFUPDOWN_UDHCPC_CMD_OPTIONS 1
+#ifdef MAKE_SUID
+# define IF_IFUPDOWN_UDHCPC_CMD_OPTIONS(...) __VA_ARGS__ "CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS"
+#else
+# define IF_IFUPDOWN_UDHCPC_CMD_OPTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_IFUPDOWN_UDHCPC_CMD_OPTIONS(...)
+
+/*
+ * Print Utilities
+ */
+#define CONFIG_LPD 1
+#define ENABLE_LPD 1
+#ifdef MAKE_SUID
+# define IF_LPD(...) __VA_ARGS__ "CONFIG_LPD"
+#else
+# define IF_LPD(...) __VA_ARGS__
+#endif
+#define IF_NOT_LPD(...)
+#define CONFIG_LPR 1
+#define ENABLE_LPR 1
+#ifdef MAKE_SUID
+# define IF_LPR(...) __VA_ARGS__ "CONFIG_LPR"
+#else
+# define IF_LPR(...) __VA_ARGS__
+#endif
+#define IF_NOT_LPR(...)
+#define CONFIG_LPQ 1
+#define ENABLE_LPQ 1
+#ifdef MAKE_SUID
+# define IF_LPQ(...) __VA_ARGS__ "CONFIG_LPQ"
+#else
+# define IF_LPQ(...) __VA_ARGS__
+#endif
+#define IF_NOT_LPQ(...)
+
+/*
+ * Mail Utilities
+ */
+#define CONFIG_MAKEMIME 1
+#define ENABLE_MAKEMIME 1
+#ifdef MAKE_SUID
+# define IF_MAKEMIME(...) __VA_ARGS__ "CONFIG_MAKEMIME"
+#else
+# define IF_MAKEMIME(...) __VA_ARGS__
+#endif
+#define IF_NOT_MAKEMIME(...)
+#define CONFIG_POPMAILDIR 1
+#define ENABLE_POPMAILDIR 1
+#ifdef MAKE_SUID
+# define IF_POPMAILDIR(...) __VA_ARGS__ "CONFIG_POPMAILDIR"
+#else
+# define IF_POPMAILDIR(...) __VA_ARGS__
+#endif
+#define IF_NOT_POPMAILDIR(...)
+#define CONFIG_FEATURE_POPMAILDIR_DELIVERY 1
+#define ENABLE_FEATURE_POPMAILDIR_DELIVERY 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_POPMAILDIR_DELIVERY(...) __VA_ARGS__ "CONFIG_FEATURE_POPMAILDIR_DELIVERY"
+#else
+# define IF_FEATURE_POPMAILDIR_DELIVERY(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_POPMAILDIR_DELIVERY(...)
+#define CONFIG_REFORMIME 1
+#define ENABLE_REFORMIME 1
+#ifdef MAKE_SUID
+# define IF_REFORMIME(...) __VA_ARGS__ "CONFIG_REFORMIME"
+#else
+# define IF_REFORMIME(...) __VA_ARGS__
+#endif
+#define IF_NOT_REFORMIME(...)
+#define CONFIG_FEATURE_REFORMIME_COMPAT 1
+#define ENABLE_FEATURE_REFORMIME_COMPAT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_REFORMIME_COMPAT(...) __VA_ARGS__ "CONFIG_FEATURE_REFORMIME_COMPAT"
+#else
+# define IF_FEATURE_REFORMIME_COMPAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_REFORMIME_COMPAT(...)
+#define CONFIG_SENDMAIL 1
+#define ENABLE_SENDMAIL 1
+#ifdef MAKE_SUID
+# define IF_SENDMAIL(...) __VA_ARGS__ "CONFIG_SENDMAIL"
+#else
+# define IF_SENDMAIL(...) __VA_ARGS__
+#endif
+#define IF_NOT_SENDMAIL(...)
+#define CONFIG_FEATURE_MIME_CHARSET "us-ascii"
+#define ENABLE_FEATURE_MIME_CHARSET 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_MIME_CHARSET(...) __VA_ARGS__ "CONFIG_FEATURE_MIME_CHARSET"
+#else
+# define IF_FEATURE_MIME_CHARSET(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_MIME_CHARSET(...)
+
+/*
+ * Process Utilities
+ */
+#define CONFIG_FREE 1
+#define ENABLE_FREE 1
+#ifdef MAKE_SUID
+# define IF_FREE(...) __VA_ARGS__ "CONFIG_FREE"
+#else
+# define IF_FREE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FREE(...)
+#define CONFIG_FUSER 1
+#define ENABLE_FUSER 1
+#ifdef MAKE_SUID
+# define IF_FUSER(...) __VA_ARGS__ "CONFIG_FUSER"
+#else
+# define IF_FUSER(...) __VA_ARGS__
+#endif
+#define IF_NOT_FUSER(...)
+#define CONFIG_IOSTAT 1
+#define ENABLE_IOSTAT 1
+#ifdef MAKE_SUID
+# define IF_IOSTAT(...) __VA_ARGS__ "CONFIG_IOSTAT"
+#else
+# define IF_IOSTAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_IOSTAT(...)
+#define CONFIG_KILL 1
+#define ENABLE_KILL 1
+#ifdef MAKE_SUID
+# define IF_KILL(...) __VA_ARGS__ "CONFIG_KILL"
+#else
+# define IF_KILL(...) __VA_ARGS__
+#endif
+#define IF_NOT_KILL(...)
+#define CONFIG_KILLALL 1
+#define ENABLE_KILLALL 1
+#ifdef MAKE_SUID
+# define IF_KILLALL(...) __VA_ARGS__ "CONFIG_KILLALL"
+#else
+# define IF_KILLALL(...) __VA_ARGS__
+#endif
+#define IF_NOT_KILLALL(...)
+#define CONFIG_KILLALL5 1
+#define ENABLE_KILLALL5 1
+#ifdef MAKE_SUID
+# define IF_KILLALL5(...) __VA_ARGS__ "CONFIG_KILLALL5"
+#else
+# define IF_KILLALL5(...) __VA_ARGS__
+#endif
+#define IF_NOT_KILLALL5(...)
+#define CONFIG_LSOF 1
+#define ENABLE_LSOF 1
+#ifdef MAKE_SUID
+# define IF_LSOF(...) __VA_ARGS__ "CONFIG_LSOF"
+#else
+# define IF_LSOF(...) __VA_ARGS__
+#endif
+#define IF_NOT_LSOF(...)
+#define CONFIG_MPSTAT 1
+#define ENABLE_MPSTAT 1
+#ifdef MAKE_SUID
+# define IF_MPSTAT(...) __VA_ARGS__ "CONFIG_MPSTAT"
+#else
+# define IF_MPSTAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_MPSTAT(...)
+#define CONFIG_NMETER 1
+#define ENABLE_NMETER 1
+#ifdef MAKE_SUID
+# define IF_NMETER(...) __VA_ARGS__ "CONFIG_NMETER"
+#else
+# define IF_NMETER(...) __VA_ARGS__
+#endif
+#define IF_NOT_NMETER(...)
+#define CONFIG_PGREP 1
+#define ENABLE_PGREP 1
+#ifdef MAKE_SUID
+# define IF_PGREP(...) __VA_ARGS__ "CONFIG_PGREP"
+#else
+# define IF_PGREP(...) __VA_ARGS__
+#endif
+#define IF_NOT_PGREP(...)
+#define CONFIG_PKILL 1
+#define ENABLE_PKILL 1
+#ifdef MAKE_SUID
+# define IF_PKILL(...) __VA_ARGS__ "CONFIG_PKILL"
+#else
+# define IF_PKILL(...) __VA_ARGS__
+#endif
+#define IF_NOT_PKILL(...)
+#define CONFIG_PIDOF 1
+#define ENABLE_PIDOF 1
+#ifdef MAKE_SUID
+# define IF_PIDOF(...) __VA_ARGS__ "CONFIG_PIDOF"
+#else
+# define IF_PIDOF(...) __VA_ARGS__
+#endif
+#define IF_NOT_PIDOF(...)
+#define CONFIG_FEATURE_PIDOF_SINGLE 1
+#define ENABLE_FEATURE_PIDOF_SINGLE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_PIDOF_SINGLE(...) __VA_ARGS__ "CONFIG_FEATURE_PIDOF_SINGLE"
+#else
+# define IF_FEATURE_PIDOF_SINGLE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_PIDOF_SINGLE(...)
+#define CONFIG_FEATURE_PIDOF_OMIT 1
+#define ENABLE_FEATURE_PIDOF_OMIT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_PIDOF_OMIT(...) __VA_ARGS__ "CONFIG_FEATURE_PIDOF_OMIT"
+#else
+# define IF_FEATURE_PIDOF_OMIT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_PIDOF_OMIT(...)
+#define CONFIG_PMAP 1
+#define ENABLE_PMAP 1
+#ifdef MAKE_SUID
+# define IF_PMAP(...) __VA_ARGS__ "CONFIG_PMAP"
+#else
+# define IF_PMAP(...) __VA_ARGS__
+#endif
+#define IF_NOT_PMAP(...)
+#define CONFIG_POWERTOP 1
+#define ENABLE_POWERTOP 1
+#ifdef MAKE_SUID
+# define IF_POWERTOP(...) __VA_ARGS__ "CONFIG_POWERTOP"
+#else
+# define IF_POWERTOP(...) __VA_ARGS__
+#endif
+#define IF_NOT_POWERTOP(...)
+#define CONFIG_PS 1
+#define ENABLE_PS 1
+#ifdef MAKE_SUID
+# define IF_PS(...) __VA_ARGS__ "CONFIG_PS"
+#else
+# define IF_PS(...) __VA_ARGS__
+#endif
+#define IF_NOT_PS(...)
+#undef CONFIG_FEATURE_PS_WIDE
+#define ENABLE_FEATURE_PS_WIDE 0
+#define IF_FEATURE_PS_WIDE(...)
+#define IF_NOT_FEATURE_PS_WIDE(...) __VA_ARGS__
+#undef CONFIG_FEATURE_PS_LONG
+#define ENABLE_FEATURE_PS_LONG 0
+#define IF_FEATURE_PS_LONG(...)
+#define IF_NOT_FEATURE_PS_LONG(...) __VA_ARGS__
+#define CONFIG_FEATURE_PS_TIME 1
+#define ENABLE_FEATURE_PS_TIME 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_PS_TIME(...) __VA_ARGS__ "CONFIG_FEATURE_PS_TIME"
+#else
+# define IF_FEATURE_PS_TIME(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_PS_TIME(...)
+#define CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS 1
+#define ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_PS_ADDITIONAL_COLUMNS(...) __VA_ARGS__ "CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS"
+#else
+# define IF_FEATURE_PS_ADDITIONAL_COLUMNS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_PS_ADDITIONAL_COLUMNS(...)
+#define CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS 1
+#define ENABLE_FEATURE_PS_UNUSUAL_SYSTEMS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_PS_UNUSUAL_SYSTEMS(...) __VA_ARGS__ "CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS"
+#else
+# define IF_FEATURE_PS_UNUSUAL_SYSTEMS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_PS_UNUSUAL_SYSTEMS(...)
+#define CONFIG_PSTREE 1
+#define ENABLE_PSTREE 1
+#ifdef MAKE_SUID
+# define IF_PSTREE(...) __VA_ARGS__ "CONFIG_PSTREE"
+#else
+# define IF_PSTREE(...) __VA_ARGS__
+#endif
+#define IF_NOT_PSTREE(...)
+#define CONFIG_PWDX 1
+#define ENABLE_PWDX 1
+#ifdef MAKE_SUID
+# define IF_PWDX(...) __VA_ARGS__ "CONFIG_PWDX"
+#else
+# define IF_PWDX(...) __VA_ARGS__
+#endif
+#define IF_NOT_PWDX(...)
+#define CONFIG_RENICE 1
+#define ENABLE_RENICE 1
+#ifdef MAKE_SUID
+# define IF_RENICE(...) __VA_ARGS__ "CONFIG_RENICE"
+#else
+# define IF_RENICE(...) __VA_ARGS__
+#endif
+#define IF_NOT_RENICE(...)
+#define CONFIG_SMEMCAP 1
+#define ENABLE_SMEMCAP 1
+#ifdef MAKE_SUID
+# define IF_SMEMCAP(...) __VA_ARGS__ "CONFIG_SMEMCAP"
+#else
+# define IF_SMEMCAP(...) __VA_ARGS__
+#endif
+#define IF_NOT_SMEMCAP(...)
+#define CONFIG_BB_SYSCTL 1
+#define ENABLE_BB_SYSCTL 1
+#ifdef MAKE_SUID
+# define IF_BB_SYSCTL(...) __VA_ARGS__ "CONFIG_BB_SYSCTL"
+#else
+# define IF_BB_SYSCTL(...) __VA_ARGS__
+#endif
+#define IF_NOT_BB_SYSCTL(...)
+#define CONFIG_TOP 1
+#define ENABLE_TOP 1
+#ifdef MAKE_SUID
+# define IF_TOP(...) __VA_ARGS__ "CONFIG_TOP"
+#else
+# define IF_TOP(...) __VA_ARGS__
+#endif
+#define IF_NOT_TOP(...)
+#define CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE 1
+#define ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE(...) __VA_ARGS__ "CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE"
+#else
+# define IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TOP_CPU_USAGE_PERCENTAGE(...)
+#define CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS 1
+#define ENABLE_FEATURE_TOP_CPU_GLOBAL_PERCENTS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TOP_CPU_GLOBAL_PERCENTS(...) __VA_ARGS__ "CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS"
+#else
+# define IF_FEATURE_TOP_CPU_GLOBAL_PERCENTS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TOP_CPU_GLOBAL_PERCENTS(...)
+#define CONFIG_FEATURE_TOP_SMP_CPU 1
+#define ENABLE_FEATURE_TOP_SMP_CPU 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TOP_SMP_CPU(...) __VA_ARGS__ "CONFIG_FEATURE_TOP_SMP_CPU"
+#else
+# define IF_FEATURE_TOP_SMP_CPU(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TOP_SMP_CPU(...)
+#define CONFIG_FEATURE_TOP_DECIMALS 1
+#define ENABLE_FEATURE_TOP_DECIMALS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TOP_DECIMALS(...) __VA_ARGS__ "CONFIG_FEATURE_TOP_DECIMALS"
+#else
+# define IF_FEATURE_TOP_DECIMALS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TOP_DECIMALS(...)
+#define CONFIG_FEATURE_TOP_SMP_PROCESS 1
+#define ENABLE_FEATURE_TOP_SMP_PROCESS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TOP_SMP_PROCESS(...) __VA_ARGS__ "CONFIG_FEATURE_TOP_SMP_PROCESS"
+#else
+# define IF_FEATURE_TOP_SMP_PROCESS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TOP_SMP_PROCESS(...)
+#define CONFIG_FEATURE_TOPMEM 1
+#define ENABLE_FEATURE_TOPMEM 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_TOPMEM(...) __VA_ARGS__ "CONFIG_FEATURE_TOPMEM"
+#else
+# define IF_FEATURE_TOPMEM(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_TOPMEM(...)
+#define CONFIG_UPTIME 1
+#define ENABLE_UPTIME 1
+#ifdef MAKE_SUID
+# define IF_UPTIME(...) __VA_ARGS__ "CONFIG_UPTIME"
+#else
+# define IF_UPTIME(...) __VA_ARGS__
+#endif
+#define IF_NOT_UPTIME(...)
+#define CONFIG_FEATURE_UPTIME_UTMP_SUPPORT 1
+#define ENABLE_FEATURE_UPTIME_UTMP_SUPPORT 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_UPTIME_UTMP_SUPPORT(...) __VA_ARGS__ "CONFIG_FEATURE_UPTIME_UTMP_SUPPORT"
+#else
+# define IF_FEATURE_UPTIME_UTMP_SUPPORT(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_UPTIME_UTMP_SUPPORT(...)
+#define CONFIG_WATCH 1
+#define ENABLE_WATCH 1
+#ifdef MAKE_SUID
+# define IF_WATCH(...) __VA_ARGS__ "CONFIG_WATCH"
+#else
+# define IF_WATCH(...) __VA_ARGS__
+#endif
+#define IF_NOT_WATCH(...)
+#define CONFIG_FEATURE_SHOW_THREADS 1
+#define ENABLE_FEATURE_SHOW_THREADS 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SHOW_THREADS(...) __VA_ARGS__ "CONFIG_FEATURE_SHOW_THREADS"
+#else
+# define IF_FEATURE_SHOW_THREADS(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SHOW_THREADS(...)
+
+/*
+ * Runit Utilities
+ */
+#define CONFIG_CHPST 1
+#define ENABLE_CHPST 1
+#ifdef MAKE_SUID
+# define IF_CHPST(...) __VA_ARGS__ "CONFIG_CHPST"
+#else
+# define IF_CHPST(...) __VA_ARGS__
+#endif
+#define IF_NOT_CHPST(...)
+#define CONFIG_SETUIDGID 1
+#define ENABLE_SETUIDGID 1
+#ifdef MAKE_SUID
+# define IF_SETUIDGID(...) __VA_ARGS__ "CONFIG_SETUIDGID"
+#else
+# define IF_SETUIDGID(...) __VA_ARGS__
+#endif
+#define IF_NOT_SETUIDGID(...)
+#define CONFIG_ENVUIDGID 1
+#define ENABLE_ENVUIDGID 1
+#ifdef MAKE_SUID
+# define IF_ENVUIDGID(...) __VA_ARGS__ "CONFIG_ENVUIDGID"
+#else
+# define IF_ENVUIDGID(...) __VA_ARGS__
+#endif
+#define IF_NOT_ENVUIDGID(...)
+#define CONFIG_ENVDIR 1
+#define ENABLE_ENVDIR 1
+#ifdef MAKE_SUID
+# define IF_ENVDIR(...) __VA_ARGS__ "CONFIG_ENVDIR"
+#else
+# define IF_ENVDIR(...) __VA_ARGS__
+#endif
+#define IF_NOT_ENVDIR(...)
+#define CONFIG_SOFTLIMIT 1
+#define ENABLE_SOFTLIMIT 1
+#ifdef MAKE_SUID
+# define IF_SOFTLIMIT(...) __VA_ARGS__ "CONFIG_SOFTLIMIT"
+#else
+# define IF_SOFTLIMIT(...) __VA_ARGS__
+#endif
+#define IF_NOT_SOFTLIMIT(...)
+#define CONFIG_RUNSV 1
+#define ENABLE_RUNSV 1
+#ifdef MAKE_SUID
+# define IF_RUNSV(...) __VA_ARGS__ "CONFIG_RUNSV"
+#else
+# define IF_RUNSV(...) __VA_ARGS__
+#endif
+#define IF_NOT_RUNSV(...)
+#define CONFIG_RUNSVDIR 1
+#define ENABLE_RUNSVDIR 1
+#ifdef MAKE_SUID
+# define IF_RUNSVDIR(...) __VA_ARGS__ "CONFIG_RUNSVDIR"
+#else
+# define IF_RUNSVDIR(...) __VA_ARGS__
+#endif
+#define IF_NOT_RUNSVDIR(...)
+#define CONFIG_FEATURE_RUNSVDIR_LOG 1
+#define ENABLE_FEATURE_RUNSVDIR_LOG 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_RUNSVDIR_LOG(...) __VA_ARGS__ "CONFIG_FEATURE_RUNSVDIR_LOG"
+#else
+# define IF_FEATURE_RUNSVDIR_LOG(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_RUNSVDIR_LOG(...)
+#define CONFIG_SV 1
+#define ENABLE_SV 1
+#ifdef MAKE_SUID
+# define IF_SV(...) __VA_ARGS__ "CONFIG_SV"
+#else
+# define IF_SV(...) __VA_ARGS__
+#endif
+#define IF_NOT_SV(...)
+#define CONFIG_SV_DEFAULT_SERVICE_DIR "/var/service"
+#define ENABLE_SV_DEFAULT_SERVICE_DIR 1
+#ifdef MAKE_SUID
+# define IF_SV_DEFAULT_SERVICE_DIR(...) __VA_ARGS__ "CONFIG_SV_DEFAULT_SERVICE_DIR"
+#else
+# define IF_SV_DEFAULT_SERVICE_DIR(...) __VA_ARGS__
+#endif
+#define IF_NOT_SV_DEFAULT_SERVICE_DIR(...)
+#define CONFIG_SVC 1
+#define ENABLE_SVC 1
+#ifdef MAKE_SUID
+# define IF_SVC(...) __VA_ARGS__ "CONFIG_SVC"
+#else
+# define IF_SVC(...) __VA_ARGS__
+#endif
+#define IF_NOT_SVC(...)
+#define CONFIG_SVLOGD 1
+#define ENABLE_SVLOGD 1
+#ifdef MAKE_SUID
+# define IF_SVLOGD(...) __VA_ARGS__ "CONFIG_SVLOGD"
+#else
+# define IF_SVLOGD(...) __VA_ARGS__
+#endif
+#define IF_NOT_SVLOGD(...)
+#undef CONFIG_CHCON
+#define ENABLE_CHCON 0
+#define IF_CHCON(...)
+#define IF_NOT_CHCON(...) __VA_ARGS__
+#undef CONFIG_FEATURE_CHCON_LONG_OPTIONS
+#define ENABLE_FEATURE_CHCON_LONG_OPTIONS 0
+#define IF_FEATURE_CHCON_LONG_OPTIONS(...)
+#define IF_NOT_FEATURE_CHCON_LONG_OPTIONS(...) __VA_ARGS__
+#undef CONFIG_GETENFORCE
+#define ENABLE_GETENFORCE 0
+#define IF_GETENFORCE(...)
+#define IF_NOT_GETENFORCE(...) __VA_ARGS__
+#undef CONFIG_GETSEBOOL
+#define ENABLE_GETSEBOOL 0
+#define IF_GETSEBOOL(...)
+#define IF_NOT_GETSEBOOL(...) __VA_ARGS__
+#undef CONFIG_LOAD_POLICY
+#define ENABLE_LOAD_POLICY 0
+#define IF_LOAD_POLICY(...)
+#define IF_NOT_LOAD_POLICY(...) __VA_ARGS__
+#undef CONFIG_MATCHPATHCON
+#define ENABLE_MATCHPATHCON 0
+#define IF_MATCHPATHCON(...)
+#define IF_NOT_MATCHPATHCON(...) __VA_ARGS__
+#undef CONFIG_RUNCON
+#define ENABLE_RUNCON 0
+#define IF_RUNCON(...)
+#define IF_NOT_RUNCON(...) __VA_ARGS__
+#undef CONFIG_FEATURE_RUNCON_LONG_OPTIONS
+#define ENABLE_FEATURE_RUNCON_LONG_OPTIONS 0
+#define IF_FEATURE_RUNCON_LONG_OPTIONS(...)
+#define IF_NOT_FEATURE_RUNCON_LONG_OPTIONS(...) __VA_ARGS__
+#undef CONFIG_SELINUXENABLED
+#define ENABLE_SELINUXENABLED 0
+#define IF_SELINUXENABLED(...)
+#define IF_NOT_SELINUXENABLED(...) __VA_ARGS__
+#undef CONFIG_SESTATUS
+#define ENABLE_SESTATUS 0
+#define IF_SESTATUS(...)
+#define IF_NOT_SESTATUS(...) __VA_ARGS__
+#undef CONFIG_SETENFORCE
+#define ENABLE_SETENFORCE 0
+#define IF_SETENFORCE(...)
+#define IF_NOT_SETENFORCE(...) __VA_ARGS__
+#undef CONFIG_SETFILES
+#define ENABLE_SETFILES 0
+#define IF_SETFILES(...)
+#define IF_NOT_SETFILES(...) __VA_ARGS__
+#undef CONFIG_FEATURE_SETFILES_CHECK_OPTION
+#define ENABLE_FEATURE_SETFILES_CHECK_OPTION 0
+#define IF_FEATURE_SETFILES_CHECK_OPTION(...)
+#define IF_NOT_FEATURE_SETFILES_CHECK_OPTION(...) __VA_ARGS__
+#undef CONFIG_RESTORECON
+#define ENABLE_RESTORECON 0
+#define IF_RESTORECON(...)
+#define IF_NOT_RESTORECON(...) __VA_ARGS__
+#undef CONFIG_SETSEBOOL
+#define ENABLE_SETSEBOOL 0
+#define IF_SETSEBOOL(...)
+#define IF_NOT_SETSEBOOL(...) __VA_ARGS__
+
+/*
+ * Shells
+ */
+#undef CONFIG_SH_IS_ASH
+#define ENABLE_SH_IS_ASH 0
+#define IF_SH_IS_ASH(...)
+#define IF_NOT_SH_IS_ASH(...) __VA_ARGS__
+#define CONFIG_SH_IS_HUSH 1
+#define ENABLE_SH_IS_HUSH 1
+#ifdef MAKE_SUID
+# define IF_SH_IS_HUSH(...) __VA_ARGS__ "CONFIG_SH_IS_HUSH"
+#else
+# define IF_SH_IS_HUSH(...) __VA_ARGS__
+#endif
+#define IF_NOT_SH_IS_HUSH(...)
+#undef CONFIG_SH_IS_NONE
+#define ENABLE_SH_IS_NONE 0
+#define IF_SH_IS_NONE(...)
+#define IF_NOT_SH_IS_NONE(...) __VA_ARGS__
+#undef CONFIG_BASH_IS_ASH
+#define ENABLE_BASH_IS_ASH 0
+#define IF_BASH_IS_ASH(...)
+#define IF_NOT_BASH_IS_ASH(...) __VA_ARGS__
+#undef CONFIG_BASH_IS_HUSH
+#define ENABLE_BASH_IS_HUSH 0
+#define IF_BASH_IS_HUSH(...)
+#define IF_NOT_BASH_IS_HUSH(...) __VA_ARGS__
+#define CONFIG_BASH_IS_NONE 1
+#define ENABLE_BASH_IS_NONE 1
+#ifdef MAKE_SUID
+# define IF_BASH_IS_NONE(...) __VA_ARGS__ "CONFIG_BASH_IS_NONE"
+#else
+# define IF_BASH_IS_NONE(...) __VA_ARGS__
+#endif
+#define IF_NOT_BASH_IS_NONE(...)
+#undef CONFIG_ASH
+#define ENABLE_ASH 0
+#define IF_ASH(...)
+#define IF_NOT_ASH(...) __VA_ARGS__
+#undef CONFIG_ASH_OPTIMIZE_FOR_SIZE
+#define ENABLE_ASH_OPTIMIZE_FOR_SIZE 0
+#define IF_ASH_OPTIMIZE_FOR_SIZE(...)
+#define IF_NOT_ASH_OPTIMIZE_FOR_SIZE(...) __VA_ARGS__
+#undef CONFIG_ASH_INTERNAL_GLOB
+#define ENABLE_ASH_INTERNAL_GLOB 0
+#define IF_ASH_INTERNAL_GLOB(...)
+#define IF_NOT_ASH_INTERNAL_GLOB(...) __VA_ARGS__
+#undef CONFIG_ASH_RANDOM_SUPPORT
+#define ENABLE_ASH_RANDOM_SUPPORT 0
+#define IF_ASH_RANDOM_SUPPORT(...)
+#define IF_NOT_ASH_RANDOM_SUPPORT(...) __VA_ARGS__
+#undef CONFIG_ASH_EXPAND_PRMT
+#define ENABLE_ASH_EXPAND_PRMT 0
+#define IF_ASH_EXPAND_PRMT(...)
+#define IF_NOT_ASH_EXPAND_PRMT(...) __VA_ARGS__
+#undef CONFIG_ASH_BASH_COMPAT
+#define ENABLE_ASH_BASH_COMPAT 0
+#define IF_ASH_BASH_COMPAT(...)
+#define IF_NOT_ASH_BASH_COMPAT(...) __VA_ARGS__
+#undef CONFIG_ASH_IDLE_TIMEOUT
+#define ENABLE_ASH_IDLE_TIMEOUT 0
+#define IF_ASH_IDLE_TIMEOUT(...)
+#define IF_NOT_ASH_IDLE_TIMEOUT(...) __VA_ARGS__
+#undef CONFIG_ASH_JOB_CONTROL
+#define ENABLE_ASH_JOB_CONTROL 0
+#define IF_ASH_JOB_CONTROL(...)
+#define IF_NOT_ASH_JOB_CONTROL(...) __VA_ARGS__
+#undef CONFIG_ASH_ALIAS
+#define ENABLE_ASH_ALIAS 0
+#define IF_ASH_ALIAS(...)
+#define IF_NOT_ASH_ALIAS(...) __VA_ARGS__
+#undef CONFIG_ASH_GETOPTS
+#define ENABLE_ASH_GETOPTS 0
+#define IF_ASH_GETOPTS(...)
+#define IF_NOT_ASH_GETOPTS(...) __VA_ARGS__
+#undef CONFIG_ASH_BUILTIN_ECHO
+#define ENABLE_ASH_BUILTIN_ECHO 0
+#define IF_ASH_BUILTIN_ECHO(...)
+#define IF_NOT_ASH_BUILTIN_ECHO(...) __VA_ARGS__
+#undef CONFIG_ASH_BUILTIN_PRINTF
+#define ENABLE_ASH_BUILTIN_PRINTF 0
+#define IF_ASH_BUILTIN_PRINTF(...)
+#define IF_NOT_ASH_BUILTIN_PRINTF(...) __VA_ARGS__
+#undef CONFIG_ASH_BUILTIN_TEST
+#define ENABLE_ASH_BUILTIN_TEST 0
+#define IF_ASH_BUILTIN_TEST(...)
+#define IF_NOT_ASH_BUILTIN_TEST(...) __VA_ARGS__
+#undef CONFIG_ASH_HELP
+#define ENABLE_ASH_HELP 0
+#define IF_ASH_HELP(...)
+#define IF_NOT_ASH_HELP(...) __VA_ARGS__
+#undef CONFIG_ASH_CMDCMD
+#define ENABLE_ASH_CMDCMD 0
+#define IF_ASH_CMDCMD(...)
+#define IF_NOT_ASH_CMDCMD(...) __VA_ARGS__
+#undef CONFIG_ASH_MAIL
+#define ENABLE_ASH_MAIL 0
+#define IF_ASH_MAIL(...)
+#define IF_NOT_ASH_MAIL(...) __VA_ARGS__
+#define CONFIG_CTTYHACK 1
+#define ENABLE_CTTYHACK 1
+#ifdef MAKE_SUID
+# define IF_CTTYHACK(...) __VA_ARGS__ "CONFIG_CTTYHACK"
+#else
+# define IF_CTTYHACK(...) __VA_ARGS__
+#endif
+#define IF_NOT_CTTYHACK(...)
+#define CONFIG_HUSH 1
+#define ENABLE_HUSH 1
+#ifdef MAKE_SUID
+# define IF_HUSH(...) __VA_ARGS__ "CONFIG_HUSH"
+#else
+# define IF_HUSH(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH(...)
+#define CONFIG_HUSH_BASH_COMPAT 1
+#define ENABLE_HUSH_BASH_COMPAT 1
+#ifdef MAKE_SUID
+# define IF_HUSH_BASH_COMPAT(...) __VA_ARGS__ "CONFIG_HUSH_BASH_COMPAT"
+#else
+# define IF_HUSH_BASH_COMPAT(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_BASH_COMPAT(...)
+#define CONFIG_HUSH_BRACE_EXPANSION 1
+#define ENABLE_HUSH_BRACE_EXPANSION 1
+#ifdef MAKE_SUID
+# define IF_HUSH_BRACE_EXPANSION(...) __VA_ARGS__ "CONFIG_HUSH_BRACE_EXPANSION"
+#else
+# define IF_HUSH_BRACE_EXPANSION(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_BRACE_EXPANSION(...)
+#define CONFIG_HUSH_HELP 1
+#define ENABLE_HUSH_HELP 1
+#ifdef MAKE_SUID
+# define IF_HUSH_HELP(...) __VA_ARGS__ "CONFIG_HUSH_HELP"
+#else
+# define IF_HUSH_HELP(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_HELP(...)
+#define CONFIG_HUSH_INTERACTIVE 1
+#define ENABLE_HUSH_INTERACTIVE 1
+#ifdef MAKE_SUID
+# define IF_HUSH_INTERACTIVE(...) __VA_ARGS__ "CONFIG_HUSH_INTERACTIVE"
+#else
+# define IF_HUSH_INTERACTIVE(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_INTERACTIVE(...)
+#undef CONFIG_HUSH_SAVEHISTORY
+#define ENABLE_HUSH_SAVEHISTORY 0
+#define IF_HUSH_SAVEHISTORY(...)
+#define IF_NOT_HUSH_SAVEHISTORY(...) __VA_ARGS__
+#define CONFIG_HUSH_JOB 1
+#define ENABLE_HUSH_JOB 1
+#ifdef MAKE_SUID
+# define IF_HUSH_JOB(...) __VA_ARGS__ "CONFIG_HUSH_JOB"
+#else
+# define IF_HUSH_JOB(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_JOB(...)
+#define CONFIG_HUSH_TICK 1
+#define ENABLE_HUSH_TICK 1
+#ifdef MAKE_SUID
+# define IF_HUSH_TICK(...) __VA_ARGS__ "CONFIG_HUSH_TICK"
+#else
+# define IF_HUSH_TICK(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_TICK(...)
+#define CONFIG_HUSH_IF 1
+#define ENABLE_HUSH_IF 1
+#ifdef MAKE_SUID
+# define IF_HUSH_IF(...) __VA_ARGS__ "CONFIG_HUSH_IF"
+#else
+# define IF_HUSH_IF(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_IF(...)
+#define CONFIG_HUSH_LOOPS 1
+#define ENABLE_HUSH_LOOPS 1
+#ifdef MAKE_SUID
+# define IF_HUSH_LOOPS(...) __VA_ARGS__ "CONFIG_HUSH_LOOPS"
+#else
+# define IF_HUSH_LOOPS(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_LOOPS(...)
+#define CONFIG_HUSH_CASE 1
+#define ENABLE_HUSH_CASE 1
+#ifdef MAKE_SUID
+# define IF_HUSH_CASE(...) __VA_ARGS__ "CONFIG_HUSH_CASE"
+#else
+# define IF_HUSH_CASE(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_CASE(...)
+#define CONFIG_HUSH_FUNCTIONS 1
+#define ENABLE_HUSH_FUNCTIONS 1
+#ifdef MAKE_SUID
+# define IF_HUSH_FUNCTIONS(...) __VA_ARGS__ "CONFIG_HUSH_FUNCTIONS"
+#else
+# define IF_HUSH_FUNCTIONS(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_FUNCTIONS(...)
+#define CONFIG_HUSH_LOCAL 1
+#define ENABLE_HUSH_LOCAL 1
+#ifdef MAKE_SUID
+# define IF_HUSH_LOCAL(...) __VA_ARGS__ "CONFIG_HUSH_LOCAL"
+#else
+# define IF_HUSH_LOCAL(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_LOCAL(...)
+#define CONFIG_HUSH_RANDOM_SUPPORT 1
+#define ENABLE_HUSH_RANDOM_SUPPORT 1
+#ifdef MAKE_SUID
+# define IF_HUSH_RANDOM_SUPPORT(...) __VA_ARGS__ "CONFIG_HUSH_RANDOM_SUPPORT"
+#else
+# define IF_HUSH_RANDOM_SUPPORT(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_RANDOM_SUPPORT(...)
+#define CONFIG_HUSH_EXPORT_N 1
+#define ENABLE_HUSH_EXPORT_N 1
+#ifdef MAKE_SUID
+# define IF_HUSH_EXPORT_N(...) __VA_ARGS__ "CONFIG_HUSH_EXPORT_N"
+#else
+# define IF_HUSH_EXPORT_N(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_EXPORT_N(...)
+#define CONFIG_HUSH_MODE_X 1
+#define ENABLE_HUSH_MODE_X 1
+#ifdef MAKE_SUID
+# define IF_HUSH_MODE_X(...) __VA_ARGS__ "CONFIG_HUSH_MODE_X"
+#else
+# define IF_HUSH_MODE_X(...) __VA_ARGS__
+#endif
+#define IF_NOT_HUSH_MODE_X(...)
+#define CONFIG_MSH 1
+#define ENABLE_MSH 1
+#ifdef MAKE_SUID
+# define IF_MSH(...) __VA_ARGS__ "CONFIG_MSH"
+#else
+# define IF_MSH(...) __VA_ARGS__
+#endif
+#define IF_NOT_MSH(...)
+#define CONFIG_FEATURE_SH_MATH 1
+#define ENABLE_FEATURE_SH_MATH 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SH_MATH(...) __VA_ARGS__ "CONFIG_FEATURE_SH_MATH"
+#else
+# define IF_FEATURE_SH_MATH(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SH_MATH(...)
+#define CONFIG_FEATURE_SH_MATH_64 1
+#define ENABLE_FEATURE_SH_MATH_64 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SH_MATH_64(...) __VA_ARGS__ "CONFIG_FEATURE_SH_MATH_64"
+#else
+# define IF_FEATURE_SH_MATH_64(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SH_MATH_64(...)
+#define CONFIG_FEATURE_SH_EXTRA_QUIET 1
+#define ENABLE_FEATURE_SH_EXTRA_QUIET 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SH_EXTRA_QUIET(...) __VA_ARGS__ "CONFIG_FEATURE_SH_EXTRA_QUIET"
+#else
+# define IF_FEATURE_SH_EXTRA_QUIET(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SH_EXTRA_QUIET(...)
+#define CONFIG_FEATURE_SH_STANDALONE 1
+#define ENABLE_FEATURE_SH_STANDALONE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SH_STANDALONE(...) __VA_ARGS__ "CONFIG_FEATURE_SH_STANDALONE"
+#else
+# define IF_FEATURE_SH_STANDALONE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SH_STANDALONE(...)
+#define CONFIG_FEATURE_SH_NOFORK 1
+#define ENABLE_FEATURE_SH_NOFORK 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SH_NOFORK(...) __VA_ARGS__ "CONFIG_FEATURE_SH_NOFORK"
+#else
+# define IF_FEATURE_SH_NOFORK(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SH_NOFORK(...)
+#define CONFIG_FEATURE_SH_HISTFILESIZE 1
+#define ENABLE_FEATURE_SH_HISTFILESIZE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SH_HISTFILESIZE(...) __VA_ARGS__ "CONFIG_FEATURE_SH_HISTFILESIZE"
+#else
+# define IF_FEATURE_SH_HISTFILESIZE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SH_HISTFILESIZE(...)
+
+/*
+ * System Logging Utilities
+ */
+#define CONFIG_KLOGD 1
+#define ENABLE_KLOGD 1
+#ifdef MAKE_SUID
+# define IF_KLOGD(...) __VA_ARGS__ "CONFIG_KLOGD"
+#else
+# define IF_KLOGD(...) __VA_ARGS__
+#endif
+#define IF_NOT_KLOGD(...)
+
+/*
+ * klogd should not be used together with syslog to kernel printk buffer
+ */
+#define CONFIG_FEATURE_KLOGD_KLOGCTL 1
+#define ENABLE_FEATURE_KLOGD_KLOGCTL 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_KLOGD_KLOGCTL(...) __VA_ARGS__ "CONFIG_FEATURE_KLOGD_KLOGCTL"
+#else
+# define IF_FEATURE_KLOGD_KLOGCTL(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_KLOGD_KLOGCTL(...)
+#define CONFIG_LOGGER 1
+#define ENABLE_LOGGER 1
+#ifdef MAKE_SUID
+# define IF_LOGGER(...) __VA_ARGS__ "CONFIG_LOGGER"
+#else
+# define IF_LOGGER(...) __VA_ARGS__
+#endif
+#define IF_NOT_LOGGER(...)
+#define CONFIG_LOGREAD 1
+#define ENABLE_LOGREAD 1
+#ifdef MAKE_SUID
+# define IF_LOGREAD(...) __VA_ARGS__ "CONFIG_LOGREAD"
+#else
+# define IF_LOGREAD(...) __VA_ARGS__
+#endif
+#define IF_NOT_LOGREAD(...)
+#define CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING 1
+#define ENABLE_FEATURE_LOGREAD_REDUCED_LOCKING 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_LOGREAD_REDUCED_LOCKING(...) __VA_ARGS__ "CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING"
+#else
+# define IF_FEATURE_LOGREAD_REDUCED_LOCKING(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_LOGREAD_REDUCED_LOCKING(...)
+#define CONFIG_SYSLOGD 1
+#define ENABLE_SYSLOGD 1
+#ifdef MAKE_SUID
+# define IF_SYSLOGD(...) __VA_ARGS__ "CONFIG_SYSLOGD"
+#else
+# define IF_SYSLOGD(...) __VA_ARGS__
+#endif
+#define IF_NOT_SYSLOGD(...)
+#define CONFIG_FEATURE_ROTATE_LOGFILE 1
+#define ENABLE_FEATURE_ROTATE_LOGFILE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_ROTATE_LOGFILE(...) __VA_ARGS__ "CONFIG_FEATURE_ROTATE_LOGFILE"
+#else
+# define IF_FEATURE_ROTATE_LOGFILE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_ROTATE_LOGFILE(...)
+#define CONFIG_FEATURE_REMOTE_LOG 1
+#define ENABLE_FEATURE_REMOTE_LOG 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_REMOTE_LOG(...) __VA_ARGS__ "CONFIG_FEATURE_REMOTE_LOG"
+#else
+# define IF_FEATURE_REMOTE_LOG(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_REMOTE_LOG(...)
+#define CONFIG_FEATURE_SYSLOGD_DUP 1
+#define ENABLE_FEATURE_SYSLOGD_DUP 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SYSLOGD_DUP(...) __VA_ARGS__ "CONFIG_FEATURE_SYSLOGD_DUP"
+#else
+# define IF_FEATURE_SYSLOGD_DUP(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SYSLOGD_DUP(...)
+#define CONFIG_FEATURE_SYSLOGD_CFG 1
+#define ENABLE_FEATURE_SYSLOGD_CFG 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SYSLOGD_CFG(...) __VA_ARGS__ "CONFIG_FEATURE_SYSLOGD_CFG"
+#else
+# define IF_FEATURE_SYSLOGD_CFG(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SYSLOGD_CFG(...)
+#define CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE 256
+#define ENABLE_FEATURE_SYSLOGD_READ_BUFFER_SIZE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_SYSLOGD_READ_BUFFER_SIZE(...) __VA_ARGS__ "CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE"
+#else
+# define IF_FEATURE_SYSLOGD_READ_BUFFER_SIZE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_SYSLOGD_READ_BUFFER_SIZE(...)
+#define CONFIG_FEATURE_IPC_SYSLOG 1
+#define ENABLE_FEATURE_IPC_SYSLOG 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IPC_SYSLOG(...) __VA_ARGS__ "CONFIG_FEATURE_IPC_SYSLOG"
+#else
+# define IF_FEATURE_IPC_SYSLOG(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IPC_SYSLOG(...)
+#define CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE 16
+#define ENABLE_FEATURE_IPC_SYSLOG_BUFFER_SIZE 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_IPC_SYSLOG_BUFFER_SIZE(...) __VA_ARGS__ "CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE"
+#else
+# define IF_FEATURE_IPC_SYSLOG_BUFFER_SIZE(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_IPC_SYSLOG_BUFFER_SIZE(...)
+#define CONFIG_FEATURE_KMSG_SYSLOG 1
+#define ENABLE_FEATURE_KMSG_SYSLOG 1
+#ifdef MAKE_SUID
+# define IF_FEATURE_KMSG_SYSLOG(...) __VA_ARGS__ "CONFIG_FEATURE_KMSG_SYSLOG"
+#else
+# define IF_FEATURE_KMSG_SYSLOG(...) __VA_ARGS__
+#endif
+#define IF_NOT_FEATURE_KMSG_SYSLOG(...)
Index: /EcnlProtoTool/trunk/busybox/src/bb_strtonum.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/bb_strtonum.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/bb_strtonum.c	(revision 447)
@@ -0,0 +1,160 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+
+#include "libbb.h"
+
+/* On exit: errno = 0 only if there was non-empty, '\0' terminated value
+ * errno = EINVAL if value was not '\0' terminated, but otherwise ok
+ *    Return value is still valid, caller should just check whether end[0]
+ *    is a valid terminating char for particular case. OTOH, if caller
+ *    requires '\0' terminated input, [s]he can just check errno == 0.
+ * errno = ERANGE if value had alphanumeric terminating char ("1234abcg").
+ * errno = ERANGE if value is out of range, missing, etc.
+ * errno = ERANGE if value had minus sign for strtouXX (even "-0" is not ok )
+ *    return value is all-ones in this case.
+ *
+ * Test code:
+ * char *endptr;
+ * const char *minus = "-";
+ * errno = 0;
+ * bb_strtoi(minus, &endptr, 0); // must set ERANGE
+ * printf("minus:%p endptr:%p errno:%d EINVAL:%d\n", minus, endptr, errno, EINVAL);
+ * errno = 0;
+ * bb_strtoi("-0-", &endptr, 0); // must set EINVAL and point to second '-'
+ * printf("endptr[0]:%c errno:%d EINVAL:%d\n", endptr[0], errno, EINVAL);
+ */
+
+static unsigned long long ret_ERANGE(void)
+{
+	errno = ERANGE; /* this ain't as small as it looks (on glibc) */
+	return ULLONG_MAX;
+}
+
+static unsigned long long handle_errors(unsigned long long v, char **endp)
+{
+	char next_ch = **endp;
+
+	/* errno is already set to ERANGE by strtoXXX if value overflowed */
+	if (next_ch) {
+		/* "1234abcg" or out-of-range? */
+		if (isalnum(next_ch) || errno)
+			return ret_ERANGE();
+		/* good number, just suspicious terminator */
+		errno = EINVAL;
+	}
+	return v;
+}
+
+
+unsigned long long FAST_FUNC bb_strtoull(const char *arg, char **endp, int base)
+{
+	unsigned long long v;
+	char *endptr;
+
+	if (!endp) endp = &endptr;
+	*endp = (char*) arg;
+
+	/* strtoul("  -4200000000") returns 94967296, errno 0 (!) */
+	/* I don't think that this is right. Preventing this... */
+	if (!isalnum(arg[0])) return ret_ERANGE();
+
+	/* not 100% correct for lib func, but convenient for the caller */
+	errno = 0;
+	v = strtoull(arg, endp, base);
+	return handle_errors(v, endp);
+}
+
+long long FAST_FUNC bb_strtoll(const char *arg, char **endp, int base)
+{
+	unsigned long long v;
+	char *endptr;
+	char first;
+
+	if (!endp) endp = &endptr;
+	*endp = (char*) arg;
+
+	/* Check for the weird "feature":
+	 * a "-" string is apparently a valid "number" for strto[u]l[l]!
+	 * It returns zero and errno is 0! :( */
+	first = (arg[0] != '-' ? arg[0] : arg[1]);
+	if (!isalnum(first)) return ret_ERANGE();
+
+	errno = 0;
+	v = strtoll(arg, endp, base);
+	return handle_errors(v, endp);
+}
+
+#if ULONG_MAX != ULLONG_MAX
+unsigned long FAST_FUNC bb_strtoul(const char *arg, char **endp, int base)
+{
+	unsigned long v;
+	char *endptr;
+
+	if (!endp) endp = &endptr;
+	*endp = (char*) arg;
+
+	if (!isalnum(arg[0])) return ret_ERANGE();
+	errno = 0;
+	v = strtoul(arg, endp, base);
+	return handle_errors(v, endp);
+}
+
+long FAST_FUNC bb_strtol(const char *arg, char **endp, int base)
+{
+	long v;
+	char *endptr;
+	char first;
+
+	if (!endp) endp = &endptr;
+	*endp = (char*) arg;
+
+	first = (arg[0] != '-' ? arg[0] : arg[1]);
+	if (!isalnum(first)) return ret_ERANGE();
+
+	errno = 0;
+	v = strtol(arg, endp, base);
+	return handle_errors(v, endp);
+}
+#endif
+
+#if UINT_MAX != ULONG_MAX
+unsigned FAST_FUNC bb_strtou(const char *arg, char **endp, int base)
+{
+	unsigned long v;
+	char *endptr;
+
+	if (!endp) endp = &endptr;
+	*endp = (char*) arg;
+
+	if (!isalnum(arg[0])) return ret_ERANGE();
+	errno = 0;
+	v = strtoul(arg, endp, base);
+	if (v > UINT_MAX) return ret_ERANGE();
+	return handle_errors(v, endp);
+}
+
+int FAST_FUNC bb_strtoi(const char *arg, char **endp, int base)
+{
+	long v;
+	char *endptr;
+	char first;
+
+	if (!endp) endp = &endptr;
+	*endp = (char*) arg;
+
+	first = (arg[0] != '-' ? arg[0] : arg[1]);
+	if (!isalnum(first)) return ret_ERANGE();
+
+	errno = 0;
+	v = strtol(arg, endp, base);
+	if (v > INT_MAX) return ret_ERANGE();
+	if (v < INT_MIN) return ret_ERANGE();
+	return handle_errors(v, endp);
+}
+#endif
Index: /EcnlProtoTool/trunk/busybox/src/bb_time.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/bb_time.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/bb_time.c	(revision 447)
@@ -0,0 +1,299 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 2007 Denys Vlasenko
+ *
+ * Licensed under GPLv2, see file LICENSE in this source tree.
+ */
+#include "libbb.h"
+
+void FAST_FUNC parse_datestr(const char *date_str, struct tm *ptm)
+{
+	char end = '\0';
+	const char *last_colon = strrchr(date_str, ':');
+
+	if (last_colon != NULL) {
+		/* Parse input and assign appropriately to ptm */
+#if ENABLE_DESKTOP
+		const char *endp;
+#endif
+
+		/* HH:MM */
+		if (sscanf(date_str, "%u:%u%c",
+					&ptm->tm_hour,
+					&ptm->tm_min,
+					&end) >= 2
+		) {
+			/* no adjustments needed */
+		} else
+		/* mm.dd-HH:MM */
+		if (sscanf(date_str, "%u.%u-%u:%u%c",
+					&ptm->tm_mon, &ptm->tm_mday,
+					&ptm->tm_hour, &ptm->tm_min,
+					&end) >= 4
+		) {
+			/* Adjust month from 1-12 to 0-11 */
+			ptm->tm_mon -= 1;
+		} else
+		/* yyyy.mm.dd-HH:MM */
+		if (sscanf(date_str, "%u.%u.%u-%u:%u%c", &ptm->tm_year,
+					&ptm->tm_mon, &ptm->tm_mday,
+					&ptm->tm_hour, &ptm->tm_min,
+					&end) >= 5
+		/* yyyy-mm-dd HH:MM */
+		 || sscanf(date_str, "%u-%u-%u %u:%u%c", &ptm->tm_year,
+					&ptm->tm_mon, &ptm->tm_mday,
+					&ptm->tm_hour, &ptm->tm_min,
+					&end) >= 5
+		) {
+			ptm->tm_year -= 1900; /* Adjust years */
+			ptm->tm_mon -= 1; /* Adjust month from 1-12 to 0-11 */
+		} else
+#if ENABLE_DESKTOP  /* strptime is BIG: ~1k in uclibc, ~10k in glibc */
+		/* month_name d HH:MM:SS YYYY. Supported by GNU date */
+		if ((endp = strptime(date_str, "%b %d %T %Y", ptm)) != NULL
+		 && *endp == '\0'
+		) {
+			return; /* don't fall through to end == ":" check */
+		} else
+#endif
+		{
+			bb_error_msg_and_die(bb_msg_invalid_date, date_str);
+		}
+		if (end == ':') {
+			/* xxx:SS */
+			if (sscanf(last_colon + 1, "%u%c", &ptm->tm_sec, &end) == 1)
+				end = '\0';
+			/* else end != NUL and we error out */
+		}
+	} else
+	if (strchr(date_str, '-')
+	    /* Why strchr('-') check?
+	     * sscanf below will trash ptm->tm_year, this breaks
+	     * if parse_str is "10101010" (iow, "MMddhhmm" form)
+	     * because we destroy year. Do these sscanf
+	     * only if we saw a dash in parse_str.
+	     */
+		/* yyyy-mm-dd HH */
+	 && (sscanf(date_str, "%u-%u-%u %u%c", &ptm->tm_year,
+				&ptm->tm_mon, &ptm->tm_mday,
+				&ptm->tm_hour,
+				&end) >= 4
+		/* yyyy-mm-dd */
+	     || sscanf(date_str, "%u-%u-%u%c", &ptm->tm_year,
+				&ptm->tm_mon, &ptm->tm_mday,
+				&end) >= 3
+	    )
+	) {
+		ptm->tm_year -= 1900; /* Adjust years */
+		ptm->tm_mon -= 1; /* Adjust month from 1-12 to 0-11 */
+	} else
+	if (date_str[0] == '@') {
+		time_t t = bb_strtol(date_str + 1, NULL, 10);
+		if (!errno) {
+			struct tm *lt = localtime(&t);
+			if (lt) {
+				*ptm = *lt;
+				return;
+			}
+		}
+		end = '1';
+	} else {
+		/* Googled the following on an old date manpage:
+		 *
+		 * The canonical representation for setting the date/time is:
+		 * cc   Century (either 19 or 20)
+		 * yy   Year in abbreviated form (e.g. 89, 06)
+		 * mm   Numeric month, a number from 1 to 12
+		 * dd   Day, a number from 1 to 31
+		 * HH   Hour, a number from 0 to 23
+		 * MM   Minutes, a number from 0 to 59
+		 * .SS  Seconds, a number from 0 to 61 (with leap seconds)
+		 * Everything but the minutes is optional
+		 *
+		 * "touch -t DATETIME" format: [[[[[YY]YY]MM]DD]hh]mm[.ss]
+		 * Some, but not all, Unix "date DATETIME" commands
+		 * move [[YY]YY] past minutes mm field (!).
+		 * Coreutils date does it, and SUS mandates it.
+		 * (date -s DATETIME does not support this format. lovely!)
+		 * In bbox, this format is special-cased in date applet
+		 * (IOW: this function assumes "touch -t" format).
+		 */
+		unsigned cur_year = ptm->tm_year;
+		int len = strchrnul(date_str, '.') - date_str;
+
+		/* MM[.SS] */
+		if (len == 2 && sscanf(date_str, "%2u%2u%2u%2u""%2u%c" + 12,
+					&ptm->tm_min,
+					&end) >= 1) {
+		} else
+		/* HHMM[.SS] */
+		if (len == 4 && sscanf(date_str, "%2u%2u%2u""%2u%2u%c" + 9,
+					&ptm->tm_hour,
+					&ptm->tm_min,
+					&end) >= 2) {
+		} else
+		/* ddHHMM[.SS] */
+		if (len == 6 && sscanf(date_str, "%2u%2u""%2u%2u%2u%c" + 6,
+					&ptm->tm_mday,
+					&ptm->tm_hour,
+					&ptm->tm_min,
+					&end) >= 3) {
+		} else
+		/* mmddHHMM[.SS] */
+		if (len == 8 && sscanf(date_str, "%2u""%2u%2u%2u%2u%c" + 3,
+					&ptm->tm_mon,
+					&ptm->tm_mday,
+					&ptm->tm_hour,
+					&ptm->tm_min,
+					&end) >= 4) {
+			/* Adjust month from 1-12 to 0-11 */
+			ptm->tm_mon -= 1;
+		} else
+		/* yymmddHHMM[.SS] */
+		if (len == 10 && sscanf(date_str, "%2u%2u%2u%2u%2u%c",
+					&ptm->tm_year,
+					&ptm->tm_mon,
+					&ptm->tm_mday,
+					&ptm->tm_hour,
+					&ptm->tm_min,
+					&end) >= 5) {
+			/* Adjust month from 1-12 to 0-11 */
+			ptm->tm_mon -= 1;
+			if ((int)cur_year >= 50) { /* >= 1950 */
+				/* Adjust year: */
+				/* 1. Put it in the current century */
+				ptm->tm_year += (cur_year / 100) * 100;
+				/* 2. If too far in the past, +100 years */
+				if (ptm->tm_year < cur_year - 50)
+					ptm->tm_year += 100;
+				/* 3. If too far in the future, -100 years */
+				if (ptm->tm_year > cur_year + 50)
+					ptm->tm_year -= 100;
+			}
+		} else
+		/* ccyymmddHHMM[.SS] */
+		if (len == 12 && sscanf(date_str, "%4u%2u%2u%2u%2u%c",
+					&ptm->tm_year,
+					&ptm->tm_mon,
+					&ptm->tm_mday,
+					&ptm->tm_hour,
+					&ptm->tm_min,
+					&end) >= 5) {
+			ptm->tm_year -= 1900; /* Adjust years */
+			ptm->tm_mon -= 1; /* Adjust month from 1-12 to 0-11 */
+		} else {
+			bb_error_msg_and_die(bb_msg_invalid_date, date_str);
+		}
+		ptm->tm_sec = 0; /* assume zero if [.SS] is not given */
+		if (end == '.') {
+			/* xxx.SS */
+			if (sscanf(strchr(date_str, '.') + 1, "%u%c",
+					&ptm->tm_sec, &end) == 1)
+				end = '\0';
+			/* else end != NUL and we error out */
+		}
+	}
+	if (end != '\0') {
+		bb_error_msg_and_die(bb_msg_invalid_date, date_str);
+	}
+}
+
+time_t FAST_FUNC validate_tm_time(const char *date_str, struct tm *ptm)
+{
+	time_t t = mktime(ptm);
+	if (t == (time_t) -1L) {
+		bb_error_msg_and_die(bb_msg_invalid_date, date_str);
+	}
+	return t;
+}
+
+static char* strftime_fmt(char *buf, unsigned len, time_t *tp, const char *fmt)
+{
+	time_t t;
+	if (!tp) {
+		tp = &t;
+		time(tp);
+	}
+	/* Returns pointer to NUL */
+	return buf + strftime(buf, len, fmt, localtime(tp));
+}
+
+char* FAST_FUNC strftime_HHMMSS(char *buf, unsigned len, time_t *tp)
+{
+	return strftime_fmt(buf, len, tp, "%H:%M:%S");
+}
+
+char* FAST_FUNC strftime_YYYYMMDDHHMMSS(char *buf, unsigned len, time_t *tp)
+{
+	return strftime_fmt(buf, len, tp, "%Y-%m-%d %H:%M:%S");
+}
+
+#if ENABLE_MONOTONIC_SYSCALL
+
+#include <sys/syscall.h>
+/* Old glibc (< 2.3.4) does not provide this constant. We use syscall
+ * directly so this definition is safe. */
+#ifndef CLOCK_MONOTONIC
+#define CLOCK_MONOTONIC 1
+#endif
+
+/* libc has incredibly messy way of doing this,
+ * typically requiring -lrt. We just skip all this mess */
+static void get_mono(struct timespec *ts)
+{
+	if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts))
+		bb_error_msg_and_die("clock_gettime(MONOTONIC) failed");
+}
+unsigned long long FAST_FUNC monotonic_ns(void)
+{
+	struct timespec ts;
+	get_mono(&ts);
+	return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
+}
+unsigned long long FAST_FUNC monotonic_us(void)
+{
+	struct timespec ts;
+	get_mono(&ts);
+	return ts.tv_sec * 1000000ULL + ts.tv_nsec/1000;
+}
+unsigned long long FAST_FUNC monotonic_ms(void)
+{
+	struct timespec ts;
+	get_mono(&ts);
+	return ts.tv_sec * 1000ULL + ts.tv_nsec/1000000;
+}
+unsigned FAST_FUNC monotonic_sec(void)
+{
+	struct timespec ts;
+	get_mono(&ts);
+	return ts.tv_sec;
+}
+
+#else
+
+unsigned long long FAST_FUNC monotonic_ns(void)
+{
+	struct timeval tv;
+	gettimeofday(&tv, NULL);
+	return tv.tv_sec * 1000000000ULL + tv.tv_usec * 1000;
+}
+unsigned long long FAST_FUNC monotonic_us(void)
+{
+	struct timeval tv;
+	gettimeofday(&tv, NULL);
+	return tv.tv_sec * 1000000ULL + tv.tv_usec;
+}
+unsigned long long FAST_FUNC monotonic_ms(void)
+{
+	struct timeval tv;
+	gettimeofday(&tv, NULL);
+	return tv.tv_sec * 1000ULL + tv.tv_usec / 1000;
+}
+unsigned FAST_FUNC monotonic_sec(void)
+{
+	return time(NULL);
+}
+
+#endif
Index: /EcnlProtoTool/trunk/busybox/src/compare_string_array.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/compare_string_array.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/compare_string_array.c	(revision 447)
@@ -0,0 +1,171 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+
+#include "libbb.h"
+
+/*
+ * Return NULL if string is not prefixed with key. Return pointer to the
+ * first character in string after the prefix key. If key is an empty string,
+ * return pointer to the beginning of string.
+ */
+char* FAST_FUNC is_prefixed_with(const char *string, const char *key)
+{
+#if 0	/* Two passes over key - probably slower */
+	int len = strlen(key);
+	if (strncmp(string, key, len) == 0)
+		return string + len;
+	return NULL;
+#else	/* Open-coded */
+	while (*key != '\0') {
+		if (*key != *string)
+			return NULL;
+		key++;
+		string++;
+	}
+	return (char*)string;
+#endif
+}
+
+/*
+ * Return NULL if string is not suffixed with key. Return pointer to the
+ * beginning of prefix key in string. If key is an empty string return pointer
+ * to the end of string.
+ */
+char* FAST_FUNC is_suffixed_with(const char *string, const char *key)
+{
+	size_t key_len = strlen(key);
+	ssize_t len_diff = strlen(string) - key_len;
+
+	if (len_diff >= 0) {
+		string += len_diff;
+		if (strcmp(string, key) == 0) {
+			return (char*)string;
+		}
+	}
+
+	return NULL;
+}
+
+/* returns the array index of the string */
+/* (index of first match is returned, or -1) */
+int FAST_FUNC index_in_str_array(const char *const string_array[], const char *key)
+{
+	int i;
+
+	for (i = 0; string_array[i] != 0; i++) {
+		if (strcmp(string_array[i], key) == 0) {
+			return i;
+		}
+	}
+	return -1;
+}
+
+int FAST_FUNC index_in_strings(const char *strings, const char *key)
+{
+	int idx = 0;
+
+	while (*strings) {
+		if (strcmp(strings, key) == 0) {
+			return idx;
+		}
+		strings += strlen(strings) + 1; /* skip NUL */
+		idx++;
+	}
+	return -1;
+}
+
+/* returns the array index of the string, even if it matches only a beginning */
+/* (index of first match is returned, or -1) */
+#ifdef UNUSED
+int FAST_FUNC index_in_substr_array(const char *const string_array[], const char *key)
+{
+	int i;
+	if (key[0]) {
+		for (i = 0; string_array[i] != 0; i++) {
+			if (is_prefixed_with(string_array[i], key)) {
+				return i;
+			}
+		}
+	}
+	return -1;
+}
+#endif
+
+int FAST_FUNC index_in_substrings(const char *strings, const char *key)
+{
+	int matched_idx = -1;
+	const int len = strlen(key);
+
+	if (len) {
+		int idx = 0;
+		while (*strings) {
+			if (strncmp(strings, key, len) == 0) {
+				if (strings[len] == '\0')
+					return idx; /* exact match */
+				if (matched_idx >= 0)
+					return -1; /* ambiguous match */
+				matched_idx = idx;
+			}
+			strings += strlen(strings) + 1; /* skip NUL */
+			idx++;
+		}
+	}
+	return matched_idx;
+}
+
+const char* FAST_FUNC nth_string(const char *strings, int n)
+{
+	while (n) {
+		n--;
+		strings += strlen(strings) + 1;
+	}
+	return strings;
+}
+
+#ifdef UNUSED_SO_FAR /* only brctl.c needs it yet */
+/* Returns 0 for no, 1 for yes or a negative value on error.  */
+smallint FAST_FUNC yesno(const char *str)
+{
+	static const char no_yes[] ALIGN1 =
+		"0\0" "off\0" "no\0"
+		"1\0" "on\0" "yes\0";
+	int ret = index_in_substrings(no_yes, str);
+	return ret / 3;
+}
+#endif
+
+#if ENABLE_UNIT_TEST
+
+BBUNIT_DEFINE_TEST(is_prefixed_with)
+{
+	BBUNIT_ASSERT_STREQ(" bar", is_prefixed_with("foo bar", "foo"));
+	BBUNIT_ASSERT_STREQ("bar", is_prefixed_with("foo bar", "foo "));
+	BBUNIT_ASSERT_STREQ("", is_prefixed_with("foo", "foo"));
+	BBUNIT_ASSERT_STREQ("foo", is_prefixed_with("foo", ""));
+	BBUNIT_ASSERT_STREQ("", is_prefixed_with("", ""));
+
+	BBUNIT_ASSERT_NULL(is_prefixed_with("foo", "bar foo"));
+	BBUNIT_ASSERT_NULL(is_prefixed_with("foo foo", "bar"));
+	BBUNIT_ASSERT_NULL(is_prefixed_with("", "foo"));
+
+	BBUNIT_ENDTEST;
+}
+
+BBUNIT_DEFINE_TEST(is_suffixed_with)
+{
+	BBUNIT_ASSERT_STREQ("bar", is_suffixed_with("foo bar", "bar"));
+	BBUNIT_ASSERT_STREQ("foo", is_suffixed_with("foo", "foo"));
+	BBUNIT_ASSERT_STREQ("", is_suffixed_with("foo", ""));
+	BBUNIT_ASSERT_STREQ("", is_suffixed_with("", ""));
+	BBUNIT_ASSERT_STREQ("foo", is_suffixed_with("barfoofoo", "foo"));
+
+	BBUNIT_ASSERT_NULL(is_suffixed_with("foo", "bar foo"));
+	BBUNIT_ASSERT_NULL(is_suffixed_with("foo foo", "bar"));
+	BBUNIT_ASSERT_NULL(is_suffixed_with("", "foo"));
+
+	BBUNIT_ENDTEST;
+}
+
+#endif /* ENABLE_UNIT_TEST */
Index: /EcnlProtoTool/trunk/busybox/src/copyfd.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/copyfd.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/copyfd.c	(revision 447)
@@ -0,0 +1,160 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+
+#include "libbb.h"
+#if ENABLE_FEATURE_USE_SENDFILE
+# include <sys/sendfile.h>
+#else
+# define sendfile(a,b,c,d) (-1)
+#endif
+
+/*
+ * We were using 0x7fff0000 as sendfile chunk size, but it
+ * was seen to cause largish delays when user tries to ^C a file copy.
+ * Let's use a saner size.
+ * Note: needs to be >= max(CONFIG_FEATURE_COPYBUF_KB),
+ * or else "copy to eof" code will use neddlesly short reads.
+ */
+#define SENDFILE_BIGBUF (16*1024*1024)
+
+/* Used by NOFORK applets (e.g. cat) - must not use xmalloc.
+ * size < 0 means "ignore write errors", used by tar --to-command
+ * size = 0 means "copy till EOF"
+ */
+static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size)
+{
+	int status = -1;
+	off_t total = 0;
+	bool continue_on_write_error = 0;
+	ssize_t sendfile_sz;
+#if CONFIG_FEATURE_COPYBUF_KB > 4
+	char *buffer = buffer; /* for compiler */
+	int buffer_size = 0;
+#else
+	char buffer[CONFIG_FEATURE_COPYBUF_KB * 1024];
+	enum { buffer_size = sizeof(buffer) };
+#endif
+
+	if (size < 0) {
+		size = -size;
+		continue_on_write_error = 1;
+	}
+
+	if (src_fd < 0)
+		goto out;
+
+	sendfile_sz = !ENABLE_FEATURE_USE_SENDFILE
+		? 0
+		: SENDFILE_BIGBUF;
+	if (!size) {
+		size = SENDFILE_BIGBUF;
+		status = 1; /* copy until eof */
+	}
+
+	while (1) {
+		ssize_t rd;
+
+		if (sendfile_sz) {
+			rd = sendfile(dst_fd, src_fd, NULL,
+				size > sendfile_sz ? sendfile_sz : size);
+			if (rd >= 0)
+				goto read_ok;
+			sendfile_sz = 0; /* do not try sendfile anymore */
+		}
+#if CONFIG_FEATURE_COPYBUF_KB > 4
+		if (buffer_size == 0) {
+			if (size > 0 && size <= 4 * 1024)
+				goto use_small_buf;
+			/* We want page-aligned buffer, just in case kernel is clever
+			 * and can do page-aligned io more efficiently */
+			buffer = mmap(NULL, CONFIG_FEATURE_COPYBUF_KB * 1024,
+					PROT_READ | PROT_WRITE,
+					MAP_PRIVATE | MAP_ANON,
+					/* ignored: */ -1, 0);
+			buffer_size = CONFIG_FEATURE_COPYBUF_KB * 1024;
+			if (buffer == MAP_FAILED) {
+ use_small_buf:
+				buffer = alloca(4 * 1024);
+				buffer_size = 4 * 1024;
+			}
+		}
+#endif
+		rd = safe_read(src_fd, buffer,
+			size > buffer_size ? buffer_size : size);
+		if (rd < 0) {
+			bb_perror_msg(bb_msg_read_error);
+			break;
+		}
+ read_ok:
+		if (!rd) { /* eof - all done */
+			status = 0;
+			break;
+		}
+		/* dst_fd == -1 is a fake, else... */
+		if (dst_fd >= 0 && !sendfile_sz) {
+			ssize_t wr = full_write(dst_fd, buffer, rd);
+			if (wr < rd) {
+				if (!continue_on_write_error) {
+					bb_perror_msg(bb_msg_write_error);
+					break;
+				}
+				dst_fd = -1;
+			}
+		}
+		total += rd;
+		if (status < 0) { /* if we aren't copying till EOF... */
+			size -= rd;
+			if (!size) {
+				/* 'size' bytes copied - all done */
+				status = 0;
+				break;
+			}
+		}
+	}
+ out:
+
+	if (buffer_size > 4 * 1024)
+		munmap(buffer, buffer_size);
+	return status ? -1 : total;
+}
+
+
+#if 0
+void FAST_FUNC complain_copyfd_and_die(off_t sz)
+{
+	if (sz != -1)
+		bb_error_msg_and_die("short read");
+	/* if sz == -1, bb_copyfd_XX already complained */
+	xfunc_die();
+}
+#endif
+
+off_t FAST_FUNC bb_copyfd_size(int fd1, int fd2, off_t size)
+{
+	if (size) {
+		return bb_full_fd_action(fd1, fd2, size);
+	}
+	return 0;
+}
+
+void FAST_FUNC bb_copyfd_exact_size(int fd1, int fd2, off_t size)
+{
+	off_t sz = bb_copyfd_size(fd1, fd2, size);
+	if (sz == (size >= 0 ? size : -size))
+		return;
+	if (sz != -1)
+		bb_error_msg_and_die("short read");
+	/* if sz == -1, bb_copyfd_XX already complained */
+	xfunc_die();
+}
+
+off_t FAST_FUNC bb_copyfd_eof(int fd1, int fd2)
+{
+	return bb_full_fd_action(fd1, fd2, 0);
+}
Index: /EcnlProtoTool/trunk/busybox/src/default_error_retval.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/default_error_retval.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/default_error_retval.c	(revision 447)
@@ -0,0 +1,18 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2003  Manuel Novoa III  <mjn3@codepoet.org>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+
+/* Seems silly to copyright a global variable.  ;-)  Oh well.
+ *
+ * At least one applet (cmp) returns a value different from the typical
+ * EXIT_FAILURE values (1) when an error occurs.  So, make it configurable
+ * by the applet.  I suppose we could use a wrapper function to set it, but
+ * that too seems silly.
+ */
+
+#include "libbb.h"
+
+uint8_t xfunc_error_retval = EXIT_FAILURE;
Index: /EcnlProtoTool/trunk/busybox/src/full_write.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/full_write.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/full_write.c	(revision 447)
@@ -0,0 +1,42 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+
+#include "libbb.h"
+
+/*
+ * Write all of the supplied buffer out to a file.
+ * This does multiple writes as necessary.
+ * Returns the amount written, or -1 on an error.
+ */
+ssize_t FAST_FUNC full_write(int fd, const void *buf, size_t len)
+{
+	ssize_t cc;
+	ssize_t total;
+
+	total = 0;
+
+	while (len) {
+		cc = safe_write(fd, buf, len);
+
+		if (cc < 0) {
+			if (total) {
+				/* we already wrote some! */
+				/* user can do another write to know the error code */
+				return total;
+			}
+			return cc;  /* write() returns -1 on failure. */
+		}
+
+		total += cc;
+		buf = ((const char *)buf) + cc;
+		len -= cc;
+	}
+
+	return total;
+}
Index: /EcnlProtoTool/trunk/busybox/src/last_char_is.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/last_char_is.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/last_char_is.c	(revision 447)
@@ -0,0 +1,24 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * busybox library eXtended function
+ *
+ * Copyright (C) 2001 Larry Doolittle, <ldoolitt@recycle.lbl.gov>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+
+#include "libbb.h"
+
+/* Find out if the last character of a string matches the one given.
+ * Don't underrun the buffer if the string length is 0.
+ */
+char* FAST_FUNC last_char_is(const char *s, int c)
+{
+	if (s && *s) {
+		size_t sz = strlen(s) - 1;
+		s += sz;
+		if ( (unsigned char)*s == c)
+			return (char*)s;
+	}
+	return NULL;
+}
Index: /EcnlProtoTool/trunk/busybox/src/libbb.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/libbb.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/libbb.c	(revision 447)
@@ -0,0 +1,40 @@
+#include "libbb.h"
+
+const char *applet_name;
+
+void bb_show_usage(void) { xfunc_die(); }
+void FAST_FUNC kill_myself_with_sig(int sig){ abort(); }
+void BUG_sizeof(void) { abort(); }
+
+static unsigned long long ret_ERANGE(void)
+{
+	errno = ERANGE; /* this ain't as small as it looks (on glibc) */
+	return ULLONG_MAX;
+}
+
+static unsigned long long handle_errors(unsigned long long v, char **endp)
+{
+	char next_ch = **endp;
+
+	/* errno is already set to ERANGE by strtoXXX if value overflowed */
+	if (next_ch) {
+		/* "1234abcg" or out-of-range? */
+		if (isalnum(next_ch) || errno)
+			return ret_ERANGE();
+		/* good number, just suspicious terminator */
+		errno = EINVAL;
+	}
+	return v;
+}
+
+char* FAST_FUNC uid2uname_utoa(uid_t uid)
+{
+	errno = ENOSYS;
+	return NULL;
+}
+
+char* FAST_FUNC gid2group_utoa(gid_t gid)
+{
+	errno = ENOSYS;
+	return NULL;
+}
Index: /EcnlProtoTool/trunk/busybox/src/libbb.h
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/libbb.h	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/libbb.h	(revision 447)
@@ -0,0 +1,2184 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Busybox main internal header file
+ *
+ * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
+ * Permission has been granted to redistribute this code under GPL.
+ *
+ * Licensed under GPLv2, see file LICENSE in this source tree.
+ */
+#ifndef LIBBB_H
+#define LIBBB_H 1
+
+#define BB_VER "1.26.2"
+#define BB_BT "2017/3/16 10:00:00"
+#include "autoconf.h"
+
+#define fgets_unlocked fgets
+#define getchar_unlocked getchar
+#define fputs_unlocked fputs
+#define putchar_unlocked putchar
+#define ferror_unlocked ferror
+#define fileno_unlocked fileno
+
+#include "platform.h"
+
+#include <ctype.h>
+#include "dirent.h"
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <netdb.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <paths.h>
+#if defined __UCLIBC__ /* TODO: and glibc? */
+/* use inlined versions of these: */
+# define sigfillset(s)    __sigfillset(s)
+# define sigemptyset(s)   __sigemptyset(s)
+# define sigisemptyset(s) __sigisemptyset(s)
+#endif
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <string.h>
+/* There are two incompatible basename's, let's not use them! */
+/* See the dirname/basename man page for details */
+#include <libgen.h> /* dirname,basename */
+#undef basename
+#define basename dont_use_basename
+#include <poll.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#if !defined(major) || defined(__GLIBC__)
+# include <sys/sysmacros.h>
+#endif
+#include <sys/wait.h>
+#include <termios.h>
+#include <time.h>
+#include <sys/param.h>
+#include <pwd.h>
+#include <grp.h>
+#if ENABLE_FEATURE_SHADOWPASSWDS
+# if !ENABLE_USE_BB_SHADOW
+/* If using busybox's shadow implementation, do not include the shadow.h
+ * header as the toolchain may not provide it at all.
+ */
+#  include <shadow.h>
+# endif
+#endif
+#if defined(ANDROID) || defined(__ANDROID__)
+# define endpwent() ((void)0)
+# define endgrent() ((void)0)
+#endif
+#ifdef HAVE_MNTENT_H
+# include <mntent.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
+#endif
+
+extern char *strchrnul(const char *, int);
+extern void *memrchr(const void *s, int c, size_t n);
+
+/* Don't do this here:
+ * #include <sys/sysinfo.h>
+ * Some linux/ includes pull in conflicting definition
+ * of struct sysinfo (only in some toolchanins), which breaks build.
+ * Include sys/sysinfo.h only in those files which need it.
+ */
+#if ENABLE_SELINUX
+# include <selinux/selinux.h>
+# include <selinux/context.h>
+#endif
+#if ENABLE_FEATURE_UTMP
+# if defined __UCLIBC__ && ( \
+    (UCLIBC_VERSION >= KERNEL_VERSION(0, 9, 32) \
+     && UCLIBC_VERSION < KERNEL_VERSION(0, 9, 34) \
+     && defined __UCLIBC_HAS_UTMPX__ \
+    ) || ( \
+	 UCLIBC_VERSION >= KERNEL_VERSION(0, 9, 34) \
+	) \
+  )
+#  include <utmpx.h>
+# elif defined __UCLIBC__
+#  include <utmp.h>
+#  define utmpx utmp
+#  define setutxent setutent
+#  define endutxent endutent
+#  define getutxent getutent
+#  define getutxid getutid
+#  define getutxline getutline
+#  define pututxline pututline
+#  define utmpxname utmpname
+#  define updwtmpx updwtmp
+#  define _PATH_UTMPX _PATH_UTMP
+# else
+#  include <utmp.h>
+#  include <utmpx.h>
+#  if defined _PATH_UTMP && !defined _PATH_UTMPX
+#   define _PATH_UTMPX _PATH_UTMP
+#  endif
+# endif
+#endif
+#if ENABLE_LOCALE_SUPPORT
+# include <locale.h>
+#else
+# define setlocale(x,y) ((void)0)
+#endif
+#ifdef DMALLOC
+# include <dmalloc.h>
+#endif
+/* Just in case libc doesn't define some of these... */
+#ifndef _PATH_PASSWD
+#define _PATH_PASSWD  "/etc/passwd"
+#endif
+#ifndef _PATH_GROUP
+#define _PATH_GROUP   "/etc/group"
+#endif
+#ifndef _PATH_SHADOW
+#define _PATH_SHADOW  "/etc/shadow"
+#endif
+#ifndef _PATH_GSHADOW
+#define _PATH_GSHADOW "/etc/gshadow"
+#endif
+#if defined __FreeBSD__ || defined __OpenBSD__
+# include <netinet/in.h>
+# include <arpa/inet.h>
+#elif defined __APPLE__
+# include <netinet/in.h>
+#else
+# include <arpa/inet.h>
+//This breaks on bionic:
+//# if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED)
+///* We #define socklen_t *after* includes, otherwise we get
+// * typedef redefinition errors from system headers
+// * (in case "is it defined already" detection above failed)
+// */
+//#  define socklen_t bb_socklen_t
+//   typedef unsigned socklen_t;
+//# endif
+//if this is still needed, add a fix along the lines of
+//  ifdef SPECIFIC_BROKEN_LIBC_CHECK / typedef socklen_t / endif
+//in platform.h instead!
+#endif
+#ifndef HAVE_CLEARENV
+# define clearenv() do { if (environ) environ[0] = NULL; } while (0)
+#endif
+#ifndef HAVE_FDATASYNC
+# define fdatasync fsync
+#endif
+#ifndef HAVE_XTABS
+# define XTABS TAB3
+#endif
+
+
+/* Some libc's forget to declare these, do it ourself */
+
+extern char **environ;
+#if defined(__GLIBC__) && __GLIBC__ < 2
+int vdprintf(int d, const char *format, va_list ap);
+#endif
+/* klogctl is in libc's klog.h, but we cheat and not #include that */
+int klogctl(int type, char *b, int len);
+#ifndef PATH_MAX
+# define PATH_MAX 256
+#endif
+#ifndef BUFSIZ
+# define BUFSIZ 4096
+#endif
+
+
+/* Busybox does not use threads, we can speed up stdio. */
+#ifdef HAVE_UNLOCKED_STDIO
+# undef  getc
+# define getc(stream)   getc_unlocked(stream)
+# undef  getchar
+# define getchar()      getchar_unlocked()
+# undef  putc
+# define putc(c,stream) putc_unlocked(c,stream)
+# undef  putchar
+# define putchar(c)     putchar_unlocked(c)
+# undef  fgetc
+# define fgetc(stream)  getc_unlocked(stream)
+# undef  fputc
+# define fputc(c,stream) putc_unlocked(c,stream)
+#endif
+/* Above functions are required by POSIX.1-2008, below ones are extensions */
+#ifdef HAVE_UNLOCKED_LINE_OPS
+# undef  fgets
+# define fgets(s,n,stream) fgets_unlocked(s,n,stream)
+# undef  fputs
+# define fputs(s,stream) fputs_unlocked(s,stream)
+/* musl <= 1.1.15 does not support fflush_unlocked(NULL) */
+//# undef  fflush
+//# define fflush(stream) fflush_unlocked(stream)
+# undef  feof
+# define feof(stream)   feof_unlocked(stream)
+# undef  ferror
+# define ferror(stream) ferror_unlocked(stream)
+# undef  fileno
+# define fileno(stream) fileno_unlocked(stream)
+#endif
+
+
+/* Make all declarations hidden (-fvisibility flag only affects definitions) */
+/* (don't include system headers after this until corresponding pop!) */
+PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
+
+
+#if ENABLE_USE_BB_PWD_GRP
+# include "pwd_.h"
+# include "grp_.h"
+#endif
+#if ENABLE_FEATURE_SHADOWPASSWDS
+# if ENABLE_USE_BB_SHADOW
+#  include "shadow_.h"
+# endif
+#endif
+
+/* Tested to work correctly with all int types (IIRC :]) */
+#define MAXINT(T) (T)( \
+	((T)-1) > 0 \
+	? (T)-1 \
+	: (T)~((T)1 << (sizeof(T)*8-1)) \
+	)
+
+#define MININT(T) (T)( \
+	((T)-1) > 0 \
+	? (T)0 \
+	: ((T)1 << (sizeof(T)*8-1)) \
+	)
+
+/* Large file support */
+/* Note that CONFIG_LFS=y forces bbox to be built with all common ops
+ * (stat, lseek etc) mapped to "largefile" variants by libc.
+ * Practically it means that open() automatically has O_LARGEFILE added
+ * and all filesize/file_offset parameters and struct members are "large"
+ * (in today's world - signed 64bit). For full support of large files,
+ * we need a few helper #defines (below) and careful use of off_t
+ * instead of int/ssize_t. No lseek64(), O_LARGEFILE etc necessary */
+#if ENABLE_LFS
+/* CONFIG_LFS is on */
+# if ULONG_MAX > 0xffffffff
+/* "long" is long enough on this system */
+typedef unsigned long uoff_t;
+#  define XATOOFF(a) xatoul_range((a), 0, LONG_MAX)
+/* usage: sz = BB_STRTOOFF(s, NULL, 10); if (errno || sz < 0) die(); */
+#  define BB_STRTOOFF bb_strtoul
+#  define STRTOOFF strtoul
+/* usage: printf("size: %"OFF_FMT"d (%"OFF_FMT"x)\n", sz, sz); */
+#  define OFF_FMT "l"
+# else
+/* "long" is too short, need "long long" */
+typedef unsigned long long uoff_t;
+#  define XATOOFF(a) xatoull_range((a), 0, LLONG_MAX)
+long long FAST_FUNC bb_strtoll(const char *arg, char **endp, int base);
+unsigned long long FAST_FUNC bb_strtoull(const char *arg, char **endp, int base);
+#  define BB_STRTOOFF bb_strtoull
+#  define STRTOOFF strtoull
+#  define OFF_FMT "ll"
+# endif
+#else
+/* CONFIG_LFS is off */
+# if UINT_MAX == 0xffffffff
+/* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway.
+ * gcc will throw warnings on printf("%d", off_t). Crap... */
+typedef unsigned long uoff_t;
+#  define XATOOFF(a) xatoi_positive(a)
+#  define BB_STRTOOFF bb_strtou
+#  define STRTOOFF strtol
+#  define OFF_FMT "l"
+# else
+typedef unsigned long uoff_t;
+#  define XATOOFF(a) xatoul_range((a), 0, LONG_MAX)
+#  define BB_STRTOOFF bb_strtoul
+#  define STRTOOFF strtol
+#  define OFF_FMT "l"
+# endif
+#endif
+/* scary. better ideas? (but do *test* them first!) */
+#define OFF_T_MAX  ((off_t)~((off_t)1 << (sizeof(off_t)*8-1)))
+/* Users report bionic to use 32-bit off_t even if LARGEFILE support is requested.
+ * We misdetected that. Don't let it build:
+ *
+struct BUG_off_t_size_is_misdetected {
+	char BUG_off_t_size_is_misdetected[sizeof(off_t) == sizeof(uoff_t) ? 1 : -1];
+};*/
+long FAST_FUNC bb_strtol(const char *arg, char **endp, int base);
+unsigned long FAST_FUNC bb_strtoul(const char *arg, char **endp, int base);
+#if UINT_MAX != ULONG_MAX
+int FAST_FUNC bb_strtoi(const char *arg, char **endp, int base);
+unsigned FAST_FUNC bb_strtou(const char *arg, char **endp, int base);
+#else
+#define bb_strtoi bb_strtol
+#define bb_strtou bb_strtoul
+#endif
+
+/* Some useful definitions */
+#undef FALSE
+#define FALSE   ((int) 0)
+#undef TRUE
+#define TRUE    ((int) 1)
+#undef SKIP
+#define SKIP	((int) 2)
+
+/* Macros for min/max.  */
+#ifndef MIN
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#endif
+
+#ifndef MAX
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#endif
+
+/* buffer allocation schemes */
+#if ENABLE_FEATURE_BUFFERS_GO_ON_STACK
+#define RESERVE_CONFIG_BUFFER(buffer,len)  char buffer[len]
+#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len]
+#define RELEASE_CONFIG_BUFFER(buffer)      ((void)0)
+#else
+#if ENABLE_FEATURE_BUFFERS_GO_IN_BSS
+#define RESERVE_CONFIG_BUFFER(buffer,len)  static          char buffer[len]
+#define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len]
+#define RELEASE_CONFIG_BUFFER(buffer)      ((void)0)
+#else
+#define RESERVE_CONFIG_BUFFER(buffer,len)  char *buffer = xmalloc(len)
+#define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char *buffer = xmalloc(len)
+#define RELEASE_CONFIG_BUFFER(buffer)      free(buffer)
+#endif
+#endif
+
+#if defined(__GLIBC__)
+/* glibc uses __errno_location() to get a ptr to errno */
+/* We can just memorize it once - no multithreading in busybox :) */
+extern int *const bb_errno;
+#undef errno
+#define errno (*bb_errno)
+#endif
+
+#if !(ULONG_MAX > 0xffffffff)
+/* Only 32-bit CPUs need this, 64-bit ones use inlined version */
+uint64_t bb_bswap_64(uint64_t x) FAST_FUNC;
+#endif
+
+unsigned long long monotonic_ns(void) FAST_FUNC;
+unsigned long long monotonic_us(void) FAST_FUNC;
+unsigned long long monotonic_ms(void) FAST_FUNC;
+unsigned monotonic_sec(void) FAST_FUNC;
+
+extern void chomp(char *s) FAST_FUNC;
+extern void trim(char *s) FAST_FUNC;
+extern char *skip_whitespace(const char *) FAST_FUNC;
+extern char *skip_non_whitespace(const char *) FAST_FUNC;
+extern char *skip_dev_pfx(const char *tty_name) FAST_FUNC;
+
+extern char *strrstr(const char *haystack, const char *needle) FAST_FUNC;
+
+//TODO: supply a pointer to char[11] buffer (avoid statics)?
+extern const char *bb_mode_string(mode_t mode) FAST_FUNC;
+extern int is_directory(const char *name, int followLinks) FAST_FUNC;
+enum {	/* cp.c, mv.c, install.c depend on these values. CAREFUL when changing them! */
+	FILEUTILS_PRESERVE_STATUS = 1 << 0, /* -p */
+	FILEUTILS_DEREFERENCE     = 1 << 1, /* !-d */
+	FILEUTILS_RECUR           = 1 << 2, /* -R */
+	FILEUTILS_FORCE           = 1 << 3, /* -f */
+	FILEUTILS_INTERACTIVE     = 1 << 4, /* -i */
+	FILEUTILS_MAKE_HARDLINK   = 1 << 5, /* -l */
+	FILEUTILS_MAKE_SOFTLINK   = 1 << 6, /* -s */
+	FILEUTILS_DEREF_SOFTLINK  = 1 << 7, /* -L */
+	FILEUTILS_DEREFERENCE_L0  = 1 << 8, /* -H */
+	/* -a = -pdR (mapped in cp.c) */
+	/* -r = -dR  (mapped in cp.c) */
+	/* -P = -d   (mapped in cp.c) */
+	FILEUTILS_VERBOSE         = (1 << 12) * ENABLE_FEATURE_VERBOSE,	/* -v */
+	FILEUTILS_UPDATE          = 1 << 13, /* -u */
+#if ENABLE_SELINUX
+	FILEUTILS_PRESERVE_SECURITY_CONTEXT = 1 << 14, /* -c */
+#endif
+	FILEUTILS_RMDEST          = 1 << (15 - !ENABLE_SELINUX), /* --remove-destination */
+	/*
+	 * Hole. cp may have some bits set here,
+	 * they should not affect remove_file()/copy_file()
+	 */
+#if ENABLE_SELINUX
+	FILEUTILS_SET_SECURITY_CONTEXT = 1 << 30,
+#endif
+	FILEUTILS_IGNORE_CHMOD_ERR = 1 << 31,
+};
+#define FILEUTILS_CP_OPTSTR "pdRfilsLHarPvu" IF_SELINUX("c")
+extern int remove_file(const char *path, int flags) FAST_FUNC;
+/* NB: without FILEUTILS_RECUR in flags, it will basically "cat"
+ * the source, not copy (unless "source" is a directory).
+ * This makes "cp /dev/null file" and "install /dev/null file" (!!!)
+ * work coreutils-compatibly. */
+extern int copy_file(const char *source, const char *dest, int flags) FAST_FUNC;
+
+enum {
+	ACTION_RECURSE        = (1 << 0),
+	ACTION_FOLLOWLINKS    = (1 << 1),
+	ACTION_FOLLOWLINKS_L0 = (1 << 2),
+	ACTION_DEPTHFIRST     = (1 << 3),
+	/*ACTION_REVERSE      = (1 << 4), - unused */
+	ACTION_QUIET          = (1 << 5),
+	ACTION_DANGLING_OK    = (1 << 6),
+};
+typedef uint8_t recurse_flags_t;
+extern int recursive_action(const char *fileName, unsigned flags,
+	int FAST_FUNC (*fileAction)(const char *fileName, struct stat* statbuf, void* userData, int depth),
+	int FAST_FUNC (*dirAction)(const char *fileName, struct stat* statbuf, void* userData, int depth),
+	void* userData, unsigned depth) FAST_FUNC;
+extern int device_open(const char *device, int mode) FAST_FUNC;
+enum { GETPTY_BUFSIZE = 16 }; /* more than enough for "/dev/ttyXXX" */
+extern int xgetpty(char *line) FAST_FUNC;
+extern int get_console_fd_or_die(void) FAST_FUNC;
+extern void console_make_active(int fd, const int vt_num) FAST_FUNC;
+extern char *find_block_device(const char *path) FAST_FUNC;
+/* bb_copyfd_XX print read/write errors and return -1 if they occur */
+extern off_t bb_copyfd_eof(int fd1, int fd2) FAST_FUNC;
+extern off_t bb_copyfd_size(int fd1, int fd2, off_t size) FAST_FUNC;
+extern void bb_copyfd_exact_size(int fd1, int fd2, off_t size) FAST_FUNC;
+/* "short" copy can be detected by return value < size */
+/* this helper yells "short read!" if param is not -1 */
+extern void complain_copyfd_and_die(off_t sz) NORETURN FAST_FUNC;
+
+extern char bb_process_escape_sequence(const char **ptr) FAST_FUNC;
+char* strcpy_and_process_escape_sequences(char *dst, const char *src) FAST_FUNC;
+/* xxxx_strip version can modify its parameter:
+ * "/"        -> "/"
+ * "abc"      -> "abc"
+ * "abc/def"  -> "def"
+ * "abc/def/" -> "def" !!
+ */
+char *bb_get_last_path_component_strip(char *path) FAST_FUNC;
+/* "abc/def/" -> "" and it never modifies 'path' */
+char *bb_get_last_path_component_nostrip(const char *path) FAST_FUNC;
+/* Simpler version: does not special case "/" string */
+const char *bb_basename(const char *name) FAST_FUNC;
+/* NB: can violate const-ness (similarly to strchr) */
+char *last_char_is(const char *s, int c) FAST_FUNC;
+const char* endofname(const char *name) FAST_FUNC;
+char *is_prefixed_with(const char *string, const char *key) FAST_FUNC;
+char *is_suffixed_with(const char *string, const char *key) FAST_FUNC;
+
+int ndelay_on(int fd) FAST_FUNC;
+int ndelay_off(int fd) FAST_FUNC;
+void close_on_exec_on(int fd) FAST_FUNC;
+void xdup2(int, int) FAST_FUNC;
+void xmove_fd(int, int) FAST_FUNC;
+
+
+DIR *xopendir(const char *path) FAST_FUNC;
+DIR *warn_opendir(const char *path) FAST_FUNC;
+
+char *xmalloc_realpath(const char *path) FAST_FUNC RETURNS_MALLOC;
+char *xmalloc_readlink(const char *path) FAST_FUNC RETURNS_MALLOC;
+char *xmalloc_readlink_or_warn(const char *path) FAST_FUNC RETURNS_MALLOC;
+/* !RETURNS_MALLOC: it's a realloc-like function */
+char *xrealloc_getcwd_or_warn(char *cwd) FAST_FUNC;
+
+char *xmalloc_follow_symlinks(const char *path) FAST_FUNC RETURNS_MALLOC;
+
+
+enum {
+	/* bb_signals(BB_FATAL_SIGS, handler) catches all signals which
+	 * otherwise would kill us, except for those resulting from bugs:
+	 * SIGSEGV, SIGILL, SIGFPE.
+	 * Other fatal signals not included (TODO?):
+	 * SIGBUS   Bus error (bad memory access)
+	 * SIGPOLL  Pollable event. Synonym of SIGIO
+	 * SIGPROF  Profiling timer expired
+	 * SIGSYS   Bad argument to routine
+	 * SIGTRAP  Trace/breakpoint trap
+	 *
+	 * The only known arch with some of these sigs not fitting
+	 * into 32 bits is parisc (SIGXCPU=33, SIGXFSZ=34, SIGSTKFLT=36).
+	 * Dance around with long long to guard against that...
+	 */
+	BB_FATAL_SIGS = (int)(0
+		+ (1LL << SIGHUP)
+		+ (1LL << SIGINT)
+		+ (1LL << SIGTERM)
+		+ (1LL << SIGPIPE)   // Write to pipe with no readers
+		+ (1LL << SIGQUIT)   // Quit from keyboard
+		+ (1LL << SIGABRT)   // Abort signal from abort(3)
+		+ (1LL << SIGALRM)   // Timer signal from alarm(2)
+		+ (1LL << SIGVTALRM) // Virtual alarm clock
+		+ (1LL << SIGXCPU)   // CPU time limit exceeded
+		+ (1LL << SIGXFSZ)   // File size limit exceeded
+		+ (1LL << SIGUSR1)   // Yes kids, these are also fatal!
+		+ (1LL << SIGUSR2)
+		+ 0),
+};
+void bb_signals(int sigs, void (*f)(int)) FAST_FUNC;
+/* Unlike signal() and bb_signals, sets handler with sigaction()
+ * and in a way that while signal handler is run, no other signals
+ * will be blocked; syscalls will not be restarted: */
+void bb_signals_recursive_norestart(int sigs, void (*f)(int)) FAST_FUNC;
+/* syscalls like read() will be interrupted with EINTR: */
+void signal_no_SA_RESTART_empty_mask(int sig, void (*handler)(int)) FAST_FUNC;
+/* syscalls like read() won't be interrupted (though select/poll will be): */
+void signal_SA_RESTART_empty_mask(int sig, void (*handler)(int)) FAST_FUNC;
+void wait_for_any_sig(void) FAST_FUNC;
+void kill_myself_with_sig(int sig) NORETURN FAST_FUNC;
+void sig_block(int sig) FAST_FUNC;
+void sig_unblock(int sig) FAST_FUNC;
+/* Will do sigaction(signum, act, NULL): */
+int sigaction_set(int sig, const struct sigaction *act) FAST_FUNC;
+/* SIG_BLOCK/SIG_UNBLOCK all signals: */
+int sigprocmask_allsigs(int how) FAST_FUNC;
+/* Standard handler which just records signo */
+extern smallint bb_got_signal;
+void record_signo(int signo); /* not FAST_FUNC! */
+
+
+void xsetgid(gid_t gid) FAST_FUNC;
+void xsetuid(uid_t uid) FAST_FUNC;
+void xsetegid(gid_t egid) FAST_FUNC;
+void xseteuid(uid_t euid) FAST_FUNC;
+void xchdir(const char *path) FAST_FUNC;
+void xfchdir(int fd) FAST_FUNC;
+void xchroot(const char *path) FAST_FUNC;
+void xsetenv(const char *key, const char *value) FAST_FUNC;
+void bb_unsetenv(const char *key) FAST_FUNC;
+void bb_unsetenv_and_free(char *key) FAST_FUNC;
+void xunlink(const char *pathname) FAST_FUNC;
+void xstat(const char *pathname, struct stat *buf) FAST_FUNC;
+void xfstat(int fd, struct stat *buf, const char *errmsg) FAST_FUNC;
+int open3_or_warn(const char *pathname, int flags, int mode) FAST_FUNC;
+int open_or_warn(const char *pathname, int flags) FAST_FUNC;
+int xopen3(const char *pathname, int flags, int mode) FAST_FUNC;
+int xopen(const char *pathname, int flags) FAST_FUNC;
+int xopen_nonblocking(const char *pathname) FAST_FUNC;
+int xopen_as_uid_gid(const char *pathname, int flags, uid_t u, gid_t g) FAST_FUNC;
+int open_or_warn_stdin(const char *pathname) FAST_FUNC;
+int xopen_stdin(const char *pathname) FAST_FUNC;
+void xrename(const char *oldpath, const char *newpath) FAST_FUNC;
+int rename_or_warn(const char *oldpath, const char *newpath) FAST_FUNC;
+off_t xlseek(int fd, off_t offset, int whence) FAST_FUNC;
+int xmkstemp(char *template) FAST_FUNC;
+off_t fdlength(int fd) FAST_FUNC;
+
+uoff_t FAST_FUNC get_volume_size_in_bytes(int fd,
+		const char *override,
+		unsigned override_units,
+		int extend);
+
+void xpipe(int filedes[2]) FAST_FUNC;
+/* In this form code with pipes is much more readable */
+struct fd_pair { int rd; int wr; };
+#define piped_pair(pair)  pipe(&((pair).rd))
+#define xpiped_pair(pair) xpipe(&((pair).rd))
+
+/* Useful for having small structure members/global variables */
+typedef int8_t socktype_t;
+typedef int8_t family_t;
+struct BUG_too_small {
+	char BUG_socktype_t_too_small[(0
+			| SOCK_STREAM
+			| SOCK_DGRAM
+			| SOCK_RDM
+			| SOCK_SEQPACKET
+			| SOCK_RAW
+			) <= 127 ? 1 : -1];
+	char BUG_family_t_too_small[(0
+			| AF_UNSPEC
+			| AF_INET
+			| AF_INET6
+			| AF_UNIX
+#ifdef AF_PACKET
+			| AF_PACKET
+#endif
+#ifdef AF_NETLINK
+			| AF_NETLINK
+#endif
+			/* | AF_DECnet */
+			/* | AF_IPX */
+			) <= 127 ? 1 : -1];
+};
+
+
+void parse_datestr(const char *date_str, struct tm *ptm) FAST_FUNC;
+time_t validate_tm_time(const char *date_str, struct tm *ptm) FAST_FUNC;
+char *strftime_HHMMSS(char *buf, unsigned len, time_t *tp) FAST_FUNC;
+char *strftime_YYYYMMDDHHMMSS(char *buf, unsigned len, time_t *tp) FAST_FUNC;
+
+int xsocket(int domain, int type, int protocol) FAST_FUNC;
+void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen) FAST_FUNC;
+void xlisten(int s, int backlog) FAST_FUNC;
+void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen) FAST_FUNC;
+ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to,
+				socklen_t tolen) FAST_FUNC;
+
+int setsockopt_int(int fd, int level, int optname, int optval) FAST_FUNC;
+int setsockopt_1(int fd, int level, int optname) FAST_FUNC;
+int setsockopt_SOL_SOCKET_int(int fd, int optname, int optval) FAST_FUNC;
+int setsockopt_SOL_SOCKET_1(int fd, int optname) FAST_FUNC;
+/* SO_REUSEADDR allows a server to rebind to an address that is already
+ * "in use" by old connections to e.g. previous server instance which is
+ * killed or crashed. Without it bind will fail until all such connections
+ * time out. Linux does not allow multiple live binds on same ip:port
+ * regardless of SO_REUSEADDR (unlike some other flavors of Unix).
+ * Turn it on before you call bind(). */
+void setsockopt_reuseaddr(int fd) FAST_FUNC; /* On Linux this never fails. */
+int setsockopt_keepalive(int fd) FAST_FUNC;
+int setsockopt_broadcast(int fd) FAST_FUNC;
+int setsockopt_bindtodevice(int fd, const char *iface) FAST_FUNC;
+/* NB: returns port in host byte order */
+unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default_port) FAST_FUNC;
+typedef struct len_and_sockaddr {
+	socklen_t len;
+	union {
+		struct sockaddr sa;
+		struct sockaddr_in sin;
+#if ENABLE_FEATURE_IPV6
+		struct sockaddr_in6 sin6;
+#endif
+	} u;
+} len_and_sockaddr;
+enum {
+	LSA_LEN_SIZE = offsetof(len_and_sockaddr, u),
+	LSA_SIZEOF_SA = sizeof(
+		union {
+			struct sockaddr sa;
+			struct sockaddr_in sin;
+#if ENABLE_FEATURE_IPV6
+			struct sockaddr_in6 sin6;
+#endif
+		}
+	)
+};
+/* Create stream socket, and allocate suitable lsa.
+ * (lsa of correct size and lsa->sa.sa_family (AF_INET/AF_INET6))
+ * af == AF_UNSPEC will result in trying to create IPv6 socket,
+ * and if kernel doesn't support it, fall back to IPv4.
+ * This is useful if you plan to bind to resulting local lsa.
+ */
+int xsocket_type(len_and_sockaddr **lsap, int af, int sock_type) FAST_FUNC;
+int xsocket_stream(len_and_sockaddr **lsap) FAST_FUNC;
+/* Create server socket bound to bindaddr:port. bindaddr can be NULL,
+ * numeric IP ("N.N.N.N") or numeric IPv6 address,
+ * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT").
+ * Only if there is no suffix, port argument is used */
+/* NB: these set SO_REUSEADDR before bind */
+int create_and_bind_stream_or_die(const char *bindaddr, int port) FAST_FUNC;
+int create_and_bind_dgram_or_die(const char *bindaddr, int port) FAST_FUNC;
+/* Create client TCP socket connected to peer:port. Peer cannot be NULL.
+ * Peer can be numeric IP ("N.N.N.N"), numeric IPv6 address or hostname,
+ * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT").
+ * If there is no suffix, port argument is used */
+int create_and_connect_stream_or_die(const char *peer, int port) FAST_FUNC;
+/* Connect to peer identified by lsa */
+int xconnect_stream(const len_and_sockaddr *lsa) FAST_FUNC;
+/* Get local address of bound or accepted socket */
+len_and_sockaddr *get_sock_lsa(int fd) FAST_FUNC RETURNS_MALLOC;
+/* Get remote address of connected or accepted socket */
+len_and_sockaddr *get_peer_lsa(int fd) FAST_FUNC RETURNS_MALLOC;
+/* Return malloc'ed len_and_sockaddr with socket address of host:port
+ * Currently will return IPv4 or IPv6 sockaddrs only
+ * (depending on host), but in theory nothing prevents e.g.
+ * UNIX socket address being returned, IPX sockaddr etc...
+ * On error does bb_error_msg and returns NULL */
+len_and_sockaddr* host2sockaddr(const char *host, int port) FAST_FUNC RETURNS_MALLOC;
+/* Version which dies on error */
+len_and_sockaddr* xhost2sockaddr(const char *host, int port) FAST_FUNC RETURNS_MALLOC;
+len_and_sockaddr* xdotted2sockaddr(const char *host, int port) FAST_FUNC RETURNS_MALLOC;
+/* Same, useful if you want to force family (e.g. IPv6) */
+#if !ENABLE_FEATURE_IPV6
+#define host_and_af2sockaddr(host, port, af) host2sockaddr((host), (port))
+#define xhost_and_af2sockaddr(host, port, af) xhost2sockaddr((host), (port))
+#else
+len_and_sockaddr* host_and_af2sockaddr(const char *host, int port, sa_family_t af) FAST_FUNC RETURNS_MALLOC;
+len_and_sockaddr* xhost_and_af2sockaddr(const char *host, int port, sa_family_t af) FAST_FUNC RETURNS_MALLOC;
+#endif
+/* Assign sin[6]_port member if the socket is an AF_INET[6] one,
+ * otherwise no-op. Useful for ftp.
+ * NB: does NOT do htons() internally, just direct assignment. */
+void set_nport(struct sockaddr *sa, unsigned port) FAST_FUNC;
+/* Retrieve sin[6]_port or return -1 for non-INET[6] lsa's */
+int get_nport(const struct sockaddr *sa) FAST_FUNC;
+/* Reverse DNS. Returns NULL on failure. */
+char* xmalloc_sockaddr2host(const struct sockaddr *sa) FAST_FUNC RETURNS_MALLOC;
+/* This one doesn't append :PORTNUM */
+char* xmalloc_sockaddr2host_noport(const struct sockaddr *sa) FAST_FUNC RETURNS_MALLOC;
+/* This one also doesn't fall back to dotted IP (returns NULL) */
+char* xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa) FAST_FUNC RETURNS_MALLOC;
+/* inet_[ap]ton on steroids */
+char* xmalloc_sockaddr2dotted(const struct sockaddr *sa) FAST_FUNC RETURNS_MALLOC;
+char* xmalloc_sockaddr2dotted_noport(const struct sockaddr *sa) FAST_FUNC RETURNS_MALLOC;
+// "old" (ipv4 only) API
+// users: traceroute.c hostname.c - use _list_ of all IPs
+struct hostent *xgethostbyname(const char *name) FAST_FUNC;
+// Also mount.c and inetd.c are using gethostbyname(),
+// + inet_common.c has additional IPv4-only stuff
+
+
+void socket_want_pktinfo(int fd) FAST_FUNC;
+ssize_t send_to_from(int fd, void *buf, size_t len, int flags,
+		const struct sockaddr *to,
+		const struct sockaddr *from,
+		socklen_t tolen) FAST_FUNC;
+ssize_t recv_from_to(int fd, void *buf, size_t len, int flags,
+		struct sockaddr *from,
+		struct sockaddr *to,
+		socklen_t sa_size) FAST_FUNC;
+
+uint16_t inet_cksum(uint16_t *addr, int len) FAST_FUNC;
+
+char *xstrdup(const char *s) FAST_FUNC RETURNS_MALLOC;
+char *xstrndup(const char *s, int n) FAST_FUNC RETURNS_MALLOC;
+void *xmemdup(const void *s, int n) FAST_FUNC RETURNS_MALLOC;
+void overlapping_strcpy(char *dst, const char *src) FAST_FUNC;
+char *safe_strncpy(char *dst, const char *src, size_t size) FAST_FUNC;
+char *strncpy_IFNAMSIZ(char *dst, const char *src) FAST_FUNC;
+unsigned count_strstr(const char *str, const char *sub) FAST_FUNC;
+char *xmalloc_substitute_string(const char *src, int count, const char *sub, const char *repl) FAST_FUNC;
+/* Guaranteed to NOT be a macro (smallest code). Saves nearly 2k on uclibc.
+ * But potentially slow, don't use in one-billion-times loops */
+int bb_putchar(int ch) FAST_FUNC;
+/* Note: does not use stdio, writes to fd 2 directly */
+int bb_putchar_stderr(char ch) FAST_FUNC;
+char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC;
+char *auto_string(char *str) FAST_FUNC;
+// gcc-4.1.1 still isn't good enough at optimizing it
+// (+200 bytes compared to macro)
+//static ALWAYS_INLINE
+//int LONE_DASH(const char *s) { return s[0] == '-' && !s[1]; }
+//static ALWAYS_INLINE
+//int NOT_LONE_DASH(const char *s) { return s[0] != '-' || s[1]; }
+#define LONE_DASH(s)     ((s)[0] == '-' && !(s)[1])
+#define NOT_LONE_DASH(s) ((s)[0] != '-' || (s)[1])
+#define LONE_CHAR(s,c)     ((s)[0] == (c) && !(s)[1])
+#define NOT_LONE_CHAR(s,c) ((s)[0] != (c) || (s)[1])
+#define DOT_OR_DOTDOT(s) ((s)[0] == '.' && (!(s)[1] || ((s)[1] == '.' && !(s)[2])))
+
+typedef struct uni_stat_t {
+	unsigned byte_count;
+	unsigned unicode_count;
+	unsigned unicode_width;
+} uni_stat_t;
+/* Returns a string with unprintable chars replaced by '?' or
+ * SUBST_WCHAR. This function is unicode-aware. */
+const char* FAST_FUNC printable_string(uni_stat_t *stats, const char *str);
+/* Prints unprintable char ch as ^C or M-c to file
+ * (M-c is used only if ch is ORed with PRINTABLE_META),
+ * else it is printed as-is (except for ch = 0x9b) */
+enum { PRINTABLE_META = 0x100 };
+void fputc_printable(int ch, FILE *file) FAST_FUNC;
+/* Return a string that is the printable representation of character ch.
+ * Buffer must hold at least four characters. */
+enum {
+	VISIBLE_ENDLINE   = 1 << 0,
+	VISIBLE_SHOW_TABS = 1 << 1,
+};
+void visible(unsigned ch, char *buf, int flags) FAST_FUNC;
+
+/* dmalloc will redefine these to it's own implementation. It is safe
+ * to have the prototypes here unconditionally.  */
+void *malloc_or_warn(size_t size) FAST_FUNC RETURNS_MALLOC;
+void *xmalloc(size_t size) FAST_FUNC RETURNS_MALLOC;
+void *xzalloc(size_t size) FAST_FUNC RETURNS_MALLOC;
+void *xrealloc(void *old, size_t size) FAST_FUNC;
+/* After v = xrealloc_vector(v, SHIFT, idx) it's ok to use
+ * at least v[idx] and v[idx+1], for all idx values.
+ * SHIFT specifies how many new elements are added (1:2, 2:4, ..., 8:256...)
+ * when all elements are used up. New elements are zeroed out.
+ * xrealloc_vector(v, SHIFT, idx) *MUST* be called with consecutive IDXs -
+ * skipping an index is a bad bug - it may miss a realloc!
+ */
+#define xrealloc_vector(vector, shift, idx) \
+	xrealloc_vector_helper((vector), (sizeof((vector)[0]) << 8) + (shift), (idx))
+void* xrealloc_vector_helper(void *vector, unsigned sizeof_and_shift, int idx) FAST_FUNC;
+
+
+extern ssize_t safe_read(int fd, void *buf, size_t count) FAST_FUNC;
+extern ssize_t nonblock_immune_read(int fd, void *buf, size_t count) FAST_FUNC;
+// NB: will return short read on error, not -1,
+// if some data was read before error occurred
+extern ssize_t full_read(int fd, void *buf, size_t count) FAST_FUNC;
+extern void xread(int fd, void *buf, size_t count) FAST_FUNC;
+extern unsigned char xread_char(int fd) FAST_FUNC;
+extern ssize_t read_close(int fd, void *buf, size_t maxsz) FAST_FUNC;
+extern ssize_t open_read_close(const char *filename, void *buf, size_t maxsz) FAST_FUNC;
+// Reads one line a-la fgets (but doesn't save terminating '\n').
+// Reads byte-by-byte. Useful when it is important to not read ahead.
+// Bytes are appended to pfx (which must be malloced, or NULL).
+extern char *xmalloc_reads(int fd, size_t *maxsz_p) FAST_FUNC;
+/* Reads block up to *maxsz_p (default: INT_MAX - 4095) */
+extern void *xmalloc_read(int fd, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
+/* Returns NULL if file can't be opened (default max size: INT_MAX - 4095) */
+extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
+/* Never returns NULL */
+extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
+
+#if defined(ARG_MAX) && (ARG_MAX >= 60*1024 || !defined(_SC_ARG_MAX))
+/* Use _constant_ maximum if: defined && (big enough || no variable one exists) */
+# define bb_arg_max() ((unsigned)ARG_MAX)
+#elif defined(_SC_ARG_MAX)
+/* Else use variable one (a bit more expensive) */
+unsigned bb_arg_max(void) FAST_FUNC;
+#else
+/* If all else fails */
+# define bb_arg_max() ((unsigned)(32 * 1024))
+#endif
+unsigned bb_clk_tck(void) FAST_FUNC;
+
+#define SEAMLESS_COMPRESSION (0 \
+ || ENABLE_FEATURE_SEAMLESS_XZ \
+ || ENABLE_FEATURE_SEAMLESS_LZMA \
+ || ENABLE_FEATURE_SEAMLESS_BZ2 \
+ || ENABLE_FEATURE_SEAMLESS_GZ \
+ || ENABLE_FEATURE_SEAMLESS_Z)
+
+#if SEAMLESS_COMPRESSION
+/* Autodetects gzip/bzip2 formats. fd may be in the middle of the file! */
+extern int setup_unzip_on_fd(int fd, int fail_if_not_compressed) FAST_FUNC;
+/* Autodetects .gz etc */
+extern int open_zipped(const char *fname, int fail_if_not_compressed) FAST_FUNC;
+extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
+#else
+# define setup_unzip_on_fd(...) (0)
+# define open_zipped(fname, fail_if_not_compressed)  open((fname), O_RDONLY);
+# define xmalloc_open_zipped_read_close(fname, maxsz_p) xmalloc_open_read_close((fname), (maxsz_p))
+#endif
+
+extern ssize_t safe_write(int fd, const void *buf, size_t count) FAST_FUNC;
+// NB: will return short write on error, not -1,
+// if some data was written before error occurred
+extern ssize_t full_write(int fd, const void *buf, size_t count) FAST_FUNC;
+extern void xwrite(int fd, const void *buf, size_t count) FAST_FUNC;
+extern void xwrite_str(int fd, const char *str) FAST_FUNC;
+extern ssize_t full_write1_str(const char *str) FAST_FUNC;
+extern ssize_t full_write2_str(const char *str) FAST_FUNC;
+extern void xopen_xwrite_close(const char* file, const char *str) FAST_FUNC;
+
+/* Close fd, but check for failures (some types of write errors) */
+extern void xclose(int fd) FAST_FUNC;
+
+/* Reads and prints to stdout till eof, then closes FILE. Exits on error: */
+extern void xprint_and_close_file(FILE *file) FAST_FUNC;
+
+/* Reads a line from a text file, up to a newline or NUL byte, inclusive.
+ * Returns malloc'ed char*. If end is NULL '\n' isn't considered
+ * end of line. If end isn't NULL, length of the chunk is stored in it.
+ * Returns NULL if EOF/error.
+ */
+extern char *bb_get_chunk_from_file(FILE *file, int *end) FAST_FUNC;
+/* Reads up to (and including) TERMINATING_STRING: */
+extern char *xmalloc_fgets_str(FILE *file, const char *terminating_string) FAST_FUNC RETURNS_MALLOC;
+/* Same, with limited max size, and returns the length (excluding NUL): */
+extern char *xmalloc_fgets_str_len(FILE *file, const char *terminating_string, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
+/* Chops off TERMINATING_STRING from the end: */
+extern char *xmalloc_fgetline_str(FILE *file, const char *terminating_string) FAST_FUNC RETURNS_MALLOC;
+/* Reads up to (and including) "\n" or NUL byte: */
+extern char *xmalloc_fgets(FILE *file) FAST_FUNC RETURNS_MALLOC;
+/* Chops off '\n' from the end, unlike fgets: */
+extern char *xmalloc_fgetline(FILE *file) FAST_FUNC RETURNS_MALLOC;
+/* Same, but doesn't try to conserve space (may have some slack after the end) */
+/* extern char *xmalloc_fgetline_fast(FILE *file) FAST_FUNC RETURNS_MALLOC; */
+
+void die_if_ferror(FILE *file, const char *msg) FAST_FUNC;
+void die_if_ferror_stdout(void) FAST_FUNC;
+int fflush_all(void) FAST_FUNC;
+void fflush_stdout_and_exit(int retval) NORETURN FAST_FUNC;
+int fclose_if_not_stdin(FILE *file) FAST_FUNC;
+FILE* xfopen(const char *filename, const char *mode) FAST_FUNC;
+/* Prints warning to stderr and returns NULL on failure: */
+FILE* fopen_or_warn(const char *filename, const char *mode) FAST_FUNC;
+/* "Opens" stdin if filename is special, else just opens file: */
+FILE* xfopen_stdin(const char *filename) FAST_FUNC;
+FILE* fopen_or_warn_stdin(const char *filename) FAST_FUNC;
+FILE* fopen_for_read(const char *path) FAST_FUNC;
+FILE* xfopen_for_read(const char *path) FAST_FUNC;
+FILE* fopen_for_write(const char *path) FAST_FUNC;
+FILE* xfopen_for_write(const char *path) FAST_FUNC;
+FILE* xfdopen_for_read(int fd) FAST_FUNC;
+FILE* xfdopen_for_write(int fd) FAST_FUNC;
+
+int bb_pstrcmp(const void *a, const void *b) /* not FAST_FUNC! */;
+void qsort_string_vector(char **sv, unsigned count) FAST_FUNC;
+
+/* Wrapper which restarts poll on EINTR or ENOMEM.
+ * On other errors complains [perror("poll")] and returns.
+ * Warning! May take (much) longer than timeout_ms to return!
+ * If this is a problem, use bare poll and open-code EINTR/ENOMEM handling */
+int safe_poll(struct pollfd *ufds, nfds_t nfds, int timeout_ms) FAST_FUNC;
+
+char *safe_gethostname(void) FAST_FUNC;
+
+/* Convert each alpha char in str to lower-case */
+char* str_tolower(char *str) FAST_FUNC;
+
+char *bb_utoa(unsigned n) FAST_FUNC;
+char *bb_itoa(int n) FAST_FUNC;
+/* Returns a pointer past the formatted number, does NOT null-terminate */
+char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC;
+char *itoa_to_buf(int n, char *buf, unsigned buflen) FAST_FUNC;
+/* Intelligent formatters of bignums */
+char *smart_ulltoa4(unsigned long long ul, char buf[4], const char *scale) FAST_FUNC;
+char *smart_ulltoa5(unsigned long long ul, char buf[5], const char *scale) FAST_FUNC;
+/* If block_size == 0, display size without fractional part,
+ * else display (size * block_size) with one decimal digit.
+ * If display_unit == 0, show value no bigger than 1024 with suffix (K,M,G...),
+ * else divide by display_unit and do not use suffix. */
+#define HUMAN_READABLE_MAX_WIDTH      7  /* "1024.0G" */
+#define HUMAN_READABLE_MAX_WIDTH_STR "7"
+//TODO: provide pointer to buf (avoid statics)?
+const char *make_human_readable_str(unsigned long long size,
+		unsigned long block_size, unsigned long display_unit) FAST_FUNC;
+/* Put a string of hex bytes ("1b2e66fe"...), return advanced pointer */
+char *bin2hex(char *dst, const char *src, int count) FAST_FUNC;
+/* Reverse */
+char* hex2bin(char *dst, const char *src, int count) FAST_FUNC;
+
+/* Generate a UUID */
+void generate_uuid(uint8_t *buf) FAST_FUNC;
+
+/* Last element is marked by mult == 0 */
+struct suffix_mult {
+	char suffix[4];
+	unsigned mult;
+};
+extern const struct suffix_mult bkm_suffixes[];
+#define km_suffixes (bkm_suffixes + 1)
+extern const struct suffix_mult cwbkMG_suffixes[];
+#define kMG_suffixes (cwbkMG_suffixes + 3)
+extern const struct suffix_mult kmg_i_suffixes[];
+
+/*#include "xatonum.h"*/
+long FAST_FUNC bb_strtol(const char *arg, char **endp, int base);
+/* Specialized: */
+
+/* Using xatoi() instead of naive atoi() is not always convenient -
+ * in many places people want *non-negative* values, but store them
+ * in signed int. Therefore we need this one:
+ * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc.
+ * It should really be named xatoi_nonnegative (since it allows 0),
+ * but that would be too long.
+ */
+int xatoi_positive(const char *numstr) FAST_FUNC;
+
+/* Useful for reading port numbers */
+uint16_t xatou16(const char *numstr) FAST_FUNC;
+
+
+/* These parse entries in /etc/passwd and /etc/group.  This is desirable
+ * for BusyBox since we want to avoid using the glibc NSS stuff, which
+ * increases target size and is often not needed on embedded systems.  */
+long xuname2uid(const char *name) FAST_FUNC;
+long xgroup2gid(const char *name) FAST_FUNC;
+/* wrapper: allows string to contain numeric uid or gid */
+unsigned long get_ug_id(const char *s, long FAST_FUNC (*xname2id)(const char *)) FAST_FUNC;
+struct bb_uidgid_t {
+	uid_t uid;
+	gid_t gid;
+};
+/* always sets uid and gid; returns 0 on failure */
+int get_uidgid(struct bb_uidgid_t*, const char*) FAST_FUNC;
+/* always sets uid and gid; exits on failure */
+void xget_uidgid(struct bb_uidgid_t*, const char*) FAST_FUNC;
+/* chown-like handling of "user[:[group]" */
+void parse_chown_usergroup_or_die(struct bb_uidgid_t *u, char *user_group) FAST_FUNC;
+struct passwd* xgetpwnam(const char *name) FAST_FUNC;
+struct group* xgetgrnam(const char *name) FAST_FUNC;
+struct passwd* xgetpwuid(uid_t uid) FAST_FUNC;
+struct group* xgetgrgid(gid_t gid) FAST_FUNC;
+char* xuid2uname(uid_t uid) FAST_FUNC;
+char* xgid2group(gid_t gid) FAST_FUNC;
+char* uid2uname(uid_t uid) FAST_FUNC;
+char* gid2group(gid_t gid) FAST_FUNC;
+char* uid2uname_utoa(uid_t uid) FAST_FUNC;
+char* gid2group_utoa(gid_t gid) FAST_FUNC;
+/* versions which cache results (useful for ps, ls etc) */
+const char* get_cached_username(uid_t uid) FAST_FUNC;
+const char* get_cached_groupname(gid_t gid) FAST_FUNC;
+void clear_username_cache(void) FAST_FUNC;
+/* internally usernames are saved in fixed-sized char[] buffers */
+enum { USERNAME_MAX_SIZE = 32 - sizeof(uid_t) };
+#if ENABLE_FEATURE_CHECK_NAMES
+void die_if_bad_username(const char* name) FAST_FUNC;
+#else
+#define die_if_bad_username(name) ((void)(name))
+#endif
+
+#if ENABLE_FEATURE_UTMP
+void FAST_FUNC write_new_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname);
+void FAST_FUNC update_utmp(pid_t pid, int new_type, const char *tty_name, const char *username, const char *hostname);
+void FAST_FUNC update_utmp_DEAD_PROCESS(pid_t pid);
+#else
+# define write_new_utmp(pid, new_type, tty_name, username, hostname) ((void)0)
+# define update_utmp(pid, new_type, tty_name, username, hostname) ((void)0)
+# define update_utmp_DEAD_PROCESS(pid) ((void)0)
+#endif
+
+
+int file_is_executable(const char *name) FAST_FUNC;
+char *find_executable(const char *filename, char **PATHp) FAST_FUNC;
+int executable_exists(const char *filename) FAST_FUNC;
+
+/* BB_EXECxx always execs (it's not doing NOFORK/NOEXEC stuff),
+ * but it may exec busybox and call applet instead of searching PATH.
+ */
+#if ENABLE_FEATURE_PREFER_APPLETS
+int BB_EXECVP(const char *file, char *const argv[]) FAST_FUNC;
+#define BB_EXECLP(prog,cmd,...) \
+	do { \
+		if (find_applet_by_name(prog) >= 0) \
+			execlp(bb_busybox_exec_path, cmd, __VA_ARGS__); \
+		execlp(prog, cmd, __VA_ARGS__); \
+	} while (0)
+#else
+#define BB_EXECVP(prog,cmd)     execvp(prog,cmd)
+#define BB_EXECLP(prog,cmd,...) execlp(prog,cmd,__VA_ARGS__)
+#endif
+void BB_EXECVP_or_die(char **argv) NORETURN FAST_FUNC;
+void exec_prog_or_SHELL(char **argv) NORETURN FAST_FUNC;
+
+/* xvfork() can't be a _function_, return after vfork in child mangles stack
+ * in the parent. It must be a macro. */
+#define xvfork() \
+({ \
+	pid_t bb__xvfork_pid = vfork(); \
+	if (bb__xvfork_pid < 0) \
+		bb_perror_msg_and_die("vfork"); \
+	bb__xvfork_pid; \
+})
+#if BB_MMU
+pid_t xfork(void) FAST_FUNC;
+#endif
+void xvfork_parent_waits_and_exits(void) FAST_FUNC;
+
+/* NOMMU friendy fork+exec: */
+pid_t spawn(char **argv) FAST_FUNC;
+pid_t xspawn(char **argv) FAST_FUNC;
+
+pid_t safe_waitpid(pid_t pid, int *wstat, int options) FAST_FUNC;
+pid_t wait_any_nohang(int *wstat) FAST_FUNC;
+/* wait4pid: unlike waitpid, waits ONLY for one process.
+ * Returns sig + 0x180 if child is killed by signal.
+ * It's safe to pass negative 'pids' from failed [v]fork -
+ * wait4pid will return -1 (and will not clobber [v]fork's errno).
+ * IOW: rc = wait4pid(spawn(argv));
+ *      if (rc < 0) bb_perror_msg("%s", argv[0]);
+ *      if (rc > 0) bb_error_msg("exit code: %d", rc & 0xff);
+ */
+int wait4pid(pid_t pid) FAST_FUNC;
+int wait_for_exitstatus(pid_t pid) FAST_FUNC;
+/* Same as wait4pid(spawn(argv)), but with NOFORK/NOEXEC if configured: */
+int spawn_and_wait(char **argv) FAST_FUNC;
+/* Does NOT check that applet is NOFORK, just blindly runs it */
+int run_nofork_applet(int applet_no, char **argv) FAST_FUNC;
+
+/* Helpers for daemonization.
+ *
+ * bb_daemonize(flags) = daemonize, does not compile on NOMMU
+ *
+ * bb_daemonize_or_rexec(flags, argv) = daemonizes on MMU (and ignores argv),
+ *      rexec's itself on NOMMU with argv passed as command line.
+ * Thus bb_daemonize_or_rexec may cause your <applet>_main() to be re-executed
+ * from the start. (It will detect it and not reexec again second time).
+ * You have to audit carefully that you don't do something twice as a result
+ * (opening files/sockets, parsing config files etc...)!
+ *
+ * Both of the above will redirect fd 0,1,2 to /dev/null and drop ctty
+ * (will do setsid()).
+ *
+ * fork_or_rexec(argv) = bare-bones fork on MMU,
+ *      "vfork + re-exec ourself" on NOMMU. No fd redirection, no setsid().
+ *      On MMU ignores argv.
+ *
+ * Helper for network daemons in foreground mode:
+ *
+ * bb_sanitize_stdio() = make sure that fd 0,1,2 are opened by opening them
+ * to /dev/null if they are not.
+ */
+enum {
+	DAEMON_CHDIR_ROOT = 1,
+	DAEMON_DEVNULL_STDIO = 2,
+	DAEMON_CLOSE_EXTRA_FDS = 4,
+	DAEMON_ONLY_SANITIZE = 8, /* internal use */
+	DAEMON_DOUBLE_FORK = 16, /* double fork to avoid controlling tty */
+};
+#if BB_MMU
+  enum { re_execed = 0 };
+# define fork_or_rexec(argv)                xfork()
+# define bb_daemonize_or_rexec(flags, argv) bb_daemonize_or_rexec(flags)
+# define bb_daemonize(flags)                bb_daemonize_or_rexec(flags, bogus)
+#else
+  extern bool re_execed;
+  /* Note: re_exec() and fork_or_rexec() do argv[0][0] |= 0x80 on NOMMU!
+   * _Parent_ needs to undo it if it doesn't want to have argv[0] mangled.
+   */
+  void re_exec(char **argv) NORETURN FAST_FUNC;
+  pid_t fork_or_rexec(char **argv) FAST_FUNC;
+  int  BUG_fork_is_unavailable_on_nommu(void) FAST_FUNC;
+  int  BUG_daemon_is_unavailable_on_nommu(void) FAST_FUNC;
+  void BUG_bb_daemonize_is_unavailable_on_nommu(void) FAST_FUNC;
+# define fork()          BUG_fork_is_unavailable_on_nommu()
+# define xfork()         BUG_fork_is_unavailable_on_nommu()
+# define daemon(a,b)     BUG_daemon_is_unavailable_on_nommu()
+# define bb_daemonize(a) BUG_bb_daemonize_is_unavailable_on_nommu()
+#endif
+void bb_daemonize_or_rexec(int flags, char **argv) FAST_FUNC;
+void bb_sanitize_stdio(void) FAST_FUNC;
+/* Clear dangerous stuff, set PATH. Return 1 if was run by different user. */
+int sanitize_env_if_suid(void) FAST_FUNC;
+
+
+char* single_argv(char **argv) FAST_FUNC;
+extern const char *const bb_argv_dash[]; /* "-", NULL */
+extern const char *opt_complementary;
+#if ENABLE_LONG_OPTS || ENABLE_FEATURE_GETOPT_LONG
+#define No_argument "\0"
+#define Required_argument "\001"
+#define Optional_argument "\002"
+extern const char *applet_long_options;
+#endif
+extern uint32_t option_mask32;
+extern uint32_t getopt32(char **argv, const char *applet_opts, ...) FAST_FUNC;
+
+
+/* Having next pointer as a first member allows easy creation
+ * of "llist-compatible" structs, and using llist_FOO functions
+ * on them.
+ */
+typedef struct llist_t {
+	struct llist_t *link;
+	char *data;
+} llist_t;
+void llist_add_to(llist_t **old_head, void *data) FAST_FUNC;
+void llist_add_to_end(llist_t **list_head, void *data) FAST_FUNC;
+void *llist_pop(llist_t **elm) FAST_FUNC;
+void llist_unlink(llist_t **head, llist_t *elm) FAST_FUNC;
+void llist_free(llist_t *elm, void (*freeit)(void *data)) FAST_FUNC;
+llist_t *llist_rev(llist_t *list) FAST_FUNC;
+llist_t *llist_find_str(llist_t *first, const char *str) FAST_FUNC;
+/* BTW, surprisingly, changing API to
+ *   llist_t *llist_add_to(llist_t *old_head, void *data)
+ * etc does not result in smaller code... */
+
+/* start_stop_daemon and udhcpc are special - they want
+ * to create pidfiles regardless of FEATURE_PIDFILE */
+#if ENABLE_FEATURE_PIDFILE || defined(WANT_PIDFILE)
+/* True only if we created pidfile which is *file*, not /dev/null etc */
+extern smallint wrote_pidfile;
+void write_pidfile(const char *path) FAST_FUNC;
+#define remove_pidfile(path) do { if (wrote_pidfile) unlink(path); } while (0)
+#else
+enum { wrote_pidfile = 0 };
+#define write_pidfile(path)  ((void)0)
+#define remove_pidfile(path) ((void)0)
+#endif
+
+enum {
+	LOGMODE_NONE = 0,
+	LOGMODE_STDIO = (1 << 0),
+	LOGMODE_SYSLOG = (1 << 1) * ENABLE_FEATURE_SYSLOG,
+	LOGMODE_BOTH = LOGMODE_SYSLOG + LOGMODE_STDIO,
+};
+extern const char *msg_eol;
+extern smallint syslog_level;
+extern smallint logmode;
+extern uint8_t xfunc_error_retval;
+extern void (*die_func)(void);
+extern void xfunc_die(void) NORETURN FAST_FUNC;
+extern void bb_show_usage(void) NORETURN FAST_FUNC;
+extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC;
+extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC;
+extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC;
+extern void bb_simple_perror_msg(const char *s) FAST_FUNC;
+extern void bb_perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC;
+extern void bb_simple_perror_msg_and_die(const char *s) NORETURN FAST_FUNC;
+extern void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC;
+extern void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC;
+extern void bb_perror_nomsg_and_die(void) NORETURN FAST_FUNC;
+extern void bb_perror_nomsg(void) FAST_FUNC;
+extern void bb_verror_msg(const char *s, va_list p, const char *strerr) FAST_FUNC;
+extern void bb_logenv_override(void) FAST_FUNC;
+
+/* We need to export XXX_main from libbusybox
+ * only if we build "individual" binaries
+ */
+#if ENABLE_FEATURE_INDIVIDUAL
+#define MAIN_EXTERNALLY_VISIBLE EXTERNALLY_VISIBLE
+#else
+#define MAIN_EXTERNALLY_VISIBLE
+#endif
+
+
+/* Applets which are useful from another applets */
+int bb_cat(char** argv);
+/* If shell needs them, they exist even if not enabled as applets */
+int echo_main(int argc, char** argv) IF_ECHO(MAIN_EXTERNALLY_VISIBLE);
+int printf_main(int argc, char **argv) IF_PRINTF(MAIN_EXTERNALLY_VISIBLE);
+int test_main(int argc, char **argv)
+#if ENABLE_TEST || ENABLE_TEST1 || ENABLE_TEST2
+		MAIN_EXTERNALLY_VISIBLE
+#endif
+;
+int kill_main(int argc, char **argv)
+#if ENABLE_KILL || ENABLE_KILLALL || ENABLE_KILLALL5
+		MAIN_EXTERNALLY_VISIBLE
+#endif
+;
+/* Similar, but used by chgrp, not shell */
+int chown_main(int argc, char **argv) IF_CHOWN(MAIN_EXTERNALLY_VISIBLE);
+/* Used by ftpd */
+int ls_main(int argc, char **argv) IF_LS(MAIN_EXTERNALLY_VISIBLE);
+/* Don't need IF_xxx() guard for these */
+int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+
+#if ENABLE_ROUTE
+void bb_displayroutes(int noresolve, int netstatfmt) FAST_FUNC;
+#endif
+
+
+/* Networking */
+/* This structure defines protocol families and their handlers. */
+struct aftype {
+	const char *name;
+	const char *title;
+	int af;
+	int alen;
+	char*       FAST_FUNC (*print)(unsigned char *);
+	const char* FAST_FUNC (*sprint)(struct sockaddr *, int numeric);
+	int         FAST_FUNC (*input)(/*int type,*/ const char *bufp, struct sockaddr *);
+	void        FAST_FUNC (*herror)(char *text);
+	int         FAST_FUNC (*rprint)(int options);
+	int         FAST_FUNC (*rinput)(int typ, int ext, char **argv);
+	/* may modify src */
+	int         FAST_FUNC (*getmask)(char *src, struct sockaddr *mask, char *name);
+};
+/* This structure defines hardware protocols and their handlers. */
+struct hwtype {
+	const char *name;
+	const char *title;
+	int type;
+	int alen;
+	char* FAST_FUNC (*print)(unsigned char *);
+	int   FAST_FUNC (*input)(const char *, struct sockaddr *);
+	int   FAST_FUNC (*activate)(int fd);
+	int suppress_null_addr;
+};
+extern smallint interface_opt_a;
+int display_interfaces(char *ifname) FAST_FUNC;
+int in_ether(const char *bufp, struct sockaddr *sap) FAST_FUNC;
+#if ENABLE_FEATURE_HWIB
+int in_ib(const char *bufp, struct sockaddr *sap) FAST_FUNC;
+#else
+#define in_ib(a, b) 1 /* fail */
+#endif
+const struct aftype *get_aftype(const char *name) FAST_FUNC;
+const struct hwtype *get_hwtype(const char *name) FAST_FUNC;
+const struct hwtype *get_hwntype(int type) FAST_FUNC;
+
+
+#ifndef BUILD_INDIVIDUAL
+extern int find_applet_by_name(const char *name) FAST_FUNC;
+extern void run_applet_no_and_exit(int a, char **argv) NORETURN FAST_FUNC;
+#endif
+
+#ifdef HAVE_MNTENT_H
+extern int match_fstype(const struct mntent *mt, const char *fstypes) FAST_FUNC;
+extern struct mntent *find_mount_point(const char *name, int subdir_too) FAST_FUNC;
+#endif
+extern void erase_mtab(const char * name) FAST_FUNC;
+extern unsigned int tty_baud_to_value(speed_t speed) FAST_FUNC;
+extern speed_t tty_value_to_baud(unsigned int value) FAST_FUNC;
+#if ENABLE_DESKTOP
+extern void bb_warn_ignoring_args(char *arg) FAST_FUNC;
+#else
+# define bb_warn_ignoring_args(arg) ((void)0)
+#endif
+
+extern int get_linux_version_code(void) FAST_FUNC;
+
+extern char *query_loop(const char *device) FAST_FUNC;
+extern int del_loop(const char *device) FAST_FUNC;
+/* If *devname is not NULL, use that name, otherwise try to find free one,
+ * malloc and return it in *devname.
+ * return value: 1: read-only loopdev was setup, 0: rw, < 0: error */
+extern int set_loop(char **devname, const char *file, unsigned long long offset, int ro) FAST_FUNC;
+
+/* Like bb_ask below, but asks on stdin with no timeout.  */
+char *bb_ask_stdin(const char * prompt) FAST_FUNC;
+//TODO: pass buf pointer or return allocated buf (avoid statics)?
+char *bb_ask(const int fd, int timeout, const char * prompt) FAST_FUNC;
+int bb_ask_confirmation(void) FAST_FUNC;
+
+/* Returns -1 if input is invalid. current_mode is a base for e.g. "u+rw" */
+int bb_parse_mode(const char* s, unsigned cur_mode) FAST_FUNC;
+
+/*
+ * Config file parser
+ */
+enum {
+	PARSE_COLLAPSE  = 0x00010000, // treat consecutive delimiters as one
+	PARSE_TRIM      = 0x00020000, // trim leading and trailing delimiters
+// TODO: COLLAPSE and TRIM seem to always go in pair
+	PARSE_GREEDY    = 0x00040000, // last token takes entire remainder of the line
+	PARSE_MIN_DIE   = 0x00100000, // die if < min tokens found
+	// keep a copy of current line
+	PARSE_KEEP_COPY = 0x00200000 * ENABLE_FEATURE_CROND_D,
+	PARSE_EOL_COMMENTS = 0x00400000, // comments are recognized even if they aren't the first char
+	// NORMAL is:
+	// * remove leading and trailing delimiters and collapse
+	//   multiple delimiters into one
+	// * warn and continue if less than mintokens delimiters found
+	// * grab everything into last token
+	// * comments are recognized even if they aren't the first char
+	PARSE_NORMAL    = PARSE_COLLAPSE | PARSE_TRIM | PARSE_GREEDY | PARSE_EOL_COMMENTS,
+};
+typedef struct parser_t {
+	FILE *fp;
+	char *data;
+	char *line, *nline;
+	size_t line_alloc, nline_alloc;
+	int lineno;
+} parser_t;
+parser_t* config_open(const char *filename) FAST_FUNC;
+parser_t* config_open2(const char *filename, FILE* FAST_FUNC (*fopen_func)(const char *path)) FAST_FUNC;
+/* delims[0] is a comment char (use '\0' to disable), the rest are token delimiters */
+int config_read(parser_t *parser, char **tokens, unsigned flags, const char *delims) FAST_FUNC;
+#define config_read(parser, tokens, max, min, str, flags) \
+	config_read(parser, tokens, ((flags) | (((min) & 0xFF) << 8) | ((max) & 0xFF)), str)
+void config_close(parser_t *parser) FAST_FUNC;
+
+/* Concatenate path and filename to new allocated buffer.
+ * Add "/" only as needed (no duplicate "//" are produced).
+ * If path is NULL, it is assumed to be "/".
+ * filename should not be NULL. */
+char *concat_path_file(const char *path, const char *filename) FAST_FUNC;
+/* Returns NULL on . and .. */
+char *concat_subpath_file(const char *path, const char *filename) FAST_FUNC;
+
+
+int bb_make_directory(char *path, long mode, int flags) FAST_FUNC;
+
+int get_signum(const char *name) FAST_FUNC;
+const char *get_signame(int number) FAST_FUNC;
+void print_signames(void) FAST_FUNC;
+
+char *bb_simplify_path(const char *path) FAST_FUNC;
+/* Returns ptr to NUL */
+char *bb_simplify_abs_path_inplace(char *path) FAST_FUNC;
+
+#ifndef LOGIN_FAIL_DELAY
+#define LOGIN_FAIL_DELAY 3
+#endif
+extern void bb_do_delay(int seconds) FAST_FUNC;
+extern void change_identity(const struct passwd *pw) FAST_FUNC;
+extern void run_shell(const char *shell, int loginshell, const char **args) NORETURN FAST_FUNC;
+
+/* Returns $SHELL, getpwuid(getuid())->pw_shell, or DEFAULT_SHELL.
+ * Note that getpwuid result might need xstrdup'ing
+ * if there is a possibility of intervening getpwxxx() calls.
+ */
+const char *get_shell_name(void) FAST_FUNC;
+
+#if ENABLE_SELINUX
+extern void renew_current_security_context(void) FAST_FUNC;
+extern void set_current_security_context(security_context_t sid) FAST_FUNC;
+extern context_t set_security_context_component(security_context_t cur_context,
+						char *user, char *role, char *type, char *range) FAST_FUNC;
+extern void setfscreatecon_or_die(security_context_t scontext) FAST_FUNC;
+extern void selinux_preserve_fcontext(int fdesc) FAST_FUNC;
+#else
+#define selinux_preserve_fcontext(fdesc) ((void)0)
+#endif
+extern void selinux_or_die(void) FAST_FUNC;
+
+
+/* setup_environment:
+ * if chdir pw->pw_dir: ok: else if to_tmp == 1: goto /tmp else: goto / or die
+ * if clear_env = 1: cd(pw->pw_dir), clear environment, then set
+ *   TERM=(old value)
+ *   USER=pw->pw_name, LOGNAME=pw->pw_name
+ *   PATH=bb_default_[root_]path
+ *   HOME=pw->pw_dir
+ *   SHELL=shell
+ * else if change_env = 1:
+ *   if not root (if pw->pw_uid != 0):
+ *     USER=pw->pw_name, LOGNAME=pw->pw_name
+ *   HOME=pw->pw_dir
+ *   SHELL=shell
+ * else does nothing
+ */
+#define SETUP_ENV_CHANGEENV (1 << 0)
+#define SETUP_ENV_CLEARENV  (1 << 1)
+#define SETUP_ENV_TO_TMP    (1 << 2)
+#define SETUP_ENV_NO_CHDIR  (1 << 4)
+void setup_environment(const char *shell, int flags, const struct passwd *pw) FAST_FUNC;
+void nuke_str(char *str) FAST_FUNC;
+int check_password(const struct passwd *pw, const char *plaintext) FAST_FUNC;
+int ask_and_check_password_extended(const struct passwd *pw, int timeout, const char *prompt) FAST_FUNC;
+int ask_and_check_password(const struct passwd *pw) FAST_FUNC;
+/* Returns a malloced string */
+#if !ENABLE_USE_BB_CRYPT
+#define pw_encrypt(clear, salt, cleanup) pw_encrypt(clear, salt)
+#endif
+extern char *pw_encrypt(const char *clear, const char *salt, int cleanup) FAST_FUNC;
+extern int obscure(const char *old, const char *newval, const struct passwd *pwdp) FAST_FUNC;
+/*
+ * rnd is additional random input. New one is returned.
+ * Useful if you call crypt_make_salt many times in a row:
+ * rnd = crypt_make_salt(buf1, 4, 0);
+ * rnd = crypt_make_salt(buf2, 4, rnd);
+ * rnd = crypt_make_salt(buf3, 4, rnd);
+ * (otherwise we risk having same salt generated)
+ */
+extern int crypt_make_salt(char *p, int cnt /*, int rnd*/) FAST_FUNC;
+/* "$N$" + sha_salt_16_bytes + NUL */
+#define MAX_PW_SALT_LEN (3 + 16 + 1)
+extern char* crypt_make_pw_salt(char p[MAX_PW_SALT_LEN], const char *algo) FAST_FUNC;
+
+
+/* Returns number of lines changed, or -1 on error */
+#if !(ENABLE_FEATURE_ADDUSER_TO_GROUP || ENABLE_FEATURE_DEL_USER_FROM_GROUP)
+#define update_passwd(filename, username, data, member) \
+	update_passwd(filename, username, data)
+#endif
+extern int update_passwd(const char *filename,
+		const char *username,
+		const char *data,
+		const char *member) FAST_FUNC;
+
+int index_in_str_array(const char *const string_array[], const char *key) FAST_FUNC;
+int index_in_strings(const char *strings, const char *key) FAST_FUNC;
+int index_in_substr_array(const char *const string_array[], const char *key) FAST_FUNC;
+int index_in_substrings(const char *strings, const char *key) FAST_FUNC;
+const char *nth_string(const char *strings, int n) FAST_FUNC;
+
+extern void print_login_issue(const char *issue_file, const char *tty) FAST_FUNC;
+extern void print_login_prompt(void) FAST_FUNC;
+
+char *xmalloc_ttyname(int fd) FAST_FUNC RETURNS_MALLOC;
+/* NB: typically you want to pass fd 0, not 1. Think 'applet | grep something' */
+int get_terminal_width_height(int fd, unsigned *width, unsigned *height) FAST_FUNC;
+int get_terminal_width(int fd) FAST_FUNC;
+
+int tcsetattr_stdin_TCSANOW(const struct termios *tp) FAST_FUNC;
+
+/* NB: "unsigned request" is crucial! "int request" will break some arches! */
+int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) FAST_FUNC;
+int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) FAST_FUNC;
+#if ENABLE_IOCTL_HEX2STR_ERROR
+int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name) FAST_FUNC;
+int bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name) FAST_FUNC;
+#define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp,#request)
+#define xioctl(fd,request,argp)        bb_xioctl(fd,request,argp,#request)
+#else
+int bb_ioctl_or_warn(int fd, unsigned request, void *argp) FAST_FUNC;
+int bb_xioctl(int fd, unsigned request, void *argp) FAST_FUNC;
+#define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp)
+#define xioctl(fd,request,argp)        bb_xioctl(fd,request,argp)
+#endif
+
+char *is_in_ino_dev_hashtable(const struct stat *statbuf) FAST_FUNC;
+void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) FAST_FUNC;
+void reset_ino_dev_hashtable(void) FAST_FUNC;
+#ifdef __GLIBC__
+/* At least glibc has horrendously large inline for this, so wrap it */
+unsigned long long bb_makedev(unsigned major, unsigned minor) FAST_FUNC;
+#undef makedev
+#define makedev(a,b) bb_makedev(a,b)
+#endif
+
+
+/* "Keycodes" that report an escape sequence.
+ * We use something which fits into signed char,
+ * yet doesn't represent any valid Unicode character.
+ * Also, -1 is reserved for error indication and we don't use it. */
+enum {
+	KEYCODE_UP        =  -2,
+	KEYCODE_DOWN      =  -3,
+	KEYCODE_RIGHT     =  -4,
+	KEYCODE_LEFT      =  -5,
+	KEYCODE_HOME      =  -6,
+	KEYCODE_END       =  -7,
+	KEYCODE_INSERT    =  -8,
+	KEYCODE_DELETE    =  -9,
+	KEYCODE_PAGEUP    = -10,
+	KEYCODE_PAGEDOWN  = -11,
+	KEYCODE_BACKSPACE = -12, /* Used only if Alt/Ctrl/Shifted */
+	KEYCODE_D         = -13, /* Used only if Alted */
+#if 0
+	KEYCODE_FUN1      = ,
+	KEYCODE_FUN2      = ,
+	KEYCODE_FUN3      = ,
+	KEYCODE_FUN4      = ,
+	KEYCODE_FUN5      = ,
+	KEYCODE_FUN6      = ,
+	KEYCODE_FUN7      = ,
+	KEYCODE_FUN8      = ,
+	KEYCODE_FUN9      = ,
+	KEYCODE_FUN10     = ,
+	KEYCODE_FUN11     = ,
+	KEYCODE_FUN12     = ,
+#endif
+	/* ^^^^^ Be sure that last defined value is small enough.
+	 * Current read_key() code allows going up to -32 (0xfff..fffe0).
+	 * This gives three upper bits in LSB to play with:
+	 * KEYCODE_foo values are 0xfff..fffXX, lowest XX bits are: scavvvvv,
+	 * s=0 if SHIFT, c=0 if CTRL, a=0 if ALT,
+	 * vvvvv bits are the same for same key regardless of "shift bits".
+	 */
+	//KEYCODE_SHIFT_...   = KEYCODE_...   & ~0x80,
+	KEYCODE_CTRL_RIGHT    = KEYCODE_RIGHT & ~0x40,
+	KEYCODE_CTRL_LEFT     = KEYCODE_LEFT  & ~0x40,
+	KEYCODE_ALT_RIGHT     = KEYCODE_RIGHT & ~0x20,
+	KEYCODE_ALT_LEFT      = KEYCODE_LEFT  & ~0x20,
+	KEYCODE_ALT_BACKSPACE = KEYCODE_BACKSPACE & ~0x20,
+	KEYCODE_ALT_D         = KEYCODE_D     & ~0x20,
+
+	KEYCODE_CURSOR_POS = -0x100, /* 0xfff..fff00 */
+	/* How long is the longest ESC sequence we know?
+	 * We want it big enough to be able to contain
+	 * cursor position sequence "ESC [ 9999 ; 9999 R"
+	 */
+	KEYCODE_BUFFER_SIZE = 16
+};
+/* Note: fd may be in blocking or non-blocking mode, both make sense.
+ * For one, less uses non-blocking mode.
+ * Only the first read syscall inside read_key may block indefinitely
+ * (unless fd is in non-blocking mode),
+ * subsequent reads will time out after a few milliseconds.
+ * Return of -1 means EOF or error (errno == 0 on EOF).
+ * buffer[0] is used as a counter of buffered chars and must be 0
+ * on first call.
+ * timeout:
+ * -2: do not poll for input;
+ * -1: poll(-1) (i.e. block);
+ * >=0: poll for TIMEOUT milliseconds, return -1/EAGAIN on timeout
+ */
+int64_t read_key(int fd, char *buffer, int timeout) FAST_FUNC;
+void read_key_ungets(char *buffer, const char *str, unsigned len) FAST_FUNC;
+
+
+#if ENABLE_FEATURE_EDITING
+/* It's NOT just ENABLEd or disabled. It's a number: */
+# if defined CONFIG_FEATURE_EDITING_HISTORY && CONFIG_FEATURE_EDITING_HISTORY > 0
+#  define MAX_HISTORY (CONFIG_FEATURE_EDITING_HISTORY + 0)
+unsigned size_from_HISTFILESIZE(const char *hp) FAST_FUNC;
+# else
+#  define MAX_HISTORY 0
+# endif
+typedef struct line_input_t {
+	int flags;
+	const char *path_lookup;
+# if MAX_HISTORY
+	int cnt_history;
+	int cur_history;
+	int max_history; /* must never be <= 0 */
+#  if ENABLE_FEATURE_EDITING_SAVEHISTORY
+	/* meaning of this field depends on FEATURE_EDITING_SAVE_ON_EXIT:
+	 * if !FEATURE_EDITING_SAVE_ON_EXIT: "how many lines are
+	 * in on-disk history"
+	 * if FEATURE_EDITING_SAVE_ON_EXIT: "how many in-memory lines are
+	 * also in on-disk history (and thus need to be skipped on save)"
+	 */
+	unsigned cnt_history_in_file;
+	const char *hist_file;
+#  endif
+	char *history[MAX_HISTORY + 1];
+# endif
+} line_input_t;
+enum {
+	DO_HISTORY       = 1 * (MAX_HISTORY > 0),
+	TAB_COMPLETION   = 2 * ENABLE_FEATURE_TAB_COMPLETION,
+	USERNAME_COMPLETION = 4 * ENABLE_FEATURE_USERNAME_COMPLETION,
+	VI_MODE          = 8 * ENABLE_FEATURE_EDITING_VI,
+	WITH_PATH_LOOKUP = 0x10,
+	FOR_SHELL        = DO_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION,
+};
+line_input_t *new_line_input_t(int flags) FAST_FUNC;
+/* So far static: void free_line_input_t(line_input_t *n) FAST_FUNC; */
+/*
+ * maxsize must be >= 2.
+ * Returns:
+ * -1 on read errors or EOF, or on bare Ctrl-D,
+ * 0  on ctrl-C (the line entered is still returned in 'command'),
+ * >0 length of input string, including terminating '\n'
+ */
+int read_line_input(line_input_t *st, const char *prompt, char *command, int maxsize, int timeout) FAST_FUNC;
+void show_history(const line_input_t *st) FAST_FUNC;
+# if ENABLE_FEATURE_EDITING_SAVE_ON_EXIT
+void save_history(line_input_t *st);
+# endif
+#else
+#define MAX_HISTORY 0
+int read_line_input(const char* prompt, char* command, int maxsize) FAST_FUNC;
+#define read_line_input(state, prompt, command, maxsize, timeout) \
+	read_line_input(prompt, command, maxsize)
+#endif
+
+
+#ifndef COMM_LEN
+# ifdef TASK_COMM_LEN
+enum { COMM_LEN = TASK_COMM_LEN };
+# else
+/* synchronize with sizeof(task_struct.comm) in /usr/include/linux/sched.h */
+enum { COMM_LEN = 16 };
+# endif
+#endif
+
+struct smaprec {
+	unsigned long mapped_rw;
+	unsigned long mapped_ro;
+	unsigned long shared_clean;
+	unsigned long shared_dirty;
+	unsigned long private_clean;
+	unsigned long private_dirty;
+	unsigned long stack;
+	unsigned long smap_pss, smap_swap;
+	unsigned long smap_size;
+	unsigned long smap_start;
+	char smap_mode[5];
+	char *smap_name;
+};
+
+#if !ENABLE_PMAP
+#define procps_read_smaps(pid, total, cb, data) \
+	procps_read_smaps(pid, total)
+#endif
+int FAST_FUNC procps_read_smaps(pid_t pid, struct smaprec *total,
+		void (*cb)(struct smaprec *, void *), void *data);
+
+typedef struct procps_status_t {
+	DIR *dir;
+	IF_FEATURE_SHOW_THREADS(DIR *task_dir;)
+	uint8_t shift_pages_to_bytes;
+	uint8_t shift_pages_to_kb;
+/* Fields are set to 0/NULL if failed to determine (or not requested) */
+	uint16_t argv_len;
+	char *argv0;
+	char *exe;
+	IF_SELINUX(char *context;)
+	IF_FEATURE_SHOW_THREADS(unsigned main_thread_pid;)
+	/* Everything below must contain no ptrs to malloc'ed data:
+	 * it is memset(0) for each process in procps_scan() */
+	unsigned long vsz, rss; /* we round it to kbytes */
+	unsigned long stime, utime;
+	unsigned long start_time;
+	unsigned pid;
+	unsigned ppid;
+	unsigned pgid;
+	unsigned sid;
+	unsigned uid;
+	unsigned gid;
+#if ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS
+	unsigned ruid;
+	unsigned rgid;
+	int niceness;
+#endif
+	unsigned tty_major,tty_minor;
+#if ENABLE_FEATURE_TOPMEM
+	struct smaprec smaps;
+#endif
+	char state[4];
+	/* basename of executable in exec(2), read from /proc/N/stat
+	 * (if executable is symlink or script, it is NOT replaced
+	 * by link target or interpreter name) */
+	char comm[COMM_LEN];
+	/* user/group? - use passwd/group parsing functions */
+#if ENABLE_FEATURE_TOP_SMP_PROCESS
+	int last_seen_on_cpu;
+#endif
+} procps_status_t;
+/* flag bits for procps_scan(xx, flags) calls */
+enum {
+	PSSCAN_PID      = 1 << 0,
+	PSSCAN_PPID     = 1 << 1,
+	PSSCAN_PGID     = 1 << 2,
+	PSSCAN_SID      = 1 << 3,
+	PSSCAN_UIDGID   = 1 << 4,
+	PSSCAN_COMM     = 1 << 5,
+	/* PSSCAN_CMD      = 1 << 6, - use read_cmdline instead */
+	PSSCAN_ARGV0    = 1 << 7,
+	PSSCAN_EXE      = 1 << 8,
+	PSSCAN_STATE    = 1 << 9,
+	PSSCAN_VSZ      = 1 << 10,
+	PSSCAN_RSS      = 1 << 11,
+	PSSCAN_STIME    = 1 << 12,
+	PSSCAN_UTIME    = 1 << 13,
+	PSSCAN_TTY      = 1 << 14,
+	PSSCAN_SMAPS	= (1 << 15) * ENABLE_FEATURE_TOPMEM,
+	/* NB: used by find_pid_by_name(). Any applet using it
+	 * needs to be mentioned here. */
+	PSSCAN_ARGVN    = (1 << 16) * (ENABLE_KILLALL
+				|| ENABLE_PGREP || ENABLE_PKILL
+				|| ENABLE_PIDOF
+				|| ENABLE_SESTATUS
+				),
+	PSSCAN_CONTEXT  = (1 << 17) * ENABLE_SELINUX,
+	PSSCAN_START_TIME = 1 << 18,
+	PSSCAN_CPU      = (1 << 19) * ENABLE_FEATURE_TOP_SMP_PROCESS,
+	PSSCAN_NICE     = (1 << 20) * ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS,
+	PSSCAN_RUIDGID  = (1 << 21) * ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS,
+	PSSCAN_TASKS	= (1 << 22) * ENABLE_FEATURE_SHOW_THREADS,
+};
+//procps_status_t* alloc_procps_scan(void) FAST_FUNC;
+void free_procps_scan(procps_status_t* sp) FAST_FUNC;
+procps_status_t* procps_scan(procps_status_t* sp, int flags) FAST_FUNC;
+/* Format cmdline (up to col chars) into char buf[size] */
+/* Puts [comm] if cmdline is empty (-> process is a kernel thread) */
+void read_cmdline(char *buf, int size, unsigned pid, const char *comm) FAST_FUNC;
+pid_t *find_pid_by_name(const char* procName) FAST_FUNC;
+pid_t *pidlist_reverse(pid_t *pidList) FAST_FUNC;
+int starts_with_cpu(const char *str) FAST_FUNC;
+unsigned get_cpu_count(void) FAST_FUNC;
+
+
+/* Use strict=1 if you process input from untrusted source:
+ * it will return NULL on invalid %xx (bad hex chars)
+ * and str + 1 if decoded char is / or NUL.
+ * In non-strict mode, it always succeeds (returns str),
+ * and also it additionally decoded '+' to space.
+ */
+char *percent_decode_in_place(char *str, int strict) FAST_FUNC;
+
+
+extern const char bb_uuenc_tbl_base64[] ALIGN1;
+extern const char bb_uuenc_tbl_std[] ALIGN1;
+void bb_uuencode(char *store, const void *s, int length, const char *tbl) FAST_FUNC;
+enum {
+	BASE64_FLAG_UU_STOP = 0x100,
+	/* Sign-extends to a value which never matches fgetc result: */
+	BASE64_FLAG_NO_STOP_CHAR = 0x80,
+};
+const char *decode_base64(char **pp_dst, const char *src) FAST_FUNC;
+void read_base64(FILE *src_stream, FILE *dst_stream, int flags) FAST_FUNC;
+
+typedef struct md5_ctx_t {
+	uint8_t wbuffer[64]; /* always correctly aligned for uint64_t */
+	void (*process_block)(struct md5_ctx_t*) FAST_FUNC;
+	uint64_t total64;    /* must be directly before hash[] */
+	uint32_t hash[8];    /* 4 elements for md5, 5 for sha1, 8 for sha256 */
+} md5_ctx_t;
+typedef struct md5_ctx_t sha1_ctx_t;
+typedef struct md5_ctx_t sha256_ctx_t;
+typedef struct sha512_ctx_t {
+	uint64_t total64[2];  /* must be directly before hash[] */
+	uint64_t hash[8];
+	uint8_t wbuffer[128]; /* always correctly aligned for uint64_t */
+} sha512_ctx_t;
+typedef struct sha3_ctx_t {
+	uint64_t state[25];
+	unsigned bytes_queued;
+	unsigned input_block_bytes;
+} sha3_ctx_t;
+void md5_begin(md5_ctx_t *ctx) FAST_FUNC;
+void md5_hash(md5_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC;
+void md5_end(md5_ctx_t *ctx, void *resbuf) FAST_FUNC;
+void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC;
+#define sha1_hash md5_hash
+void sha1_end(sha1_ctx_t *ctx, void *resbuf) FAST_FUNC;
+void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC;
+#define sha256_hash md5_hash
+#define sha256_end  sha1_end
+void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC;
+void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC;
+void sha512_end(sha512_ctx_t *ctx, void *resbuf) FAST_FUNC;
+void sha3_begin(sha3_ctx_t *ctx) FAST_FUNC;
+void sha3_hash(sha3_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC;
+void sha3_end(sha3_ctx_t *ctx, void *resbuf) FAST_FUNC;
+
+extern uint32_t *global_crc32_table;
+uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC;
+uint32_t crc32_block_endian1(uint32_t val, const void *buf, unsigned len, uint32_t *crc_table) FAST_FUNC;
+uint32_t crc32_block_endian0(uint32_t val, const void *buf, unsigned len, uint32_t *crc_table) FAST_FUNC;
+
+typedef struct masks_labels_t {
+	const char *labels;
+	const int masks[];
+} masks_labels_t;
+int print_flags_separated(const int *masks, const char *labels,
+		int flags, const char *separator) FAST_FUNC;
+int print_flags(const masks_labels_t *ml, int flags) FAST_FUNC;
+
+typedef struct bb_progress_t {
+	unsigned last_size;
+	unsigned last_update_sec;
+	unsigned last_change_sec;
+	unsigned start_sec;
+	const char *curfile;
+} bb_progress_t;
+
+#define is_bb_progress_inited(p) ((p)->curfile != NULL)
+#define bb_progress_free(p) do { \
+	if (ENABLE_UNICODE_SUPPORT) free((char*)((p)->curfile)); \
+	(p)->curfile = NULL; \
+} while (0)
+void bb_progress_init(bb_progress_t *p, const char *curfile) FAST_FUNC;
+void bb_progress_update(bb_progress_t *p,
+			uoff_t beg_range,
+			uoff_t transferred,
+			uoff_t totalsize) FAST_FUNC;
+
+unsigned ubi_devnum_from_devname(const char *str) FAST_FUNC;
+int ubi_get_volid_by_name(unsigned ubi_devnum, const char *vol_name) FAST_FUNC;
+
+
+extern const char *applet_name;
+
+/* Some older linkers don't perform string merging, we used to have common strings
+ * as global arrays to do it by hand. But:
+ * (1) newer linkers do it themselves,
+ * (2) however, they DONT merge string constants with global arrays,
+ * even if the value is the same (!). Thus global arrays actually
+ * increased size a bit: for example, "/etc/passwd" string from libc
+ * wasn't merged with bb_path_passwd_file[] array!
+ * Therefore now we use #defines.
+ */
+/* "BusyBox vN.N.N (timestamp or extra_version)" */
+extern const char bb_banner[] ALIGN1;
+extern const char bb_msg_memory_exhausted[] ALIGN1;
+extern const char bb_msg_invalid_date[] ALIGN1;
+#define bb_msg_read_error "read error"
+#define bb_msg_write_error "write error"
+extern const char bb_msg_unknown[] ALIGN1;
+extern const char bb_msg_can_not_create_raw_socket[] ALIGN1;
+extern const char bb_msg_perm_denied_are_you_root[] ALIGN1;
+extern const char bb_msg_you_must_be_root[] ALIGN1;
+extern const char bb_msg_requires_arg[] ALIGN1;
+extern const char bb_msg_invalid_arg_to[] ALIGN1;
+extern const char bb_msg_standard_input[] ALIGN1;
+extern const char bb_msg_standard_output[] ALIGN1;
+
+/* NB: (bb_hexdigits_upcase[i] | 0x20) -> lowercase hex digit */
+extern const char bb_hexdigits_upcase[] ALIGN1;
+
+extern const char bb_path_wtmp_file[] ALIGN1;
+
+/* Busybox mount uses either /proc/mounts or /etc/mtab to
+ * get the list of currently mounted filesystems */
+#define bb_path_mtab_file IF_FEATURE_MTAB_SUPPORT("/etc/mtab")IF_NOT_FEATURE_MTAB_SUPPORT("/proc/mounts")
+
+#define bb_path_passwd_file  _PATH_PASSWD
+#define bb_path_group_file   _PATH_GROUP
+#define bb_path_shadow_file  _PATH_SHADOW
+#define bb_path_gshadow_file _PATH_GSHADOW
+
+#define bb_path_motd_file "/etc/motd"
+
+#define bb_dev_null "/dev/null"
+extern const char bb_busybox_exec_path[] ALIGN1;
+/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin,
+ * but I want to save a few bytes here */
+extern const char bb_PATH_root_path[] ALIGN1; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */
+#define bb_default_root_path (bb_PATH_root_path + sizeof("PATH"))
+#define bb_default_path      (bb_PATH_root_path + sizeof("PATH=/sbin:/usr/sbin"))
+
+extern const int const_int_0;
+//extern const int const_int_1;
+
+/* This struct is deliberately not defined. */
+/* See docs/keep_data_small.txt */
+struct globals;
+/* '*const' ptr makes gcc optimize code much better.
+ * Magic prevents ptr_to_globals from going into rodata.
+ * If you want to assign a value, use SET_PTR_TO_GLOBALS(x) */
+extern struct globals *const ptr_to_globals;
+/* At least gcc 3.4.6 on mipsel system needs optimization barrier */
+#define barrier() __asm__ __volatile__("":::"memory")
+#define SET_PTR_TO_GLOBALS(x) do { \
+	(*(struct globals**)&ptr_to_globals) = (void*)(x); \
+	barrier(); \
+} while (0)
+#define FREE_PTR_TO_GLOBALS() do { \
+	if (ENABLE_FEATURE_CLEAN_UP) { \
+		free(ptr_to_globals); \
+	} \
+} while (0)
+
+/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it,
+ * use bb_default_login_shell and following defines.
+ * If you change LIBBB_DEFAULT_LOGIN_SHELL,
+ * don't forget to change increment constant. */
+#define LIBBB_DEFAULT_LOGIN_SHELL  "-/bin/sh"
+extern const char bb_default_login_shell[] ALIGN1;
+/* "/bin/sh" */
+#define DEFAULT_SHELL              (bb_default_login_shell+1)
+/* "sh" */
+#define DEFAULT_SHELL_SHORT_NAME   (bb_default_login_shell+6)
+
+/* The following devices are the same on all systems.  */
+#define CURRENT_TTY "/dev/tty"
+#define DEV_CONSOLE "/dev/console"
+
+#if defined(__FreeBSD_kernel__)
+# define CURRENT_VC CURRENT_TTY
+# define VC_1 "/dev/ttyv0"
+# define VC_2 "/dev/ttyv1"
+# define VC_3 "/dev/ttyv2"
+# define VC_4 "/dev/ttyv3"
+# define VC_5 "/dev/ttyv4"
+# define VC_FORMAT "/dev/ttyv%d"
+#elif defined(__GNU__)
+# define CURRENT_VC CURRENT_TTY
+# define VC_1 "/dev/tty1"
+# define VC_2 "/dev/tty2"
+# define VC_3 "/dev/tty3"
+# define VC_4 "/dev/tty4"
+# define VC_5 "/dev/tty5"
+# define VC_FORMAT "/dev/tty%d"
+#elif ENABLE_FEATURE_DEVFS
+/*Linux, obsolete devfs names */
+# define CURRENT_VC "/dev/vc/0"
+# define VC_1 "/dev/vc/1"
+# define VC_2 "/dev/vc/2"
+# define VC_3 "/dev/vc/3"
+# define VC_4 "/dev/vc/4"
+# define VC_5 "/dev/vc/5"
+# define VC_FORMAT "/dev/vc/%d"
+# define LOOP_FORMAT "/dev/loop/%u"
+# define LOOP_NAMESIZE (sizeof("/dev/loop/") + sizeof(int)*3 + 1)
+# define LOOP_NAME "/dev/loop/"
+# define FB_0 "/dev/fb/0"
+#else
+/*Linux, normal names */
+# define CURRENT_VC "/dev/tty0"
+# define VC_1 "/dev/tty1"
+# define VC_2 "/dev/tty2"
+# define VC_3 "/dev/tty3"
+# define VC_4 "/dev/tty4"
+# define VC_5 "/dev/tty5"
+# define VC_FORMAT "/dev/tty%d"
+# define LOOP_FORMAT "/dev/loop%u"
+# define LOOP_NAMESIZE (sizeof("/dev/loop") + sizeof(int)*3 + 1)
+# define LOOP_NAME "/dev/loop"
+# define FB_0 "/dev/fb0"
+#endif
+
+
+#define ARRAY_SIZE(x) ((unsigned)(sizeof(x) / sizeof((x)[0])))
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+
+
+/* We redefine ctype macros. Unicode-correct handling of char types
+ * can't be done with such byte-oriented operations anyway,
+ * we don't lose anything.
+ */
+#undef isalnum
+#undef isalpha
+#undef isascii
+#undef isblank
+#undef iscntrl
+#undef isdigit
+#undef isgraph
+#undef islower
+#undef isprint
+#undef ispunct
+#undef isspace
+#undef isupper
+#undef isxdigit
+#undef toupper
+#undef tolower
+
+/* We save ~500 bytes on isdigit alone.
+ * BTW, x86 likes (unsigned char) cast more than (unsigned). */
+
+/* These work the same for ASCII and Unicode,
+ * assuming no one asks "is this a *Unicode* letter?" using isalpha(letter) */
+#define isascii(a) ((unsigned char)(a) <= 0x7f)
+#define isdigit(a) ((unsigned char)((a) - '0') <= 9)
+#define isupper(a) ((unsigned char)((a) - 'A') <= ('Z' - 'A'))
+#define islower(a) ((unsigned char)((a) - 'a') <= ('z' - 'a'))
+#define isalpha(a) ((unsigned char)(((a)|0x20) - 'a') <= ('z' - 'a'))
+#define isblank(a) ({ unsigned char bb__isblank = (a); bb__isblank == ' ' || bb__isblank == '\t'; })
+#define iscntrl(a) ({ unsigned char bb__iscntrl = (a); bb__iscntrl < ' ' || bb__iscntrl == 0x7f; })
+/* In POSIX/C locale isspace is only these chars: "\t\n\v\f\r" and space.
+ * "\t\n\v\f\r" happen to have ASCII codes 9,10,11,12,13.
+ */
+#define isspace(a) ({ unsigned char bb__isspace = (a) - 9; bb__isspace == (' ' - 9) || bb__isspace <= (13 - 9); })
+// Unsafe wrt NUL: #define ispunct(a) (strchr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", (a)) != NULL)
+#define ispunct(a) (strchrnul("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", (a))[0])
+// Bigger code: #define isalnum(a) ({ unsigned char bb__isalnum = (a) - '0'; bb__isalnum <= 9 || ((bb__isalnum - ('A' - '0')) & 0xdf) <= 25; })
+#define isalnum(a) bb_ascii_isalnum(a)
+static ALWAYS_INLINE int bb_ascii_isalnum(unsigned char a)
+{
+	unsigned char b = a - '0';
+	if (b <= 9)
+		return (b <= 9);
+	b = (a|0x20) - 'a';
+	return b <= 'z' - 'a';
+}
+#define isxdigit(a) bb_ascii_isxdigit(a)
+static ALWAYS_INLINE int bb_ascii_isxdigit(unsigned char a)
+{
+	unsigned char b = a - '0';
+	if (b <= 9)
+		return (b <= 9);
+	b = (a|0x20) - 'a';
+	return b <= 'f' - 'a';
+}
+#define toupper(a) bb_ascii_toupper(a)
+static ALWAYS_INLINE unsigned char bb_ascii_toupper(unsigned char a)
+{
+	unsigned char b = a - 'a';
+	if (b <= ('z' - 'a'))
+		a -= 'a' - 'A';
+	return a;
+}
+#define tolower(a) bb_ascii_tolower(a)
+static ALWAYS_INLINE unsigned char bb_ascii_tolower(unsigned char a)
+{
+	unsigned char b = a - 'A';
+	if (b <= ('Z' - 'A'))
+		a += 'a' - 'A';
+	return a;
+}
+
+/* In ASCII and Unicode, these are likely to be very different.
+ * Let's prevent ambiguous usage from the start */
+#define isgraph(a) isgraph_is_ambiguous_dont_use(a)
+#define isprint(a) isprint_is_ambiguous_dont_use(a)
+/* NB: must not treat EOF as isgraph or isprint */
+#define isgraph_asciionly(a) ((unsigned)((a) - 0x21) <= 0x7e - 0x21)
+#define isprint_asciionly(a) ((unsigned)((a) - 0x20) <= 0x7e - 0x20)
+
+
+/* Simple unit-testing framework */
+
+typedef void (*bbunit_testfunc)(void);
+
+struct bbunit_listelem {
+	const char* name;
+	bbunit_testfunc testfunc;
+};
+
+void bbunit_registertest(struct bbunit_listelem* test);
+void bbunit_settestfailed(void);
+
+#define BBUNIT_DEFINE_TEST(NAME) \
+	static void bbunit_##NAME##_test(void); \
+	static struct bbunit_listelem bbunit_##NAME##_elem = { \
+		.name = #NAME, \
+		.testfunc = bbunit_##NAME##_test, \
+	}; \
+	static void INIT_FUNC bbunit_##NAME##_register(void) \
+	{ \
+		bbunit_registertest(&bbunit_##NAME##_elem); \
+	} \
+	static void bbunit_##NAME##_test(void)
+
+/*
+ * Both 'goto bbunit_end' and 'break' are here only to get rid
+ * of compiler warnings.
+ */
+#define BBUNIT_ENDTEST \
+	do { \
+		goto bbunit_end; \
+	bbunit_end: \
+		break; \
+	} while (0)
+
+#define BBUNIT_PRINTASSERTFAIL \
+	do { \
+		bb_error_msg( \
+			"[ERROR] Assertion failed in file %s, line %d", \
+			__FILE__, __LINE__); \
+	} while (0)
+
+#define BBUNIT_ASSERTION_FAILED \
+	do { \
+		bbunit_settestfailed(); \
+		goto bbunit_end; \
+	} while (0)
+
+/*
+ * Assertions.
+ * For now we only offer assertions which cause tests to fail
+ * immediately. In the future 'expects' might be added too -
+ * similar to those offered by the gtest framework.
+ */
+#define BBUNIT_ASSERT_EQ(EXPECTED, ACTUAL) \
+	do { \
+		if ((EXPECTED) != (ACTUAL)) { \
+			BBUNIT_PRINTASSERTFAIL; \
+			bb_error_msg("[ERROR] '%s' isn't equal to '%s'", \
+						#EXPECTED, #ACTUAL); \
+			BBUNIT_ASSERTION_FAILED; \
+		} \
+	} while (0)
+
+#define BBUNIT_ASSERT_NOTEQ(EXPECTED, ACTUAL) \
+	do { \
+		if ((EXPECTED) == (ACTUAL)) { \
+			BBUNIT_PRINTASSERTFAIL; \
+			bb_error_msg("[ERROR] '%s' is equal to '%s'", \
+						#EXPECTED, #ACTUAL); \
+			BBUNIT_ASSERTION_FAILED; \
+		} \
+	} while (0)
+
+#define BBUNIT_ASSERT_NOTNULL(PTR) \
+	do { \
+		if ((PTR) == NULL) { \
+			BBUNIT_PRINTASSERTFAIL; \
+			bb_error_msg("[ERROR] '%s' is NULL!", #PTR); \
+			BBUNIT_ASSERTION_FAILED; \
+		} \
+	} while (0)
+
+#define BBUNIT_ASSERT_NULL(PTR) \
+	do { \
+		if ((PTR) != NULL) { \
+			BBUNIT_PRINTASSERTFAIL; \
+			bb_error_msg("[ERROR] '%s' is not NULL!", #PTR); \
+			BBUNIT_ASSERTION_FAILED; \
+		} \
+	} while (0)
+
+#define BBUNIT_ASSERT_FALSE(STATEMENT) \
+	do { \
+		if ((STATEMENT)) { \
+			BBUNIT_PRINTASSERTFAIL; \
+			bb_error_msg("[ERROR] Statement '%s' evaluated to true!", \
+								#STATEMENT); \
+			BBUNIT_ASSERTION_FAILED; \
+		} \
+	} while (0)
+
+#define BBUNIT_ASSERT_TRUE(STATEMENT) \
+	do { \
+		if (!(STATEMENT)) { \
+			BBUNIT_PRINTASSERTFAIL; \
+			bb_error_msg("[ERROR] Statement '%s' evaluated to false!", \
+					#STATEMENT); \
+			BBUNIT_ASSERTION_FAILED; \
+		} \
+	} while (0)
+
+#define BBUNIT_ASSERT_STREQ(STR1, STR2) \
+	do { \
+		if (strcmp(STR1, STR2) != 0) { \
+			BBUNIT_PRINTASSERTFAIL; \
+			bb_error_msg("[ERROR] Strings '%s' and '%s' " \
+					"are not the same", STR1, STR2); \
+			BBUNIT_ASSERTION_FAILED; \
+		} \
+	} while (0)
+
+#define BBUNIT_ASSERT_STRNOTEQ(STR1, STR2) \
+	do { \
+		if (strcmp(STR1, STR2) == 0) { \
+			BBUNIT_PRINTASSERTFAIL; \
+			bb_error_msg("[ERROR] Strings '%s' and '%s' " \
+					"are the same, but were " \
+					"expected to differ", STR1, STR2); \
+			BBUNIT_ASSERTION_FAILED; \
+		} \
+	} while (0)
+
+
+POP_SAVED_FUNCTION_VISIBILITY
+
+#endif
Index: /EcnlProtoTool/trunk/busybox/src/messages.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/messages.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/messages.c	(revision 447)
@@ -0,0 +1,61 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+
+#include "libbb.h"
+
+/* allow default system PATH to be extended via CFLAGS */
+#ifndef BB_ADDITIONAL_PATH
+#define BB_ADDITIONAL_PATH ""
+#endif
+
+/* allow version to be extended, via CFLAGS */
+#ifndef BB_EXTRA_VERSION
+#define BB_EXTRA_VERSION BB_BT
+#endif
+
+#define BANNER "BusyBox v" BB_VER " (" BB_EXTRA_VERSION ")"
+
+const char bb_banner[] ALIGN1 = BANNER;
+
+
+const char bb_msg_memory_exhausted[] ALIGN1 = "out of memory";
+const char bb_msg_invalid_date[] ALIGN1 = "invalid date '%s'";
+const char bb_msg_unknown[] ALIGN1 = "(unknown)";
+const char bb_msg_can_not_create_raw_socket[] ALIGN1 = "can't create raw socket";
+const char bb_msg_perm_denied_are_you_root[] ALIGN1 = "permission denied (are you root?)";
+const char bb_msg_you_must_be_root[] ALIGN1 = "you must be root";
+const char bb_msg_requires_arg[] ALIGN1 = "%s requires an argument";
+const char bb_msg_invalid_arg_to[] ALIGN1 = "invalid argument '%s' to '%s'";
+const char bb_msg_standard_input[] ALIGN1 = "standard input";
+const char bb_msg_standard_output[] ALIGN1 = "standard output";
+
+const char bb_hexdigits_upcase[] ALIGN1 = "0123456789ABCDEF";
+
+const char bb_busybox_exec_path[] ALIGN1 = CONFIG_BUSYBOX_EXEC_PATH;
+const char bb_default_login_shell[] ALIGN1 = LIBBB_DEFAULT_LOGIN_SHELL;
+/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin,
+ * but I want to save a few bytes here. Check libbb.h before changing! */
+const char bb_PATH_root_path[] ALIGN1 =
+	"PATH=/sbin:/usr/sbin:/bin:/usr/bin" BB_ADDITIONAL_PATH;
+
+
+//const int const_int_1 = 1;
+/* explicitly = 0, otherwise gcc may make it a common variable
+ * and it will end up in bss */
+const int const_int_0 = 0;
+
+#if ENABLE_FEATURE_WTMP
+/* This is usually something like "/var/adm/wtmp" or "/var/log/wtmp" */
+const char bb_path_wtmp_file[] ALIGN1 =
+# if defined _PATH_WTMP
+	_PATH_WTMP;
+# elif defined WTMP_FILE
+	WTMP_FILE;
+# else
+#  error unknown path to wtmp file
+# endif
+#endif
Index: /EcnlProtoTool/trunk/busybox/src/perror_msg.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/perror_msg.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/perror_msg.c	(revision 447)
@@ -0,0 +1,40 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+#include "libbb.h"
+
+void FAST_FUNC bb_perror_msg(const char *s, ...)
+{
+	va_list p;
+
+	va_start(p, s);
+	/* Guard against "<error message>: Success" */
+	bb_verror_msg(s, p, errno ? strerror(errno) : NULL);
+	va_end(p);
+}
+
+void FAST_FUNC bb_perror_msg_and_die(const char *s, ...)
+{
+	va_list p;
+
+	va_start(p, s);
+	/* Guard against "<error message>: Success" */
+	bb_verror_msg(s, p, errno ? strerror(errno) : NULL);
+	va_end(p);
+	xfunc_die();
+}
+
+void FAST_FUNC bb_simple_perror_msg(const char *s)
+{
+	bb_perror_msg("%s", s);
+}
+
+void FAST_FUNC bb_simple_perror_msg_and_die(const char *s)
+{
+	bb_perror_msg_and_die("%s", s);
+}
Index: /EcnlProtoTool/trunk/busybox/src/platform.h
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/platform.h	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/platform.h	(revision 447)
@@ -0,0 +1,582 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright 2006, Bernhard Reutner-Fischer
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+#ifndef BB_PLATFORM_H
+#define BB_PLATFORM_H 1
+
+
+/* Convenience macros to test the version of gcc. */
+#undef __GNUC_PREREQ
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define __GNUC_PREREQ(maj, min) \
+		((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+# define __GNUC_PREREQ(maj, min) 0
+#endif
+
+/* __restrict is known in EGCS 1.2 and above. */
+#if !__GNUC_PREREQ(2,92)
+# ifndef __restrict
+#  define __restrict
+# endif
+#endif
+
+#if !__GNUC_PREREQ(2,7)
+# ifndef __attribute__
+#  define __attribute__(x)
+# endif
+#endif
+
+#undef inline
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L
+/* it's a keyword */
+#elif __GNUC_PREREQ(2,7)
+# define inline __inline__
+#else
+# define inline
+#endif
+
+#ifndef __const
+# define __const const
+#endif
+
+#define UNUSED_PARAM __attribute__ ((__unused__))
+#define NORETURN __attribute__ ((__noreturn__))
+/* "The malloc attribute is used to tell the compiler that a function
+ * may be treated as if any non-NULL pointer it returns cannot alias
+ * any other pointer valid when the function returns. This will often
+ * improve optimization. Standard functions with this property include
+ * malloc and calloc. realloc-like functions have this property as long
+ * as the old pointer is never referred to (including comparing it
+ * to the new pointer) after the function returns a non-NULL value."
+ */
+#define RETURNS_MALLOC __attribute__ ((malloc))
+#define PACKED __attribute__ ((__packed__))
+#define ALIGNED(m) __attribute__ ((__aligned__(m)))
+
+/* __NO_INLINE__: some gcc's do not honor inlining! :( */
+#if __GNUC_PREREQ(3,0) && !defined(__NO_INLINE__)
+# define ALWAYS_INLINE __attribute__ ((always_inline)) inline
+/* I've seen a toolchain where I needed __noinline__ instead of noinline */
+# define NOINLINE      __attribute__((__noinline__))
+# if !ENABLE_WERROR
+#  define DEPRECATED __attribute__ ((__deprecated__))
+#  define UNUSED_PARAM_RESULT __attribute__ ((warn_unused_result))
+# else
+#  define DEPRECATED
+#  define UNUSED_PARAM_RESULT
+# endif
+#else
+# define ALWAYS_INLINE inline
+# define NOINLINE
+# define DEPRECATED
+# define UNUSED_PARAM_RESULT
+#endif
+
+/* used by unit test machinery to run registration functions before calling main() */
+#define INIT_FUNC __attribute__ ((constructor))
+
+/* -fwhole-program makes all symbols local. The attribute externally_visible
+ * forces a symbol global.  */
+#if __GNUC_PREREQ(4,1)
+# define EXTERNALLY_VISIBLE __attribute__(( visibility("default") ))
+//__attribute__ ((__externally_visible__))
+#else
+# define EXTERNALLY_VISIBLE
+#endif
+
+/* At 4.4 gcc become much more anal about this, need to use "aliased" types */
+#if __GNUC_PREREQ(4,4)
+# define FIX_ALIASING __attribute__((__may_alias__))
+#else
+# define FIX_ALIASING
+#endif
+
+/* We use __extension__ in some places to suppress -pedantic warnings
+ * about GCC extensions.  This feature didn't work properly before
+ * gcc 2.8.  */
+#if !__GNUC_PREREQ(2,8)
+# ifndef __extension__
+#  define __extension__
+# endif
+#endif
+
+/* FAST_FUNC is a qualifier which (possibly) makes function call faster
+ * and/or smaller by using modified ABI. It is usually only needed
+ * on non-static, busybox internal functions. Recent versions of gcc
+ * optimize statics automatically. FAST_FUNC on static is required
+ * only if you need to match a function pointer's type */
+#if __GNUC_PREREQ(3,0) && defined(i386) /* || defined(__x86_64__)? */
+/* stdcall makes callee to pop arguments from stack, not caller */
+# define FAST_FUNC __attribute__((regparm(3),stdcall))
+/* #elif ... - add your favorite arch today! */
+#else
+# define FAST_FUNC
+#endif
+
+/* Make all declarations hidden (-fvisibility flag only affects definitions) */
+/* (don't include system headers after this until corresponding pop!) */
+#if __GNUC_PREREQ(4,1) && !defined(__CYGWIN__)
+# define PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN _Pragma("GCC visibility push(hidden)")
+# define POP_SAVED_FUNCTION_VISIBILITY              _Pragma("GCC visibility pop")
+#else
+# define PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
+# define POP_SAVED_FUNCTION_VISIBILITY
+#endif
+
+/* gcc-2.95 had no va_copy but only __va_copy. */
+#if !__GNUC_PREREQ(3,0)
+# include <stdarg.h>
+# if !defined va_copy && defined __va_copy
+#  define va_copy(d,s) __va_copy((d),(s))
+# endif
+#endif
+
+
+/* ---- Endian Detection ------------------------------------ */
+
+#include <limits.h>
+#if defined(__digital__) && defined(__unix__)
+# include <sex.h>
+#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \
+   || defined(__APPLE__)
+# include <sys/resource.h>  /* rlimit */
+# include <machine/endian.h>
+# define bswap_64 __bswap64
+# define bswap_32 __bswap32
+# define bswap_16 __bswap16
+#else
+# include <byteswap.h>
+# include <endian.h>
+#endif
+
+#if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN
+# define BB_BIG_ENDIAN 1
+# define BB_LITTLE_ENDIAN 0
+#elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN
+# define BB_BIG_ENDIAN 0
+# define BB_LITTLE_ENDIAN 1
+#elif defined(_BYTE_ORDER) && _BYTE_ORDER == _BIG_ENDIAN
+# define BB_BIG_ENDIAN 1
+# define BB_LITTLE_ENDIAN 0
+#elif defined(_BYTE_ORDER) && _BYTE_ORDER == _LITTLE_ENDIAN
+# define BB_BIG_ENDIAN 0
+# define BB_LITTLE_ENDIAN 1
+#elif defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
+# define BB_BIG_ENDIAN 1
+# define BB_LITTLE_ENDIAN 0
+#elif defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN
+# define BB_BIG_ENDIAN 0
+# define BB_LITTLE_ENDIAN 1
+#elif defined(__386__)
+# define BB_BIG_ENDIAN 0
+# define BB_LITTLE_ENDIAN 1
+#else
+# error "Can't determine endianness"
+#endif
+
+#if ULONG_MAX > 0xffffffff
+# define bb_bswap_64(x) bswap_64(x)
+#endif
+
+/* SWAP_LEnn means "convert CPU<->little_endian by swapping bytes" */
+#if BB_BIG_ENDIAN
+# define SWAP_BE16(x) (x)
+# define SWAP_BE32(x) (x)
+# define SWAP_BE64(x) (x)
+# define SWAP_LE16(x) bswap_16(x)
+# define SWAP_LE32(x) bswap_32(x)
+# define SWAP_LE64(x) bb_bswap_64(x)
+# define IF_BIG_ENDIAN(...) __VA_ARGS__
+# define IF_LITTLE_ENDIAN(...)
+#else
+# define SWAP_BE16(x) bswap_16(x)
+# define SWAP_BE32(x) bswap_32(x)
+# define SWAP_BE64(x) bb_bswap_64(x)
+# define SWAP_LE16(x) (x)
+# define SWAP_LE32(x) (x)
+# define SWAP_LE64(x) (x)
+# define IF_BIG_ENDIAN(...)
+# define IF_LITTLE_ENDIAN(...) __VA_ARGS__
+#endif
+
+
+/* ---- Unaligned access ------------------------------------ */
+
+#include <stdint.h>
+typedef int      bb__aliased_int      FIX_ALIASING;
+typedef long     bb__aliased_long     FIX_ALIASING;
+typedef uint16_t bb__aliased_uint16_t FIX_ALIASING;
+typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
+typedef uint64_t bb__aliased_uint64_t FIX_ALIASING;
+
+/* NB: unaligned parameter should be a pointer, aligned one -
+ * a lvalue. This makes it more likely to not swap them by mistake
+ */
+#if defined(i386) || defined(__x86_64__) || defined(__powerpc__)
+# define BB_UNALIGNED_MEMACCESS_OK 1
+# define move_from_unaligned_int(v, intp)  ((v) = *(bb__aliased_int*)(intp))
+# define move_from_unaligned_long(v, longp) ((v) = *(bb__aliased_long*)(longp))
+# define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p))
+# define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p))
+# define move_to_unaligned16(u16p, v)   (*(bb__aliased_uint16_t*)(u16p) = (v))
+# define move_to_unaligned32(u32p, v)   (*(bb__aliased_uint32_t*)(u32p) = (v))
+/* #elif ... - add your favorite arch today! */
+#else
+# define BB_UNALIGNED_MEMACCESS_OK 0
+/* performs reasonably well (gcc usually inlines memcpy here) */
+# define move_from_unaligned_int(v, intp) (memcpy(&(v), (intp), sizeof(int)))
+# define move_from_unaligned_long(v, longp) (memcpy(&(v), (longp), sizeof(long)))
+# define move_from_unaligned16(v, u16p) (memcpy(&(v), (u16p), 2))
+# define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4))
+# define move_to_unaligned16(u16p, v) do { \
+	uint16_t __t = (v); \
+	memcpy((u16p), &__t, 2); \
+} while (0)
+# define move_to_unaligned32(u32p, v) do { \
+	uint32_t __t = (v); \
+	memcpy((u32p), &__t, 4); \
+} while (0)
+#endif
+
+
+/* ---- Size-saving "small" ints (arch-dependent) ----------- */
+
+#if defined(i386) || defined(__x86_64__) || defined(__mips__) || defined(__cris__)
+/* add other arches which benefit from this... */
+typedef signed char smallint;
+typedef unsigned char smalluint;
+#else
+/* for arches where byte accesses generate larger code: */
+typedef int smallint;
+typedef unsigned smalluint;
+#endif
+
+/* ISO C Standard:  7.16  Boolean type and values  <stdbool.h> */
+#if (defined __digital__ && defined __unix__)
+/* old system without (proper) C99 support */
+# define bool smalluint
+#else
+/* modern system, so use it */
+# include <stdbool.h>
+#endif
+
+
+/*----- Kernel versioning ------------------------------------*/
+
+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+
+#ifdef __UCLIBC__
+# define UCLIBC_VERSION KERNEL_VERSION(__UCLIBC_MAJOR__, __UCLIBC_MINOR__, __UCLIBC_SUBLEVEL__)
+#else
+# define UCLIBC_VERSION 0
+#endif
+
+
+/* ---- Miscellaneous --------------------------------------- */
+
+#if defined __GLIBC__ \
+ || defined __UCLIBC__ \
+ || defined __dietlibc__ \
+ || defined __BIONIC__ \
+ || defined _NEWLIB_VERSION
+# include <features.h>
+#endif
+
+/* Define bb_setpgrp */
+#if defined(__digital__) && defined(__unix__)
+/* use legacy setpgrp(pid_t, pid_t) for now.  move to platform.c */
+# define bb_setpgrp() do { pid_t __me = getpid(); setpgrp(__me, __me); } while (0)
+#else
+# define bb_setpgrp() setpgrp()
+#endif
+
+/* fdprintf is more readable, we used it before dprintf was standardized */
+#include <unistd.h>
+#define fdprintf dprintf
+
+/* Useful for defeating gcc's alignment of "char message[]"-like data */
+#if !defined(__s390__)
+    /* on s390[x], non-word-aligned data accesses require larger code */
+# define ALIGN1 __attribute__((aligned(1)))
+# define ALIGN2 __attribute__((aligned(2)))
+# define ALIGN4 __attribute__((aligned(4)))
+#else
+/* Arches which MUST have 2 or 4 byte alignment for everything are here */
+# define ALIGN1
+# define ALIGN2
+# define ALIGN4
+#endif
+
+/*
+ * For 0.9.29 and svn, __ARCH_USE_MMU__ indicates no-mmu reliably.
+ * For earlier versions there is no reliable way to check if we are building
+ * for a mmu-less system.
+ */
+#if ENABLE_NOMMU || \
+    (defined __UCLIBC__ && \
+     UCLIBC_VERSION > KERNEL_VERSION(0, 9, 28) && \
+     !defined __ARCH_USE_MMU__)
+# define BB_MMU 0
+# define USE_FOR_NOMMU(...) __VA_ARGS__
+# define USE_FOR_MMU(...)
+#else
+# define BB_MMU 1
+# define USE_FOR_NOMMU(...)
+# define USE_FOR_MMU(...) __VA_ARGS__
+#endif
+
+#if defined(__digital__) && defined(__unix__)
+# include <standards.h>
+# include <inttypes.h>
+# define PRIu32 "u"
+# if !defined ADJ_OFFSET_SINGLESHOT && defined MOD_CLKA && defined MOD_OFFSET
+#  define ADJ_OFFSET_SINGLESHOT (MOD_CLKA | MOD_OFFSET)
+# endif
+# if !defined ADJ_FREQUENCY && defined MOD_FREQUENCY
+#  define ADJ_FREQUENCY MOD_FREQUENCY
+# endif
+# if !defined ADJ_TIMECONST && defined MOD_TIMECONST
+#  define ADJ_TIMECONST MOD_TIMECONST
+# endif
+# if !defined ADJ_TICK && defined MOD_CLKB
+#  define ADJ_TICK MOD_CLKB
+# endif
+#endif
+
+#if defined(__CYGWIN__)
+# define MAXSYMLINKS SYMLOOP_MAX
+#endif
+
+#if defined(ANDROID) || defined(__ANDROID__)
+# define BB_ADDITIONAL_PATH ":/system/sbin:/system/bin:/system/xbin"
+# define SYS_ioprio_set __NR_ioprio_set
+# define SYS_ioprio_get __NR_ioprio_get
+#endif
+
+
+/* ---- Who misses what? ------------------------------------ */
+
+/* Assume all these functions and header files exist by default.
+ * Platforms where it is not true will #undef them below.
+ */
+#define HAVE_CLEARENV 1
+#define HAVE_FDATASYNC 1
+#define HAVE_DPRINTF 1
+#define HAVE_MEMRCHR 1
+#define HAVE_MKDTEMP 1
+#define HAVE_TTYNAME_R 1
+#define HAVE_PTSNAME_R 1
+#define HAVE_SETBIT 1
+#define HAVE_SIGHANDLER_T 1
+#define HAVE_STPCPY 1
+#define HAVE_MEMPCPY 1
+#define HAVE_STRCASESTR 1
+#define HAVE_STRCHRNUL 1
+#define HAVE_STRSEP 1
+#define HAVE_STRSIGNAL 1
+#define HAVE_STRVERSCMP 0
+#define HAVE_VASPRINTF 1
+#define HAVE_USLEEP 1
+#define HAVE_UNLOCKED_STDIO 1
+#define HAVE_UNLOCKED_LINE_OPS 1
+#define HAVE_GETLINE 1
+#define HAVE_XTABS 1
+#define HAVE_MNTENT_H 1
+#define HAVE_NET_ETHERNET_H 1
+#define HAVE_SYS_STATFS_H 1
+
+#if defined(__UCLIBC__)
+# if UCLIBC_VERSION < KERNEL_VERSION(0, 9, 32)
+#  undef HAVE_STRVERSCMP
+# endif
+# if UCLIBC_VERSION >= KERNEL_VERSION(0, 9, 30)
+#  ifndef __UCLIBC_SUSV3_LEGACY__
+#   undef HAVE_USLEEP
+#  endif
+# endif
+#endif
+
+#if defined(__WATCOMC__)
+# undef HAVE_DPRINTF
+# undef HAVE_GETLINE
+# undef HAVE_MEMRCHR
+# undef HAVE_MKDTEMP
+# undef HAVE_SETBIT
+# undef HAVE_STPCPY
+# undef HAVE_STRCASESTR
+# undef HAVE_STRCHRNUL
+# undef HAVE_STRSEP
+# undef HAVE_STRSIGNAL
+# undef HAVE_STRVERSCMP
+# undef HAVE_VASPRINTF
+# undef HAVE_UNLOCKED_STDIO
+# undef HAVE_UNLOCKED_LINE_OPS
+# undef HAVE_NET_ETHERNET_H
+#endif
+
+#if defined(__CYGWIN__)
+# undef HAVE_CLEARENV
+# undef HAVE_FDPRINTF
+# undef HAVE_MEMRCHR
+# undef HAVE_PTSNAME_R
+# undef HAVE_STRVERSCMP
+# undef HAVE_UNLOCKED_LINE_OPS
+#endif
+
+/* These BSD-derived OSes share many similarities */
+#if (defined __digital__ && defined __unix__) \
+ || defined __APPLE__ \
+ || defined __OpenBSD__ || defined __NetBSD__
+# undef HAVE_CLEARENV
+# undef HAVE_FDATASYNC
+# undef HAVE_GETLINE
+# undef HAVE_MNTENT_H
+# undef HAVE_PTSNAME_R
+# undef HAVE_SYS_STATFS_H
+# undef HAVE_SIGHANDLER_T
+# undef HAVE_STRVERSCMP
+# undef HAVE_XTABS
+# undef HAVE_DPRINTF
+# undef HAVE_UNLOCKED_STDIO
+# undef HAVE_UNLOCKED_LINE_OPS
+#endif
+
+#if defined(__dietlibc__)
+# undef HAVE_STRCHRNUL
+#endif
+
+#if defined(__APPLE__)
+# undef HAVE_STRCHRNUL
+#endif
+
+#if defined(__FreeBSD__)
+/* users say mempcpy is not present in FreeBSD 9.x */
+# undef HAVE_MEMPCPY
+# undef HAVE_CLEARENV
+# undef HAVE_FDATASYNC
+# undef HAVE_MNTENT_H
+# undef HAVE_PTSNAME_R
+# undef HAVE_SYS_STATFS_H
+# undef HAVE_SIGHANDLER_T
+# undef HAVE_STRVERSCMP
+# undef HAVE_XTABS
+# undef HAVE_UNLOCKED_LINE_OPS
+# include <osreldate.h>
+# if __FreeBSD_version < 1000029
+#  undef HAVE_STRCHRNUL /* FreeBSD added strchrnul() between 1000028 and 1000029 */
+# endif
+#endif
+
+#if defined(__NetBSD__)
+# define HAVE_GETLINE 1  /* Recent NetBSD versions have getline() */
+#endif
+
+#if defined(__digital__) && defined(__unix__)
+# undef HAVE_STPCPY
+#endif
+
+#if defined(ANDROID) || defined(__ANDROID__)
+# if __ANDROID_API__ < 8
+   /* ANDROID < 8 has no [f]dprintf at all */
+#  undef HAVE_DPRINTF
+# elif __ANDROID_API__ < 21
+   /* ANDROID < 21 has fdprintf */
+#  define dprintf fdprintf
+# else
+   /* ANDROID >= 21 has standard dprintf */
+# endif
+# if __ANDROID_API__ < 21
+#  undef HAVE_TTYNAME_R
+#  undef HAVE_GETLINE
+#  undef HAVE_STPCPY
+# endif
+# undef HAVE_MEMPCPY
+# undef HAVE_STRCHRNUL
+# undef HAVE_STRVERSCMP
+# undef HAVE_UNLOCKED_LINE_OPS
+# undef HAVE_NET_ETHERNET_H
+#endif
+
+/*
+ * Now, define prototypes for all the functions defined in platform.c
+ * These must come after all the HAVE_* macros are defined (or not)
+ */
+
+#ifndef HAVE_DPRINTF
+extern int dprintf(int fd, const char *format, ...);
+#endif
+
+#ifndef HAVE_MEMRCHR
+extern void *memrchr(const void *s, int c, size_t n) FAST_FUNC;
+#endif
+
+#ifndef HAVE_MKDTEMP
+extern char *mkdtemp(char *template) FAST_FUNC;
+#endif
+
+#ifndef HAVE_TTYNAME_R
+#define ttyname_r bb_ttyname_r
+extern int ttyname_r(int fd, char *buf, size_t buflen);
+#endif
+
+#ifndef HAVE_SETBIT
+# define setbit(a, b)  ((a)[(b) >> 3] |= 1 << ((b) & 7))
+# define clrbit(a, b)  ((a)[(b) >> 3] &= ~(1 << ((b) & 7)))
+#endif
+
+#ifndef HAVE_SIGHANDLER_T
+typedef void (*sighandler_t)(int);
+#endif
+
+#ifndef HAVE_STPCPY
+extern char *stpcpy(char *p, const char *to_add) FAST_FUNC;
+#endif
+
+#ifndef HAVE_MEMPCPY
+#include <string.h>
+/* In case we are wrong about !HAVE_MEMPCPY, and toolchain _does_ have
+ * mempcpy(), avoid colliding with it:
+ */
+#define mempcpy bb__mempcpy
+static ALWAYS_INLINE void *mempcpy(void *dest, const void *src, size_t len)
+{
+	return memcpy(dest, src, len) + len;
+}
+#endif
+
+#ifndef HAVE_STRCASESTR
+extern char *strcasestr(const char *s, const char *pattern) FAST_FUNC;
+#endif
+
+#ifndef HAVE_STRCHRNUL
+extern char *strchrnul(const char *s, int c) FAST_FUNC;
+#endif
+
+#ifndef HAVE_STRSEP
+extern char *strsep(char **stringp, const char *delim) FAST_FUNC;
+#endif
+
+#ifndef HAVE_STRSIGNAL
+/* Not exactly the same: instead of "Stopped" it shows "STOP" etc */
+# define strsignal(sig) get_signame(sig)
+#endif
+
+#ifndef HAVE_USLEEP
+extern int usleep(unsigned) FAST_FUNC;
+#endif
+
+#ifndef HAVE_VASPRINTF
+extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC;
+#endif
+
+#ifndef HAVE_GETLINE
+# include <stdio.h> /* for FILE */
+# include <sys/types.h> /* size_t */
+extern ssize_t getline(char **lineptr, size_t *n, FILE *stream) FAST_FUNC;
+#endif
+
+#endif
Index: /EcnlProtoTool/trunk/busybox/src/ptr_to_globals.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/ptr_to_globals.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/ptr_to_globals.c	(revision 447)
@@ -0,0 +1,35 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2008 by Denys Vlasenko <vda.linux@googlemail.com>
+ *
+ * Licensed under GPLv2, see file LICENSE in this source tree.
+ */
+
+#include <errno.h>
+
+struct globals;
+
+#ifndef GCC_COMBINE
+
+/* We cheat here. It is declared as const ptr in libbb.h,
+ * but here we make it live in R/W memory */
+struct globals *ptr_to_globals;
+
+#ifdef __GLIBC__
+int *bb_errno;
+#endif
+
+
+#else
+
+
+/* gcc -combine will see through and complain */
+/* Using alternative method which is more likely to break
+ * on weird architectures, compilers, linkers and so on */
+struct globals *const ptr_to_globals __attribute__ ((section (".data")));
+
+#ifdef __GLIBC__
+int *const bb_errno __attribute__ ((section (".data")));
+#endif
+
+#endif
Index: /EcnlProtoTool/trunk/busybox/src/read.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/read.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/read.c	(revision 447)
@@ -0,0 +1,72 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+#include "libbb.h"
+
+ssize_t FAST_FUNC safe_read(int fd, void *buf, size_t count)
+{
+	ssize_t n;
+
+	do {
+		n = read(fd, buf, count);
+	} while (n < 0 && errno == EINTR);
+
+	return n;
+}
+
+/*
+ * Read all of the supplied buffer from a file.
+ * This does multiple reads as necessary.
+ * Returns the amount read, or -1 on an error.
+ * A short read is returned on an end of file.
+ */
+ssize_t FAST_FUNC full_read(int fd, void *buf, size_t len)
+{
+	ssize_t cc;
+	ssize_t total;
+
+	total = 0;
+
+	while (len) {
+		cc = safe_read(fd, buf, len);
+
+		if (cc < 0) {
+			if (total) {
+				/* we already have some! */
+				/* user can do another read to know the error code */
+				return total;
+			}
+			return cc; /* read() returns -1 on failure. */
+		}
+		if (cc == 0)
+			break;
+		buf = ((char *)buf) + cc;
+		total += cc;
+		len -= cc;
+	}
+
+	return total;
+}
+
+ssize_t FAST_FUNC read_close(int fd, void *buf, size_t size)
+{
+	/*int e;*/
+	size = full_read(fd, buf, size);
+	/*e = errno;*/
+	close(fd);
+	/*errno = e;*/
+	return size;
+}
+
+ssize_t FAST_FUNC open_read_close(const char *filename, void *buf, size_t size)
+{
+	int fd = open(filename, O_RDONLY);
+	if (fd < 0)
+		return fd;
+	return read_close(fd, buf, size);
+}
Index: /EcnlProtoTool/trunk/busybox/src/read_key.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/read_key.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/read_key.c	(revision 447)
@@ -0,0 +1,293 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 2008 Rob Landley <rob@landley.net>
+ * Copyright (C) 2008 Denys Vlasenko <vda.linux@googlemail.com>
+ *
+ * Licensed under GPLv2, see file LICENSE in this source tree.
+ */
+#include "libbb.h"
+
+int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout)
+{
+	struct pollfd pfd;
+	const char *seq;
+	int n;
+
+	/* Known escape sequences for cursor and function keys.
+	 * See "Xterm Control Sequences"
+	 * http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
+	 * Array should be sorted from shortest to longest.
+	 */
+	static const char esccmds[] ALIGN1 = {
+		'\x7f'         |0x80,KEYCODE_ALT_BACKSPACE,
+		'\b'           |0x80,KEYCODE_ALT_BACKSPACE,
+		'd'            |0x80,KEYCODE_ALT_D   ,
+	/* lineedit mimics bash: Alt-f and Alt-b are forward/backward
+	 * word jumps. We cheat here and make them return ALT_LEFT/RIGHT
+	 * keycodes. This way, lineedit need no special code to handle them.
+	 * If we'll need to distinguish them, introduce new ALT_F/B keycodes,
+	 * and update lineedit to react to them.
+	 */
+		'f'            |0x80,KEYCODE_ALT_RIGHT,
+		'b'            |0x80,KEYCODE_ALT_LEFT,
+		'O','A'        |0x80,KEYCODE_UP      ,
+		'O','B'        |0x80,KEYCODE_DOWN    ,
+		'O','C'        |0x80,KEYCODE_RIGHT   ,
+		'O','D'        |0x80,KEYCODE_LEFT    ,
+		'O','H'        |0x80,KEYCODE_HOME    ,
+		'O','F'        |0x80,KEYCODE_END     ,
+#if 0
+		'O','P'        |0x80,KEYCODE_FUN1    ,
+		/* [ESC] ESC O [2] P - [Alt-][Shift-]F1 */
+		/* ESC [ O 1 ; 2 P - Shift-F1 */
+		/* ESC [ O 1 ; 3 P - Alt-F1 */
+		/* ESC [ O 1 ; 4 P - Alt-Shift-F1 */
+		/* ESC [ O 1 ; 5 P - Ctrl-F1 */
+		/* ESC [ O 1 ; 6 P - Ctrl-Shift-F1 */
+		'O','Q'        |0x80,KEYCODE_FUN2    ,
+		'O','R'        |0x80,KEYCODE_FUN3    ,
+		'O','S'        |0x80,KEYCODE_FUN4    ,
+#endif
+		'[','A'        |0x80,KEYCODE_UP      ,
+		'[','B'        |0x80,KEYCODE_DOWN    ,
+		'[','C'        |0x80,KEYCODE_RIGHT   ,
+		'[','D'        |0x80,KEYCODE_LEFT    ,
+		/* ESC [ 1 ; 2 x, where x = A/B/C/D: Shift-<arrow> */
+		/* ESC [ 1 ; 3 x, where x = A/B/C/D: Alt-<arrow> - implemented below */
+		/* ESC [ 1 ; 4 x, where x = A/B/C/D: Alt-Shift-<arrow> */
+		/* ESC [ 1 ; 5 x, where x = A/B/C/D: Ctrl-<arrow> - implemented below */
+		/* ESC [ 1 ; 6 x, where x = A/B/C/D: Ctrl-Shift-<arrow> */
+		/* ESC [ 1 ; 7 x, where x = A/B/C/D: Ctrl-Alt-<arrow> */
+		/* ESC [ 1 ; 8 x, where x = A/B/C/D: Ctrl-Alt-Shift-<arrow> */
+		'[','H'        |0x80,KEYCODE_HOME    , /* xterm */
+		'[','F'        |0x80,KEYCODE_END     , /* xterm */
+		/* [ESC] ESC [ [2] H - [Alt-][Shift-]Home (End similarly?) */
+		/* '[','Z'        |0x80,KEYCODE_SHIFT_TAB, */
+		'[','1','~'    |0x80,KEYCODE_HOME    , /* vt100? linux vt? or what? */
+		'[','2','~'    |0x80,KEYCODE_INSERT  ,
+		/* ESC [ 2 ; 3 ~ - Alt-Insert */
+		'[','3','~'    |0x80,KEYCODE_DELETE  ,
+		/* [ESC] ESC [ 3 [;2] ~ - [Alt-][Shift-]Delete */
+		/* ESC [ 3 ; 3 ~ - Alt-Delete */
+		/* ESC [ 3 ; 5 ~ - Ctrl-Delete */
+		'[','4','~'    |0x80,KEYCODE_END     , /* vt100? linux vt? or what? */
+		'[','5','~'    |0x80,KEYCODE_PAGEUP  ,
+		/* ESC [ 5 ; 3 ~ - Alt-PgUp */
+		/* ESC [ 5 ; 5 ~ - Ctrl-PgUp */
+		/* ESC [ 5 ; 7 ~ - Ctrl-Alt-PgUp */
+		'[','6','~'    |0x80,KEYCODE_PAGEDOWN,
+		'[','7','~'    |0x80,KEYCODE_HOME    , /* vt100? linux vt? or what? */
+		'[','8','~'    |0x80,KEYCODE_END     , /* vt100? linux vt? or what? */
+#if 0
+		'[','1','1','~'|0x80,KEYCODE_FUN1    , /* old xterm, deprecated by ESC O P */
+		'[','1','2','~'|0x80,KEYCODE_FUN2    , /* old xterm... */
+		'[','1','3','~'|0x80,KEYCODE_FUN3    , /* old xterm... */
+		'[','1','4','~'|0x80,KEYCODE_FUN4    , /* old xterm... */
+		'[','1','5','~'|0x80,KEYCODE_FUN5    ,
+		/* [ESC] ESC [ 1 5 [;2] ~ - [Alt-][Shift-]F5 */
+		'[','1','7','~'|0x80,KEYCODE_FUN6    ,
+		'[','1','8','~'|0x80,KEYCODE_FUN7    ,
+		'[','1','9','~'|0x80,KEYCODE_FUN8    ,
+		'[','2','0','~'|0x80,KEYCODE_FUN9    ,
+		'[','2','1','~'|0x80,KEYCODE_FUN10   ,
+		'[','2','3','~'|0x80,KEYCODE_FUN11   ,
+		'[','2','4','~'|0x80,KEYCODE_FUN12   ,
+		/* ESC [ 2 4 ; 2 ~ - Shift-F12 */
+		/* ESC [ 2 4 ; 3 ~ - Alt-F12 */
+		/* ESC [ 2 4 ; 4 ~ - Alt-Shift-F12 */
+		/* ESC [ 2 4 ; 5 ~ - Ctrl-F12 */
+		/* ESC [ 2 4 ; 6 ~ - Ctrl-Shift-F12 */
+#endif
+		/* '[','1',';','5','A' |0x80,KEYCODE_CTRL_UP   , - unused */
+		/* '[','1',';','5','B' |0x80,KEYCODE_CTRL_DOWN , - unused */
+		'[','1',';','5','C' |0x80,KEYCODE_CTRL_RIGHT,
+		'[','1',';','5','D' |0x80,KEYCODE_CTRL_LEFT ,
+		/* '[','1',';','3','A' |0x80,KEYCODE_ALT_UP    , - unused */
+		/* '[','1',';','3','B' |0x80,KEYCODE_ALT_DOWN  , - unused */
+		'[','1',';','3','C' |0x80,KEYCODE_ALT_RIGHT,
+		'[','1',';','3','D' |0x80,KEYCODE_ALT_LEFT ,
+		/* '[','3',';','3','~' |0x80,KEYCODE_ALT_DELETE, - unused */
+		0
+	};
+
+	pfd.fd = fd;
+	pfd.events = POLLIN;
+
+	buffer++; /* saved chars counter is in buffer[-1] now */
+
+ start_over:
+	errno = 0;
+	n = (unsigned char)buffer[-1];
+	if (n == 0) {
+		/* If no data, wait for input.
+		 * If requested, wait TIMEOUT ms. TIMEOUT = -1 is useful
+		 * if fd can be in non-blocking mode.
+		 */
+		if (timeout >= -1) {
+			if (safe_poll(&pfd, 1, timeout) == 0) {
+				/* Timed out */
+				errno = EAGAIN;
+				return -1;
+			}
+		}
+		/* It is tempting to read more than one byte here,
+		 * but it breaks pasting. Example: at shell prompt,
+		 * user presses "c","a","t" and then pastes "\nline\n".
+		 * When we were reading 3 bytes here, we were eating
+		 * "li" too, and cat was getting wrong input.
+		 */
+		n = safe_read(fd, buffer, 1);
+		if (n <= 0)
+			return -1;
+	}
+
+	{
+		unsigned char c = buffer[0];
+		n--;
+		if (n)
+			memmove(buffer, buffer + 1, n);
+		/* Only ESC starts ESC sequences */
+		if (c != 27) {
+			buffer[-1] = n;
+			return c;
+		}
+	}
+
+	/* Loop through known ESC sequences */
+	seq = esccmds;
+	while (*seq != '\0') {
+		/* n - position in sequence we did not read yet */
+		int i = 0; /* position in sequence to compare */
+
+		/* Loop through chars in this sequence */
+		while (1) {
+			/* So far escape sequence matched up to [i-1] */
+			if (n <= i) {
+				/* Need more chars, read another one if it wouldn't block.
+				 * Note that escape sequences come in as a unit,
+				 * so if we block for long it's not really an escape sequence.
+				 * Timeout is needed to reconnect escape sequences
+				 * split up by transmission over a serial console. */
+				if (safe_poll(&pfd, 1, 50) == 0) {
+					/* No more data!
+					 * Array is sorted from shortest to longest,
+					 * we can't match anything later in array -
+					 * anything later is longer than this seq.
+					 * Break out of both loops. */
+					goto got_all;
+				}
+				errno = 0;
+				if (safe_read(fd, buffer + n, 1) <= 0) {
+					/* If EAGAIN, then fd is O_NONBLOCK and poll lied:
+					 * in fact, there is no data. */
+					if (errno != EAGAIN) {
+						/* otherwise: it's EOF/error */
+						buffer[-1] = 0;
+						return -1;
+					}
+					goto got_all;
+				}
+				n++;
+			}
+			if (buffer[i] != (seq[i] & 0x7f)) {
+				/* This seq doesn't match, go to next */
+				seq += i;
+				/* Forward to last char */
+				while (!(*seq & 0x80))
+					seq++;
+				/* Skip it and the keycode which follows */
+				seq += 2;
+				break;
+			}
+			if (seq[i] & 0x80) {
+				/* Entire seq matched */
+				n = 0;
+				/* n -= i; memmove(...);
+				 * would be more correct,
+				 * but we never read ahead that much,
+				 * and n == i here. */
+				buffer[-1] = 0;
+				return (signed char)seq[i+1];
+			}
+			i++;
+		}
+	}
+	/* We did not find matching sequence.
+	 * We possibly read and stored more input in buffer[] by now.
+	 * n = bytes read. Try to read more until we time out.
+	 */
+	while (n < KEYCODE_BUFFER_SIZE-1) { /* 1 for count byte at buffer[-1] */
+		if (safe_poll(&pfd, 1, 50) == 0) {
+			/* No more data! */
+			break;
+		}
+		errno = 0;
+		if (safe_read(fd, buffer + n, 1) <= 0) {
+			/* If EAGAIN, then fd is O_NONBLOCK and poll lied:
+			 * in fact, there is no data. */
+			if (errno != EAGAIN) {
+				/* otherwise: it's EOF/error */
+				buffer[-1] = 0;
+				return -1;
+			}
+			break;
+		}
+		n++;
+		/* Try to decipher "ESC [ NNN ; NNN R" sequence */
+		if ((ENABLE_FEATURE_EDITING_ASK_TERMINAL
+		    || ENABLE_FEATURE_VI_ASK_TERMINAL
+		    || ENABLE_FEATURE_LESS_ASK_TERMINAL
+		    )
+		 && n >= 5
+		 && buffer[0] == '['
+		 && buffer[n-1] == 'R'
+		 && isdigit(buffer[1])
+		) {
+			char *end;
+			unsigned long row, col;
+
+			row = strtoul(buffer + 1, &end, 10);
+			if (*end != ';' || !isdigit(end[1]))
+				continue;
+			col = strtoul(end + 1, &end, 10);
+			if (*end != 'R')
+				continue;
+			if (row < 1 || col < 1 || (row | col) > 0x7fff)
+				continue;
+
+			buffer[-1] = 0;
+			/* Pack into "1 <row15bits> <col16bits>" 32-bit sequence */
+			col |= (((-1 << 15) | row) << 16);
+			/* Return it in high-order word */
+			return ((int64_t) col << 32) | (uint32_t)KEYCODE_CURSOR_POS;
+		}
+	}
+ got_all:
+
+	if (n <= 1) {
+		/* Alt-x is usually returned as ESC x.
+		 * Report ESC, x is remembered for the next call.
+		 */
+		buffer[-1] = n;
+		return 27;
+	}
+
+	/* We were doing "buffer[-1] = n; return c;" here, but this results
+	 * in unknown key sequences being interpreted as ESC + garbage.
+	 * This was not useful. Pretend there was no key pressed,
+	 * go and wait for a new keypress:
+	 */
+	buffer[-1] = 0;
+	goto start_over;
+}
+
+void FAST_FUNC read_key_ungets(char *buffer, const char *str, unsigned len)
+{
+	unsigned cur_len = (unsigned char)buffer[0];
+	if (len > KEYCODE_BUFFER_SIZE-1 - cur_len)
+		len = KEYCODE_BUFFER_SIZE-1 - cur_len;
+	memcpy(buffer + 1 + cur_len, str, len);
+	buffer[0] += len;
+}
Index: /EcnlProtoTool/trunk/busybox/src/safe_poll.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/safe_poll.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/safe_poll.c	(revision 447)
@@ -0,0 +1,34 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 2007 by Denys Vlasenko <vda.linux@googlemail.com>
+ *
+ * Licensed under GPLv2, see file LICENSE in this source tree.
+ */
+
+#include "libbb.h"
+
+/* Wrapper which restarts poll on EINTR or ENOMEM.
+ * On other errors does perror("poll") and returns.
+ * Warning! May take longer than timeout_ms to return! */
+int FAST_FUNC safe_poll(struct pollfd *ufds, nfds_t nfds, int timeout)
+{
+	while (1) {
+		int n = poll(ufds, nfds, timeout);
+		if (n >= 0)
+			return n;
+		/* Make sure we inch towards completion */
+		if (timeout > 0)
+			timeout--;
+		/* E.g. strace causes poll to return this */
+		if (errno == EINTR)
+			continue;
+		/* Kernel is very low on memory. Retry. */
+		/* I doubt many callers would handle this correctly! */
+		if (errno == ENOMEM)
+			continue;
+		bb_perror_msg("poll");
+		return n;
+	}
+}
Index: /EcnlProtoTool/trunk/busybox/src/safe_write.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/safe_write.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/safe_write.c	(revision 447)
@@ -0,0 +1,21 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+
+#include "libbb.h"
+
+ssize_t FAST_FUNC safe_write(int fd, const void *buf, size_t count)
+{
+	ssize_t n;
+
+	do {
+		n = write(fd, buf, count);
+	} while (n < 0 && errno == EINTR);
+
+	return n;
+}
Index: /EcnlProtoTool/trunk/busybox/src/skip_whitespace.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/skip_whitespace.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/skip_whitespace.c	(revision 447)
@@ -0,0 +1,39 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * skip_whitespace implementation for busybox
+ *
+ * Copyright (C) 2003  Manuel Novoa III  <mjn3@codepoet.org>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+
+#include "libbb.h"
+
+char* FAST_FUNC skip_whitespace(const char *s)
+{
+	/* In POSIX/C locale (the only locale we care about: do we REALLY want
+	 * to allow Unicode whitespace in, say, .conf files? nuts!)
+	 * isspace is only these chars: "\t\n\v\f\r" and space.
+	 * "\t\n\v\f\r" happen to have ASCII codes 9,10,11,12,13.
+	 * Use that.
+	 */
+	while (*s == ' ' || (unsigned char)(*s - 9) <= (13 - 9))
+		s++;
+
+	return (char *) s;
+}
+
+char* FAST_FUNC skip_non_whitespace(const char *s)
+{
+	while (*s != '\0' && *s != ' ' && (unsigned char)(*s - 9) > (13 - 9))
+		s++;
+
+	return (char *) s;
+}
+
+char* FAST_FUNC skip_dev_pfx(const char *tty_name)
+{
+	if (is_prefixed_with(tty_name, "/dev/"))
+		tty_name += 5;
+	return (char*)tty_name;
+}
Index: /EcnlProtoTool/trunk/busybox/src/verror_msg.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/verror_msg.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/verror_msg.c	(revision 447)
@@ -0,0 +1,182 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+#include "libbb.h"
+#if ENABLE_FEATURE_SYSLOG
+# include <syslog.h>
+#endif
+
+#if ENABLE_FEATURE_SYSLOG
+smallint syslog_level = LOG_ERR;
+#endif
+smallint logmode = LOGMODE_STDIO;
+const char *msg_eol = "\n";
+
+void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr)
+{
+	char *msg, *msg1;
+	char stack_msg[80];
+	int applet_len, strerr_len, msgeol_len, used;
+
+	if (!logmode)
+		return;
+
+	if (!s) /* nomsg[_and_die] uses NULL fmt */
+		s = ""; /* some libc don't like printf(NULL) */
+
+	applet_len = strlen(applet_name) + 2; /* "applet: " */
+	strerr_len = strerr ? strlen(strerr) : 0;
+	msgeol_len = strlen(msg_eol);
+
+	/* This costs ~90 bytes of code, but avoids costly
+	 * malloc()[in vasprintf]+realloc()+memmove()+free() in 99% of cases.
+	 * ~40% speedup.
+	 */
+	if ((int)sizeof(stack_msg) - applet_len > 0) {
+		va_list p2;
+
+		/* It is not portable to use va_list twice, need to va_copy it */
+		va_copy(p2, p);
+		used = vsnprintf(stack_msg + applet_len, (int)sizeof(stack_msg) - applet_len, s, p2);
+		va_end(p2);
+		msg = stack_msg;
+		used += applet_len;
+		if (used < (int)sizeof(stack_msg) - 3 - msgeol_len - strerr_len)
+			goto add_pfx_and_sfx;
+	}
+
+	used = vasprintf(&msg, s, p);
+	if (used < 0)
+		return;
+
+	/* This is ugly and costs +60 bytes compared to multiple
+	 * fprintf's, but is guaranteed to do a single write.
+	 * This is needed for e.g. httpd logging, when multiple
+	 * children can produce log messages simultaneously. */
+
+	/* can't use xrealloc: it calls error_msg on failure,
+	 * that may result in a recursion */
+	/* +3 is for ": " before strerr and for terminating NUL */
+	msg1 = realloc(msg, applet_len + used + strerr_len + msgeol_len + 3);
+	if (!msg1) {
+		msg[used++] = '\n'; /* overwrites NUL */
+		applet_len = 0;
+	} else {
+		msg = msg1;
+		/* TODO: maybe use writev instead of memmoving? Need full_writev? */
+		memmove(msg + applet_len, msg, used);
+		used += applet_len;
+ add_pfx_and_sfx:
+		strcpy(msg, applet_name);
+		msg[applet_len - 2] = ':';
+		msg[applet_len - 1] = ' ';
+		if (strerr) {
+			if (s[0]) { /* not perror_nomsg? */
+				msg[used++] = ':';
+				msg[used++] = ' ';
+			}
+			strcpy(&msg[used], strerr);
+			used += strerr_len;
+		}
+		strcpy(&msg[used], msg_eol);
+		used += msgeol_len;
+	}
+
+	if (logmode & LOGMODE_STDIO) {
+		fflush_all();
+		full_write(STDERR_FILENO, msg, used);
+	}
+#if ENABLE_FEATURE_SYSLOG
+	if (logmode & LOGMODE_SYSLOG) {
+		syslog(syslog_level, "%s", msg + applet_len);
+	}
+#endif
+	if (msg != stack_msg)
+		free(msg);
+}
+
+#ifdef VERSION_WITH_WRITEV
+/* Code size is approximately the same, but currently it's the only user
+ * of writev in entire bbox. __libc_writev in uclibc is ~50 bytes. */
+void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr)
+{
+	int strerr_len, msgeol_len;
+	struct iovec iov[3];
+
+#define used   (iov[2].iov_len)
+#define msgv   (iov[2].iov_base)
+#define msgc   ((char*)(iov[2].iov_base))
+#define msgptr (&(iov[2].iov_base))
+
+	if (!logmode)
+		return;
+
+	if (!s) /* nomsg[_and_die] uses NULL fmt */
+		s = ""; /* some libc don't like printf(NULL) */
+
+	/* Prevent "derefing type-punned ptr will break aliasing rules" */
+	used = vasprintf((char**)(void*)msgptr, s, p);
+	if (used < 0)
+		return;
+
+	/* This is ugly and costs +60 bytes compared to multiple
+	 * fprintf's, but is guaranteed to do a single write.
+	 * This is needed for e.g. httpd logging, when multiple
+	 * children can produce log messages simultaneously. */
+
+	strerr_len = strerr ? strlen(strerr) : 0;
+	msgeol_len = strlen(msg_eol);
+	/* +3 is for ": " before strerr and for terminating NUL */
+	msgv = xrealloc(msgv, used + strerr_len + msgeol_len + 3);
+	if (strerr) {
+		msgc[used++] = ':';
+		msgc[used++] = ' ';
+		strcpy(msgc + used, strerr);
+		used += strerr_len;
+	}
+	strcpy(msgc + used, msg_eol);
+	used += msgeol_len;
+
+	if (logmode & LOGMODE_STDIO) {
+		iov[0].iov_base = (char*)applet_name;
+		iov[0].iov_len = strlen(applet_name);
+		iov[1].iov_base = (char*)": ";
+		iov[1].iov_len = 2;
+		/*iov[2].iov_base = msgc;*/
+		/*iov[2].iov_len = used;*/
+		fflush_all();
+		writev(STDERR_FILENO, iov, 3);
+	}
+# if ENABLE_FEATURE_SYSLOG
+	if (logmode & LOGMODE_SYSLOG) {
+		syslog(LOG_ERR, "%s", msgc);
+	}
+# endif
+	free(msgc);
+}
+#endif
+
+
+void FAST_FUNC bb_error_msg_and_die(const char *s, ...)
+{
+	va_list p;
+
+	va_start(p, s);
+	bb_verror_msg(s, p, NULL);
+	va_end(p);
+	xfunc_die();
+}
+
+void FAST_FUNC bb_error_msg(const char *s, ...)
+{
+	va_list p;
+
+	va_start(p, s);
+	bb_verror_msg(s, p, NULL);
+	va_end(p);
+}
Index: /EcnlProtoTool/trunk/busybox/src/vi.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/vi.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/vi.c	(revision 447)
@@ -0,0 +1,4794 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * tiny vi.c: A small 'vi' clone
+ * Copyright (C) 2000, 2001 Sterling Huxley <sterling@europa.com>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+
+/*
+ * Things To Do:
+ *	EXINIT
+ *	$HOME/.exrc  and  ./.exrc
+ *	add magic to search	/foo.*bar
+ *	add :help command
+ *	:map macros
+ *	if mark[] values were line numbers rather than pointers
+ *      it would be easier to change the mark when add/delete lines
+ *	More intelligence in refresh()
+ *	":r !cmd"  and  "!cmd"  to filter text through an external command
+ *	An "ex" line oriented mode- maybe using "cmdedit"
+ */
+
+//config:config VI
+//config:	bool "vi"
+//config:	default y
+//config:	help
+//config:	  'vi' is a text editor. More specifically, it is the One True
+//config:	  text editor <grin>. It does, however, have a rather steep
+//config:	  learning curve. If you are not already comfortable with 'vi'
+//config:	  you may wish to use something else.
+//config:
+//config:config FEATURE_VI_MAX_LEN
+//config:	int "Maximum screen width in vi"
+//config:	range 256 16384
+//config:	default 4096
+//config:	depends on VI
+//config:	help
+//config:	  Contrary to what you may think, this is not eating much.
+//config:	  Make it smaller than 4k only if you are very limited on memory.
+//config:
+//config:config FEATURE_VI_8BIT
+//config:	bool "Allow vi to display 8-bit chars (otherwise shows dots)"
+//config:	default n
+//config:	depends on VI
+//config:	help
+//config:	  If your terminal can display characters with high bit set,
+//config:	  you may want to enable this. Note: vi is not Unicode-capable.
+//config:	  If your terminal combines several 8-bit bytes into one character
+//config:	  (as in Unicode mode), this will not work properly.
+//config:
+//config:config FEATURE_VI_COLON
+//config:	bool "Enable \":\" colon commands (no \"ex\" mode)"
+//config:	default y
+//config:	depends on VI
+//config:	help
+//config:	  Enable a limited set of colon commands for vi. This does not
+//config:	  provide an "ex" mode.
+//config:
+//config:config FEATURE_VI_YANKMARK
+//config:	bool "Enable yank/put commands and mark cmds"
+//config:	default y
+//config:	depends on VI
+//config:	help
+//config:	  This will enable you to use yank and put, as well as mark in
+//config:	  busybox vi.
+//config:
+//config:config FEATURE_VI_SEARCH
+//config:	bool "Enable search and replace cmds"
+//config:	default y
+//config:	depends on VI
+//config:	help
+//config:	  Select this if you wish to be able to do search and replace in
+//config:	  busybox vi.
+//config:
+//config:config FEATURE_VI_REGEX_SEARCH
+//config:	bool "Enable regex in search and replace"
+//config:	default n   # Uses GNU regex, which may be unavailable. FIXME
+//config:	depends on FEATURE_VI_SEARCH
+//config:	help
+//config:	  Use extended regex search.
+//config:
+//config:config FEATURE_VI_USE_SIGNALS
+//config:	bool "Catch signals"
+//config:	default y
+//config:	depends on VI
+//config:	help
+//config:	  Selecting this option will make busybox vi signal aware. This will
+//config:	  make busybox vi support SIGWINCH to deal with Window Changes, catch
+//config:	  Ctrl-Z and Ctrl-C and alarms.
+//config:
+//config:config FEATURE_VI_DOT_CMD
+//config:	bool "Remember previous cmd and \".\" cmd"
+//config:	default y
+//config:	depends on VI
+//config:	help
+//config:	  Make busybox vi remember the last command and be able to repeat it.
+//config:
+//config:config FEATURE_VI_READONLY
+//config:	bool "Enable -R option and \"view\" mode"
+//config:	default y
+//config:	depends on VI
+//config:	help
+//config:	  Enable the read-only command line option, which allows the user to
+//config:	  open a file in read-only mode.
+//config:
+//config:config FEATURE_VI_SETOPTS
+//config:	bool "Enable set-able options, ai ic showmatch"
+//config:	default y
+//config:	depends on VI
+//config:	help
+//config:	  Enable the editor to set some (ai, ic, showmatch) options.
+//config:
+//config:config FEATURE_VI_SET
+//config:	bool "Support for :set"
+//config:	default y
+//config:	depends on VI
+//config:	help
+//config:	  Support for ":set".
+//config:
+//config:config FEATURE_VI_WIN_RESIZE
+//config:	bool "Handle window resize"
+//config:	default y
+//config:	depends on VI
+//config:	help
+//config:	  Make busybox vi behave nicely with terminals that get resized.
+//config:
+//config:config FEATURE_VI_ASK_TERMINAL
+//config:	bool "Use 'tell me cursor position' ESC sequence to measure window"
+//config:	default y
+//config:	depends on VI
+//config:	help
+//config:	  If terminal size can't be retrieved and $LINES/$COLUMNS are not set,
+//config:	  this option makes vi perform a last-ditch effort to find it:
+//config:	  position cursor to 999,999 and ask terminal to report real
+//config:	  cursor position using "ESC [ 6 n" escape sequence, then read stdin.
+//config:
+//config:	  This is not clean but helps a lot on serial lines and such.
+//config:config FEATURE_VI_UNDO
+//config:	bool "Support undo command 'u'"
+//config:	default y
+//config:	depends on VI
+//config:	help
+//config:	  Support the 'u' command to undo insertion, deletion, and replacement
+//config:	  of text.
+//config:config FEATURE_VI_UNDO_QUEUE
+//config:	bool "Enable undo operation queuing"
+//config:	default y
+//config:	depends on FEATURE_VI_UNDO
+//config:	help
+//config:	  The vi undo functions can use an intermediate queue to greatly lower
+//config:	  malloc() calls and overhead. When the maximum size of this queue is
+//config:	  reached, the contents of the queue are committed to the undo stack.
+//config:	  This increases the size of the undo code and allows some undo
+//config:	  operations (especially un-typing/backspacing) to be far more useful.
+//config:config FEATURE_VI_UNDO_QUEUE_MAX
+//config:	int "Maximum undo character queue size"
+//config:	default 256
+//config:	range 32 65536
+//config:	depends on FEATURE_VI_UNDO_QUEUE
+//config:	help
+//config:	  This option sets the number of bytes used at runtime for the queue.
+//config:	  Smaller values will create more undo objects and reduce the amount
+//config:	  of typed or backspaced characters that are grouped into one undo
+//config:	  operation; larger values increase the potential size of each undo
+//config:	  and will generally malloc() larger objects and less frequently.
+//config:	  Unless you want more (or less) frequent "undo points" while typing,
+//config:	  you should probably leave this unchanged.
+
+//applet:IF_VI(APPLET(vi, BB_DIR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_VI) += vi.o
+
+//usage:#define vi_trivial_usage
+//usage:       "[OPTIONS] [FILE]..."
+//usage:#define vi_full_usage "\n\n"
+//usage:       "Edit FILE\n"
+//usage:	IF_FEATURE_VI_COLON(
+//usage:     "\n	-c CMD	Initial command to run ($EXINIT also available)"
+//usage:	)
+//usage:	IF_FEATURE_VI_READONLY(
+//usage:     "\n	-R	Read-only"
+//usage:	)
+//usage:     "\n	-H	List available features"
+
+#include "libbb.h"
+/* Should be after libbb.h: on some systems regex.h needs sys/types.h: */
+#if ENABLE_FEATURE_VI_REGEX_SEARCH
+# include <regex.h>
+#endif
+
+/* the CRASHME code is unmaintained, and doesn't currently build */
+#define ENABLE_FEATURE_VI_CRASHME 0
+
+#define ENABLE_BASIC_MULTI_CHAR_CODE
+
+#if ENABLE_LOCALE_SUPPORT
+
+#if ENABLE_FEATURE_VI_8BIT
+//FIXME: this does not work properly for Unicode anyway
+# define Isprint(c) (isprint)(c)
+#else
+# define Isprint(c) isprint_asciionly(c)
+#endif
+
+#else
+
+/* 0x9b is Meta-ESC */
+#if ENABLE_FEATURE_VI_8BIT
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+# define Isprint(c) ((unsigned char)(c) >= ' ' && (c) != 0x7f && (unsigned char)(c) != 0x9b)
+#else
+#define MULTI_BYTE_MULTIPLE	3
+bool Isprint(unsigned char c)
+{
+	static int mbc_st = 0;
+
+	if (mbc_st == 0) {
+		if ((c & 0xE0) == 0xC0) { mbc_st = 2; }
+		else if ((c & 0xF0) == 0xE0) { mbc_st = 3; }
+		else if ((c & 0xF8) == 0xF0) { mbc_st = 4; }
+		else if ((c & 0xFC) == 0xF8) { mbc_st = 5; }
+		else if ((c & 0xFE) == 0xFC) { mbc_st = 6; }
+	}
+
+	if (mbc_st == 0) {
+		return ((unsigned char)(c) >= ' ' && (c) != 0x7f && (unsigned char)(c) != 0x9b);
+	}
+
+	mbc_st--;
+	return true;
+}
+bool IsMultiByteChar(unsigned char c, int *bytes)
+{
+	bool ret = false;
+	*bytes = 1;
+	if ((c & 0xE0) == 0xC0) { *bytes = 2; }
+	else if ((c & 0xF0) == 0xE0) { *bytes = 3; }
+	else if ((c & 0xF8) == 0xF0) { *bytes = 4; }
+	else if ((c & 0xFC) == 0xF8) { *bytes = 5; }
+	else if ((c & 0xFE) == 0xFC) { *bytes = 6; }
+	if (*bytes != 1)
+		ret = true;
+	return ret;
+}
+#endif
+#else
+# define Isprint(c) ((unsigned char)(c) >= ' ' && (unsigned char)(c) < 0x7f)
+#endif
+
+#endif
+
+
+enum {
+	MAX_TABSTOP = 32, // sanity limit
+	// User input len. Need not be extra big.
+	// Lines in file being edited *can* be bigger than this.
+	MAX_INPUT_LEN = 128,
+	// Sanity limits. We have only one buffer of this size.
+	MAX_SCR_COLS = CONFIG_FEATURE_VI_MAX_LEN,
+	MAX_SCR_ROWS = CONFIG_FEATURE_VI_MAX_LEN,
+};
+
+/* VT102 ESC sequences.
+ * See "Xterm Control Sequences"
+ * http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
+ */
+/* Inverse/Normal text */
+#define ESC_BOLD_TEXT "\033[7m"
+#define ESC_NORM_TEXT "\033[0m"
+/* Bell */
+#define ESC_BELL "\007"
+/* Clear-to-end-of-line */
+#define ESC_CLEAR2EOL "\033[K"
+/* Clear-to-end-of-screen.
+ * (We use default param here.
+ * Full sequence is "ESC [ <num> J",
+ * <num> is 0/1/2 = "erase below/above/all".)
+ */
+#define ESC_CLEAR2EOS "\033[J"
+/* Cursor to given coordinate (1,1: top left) */
+#define ESC_SET_CURSOR_POS "\033[%u;%uH"
+//UNUSED
+///* Cursor up and down */
+//#define ESC_CURSOR_UP "\033[A"
+//#define ESC_CURSOR_DOWN "\n"
+
+#if ENABLE_FEATURE_VI_DOT_CMD || ENABLE_FEATURE_VI_YANKMARK
+// cmds modifying text[]
+// vda: removed "aAiIs" as they switch us into insert mode
+// and remembering input for replay after them makes no sense
+static const char modifying_cmds[] ALIGN1 = "cCdDJoOpPrRxX<>~";
+#endif
+
+enum {
+	YANKONLY = FALSE,
+	YANKDEL = TRUE,
+	FORWARD = 1,	// code depends on "1"  for array index
+	BACK = -1,	// code depends on "-1" for array index
+	LIMITED = 0,	// how much of text[] in char_search
+	FULL = 1,	// how much of text[] in char_search
+
+	S_BEFORE_WS = 1,	// used in skip_thing() for moving "dot"
+	S_TO_WS = 2,		// used in skip_thing() for moving "dot"
+	S_OVER_WS = 3,		// used in skip_thing() for moving "dot"
+	S_END_PUNCT = 4,	// used in skip_thing() for moving "dot"
+	S_END_ALNUM = 5,	// used in skip_thing() for moving "dot"
+};
+
+
+/* vi.c expects chars to be unsigned. */
+/* busybox build system provides that, but it's better */
+/* to audit and fix the source */
+
+struct globals {
+	/* many references - keep near the top of globals */
+	char *text, *end;       // pointers to the user data in memory
+	char *dot;              // where all the action takes place
+	int text_size;		// size of the allocated buffer
+
+	/* the rest */
+	smallint vi_setops;
+#define VI_AUTOINDENT 1
+#define VI_SHOWMATCH  2
+#define VI_IGNORECASE 4
+#define VI_ERR_METHOD 8
+#define autoindent (vi_setops & VI_AUTOINDENT)
+#define showmatch  (vi_setops & VI_SHOWMATCH )
+#define ignorecase (vi_setops & VI_IGNORECASE)
+/* indicate error with beep or flash */
+#define err_method (vi_setops & VI_ERR_METHOD)
+
+#if ENABLE_FEATURE_VI_READONLY
+	smallint readonly_mode;
+#define SET_READONLY_FILE(flags)        ((flags) |= 0x01)
+#define SET_READONLY_MODE(flags)        ((flags) |= 0x02)
+#define UNSET_READONLY_FILE(flags)      ((flags) &= 0xfe)
+#else
+#define SET_READONLY_FILE(flags)        ((void)0)
+#define SET_READONLY_MODE(flags)        ((void)0)
+#define UNSET_READONLY_FILE(flags)      ((void)0)
+#endif
+
+	smallint editing;        // >0 while we are editing a file
+	                         // [code audit says "can be 0, 1 or 2 only"]
+	smallint cmd_mode;       // 0=command  1=insert 2=replace
+	int modified_count;      // buffer contents changed if !0
+	int last_modified_count; // = -1;
+	int save_argc;           // how many file names on cmd line
+	int cmdcnt;              // repetition count
+	unsigned rows, columns;	 // the terminal screen is this size
+#if ENABLE_FEATURE_VI_ASK_TERMINAL
+	int get_rowcol_error;
+#endif
+	int crow, ccol;          // cursor is on Crow x Ccol
+	int offset;              // chars scrolled off the screen to the left
+	int have_status_msg;     // is default edit status needed?
+	                         // [don't make smallint!]
+	int last_status_cksum;   // hash of current status line
+	char *current_filename;
+	char *screenbegin;       // index into text[], of top line on the screen
+	char *screen;            // pointer to the virtual screen buffer
+	int screensize;          //            and its size
+	int tabstop;
+	int last_forward_char;   // last char searched for with 'f' (int because of Unicode)
+	char erase_char;         // the users erase character
+	char last_input_char;    // last char read from user
+
+#if ENABLE_FEATURE_VI_DOT_CMD
+	smallint adding2q;	 // are we currently adding user input to q
+	int lmc_len;             // length of last_modifying_cmd
+	char *ioq, *ioq_start;   // pointer to string for get_one_char to "read"
+#endif
+#if ENABLE_FEATURE_VI_USE_SIGNALS || ENABLE_FEATURE_VI_CRASHME
+	int my_pid;
+#endif
+#if ENABLE_FEATURE_VI_SEARCH
+	char *last_search_pattern; // last pattern from a '/' or '?' search
+#endif
+
+	/* former statics */
+#if ENABLE_FEATURE_VI_YANKMARK
+	char *edit_file__cur_line;
+#endif
+	int refresh__old_offset;
+	int format_edit_status__tot;
+
+	/* a few references only */
+#if ENABLE_FEATURE_VI_YANKMARK
+	int YDreg, Ureg;        // default delete register and orig line for "U"
+	char *reg[28];          // named register a-z, "D", and "U" 0-25,26,27
+	char *mark[28];         // user marks points somewhere in text[]-  a-z and previous context ''
+	char *context_start, *context_end;
+#endif
+#if ENABLE_FEATURE_VI_USE_SIGNALS
+	sigjmp_buf restart;     // catch_sig()
+#endif
+	struct termios term_orig, term_vi; // remember what the cooked mode was
+#if ENABLE_FEATURE_VI_COLON
+	char *initial_cmds[3];  // currently 2 entries, NULL terminated
+#endif
+	// Should be just enough to hold a key sequence,
+	// but CRASHME mode uses it as generated command buffer too
+#if ENABLE_FEATURE_VI_CRASHME
+	char readbuffer[128];
+#else
+	char readbuffer[KEYCODE_BUFFER_SIZE];
+#endif
+#define STATUS_BUFFER_LEN  200
+	char status_buffer[STATUS_BUFFER_LEN]; // messages to the user
+#if ENABLE_FEATURE_VI_DOT_CMD
+	char last_modifying_cmd[MAX_INPUT_LEN];	// last modifying cmd for "."
+#endif
+	char get_input_line__buf[MAX_INPUT_LEN]; /* former static */
+
+	char scr_out_buf[MAX_SCR_COLS + MAX_TABSTOP * 2];
+#if ENABLE_FEATURE_VI_UNDO
+// undo_push() operations
+#define UNDO_INS         0
+#define UNDO_DEL         1
+#define UNDO_INS_CHAIN   2
+#define UNDO_DEL_CHAIN   3
+// UNDO_*_QUEUED must be equal to UNDO_xxx ORed with UNDO_QUEUED_FLAG
+#define UNDO_QUEUED_FLAG 4
+#define UNDO_INS_QUEUED  4
+#define UNDO_DEL_QUEUED  5
+#define UNDO_USE_SPOS   32
+#define UNDO_EMPTY      64
+// Pass-through flags for functions that can be undone
+#define NO_UNDO          0
+#define ALLOW_UNDO       1
+#define ALLOW_UNDO_CHAIN 2
+# if ENABLE_FEATURE_VI_UNDO_QUEUE
+#define ALLOW_UNDO_QUEUED 3
+	char undo_queue_state;
+	int undo_q;
+	char *undo_queue_spos;	// Start position of queued operation
+	char undo_queue[CONFIG_FEATURE_VI_UNDO_QUEUE_MAX];
+# else
+// If undo queuing disabled, don't invoke the missing queue logic
+#define ALLOW_UNDO_QUEUED 1
+# endif
+
+	struct undo_object {
+		struct undo_object *prev;	// Linking back avoids list traversal (LIFO)
+		int start;		// Offset where the data should be restored/deleted
+		int length;		// total data size
+		uint8_t u_type;		// 0=deleted, 1=inserted, 2=swapped
+		char undo_text[1];	// text that was deleted (if deletion)
+	} *undo_stack_tail;
+#endif /* ENABLE_FEATURE_VI_UNDO */
+};
+#define G (*ptr_to_globals)
+#define text           (G.text          )
+#define text_size      (G.text_size     )
+#define end            (G.end           )
+#define dot            (G.dot           )
+#define reg            (G.reg           )
+
+#define vi_setops               (G.vi_setops          )
+#define editing                 (G.editing            )
+#define cmd_mode                (G.cmd_mode           )
+#define modified_count          (G.modified_count     )
+#define last_modified_count     (G.last_modified_count)
+#define save_argc               (G.save_argc          )
+#define cmdcnt                  (G.cmdcnt             )
+#define rows                    (G.rows               )
+#define columns                 (G.columns            )
+#define crow                    (G.crow               )
+#define ccol                    (G.ccol               )
+#define offset                  (G.offset             )
+#define status_buffer           (G.status_buffer      )
+#define have_status_msg         (G.have_status_msg    )
+#define last_status_cksum       (G.last_status_cksum  )
+#define current_filename        (G.current_filename   )
+#define screen                  (G.screen             )
+#define screensize              (G.screensize         )
+#define screenbegin             (G.screenbegin        )
+#define tabstop                 (G.tabstop            )
+#define last_forward_char       (G.last_forward_char  )
+#define erase_char              (G.erase_char         )
+#define last_input_char         (G.last_input_char    )
+#if ENABLE_FEATURE_VI_READONLY
+#define readonly_mode           (G.readonly_mode      )
+#else
+#define readonly_mode           0
+#endif
+#define adding2q                (G.adding2q           )
+#define lmc_len                 (G.lmc_len            )
+#define ioq                     (G.ioq                )
+#define ioq_start               (G.ioq_start          )
+#define my_pid                  (G.my_pid             )
+#define last_search_pattern     (G.last_search_pattern)
+
+#define edit_file__cur_line     (G.edit_file__cur_line)
+#define refresh__old_offset     (G.refresh__old_offset)
+#define format_edit_status__tot (G.format_edit_status__tot)
+
+#define YDreg          (G.YDreg         )
+#define Ureg           (G.Ureg          )
+#define mark           (G.mark          )
+#define context_start  (G.context_start )
+#define context_end    (G.context_end   )
+#define restart        (G.restart       )
+#define term_orig      (G.term_orig     )
+#define term_vi        (G.term_vi       )
+#define initial_cmds   (G.initial_cmds  )
+#define readbuffer     (G.readbuffer    )
+#define scr_out_buf    (G.scr_out_buf   )
+#define last_modifying_cmd  (G.last_modifying_cmd )
+#define get_input_line__buf (G.get_input_line__buf)
+
+#if ENABLE_FEATURE_VI_UNDO
+#define undo_stack_tail  (G.undo_stack_tail )
+# if ENABLE_FEATURE_VI_UNDO_QUEUE
+#define undo_queue_state (G.undo_queue_state)
+#define undo_q           (G.undo_q          )
+#define undo_queue       (G.undo_queue      )
+#define undo_queue_spos  (G.undo_queue_spos )
+# endif
+#endif
+
+#define INIT_G() do { \
+	SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
+	last_modified_count = -1; \
+	/* "" but has space for 2 chars: */ \
+	IF_FEATURE_VI_SEARCH(last_search_pattern = xzalloc(2);) \
+} while (0)
+
+
+static void edit_file(char *);	// edit one file
+static void do_cmd(int);	// execute a command
+static int next_tabstop(int);
+static void sync_cursor(char *, int *, int *);	// synchronize the screen cursor to dot
+static char *begin_line(char *);	// return pointer to cur line B-o-l
+static char *end_line(char *);	// return pointer to cur line E-o-l
+static char *prev_line(char *);	// return pointer to prev line B-o-l
+static char *next_line(char *);	// return pointer to next line B-o-l
+static char *end_screen(void);	// get pointer to last char on screen
+static int count_lines(char *, char *);	// count line from start to stop
+static char *find_line(int);	// find beginning of line #li
+static char *move_to_col(char *, int);	// move "p" to column l
+static void dot_left(void);	// move dot left- dont leave line
+static void dot_right(void);	// move dot right- dont leave line
+static void dot_begin(void);	// move dot to B-o-l
+static void dot_end(void);	// move dot to E-o-l
+static void dot_next(void);	// move dot to next line B-o-l
+static void dot_prev(void);	// move dot to prev line B-o-l
+static void dot_scroll(int, int);	// move the screen up or down
+static void dot_skip_over_ws(void);	// move dot pat WS
+static char *bound_dot(char *);	// make sure  text[0] <= P < "end"
+static char *new_screen(int, int);	// malloc virtual screen memory
+#if !ENABLE_FEATURE_VI_UNDO
+#define char_insert(a,b,c) char_insert(a,b)
+#endif
+static char *char_insert(char *, char, int);	// insert the char c at 'p'
+// might reallocate text[]! use p += stupid_insert(p, ...),
+// and be careful to not use pointers into potentially freed text[]!
+static uintptr_t stupid_insert(char *, char);	// stupidly insert the char c at 'p'
+static int find_range(char **, char **, char);	// return pointers for an object
+static int st_test(char *, int, int, char *);	// helper for skip_thing()
+static char *skip_thing(char *, int, int, int);	// skip some object
+static char *find_pair(char *, const char);	// find matching pair ()  []  {}
+#if !ENABLE_FEATURE_VI_UNDO
+#define text_hole_delete(a,b,c) text_hole_delete(a,b)
+#endif
+static char *text_hole_delete(char *, char *, int);	// at "p", delete a 'size' byte hole
+// might reallocate text[]! use p += text_hole_make(p, ...),
+// and be careful to not use pointers into potentially freed text[]!
+static uintptr_t text_hole_make(char *, int);	// at "p", make a 'size' byte hole
+#if !ENABLE_FEATURE_VI_UNDO
+#define yank_delete(a,b,c,d,e) yank_delete(a,b,c,d)
+#endif
+static char *yank_delete(char *, char *, int, int, int);	// yank text[] into register then delete
+static void show_help(void);	// display some help info
+static void rawmode(void);	// set "raw" mode on tty
+static void cookmode(void);	// return to "cooked" mode on tty
+// sleep for 'h' 1/100 seconds, return 1/0 if stdin is (ready for read)/(not ready)
+static int mysleep(int);
+static int readit(void);	// read (maybe cursor) key from stdin
+static int get_one_char(void);	// read 1 char from stdin
+// file_insert might reallocate text[]!
+static int file_insert(const char *, char *, int);
+static int file_write(char *, char *, char *);
+static void place_cursor(int, int);
+static void screen_erase(void);
+static void clear_to_eol(void);
+static void clear_to_eos(void);
+static void go_bottom_and_clear_to_eol(void);
+static void standout_start(void);	// send "start reverse video" sequence
+static void standout_end(void);	// send "end reverse video" sequence
+static void flash(int);		// flash the terminal screen
+static void show_status_line(void);	// put a message on the bottom line
+static void status_line(const char *, ...);     // print to status buf
+static void status_line_bold(const char *, ...);
+static void status_line_bold_errno(const char *fn);
+static void not_implemented(const char *); // display "Not implemented" message
+static int format_edit_status(void);	// format file status on status line
+static void redraw(int);	// force a full screen refresh
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+static char* format_line(char* /*, int*/);
+#else
+static char* format_line(char* , int*, int*);
+#endif
+static void refresh(int);	// update the terminal from screen[]
+
+static void indicate_error(void);       // use flash or beep to indicate error
+static void Hit_Return(void);
+
+#if ENABLE_FEATURE_VI_SEARCH
+static char *char_search(char *, const char *, int, int);	// search for pattern starting at p
+#endif
+#if ENABLE_FEATURE_VI_COLON
+static char *get_one_address(char *, int *);	// get colon addr, if present
+static char *get_address(char *, int *, int *);	// get two colon addrs, if present
+#endif
+static void colon(char *);	// execute the "colon" mode cmds
+#if ENABLE_FEATURE_VI_USE_SIGNALS
+static void winch_sig(int);	// catch window size changes
+static void suspend_sig(int);	// catch ctrl-Z
+static void catch_sig(int);     // catch ctrl-C and alarm time-outs
+#endif
+#if ENABLE_FEATURE_VI_DOT_CMD
+static void start_new_cmd_q(char);	// new queue for command
+static void end_cmd_q(void);	// stop saving input chars
+#else
+#define end_cmd_q() ((void)0)
+#endif
+#if ENABLE_FEATURE_VI_SETOPTS
+static void showmatching(char *);	// show the matching pair ()  []  {}
+#endif
+#if ENABLE_FEATURE_VI_YANKMARK || (ENABLE_FEATURE_VI_COLON && ENABLE_FEATURE_VI_SEARCH) || ENABLE_FEATURE_VI_CRASHME
+// might reallocate text[]! use p += string_insert(p, ...),
+// and be careful to not use pointers into potentially freed text[]!
+# if !ENABLE_FEATURE_VI_UNDO
+#define string_insert(a,b,c) string_insert(a,b)
+# endif
+static uintptr_t string_insert(char *, const char *, int);	// insert the string at 'p'
+#endif
+#if ENABLE_FEATURE_VI_YANKMARK
+static char *text_yank(char *, char *, int);	// save copy of "p" into a register
+static char what_reg(void);		// what is letter of current YDreg
+static void check_context(char);	// remember context for '' command
+#endif
+#if ENABLE_FEATURE_VI_UNDO
+static void flush_undo_data(void);
+static void undo_push(char *, unsigned int, unsigned char);	// Push an operation on the undo stack
+static void undo_pop(void);	// Undo the last operation
+# if ENABLE_FEATURE_VI_UNDO_QUEUE
+static void undo_queue_commit(void);	// Flush any queued objects to the undo stack
+# else
+# define undo_queue_commit() ((void)0)
+# endif
+#else
+#define flush_undo_data()   ((void)0)
+#define undo_queue_commit() ((void)0)
+#endif
+
+#if ENABLE_FEATURE_VI_CRASHME
+static void crash_dummy();
+static void crash_test();
+static int crashme = 0;
+#endif
+
+#ifdef ENABLE_BASIC_MULTI_CHAR_CODE
+extern unsigned int Utf8_to_Utf16(const char *src, int *code_size);
+extern int bs_char_count(char *str, int pos);
+#endif
+
+static void write1(const char *out)
+{
+	fputs(out, stdout);
+}
+
+int vi_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+int vi_main(int argc, char **argv)
+{
+	int c;
+
+	INIT_G();
+
+#if ENABLE_FEATURE_VI_UNDO
+	/* undo_stack_tail = NULL; - already is */
+#if ENABLE_FEATURE_VI_UNDO_QUEUE
+	undo_queue_state = UNDO_EMPTY;
+	/* undo_q = 0; - already is  */
+#endif
+#endif
+
+#if ENABLE_FEATURE_VI_USE_SIGNALS || ENABLE_FEATURE_VI_CRASHME
+	my_pid = getpid();
+#endif
+#if ENABLE_FEATURE_VI_CRASHME
+	srand((long) my_pid);
+#endif
+#ifdef NO_SUCH_APPLET_YET
+	/* If we aren't "vi", we are "view" */
+	if (ENABLE_FEATURE_VI_READONLY && applet_name[2]) {
+		SET_READONLY_MODE(readonly_mode);
+	}
+#endif
+
+	// autoindent is not default in vim 7.3
+	vi_setops = /*VI_AUTOINDENT |*/ VI_SHOWMATCH | VI_IGNORECASE;
+	//  1-  process $HOME/.exrc file (not inplemented yet)
+	//  2-  process EXINIT variable from environment
+	//  3-  process command line args
+#if ENABLE_FEATURE_VI_COLON
+	{
+		char *p = getenv("EXINIT");
+		if (p && *p)
+			initial_cmds[0] = xstrndup(p, MAX_INPUT_LEN);
+	}
+#endif
+	while ((c = getopt(argc, argv, "hCRH" IF_FEATURE_VI_COLON("c:"))) != -1) {
+		switch (c) {
+#if ENABLE_FEATURE_VI_CRASHME
+		case 'C':
+			crashme = 1;
+			break;
+#endif
+#if ENABLE_FEATURE_VI_READONLY
+		case 'R':		// Read-only flag
+			SET_READONLY_MODE(readonly_mode);
+			break;
+#endif
+#if ENABLE_FEATURE_VI_COLON
+		case 'c':		// cmd line vi command
+			if (*optarg)
+				initial_cmds[initial_cmds[0] != NULL] = xstrndup(optarg, MAX_INPUT_LEN);
+			break;
+#endif
+		case 'H':
+			show_help();
+			/* fall through */
+		default:
+			bb_show_usage();
+			return 1;
+		}
+	}
+
+	// The argv array can be used by the ":next"  and ":rewind" commands
+	argv += optind;
+	argc -= optind;
+
+	//----- This is the main file handling loop --------------
+	save_argc = argc;
+	optind = 0;
+	// "Save cursor, use alternate screen buffer, clear screen"
+	write1("\033[?1049h");
+	while (1) {
+		edit_file(argv[optind]); /* param might be NULL */
+		if (++optind >= argc)
+			break;
+	}
+	// "Use normal screen buffer, restore cursor"
+	write1("\033[?1049l");
+	//-----------------------------------------------------------
+
+	return 0;
+}
+
+/* read text from file or create an empty buf */
+/* will also update current_filename */
+static int init_text_buffer(char *fn)
+{
+	int rc;
+
+	flush_undo_data();
+	modified_count = 0;
+	last_modified_count = -1;
+#if ENABLE_FEATURE_VI_YANKMARK
+	/* init the marks */
+	memset(mark, 0, sizeof(mark));
+#endif
+
+	/* allocate/reallocate text buffer */
+	free(text);
+	text_size = 10240;
+	screenbegin = dot = end = text = xzalloc(text_size);
+
+	if (fn != current_filename) {
+		free(current_filename);
+		current_filename = xstrdup(fn);
+	}
+	rc = file_insert(fn, text, 1);
+	if (rc < 0) {
+		// file doesnt exist. Start empty buf with dummy line
+		char_insert(text, '\n', NO_UNDO);
+	}
+	return rc;
+}
+
+#if ENABLE_FEATURE_VI_WIN_RESIZE
+static int query_screen_dimensions(void)
+{
+	int err = get_terminal_width_height(STDIN_FILENO, &columns, &rows);
+	if (rows > MAX_SCR_ROWS)
+		rows = MAX_SCR_ROWS;
+	if (columns > MAX_SCR_COLS)
+		columns = MAX_SCR_COLS;
+	return err;
+}
+#else
+# define query_screen_dimensions() (0)
+#endif
+
+static void edit_file(char *fn)
+{
+#if ENABLE_FEATURE_VI_YANKMARK
+#define cur_line edit_file__cur_line
+#endif
+	int c;
+#if ENABLE_FEATURE_VI_USE_SIGNALS
+	int sig;
+#endif
+
+	editing = 1;	// 0 = exit, 1 = one file, 2 = multiple files
+	rawmode();
+	rows = 24;
+	columns = 80;
+	IF_FEATURE_VI_ASK_TERMINAL(G.get_rowcol_error =) query_screen_dimensions();
+#if ENABLE_FEATURE_VI_ASK_TERMINAL
+	if (G.get_rowcol_error /* TODO? && no input on stdin */) {
+		uint64_t k;
+		write1("\033[999;999H" "\033[6n");
+		fflush_all();
+		k = read_key(STDIN_FILENO, readbuffer, /*timeout_ms:*/ 100);
+		if ((int32_t)k == KEYCODE_CURSOR_POS) {
+			uint32_t rc = (k >> 32);
+			columns = (rc & 0x7fff);
+			if (columns > MAX_SCR_COLS)
+				columns = MAX_SCR_COLS;
+			rows = ((rc >> 16) & 0x7fff);
+			if (rows > MAX_SCR_ROWS)
+				rows = MAX_SCR_ROWS;
+		}
+	}
+#endif
+	new_screen(rows, columns);	// get memory for virtual screen
+	init_text_buffer(fn);
+
+#if ENABLE_FEATURE_VI_YANKMARK
+	YDreg = 26;			// default Yank/Delete reg
+	Ureg = 27;			// hold orig line for "U" cmd
+	mark[26] = mark[27] = text;	// init "previous context"
+#endif
+
+	last_forward_char = last_input_char = '\0';
+	crow = 0;
+	ccol = 0;
+
+#if ENABLE_FEATURE_VI_USE_SIGNALS
+	signal(SIGINT, catch_sig);
+	signal(SIGWINCH, winch_sig);
+	signal(SIGTSTP, suspend_sig);
+	sig = sigsetjmp(restart, 1);
+	if (sig != 0) {
+		screenbegin = dot = text;
+	}
+#endif
+
+	cmd_mode = 0;		// 0=command  1=insert  2='R'eplace
+	cmdcnt = 0;
+	tabstop = 8;
+	offset = 0;			// no horizontal offset
+	c = '\0';
+#if ENABLE_FEATURE_VI_DOT_CMD
+	free(ioq_start);
+	ioq = ioq_start = NULL;
+	lmc_len = 0;
+	adding2q = 0;
+#endif
+
+#if ENABLE_FEATURE_VI_COLON
+	{
+		char *p, *q;
+		int n = 0;
+
+		while ((p = initial_cmds[n]) != NULL) {
+			do {
+				q = p;
+				p = strchr(q, '\n');
+				if (p)
+					while (*p == '\n')
+						*p++ = '\0';
+				if (*q)
+					colon(q);
+			} while (p);
+			free(initial_cmds[n]);
+			initial_cmds[n] = NULL;
+			n++;
+		}
+	}
+#endif
+	redraw(FALSE);			// dont force every col re-draw
+	//------This is the main Vi cmd handling loop -----------------------
+	while (editing > 0) {
+#if ENABLE_FEATURE_VI_CRASHME
+		if (crashme > 0) {
+			if ((end - text) > 1) {
+				crash_dummy();	// generate a random command
+			} else {
+				crashme = 0;
+				string_insert(text, "\n\n#####  Ran out of text to work on.  #####\n\n", NO_UNDO); // insert the string
+				dot = text;
+				refresh(FALSE);
+			}
+		}
+#endif
+		last_input_char = c = get_one_char();	// get a cmd from user
+#if ENABLE_FEATURE_VI_YANKMARK
+		// save a copy of the current line- for the 'U" command
+		if (begin_line(dot) != cur_line) {
+			cur_line = begin_line(dot);
+			text_yank(begin_line(dot), end_line(dot), Ureg);
+		}
+#endif
+#if ENABLE_FEATURE_VI_DOT_CMD
+		// These are commands that change text[].
+		// Remember the input for the "." command
+		if (!adding2q && ioq_start == NULL
+		 && cmd_mode == 0 // command mode
+		 && c > '\0' // exclude NUL and non-ASCII chars
+		 && c < 0x7f // (Unicode and such)
+		 && strchr(modifying_cmds, c)
+		) {
+			start_new_cmd_q(c);
+		}
+#endif
+		do_cmd(c);		// execute the user command
+
+		// poll to see if there is input already waiting. if we are
+		// not able to display output fast enough to keep up, skip
+		// the display update until we catch up with input.
+		if (!readbuffer[0] && mysleep(0) == 0) {
+			// no input pending - so update output
+			refresh(FALSE);
+			show_status_line();
+		}
+#if ENABLE_FEATURE_VI_CRASHME
+		if (crashme > 0)
+			crash_test();	// test editor variables
+#endif
+	}
+	//-------------------------------------------------------------------
+
+	go_bottom_and_clear_to_eol();
+	cookmode();
+#undef cur_line
+}
+
+//----- The Colon commands -------------------------------------
+#if ENABLE_FEATURE_VI_COLON
+static char *get_one_address(char *p, int *addr)	// get colon addr, if present
+{
+	int st;
+	char *q;
+	IF_FEATURE_VI_YANKMARK(char c;)
+	IF_FEATURE_VI_SEARCH(char *pat;)
+
+	*addr = -1;			// assume no addr
+	if (*p == '.') {	// the current line
+		p++;
+		q = begin_line(dot);
+		*addr = count_lines(text, q);
+	}
+#if ENABLE_FEATURE_VI_YANKMARK
+	else if (*p == '\'') {	// is this a mark addr
+		p++;
+		c = tolower(*p);
+		p++;
+		if (c >= 'a' && c <= 'z') {
+			// we have a mark
+			c = c - 'a';
+			q = mark[(unsigned char) c];
+			if (q != NULL) {	// is mark valid
+				*addr = count_lines(text, q);
+			}
+		}
+	}
+#endif
+#if ENABLE_FEATURE_VI_SEARCH
+	else if (*p == '/') {	// a search pattern
+		q = strchrnul(++p, '/');
+		pat = xstrndup(p, q - p); // save copy of pattern
+		p = q;
+		if (*p == '/')
+			p++;
+		q = char_search(dot, pat, FORWARD, FULL);
+		if (q != NULL) {
+			*addr = count_lines(text, q);
+		}
+		free(pat);
+	}
+#endif
+	else if (*p == '$') {	// the last line in file
+		p++;
+		q = begin_line(end - 1);
+		*addr = count_lines(text, q);
+	} else if (isdigit(*p)) {	// specific line number
+		sscanf(p, "%d%n", addr, &st);
+		p += st;
+	} else {
+		// unrecognized address - assume -1
+		*addr = -1;
+	}
+	return p;
+}
+
+static char *get_address(char *p, int *b, int *e)	// get two colon addrs, if present
+{
+	//----- get the address' i.e., 1,3   'a,'b  -----
+	// get FIRST addr, if present
+	while (isblank(*p))
+		p++;				// skip over leading spaces
+	if (*p == '%') {			// alias for 1,$
+		p++;
+		*b = 1;
+		*e = count_lines(text, end-1);
+		goto ga0;
+	}
+	p = get_one_address(p, b);
+	while (isblank(*p))
+		p++;
+	if (*p == ',') {			// is there a address separator
+		p++;
+		while (isblank(*p))
+			p++;
+		// get SECOND addr, if present
+		p = get_one_address(p, e);
+	}
+ ga0:
+	while (isblank(*p))
+		p++;				// skip over trailing spaces
+	return p;
+}
+
+#if ENABLE_FEATURE_VI_SET && ENABLE_FEATURE_VI_SETOPTS
+static void setops(const char *args, const char *opname, int flg_no,
+			const char *short_opname, int opt)
+{
+	const char *a = args + flg_no;
+	int l = strlen(opname) - 1; /* opname have + ' ' */
+
+	// maybe strncmp? we had tons of erroneous strncasecmp's...
+	if (strncasecmp(a, opname, l) == 0
+	 || strncasecmp(a, short_opname, 2) == 0
+	) {
+		if (flg_no)
+			vi_setops &= ~opt;
+		else
+			vi_setops |= opt;
+	}
+}
+#endif
+
+#endif /* FEATURE_VI_COLON */
+
+// buf must be no longer than MAX_INPUT_LEN!
+static void colon(char *buf)
+{
+#if !ENABLE_FEATURE_VI_COLON
+	/* Simple ":cmd" handler with minimal set of commands */
+	char *p = buf;
+	int cnt;
+
+	if (*p == ':')
+		p++;
+	cnt = strlen(p);
+	if (cnt == 0)
+		return;
+	if (strncmp(p, "quit", cnt) == 0
+	 || strncmp(p, "q!", cnt) == 0
+	) {
+		if (modified_count && p[1] != '!') {
+			status_line_bold("No write since last change (:%s! overrides)", p);
+		} else {
+			editing = 0;
+		}
+		return;
+	}
+	if (strncmp(p, "write", cnt) == 0
+	 || strncmp(p, "wq", cnt) == 0
+	 || strncmp(p, "wn", cnt) == 0
+	 || (p[0] == 'x' && !p[1])
+	) {
+		cnt = file_write(current_filename, text, end - 1);
+		if (cnt < 0) {
+			if (cnt == -1)
+				status_line_bold("Write error: %s", strerror(errno));
+		} else {
+			modified_count = 0;
+			last_modified_count = -1;
+			status_line("'%s' %dL, %dC",
+				current_filename,
+				count_lines(text, end - 1), cnt
+			);
+			if (p[0] == 'x' || p[1] == 'q' || p[1] == 'n'
+			 || p[0] == 'X' || p[1] == 'Q' || p[1] == 'N'
+			) {
+				editing = 0;
+			}
+		}
+		return;
+	}
+	if (strncmp(p, "file", cnt) == 0) {
+		last_status_cksum = 0;	// force status update
+		return;
+	}
+	if (sscanf(p, "%d", &cnt) > 0) {
+		dot = find_line(cnt);
+		dot_skip_over_ws();
+		return;
+	}
+	not_implemented(p);
+#else
+
+	char c, *orig_buf, *buf1, *q, *r;
+	char *fn, cmd[MAX_INPUT_LEN], args[MAX_INPUT_LEN];
+	int i, l, li, b, e;
+	int useforce;
+
+	// :3154	// if (-e line 3154) goto it  else stay put
+	// :4,33w! foo	// write a portion of buffer to file "foo"
+	// :w		// write all of buffer to current file
+	// :q		// quit
+	// :q!		// quit- dont care about modified file
+	// :'a,'z!sort -u   // filter block through sort
+	// :'f		// goto mark "f"
+	// :'fl		// list literal the mark "f" line
+	// :.r bar	// read file "bar" into buffer before dot
+	// :/123/,/abc/d    // delete lines from "123" line to "abc" line
+	// :/xyz/	// goto the "xyz" line
+	// :s/find/replace/ // substitute pattern "find" with "replace"
+	// :!<cmd>	// run <cmd> then return
+	//
+
+	if (!buf[0])
+		goto ret;
+	if (*buf == ':')
+		buf++;			// move past the ':'
+
+	li = i = 0;
+	b = e = -1;
+	q = text;			// assume 1,$ for the range
+	r = end - 1;
+	li = count_lines(text, end - 1);
+	fn = current_filename;
+
+	// look for optional address(es)  :.  :1  :1,9   :'q,'a   :%
+	buf = get_address(buf, &b, &e);
+
+	// remember orig command line
+	orig_buf = buf;
+
+	// get the COMMAND into cmd[]
+	buf1 = cmd;
+	while (*buf != '\0') {
+		if (isspace(*buf))
+			break;
+		*buf1++ = *buf++;
+	}
+	*buf1 = '\0';
+	// get any ARGuments
+	while (isblank(*buf))
+		buf++;
+	strcpy(args, buf);
+	useforce = FALSE;
+	buf1 = last_char_is(cmd, '!');
+	if (buf1) {
+		useforce = TRUE;
+		*buf1 = '\0';   // get rid of !
+	}
+	if (b >= 0) {
+		// if there is only one addr, then the addr
+		// is the line number of the single line the
+		// user wants. So, reset the end
+		// pointer to point at end of the "b" line
+		q = find_line(b);	// what line is #b
+		r = end_line(q);
+		li = 1;
+	}
+	if (e >= 0) {
+		// we were given two addrs.  change the
+		// end pointer to the addr given by user.
+		r = find_line(e);	// what line is #e
+		r = end_line(r);
+		li = e - b + 1;
+	}
+	// ------------ now look for the command ------------
+	i = strlen(cmd);
+	if (i == 0) {		// :123CR goto line #123
+		if (b >= 0) {
+			dot = find_line(b);	// what line is #b
+			dot_skip_over_ws();
+		}
+	}
+#if ENABLE_FEATURE_ALLOW_EXEC
+	else if (cmd[0] == '!') {	// run a cmd
+		int retcode;
+		// :!ls   run the <cmd>
+		go_bottom_and_clear_to_eol();
+		cookmode();
+		retcode = system(orig_buf + 1);	// run the cmd
+		if (retcode)
+			printf("\nshell returned %i\n\n", retcode);
+		rawmode();
+		Hit_Return();			// let user see results
+	}
+#endif
+	else if (cmd[0] == '=' && !cmd[1]) {	// where is the address
+		if (b < 0) {	// no addr given- use defaults
+			b = e = count_lines(text, dot);
+		}
+		status_line("%d", b);
+	} else if (strncmp(cmd, "delete", i) == 0) {	// delete lines
+		if (b < 0) {	// no addr given- use defaults
+			q = begin_line(dot);	// assume .,. for the range
+			r = end_line(dot);
+		}
+		dot = yank_delete(q, r, 1, YANKDEL, ALLOW_UNDO);	// save, then delete lines
+		dot_skip_over_ws();
+	} else if (strncmp(cmd, "edit", i) == 0) {	// Edit a file
+		int size;
+
+		// don't edit, if the current file has been modified
+		if (modified_count && !useforce) {
+			status_line_bold("No write since last change (:%s! overrides)", cmd);
+			goto ret;
+		}
+		if (args[0]) {
+			// the user supplied a file name
+			fn = args;
+		} else if (current_filename && current_filename[0]) {
+			// no user supplied name- use the current filename
+			// fn = current_filename;  was set by default
+		} else {
+			// no user file name, no current name- punt
+			status_line_bold("No current filename");
+			goto ret;
+		}
+
+		size = init_text_buffer(fn);
+
+#if ENABLE_FEATURE_VI_YANKMARK
+		if (Ureg >= 0 && Ureg < 28) {
+			free(reg[Ureg]);	//   free orig line reg- for 'U'
+			reg[Ureg] = NULL;
+		}
+		if (YDreg >= 0 && YDreg < 28) {
+			free(reg[YDreg]);	//   free default yank/delete register
+			reg[YDreg] = NULL;
+		}
+#endif
+		// how many lines in text[]?
+		li = count_lines(text, end - 1);
+		status_line("'%s'%s"
+			IF_FEATURE_VI_READONLY("%s")
+			" %dL, %dC",
+			current_filename,
+			(size < 0 ? " [New file]" : ""),
+			IF_FEATURE_VI_READONLY(
+				((readonly_mode) ? " [Readonly]" : ""),
+			)
+			li, (int)(end - text)
+		);
+	} else if (strncmp(cmd, "file", i) == 0) {	// what File is this
+		if (b != -1 || e != -1) {
+			status_line_bold("No address allowed on this command");
+			goto ret;
+		}
+		if (args[0]) {
+			// user wants a new filename
+			free(current_filename);
+			current_filename = xstrdup(args);
+		} else {
+			// user wants file status info
+			last_status_cksum = 0;	// force status update
+		}
+	} else if (strncmp(cmd, "features", i) == 0) {	// what features are available
+		// print out values of all features
+		go_bottom_and_clear_to_eol();
+		cookmode();
+		show_help();
+		rawmode();
+		Hit_Return();
+	} else if (strncmp(cmd, "list", i) == 0) {	// literal print line
+		if (b < 0) {	// no addr given- use defaults
+			q = begin_line(dot);	// assume .,. for the range
+			r = end_line(dot);
+		}
+		go_bottom_and_clear_to_eol();
+		puts("\r");
+		for (; q <= r; q++) {
+			int c_is_no_print;
+
+			c = *q;
+			c_is_no_print = (c & 0x80) && !Isprint(c);
+			if (c_is_no_print) {
+				c = '.';
+				standout_start();
+			}
+			if (c == '\n') {
+				write1("$\r");
+			} else if (c < ' ' || c == 127) {
+				bb_putchar('^');
+				if (c == 127)
+					c = '?';
+				else
+					c += '@';
+			}
+			bb_putchar(c);
+			if (c_is_no_print)
+				standout_end();
+		}
+		Hit_Return();
+	} else if (strncmp(cmd, "quit", i) == 0 // quit
+	        || strncmp(cmd, "next", i) == 0 // edit next file
+	        || strncmp(cmd, "prev", i) == 0 // edit previous file
+	) {
+		int n;
+		if (useforce) {
+			if (*cmd == 'q') {
+				// force end of argv list
+				optind = save_argc;
+			}
+			editing = 0;
+			goto ret;
+		}
+		// don't exit if the file been modified
+		if (modified_count) {
+			status_line_bold("No write since last change (:%s! overrides)", cmd);
+			goto ret;
+		}
+		// are there other file to edit
+		n = save_argc - optind - 1;
+		if (*cmd == 'q' && n > 0) {
+			status_line_bold("%d more file(s) to edit", n);
+			goto ret;
+		}
+		if (*cmd == 'n' && n <= 0) {
+			status_line_bold("No more files to edit");
+			goto ret;
+		}
+		if (*cmd == 'p') {
+			// are there previous files to edit
+			if (optind < 1) {
+				status_line_bold("No previous files to edit");
+				goto ret;
+			}
+			optind -= 2;
+		}
+		editing = 0;
+	} else if (strncmp(cmd, "read", i) == 0) {	// read file into text[]
+		int size;
+
+		fn = args;
+		if (!fn[0]) {
+			status_line_bold("No filename given");
+			goto ret;
+		}
+		if (b < 0) {	// no addr given- use defaults
+			q = begin_line(dot);	// assume "dot"
+		}
+		// read after current line- unless user said ":0r foo"
+		if (b != 0) {
+			q = next_line(q);
+			// read after last line
+			if (q == end-1)
+				++q;
+		}
+		{ // dance around potentially-reallocated text[]
+			uintptr_t ofs = q - text;
+			size = file_insert(fn, q, 0);
+			q = text + ofs;
+		}
+		if (size < 0)
+			goto ret;	// nothing was inserted
+		// how many lines in text[]?
+		li = count_lines(q, q + size - 1);
+		status_line("'%s'"
+			IF_FEATURE_VI_READONLY("%s")
+			" %dL, %dC",
+			fn,
+			IF_FEATURE_VI_READONLY((readonly_mode ? " [Readonly]" : ""),)
+			li, size
+		);
+		if (size > 0) {
+			// if the insert is before "dot" then we need to update
+			if (q <= dot)
+				dot += size;
+		}
+	} else if (strncmp(cmd, "rewind", i) == 0) {	// rewind cmd line args
+		if (modified_count && !useforce) {
+			status_line_bold("No write since last change (:%s! overrides)", cmd);
+		} else {
+			// reset the filenames to edit
+			optind = -1; /* start from 0th file */
+			editing = 0;
+		}
+#if ENABLE_FEATURE_VI_SET
+	} else if (strncmp(cmd, "set", i) == 0) {	// set or clear features
+#if ENABLE_FEATURE_VI_SETOPTS
+		char *argp;
+#endif
+		i = 0;			// offset into args
+		// only blank is regarded as args delimiter. What about tab '\t'?
+		if (!args[0] || strcasecmp(args, "all") == 0) {
+			// print out values of all options
+#if ENABLE_FEATURE_VI_SETOPTS
+			status_line_bold(
+				"%sautoindent "
+				"%sflash "
+				"%signorecase "
+				"%sshowmatch "
+				"tabstop=%u",
+				autoindent ? "" : "no",
+				err_method ? "" : "no",
+				ignorecase ? "" : "no",
+				showmatch ? "" : "no",
+				tabstop
+			);
+#endif
+			goto ret;
+		}
+#if ENABLE_FEATURE_VI_SETOPTS
+		argp = args;
+		while (*argp) {
+			if (strncmp(argp, "no", 2) == 0)
+				i = 2;		// ":set noautoindent"
+			setops(argp, "autoindent ", i, "ai", VI_AUTOINDENT);
+			setops(argp, "flash "     , i, "fl", VI_ERR_METHOD);
+			setops(argp, "ignorecase ", i, "ic", VI_IGNORECASE);
+			setops(argp, "showmatch " , i, "sm", VI_SHOWMATCH );
+			if (strncmp(argp + i, "tabstop=", 8) == 0) {
+				int t = 0;
+				sscanf(argp + i+8, "%u", &t);
+				if (t > 0 && t <= MAX_TABSTOP)
+					tabstop = t;
+			}
+			argp = skip_non_whitespace(argp);
+			argp = skip_whitespace(argp);
+		}
+#endif /* FEATURE_VI_SETOPTS */
+#endif /* FEATURE_VI_SET */
+#if ENABLE_FEATURE_VI_SEARCH
+	} else if (cmd[0] == 's') {	// substitute a pattern with a replacement pattern
+		char *F, *R, *flags;
+		size_t len_F, len_R;
+		int gflag;		// global replace flag
+#if ENABLE_FEATURE_VI_UNDO
+		int dont_chain_first_item = ALLOW_UNDO;
+#endif
+
+		// F points to the "find" pattern
+		// R points to the "replace" pattern
+		// replace the cmd line delimiters "/" with NULs
+		c = orig_buf[1];	// what is the delimiter
+		F = orig_buf + 2;	// start of "find"
+		R = strchr(F, c);	// middle delimiter
+		if (!R)
+			goto colon_s_fail;
+		len_F = R - F;
+		*R++ = '\0';	// terminate "find"
+		flags = strchr(R, c);
+		if (!flags)
+			goto colon_s_fail;
+		len_R = flags - R;
+		*flags++ = '\0';	// terminate "replace"
+		gflag = *flags;
+
+		q = begin_line(q);
+		if (b < 0) {	// maybe :s/foo/bar/
+			q = begin_line(dot);      // start with cur line
+			b = count_lines(text, q); // cur line number
+		}
+		if (e < 0)
+			e = b;		// maybe :.s/foo/bar/
+
+		for (i = b; i <= e; i++) {	// so, :20,23 s \0 find \0 replace \0
+			char *ls = q;		// orig line start
+			char *found;
+ vc4:
+			found = char_search(q, F, FORWARD, LIMITED);	// search cur line only for "find"
+			if (found) {
+				uintptr_t bias;
+				// we found the "find" pattern - delete it
+				// For undo support, the first item should not be chained
+				text_hole_delete(found, found + len_F - 1, dont_chain_first_item);
+#if ENABLE_FEATURE_VI_UNDO
+				dont_chain_first_item = ALLOW_UNDO_CHAIN;
+#endif
+				// insert the "replace" patern
+				bias = string_insert(found, R, ALLOW_UNDO_CHAIN);
+				found += bias;
+				ls += bias;
+				/*q += bias; - recalculated anyway */
+				// check for "global"  :s/foo/bar/g
+				if (gflag == 'g') {
+					if ((found + len_R) < end_line(ls)) {
+						q = found + len_R;
+						goto vc4;	// don't let q move past cur line
+					}
+				}
+			}
+			q = next_line(ls);
+		}
+#endif /* FEATURE_VI_SEARCH */
+	} else if (strncmp(cmd, "version", i) == 0) {  // show software version
+		status_line(BB_VER " " BB_BT);
+	} else if (strncmp(cmd, "write", i) == 0  // write text to file
+	        || strncmp(cmd, "wq", i) == 0
+	        || strncmp(cmd, "wn", i) == 0
+	        || (cmd[0] == 'x' && !cmd[1])
+	) {
+		int size;
+		//int forced = FALSE;
+
+		// is there a file name to write to?
+		if (args[0]) {
+			fn = args;
+		}
+#if ENABLE_FEATURE_VI_READONLY
+		if (readonly_mode && !useforce) {
+			status_line_bold("'%s' is read only", fn);
+			goto ret;
+		}
+#endif
+		// how many lines in text[]?
+		li = count_lines(q, r);
+		size = r - q + 1;
+		//if (useforce) {
+			// if "fn" is not write-able, chmod u+w
+			// sprintf(syscmd, "chmod u+w %s", fn);
+			// system(syscmd);
+			// forced = TRUE;
+		//}
+		l = file_write(fn, q, r);
+		//if (useforce && forced) {
+			// chmod u-w
+			// sprintf(syscmd, "chmod u-w %s", fn);
+			// system(syscmd);
+			// forced = FALSE;
+		//}
+		if (l < 0) {
+			if (l == -1)
+				status_line_bold_errno(fn);
+		} else {
+			status_line("'%s' %dL, %dC", fn, li, l);
+			if (q == text && r == end - 1 && l == size) {
+				modified_count = 0;
+				last_modified_count = -1;
+			}
+			if ((cmd[0] == 'x' || cmd[1] == 'q' || cmd[1] == 'n'
+			    || cmd[0] == 'X' || cmd[1] == 'Q' || cmd[1] == 'N'
+			    )
+			 && l == size
+			) {
+				editing = 0;
+			}
+		}
+#if ENABLE_FEATURE_VI_YANKMARK
+	} else if (strncmp(cmd, "yank", i) == 0) {	// yank lines
+		if (b < 0) {	// no addr given- use defaults
+			q = begin_line(dot);	// assume .,. for the range
+			r = end_line(dot);
+		}
+		text_yank(q, r, YDreg);
+		li = count_lines(q, r);
+		status_line("Yank %d lines (%d chars) into [%c]",
+				li, strlen(reg[YDreg]), what_reg());
+#endif
+	} else {
+		// cmd unknown
+		not_implemented(cmd);
+	}
+ ret:
+	dot = bound_dot(dot);	// make sure "dot" is valid
+	return;
+#if ENABLE_FEATURE_VI_SEARCH
+ colon_s_fail:
+	status_line(":s expression missing delimiters");
+#endif
+#endif /* FEATURE_VI_COLON */
+}
+
+static void Hit_Return(void)
+{
+	int c;
+
+	standout_start();
+	write1("[Hit return to continue]");
+	standout_end();
+	while ((c = get_one_char()) != '\n' && c != '\r')
+		continue;
+	redraw(TRUE);		// force redraw all
+}
+
+static int next_tabstop(int col)
+{
+	return col + ((tabstop - 1) - (col % tabstop));
+}
+
+//----- Synchronize the cursor to Dot --------------------------
+static NOINLINE void sync_cursor(char *d, int *row, int *col)
+{
+	char *beg_cur;	// begin and end of "d" line
+	char *tp;
+	int cnt, ro, co;
+#ifdef ENABLE_BASIC_MULTI_CHAR_CODE
+	int last_code_size = 0;
+#endif
+
+	beg_cur = begin_line(d);	// first char of cur line
+
+	if (beg_cur < screenbegin) {
+		// "d" is before top line on screen
+		// how many lines do we have to move
+		cnt = count_lines(beg_cur, screenbegin);
+ sc1:
+		screenbegin = beg_cur;
+		if (cnt > (rows - 1) / 2) {
+			// we moved too many lines. put "dot" in middle of screen
+			for (cnt = 0; cnt < (rows - 1) / 2; cnt++) {
+				screenbegin = prev_line(screenbegin);
+			}
+		}
+	} else {
+		char *end_scr;	// begin and end of screen
+		end_scr = end_screen();	// last char of screen
+		if (beg_cur > end_scr) {
+			// "d" is after bottom line on screen
+			// how many lines do we have to move
+			cnt = count_lines(end_scr, beg_cur);
+			if (cnt > (rows - 1) / 2)
+				goto sc1;	// too many lines
+			for (ro = 0; ro < cnt - 1; ro++) {
+				// move screen begin the same amount
+				screenbegin = next_line(screenbegin);
+				// now, move the end of screen
+				end_scr = next_line(end_scr);
+				end_scr = end_line(end_scr);
+			}
+		}
+	}
+	// "d" is on screen- find out which row
+	tp = screenbegin;
+	for (ro = 0; ro < rows - 1; ro++) {	// drive "ro" to correct row
+		if (tp == beg_cur)
+			break;
+		tp = next_line(tp);
+	}
+
+	// find out what col "d" is on
+	co = 0;
+	while (tp < d) { // drive "co" to correct column
+		if (*tp == '\n') //vda || *tp == '\0')
+			break;
+		if (*tp == '\t') {
+			// handle tabs like real vi
+			if (d == tp && cmd_mode) {
+				break;
+			}
+			co = next_tabstop(co);
+		} else if ((unsigned char)*tp < ' ' || *tp == 0x7f) {
+			co++; // display as ^X, use 2 columns
+		}
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+		co++;
+		tp++;
+#else
+		unsigned short tmp_code;
+		int code_size;
+		tmp_code = Utf8_to_Utf16(tp, &code_size);
+		co += (code_size > 1 ? 2 : code_size);
+		tp += code_size;
+		last_code_size = code_size;
+#endif
+	}
+
+	// "co" is the column where "dot" is.
+	// The screen has "columns" columns.
+	// The currently displayed columns are  0+offset -- columns+ofset
+	// |-------------------------------------------------------------|
+	//               ^ ^                                ^
+	//        offset | |------- columns ----------------|
+	//
+	// If "co" is already in this range then we do not have to adjust offset
+	//      but, we do have to subtract the "offset" bias from "co".
+	// If "co" is outside this range then we have to change "offset".
+	// If the first char of a line is a tab the cursor will try to stay
+	//  in column 7, but we have to set offset to 0.
+
+	if (co < 0 + offset) {
+		offset = co;
+	}
+	if (co >= columns + offset) {
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+		offset = co - columns + 1;
+#else
+		offset = co - columns + (last_code_size > 1 ? 2 : 1);
+#endif
+	}
+	// if the first char of the line is a tab, and "dot" is sitting on it
+	//  force offset to 0.
+	if (d == beg_cur && *d == '\t') {
+		offset = 0;
+	}
+	co -= offset;
+
+	*row = ro;
+	*col = co;
+}
+
+//----- Text Movement Routines ---------------------------------
+static char *begin_line(char *p) // return pointer to first char cur line
+{
+	if (p > text) {
+		p = memrchr(text, '\n', p - text);
+		if (!p)
+			return text;
+		return p + 1;
+	}
+	return p;
+}
+
+static char *end_line(char *p) // return pointer to NL of cur line
+{
+	if (p < end - 1) {
+		p = memchr(p, '\n', end - p - 1);
+		if (!p)
+			return end - 1;
+	}
+	return p;
+}
+
+static char *dollar_line(char *p) // return pointer to just before NL line
+{
+	p = end_line(p);
+	// Try to stay off of the Newline
+	if (*p == '\n' && (p - begin_line(p)) > 0)
+		p--;
+	return p;
+}
+
+static char *prev_line(char *p) // return pointer first char prev line
+{
+	p = begin_line(p);	// goto beginning of cur line
+	if (p > text && p[-1] == '\n')
+		p--;			// step to prev line
+	p = begin_line(p);	// goto beginning of prev line
+	return p;
+}
+
+static char *next_line(char *p) // return pointer first char next line
+{
+	p = end_line(p);
+	if (p < end - 1 && *p == '\n')
+		p++;			// step to next line
+	return p;
+}
+
+//----- Text Information Routines ------------------------------
+static char *end_screen(void)
+{
+	char *q;
+	int cnt;
+
+	// find new bottom line
+	q = screenbegin;
+	for (cnt = 0; cnt < rows - 2; cnt++)
+		q = next_line(q);
+	q = end_line(q);
+	return q;
+}
+
+// count line from start to stop
+static int count_lines(char *start, char *stop)
+{
+	char *q;
+	int cnt;
+
+	if (stop < start) { // start and stop are backwards- reverse them
+		q = start;
+		start = stop;
+		stop = q;
+	}
+	cnt = 0;
+	stop = end_line(stop);
+	while (start <= stop && start <= end - 1) {
+		start = end_line(start);
+		if (*start == '\n')
+			cnt++;
+		start++;
+	}
+	return cnt;
+}
+
+static char *find_line(int li)	// find beginning of line #li
+{
+	char *q;
+
+	for (q = text; li > 1; li--) {
+		q = next_line(q);
+	}
+	return q;
+}
+
+//----- Dot Movement Routines ----------------------------------
+static void dot_left(void)
+{
+	undo_queue_commit();
+	if (dot > text && dot[-1] != '\n')
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+		dot--;
+#else
+		dot -= bs_char_count(text, dot - text - 1);
+#endif
+}
+
+static void dot_right(void)
+{
+	undo_queue_commit();
+	if (dot < end - 1 && *dot != '\n')
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+		dot++;
+#else
+	{
+		int code_size;
+		unsigned short tmp_code = Utf8_to_Utf16(dot, &code_size);
+		if (dot[code_size - 1] != '\n')
+			dot += code_size;
+	}
+#endif
+}
+
+static void dot_begin(void)
+{
+	undo_queue_commit();
+	dot = begin_line(dot);	// return pointer to first char cur line
+}
+
+static void dot_end(void)
+{
+	undo_queue_commit();
+	dot = end_line(dot);	// return pointer to last char cur line
+}
+
+static char *move_to_col(char *p, int l)
+{
+	int co;
+
+	p = begin_line(p);
+	co = 0;
+	while (co < l && p < end) {
+		if (*p == '\n') //vda || *p == '\0')
+			break;
+		if (*p == '\t') {
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+			co = next_tabstop(co);
+#else
+			co += tabstop;
+			p++;
+#endif
+		}
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+		else if (*p < ' ' || *p == 127) {
+			co++; // display as ^X, use 2 columns
+		}
+		co++;
+		p++;
+#else
+		else {
+			int code_size, tmp_co;
+			char *tmp_p;
+			unsigned short tmp_code = Utf8_to_Utf16(p, &code_size);
+			tmp_co = co + (code_size > 1 ? 2 : 1);
+			if (tmp_co > l)
+				break;
+			else
+				co = tmp_co;
+			tmp_p = p + code_size;
+			if (tmp_p > end)
+				break;
+			else
+				p = tmp_p;
+		}
+#endif
+	}
+	return p;
+}
+
+static void dot_next(void)
+{
+	undo_queue_commit();
+	dot = next_line(dot);
+}
+
+static void dot_prev(void)
+{
+	undo_queue_commit();
+	dot = prev_line(dot);
+}
+
+static void dot_scroll(int cnt, int dir)
+{
+	char *q;
+
+	undo_queue_commit();
+	for (; cnt > 0; cnt--) {
+		if (dir < 0) {
+			// scroll Backwards
+			// ctrl-Y scroll up one line
+			screenbegin = prev_line(screenbegin);
+		} else {
+			// scroll Forwards
+			// ctrl-E scroll down one line
+			screenbegin = next_line(screenbegin);
+		}
+	}
+	// make sure "dot" stays on the screen so we dont scroll off
+	if (dot < screenbegin)
+		dot = screenbegin;
+	q = end_screen();	// find new bottom line
+	if (dot > q)
+		dot = begin_line(q);	// is dot is below bottom line?
+	dot_skip_over_ws();
+}
+
+static void dot_skip_over_ws(void)
+{
+	// skip WS
+	while (isspace(*dot) && *dot != '\n' && dot < end - 1)
+		dot++;
+}
+
+static char *bound_dot(char *p) // make sure  text[0] <= P < "end"
+{
+	if (p >= end && end > text) {
+		p = end - 1;
+		indicate_error();
+	}
+	if (p < text) {
+		p = text;
+		indicate_error();
+	}
+	return p;
+}
+
+//----- Helper Utility Routines --------------------------------
+
+//----------------------------------------------------------------
+//----- Char Routines --------------------------------------------
+/* Chars that are part of a word-
+ *    0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+ * Chars that are Not part of a word (stoppers)
+ *    !"#$%&'()*+,-./:;<=>?@[\]^`{|}~
+ * Chars that are WhiteSpace
+ *    TAB NEWLINE VT FF RETURN SPACE
+ * DO NOT COUNT NEWLINE AS WHITESPACE
+ */
+
+static char *new_screen(int ro, int co)
+{
+	int li;
+	int internal_co = co;
+#ifdef ENABLE_BASIC_MULTI_CHAR_CODE
+	internal_co *= MULTI_BYTE_MULTIPLE;
+#endif
+
+	free(screen);
+	screensize = ro * internal_co + 8;
+	screen = xmalloc(screensize);
+	// initialize the new screen. assume this will be a empty file.
+	screen_erase();
+	//   non-existent text[] lines start with a tilde (~).
+	for (li = 1; li < ro - 1; li++) {
+		screen[(li * internal_co) + 0] = '~';
+	}
+	return screen;
+}
+
+#if ENABLE_FEATURE_VI_SEARCH
+
+# if ENABLE_FEATURE_VI_REGEX_SEARCH
+
+// search for pattern starting at p
+static char *char_search(char *p, const char *pat, int dir, int range)
+{
+	struct re_pattern_buffer preg;
+	const char *err;
+	char *q;
+	int i;
+	int size;
+
+	re_syntax_options = RE_SYNTAX_POSIX_EXTENDED;
+	if (ignorecase)
+		re_syntax_options = RE_SYNTAX_POSIX_EXTENDED | RE_ICASE;
+
+	memset(&preg, 0, sizeof(preg));
+	err = re_compile_pattern(pat, strlen(pat), &preg);
+	if (err != NULL) {
+		status_line_bold("bad search pattern '%s': %s", pat, err);
+		return p;
+	}
+
+	// assume a LIMITED forward search
+	q = end - 1;
+	if (dir == BACK)
+		q = text;
+	// RANGE could be negative if we are searching backwards
+	range = q - p;
+	q = p;
+	size = range;
+	if (range < 0) {
+		size = -size;
+		q = p - size;
+		if (q < text)
+			q = text;
+	}
+	// search for the compiled pattern, preg, in p[]
+	// range < 0: search backward
+	// range > 0: search forward
+	// 0 < start < size
+	// re_search() < 0: not found or error
+	// re_search() >= 0: index of found pattern
+	//           struct pattern   char     int   int    int    struct reg
+	// re_search(*pattern_buffer, *string, size, start, range, *regs)
+	i = re_search(&preg, q, size, /*start:*/ 0, range, /*struct re_registers*:*/ NULL);
+	regfree(&preg);
+	if (i < 0)
+		return NULL;
+	if (dir == FORWARD)
+		p = p + i;
+	else
+		p = p - i;
+	return p;
+}
+
+# else
+
+#  if ENABLE_FEATURE_VI_SETOPTS
+static int mycmp(const char *s1, const char *s2, int len)
+{
+	if (ignorecase) {
+		return strncasecmp(s1, s2, len);
+	}
+	return strncmp(s1, s2, len);
+}
+#  else
+#   define mycmp strncmp
+#  endif
+
+static char *char_search(char *p, const char *pat, int dir, int range)
+{
+	char *start, *stop;
+	int len;
+
+	len = strlen(pat);
+	if (dir == FORWARD) {
+		stop = end - 1;	// assume range is p..end-1
+		if (range == LIMITED)
+			stop = next_line(p);	// range is to next line
+		for (start = p; start < stop; start++) {
+			if (mycmp(start, pat, len) == 0) {
+				return start;
+			}
+		}
+	} else if (dir == BACK) {
+		stop = text;	// assume range is text..p
+		if (range == LIMITED)
+			stop = prev_line(p);	// range is to prev line
+		for (start = p - len; start >= stop; start--) {
+			if (mycmp(start, pat, len) == 0) {
+				return start;
+			}
+		}
+	}
+	// pattern not found
+	return NULL;
+}
+
+# endif
+
+#endif /* FEATURE_VI_SEARCH */
+
+static char *char_insert(char *p, char c, int undo) // insert the char c at 'p'
+{
+	if (c == 22) {		// Is this an ctrl-V?
+		p += stupid_insert(p, '^');	// use ^ to indicate literal next
+		refresh(FALSE);	// show the ^
+		c = get_one_char();
+		*p = c;
+#if ENABLE_FEATURE_VI_UNDO
+		switch (undo) {
+			case ALLOW_UNDO:
+				undo_push(p, 1, UNDO_INS);
+				break;
+			case ALLOW_UNDO_CHAIN:
+				undo_push(p, 1, UNDO_INS_CHAIN);
+				break;
+# if ENABLE_FEATURE_VI_UNDO_QUEUE
+			case ALLOW_UNDO_QUEUED:
+				undo_push(p, 1, UNDO_INS_QUEUED);
+				break;
+# endif
+		}
+#else
+		modified_count++;
+#endif /* ENABLE_FEATURE_VI_UNDO */
+		p++;
+	} else if (c == 27) {	// Is this an ESC?
+		cmd_mode = 0;
+		undo_queue_commit();
+		cmdcnt = 0;
+		end_cmd_q();	// stop adding to q
+		last_status_cksum = 0;	// force status update
+		if ((p[-1] != '\n') && (dot > text)) {
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+			p--;
+#else
+			p -= bs_char_count(text, (p - text - 1));
+#endif
+		}
+	} else if (c == erase_char || c == 8 || c == 127) { // Is this a BS
+		if (p > text) {
+			p--;
+			p = text_hole_delete(p, p, ALLOW_UNDO_QUEUED);	// shrink buffer 1 char
+		}
+	} else {
+		// insert a char into text[]
+		if (c == 13)
+			c = '\n';	// translate \r to \n
+#if ENABLE_FEATURE_VI_UNDO
+# if ENABLE_FEATURE_VI_UNDO_QUEUE
+		if (c == '\n')
+			undo_queue_commit();
+# endif
+		switch (undo) {
+			case ALLOW_UNDO:
+				undo_push(p, 1, UNDO_INS);
+				break;
+			case ALLOW_UNDO_CHAIN:
+				undo_push(p, 1, UNDO_INS_CHAIN);
+				break;
+# if ENABLE_FEATURE_VI_UNDO_QUEUE
+			case ALLOW_UNDO_QUEUED:
+				undo_push(p, 1, UNDO_INS_QUEUED);
+				break;
+# endif
+		}
+#else
+		modified_count++;
+#endif /* ENABLE_FEATURE_VI_UNDO */
+		p += 1 + stupid_insert(p, c);	// insert the char
+#if ENABLE_FEATURE_VI_SETOPTS
+		if (showmatch && strchr(")]}", c) != NULL) {
+			showmatching(p - 1);
+		}
+		if (autoindent && c == '\n') {	// auto indent the new line
+			char *q;
+			size_t len;
+			q = prev_line(p);	// use prev line as template
+			len = strspn(q, " \t"); // space or tab
+			if (len) {
+				uintptr_t bias;
+				bias = text_hole_make(p, len);
+				p += bias;
+				q += bias;
+#if ENABLE_FEATURE_VI_UNDO
+				undo_push(p, len, UNDO_INS);
+#endif
+				memcpy(p, q, len);
+				p += len;
+			}
+		}
+#endif
+	}
+	return p;
+}
+
+// might reallocate text[]! use p += stupid_insert(p, ...),
+// and be careful to not use pointers into potentially freed text[]!
+static uintptr_t stupid_insert(char *p, char c) // stupidly insert the char c at 'p'
+{
+	uintptr_t bias;
+	bias = text_hole_make(p, 1);
+	p += bias;
+	*p = c;
+	return bias;
+}
+
+static int find_range(char **start, char **stop, char c)
+{
+	char *save_dot, *p, *q, *t;
+	int cnt, multiline = 0;
+
+	save_dot = dot;
+	p = q = dot;
+
+	if (strchr("cdy><", c)) {
+		// these cmds operate on whole lines
+		p = q = begin_line(p);
+		for (cnt = 1; cnt < cmdcnt; cnt++) {
+			q = next_line(q);
+		}
+		q = end_line(q);
+	} else if (strchr("^%$0bBeEfth\b\177", c)) {
+		// These cmds operate on char positions
+		do_cmd(c);		// execute movement cmd
+		q = dot;
+	} else if (strchr("wW", c)) {
+		do_cmd(c);		// execute movement cmd
+		// if we are at the next word's first char
+		// step back one char
+		// but check the possibilities when it is true
+		if (dot > text && ((isspace(dot[-1]) && !isspace(dot[0]))
+				|| (ispunct(dot[-1]) && !ispunct(dot[0]))
+				|| (isalnum(dot[-1]) && !isalnum(dot[0]))))
+			dot--;		// move back off of next word
+		if (dot > text && *dot == '\n')
+			dot--;		// stay off NL
+		q = dot;
+	} else if (strchr("H-k{", c)) {
+		// these operate on multi-lines backwards
+		q = end_line(dot);	// find NL
+		do_cmd(c);		// execute movement cmd
+		dot_begin();
+		p = dot;
+	} else if (strchr("L+j}\r\n", c)) {
+		// these operate on multi-lines forwards
+		p = begin_line(dot);
+		do_cmd(c);		// execute movement cmd
+		dot_end();		// find NL
+		q = dot;
+	} else {
+		// nothing -- this causes any other values of c to
+		// represent the one-character range under the
+		// cursor.  this is correct for ' ' and 'l', but
+		// perhaps no others.
+		//
+	}
+	if (q < p) {
+		t = q;
+		q = p;
+		p = t;
+	}
+
+	// backward char movements don't include start position
+	if (q > p && strchr("^0bBh\b\177", c)) q--;
+
+	multiline = 0;
+	for (t = p; t <= q; t++) {
+		if (*t == '\n') {
+			multiline = 1;
+			break;
+		}
+	}
+
+	*start = p;
+	*stop = q;
+	dot = save_dot;
+	return multiline;
+}
+
+static int st_test(char *p, int type, int dir, char *tested)
+{
+	char c, c0, ci;
+	int test, inc;
+
+	inc = dir;
+	c = c0 = p[0];
+	ci = p[inc];
+	test = 0;
+
+	if (type == S_BEFORE_WS) {
+		c = ci;
+		test = (!isspace(c) || c == '\n');
+	}
+	if (type == S_TO_WS) {
+		c = c0;
+		test = (!isspace(c) || c == '\n');
+	}
+	if (type == S_OVER_WS) {
+		c = c0;
+		test = isspace(c);
+	}
+	if (type == S_END_PUNCT) {
+		c = ci;
+		test = ispunct(c);
+	}
+	if (type == S_END_ALNUM) {
+		c = ci;
+		test = (isalnum(c) || c == '_');
+	}
+	*tested = c;
+	return test;
+}
+
+static char *skip_thing(char *p, int linecnt, int dir, int type)
+{
+	char c;
+
+	while (st_test(p, type, dir, &c)) {
+		// make sure we limit search to correct number of lines
+		if (c == '\n' && --linecnt < 1)
+			break;
+		if (dir >= 0 && p >= end - 1)
+			break;
+		if (dir < 0 && p <= text)
+			break;
+		p += dir;		// move to next char
+	}
+	return p;
+}
+
+// find matching char of pair  ()  []  {}
+// will crash if c is not one of these
+static char *find_pair(char *p, const char c)
+{
+	const char *braces = "()[]{}";
+	char match;
+	int dir, level;
+
+	dir = strchr(braces, c) - braces;
+	dir ^= 1;
+	match = braces[dir];
+	dir = ((dir & 1) << 1) - 1; /* 1 for ([{, -1 for )\} */
+
+	// look for match, count levels of pairs  (( ))
+	level = 1;
+	for (;;) {
+		p += dir;
+		if (p < text || p >= end)
+			return NULL;
+		if (*p == c)
+			level++;	// increase pair levels
+		if (*p == match) {
+			level--;	// reduce pair level
+			if (level == 0)
+				return p; // found matching pair
+		}
+	}
+}
+
+#if ENABLE_FEATURE_VI_SETOPTS
+// show the matching char of a pair,  ()  []  {}
+static void showmatching(char *p)
+{
+	char *q, *save_dot;
+
+	// we found half of a pair
+	q = find_pair(p, *p);	// get loc of matching char
+	if (q == NULL) {
+		indicate_error();	// no matching char
+	} else {
+		// "q" now points to matching pair
+		save_dot = dot;	// remember where we are
+		dot = q;		// go to new loc
+		refresh(FALSE);	// let the user see it
+		mysleep(40);	// give user some time
+		dot = save_dot;	// go back to old loc
+		refresh(FALSE);
+	}
+}
+#endif /* FEATURE_VI_SETOPTS */
+
+#if ENABLE_FEATURE_VI_UNDO
+static void flush_undo_data(void)
+{
+	struct undo_object *undo_entry;
+
+	while (undo_stack_tail) {
+		undo_entry = undo_stack_tail;
+		undo_stack_tail = undo_entry->prev;
+		free(undo_entry);
+	}
+}
+
+// Undo functions and hooks added by Jody Bruchon (jody@jodybruchon.com)
+static void undo_push(char *src, unsigned int length, uint8_t u_type)	// Add to the undo stack
+{
+	struct undo_object *undo_entry;
+
+	// "u_type" values
+	// UNDO_INS: insertion, undo will remove from buffer
+	// UNDO_DEL: deleted text, undo will restore to buffer
+	// UNDO_{INS,DEL}_CHAIN: Same as above but also calls undo_pop() when complete
+	// The CHAIN operations are for handling multiple operations that the user
+	// performs with a single action, i.e. REPLACE mode or find-and-replace commands
+	// UNDO_{INS,DEL}_QUEUED: If queuing feature is enabled, allow use of the queue
+	// for the INS/DEL operation. The raw values should be equal to the values of
+	// UNDO_{INS,DEL} ORed with UNDO_QUEUED_FLAG
+
+#if ENABLE_FEATURE_VI_UNDO_QUEUE
+	// This undo queuing functionality groups multiple character typing or backspaces
+	// into a single large undo object. This greatly reduces calls to malloc() for
+	// single-character operations while typing and has the side benefit of letting
+	// an undo operation remove chunks of text rather than a single character.
+	switch (u_type) {
+	case UNDO_EMPTY:	// Just in case this ever happens...
+		return;
+	case UNDO_DEL_QUEUED:
+		if (length != 1)
+			return;	// Only queue single characters
+		switch (undo_queue_state) {
+		case UNDO_EMPTY:
+			undo_queue_state = UNDO_DEL;
+		case UNDO_DEL:
+			undo_queue_spos = src;
+			undo_q++;
+			undo_queue[CONFIG_FEATURE_VI_UNDO_QUEUE_MAX - undo_q] = *src;
+			// If queue is full, dump it into an object
+			if (undo_q == CONFIG_FEATURE_VI_UNDO_QUEUE_MAX)
+				undo_queue_commit();
+			return;
+		case UNDO_INS:
+			// Switch from storing inserted text to deleted text
+			undo_queue_commit();
+			undo_push(src, length, UNDO_DEL_QUEUED);
+			return;
+		}
+		break;
+	case UNDO_INS_QUEUED:
+		if (length != 1)
+			return;
+		switch (undo_queue_state) {
+		case UNDO_EMPTY:
+			undo_queue_state = UNDO_INS;
+			undo_queue_spos = src;
+		case UNDO_INS:
+			undo_q++;	// Don't need to save any data for insertions
+			if (undo_q == CONFIG_FEATURE_VI_UNDO_QUEUE_MAX)
+				undo_queue_commit();
+			return;
+		case UNDO_DEL:
+			// Switch from storing deleted text to inserted text
+			undo_queue_commit();
+			undo_push(src, length, UNDO_INS_QUEUED);
+			return;
+		}
+		break;
+	}
+#else
+	// If undo queuing is disabled, ignore the queuing flag entirely
+	u_type = u_type & ~UNDO_QUEUED_FLAG;
+#endif
+
+	// Allocate a new undo object
+	if (u_type == UNDO_DEL || u_type == UNDO_DEL_CHAIN) {
+		// For UNDO_DEL objects, save deleted text
+		if ((src + length) == end)
+			length--;
+		// If this deletion empties text[], strip the newline. When the buffer becomes
+		// zero-length, a newline is added back, which requires this to compensate.
+		undo_entry = xzalloc(offsetof(struct undo_object, undo_text) + length);
+		memcpy(undo_entry->undo_text, src, length);
+	} else {
+		undo_entry = xzalloc(sizeof(*undo_entry));
+	}
+	undo_entry->length = length;
+#if ENABLE_FEATURE_VI_UNDO_QUEUE
+	if ((u_type & UNDO_USE_SPOS) != 0) {
+		undo_entry->start = undo_queue_spos - text;	// use start position from queue
+	} else {
+		undo_entry->start = src - text;	// use offset from start of text buffer
+	}
+	u_type = (u_type & ~UNDO_USE_SPOS);
+#else
+	undo_entry->start = src - text;
+#endif
+	undo_entry->u_type = u_type;
+
+	// Push it on undo stack
+	undo_entry->prev = undo_stack_tail;
+	undo_stack_tail = undo_entry;
+	modified_count++;
+}
+
+static void undo_pop(void)	// Undo the last operation
+{
+	int repeat;
+	char *u_start, *u_end;
+	struct undo_object *undo_entry;
+
+	// Commit pending undo queue before popping (should be unnecessary)
+	undo_queue_commit();
+
+	undo_entry = undo_stack_tail;
+	// Check for an empty undo stack
+	if (!undo_entry) {
+		status_line("Already at oldest change");
+		return;
+	}
+
+	switch (undo_entry->u_type) {
+	case UNDO_DEL:
+	case UNDO_DEL_CHAIN:
+		// make hole and put in text that was deleted; deallocate text
+		u_start = text + undo_entry->start;
+		text_hole_make(u_start, undo_entry->length);
+		memcpy(u_start, undo_entry->undo_text, undo_entry->length);
+		status_line("Undo [%d] %s %d chars at position %d",
+			modified_count, "restored",
+			undo_entry->length, undo_entry->start
+		);
+		break;
+	case UNDO_INS:
+	case UNDO_INS_CHAIN:
+		// delete what was inserted
+		u_start = undo_entry->start + text;
+		u_end = u_start - 1 + undo_entry->length;
+		text_hole_delete(u_start, u_end, NO_UNDO);
+		status_line("Undo [%d] %s %d chars at position %d",
+			modified_count, "deleted",
+			undo_entry->length, undo_entry->start
+		);
+		break;
+	}
+	repeat = 0;
+	switch (undo_entry->u_type) {
+	// If this is the end of a chain, lower modification count and refresh display
+	case UNDO_DEL:
+	case UNDO_INS:
+		dot = (text + undo_entry->start);
+		refresh(FALSE);
+		break;
+	case UNDO_DEL_CHAIN:
+	case UNDO_INS_CHAIN:
+		repeat = 1;
+		break;
+	}
+	// Deallocate the undo object we just processed
+	undo_stack_tail = undo_entry->prev;
+	free(undo_entry);
+	modified_count--;
+	// For chained operations, continue popping all the way down the chain.
+	if (repeat) {
+		undo_pop();	// Follow the undo chain if one exists
+	}
+}
+
+#if ENABLE_FEATURE_VI_UNDO_QUEUE
+static void undo_queue_commit(void)	// Flush any queued objects to the undo stack
+{
+	// Pushes the queue object onto the undo stack
+	if (undo_q > 0) {
+		// Deleted character undo events grow from the end
+		undo_push(undo_queue + CONFIG_FEATURE_VI_UNDO_QUEUE_MAX - undo_q,
+			undo_q,
+			(undo_queue_state | UNDO_USE_SPOS)
+		);
+		undo_queue_state = UNDO_EMPTY;
+		undo_q = 0;
+	}
+}
+#endif
+
+#endif /* ENABLE_FEATURE_VI_UNDO */
+
+// open a hole in text[]
+// might reallocate text[]! use p += text_hole_make(p, ...),
+// and be careful to not use pointers into potentially freed text[]!
+static uintptr_t text_hole_make(char *p, int size)	// at "p", make a 'size' byte hole
+{
+	uintptr_t bias = 0;
+
+	if (size <= 0)
+		return bias;
+	end += size;		// adjust the new END
+	if (end >= (text + text_size)) {
+		char *new_text;
+		text_size += end - (text + text_size) + 10240;
+		new_text = xrealloc(text, text_size);
+		bias = (new_text - text);
+		screenbegin += bias;
+		dot         += bias;
+		end         += bias;
+		p           += bias;
+#if ENABLE_FEATURE_VI_YANKMARK
+		{
+			int i;
+			for (i = 0; i < ARRAY_SIZE(mark); i++)
+				if (mark[i])
+					mark[i] += bias;
+		}
+#endif
+		text = new_text;
+	}
+	memmove(p + size, p, end - size - p);
+	memset(p, ' ', size);	// clear new hole
+	return bias;
+}
+
+//  close a hole in text[]
+//  "undo" value indicates if this operation should be undo-able
+static char *text_hole_delete(char *p, char *q, int undo) // delete "p" through "q", inclusive
+{
+	char *src, *dest;
+	int cnt, hole_size;
+
+	// move forwards, from beginning
+	// assume p <= q
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+	src = q + 1;
+	dest = p;
+	if (q < p) {		// they are backward- swap them
+		src = p + 1;
+		dest = q;
+	}
+	hole_size = q - p + 1;
+#else
+	int code_size;
+	unsigned short tmp_code;
+	if (q < p) {	// they are backward- swap them
+		tmp_code = Utf8_to_Utf16(p, &code_size);
+		src = p + code_size;
+		dest = q;
+		hole_size = p - q + code_size;
+	}
+	else {
+		if (q == (dot - 1)) {	// BS
+			code_size = bs_char_count(text, (dot - text - 1));
+			src = q + 1;
+			dest = p - (code_size - 1);
+		}
+		else {	// DEL
+			tmp_code = Utf8_to_Utf16(q, &code_size);
+			src = q + code_size;
+			dest = p;
+		}
+		hole_size = q - p + code_size;
+	}
+#endif
+	cnt = end - src;
+#if ENABLE_FEATURE_VI_UNDO
+	switch (undo) {
+		case NO_UNDO:
+			break;
+		case ALLOW_UNDO:
+			undo_push(p, hole_size, UNDO_DEL);
+			break;
+		case ALLOW_UNDO_CHAIN:
+			undo_push(p, hole_size, UNDO_DEL_CHAIN);
+			break;
+# if ENABLE_FEATURE_VI_UNDO_QUEUE
+		case ALLOW_UNDO_QUEUED:
+			undo_push(p, hole_size, UNDO_DEL_QUEUED);
+			break;
+# endif
+	}
+	modified_count--;
+#endif
+	if (src < text || src > end)
+		goto thd0;
+	if (dest < text || dest >= end)
+		goto thd0;
+	modified_count++;
+	if (src >= end)
+		goto thd_atend;	// just delete the end of the buffer
+	memmove(dest, src, cnt);
+ thd_atend:
+	end = end - hole_size;	// adjust the new END
+	if (dest >= end)
+		dest = end - 1;	// make sure dest in below end-1
+	if (end <= text)
+		dest = end = text;	// keep pointers valid
+ thd0:
+	return dest;
+}
+
+// copy text into register, then delete text.
+// if dist <= 0, do not include, or go past, a NewLine
+//
+static char *yank_delete(char *start, char *stop, int dist, int yf, int undo)
+{
+	char *p;
+
+	// make sure start <= stop
+	if (start > stop) {
+		// they are backwards, reverse them
+		p = start;
+		start = stop;
+		stop = p;
+	}
+	if (dist <= 0) {
+		// we cannot cross NL boundaries
+		p = start;
+		if (*p == '\n')
+			return p;
+		// dont go past a NewLine
+		for (; p + 1 <= stop; p++) {
+			if (p[1] == '\n') {
+				stop = p;	// "stop" just before NewLine
+				break;
+			}
+		}
+	}
+	p = start;
+#if ENABLE_FEATURE_VI_YANKMARK
+	text_yank(start, stop, YDreg);
+#endif
+	if (yf == YANKDEL) {
+		p = text_hole_delete(start, stop, undo);
+	}					// delete lines
+	return p;
+}
+
+static void show_help(void)
+{
+	puts("These features are available:"
+#if ENABLE_FEATURE_VI_SEARCH
+	"\n\tPattern searches with / and ?"
+#endif
+#if ENABLE_FEATURE_VI_DOT_CMD
+	"\n\tLast command repeat with ."
+#endif
+#if ENABLE_FEATURE_VI_YANKMARK
+	"\n\tLine marking with 'x"
+	"\n\tNamed buffers with \"x"
+#endif
+#if ENABLE_FEATURE_VI_READONLY
+	//not implemented: "\n\tReadonly if vi is called as \"view\""
+	//redundant: usage text says this too: "\n\tReadonly with -R command line arg"
+#endif
+#if ENABLE_FEATURE_VI_SET
+	"\n\tSome colon mode commands with :"
+#endif
+#if ENABLE_FEATURE_VI_SETOPTS
+	"\n\tSettable options with \":set\""
+#endif
+#if ENABLE_FEATURE_VI_USE_SIGNALS
+	"\n\tSignal catching- ^C"
+	"\n\tJob suspend and resume with ^Z"
+#endif
+#if ENABLE_FEATURE_VI_WIN_RESIZE
+	"\n\tAdapt to window re-sizes"
+#endif
+	);
+}
+
+#if ENABLE_FEATURE_VI_DOT_CMD
+static void start_new_cmd_q(char c)
+{
+	// get buffer for new cmd
+	// if there is a current cmd count put it in the buffer first
+	if (cmdcnt > 0) {
+		lmc_len = sprintf(last_modifying_cmd, "%d%c", cmdcnt, c);
+	} else { // just save char c onto queue
+		last_modifying_cmd[0] = c;
+		lmc_len = 1;
+	}
+	adding2q = 1;
+}
+
+static void end_cmd_q(void)
+{
+#if ENABLE_FEATURE_VI_YANKMARK
+	YDreg = 26;			// go back to default Yank/Delete reg
+#endif
+	adding2q = 0;
+}
+#endif /* FEATURE_VI_DOT_CMD */
+
+#if ENABLE_FEATURE_VI_YANKMARK \
+ || (ENABLE_FEATURE_VI_COLON && ENABLE_FEATURE_VI_SEARCH) \
+ || ENABLE_FEATURE_VI_CRASHME
+// might reallocate text[]! use p += string_insert(p, ...),
+// and be careful to not use pointers into potentially freed text[]!
+static uintptr_t string_insert(char *p, const char *s, int undo) // insert the string at 'p'
+{
+	uintptr_t bias;
+	int i;
+
+	i = strlen(s);
+#if ENABLE_FEATURE_VI_UNDO
+	switch (undo) {
+		case ALLOW_UNDO:
+			undo_push(p, i, UNDO_INS);
+			break;
+		case ALLOW_UNDO_CHAIN:
+			undo_push(p, i, UNDO_INS_CHAIN);
+			break;
+	}
+#endif
+	bias = text_hole_make(p, i);
+	p += bias;
+	memcpy(p, s, i);
+#if ENABLE_FEATURE_VI_YANKMARK
+	{
+		int cnt;
+		for (cnt = 0; *s != '\0'; s++) {
+			if (*s == '\n')
+				cnt++;
+		}
+		status_line("Put %d lines (%d chars) from [%c]", cnt, i, what_reg());
+	}
+#endif
+	return bias;
+}
+#endif
+
+#if ENABLE_FEATURE_VI_YANKMARK
+static char *text_yank(char *p, char *q, int dest)	// copy text into a register
+{
+	int cnt = q - p;
+	if (cnt < 0) {		// they are backwards- reverse them
+		p = q;
+		cnt = -cnt;
+	}
+	free(reg[dest]);	//  if already a yank register, free it
+	reg[dest] = xstrndup(p, cnt + 1);
+	return p;
+}
+
+static char what_reg(void)
+{
+	char c;
+
+	c = 'D';			// default to D-reg
+	if (0 <= YDreg && YDreg <= 25)
+		c = 'a' + (char) YDreg;
+	if (YDreg == 26)
+		c = 'D';
+	if (YDreg == 27)
+		c = 'U';
+	return c;
+}
+
+static void check_context(char cmd)
+{
+	// A context is defined to be "modifying text"
+	// Any modifying command establishes a new context.
+
+	if (dot < context_start || dot > context_end) {
+		if (strchr(modifying_cmds, cmd) != NULL) {
+			// we are trying to modify text[]- make this the current context
+			mark[27] = mark[26];	// move cur to prev
+			mark[26] = dot;	// move local to cur
+			context_start = prev_line(prev_line(dot));
+			context_end = next_line(next_line(dot));
+			//loiter= start_loiter= now;
+		}
+	}
+}
+
+static char *swap_context(char *p) // goto new context for '' command make this the current context
+{
+	char *tmp;
+
+	// the current context is in mark[26]
+	// the previous context is in mark[27]
+	// only swap context if other context is valid
+	if (text <= mark[27] && mark[27] <= end - 1) {
+		tmp = mark[27];
+		mark[27] = p;
+		mark[26] = p = tmp;
+		context_start = prev_line(prev_line(prev_line(p)));
+		context_end = next_line(next_line(next_line(p)));
+	}
+	return p;
+}
+#endif /* FEATURE_VI_YANKMARK */
+
+//----- Set terminal attributes --------------------------------
+static void rawmode(void)
+{
+	tcgetattr(0, &term_orig);
+	term_vi = term_orig;
+	term_vi.c_lflag &= (~ICANON & ~ECHO);	// leave ISIG on - allow intr's
+	term_vi.c_iflag &= (~IXON & ~ICRNL);
+	term_vi.c_oflag &= (~ONLCR);
+	term_vi.c_cc[VMIN] = 1;
+	term_vi.c_cc[VTIME] = 0;
+	erase_char = term_vi.c_cc[VERASE];
+	tcsetattr_stdin_TCSANOW(&term_vi);
+}
+
+static void cookmode(void)
+{
+	fflush_all();
+	tcsetattr_stdin_TCSANOW(&term_orig);
+}
+
+#if ENABLE_FEATURE_VI_USE_SIGNALS
+//----- Come here when we get a window resize signal ---------
+static void winch_sig(int sig UNUSED_PARAM)
+{
+	int save_errno = errno;
+	// FIXME: do it in main loop!!!
+	signal(SIGWINCH, winch_sig);
+	query_screen_dimensions();
+	new_screen(rows, columns);	// get memory for virtual screen
+	redraw(TRUE);		// re-draw the screen
+	errno = save_errno;
+}
+
+//----- Come here when we get a continue signal -------------------
+static void cont_sig(int sig UNUSED_PARAM)
+{
+	int save_errno = errno;
+	rawmode(); // terminal to "raw"
+	last_status_cksum = 0; // force status update
+	redraw(TRUE); // re-draw the screen
+
+	signal(SIGTSTP, suspend_sig);
+	signal(SIGCONT, SIG_DFL);
+	//kill(my_pid, SIGCONT); // huh? why? we are already "continued"...
+	errno = save_errno;
+}
+
+//----- Come here when we get a Suspend signal -------------------
+static void suspend_sig(int sig UNUSED_PARAM)
+{
+	int save_errno = errno;
+	go_bottom_and_clear_to_eol();
+	cookmode(); // terminal to "cooked"
+
+	signal(SIGCONT, cont_sig);
+	signal(SIGTSTP, SIG_DFL);
+	kill(my_pid, SIGTSTP);
+	errno = save_errno;
+}
+
+//----- Come here when we get a signal ---------------------------
+static void catch_sig(int sig)
+{
+	signal(SIGINT, catch_sig);
+	siglongjmp(restart, sig);
+}
+#endif /* FEATURE_VI_USE_SIGNALS */
+
+static int mysleep(int hund)	// sleep for 'hund' 1/100 seconds or stdin ready
+{
+	struct pollfd pfd[1];
+
+	if (hund != 0)
+		fflush_all();
+
+	pfd[0].fd = STDIN_FILENO;
+	pfd[0].events = POLLIN;
+	return safe_poll(pfd, 1, hund*10) > 0;
+}
+
+//----- IO Routines --------------------------------------------
+static int readit(void) // read (maybe cursor) key from stdin
+{
+	int c;
+
+	fflush_all();
+	c = read_key(STDIN_FILENO, readbuffer, /*timeout off:*/ -2);
+	if (c == -1) { // EOF/error
+		go_bottom_and_clear_to_eol();
+		cookmode(); // terminal to "cooked"
+		bb_error_msg_and_die("can't read user input");
+	}
+	return c;
+}
+
+//----- IO Routines --------------------------------------------
+static int get_one_char(void)
+{
+	int c;
+
+#if ENABLE_FEATURE_VI_DOT_CMD
+	if (!adding2q) {
+		// we are not adding to the q.
+		// but, we may be reading from a q
+		if (ioq == 0) {
+			// there is no current q, read from STDIN
+			c = readit();	// get the users input
+		} else {
+			// there is a queue to get chars from first
+			// careful with correct sign expansion!
+			c = (unsigned char)*ioq++;
+			if (c == '\0') {
+				// the end of the q, read from STDIN
+				free(ioq_start);
+				ioq_start = ioq = 0;
+				c = readit();	// get the users input
+			}
+		}
+	} else {
+		// adding STDIN chars to q
+		c = readit();	// get the users input
+		if (lmc_len >= MAX_INPUT_LEN - 1) {
+			status_line_bold("last_modifying_cmd overrun");
+		} else {
+			// add new char to q
+			last_modifying_cmd[lmc_len++] = c;
+		}
+	}
+#else
+	c = readit();		// get the users input
+#endif /* FEATURE_VI_DOT_CMD */
+	return c;
+}
+
+// Get input line (uses "status line" area)
+static char *get_input_line(const char *prompt)
+{
+	// char [MAX_INPUT_LEN]
+#define buf get_input_line__buf
+
+	int c;
+	int i;
+
+	strcpy(buf, prompt);
+	last_status_cksum = 0;	// force status update
+	go_bottom_and_clear_to_eol();
+	write1(prompt);      // write out the :, /, or ? prompt
+
+	i = strlen(buf);
+	while (i < MAX_INPUT_LEN) {
+		c = get_one_char();
+		if (c == '\n' || c == '\r' || c == 27)
+			break;		// this is end of input
+		if (c == erase_char || c == 8 || c == 127) {
+			// user wants to erase prev char
+			buf[--i] = '\0';
+			write1("\b \b"); // erase char on screen
+			if (i <= 0) // user backs up before b-o-l, exit
+				break;
+		} else if (c > 0 && c < 256) { // exclude Unicode
+			// (TODO: need to handle Unicode)
+			buf[i] = c;
+			buf[++i] = '\0';
+			bb_putchar(c);
+		}
+	}
+	refresh(FALSE);
+	return buf;
+#undef buf
+}
+
+// might reallocate text[]!
+static int file_insert(const char *fn, char *p, int initial)
+{
+	int cnt = -1;
+	int fd, size;
+	struct stat statbuf;
+
+	if (p < text)
+		p = text;
+	if (p > end)
+		p = end;
+
+	fd = open(fn, O_RDONLY);
+	if (fd < 0) {
+		if (!initial)
+			status_line_bold_errno(fn);
+		return cnt;
+	}
+
+	/* Validate file */
+//	if (fstat(fd, &statbuf) < 0) {
+	if (stat(fn, &statbuf) < 0) {
+		status_line_bold_errno(fn);
+		goto fi;
+	}
+	if (!S_ISREG(statbuf.st_mode)) {
+		status_line_bold("'%s' is not a regular file", fn);
+		goto fi;
+	}
+	size = (statbuf.st_size < INT_MAX ? (int)statbuf.st_size : INT_MAX);
+	p += text_hole_make(p, size);
+	cnt = full_read(fd, p, size);
+	if (cnt < 0) {
+		status_line_bold_errno(fn);
+		p = text_hole_delete(p, p + size - 1, NO_UNDO);	// un-do buffer insert
+	} else if (cnt < size) {
+		// There was a partial read, shrink unused space
+		p = text_hole_delete(p + cnt, p + size - 1, NO_UNDO);
+		status_line_bold("can't read '%s'", fn);
+	}
+ fi:
+	close(fd);
+
+#if ENABLE_FEATURE_VI_READONLY
+	if (initial
+	 && ((access(fn, W_OK) < 0) ||
+		/* root will always have access()
+		 * so we check fileperms too */
+		!(statbuf.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))
+	    )
+	) {
+		SET_READONLY_FILE(readonly_mode);
+	}
+#endif
+	return cnt;
+}
+
+static int file_write(char *fn, char *first, char *last)
+{
+	int fd, cnt, charcnt;
+
+	if (fn == 0) {
+		status_line_bold("No current filename");
+		return -2;
+	}
+	/* By popular request we do not open file with O_TRUNC,
+	 * but instead ftruncate() it _after_ successful write.
+	 * Might reduce amount of data lost on power fail etc.
+	 */
+	fd = open(fn, (O_WRONLY | O_CREAT), 0666);
+	if (fd < 0)
+		return -1;
+	cnt = last - first + 1;
+	charcnt = full_write(fd, first, cnt);
+	ftruncate(fd, charcnt);
+	if (charcnt == cnt) {
+		// good write
+		//modified_count = FALSE;
+	} else {
+		charcnt = 0;
+	}
+	close(fd);
+	return charcnt;
+}
+
+//----- Terminal Drawing ---------------------------------------
+// The terminal is made up of 'rows' line of 'columns' columns.
+// classically this would be 24 x 80.
+//  screen coordinates
+//  0,0     ...     0,79
+//  1,0     ...     1,79
+//  .       ...     .
+//  .       ...     .
+//  22,0    ...     22,79
+//  23,0    ...     23,79   <- status line
+
+//----- Move the cursor to row x col (count from 0, not 1) -------
+static void place_cursor(int row, int col)
+{
+	char cm1[sizeof(ESC_SET_CURSOR_POS) + sizeof(int)*3 * 2];
+
+	if (row < 0) row = 0;
+	if (row >= rows) row = rows - 1;
+	if (col < 0) col = 0;
+	if (col >= columns) col = columns - 1;
+
+	sprintf(cm1, ESC_SET_CURSOR_POS, row + 1, col + 1);
+	write1(cm1);
+}
+
+//----- Erase from cursor to end of line -----------------------
+static void clear_to_eol(void)
+{
+	write1(ESC_CLEAR2EOL);
+}
+
+static void go_bottom_and_clear_to_eol(void)
+{
+	place_cursor(rows - 1, 0);
+	clear_to_eol();
+}
+
+//----- Erase from cursor to end of screen -----------------------
+static void clear_to_eos(void)
+{
+	write1(ESC_CLEAR2EOS);
+}
+
+//----- Start standout mode ------------------------------------
+static void standout_start(void)
+{
+	write1(ESC_BOLD_TEXT);
+}
+
+//----- End standout mode --------------------------------------
+static void standout_end(void)
+{
+	write1(ESC_NORM_TEXT);
+}
+
+//----- Flash the screen  --------------------------------------
+static void flash(int h)
+{
+	standout_start();
+	redraw(TRUE);
+	mysleep(h);
+	standout_end();
+	redraw(TRUE);
+}
+
+static void indicate_error(void)
+{
+#if ENABLE_FEATURE_VI_CRASHME
+	if (crashme > 0)
+		return;			// generate a random command
+#endif
+	if (!err_method) {
+		write1(ESC_BELL);
+	} else {
+		flash(10);
+	}
+}
+
+//----- Screen[] Routines --------------------------------------
+//----- Erase the Screen[] memory ------------------------------
+static void screen_erase(void)
+{
+	memset(screen, ' ', screensize);	// clear new screen
+}
+
+static int bufsum(char *buf, int count)
+{
+	int sum = 0;
+	char *e = buf + count;
+
+	while (buf < e)
+		sum += (unsigned char) *buf++;
+	return sum;
+}
+
+//----- Draw the status line at bottom of the screen -------------
+static void show_status_line(void)
+{
+	int cnt = 0, cksum = 0;
+
+	// either we already have an error or status message, or we
+	// create one.
+	if (!have_status_msg) {
+		cnt = format_edit_status();
+		cksum = bufsum(status_buffer, cnt);
+	}
+	if (have_status_msg || ((cnt > 0 && last_status_cksum != cksum))) {
+		last_status_cksum = cksum;		// remember if we have seen this line
+		go_bottom_and_clear_to_eol();
+		write1(status_buffer);
+		if (have_status_msg) {
+			if (((int)strlen(status_buffer) - (have_status_msg - 1)) >
+					(columns - 1) ) {
+				have_status_msg = 0;
+				Hit_Return();
+			}
+			have_status_msg = 0;
+		}
+		place_cursor(crow, ccol);  // put cursor back in correct place
+	}
+	fflush_all();
+}
+
+//----- format the status buffer, the bottom line of screen ------
+// format status buffer, with STANDOUT mode
+static void status_line_bold(const char *format, ...)
+{
+	va_list args;
+
+	va_start(args, format);
+	strcpy(status_buffer, ESC_BOLD_TEXT);
+	vsprintf(status_buffer + sizeof(ESC_BOLD_TEXT)-1, format, args);
+	strcat(status_buffer, ESC_NORM_TEXT);
+	va_end(args);
+
+	have_status_msg = 1 + sizeof(ESC_BOLD_TEXT) + sizeof(ESC_NORM_TEXT) - 2;
+}
+
+static void status_line_bold_errno(const char *fn)
+{
+	status_line_bold("'%s' %s", fn, strerror(errno));
+}
+
+// format status buffer
+static void status_line(const char *format, ...)
+{
+	va_list args;
+
+	va_start(args, format);
+	vsprintf(status_buffer, format, args);
+	va_end(args);
+
+	have_status_msg = 1;
+}
+
+// copy s to buf, convert unprintable
+static void print_literal(char *buf, const char *s)
+{
+	char *d;
+	unsigned char c;
+
+	buf[0] = '\0';
+	if (!s[0])
+		s = "(NULL)";
+
+	d = buf;
+	for (; *s; s++) {
+		int c_is_no_print;
+
+		c = *s;
+		c_is_no_print = (c & 0x80) && !Isprint(c);
+		if (c_is_no_print) {
+			strcpy(d, ESC_NORM_TEXT);
+			d += sizeof(ESC_NORM_TEXT)-1;
+			c = '.';
+		}
+		if (c < ' ' || c == 0x7f) {
+			*d++ = '^';
+			c |= '@'; /* 0x40 */
+			if (c == 0x7f)
+				c = '?';
+		}
+		*d++ = c;
+		*d = '\0';
+		if (c_is_no_print) {
+			strcpy(d, ESC_BOLD_TEXT);
+			d += sizeof(ESC_BOLD_TEXT)-1;
+		}
+		if (*s == '\n') {
+			*d++ = '$';
+			*d = '\0';
+		}
+		if (d - buf > MAX_INPUT_LEN - 10) // paranoia
+			break;
+	}
+}
+
+static void not_implemented(const char *s)
+{
+	char buf[MAX_INPUT_LEN];
+
+	print_literal(buf, s);
+	status_line_bold("\'%s\' is not implemented", buf);
+}
+
+// show file status on status line
+static int format_edit_status(void)
+{
+	static const char cmd_mode_indicator[] ALIGN1 = "-IR-";
+
+#define tot format_edit_status__tot
+
+	int cur, percent, ret, trunc_at;
+
+	// modified_count is now a counter rather than a flag.  this
+	// helps reduce the amount of line counting we need to do.
+	// (this will cause a mis-reporting of modified status
+	// once every MAXINT editing operations.)
+
+	// it would be nice to do a similar optimization here -- if
+	// we haven't done a motion that could have changed which line
+	// we're on, then we shouldn't have to do this count_lines()
+	cur = count_lines(text, dot);
+
+	// count_lines() is expensive.
+	// Call it only if something was changed since last time
+	// we were here:
+	if (modified_count != last_modified_count) {
+		tot = cur + count_lines(dot, end - 1) - 1;
+		last_modified_count = modified_count;
+	}
+
+	//    current line         percent
+	//   -------------    ~~ ----------
+	//    total lines            100
+	if (tot > 0) {
+		percent = (100 * cur) / tot;
+	} else {
+		cur = tot = 0;
+		percent = 100;
+	}
+
+	trunc_at = columns < STATUS_BUFFER_LEN-1 ?
+		columns : STATUS_BUFFER_LEN-1;
+
+	ret = snprintf(status_buffer, trunc_at+1,
+#if ENABLE_FEATURE_VI_READONLY
+		"%c %s%s%s %d/%d %d%%",
+#else
+		"%c %s%s %d/%d %d%%",
+#endif
+		cmd_mode_indicator[cmd_mode & 3],
+		(current_filename != NULL ? current_filename : "No file"),
+#if ENABLE_FEATURE_VI_READONLY
+		(readonly_mode ? " [Readonly]" : ""),
+#endif
+		(modified_count ? " [Modified]" : ""),
+		cur, tot, percent);
+
+	if (ret >= 0 && ret < trunc_at)
+		return ret;  /* it all fit */
+
+	return trunc_at;  /* had to truncate */
+#undef tot
+}
+
+//----- Force refresh of all Lines -----------------------------
+static void redraw(int full_screen)
+{
+	place_cursor(0, 0);
+	clear_to_eos();
+	screen_erase();		// erase the internal screen buffer
+	last_status_cksum = 0;	// force status update
+	refresh(full_screen);	// this will redraw the entire display
+	show_status_line();
+}
+
+#ifdef ENABLE_BASIC_MULTI_CHAR_CODE
+//----- get screen column number of string ---------------------
+int get_view_col_from_bytes(char *st, char bytes, int max_size)
+{
+	char *buf_end = st + max_size;
+	int tmp_bytes = 0, tmp_total_bytes = 0, view_col = 0;
+	while (tmp_total_bytes < bytes) {
+		Utf8_to_Utf16(st, &tmp_bytes);
+		tmp_total_bytes += tmp_bytes;
+		view_col += tmp_bytes > 1 ? 2 : 1;
+		st += tmp_bytes;
+		if (st >= buf_end)
+			break;
+	}
+	return view_col;
+}
+//----- get string bytes of screen column ----------------------
+int get_bytes_from_view_col(char *st, int view_col, int max_size)
+{
+	char *buf_end = st + max_size;
+	int tmp_view_col = 0, bytes = 0, tmp_bytes;
+	while (tmp_view_col < view_col) {
+		Utf8_to_Utf16(st, &tmp_bytes);
+		bytes += tmp_bytes;
+		tmp_view_col += tmp_bytes > 1 ? 2 : 1;
+		st += tmp_bytes;
+		if (st >= buf_end)
+			break;
+	}
+	return bytes;
+}
+#endif
+
+//----- Format a text[] line into a buffer ---------------------
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+static char* format_line(char *src /*, int li*/)
+#else
+static char* format_line(char *src , int *bytes, int *view_co)
+#endif
+{
+	unsigned char c;
+	int co;
+	int ofs = offset;
+	char *dest = scr_out_buf; // [MAX_SCR_COLS + MAX_TABSTOP * 2]
+#ifdef ENABLE_BASIC_MULTI_CHAR_CODE
+	int tmp_bytes, tmp_columns_count, total_bytes = 0, view_columns = 0;
+	memset(scr_out_buf, 0x00, sizeof(scr_out_buf));
+#endif
+
+	c = '~'; // char in col 0 in non-existent lines is '~'
+	co = 0;
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+	while (co < columns + tabstop) {
+#else
+	while (view_columns < columns + ofs/* + tabstop*/) {
+#endif
+		// have we gone past the end?
+		if (src < end) {
+			c = *src++;
+			if (c == '\n')
+				break;
+			if ((c & 0x80) && !Isprint(c)) {
+				c = '.';
+			}
+			if (c < ' ' || c == 0x7f) {
+				if (c == '\t') {
+					c = ' ';
+					//      co %    8     !=     7
+					while ((co % tabstop) != (tabstop - 1)) {
+						dest[co++] = c;
+#ifdef ENABLE_BASIC_MULTI_CHAR_CODE
+						total_bytes++;
+						view_columns++;
+#endif
+					}
+				} else {
+					dest[co++] = '^';
+					if (c == 0x7f)
+						c = '?';
+					else
+						c += '@'; // Ctrl-X -> 'X'
+				}
+			}
+		}
+		dest[co++] = c;
+#ifdef ENABLE_BASIC_MULTI_CHAR_CODE
+		total_bytes++;
+		view_columns++;
+		if (IsMultiByteChar(c, &tmp_bytes)) {
+			if (view_columns + 1 > columns + ofs) {
+				dest[--co] = ' ';
+			}
+			else {
+				view_columns++;
+				int i;
+				for (i = 0; i < tmp_bytes - 1; i++) {
+					dest[co++] = *src++;
+					total_bytes++;
+				}
+			}
+		}
+#endif
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+		// discard scrolled-off-to-the-left portion,
+		// in tabstop-sized pieces
+		if (ofs >= tabstop && co >= tabstop) {
+			memmove(dest, dest + tabstop, co);
+			co -= tabstop;
+			ofs -= tabstop;
+		}
+#endif
+		if (src >= end)
+			break;
+	}
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+	// check "short line, gigantic offset" case
+	if (co < ofs)
+		ofs = co;
+	// discard last scrolled off part
+	co -= ofs;
+	dest += ofs;
+	// fill the rest with spaces
+	if (co < columns)
+		memset(&dest[co], ' ', columns - co);
+#else
+	// check "short line, gigantic offset" case
+	if (view_columns < ofs)
+		ofs = view_columns;
+	// discard last scrolled off part
+	view_columns -= ofs;
+	tmp_columns_count = 0;
+	while (tmp_columns_count < ofs) {
+		IsMultiByteChar(*dest, &tmp_bytes);
+		dest += tmp_bytes;
+		total_bytes -= tmp_bytes;
+		tmp_columns_count += tmp_bytes > 1 ? 2 : 1;
+	}
+	// fill the rest with spaces
+	if (view_columns < columns) {
+		int ofs_bytes = get_bytes_from_view_col(scr_out_buf, ofs, co);
+		memset(&dest[co - ofs_bytes], ' ', columns - view_columns);
+		total_bytes = total_bytes + (columns - view_columns);
+	}
+	*bytes = total_bytes;
+	*view_co = view_columns;
+#endif
+	return dest;
+}
+
+//----- Refresh the changed screen lines -----------------------
+// Copy the source line from text[] into the buffer and note
+// if the current screenline is different from the new buffer.
+// If they differ then that line needs redrawing on the terminal.
+//
+static void refresh(int full_screen)
+{
+#define old_offset refresh__old_offset
+
+	int li, changed;
+	char *tp, *sp;		// pointer into text[] and screen[]
+#ifdef ENABLE_BASIC_MULTI_CHAR_CODE
+	int bytes, view_co;
+#endif
+
+	if (ENABLE_FEATURE_VI_WIN_RESIZE IF_FEATURE_VI_ASK_TERMINAL(&& !G.get_rowcol_error) ) {
+		unsigned c = columns, r = rows;
+		query_screen_dimensions();
+		full_screen |= (c - columns) | (r - rows);
+	}
+	sync_cursor(dot, &crow, &ccol);	// where cursor will be (on "dot")
+	tp = screenbegin;	// index into text[] of top line
+
+	// compare text[] to screen[] and mark screen[] lines that need updating
+	for (li = 0; li < rows - 1; li++) {
+		int cs, ce;				// column start & end
+		char *out_buf;
+		// format current text line
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+		out_buf = format_line(tp /*, li*/);
+#else
+		out_buf = format_line(tp , &bytes, &view_co);
+#endif
+
+		// skip to the end of the current text[] line
+		if (tp < end) {
+			char *t = memchr(tp, '\n', end - tp);
+			if (!t) t = end - 1;
+			tp = t + 1;
+		}
+
+		// see if there are any changes between virtual screen and out_buf
+		changed = FALSE;	// assume no change
+		cs = 0;
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+		ce = columns - 1;
+		int cursor_column = 0;
+		sp = &screen[li * columns];	// start of screen line
+#else
+		ce = bytes - 1;
+		int cursor_column = 0;
+		sp = &screen[li * columns * MULTI_BYTE_MULTIPLE];	// start of screen line
+#endif
+		if (full_screen) {
+			// force re-draw of every single column from 0 - columns-1
+			goto re0;
+		}
+		// compare newly formatted buffer with virtual screen
+		// look forward for first difference between buf and screen
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+		for (; cs <= ce; cs++) {
+			if (out_buf[cs] != sp[cs]) {
+				changed = TRUE;	// mark for redraw
+				break;
+			}
+		}
+#else
+		while (cs <= ce) {
+			int code_size;
+			unsigned short tmp_code = Utf8_to_Utf16(&sp[cs], &code_size);
+			if (memcmp(&out_buf[cs], &sp[cs], code_size)) {
+				changed = TRUE;	// mark for redraw
+				break;
+			}
+			cs += code_size;
+			cursor_column += (code_size > 1 ? 2 : 1);
+		}
+#endif
+		// look backward for last difference between out_buf and screen
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+		for (; ce >= cs; ce--) {
+			if (out_buf[ce] != sp[ce]) {
+				changed = TRUE;	// mark for redraw
+				break;
+			}
+		}
+#else
+		while (ce >= cs) {
+			int code_size = bs_char_count(out_buf, ce);
+			if (memcmp(&out_buf[ce], &sp[ce], code_size)) {
+				changed = TRUE;	// mark for redraw
+				break;
+			}
+			ce -= code_size;
+		}
+		if (view_co < columns - 1)
+			ce = bytes;
+#endif
+		// now, cs is index of first diff, and ce is index of last diff
+
+		// if horz offset has changed, force a redraw
+		if (offset != old_offset) {
+ re0:
+			changed = TRUE;
+		}
+
+		// make a sanity check of columns indexes
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+		if (cs < 0) { cs = 0; cursor_column = 0; }
+		if (ce > columns - 1) ce = columns - 1;
+		if (cs > ce) { cs = 0; ce = columns - 1; cursor_column = 0; }
+#else
+		if (cs < 0) { cs = 0; cursor_column = 0; }
+		if (get_view_col_from_bytes(out_buf, ce, (columns * MULTI_BYTE_MULTIPLE)) > columns - 1)
+			ce = get_bytes_from_view_col(out_buf, columns, (columns * MULTI_BYTE_MULTIPLE)) - 1;
+		if (cs > ce) {
+			cs = 0;
+			ce = get_bytes_from_view_col(out_buf, columns, (columns * MULTI_BYTE_MULTIPLE)) - 1;
+			cursor_column = 0;
+		}
+#endif
+		// is there a change between virtual screen and out_buf
+		if (changed) {
+			// copy changed part of buffer to virtual screen
+			memcpy(sp+cs, out_buf+cs, ce-cs+1);
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+			place_cursor(li, cs);
+#else
+			place_cursor(li, cursor_column);
+#endif
+			// write line out to terminal
+			fwrite(&sp[cs], ce - cs + 1, 1, stdout);
+		}
+	}
+
+	place_cursor(crow, ccol);
+
+	old_offset = offset;
+#undef old_offset
+}
+
+//---------------------------------------------------------------------
+//----- the Ascii Chart -----------------------------------------------
+//
+//  00 nul   01 soh   02 stx   03 etx   04 eot   05 enq   06 ack   07 bel
+//  08 bs    09 ht    0a nl    0b vt    0c np    0d cr    0e so    0f si
+//  10 dle   11 dc1   12 dc2   13 dc3   14 dc4   15 nak   16 syn   17 etb
+//  18 can   19 em    1a sub   1b esc   1c fs    1d gs    1e rs    1f us
+//  20 sp    21 !     22 "     23 #     24 $     25 %     26 &     27 '
+//  28 (     29 )     2a *     2b +     2c ,     2d -     2e .     2f /
+//  30 0     31 1     32 2     33 3     34 4     35 5     36 6     37 7
+//  38 8     39 9     3a :     3b ;     3c <     3d =     3e >     3f ?
+//  40 @     41 A     42 B     43 C     44 D     45 E     46 F     47 G
+//  48 H     49 I     4a J     4b K     4c L     4d M     4e N     4f O
+//  50 P     51 Q     52 R     53 S     54 T     55 U     56 V     57 W
+//  58 X     59 Y     5a Z     5b [     5c \     5d ]     5e ^     5f _
+//  60 `     61 a     62 b     63 c     64 d     65 e     66 f     67 g
+//  68 h     69 i     6a j     6b k     6c l     6d m     6e n     6f o
+//  70 p     71 q     72 r     73 s     74 t     75 u     76 v     77 w
+//  78 x     79 y     7a z     7b {     7c |     7d }     7e ~     7f del
+//---------------------------------------------------------------------
+
+//----- Execute a Vi Command -----------------------------------
+static void do_cmd(int c)
+{
+	char *p, *q, *save_dot;
+	char buf[12];
+	int dir;
+	int cnt, i, j;
+	int c1;
+
+//	c1 = c; // quiet the compiler
+//	cnt = yf = 0; // quiet the compiler
+//	p = q = save_dot = buf; // quiet the compiler
+	memset(buf, '\0', sizeof(buf));
+
+	show_status_line();
+
+	/* if this is a cursor key, skip these checks */
+	switch (c) {
+		case KEYCODE_UP:
+		case KEYCODE_DOWN:
+		case KEYCODE_LEFT:
+		case KEYCODE_RIGHT:
+		case KEYCODE_HOME:
+		case KEYCODE_END:
+		case KEYCODE_PAGEUP:
+		case KEYCODE_PAGEDOWN:
+		case KEYCODE_DELETE:
+			goto key_cmd_mode;
+	}
+
+	if (cmd_mode == 2) {
+		//  flip-flop Insert/Replace mode
+		if (c == KEYCODE_INSERT)
+			goto dc_i;
+		// we are 'R'eplacing the current *dot with new char
+		if (*dot == '\n') {
+			// don't Replace past E-o-l
+			cmd_mode = 1;	// convert to insert
+			undo_queue_commit();
+		} else {
+			if (1 <= c || Isprint(c)) {
+				if (c != 27)
+					dot = yank_delete(dot, dot, 0, YANKDEL, ALLOW_UNDO);	// delete char
+				dot = char_insert(dot, c, ALLOW_UNDO_CHAIN);	// insert new char
+			}
+			goto dc1;
+		}
+	}
+	if (cmd_mode == 1) {
+		//  hitting "Insert" twice means "R" replace mode
+		if (c == KEYCODE_INSERT) goto dc5;
+		// insert the char c at "dot"
+		if (1 <= c || Isprint(c)) {
+			dot = char_insert(dot, c, ALLOW_UNDO_QUEUED);
+		}
+		goto dc1;
+	}
+
+ key_cmd_mode:
+	switch (c) {
+		//case 0x01:	// soh
+		//case 0x09:	// ht
+		//case 0x0b:	// vt
+		//case 0x0e:	// so
+		//case 0x0f:	// si
+		//case 0x10:	// dle
+		//case 0x11:	// dc1
+		//case 0x13:	// dc3
+#if ENABLE_FEATURE_VI_CRASHME
+	case 0x14:			// dc4  ctrl-T
+		crashme = (crashme == 0) ? 1 : 0;
+		break;
+#endif
+		//case 0x16:	// syn
+		//case 0x17:	// etb
+		//case 0x18:	// can
+		//case 0x1c:	// fs
+		//case 0x1d:	// gs
+		//case 0x1e:	// rs
+		//case 0x1f:	// us
+		//case '!':	// !-
+		//case '#':	// #-
+		//case '&':	// &-
+		//case '(':	// (-
+		//case ')':	// )-
+		//case '*':	// *-
+		//case '=':	// =-
+		//case '@':	// @-
+		//case 'F':	// F-
+		//case 'K':	// K-
+		//case 'Q':	// Q-
+		//case 'S':	// S-
+		//case 'T':	// T-
+		//case 'V':	// V-
+		//case '[':	// [-
+		//case '\\':	// \-
+		//case ']':	// ]-
+		//case '_':	// _-
+		//case '`':	// `-
+		//case 'v':	// v-
+	default:			// unrecognized command
+		buf[0] = c;
+		buf[1] = '\0';
+		not_implemented(buf);
+		end_cmd_q();	// stop adding to q
+	case 0x00:			// nul- ignore
+		break;
+	case 2:			// ctrl-B  scroll up   full screen
+	case KEYCODE_PAGEUP:	// Cursor Key Page Up
+		dot_scroll(rows - 2, -1);
+		break;
+	case 4:			// ctrl-D  scroll down half screen
+		dot_scroll((rows - 2) / 2, 1);
+		break;
+	case 5:			// ctrl-E  scroll down one line
+		dot_scroll(1, 1);
+		break;
+	case 6:			// ctrl-F  scroll down full screen
+	case KEYCODE_PAGEDOWN:	// Cursor Key Page Down
+		dot_scroll(rows - 2, 1);
+		break;
+	case 7:			// ctrl-G  show current status
+		last_status_cksum = 0;	// force status update
+		break;
+	case 'h':			// h- move left
+	case KEYCODE_LEFT:	// cursor key Left
+	case 8:		// ctrl-H- move left    (This may be ERASE char)
+	case 0x7f:	// DEL- move left   (This may be ERASE char)
+		do {
+			dot_left();
+		} while (--cmdcnt > 0);
+		break;
+	case 10:			// Newline ^J
+	case 'j':			// j- goto next line, same col
+	case KEYCODE_DOWN:	// cursor key Down
+		do {
+			dot_next();		// go to next B-o-l
+			// try stay in same col
+			dot = move_to_col(dot, ccol + offset);
+		} while (--cmdcnt > 0);
+		break;
+	case 12:			// ctrl-L  force redraw whole screen
+	case 18:			// ctrl-R  force redraw
+		place_cursor(0, 0);
+		clear_to_eos();
+		//mysleep(10); // why???
+		screen_erase();	// erase the internal screen buffer
+		last_status_cksum = 0;	// force status update
+		refresh(TRUE);	// this will redraw the entire display
+		break;
+	case 13:			// Carriage Return ^M
+	case '+':			// +- goto next line
+		do {
+			dot_next();
+			dot_skip_over_ws();
+		} while (--cmdcnt > 0);
+		break;
+	case 21:			// ctrl-U  scroll up   half screen
+		dot_scroll((rows - 2) / 2, -1);
+		break;
+	case 25:			// ctrl-Y  scroll up one line
+		dot_scroll(1, -1);
+		break;
+	case 27:			// esc
+		if (cmd_mode == 0)
+			indicate_error();
+		cmd_mode = 0;	// stop insrting
+		undo_queue_commit();
+		end_cmd_q();
+		last_status_cksum = 0;	// force status update
+		break;
+	case ' ':			// move right
+	case 'l':			// move right
+	case KEYCODE_RIGHT:	// Cursor Key Right
+		do {
+			dot_right();
+		} while (--cmdcnt > 0);
+		break;
+#if ENABLE_FEATURE_VI_YANKMARK
+	case '"':			// "- name a register to use for Delete/Yank
+		c1 = (get_one_char() | 0x20) - 'a'; // | 0x20 is tolower()
+		if ((unsigned)c1 <= 25) { // a-z?
+			YDreg = c1;
+		} else {
+			indicate_error();
+		}
+		break;
+	case '\'':			// '- goto a specific mark
+		c1 = (get_one_char() | 0x20);
+		if ((unsigned)(c1 - 'a') <= 25) { // a-z?
+			c1 = (c1 - 'a');
+			// get the b-o-l
+			q = mark[c1];
+			if (text <= q && q < end) {
+				dot = q;
+				dot_begin();	// go to B-o-l
+				dot_skip_over_ws();
+			}
+		} else if (c1 == '\'') {	// goto previous context
+			dot = swap_context(dot);	// swap current and previous context
+			dot_begin();	// go to B-o-l
+			dot_skip_over_ws();
+		} else {
+			indicate_error();
+		}
+		break;
+	case 'm':			// m- Mark a line
+		// this is really stupid.  If there are any inserts or deletes
+		// between text[0] and dot then this mark will not point to the
+		// correct location! It could be off by many lines!
+		// Well..., at least its quick and dirty.
+		c1 = (get_one_char() | 0x20) - 'a';
+		if ((unsigned)c1 <= 25) { // a-z?
+			// remember the line
+			mark[c1] = dot;
+		} else {
+			indicate_error();
+		}
+		break;
+	case 'P':			// P- Put register before
+	case 'p':			// p- put register after
+		p = reg[YDreg];
+		if (p == NULL) {
+			status_line_bold("Nothing in register %c", what_reg());
+			break;
+		}
+		// are we putting whole lines or strings
+		if (strchr(p, '\n') != NULL) {
+			if (c == 'P') {
+				dot_begin();	// putting lines- Put above
+			}
+			if (c == 'p') {
+				// are we putting after very last line?
+				if (end_line(dot) == (end - 1)) {
+					dot = end;	// force dot to end of text[]
+				} else {
+					dot_next();	// next line, then put before
+				}
+			}
+		} else {
+			if (c == 'p')
+				dot_right();	// move to right, can move to NL
+		}
+		string_insert(dot, p, ALLOW_UNDO);	// insert the string
+		end_cmd_q();	// stop adding to q
+		break;
+	case 'U':			// U- Undo; replace current line with original version
+		if (reg[Ureg] != NULL) {
+			p = begin_line(dot);
+			q = end_line(dot);
+			p = text_hole_delete(p, q, ALLOW_UNDO);	// delete cur line
+			p += string_insert(p, reg[Ureg], ALLOW_UNDO_CHAIN);	// insert orig line
+			dot = p;
+			dot_skip_over_ws();
+		}
+		break;
+#endif /* FEATURE_VI_YANKMARK */
+#if ENABLE_FEATURE_VI_UNDO
+	case 'u':	// u- undo last operation
+		undo_pop();
+		break;
+#endif
+	case '$':			// $- goto end of line
+	case KEYCODE_END:		// Cursor Key End
+		for (;;) {
+			dot = end_line(dot);
+			if (--cmdcnt <= 0)
+				break;
+			dot_next();
+		}
+		break;
+	case '%':			// %- find matching char of pair () [] {}
+		for (q = dot; q < end && *q != '\n'; q++) {
+			if (strchr("()[]{}", *q) != NULL) {
+				// we found half of a pair
+				p = find_pair(q, *q);
+				if (p == NULL) {
+					indicate_error();
+				} else {
+					dot = p;
+				}
+				break;
+			}
+		}
+		if (*q == '\n')
+			indicate_error();
+		break;
+	case 'f':			// f- forward to a user specified char
+		last_forward_char = get_one_char();	// get the search char
+		//
+		// dont separate these two commands. 'f' depends on ';'
+		//
+		//**** fall through to ... ';'
+	case ';':			// ;- look at rest of line for last forward char
+		do {
+			if (last_forward_char == 0)
+				break;
+			q = dot + 1;
+			while (q < end - 1 && *q != '\n' && *q != last_forward_char) {
+				q++;
+			}
+			if (*q == last_forward_char)
+				dot = q;
+		} while (--cmdcnt > 0);
+		break;
+	case ',':           // repeat latest 'f' in opposite direction
+		if (last_forward_char == 0)
+			break;
+		do {
+			q = dot - 1;
+			while (q >= text && *q != '\n' && *q != last_forward_char) {
+				q--;
+			}
+			if (q >= text && *q == last_forward_char)
+				dot = q;
+		} while (--cmdcnt > 0);
+		break;
+
+	case '-':			// -- goto prev line
+		do {
+			dot_prev();
+			dot_skip_over_ws();
+		} while (--cmdcnt > 0);
+		break;
+#if ENABLE_FEATURE_VI_DOT_CMD
+	case '.':			// .- repeat the last modifying command
+		// Stuff the last_modifying_cmd back into stdin
+		// and let it be re-executed.
+		if (lmc_len > 0) {
+			last_modifying_cmd[lmc_len] = 0;
+			ioq = ioq_start = xstrdup(last_modifying_cmd);
+		}
+		break;
+#endif
+#if ENABLE_FEATURE_VI_SEARCH
+	case '?':			// /- search for a pattern
+	case '/':			// /- search for a pattern
+		buf[0] = c;
+		buf[1] = '\0';
+		q = get_input_line(buf);	// get input line- use "status line"
+		if (q[0] && !q[1]) {
+			if (last_search_pattern[0])
+				last_search_pattern[0] = c;
+			goto dc3; // if no pat re-use old pat
+		}
+		if (q[0]) {       // strlen(q) > 1: new pat- save it and find
+			// there is a new pat
+			free(last_search_pattern);
+			last_search_pattern = xstrdup(q);
+			goto dc3;	// now find the pattern
+		}
+		// user changed mind and erased the "/"-  do nothing
+		break;
+	case 'N':			// N- backward search for last pattern
+		dir = BACK;		// assume BACKWARD search
+		p = dot - 1;
+		if (last_search_pattern[0] == '?') {
+			dir = FORWARD;
+			p = dot + 1;
+		}
+		goto dc4;		// now search for pattern
+		break;
+	case 'n':			// n- repeat search for last pattern
+		// search rest of text[] starting at next char
+		// if search fails return orignal "p" not the "p+1" address
+		do {
+			const char *msg;
+ dc3:
+			dir = FORWARD;	// assume FORWARD search
+			p = dot + 1;
+			if (last_search_pattern[0] == '?') {
+				dir = BACK;
+				p = dot - 1;
+			}
+ dc4:
+			q = char_search(p, last_search_pattern + 1, dir, FULL);
+			if (q != NULL) {
+				dot = q;	// good search, update "dot"
+				msg = NULL;
+				goto dc2;
+			}
+			// no pattern found between "dot" and "end"- continue at top
+			p = text;
+			if (dir == BACK) {
+				p = end - 1;
+			}
+			q = char_search(p, last_search_pattern + 1, dir, FULL);
+			if (q != NULL) {	// found something
+				dot = q;	// found new pattern- goto it
+				msg = "search hit BOTTOM, continuing at TOP";
+				if (dir == BACK) {
+					msg = "search hit TOP, continuing at BOTTOM";
+				}
+			} else {
+				msg = "Pattern not found";
+			}
+ dc2:
+			if (msg)
+				status_line_bold("%s", msg);
+		} while (--cmdcnt > 0);
+		break;
+	case '{':			// {- move backward paragraph
+		q = char_search(dot, "\n\n", BACK, FULL);
+		if (q != NULL) {	// found blank line
+			dot = next_line(q);	// move to next blank line
+		}
+		break;
+	case '}':			// }- move forward paragraph
+		q = char_search(dot, "\n\n", FORWARD, FULL);
+		if (q != NULL) {	// found blank line
+			dot = next_line(q);	// move to next blank line
+		}
+		break;
+#endif /* FEATURE_VI_SEARCH */
+	case '0':			// 0- goto beginning of line
+	case '1':			// 1-
+	case '2':			// 2-
+	case '3':			// 3-
+	case '4':			// 4-
+	case '5':			// 5-
+	case '6':			// 6-
+	case '7':			// 7-
+	case '8':			// 8-
+	case '9':			// 9-
+		if (c == '0' && cmdcnt < 1) {
+			dot_begin();	// this was a standalone zero
+		} else {
+			cmdcnt = cmdcnt * 10 + (c - '0');	// this 0 is part of a number
+		}
+		break;
+	case ':':			// :- the colon mode commands
+		p = get_input_line(":");	// get input line- use "status line"
+		colon(p);		// execute the command
+		break;
+	case '<':			// <- Left  shift something
+	case '>':			// >- Right shift something
+		cnt = count_lines(text, dot);	// remember what line we are on
+		c1 = get_one_char();	// get the type of thing to delete
+		find_range(&p, &q, c1);
+		yank_delete(p, q, 1, YANKONLY, NO_UNDO);	// save copy before change
+		p = begin_line(p);
+		q = end_line(q);
+		i = count_lines(p, q);	// # of lines we are shifting
+		for ( ; i > 0; i--, p = next_line(p)) {
+			if (c == '<') {
+				// shift left- remove tab or 8 spaces
+				if (*p == '\t') {
+					// shrink buffer 1 char
+					text_hole_delete(p, p, NO_UNDO);
+				} else if (*p == ' ') {
+					// we should be calculating columns, not just SPACE
+					for (j = 0; *p == ' ' && j < tabstop; j++) {
+						text_hole_delete(p, p, NO_UNDO);
+					}
+				}
+			} else if (c == '>') {
+				// shift right -- add tab or 8 spaces
+				char_insert(p, '\t', ALLOW_UNDO);
+			}
+		}
+		dot = find_line(cnt);	// what line were we on
+		dot_skip_over_ws();
+		end_cmd_q();	// stop adding to q
+		break;
+	case 'A':			// A- append at e-o-l
+		dot_end();		// go to e-o-l
+		//**** fall through to ... 'a'
+	case 'a':			// a- append after current char
+		if (*dot != '\n')
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+			dot++;
+#else
+		{
+			int code_size;
+			unsigned short tmp_code = Utf8_to_Utf16(dot, &code_size);
+			dot += code_size;
+		}
+#endif
+		goto dc_i;
+		break;
+	case 'B':			// B- back a blank-delimited Word
+	case 'E':			// E- end of a blank-delimited word
+	case 'W':			// W- forward a blank-delimited word
+		dir = FORWARD;
+		if (c == 'B')
+			dir = BACK;
+		do {
+			if (c == 'W' || isspace(dot[dir])) {
+				dot = skip_thing(dot, 1, dir, S_TO_WS);
+				dot = skip_thing(dot, 2, dir, S_OVER_WS);
+			}
+			if (c != 'W')
+				dot = skip_thing(dot, 1, dir, S_BEFORE_WS);
+		} while (--cmdcnt > 0);
+		break;
+	case 'C':			// C- Change to e-o-l
+	case 'D':			// D- delete to e-o-l
+		save_dot = dot;
+		dot = dollar_line(dot);	// move to before NL
+		// copy text into a register and delete
+		dot = yank_delete(save_dot, dot, 0, YANKDEL, ALLOW_UNDO);	// delete to e-o-l
+		if (c == 'C')
+			goto dc_i;	// start inserting
+#if ENABLE_FEATURE_VI_DOT_CMD
+		if (c == 'D')
+			end_cmd_q();	// stop adding to q
+#endif
+		break;
+	case 'g': // 'gg' goto a line number (vim) (default: very first line)
+		c1 = get_one_char();
+		if (c1 != 'g') {
+			buf[0] = 'g';
+			// c1 < 0 if the key was special. Try "g<up-arrow>"
+			// TODO: if Unicode?
+			buf[1] = (c1 >= 0 ? c1 : '*');
+			buf[2] = '\0';
+			not_implemented(buf);
+			break;
+		}
+		if (cmdcnt == 0)
+			cmdcnt = 1;
+		/* fall through */
+	case 'G':		// G- goto to a line number (default= E-O-F)
+		dot = end - 1;				// assume E-O-F
+		if (cmdcnt > 0) {
+			dot = find_line(cmdcnt);	// what line is #cmdcnt
+		}
+		dot_skip_over_ws();
+		break;
+	case 'H':			// H- goto top line on screen
+		dot = screenbegin;
+		if (cmdcnt > (rows - 1)) {
+			cmdcnt = (rows - 1);
+		}
+		if (--cmdcnt > 0) {
+			do_cmd('+');
+		}
+		dot_skip_over_ws();
+		break;
+	case 'I':			// I- insert before first non-blank
+		dot_begin();	// 0
+		dot_skip_over_ws();
+		//**** fall through to ... 'i'
+	case 'i':			// i- insert before current char
+	case KEYCODE_INSERT:	// Cursor Key Insert
+ dc_i:
+		cmd_mode = 1;	// start inserting
+		undo_queue_commit();	// commit queue when cmd_mode changes
+		break;
+	case 'J':			// J- join current and next lines together
+		do {
+			dot_end();		// move to NL
+			if (dot < end - 1) {	// make sure not last char in text[]
+#if ENABLE_FEATURE_VI_UNDO
+				undo_push(dot, 1, UNDO_DEL);
+				*dot++ = ' ';	// replace NL with space
+				undo_push((dot - 1), 1, UNDO_INS_CHAIN);
+#else
+				*dot++ = ' ';
+				modified_count++;
+#endif
+				while (isblank(*dot)) {	// delete leading WS
+					text_hole_delete(dot, dot, ALLOW_UNDO_CHAIN);
+				}
+			}
+		} while (--cmdcnt > 0);
+		end_cmd_q();	// stop adding to q
+		break;
+	case 'L':			// L- goto bottom line on screen
+		dot = end_screen();
+		if (cmdcnt > (rows - 1)) {
+			cmdcnt = (rows - 1);
+		}
+		if (--cmdcnt > 0) {
+			do_cmd('-');
+		}
+		dot_begin();
+		dot_skip_over_ws();
+		break;
+	case 'M':			// M- goto middle line on screen
+		dot = screenbegin;
+		for (cnt = 0; cnt < (rows-1) / 2; cnt++)
+			dot = next_line(dot);
+		break;
+	case 'O':			// O- open a empty line above
+		//    0i\n ESC -i
+		p = begin_line(dot);
+		if (p[-1] == '\n') {
+			dot_prev();
+	case 'o':			// o- open a empty line below; Yes, I know it is in the middle of the "if (..."
+			dot_end();
+			dot = char_insert(dot, '\n', ALLOW_UNDO);
+		} else {
+			dot_begin();	// 0
+			dot = char_insert(dot, '\n', ALLOW_UNDO);	// i\n ESC
+			dot_prev();	// -
+		}
+		goto dc_i;
+		break;
+	case 'R':			// R- continuous Replace char
+ dc5:
+		cmd_mode = 2;
+		undo_queue_commit();
+		break;
+	case KEYCODE_DELETE:
+		if (dot < end - 1)
+			dot = yank_delete(dot, dot, 1, YANKDEL, ALLOW_UNDO);
+		break;
+	case 'X':			// X- delete char before dot
+	case 'x':			// x- delete the current char
+	case 's':			// s- substitute the current char
+		dir = 0;
+		if (c == 'X')
+			dir = -1;
+		do {
+			if (dot[dir] != '\n') {
+				if (c == 'X')
+					dot--;	// delete prev char
+				dot = yank_delete(dot, dot, 0, YANKDEL, ALLOW_UNDO);	// delete char
+			}
+		} while (--cmdcnt > 0);
+		end_cmd_q();	// stop adding to q
+		if (c == 's')
+			goto dc_i;	// start inserting
+		break;
+	case 'Z':			// Z- if modified, {write}; exit
+		// ZZ means to save file (if necessary), then exit
+		c1 = get_one_char();
+		if (c1 != 'Z') {
+			indicate_error();
+			break;
+		}
+		if (modified_count) {
+			if (ENABLE_FEATURE_VI_READONLY && readonly_mode) {
+				status_line_bold("'%s' is read only", current_filename);
+				break;
+			}
+			cnt = file_write(current_filename, text, end - 1);
+			if (cnt < 0) {
+				if (cnt == -1)
+					status_line_bold("Write error: %s", strerror(errno));
+			} else if (cnt == (end - 1 - text + 1)) {
+				editing = 0;
+			}
+		} else {
+			editing = 0;
+		}
+		break;
+	case '^':			// ^- move to first non-blank on line
+		dot_begin();
+		dot_skip_over_ws();
+		break;
+	case 'b':			// b- back a word
+	case 'e':			// e- end of word
+		dir = FORWARD;
+		if (c == 'b')
+			dir = BACK;
+		do {
+			if ((dot + dir) < text || (dot + dir) > end - 1)
+				break;
+			dot += dir;
+			if (isspace(*dot)) {
+				dot = skip_thing(dot, (c == 'e') ? 2 : 1, dir, S_OVER_WS);
+			}
+			if (isalnum(*dot) || *dot == '_') {
+				dot = skip_thing(dot, 1, dir, S_END_ALNUM);
+			} else if (ispunct(*dot)) {
+				dot = skip_thing(dot, 1, dir, S_END_PUNCT);
+			}
+		} while (--cmdcnt > 0);
+		break;
+	case 'c':			// c- change something
+	case 'd':			// d- delete something
+#if ENABLE_FEATURE_VI_YANKMARK
+	case 'y':			// y- yank   something
+	case 'Y':			// Y- Yank a line
+#endif
+	{
+		int yf, ml, whole = 0;
+		yf = YANKDEL;	// assume either "c" or "d"
+#if ENABLE_FEATURE_VI_YANKMARK
+		if (c == 'y' || c == 'Y')
+			yf = YANKONLY;
+#endif
+		c1 = 'y';
+		if (c != 'Y')
+			c1 = get_one_char();	// get the type of thing to delete
+		// determine range, and whether it spans lines
+		ml = find_range(&p, &q, c1);
+		place_cursor(0, 0);
+		if (c1 == 27) {	// ESC- user changed mind and wants out
+			c = c1 = 27;	// Escape- do nothing
+		} else if (strchr("wW", c1)) {
+			if (c == 'c') {
+				// don't include trailing WS as part of word
+				while (isblank(*q)) {
+					if (q <= text || q[-1] == '\n')
+						break;
+					q--;
+				}
+			}
+			dot = yank_delete(p, q, ml, yf, ALLOW_UNDO);	// delete word
+		} else if (strchr("^0bBeEft%$ lh\b\177", c1)) {
+			// partial line copy text into a register and delete
+			dot = yank_delete(p, q, ml, yf, ALLOW_UNDO);	// delete word
+		} else if (strchr("cdykjHL+-{}\r\n", c1)) {
+			// whole line copy text into a register and delete
+			dot = yank_delete(p, q, ml, yf, ALLOW_UNDO);	// delete lines
+			whole = 1;
+		} else {
+			// could not recognize object
+			c = c1 = 27;	// error-
+			ml = 0;
+			indicate_error();
+		}
+		if (ml && whole) {
+			if (c == 'c') {
+				dot = char_insert(dot, '\n', ALLOW_UNDO_CHAIN);
+				// on the last line of file don't move to prev line
+				if (whole && dot != (end-1)) {
+					dot_prev();
+				}
+			} else if (c == 'd') {
+				dot_begin();
+				dot_skip_over_ws();
+			}
+		}
+		if (c1 != 27) {
+			// if CHANGING, not deleting, start inserting after the delete
+			if (c == 'c') {
+				strcpy(buf, "Change");
+				goto dc_i;	// start inserting
+			}
+			if (c == 'd') {
+				strcpy(buf, "Delete");
+			}
+#if ENABLE_FEATURE_VI_YANKMARK
+			if (c == 'y' || c == 'Y') {
+				strcpy(buf, "Yank");
+			}
+			p = reg[YDreg];
+			q = p + strlen(p);
+			for (cnt = 0; p <= q; p++) {
+				if (*p == '\n')
+					cnt++;
+			}
+			status_line("%s %d lines (%d chars) using [%c]",
+				buf, cnt, strlen(reg[YDreg]), what_reg());
+#endif
+			end_cmd_q();	// stop adding to q
+		}
+		break;
+	}
+	case 'k':			// k- goto prev line, same col
+	case KEYCODE_UP:		// cursor key Up
+		do {
+			dot_prev();
+			dot = move_to_col(dot, ccol + offset);	// try stay in same col
+		} while (--cmdcnt > 0);
+		break;
+	case 'r':			// r- replace the current char with user input
+		c1 = get_one_char();	// get the replacement char
+		if (*dot != '\n') {
+#if ENABLE_FEATURE_VI_UNDO
+			undo_push(dot, 1, UNDO_DEL);
+			*dot = c1;
+			undo_push(dot, 1, UNDO_INS_CHAIN);
+#else
+			*dot = c1;
+			modified_count++;
+#endif
+		}
+		end_cmd_q();	// stop adding to q
+		break;
+	case 't':			// t- move to char prior to next x
+		last_forward_char = get_one_char();
+		do_cmd(';');
+		if (*dot == last_forward_char)
+			dot_left();
+		last_forward_char = 0;
+		break;
+	case 'w':			// w- forward a word
+		do {
+			if (isalnum(*dot) || *dot == '_') {	// we are on ALNUM
+				dot = skip_thing(dot, 1, FORWARD, S_END_ALNUM);
+			} else if (ispunct(*dot)) {	// we are on PUNCT
+				dot = skip_thing(dot, 1, FORWARD, S_END_PUNCT);
+			}
+			if (dot < end - 1)
+				dot++;		// move over word
+			if (isspace(*dot)) {
+				dot = skip_thing(dot, 2, FORWARD, S_OVER_WS);
+			}
+		} while (--cmdcnt > 0);
+		break;
+	case 'z':			// z-
+		c1 = get_one_char();	// get the replacement char
+		cnt = 0;
+		if (c1 == '.')
+			cnt = (rows - 2) / 2;	// put dot at center
+		if (c1 == '-')
+			cnt = rows - 2;	// put dot at bottom
+		screenbegin = begin_line(dot);	// start dot at top
+		dot_scroll(cnt, -1);
+		break;
+	case '|':			// |- move to column "cmdcnt"
+		dot = move_to_col(dot, cmdcnt - 1);	// try to move to column
+		break;
+	case '~':			// ~- flip the case of letters   a-z -> A-Z
+		do {
+#if ENABLE_FEATURE_VI_UNDO
+			if (islower(*dot)) {
+				undo_push(dot, 1, UNDO_DEL);
+				*dot = toupper(*dot);
+				undo_push(dot, 1, UNDO_INS_CHAIN);
+			} else if (isupper(*dot)) {
+				undo_push(dot, 1, UNDO_DEL);
+				*dot = tolower(*dot);
+				undo_push(dot, 1, UNDO_INS_CHAIN);
+			}
+#else
+			if (islower(*dot)) {
+				*dot = toupper(*dot);
+				modified_count++;
+			} else if (isupper(*dot)) {
+				*dot = tolower(*dot);
+				modified_count++;
+			}
+#endif
+			dot_right();
+		} while (--cmdcnt > 0);
+		end_cmd_q();	// stop adding to q
+		break;
+		//----- The Cursor and Function Keys -----------------------------
+	case KEYCODE_HOME:	// Cursor Key Home
+		dot_begin();
+		break;
+		// The Fn keys could point to do_macro which could translate them
+#if 0
+	case KEYCODE_FUN1:	// Function Key F1
+	case KEYCODE_FUN2:	// Function Key F2
+	case KEYCODE_FUN3:	// Function Key F3
+	case KEYCODE_FUN4:	// Function Key F4
+	case KEYCODE_FUN5:	// Function Key F5
+	case KEYCODE_FUN6:	// Function Key F6
+	case KEYCODE_FUN7:	// Function Key F7
+	case KEYCODE_FUN8:	// Function Key F8
+	case KEYCODE_FUN9:	// Function Key F9
+	case KEYCODE_FUN10:	// Function Key F10
+	case KEYCODE_FUN11:	// Function Key F11
+	case KEYCODE_FUN12:	// Function Key F12
+		break;
+#endif
+	}
+
+ dc1:
+	// if text[] just became empty, add back an empty line
+	if (end == text) {
+		char_insert(text, '\n', NO_UNDO);	// start empty buf with dummy line
+		dot = text;
+	}
+	// it is OK for dot to exactly equal to end, otherwise check dot validity
+	if (dot != end) {
+		dot = bound_dot(dot);	// make sure "dot" is valid
+	}
+#if ENABLE_FEATURE_VI_YANKMARK
+	check_context(c);	// update the current context
+#endif
+
+	if (!isdigit(c))
+		cmdcnt = 0;		// cmd was not a number, reset cmdcnt
+	cnt = dot - begin_line(dot);
+	// Try to stay off of the Newline
+	if (*dot == '\n' && cnt > 0 && cmd_mode == 0)
+#ifndef ENABLE_BASIC_MULTI_CHAR_CODE
+		dot--;
+#else
+		dot -= bs_char_count(text, dot - text - 1);
+#endif
+}
+
+/* NB!  the CRASHME code is unmaintained, and doesn't currently build */
+#if ENABLE_FEATURE_VI_CRASHME
+static int totalcmds = 0;
+static int Mp = 85;             // Movement command Probability
+static int Np = 90;             // Non-movement command Probability
+static int Dp = 96;             // Delete command Probability
+static int Ip = 97;             // Insert command Probability
+static int Yp = 98;             // Yank command Probability
+static int Pp = 99;             // Put command Probability
+static int M = 0, N = 0, I = 0, D = 0, Y = 0, P = 0, U = 0;
+static const char chars[20] = "\t012345 abcdABCD-=.$";
+static const char *const words[20] = {
+	"this", "is", "a", "test",
+	"broadcast", "the", "emergency", "of",
+	"system", "quick", "brown", "fox",
+	"jumped", "over", "lazy", "dogs",
+	"back", "January", "Febuary", "March"
+};
+static const char *const lines[20] = {
+	"You should have received a copy of the GNU General Public License\n",
+	"char c, cm, *cmd, *cmd1;\n",
+	"generate a command by percentages\n",
+	"Numbers may be typed as a prefix to some commands.\n",
+	"Quit, discarding changes!\n",
+	"Forced write, if permission originally not valid.\n",
+	"In general, any ex or ed command (such as substitute or delete).\n",
+	"I have tickets available for the Blazers vs LA Clippers for Monday, Janurary 1 at 1:00pm.\n",
+	"Please get w/ me and I will go over it with you.\n",
+	"The following is a list of scheduled, committed changes.\n",
+	"1.   Launch Norton Antivirus (Start, Programs, Norton Antivirus)\n",
+	"Reminder....Town Meeting in Central Perk cafe today at 3:00pm.\n",
+	"Any question about transactions please contact Sterling Huxley.\n",
+	"I will try to get back to you by Friday, December 31.\n",
+	"This Change will be implemented on Friday.\n",
+	"Let me know if you have problems accessing this;\n",
+	"Sterling Huxley recently added you to the access list.\n",
+	"Would you like to go to lunch?\n",
+	"The last command will be automatically run.\n",
+	"This is too much english for a computer geek.\n",
+};
+static char *multilines[20] = {
+	"You should have received a copy of the GNU General Public License\n",
+	"char c, cm, *cmd, *cmd1;\n",
+	"generate a command by percentages\n",
+	"Numbers may be typed as a prefix to some commands.\n",
+	"Quit, discarding changes!\n",
+	"Forced write, if permission originally not valid.\n",
+	"In general, any ex or ed command (such as substitute or delete).\n",
+	"I have tickets available for the Blazers vs LA Clippers for Monday, Janurary 1 at 1:00pm.\n",
+	"Please get w/ me and I will go over it with you.\n",
+	"The following is a list of scheduled, committed changes.\n",
+	"1.   Launch Norton Antivirus (Start, Programs, Norton Antivirus)\n",
+	"Reminder....Town Meeting in Central Perk cafe today at 3:00pm.\n",
+	"Any question about transactions please contact Sterling Huxley.\n",
+	"I will try to get back to you by Friday, December 31.\n",
+	"This Change will be implemented on Friday.\n",
+	"Let me know if you have problems accessing this;\n",
+	"Sterling Huxley recently added you to the access list.\n",
+	"Would you like to go to lunch?\n",
+	"The last command will be automatically run.\n",
+	"This is too much english for a computer geek.\n",
+};
+
+// create a random command to execute
+static void crash_dummy()
+{
+	static int sleeptime;   // how long to pause between commands
+	char c, cm, *cmd, *cmd1;
+	int i, cnt, thing, rbi, startrbi, percent;
+
+	// "dot" movement commands
+	cmd1 = " \n\r\002\004\005\006\025\0310^$-+wWeEbBhjklHL";
+
+	// is there already a command running?
+	if (readbuffer[0] > 0)
+		goto cd1;
+ cd0:
+	readbuffer[0] = 'X';
+	startrbi = rbi = 1;
+	sleeptime = 0;          // how long to pause between commands
+	memset(readbuffer, '\0', sizeof(readbuffer));
+	// generate a command by percentages
+	percent = (int) lrand48() % 100;        // get a number from 0-99
+	if (percent < Mp) {     //  Movement commands
+		// available commands
+		cmd = cmd1;
+		M++;
+	} else if (percent < Np) {      //  non-movement commands
+		cmd = "mz<>\'\"";       // available commands
+		N++;
+	} else if (percent < Dp) {      //  Delete commands
+		cmd = "dx";             // available commands
+		D++;
+	} else if (percent < Ip) {      //  Inset commands
+		cmd = "iIaAsrJ";        // available commands
+		I++;
+	} else if (percent < Yp) {      //  Yank commands
+		cmd = "yY";             // available commands
+		Y++;
+	} else if (percent < Pp) {      //  Put commands
+		cmd = "pP";             // available commands
+		P++;
+	} else {
+		// We do not know how to handle this command, try again
+		U++;
+		goto cd0;
+	}
+	// randomly pick one of the available cmds from "cmd[]"
+	i = (int) lrand48() % strlen(cmd);
+	cm = cmd[i];
+	if (strchr(":\024", cm))
+		goto cd0;               // dont allow colon or ctrl-T commands
+	readbuffer[rbi++] = cm; // put cmd into input buffer
+
+	// now we have the command-
+	// there are 1, 2, and multi char commands
+	// find out which and generate the rest of command as necessary
+	if (strchr("dmryz<>\'\"", cm)) {        // 2-char commands
+		cmd1 = " \n\r0$^-+wWeEbBhjklHL";
+		if (cm == 'm' || cm == '\'' || cm == '\"') {    // pick a reg[]
+			cmd1 = "abcdefghijklmnopqrstuvwxyz";
+		}
+		thing = (int) lrand48() % strlen(cmd1); // pick a movement command
+		c = cmd1[thing];
+		readbuffer[rbi++] = c;  // add movement to input buffer
+	}
+	if (strchr("iIaAsc", cm)) {     // multi-char commands
+		if (cm == 'c') {
+			// change some thing
+			thing = (int) lrand48() % strlen(cmd1); // pick a movement command
+			c = cmd1[thing];
+			readbuffer[rbi++] = c;  // add movement to input buffer
+		}
+		thing = (int) lrand48() % 4;    // what thing to insert
+		cnt = (int) lrand48() % 10;     // how many to insert
+		for (i = 0; i < cnt; i++) {
+			if (thing == 0) {       // insert chars
+				readbuffer[rbi++] = chars[((int) lrand48() % strlen(chars))];
+			} else if (thing == 1) {        // insert words
+				strcat(readbuffer, words[(int) lrand48() % 20]);
+				strcat(readbuffer, " ");
+				sleeptime = 0;  // how fast to type
+			} else if (thing == 2) {        // insert lines
+				strcat(readbuffer, lines[(int) lrand48() % 20]);
+				sleeptime = 0;  // how fast to type
+			} else {        // insert multi-lines
+				strcat(readbuffer, multilines[(int) lrand48() % 20]);
+				sleeptime = 0;  // how fast to type
+			}
+		}
+		strcat(readbuffer, "\033");
+	}
+	readbuffer[0] = strlen(readbuffer + 1);
+ cd1:
+	totalcmds++;
+	if (sleeptime > 0)
+		mysleep(sleeptime);      // sleep 1/100 sec
+}
+
+// test to see if there are any errors
+static void crash_test()
+{
+	static time_t oldtim;
+
+	time_t tim;
+	char d[2], msg[80];
+
+	msg[0] = '\0';
+	if (end < text) {
+		strcat(msg, "end<text ");
+	}
+	if (end > textend) {
+		strcat(msg, "end>textend ");
+	}
+	if (dot < text) {
+		strcat(msg, "dot<text ");
+	}
+	if (dot > end) {
+		strcat(msg, "dot>end ");
+	}
+	if (screenbegin < text) {
+		strcat(msg, "screenbegin<text ");
+	}
+	if (screenbegin > end - 1) {
+		strcat(msg, "screenbegin>end-1 ");
+	}
+
+	if (msg[0]) {
+		printf("\n\n%d: \'%c\' %s\n\n\n%s[Hit return to continue]%s",
+			totalcmds, last_input_char, msg, ESC_BOLD_TEXT, ESC_NORM_TEXT);
+		fflush_all();
+		while (safe_read(STDIN_FILENO, d, 1) > 0) {
+			if (d[0] == '\n' || d[0] == '\r')
+				break;
+		}
+	}
+	tim = time(NULL);
+	if (tim >= (oldtim + 3)) {
+		sprintf(status_buffer,
+				"Tot=%d: M=%d N=%d I=%d D=%d Y=%d P=%d U=%d size=%d",
+				totalcmds, M, N, I, D, Y, P, U, end - text + 1);
+		oldtim = tim;
+	}
+}
+#endif
Index: /EcnlProtoTool/trunk/busybox/src/xfunc_die.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/xfunc_die.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/xfunc_die.c	(revision 447)
@@ -0,0 +1,22 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 2008 by Denys Vlasenko <vda.linux@googlemail.com>
+ *
+ * Licensed under GPLv2, see file LICENSE in this source tree.
+ */
+
+/* Keeping it separate allows to NOT pull in stdio for VERY small applets.
+ * Try building busybox with only "true" enabled... */
+
+#include "libbb.h"
+
+void (*die_func)(void);
+
+void FAST_FUNC xfunc_die(void)
+{
+	if (die_func)
+		die_func();
+	exit(xfunc_error_retval);
+}
Index: /EcnlProtoTool/trunk/busybox/src/xfuncs.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/xfuncs.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/xfuncs.c	(revision 447)
@@ -0,0 +1,358 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2006 Rob Landley
+ * Copyright (C) 2006 Denys Vlasenko
+ *
+ * Licensed under GPLv2, see file LICENSE in this source tree.
+ */
+
+/* We need to have separate xfuncs.c and xfuncs_printf.c because
+ * with current linkers, even with section garbage collection,
+ * if *.o module references any of XXXprintf functions, you pull in
+ * entire printf machinery. Even if you do not use the function
+ * which uses XXXprintf.
+ *
+ * xfuncs.c contains functions (not necessarily xfuncs)
+ * which do not pull in printf, directly or indirectly.
+ * xfunc_printf.c contains those which do.
+ *
+ * TODO: move xmalloc() and xatonum() here.
+ */
+
+#include "libbb.h"
+
+/* Turn on nonblocking I/O on a fd */
+int FAST_FUNC ndelay_on(int fd)
+{
+	int flags = fcntl(fd, F_GETFL);
+	if (flags & O_NONBLOCK)
+		return flags;
+	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+	return flags;
+}
+
+int FAST_FUNC ndelay_off(int fd)
+{
+	int flags = fcntl(fd, F_GETFL);
+	if (!(flags & O_NONBLOCK))
+		return flags;
+	fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
+	return flags;
+}
+
+void FAST_FUNC close_on_exec_on(int fd)
+{
+	fcntl(fd, F_SETFD, FD_CLOEXEC);
+}
+
+char* FAST_FUNC strncpy_IFNAMSIZ(char *dst, const char *src)
+{
+#ifndef IFNAMSIZ
+	enum { IFNAMSIZ = 16 };
+#endif
+	return strncpy(dst, src, IFNAMSIZ);
+}
+
+
+/* Convert unsigned integer to ascii, writing into supplied buffer.
+ * A truncated result contains the first few digits of the result ala strncpy.
+ * Returns a pointer past last generated digit, does _not_ store NUL.
+ */
+void BUG_sizeof(void);
+char* FAST_FUNC utoa_to_buf(unsigned n, char *buf, unsigned buflen)
+{
+	unsigned i, out, res;
+
+	if (buflen) {
+		out = 0;
+		if (sizeof(n) == 4)
+		// 2^32-1 = 4294967295
+			i = 1000000000;
+#if UINT_MAX > 4294967295 /* prevents warning about "const too large" */
+		else
+		if (sizeof(n) == 8)
+		// 2^64-1 = 18446744073709551615
+			i = 10000000000000000000;
+#endif
+		else
+			BUG_sizeof();
+		for (; i; i /= 10) {
+			res = n / i;
+			n = n % i;
+			if (res || out || i == 1) {
+				if (--buflen == 0)
+					break;
+				out++;
+				*buf++ = '0' + res;
+			}
+		}
+	}
+	return buf;
+}
+
+/* Convert signed integer to ascii, like utoa_to_buf() */
+char* FAST_FUNC itoa_to_buf(int n, char *buf, unsigned buflen)
+{
+	if (!buflen)
+		return buf;
+	if (n < 0) {
+		n = -n;
+		*buf++ = '-';
+		buflen--;
+	}
+	return utoa_to_buf((unsigned)n, buf, buflen);
+}
+
+// The following two functions use a static buffer, so calling either one a
+// second time will overwrite previous results.
+//
+// The largest 32 bit integer is -2 billion plus NUL, or 1+10+1=12 bytes.
+// It so happens that sizeof(int) * 3 is enough for 32+ bit ints.
+// (sizeof(int) * 3 + 2 is correct for any width, even 8-bit)
+
+static char local_buf[sizeof(int) * 3];
+
+/* Convert unsigned integer to ascii using a static buffer (returned). */
+char* FAST_FUNC bb_utoa(unsigned n)
+{
+	*(utoa_to_buf(n, local_buf, sizeof(local_buf) - 1)) = '\0';
+
+	return local_buf;
+}
+
+/* Convert signed integer to ascii using a static buffer (returned). */
+char* FAST_FUNC bb_itoa(int n)
+{
+	*(itoa_to_buf(n, local_buf, sizeof(local_buf) - 1)) = '\0';
+
+	return local_buf;
+}
+
+/* Emit a string of hex representation of bytes */
+char* FAST_FUNC bin2hex(char *p, const char *cp, int count)
+{
+	while (count) {
+		unsigned char c = *cp++;
+		/* put lowercase hex digits */
+		*p++ = 0x20 | bb_hexdigits_upcase[c >> 4];
+		*p++ = 0x20 | bb_hexdigits_upcase[c & 0xf];
+		count--;
+	}
+	return p;
+}
+
+/* Convert "[x]x[:][x]x[:][x]x[:][x]x" hex string to binary, no more than COUNT bytes */
+char* FAST_FUNC hex2bin(char *dst, const char *str, int count)
+{
+	errno = EINVAL;
+	while (*str && count) {
+		uint8_t val;
+		uint8_t c = *str++;
+		if (isdigit(c))
+			val = c - '0';
+		else if ((c|0x20) >= 'a' && (c|0x20) <= 'f')
+			val = (c|0x20) - ('a' - 10);
+		else
+			return NULL;
+		val <<= 4;
+		c = *str;
+		if (isdigit(c))
+			val |= c - '0';
+		else if ((c|0x20) >= 'a' && (c|0x20) <= 'f')
+			val |= (c|0x20) - ('a' - 10);
+		else if (c == ':' || c == '\0')
+			val >>= 4;
+		else
+			return NULL;
+
+		*dst++ = val;
+		if (c != '\0')
+			str++;
+		if (*str == ':')
+			str++;
+		count--;
+	}
+	errno = (*str ? ERANGE : 0);
+	return dst;
+}
+
+/* Return how long the file at fd is, if there's any way to determine it. */
+#ifdef UNUSED
+off_t FAST_FUNC fdlength(int fd)
+{
+	off_t bottom = 0, top = 0, pos;
+	long size;
+
+	// If the ioctl works for this, return it.
+
+	if (ioctl(fd, BLKGETSIZE, &size) >= 0) return size*512;
+
+	// FIXME: explain why lseek(SEEK_END) is not used here!
+
+	// If not, do a binary search for the last location we can read.  (Some
+	// block devices don't do BLKGETSIZE right.)
+
+	do {
+		char temp;
+
+		pos = bottom + (top - bottom) / 2;
+
+		// If we can read from the current location, it's bigger.
+
+		if (lseek(fd, pos, SEEK_SET)>=0 && safe_read(fd, &temp, 1)==1) {
+			if (bottom == top) bottom = top = (top+1) * 2;
+			else bottom = pos;
+
+		// If we can't, it's smaller.
+		} else {
+			if (bottom == top) {
+				if (!top) return 0;
+				bottom = top/2;
+			}
+			else top = pos;
+		}
+	} while (bottom + 1 != top);
+
+	return pos + 1;
+}
+#endif
+
+int FAST_FUNC bb_putchar_stderr(char ch)
+{
+	return write(STDERR_FILENO, &ch, 1);
+}
+
+ssize_t FAST_FUNC full_write1_str(const char *str)
+{
+	return full_write(STDOUT_FILENO, str, strlen(str));
+}
+
+ssize_t FAST_FUNC full_write2_str(const char *str)
+{
+	return full_write(STDERR_FILENO, str, strlen(str));
+}
+
+static int wh_helper(int value, int def_val, const char *env_name, int *err)
+{
+	/* Envvars override even if "value" from ioctl is valid (>0).
+	 * Rationale: it's impossible to guess what user wants.
+	 * For example: "man CMD | ...": should "man" format output
+	 * to stdout's width? stdin's width? /dev/tty's width? 80 chars?
+	 * We _cant_ know it. If "..." saves text for e.g. email,
+	 * then it's probably 80 chars.
+	 * If "..." is, say, "grep -v DISCARD | $PAGER", then user
+	 * would prefer his tty's width to be used!
+	 *
+	 * Since we don't know, at least allow user to do this:
+	 * "COLUMNS=80 man CMD | ..."
+	 */
+	char *s = getenv(env_name);
+	if (s) {
+		value = atoi(s);
+		/* If LINES/COLUMNS are set, pretend that there is
+		 * no error getting w/h, this prevents some ugly
+		 * cursor tricks by our callers */
+		*err = 0;
+	}
+
+	if (value <= 1 || value >= 30000)
+		value = def_val;
+	return value;
+}
+
+/* It is perfectly ok to pass in a NULL for either width or for
+ * height, in which case that value will not be set.  */
+int FAST_FUNC get_terminal_width_height(int fd, unsigned *width, unsigned *height)
+{
+	struct winsize win;
+	int err;
+	int close_me = -1;
+
+	if (fd == -1) {
+		if (isatty(STDOUT_FILENO))
+			fd = STDOUT_FILENO;
+		else
+		if (isatty(STDERR_FILENO))
+			fd = STDERR_FILENO;
+		else
+		if (isatty(STDIN_FILENO))
+			fd = STDIN_FILENO;
+		else
+			close_me = fd = open("/dev/tty", O_RDONLY);
+	}
+
+	win.ws_row = 0;
+	win.ws_col = 0;
+	/* I've seen ioctl returning 0, but row/col is (still?) 0.
+	 * We treat that as an error too.  */
+	err = ioctl(fd, TIOCGWINSZ, &win) != 0 || win.ws_row == 0;
+	if (height)
+		*height = wh_helper(win.ws_row, 24, "LINES", &err);
+	if (width)
+		*width = wh_helper(win.ws_col, 80, "COLUMNS", &err);
+
+	if (close_me >= 0)
+		close(close_me);
+
+	return err;
+}
+int FAST_FUNC get_terminal_width(int fd)
+{
+	unsigned width;
+	get_terminal_width_height(fd, &width, NULL);
+	return width;
+}
+
+int FAST_FUNC tcsetattr_stdin_TCSANOW(const struct termios *tp)
+{
+	return tcsetattr(STDIN_FILENO, TCSANOW, tp);
+}
+
+pid_t FAST_FUNC safe_waitpid(pid_t pid, int *wstat, int options)
+{
+	pid_t r;
+
+	do
+		r = waitpid(pid, wstat, options);
+	while ((r == -1) && (errno == EINTR));
+	return r;
+}
+
+pid_t FAST_FUNC wait_any_nohang(int *wstat)
+{
+	return safe_waitpid(-1, wstat, WNOHANG);
+}
+
+// Wait for the specified child PID to exit, returning child's error return.
+int FAST_FUNC wait4pid(pid_t pid)
+{
+	int status;
+
+	if (pid <= 0) {
+		/*errno = ECHILD; -- wrong. */
+		/* we expect errno to be already set from failed [v]fork/exec */
+		return -1;
+	}
+	if (safe_waitpid(pid, &status, 0) == -1)
+		return -1;
+	if (WIFEXITED(status))
+		return WEXITSTATUS(status);
+	if (WIFSIGNALED(status))
+		return WTERMSIG(status) + 0x180;
+	return 0;
+}
+
+// Useful when we do know that pid is valid, and we just want to wait
+// for it to exit. Not existing pid is fatal. waitpid() status is not returned.
+int FAST_FUNC wait_for_exitstatus(pid_t pid)
+{
+	int exit_status, n;
+
+	n = safe_waitpid(pid, &exit_status, 0);
+	if (n < 0)
+		bb_perror_msg_and_die("waitpid");
+	return exit_status;
+}
Index: /EcnlProtoTool/trunk/busybox/src/xfuncs_printf.c
===================================================================
--- /EcnlProtoTool/trunk/busybox/src/xfuncs_printf.c	(revision 447)
+++ /EcnlProtoTool/trunk/busybox/src/xfuncs_printf.c	(revision 447)
@@ -0,0 +1,685 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Utility routines.
+ *
+ * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
+ * Copyright (C) 2006 Rob Landley
+ * Copyright (C) 2006 Denys Vlasenko
+ *
+ * Licensed under GPLv2, see file LICENSE in this source tree.
+ */
+
+/* We need to have separate xfuncs.c and xfuncs_printf.c because
+ * with current linkers, even with section garbage collection,
+ * if *.o module references any of XXXprintf functions, you pull in
+ * entire printf machinery. Even if you do not use the function
+ * which uses XXXprintf.
+ *
+ * xfuncs.c contains functions (not necessarily xfuncs)
+ * which do not pull in printf, directly or indirectly.
+ * xfunc_printf.c contains those which do.
+ */
+
+#include "libbb.h"
+
+
+/* All the functions starting with "x" call bb_error_msg_and_die() if they
+ * fail, so callers never need to check for errors.  If it returned, it
+ * succeeded. */
+
+#ifndef DMALLOC
+/* dmalloc provides variants of these that do abort() on failure.
+ * Since dmalloc's prototypes overwrite the impls here as they are
+ * included after these prototypes in libbb.h, all is well.
+ */
+// Warn if we can't allocate size bytes of memory.
+void* FAST_FUNC malloc_or_warn(size_t size)
+{
+	void *ptr = malloc(size);
+	if (ptr == NULL && size != 0)
+		bb_error_msg(bb_msg_memory_exhausted);
+	return ptr;
+}
+
+// Die if we can't allocate size bytes of memory.
+void* FAST_FUNC xmalloc(size_t size)
+{
+	void *ptr = malloc(size);
+	if (ptr == NULL && size != 0)
+		bb_error_msg_and_die(bb_msg_memory_exhausted);
+	return ptr;
+}
+
+// Die if we can't resize previously allocated memory.  (This returns a pointer
+// to the new memory, which may or may not be the same as the old memory.
+// It'll copy the contents to a new chunk and free the old one if necessary.)
+void* FAST_FUNC xrealloc(void *ptr, size_t size)
+{
+	ptr = realloc(ptr, size);
+	if (ptr == NULL && size != 0)
+		bb_error_msg_and_die(bb_msg_memory_exhausted);
+	return ptr;
+}
+#endif /* DMALLOC */
+
+// Die if we can't allocate and zero size bytes of memory.
+void* FAST_FUNC xzalloc(size_t size)
+{
+	void *ptr = xmalloc(size);
+	memset(ptr, 0, size);
+	return ptr;
+}
+
+// Die if we can't copy a string to freshly allocated memory.
+char* FAST_FUNC xstrdup(const char *s)
+{
+	char *t;
+
+	if (s == NULL)
+		return NULL;
+
+	t = strdup(s);
+
+	if (t == NULL)
+		bb_error_msg_and_die(bb_msg_memory_exhausted);
+
+	return t;
+}
+
+// Die if we can't allocate n+1 bytes (space for the null terminator) and copy
+// the (possibly truncated to length n) string into it.
+char* FAST_FUNC xstrndup(const char *s, int n)
+{
+	int m;
+	char *t;
+
+	if (ENABLE_DEBUG && s == NULL)
+		bb_error_msg_and_die("xstrndup bug");
+
+	/* We can just xmalloc(n+1) and strncpy into it, */
+	/* but think about xstrndup("abc", 10000) wastage! */
+	m = n;
+	t = (char*) s;
+	while (m) {
+		if (!*t) break;
+		m--;
+		t++;
+	}
+	n -= m;
+	t = xmalloc(n + 1);
+	t[n] = '\0';
+
+	return memcpy(t, s, n);
+}
+
+void* FAST_FUNC xmemdup(const void *s, int n)
+{
+	return memcpy(xmalloc(n), s, n);
+}
+
+// Die if we can't open a file and return a FILE* to it.
+// Notice we haven't got xfread(), This is for use with fscanf() and friends.
+FILE* FAST_FUNC xfopen(const char *path, const char *mode)
+{
+	FILE *fp = fopen(path, mode);
+	if (fp == NULL)
+		bb_perror_msg_and_die("can't open '%s'", path);
+	return fp;
+}
+
+// Die if we can't open a file and return a fd.
+int FAST_FUNC xopen3(const char *pathname, int flags, int mode)
+{
+	int ret;
+
+	ret = open(pathname, flags, mode);
+	if (ret < 0) {
+		bb_perror_msg_and_die("can't open '%s'", pathname);
+	}
+	return ret;
+}
+
+// Die if we can't open a file and return a fd.
+int FAST_FUNC xopen(const char *pathname, int flags)
+{
+	return xopen3(pathname, flags, 0666);
+}
+
+// Warn if we can't open a file and return a fd.
+int FAST_FUNC open3_or_warn(const char *pathname, int flags, int mode)
+{
+	int ret;
+
+	ret = open(pathname, flags, mode);
+	if (ret < 0) {
+		bb_perror_msg("can't open '%s'", pathname);
+	}
+	return ret;
+}
+
+// Warn if we can't open a file and return a fd.
+int FAST_FUNC open_or_warn(const char *pathname, int flags)
+{
+	return open3_or_warn(pathname, flags, 0666);
+}
+
+/* Die if we can't open an existing file readonly with O_NONBLOCK
+ * and return the fd.
+ * Note that for ioctl O_RDONLY is sufficient.
+ */
+int FAST_FUNC xopen_nonblocking(const char *pathname)
+{
+	return xopen(pathname, O_RDONLY | O_NONBLOCK);
+}
+
+int FAST_FUNC xopen_as_uid_gid(const char *pathname, int flags, uid_t u, gid_t g)
+{
+	int fd;
+	uid_t old_euid = geteuid();
+	gid_t old_egid = getegid();
+
+	xsetegid(g);
+	xseteuid(u);
+
+	fd = xopen(pathname, flags);
+
+	xseteuid(old_euid);
+	xsetegid(old_egid);
+
+	return fd;
+}
+
+void FAST_FUNC xunlink(const char *pathname)
+{
+	if (unlink(pathname))
+		bb_perror_msg_and_die("can't remove file '%s'", pathname);
+}
+
+void FAST_FUNC xrename(const char *oldpath, const char *newpath)
+{
+	if (rename(oldpath, newpath))
+		bb_perror_msg_and_die("can't move '%s' to '%s'", oldpath, newpath);
+}
+
+int FAST_FUNC rename_or_warn(const char *oldpath, const char *newpath)
+{
+	int n = rename(oldpath, newpath);
+	if (n)
+		bb_perror_msg("can't move '%s' to '%s'", oldpath, newpath);
+	return n;
+}
+
+void FAST_FUNC xpipe(int filedes[2])
+{
+	if (pipe(filedes))
+		bb_perror_msg_and_die("can't create pipe");
+}
+
+void FAST_FUNC xdup2(int from, int to)
+{
+	if (dup2(from, to) != to)
+		bb_perror_msg_and_die("can't duplicate file descriptor");
+}
+
+// "Renumber" opened fd
+void FAST_FUNC xmove_fd(int from, int to)
+{
+	if (from == to)
+		return;
+	xdup2(from, to);
+	close(from);
+}
+
+// Die with an error message if we can't write the entire buffer.
+void FAST_FUNC xwrite(int fd, const void *buf, size_t count)
+{
+	if (count) {
+		ssize_t size = full_write(fd, buf, count);
+		if ((size_t)size != count) {
+			/*
+			 * Two cases: write error immediately;
+			 * or some writes succeeded, then we hit an error.
+			 * In either case, errno is set.
+			 */
+			bb_perror_msg_and_die(
+				size >= 0 ? "short write" : "write error"
+			);
+		}
+	}
+}
+void FAST_FUNC xwrite_str(int fd, const char *str)
+{
+	xwrite(fd, str, strlen(str));
+}
+
+void FAST_FUNC xclose(int fd)
+{
+	if (close(fd))
+		bb_perror_msg_and_die("close failed");
+}
+
+// Die with an error message if we can't lseek to the right spot.
+off_t FAST_FUNC xlseek(int fd, off_t offset, int whence)
+{
+	off_t off = lseek(fd, offset, whence);
+	if (off == (off_t)-1) {
+		if (whence == SEEK_SET)
+			bb_perror_msg_and_die("lseek(%"OFF_FMT"u)", offset);
+		bb_perror_msg_and_die("lseek");
+	}
+	return off;
+}
+
+int FAST_FUNC xmkstemp(char *template)
+{
+	int fd = mkstemp(template);
+	if (fd < 0)
+		bb_perror_msg_and_die("can't create temp file '%s'", template);
+	return fd;
+}
+
+// Die with supplied filename if this FILE* has ferror set.
+void FAST_FUNC die_if_ferror(FILE *fp, const char *fn)
+{
+	if (ferror(fp)) {
+		/* ferror doesn't set useful errno */
+		bb_error_msg_and_die("%s: I/O error", fn);
+	}
+}
+
+// Die with an error message if stdout has ferror set.
+void FAST_FUNC die_if_ferror_stdout(void)
+{
+	die_if_ferror(stdout, bb_msg_standard_output);
+}
+
+int FAST_FUNC fflush_all(void)
+{
+	return fflush(NULL);
+}
+
+
+int FAST_FUNC bb_putchar(int ch)
+{
+	return putchar(ch);
+}
+
+/* Die with an error message if we can't copy an entire FILE* to stdout,
+ * then close that file. */
+void FAST_FUNC xprint_and_close_file(FILE *file)
+{
+	fflush_all();
+	// copyfd outputs error messages for us.
+	if (bb_copyfd_eof(fileno(file), STDOUT_FILENO) == -1)
+		xfunc_die();
+
+	fclose(file);
+}
+
+// Die with an error message if we can't malloc() enough space and do an
+// sprintf() into that space.
+char* FAST_FUNC xasprintf(const char *format, ...)
+{
+	va_list p;
+	int r;
+	char *string_ptr;
+
+	va_start(p, format);
+	r = vasprintf(&string_ptr, format, p);
+	va_end(p);
+
+	if (r < 0)
+		bb_error_msg_and_die(bb_msg_memory_exhausted);
+	return string_ptr;
+}
+
+void FAST_FUNC xsetenv(const char *key, const char *value)
+{
+	if (setenv(key, value, 1))
+		bb_error_msg_and_die(bb_msg_memory_exhausted);
+}
+
+/* Handles "VAR=VAL" strings, even those which are part of environ
+ * _right now_
+ */
+void FAST_FUNC bb_unsetenv(const char *var)
+{
+	char *tp = strchr(var, '=');
+
+	if (!tp) {
+		unsetenv(var);
+		return;
+	}
+
+	/* In case var was putenv'ed, we can't replace '='
+	 * with NUL and unsetenv(var) - it won't work,
+	 * env is modified by the replacement, unsetenv
+	 * sees "VAR" instead of "VAR=VAL" and does not remove it!
+	 * horror :( */
+	tp = xstrndup(var, tp - var);
+	unsetenv(tp);
+	free(tp);
+}
+
+void FAST_FUNC bb_unsetenv_and_free(char *var)
+{
+	bb_unsetenv(var);
+	free(var);
+}
+
+// Die with an error message if we can't set gid.  (Because resource limits may
+// limit this user to a given number of processes, and if that fills up the
+// setgid() will fail and we'll _still_be_root_, which is bad.)
+void FAST_FUNC xsetgid(gid_t gid)
+{
+	if (setgid(gid)) bb_perror_msg_and_die("setgid");
+}
+
+// Die with an error message if we can't set uid.  (See xsetgid() for why.)
+void FAST_FUNC xsetuid(uid_t uid)
+{
+	if (setuid(uid)) bb_perror_msg_and_die("setuid");
+}
+
+void FAST_FUNC xsetegid(gid_t egid)
+{
+	if (setegid(egid)) bb_perror_msg_and_die("setegid");
+}
+
+void FAST_FUNC xseteuid(uid_t euid)
+{
+	if (seteuid(euid)) bb_perror_msg_and_die("seteuid");
+}
+
+// Die if we can't chdir to a new path.
+void FAST_FUNC xchdir(const char *path)
+{
+	if (chdir(path))
+		bb_perror_msg_and_die("can't change directory to '%s'", path);
+}
+
+void FAST_FUNC xfchdir(int fd)
+{
+	if (fchdir(fd))
+		bb_perror_msg_and_die("fchdir");
+}
+
+void FAST_FUNC xchroot(const char *path)
+{
+	if (chroot(path))
+		bb_perror_msg_and_die("can't change root directory to '%s'", path);
+	xchdir("/");
+}
+
+// Print a warning message if opendir() fails, but don't die.
+DIR* FAST_FUNC warn_opendir(const char *path)
+{
+	DIR *dp;
+
+	dp = opendir(path);
+	if (!dp)
+		bb_perror_msg("can't open '%s'", path);
+	return dp;
+}
+
+// Die with an error message if opendir() fails.
+DIR* FAST_FUNC xopendir(const char *path)
+{
+	DIR *dp;
+
+	dp = opendir(path);
+	if (!dp)
+		bb_perror_msg_and_die("can't open '%s'", path);
+	return dp;
+}
+
+// Die with an error message if we can't open a new socket.
+int FAST_FUNC xsocket(int domain, int type, int protocol)
+{
+	int r = socket(domain, type, protocol);
+
+	if (r < 0) {
+		/* Hijack vaguely related config option */
+#if ENABLE_VERBOSE_RESOLUTION_ERRORS
+		const char *s = "INET";
+# ifdef AF_PACKET
+		if (domain == AF_PACKET) s = "PACKET";
+# endif
+# ifdef AF_NETLINK
+		if (domain == AF_NETLINK) s = "NETLINK";
+# endif
+IF_FEATURE_IPV6(if (domain == AF_INET6) s = "INET6";)
+		bb_perror_msg_and_die("socket(AF_%s,%d,%d)", s, type, protocol);
+#else
+		bb_perror_msg_and_die("socket");
+#endif
+	}
+
+	return r;
+}
+
+// Die with an error message if we can't bind a socket to an address.
+void FAST_FUNC xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen)
+{
+	if (bind(sockfd, my_addr, addrlen)) bb_perror_msg_and_die("bind");
+}
+
+// Die with an error message if we can't listen for connections on a socket.
+void FAST_FUNC xlisten(int s, int backlog)
+{
+	if (listen(s, backlog)) bb_perror_msg_and_die("listen");
+}
+
+/* Die with an error message if sendto failed.
+ * Return bytes sent otherwise  */
+ssize_t FAST_FUNC xsendto(int s, const void *buf, size_t len, const struct sockaddr *to,
+				socklen_t tolen)
+{
+	ssize_t ret = sendto(s, buf, len, 0, to, tolen);
+	if (ret < 0) {
+		if (ENABLE_FEATURE_CLEAN_UP)
+			close(s);
+		bb_perror_msg_and_die("sendto");
+	}
+	return ret;
+}
+
+// xstat() - a stat() which dies on failure with meaningful error message
+void FAST_FUNC xstat(const char *name, struct stat *stat_buf)
+{
+	if (stat(name, stat_buf))
+		bb_perror_msg_and_die("can't stat '%s'", name);
+}
+
+void FAST_FUNC xfstat(int fd, struct stat *stat_buf, const char *errmsg)
+{
+	/* errmsg is usually a file name, but not always:
+	 * xfstat may be called in a spot where file name is no longer
+	 * available, and caller may give e.g. "can't stat input file" string.
+	 */
+	if (fstat(fd, stat_buf))
+		bb_simple_perror_msg_and_die(errmsg);
+}
+
+// selinux_or_die() - die if SELinux is disabled.
+void FAST_FUNC selinux_or_die(void)
+{
+#if ENABLE_SELINUX
+	int rc = is_selinux_enabled();
+	if (rc == 0) {
+		bb_error_msg_and_die("SELinux is disabled");
+	} else if (rc < 0) {
+		bb_error_msg_and_die("is_selinux_enabled() failed");
+	}
+#else
+	bb_error_msg_and_die("SELinux support is disabled");
+#endif
+}
+
+int FAST_FUNC ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...)
+{
+	int ret;
+	va_list p;
+
+	ret = ioctl(fd, request, argp);
+	if (ret < 0) {
+		va_start(p, fmt);
+		bb_verror_msg(fmt, p, strerror(errno));
+		/* xfunc_die can actually longjmp, so be nice */
+		va_end(p);
+		xfunc_die();
+	}
+	return ret;
+}
+
+int FAST_FUNC ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...)
+{
+	va_list p;
+	int ret = ioctl(fd, request, argp);
+
+	if (ret < 0) {
+		va_start(p, fmt);
+		bb_verror_msg(fmt, p, strerror(errno));
+		va_end(p);
+	}
+	return ret;
+}
+
+#if ENABLE_IOCTL_HEX2STR_ERROR
+int FAST_FUNC bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name)
+{
+	int ret;
+
+	ret = ioctl(fd, request, argp);
+	if (ret < 0)
+		bb_simple_perror_msg(ioctl_name);
+	return ret;
+}
+int FAST_FUNC bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name)
+{
+	int ret;
+
+	ret = ioctl(fd, request, argp);
+	if (ret < 0)
+		bb_simple_perror_msg_and_die(ioctl_name);
+	return ret;
+}
+#else
+int FAST_FUNC bb_ioctl_or_warn(int fd, unsigned request, void *argp)
+{
+	int ret;
+
+	ret = ioctl(fd, request, argp);
+	if (ret < 0)
+		bb_perror_msg("ioctl %#x failed", request);
+	return ret;
+}
+int FAST_FUNC bb_xioctl(int fd, unsigned request, void *argp)
+{
+	int ret;
+
+	ret = ioctl(fd, request, argp);
+	if (ret < 0)
+		bb_perror_msg_and_die("ioctl %#x failed", request);
+	return ret;
+}
+#endif
+
+char* FAST_FUNC xmalloc_ttyname(int fd)
+{
+	char buf[128];
+	int r = ttyname_r(fd, buf, sizeof(buf) - 1);
+	if (r)
+		return NULL;
+	return xstrdup(buf);
+}
+
+void FAST_FUNC generate_uuid(uint8_t *buf)
+{
+	/* http://www.ietf.org/rfc/rfc4122.txt
+	 *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+	 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+	 * |                          time_low                             |
+	 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+	 * |       time_mid                |         time_hi_and_version   |
+	 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+	 * |clk_seq_and_variant            |         node (0-1)            |
+	 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+	 * |                         node (2-5)                            |
+	 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+	 * IOW, uuid has this layout:
+	 * uint32_t time_low (big endian)
+	 * uint16_t time_mid (big endian)
+	 * uint16_t time_hi_and_version (big endian)
+	 *  version is a 4-bit field:
+	 *   1 Time-based
+	 *   2 DCE Security, with embedded POSIX UIDs
+	 *   3 Name-based (MD5)
+	 *   4 Randomly generated
+	 *   5 Name-based (SHA-1)
+	 * uint16_t clk_seq_and_variant (big endian)
+	 *  variant is a 3-bit field:
+	 *   0xx Reserved, NCS backward compatibility
+	 *   10x The variant specified in rfc4122
+	 *   110 Reserved, Microsoft backward compatibility
+	 *   111 Reserved for future definition
+	 * uint8_t node[6]
+	 *
+	 * For version 4, these bits are set/cleared:
+	 * time_hi_and_version & 0x0fff | 0x4000
+	 * clk_seq_and_variant & 0x3fff | 0x8000
+	 */
+	pid_t pid;
+	int i;
+
+	i = open("/dev/urandom", O_RDONLY);
+	if (i >= 0) {
+		read(i, buf, 16);
+		close(i);
+	}
+	/* Paranoia. /dev/urandom may be missing.
+	 * rand() is guaranteed to generate at least [0, 2^15) range,
+	 * but lowest bits in some libc are not so "random".  */
+	srand(monotonic_us()); /* pulls in printf */
+	pid = getpid();
+	while (1) {
+		for (i = 0; i < 16; i++)
+			buf[i] ^= rand() >> 5;
+		if (pid == 0)
+			break;
+		srand(pid);
+		pid = 0;
+	}
+
+	/* version = 4 */
+	buf[4 + 2    ] = (buf[4 + 2    ] & 0x0f) | 0x40;
+	/* variant = 10x */
+	buf[4 + 2 + 2] = (buf[4 + 2 + 2] & 0x3f) | 0x80;
+}
+
+#if BB_MMU
+pid_t FAST_FUNC xfork(void)
+{
+	pid_t pid;
+	pid = fork();
+	if (pid < 0) /* wtf? */
+		bb_perror_msg_and_die("vfork"+1);
+	return pid;
+}
+#endif
+
+void FAST_FUNC xvfork_parent_waits_and_exits(void)
+{
+	pid_t pid;
+
+	fflush_all();
+	pid = xvfork();
+	if (pid > 0) {
+		/* Parent */
+		int exit_status = wait_for_exitstatus(pid);
+		if (WIFSIGNALED(exit_status))
+			kill_myself_with_sig(WTERMSIG(exit_status));
+		_exit(WEXITSTATUS(exit_status));
+	}
+	/* Child continues */
+}
Index: /EcnlProtoTool/trunk/prototool/.cproject
===================================================================
--- /EcnlProtoTool/trunk/prototool/.cproject	(revision 446)
+++ /EcnlProtoTool/trunk/prototool/.cproject	(revision 447)
@@ -150,4 +150,5 @@
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/tcc-0.9.27/Debug}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/onigmo-6.1.3/Debug}&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/busybox/Debug}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/mbed_api/Debug}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/mruby-2.1.1/build/arm-none-eabi/lib}&quot;"/>
@@ -165,4 +166,5 @@
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/tcc-0.9.27/Debug}/libtcc.a&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/onigmo-6.1.3/Debug}/libonigmo.a&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/busybox/Debug/libbusybox.a}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/mbed_api/Debug}/libmbed_api.a&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/mruby-2.1.1}/build/arm-none-eabi/lib/libmruby.a&quot;"/>
@@ -177,4 +179,5 @@
 									<listOptionValue builtIn="false" value="tcc"/>
 									<listOptionValue builtIn="false" value="onigmo"/>
+									<listOptionValue builtIn="false" value="busybox"/>
 									<listOptionValue builtIn="false" value="mruby"/>
 									<listOptionValue builtIn="false" value="mrbcode"/>
Index: /EcnlProtoTool/trunk/prototool/.project
===================================================================
--- /EcnlProtoTool/trunk/prototool/.project	(revision 446)
+++ /EcnlProtoTool/trunk/prototool/.project	(revision 447)
@@ -4,4 +4,5 @@
 	<comment></comment>
 	<projects>
+		<project>busybox</project>
 		<project>curl-7.57.0</project>
 		<project>mbed_api</project>
