[
  {
    "path": ".gitattributes",
    "content": "* text eol=crlf\r\n*.sh text eol=lf\r\n*.com -text\r\n*.ico -text\r\nelvis.rc -text\r\nci_*.sh text eol=lf\r\n.github/workflows/*.yml text eol=lf\r\n\r\n# On checkout it is the specified encoding, but git internal\r\n# representation is UTF-8 so that diffs work correctly\r\nstrings/DEFAULT.??? working-tree-encoding=CP437 text eol=auto\r\nstrings/english.??? working-tree-encoding=CP437 text eol=auto\r\nstrings/yu437.???   working-tree-encoding=CP437 text eol=auto\r\nstrings/dutch.???   working-tree-encoding=CP850 text eol=auto\r\nstrings/finnish.??? working-tree-encoding=CP850 text eol=auto\r\nstrings/french.???  working-tree-encoding=CP850 text eol=auto\r\nstrings/german.???  working-tree-encoding=CP850 text eol=auto\r\nstrings/italian.??? working-tree-encoding=CP850 text eol=auto\r\nstrings/pt_br.???   working-tree-encoding=CP850 text eol=auto\r\nstrings/spanish.??? working-tree-encoding=CP850 text eol=auto\r\nstrings/swedish.??? working-tree-encoding=CP850 text eol=auto\r\nstrings/serbian.??? working-tree-encoding=CP852 text eol=auto\r\nstrings/slovene.??? working-tree-encoding=CP852 text eol=auto\r\nstrings/turkish.??? working-tree-encoding=CP857 text eol=auto\r\nstrings/pt.???   working-tree-encoding=CP860 text eol=auto\r\nstrings/russian.??? working-tree-encoding=CP866 text eol=auto\r\nstrings/ukr.???     working-tree-encoding=CP866 text eol=auto\r\n# Does not exist in iconv, so have to do it manually\r\n# strings/polish.???  working-tree-encoding=CP991 text eol=auto\r\nstrings/polish.??? text eol=auto\r\n"
  },
  {
    "path": ".github/actions/build/action.yml",
    "content": "name: cross-compile-build\r\ndescription: Cross-compile\r\ninputs:\r\n  cmd:\r\n    description: 'build cmd'\r\n    default: ''\r\n    required: false\r\n    type: string\r\n#\r\nruns:\r\n  using: composite\r\n  steps:\r\n    - name: build (Windows)\r\n      if: runner.os == 'Windows'\r\n      run: |\r\n        copy config.b config.bat\r\n        copy config.std config.mak\r\n        ${{inputs.cmd}}\r\n      shell: cmd\r\n    - name: build (OSX, Linux)\r\n      if: runner.os != 'Windows'\r\n      run: |\r\n        ${{inputs.cmd}}\r\n      shell: bash\r\n\r\n"
  },
  {
    "path": ".github/actions/upx-inst/action.yml",
    "content": "name: install-upx\r\ndescription: Load UPX\r\n#\r\nruns:\r\n  using: composite\r\n  steps:\r\n    - name: UPX install (OSX)\r\n      if: runner.os == 'macOS'\r\n      run: brew install upx\r\n      shell: bash\r\n    - name: UPX install (Linux, Windows)\r\n      if: runner.os != 'macOS'\r\n      uses: crazy-max/ghaction-upx@v3\r\n      with:\r\n        install-only: true\r\n"
  },
  {
    "path": ".github/workflows/ci-build.yml",
    "content": "name: Build\non:\n  pull_request:\n    types:\n      - opened\n      - edited\n      - ready_for_review\n      - reopened\n      - synchronize\n  push:\n\njobs:\n  build:\n    if: contains(github.event.head_commit.message, '[skip ci]') == false\n\n    runs-on: ubuntu-24.04\n\n    steps:\n    - uses: actions/checkout@v4\n\n    - name: prerequisites\n      run: ./ci_prereq.sh\n      env:\n          TC201_ARCHIVE_PATHNAME: ${{ vars.TC201_ARCHIVE_PATHNAME }}\n          TC201_ARCHIVE_FILENAME: ${{ vars.TC201_ARCHIVE_FILENAME }}\n          TC201_ARCHIVE_PASSPHRASE: ${{ secrets.TC201_ARCHIVE_PASSPHRASE }}\n\n    - name: build\n      run: ./ci_build.sh\n\n    - name: test\n      run: ./ci_test.sh\n\n    - name: make snapshot name\n      id: snapshotname\n      run: |\n        (\n          today=`date -u +%F | tr '\\n' '-'`\n          s_sha=`echo -n ${GITHUB_SHA} | cut -c1-8`\n          printf \"fname=snapshot-%s%s\\n\" $today $s_sha >> $GITHUB_OUTPUT\n        )\n\n    - name: upload\n      if: github.repository == 'FDOS/freecom' &&\n        (github.event_name == 'push' || github.event.pull_request.merged == true)\n      uses: actions/upload-artifact@v4\n      with:\n        name: ${{ steps.snapshotname.outputs.fname }}\n        path: _output\n\n  test-ow-cross-compile:\n    if: contains(github.event.head_commit.message, '[skip ci]') == false\n    strategy:\n      matrix:\n        ow:\n          - name:   '1.9'\n            id:     '1.9'\n          - name:   '2.0'\n            id:     '2.0-64'\n        host:\n          - name:   'Windows'\n            id:     'nt'\n            image:  'windows-latest'\n            cmd:    'build.bat watcom upx english'\n          - name:   'Mac OSX-ARM'\n            id:     'osx'\n            image:  'macos-latest'\n            cmd:    './build.sh watcom upx english'\n          - name:   'Linux'\n            id:     'linux'\n            image:  'ubuntu-latest'\n            cmd:    './build.sh watcom upx english'\n        exclude:\n          - { ow: { name: '1.9' }, host: { id: 'osx' } }\n    runs-on: ${{matrix.host.image}}\n    name: Test OW ${{matrix.ow.name}} cross-compile (${{matrix.host.name}})\n\n    steps:\n    - uses: actions/checkout@v4\n\n    - name: Nasm install\n      uses: ilammy/setup-nasm@v1\n\n    - name: UPX install\n      uses: \"./.github/actions/upx-inst\"\n\n    - name: Open Watcom install\n      uses: open-watcom/setup-watcom@v0\n      with:\n        version: ${{matrix.ow.id}}\n\n    - name: build\n      uses: \"./.github/actions/build\"\n      with:\n        cmd: ${{matrix.host.cmd}}\n"
  },
  {
    "path": ".gitignore",
    "content": "*.cfg\r\n*.com\r\n*.exe\r\n*.icd\r\n*.lib\r\n*.lst\r\n*.map\r\n*.o\r\n*.obj\r\n*.rsp\r\n*.tmp\r\n\r\n# CI build\r\n/_downloads/**\r\n/_output/**\r\n/_watcom/**\r\n\r\n/build/**\r\n/strings/strings/**\r\n!/strings/strings/makefile.mak\r\n/**/echolib.bat\r\n/**/echoto.bat\r\n!/scripts/**\r\n/**/gnumake.mak\r\n\r\n/config.bat\r\n/config.mak\r\n/context.h_c\r\n/context.inc\r\n/gnuconf.mak\r\n/infores\r\n/info.txt\r\n/strings.h\r\n/criter/context.def\r\n/criter/context.h_c\r\n/criter/context.inc\r\n/criter/criter\r\n/criter/criter1\r\n/shell/command.err\r\n/strings/strings.dat\r\n/strings/strings.err\r\n/strings/strings.h\r\n/strings/strings.log\r\n/strings/xmsswap.cln\r\n/tools/makefile.mak\r\n"
  },
  {
    "path": "FILE_ID.DIZ",
    "content": "This is the FreeDOS Command Shell (command.com).\r\n\r\nFor the latest version and information, visit\r\n\r\nhttp://wiki.freedos.org/wiki/index.php/FreeCOM\r\n\r\nSee LICENSE for license information.\r\n"
  },
  {
    "path": "README.md",
    "content": "# FreeCom - The DOS Command Line Interface #\r\n********************************************\r\n\r\nSource code distribution of FreeCOM - a Command line interface\r\nprogram, which substitutes COMMAND.COM\r\n\r\n<!-- Upstream Master -->\r\n<!-- [![Build](https://github.com/FDOS/freecom/workflows/Build/badge.svg)](https://github.com/FDOS/freecom/actions) -->\r\n<!-- Local Branch -->\r\n[![Build](../../workflows/Build/badge.svg)](../../actions)\r\n\r\n## About ##\r\nThis software is part of the FreeDOS project. \r\nPlease visit the freedos web page at http://www.freedos.org/ for more information about FreeDOS.\r\n\r\nFreeCOM implements the command processor for the DOS kernel.  It is usually the first program started by the kernel and provides a command line interface to interactively run other DOS programs.\r\n\r\nAdditionally, FreeCOM implements a BATCH file processor allowing scripting of commands as well.  See http://help.fdos.org/en/hhstndrd/batch/index.htm for more help with batch commands.\r\n\r\n\r\n## More information ##\r\n[Changes since last official release](https://github.com/FDOS/freecom/commits/master)\r\n\r\n[How to compile FreeCOM](docs/compile.txt)\r\n\r\n\r\n## Bugs and Help ##\r\n\r\nThe COMMAND.COM web site (including source hosting) is at\r\n\r\n   https://github.com/FDOS/freecom\r\n\r\nBugs may be filed at https://github.com/FDOS/freecom/issues\r\nor you may send any bug reports, comments or other info to the\r\none of the FreeDOS mailing lists.  For subscription and archives, see:\r\n\r\n   http://www.freedos.org/forums/\r\n\r\nThis software has been developed by many people.  Older changes are listed along with who provided the change within docs/HISTORY.TXT file and more recent changes can be seen with git log (HISTORY.TXT is only updated periodically).\r\n\r\nPlease note that this software is separate from the DOS-C kernel and\r\nis intended to be compatible with a variety of kernels that implement the DOS API (i.e. it should run on FreeDOS DOS-C kernel and on other DOS kernels such as Microsoft's DOS).\r\n\r\n## Installation ##\r\nTo use this shell, just run the COMMAND.COM file.\r\nYou can also add this to your CONFIG.SYS file:\r\n\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nSHELL=<shell path><shell filename>\r\n\r\ne.g.\r\n\r\nSHELL=C:\\FREEDOS\\COMMAND.COM /P\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nSee http://help.fdos.org/en/hhstndrd/command.htm for description of command line options.\r\n\r\n\r\n## Current Features ##\r\n- environment handling with prompt and path support\r\n- directory utilities\r\n- command-line history with doskey-like features + filename completion (TAB)\r\n- batch file processing\r\n- input/output redirection and piping\r\n- loadhigh support\r\n- alias support\r\n- flow control (IF, FOR, GOTO, labels)\r\n- support for error and other messages in multiple languages\r\n"
  },
  {
    "path": "VERSION.TXT",
    "content": "FreeCom version 0.87 - WATCOMC [???]\r\n"
  },
  {
    "path": "build.bat",
    "content": "@echo off\r\n\r\nset SWAP=YES-DXMS-SWAP____________________\r\nif NOT \"%SWAP%\"==\"YES-DXMS-SWAP____________________\" goto err1\r\n: BEGIN Internal stuff for ska -- If one of these three commands\r\n:       fail for you, your distribution is broken! Please report.\r\nfor %%a in (lib\\makefile.mak cmd\\makefile.mak shell\\makefile.mak) do if not exist %%a set SWAP=NO\r\nif \"%SWAP%\"==\"NO\" set XMS_SWAP=\r\nif \"%SWAP%\"==\"NO\" call dmake dist\r\n: END\r\nset SWAP=\r\n\r\nset COMPILER=TURBOCPP\r\nif not exist config.bat goto err3\r\nif not exist config.mak goto err2\r\ncall config.bat\r\nif exist lastmake.mk call clean.bat\r\nif \"%1\"==\"-r\" call clean.bat\r\nif \"%1\"==\"-r\" shift\r\nif \"%1\"==\"clean\" clean.bat\r\nif \"%1\"==\"clean\" goto ende\r\nif \"%1\"==\"-h\" goto help\r\nif \"%1\"==\"-?\" goto help\r\n\r\nset XMS_SWAP=1\r\n:loop_commandline\r\nif \"%1\"==\"no-xms-swap\" goto special\r\nif \"%1\"==\"xms-swap\" goto special\r\nif \"%1\"==\"xmsswap\"  goto special\r\nif \"%1\"==\"debug\"    goto special\r\nif \"%1\"==\"plainedt\" goto plainedt\r\nif \"%1\"==\"watcom\"   goto special\r\nif \"%1\"==\"wc\"       goto special\r\nif \"%1\"==\"tc\"       goto special\r\nif \"%1\"==\"tcpp\"     goto special\r\nif \"%1\"==\"bc\"       goto special\r\nif \"%1\"==\"upx\"      goto special\r\ngoto run\r\n\r\n:special\r\nif \"%1\"==\"no-xms-swap\" set XMS_SWAP=\r\nif \"%1\"==\"xms-swap\" set XMS_SWAP=1\r\nif \"%1\"==\"xmsswap\"  set XMS_SWAP=1\r\nif \"%1\"==\"debug\"    set DEBUG=1\r\nif \"%1\"==\"watcom\"   set COMPILER=WATCOM\r\nif \"%1\"==\"wc\"       set COMPILER=WATCOM\r\nif \"%1\"==\"tc\"       set COMPILER=TC2\r\nif \"%1\"==\"tcpp\"     set COMPILER=TURBOCPP\r\nif \"%1\"==\"bc\"       set COMPILER=BC5\r\nif \"%1\"==\"upx\"      set WITH_UPX=1\r\nshift\r\nif not \"%1\" == \"\" goto loop_commandline\r\n\r\nif not \"%1\"==\"-h\" goto run\r\n\r\n:help\r\necho Build FreeCOM\r\necho Usage: %0 [-r] [clean] [no-xms-swap] [debug] [language]\r\necho -r: Rebuild -- Clean before proceed\r\necho clean: Remove *.OBJ, *.COM, *.LIB, etc. files, then exit\r\necho no-xms-swap: Build FreeCOM without XMS-Only Swap support\r\necho debug: Build FreeCOM with debug settings.\r\necho plainedt: Build FreeCOM without enhanced line editing/history\r\necho You can select for which language to built FreeCOM by setting\r\necho the environment variable LNG before running this script, e.g.:\r\necho SET LNG=german\r\necho selects the German language. For available language see STRINGS\\*.LNG\r\ngoto ende\r\n\r\n:plainedt\r\nif exist config.$$$ del config.$$$\r\nren config.h config.$$$\r\necho #define IGNORE_ENHANCED_INPUT >config.h\r\ntype config.$$$ >>config.h\r\nshift\r\nif not \"%1\" == \"\" goto loop_commandline\r\n::goto run\r\n\r\n:run\r\nif not x%1==x set LNG=%1\r\nif \"%lng%\"==\"\" set LNG=english\r\necho Building FreeCOM for language %LNG%\r\n\r\nif not \"%MAKE%\" == \"\" goto skip_make\r\n\r\nif \"%COMPILER%\" == \"TC2\"      set MAKE=%TC2_BASE%\\make -fmakefile.mak\r\nif \"%COMPILER%\" == \"TURBOCPP\" set MAKE=%TP1_BASE%\\bin\\make -f makefile.mak\r\nif \"%COMPILER%\" == \"BC5\"      set MAKE=%BC5_BASE%\\bin\\make -f makefile.mak\r\nif \"%COMPILER%\" == \"WATCOM\"   set MAKE=wmake -ms -h -f makefile.mak\r\n\r\necho Make is %MAKE%.\r\n\r\n:skip_make\r\n\r\necho.\r\necho Checking SUPPL library\r\ncd suppl\r\nif exist skip goto endSuppl\r\necho Building SUPPL library\r\n%MAKE% all\r\nif errorlevel 1 goto ende\r\ncd src\r\n%MAKE% all\r\nif errorlevel 1 goto ende\r\ncd ..\r\n:endSuppl\r\ncd ..\r\n\r\necho.\r\necho Making basic utilities for build process\r\necho.\r\ncd utils\r\n%MAKE% all\r\nif errorlevel 1 goto ende\r\ncd ..\\utilsc\r\n%MAKE% all\r\nif errorlevel 1 goto ende\r\ncd ..\r\n\r\necho.\r\necho Making STRINGS resource\r\necho.\r\ncd strings\r\n%MAKE% all\r\nif errorlevel 1 goto ende\r\ncd strings\r\n%MAKE% all\r\nif errorlevel 1 goto ende\r\ncd ..\\..\r\n\r\necho.\r\necho Making CRITER resource\r\necho.\r\ncd criter\r\n%MAKE% all\r\nif errorlevel 1 goto ende\r\ncd ..\r\n\r\necho.\r\necho Making misc library\r\necho.\r\ncd lib\r\n%MAKE% all\r\nif errorlevel 1 goto ende\r\ncd ..\r\n\r\necho.\r\necho Making commands library\r\necho.\r\ncd cmd\r\n%MAKE% all\r\nif errorlevel 1 goto ende\r\ncd ..\r\n\r\necho.\r\necho Making COMMAND.COM\r\necho.\r\ncd shell\r\n%MAKE% all\r\nif errorlevel 1 goto ende\r\ncd ..\r\n\r\nutils\\mkinfres.exe /tinfo.txt infores shell\\command.map shell\\command.exe\r\n:: save version without lang specific files and version with strings embedded\r\nif NOT \"%XMS_SWAP%\"==\"\" SET CMD_NAME=strings\\xmsswap.cln\r\nif \"%XMS_SWAP%\"==\"\" SET CMD_NAME=strings\\command.cln\r\ncopy /b shell\\command.exe + infores + criter\\criter1 + criter\\criter %CMD_NAME%\r\ncopy /b %CMD_NAME% + strings\\strings.dat command.com\r\nif not exist command.com goto ende\r\n\r\necho.\r\necho Making supplemental tools\r\necho.\r\ncd tools\r\ntype tools.m1 >makefile.mak\r\n..\\utils\\mktools.exe >>makefile.mak\r\ntype tools.m2 >>makefile.mak\r\n%MAKE% all\r\nif errorlevel 1 goto ende\r\ncd ..\r\n\r\necho.\r\necho Patching heap size to 8KB\r\necho.\r\nutils\\ptchsize.exe command.com +8KB\r\nutils\\ptchsize.exe %CMD_NAME% +8KB\r\n\r\nif %WITH_UPX%x == x goto alldone\r\nif exist command.upx del command.upx >nul\r\nupx --8086 --best -o command.upx command.com\r\n\r\n:alldone\r\necho.\r\necho All done. COMMAND.COM is ready for use!\r\necho.\r\nif NOT \"%XMS_SWAP%\"==\"\" goto ende\r\n\r\necho Note: To build FreeCOM without XMS-Only Swap, re-run\r\necho BUILD.BAT -r no-xms-swap %LNG%\r\ngoto ende\r\n\r\n:err3\r\necho Please copy CONFIG.B into CONFIG.BAT and update the\r\necho settings therein.\r\ngoto ende\r\n\r\n:err2\r\necho Please copy CONFIG.STD into CONFIG.MAK and update the\r\necho settings therein.\r\ngoto ende\r\n\r\n:err1\r\necho Environment full (cannot add environment variables)\r\necho Cannot proceed\r\n\r\n:ende\r\nset XMS_SWAP=\r\nset DEBUG=\r\nset MAKE=\r\nset COMPILER=\r\nset TC2_BASE=\r\nset TP1_BASE=\r\nset BC5_BASE=\r\nset XNASM=\r\nset LNG=\r\nset WITH_UPX=\r\nset CMD_NAME=\r\nif exist config.$$$ del config.h\r\nif exist config.$$$ ren config.$$$ config.h\r\n"
  },
  {
    "path": "build.sh",
    "content": "#!/bin/bash\n\nset -e\n\nWITH_UPX=\"no\"\nSED=sed\n#workaround for Windows (set to binary mode)\nif [ \"$(expr substr $(uname -s) 1 5)\" == 'MINGW' ]; then\n    SED='sed -b'\nfi\n\n\nexport SWAP=YES-DXMS-SWAP____________________\n# BEGIN Internal stuff for ska -- If one of these three commands\n#       fail for you, your distribution is broken! Please report.\nfor a in lib/makefile.mak cmd/makefile.mak shell/makefile.mak; do if [ ! -f $a ]; then export SWAP=NO; fi; done\nif [ \"$SWAP\" == \"NO\" ]; then\n    unset XMS_SWAP\n    dmake dist\nfi\n# end\nexport SWAP=\n\nif [ ! -f config.mak ]; then\n  echo File config.mak missing, copying config.std to it\n  cp config.std config.mak || exit 1\nfi\n\nexport XNASM=nasm\nexport COMPILER=watcom\nif [ -z \"$WATCOM\" ]; then\n  export WATCOM=$HOME/watcom\n  export PATH=$PATH:$WATCOM/binl\nfi\nexport PATH=$PATH:.\n\nif [ -f lastmake.mk ] || [ \"$1\" == \"-r\" ]; then ./clean.sh; fi\nif [ \"$1\" == \"-r\" ]; then ./clean.sh; shift; fi\nif [ \"$1\" == \"clean\" ]; then ./clean.sh; exit 0; fi\n\nexport XMS_SWAP=1\nwhile (( \"$#\" )); do\n  case \"$1\" in\n    -h)\n\techo Build FreeCOM\n\techo Usage: %0 [-r] [clean] [no-xms-swap] [debug] [language]\n\techo -r: Rebuild -- Clean before proceed\n\techo clean: Remove *.OBJ, *.COM, *.LIB, etc. files, then exit\n\techo no-xms-swap: Build FreeCOM without XMS-Only Swap support\n\techo debug: Build FreeCOM with debug settings.\n\techo You can select for which language to built FreeCOM by setting\n\techo the environment variable LNG before running this script, e.g.:\n\techo EXPORT LNG=german\n\techo selects the German language. For available language see STRINGS\\*.LNG\n\texit 0\n\t;;\n    no-xms-swap)\n\tunset XMS_SWAP\n\t;;\n    debug)\n\texport DEBUG=1\n\t;;\n    watcom)\n\texport COMPILER=watcom\n\t;;\n    wc)\n\texport COMPILER=watcom\n\t;;\n    gcc)\n\texport COMPILER=gcc\n\t;;\n    upx)\n\tWITH_UPX=\"yes\"\n\t;;\n    *)\n\tbreak\n\t;;\n  esac\n  shift\ndone\n\n\nif [ -n \"$1\" ]; then export LNG=$1; fi\nif [ -z \"$LNG\" ]; then export LNG=english; fi\necho Building FreeCOM for language $LNG\n\nif [ -z \"$MAKE\" ]; then\n    case \"$COMPILER\" in\n\twatcom)\n\t    export MAKE=\"wmake -ms -h -f makefile.mak\"\n\t    ;;\n\tgcc)\n\t    export MAKE=\"make -f gnumake.mak\"\n\t    ;;\n\t*)\n\t    ;;\n    esac\n    echo Make is $MAKE.\nfi\n\n# substitutions for GNU Make\n\ngnumake_subst () {\n    $SED -e 's@^!@@' \\\n\t-e 's@^include \"\\(.*\\)\"@include \\1@' \\\n\t-e 's@^include $(TOP)/config.mak@include $(TOP)/gnuconf.mak@' \\\n\t-e 's@if \\(.*\\) == \\(.*\\)[\\r$]@ifeq (\\1,\\2)@' \\\n\t-e 's@^CC =@CC :=@' \\\n\t-e 's@^INCLUDEPATH =@INCLUDEPATH :=@' \\\n\t-e 's/\\(-f obj.*$<\\)/\\1 -o $@/' \\\n\t < $1/$2 > $1/$3\n}\n\nif $MAKE -? 2>&1 | grep -q gnu; then\n    gnumake_subst . config.mak gnuconf.mak\n    for i in suppl utils utilsc strings criter lib cmd; do\n\tgnumake_subst $i makefile.mak gnumake.mak\n    done\n    gnumake_subst suppl/src makefile.mak gnumake.mak\n    gnumake_subst strings/strings makefile.mak gnumake.mak\n    gnumake_subst shell makefile.mak gnumake.mak\nfi\n\necho\necho Checking SUPPL library\ncd suppl\nif [ ! -f skip ]; then\n    echo Building SUPPL library\n    $MAKE all\n\n    cd src\n    $MAKE all\n    cd ..\nfi\ncd ..\n\necho\necho Making basic utilities for build process\necho\ncd utils\n$MAKE all\ncd ../utilsc\n$MAKE all\ncd ..\n\necho\necho Making STRINGS resource\necho\ncd strings\n$MAKE all\ncd strings\n$MAKE all\ncd ../..\n\necho\necho Making CRITER resource\necho\ncd criter\n$MAKE all\ncd ..\n\necho\necho Making misc library\necho\ncd lib\n$MAKE all\ncd ..\n\necho\necho Making commands library\necho\ncd cmd\n$MAKE all\ncd ..\n\necho\necho Making COMMAND.COM\necho\ncd shell\n$MAKE all\ncd ..\n\nutils/mkinfres.exe -Tinfo.txt infores shell/command.map shell/command.exe\ncat shell/command.exe infores criter/criter1 criter/criter strings/strings.dat > command.com\n[ -f command.com ] || exit 1\n\necho\necho Making supplemental tools\necho\ncd tools\ncat tools.m1 > makefile.mak\n../utils/mktools.exe >>makefile.mak\ncat tools.m2 >>makefile.mak\nif $MAKE -? 2>&1 | grep -q gnu; then\n    gnumake_subst . makefile.mak gnumake.mak\nfi\n$MAKE all\ncd ..\n\necho\necho Patching heap size to 8KB\necho\nutils/ptchsize.exe command.com +8KB\n\nif [ $WITH_UPX = \"yes\" ]; then\n  rm -f command.upx\n  upx --8086 --best -o command.upx command.com\nfi\n\necho\necho All done. COMMAND.COM is ready for use!\necho\nif [ -z \"$XMS_SWAP\" ]; then\n  echo Note: To build FreeCOM without XMS-Only Swap, re-run\n  echo ./build.sh -r no-xms-swap $LNG\nfi\n"
  },
  {
    "path": "buildall.bat",
    "content": "@ECHO OFF\r\nREM we use BUILD_COMPILER as build.bat sets and clears COMPILER env var\r\nif \"%BUILD_COMPILER%\"==\"\" set BUILD_COMPILER=wc\r\nif NOT \"%1\"==\"\" goto %1\r\n\r\nrd /s /q build\r\ncall clean\r\nmkdir build\r\nmkdir build\\localize\r\ncopy VERSION.TXT build\\localize\\\r\ncopy command.lsm build\\localize\\\r\ncopy docs\\localize.txt build\\localize\\\r\n\r\nREM make FreeDOS package structure\r\nmd build\\package\r\nSET pkgdir=build\\package\r\nmd %pkgdir%\\APPINFO\r\nmd %pkgdir%\\BIN\r\nmd %pkgdir%\\DOC\r\nmd %pkgdir%\\DOC\\COMMAND\r\nmd %pkgdir%\\HELP\r\nmd %pkgdir%\\NLS\r\nmd %pkgdir%\\SOURCE\r\nmd %pkgdir%\\SOURCE\\FREECOM\r\n\r\npushd .\r\nset languages=NL Dutch ES Spanish DE German FI Finnish FR French IT Italian PO Polish PTR PT_BR RU Russian SE Swedish Ser Serbian SI Slovene TR Turkish UKR Ukr YUG YU437 EN English\r\nset buildfile=%0\r\ncall %0 buildall padding %languages%\r\n::for %%a in (Dutch Spanish German Finnish French Italian Polish PT_BR Russian Swedish Serbian Slovene Turkish Ukr YU437 English) DO %0 %%a\r\npopd\r\n\r\npushd .\r\ncd build\\localize\r\n7z a -mx9 -tzip ..\\localize.zip .\r\npopd\r\n\r\nREM source with filetimes matching commit\r\npushd .\r\ncd build\r\nmd source\r\ncd source\r\ngit clone https://github.com/FDOS/freecom.git\r\ncd freecom\r\nREM this is from git-tools, it is not included with git\r\ngit restore-mtime\r\nREM remove git references\r\nrd /s /q .git\r\nrd /s /q .github\r\ndel .gitattributes\r\ndel .gitignore\r\ncd ..\r\n7z a -mx9 -tzip ..\\freecom-source.zip .\r\npopd\r\n\r\nREM make FreeDOS package\r\npushd .\r\ncopy command.lsm %pkgdir%\\APPINFO\\COMMAND.LSM\r\ncopy bin\\fdcom.ico %pkgdir%\\BIN\\FDCOM.ICO\r\ncopy build\\English\\xmsswap\\command.com %pkgdir%\\BIN\\COMMAND.COM\r\ncopy FILE_ID.DIZ %pkgdir%\\DOC\\COMMAND\\FILE_ID.DIZ\r\ncopy README.md %pkgdir%\\DOC\\COMMAND\\README.MD\r\ncopy VERSION.TXT %pkgdir%\\DOC\\COMMAND\\VERSION.TXT\r\ncopy docs\\HELP.EN %pkgdir%\\HELP\\COMMAND.EN\r\ncopy docs\\html\\commands\\cmd.html %pkgdir%\\DOC\\COMMAND\\CMD.HTM\r\ncopy docs\\html\\commands\\FreeCOM.html %pkgdir%\\DOC\\COMMAND\\FREECOM.HTM\r\ncopy utils\\MAKECMD.BAT %pkgdir%\\NLS\\MAKECMD.BAT\r\n:: language specific versions copied into NLS during build\r\ncopy build\\freecom-source.zip %pkgdir%\\SOURCE\\FREECOM\\SOURCES.ZIP\r\ncd %pkgdir%\r\n7z a -mx9 -tzip ..\\command.zip .\r\npopd\r\n\r\n\r\ncall clean\r\nSET languages=\r\nSET pkgdir=\r\nSET buildfile=\r\nECHO Done bulding all!\r\ngoto end\r\n\r\n:buildall\r\nrem skip past buildall dummy on first pass, skip last language on each successive pass\r\nshift\r\nshift\r\nrem %1 and %2 are abbr and language name\r\nif \"%1\"==\"\" goto end\r\npushd .\r\nECHO building %2 (%1)\r\ncall %buildfile% dobuild %2\r\npopd\r\ncopy build\\%2\\xmsswap\\command.com %pkgdir%\\NLS\\CMD-%1.COM\r\ngoto buildall\r\n\r\n:dobuild\r\nrem skip past dobuild\r\nshift\r\nrem %1 is the language name (should match one of the *.LNG files)\r\nmkdir build\\%1\r\ncopy VERSION.TXT build\\%1\\\r\ncopy command.lsm build\\%1\\\r\n\r\nmkdir build\\%1\\xmsswap\r\ncall build -r %BUILD_COMPILER% xms-swap %1\r\ncopy command.com build\\%1\\xmsswap\\\r\ncopy tools\\28.com build\\%1\\\r\ncopy tools\\50.com build\\%1\\\r\ncopy tools\\load_icd.exe build\\%1\\\r\n\r\ncopy strings\\xmsswap.cln build\\localize\\\r\ncopy strings\\fixstrs.exe build\\localize\\\r\ncopy strings\\default.lng build\\localize\\\r\ncopy strings\\%1.lng build\\localize\\\r\ncopy strings\\strings.dat build\\localize\\%1.dat\r\ncopy tools\\28.com build\\localize\\\r\ncopy tools\\50.com build\\localize\\\r\ncopy tools\\load_icd.exe build\\localize\\\r\n\r\n\r\nmkdir build\\%1\\kswap\r\ncall build -r %BUILD_COMPILER% no-xms-swap %1\r\ncopy command.com build\\%1\\kswap\\\r\ncopy docs\\k-swap.txt build\\%1\\kswap\\\r\ncopy tools\\kssf.com build\\%1\\kswap\\\r\ncopy tools\\vspawn.com build\\%1\\kswap\\\r\n\r\ncopy strings\\command.cln build\\localize\\\r\ncopy tools\\kssf.com build\\localize\\\r\ncopy tools\\vspawn.com build\\localize\\\r\n\r\n\r\nmkdir build\\%1\\debug\r\ncall build -r %BUILD_COMPILER% xms-swap debug %1\r\ncopy command.com build\\%1\\debug\\\r\n\r\n\r\nmkdir build\\%1\\plainedt\r\ncall build -r %BUILD_COMPILER% xms-swap plainedt %1\r\ncopy command.com build\\%1\\plainedt\\\r\n\r\n\r\npushd .\r\ncd build\\%1\r\n7z a -mx9 -tzip ..\\%1.zip .\r\npopd\r\n\r\n:end\r\n"
  },
  {
    "path": "ci_build.sh",
    "content": "#!/bin/sh\n\nset -e\n\nif [ ! -z \"${TRAVIS_BUILD_DIR}\" ] ; then\n  CI_BUILD_DIR=${TRAVIS_BUILD_DIR}\nelse\n  CI_BUILD_DIR=$(pwd)\nfi\necho CI_BUILD_DIR is \\\"${CI_BUILD_DIR}\\\"\n\n# Open Watcom Environment Setup\nexport WATCOM=$CI_BUILD_DIR/_watcom\nexport PATH=$CI_BUILD_DIR/bin:$PATH:$WATCOM/binl64\n\n# Output directory\nrm -rf _output\nmkdir _output\n\n# Which ones to build\nLANGUAGES=\"english dutch finnish french german italian polish pt pt_br russian serbian slovene spanish swedish turkish ukr yu437\"\n\n# GCC\nfor lng in ${LANGUAGES} ; do\n  # Do full clean for rebuild of each language\n  echo \"Do full clean\"\n  git clean -q -x -d -f -e _output -e _watcom -e _download\n  export LNG=${lng}\n  ./build.sh gcc\n  TGT=\"_output/gcc/${LNG}\"\n  mkdir -p ${TGT}\n  mv -i command.com ${TGT}/.\ndone\n\n# Watcom\nfor lng in ${LANGUAGES} ; do\n  # Do full clean for rebuild of each language\n  echo \"Do full clean\"\n  git clean -q -x -d -f -e _output -e _watcom -e _download\n  export LNG=${lng}\n  ./build.sh wc\n  TGT=\"_output/wc/${LNG}\"\n  mkdir -p ${TGT}\n  mv -i command.com ${TGT}/.\ndone\n\n# Let's use the just compiled command.com for the DOS builds and get some\n# testing of it for free. Note case insensitive target in case the freecom\n# package ever has an upper or mixed case file.\necho Copying the GCC Linux built command.com to use for the DOS builds\ncp -v _output/gcc/english/command.com ${HOME}/.dosemu/drive_c/[Cc][Oo][Mm][Mm][Aa][Nn][Dd].[Cc][Oo][Mm]\n\n# Watcom (DOS) (slow so just English)\nmkdir -p _output/wc_dos/english\ngit clean -q -x -d -f -e _output -e _watcom -e _download\n{\n  echo set COMPILER=WATCOM\n  echo set WATCOM='C:\\\\devel\\\\watcomc'\n  echo set MAKE=wmake /ms /h /f makefile.mak\n  echo set XNASM='C:\\\\devel\\\\nasm\\\\nasm'\n  echo set XUPX=upx --8086 --best\n  echo set OLDPATH=%PATH%\n  echo set PATH='%WATCOM%\\\\binw;C:\\\\bin;%OLDPATH%'\n  echo set DOS4G=QUIET\n} | unix2dos > config.bat\n\ncp config.std config.mak\n\ndosemu -td -q -K . -E \"build.bat wc\"\nmv -i command.com _output/wc_dos/english/.\n\n# Turbo C 2.01 (DOS) (slow so just Spanish)\nif [ -d ${HOME}/.dosemu/drive_c/tc201 ] ; then\n  export LNG=spanish\n\n  mkdir -p _output/tc2_dos/${LNG}\n  git clean -q -x -d -f -e _output -e _watcom -e _downloads\n  {\n    echo set LNG=${LNG}\n\n    echo set COMPILER=TC2\n    echo set TC2_BASE='C:\\\\tc201'\n    echo set XNASM=nasm\n    echo set XUPX=upx --8086 --best\n    echo set OLDPATH=%PATH%\n    echo set PATH='%TC2_BASE%;C:\\\\devel\\\\nasm;C:\\\\bin;%WATCOM%\\\\binw;%OLDPATH%'\n  } | unix2dos > config.bat\n\n  cp config.std config.mak\n\n  dosemu -td -q -K . -E \"build.bat\"\n  mv -i command.com _output/tc2_dos/${LNG}/.\nfi\n\necho done\n"
  },
  {
    "path": "ci_prereq.sh",
    "content": "#!/bin/sh\n\nset -e\n\nsudo add-apt-repository -y ppa:dosemu2/ppa\nsudo add-apt-repository ppa:tkchia/build-ia16\nsudo apt update\n\n# Common tools\nsudo apt install nasm upx\nsudo apt install dosemu2 dos2unix\n\n# GCC-IA16 for Linux\nsudo apt install gcc-ia16-elf libi86-ia16-elf\n\n# Tools for DOS builds\nmkdir -p _downloads\nmkdir -p _watcom\ncd _downloads\n\nHERE=$(pwd)\n\n# download and unpack Open Watcom snapshot\n[ -f ow-snapshot.tar.xz ] || wget --no-verbose https://github.com/open-watcom/open-watcom-v2/releases/download/Current-build/ow-snapshot.tar.xz\ntar -C ../_watcom -xf ow-snapshot.tar.xz\n\n#IBIBLIO_PATH='http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos'\nIBIBLIO_PATH='https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/repositories/1.3'\n\nBASE=${IBIBLIO_PATH}/base\n\n#    get FreeDOS kernel\n[ -f kernel.zip ] || wget --no-verbose ${BASE}/kernel.zip\n\n#    get FreeCOM\n[ -f freecom.zip ] || wget --no-verbose ${BASE}/freecom.zip\n\nDEVEL=${IBIBLIO_PATH}/devel\n\n#    get gnumake for DOS\n[ -f djgpp_mk.zip ] || wget --no-verbose ${DEVEL}/djgpp_mk.zip\n\n#    get nasm for DOS\n[ -f nasm.zip ] || wget --no-verbose ${DEVEL}/nasm.zip\n\n#    get upx for DOS\n[ -f upx.zip ] || wget --no-verbose ${DEVEL}/upx.zip\n\n#    get Watcom for DOS\n[ -f watcomc.zip ] || wget --no-verbose ${DEVEL}/watcomc.zip\n\n#    get Turbo C 2.01 (maybe encrypted) tar file\nif [ -n \"${TC201_ARCHIVE_FILENAME}\" ] && [ ! -f ${TC201_ARCHIVE_FILENAME} ] ; then\n   echo \"Downloading Turbo C 2.01\"\n   wget --no-verbose ${TC201_ARCHIVE_PATHNAME}/${TC201_ARCHIVE_FILENAME}\nfi\n\n# Unpack the DOS binaries\nmkdir -p ${HOME}/.dosemu/drive_c\ncd ${HOME}/.dosemu/drive_c && (\n\n  mkdir -p bin\n\n  # Boot files\n  unzip -LL -q ${HERE}/kernel.zip\n  cp -p bin/kernl386.sys ./kernel.sys\n  unzip -LL -q ${HERE}/freecom.zip\n  cp -p bin/command.com ./command.com\n  cp -p /usr/share/dosemu/dosemu2-cmds-0.3/c/fdconfig.sys .\n\n  # Development files\n  unzip -LL -q ${HERE}/djgpp_mk.zip\n  cp -p devel/djgpp/bin/make.exe bin/.\n  unzip -LL -q ${HERE}/upx.zip\n  cp -p devel/upx/upx.exe bin/.\n  echo PATH to make and upx binaries is 'c:/bin'\n\n  unzip -LL -q ${HERE}/nasm.zip\n  echo PATH to nasm binary is 'c:/devel/nasm'\n\n  unzip -LL -q ${HERE}/watcomc.zip\n  echo PATH to watcom binaries is 'c:/devel/watcomc/binw'\n\n  # Turbo C\n  if [ -f ${HERE}/${TC201_ARCHIVE_FILENAME} ] && [ -n \"${TC201_ARCHIVE_PASSPHRASE}\" ] ; then\n    echo Decrypting and unpacking Turbo C 2.01\n    echo \"${TC201_ARCHIVE_PASSPHRASE}\" | gpg --decrypt --batch --passphrase-fd 0 ${HERE}/${TC201_ARCHIVE_FILENAME} | tar -jxf -\n  elif [ -f ${HERE}/${TC201_ARCHIVE_FILENAME} ] ; then\n    echo Unpacking Turbo C 2.01\n    tar -jxf ${HERE}/${TC201_ARCHIVE_FILENAME}\n  else\n    echo No Turbo C 2.01 archive available\n  fi\n)\n"
  },
  {
    "path": "ci_test.sh",
    "content": "#!/bin/sh\n\necho No tests created yet!\nexit 0\n"
  },
  {
    "path": "clean.bat",
    "content": "@echo off\r\nif \"%1\"==\"\" goto main\r\nfor %%i in (%2 %3 %4 %5 %6 %7 %8 %9) do if exist %1%%i del %1%%i>nul\r\ngoto end\r\n\r\n:main\r\ncd suppl\r\ncall clnsuppl.bat\r\ncd ..\r\ncall %0 .\\ command.com command.upx \r\ncall %0 .\\ lastmake.mk context.h_c context.inc strings.h infores info.txt gnuconf.mak\r\ncall %0 criter\\ criter criter1 context.def context.inc context.h_c\r\ncall %0 strings\\ command.cln xmsswap.cln strings.h strings.err strings.dat strings.log\r\ncall %0 strings\\strings\\ makefile strings.mak\r\ncall %0 strings\\strings\\*. c\r\ncall %0 tools\\ makefile.mak\r\ncall %0 tools\\*. icd\r\n\r\nfor %%i in (cmd lib strings strings\\strings) do call %0 %%i\\*. lib lst\r\nfor %%i in (cmd lib shell strings strings\\strings tools utils utilsc) do call %0 %%i\\*. obj o cfg map exe com rsp\r\nfor %%i in (cmd lib shell strings strings\\strings tools utils utilsc) do call %0 %%i\\ echoto.bat echolib.bat gnumake.mak\r\nfor %%i in (. criter) do call %0 %%i\\ gnumake.mak\r\n\r\n:end\r\n\r\n"
  },
  {
    "path": "clean.sh",
    "content": "#!/bin/sh\ncd suppl\nrm -f all_done untar.exe untar.com untar.obj untar.map gnumake.mak\nrm -f compile.me suppl*.lib suppl*.lst echoto.bat vars.bat *.cfg\ncd src\nrm -f *.obj suppllib.rsp echoto.bat echolib.bat *.cfg gnumake.mak suppl*.lib suppl*.lst\ncd ../..\nrm -f command.com command.upx\nrm -f lastmake.mk context.h_c context.inc strings.h infores info.txt\ncd strings    && rm -f strings.h strings.err strings.dat strings.log\ncd ../criter  && rm -f criter criter1 context.def context.inc context.h_c\ncd ../strings/strings && rm -f *.c makefile strings.mak\ncd ../../tools && rm -f makefile.mak *.icd\ncd ..\nfor i in cmd lib strings strings/strings; do rm -f $i/*.lib $i/*.lst; done\nfor i in cmd lib shell strings strings/strings tools utils utilsc; do\n  rm -f $i/gnumake.mak $i/*.obj $i/*.o $i/*.cfg $i/*.map $i/*.exe\n  rm -f $i/*.com $i/*.rsp $i/echoto.bat $i/echolib.bat\ndone\nfor i in . criter; do rm -f $i/gnumake.mak; done\n"
  },
  {
    "path": "cmd/alias.c",
    "content": "/* $Id$\r\n *  ALIAS.C - alias administration module\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <nls_f.h>\r\n\r\n#include \"../err_fcts.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n\r\nint cmd_alias(char *param)\r\n{\tchar *value;\r\n\r\n\t\t/* Bail on every option */\r\n\tif(leadOptions(&param, 0, 0) != E_None)\r\n\t\treturn 1;\r\n\r\n\t/* *param != whitespace */\r\n\tswitch(breakVarAssign(ctxtAlias, param, &value)) {\r\n\tcase 1:\t\t\t/* no equal sign */\r\n\t\terror_syntax(0);\r\n\t\treturn 1;\r\n\tcase 0:\t\t\t/* displayed */\r\n\t\treturn 0;\r\n#ifdef DEBUG\r\n\tcase 2: break;\r\n\tdefault:\r\n\t\tdprintf((\"[ALIAS: Invalid response from breakVarAssign()]\\n\"));\r\n\t\treturn 1;\r\n#endif\r\n\t}\r\n\r\n\t/* param[] == alias name -> check its validity */\r\n\trtrimsp(param);\t\t/* spaces are ignored at its end */\r\n\tif(!*param) {\r\n\t\terror_syntax(0);\r\n\t\treturn 1;\r\n\t}\r\n\tif(!is_fnstr(param)) {\r\n\t\terror_no_alias_name(param);\r\n\t\treturn 1;\r\n\t}\r\n\tStrFUpr(param);\t\t\t\t/* Aliases are case-insensitive */\r\n\tvalue = trimsp(value);\r\n\r\n\treturn chgCtxt(CTXT_TAG_ALIAS, param, *value? value: 0);\r\n}\r\n"
  },
  {
    "path": "cmd/beep.c",
    "content": "/* $Id$\r\n *  BEEP.C - beep command.\r\n *\r\n *  Comments:\r\n *\r\n * 16 Jul 1998 (Hans B Pufal)\r\n *   started.\r\n *\r\n * 16 Jul 1998 (John P Price)\r\n *   Seperated commands into individual files.\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n\r\nint cmd_beep (char * param) { (void)param; beep (); return 0; }\r\n"
  },
  {
    "path": "cmd/break.c",
    "content": "/* $Id$\r\n *  BREAK.C - break command.\r\n *\r\n *  Comments:\r\n *\r\n * 14-Aug-1998 (John P Price)\r\n *   started.\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../err_fcts.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n\r\nint cmd_break(char *param)\r\n{\r\n\tswitch(onoffStr(param)) {\r\n  \tdefault:\r\n\t\terror_on_off();\r\n\t\treturn 1;\r\n\tcase OO_Null:\tcase OO_Empty:\r\n\t\tdisplayString(TEXT_MSG_BREAK_STATE, getbreak() ? D_ON : D_OFF);\r\n\t\tbreak;\r\n  \tcase OO_Off:\tsetbreak(0);\tbreak;\r\n  \tcase OO_On:\t\tsetbreak(1);\tbreak;\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/call.c",
    "content": "/* $Id$\r\n *  CALL.C - batch file call command.\r\n *\r\n *  Comments:\r\n *\r\n * 16 Jul 1998 (Hans B Pufal)\r\n *   started.\r\n *\r\n * 16 Jul 1998 (John P Price)\r\n *   Seperated commands into individual files.\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 04-Aug-1998 (Hans B Pufal)\r\n * - added lines to initialize for pointers (HBP004)  This fixed the\r\n *   lock-up that happened sometimes when calling a batch file from\r\n *   another batch file.\r\n *\r\n * 10-Aug-1998 ska\r\n * - changed: initialize bcontext with function\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <stdio.h>\r\n#include <string.h>\r\n#include <stdlib.h>\r\n\r\n#include \"../include/batch.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/kswap.h\"\r\n\r\nstatic int optS = 0;\t\t/* force to swap out FreeCOM during call */\r\nstatic int optN = 0;\t\t/* force to NOT swap (superceeds optS) */\r\n\r\noptScanFct(opt_call)\r\n{\r\n  (void)arg;\r\n  switch(ch) {\r\n  case 'S': return optScanBool(optS);\r\n  case 'N': return optScanBool(optN);\r\n  case 'Y': return optScanBool(tracemode);\r\n  }\r\n  optErr();\r\n  return E_Useage;\r\n}\r\n\r\n/*\r\n * Perform CALL command.\r\n *\r\n * Allocate a new batch context and add it to the current chain.\r\n * Call parsecommandline passing in our param string\r\n * If No batch file was opened then remove our newly allocted\r\n * context block.\r\n */\r\nint cmd_call (char * param) {\r\n\tstruct bcontext *n = newBatchContext();\r\n\tint ec;\r\n\r\n        (void)param;\r\n\tif (n == 0) {\r\n\t\t/* Not in a batch file */\r\n\t\treturn 1;\r\n\t}\r\n\r\n\toptS = optN = 0;\r\n\r\n\tif((ec = leadOptions(&param, opt_call, 0)) != E_None)\r\n\t\treturn ec;\r\n\r\n\tif(swapOnExec != ERROR) {\r\n\t\tif(optS)\r\n\t\t\tswapOnExec = TRUE;\r\n\t\tif(optN)\r\n\t\t\tswapOnExec = FALSE;\r\n\t}\r\n\r\n\tparsecommandline(param, FALSE);\r\n\tif(swapOnExec != ERROR)\r\n\t\tswapOnExec = FALSE;\r\n\r\n\tif (bc->bfile == 0\r\n\t && bc->bfnam == 0) {    /* Wasn't a batch file so remove context */\r\n\t\tbc = bc->prev;\r\n\t\tfree(n);\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/cdd.c",
    "content": "/* $Id$\r\n * CDD - changes drive and directory\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/command.h\"\r\n\r\nint cmd_cdd(char *param)\r\n{\r\n\treturn cd_dir(param, 1, \"CDD\");\r\n}\r\n"
  },
  {
    "path": "cmd/chcp.c",
    "content": "/* $Id$\r\n *  CHCP.C - CHCP command.\r\n\r\n \tCHCP [codepage]\r\n\r\n \tvia DOS-66-01/02\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/07/19 18:13:39  skaus\r\n\tbugfix: CHCP: use n to set new codepage [Eduardo Casino]\r\n\r\n\tRevision 1.2  2003/03/05 17:43:51  skaus\r\n\tbugfix: cached NLS data not flushed\r\n\t\r\n\tRevision 1.1  2002/11/12 21:47:16  skaus\r\n\tadd: CHCP (disabled by default)\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <ctype.h>\r\n\r\n#include <portable.h>\r\n\r\n#include \"../err_fcts.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/nls.h\"\r\n#include \"../strings.h\"\r\n\r\nint cmd_chcp(char *param)\r\n{\tUSEREGS\r\n\tunsigned curCP, sysCP;\r\n\r\n\t_AX = 0x6601;\r\n\t_BX = 0xffffU;\r\n\tgeninterrupt(0x21);\r\n\tcurCP = _BX;\r\n\tsysCP = _DX;\r\n\tif(_CFLAG || curCP == 0xffffU) {\r\n\t\terror_get_codepage();\r\n\t\treturn 1;\r\n\t}\r\n\r\n\tif(!param || !*param) {\r\n\t\t/* display current codepage */\r\n\t\tdisplayString(TEXT_DISPLAY_CODEPAGE, curCP, sysCP);\r\n\t} else {\r\n\t\tchar *p;\r\n\t\tunsigned n = 0;\r\n\r\n\t\t/* set code page */\r\n\t\tif(!isdigit(*param)) {\r\n\t\t\terror_syntax(param);\r\n\t\t\treturn 1;\r\n\t\t}\r\n\r\n\t\tp = param;\r\n\t\tdo  n = n * 10 + (*p - '0');\r\n\t\twhile (isdigit(*++p));\r\n\r\n\t\tif(*ltrimcl(p)) {\r\n\t\t\terror_syntax(param);\r\n\t\t\treturn 1;\r\n\t\t}\r\n\r\n\t\tinvalidateNLSbuf();\r\n\r\n\t\t_DX = sysCP;\r\n\t\t_BX = n;\r\n\t\t_AX = 0x6602;\r\n\t\tgeninterrupt(0x21);\r\n\t\tif(_CFLAG) {\r\n\t\t\terror_set_codepage();\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t}\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/chdir.c",
    "content": "/* $Id$\r\n * CD / CHDIR - changes the current working directory of a drive\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/command.h\"\r\n\r\nint cmd_chdir(char *param)\r\n{\r\n  return cd_dir(param, 0, \"CHDIR\");\r\n}\r\n"
  },
  {
    "path": "cmd/cls.c",
    "content": "/* $Id$\r\n *  CLS.C - clear screen internal command\r\n *\r\n *  Comments:\r\n *\r\n *\tIssues ^L (Form Feed), then:\r\n *\tif file descriptor #1 (aka stdout) is connected to a device _and_\r\n *\tis not the NUL: device, uses the BIOS to clear the screen\r\n *\tand home the cursor to the upper left.\r\n *\r\n *  07/27/1998 (John P. Price)\r\n *    started.\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 30-Nov-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - CLS now sets the text colors to lightgray on black before clearing the\r\n *   screen.\r\n *\r\n * $Log$\r\n * Revision 1.9  2006/09/05 01:44:32  blairdude\r\n * Massive patches from Arkady that I'm way too lazy to sort through.  If anything happens, Arkady can answer for it.\r\n *\r\n * Revision 1.8  2006/06/12 04:55:42  blairdude\r\n * All putchar's now use outc which first flushes stdout and then uses write to write the character to the console.  Some potential bugs have been fixed ( Special thanks to Arkady for noticing them :-) ).  All CONIO dependencies have now been removed and replaced with size-optimized functions (for example, mycprintf, simply opens \"CON\" and directly writes to the console that way, and mywherex and mywherey use MK_FP to access memory and find the cursor position).  FreeCOM is now\r\n * significantly smaller.\r\n *\r\n * Revision 1.7  2006/06/11 02:06:11  blairdude\r\n *\r\n *\r\n * All of FreeCOM now uses write instead of putchar and intr instead of int86[x] or intdos[x]\r\n *\r\n * Revision 1.6  2004/08/19 19:10:49  skaus\r\n * fix: CLS: cut debug message\r\n *\r\n * Revision 1.5  2004/06/29 14:14:54  skaus\r\n * fix: help screen of internal commands causes \"Unknown command error\" {Bernd Blaauw}\r\n *\r\n * Revision 1.4  2004/06/15 19:27:43  skaus\r\n * bugfix: CLS: use BIOS, unless fd1 is file or NUL {Eric Auer}\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <dos.h>\r\n#include <stdio.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/openf.h\"\r\n#include \"../include/misc.h\"\r\n\r\nint cmd_cls (char * param) {\r\n    int attr = fdattr(1);\r\n    (void)param;\r\n    outc( '\\xc' ); /* ^L Form feed */\r\n\r\n\t/* Output stream is standard CON device */\r\n\tif((attr & 0x9f) == 0x93) {\r\n\t\tunsigned attr = 0x0700;\r\n\t\tint mode;\r\n\t\tIREGS r;\r\n\t\t\r\n\t\t/* Get the current video mode */\r\n\t\t\r\n\t\tr.r_ax = 0x0f00;\t/* Scroll window up // entire window */\r\n\t\tintrpt(0x10, &r);\r\n\t\tmode = r.r_ax & 0x7f;\r\n\t\t\r\n\t\tswitch (mode)\r\n\t\t{\r\n\t\tcase 0x04: /* CGA 320x200 */\r\n\t\tcase 0x05: /* CGA 320x200, grayscale */\r\n\t\tcase 0x09: /* PCjr 320x200 */\r\n\t\tcase 0x0a: /* PCjr 640x200 */\r\n\t\tcase 0x0b: /* Tandy 1000 SL/TL */\r\n\t\tcase 0x0d: /* EGA/VGA 320x200, 16 colors */\r\n\t\tcase 0x0e: /* EGA/VGA 640x200, 16 colors */\r\n\t\tcase 0x0f: /* EGA/VGA 640x350, mono */\r\n\t\tcase 0x10: /* EGA/VGA 640x350, 4 or 16 colors */\r\n\t\tcase 0x11: /* VGA 640x480, mono */\r\n\t\tcase 0x12: /* VGA 640x480, 16 colors */\r\n\t\tcase 0x13: /* VGA 320x200, 256 colors */\r\n\t\tcase 0x59: /* SVGA 800x600, 16 colors */\r\n\t\t\tattr = 0;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t;\r\n\t\t}\r\n\t\t\r\n\t\t/* Now roll the screen */\r\n\t\tr.r_ax = 0x0600;\t/* Scroll window up // entire window */\r\n\t\tr.r_bx = attr;\t\t/* Attribute to write */\r\n\t\tr.r_cx = 0x0000;\t/* Upper left */\r\n\t\tr.r_dx = ((SCREEN_ROWS - 1) << 8) | (SCREEN_COLS - 1); /* Lower right */\r\n\t\tintrpt(0x10, &r);\r\n\t\tgoxy(1, 1);\t\t\t/* home the cursor */\r\n\t}\r\n\telse if((attr & 0x9c) == 0x80) {\r\n\t\t/* character device neither NUL nor CLOCK$ nor standard CON\r\n\t\t  (guess AUX or COMn, which is connected commmon serial terminal) */\r\n\t\touts( \"\\x1b[2J\" );\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/cmd.m1",
    "content": ".AUTODEPEND\r\n\r\nCFG_DEPENDENCIES = makefile.mak\r\n\r\n!include \"..\\config.mak\"\r\n\r\nall: $(CFG) cmds.lib\r\n\r\n"
  },
  {
    "path": "cmd/cmd.m2",
    "content": "\r\n"
  },
  {
    "path": "cmd/copy.c",
    "content": "/* $Id$\r\n * COPY.C -- Internal Copy Command\r\n *\r\n * 1999/05/10 ska\r\n * rewritten, based upon previous COPY.C of FreeCom v0.76b\r\n *\r\n * Known bugs:\r\n *  + Multiple '+' plus signs are scanned as a single one.\r\n *\r\n * 1999/07/08 ska\r\n * bugfix: destination is a drive letter only\r\n *\r\n * 2000/07/17 Ron Cemer\r\n * bugfix: destination ending in \"\\\\\" must be a directory, but fails\r\n *\twithin dfnstat()\r\n *\r\n * 2000/07/24 Ron Cemer\r\n * bugfix: Suppress \"Overwrite...\" prompt if destination is device\r\n *\r\n * 2001/02/17 ska\r\n * add: interactive command flag\r\n \r\n * bugfix: copy 1 + 2 + 3 <-> only first and last file is stored\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#include <io.h>\r\n#include <fcntl.h>\r\n#include <sys/stat.h>\r\n#include <limits.h>\r\n\r\n#include <portable.h>\r\n\r\n/*#define DEBUG*/\r\n\r\n#include \"dfn.h\"\r\n#include \"suppl.h\"\r\n#include \"supplio.h\"\r\n\r\n#include \"../include/lfnfuncs.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n#include \"../include/openf.h\"\r\n\r\n#define ASCII 1\r\n#define BINARY 2\r\n#define IS_DIRECTORY 5\r\n\r\nstatic struct CopySource {\r\n  struct CopySource *nxt;   /* next source */\r\n  struct CopySource *app;   /* list of files to append */\r\n  int flags;          /* ASCII / Binary */\r\n  char *fnam;         /* filename */\r\n} *head, *last, *lastApp;\r\n\r\n\r\nstatic int appendToFile; /* Append the next file rather than new source */\r\nstatic char *destFile;     /* destination file/directory/pattern */\r\nstatic int destFlags;\r\n\r\nstatic int optY, optV, optA, optB;\r\n\r\noptScanFct(opt_copy)\r\n{\r\n  (void)arg;\r\n  switch(ch) {\r\n  case 'Y': return optScanBool(optY);\r\n  case 'V': return optScanBool(optV);\r\n  case 'A': case 'B': return E_Ignore;\r\n  }\r\n  optErr();\r\n  return E_Useage;\r\n}\r\n\r\noptScanFct(opt_copy1)\r\n{\r\n  int ec, *opt = NULL, *optReset = NULL;\r\n\r\n  (void)arg;\r\n  switch(ch) {\r\n#ifndef NDEBUG\r\n  default:\r\n    fprintf(stderr, \"Invalid option: file '%s' in line %d\\n\"\r\n      , __FILE__, __LINE__);\r\n    abort();\r\n#endif\r\n  case 'A': opt = &optA; optReset = &optB; break;\r\n  case 'B': opt = &optB; optReset = &optA; break;\r\n  }\r\n  if((ec = optScanBool(*opt)) == E_None\r\n   && *opt)\r\n    *optReset = 0;\r\n\r\n  return ec;\r\n}\r\n\r\n\r\nstatic void initContext(void)\r\n{\r\n  appendToFile = 0;\r\n  last = lastApp = 0;\r\n}\r\n\r\nstatic void killContext(void)\r\n{\r\n  if(last) {\r\n    assert(head);\r\n    do {\r\n      if((lastApp = head->app) != 0) do {\r\n        lastApp = (last = lastApp)->app;\r\n        free(last);\r\n      } while(lastApp);\r\n      head = (last = head)->nxt;\r\n      free(last);\r\n    } while(head);\r\n  }\r\n}\r\n\r\n/*\r\n\tfaster copy, using large (far) buffers\r\n*/\r\n\r\n/*\r\n\ta) this copies data, using a 60K buffer\r\n\tb) if transfer is slow (or on a huge file),\r\n\t   indicate some progress\r\n*/\r\n\r\nstatic int BIGcopy(int fdout, int fdin, int asc)\r\n{\r\n\tchar far *buffer;\r\n\tunsigned size;\r\n\tunsigned rd;\r\n\tint retval = 0;\r\n\t\t\t\t\t\t\t\t/* stat stuff */\r\n\tunsigned startTime, lastTime=0, now, doStat = 0, deviceIn;\r\n\tunsigned long copied = 0, toCopy = filelength(fdin);\r\n\tchar *statString;\r\n\tchar far *ctrlz;\r\n\t\r\n\t\r\n\t/* Fetch the largest available buffer */\r\n\tfor(size = 60*1024u; size != 0; size -= 4*1024) {\r\n#ifdef FARDATA\r\n\t\t/* use last-fit allocation to work well with large model */\r\n\t\tbuffer = MK_SEG_PTR(void, DOSalloc(size/16,2));\r\n#else\r\n\t\tbuffer = MK_SEG_PTR(void, DOSalloc(size/16,0));\r\n#endif\r\n\t\tif(buffer != NULL)\r\n\t\t\tgoto ok;\r\n\t}\r\n\treturn 3;\t/* out of memory error */\r\n\r\nok:\r\n\tdprintf( (\"[MEM: BIGcopy() allocate %u bytes @ 0x%04x]\\n\"\r\n\t , size, FP_SEG(buffer)) );\r\n\tdeviceIn = isadev(fdin);\r\n\tstatString = getString(deviceIn\r\n\t\t? TEXT_COPY_COPIED_NO_END\r\n\t\t: TEXT_COPY_COPIED);\r\n\tstartTime = *(unsigned far *)MK_FP(0x40,0x6c);\r\n\r\n\tctrlz = 0;\r\n\twhile((rd = farread(fdin, buffer, size)) != 0) {\r\n\t\tif(rd == 0xffff) {\r\n\t\t\tretval = 1;\r\n\t\t\tgoto _exit;\r\n\t\t}\r\n\r\n\t\tif(asc) {\r\n\t\t\tctrlz = _fmemchr(buffer, 0x1a, rd);\r\n\t\t\tif(ctrlz != 0)\r\n\t\t\t\trd = (unsigned)(ctrlz - buffer);\r\n\t\t}\r\n\t\t\r\n\t\tif(farwrite(fdout, buffer, rd) != rd) {\r\n\t\t\tif(!isadev(fdout)) retval = 2;\r\n\t\t\tgoto _exit;\r\n\t\t}\r\n\t\t\t\r\n\t\t\t\t\t\t/* statistics */\r\n\t\tcopied += rd;\t\r\n\t\t\t\r\n\t\tnow = *(unsigned far *)MK_FP(0x40,0x6c);\r\n\t\t\r\n\t\tif(!doStat\r\n\t\t && now - startTime > 15 * 18\r\n\t\t && isatty(fileno(stdout)))\r\n\t\t\tdoStat = TRUE;\r\n\t\t\r\n\t\tif(now - lastTime > 18) {\r\n\t\t\tif(doStat)\r\n\t\t\t\tprintf(statString, copied/1024, toCopy/1024);\r\n\t\t\t\t\r\n\t\t\tif(cbreak) {\r\n\t\t\t\tretval = 3;\r\n\t\t\t\tgoto _exit;\r\n\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\tlastTime = now;\r\n\t\t}\r\n\t\tif(ctrlz || (rd < size && !(deviceIn && asc))) break;\r\n\t}\t\r\n\t\t\r\n_exit:\t\t\r\n\tif(doStat)\r\n\t\tprintf(\"%30s\\r\",\"\");\r\n\t\t\r\n\tdprintf( (\"[MEM: BIGcopy() release memory @ 0x%04x]\\n\"\r\n\t , FP_SEG(buffer)) );\r\n\tDOSfree(FP_SEG(buffer));\r\n\tfree(statString);\r\n\treturn retval;\r\n}\r\n\r\nstatic int is_valid_disk(int tstdsk)\r\n{\r\n  int savdsk = getdisk();\r\n  int newdsk;\r\n\r\n  /* Change to new disk */\r\n  setdisk(tstdsk);\r\n  newdsk = getdisk();\r\n\r\n  /* Restore */\r\n  setdisk(savdsk);\r\n\r\n  return (newdsk == tstdsk);\r\n}\r\n\r\nstatic int copy(char *dst, char *pattern, struct CopySource *src\r\n  , int openMode)\r\n{ struct dos_ffblk ff;\r\n  struct CopySource *h;\r\n  char rDest[MAXPATH], rSrc[MAXPATH];\r\n  int fdin, fdout;\r\n  int rc;\r\n  FLAG keepFTime;\r\n#if defined(__WATCOMC__) && __WATCOMC__ < 1280\r\n  unsigned short date, time;\r\n#elif defined(__TURBOC__)\r\n  struct ftime fileTime;\r\n#else\r\n  unsigned date, time;\r\n#endif\r\n  char *srcFile;\r\n  FLAG wildcarded;\r\n  /*FLAG isfirst = 1;*/\r\n  FLAG singleFileCopy = src->app == NULL;\r\n\r\n  assert(dst);\r\n  assert(pattern);\r\n  assert(src);\r\n\r\n  if(strpbrk(pattern, \"*?\") == 0) {\r\n  \tsrcFile = dfnfilename(pattern);\r\n  \twildcarded = 0;\r\n  } else if(dos_findfirst(pattern, &ff, FA_RDONLY | FA_ARCH) != 0) {\r\n    error_sfile_not_found(pattern);\r\n    return 0;\r\n  } else {\r\n  \tsrcFile = ff.ff_name;\r\n  \twildcarded = 1;\r\n  }\r\n\r\n  do {\r\n/*    if( wildcarded && !strpbrk( dst, \"*?\" ) && !isfirst ) openMode = O_APPEND; */\r\n    fillFnam(rDest, dst, srcFile);\r\n    if(rDest[0] == 0)\r\n      return 0;\r\n    h = src;\r\n    do {  /* to prevent to open a source file for writing, e.g.\r\n          for COPY *.c *.?    */\r\n      fillFnam(rSrc, h->fnam, srcFile);\r\n      if(rSrc[0] == 0) {\r\n        return 0;\r\n      }\r\n      rc = samefile(rDest, rSrc);\r\n      if(rc < 0) {\r\n        error_out_of_memory();\r\n        return 0;\r\n      } else if(rc) {\r\n        error_selfcopy(rDest);\r\n        return 0;\r\n      }\r\n    } while((h = h->app) != 0);\r\n\r\n    /* Concenation of files uses ASCII by default */\r\n    if(src->app) {\r\n      for(h = src; h && !h->flags; h = h->app)\r\n        h->flags = ASCII;\r\n      if(!destFlags) destFlags = ASCII;\r\n    }\r\n\r\n    if(interactive_command\t\t/* Suppress prompt if in batch file */\r\n       && openMode != O_APPEND && !optY\r\n       && (fdout = dos_open(rDest, O_RDONLY)) >= 0) {\r\n    \tint destIsDevice = isadev(fdout);\r\n\r\n      dos_close(fdout);\r\n      if(!destIsDevice) {\t/* Devices do always exist */\r\n        if((fdin = devopen(rSrc, O_RDONLY)) < 0) { /* Source doesn't exist */\r\n            error_open_file( rSrc );\r\n            return 0;\r\n        } else {\r\n\t        dos_close(fdin);\r\n          \tswitch(userprompt(PROMPT_OVERWRITE_FILE, rDest)) {\r\n\t    \tdefault:\t/* Error */\r\n\t\t    case 4:\t/* Quit */\r\n\t    \t\t  return 0;\r\n\t\t    case 3:\t/* All */\r\n\t\t\t    optY = 1;\r\n    \t\tcase 1: /* Yes */\r\n\t    \t\tbreak;\r\n\t\t    case 2:\t/* No */\r\n    \t\t\tcontinue;\r\n    \t\t}\r\n        }\r\n\t  }\r\n    }\r\n    if(cbreak) {\r\n      return 0;\r\n    }\r\n    if((fdout = devopen(rDest, openMode)) < 0) {\r\n      error_open_file(rDest);\r\n      return 0;\r\n    }\r\n    keepFTime = 1;\r\n    if(isadev(fdout)) {\r\n      if(destFlags & BINARY)  {\r\n        /* in forced binary mode character devices are set to raw */\r\n        fdsetattr(fdout, (fdattr(fdout) & 0xff) | 0x20);\r\n      }\r\n      keepFTime = 0;\r\n    }\r\n    h = src;\r\n    keepFTime = (keepFTime && h->app == 0);\r\n    do {\r\n      fillFnam(rSrc, h->fnam, srcFile);\r\n      if(rSrc[0] == 0) {\r\n        dos_close(fdout);\r\n        unlink(rDest);\t\t/* if device -> no removal, ignore error */\r\n        return 0;\r\n      }\r\n      if((fdin = devopen(rSrc, O_RDONLY)) < 0) {\r\n        error_open_file(rSrc);\r\n        dos_close(fdout);\r\n        unlink(rDest);\t\t/* if device -> no removal, ignore error */\r\n        return 0;\r\n      }\r\n      if(isadev(fdin)) {\r\n\t\tkeepFTime = 0;\t\t/* Cannot keep file time of devices */\r\n      \tif(h->flags & BINARY)\r\n\t\t  /* in forced binary mode character devices are set to raw */\r\n\t\t  fdsetattr(fdin, (fdattr(fdin) & 0xff) | 0x20);\r\n      \telse\r\n\t\t  /* make sure to stop at Ctrl-Z */\r\n\t\t  h->flags |= ASCII;\r\n      }\r\n      if(keepFTime)\r\n#ifdef __TURBOC__\r\n        if(getftime(fdin , &fileTime))\r\n#else\r\n        if(_dos_getftime(fdin , &date , &time))\r\n#endif\r\n          keepFTime = 0; /* if error: turn it off */\r\n\r\n      displayString(TEXT_MSG_COPYING, rSrc\r\n\t   , (openMode == 'a' || h != src)? \"=>>\": \"=>\", rDest);\r\n      if(cbreak) {\r\n        dos_close(fdin);\r\n        dos_close(fdout);\r\n        unlink(rDest);\t\t/* if device -> no removal, ignore error */\r\n        return 0;\r\n      }\r\n\r\n      /* Now copy the file */\r\n      rc = 1;\r\n      {\r\n      \tFLAG sizeChanged = !(h->flags & ASCII) && singleFileCopy &&\r\n\t\t\t!isadev(fdin) && !isadev(fdout);\r\n        if(sizeChanged) {\t/* faster copy, *MUCH* faster on floppies\r\n\t\t\t\t\t\t\t\t change destination filesize to wanted size.\r\n\t\t\t\t\t\t\t\t this a) writes all required entries to the\r\n\t\t\t\t\t\t\t\t FAT (faster) determines, if there is enough\r\n\t\t\t\t\t\t\t\t space on the destination device\r\n\t\t\t\t\t\t\t\t no need to copy file, if it won't fit */\r\n        \t\t\t\t\t/* No test if chsize() fails for MS DOS 5/6 bug\r\n        \t\t\t\t\t\tsee RBIL DOS-40 */\r\n        \t\t\t\t\t/* Don't use chsize() as Turbo RTL fills with\r\n        \t\t\t\t\t\t'\\0' bytes, which is not useful here */\r\n        \tlseek(fdout, filelength(fdin), SEEK_SET);\r\n        \tif(truncate(fdout) != 0\r\n        \t || lseek(fdout, 0, SEEK_SET) == -1) {\r\n\t\t\t\terror_write_file_disc_full(rDest, filelength(fdin));\r\n        \t\trc = 0;\r\n\t\t\t} else {\r\n\t\t\t\tdprintf( (\"[COPY chsize(%s, %lu)]\\n\", rDest,\r\n\t\t\t\t filelength(fdin)) );\r\n\t\t\t}\r\n\t\t}\r\n      \r\n        if(rc != 0)\r\n\t\t\tswitch(BIGcopy(fdout, fdin, h->flags & ASCII)) {\r\n\t\t\tcase 0: \r\n\t\t\t\tif(sizeChanged)\r\n\t\t\t\t\t/* probably the source file got truncated */\r\n\t\t\t\t\t/* we silently ignore any failure here, because it is\r\n\t\t\t\t\t\tassumed that we never extend, but truncate the file\r\n\t\t\t\t\t\tonly (or do not change the length at all) */\r\n\t\t\t\t\ttruncate(fdout);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 1:  error_read_file(rSrc);   rc = 0; break;\r\n\t\t\tcase 2:  error_write_file(rDest); rc = 0; break;\r\n\t\t\tdefault: error_copy();            rc = 0; break;\r\n\t\t\t}\r\n      }\r\n      if(cbreak)\r\n        rc = 0;\r\n      dos_close(fdin);\r\n      if(!rc) {\r\n        dos_close(fdout);\r\n        unlink(rDest);\t\t/* if device -> no removal, ignore error */\r\n        return 0;\r\n      }\r\n    } while((h = h->app) != 0);\r\n    rc = 0;\r\n    if((destFlags & ASCII) && !isadev(fdout)) {   /* append the ^Z as we copied in ASCII mode */\r\n      if (dos_write(fdout, \"\\x1a\", 1) != 1)\r\n\t\trc = 1;\r\n    }\r\n    if(keepFTime)\r\n#ifdef __TURBOC__\r\n      setftime(fdout, &fileTime);\r\n#else\r\n      _dos_setftime(fdout, date, time);\r\n#endif\r\n    if(dos_close(fdout) != 0)\r\n      rc = 1;\r\n    if(rc) {\r\n      error_write_file(rDest);\r\n      unlink(rDest);\t\t/* if device -> no removal, ignore error */\r\n      return 0;\r\n    }\r\n  } while (wildcarded && dos_findnext(&ff) == 0);\r\n  /*} while(wildcarded && FINDNEXT(&ff) == 0 && !(isfirst = 0)); */\r\n\r\n  dos_findclose(&ff);\r\n\r\n  return 1;\r\n}\r\n\r\nstatic int copyFiles(struct CopySource *h)\r\n{ int differ, rc;\r\n\r\n  rc = 0;\r\n\r\n#define dst destFile\r\n  if((differ = samefile(h->fnam, dst)) < 0)\r\n    error_out_of_memory();\r\n  else if(!differ)\r\n    rc = copy(dst, h->fnam, h, O_WRONLY|O_TRUNC|O_CREAT);\r\n  else if(h->app)\r\n    rc = copy(dst, h->fnam, h->app, O_WRONLY|O_APPEND);\r\n  else\r\n    error_selfcopy(dst);\r\n#undef dst\r\n\r\n  return rc;\r\n}\r\n\r\nstatic int cpyFlags(void)\r\n{\r\n  return (optA? ASCII: 0) | (optB? BINARY: 0);\r\n}\r\n\r\nstatic struct CopySource *srcItem(char *fnam)\r\n{\tstruct CopySource *h;\r\n\r\n    if((h = malloc(sizeof(struct CopySource))) == 0) {\r\n      error_out_of_memory();\r\n      return 0;\r\n    }\r\n\r\n    h->fnam = fnam;\r\n    h->nxt = h->app = 0;\r\n    h->flags = cpyFlags();\r\n\r\n    return h;\r\n}\r\n\r\nstatic int addSource(char *p)\r\n{ struct CopySource *h;\r\n  char *q;\r\n\r\n  assert(p);\r\n  q = strtok(p, \"+\");\r\n  assert(q && *q);\r\n\r\n  if(appendToFile) {\r\n    appendToFile = 0;\r\n    if(!lastApp) {\r\n      error_leading_plus();\r\n      return 0;\r\n    }\r\n  } else {      /* New entry */\r\n    if(0 == (h = srcItem(q)))\r\n      return 0;\r\n    if(!last)\r\n      last = lastApp = head = h;\r\n    else\r\n      last = lastApp = last->nxt = h;\r\n\r\n    if((q = strtok(0, \"+\")) == 0)   /* no to-append file */\r\n      return 1;\r\n  }\r\n\r\n  /* all the next files are to be appended to the source in \"last\" */\r\n  assert(q);\r\n  assert(lastApp);\r\n  do {\r\n    if(0 == (h = srcItem(q)))\r\n      return 0;\r\n    lastApp = lastApp->app = h;\r\n  } while((q = strtok(0, \"+\")) != 0);\r\n\r\n  return 1;\r\n}\r\n\r\n\r\nint cmd_copy(char *rest)\r\n{ char **argv, *p;\r\n  int argc, opts, argi;\r\n  struct CopySource *h;\r\n  char **argBuffer = 0;\r\n\r\n  /* Initialize options */\r\n  optA = optB = optV = optY = 0;\r\n\r\n  /* read the parameters from env */\r\n  if ((argv = scanCmdline(p = getEnv(\"COPYCMD\"), opt_copy, 0, &argc, &opts))\r\n   == 0) {\r\n    free(p);\r\n    return 1;\r\n  }\r\n  free(p);\r\n  freep(argv);    /* ignore any parameter from env var */\r\n\r\n  if((argv = scanCmdline(rest, opt_copy, 0, &argc, &opts)) == 0)\r\n    return 1;\r\n\r\n  initContext();\r\n\r\n  /* Now parse the remaining arguments into the copy file\r\n    structure */\r\n  for(argi = 0; argi < argc; ++argi)\r\n    if(isoption(p = argv[argi])) {    /* infix /a or /b */\r\n      if(leadOptions(&p, opt_copy1, 0) != E_None) {\r\n        killContext();\r\n        freep(argv);\r\n        return 1;\r\n      }\r\n      /* Change the flags of the previous argument */\r\n      if(lastApp)\r\n        lastApp->flags = cpyFlags();\r\n    } else {            /* real argument */\r\n      if(*p == '+') {       /* to previous argument */\r\n        appendToFile = 1;\r\n        while(*++p == '+');\r\n        if(!*p)\r\n          continue;\r\n      }\r\n\r\n      if(!addSource(p)) {\r\n        killContext();\r\n        freep(argv);\r\n        return 1;\r\n      }\r\n\r\n    }\r\n\r\n  if(appendToFile) {\r\n    error_trailing_plus();\r\n    killContext();\r\n    freep(argv);\r\n    return 1;\r\n  }\r\n\r\n  if(!last) {   /* Nothing to do */\r\n    error_nothing_to_do();\r\n    killContext();\r\n    freep(argv);\r\n    return 1;\r\n  }\r\n\r\n  assert(head);\r\n\r\n  /* Check whether the source items are files or directories */\r\n  h = head;\r\n  argc = 0;\t\t/* argBuffer entries */\r\n  do {\r\n\tstruct CopySource *p = h;\r\n  \tdo {\r\n  \t\tchar *s = strchr(p->fnam, '\\0') - 1;\r\n  \t\tif(*s == '/' || *s == '\\\\'\t\t/* forcedly be directory */\r\n  \t\t || 0 != (dfnstat(p->fnam) & DFN_DIRECTORY)) {\r\n\t\t\tchar **buf;\r\n\t\t\tchar *q;\r\n\t\t\tif(*s == ':') \r\n\t\t\t\tq = dfnmerge(0, p->fnam, 0, \"*\", \"*\");\r\n\t\t\telse\r\n\t\t\t\tq = dfnmerge(0, 0, p->fnam, \"*\", \"*\");\r\n\t\t\tif(0 == (buf = realloc(argBuffer, (argc + 2) * sizeof(char*)))\r\n\t\t\t || !q) {\r\n\t\t\t\tfree(q);\r\n\t\t\t\terror_out_of_memory();\r\n\t\t\t\tgoto errRet;\r\n\t\t\t}\r\n\t\t\targBuffer = buf;\r\n\t\t\tbuf[argc] = p->fnam = q;\r\n\t\t\tbuf[++argc] = 0;\r\n\t\t} else if(*s == ':' && (s - p->fnam) > 1) {\t\t/* Device name LPT1:, but not X: */\r\n  \t\t\tif(!isDeviceName(p->fnam)) {\r\n\t\t\t\terror_invalid_parameter(p->fnam);\r\n\t\t\t\tgoto errRet;\r\n\t\t\t}\r\n  \t\t}\r\n  \t} while(0 != (p = p->app));\r\n  } while(0 != (h = h->nxt));\r\n\r\n  destFlags = last->flags;\r\n\tif(last != head) {\r\n\t\t/* The last argument is to be the destination */\r\n\t\tif(last->app) {\t/* last argument is a + b syntax -> no dst! */\r\n\t\t\terror_copy_plus_destination();\r\n\t\t\tgoto errRet;\r\n\t\t}\r\n\t\tdestFile = last->fnam;\r\n\t\th = head;         /* remove it from argument list */\r\n\t\twhile(h->nxt != last) {\r\n\t\t  assert(h->nxt);\r\n\t\t  h = h->nxt;\r\n\t\t}\r\n\t\tfree(last);\r\n\t\t(last = h)->nxt = 0;\r\n  } else {              /* Nay */\r\n    destFile = \".\\\\*.*\";\r\n  }\r\n\r\n#define dst destFile\r\n  /* If the destination specifies a drive, check that it is valid */\r\n  if (dst[0] && dst[1] == ':' && !is_valid_disk(toupper(dst[0]) - 'A')) {\r\n    error_invalid_drive(toupper(dst[0]) - 'A');\r\n    return 0;\r\n  }\r\n#undef dst\r\n\r\n  /* Now copy the files */\r\n  h = head;\r\n  while(copyFiles(h) && (h = h->nxt) != 0);\r\n\r\nerrRet:\r\n  killContext();\r\n  freep(argv);\r\n  freep(argBuffer);\r\n  return 0;\r\n}\r\n"
  },
  {
    "path": "cmd/ctty.c",
    "content": "/* $Id$\r\n *  CTTY.C - ctty command.\r\n *\r\n *  Comments:\r\n *\r\n *  Current possible problems: -- 2000/01/14 ska\r\n *\r\n *  Problem: Only the first three handles are changed to the passed device.\r\n *  -->\r\n *  As far as I know to CTTY (Change TTY) it is not sufficient just to\r\n *  change the handles 0-2 (stdin, stdout, stderr), but one must inform\r\n *  the system that another driver is the default STDIN/OUT device,\r\n *  what would include to:\r\n *  + return ienabled STDIN/STDOUT bits when the device attributes are\r\n *    retreived via IOCTL,\r\n *  + change the pointer at LoL+0C.\r\n *  My original implication that INT-29 is effected, too, is wrong in\r\n *  the Win98 DOSbox.\r\n *\r\n *  FreeDOS kernel 2017f passes the DOS1-compatible IO functions to\r\n *  the handle based ones, so maybe most simply programs will work?!\r\n *\r\n * 14 Aug 1998 (John P Price)\r\n * - Created dummy command.\r\n *\r\n * 2000/01/14 ska\r\n * + Added to change the first three handles to the given device name\r\n * + Supports only redirection of stdin and stdout, e.g.:\r\n *    C:\\> CTTY COM1 >file\r\n *  -or-\r\n *    C:\\> echo Hallo | CTTY COM1 | echo du\r\n *  The CTTY command effects the commands on the _next_ line.\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <fcntl.h>\r\n#ifdef DEBUG\r\n#include <dos.h>\r\n#endif\r\n#include <io.h>\r\n#include <stdio.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/openf.h\"\r\n#include \"../strings.h\"\r\n#include \"../include/lfnfuncs.h\"\r\n\r\n#ifdef DEBUG\r\nstatic void devAttr(int fd)\r\n{ int attr;\r\n\r\n  if((attr = fdattr(fd)) == 0)\r\n\t{\r\n    dprintf((\"[Failed to read attributes of fd #%d]\\n\", fd));\r\n\t}\r\n  else {\r\n    dbg_print(\"[fd #%d is\", fd);\r\n    if(attr & 0x80) {\r\n      if(attr & 7) {\r\n        if(attr & 1) dbg_outs(\" STDIN\");\r\n        if(attr & 2) dbg_outs(\" STDOUT\");\r\n        if(attr & 4) dbg_outs(\" NUL\");\r\n      } else dbg_outs(\" a device\");\r\n    } else dbg_outs(\" a file\");\r\n    dbg_outsn(\"]\");\r\n  }\r\n}\r\n#endif\r\n\r\nint cmd_ctty(char *param)\r\n{ int f, attr, failed;\r\n\r\n  if(!param || !*param) {\r\n    displayString(TEXT_CMDHELP_CTTY);\r\n    return 1;\r\n  }\r\n\r\n#ifdef DEBUG\r\n  devAttr(0);\r\n  devAttr(1);\r\n  devAttr(2);\r\n#endif\r\n\r\n  if((f = devopen(param, O_RDWR)) < 0) {\r\n    error_no_rw_device(param);\r\n    return 1;\r\n  }\r\n\r\n  if(((attr = fdattr(f)) & 0x80) == 0\r\n   || dos_write(f, \"\\r\\n\", 2) != 2) {\t\t/* need \\r as in bin mode */\r\n    dos_close(f);\r\n    error_no_rw_device(param);\r\n    return 1;\r\n  }\r\n\r\n\t/* Now inform the system that this device is the new console\r\n\t\tnow; STDIN and STDOUT flag are the most lowest two bits  */\r\n\tfdsetattr(f, (attr & 0xFF) | 0x03);\r\n\r\n  /* Now change the file descriptors:\r\n    0 := rdonly\r\n    1,2 := wronly\r\n\r\n    if CTTY is called within a pipe or its I/O is redirected,\r\n    oldinfd or oldoutfd is not equal to -1. In such case the\r\n    old*fd is modified in order to effect the file descriptor\r\n    after the redirections are restored. Otherwise a pipe or\r\n    redirection would left CTTY in a half-made status.\r\n  */\r\n  failed = dup2(f, 2);   /* no redirection support */\r\n  if(oldinfd != -1)\r\n  \tdos_close(oldinfd);\r\n  oldinfd = f;\r\n  if(oldoutfd != -1)\r\n  \tdos_close(oldoutfd);\r\n  if((oldoutfd = dup(f)) == -1)\r\n  \tfailed = 1;\r\n\r\n  if(failed)\r\n    error_ctty_dup(param);\r\n  else {\r\n    setCurrentConDev(param);\r\n    /* workaround: do not use enhanced input if switched device is\r\n                   not standard 'CON' */\r\n    set_readcommandType( (attr & 0x9f) == 0x93 );\r\n  }\r\n\r\n  return failed;\r\n}\r\n"
  },
  {
    "path": "cmd/date.c",
    "content": "/* $Id$\r\n *  DATE.C - date internal command\r\n *\r\n *  Comments:\r\n *\r\n *  08 Jul 1998 (John P. Price)\r\n *    started.\r\n *\r\n *  20 Jul 1998 (John P. Price)\r\n *  - corrected number of days for December from 30 to 31.\r\n *    (Thanx to Steffen Kaiser for bug report)\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 29-Jul-1998 (Rob Lake)\r\n * - fixed stand-alone mode.  Added Pacific C compatible dos_getdate functions\r\n *\r\n * 1999/03/17 ska\r\n * bugfix: detection for invalid date strings.\r\n *  Now the whole string must match: ^\\s*\\d+(.(\\d+(.\\d*)?)?)?\\s*$\r\n *  The numbers can be delimited by any character from the 7-bit ASCII set,\r\n *  which is printable, but not alphanumerical.\r\n *  One need not specify all three parts (in which case the delimiter\r\n *  may be omitted, too). If one specify;\r\n *    1 number --> only the day changes\r\n *    2 numbers --> month/day; year remains unchanged\r\n *    3 numbers --> month/day/year\r\n *\r\n * 2001/02/08 ska\r\n * chg: two-digit year -> 2000 if less than 80\r\n * add: DATE /D and TIME /T\r\n *\r\n * 2001/02/14 ska\r\n * fix: years in range 80..199 are promoted to century 1900\r\n *\t\tallows to parse dates created with year100 bug (by Arkady)\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <dos.h>\r\n#include <io.h>\r\n#include <stdlib.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/nls.h\"\r\n#include \"../strings.h\"\r\n\r\n\r\nstatic int noPrompt = 0;\r\n\r\noptScanFct(opt_date)\r\n{\r\n  (void)arg;\r\n  switch(ch) {\r\n  case 'D':\r\n  case 'T': return optScanBool(noPrompt);\r\n  }\r\n  optErr();\r\n  return E_Useage;\r\n}\r\n\r\n\r\nstatic int my_setdate(const char *s)\r\n{\tstruct dosdate_t d;\r\n\r\n\tswitch(parsedate(s, &d)) {\r\n\tcase E_None:\t\t/* success -> set the date */\r\n\t\t_dos_setdate(&d);\r\n\t\t_dos_setdate(&d);\t\t/* In WinNT the date is often one day +/- */\r\n\t\t/* fall through */\r\n\tcase E_Empty:\t\t/* empty line */\r\n\t\treturn 1;\t\t/* success */\r\n\t}\r\n\r\n\treturn 0;\t\t\t/* failure */\r\n}\r\n\r\nint cmd_date(char *param)\r\n{\r\n\tchar s[40];\r\n\tint ec;\r\n\r\n\tnoPrompt = 0;\r\n\r\n#ifdef FEATURE_NLS\r\n\trefreshNLS();\r\n#endif\r\n\r\n\tif((ec = leadOptions(&param, opt_date, 0)) != E_None)\r\n\t\treturn ec;\r\n\r\n\tif (!*param) {\r\n\t\tchar *date;\r\n\r\n\t\tif((date = curDateLong()) == 0)\r\n\t\t\treturn 1;\t\t/* out of mem */\r\n\r\n\t\tdisplayString(TEXT_MSG_CURRENT_DATE, date);\r\n\t\tfree(date);\r\n\r\n\t\tparam = 0;\r\n\t}\r\n\r\n\twhile(1)  {                    /*forever loop */\r\n\t\tif (!param) {\r\n\t\t\tint len;\r\n\t\t\tif(noPrompt) return 0;\r\n\r\n\t\t\tdisplayString(TEXT_MSG_ENTER_DATE_AMERICAN\r\n#ifdef FEATURE_NLS\r\n\t\t\t + nlsBuf->datefmt, nlsBuf->dateSep, nlsBuf->dateSep\r\n#else\r\n\t\t\t , \"-\", \"-\"\r\n#endif\r\n\t\t\t);\r\n\t\t\tlen = dos_read(0, s, sizeof(s) - 1);\r\n\t\t\tif(cbreak || len < 0)\r\n\t\t\t\treturn 1;\r\n\t\t\ts[len] = '\\0';\r\n\t\t\tparam = s;\r\n\t\t}\r\n\r\n\t\tif(my_setdate(param))\r\n\t\t\tbreak;\r\n\t\t\r\n\t\terror_invalid_date();\r\n\t\t/* force input the next time around. */\r\n\t\tparam = 0;\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/del.c",
    "content": "/* $Id$\r\n *  DEL.C - del command.\r\n *\r\n *  Comments:\r\n *\r\n *  06/29/98 (Rob Lake rlake@cs.mun.ca)\r\n *      rewrote del to support wildcards\r\n *      added my name to the contributors\r\n *\r\n * 07/13/98 (Rob Lake)\r\n *  - fixed bug that caused del not to delete file with out attribute.\r\n *  - moved set, del, ren, and ver to there own files\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 09-Aug-1998 (Rob Lake <rlake@cs.mun.ca>)\r\n * - changed check for ^C\r\n * - alloced mem for char **arg\r\n *\r\n * 10-Aug-1998 ska\r\n * - fixed allocation of char **arg incl. out-of-memory check\r\n *\r\n * 1998/12/04 ska\r\n * - chg: vcgetchar() displays a space rather beep()s for no-printable\r\n *  characters. the caller can beep()\r\n * - chg: moved vcgetchar() to misc.c as it is multiply used now\r\n * - chg: use vcgetcstr() instead of vcgetchar() loop\r\n *\r\n * 1999/04/27 ska\r\n * chg: uniform command line parser\r\n * add: allow multiple patterns on command line\r\n * add: delete count\r\n *\r\n * 1999/07/02 ska\r\n * chg: replaced stat() by dfnstat() [reduces size of image]\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <io.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"suppl.h\"\r\n#include \"dfn.h\"\r\n\r\n#include \"../include/lfnfuncs.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#ifdef FEATURE_LONG_FILENAMES\r\n#define abspath( x, y ) abspath( getshortfilename( x ), y )\r\n#endif\r\n\r\nstatic int optP, verbose;\r\n\r\noptScanFct(opt_del)\r\n{\r\n  (void)arg;\r\n  switch(ch) {\r\n  case 'P': return optScanBool(optP);\r\n  case 'V': return optScanBool(verbose);\r\n  }\r\n  optErr();\r\n  return E_Useage;\r\n}\r\n\r\nint cmd_del(char *param)\r\n{\r\n\tint ec = E_None;    /* exit code */\r\n\tint i;\r\n\tunsigned count = 0;\r\n\r\n\tstruct dos_ffblk f;\r\n\r\n\t/* Make fullname somewhat larger to ensure that appending\r\n\t\ta matched name, one backslash and one hope. */\r\n\tchar fullname[MAXPATH + sizeof(f.ff_name) + 2],\r\n\t*p, *q;\r\n\tint len;\r\n\r\n\tchar **arg;\r\n\tint argc, optc;\r\n\r\n\t/* initialize options */\r\n\tverbose = optP = 0;\r\n\r\n\tif((arg = scanCmdline(param, opt_del, 0, &argc, &optc)) == 0)\r\n\t\treturn E_Other;\r\n\r\n\tif(!argc) {\r\n\t\terror_req_param_missing();\r\n\t\tec = E_Useage;\r\n\t} else {\r\n\t\ti = 0;\r\n\t\tdo {\r\n\t\t\tassert(arg[i]);\r\n\r\n\t\t/* Get the pattern fully-qualified */\r\n\t\t\t/* Note: An absolute path always contains:\r\n\t\t\t\tA:\\\\\r\n\t\t\t\t--> It's always three bytes long at minimum\r\n\t\t\t\tand always contains a backslash */\r\n\t\t\tp = abspath(arg[i], 1);\r\n\t\t\tif(!p)\r\n\t\t\t\treturn E_Other;\r\n\t\t\tassert(strlen(p) >= 3);\r\n\r\n\t\t\tif((len = strlen(p)) >= MAXPATH) {\r\n\t\t\t\terror_filename_too_long(p);\r\n\t\t\t\tfree(p);\r\n\t\t\t\tec = E_Other;\r\n\t\t\t\tgoto errRet;\r\n\t\t\t}\r\n\t\t\tstrcpy(fullname, p);  /* Operating over a local buffer simplifies\r\n\t\t\t\t\t the process; rather than keep the pattern\r\n\t\t\t\t\t within dynamic memory */\r\n\t\t\tfree(p);\r\n\t\t\tp = fullname + len;\r\n\r\n\t\t\t/* check if it is a directory */\r\n\t\t\tif(dfnstat(fullname) & DFN_DIRECTORY) {\r\n\t\t\t\tif (p[-1] != '\\\\')\r\n\t\t\t\t\t*p++ = '\\\\';\r\n\t\t\t}\r\n\r\n\t\t\tif(p[-1] == '\\\\')    /* delete a whole directory */\r\n\t\t\t\tp = stpcpy(p, \"*.*\");\r\n\r\n\t\t\t/* p := address to copy the filename to to form the fully-qualified\r\n\t\t\t\tfilename */\r\n\t\t\t/* There is at least one backslash within fullname,\r\n\t\t\t\tbecause of dfnexpand() */\r\n\t\t\twhile(*--p != '\\\\') ;\r\n\t\t\t++p;\r\n\r\n\t\t\t/* make sure user is sure if all files are to be\r\n\t\t\t * deleted */\r\n            /*\r\n             * Also make sure to find the LAST '.', as long filenames\r\n             * are allowed to contain several\r\n             */\r\n\t\t\tif(!optP && *p == '*'\r\n\t\t\t && ((q = strrchr(p, '.')) == 0 || q[1] == '*')) {\r\n\t\t\t\tint r;\r\n\t\t\t\t\r\n\t\t\t\tp[-1] = 0;\r\n\t\t\t\tr = userprompt(PROMPT_DELETE_ALL, fullname);\r\n\t\t\t\tp[-1] = '\\\\';\r\n\t\t\t\t\r\n\t\t\t\tif (r != 1) {\r\n\t\t\t\t\tec = E_Other;\r\n\t\t\t\t\tgoto errRet;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (dos_findfirst(fullname, &f, FA_ARCH)) {\r\n\t\t\t\terror_sfile_not_found(fullname);\r\n\t\t\t} else do {\r\n\t\t\t\tstrcpy(p, f.ff_name);       /* Make the full path */\r\n\r\n\t\t\t\tif(optP) {\r\n\t\t\t\t\tswitch(userprompt(PROMPT_DELETE_FILE, fullname)) {\r\n\t\t\t\t\tcase 4:             /* Quit/^Break pressed */\r\n\t\t\t\t\t\tec = E_CBreak;\r\n\t\t\t\t\t\tgoto errRet;\r\n\t\t\t\t\tcase 3:\t\t\t\t/* all */\r\n\t\t\t\t\t\toptP = 0;\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tbreak;                /* yes, delete */\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tcontinue;             /* no, don't delete */\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if(cbreak) {  /* is also probed for in vcgetstr() */\r\n\t\t\t\t\tec = E_CBreak;\r\n\t\t\t\t\tgoto errRet;\r\n\t\t\t\t}\r\n\r\n#ifdef NODEL\r\n\t\t\t\t/* define NODEL if you want to debug */\r\n\t\t\t\tputs(fullname);\r\n#else\r\n\t\t\t\tif(verbose && !optP)\r\n\t\t\t\t\tdisplayString(TEXT_DELETE_FILE, fullname);\r\n\t\t\t\tif(unlink(fullname) != 0) {\r\n\t\t\t\t\tmyperror(fullname);   /* notify the user */\r\n\t\t\t\t} else\r\n\t\t\t\t\t++count;\r\n#endif\r\n\r\n\t\t\t} while (dos_findnext(&f) == 0);\r\n\t\t} while(++i < argc && *arg[i]);/* arg[i] can be NULL with LFNS?? */\r\n\t}\r\n\r\nerrRet:\r\n    dos_findclose(&f);\r\n\r\n\tif(echo)\r\n\t\tdispCount(count, TEXT_MSG_DEL_CNT_FILES);\r\n\r\n\tfreep(arg);\r\n\treturn ec;\r\n}\r\n"
  },
  {
    "path": "cmd/depend.mk",
    "content": "cmd .SEQUENTIAL : utils err_fcts.h strings context lib cmd_dir\r\n\r\ncmd_dir .SETDIR=cmd :\r\n\t@echo Entering $(PWD)\r\n\t$(RUNMAKE) all\r\n\t@echo Leaving $(PWD)\r\n\r\nCLEAN_DEPENDENCIES += cmd_clean\r\ncmd_clean .SETDIR=cmd :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) clean\r\n\t@echo Leaving  $(PWD)\r\n\r\nCLOBBER_DEPENDENCIES += cmd_clobber\r\ncmd_clobber .SETDIR=cmd :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) clobber\r\n\t@echo Leaving  $(PWD)\r\n\r\nDIST_DEPENDENCIES += cmd_dist\r\ncmd_dist .SETDIR=cmd :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) dist\r\n\t@echo Leaving  $(PWD)\r\n"
  },
  {
    "path": "cmd/dir.c",
    "content": "/* $Id$\r\n *  DIR.C - dir internal command\r\n *\r\n *  Comments:\r\n *\r\n *  01/29/97 (Tim Norman)\r\n *    started.\r\n *\r\n *  06/13/97 (Tim Norman)\r\n *    Fixed code.\r\n *\r\n *  07/12/97 (Tim Norman)\r\n *    Fixed bug that caused the root directory to be unlistable\r\n *\r\n *  07/12/97 (Marc Desrochers)\r\n *    Changed to use maxx, maxy instead of findxy()\r\n *\r\n *  06/08/98 (Rob Lake)\r\n *    Added compatibility for /w in dir\r\n *\r\n * Compatibility for dir/s started 06/09/98 -- Rob Lake\r\n * 06/09/98 (Rob Lake)\r\n * -Tested that program finds directories off root fine\r\n *\r\n *\r\n * 06/10/98 (Rob Lake)\r\n *      -do_recurse saves the cwd and also stores it in Root\r\n *      -build_tree adds the cwd to the beginning of\r\n *   its' entries\r\n *      -Program runs fine, added print_tree -- works fine.. as EXE,\r\n *   program won't work properly as COM.\r\n *\r\n * 06/11/98 (Rob Lake)\r\n * -Found problem that caused COM not to work\r\n *\r\n * 06/12/98 (Rob Lake)\r\n *      -debugged...\r\n *      -added free mem routine\r\n *\r\n * 06/13/98 (Rob Lake)\r\n *      -debugged the free mem routine\r\n *      -debugged whole thing some more\r\n *      Notes:\r\n *      -ReadDir stores Root name and _Read_Dir does the hard work\r\n *      -PrintDir prints Root and _Print_Dir does the hard work\r\n *      -KillDir kills Root _after_ _Kill_Dir does the hard work\r\n *      -Integrated program into DIR.C(this file) and made some same\r\n *       changes throughout\r\n *\r\n * 06/14/98 (Rob Lake)\r\n *      -Cleaned up code a bit, added comments\r\n *\r\n * 06/16/98 (Rob Lake)\r\n * - Added error checking to my previously added routines\r\n *\r\n * 06/17/98 (Rob Lake)\r\n *      - Rewrote recursive functions, again! Most other recursive\r\n *      functions are now obsolete -- ReadDir, PrintDir, _Print_Dir,\r\n *      KillDir and _Kill_Dir.  do_recurse does what PrintDir did\r\n *      and _Read_Dir did what it did before along with what _Print_Dir\r\n *      did.  Makes /s a lot faster!\r\n *  - Reports 2 more files/dirs that DOS actually reports\r\n *      when used in root directory(is this because dir defaults\r\n *      to look for read only files?)\r\n *      - Added support for /b, /a and /l\r\n *      - Made error message similar to DOS error messages\r\n * - Added help screen\r\n *\r\n * 06/20/98 (Rob Lake)\r\n * - Added check for /-(switch) to turn off previously defined\r\n * switches\r\n * - Added ability to check for DIRCMD in environment and\r\n * process it\r\n *\r\n * 06/21/98 (Rob Lake)\r\n * - Fixed up /B\r\n * - Now can dir *.ext/X, no spaces!\r\n *\r\n * 06/29/98 (Rob Lake)\r\n *      - error message now found in command.h\r\n *\r\n * 07/08/1998 (John P. Price)\r\n * - removed extra returns; closer to MSDOS\r\n * - fixed wide display so that an extra return is not displayed when\r\n *   there is five filenames in the last line.\r\n *\r\n * 07/12/98 (Rob Lake)\r\n * - Changed error messages\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 09-Aug-1998 (Rob Lake <rlake@cs.mun.ca>)\r\n * - fixed bug that caused blank lines to be printed\r\n * - renamed _Read_Dir to Read_Dir\r\n *\r\n * 10-Aug-1998 ska\r\n * - added checks for ^break\r\n *\r\n * 03-Dec-1998 John P Price\r\n * - Rewrote DIR command.  fixed problem with \"DIR .COM\" and other bugs\r\n *   Recursive switch does not work now, but it will be added soon.\r\n *\r\n * 31-Jan-1999 (John P. Price)\r\n * - Changed dir_print_header to use function INT21,AH=69 instead of the\r\n *   function it was using.  I'm not sure if this will fix anything or not.\r\n *   Also fixed bug with changing and restoring the current drive.\r\n *\r\n * 1999/04/23 ska\r\n * bugfix: cmd_dir(): dircmd can be NULL\r\n *\r\n * 25-Apr-1999 (John P. Price)\r\n * - changed dir so it always shows the bytes free.\r\n *\r\n * 29-Apr-1999 (John P. Price)\r\n * - Changed so that \"dir command\" with no extension will do as\r\n *   \"dir command.*\" (as it should).  Also made the display of the directory\r\n *   not include the whole filespec, but only the directory\r\n *\r\n * 2000/01/05 ska (Reported by Jeremy Greiner 2000/01/03)\r\n * bugfix: Last modification time displays year 2000 as 100\r\n *    --> Should be revised to allow 4-digit year\r\n *    Note: This fix differs from Jeremy Greiner's by that it does\r\n *    still display a 2-digit year rather than a 4-digit one.\r\n *    A four-digit year would break all batch files scanning the\r\n *    output of DIR.\r\n *\r\n * 2000/07/07 Ron Cemer\r\n * Added code to detect a pattern of \".\" or \"\" and convert to \".\\*.*\",\r\n * to prevent \"file not found\" errors from command.com when executed\r\n * from the root of drive C: and \"DIR\" is typed without any arguments,\r\n * or if you type \"DIR C:\" and the current directory on drive C: is \\.\r\n * Also added code to convert \\.\\ in paths to \\ (eliminate the .\\ when\r\n * not needed).  Hopefully this will help to bypass any findfirst/findnext\r\n * bugs which may exist in the kernel.\r\n *\r\n * 2000/07/16 Ron Cemer\r\n * Fixed \"DIR ..\" or \"DIR C:\\FREEDOS\\COM079\\..\".\r\n * Fixed \"DIR /S\".\r\n * No longer reallocate the \"path\" variable in dir_list().  This would break\r\n * \"DIR /S\" because dir_list() is recursive and simply tacks on additional\r\n * subdirectories to the end of the \"path\" variable.  So the \"path\" variable\r\n * must NOT be moving around in memory, so I pre-allocate it to 270 characters\r\n * to allow plenty of room to tack on subdirectories while recursing.\r\n * Changed formatting to exactly match DOS's formatting as much as possible,\r\n * except that the \"bytes free\" count is still printed in bytes instead of\r\n * KB or MB.\r\n *\r\n * 2001/02/16 ska\r\n * chg: using STRINGS resource\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <conio.h>\r\n#include <ctype.h>\r\n#include <dos.h>\r\n#ifndef FA_DEVICE\r\n#define FA_DEVICE 0x0040u\r\n#endif\r\n#include <io.h>\r\n#include <fcntl.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#include <sys/stat.h>\r\n#include <sys/types.h>\r\n\r\n#include <portable.h>\r\n\r\n/* Not available with TURBOC++ 1.0 or earlier: */\r\n#if defined __GNUC__\r\n#define pause cmdpause\r\n#elif ( (!defined(__WATCOMC__) && !defined(__TURBOC__)) || (__TURBOC__ > 0x297) )\r\n#include <dirent.h>\r\n#endif\r\n\r\n#include \"dfn.h\"\r\n\r\n#define __LFNFUNCS_C\r\n#include \"../include/lfnfuncs.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/nls.h\"\r\n#include \"../strings.h\"\r\n\r\n/* useful macros */\r\n#define MEM_ERR error_out_of_memory(); return 1;\r\n\r\n#define WIDE_COLUMNS 5\r\n\t/* FINDFIRST() file mask used if no /A has been given */\r\n#define ATTR_DEFAULT FA_RDONLY | FA_ARCH | FA_DIREC\r\n\t/* FINDFIRST() file mask used if /A (no args) has been given */\r\n#define ATTR_ALL FA_RDONLY | FA_ARCH | FA_DIREC | FA_HIDDEN | FA_SYSTEM;\r\n\r\n/* Definitions for optO */\r\n#define ORDER_BY_SIZE 2\r\n#define ORDER_BY_DATE 4\r\n#define ORDER_BY_NAME 8\r\n#define ORDER_BY_EXT  0x10\r\n#define ORDER_INVERSE 0x01\r\n#define ORDER_DIRS_FIRST 0x20\r\n#define ORDER_DIRS_LAST 0x40\r\n#define ORDER_BY_MASK 0x1e    \r\n#define DEFAULT_SORT_ORDER \"NG\"\r\n\r\nstatic unsigned char optOdir = 0;\r\nstatic char optOorderby[5]; /* Array: One byte longer than order methods,\r\n\t\t\t\t\t\t\tthe last unused orderby[] byte is zero\r\n\t\t\t\t\t\t\tby design always\r\n\t\t\t\t\t\t\t--> eases implementation, e.g. memcpy()\r\n\t\t\t\t\t\t\tin scanOrder() and for() loop in\r\n\t\t\t\t\t\t\torderFuntion() */\r\n\r\n\r\nstruct currDir {\r\n\tunsigned linecount; /* for /B */\r\n\t};          \r\n\t\r\nstatic int optS, optP, optW, optB, optL, longyear, optO;\r\n\r\n\r\n#ifdef FEATURE_LONG_FILENAMES\r\nstatic int dispLFN;\r\n#endif\r\n\r\n#ifdef FEATURE_DESCRIPT_ION\r\nstatic int descriptionExists;\r\nstatic int fDescription;\r\nstatic void showDescription(const char *shortName, char *ext);\r\n#endif\r\n\r\nstatic struct ffblk _seg *orderArray;\r\n\r\nstatic unsigned attrMay, attrMask, attrMatch;\r\n/* within/right after the parsing of the options:\r\n\t\twhat attributes \"may\" be on (but need not), which \"must\" be set\r\n\t\tand which \"must not\" be set.\r\n\tattrMay is just passed into FINDFIRST(),\r\n\tattrMask and attrMatch are aggregated so that\r\n\t\t<current attributes> & mask == match\r\n\tselects all valid files\r\n*/\r\n\r\n\r\nstatic char *path;\r\nstatic unsigned line;\r\nstatic int need_nl;\r\n\r\n/* FAT32: file sizes are less then unsigned long, but accumulated\r\n          directory sizes may be up to 2 TB\r\n\r\n   so here comes simple 'large integer' arithmetic with billions separate\r\n*/\r\n\r\ntypedef struct _bignum\r\n{\r\n  unsigned long low;\r\n  unsigned billions;\r\n} bignum;\r\n\r\nstatic void bignum_add(bignum *big, bignum *to_add)\r\n{\r\n  big->billions += to_add->billions;\r\n  big->low  += to_add->low;\r\n\r\n  if (big->low >= 1000000000ul) {\t/* carry propagation, school style */\r\n    big->low -= 1000000000ul;\r\n    big->billions++;\r\n  }\r\n}\r\n\r\n#ifdef FEATURE_LONG_FILENAMES\r\nstatic void printLFNname(char *shortName, char *ext)\r\n{\r\n    IREGS r;\r\n    char pathbuffer[128];\r\n\tchar longname[270];\r\n\tint pathlen;\r\n\r\n\t/* reconstruct the path+filename */\r\n\tpathlen = strrchr(path,'\\\\') - path;\r\n\r\n\tsprintf(pathbuffer,\"%*.*s\\\\%s%c%s\"\r\n\t , pathlen\r\n\t , pathlen\r\n\t , path\r\n\t , shortName\r\n\t , *ext ? '.' : 0x0\r\n\t , *ext ? ext : 0x0);\r\n\r\n    dprintf((\"[LFN: path %s\\n\",pathbuffer)); \r\n\t\r\n      /* LFN get canonical LFN */\r\n\tr.r_flags = 1;\t/* CY before 21.71 calls! */\r\n\tr.r_ax = 0x7160;\r\n\tr.r_cx = 0x8002;\r\n\tr.r_si = FP_OFF( pathbuffer );\r\n    r.r_ds = FP_SEG( pathbuffer );\r\n\tr.r_di = FP_OFF( longname );\r\n    r.r_es = FP_SEG( longname );\r\n\tintrpt(0x21, &r);\r\n\t\r\n    if( r.r_flags & 1 || r.r_ax == 0x7100 || !__supportlfns ) {\r\n        dprintf((\"[LFN: not supported %x]\\n\",r.r_ax)); \r\n\t\treturn;\r\n\t}\r\n\r\n    if(samefile(longname, \".\")) strcpy(longname, \"\\\\.\");\r\n\r\n    if(dfnstat(\"..\") != 0 && samefile(longname, \"..\")) strcpy(longname, \"\\\\..\");\r\n\t\r\n\tprintf(\" %.30s \", &strrchr(longname, '\\\\')[1]);\r\n}\r\n#endif\r\n\r\n\r\n#ifdef FEATURE_DESCRIPT_ION\r\nstatic int incline(void); /* forward reference */\r\n\r\n/* this will read in next non-blank line from fDescription,\r\n   and stores next token (ie filename or description).\r\n   returns 0 on any error or no more entries in file\r\n   *buf will equal '\\0' or successfully read in filename\r\n*/\r\nstatic int descGetNextToken(char *buf, int fn, int maxlen)\r\n{\r\n  /* skip blank lines and any initial spaces, also exit early on any read error */\r\n  do {\r\n    if (dos_read(fDescription, buf, 1) != 1)\r\n    {\r\n      /*printf(\"[read error]\\n\");*/\r\n      *buf = '\\0';\r\n      return 0;\r\n    }\r\n  } while ( (*buf == ' ') || (fn && isspace(*buf)) );\r\n\r\n  /* read in characters until end of line/file (or space) is found */\r\n  do {\r\n    if (maxlen > 1) /* reuse last char in buffer, but don't exceed maxlen */\r\n    {\r\n      maxlen--;\r\n      buf++;\r\n    }\r\n    if (dos_read(fDescription, buf, 1) != 1)\r\n      break;\r\n  } while ( (*buf!='\\r') && (*buf!='\\n') && \r\n            (*buf!=0x4/*Ctrl-D*/) && (*buf!=26/*Ctrl-Z*/) &&\r\n            (!fn || (fn && !isspace(*buf))) );\r\n\r\n  /* if read in description, then skip to end of line */\r\n  /* note: because we stop at \\r, next read may seem like blank line (\\n) */\r\n  if (!fn) \r\n    while ( (*buf!='\\r') && (*buf!='\\n') )\r\n    {\r\n      if (dos_read(fDescription, buf, 1) != 1)\r\n        break;\r\n    }\r\n\r\n  /* terminate filename read in */\r\n  *buf = '\\0';\r\n  return 1;\r\n}\r\n\r\n/* if a DESCRIPT.ION file was found (and opened) in current\r\n   directory, then sequentially (as it's unsorted) read through it\r\n   and print matching descriptions if found. Basic format are lines of\r\n   filename <whitespace> description text [Ctrl-D ...] <EOL (\\r,\\n,\\r\\n)>|<EOF>\r\n */\r\nstatic void showDescription(const char *shortName, char *ext)\r\n{\r\n  char fn[14], dummy[1], buf[128]; /* 4096 is max line size officially supported */\r\n  assert(fDescription != 0);\r\n\r\n  if (*shortName == '.') return; /* ignore . and .. entries */\r\n\r\n  sprintf(fn, \"%s%c%s\", shortName, (*ext)?'.':0x0, ext); /* fn is 8.3 filename[.extension] */\r\n  fn[13]='\\0';\r\n  lseek(fDescription, 0, SEEK_SET);  /* start at beginning of unsorted description file */\r\n  while (descGetNextToken(buf,1,sizeof(buf)) && (strcmpi(fn,buf) != 0)) \r\n    { descGetNextToken(dummy,0,sizeof(dummy)); /* skip rest of this line & try again */ }\r\n\r\n  if (*buf) /* found line in DESCRIPT.ION file matching this file */\r\n  {\r\n    descGetNextToken(buf,0,sizeof(buf));\r\n    /* loop displaying upto 34 characters of description at a time. */\r\n    #define DESCLEN 34\r\n    {\r\n      char *p = buf;\r\n      while (strlen(p) > DESCLEN) /* display in chunks */\r\n      {\r\n        char t;\r\n\r\n        /* start at end of chunk, try to split word at whitespace [or\r\n           any punctuation]; don't split if word too big.\r\n           i set to where '\\0' will be stored.\r\n         */\r\n        int i = DESCLEN+1;\r\n        while ((i>(DESCLEN/2)) && !isspace(*(p+i)) /*&& !ispunct(*(p+i))*/) i--;\r\n        if (i<=(DESCLEN/2)) i = DESCLEN+1;\r\n        else if (i<=DESCLEN) i++;\r\n\r\n        t = *(p+i);                   /* store character          */\r\n        *(p+i) = '\\0';                /* temp force end of string */\r\n        printf(\"\\n\");  incline();     /* handle dir /p            */\r\n        printf(\"%44c%s\", ' ', p);     /* display the substring    */\r\n        p += i;                       /* skip past portion shown  */\r\n        *p = t;                       /* restore saved character  */\r\n\r\n        while(isspace(*p)) p++;       /* skip past whitespace splitting words at line edge */\r\n      }\r\n      /* and print the final (or only) chunk of description */\r\n      printf(\"\\n\");  incline();       /* handle dir /p            */\r\n      printf(\"%44c%s\", ' ', p);\r\n      /* printf(\"\\n%44c%s\", ' ', (*buf)? buf : \"<empty description>\"); */\r\n    }\r\n  }\r\n  /* else printf(\"\\n%44c%s\", ' ', \"NO MATCH FOUND\"); */\r\n}\r\n#endif\r\n\r\n\r\n/* The DIR command accepts more than one /A options, the later ones\r\n\treplaces former ones */\r\nstatic int scanAttr(const char *p)\r\n{\tunsigned attr;\r\n\r\n\tattrMask = attrMatch = 0;\t/* purge previous /A*** */\r\n\tattrMay = ATTR_ALL;\r\n\r\n\tif(p && *p) {\r\n\t\tfor(--p;;) {\r\n\t\t\tswitch(toupper(*++p)) {\r\n\t\t\tcase 'R': attr = FA_RDONLY; break;\r\n\t\t\tcase 'A': attr = FA_ARCH; break;\r\n\t\t\tcase 'D': attr = FA_DIREC; break;\r\n\t\t\tcase 'H': attr = FA_HIDDEN; break;\r\n\t\t\tcase 'S': attr = FA_SYSTEM; break;\r\n\t\t\t/* case 'L': WinXP has this one too? */\r\n\t\t\t/* case '+': */ case '-': continue;\r\n\t\t\tcase '\\0': goto done;\r\n\t\t\tdefault:\t/* error */\r\n\t\t\t\terror_illformed_option(p);\r\n\t\t\t\treturn E_Useage;\r\n\t\t\t}\r\n\t\t\tswitch(p[-1]) {\r\n\t\t\tcase '-': /* disable */\tattrMatch &= ~attr; break;\r\n\t\t\tdefault: /* enable */\tattrMatch |= attr; break;\r\n\t\t\t/* case '+': / * anyway * / break; */\r\n\t\t\t}\r\n\t\t\tattrMask |= attr;\t/* \"mustNot\" is dropped later, must need to\r\n\t\t\t\t\t\t\t\t\tbe ORed later anyway */\r\n\t\t}\r\ndone:\r\n\t\t/* no need to fetch entries with disabled attributes */\r\n\t\tattrMay &= ~attrMask | attrMatch;\r\n\t}\r\n\t/* else  no specifying arguments --> display all */\r\n\r\n\treturn E_None;\r\n}\r\n    \r\n\r\n    \r\n    \r\nstatic int scanOrder(const char *p)\r\n{\r\n\tif(!p || !*p)\r\n\t\tp = DEFAULT_SORT_ORDER;\r\n\r\nrestart:\t\r\n\tmemset(optOorderby, 0, sizeof(optOorderby));\r\n\toptOdir = 0;\r\n\r\n\tif(p && *p) {\r\n\t\tfor(;;p++) {\r\n\t\t\tint inverse = p[-1] == '-';\r\n\t\t\tint option;\r\n\t\t\tint i;\r\n\t\t\t\r\n\t\t\tswitch(toupper(*p)) {\r\n\t\t\tcase '-': continue;\r\n\t\t\tcase 'S': option = ORDER_BY_SIZE; break;\r\n\t\t\tcase 'D': option = ORDER_BY_DATE; break;\r\n\t\t\tcase 'N': option = ORDER_BY_NAME; break;\r\n\t\t\tcase 'E': option = ORDER_BY_EXT; break;\r\n\t\t\tcase 'G': optOdir = inverse? ORDER_DIRS_LAST: ORDER_DIRS_FIRST;\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\tcase 'U': ++p; goto restart;\r\n\t\t\tcase '\\0': goto done;\r\n\t\t\tdefault:\t/* error */\r\n\t\t\t\terror_illformed_option(p);\r\n\t\t\t\treturn E_Useage;\r\n\t\t\t}\r\n\r\n\t\t\tfor(i = 0; i < sizeof(optOorderby); ++i) {\r\n\t\t\t\tif(optOorderby[i] == 0)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif((optOorderby[i] & ORDER_BY_MASK) == option) {\r\n\t\t\t\t\tmemcpy(optOorderby+i, optOorderby+i+1\r\n\t\t\t\t\t , (sizeof(optOorderby)-1-i)*sizeof(optOorderby[0]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\toptOorderby[i] = option | inverse;\r\n#ifdef DEBUG\r\n\t\t\twhile(++i < sizeof(sizeof(optOorderby))) {\r\n\t\t\t\tassert(!optOorderby[i]);\r\n\t\t\t}\r\n#endif\r\n\t\t}\r\ndone:;\r\n\t}\r\n\r\n\toptO = optOorderby[0] | optOdir;\r\n\treturn E_None;\r\n}\r\n\r\noptScanFct(opt_dir)\r\n{\r\n  (void)arg;\r\n  switch(ch) {\r\n  case 'S': return optScanBool(optS);\r\n  case 'P': return optScanBool2(optP);  /* multiple uses, /P /P, do not cancel, only /-P */\r\n  case 'W': return optScanBool(optW);\r\n  case 'B': return optScanBool(optB);\r\n  case 'O': if(!bool) return scanOrder(strarg);\r\n  \t\t\tbreak;\r\n  case 'A': if(!bool) return scanAttr(strarg);\r\n  \t\t\tbreak;\r\n  case 'L': return optScanBool(optL);\r\n  case '4':\r\n  case 'Y': return optScanBool(longyear);\r\n  case 0:\t/* Longname option, e.g. /A without argument sign */\r\n  \tswitch(*optstr) {\r\n  \tcase 'A': case 'a':\t\t/* /A*** */\r\n  \t\tif(!bool && !optHasArg())\r\n\t\t\treturn scanAttr(optstr + 1);\r\n\t\tbreak;\r\n  \tcase 'O': case 'o':\t\t/* /O*** */\r\n  \t\tif(!bool && !optHasArg())\r\n\t\t\treturn scanOrder(optstr + 1);\r\n\t\tbreak;\r\n#ifdef FEATURE_LONG_FILENAMES\r\n    case 'L': case 'l':\t\t/* enable to display LFNs? */\r\n      if(optLong(\"LFN\"))\r\n        return optScanBool(dispLFN);\r\n      break;\r\n#endif\r\n\t}\r\n  }\r\n  optErr();\r\n  return E_Useage;\r\n}\r\n\r\n/*\r\n * pause\r\n *\r\n * pause until a key is pressed\r\n */\r\nstatic int pause(void)\r\n{\r\n  cmd_pause(0);\r\n\r\n  return 0;\r\n}\r\n\r\n/*\r\n * incline\r\n *\r\n * increment our line if paginating, display message at end of screen\r\n */\r\nstatic int incline(void)\r\n{\r\n\r\n  if (!optP)\r\n    return E_None;\r\n\r\n  if (++line >= MAX_Y)\r\n  {\r\n    line = 0;\r\n    return pause();\r\n  }\r\n\r\n  return 0;\r\n}\r\n\r\nstatic int flush_nl(void)\r\n{ if(need_nl) {\r\n    outc('\\n');\r\n    return incline();\r\n  }\r\n\r\n  return E_None;\r\n}\r\n\r\n/*\r\n * dir_print_header\r\n *\r\n * print the header for the dir command\r\n */\r\nstatic int dir_print_header(int drive)\r\n{\r\n\r\n# include \"algnbyte.h\"\r\n\r\n  struct media_id\r\n  {\r\n    int info_level;\r\n    int serial1;\r\n    int serial2;\r\n    char vol_id[11];\r\n    char file_sys[8];\r\n  }\r\n  media;\r\n\r\n# include \"algndflt.h\"\r\n\r\n  struct ffblk f;\r\n  IREGS r;\r\n  int currDisk;\r\n  int rv;\r\n\r\n  if (cbreak)\r\n    return E_CBreak;\r\n\r\n  if (optB)\r\n    return 0;\r\n\r\n  currDisk = getdisk();\r\n  if(changeDrive(drive+1) != 0) {\r\n    setdisk(currDisk);\r\n    return 1;\r\n  }\r\n\r\n  /* get the media ID of the drive */\r\n/*\r\n   Format of disk info:\r\n   Offset  Size    Description     (Table 01766)\r\n   00h    WORD    0000h (info level)\r\n   02h    DWORD   disk serial number (binary)\r\n   06h 11 BYTEs   volume label or \"NO NAME    \" if none present\r\n   11h  8 BYTEs   (AL=00h only) filesystem type (see #01767)\r\n\r\n */\r\n\r\n  r.r_ax = 0x6900;\r\n  r.r_bx = drive + 1;\r\n  r.r_ds = FP_SEG(&media);\r\n  r.r_dx = FP_OFF(&media);\r\n  intrpt( 0x21, &r );\r\n\r\n  /* print drive info */\r\n \tdisplayString(TEXT_DIR_HDR_VOLUME, drive + 'A');\r\n\r\n\r\n  if (sfnfindfirst(\"\\\\*.*\", &f, FA_LABEL) == 0)\r\n  {\r\n        /* Added to remove \".\" from labels which are longer than\r\n           8 characters (as DOS does), but must pad name with spaces. */\r\n    char *dotptr = strchr(f.ff_name, '.');\r\n    if (dotptr != 0)\r\n    {\r\n      char *mptr = f.ff_name+8;\r\n      /* shift extension either back over dot or to end of space padding */\r\n      memmove(mptr, dotptr+1, 4);  /* 4=max 3 char ext + \\0 */\r\n      /* add spaces for padding / overwrite with spaces shifted extension */\r\n      while (dotptr < mptr)\r\n        *dotptr++ = ' ';  /* pad with space and increment */\r\n    }\r\n    displayString(TEXT_DIR_HDR_VOLUME_STRING, f.ff_name);\r\n  }\r\n  else\r\n  {\r\n    displayString(TEXT_DIR_HDR_VOLUME_NONE);\r\n  }\r\n\r\n  setdisk(currDisk);\r\n\r\n  if ((rv = incline()) == 0) {\r\n  /* print the volume serial number if the return was successful */\r\n      if (!( r.r_flags & 1 )) {\r\n\t\tdisplayString(TEXT_DIR_HDR_SERIAL_NUMBER\r\n\t\t , media.serial2, media.serial1);\r\n\t\trv = incline();\r\n\t  }\r\n  }\r\n\r\n        /* Added to exactly match DOS's formatting. */\r\n  if ( (optS) && (rv == 0) ) {\r\n      outc('\\n');\r\n      rv = incline();\r\n  }\r\n\r\n  return rv;\r\n}\r\n\r\n\r\n#ifdef INCLUDE_CMD_DIR\r\n/*\r\n * print_summary: prints dir summary\r\n */\r\nstatic int print_summary(unsigned long files\r\n  , bignum *bytes)\r\n{\r\n  char buffer[32];\r\n\r\n  if (optB)\r\n    return 0;\r\n\r\n  convert(files, 0, buffer);\r\n  displayString(TEXT_DIR_FTR_FILES, buffer);\r\n  convert(bytes->low, bytes->billions, buffer);\r\n  displayString(TEXT_DIR_FTR_BYTES, buffer);\r\n  need_nl = 1;\r\n  return incline();\r\n}\r\n\r\nstatic int print_total\r\n    (unsigned long files,\r\n     bignum *bytes)\r\n{ int rv;\r\n\r\n  if(optB)\r\n    return 0;\r\n\r\n  rv = flush_nl();\r\n  if(rv == E_None) {\r\n    displayString(TEXT_DIR_FTR_TOTAL_NUMBER);\r\n    if((rv = incline()) == E_None)\r\n      return print_summary(files, bytes);\r\n  }\r\n\r\n  return rv;\r\n}\r\n\r\nstatic int dir_print_free(unsigned long dirs)\r\n{\r\n  char buffer[32];\r\n  IREGS r;\r\n  struct {\r\n  \tunsigned short whatever;\r\n  \tunsigned short version;\r\n  \tunsigned long  sectors_per_cluster; \r\n  \tunsigned long  bytes_per_sector;\r\n  \tunsigned long  free_clusters;\r\n  \tunsigned long  total_clusters;\r\n  \tunsigned long  available_physical_sectors;\r\n  \tunsigned long  total_physical_sectors;\r\n  \tunsigned long  free_allocation_units; \r\n  \tunsigned long  total_allocation_units; \r\n  \tunsigned char  reserved[8];\r\n  \t} FAT32_Free_Space;\r\n  static char rootname[] = \"C:\\\\\";\t\r\n  unsigned long clustersize;\r\n\r\n  if(optB)\r\n    return 0;\r\n\r\n  /* print number of dirs and bytes free */\r\n\r\n  convert(dirs, 0, buffer);\r\n  displayString(TEXT_DIR_FTR_DIRS, buffer);\r\n\r\n  rootname[0] = toupper(*path);\r\n  r.r_flags = 1;\t/* CY before 21.73 calls! */\r\n  r.r_ax = 0x7303;\r\n  r.r_ds = FP_SEG(rootname);\r\n  r.r_dx = FP_OFF(rootname);\r\n  r.r_es = FP_SEG(&FAT32_Free_Space);\r\n  r.r_di = FP_OFF(&FAT32_Free_Space);\r\n  r.r_cx = sizeof(FAT32_Free_Space);\r\n  intrpt( 0x21, &r);\r\n\r\n  /* Note: RBIL carry clear and al==0 also means unimplemented \r\n     alternately carry set and ax==undefined (usually unchanged) for unimplemented\r\n     ecm: RBIL is wrong, CF unchanged al=0 is the typical error return.\r\n     EDR-DOS returns NC ax=0 so checking for al!=0 here was wrong.\r\n  */\r\n  if(!( r.r_flags & 1 ) && ( r.r_ax != 0x7300 ) ) {\r\n\tdprintf((\"[DIR: Using FAT32 info]\\n\"));\r\n\tclustersize = FAT32_Free_Space.sectors_per_cluster\r\n\t * FAT32_Free_Space.bytes_per_sector;\r\n\r\n       /* The following loop is intended to handle large free space amounts\r\n          and huge [fake] cluster sizes, such as NTFS4DOS driver on large HDs.\r\n       */\r\n       if (clustersize)\r\n          if (FAT32_Free_Space.free_clusters >= 0x80000000ul / clustersize)\r\n                {\r\n                int shift;\r\n                \r\n                for (shift = 21; --shift;)\r\n                        {\r\n                        if ((clustersize & 1) == 0) clustersize >>= 1;\r\n                        else                        FAT32_Free_Space.free_clusters >>= 1;\r\n                        }\r\n                \r\n                convert(FAT32_Free_Space.free_clusters * clustersize, 0, buffer);\r\n\r\n                strcat(buffer, \" Mega\");\r\n                goto output;\r\n                }\r\n  }  \r\n  r.r_ax = 0x3600;\r\n  r.r_dx = toupper(*path) - 'A' + 1;\r\n  intrpt(0x21, &r);\r\n  convert((unsigned long)r.r_ax * r.r_bx * r.r_cx, 0, buffer);\r\noutput:\r\n  displayString(TEXT_DIR_FTR_BYTES_FREE, buffer);\r\n\r\n  return incline();\r\n}\r\n\r\nstatic int DisplaySingleDirEntry(struct ffblk *file, struct currDir *cDir)\r\n{\r\n   int rv = E_None;\r\n\r\n    if (cbreak)\r\n      return E_CBreak;\r\n\r\n    if (optL)\r\n      strlwr(file->ff_name);\r\n\r\n    if (optW)\r\n    {\r\n      char buffer[sizeof(file->ff_name) + 3];\r\n\r\n      if (file->ff_attrib & FA_DIREC)\r\n      {\r\n        sprintf(buffer, \"[%s]\", file->ff_name);\r\n      }\r\n      else\r\n      {\r\n        strcpy(buffer, file->ff_name);\r\n      }\r\n      displayString(TEXT_DIR_LINE_FILENAME_WIDE, buffer);\r\n      if (++cDir->linecount == WIDE_COLUMNS)\r\n      {\r\n        /* outputted 5 columns */\r\n        outc('\\n');\r\n        rv = incline();\r\n        cDir->linecount = 0;\r\n      }\r\n    }\r\n    else if (optB)\r\n    {\r\n      if (strcmp(file->ff_name, \".\") == 0 || strcmp(file->ff_name, \"..\") == 0)\r\n        return E_None;\r\n      if (optS)\r\n        outs(path);\r\n      displayString(TEXT_DIR_LINE_FILENAME_BARE, file->ff_name);\r\n      rv = incline();\r\n    }\r\n    else\r\n    {\r\n      char buffer[sizeof(long) * 4 + 2], *ext = \"\";\r\n\r\n      if (file->ff_name[0] == '.')\r\n        displayString(TEXT_DIR_LINE_FILENAME_SINGLE, file->ff_name);\r\n      else\r\n      {\r\n        ext = strrchr(file->ff_name, '.');\r\n        if (!ext)\r\n          ext = \"\";\r\n        else\r\n          *ext++ = '\\0';\r\n\r\n        displayString(TEXT_DIR_LINE_FILENAME, file->ff_name, ext);\r\n      }\r\n\r\n      if (file->ff_attrib & FA_DIREC)\r\n      {\r\n        displayString(TEXT_DIR_LINE_SIZE_DIR);\r\n      }\r\n      else\r\n      {\r\n        convert(file->ff_fsize, 0, buffer);\r\n        displayString(TEXT_DIR_LINE_SIZE, buffer);\r\n      }\r\n\r\n\t{ char *p;\r\n\t\tint year, month, day;\r\n\t\tint hour, minute;\r\n\r\n\t\tyear = (file->ff_fdate >> 9) + 80;\r\n\t\tif(longyear)\r\n\t\t\tyear += 1900;\r\n\t\telse\tyear %= 100;\r\n\t\tday = file->ff_fdate & 0x001f;\r\n\t\tmonth = (file->ff_fdate >> 5) & 0x000f;\r\n\t\thour = file->ff_ftime >> 5 >> 6;\r\n\t\tminute = (file->ff_ftime >> 5) & 0x003f;\r\n\r\n\t\tp = nls_makedate(0, year, month, day);\r\n\t\tif(!p) {\r\n\t\t\terror_out_of_memory();\r\n\t\t\treturn E_NoMem;\r\n\t\t}\r\n        outc(' ');\r\n\t\touts(p);\r\n\t\tfree(p);\r\n\t\tp = nls_maketime(NLS_MAKE_SHORT_AMPM, hour, minute, -1, 0);\r\n\t\tif(!p) {\r\n\t\t\terror_out_of_memory();\r\n\t\t\treturn E_NoMem;\r\n\t\t}\r\n        outc(' ');\r\n\t\touts(p);\r\n\t\tfree(p);\r\n\t\t#ifdef FEATURE_LONG_FILENAMES\r\n            if( dispLFN )\r\n\t\t\t\tprintLFNname(file->ff_name, ext);\r\n\t\t#endif\r\n\t\t#ifdef FEATURE_DESCRIPT_ION\r\n\t\t\tif (descriptionExists)\r\n\t\t\t\tshowDescription(file->ff_name, ext);\r\n\t\t#endif\r\n        outc('\\n');\r\n\t }\r\n\r\n      rv = incline();\r\n   }\r\n   return cbreak? E_CBreak: rv;\r\n}\r\n\r\n/* return -1,0,1 where -1 if p1 is before p2, 0 if same, 1 if p2 is before p1 */\r\nstatic int orderFunction(const void *p1, const void *p2)\r\n{\r\n  int i1 = *(int*)p1;\r\n  int i2 = *(int*)p2;\r\n  int rv = 0;\r\n  int i;\r\n\r\n  struct ffblk f1, f2;\r\n\r\n  _fmemcpy(&f1, orderArray + i1 , sizeof(f1));\r\n  _fmemcpy(&f2, orderArray + i2 , sizeof(f2));\r\n  \r\n  if(optOdir && (f1.ff_attrib & FA_DIREC) != (f2.ff_attrib & FA_DIREC))\r\n  \treturn (optOdir & ORDER_DIRS_FIRST ? f1.ff_attrib: f2.ff_attrib)\r\n  \t         & FA_DIREC ? -1 : 1;  \r\n  \t         \r\n  \r\n  for (i = 0; rv == 0; i++) {\r\n  \tint opt = optOorderby[i];\r\n  \tassert(i < sizeof(optOorderby));\r\n  \t\r\n\tswitch(opt & ORDER_BY_MASK) {\r\n\t\r\n\t  case 0:\r\n\t  \treturn rv;\t\t\t/* is 0 actually */\r\n\t\r\n\t  case ORDER_BY_SIZE:\r\n\t\tif(f1.ff_fsize > f2.ff_fsize) rv = 1;\r\n\t\telse if(f1.ff_fsize < f2.ff_fsize) rv = -1;\r\n\t\tbreak;\r\n\t\r\n\t  case ORDER_BY_DATE:\r\n\t    rv = f1.ff_fdate - f2.ff_fdate;\r\n\t    if(!rv)\r\n\t    \t rv = f1.ff_ftime - f2.ff_ftime;\r\n\t\tbreak;\r\n\t\r\n\t  case ORDER_BY_EXT:\r\n\t\t{ char *x1 = strchr(f1.ff_name, '.');\r\n\t\tchar *x2 = strchr(f2.ff_name, '.');\r\n\t\t\r\n\t\t\r\n\t\tif(!x1 && !x2)\t/* both are equal */\r\n\t\t\tcontinue;\r\n\t\t\r\n\t\tif (x1 && x2) rv = strcmp(x1, x2);\r\n\t\telse if (!x1 && x2) rv = -1;\r\n\t\telse rv = 1;\t\t\t/* x1 && !x2 */\r\n\t    }\r\n\t    break;\r\n\t\t\r\n\t  case ORDER_BY_NAME:\r\n\t\trv = strcmp(f1.ff_name,f2.ff_name);\r\n\t\tbreak;\r\n\t}\r\n\tif (opt & ORDER_INVERSE) rv = - rv;\r\n  }  \r\n  \r\n  /* if criteria (size, date, etc) compare equal then return results lexically by filename */\r\n  if (rv == 0)\r\n\trv = strcmp(f1.ff_name,f2.ff_name);\r\n\r\n  return rv;\r\n}    \t\r\n\r\n\r\nstatic int flushOrder(struct ffblk _seg *orderArray,\r\n  \t\tint *orderIndex,\r\n  \t\tint  orderCount,\r\n\t\tstruct currDir *cDir)\r\n{\r\n  int i;\r\n  struct ffblk file;\r\n  \r\n  for (i = 0; i < orderCount; i++)\r\n  \torderIndex[i] = i;\r\n  \t\r\n  qsort(orderIndex, orderCount, sizeof(orderIndex[0]), orderFunction);\r\n\r\n  for (i = 0; i < orderCount; i++) {\r\n  \tint rv;\r\n    _fmemcpy(&file, &orderArray[orderIndex[i]], sizeof(file));\r\n    if((rv = DisplaySingleDirEntry(&file, cDir)) != E_None)\r\n    \treturn rv;\r\n  }\r\n  return E_None;  \r\n}  \t\t\r\n\r\n/*\r\n * dir_list\r\n *\r\n * list the files in the directory\r\n */\r\nstatic int dir_list(int pathlen\r\n  , char *pattern\r\n  , unsigned long *dcnt\r\n  , unsigned long *fcnt\r\n  , bignum *bcnt\r\n  )\r\n{\r\n  struct ffblk file;\r\n  bignum bytecount = {0};\r\n  unsigned long filecount = 0;\r\n  unsigned long dircount = 0;\r\n  int rv = E_None;\r\n  struct currDir cDir = {0};\r\n  \r\n#define MAX_ORDER (0xffff / sizeof(struct ffblk))\r\n  int *orderIndex = NULL;\r\n  int  orderCount;\r\n\r\n  assert(path);\r\n  assert(pattern);\r\n  assert(pathlen >= 2);   /* at least root */\r\n\r\n  if(optO)  {\r\n    orderIndex = malloc(MAX_ORDER * sizeof(unsigned));\r\n    if(!orderIndex) {\r\n    \terror_out_of_memory();\r\n    \toptO = 0;\r\n\t} else {\r\n#ifdef FARDATA\r\n\t\t/* use last-fit allocation to work well with large model */\r\n\t\torderArray = MK_SEG_PTR(void, DOSalloc(0x1000,2));\r\n#else\r\n\t\torderArray = MK_SEG_PTR(void, DOSalloc(0x1000,0));\r\n#endif\r\n\t\tif(!orderArray) {\r\n\t\t\tfree(orderIndex);\r\n\t\t\terror_out_of_dos_memory();\r\n\t\t\toptO = 0;\r\n\t\t}    \t\r\n\t\torderCount = 0;\r\n  \t}\r\n  }\r\n    \r\n  /* Search for matching entries */\r\n  path[pathlen - 1] = '\\\\';\r\n#ifdef FEATURE_DESCRIPT_ION\r\n  strcpy(&path[pathlen], \"DESCRIPT.ION\");\r\n  descriptionExists = ((fDescription = dos_open(path, O_RDONLY)) >= 0);\r\n#endif\r\n  strcpy(&path[pathlen], pattern);\r\n\r\n  if (sfnfindfirst(path, &file, attrMay) == 0) {\r\n  \tint printDirectoryEntry = !optB;\r\n/* For counting columns of output */\r\n  cDir.linecount = 0;\r\n  /* if optB && optS the path with trailing backslash is needed,\r\n  \talso for optS below do {} while */\r\n  strcpy(&path[pathlen - 1], \"\\\\\");\r\n\r\n  if(rv == E_None) do\r\n  if((file.ff_attrib & attrMask) == attrMatch) {\r\n    assert(strlen(file.ff_name) < 13);\r\n\r\n  /* moved down here because if we are recursively searching and\r\n   * don't find any files, we don't want just to print\r\n   * Directory of C:\\SOMEDIR\r\n   * with nothing else\r\n   * 2003-02-03 moved down even further to handle attribute selection.\r\n   */\r\n\r\n  if(printDirectoryEntry) {\r\n    printDirectoryEntry = 0;\r\n    rv = flush_nl();\r\n    if(rv == E_None) {\r\n\t   \t/* path without superflous '\\' at its end */\r\n\t   if(pathlen == 3)     /* root directory */\r\n\t\t path[pathlen] = '\\0';    /* path := path w/o filename */\r\n\t   else path[pathlen - 1] = '\\0';\r\n        displayString(optS ? TEXT_DIR_DIRECTORY: TEXT_DIR_DIRECTORY_WITH_SPACE\r\n         , path);\r\n\t    path[pathlen - 1] = '\\\\';\t/* need this below */\r\n        if((rv = incline()) == E_None) {\r\n        outc('\\n');\r\n        rv = incline();\r\n    }\r\n   }\r\n  }\r\n\r\n    if (cbreak)\r\n      rv = E_CBreak;\r\n    else if (rv == E_None && file.ff_attrib != FA_DEVICE) {\r\n\t\tif(file.ff_attrib & FA_DIREC) {\r\n\t\t\tdircount++;\r\n\t\t} else {\r\n\t\t\tbignum tmp;\r\n\t\t\tfilecount++;\r\n\t\t\ttmp.low = (unsigned long)file.ff_fsize % 1000000000ul;\r\n\t\t\ttmp.billions = (unsigned long)file.ff_fsize / 1000000000ul;\r\n\t\t\tbignum_add(&bytecount, &tmp);\r\n\t\t}\r\n\t\tif(optO) {  \r\n\t\t\t_fmemcpy(&orderArray[orderCount], &file, sizeof(file));\r\n\t\t\torderCount++;\r\n\t\t\tif(orderCount >= MAX_ORDER) {\r\n\t\t\t\trv = flushOrder(orderArray,orderIndex,orderCount,&cDir);\r\n\t\t\t\torderCount = 0;\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\trv = DisplaySingleDirEntry(&file, &cDir);\r\n    }\r\n  }\r\n  while (rv == E_None && sfnfindnext(&file) == 0);\r\n  }\r\n\r\n  #ifdef FEATURE_DESCRIPT_ION\r\n    if (descriptionExists) dos_close(fDescription);\r\n  #endif\r\n\r\n\r\n  if(optO) {\r\n    if(rv == E_None)\r\n\t\trv = flushOrder(orderArray,orderIndex,orderCount,&cDir);\r\n    free(orderIndex);\r\n    DOSfree(FP_SEG(orderArray));\r\n  }\r\n\r\n  if (rv == E_None && optW && (cDir.linecount != 0)) {\r\n    outc('\\n');\r\n    rv = incline();\r\n  }\r\n\r\n\tif(rv == E_None) {\r\n\t\tif(filecount || dircount)\r\n\t\t\trv = print_summary(filecount, &bytecount);\r\n\t\telse if(!optS) {\r\n\t\t\terror_file_not_found();\r\n\t\t\trv = E_Other;\r\n\t\t}\r\n\t}\r\n\r\n  if(rv == E_None       /* no error */\r\n   && optS) {            /* do recursively */\r\n      /* already set for optB && optS before do {} while above \r\n\t\t  path[pathlen - 1] = '\\\\';\t\t*/\r\n      strcpy(&path[pathlen], \"*.*\");\r\n      \t/* Import attributes S & H from \"maybe\" */\r\n      if (sfnfindfirst(path, &file, attrMay | FA_DIREC) == 0) do {\r\n        if((file.ff_attrib & FA_DIREC) != 0 /* is directory */\r\n         && strcmp(file.ff_name, \".\") != 0  /* not cur dir */\r\n         && strcmp(file.ff_name, \"..\") != 0) {  /* not parent dir */\r\n          if (optL)\r\n            strlwr(file.ff_name);\r\n          strcpy(&path[pathlen], file.ff_name);\r\n          rv = dir_list(pathlen + strlen(file.ff_name) + 1, pattern\r\n           , &dircount, &filecount, &bytecount\r\n           );\r\n        }\r\n      } while (rv == E_None && sfnfindnext(&file) == 0);\r\n  }\r\n\r\n    *dcnt += dircount;\r\n    *fcnt += filecount;\r\n    bignum_add(bcnt, &bytecount);\r\n\r\n  return rv;\r\n}\r\n\r\n\r\nstatic int dir_print_body(char *arg, unsigned long *dircount)\r\n{\tint rv;\r\n\tunsigned long filecount;\r\n\tbignum bytecount = {0};\r\n\tchar *pattern, *cachedPattern;\r\n\tchar *p;\r\n#if 0\r\n    char altarg[ MAXPATH ];\r\n\r\n    if( ( p = strrchr( arg, '\\\\' ) ) == NULL && arg[ 1 ] ) {\r\n        if( *arg = '.' ) {\r\n            sprintf( altarg, \"*%s\", arg );\r\n        } else if( strchr( arg, '.' ) == NULL ) {\r\n            sprintf( altarg, \"%s.*\", arg );\r\n        }\r\n    } else if( p[ 1 ] ) {\r\n        if( *arg = '.' ) {\r\n        }\r\n    }\r\n#endif\r\n\r\n\t\t/* Modified to pre-allocate path to 270 bytes so that\r\n\t\t   we don't have to realloc() it later.  That was causing\r\n\t\t   \"DIR /S\" not to work properly.  The path variable cannot\r\n\t\t   be reallocated once dir_list() is called, because dir_list()\r\n\t\t   is recursive.  This will also help to reduce memory\r\n\t\t   fragmentation. */\r\n\tif((p = abspath(arg, 1)) == 0) {\r\n\t\treturn E_NoMem;\r\n\t}\r\n\tif((path = realloc(p, 270*sizeof(char))) == 0) {\r\n\t\tfree(p);\r\n\t\terror_out_of_memory();\r\n\t\treturn E_NoMem;\r\n\t}\r\n\r\n\tfilecount = 0;\r\n\r\n\t/* print the header */\r\n\tif((rv = dir_print_header(toupper(path[0]) - 'A')) == 0) {\r\n\t\t/* There are some directory specs that are not detected by\r\n\t\t\tdfnstat() as they are no part of the filesystem in DOS */\r\n\t\tpattern = dfnfilename(path);\r\n\t\tassert(p);\r\n\t\tif(!*pattern || (dfnstat(path) & DFN_DIRECTORY) != 0) {\r\n\t\t\tpattern = strchr(pattern, '\\0');\r\n\t\t\tif(pattern[-1] != '\\\\')\r\n\t\t\t\t++pattern;\r\n\t\t\trv = dir_list(pattern - path, \"*.*\", dircount, &filecount\r\n\t\t\t , &bytecount\r\n\t\t\t );\r\n\t\t} else {\r\n\t\t\tif((cachedPattern = strdup(pattern)) == 0) {\r\n\t\t\t\terror_out_of_memory();\r\n\t\t\t\trv = E_NoMem;\r\n\t\t\t} else {\r\n\t\t\t\trv = dir_list(pattern - path, cachedPattern, dircount\r\n\t\t\t\t , &filecount, &bytecount\r\n\t\t\t\t );\r\n\t\t\t\tfree(cachedPattern);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n  if(optS) {\r\n    if(filecount)\r\n\t\trv = print_total(filecount, &bytecount);\r\n    else {\r\n\t\terror_file_not_found();\r\n\t\trv = E_Other;\r\n    }\r\n  }\r\n  if(!rv)\r\n    rv = dir_print_free(*dircount);\r\n\r\n\tfree(path);\r\n\treturn rv;\r\n}\r\n\r\n\r\n/*\r\n * dir\r\n *\r\n * internal dir command\r\n */\r\nint cmd_dir (char * rest) {\r\n  char **argv;\r\n  char *p;\r\n  int argc, opts;\r\n  int rv;                       /* return value */\r\n  unsigned long dircount;\r\n  int appState;\t\t\t\t\t/* DOS/APPEND state */\r\n\r\n  /* initialize options */\r\n  attrMask = attrMatch = optO = longyear = optS = optP = optW = optB = optL = 0;\r\n#ifdef FEATURE_LONG_FILENAMES\r\n  dispLFN = 0;\r\n#endif\r\n  attrMay = ATTR_DEFAULT;\r\n\r\n  /* read the parameters from env */\r\n  if ((argv = scanCmdline(p = getEnv(\"DIRCMD\"), opt_dir, 0, &argc, &opts))\r\n   == 0) {\r\n    free(p);\r\n    return 1;\r\n  }\r\n  free(p);\r\n  freep(argv);    /* ignore any parameter from env var */\r\n\r\n  line = 0;\r\n  /* read the parameters */\r\n  if ((argv = scanCmdline(rest, opt_dir, 0, &argc, &opts)) == 0)\r\n    return 1;\r\n\r\n  /* critEnableRepeatCheck(); */\r\n  appState = appendDisable();\r\n  dircount = 0;\r\n  if(argc)\r\n    for(opts = 0\r\n     ; opts < argc && (rv = dir_print_body(argv[opts], &dircount)) == 0\r\n     ; ++opts)\r\n      ;\r\n  else\r\n    rv = dir_print_body(\".\", &dircount);\r\n  /* critEndRepCheck(); */\r\n\r\n  appendRestore(appState);\r\n  freep(argv);\r\n  return rv;\r\n}\r\n\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_VOL\r\n\r\n/*\r\n * vol\r\n *\r\n * internal vol command\r\n */\r\nint cmd_vol (char * rest) {\r\n  int drive;\r\n\r\n  assert(rest);\r\n\r\n  /* save the current directory info */\r\n      line = 0;\r\n      optB = 0;\r\n\r\n  if (rest && *rest)\r\n  {\r\n    /* trim whitespace after drive indicator, else extra spaces cause syntax error */\r\n    rtrimcl(rest);\r\n\r\n    if ((strlen(rest) != 2) || (rest[1] != ':'))\r\n    {\r\n      error_syntax(rest);\r\n      return E_Useage;\r\n    }\r\n    drive = toupper(rest[0]) - 'A';\r\n  }\r\n  else\r\n    drive = getdisk();\r\n\r\n  return dir_print_header(drive);\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "cmd/dirs.c",
    "content": "/* $Id$\r\n *  DSTACK.C - Directory stack PUSHD/POPD support, compatible with 4/NDOS\r\n *\r\n * Outputs directory stack contents\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/command.h\"\r\n#include \"../strings.h\"\r\n\r\nint cmd_dirs (char * param) {\r\n    (void)param;\r\n    return ctxtView (CTXT_TAG_DIRSTACK, TEXT_DIRSTACK_EMPTY);\r\n}\r\n"
  },
  {
    "path": "cmd/doskey.c",
    "content": "/* $Id$\r\n *  DOSKEY -- command line editor extender <-> incorporated, but\r\n *\t\tnot loadable\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/command.h\"\r\n#include \"../strings.h\"\r\n\r\nint cmd_doskey (char * param) {\r\n    (void)param;\r\n    displayString (TEXT_MSG_DOSKEY);\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "cmd/echo.c",
    "content": "/* $Id$\r\n *  ECHO.C - echo command.\r\n *\r\n *  Comments:\r\n *\r\n * 16 Jul 1998 (Hans B Pufal)\r\n *   started.\r\n *\r\n * 16 Jul 1998 (John P Price)\r\n *   Seperated commands into individual files.\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 1999/04/27 ska\r\n * add: \"ECHO.\" displays empty line\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/batch.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../strings.h\"\r\n\r\nint cmd_echo(char *param)\r\n{\tint nostatus;\r\n\r\n\tdprintf( (\"[ECHO: %s]\\n\", param) );\r\n\r\n\tif(param && *param) {\r\n\t\tnostatus = !isspace(*param);\r\n\t\t\t/* Unlike other internal commands, puncation characters\r\n\t\t\t\tare not removed by ECHO */\r\n\t\t++param;\r\n\t} else nostatus = 0;\r\n\r\n\tswitch(onoffStr(param)) {\r\n\tcase OO_Null:\tcase OO_Empty:\r\n\tdefault:\r\n\t  if(nostatus)\r\n\t\toutc('\\n');\r\n\t  else\r\n\t\tdisplayString(TEXT_MSG_ECHO_STATE, echo ? D_ON : D_OFF);\r\n\t  break;\r\n\r\n\tcase OO_Off:\techo = 0; break;\r\n\tcase OO_On:\t\techo = 1; break;\r\n    case OO_Other:\r\n\t\tputs(param);\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/exit.c",
    "content": "/* $Id$\r\n *  EXIT -- exits current instance of FreeCOM or leave all batch files\r\n *\r\n * set the exitflag to true\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/command.h\"\r\n\r\nint internal_exit (char * rest) { (void)rest; exitflag = 1; return 0; }\r\n"
  },
  {
    "path": "cmd/exit2.c",
    "content": "/* $Id$\r\n *  EXIT -- exits current instance of FreeCOM or leave all batch files\r\n *\r\n * set the exitflag to true\r\n * and _force_ exit\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/command.h\"\r\n\r\nint force_exit (char * rest) { (void)rest; canexit = exitflag = 1; return 0; }\r\n"
  },
  {
    "path": "cmd/fddebug.c",
    "content": "/* $Id$\r\n *  FDDEBUG.C - verify command.\r\n *\r\n *  Comments: Turn on/off the debug flag\r\n *\r\n * 30-Mar-2000 (John P Price <linux-guru@gcfl.net>)\r\n *   started.\r\n *\r\n * 2001/02/16 ska\r\n * add: redirect output into file\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#ifdef DEBUG\r\nextern FILE *dbg_logfile;\r\nextern char *dbg_logname;\r\n\r\nint cmd_fddebug(char *param)\r\n{\r\n\tswitch(onoffStr(param)) {\r\n  \tdefault: {\r\n  \t\tFILE *f;\r\n  \t\tchar *p;\r\n\r\n  \t\tif((p = strdup(trimcl(param))) == 0) {\r\n  \t\t\terror_out_of_memory();\r\n  \t\t\treturn 1;\r\n  \t\t}\r\n\r\n  \t\tif(stricmp(param, \"stderr\") == 0) f = stderr;\r\n  \t\telse if(stricmp(param, \"stdout\") == 0) f = stdout;\r\n  \t\telse if((f = fopen(param, \"at\")) == 0) {\r\n  \t\t\terror_open_file(param);\r\n  \t\t\treturn 2;\r\n  \t\t}\r\n\t\tif(dbg_logfile != stderr && dbg_logfile != stdout)\r\n\t\t\tfclose(dbg_logfile);\r\n\t\tdbg_logfile = f;\r\n\t\tfree(dbg_logname);\r\n\t\tdbg_logname = p;\r\n\t\t/* FALL THROUGH */\r\n\t}\r\n  \tcase OO_On:\t\tfddebug = 1;\tbreak;\r\n\tcase OO_Null:\tcase OO_Empty:\r\n\t\tdisplayString(TEXT_MSG_FDDEBUG_STATE, fddebug ? D_ON : D_OFF);\r\n\t\tdisplayString(TEXT_MSG_FDDEBUG_TARGET\r\n\t\t , dbg_logname? dbg_logname: \"stdout\");\r\n\t\tbreak;\r\n  \tcase OO_Off:\tfddebug = 0;\tbreak;\r\n\t}\r\n  return 0;\r\n}\r\n#endif\r\n"
  },
  {
    "path": "cmd/for.c",
    "content": "/* $Id$\r\n *  FOR.C - for command.\r\n *\r\n *\tSynopsises:\r\n *\t\ta) FOR { '%' } v  IN (...) DO ...\r\n *\t\tb) FOR [{ '%' }] name [ '%' ] IN (...) DO ...\r\n *\tv ::= a single alphabetic character\r\n *\tname ::= a name; at least two characters that may be used in\r\n *\t\tfilenames as well; name != \"IN\"\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/batch.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/context.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n\t/* If set --> toupper(varE[-1]) */\r\n#define FLAG_HACKERY_FOR 1\r\n\r\ntypedef enum {\r\n\tOK, badVar, noIN, noParens, noDO, noCMD\r\n} forErrors;\r\n\r\nstatic forErrors checkFOR(char * param\t/* in: command line */\r\n\t, char ** varS, char ** varE\t\t/* out: start/end variable name */\r\n\t, char ** paramS, char ** paramE\t/* out: start/end paramter list */\r\n\t, char ** cmd, int *flags)\t\t\t/* out */\r\n{\r\n\tassert(param);\r\n\r\n\tassert(varS);\r\n\tassert(varE);\r\n\tassert(paramS);\r\n\tassert(paramE);\r\n\tassert(cmd);\r\n\tassert(flags);\r\n\r\n\t*flags = 0;\r\n\r\n    /* skip past and process any option flags\r\n\t   /D filespec is for directories instead of files\r\n\t   /F ??? - not currently supported, parse file instead of perform findfirst/next\r\n\t   /R [basepath] - not currently supported, repeat for each subdir of basepath\r\n\t */\r\n\tif (*param == '/' || *param == '-') {\r\n\t\tparam++;\r\n\t\tswitch(toupper(*param++)) {\r\n\t\t\tcase 'D':\r\n\t\t\t\t*flags |= FLAG_OPT_DIRECTORY;\r\n\t\t\t\tbreak;\r\n#if 0\r\n\t\t\tcase 'F':\r\n\t\t\t\t*flags |= FLAG_OPT_FILEPARSE;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'R':\r\n\t\t\t\t*flags |= FLAG_OPT_RECURSE;\r\n\t\t\t\tbreak;\r\n#endif\r\n\t\t\tdefault:\r\n\t\t\t\treturn badVar;\r\n\t\t}\r\n\t\tparam = ltrimcl(param + 1);   /* skip whitespaces */\r\n\t}\r\n\r\n\t/* Check that it starts with a % then an alpha char followed by space */\r\n\t*varS = param;\r\n\tif(*param == '%') { \t/* Check for FOR %%%%v IN syntax */\r\n\t\twhile(*++param == '%');\r\n\t\tif(isalpha(*param) && isargdelim(param[1])) {\r\n\t\t\t/* hackery FOR variable */\r\n\t\t\t*flags |= FLAG_HACKERY_FOR;\r\n\t\t\t*varE = ++param;\r\n\t\t\tgoto varfound;\r\n\t\t}\r\n\t}\r\n\r\n#if 0\r\n\t/* the standard release does not support normal variables as\r\n\t\tFOR variables */\r\n\treturn badVar;\r\n#else\r\n\t/* Use a normal variable; strip leading %'s */\r\n\t*varE = param = skipfnam(*varS = param);\r\n\tif(*param == '%')\t\t/* ignore _one_ trailing percent sign */\r\n\t\t++param;\r\n\tif(!*param || !isargdelim(*param)\r\n\t || *varE - *varS < 2\r\n/*\t || (*varE - *varS == 2 && memicmp(*varS, \"IN\", 2) == 0) */ ) {\r\n\t\treturn badVar;\r\n\t}\r\n#endif\r\n\r\nvarfound:\r\n\tparam = ltrimcl(param + 1);   /* skip whitespaces */\r\n\r\n\t/* Check next element is 'IN' */\r\n\tif(!matchtok(param, \"in\")) {\r\n\t\treturn noIN;\r\n\t}\r\n\r\n\t/* Followed by a '(', find also matching ')' */\r\n\tif(*param != '(')\r\n\t\treturn noParens;\r\n\r\n\t*paramS = param + 1;\r\n\r\n\t{ \t/* Search for right ) */\r\n\t\tint inQuote = 0;\r\n\r\n\t\twhile(*++param)\r\n\t\t\tif(is_quote(*param)) {\r\n\t\t\t\tif(inQuote)\r\n\t\t\t\t\tinQuote = 0;\r\n\t\t\t\telse\r\n\t\t\t\t\tinQuote = *param;\r\n\t\t\t} else if(*param == ')' && !inQuote\r\n\t\t\t\t&& isargdelim(param[1])\t/* COMMAND bug: sees right parens\r\n\t\t\t\t\t\t\t\t\t\t\tonly if followed by whitespace */\r\n\t\t\t\t\t)\r\n\t\t\t\tgoto rightParansFound;\r\n\t\treturn noParens;\r\n\t}\r\n\trightParansFound:\r\n\t\t*paramE = param;\r\n\r\n\tparam = ltrimcl(param + 1);\r\n\r\n\t/* Check if DO follows */\r\n\tif(!matchtok(param, \"do\"))\r\n\t\treturn noDO;\r\n\r\n\t/* Check that command tail is not empty */\r\n\tif(!*param)\r\n\t\treturn noCMD;\r\n\r\n\t*cmd = param;\r\n\treturn OK;\r\n}\r\n\r\nstatic int doFOR (char * varname, char * varE, char * param, char * paramE,\r\n                  char *cmd, int flags) {\r\n#if 0\r\n        char *oldContents;\r\n\tchar **argv;\t\t\t/* pattern list */\r\n\tint argc;\r\n\tint rv;\r\n#endif\r\n\r\n\tassert(varname);\r\n\tassert(varE);\r\n\tassert(param);\r\n\tassert(paramE);\r\n\tassert(cmd);\r\n\r\n\t*varE = 0;\r\n\t*paramE = 0;\r\n\r\n/* OK all is correct, build the exec contexts */\r\n#if 1\r\n\tassert(*varname == '%');\r\n\t{\r\n\t\tchar parsedParam[MAX_INTERNAL_COMMAND_SIZE + sizeof(errorlevel) * 8];\r\n\r\n\t\tif(!expandEnvVars(param, parsedParam)) {\r\n\t\t\terror_line_too_long();\r\n\t\t\treturn 1;\r\n\t\t}\r\n\r\n\t\tif(!newBatchContext())\r\n\t\t\treturn 1;\r\n\r\n\r\n\t\tif((bc->forproto = strdup(cmd)) == 0\r\n\t\t || (bc->forvar = strdup(varname)) == 0) {\r\n\t\t\terror_out_of_memory();\r\n\t\t\texit_batch();   /* remove the newly created batch context */\r\n\t\t\treturn 1;\r\n\t\t}\r\n\r\n\t\tif(!setBatchParams(parsedParam)) { /* Split out list */\r\n\t\t\texit_batch();\r\n\t\t\treturn 1;\r\n\t\t}\r\n\r\n\t\tbc->shiftlevel = 1;     /* skip %0 <=> filename */\r\n\t\tbc->forFlags = flags;\r\n\t}\r\n\treturn 0;\r\n\r\n#else\r\n\trv = E_None;\r\n\r\n\t/* 1st: C/FORVAR|SET hidden context */\r\n\tif(*varname == '%') {\t/* special FOR variable */\r\n\t\tswitch(ctxtGetS(1, CTXT_TAG_IVAR, varname, &oldContents)) {\r\n#ifdef DEBUG\r\n\t\tdefault:\r\n\t\t\tdprintf((\"[FOR: Invalid return value from ctxtGetS]\\n\"));\r\n\t\t\trv = E_None;\r\n\t\t\tbreak;\r\n\t\tcase 1:\t\t/* no such item */\r\n#else\r\n\t\tdefault:\r\n#endif\r\n\t\t\trv = ecMkc(\"IVAR %@VERBATIM()\", varname, (char*)0);\r\n\t\t\tbreak;\r\n\t\tcase 0:\t\t/* Got it */\r\n\t\t\trv = ecMkc(\"IVAR %@VERBATIM()\", varname, \"=\"\r\n\t\t\t , oldContents, (char*)0);\r\n\t\t\tmyfree(oldContents);\r\n\t\t\tbreak;\r\n\t\tcase 2:\t/* Out of memory */\r\n\t\t\terror_out_of_memory();\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t} else {\t\t\t/* normal variable */\r\n\t\toldContents = getEnv(varname);\r\n\t\t\t/* getEnv() will also update the varname array with the current\r\n\t\t\t\tcase of the particular characters */\r\n\t\trv = ecMkc(\"SET /C %@VERBATIM()\", varname, \"=\", oldContents, (char*)0);\r\n\t\tfree(oldContents);\r\n\t}\r\n\r\n\tif(rv == E_None) {\r\n\t\tif((argv = split(param, &argc)) == 0) {\r\n\t\t\terror_out_of_memory();\r\n\t\t\treturn E_NoMem;\r\n\t\t}\r\n\r\n\t\t/* Make the F context */\r\n\t\tif(argc)\r\n\t\t\trv = ecMkF(argv, argc, varname, cmd);\r\n\t\t/* else silently ignore an empty argument line */\r\n\t\tfreep(argv);\r\n\t}\r\n\r\n\treturn rv;\r\n#endif\r\n}\r\n\r\n\r\nint cmd_for(char *param)\r\n{\r\n\t/*\r\n\t * First check syntax is correct : FOR %v IN ( <list> ) DO <command>\r\n\t *   v must be alphabetic, <command> must not be empty.\r\n\t *\r\n\t * If all is correct build a new F exec context.\r\n\t * If also preserves the old contents of the FOR variable\r\n\t *\r\n\t *\tvarname := name of FOR variable\r\n\t *\tparam := parameters within '(...)'\r\n\t *\tcmd := command\r\n\t */\r\n\r\n\tchar *varname, *varE, *cmd, *paramE;\r\n\tint flags;\r\n\r\n\tswitch(checkFOR(param, &varname, &varE, &param, &paramE, &cmd, &flags)) {\r\n\tcase badVar:\r\n\t\terror_for_bad_var();\r\n\t\treturn 1;\r\n\tcase noIN:\r\n\t\terror_for_in();\r\n\t\treturn 1;\r\n\tcase noParens:\r\n\t\terror_for_parens();\r\n\t\treturn 1;\r\n\tcase noDO:\r\n\t\terror_for_do();\r\n\t\treturn 1;\r\n\tcase noCMD:\r\n\t\terror_for_no_command();\r\n\t\treturn 1;\r\n\tcase OK:\r\n\t\tbreak;\r\n\tdefault:\r\n#ifdef DEBUG\r\n\t\tdprintf((\"[FOR: Invalid return value from checkFOR()]\\n\"));\r\n#endif\r\n\t\treturn 1;\r\n\t}\r\n\r\n\treturn doFOR(varname, varE, param, paramE, cmd, flags);\r\n}\r\n\r\nint cmd_for_hackery(char *Xparam)\r\n{\tchar *param;\r\n\tchar *varname, *varE, *cmd, *paramE;\r\n\tint flags;\r\n\r\n\tif(!matchtok(Xparam, \"for\")\r\n\t || checkFOR(Xparam, &varname, &varE, &param, &paramE, &cmd, &flags)\r\n\t != OK)\r\n\t\treturn 0;\r\n\r\n\t\t/* Ignore the return value as this is a FOR cmd now, but if it\r\n\t\t\tfails here, some other error caused it */\r\n\tdoFOR(varname, varE, param, paramE, cmd, flags);\r\n\r\n\treturn 1;\r\n}\r\n"
  },
  {
    "path": "cmd/goto.c",
    "content": "/* $Id$\r\n *  GOTO.C - goto command.\r\n *\r\n *  Comments:\r\n *\r\n * 16 Jul 1998 (Hans B Pufal)\r\n *   started.\r\n *\r\n * 16 Jul 1998 (John P Price)\r\n *   Seperated commands into individual files.\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 28 Jul 1998 (Hans B Pufal) [HBP_003]\r\n *   Terminate label on first space character, use only first 8 chars of\r\n *   label string\r\n *\r\n * 10-Aug-1998 ska\r\n * - moved code into readbatchline() that automatically supports\r\n *   modifyable scripts & ^Break checks\r\n *\r\n * 1999/11/02 ska\r\n * bugfix: some DOS shells except a colon before the label\r\n *\r\n * 2000/07/05 Ron Cemer\r\n *\tbugfix: renamed skipwd() -> skip_word() to prevent duplicate symbol\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/batch.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\nint cmd_goto(char *param)\r\n{\r\n\t/*\r\n\t * Perform GOTO command.\r\n\t *\r\n\t * Only valid if batch file current.\r\n\t */\r\n\r\n\tchar *tmp;\r\n\r\n\twhile(bc && bc->forvar)   /* is FOR context */\r\n\t\texit_batch();       /* remove it */\r\n\r\n\tif(bc == 0) {\r\n\t/*!! not in batch error */\r\n\r\n\t\treturn 1;\r\n\t}\r\n\tassert(param);\r\n\r\n\tif(*param == ':')    /* some old DOS shell excepts a colon */\r\n\t\tparam = skipdm(param + 1);\r\n\r\n\tif(*param == '\\0') {\r\n\t\terror_goto_label();\r\n\t\texit_batch();\r\n\t\treturn 1;\r\n\t}\r\n\r\n\ttmp = skip_word(param);\r\n\t*tmp = '\\0';\r\n\r\n\ttmp = strdup(param);\r\n\tif(!tmp) {\r\n\t\terror_out_of_memory();\r\n\t\treturn 1;\r\n\t}\r\n\r\n\t/* Restart the batch file from the beginning */\r\n\tbc->brewind = 1;\r\n\tbc->blabel = tmp;\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/history.c",
    "content": "/*\t$Id$\r\n\r\n\tcommand line history\r\n\r\n\tThis file bases on HISTORY.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:09:06  skaus\r\n\tchg: New structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <stdlib.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/context.h\"\r\n#include \"../strings.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nint cmd_history(char *param)\r\n{\r\n\tif(param && *param) {\r\n\t\tunsigned long x;\r\n\r\n\t\tx = atol(param);\r\n\t\tif(x < 256 || x > 32768U) {\r\n\t\t\terror_history_size(param);\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tputs(\"HISTORY: To change to size of the history is not implemented, yet\");\r\n\t\treturn 0;\r\n\t}\r\n\r\n\treturn ctxtView(CTXT_TAG_HISTORY, TEXT_HISTORY_EMPTY);\r\n}\r\n"
  },
  {
    "path": "cmd/if.c",
    "content": "/* $Id$\r\n *  IF.C - if command.\r\n *\r\n *  Comments:\r\n *\r\n * 16 Jul 1998 (Hans B Pufal)\r\n *   started.\r\n *\r\n * 16 Jul 1998 (John P Price)\r\n *   Seperated commands into individual files.\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 1999/11/04 ska\r\n * + bugfix: if: case-insensitive compare  in \"==\" format\r\n * + bugfix: if: added support for quoted operands of \"==\" format\r\n * + add: if: detailed error messages\r\n * + bugfix: if: keyword \"EXIST\" misspelled\r\n *\r\n * 2000/07/05 Ron Cemer\r\n *\tbugfix: renamed skipwd() -> skip_word() to prevent duplicate symbol\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <dos.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include <suppl.h>\r\n\r\n#include \"../include/lfnfuncs.h\"\r\n#include \"../include/batch.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n\r\n#ifdef XMS_SWAP\r\n#include \"../include/cswap.h\"\r\n#endif\r\n\r\nint cmd_if(char *param)\r\n{\r\n\r\n#define X_EXEC 1\r\n\r\n\tchar *pp;\r\n\r\n\tint x_flag = 0;       /* when set cause 'then' clause to be exec'ed */\r\n\tint negate = 0;       /* NOT keyword present */\r\n\tint ignore_case = 0;  /* /I option, case insensitive compare */\r\n\r\n\r\n\t/* First check if param exists */\r\n\tassert(param);\r\n\r\n\t/* check for options, note non-options must be treated as part of comparision */\r\n\t/* also check if param string begins with word 'not' */\r\n    /* users will expect /I NOT and NOT /I to both work */\r\n\tif (matchtok(param, \"NOT\")) negate = X_EXEC;            /* Remember 'NOT' */\r\n\tif (matchtok(param, \"/I\"))  ignore_case++;\r\n\tif (matchtok(param, \"NOT\")) negate = X_EXEC;            /* Remember 'NOT' */\r\n\r\n\r\n\t/* Check for 'exist' form */\r\n\r\n\tif(matchtok(param, \"exist\")) {\r\n\t\tstruct dos_ffblk f;\r\n\t\tisr olderrhandler;\r\n\r\n\t\tif(!*param) {\r\n\t\t\t/* syntax error */\r\n\t\t\terror_if_exist();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tpp = skip_word(param);\r\n\t\t*pp = '\\0';\r\n\t\tpp++;\r\n\r\n\t\t/* don't show abort/retry/fail if no disk in drive */\r\n\t\tget_isr(0x24, olderrhandler);\r\n#ifdef XMS_SWAP\r\n\t\tset_isrfct(0x24, autofail_err_handler);  /* always fails */\r\n#else\r\n\t\tset_isrfct(0x24, dummy_criter_handler);  /* always fails */\r\n#endif\r\n\r\n\t\tif(dos_findfirst(param, &f, FA_NORMAL|FA_ARCH|FA_SYSTEM|FA_RDONLY|FA_HIDDEN) == 0)\r\n\t\t\tx_flag = X_EXEC;\r\n\t\tdos_findclose(&f);\r\n        \r\n\t\t/* restore critical error handler */\r\n\t\tset_isrfct(0x24, olderrhandler);\r\n\t}\r\n\r\n\t/* Check for 'errorlevel' form */\r\n\r\n\telse if(matchtok(param, \"errorlevel\")) {\r\n\t\tint n = 0;\r\n\r\n#if 0\r\n\t\tif(!isdigit(*param)) {\r\n\t\t\terror_if_errorlevel();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tpp = param;\r\n\t\tdo  n = n * 10 + (*pp - '0');\r\n\t\twhile (isdigit(*++pp));\r\n\r\n\t\tif(*pp && !isargdelim(*pp)) {\r\n\t\t\terror_if_errorlevel_number();\r\n\t\t\treturn 0;\r\n\t\t}\r\n#else\r\n\t\t/* Add this COMMAND bug as someone tries to use:\r\n\t\t\tIF ERRORLEVEL H<upper-case_letter>\r\n\t\t\t-or-\r\n\t\t\tIF ERRORLEVEL x<lower-case_letter>\r\n\r\n\t\t\tto match the errorlevel against drive letters.\r\n\t\t\tNOT supported by 4dos or WinNT.\r\n\r\n\t\t\tHA --> maps to errorlevel 1\r\n\t\t\txa --> same\r\n\r\n\t\t\tHB & xb --> to 2\r\n\t\t\ta.s.o.\r\n\t\t*/\r\n\r\n\t\tif(!*param) {\r\n\t\t\terror_if_errorlevel();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tpp = param;\r\n\t\tdo  n = n * 10 + (*pp - '0');\r\n\t\twhile(*++pp && !isargdelim(*pp));\r\n\t\tn &= 255;\r\n\t\tdprintf( (\"IF: checking for ERRORLEVEL >= %u\\n\", n) );\r\n#endif\r\n\r\n\t\tif(errorlevel >= n)\r\n\t\t\tx_flag = X_EXEC;\r\n\t}\r\n\r\n\t/* Check that '==' is present, syntax error if not */\r\n\telse {\r\n\t\tsize_t len_l, len_r;\r\n\t\tchar *r;      /* right operand */\r\n\r\n\t\tpp = skipqword(param, \"==\");\r\n\r\n        /* skip past any garbage characters before the == */\r\n        while (*pp && (*pp != '=') && !isargdelim(*pp)) pp++;\r\n\r\n\t\tif(*pp != '=' || pp[1] != '=') {\r\n\t\t\terror_syntax(0);\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\t*pp = '\\0';     /* param[] points to the left operand */\r\n\r\n\t\t/* skip over the '==' and subsquent spaces */\r\n        r = ltrimcl(pp + 2);\r\n        /* and assign the end of the right operator to pp */\r\n\t\tpp = skipqword(r, 0);\r\n\r\n\t\t/*\tnow: param := beginning of the left operand\r\n\t\t\tr := beginning of the right operand\r\n\t\t\tpp := end of right operand\r\n\t\t*/\r\n\r\n\t\trtrimcl(param);      /* ensure that spurious whitespaces are ignored */\r\n\t\tlen_l = strlen(param);\r\n\t\tlen_r = strlen(r);\r\n\t\tdprintf((\"left side=[%s] %i\\n\", param, len_l));\r\n\t\tdprintf((\"rigt side=[%s] %i\\n\", r, len_r));\r\n\r\n\t\t/* check if strings differ */\r\n\t\tif ( (len_l == len_r) &&\r\n\t\t     ((ignore_case && strnicmp(param, r, len_l) == 0) ||\r\n\t\t      (memcmp(param, r, len_l) == 0)) )\r\n\t\t\tx_flag = X_EXEC;\r\n\t}\r\n\r\n\tif(x_flag ^ negate) {\t\t/* perform the command */\r\n\t\tif(!*(pp = ltrimcl(pp)))\r\n\t\t\terror_if_command();\r\n\t\telse\r\n\t\t\tparsecommandline(pp, FALSE);\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/lfnfor.c",
    "content": "/* $Id$\r\n *  LFNFOR.C - lfnfor command (MS-DOS 7.0).\r\n *\r\n *  Comments:\r\n *\r\n * 22-June-2006 (Blair Campbell)\r\n *   started.\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <string.h>\r\n\r\n#include \"../err_fcts.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n\r\nunsigned char lfnfor = 0;\r\nunsigned char lfncomplete = 0;\r\n\r\nint cmd_lfnfor(char *param)\r\n{\r\n    if(strnicmp(param, \"COMPLETE\", 8) == 0) {\r\n        switch(onoffStr(&param[8])) {\r\n        default:\r\n            error_on_off();\r\n            return 1;\r\n        case OO_Null:   case OO_Empty:\r\n            displayString(TEXT_MSG_LFNFOR_COMPLETE_STATE, lfncomplete ?\r\n                                                          D_ON : D_OFF );\r\n            break;\r\n        case OO_Off:    lfncomplete = 0; break;\r\n        case OO_On:     lfncomplete = 1; break;\r\n        }\r\n    }\r\n    else switch(onoffStr(param)) {\r\n  \tdefault:\r\n\t\terror_on_off();\r\n\t\treturn 1;\r\n\tcase OO_Null:\tcase OO_Empty:\r\n\t\tdisplayString(TEXT_MSG_LFNFOR_STATE, lfnfor ? D_ON : D_OFF);\r\n\t\tbreak;\r\n  \tcase OO_Off:\tlfnfor = 0;\tbreak;\r\n  \tcase OO_On:\t\tlfnfor = 1;\tbreak;\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/makefile",
    "content": "# $Id$\r\n#\r\n# Makefile for the FreeCOM library\r\n#\r\n# $Log$\r\n# Revision 1.5  2002/11/12 21:56:14  skaus\r\n# v0.83 Beta 52:\r\n#\r\n# Revision 1.4  2002/04/02 23:36:37  skaus\r\n# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n#\r\n# Revision 1.3  2001/12/03 20:15:54  skaus\r\n# v0.83 Beta 32:\r\n# bugfix: if FREECOM.COM /P without AUTOEXEC.BAT --> assert() failure.\r\n# add: if DEBUG enabled: internal command EXIT!! that ignores /P\r\n# chg: FEATURE_BOOT_KEYS: mandory boot keys (F5/F8) turned into\r\n# \toptional compile-time option; disabled by default now as the\r\n# \tkernel provides F5/F8 checking\r\n# chg: some document updates\r\n#\r\n# Revision 1.2  2001/06/10 17:17:23  skaus\r\n# bugfix: Single point of configuration CONFIG.MAK/.H\r\n#\r\n# Revision 1.1  2001/04/12 00:09:06  skaus\r\n# chg: New structure\r\n# chg: If DEBUG enabled, no available commands are displayed on startup\r\n# fix: PTCHSIZE also patches min extra size to force to have this amount\r\n#    of memory available on start\r\n# bugfix: CALL doesn't reset options\r\n# add: PTCHSIZE to patch heap size\r\n# add: VSPAWN, /SWAP switch, .SWP resource handling\r\n# bugfix: COMMAND.COM A:\\\r\n# bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n# add: command MEMORY\r\n# bugfix: runExtension(): destroys command[-2]\r\n# add: clean.bat\r\n# add: localized CRITER strings\r\n# chg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n# \tvia STRINGS.LIB\r\n# add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n# add: fixstrs.c: prompts & symbolic keys\r\n# add: fixstrs.c: backslash escape sequences\r\n# add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n# chg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n# bugfix: IF is now using error system & STRINGS to report errors\r\n# add: CALL: /N\r\n#\r\n#\r\n\r\n.INCLUDE : ../_config.mk\r\n\r\n# Sources of this make target\r\nSRC = alias.c beep.c break.c call.c cdd.c chcp.c chdir.c cls.c copy.c \\\r\n\tctty.c date.c del.c dir.c dirs.c doskey.c echo.c exit.c exit2.c \\\r\n\tfddebug.c for.c goto.c history.c if.c memory.c mkdir.c path.c pause.c \\\r\n\tpopd.c prompt.c pushd.c rem.c ren.c rmdir.c set.c shift.c time.c \\\r\n\ttruename.c type.c verify.c which.c\r\nOBJ = alias.obj beep.obj break.obj call.obj cdd.obj chcp.obj chdir.obj \\\r\n\tcls.obj copy.obj ctty.obj date.obj del.obj dir.obj dirs.obj doskey.obj \\\r\n\techo.obj exit.obj exit2.obj fddebug.obj for.obj goto.obj history.obj \\\r\n\tif.obj memory.obj mkdir.obj path.obj pause.obj popd.obj prompt.obj \\\r\n\tpushd.obj rem.obj ren.obj rmdir.obj set.obj shift.obj time.obj \\\r\n\ttruename.obj type.obj verify.obj which.obj\r\nHDR = ..\\config.h ..\\err_fcts.h ..\\include/batch.h ..\\include/cmdline.h \\\r\n\t..\\include/command.h ..\\include/context.h ..\\include/datefunc.h \\\r\n\t..\\include/debug.h ..\\include/kswap.h ..\\include/misc.h ..\\include/nls.h \\\r\n\t..\\include/openf.h ..\\include/timefunc.h\r\n\r\n\r\n#\tDefault target\r\nall: cmds.lib\r\n\r\ndist: makefile.mak\r\n\r\n%.obj : %.asm ; $(NASM) $(NASMFLAGS) -f obj -F borland -o $@ $< >>errlist\r\n\r\n### Utils are required by build process\r\n.INIT .PHONY .SEQUENTIAL : verscheck $(CFG) __errl\r\n\r\n\r\n.IF $(THISMAKE) == $(LASTMAKE)\r\nverscheck :;\r\n.ELSE\r\nverscheck : \r\n\t@+-echo Changed Make parameters, already made files invalid!\r\n\t+-echo LASTMAKE = $(THISMAKE) >lastmake.mk\r\n\t$(RUNMAKE) clobber\r\n.IF $(CFG)\r\n\t$(RUNMAKE) $(CFG)\r\n.ENDIF\r\n.ENDIF\r\n\r\n__errl:\r\n\t@+-if exist errlist del errlist >nul\r\n\t-ctags *.c ..\\lib\\*.c ..\\shell\\*.c $(FREEDOS)\\SRC\\LIB\\SUPPL\\*.c\r\n\r\ncmds.lib .LIBRARY : $(OBJ)\r\n\r\n#MAKEDEP START\r\nmkdir.obj : mkdir.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nmemory.obj : memory.c \\\r\n\t ../config.h ../include/command.h ../include/context.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h ../strings.h\r\ngoto.obj : goto.c \\\r\n\t ../config.h ../err_fcts.h ../include/batch.h ../include/cmdline.h \\\r\n\t../include/command.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h ../strings.h\r\ncopy.obj : copy.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/openf.h ../include/timefunc.h ../strings.h\r\nshift.obj : shift.c \\\r\n\t ../config.h ../include/batch.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nrmdir.obj : rmdir.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\npause.obj : pause.c \\\r\n\t ../config.h ../include/batch.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h ../strings.h\r\ndate.obj : date.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/nls.h ../include/timefunc.h ../strings.h\r\nchcp.obj : chcp.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\ndir.obj : dir.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/nls.h ../include/timefunc.h ../strings.h\r\ntruename.obj : truename.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nrem.obj : rem.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nctty.obj : ctty.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/openf.h \\\r\n\t../include/timefunc.h ../strings.h\r\nren.obj : ren.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nbreak.obj : break.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\nfor.obj : for.c \\\r\n\t ../config.h ../err_fcts.h ../include/batch.h ../include/cmdline.h \\\r\n\t../include/command.h ../include/context.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\nchdir.obj : chdir.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nalias.obj : alias.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/context.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h ../strings.h\r\ncdd.obj : cdd.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nset.obj : set.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/context.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h ../strings.h\r\nexit2.obj : exit2.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\npath.obj : path.c \\\r\n\t ../config.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/context.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h ../strings.h\r\nif.obj : if.c \\\r\n\t ../config.h ../err_fcts.h ../include/batch.h ../include/cmdline.h \\\r\n\t../include/command.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nhistory.obj : history.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/context.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h ../strings.h\r\ndirs.obj : dirs.c \\\r\n\t ../config.h ../include/command.h ../include/context.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h ../strings.h\r\nwhich.obj : which.c \\\r\n\t ../config.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\npopd.obj : popd.c \\\r\n\t ../config.h ../include/command.h ../include/context.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h ../strings.h\r\nexit.obj : exit.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\ncall.obj : call.c \\\r\n\t ../config.h ../context.h_c ../err_fcts.h ../include/batch.h \\\r\n\t../include/cmdline.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/kswap.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nbeep.obj : beep.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\necho.obj : echo.c \\\r\n\t ../config.h ../include/batch.h ../include/cmdline.h \\\r\n\t../include/command.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h ../strings.h\r\ntype.obj : type.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/openf.h ../include/timefunc.h ../strings.h\r\nprompt.obj : prompt.c \\\r\n\t ../config.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/context.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\ncls.obj : cls.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\npushd.obj : pushd.c \\\r\n\t ../config.h ../include/command.h ../include/context.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\ntime.obj : time.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/nls.h ../include/timefunc.h ../strings.h\r\ndoskey.obj : doskey.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\nfddebug.obj : fddebug.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h ../strings.h\r\nverify.obj : verify.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\ndel.obj : del.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h ../strings.h\r\nDYNSOURCES =\r\n#MAKEDEP STOP\r\n\r\nclobber : clean\r\n\t$(RM) $(RMFLAGS) *.com *.cln *.lib *.lst *.cfg makefile.mak\r\n\r\nclean : \r\n\t$(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj *.exe $(CFG) *.dmp com.com tags errlist\r\n\r\n\r\nmakefile.mak : makefile cmd.m1 cmd.m2\r\n\t+copy cmd.m1 + $(mktmp cmds.lib : \\44(CFG) $(OBJ:t\" \\\\\\\\\\\\n\\\\t\") \\n\\tif exist cmds.lib \\44(AR) cmds.lib /c @&&|\\n+-$(OBJ:t\" &\\\\n+-\")\\n| , cmds.lst \\n\\tif not exist cmds.lib \\44(AR) cmds.lib /c @&&|\\n+$(OBJ:t\" &\\\\n+\")\\n| , cmds.lst \\n) + cmd.m2 $@\r\n\r\n"
  },
  {
    "path": "cmd/makefile.mak",
    "content": "CFG_DEPENDENCIES = makefile.mak\r\n\r\nTOP = ..\r\n!include \"$(TOP)/config.mak\"\r\n\r\nall: $(CFG) cmds.lib\r\n\r\nOBJS1 = alias.obj beep.obj break.obj call.obj cdd.obj chcp.obj chdir.obj\r\nOBJS2 = cls.obj copy.obj ctty.obj date.obj del.obj dir.obj dirs.obj\r\nOBJS3 = doskey.obj echo.obj exit.obj exit2.obj fddebug.obj for.obj goto.obj\r\nOBJS4 = history.obj if.obj lfnfor.obj memory.obj mkdir.obj path.obj pause.obj\r\nOBJS5 = popd.obj prompt.obj pushd.obj rem.obj ren.obj rmdir.obj set.obj\r\nOBJS6 = shift.obj time.obj truename.obj type.obj verify.obj which.obj\r\n\r\ncmds.rsp : $(ECHOLIBDEP) makefile.mak\r\n\t$(RMFILES) cmds.rsp\r\n\t$(ECHOLIB) cmds.rsp $(OBJS1)\r\n\t$(ECHOLIB) cmds.rsp $(OBJS2)\r\n\t$(ECHOLIB) cmds.rsp $(OBJS3)\r\n\t$(ECHOLIB) cmds.rsp $(OBJS4)\r\n\t$(ECHOLIB) cmds.rsp $(OBJS5)\r\n\t$(ECHOLIB) cmds.rsp $(OBJS6)\r\n\r\ncmds.lib : $(CFG) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) $(OBJS6) cmds.rsp\r\n\t$(RMFILES) cmds.lib\r\n\t$(AR) cmds.lib @cmds.rsp $(LIBLIST) cmds.lst \r\n"
  },
  {
    "path": "cmd/memory.c",
    "content": "/* $Id$\r\n\r\n\tInternal command MEMORY to display the amount of memory used by\r\n\tthe various internal data structures.\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#ifdef __TURBOC__\r\n#include <alloc.h>\r\n#endif\r\n\r\n#include <environ.h>\r\n#include <mcb.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/command.h\"\r\n#include \"../strings.h\"\r\n\r\nstatic void displayTag(int string, Context_Tag tag)\r\n{\tctxt_info_t *info;\r\n\r\n\tinfo = &CTXT_INFO_STRUCT(tag);\r\n\r\n\tdisplayString(string, info->c_sizemax, info->c_sizecur\r\n\t , info->c_nummin < info->c_nummax\r\n\t \t? info->c_nummax - info->c_nummin : 0);\r\n}\r\nstatic void displayTag1(int string, Context_Tag tag)\r\n{\tctxt_info_t *info;\r\n\r\n\tinfo = &CTXT_INFO_STRUCT(tag);\r\n\r\n\tdisplayString(string, info->c_sizecur\r\n\t , info->c_nummin < info->c_nummax\r\n\t \t? info->c_nummax - info->c_nummin : 0);\r\n}\r\n\r\nint cmd_memory (char * param) {\r\n        (void)param;\r\n\tdisplayString(TEXT_MEMORY_ENVIRONMENT\r\n\t\t, mcb_length(env_glbSeg), env_freeCount(env_glbSeg));\r\n\tdisplayString(TEXT_MEMORY_CONTEXT\r\n\t\t, mcb_length(ctxt), env_freeCount(ctxt));\r\n\tdisplayTag(TEXT_MEMORY_CTXT_ALIAS, CTXT_TAG_ALIAS);\r\n\tdisplayTag(TEXT_MEMORY_CTXT_HISTORY, CTXT_TAG_HISTORY);\r\n\tdisplayTag(TEXT_MEMORY_CTXT_DIRSTACK, CTXT_TAG_DIRSTACK);\r\n\tdisplayTag1(TEXT_MEMORY_CTXT_LASTDIR, CTXT_TAG_LASTDIR);\r\n/*\tdisplayTag1(TEXT_MEMORY_CTXT_BATCH, CTXT_TAG_BATCH);\r\n\tnot used, yet -- 2001/06/11 ska*/\r\n\tdisplayTag1(TEXT_MEMORY_CTXT_SWAPINFO, CTXT_TAG_SWAPINFO);\r\n#ifdef __TURBOC__\r\n\tdisplayString(TEXT_MEMORY_HEAP, (unsigned long)coreleft());\r\n#endif\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/mkdir.c",
    "content": "/* $Id$\r\n * MD / MKDIR - makes a call to directory_handler to do its work\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <sys/stat.h>\r\n#include <string.h>\r\n\r\n#include \"suppl.h\"\r\n#include \"dfn.h\"\r\n#ifdef DBCS\r\n# include \"mbcs.h\"\r\n#endif\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/lfnfuncs.h\"\r\n\r\nint recursive_mkdir(const char * path, int recursiveMode, int quiet)\r\n{\r\n\tif (recursiveMode) {\r\n\t\tchar fullname[MAXPATH];\r\n\t\tchar *p = fullname;\r\n\t\tint flag_not_done = 0;\r\n\t\tint ret;\r\n\t\tstrcpy(fullname, path); /* so we can modify in place */\r\n\t\tdprintf((\"fullpath = %s\\n\", fullname));\r\n\t\tdo {\r\n\t\t\twhile (*p && ((*p != '\\\\') && (*p != '/'))) {\r\n#ifdef DBCS\r\n\t\t\t\tp += MbLen(p);\r\n#else\r\n\t\t\t\tp++;\r\n#endif\r\n\t\t\t}\r\n\t\t\tflag_not_done = *p; /* == 0 when end of path found, nonzero if \\ or / */\r\n\t\t\t*p = '\\0';\r\n\t\t\tdprintf((\"mkdir(%s)\\n\", fullname));\r\n\t\t\t/* validate if path exists and is a directory */\r\n\t\t\tret = dfnstat(fullname);\r\n\t\t\tif (ret) { /* found, verify it is a directory */\r\n\t\t\t\tif (!(ret & DFN_DIRECTORY)) {\r\n\t\t\t\t\t/* path component exists but not a directory */\r\n\t\t\t\t\tret = E_Other;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tret = 0;  /* no error */\r\n\t\t\t\t}\r\n\t\t\t} else { /* not found (or other error) so attempt to make directory */\r\n\t\t\t\tret = mkdir(fullname);\r\n\t\t\t}\r\n\t\t\tif (ret) {\r\n\t\t\t\tif (!quiet) {\r\n\t\t\t\t\t/* TODO show error message */\r\n\t\t\t\t}\r\n\t\t\t\treturn ret;\r\n\t\t\t}\r\n\t\t\tif (flag_not_done)\r\n\t\t\t\t*p++ = '\\\\';\r\n\t\t} while(flag_not_done);\t\t\r\n\t\treturn ret;\r\n\t} else {\r\n\t\treturn mkdir(path);\r\n\t}\r\n}\r\n\r\nint cmd_mkdir(char *param)\r\n{\r\n\treturn mk_rd_dir(param, recursive_mkdir, \"MKDIR\");\r\n}\r\n\r\n\r\n"
  },
  {
    "path": "cmd/path.c",
    "content": "/* $Id$\r\n *  PATH.C - path command.\r\n *\r\n *  Comments:\r\n *\r\n * 17 Jul 1998 (John P Price)\r\n *   Seperated commands into individual files.\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 12-Aug-1998 ska\r\n * - added: SUPPL environment handling\r\n *   currently \"PATH=\" will delete the environment variable PATH;\r\n *   if an empty one shall be created, replace chgEnv1() by chgEnv()\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/context.h\"\r\n#include \"../strings.h\"\r\n\r\n#define PATHVAR    \"PATH\"\r\n\r\nint cmd_path(char *param)\r\n{\tchar *p;\r\n\r\n\t/* >>PATH ;<< must remove the string entirely */\r\n\tif(!param || (!*(p = ltrimcl(param)) && !strchr(param, ';'))) {\r\n\t\tp = getEnv(PATHVAR);\r\n\t\tdisplayString(p? TEXT_MSG_PATH: TEXT_MSG_PATH_NONE, p);\r\n\t\tfree(p);\r\n\t\treturn 0;\r\n\t}\r\n\r\n\trtrimcl(p);\t\t\t/* remove trailing spaces */\r\n\treturn chgEnvRemove(PATHVAR, p);\r\n}\r\n"
  },
  {
    "path": "cmd/pause.c",
    "content": "/* $Id$\r\n *  PAUSE.C - pause command.\r\n *\r\n * FREEDOS extension : If resteter is specified use that as the pause\r\n *   message.\r\n *\r\n *  Comments:\r\n *\r\n * 16 Jul 1998 (Hans B Pufal)\r\n *   started.\r\n *\r\n * 16 Jul 1998 (John P Price)\r\n *   Seperated commands into individual files.\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 1999/05/03 ska\r\n * bugfix: '\\n' issued after waiting for keypress\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <string.h>\r\n#include <io.h>\r\n\r\n#include \"../include/batch.h\"\r\n#include \"../include/command.h\"\r\n#include \"../strings.h\"\r\n\r\nint cmd_pause (char * param) {\r\n\tif(param && *param)\r\n        dos_write( 1, param, strlen(param) );\r\n\telse\r\n\t\tdisplayString(TEXT_MSG_PAUSE);\r\n\r\n\tcgetchar();\r\n\toutc('\\n');\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/popd.c",
    "content": "/* $Id$\r\n *  DSTACK.C - Directory stack PUSHD/POPD support, compatible with 4/NDOS\r\n *\r\n *\tPOPD [*]\r\n *\r\n * Pops a directory off the stack, and sets it as cwd.\r\n * Accepts the parameter '*', causing it to wipe the stack.\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <stdlib.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n\r\nint cmd_popd(char *param)\r\n{\r\n\tif(!param || *param != '*') {\r\n\t\tchar *todir;\r\n\r\n\t\tif(ctxtPop(CTXT_TAG_DIRSTACK, &todir)) {\r\n\t\t\tint rc;\r\n\r\n\t\t\trc = cmd_cdd(todir);\r\n\t\t\tfree(todir);\r\n\t\t\treturn rc;\r\n\t\t}\r\n\r\n\t\tdisplayString(TEXT_DIRSTACK_EMPTY);\r\n\t}\r\n\r\n\t\t/* Wipe the dirstack */\r\n\tctxtClear(CTXT_TAG_DIRSTACK);\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/prompt.c",
    "content": "/* $Id$\r\n *  PROMPT.C - prompt handling.\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n\r\nint cmd_prompt(char *param)\r\n{\r\n  if(param && *param == '=')    /* skip '=' & spaces */\r\n    param = ltrimcl(param + 1);\r\n\r\n  /* NO rtrim()! */\r\n  return chgEnvRemove(PROMPTVAR, param);\r\n}\r\n"
  },
  {
    "path": "cmd/pushd.c",
    "content": "/* $Id$\r\n *  DSTACK.C - Directory stack PUSHD/POPD support, compatible with 4/NDOS\r\n *\r\n *\tPUSHD <dir>\r\n *\r\n * Pushes the current directory onto the stack.  If the length of\r\n * the directory string exceeds the remainer of the stack, it pops the first\r\n * entry, adjusts, and proceeds with the push.\r\n * Also: changes to the directory specified on the command line.\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <stdlib.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n\r\nint cmd_pushd(char *param)\r\n{\tchar *curdir;\r\n\r\n\tif((curdir = cwd(0)) != 0) {\r\n\t\tint rc;\r\n\r\n\t\trc = ctxtPush(CTXT_TAG_DIRSTACK, curdir);\r\n\t\tfree(curdir);\r\n\r\n\t\tif(rc == E_None) {\r\n\t\t\t/* Change to directory specified on command line */\r\n\t\t\tif(param && *param)\r\n\t\t\t\treturn cmd_cdd(param);\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}\r\n\treturn 1;\r\n}\r\n"
  },
  {
    "path": "cmd/rem.c",
    "content": "/* $Id$\r\n *  REM -- includes comments \"remarks\" into batch scripts\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/command.h\"\r\n\r\nint cmd_rem (char * param) { (void)param; return 0; }\r\n"
  },
  {
    "path": "cmd/ren.c",
    "content": "/* $Id$\r\n * REN.C - rename command\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n * 15-Mar-2003 (Wolf Bergenheim <dog@users.sf.net>)\r\n * - added support for * and ?\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <fcntl.h>\r\n#include <string.h>\r\n\r\n/*#define DEBUG*/\r\n\r\n#include <dfn.h>\r\n#include <suppl.h>\r\n#include <supplio.h>\r\n\r\n#include \"../include/lfnfuncs.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nvoid myfnsplit( const char *path,\r\n                      char *buf,\r\n                      char *drv,\r\n                      char **dir,\r\n                      char **name,\r\n                      char **ext )\r\n{\r\n    const char* end;\r\n    const char* p;\r\n    const char* s;\r\n\r\n    if( path[ 0 ] && path[ 1 ] == ':' ) {\r\n        if( drv ) {\r\n            *drv++ = *path++;\r\n            *drv++ = *path++;\r\n            *drv = '\\0';\r\n        }\r\n    } else if( drv ) *drv = '\\0';\r\n\r\n    for( end = path; *end && *end != ':'; ) end++;\r\n\r\n    for( p = end; p > path && *--p != '\\\\'/* && *p != '/'*/; )\r\n        if( *p == '.' ) {\r\n            end = p;\r\n            break;\r\n        }\r\n    if ( ext ) {\r\n        *ext = buf;\r\n        for( s = end; ( *buf++ = *s++ ) != '\\0'; );\r\n    }\r\n\r\n    for( p = end; p > path; )\r\n        if( *--p == '\\\\'/* || *p == '/'*/) {\r\n        /* \r\n         * '/' can't happen as a path seperator in FreeCOM because it's treated\r\n         * as a switch character no matter where it's found\r\n         */\r\n            p++;\r\n            break;\r\n        }\r\n\r\n    if( name ) {\r\n        *name = buf;\r\n        for( s = p; s < end; ) *buf++ = *s++;\r\n        *buf++ = '\\0';\r\n    }\r\n\r\n    if ( dir ) {\r\n        *dir = buf;\r\n        for( s = path; s < p; ) *buf++ = *s++;\r\n        *buf = '\\0';\r\n    }\r\n}\r\n\r\nvoid myfnmerge( char *path, const char *drive, const char *dir,\r\n                            const char *fname, const char *ext )\r\n{\r\n    if( *drive ) {\r\n        strcpy( path, drive );\r\n#if 0 /* Unused */\r\n        if( !drive[ 1 ] )strcat( path, \":\" );\r\n#endif\r\n    } else ( *path ) = 0;\r\n\r\n    if( *dir ) {\r\n        strcat( path, dir );\r\n        if( *( dir + strlen( dir ) - 1 ) != '\\\\' )\r\n            strcat( path, \"\\\\\" );\r\n    }\r\n\r\n    if( *fname ) {\r\n        strcat( path, fname );\r\n        if( ext && *ext ) {\r\n#if 0 /* Unused */\r\n            if( *ext != '.' ) strcat( path, \".\" );\r\n#endif\r\n            strcat( path, ext );\r\n        }\r\n    }\r\n}\r\n\r\nint cmd_rename(char *param)\r\n{\t\r\n\tchar **argv;\r\n\tint argc, opts, ec = E_None;\r\n\tstruct dos_ffblk ff;\r\n\tint appState;\r\n\r\n\tif((argv = scanCmdline(param, 0, 0, &argc, &opts)) == 0)\r\n\t\treturn 1;\r\n\r\n\tappState = appendDisable();\r\n\tif(argc < 2) {\r\n\t\terror_req_param_missing();\r\n\t\tec = E_Useage;\r\n\t}\r\n\telse if(argc > 2) {\r\n\t\terror_too_many_parameters(param);\r\n\t\tec = E_Useage;\r\n\t} else if(dos_findfirst(argv[0], &ff\r\n\t\t , FA_NORMAL|FA_DIREC|FA_ARCH|FA_SYSTEM|FA_RDONLY|FA_HIDDEN) != 0) {\r\n\t\t\terror_sfile_not_found(argv[0]);\r\n\t\t/* ec == E_None */\r\n\t} else {\r\n#if 0   /*\r\n         * There is some dynamic memory bug in relation to dfnmerge\r\n         * Let's spare ourselves the whole mucking about in dynamic memory\r\n         * thing, and we can use myfnmerge/myfnsplit to make everything work.\r\n         * Unless of course someone wants to fix the bug in dfnmerge/split\r\n         * So... the old code is still here if anyone wants to give it a shot\r\n         * AND, if anyone tries to blame the _REGISTER usage in lfnfuncs.c as\r\n         * the culprit, it already uses intr instead :-)\r\n         */\r\n\t\tchar *s_drv = NULL, *s_dir = NULL, *s_fil = NULL, *s_ext = NULL;\r\n\t\tchar *d_drv = NULL, *d_dir = NULL, *d_fil = NULL, *d_ext = NULL;\r\n\t\tchar *newname = 0, *sn = 0, *dn = 0;\r\n\t\tchar *oldFname;\r\n\r\n#define p oldFname\r\n\t\tif(!dfnsplit(argv[0], &s_drv, &s_dir, &s_fil, &s_ext)\r\n\t\t || !dfnsplit(argv[1], &d_drv, &d_dir, &d_fil, &d_ext)\r\n\t\t || (sn = dfnmerge(0, s_drv, s_dir, \"\", NULL)) == 0\r\n\t\t || (p = realloc(sn, strlen(sn) + sizeof(ff.ff_name) + 1)) == 0) {\r\n\t\t/* build dir to use */\r\n\t\t\terror_out_of_memory();\r\n\t\t\tec = E_NoMem;\r\n\t\t\tgoto errRet;\r\n\t\t}\r\n\t\tsn = p;\r\n\t\tp = strchr(sn, '\\0');\r\n#undef p\r\n#else\r\n        char s_drv[ MAXDRIVE ], d_drv[ MAXDRIVE ];\r\n        char *s_dir, *d_dir, *d_fil, *d_ext;\r\n        char s_buf[ MAXPATH ], d_buf[ MAXPATH ],\r\n             *sn, dn[ MAXPATH ], newname[MAXPATH];\r\n\r\n        myfnsplit( argv[ 0 ], s_buf, s_drv, &s_dir, NULL, NULL );\r\n        myfnsplit( argv[ 1 ], d_buf, d_drv, &d_dir, &d_fil, &d_ext );\r\n#endif\r\n\r\n\t\t/* if drive or path in second arg, return with syntax error */\r\n\t\tif((d_drv[ 0 ]) || (d_dir[ 0 ])) {\r\n\t\t\terror_syntax(argv[1]);\r\n\t\t\tec = E_Useage;\r\n\t\t\tgoto errRet;\r\n\t\t}\r\n\r\n#if 0\r\n\t\tif((dn = dfnmerge(0, s_drv, s_dir, d_fil, d_ext)) == 0) {\r\n\t\t/* build dir to use */\r\n\t\t\terror_out_of_memory();\r\n\t\t\tec = E_NoMem;\r\n\t\t\tgoto errRet;\r\n\t\t}\r\n#else\r\n        myfnmerge( dn, s_drv, s_dir, d_fil, d_ext );\r\n\t/* d_buf no longer used after this */\r\n\tsn = d_buf;\r\n#endif\r\n\r\n\t\tdo {\r\n            fillFnam(newname, dn, ff.ff_name);\r\n#if 0\r\n\t\t\tif(newname[0] == 0) {\r\n\t\t\t\terror_out_of_memory();\r\n\t\t\t\tec = E_NoMem;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n#endif\r\n\t\t\tmyfnmerge( sn, s_drv, s_dir, ff.ff_name, NULL );\r\n\t\t\tdprintf((\"rename(%s, %s)\\n\", sn, newname) );\r\n\t\t\tif(rename(sn, newname) != 0) {\r\n\t\t\t\tmyperror(\"rename\");\r\n\t\t\t\tec = E_Other;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t/*free(newname);*/\r\n            newname[0] = 0;\r\n\t\t} while(dos_findnext(&ff) == 0);\r\n\r\n\terrRet:\r\n        dos_findclose(&ff);\r\n#if 0 /* free(newname) isn't even necessary because it is free'd above */\r\n\t\tfree(s_drv); free(s_dir); free(s_fil); free(s_ext);\r\n\t\tfree(d_drv); free(d_dir); free(d_fil); free(d_ext);\r\n\t\tfree(newname); free(sn); free(dn);\r\n#endif\r\n\t}\r\n\t\r\n\tappendRestore(appState);\r\n\tfreep(argv);\r\n\treturn ec;\r\n}\r\n"
  },
  {
    "path": "cmd/rmdir.c",
    "content": "/* $Id$\r\n * RD / RMDIR - makes a call to directory_handler to do its work\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <io.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"suppl.h\"\r\n#include \"dfn.h\"\r\n#ifdef DBCS\r\n# include \"mbcs.h\"\r\n#endif\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/lfnfuncs.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#ifdef FEATURE_LONG_FILENAMES\r\n#define abspath( x, y ) abspath( getshortfilename( x ), y )\r\n#endif\r\n\r\n/* recursively delete subdirs and files */\r\n#ifdef DBCS\r\nint rmdir_withfiles(const char * fullname, char * path, int maxlen)\r\n#else\r\nint rmdir_withfiles(char * path, int maxlen)\r\n#endif\r\n{\r\n\tstruct dos_ffblk *f;\r\n\tint ret;\r\n\tint len = strlen(path);  /* Warning: we assume path is a buffer is large enough for longest file path */\r\n\tchar *p = path+len;\r\n\r\n\t/* ensure ends with \\ */\r\n#ifdef DBCS\r\n\tif (*fullname && *(CharPrev(fullname, p)) != '\\\\')\r\n#else\r\n\tif (p[-1] != '\\\\')\r\n#endif\r\n\t\t*p++ = '\\\\';\r\n\t*p = '\\0';\r\n\t\r\n\tdprintf((\"rmdir(%s)\\n\", path));\t\r\n\r\n\t/* cycle through removing directories first */\r\n\tstpcpy(p, \"*.*\");\r\n\t/* allocate our findfirst/next structure on heap to avoid exhausting stack */\r\n\tf = (struct dos_ffblk *)malloc(sizeof(struct dos_ffblk));\r\n\tif (f == NULL) {\r\n\t\terror_out_of_memory();\r\n\t\treturn E_NoMem;\r\n\t}\r\n\tif (!dos_findfirst(path, f, FA_DIREC)) {\r\n\t\tret = 0;\r\n\t\tdo {\r\n\t\t\t/* skip . and .. directory entries */\r\n\t\t\tif ((strcmp(f->ff_name, \".\")==0) ||\r\n\t\t\t    (strcmp(f->ff_name, \"..\")==0))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif (f->ff_attrib & FA_DIREC) {\r\n\t\t\t\tdprintf((\"name=%s\\n\", f->ff_name));\r\n\t\t\t\t/* avoid overflowing our buffer */\r\n\t\t\t\tif((len + strlen(f->ff_name)) > maxlen) {\r\n\t\t\t\t\terror_filename_too_long(p);\r\n\t\t\t\t\tret = E_Other;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstrcpy(p, f->ff_name);       /* Make the full path */\r\n\t\t\t\t/* recursively delete subdirectory */\r\n#ifdef DBCS\r\n\t\t\t\tret = rmdir_withfiles(fullname, path, maxlen);\r\n#else\r\n\t\t\t\tret = rmdir_withfiles(path, maxlen);\r\n#endif\r\n\t\t\t}\r\n\t\t} while (!ret && (dos_findnext(f) == 0));\r\n\t\tdos_findclose(f);\r\n\t\t/* return early on error */\r\n\t\tif (ret) {\r\n\t\t\tfree(f);\r\n\t\t\treturn ret;\r\n\t\t}\r\n\t}\r\n\r\n\t/* remove any files in current directory */\r\n\tstpcpy(p, \"*.*\");\r\n\tif (!dos_findfirst(path, f, FA_NORMAL)) {\r\n\t\tret = 0;\r\n\t\tdo {\r\n\t\t\t/* avoid overflowing our buffer */\r\n\t\t\tif((len + strlen(f->ff_name)) > maxlen) {\r\n\t\t\t\terror_filename_too_long(p);\r\n\t\t\t\tret = E_Other;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tstrcpy(p, f->ff_name);       /* Make the full path */\r\n\t\t\tdprintf((\"deleting [%s]\\n\", path));\r\n\t\t\t/* try to delete the file */\r\n\t\t\tif(unlink(path) != 0) {\r\n\t\t\t\tmyperror(path);  /* notify the user */\r\n\t\t\t\t/* could exit here, but we just let rmdir fail */\r\n\t\t\t}\r\n\t\t} while (!ret && (dos_findnext(f) == 0));\r\n\t\tdos_findclose(f);\r\n\t}\r\n\tfree(f);\r\n\r\n\t/* finally actually remove the directory */\r\n\tp[-1] = '\\0';\r\n\treturn rmdir(path);\r\n}\r\n\r\nint recursive_rmdir(const char * path, int recursiveMode, int quiet)\r\n{\r\n\tif (recursiveMode) {\r\n\t\tstruct dos_ffblk f;\r\n\t\tchar *p;\r\n\t\tstatic char fullname[MAXPATH + sizeof(f.ff_name) + 2];\r\n\t\tint len;\r\n\t\t/* Get the pattern fully-qualified */\r\n\t\t\t/* Note: An absolute path always contains:\r\n\t\t\t\tA:\\\\\r\n\t\t\t\t--> It's always three bytes long at minimum\r\n\t\t\t\tand always contains a backslash */\r\n\t\tp = abspath(path, 1);\r\n\t\tif(!p)\r\n\t\t\treturn E_Other;\r\n\t\tassert(strlen(p) >= 3);\r\n\r\n\t\tif((len = strlen(p)) >= MAXPATH) {\r\n\t\t\terror_filename_too_long(p);\r\n\t\t\tfree(p);\r\n\t\t\treturn E_Other;\r\n\t\t}\r\n\t\tstrcpy(fullname, p);\r\n\t\tfree(p);\r\n\t\tp = fullname + len;\r\n\r\n\t\t/* validate path exists and is a directory */\r\n\t\tif(!(dfnstat(fullname) & DFN_DIRECTORY)) {\r\n\t\t\t/* not a directory */\r\n\t\t\treturn E_Other;\r\n\t\t}\r\n\t\t\r\n\t\t/* ensure ends with \\ */\r\n#ifdef DBCS\r\n\t\tif (len > 0 && *(CharPrev(fullname, p)) != '\\\\')\r\n#else\r\n\t\tif (p[-1] != '\\\\')\r\n#endif\r\n\t\t\t*p++ = '\\\\';\r\n\t\t*p = 0;\r\n\t\t\r\n\t\t/* prompt user if they are sure, regardless if files or not */\r\n\t\tif (!quiet) {\r\n\t\t\tint r;\r\n\t\t\tr = userprompt(PROMPT_DELETE_ALL, fullname);  /* Are you sure? TODO fix me */\r\n\t\t\t\t\r\n\t\t\tif (r != 1) {\r\n\t\t\t\treturn E_Other;\r\n\t\t\t}\r\n\t\t}\r\n#ifdef DBCS\r\n\t\treturn rmdir_withfiles(fullname, fullname, sizeof(fullname));\r\n#else\r\n\t\treturn rmdir_withfiles(fullname, sizeof(fullname));\r\n#endif\r\n\t} else {\r\n\t\treturn rmdir(path);\r\n\t}\r\n}\r\n\r\nint cmd_rmdir(char *param)\r\n{\r\n\treturn mk_rd_dir(param, recursive_rmdir, \"RMDIR\");\r\n}\r\n"
  },
  {
    "path": "cmd/set.c",
    "content": "/* $Id$\r\n *\tSet environment variables\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#include <io.h>\r\n#include <fcntl.h>\r\n\r\n#include \"environ.h\"\r\n#include \"nls_c.h\"\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#define promptBuffer 256\r\n\r\n/* optC determines if env variable's name (param) is set using\r\n   passed in case or uppercased, whereas upCaseValue determines\r\n   if the value the user passes in (with the /P option) is\r\n   stored as typed or uppercased. */\r\nstatic int optC, promptUser, upCaseValue, optExecute;\r\n\r\noptScanFct(opt_set)\r\n{\r\n  (void)arg;\r\n  switch(ch) {\r\n  /* case 'A': return optScanBool(optA); arithmetic expression */\r\n  case 'C': return optScanBool(optC);\r\n  case 'U': return optScanBool(upCaseValue);\r\n#if 1\r\n  case 'I': /* Display Information about current memory */\r\n\t\tprintf(\"Size of environment segment: %u bytes; unused: %u\\n\"\r\n\t\t , env_resize(0, 0), env_freeCount(env_glbSeg));\r\n\t\treturn E_Other;\r\n#endif\r\n  case 'P': return optScanBool(promptUser);\r\n  case 'E': return optScanBool(optExecute);\r\n  }\r\n  optErr();\r\n  return E_Useage;\r\n}\r\n\r\nint cmd_set(char *param)\r\n{\tchar *value;\r\n\tchar *promptBuf = 0, tempcmd[255];\r\n\tint ret;\r\n\r\n\toptC = promptUser = upCaseValue = optExecute = 0;\r\n\r\n\tif(leadOptions(&param, opt_set, 0) != E_None)\r\n\t\treturn 1;\r\n\r\n\tswitch(breakVarAssign(ctxtEnvironment, param, &value)) {\r\n\tcase 1:\t\t\t/* no equal sign */\r\n#ifdef FEATURE_CMD_SET_PRINT\r\n        if( ( value = getEnv( param ) ) != NULL ) printf( \"%s\\n\", value );\r\n        else {\r\n            error_env_var_not_found( param );\r\n            return( 1 );\r\n        }\r\n        free(value);\r\n        return( 0 );\r\n#else\r\n\t\terror_syntax(0);\r\n\t\treturn 1;\r\n#endif\r\n\tcase 0:\t\t\t/* displayed */\r\n\t\treturn 0;\r\n#ifdef DEBUG\r\n\tcase 2: break;\r\n\tdefault:\r\n\t\tdprintf((\"[SET: Invalid response from breakVarAssign()]\\n\"));\r\n\t\treturn 1;\r\n#endif\r\n\t}\r\n\r\n\tif(promptUser) {\t/* -> Display the value, then read and assign */\r\n\t\tint len;\r\n\t\tassert(value);\r\n\t\touts(value);\r\n\t\tpromptBuf = malloc(promptBuffer);\r\n\t\tif(!promptBuf) {\r\n\t\t\terror_out_of_memory();\r\n\t\t\treturn E_NoMem;\r\n\t\t}\r\n\t\tlen = dos_read(0, promptBuf, promptBuffer-1);\r\n\t\tif(cbreak || len < 0) {\r\n\t\t\tfree(promptBuf);\r\n\t\t\treturn E_CBreak;\r\n\t\t}\r\n\t\tvalue = &promptBuf[len];\r\n\t\twhile(--value >= promptBuf && (*value == '\\n' || *value == '\\r'));\r\n\t\tvalue[1] = '\\0';\t/* strip trailing newlines */\r\n\t\tvalue = promptBuf;\r\n\t}\r\n    if (optExecute) {\r\n        char *tempfile = tmpfn();\r\n        int fd, len;\r\n\r\n        if (!tempfile) return (1);\r\n        sprintf (tempcmd, \"%s>%s\", value, tempfile);\r\n        parsecommandline (tempcmd, TRUE);\r\n        fd = dos_open (tempfile, O_RDONLY);\r\n        if (fd < 0) {\r\n            unlink (tempfile);\r\n            free (tempfile);\r\n            return (1);\r\n        }\r\n        len = dos_read(fd, tempcmd, 254);\r\n        if (len >= 0) {\r\n            value = memchr(tempcmd, '\\n', len);\r\n            if (value) len = value - tempcmd;\r\n\t    if (len > 0 && tempcmd[len-1] == '\\r') len--;\r\n            tempcmd[len] = '\\0';\r\n        }\r\n        value = tempcmd;\r\n        dos_close (fd);\r\n        unlink (tempfile);\r\n        free (tempfile);\r\n    }\r\n\r\n\t/* If the value is just blanks, it means to delete the value;\r\n\t\tbut otherwise even leading and trailing spaces must be kept */\r\n\tif(is_empty(value))\r\n\t\tvalue = 0;\r\n\r\n\tif (upCaseValue) StrUpr(value); /* set value as upper case, eg for if testing */\r\n\r\n\tret = chgEnvCase(optC, param, value);\r\n\tfree(promptBuf);\r\n\treturn ret;\r\n}\r\n"
  },
  {
    "path": "cmd/shift.c",
    "content": "/* $Id$\r\n *  SHIFT.C - shift command.\r\n *\r\n * Only valid inside batch files.\r\n *\r\n * FREEDOS extension : optional parameter DOWN to allow shifting\r\n *   parameters backwards.\r\n *\r\n * 16 Jul 1998 (Hans B Pufal)\r\n *   started.\r\n *\r\n * 16 Jul 1998 (John P Price)\r\n *   Seperated commands into individual files.\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/batch.h\"\r\n#include \"../include/command.h\"\r\n\r\nint cmd_shift(char *param)\r\n{\r\n\tstruct bcontext *b = activeBatchContext();\r\n\r\n\tif(!b)\r\n\t\t/* not in batch - error */\r\n\t\treturn 1;\r\n\r\n\tassert(param);\r\n\tif(stricmp(param, \"down\") == 0) {\r\n\t\tif(b->shiftlevel)\r\n\t\t\tb->shiftlevel--;\r\n\t} else                          /* shift up */\r\n\t\tb->shiftlevel++;\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/time.c",
    "content": "/* $Id$\r\n *  TIME.C - time internal command\r\n *\r\n *  Comments:\r\n *\r\n *  07/08/1998 (John P. Price)\r\n *    started.\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 1999/03/17 ska\r\n * bugfix: Detection of invalid time strings\r\n *  One can specify:\r\n *    ^\\s*\\d+.\\d+(.(\\d+(.\\d*)?)?)?\\s*([aApP]([mM]|\\.[mM]\\.)?\\s*$\r\n *  If one specifies:\r\n *    1 number --> error\r\n *    2 numbers --> hour:minute, seconds & hundreds default to zero\r\n *    3 numbers --> hour:minute:seconds, hundreds defaults to zero\r\n *    4 numbers --> hour:minute:seconds.hundreds\r\n *  The numbers may be delimited by any character from the 7-bit ASCII set,\r\n *  which is printable, but not alphanumerical.\r\n *\r\n * 2001/02/08 ska\r\n * add: DATE /D and TIME /T\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <dos.h>\r\n#include <io.h>\r\n#include <stdlib.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/nls.h\"\r\n#include \"../strings.h\"\r\n\r\nstatic int noPrompt = 0;\r\n\r\noptScanFct(opt_date)\r\n{\r\n  (void)arg;\r\n  switch(ch) {\r\n  case 'D':\r\n  case 'T': return optScanBool(noPrompt);\r\n  }\r\n  optErr();\r\n  return E_Useage;\r\n}\r\n\r\n\r\nstatic int my_settime(const char *s)\r\n{\tstruct dostime_t t;\r\n\r\n\tswitch(parsetime(s, &t)) {\r\n\tcase E_None:\t\t/* success -> set the date */\r\n\t\t_dos_settime(&t);\r\n\t\t/* fall through */\r\n\tcase E_Empty:\t\t/* empty line */\r\n\t\treturn 1;\t\t/* success */\r\n\t}\r\n\r\n\treturn 0;\t\t\t/* failure */\r\n}\r\n\r\nint cmd_time(char *param)\r\n{\r\n\tchar s[40];\r\n\tint ec;\r\n\r\n\tnoPrompt = 0;\r\n\r\n\tif((ec = leadOptions(&param, opt_date, 0)) != E_None)\r\n\t\treturn ec;\r\n\r\n\tif(!*param) {\r\n\t\tchar *time;\r\n\r\n\t\tif((time = curTime()) == 0)\r\n\t\t\treturn 1;\r\n\r\n\t\tdisplayString(TEXT_MSG_CURRENT_TIME, time);\r\n\t\tfree(time);\r\n\t\tparam = 0;\r\n\t}\r\n\r\n\twhile(1) {\r\n\t\tif(!param) {\r\n\t\t\tint len;\r\n\t\t\tif(noPrompt) return 0;\r\n\r\n\t\t\tdisplayString(TEXT_MSG_ENTER_TIME);\r\n\t\t\tlen = dos_read(0, s, sizeof(s) - 1);\r\n\t\t\tif (cbreak || len < 0)\r\n\t\t\t\treturn 1;\r\n\t\t\ts[len] = '\\0';\r\n\t\t\tparam = s;\r\n\t\t}\r\n\t\tif(my_settime(param))\r\n\t\t\tbreak;\r\n\t\terror_invalid_time();\r\n\t\t/* force user interaction the next time around. */\r\n\t\tparam = 0;\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/truename.c",
    "content": "/* $Id$\r\n * TRUENAME.C -- Truename Command (undocumented DOS?)\r\n *\r\n * 07/14/98 (Rob Lake)\r\n *  - started and tested fine\r\n *  - added stand alone debugging\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 28-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - changed _truename function so it does not return a pointer to a local\r\n *   variable.\r\n *\r\n * 09-Aug-1998 (Rob Lake <rlake@cs.mun.ca>)\r\n * - _truename now sets errno\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n\r\n#include <dfn.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nint cmd_truename(char *param)\r\n{\r\n\tchar *p;\r\n\r\n\tif(0 != (p = truepath((param && *param)? param: \".\"))) {\r\n\t\tputs(p);\r\n\t\tfree(p);\r\n\t\treturn 1;\r\n\t}\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "cmd/type.c",
    "content": "/* $Id$\r\n *  TYPE.C - type internal command\r\n *\r\n *  Comments:\r\n *\r\n *  07/08/1998 (John P. Price)\r\n *    started.\r\n *\r\n * 07/12/98 (Rob Lake)\r\n *    - Changed error messages\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 10-Aug-1998 ska\r\n * - added ^Break checking\r\n *\r\n * 1999/01/24 ska\r\n * add: support for CP/M style device names (openf.h)\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <io.h>\r\n#include <fcntl.h>\r\n#include <string.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/openf.h\"\r\n#include \"../strings.h\"\r\n\r\nint cmd_type(char *param)\r\n{\r\n\tchar buf[256];\r\n\tchar **argv;\r\n\tint argc, opts, ec = E_None;\r\n\tint fd, len;\r\n\r\n\tif((argv = scanCmdline(param, 0, 0, &argc, &opts)) == 0)\r\n\t\treturn 1;\r\n\r\n\t/* Because no option was passed into scanCmdline() no\r\n\t\toption can have been processed */\r\n\tassert(opts == 0);\r\n\r\n\tif(!argc) {\r\n\t\terror_req_param_missing();\r\n\t\tec = E_Useage;\r\n\t\tgoto errRet;\r\n\t}\r\n\r\n\tfor(argc = 0; argv[argc]; ++argc) {\r\n\t\tif((fd = devopen(argv[argc], O_RDONLY)) < 0) {\r\n\t\t\terror_sfile_not_found(argv[argc]);\r\n\t\t\tec = E_Other;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\twhile((len = dos_read(fd, buf, sizeof(buf))) >= 0) {\r\n\t\t\tchar *bufp, *p;\r\n\t\t\tif(cbreak) {\r\n\t\t\t\tdos_close(fd);\r\n\t\t\t\tec = E_CBreak;\r\n\t\t\t\tgoto errRet;\r\n\t\t\t}\r\n\t\t\tbufp = buf;\r\n\t\t\tfor(p = buf; p < buf+len; p++) {\r\n\t\t\t\tif(*p == 26) break; /* CTRL-Z */\r\n\t\t\t\tif(*p == '\\r' || *p == '\\n') {\r\n\t\t\t\t\tif(p > bufp) dos_write(1, bufp, p - bufp);\r\n\t\t\t\t\tif(*p == '\\n') dos_write(1, \"\\r\\n\", 2);\r\n\t\t\t\t\tbufp = p + 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tdos_write(1, bufp, p - bufp);\r\n\t\t\tif (len == 0 || *p == 26) break;\r\n\t\t}\r\n\t\tdos_close(fd);\r\n\t\tif(cbreak) {\r\n\t\t\tec = E_CBreak;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\nerrRet:\r\n\tfreep(argv);\r\n\r\n\treturn ec;\r\n}\r\n"
  },
  {
    "path": "cmd/verify.c",
    "content": "/* $Id$\r\n *  VERIFY.C - verify command.\r\n *\r\n *  Comments:\r\n *\r\n * 31 Jul 1998 (John P Price)\r\n *   started.\r\n *\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n\r\n#include \"../err_fcts.h\"\r\n#include \"../include/command.h\"\r\n#include \"../strings.h\"\r\n\r\n#ifdef __WATCOMC__\r\nvoid setverify(char a);\r\n#pragma aux setverify = \\\r\n\t\"mov ah,0x2e\" \\\r\n\t\"mov dl,0\" \\\r\n\t\"int 0x21\" \\\r\n\t__parm [__al] __modify __exact [__ah __dl]\r\nchar getverify(void);\r\n#pragma aux getverify = \\\r\n\t\"mov ah,0x54\" \\\r\n\t\"int 0x21\" \\\r\n\t__value [__al] __modify __exact [__ah]\r\n#endif\r\n\r\n#ifdef __GNUC__\r\nstatic inline void setverify(char a)\r\n{\r\n\tasm volatile(\"int $0x21\":: \"Rah\"((char)0x2e), \"Rdl\"((char)0), \"Ral\"(a));\r\n}\r\n\r\nstatic inline char getverify(void)\r\n{\r\n\tchar ret;\r\n\tasm volatile(\"int $0x21\": \"=Ral\"(ret): \"Rah\"((char)0x54));\r\n\treturn ret;\r\n}\r\n#endif\r\n\r\nint cmd_verify(char *param)\r\n{\r\n  switch(onoffStr(param)) {\r\n  \tdefault:\r\n\t\terror_on_off();\r\n\t\treturn 1;\r\n\tcase OO_Null:\tcase OO_Empty:\r\n\t\tdisplayString(TEXT_MSG_VERIFY_STATE, getverify() ? D_ON : D_OFF);\r\n\t\tbreak;\r\n  \tcase OO_Off:\tsetverify(0);\tbreak;\r\n  \tcase OO_On:\t\tsetverify(1);\tbreak;\r\n\t}\r\n  return 0;\r\n}\r\n"
  },
  {
    "path": "cmd/which.c",
    "content": "/* $Id$\r\n *  WHERE.C - path functions.\r\n *\r\n *\r\n *\r\n *  Comments:\r\n *\r\n *  07/15/95 (Tim Norman)\r\n *    started.\r\n *\r\n *  08/08/95 (Matt Rains)\r\n *    i have cleaned up the source code. changes now bring this source into\r\n *    guidelines for recommended programming practice.\r\n *\r\n *  12/12/95 (Steffan Kaiser & Tim Norman)\r\n *    added some patches to fix some things and make more efficient\r\n *\r\n *  1/6/96 (Tim Norman)\r\n *    fixed a stupid pointer mistake...  Thanks to everyone who noticed it!\r\n *\r\n *  8/1/96 (Tim Norman)\r\n *    fixed a bug when getenv returns NULL\r\n *\r\n *  8/7/96 (Steffan Kaiser and Tim Norman)\r\n *    speed improvements and bug fixes\r\n *\r\n *  8/27/96 (Tim Norman)\r\n *    changed code to use pointers directly into PATH environment variable\r\n *    rather than making our own copy.  This saves some memory, but requires\r\n *    we write our own function to copy pathnames out of the variable.\r\n *\r\n *  12/23/96 (Aaron Kaufman)\r\n *    Fixed a bug in get_paths() that did not point to the first PATH in the\r\n *    environment variable.\r\n *\r\n *  7/12/97 (Tim Norman)\r\n *    Apparently, Aaron's bugfix got lost, so I fixed it again.\r\n *\r\n *  16 July 1998 (John P. Price)\r\n *    Added stand alone code.\r\n *\r\n *  17 July 1998 (John P. Price)\r\n *    Rewrote find_which to use searchpath function\r\n *\r\n * 24-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - fixed bug where didn't check all extensions when path was specified\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 30-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - fixed so that it find_which returns NULL if filename is not executable\r\n *   (does not have .bat, .com, or .exe extention). Before command would\r\n *   to execute any file with any extension (opps!)\r\n *\r\n * 2001/02/16 ska\r\n * add: command WHICH\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdio.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n\r\n\r\nint cmd_which(char *param)\r\n{\r\n\tchar **arg, *p;\r\n\tint argc, optc, i;\r\n\r\n\tif((arg = scanCmdline(param, 0, 0, &argc, &optc)) == 0)\r\n\t\treturn E_Other;\r\n\r\n\tfor(i = 0; i < argc; ++i) {\r\n\t\tassert(arg[i]);\r\n\t\touts(arg[i]);\r\n\t\tif((p = find_which(arg[i])) != 0) {\r\n\t\t\toutc('\\t');\r\n\t\t\tputs(p);\r\n\t\t} else {\r\n\t\t\toutc('\\n');\r\n\t\t}\r\n\t}\r\n\r\n\tfreep(arg);\r\n\treturn E_None;\r\n}\r\n"
  },
  {
    "path": "command.lsm",
    "content": "Begin3\r\nTitle:          FreeCom\r\nVersion:        0.87\r\nEntered-date:   Mon DD 202Y\r\nDescription:    The FreeDOS Command Shell\r\nKeywords:       freecom freedos command shell\r\nAuthor:         freedos-devel@lists.sourceforge.net (developers)\r\nMaintained-by:  freedos-devel@lists.sourceforge.net (maintainers)\r\nPrimary-site:   https://github.com/FDOS/freecom\r\nAlternate-site: http://freedos.sourceforge.net/\r\nAlternate-site: http://www.freedos.org/\r\nPlatforms:      dos dosemu\r\nCopying-policy: GNU General Public License, Version 2 (GPL)\r\nWiki-site:      http://wiki.freedos.org/wiki/index.php/Command\r\nEnd\r\n"
  },
  {
    "path": "config.b",
    "content": "@echo off\r\n:-****************************************************************\r\n:-  NOTICE!  You can edit but then copy this file to CONFIG.BAT! *\r\n:-****************************************************************\r\n\r\n:-**********************************************************************\r\n:-- define NASM executable\r\n:-**********************************************************************\r\n\r\nset XNASM=nasm\r\n\r\n:**********************************************************************\r\n:- define your COMPILER type here, pick one of them\r\n:**********************************************************************\r\n\r\n:- Open Watcom C\r\n:- set COMPILER=WATCOM\r\n:- Turbo C 2.01\r\n:- set COMPILER=TC2\r\n:- Turbo C++ 1.01\r\nset COMPILER=TURBOCPP\r\n:- Borland C\r\n:- set COMPILER=BC5\r\n\r\n:-**********************************************************************\r\n:-- where is the BASE dir of your compiler(s) ??\r\n:-**********************************************************************\r\n                                                \r\n:- set TC2_BASE=c:\\tc201\r\nset TP1_BASE=c:\\tcpp\r\n:- set BC5_BASE=c:\\bc5\r\n\r\n:- if WATCOM maybe you need to set your WATCOM environment variables \r\n:- and path\r\n:- if not \\%WATCOM% == \\ goto watcom_defined\r\n:- set WATCOM=c:\\watcom\r\n:- set PATH=%PATH%;%WATCOM%\\binw\r\n:watcom_defined\r\n"
  },
  {
    "path": "config.h",
    "content": "/*\r\n * config.h - Used to configure what will be compiled into the shell.\r\n *\r\n */\r\n\r\n/* define DEBUG to add debugging code */\r\n#ifndef DEBUG           /* possibly already defined via command line */\r\n/*#define DEBUG*/\r\n#endif\r\n\r\n/* Define to enable the alias command, and aliases. */\r\n#define FEATURE_ALIASES\r\n#define ALIAS_DEFAULT_SIZE 1024\r\n\r\n/* Define to disable context error messages that may scare a user */\r\n/* #define NO_CONTEXT_ERROR */\r\n\r\n/* Define to enable enhanced input (prerequisite of History and Filename\r\n    completion */\r\n#define FEATURE_ENHANCED_INPUT\r\n\r\n/* Define to enable history (aka DOSKEY); requires: Enhanced Input */\r\n#define FEATURE_HISTORY\r\n#define HISTORY_DEFAULT_SIZE 256\r\n\r\n/* Define to enable filename completion; requires: Enhanced Input */\r\n#define FEATURE_FILENAME_COMPLETION\r\n\r\n/* Define to enable to load messages into memory */\r\n#define FEATURE_LOAD_MESSAGES\r\n\r\n/* Define to enable /Z support, display exit code on program exit */\r\n#define DISP_EXITCODE\r\n\r\n/* Define to enable usage of LFNs */\r\n#define FEATURE_LONG_FILENAMES\r\n\r\n/* Define to enable usage or the DOS switch character in option processing */\r\n#define FEATURE_SWITCHAR\r\n\r\n/* Define to enable printing of environment variables for \"SET VAR\" syntax */\r\n/* (Like Win2k's cmd.exe does) */\r\n#define FEATURE_CMD_SET_PRINT\r\n\r\n/* Define for limited support of 4DOS DESCRIPT.ION files */\r\n#define FEATURE_DESCRIPT_ION\r\n\r\n/* Define to enable DOS NLS */\r\n#define FEATURE_NLS\r\n\r\n/* Define to enable F5/F8 key test on startup if /P is present on\r\n    command line */\r\n/* #define FEATURE_BOOT_KEYS */\r\n\r\n/* Command line logging feature */\r\n/* #define FEATURE_CALL_LOGGING */\r\n\r\n/* Preserves last directory (CD, CHDIR, CDD, PUSHD, POPD);\r\n    \"CD -\" chdir's there */\r\n#define FEATURE_LAST_DIR\r\n\r\n/* Enables CDD to a filepath (ignores filename portion) */\r\n#define FEATURE_CDD_FNAME\r\n\r\n/* Enable to support installable COMMAND extensions (MUX-AE)\r\n */\r\n#define FEATURE_INSTALLABLE_COMMANDS\r\n/* How often gets the MUX-AE called, when an installable command\r\n    extension rewrote the command. */\r\n#define MUX_AE_MAX_REPEAT_CALL  32\r\n\r\n/* Name of the executable */\r\n#define COM_NAME \"COMMAND.COM\"\r\n/* standard name of AUTOEXEC.BAT */\r\n#define AUTO_EXEC \"\\\\autoexec.bat\"\r\n/* Logfile for some logging features; MUST be fully-qualified! */\r\n#define LOG_FILE \"C:\\\\FreeCom.log\"\r\n\r\n/* Define to number of loops when to redirect to CON if the\r\n    shells hangs in the \"hangForEver()\" loop\r\n   Undefine to remove this feature */\r\n#define FEATURE_AUTO_REDIRECT_TO_CON 5\r\n\r\n/* How many batch files should be nestable minimally */\r\n#define BATCH_NESTLEVEL_MIN 5\r\n\r\n/* Define to support kernel-supported swapout of FreeCOM\r\n    see DOCS\\K-SWAP.TXT\r\n*/\r\n#define FEATURE_KERNEL_SWAP_SHELL\r\n\r\n/* Define to support XMS-only swap support of FreeCOM\r\n    This setting is incompatible with the above one!\r\n*/\r\n/* #define FEATURE_XMS_SWAP */\r\n\r\n/* Define the size of the buffer used to store old paths for PUSHD/POPD */\r\n#define DIRSTACK_DEFAULT_SIZE 256\r\n\r\n/* Use this errorlevel if an external program was terminated by\r\n    ^C or ^Break --> DOS error code interrupted system call */\r\n#define CBREAK_ERRORLEVEL 0x5F\r\n\r\n/* Use these filemode while searching for file completion */\r\n#define FILE_SEARCH_MODE FA_RDONLY | FA_ARCH | FA_DIREC\r\n\r\n/* If no /E: is specified, always keep this amount of bytes\r\n    free within the environment */\r\n#define ENVIRONMENT_KEEP_FREE 256\r\n\r\n\r\n/* Default message settings:\r\n  PATTERN: how the string is constructed for the ID (with \\n)\r\n  OUTOFMEMORY: string to issue on out-of-memory condition (no \\n)\r\n  ID_: the error ID when no default pattern is to be created, but\r\n    the out-of-memory string is to be displayed\r\n*/\r\n#define MSG_DFL_PATTERN \"String #%u\\n\"\r\n#define MSG_DFL_OUTOFMEMORY \"Out of memory!\"\r\n#define MSG_ERR_ID_OUTOFMEMORY TEXT_ERROR_OUT_OF_MEMORY\r\n\r\n\r\n/* Default prompt */\r\n#define DEFAULT_PROMPT \"$P$G\"\r\n\r\n/* Provides the uppermost size the context may have */\r\n#define CONTEXT_MAX_SIZE (65535U - 12)\r\n\r\n/* Define this value to select the initialization value of fddebug */\r\n#define FDDEBUG_INIT_VALUE 1\r\n\r\n#define INCLUDE_CMD_BEEP\r\n#define INCLUDE_CMD_BREAK\r\n#define INCLUDE_CMD_CHDIR\r\n#define INCLUDE_CMD_CHCP\r\n#define INCLUDE_CMD_CDD\r\n#define INCLUDE_CMD_CLS\r\n#define INCLUDE_CMD_COPY\r\n#define INCLUDE_CMD_CTTY\r\n#define INCLUDE_CMD_DATE\r\n#define INCLUDE_CMD_DEL\r\n#define INCLUDE_CMD_DIR\r\n#define INCLUDE_CMD_DIRS\r\n#ifdef FEATURE_LONG_FILENAMES\r\n#define INCLUDE_CMD_LFNFOR\r\n#endif\r\n#define INCLUDE_CMD_LOADFIX\r\n#define INCLUDE_CMD_LOADHIGH\r\n/*#define INCLUDE_CMD_FAKELOADHIGH */ /* DO NOT include this and CMD_LOADHIGH nor CMD_LOADFIX */\r\n#define INCLUDE_CMD_MEMORY\r\n#define INCLUDE_CMD_MKDIR\r\n#define INCLUDE_CMD_PATH\r\n#define INCLUDE_CMD_PAUSE\r\n#define INCLUDE_CMD_PROMPT\r\n#define INCLUDE_CMD_PUSHD\r\n#define INCLUDE_CMD_POPD\r\n#define INCLUDE_CMD_REM\r\n#define INCLUDE_CMD_RENAME\r\n#define INCLUDE_CMD_RMDIR\r\n#define INCLUDE_CMD_SET\r\n#define INCLUDE_CMD_TIME\r\n#define INCLUDE_CMD_TRUENAME\r\n#define INCLUDE_CMD_TYPE\r\n#define INCLUDE_CMD_VER\r\n#define INCLUDE_CMD_VERIFY\r\n#define INCLUDE_CMD_VOL\r\n#define INCLUDE_CMD_QUESTION\r\n#define INCLUDE_CMD_WHICH\r\n#ifdef DEBUG\r\n#define INCLUDE_CMD_FDDEBUG\r\n#endif\r\n/*\r\n   command that do not have a define:\r\n\r\n   exit\r\n   call\r\n   echo\r\n   goto\r\n   for\r\n   if\r\n   shift\r\n\r\n */\r\n\r\n/********\r\n    ***** Resolve dependencies\r\n    ***** Don't change without change the appropriate sources!\r\n    ************/\r\n#if defined(INCLUDE_CMD_PUSHD) || defined(INCLUDE_CMD_POPD)\r\n#define INCLUDE_CMD_CDD\r\n#endif\r\n\r\n/* Not available with TURBOC++ 1.0 or earlier: */\r\n#ifdef __TURBOC__\r\n\r\n#if __TURBOC__ > 0x297\r\n#define _TC_LATER_\r\n#else\r\n#define _TC_EARLY_\r\n#endif\r\n\r\n#endif\r\n\r\n/* Define if your compiler does not have 'dosdate_t' or 'dostime_t' */\r\n#if defined(_TC_EARLY_) || defined(__GNUC__)\r\n    /* TC++1 */\r\n#define _NO__DOS_DATE\r\n#define _NO__DOS_TIME\r\n#define _NO_FMEMCHR\r\n#define _NO_FMEMCMP\r\n#endif\r\n\r\n\r\n    /* set by MKDIST.BAT */\r\n#ifdef IGNORE_ENHANCED_INPUT\r\n#undef FEATURE_ENHANCED_INPUT\r\n#endif\r\n\r\n#ifndef FEATURE_ENHANCED_INPUT\r\n#undef FEATURE_HISTORY\r\n#undef FEATURE_FILENAME_COMPLETION\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_PUSHD\r\n#define FEATURE_DIRSTACK\r\n#endif\r\n\r\n#if CONTEXT_MAX_SIZE > 65535U - 12\r\n#error \"The maximal context size may not exceed 65535 - 12 bytes\"\r\n#endif\r\n\r\n#if defined(FEATURE_KERNEL_SWAP_SHELL) && defined(FEATURE_XMS_SWAP)\r\n#error \"FreeCOM cannot support both Kernel- and XMS-based swapping simultaneously\"\r\n#endif\r\n\r\n/* Externally defined to compile with XMS-Swap support */\r\n#if defined(XMS_SWAP)\r\n#undef FEATURE_KERNEL_SWAP_SHELL\r\n#define FEATURE_XMS_SWAP\r\n#endif\r\n\r\n#ifdef __TURBOC__\r\n#if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__)\r\n/* Compiling in Large memory model --> turn of Warning:\r\n    \"Conversation may lose significant digits\"  */\r\n#pragma warn -sig\r\n#endif\r\n#endif\r\n\r\n#include \"../include/debug.h\"\r\n"
  },
  {
    "path": "config.std",
    "content": "# defaults for DOS; can be overridden in compiler makefiles\r\nDIRSEP = \\ #a backslash\r\nECHOTO = echoto\r\nECHOTODEP = echoto.bat\r\nLIBLIST = ,\r\nECHOLIB = echolib\r\nECHOLIBDEP = echolib.bat\r\nCP = copy\r\nCLO =\r\nSCRIPTS_PATH = ..\\scripts\r\n!if $(TOP2LVL)0 == 10\r\nSCRIPTS_PATH = ..\\..\\scripts\r\n!endif\r\nRMFILES = $(SCRIPTS_PATH)\\rmfiles\r\n\r\nFIXSTRSOPT = --lib\r\n\r\n## Where the pre-compiled SUPPL files are located\r\n## See DOCS\\SUPPL.TXT for more information about this library\r\nSUPPL_INC_PATH = ..$(DIRSEP)suppl\r\nSUPPL_LIB_PATH = $(SUPPL_INC_PATH)\r\n\r\n## Memory model of FreeCOM\r\n!if $(DEBUG)0 == 10\r\nSHELL_MMODEL=m\r\nDEBUG=-DDEBUG\r\n!else\r\nSHELL_MMODEL=s\r\nDEBUG=-UDEBUG -DNDEBUG\r\n!endif\r\nSHELL_MMODEL_COMP=$(SHELL_MMODEL)\r\n\r\n## Compact Memory model used if it requires far data pointers, so uses compact memory model by default\r\nCOMPACT_MMODEL=-mc\r\n\r\n## Add -DDEBUG=1 below to enable debug support for assembly files\r\nNASMFLAGS = -I$(TOP)/include\r\n\r\n!include \"$(TOP)/mkfiles/$(COMPILER).mak\"\r\n\r\n## Which programs to use\r\nNASM = $(XNASM)\r\n\r\n## Add -DDEBUG=1 below to enable FreeCOM-debug support for C files\r\n## Add -DNDEBUG=1 below to disable any debug (even assert)\r\n\r\n!if $(XMS_SWAP)0 == 10\r\n__XMS_SWAP = -DXMS_SWAP\r\n!endif\r\n\r\n!if $(COMPACT_MODEL)0 == 10\r\nMMODEL = $(COMPACT_MMODEL)\r\n!endif\r\n\r\n# Default configuration\r\n# added strings.h here because $(CFG) is included everywhere already\r\n## Add -D_NO__DOS_DATE if your compiler does not have no dosdate_t (*)\r\n## Add -D_NO__DOS_TIME if your compiler does not have no dostime_t (*)\r\n## Add -D_NO_FMEMCHR if your compiler does not have no _fmemchr() (*)\r\n## Add -D_NO_FMEMCMP if your compiler does not have no _fmemcmp() (*)\r\n##\r\n## (*) Note: Should be detected by CONFIG.H automatically for Turbo C\r\n##     and Borland C compilers.\r\n$(CFG): $(ECHOTODEP) $(CFG_DEPENDENCIES) $(TOP)/config.mak\r\n\t$(RMFILES) $(CFG)\r\n\t$(ECHOTO) $(CFG) $(CFLAGS1)\r\n\t$(ECHOTO) $(CFG) $(CFLAGS2)\r\n\t$(ECHOTO) $(CFG) $(INCLUDEPATH) -I$(SUPPL_INC_PATH)\r\n\t$(ECHOTO) $(CFG) -m$(SHELL_MMODEL_COMP) $(MMODEL)\r\n\t$(ECHOTO) $(CFG) $(DEBUG) $(__XMS_SWAP)\r\n\r\nechoto.bat: $(SCRIPTS_PATH)\\echoto.bat\r\n\t$(CP) $(SCRIPTS_PATH)\\echoto.bat .\r\n\r\necholib.bat: $(SCRIPTS_PATH)\\echolib.bat\r\n\t$(CP) $(SCRIPTS_PATH)\\echolib.bat .\r\n\r\n#\t\t*Implicit Rules*\r\n.asm.obj:\r\n\t$(NASM) -f obj $(NASMFLAGS) -DMODEL=$(SHELL_MMODEL) -DCOMPILER=$(COMPILER) $(__XMS_SWAP) $<\r\n"
  },
  {
    "path": "criter/context.x",
    "content": "# Context description file\r\n#\r\n#\tContains persistent information to be preserved during the\r\n#\texecution of an external program\r\n#\r\n# separated to allow to use one file for both assembly and C\r\n# TOOLS\\MKCTXT.EXE creates the following files:\r\n#\tcontext.h_c: contains the structure in C syntax\r\n#\tcontext.h_a: contains the definition of the structure in assembly\r\n#\tcontext.inc: contains the EQUs of the offsets of a value into the structure\r\n#\t\ttwo definitions per offset:\r\n#\t\t<value> - offset from the very beginning of the context\r\n#\t\t<package>_<value> - offset of the value relative to the beginning\r\n#\t\t\tof the specific package\r\n\r\n# \"typedef\" opens a new \"typedef struct {\".\r\n# \"package\" groups different values together, if the package\r\n# is a shared module, too, a pointer to this position is passed\r\n# to the module. Within C, they are represented by struct's\r\n# \"structure\" is more or less the same, but it is ensured that all\r\n# structures defined for one package are physically located in above the\r\n# pointer to the package\r\n# An empty line (no comment lines!) end a structure.\r\n\r\n# Type:\r\n# byte - one single byte (unsigned char)\r\n# word - two bytes (unsigned short int)\r\n# pointer - far pointer (void far*)\r\n# constant - #define of _numerical_ constant\r\n# reference - label at exactly this position (unsigned char [])\r\n\r\n\r\ntypedef kswap_t\t# Type currently defined\r\n\r\nword envSegm 0\t\t# segment to be passed forth as environment \r\npointer prg 0\t\t# program to be executed \r\npointer cmdline 0\t# command line arguments of program \r\nword execErr 0\t\t# exit code of DOS-4B of external program\r\npointer shell 0\t\t# absolute path to shell to be executed \r\nword canexit 0\t\t# true unless FreeCOM was invoked with /P \r\nword dfltSwap 0\t\t# default value of swapOnExec\r\nword debug 0\t\t# Debug status\r\nword envSize 0\t\t# size of environment segment \r\nword dyn_ctxt 0\t\t# dynamically changed portions of context \r\nword ofs_criter _lowlevel_err_handler\t\t# offset of criter module within this context \r\nreference cbreak_hdlr\t# start of dummy ^Break handler active if FreeCOM\r\n\t\t\t\t\t# is NOT running itself\r\n"
  },
  {
    "path": "criter/criter.asm",
    "content": "; $Id$\r\n;\r\n;\t\tCritical Error handler -- module\r\n;\r\n; Three macros to customize the assembler process:\r\n;\t\tCOMPILE_COM in order to generate a .COM file (Debugging ONLY)\r\n;\t\t\tautomatically defines COMPILE_STRINGS\r\n;\t\t\tincludes this:\twrite(open(\"A:\\AUX\", O_RDWR), 0, 65535)\r\n;\t\t\tit is assumed that A: is empty first, then a floppy is\r\n;\t\t\tinserted and no AUX: device is present\r\n;\t\t\t--> produces 1st a block device Criter, then a char device\r\n;\t\t\t\tCriter\r\n;\t\tCOMPILE_STRINGS to include English response strings right into\r\n;\t\t\tthis image\r\n;\t\tNO_RESOURCE_BLOCK omit resource block at the end of the file\r\n;\t\tXMS_SWAP_CRITER disables interfering stuff when assembling for\r\n;\t\t\tXMS Swap variant\r\n;\r\n;\tDoing a ECHO >A:\\FILE results in:\r\n;\t\tWinNT 4 DOSbox:\r\n;\t\t\tno floppy in drive --> AX := 0x1800 ; [BP:SI+4] == 0x0000\r\n;\t\t\twrite protected floppy & file already exists\r\n;\t\t\t\t--> AX := 0x98FF; [attr] == 0x8000\r\n;\t\t\twrite protected floppy, but files does NOT exist\r\n;\t\t\t\t--> AX := 0x1800; [attr] == 0x0000\r\n;\t\tWin98 plain:\r\n;\t\t\tno floppy in drive --> AX := 0x1A00; [attr] == 0x08C2\r\n;\t\t\twrite protected floppy -> AX := 0x1B00; [attr] == 0x08C2\r\n;\t\tFreeDOS build 2021:\r\n;\t\t\tno floppy in drive --> AX := 0x3800; [attr] == 0x08C2\r\n;\t\t\twrite protected floppy -> same as above\r\n;\t\tFreeDOS build 2022:\r\n;\t\t\tno floppy in drive --> AX := 0x3800; [attr] == 0x08C2\r\n;\t\t\twrite protected floppy -> stalled quite some time, but NO CRITER!\r\n;\t\tFreeDOS build 2023b [Mar 27 2001 21:51:20]:\r\n;\t\t\tno floppy in drive --> AX := 0x3800; [attr] == 0x08C2\r\n;\t\t\twrite protected floppy -> stalled quite some time, but NO CRITER!\r\n;\r\n;\tThis handler does:\r\n;\t0) The current context is passed into this function within ES:BX\r\n;\t\tThe original ES & BX are restored by CRITER.\r\n;\t1) Probe for Autofail <-> return FAIL for all criterrs\r\n;\t2) Display error message:\r\n;\tblock devices:\r\n;\t\tError \"reading from\"|\"writing to\" drive ?: XXX area: error\r\n;\tcharacter devices:\r\n;\t\tError \"reading from\"|\"writing to\" device XXXXXXX: error\r\n;\t3) Display user action possebilities:\r\n;\t\t(A)bort (I)gnore (R)etry (F)ail? _\r\n;\t4) Get user input & return to DOS (via IRET)\r\n;\r\n;\tFields of context used:\r\n;\t\toffset 0, byte (boolean), autofail\r\n;\r\n;\t== What to do if neither I,R,nor F are allowed??\r\n;\t== Simply return??\r\n;\r\n;\tOrganization of the strings:\r\n;\t+ There may be upto 256 strings, numbered from 0 through N\r\n;\t+ The actual \"error strings\" must be the last ones and their\r\n;\t  order must be the same as the code in DI\r\n;\t+ All strings are packed together as follows:\r\n;\t  (N+1) words\tnear pointer to character sequence of string #X\r\n;\t  character sequences of strings, no obvious order among them required\r\n;\t  This block is created by an external tool, like the messages for\r\n;\t  FreeCom itself and simply attached to the criterr handler code.\r\n;\t+ Within the code procedure ?oString maps BL -> near pointer (BX)\r\n;\t  and displays the associated character sequence with ?oBuffer\r\n;\t+ Special sequences:\r\n;\t\t%%\t--> a single percent sign\r\n;\t\t%#\t--> where '#' is a decimal digit --> insert string\r\n;\t\t\t\twith number BYTE [?strarg#]\r\n;\t\t%A\t--> where 'A' is a capital Latin letter --> insert\r\n;\t\t\t\tthe buffer at ?strargA\r\n;\r\n;\tPossible NLS hazards:\r\n;\t+ drive letter is created via \"+ 'A'\"\r\n;\t+ for robustness when displaying the driver's name, characters less\r\n;\t  than ' ' are ignored (usually control characters)\r\n;\r\n; $Log$\r\n; Revision 1.5  2004/09/13 18:59:39  skaus\r\n; add: CRITER: Repeat check autofail magic {Tom Ehlert/Eric Auer}\r\n;\r\n; Revision 1.4  2003/10/18 10:55:24  skaus\r\n; bugfix: CRITERR: to use DOS API {Tom Ehlert/Bart Oldeman}\r\n;\r\n; Revision 1.3  2003/08/03 16:00:57  skaus\r\n; bugfix: /F (AutoFail) for the XMS_Swap variant\r\n;\r\n; Revision 1.2  2002/04/02 18:09:31  skaus\r\n; add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n;\r\n; Revision 1.1  2001/04/23 21:35:41  skaus\r\n; Beta 7 changes (code split)\r\n;\r\n; Revision 1.1.2.3  2001/02/27 18:27:06  skaus\r\n; fix: criter.asm: DEBUG does no longer compile to .COM (for consistency)\r\n; chg: removed all NULLs to prevent NULL problematic, functions must be\r\n; \tused fully prototyped now\r\n;\r\n; Revision 1.1.2.2  2001/02/18 17:59:36  skaus\r\n; bugfix: KSSF: restore parentPSP on exit\r\n; chg: Using STRINGS resource for all non-interactive messages\r\n; chg: moving all assembly files to NASM\r\n;\r\n; Revision 1.1.2.1  2001/01/28 21:23:55  skaus\r\n; add: Kernel Swap Support\r\n;\r\n; Revision 1.1.2.1.2.1  2000/12/17 21:57:36  skaus\r\n; intermediate update 1\r\n;\r\n\r\n;;; Settings for stand-alone variant\r\n%define COMPILE_STRINGS\t\t;; always keep this enabled in this release!!\r\n%define INCLUDE_STRINGS\t\t;; use STRINGS.INC instead of hard-coded strings\r\n;; %define AUTO_FAIL\t\t;; make the autofail variant of Criter\r\n%define HIDE_CRITER_DRIVES 26\t;; For how many drives hide-multiple is active\r\n\r\n;; Version of this module\r\nMODULE_VERSION EQU 2\r\n\r\n%include \"../include/stuff.inc\"\r\n%ifndef XMS_SWAP_CRITER\r\n%include \"resource.inc\"\r\n%endif\r\n\r\n???start:\r\n\r\n%ifdef COMPILE_COM\r\nORG 100h\r\n\r\nmov ax, cs\r\nmov ds, ax\r\nmov ax, 2524h\r\nmov dx, _lowlevel_err_handler\r\nint 21h\r\n\r\n;; Trying to open a file on drive A:\r\nmov ax, 3d02h\r\nmov dx, dummy_file\r\nint 21h\r\n\r\n;; Trying to copy stuff on PRN:\r\nmov bx, ax\r\nmov ah, 40h\r\nmov cx, 0ffffh\r\nmov dx, 0\r\nint 21h\r\n\r\nmov ax, 4c00h\r\nint 21h\r\nint 20h\r\n\r\ndummy_file DB \"a:\\ux\", 0\r\n\r\n%ifndef COMPILE_STRINGS\r\n%define COMPILE_STRINGS\r\n%endif\r\n%endif\r\n\r\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Real start\r\n;; Join both modules into the same memory image in order to handle\r\n;; them easier\r\n\r\n%ifndef XMS_SWAP_CRITER\r\n\t;; Static context of KSwap support\r\n%include \"context.def\" \r\n\r\n%include \"dmy_cbrk.asm\"\r\n%endif\r\n\r\n;; Low level Critical Error handler\r\n;; Note: Both I/O functions should use the channel to read/write\r\n;;\tthe characters. In this case: the BIOS.\r\n;; Sidenote: RBIL states that some BIOSes destroy the BP register.\r\n%macro printALtoConsole 0\r\n\tcall ?oChar\r\n%endmacro\r\n%macro readALfromConsole 0\r\n\tmov ax, 0c07h\t; clear buffer, read from STDIN one key without echo\r\n\tint 21h\r\n%endmacro\r\n\r\n\r\nLOCAL_BELL\tEQU 7\r\n\r\n;; Return values\r\nIGNORE\t\tEQU 0\r\nRETRY\t\tEQU 1\r\nABORT\t\tEQU 2\r\nFAIL\t\tEQU 3\r\n\r\n; bitmask of the \"allowed action\" flags\r\nCodeIgnore\tEQU 32\r\nCodeRetry\tEQU 16\r\nCodeFail\tEQU 8\r\n\r\n;; String numbers -- fixed order section\r\n; 0 -> %1: write to\r\n; 1 -> %1: read from \r\n\r\nStrBlockDevice\tEQU 2\r\nStrCharDevice\tEQU 3\r\n\r\nStrArea EQU 4\r\n; StrArea (area of failure)\r\n; + 0 -> DOS\r\n; + 1 -> FAT\r\n; + 2 -> root\r\n; + 3 -> data\r\n\r\n; StrActionStrings 8\r\n; + 0 -> Ignore\r\n; + 1 -> Retry\r\n; + 2 -> Abort\r\n; + 3 -> Fail\r\nStrIgnore\tEQU 8\r\nStrRetry\tEQU 9\r\nStrAbort\tEQU 10\r\nStrFail\t\tEQU 11\r\n\r\nStrQuestionMark\tEQU 12\r\nStrDelimiter\tEQU 13\r\nStrKeys\t\t\tEQU 14\t\t; enumerated valid input keys\r\n\t\t; format:\tLK..KA..A\r\n\t\t;\tL: BYTE number of K's (== number of A's)\r\n\t\t;\tK: BYTE one keystroke\r\n\t\t;\tA: BYTE one action code 0..3 (IRAF)\r\n\t\t;\ta K's action code is located at the byte pointed to\r\n\t\t;\tby the address of K plus L\r\n\r\nStrErrCodes\t\tEQU 15\r\n\r\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r\n;;;;;;;;;;;;;;;;;;;;;; Entry point\r\n\r\n; arguments:\r\n;\t\tES:BX == pointer to context, package int24\r\n;\t\telse: as normal INT-24 handler\r\n\r\n%ifdef XMS_SWAP_CRITER\r\n\tcglobal autofail_err_handler\r\nautofail_err_handler:\r\n\tmov al, FAIL\r\n\tiret\r\n%endif\r\n\r\n\tcglobal lowlevel_err_handler\r\nlowlevel_err_handler:\r\n%ifdef AUTO_FAIL\r\n\t;; most simple <-> return AL := 3\r\n\tmov al, FAIL\r\n\tiret\r\n%else\r\n\tpush dx\r\n\tpushm es, ds, bp, si, di, cx, bx, ax\r\n\r\n\tmov cx, cs\r\n\tmov ds, cx\t\t; DS := local code/data segment\r\n\r\n%ifdef DEBUG\r\n\tcall ??dispAX\r\n%endif\r\n\r\n\tpush ax\t\t\t; save AH bit 7  and AL for later\r\n\r\n\t\t\t;; free AL\r\n\tadd al, 'A'\t\t; AL may contain the drive number\r\n\tmov BYTE [??strargA], al\t;; will be overwritten, if char device\r\n\txor al, al\r\n\tmov BYTE [??strargA + 1], al\t; end of string\r\n\r\n\tmov es, cx\t\t; still shared local code/data segm\r\n\r\n\tshr ah, 1\t\t; Carry := 0-> read; 1->write\r\n\tadc al, al\t\t; AL := 0-> read; 1->write\r\n\tmov BYTE [??strarg1], al\r\n\r\n\tmov al, ah\r\n\tand al, 3\t\t; AL := 0/1/2/3 -> DOS/FAT/root/data area\r\n\tadd al, StrArea\t;  make it a string#\r\n\tmov BYTE [??strarg2], al\t;; will be ignored if char device\r\n\r\n;;\r\n;; and al, (CodeIgnore or CodeRetry or CodeFail) / 2\r\n;; jz ONLY_ABORT_ALLOWED_AND_NOW??\r\n;;\r\n\tmov al, ah\r\n\tand al, CodeFail / 2\r\n\tmov [??allowFail], al\r\n\tmov al, ah\r\n\tand al, CodeRetry / 2\r\n\tmov [??allowRetry], al\r\n\tand ah, CodeIgnore / 2\r\n\tmov [??allowIgnore], ah\r\n\r\n;; AX is empty now\r\n%ifdef DEBUG\r\n\tpush ds\r\n\tmov ax, bp\r\n\tmov ds, bp\r\n\tpush si\r\n\tpush di\r\n\tpush cx\r\n\tmov cx, 8\r\n\tmov di, ??_c\r\n\tadd si, byte 10\r\n??__e:\r\n\tlodsb\r\n\tcmp al, 32\r\n\tjnc ??__d\r\n\tmov al, 32\r\n??__d:\r\n\tstosb\r\n\tloop ??__e\r\n\tpop cx\r\n\tpop di\r\n\tpop si\r\n\tmov ax, [si+4]\r\n\tpop ds\r\n\tcall ??dispAX\r\n\tmov bx, ??_d\r\n\tcall ?oBuffer\r\n%endif\r\n\r\n%if 0\t\t;; No need when doing I/O through DOS\r\n\tmov ah, 0fh\t\t; Get current video mode\r\n\tint 10h\r\n\tmov BYTE [??actPage], bh\r\n\tmov BYTE [??actColour], 255\r\n%endif\r\n\r\n\tmov ax, di\t\t; AL := lobyte(DI) -> error number\r\n\tadd al, StrErrCodes\r\n\tmov BYTE [??strarg3], al\r\n\r\n\tmov bl, StrBlockDevice\t\t; by default issue block device error\r\n\tpop ax\t\t\t\t\t\t; AL := drive letter again\r\n\tshl ah, 1\t\t\t\t\t; get bit 7 --> carry flag\r\n\tjnc ?noCharDevice\r\n\r\n\tmov ds, bp\t\t\t\t\t; is still segment of device driver\r\n\ttest BYTE [si+5], 128\t\t; bit 7 == 1 if block device\r\n\tjz ?noCharDevice\r\n\t\t\t; fetch the name of the character device\r\n\t\tmov cx, 8\t\t; max eight characters to display\r\n\t\tadd si, byte 10\t\t; located at offset 10\r\n\t\tmov di, ??strargA\r\n\t\tmov ah, ' '\r\n\t\tcld\r\n?drvNameGetLoop:\r\n\t\tlodsb\r\n\t\tcmp al, ah\r\n\t\tjnc ?charOK\r\n\t\tmov al, ah\r\n?charOK:\r\n\t\tstosb\r\n\t\tloop ?drvNameGetLoop\r\n\r\n\t\t\t;; Remove trailing whitespaces\r\n\t\tmov cx, 8\t\t; max eight characters to display\r\n\t\tmov al, ah\r\n\t\tstd\r\n\t\tdec di\t\t\t; stosb leaves DI behind the last written byte\r\n\t\trepe scasb\r\n\t\tmov BYTE [ES:di+2], ch\t; place termination character\r\n\t\tmov cx, cs\r\n\t\tmov bl, StrCharDevice\t\t; issue device driver message\r\n\t\tmov al, 0ffh\t\t; AL := invalidate\r\n\r\n?noCharDevice:\r\n\r\n\tcld\t\t\t\t; forward direction\r\n\tmov ds, cx\t\t; CX is still or again == CS\r\n\r\n\tpush bx\r\n\t;; Now many registers are available to use\r\n\t;; Perform the repeat check; AL == -1 (char device), 0..31 if block\r\n\tmov bx, ?repCheck\r\n\tmov di, dummyByte\t; Tha byte at [DI} will be decremented eventually\r\n\tinc WORD [BX]\t; check if enabled\r\n\tjz ?noRepCheck\r\n\t;; paranoid check to avoid memory overflow\r\n\t;; also skips if char device\r\n\tcmp al, HIDE_CRITER_DRIVES\t; 0..26 == A..Z\r\n\tjnc ?noRepCheck\r\n\tcbw\t\t\t\t; AH := 0\r\n\tadd al, 2\t\t; correction as BX is two bytes below\r\n\tadd ax, bx\t\t; repCheckByte area \r\n\tmov di, ax\r\n\tinc BYTE [DI]\t; will display the 1st and every 256th Criter\r\n\tjnz\t?fail\t\t; displayed already --> AutoFail && keep incremented [BX]\r\n\t\t\t\t\t; NOTE: There is no output generated til now!!\r\n\t\t\t\t\t;\tThe output channels have not been touched\r\n?noRepCheck:\r\n\tdec WORD [BX]\t; keep the word at value -1\r\n\tmov WORD [repCheckDecAddr], di\r\n\r\n;; Try to find a suitable I/O channel\r\n\tmov ah, 62h\t\t; Get PSP\r\n\tint 21h\r\n\tmov es, bx\r\n;;\tmov cx, [ES:32h]\t; number of entries in JFT\r\n\tles bx, [ES:34h]\t; Pointer to JFT\r\n\tmov al, [es:bx+2]\t; stderr\r\n\t; patch STDIN & STDOUT to point to the found channel\r\n\tmov ah, al\r\n\txchg WORD [ES:bx], ax\r\n\tmov WORD [?orgIOchannels], ax\r\n\tmov WORD [??repatchAddr], bx\r\n\tmov WORD [??repatchAddr+2], es\r\n\tpop bx\r\n\tmov es, cx\t\t\t;; reset ES to the shared code/data segement\r\n\r\n\r\n\tcall ?oString\t; Display the Critical Error message string\r\n\tcall ?newline\r\n\tmov bl, StrAbort\r\n\tcall ?oString\r\n\tmov bl, 0\t\t; try Ignore\r\n\tcall ?oAction\r\n\tmov bl, 1\t\t; try Retry\r\n\tcall ?oAction\r\n\tmov bl, 3\t\t; try Fail\r\n\tcall ?oAction\r\n\tmov bl, StrQuestionMark\r\n\tcall ?oString\r\n\tjmp short ?inputLoop\r\n\r\n?fail:\r\n\tpop bx\t\t; correct the stack from repeat check\r\n\tmov bl, FAIL\r\n\tjmp short ?iret\t; actually return\r\n\r\n?inputError:\r\n\tmov al, LOCAL_BELL\r\n\tprintALtoConsole\r\n\r\n?inputLoop:\r\n\t; Prepare to decode the character\r\n\tmov di, [StrKeys * 2 + 1 + ??strings]\t; address of enumerated valid keys\r\n\txor ax, ax\r\n\tmov al, [di]\r\n\tinc di\r\n\tmov cx, ax\t\t\t; number of enumerated keys\r\n\tmov bx, ax\r\n\r\n\treadALfromConsole\r\n\t;; special keys (AL == 0) are ignored\r\n\r\n;; Decode user input\r\n\trepne scasb\r\n\tjne ?inputError\t\t; key not found\r\n\r\n\tmov bl, [bx+di-1]\t; action code (DI is one byte too far by SCASB)\r\n\tmov al, [bx+??allow]\r\n\tor al, al\r\n\tjz ?inputError\t\t; not allowed\r\n\r\n?errRet:\r\n\t;; allowed action code in BL\r\n\tcall ?newline\r\n\r\n\t;; Restore the JFT\r\n\tles di, [??repatchAddr]\r\n\tmov ax, 1234h\r\n?orgIOchannels EQU $-2\r\n\tmov WORD [ES:di], ax\r\n\r\n?iret:\r\n\tpop ax\t\t\t; preserve AH\r\n\tmov al, bl\t\t; action code\r\n\tcmp al, ABORT\r\n\tje ?iretNow\r\n\tcmp al, FAIL\r\n\tje ?iretNow\r\n\t;; AutoFail is activated for ABORT and FAIL only\r\n\t;; as user selected something else, reset the AutoFail state of the drive\r\n\tdec BYTE [1234h]\r\nrepCheckDecAddr EQU $-2\r\n?iretNow:\r\n\tpopm es, ds, bp, si, di, cx, bx\r\n\tpop dx\r\n\tiret\r\n\r\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r\n;;;;;;;;;;;;;;;;;;;;;;;;; procedures\r\n\r\n;; dump allowed action #AL\r\n\r\n?oAction:\r\n\tmov bh, 0\r\n\tor bh, [bx+??allow]\r\n\tjz ?oRet\t\t\t; not allowed\r\n\tadd bl, '5'\t\t\t; local strarg code\r\n\tmov BYTE [??input+3], bl\t; construct the temp output buffer\r\n\tmov bx, ??input\r\n\tjmp short ?oBuffer\r\n\r\n;; dump string #BL onto screen\r\n;; IN: BL = string number\r\n;; OUT: BX destroyed\r\n\r\n?oString:\r\n\t;; make sure BL is within limit\r\n\tmov al, BYTE [??strings]\r\n\tcmp bl, al\r\n\tjc ?oS_idOK\r\n\tmov bl, al\r\n?oS_idOK:\r\n\tmov bh, 0\r\n\tadd bx, bx\r\n\tmov bx, WORD [bx+??strings+1]\r\n\tjmp short ?oBuffer\r\n\r\n;; dump character sequence pointed to by BX onto screen\r\n;; IN: BX = address\r\n;; OUT: BX destroyed\r\n\r\n?oB_bufA:\t\t;; Dump string argument A\r\n\tpush bx\r\n\tmov bx, ??strargA\r\n\tcall ?oBuffer\r\n\tjmp short ?oB_1\r\n\r\n?oB_special:\r\n\tinc bx\r\n\tmov al, [bx]\r\n\tor al, al\r\n\tje ?oRet\r\n\tcmp al, 'A'\r\n\tje ?oB_bufA\r\n\tcmp al, '1'\r\n\tjc ?oB_dump\r\n\tcmp al, '9' + 1\r\n\tjnc ?oB_dump\r\n\t\t;; display the numbered argument #AL\r\n\tpush bx\r\n\tcbw\r\n\tmov bx, ax\r\n\tmov bl, [bx+??strarg1-'1']\r\n\tcall ?oString\r\n?oB_1:\r\n\tpop bx\r\n\tjmp short ?oB_2\r\n?oB_loop:\r\n\tcmp al, '%'\r\n\tje ?oB_special\r\n?oB_dump:\r\n\tprintALtoConsole\r\n?oB_2:\r\n\tinc bx\r\n?oBuffer:\r\n\tmov al, BYTE [BX]\r\n\tor al, al\r\n\tjnz ?oB_loop\r\n?oRet:\r\n\tret\r\n\r\n?newline:\r\n\t;; Linefeed\r\n\tmov al, 10\r\n\tprintALtoConsole\r\n\tmov al, 13\r\n;;\tprintALtoConsole\r\n\r\n;; Dump character AL onto screen\r\n;; IN: AL = character\r\n\r\n?oChar:\r\n%if 0\t\t;; no need when doing I/O through DOS\r\n\tpush bx\r\n\tmov bx, [??0Earg]\r\n\tmov ah, 0eh\t\t; teletype output\r\n\tint 10h\r\n\tpop bx\r\n%else\r\n\tmov ah, 2\t\t; output to STDOUT\r\n\tmov dl, al\r\n\tint 21h\r\n%endif\r\n\tret\r\n\r\n%ifdef DEBUG\r\n??_a DB \"AX == 0x\"\r\n??_b DB 1,2,3,4, 13, 10, 0\r\n??_d DB \"Device name: >>\"\r\n??_c DB 1,2,3,4,5,6,7,8, '<<', 13, 10, 0\r\n??dispAX:\r\n\tpush bx\r\n\tpush ax\r\n\tmov bx, ??_b\r\n\tcall ??AXtoBX\r\n\tmov bx, ??_a\r\n\tcall ?oBuffer\r\n\tpop ax\r\n\tpop bx\r\n\tret\r\n??AXtoBX:\r\n\tpush ax\r\n\tmov al, ah\r\n\tcall ??ALtoBX\r\n\tpop ax\r\n??ALtoBX:\r\n\tpush ax\r\n\tshr al, 4\r\n\tcall ??NybbleToBX\r\n\tpop ax\r\n??NybbleToBX:\r\n\tand al, 15\r\n\tadd al, '0'\r\n\tcmp al, '0' + 10\r\n\tjc ??__c\r\n\tadd al, 'A' - '0' - 10\r\n??__c:\r\n\tmov BYTE [bx], al\r\n\tinc bx\r\n\tret\r\n%endif\r\n\r\n%if 0\t\t;; no need for I/O through DOS\r\n??0Earg:\r\n??actColour\tDB 7\r\n??actPage\tDB 0\r\n%endif\r\n\r\n??repatchAddr DD 0\r\n\r\n;?orgIOchannels DW 1234h\r\n\r\n\t;; Numerical arguments\r\n??strarg1\tDB 0\t\t\t\t\t;; read/write\r\n??strarg2\tDB 0\t\t\t\t\t;; area failed on\r\n??strarg3\tDB 0\t\t\t\t\t;; error string\r\n??strarg4\tDB StrDelimiter\t\t\t;; delimiter between two action strings\r\n??strarg5\tDB StrIgnore\r\n??strarg6\tDB StrRetry\r\n??strarg7\tDB StrAbort\r\n??strarg8\tDB StrFail\r\n\r\n\t;; alphabetical arguments\r\ndummyByte:\t;; This byte is destroyed, when no repeatCheck AutoFail is\r\n\t\t\t;; active for the drive\r\n??strargA\tDB '12345678', 0\t\t;; drive letter or device name string\r\n\r\n;; The repeat check is:\r\n;; _+ activated if ?repCheck != -1\r\n;;\t+ the number of drives available to be checked is determined by\r\n;;\t\tcounting the number of 0xFF bytes the immediately after the module\r\n;;\t\tgot loaded into memory\r\n%ifdef XMS_SWAP_CRITER\r\n\tcglobal criter_repeat_checkarea\r\ncriter_repeat_checkarea:\r\n%endif\r\n?repCheck\tDW -1\t;; disabled\r\nTIMES HIDE_CRITER_DRIVES DB -1\t\t;; not displayed already\r\n\r\n??allow:\r\n??allowIgnore\tDB 0\r\n??allowRetry\tDB 0\r\n??allowAbort\tDB 1\t;; always allowed\r\n??allowFail\t\tDB 0\r\n??input\t\t\tDB '%4%6', 0\t\t;; temporary storage\r\n\r\n\r\n%ifndef COMPILE_STRINGS\r\n??strings:\r\n%else\r\n%ifdef INCLUDE_STRINGS\r\n%include \"../strings/strings.err\"\r\n%else\r\n??strings\t\tDB 36\t;; number of strings\r\n\t;; Here start all the strings!\r\n\r\nDW S0\r\nDW S1\r\nDW S2\r\nDW S3\r\nDW S4\r\nDW S5\r\nDW S6\r\nDW S7\r\nDW S8\r\nDW S9\r\nDW S10\r\nDW S11\r\nDW S12\r\nDW S13\r\nDW S14\r\nDW S15\r\nDW S16\r\nDW S17\r\nDW S18\r\nDW S19\r\nDW S20\r\nDW S21\r\nDW S22\r\nDW S23\r\nDW S24\r\nDW S25\r\nDW S26\r\nDW S27\r\nDW S28\r\nDW S29\r\nDW S30\r\nDW S31\r\nDW S32\r\nDW S33\r\nDW S34\r\nDW S35\r\nDW S36\r\n\r\nS0\tDB 'reading from', 0\r\nS1\tDB 'writing to', 0\r\nS2\tDB 'Error %1 drive %A: %2 area: %3', 0\r\nS3\tDB 'Error %1 device %A: %3', 0\r\nS4\tDB 'DOS', 0\r\nS5\tDB 'FAT', 0\r\nS6\tDB 'root', 0\r\nS7\tDB 'data', 0\r\nS8\tDB '(I)gnore', 0\r\nS9\tDB '(R)etry', 0\r\nS10\tDB '(A)bort', 0\r\nS11\tDB '(F)ail', 0\r\nS12\tDB '? ', 0\r\nS13\tDB ', ', 0\r\nS14\tDB  8, 'IiRrAaFf', 0, 0, 1, 1, 2, 2, 3, 3\r\n\r\nS15 DB 'write-protection violation attempted', 0\r\nS16 DB 'unknown unit for driver', 0\r\nS17 DB 'drive not ready', 0\r\nS18 DB 'unknown command given to driver', 0\r\nS19 DB 'data error (bad CRC)', 0\r\nS20 DB 'bad device driver request structure length', 0\r\nS21 DB 'seek error', 0\r\nS22 DB 'unknown media type', 0\r\nS23 DB 'sector not found', 0\r\nS24 DB 'printer out of paper', 0\r\nS25 DB 'write fault', 0\r\nS26 DB 'read fault', 0\r\nS27 DB 'general failure', 0\r\nS28 DB '(DOS 3.0+) sharing violation', 0\r\nS29 DB '(DOS 3.0+) lock violation', 0\r\nS30 DB 'invalid disk change', 0\r\nS31 DB '(DOS 3.0+) FCB unavailable', 0\r\nS32 DB '(DOS 3.0+) sharing buffer overflow', 0\r\nS33 DB '(DOS 4.0+) code page mismatch', 0\r\nS34 DB '(DOS 4.0+) out of input', 0\r\nS35 DB '(DOS 4.0+) insufficient disk space', 0\r\nS36\tDB 'Unknown error code', 0\r\n%endif\t\t; INCLUDE_STRINGS\r\n%endif\t\t; COMPILE_STRINGS\r\n%endif\t\t; AUTO_FILE\r\n\r\n\r\n%ifndef NO_RESOURCE_BLOCK\r\n%ifndef AUTO_FAIL\r\n\tDW ?repCheck\r\n%endif\r\n%endif\r\n\r\n???ende:\r\n\r\n%ifndef NO_RESOURCE_BLOCK\r\n;; Include resource block\r\n%ifdef AUTO_FAIL\r\n\tresIdBlock RES_ID_CRITER, 0\r\n%else\r\n%ifndef COMPILE_STRINGS\r\n\tresIdBlock RES_ID_CRITER, 1\r\n%else\r\n\tresIdBlock RES_ID_CRITER, 3\r\n%endif\t\t; COMPILER_STRINGS\r\n%endif\t\t; AUTO_FAIL\r\n%endif\t\t; NO_RESOURCE_BLOCK\r\n\r\n;;END\r\n\r\n; Quote from RBIL\r\n;--------D-24---------------------------------\r\n;INT 24 C - DOS 1+ - CRITICAL ERROR HANDLER\r\n;Notes:  invoked when a critical (usually hardware) error is encountered by DOS\r\n;          (see #02543); should never be called directly\r\n;        when DOS terminates a program, it copies the previous value of the\r\n;          INT 24 vector out of the PSP (see #01378) and into the interrupt\r\n;          vector table\r\n;SeeAlso: INT 21/AH=95h\r\n;\r\n;(Table 02543)\r\n;Values critical error handler is called with:\r\n;        AH = type and processing flags (see #02544)\r\n;        AL = drive number if AH bit 7 clear\r\n;        BP:SI -> device driver header (see #01646 at INT 21/AH=52h)\r\n;                (BP:[SI+4] bit 15 set if character device)\r\n;        DI low byte contains error code if AH bit 7 set (see #02545)\r\n;        STACK:  DWORD   return address for INT 24 call\r\n;                WORD    flags pushed by INT 24\r\n;                WORD    original AX on entry to INT 21\r\n;                WORD    BX\r\n;                WORD    CX\r\n;                WORD    DX\r\n;                WORD    SI\r\n;                WORD    DI\r\n;                WORD    BP\r\n;                WORD    DS\r\n;                WORD    ES\r\n;                DWORD   return address for INT 21 call\r\n;                WORD    flags pushed by INT 21\r\n;Return: AL = action code (see #02546)\r\n;        SS,SP,DS,ES,BX,CX,DX preserved\r\n;Notes:  the only DOS calls the handler may make are INT 21/AH=01h-0Ch,30h,59h\r\n;        if the handler returns to the application by popping the stack, DOS\r\n;          will be in an unstable state until the first call with AH > 0Ch\r\n;        for DOS 3.1+, IGNORE (AL=00h) is turned into FAIL (AL=03h) on network\r\n;          critical errors\r\n;        if IGNORE specified but not allowed, it is turned into FAIL\r\n;        if RETRY specified but not allowed, it is turned into FAIL\r\n;        if FAIL specified but not allowed, it is turned into ABORT\r\n;        (DOS 3.0+) if a critical error occurs inside the critical error\r\n;          handler, the DOS call is automatically failed (AL set to 03h and\r\n;          the INT 24 call skipped)\r\n;\r\n;Bitfields for critical error type and processing flags:\r\n;Bit(s)  Description     (Table 02544)\r\n; 7      clear = disk I/O error\r\n;        set   = -- if block device, bad FAT image in memory\r\n;                -- if char device, error code in DI\r\n; 6      unused\r\n; 5      Ignore allowed (DOS 3.0+)\r\n; 4      Retry allowed (DOS 3.0+)\r\n; 3      Fail allowed (DOS 3.0+)\r\n; 2-1    disk area of error\r\n;        00 = DOS area   01 = FAT\r\n;        10 = root dir   11 = data area\r\n; 0      set if write, clear if read\r\n;SeeAlso: #02545,#02546\r\n;\r\n;(Table 02545)\r\n;Values for critical error code:\r\n; 00h    write-protection violation attempted\r\n; 01h    unknown unit for driver\r\n; 02h    drive not ready\r\n; 03h    unknown command given to driver\r\n; 04h    data error (bad CRC)\r\n; 05h    bad device driver request structure length\r\n; 06h    seek error\r\n; 07h    unknown media type\r\n; 08h    sector not found\r\n; 09h    printer out of paper\r\n; 0Ah    write fault\r\n; 0Bh    read fault\r\n; 0Ch    general failure\r\n; 0Dh    (DOS 3.0+) sharing violation\r\n; 0Eh    (DOS 3.0+) lock violation\r\n; 0Fh    invalid disk change\r\n; 10h    (DOS 3.0+) FCB unavailable\r\n; 11h    (DOS 3.0+) sharing buffer overflow\r\n; 12h    (DOS 4.0+) code page mismatch\r\n; 13h    (DOS 4.0+) out of input\r\n; 14h    (DOS 4.0+) insufficient disk space\r\n;SeeAlso: #02544,#02546\r\n;\r\n;(Table 02546)\r\n;Values for critical error handler action code:\r\n; 00h    ignore error and continue processing request\r\n; 01h    retry operation\r\n; 02h    terminate program as though INT 21/AH=4Ch called (INT 20h for DOS 1.x)\r\n; 03h    fail system call in progress (DOS 3+)\r\n;SeeAlso: #02544,#02546\r\n;\r\n;~\r\n"
  },
  {
    "path": "criter/criter.txt",
    "content": "Critical Error & Dummy ^Break handler & Kernel Swap Context\r\n\r\nCompile:\r\n\tnasm -f bin criter.asm\r\n\r\nResult is CRITER, the memory image which must be installed permanently\r\ninto memory.\r\n\r\nEntry offsets:\r\n\r\nPerformed actions:\r\n\r\nThe Dummy ^Break handler simply returns \"Terminate\", hence its name.\r\nIt is assumed that this handler gets activated only, if FreeCOM is NOT\r\nactive itself -> ergo, FreeCOM must install its own Ctrl-Break handler.\r\n\r\nThe Criter handler displays the known menu Abort/Retry/Ignore/Fail.\r\nThe handler does NOT pop to the program directly, but returns to the\r\ncaller, usually the DOS kernel.\r\n\r\nUseage:\r\n1) allocate a block of memory (--> segm)\r\n2) invalidate owner's ID of segm\r\n3) store the compiled CRITER module into segm\r\n4) interrupt vector 0x24 := MK_FP(segm, *(word far*)MK_FP(segm, 0))\r\n5) interrupt vector 0x23 := MK_FP(segm, 2)\r\n*) Module needs not be patched/updated in any way. It's standalone.\r\n\r\nTested:\r\n+ with MS DOS 6\r\n+ compiled: NASM -f bin -o criter.com -DDEBUG=1 criter.asm\r\n+ ran: .\\criter.com\r\n--> 1x fault because of non-responding drive A:\r\n--> 1x fault because of non-responding character device AUX:\r\n(see DEBUG switch within criter.asm)\r\n"
  },
  {
    "path": "criter/dmy_cbrk.asm",
    "content": ";   $Id$\r\n;\r\n;\tDummy ^Break signal catcher -- module\r\n;\tAborts any program\t\t<-> Activated only if FreeCOM is not active\r\n;\tFull relocable\r\n;\r\n;\tOn return the caller must return to DOS the following way:\r\n;\tif(Carry)\tretf\t\t\t<-- Terminate\r\n;\tif(!Carry)\tretf 2\t\t\t<-- Proceed / Ignore ^Break\r\n;\r\n;   $Log$\r\n;   Revision 1.2  2002/04/02 18:09:31  skaus\r\n;   add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n;\r\n;   Revision 1.1  2001/04/23 21:35:41  skaus\r\n;   Beta 7 changes (code split)\r\n;\r\n;   Revision 1.1.2.1  2001/01/28 21:23:55  skaus\r\n;   add: Kernel Swap Support\r\n;\r\n\r\n\t\tstc\t\t\t;; tell DOS to terminate the program\r\n\t\tretf\t\t;; no IRET!\r\n"
  },
  {
    "path": "criter/files.txt",
    "content": "Implementation of the Criter, Dummy CBreak and Context module\r\n\r\nThis implementation is a spin-off of two other on-going implementations:\r\n+ KSS - Kernel Swap Support, which is included in this release,&\r\n+ modules - which is available on CVS by tag expSpawn.\r\n\r\n\r\nCONTEXT.X\t\tShared context between C and Assembly\r\ncriter.asm\t\tCombined Criter, dummy CBreak and Context modules\r\ndmy_cbrk.asm\tDummy CBreak hamdler\r\nRESOURCE.ID\t\tResource IDs understood by this implementation\r\nRESOURCE.INC\tResource block understood by this implementation\r\n"
  },
  {
    "path": "criter/makefile",
    "content": "# $Id$\r\n#\r\n# Makefile for the FreeCOM CRITER module\r\n#\r\n# $Log$\r\n# Revision 1.2  2002/04/02 23:36:37  skaus\r\n# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n#\r\n# Revision 1.1  2001/04/23 21:35:41  skaus\r\n# Beta 7 changes (code split)\r\n#\r\n# Revision 1.1.2.2  2001/02/27 18:27:06  skaus\r\n# fix: criter.asm: DEBUG does no longer compile to .COM (for consistency)\r\n# chg: removed all NULLs to prevent NULL problematic, functions must be\r\n# \tused fully prototyped now\r\n#\r\n# Revision 1.1.2.1  2001/02/18 18:09:55  skaus\r\n# intermediate update #3\r\n#\r\n\r\n.IMPORT : FREEDOS\r\n\r\nINCDIR +=;$(FREEDOS)\\SRC\\INCLUDE\r\nLIBDIR +=;$(FREEDOS)\\SRC\\LIB\\$(_COMPILER)\r\nLDLIBS = suppl_$(_MODEL).lib\r\nLDFLAGS += /msl\r\nNASM *= c:\\TOOL\\NASMW.EXE\r\n\r\n##LD_TLINK != D:\\BC5\\BIN\\TLINK.EXE\r\n\r\n# Project specific C compiler flags\r\nMYCFLAGS_DBG = -DNDEBUG=1 $(null,$(DEBUG) $(NULL) -DDEBUG=1)\r\nMYCFLAGS_NDBG =\r\nMYCFLAGS = $(null,$(NDEBUG) $(MYCFLAGS_DBG) $(MYCFLAGS_NDBG))\r\n\r\n# Project specific NASM compiler flags\r\nNASMFLAGS_DBG = $(null,$(DEBUG) $(NULL) -DDEBUG=1) -s\r\nNASMFLAGS_NDBG = -s\r\nNASMFLAGS = $(null,$(NDEBUG) $(NASMFLAGS_DBG) $(NASMFLAGS_NDBG))\r\n\r\n# Sources of this make target\r\nSRC = \r\n\r\n#\tDefault target\r\nall: criter criter1 context.def\r\n\r\n\r\ndist : ;\r\n\r\n.INIT .PHONY .SEQUENTIAL : $(CFG) __errl\r\n\r\n\r\n__errl:\r\n\t@+-if exist errlist del errlist >nul\r\n#\t-ctags *.c\r\n\r\ncriter.asm : context.def dmy_cbrk.asm ../include/stuff.inc resource.inc ../strings/strings.err\r\n\r\ncriter : criter.asm\r\n\t$(NASM) $(NASMFLAGS) -f bin -o $@ $< >>errlist\r\n\r\ncriter1 : criter.asm\r\n\t$(NASM) $(NASMFLAGS) -DAUTO_FAIL -f bin -o $@ $< >>errlist\r\n\r\ncontext.def context.h_c .UPDATEALL : context.x\r\n\t..\\utils\\mkctxt.exe $<\r\n\t+copy context.h_c ..\r\n\t+copy context.inc ..\r\n\r\n#MAKEDEP START\r\n#MAKEDEP STOP\r\n\r\nclobber : clean\r\n\t$(RM) $(RMFLAGS) *.com *.cln criter criter1 *.cfg\r\n\r\nclean : \r\n\t$(RM) $(RMFLAGS) *.obj *.bak context.h_c context.def context.inc ..\\context.h_c ..\\context.inc tags errlist strings.inc\r\n\r\n"
  },
  {
    "path": "criter/makefile.mak",
    "content": "CFG_DEPENDENCIES = makefile.mak\r\n\r\nTOP = ..\r\n!include \"$(TOP)/config.mak\"\r\n\r\nall:  context.def criter criter1\r\n\r\ncontext.def : context.x\r\n\t..$(DIRSEP)utils$(DIRSEP)mkctxt.exe context\r\n\t$(CP) context.h_c ..\r\n\t$(CP) context.inc ..\r\n\r\ncriter : criter.asm dmy_cbrk.asm ../include/stuff.inc context.def\r\n\t$(NASM) $(NASMFLAGS) -f bin -o criter criter.asm\r\n\r\ncriter1 : criter.asm dmy_cbrk.asm ../include/stuff.inc context.def\r\n\t$(NASM) $(NASMFLAGS) -DAUTO_FAIL -f bin -o criter1 criter.asm\r\n\r\n"
  },
  {
    "path": "criter/resource.id",
    "content": "RES_ID_NONE EQU -32766\r\nRES_ID_ANY EQU -32767\r\nRES_ID_STRINGS EQU 0\r\nRES_ID_CRITER EQU 1\r\nRES_ID_CBREAK EQU 2\r\nRES_ID_RESPAWNER EQU 3\r\n"
  },
  {
    "path": "criter/resource.inc",
    "content": "%include \"resource.id\"\r\n%macro resIdBlock 1-2 -1\r\n\tdd\t???ende - ???start\t\t;; Length of this resource\r\n\tdw %1\t\t\t\t\t\t;; major resource ID\r\n\tdw %2\t\t\t\t\t\t;; minor resource ID\r\n\tdb 'FREECOM '\t\t\t\t;; cookie\r\n%endmacro\r\n"
  },
  {
    "path": "docs/HELP.EN",
    "content": "FreeCom 0.85\r\n(Note: some features and commands are optional)\r\n\r\nList of commands and features of FreeCOM:\r\n\r\n    * ALIAS - Display or change an alias <#alias>\r\n    * BEEP - Issue a Beep <#beep>\r\n    * BREAK - Display or Set Extended Break Checking <#break>\r\n    * CALL - Call a Nested Batchfile or Program <#call>\r\n    * CANCEL - Terminate all scripts <#cancel>\r\n    * CD - Change current directory of a drive <#cd>\r\n    * CDD - Changes the current working directory <#cdd>\r\n    * CHDIR - Change current directory of a drive <#chdir>\r\n    * CLS - Clear screen <#cls>\r\n    * COPY - Copy one or more files to another location <#copy>\r\n    * CTTY - Change TTY (console) <#ctty>\r\n    * DATE - Display or set current date <#date>\r\n    * DEL - Delete files <#del>\r\n    * DIR - Displays the contents of the directory <#dir>\r\n    * DIRS - Display the directory stack <#dirs>\r\n    * ECHO - Displays a string onto screen <#echo>\r\n    * ENVIRONMENT_KEEP_FREE - keep free space in environment segment\r\n      <#environment_keep_free>\r\n    * ERASE - Delete files <#erase>\r\n    * EXIT - Terminate shell <#exit>\r\n    * FEATURE_ALIASES - Command aliases <#feature_aliases>\r\n    * FEATURE_AUTO_REDIRECT_TO_CON - Autoswitch CON: to monitor\r\n      <#feature_auto_redirect_to_con>\r\n    * FEATURE_BATCH - Batch script processing <#feature_batch>\r\n    * FEATURE_BOOT_KEYS - check for F5/F8 keys on startup if /P is\r\n      present <#feature_boot_keys>\r\n    * FEATURE_CALL_LOGGING - Startup logging <#feature_call_logging>\r\n    * FEATURE_DIRSTACK - Directory stack <#feature_dirstack>\r\n    * FEATURE_ENHANCED_INPUT - Enhanced command line editing\r\n      <#feature_enhanced_input>\r\n    * FEATURE_FILENAME_COMPLETION - Filename completion\r\n      <#feature_filename_completion>\r\n    * FEATURE_HISTORY - Command line history <#feature_history>\r\n    * FEATURE_INSTALLABLE_COMMANDS - Installable Commands interface\r\n      (MUX-AE) <#feature_installable_commands>\r\n    * FEATURE_LAST_DIR - Change back to last directory <#feature_last_dir>\r\n    * FEATURE_LOAD_MESSAGES - Load messages permanently\r\n      <#feature_load_messages>\r\n    * FEATURE_NLS - use DOS NLS <#feature_nls>\r\n    * FOR - Repeat a command <#for>\r\n    * GOTO - Goto label <#goto>\r\n    * HISTORY - Display command line history <#history>\r\n    * IF - Conditional execution of a command <#if>\r\n    * LOADFIX - Load an external program above the first 64KB memory\r\n      <#loadfix>\r\n    * LOADHIGH - Load an external program into high memory <#loadhigh>\r\n    * MD - make directory <#md>\r\n    * MEMORY - Display the internally used memory <#memory>\r\n    * MKDIR - Make directory <#mkdir>\r\n    * PATH - Display or set the search path <#path>\r\n    * PAUSE - Pauses batch file execution <#pause>\r\n    * POPD - Change back to the last pushed directory <#popd>\r\n    * PROMPT - Display or set the shell prompt <#prompt>\r\n    * PUSHD - Push the current working directory onto the directory\r\n      stack <#pushd>\r\n    * QUIT - Terminate the current script <#quit>\r\n    * RD - Remove directory <#rd>\r\n    * REM - Marks comments or remarks in batchfiles <#rem>\r\n    * REN - Rename files <#ren>\r\n    * RENAME - Rename files <#rename>\r\n    * RMDIR - Remove directory <#rmdir>\r\n    * SET - Display or set environment variables <#set>\r\n    * SHIFT - Shift the arguments of a batch script <#shift>\r\n    * TIME - Display or set current time <#time>\r\n    * TRUENAME - Display the true name of a file <#truename>\r\n    * TYPE - Display the contents of files <#type>\r\n    * VER - Display the version information about FreeCOM and DOS <#ver>\r\n    * VERIFY - Display or set verify level <#verify>\r\n    * VOL - Display the volume label of a drive <#vol>\r\n    * WHICH - Search and display the executable file of specified\r\n      commands <#which> \r\n\r\n\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    ALIAS - Display or change an alias\r\n\r\nRequirements: FEATURE_ALIASES <#feature_aliases>\r\n\r\n\r\n      Synopsis\r\n\r\n   1. ALIAS\r\n   2. ALIAS /name/ '=' *[* string *]*\r\n\r\nThe first format without any argument displays all defined aliases.\r\n\r\nThe second format assigns the specified /string/ to the alias with the\r\nspecified /name/. If the /string/ is empty, the named alias is removed.\r\n\r\nOnce an aliase is defined, a command line of the form: name { argument }\r\nis replaced by: <> { argument }\r\nThis mechanism is called /alias expansion/, because the alias /name/\r\nexpands to the specified string. To prevent alias expansion the\r\ncommand must be prefixed by one asterisk, e.g.: *name arguments\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nALIAS <#alias> dir=dir /w\r\ndir\r\ndisplays short directory listing from now on.\r\n\r\n\r\n        Example: 2\r\n\r\nALIAS <#alias>\r\ndisplays all currently defined aliases, e.g.:\r\n\r\nDIR <#dir>=dir /w\r\n\r\nin this case.\r\n\r\n\r\n        Example: 3\r\n\r\nALIAS <#alias> dir=\r\nremoves the previously defined alias dir, thus, DIR <#dir> displays the\r\nlong output as by default again.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FEATURE_ALIASES - Command aliases\r\n\r\nSee also: ALIAS <#alias>\r\n\r\nIf defined on compilation of FreeCOM, command aliases are supported.\r\n\r\nNew aliases are _defined_ using the command:\r\nALIAS /name/ '=' string\r\n\r\nAliases are _removed_ using the command:\r\nALIAS /name/ '='\r\n\r\nWhen FreeCOM is interpreting a command line, the command -- the very\r\nfirst word -- is matched against all defined aliases. This word is\r\nseparated from its arguments by whitespaces and cannot contain any path\r\ndelimiters, such as backslashes or colons.\r\nIf the command matches an alias, the name is _substituted_ by the\r\nstringassociated to the aliases, e.g. by defining the alias ls by:\r\nALIAS <#alias> ls=dir /w/o\r\n\r\nlet FreeCOM interprete the command line:\r\nC> ls /a\r\n\r\nexactly as if one had typed in:\r\nC> dir /w/o /a\r\n\r\nTo _prevent_ the alias expansion an asterisk is prefixed before the\r\ncommand, e.g.:\r\nC> *ls /a\r\n\r\nreally tries to execute the command:\r\nls /a\r\n\r\nwhich usually is an external command.\r\n\r\nAliases may be used to _hide or re-place internal commands_, e.g.:\r\nALIAS <#alias> dir=xdir\r\n\r\neffectively hides the internal command DIR <#dir> and will always\r\nexecute the -- usually -- external command XDIR.\r\n\r\nAliases _may be nested_, so if both alias definitions mentioned above\r\nare in place, the command:\r\nC> ls /a\r\n\r\nis really executed as:\r\nxdir /w/o /a\r\n\r\nwhere the ls command is substituted by the command dir /w/o, then dir is\r\ndetected as alias, too, and hence replaced by xdir.\r\nThe same alias is _never substituted twice_, neither directly nor\r\ntransitively, so:\r\nALIAS <#alias> dir=dir /w\r\n\r\nis allowed as well as:\r\nALIAS <#alias> ls=dir /w/o\r\nALIAS <#alias> dir=ls -l\r\n\r\ncommand results in\r\nls ls -l /w/o\r\ndir dir /w/o -l\r\n\r\nAs implied above, aliases are expanded when needed and /not/ when they\r\nare defined.\r\n\r\nAliases are storred _for each instance of FreeCOM individually_ and are\r\ninherited by secondary instances from the parent.\r\n\r\n\r\n      Options\r\n\r\nCompile-time options:\r\n\r\n    * ALIAS_DEFAULT_SIZE: The size reserved for all aliases per FreeCOM\r\n      instance. Default: 1024 \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    BEEP - Issue a Beep\r\n\r\nRequirements: CMD_BEEP\r\n\r\n\r\n      Synopsis\r\n\r\nBEEP\r\n\r\nIssues a beep.\r\nAt this time FreeCOM supports audible beeps only.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    BREAK - Display or Set Extended Break Checking\r\n\r\nRequirements: CMD_BREAK\r\n\r\n\r\n      Synopsis\r\n\r\nBREAK *[* ON | OFF *]*\r\n\r\nDisplays or sets the Extended Break status.\r\n\r\nBy pressing ^Break or ^C (Control-Break or Control-C) an user may signal\r\nthe currently running program to halt. Most programs will abort to the\r\nprompt, but some may decide to just cancel the current action, but\r\nremain active.\r\n\r\nDOS checks for ^Break/^C (Control-Break or Crontrol-C) each time a\r\nprogram issues a console input/output request. When Extended Break\r\nchecking is enabled (/ON/), DOS checks for ^Break each time a program\r\nissues a request.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    CALL - Call a Nested Batchfile or Program\r\n\r\nSee also: LOADFIX <#loadfix>, LOADHIGH <#loadhigh>\r\nOptional requirements: FEATURE_KERNEL_SWAP_SHELL\r\n\r\n\r\n      Synopsis\r\n\r\n   1. CALL *[/Y]* /program/ *[* arguments *]*\r\n   2. CALL *[/Y]* *[* */S* | */N* *]* /program/ *[* arguments *]*\r\n\r\nCalls a program or batch script.\r\n\r\nIf the /program/ is a batch script <#_appendix_batch>, that means it has\r\nthe extension .BAT, CALL <#call> nests the batch script within the\r\nalready running one. Without CALL <#call> the invoked batch script would\r\nterminate all already running batch scripts.\r\n\r\nIf present, the arguments are passed unchanged to the invoked program.\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n    * */S*: If /program/ is not a batch script, the external program is\r\n      executed by swapping FreeCOM out of memory. This process will\r\n      require more time, especially if FreeCOM is to be reloaded from a\r\n      floppy, some internal settings are lost, e.g. command line\r\n      history, but it will free as much memory as possible for the\r\n      external program.\r\n\r\n      This option and, thereby, this function is available only, if\r\n      FreeCOM had been compiled with some support for swapping.\r\n\r\n    * */N*: If /program/ is not a batch script, the external program is\r\n      executed directly, with swapping disabled. */N* superceeds */S*.\r\n    * */Y*: Enables tracemode during execution of the command. \r\n\r\nNote: In the future to swap FreeCOM out of memory during the execution\r\nof an external program will be the default behaviour.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    CANCEL - Terminate all scripts\r\n\r\n\r\n      Synopsis\r\n\r\nCANCEL *[* /n/ *]*\r\nTerminates all currently active batch scripts and, if present, assigns\r\nthe specified number /n/ to the errorlevel.\r\n\r\n/Note/: This command is a hidden internal command <#_appendix_hicmd>.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    CD - Change current directory of a drive\r\n\r\nSee also: CDD <#cdd>, CHDIR <#chdir>, DIR <#dir>, DIRS <#dirs>, MD\r\n<#md>, PUSHD <#pushd>, RD <#rd>\r\nRequirements: CMD_CHDIR\r\nOptional requirements: FEATURE_LAST_DIR <#feature_last_dir>\r\n\r\n\r\n      Synopsis\r\n\r\n   1. CD\r\n   2. CD *[* /drive/ ':' *]* /path/\r\n   3. CD '-'\r\n\r\nCD <#cd> is 100% compatible with the CHDIR <#chdir> command; there is no\r\ndifference -- beside the spelling -- between them.\r\n\r\nThe first variant shows the current working directory <#_appendix_cwd>\r\nas absolute path.\r\n\r\nThe second variant changes the current directory <#_appendix_currdir> of\r\nthe given drive. If no drive is specified on command line, the current\r\ndirectory of the currently selected drive (disk) <#chgdrive> is changed.\r\nThis command does *not* change the currently selected drive in opposite\r\nto CDD <#cdd>!\r\n\r\nThe third variant changes back into the last visited directory *and*\r\ndrive. The commands CD <#cd>, CHDIR <#chdir>, CDD <#cdd>, and PUSHD\r\n<#pushd> save the current working directory before performing the\r\nspecified directory change; the command CD <#cd> '-' restores this saved\r\ndirectory. This command is available only, if the feature LAST_DIR has\r\nbeen enabled during the compilation of FreeCOM.\r\n\r\n\r\n      Options\r\n\r\nThere are no options for this command.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nCD <#cd> \\freedos\\help\r\nChanges the current working directory of the currently selected drive to\r\nthe path \\FREEDOS\\HELP.\r\n\r\n\r\n        Example: 2\r\n\r\nCD <#cd> c:\\freedos\\help\r\nChanges the current directory of drive C:.\r\n\r\n\r\n        Example: 3\r\n\r\nAssuming the current working directory is \\FREEDOS\\HELP and the\r\ncurrently selected drive is C:. CD <#cd>\r\nDisplays C:\\FREEDOS\\HELP\r\n\r\n\r\n        Example: 3\r\n\r\nThe command sequence, provided the first two worked successfully:\r\nCD <#cd> \\FREEDOS\\HELP\r\nCD <#cd> ..\r\nCD <#cd> -\r\nchanges first into the directory \\FREEDOS\\HELP, then into its parent\r\ndirectory, which is \\FREECOM. And finally CD <#cd> - changes back to\r\n\\FREEDOS\\HELP, because this was the previous directory before previous\r\nCD <#cd>-like command.\r\n\r\nBecause CD <#cd> - saves the previous directory, too, any subsequent: CD\r\n<#cd> -\r\nwill switch between these two directories; until another directory is\r\nchanged to.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    CDD - Changes the current working directory\r\n\r\nSee also: CD <#cd>, DIR <#dir>, MD <#md>, PUSHD <#pushd>, RD <#rd>\r\nRequirements: CMD_CDD\r\n\r\n\r\n      Synopsis\r\n\r\n   1. CDD\r\n   2. CDD *[* /drive/ ':' *]* /path/\r\n   3. CDD '-'\r\n\r\nThe behaviour of CDD <#cdd> is similiar to the CD <#cd> command, but it\r\nalways changes both the currently selected drive and the current\r\ndirectory, thus, it changes the current working directory.\r\n\r\nFor further details please see the CD <#cd> command.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    CHDIR - Change current directory of a drive\r\n\r\nThis command is 100% compatible to CD <#cd>, please see there\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    CLS - Clear screen\r\n\r\nSee also: ECHO <#echo>, TYPE <#type>\r\nRequirements: CMD_CLS\r\n\r\n\r\n      Synopsis\r\n\r\nCLS\r\nClears the screen and resets the character colours to white on black.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    COPY - Copy one or more files to another location\r\n\r\nSee also: DEL <#del>, REN <#ren>\r\nRequirements: CMD_COPY\r\n\r\n\r\n      Synopsis\r\n\r\n   1. COPY *[{* /option/ *}]* /source/ *[{* /option/ *}]* /target/ *[{*\r\n      /option/ *}]*\r\n\r\nCopies the source file into the target file. See also: \\REF{wildcards}\r\n\r\nBefore parsing its command line COPY <#copy> parses any /option/\r\nspecified by the environment variable *COPYCMD*.\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n    * */A* see below\r\n    * */B*: Specifies the mode, in which the file is copied, */A* forces\r\n      ASCII and */B* forces binary mode.\r\n\r\n      These options do alter the mode of the file immediately preceeding\r\n      them and all following ones, until changed again.\r\n\r\n      In binary mode the file is copied and nothing is changed at all.\r\n\r\n      In ASCII mode COPY <#copy> takes special care about linefeeds /\r\n      newline characters and the end-of-line character.\r\n\r\n          o On read, the newline characters, which are a sequence of two\r\n            different bytes in DOS, are transformed into a single\r\n            character, as known from Unix-style systems. On write, this\r\n            single character is transformed into the two-byte sequence.\r\n            So, if both files are copied with different modes, newline\r\n            characters are transformed into either way.\r\n          o If the end-of-file character is found on read, the remaining\r\n            contents of the file is ignored. On write, such character is\r\n            appended after the last character has been written. \r\n      By default, files are copied in binary mode, whereas devices, e.g.\r\n      CON:, are copied in ASCII mode, but no end-of-file is appended. \r\n\r\n\r\n      Arguments\r\n\r\n    * /source/: The source file.\r\n      If more than one source file is specified, the target must be a\r\n      directory.\r\n    * /target/: The target of the COPY <#copy> process.\r\n      If target is a directory, the destination file is placed into this\r\n      directory, but with the same filename as the source file.\r\n      If exactly one source is specified, but no target, target defaults\r\n      to just ., which represant the current directory. \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    CTTY - Change TTY (console)\r\n\r\nRequirements: CMD_CTTY\r\n\r\n\r\n      Synopsis\r\n\r\nCTTY /device/\r\nWith this command the console device can be changed. A console device\r\nperforms all basic input and output operations. This change is more\r\ncomplete than IO-redirections <#_appendix_redirection>, because latter\r\none might not catch all output, for instance the error messages. See\r\nexample 3 below.\r\nBecause the console is a bidirectional virtual device, meaning it is to\r\nperform input *and* output, the specified /device/ must not a\r\nunidirectional device, such as PRN.\r\n\r\nTo specify a second argument on the command line of FreeCOM has the same\r\neffect.\r\n\r\n*Attention*: This command is to effect the whole system, not only\r\nFreeCOM itself; so the effect of CTTY <#ctty> does not only depend on\r\nthe implementation status of FreeCOM, but on the DOS kernel, too.\r\n\r\nAlso, some programs access the screen or keyboard directly, rather than\r\nusing the DOS functions; these programs are *not* effected by CTTY <#ctty>.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nCTTY <#ctty> aux\r\nChanges the console to the /AUX:/ device, which is usually the first\r\nserial communication port COM1:. If this line is connected to a terminal\r\nor a terminal emulator, the system can be controlled from the terminal\r\nby now.\r\n\r\n\r\n        Example: 2\r\n\r\nCTTY <#ctty> nul\r\nany command sequence\r\nCTTY <#ctty> con\r\nThe first command discards any output. If a program attempts any input\r\noperation, it gets none. Some programs may not handle such situation\r\ncorrectly.\r\nSo, any output, even error messages, are discarded during the command\r\nsequence.\r\nThe second command changes the console back to the screen/keyboard pair.\r\nTo display a string onto screen or read from keybord the usual\r\nI/O-redirections <#_appendix_redirection> may be used, for instance:\r\n\r\n    * ECHO <#echo> This line appears on the screen >CON\r\n    * PAUSE <#pause> <CON\r\n      This PAUSE <#pause> command will get its input even within the\r\n      \"CTTY <#ctty> nul\" environment. \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    DATE - Display or set current date\r\n\r\nSee also: TIME <#time>\r\nRequirements: CMD_DATE\r\n\r\n\r\n      Synopsis\r\n\r\n   1. DATE *[* */D* *]*\r\n   2. DATE *[* */D* *]* /date/\r\n\r\nThe first variant displays the current system date, then enters a loop\r\nprompting the user for a new date. The loop terminates, if the user\r\nentered a valid new date or just pressed the ENTER key.\r\n\r\nThe second variant does not display the current date and tries to change\r\nthe date to the specified /date/. On success the command terminates,\r\notherwise enters the loop explained above.\r\n\r\nThe individual portions of a date may be separated by at least: dots .,\r\nforward slashes / or dashes -. Other nationally used characters may be\r\nsupported, too.\r\nDATE <#date> will support partial formats:\r\n\r\n    * A /single numnber/: specifies the day only.\r\n    * /Two numbers/: specifies the day and the month in the order used\r\n      by the national date format, which is MM/DD for American and\r\n      Japanese and DD/MM for European format.\r\n    * /Three numbers/: specifies a full date including day, month and\r\n      year in the order suitable for the national date format, which is:\r\n          o MM/DD/[CC]YY: for American,\r\n          o DD/MM/[CC]YY: for European and\r\n          o [CC]YY/MM/DD: for Japanese format. \r\n      If the year portion is less than 100, the century is assumed to be\r\n      1900, if it is greater or equal than 80; otherwise the century is\r\n      2000.\r\n\r\n      /Note/: Some European countries introduced the so-called business\r\n      date in 1996 or so, which is the same as the Japanese format; it\r\n      makes sorting of literal dates a lot easier. If FreeCOM will or\r\n      will not support it, will depend on the NLS used by DOS.\r\n\r\n\r\nSymbolical names of monthes are not support (yet).\r\n\r\n\r\n      Options\r\n\r\nAll options must precced any argument.\r\n\r\n*/D* prevents from prompting the user.\r\n\r\n   1. In variant 1, the date is displayed only.\r\n   2. In variant 2, the date is tried to be changed, but the loop is not\r\n      entered on failure. \r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nDATE <#date> /D\r\nJust display the current system date.\r\n\r\n\r\n        Example: 3\r\n\r\nDATE <#date> 2/1/00\r\nSets the current date to 1st February of 2000.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    DEL - Delete files\r\n\r\nSee also: DIR <#dir>\r\nRequirements: CMD_DELETE\r\n\r\n\r\n      Synopsis\r\n\r\nDEL *[{* /options/ | /pattern/ *}]*\r\nDeletes files, if /pattern/ matches a directory, all files within this\r\ndirectory are deleted.\r\n\r\nWhen all files are to be deleted, a warning prompt is issued.\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n    * */P*: Prompts the user before delete a file.\r\n    * */V*: Displays, which files are deleted. \r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nDEL <#del> FILE1.EXT FILE2.EXT\r\nDeletes the files FILE1.EXT and FILE2.EXT.\r\n\r\n\r\n        Example: 2\r\n\r\nDEL <#del> /P *.bak\r\nDeletes all files with extension BAK, but prompts the user for each\r\nsingle file before deleting it.\r\n\r\n\r\n        Example: 3\r\n\r\nDEL <#del>.\r\nDeletes all files within the current directory.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    DIR - Displays the contents of the directory\r\n\r\nSee also: CHDIR <#chdir>, MKDIR <#mkdir>, RMDIR <#rmdir>\r\nRequirements: CMD_DIR\r\n\r\n\r\n      Synopsis\r\n\r\nDIR *[{* /options/ | /pattern/ *}]*\r\n\r\nDIR <#dir> displays the contents of direcories and/or the attributes of\r\nfiles, whatever the /pattern/ specifies. If no /pattern/ is specified on\r\ncommand line, the current working directory is displayed. The actual\r\ninformation displayed depends on the specified options and is explained\r\nbelow.\r\n\r\nA /pattern/ may contain wildcards <#_appendix_wildcards>, which are\r\nexpanded against both files and directories. To specify a directory is\r\nessentially equal to write: directory\\*.*.\r\n\r\nUnlike options patterns are performed in sequence, that means that if\r\ntwo patterns are specified, first all entries matching the first one,\r\nthen all entries matching the second one are displayed; instead of to\r\ndisplay the matching entries intermixed.\r\n\r\nBefore parsing its command line DIR <#dir> parses any /option/ specified\r\nby the environment variable *DIRCMD*.\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n    * */A*: (All) Wildcards are matched against System and Hidden files,\r\n      too.\r\n    * */A***: (Attribute) Wildcards are matched against files with\r\n      selected attributes set or clear. The argument of the */A* option\r\n      is a sequence of:\r\n          o *?* meaning: attribute *?* must be set, or\r\n          o *-?* meaning: attribute *?* must not be set. \r\n\r\n      The following attributes, the *?* above, are supported:\r\n\r\n          o *R* for: read-only,\r\n          o *H* for: hidden,\r\n          o *S* for: system,\r\n          o *D* for: directory, and\r\n          o *A* for: archive. \r\n\r\n      If the same attribute is specified twice within the same */A*\r\n      option, the last one superceeds previous ones; if more than one\r\n      */A* option is specified, the last one superceeds all previous ones.\r\n\r\n    * */B*: (Bare) Displays the lines with the information of files and\r\n      directories only. The ones displaying the volume label, the serial\r\n      number, totals etc. are suppressed. In combination with */S* the\r\n      absolute path of the files is displayed.\r\n    * */L*: (Lower-case) Filenames are displayed in lower-case letters\r\n      rather than capitol ones.\r\n    * */O*: (Order default) is a synonym of */ONG*.\r\n    * */O***: (Order) Sort the entries displayed in a specific order.\r\n      The following sort orders are supported:\r\n          o *D* sort by last modification *d*ate (earliest first)\r\n          o *E* sort by file *e*xtension\r\n          o *G* *g*roup directories first\r\n          o *N* sort by file *n*ame\r\n          o *S* sort by size (smallest first)\r\n          o *U* do not sort (*u*nsorted) \r\n\r\n      Each sort order, except *U*, may be prefixed by a hyphen to\r\n      reverse the sort order. *U* effectively cancels any previous\r\n      setting or specified sort order, e.g. to override an */O* option\r\n      from the *DIRCMD* environment variable.\r\n\r\n      If the same sort order is specified twice within the same */O*\r\n      option, the last one superceeds previous ones; if more than one\r\n      */O* option is specified, the last one superceeds all previous ones.\r\n\r\n      *Warning*: The entries are cached within memory before displaying\r\n      them; if FreeCOM runs short on memory, to sort is disabled\r\n      completely or the entries are sorted in chunks only.\r\n\r\n    * */P*: (Page) Page the output -- pause the display after issuing\r\n      one screen-full.\r\n    * */S*: (Subdirectories) Recursively display directories.\r\n    * */W*: (Wide) Displays five filenames per line and suppress the\r\n      information about the file size, date etc.\r\n    * */Y*: (Year) Displays a 4-digit year, rather than just two digits.\r\n    * */4*: (4digit Year) is a synonym of */Y*. \r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nDIR <#dir>\r\nDisplays the contents of the current directory, but ignore System and\r\nHidden files. The output may look like this:\r\n\r\n!!todo!!\r\n\r\n\r\n        Example: 2\r\n\r\nDIR <#dir> a* bb* *.txt\r\nFirst displays all files, that begin with the letter A; then all files,\r\nthat begin with two letters B, are displayed and at last all files with\r\nthe extension TXT.\r\n\r\n\r\n        Example: 3\r\n\r\nDIR <#dir> /w a* b*\r\nDIR <#dir> a* /w b*\r\nDIR <#dir> a* b* /w\r\nBecause the position of options is not significant, all these examples\r\nbehave the same way and display the matching files in /wide/ or also\r\ncalled /short/ form, which may look like this:\r\n\r\n!!todo!!\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    DIRS - Display the directory stack\r\n\r\nSee also: CD <#cd>, CHDIR <#chdir>, POPD <#popd>, PUSHD <#pushd>\r\nRequirements: CMD_DIRS\r\n\r\n\r\n      Synopsis\r\n\r\nDIRS\r\nDisplays all directories stacked with the PUSHD <#pushd> command.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    ECHO - Displays a string onto screen\r\n\r\nSee also: TYPE <#type>\r\nRequirements: CMD_ECHO\r\n\r\n\r\n      Synopsis\r\n\r\n   1. ECHO *[* ON | OFF *]*\r\n   2. ECHO string\r\n   3. ECHO.\r\n\r\nWhen executing a batch script each line is displayed to the console\r\nbefore executing it by default. The first variant of ECHO <#echo>\r\nenables or disables this behaviour. To disable echoing the commands is\r\nequal to prefix each line of a batch script with the Ad-symbol @.\r\nIf ECHO <#echo> is invoked with no argument at all, the current echo\r\nstatus is displayed.\r\nWhen entered on an interactive command line the echo status controls\r\nwhether or not the PROMPT <#prompt> string is displayed.\r\n\r\nThe second variant displays the specified string.\r\nNote: Because of variant 1 string may not expand to the single words\r\nON or OFF without another character.\r\n\r\nThe third variant displays an empty line. No space must be placed\r\nbetween the dot and ECHO <#echo>.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nECHO <#echo>\r\nDisplays the current echo status, e.g. responding:\r\n\r\nECHO <#echo> is on\r\n\r\n\r\n        Example: 2\r\n\r\n@ECHO <#echo> OFF\r\nDisables the echo status. Because the Ad-sign @ disables the echo status\r\nright for this line, this command disable echoing all the next lines of\r\na batch script and is not echoed to the console itself. It is,\r\ntherefore, best placed in the first line of a batch script.\r\n\r\n\r\n        Example: 3\r\n\r\nECHO <#echo> Just a text\r\nDisplays Just a text\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FEATURE_ENHANCED_INPUT - Enhanced command line editing\r\n\r\nSee also: FEATURE_FILENAME_COMPLETION <#feature_filename_completion>,\r\nFEATURE_HISTORY <#feature_history>\r\n\r\nIf enabled on compilation of FreeCOM, enhanced command line editing\r\nfeatures are activated. Otherwise, FreeCOM uses the default buffered\r\ninput DOS API function #0A.\r\n\r\nIf this feature is disabled, neither command line history nor filename\r\ncompletion is available.\r\n\r\nBesides the other features various key bindings recognized, which are\r\nlisted in the general FreeCOM documentation.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    ERASE - Delete files\r\n\r\nThis command is 100% compatible to DEL <#del>, please see there\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    EXIT - Terminate shell\r\n\r\n\r\n      Synopsis\r\n\r\nEXIT\r\nTerminates the currently running shell, unless FreeCOM had been started\r\nwith the */P* option. In this case, EXIT <#exit> works like CANCEL\r\n<#cancel>.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FEATURE_AUTO_REDIRECT_TO_CON - Autoswitch CON: to monitor\r\n\r\nIf defined on compilation of FreeCOM and if FreeCOM is to terminate\r\nalthough it is forbidden -- e.g. by passing the */P* option when\r\nexecuting FreeCOM --, the console is changed to the keyboard/monitor\r\npair automatically after some insuccessful prompts to reboot the system.\r\n\r\n\r\n      Options\r\n\r\nCompile-time options:\r\n\r\n    * FEATURE_AUTO_REDIRECT_TO_CON <#feature_auto_redirect_to_con>: How\r\n      many loops may pass before switching the console CON: to the\r\n      monitor. Default: 5. \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FEATURE_BATCH - Batch script processing\r\n\r\nRequirements: IMPLICIT\r\n\r\nThe batch script processing is always enabled.\r\n\r\n\r\n      Options\r\n\r\nCompile-time options:\r\n\r\n    * BATCH_NESTLEVEL_MIN: Minimal supported batch nesting level.\r\n      Default: 5 \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    ENVIRONMENT_KEEP_FREE - keep free space in environment segment\r\n\r\nIf defined on compilation of FreeCOM, FreeCOM tries to keep the unused\r\nspace in the environment segment equal to or greater than\r\nENVIRONMENT_KEEP_FREE <#environment_keep_free>. The default value is 256.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FEATURE_BOOT_KEYS - check for F5/F8 keys on startup if /P is present\r\n\r\nIf defined on compilation of FreeCOM, FreeCOM waits three seconds on\r\nstartup, if the */P* switch is present. If during this time a key has\r\nbeen pressed, |F5| will bypass AUTOEXEC.BAT execution and |F8| will\r\nenable trace mode.\r\n|F5| is equal to to pass the */D* switch <FreeCOM.html#-cmdline> to\r\nFreeCOM.\r\n|F8| is equal to to pass the */Y* switch <FreeCOM.html#-cmdline> to\r\nFreeCOM.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FEATURE_INSTALLABLE_COMMANDS - Installable Commands interface (MUX-AE)\r\n\r\nIf defined on compilation of FreeCOM, calls to the Installable Commands\r\nAPI are made before executing any command. The API is situated at\r\nMUX-AE, the Multiplexer interrupt 0x2F function 0xAE.\r\n\r\nThe interface is documented elsewhere, for instance RBIL (Ralph Brown's\r\ninterrupt list).\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FEATURE_NLS - use DOS NLS\r\n\r\nIf defined on compilation of FreeCOM, FreeCOM uses the information\r\nretrievable by the currently active DOS NLS using the API functions #65.\r\n\r\nThese information influence:\r\n\r\n    * the format displaying time and date information,\r\n    * the characters to delimit items in lists,\r\n    * the currency string and display format,\r\n    * how to up- (and supported by some NLS only) to lower-case characters,\r\n    * how to sort characters. \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FEATURE_CALL_LOGGING - Startup logging\r\n\r\nIf defined on compilation of FreeCOM, all startups of a FreeCOM instance\r\nis logged into a file.\r\n\r\nThe drive the logfile is created on can be changed at run-time with the\r\nexternal tool PTCHLDRV.\r\n\r\n\r\n      Options\r\n\r\nCompile-time options:\r\n\r\n    * LOG_FILE: The name of the logfile. Default: C:\\FreeCom.log \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FEATURE_FILENAME_COMPLETION - Filename completion\r\n\r\nRequirements: FEATURE_ENHANCED_INPUT <#feature_enhanced_input>\r\n\r\nIf defined on compilation of FreeCOM and if the enhanced command line\r\nediting is activated as well, the tabulatur key binding becomes available.\r\n\r\nWhen the tabulator key is pressed, the word the cursor is located on\r\nactually or is immediately preceeding is separated and tried to match\r\nagainst files, like a DIR <#dir> command would do, e.g. when hitting tab\r\nat the command line:\r\nbar\\f_ some arguments\r\n\r\n-- where the underscore _ is to mark the location of the cursor and is\r\n/no/ actual character -- causes FreeCOM to try to locate any files or\r\ndirectories matching the filename pattern bar\\f*.*.\r\nIf none is found, a beep is issued to indicate that error and the\r\ncommand line remains unchanged.\r\nOtherwise as many characters are appended to the filename as are the\r\nsame for all found matches, e.g.:\r\n\r\n   1. if exactly one match was found, its name is appened.\r\n   2. if, for example, the files or directories: FOO, FUU.TXT or FUU are\r\n      present in the directory BAR, no character is appened, because\r\n      there are no equal characters following the already present f\r\n      character.\r\n   3. if, for example, the files or directories: FOO, FOO.TXT or\r\n      FOO1.TXT are present in the directory BAR, the two characters OO\r\n      are appened, because all found matches share these two characters\r\n      immediately following the already present characers. Hence, the\r\n      command line is expanded to:\r\n      bar\\FOO_ some arguments\r\n\r\n      Please note that the case of all characters will match the case of\r\n      the retrieved filenames. \r\n\r\nIn addition, because in the cases 2 and 3 the file completion was not\r\ncomplete because more than one match was found, a beep is issued. In\r\nthis situation to hit the tabulator key a second time, without an\r\nintervueing other key press, causes to display all available matches,\r\nbut keeps the command line unchanged otherwise.\r\nIf exactly one filename match was found, hence the file completion was\r\ncomplete, and if the found match is a directory, a backslash is appended\r\nto. This allows to walk into deep levels of directories speededly.\r\n\r\nIf the cursor had been placed, for instance, under the backslash in\r\nabove mentioned command line, the full string bar\\f had been tried to be\r\ncompleted as well. This behaviour differs from other implementations.\r\n\r\n\r\n      Options\r\n\r\nCompile-time options:\r\n\r\n    * FILE_SEARCH_MODE: Filemode passed to the DOS API to aquire\r\n      matching directory entries. Default: Read-Only, Archive, Directory \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FEATURE_DIRSTACK - Directory stack\r\n\r\nSee also: DIRS <#dirs>, POPD <#popd>, PUSHD <#pushd>\r\n\r\nThis feature is automatically enabled, if PUSHD <#pushd> is enabled.\r\n\r\nThe directory stack pushes and pops directories on demand via the\r\ncommands PUSHD <#pushd> and POPD <#popd>. DIRS <#dirs> displays all\r\npushed directories.\r\n\r\nPlease see the documentation of the mentioned commands.\r\n\r\n\r\n      Options\r\n\r\nCompile-time options:\r\n\r\n    * DIRSTACK_DEFAULT_SIZE: The amount of bytes reserved to store items\r\n      of the directory stack. Default: 256 \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FEATURE_HISTORY - Command line history\r\n\r\nSee also: HISTORY <#history>\r\nRequirements: FEATURE_ENHANCED_INPUT <#feature_enhanced_input>\r\n\r\nIf enabled on compilation of FreeCOM and the enhanced command line\r\nediting is acivated as well, the command line history becomes available.\r\n\r\nWhen commands are enterred manually on the command line prompt of\r\nFreeCOM, old command lines are storred in the history and can be\r\nretrieved later using the key bindings of F3, F1 and the cursor Up and\r\nDown keys.\r\nWithout the command line history at most one line is cached.\r\n\r\nThe command:\r\nHISTORY <#history>\r\n\r\ndisplays all cached command lines.\r\n\r\nThe command:\r\nHISTORY /number/\r\n\r\nresizes the amount of bytes reserved to cache command lines to /number/\r\nbytes. Doing so all cached command lines are deleted.\r\n\r\nEach instance of FreeCOM maintains its own command line history, which\r\nis initially inherited from the particular parent instance, if any.\r\n\r\n\r\n      Options\r\n\r\nCompile-time options:\r\n\r\n    * HISTORY_DEFAULT_SIZE: The amount of bytes reserved initially.\r\n      Default: 256 \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FEATURE_LAST_DIR - Change back to last directory\r\n\r\nSee also: CD <#cd>, CDD <#cdd>, CHDIR <#chdir>, POPD <#popd>, PUSHD <#pushd>\r\n\r\nIf defined on compilation of FreeCOM, every change of the current\r\ndirectory using an internal command records the previous directory and\r\nenables the /-/ shortcut for CD <#cd>, CDD <#cdd> and CHDIR <#chdir>.\r\n\r\n\r\n        Example:\r\n\r\nC> CD <#cd> \\\r\nC> CD <#cd> freedos\\bin\r\nC> CD <#cd> -\r\nC> CD <#cd> -\r\n\r\nThe first CD <#cd> command changes into the root direcotry, the second\r\ninto the directory \\FREEDOS\\BIN, any subsequent CD <#cd> - commands will\r\nchange between the root directory and \\FREEDOS\\BIN.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FOR - Repeat a command\r\n\r\nRequirements: CMD_FOR\r\n\r\n\r\n      Synopsis\r\n\r\nFOR '%' /letter/ IN '(' *{* /word/ | /pattern/ *}* ')' DO any command\r\nExecutes any command for several values assigned to the variable\r\n/letter/. The values are read strictly left to right from the /word/s\r\nand /pattern/s enclosed in parenthises; where /pattern/s are words\r\ncontaining wildcards and are replaced by all matching filenames.\r\n\r\nAny occurence of a percent sign % and the specified letter is replaced\r\nby the current value of the FOR <#for> loop. /Note:/ The letter is\r\ncase-sensitively matched!\r\n\r\n*Warning #1*: Unlike most commands I/O-redirections\r\n<#_appendix_redirection> are passed forth to the command instead of to\r\napply them to FOR <#for> itself, e.g.:\r\nFOR <#for> %a IN (*.*) DO ECHO <#echo> %a >q\r\nrepeatedly executes the ECHO <#echo> command with the redirection >q,\r\nhence, effectively overwriting the file each time.\r\n*Warning #2*: Due the syntactical problem that the FOR <#for> variable\r\nis specified as '%' /letter/, which is also a legal start of an\r\nenvironment variable, the following kludge had been included to support\r\nFOR <#for> and its special variables:\r\n\r\n    * You can use as many percent character as you wish as long as you\r\n      use exactly the same number for a particular FOR <#for> variable.\r\n    * Before any environment variables are expanded, the command line is\r\n      checked for the skeleton specified within the synopsis (there must\r\n      not be specified no redirection between the FOR <#for> and DO\r\n      keywords), if it is found, the FOR <#for> command is executed\r\n      /without/ expanding any environment variables -- they get expanded\r\n      each time the command is invoked.\r\n    * *Known Bug*: Otherwise any environment variables are expanded and,\r\n      if it happens that a valid FOR <#for> command is found now, the\r\n      environment variables within the command are expanded a second\r\n      time. In this case the I/O redirections are applied to FOR <#for>,\r\n      too, instead of passing them forth to the command.\r\n    * FOR <#for> commands as part of the command of CALL <#call>, IF\r\n      <#if>, and FOR <#for> itself are never found before expanding the\r\n      environment variables. \r\n\r\n\r\n*Warning #3*: Due a bug in MS COMMAND (BugID #1050) the right\r\nparenthesis *must* be followed by at least one whitespace, this allows\r\nthe \"/feature/\" to embed such characters within the words and patterns,\r\ne.g.:\r\nFOR <#for> %a in (a()a b()b) DO command\r\nexecutes the command two times, first replacing %a by a()a, second by b()b.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nFOR <#for> %z IN (*.*) DO copy %a a:\r\nPerforms a COPY <#copy> xyz A: command for each file in the current\r\ndirectory. Its behaviour is equal to COPY <#copy> *.* A:\r\n\r\n\r\n        Example: 2\r\n\r\nFOR <#for> %z IN (a?b*.TXT) DO CALL <#call> batch arg %z\r\nExecutes the batch script batch.bat for each file matching the pattern\r\nA?B*.TXT located in the current directory. Within the script, the\r\nautomatic variable /%1/ always expands to the constant argument /arg/,\r\nwhereas /%2/ expands to the filename of the current loop.\r\n\r\n\r\n        Example: 3\r\n\r\nFOR <#for> %a IN (1 2 3 4 5) DO ECHO <#echo> %a\r\nIs equal to the command sequence:\r\nECHO <#echo> 1\r\nECHO <#echo> 2\r\nECHO <#echo> 3\r\nECHO <#echo> 4\r\nECHO <#echo> 5\r\nBecause these words do /not/ contain no wildcards, they are /not/\r\nmatched as filenames.\r\n\r\n\r\n        Example: 4\r\n\r\nFOR <#for> %g IN (1 2 3*) DO ECHO <#echo> %g\r\nPerforms the commands:\r\nECHO <#echo> 1\r\nECHO <#echo> 2\r\nand the ECHO <#echo> command for each file in the current directory,\r\nthat has no extension and which name starts with the digit three.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    GOTO - Goto label\r\n\r\nRequirements: CMD_GOTO\r\n\r\n\r\n      Synopsis\r\n\r\nGOTO *[* ':' *]* /label/\r\nNormally all commands of a batch script are executed in the sequence in\r\nwhich they are appear with the script. GOTO <#goto> controls the command\r\nflow by unconditionally jumping to the specified /label/; the commands\r\nfollowing that label will be executed then. A label is written as a\r\ncolon in the first column of a line and the name of the label\r\nimmediately behind. If FreeCOM hits a label in the normal flow, it is\r\nignored completely, even any redirection characters are ignored.\r\n\r\nThe /label/ must be located in the same script file as the GOTO <#goto>\r\nitself, if it appears more than once, the first occurance takes precedence.\r\n\r\nConditional jumps can be contructed with help of the IF <#if> command,\r\nsee example 2.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nGOTO <#goto> ende\r\nJumps the to label :ende\r\n\r\n\r\n        Example: 2\r\n\r\nIF <#if> \"%1\"==\"\" GOTO <#goto> emptyCommandLine\r\nJumps to label :emptyCommandLine, if no argument had been passed to the\r\nbatch script. For instance:\r\n\r\n@ECHO <#echo> OFF\r\nIF <#if> \"%1\"==\"\" GOTO <#goto> error\r\nREM <#rem> do something sane here\r\nGOTO <#goto> ende\r\n\r\n:error\r\nECHO <#echo> You must pass an argument to me!\r\n\r\n:ende\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    HISTORY - Display command line history\r\n\r\nRequirements: FEATURE_HISTORY <#feature_history>\r\n\r\n\r\n      Synopsis\r\n\r\n   1. HISTORY\r\n   2. HISTORY /number/\r\n\r\nThe first format without any argument displays all cached command lines.\r\n\r\nThe second format resizes the memory pre-allocated for the command line\r\nhistory cache to /number/ bytes.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    IF - Conditional execution of a command\r\n\r\n\r\n      Synopsis\r\n\r\n   1. IF *[* NOT *]* EXIST /file/ command\r\n   2. IF *[* NOT *]* ERRORLEVEL /number/ command\r\n   3. IF *[* NOT *]* /string/ '==' /word/ command\r\n   4. IF *[* NOT *]* /quoted-string/ '==' /quoted-string/ command\r\n\r\nConditionally executes the specified command. If the keyword NOT is\r\nspecified, the condition is negated, meaning, the command is executed,\r\nif the condition evaluates to false.\r\n\r\nThe first condition evaluates to true, if the specified /file/ exists.\r\nWildcards are supported. On local file systems one can test for\r\ncharacter devices, too.\r\n\r\nThe second variant evaluates to true, if the errorlevel is currently\r\nassigned to a number greater or equal than the specified /number/.\r\nErrorlevels are assigned when external commands terminates or via CANCEL\r\n<#cancel> or QUIT <#quit>.\r\n\r\nThe third and four ones are true, when the left string is\r\ncase-sensitively equal to the string on the right side of the double\r\nequal sign. Either side may be quoted by double quotes, though, if the\r\nright side is /not/ quoted, the first word is tested only.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nIF <#if> NOT EXIST c:\\command.com ECHO <#echo> There is no COMMAND.COM\r\nin C:\\\r\n\r\nExecutes the ECHO <#echo> command, if a file C:\\COMMAND.COM does /not/\r\nexist.\r\n\r\n\r\n        Example: 2\r\n\r\nIF <#if> EXIST c:\\fdos\\nul GOTO <#goto> have_fdos_directory\r\n\r\nBranch the interpretation of the batch script to the label, if the file\r\nC:\\FDOS\\NUL exists. Because the filename NUL corresponds to the\r\ncharacter device NUL:, which always exists, this test may be used to\r\nprobe for the existance of the path C:\\FDOS, because all character\r\ndevices are virtually present in every directory of local filesystems.\r\n\r\n\r\n        Example: 3\r\n\r\nIF <#if> %1==name ECHO <#echo> First argument is \"name\"\r\n\r\nECHO <#echo> is executed, if the first argument of the current batch\r\nscript is /\"name\"/ (without the quotes). %1 may expand to any string,\r\neven with embedded whitespaces, but without an embedded double equal\r\nsign. Also, metacharacters included within the argument are evaluated.\r\n\r\n\r\n        Example: 4\r\n\r\nIF <#if> \"%1\"==\"first name\" ECHO <#echo> First argument is \"first name\"\r\n\r\nECHO <#echo> is executed, if the first argument of the current batch\r\nscript is /\"first name\"/ (without the quotes). %1 may expand to any\r\nstring, even with embedded whitespaces or an embedded double equal sign\r\nor metacharacters.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    FEATURE_LOAD_MESSAGES - Load messages permanently\r\n\r\nIf enabled on compilation of FreeCOM, the */MSG* becomes available.\r\n\r\nIf this option is present, when an instance of FreeCOM is created, the\r\nFreeCOM messages are loaded into memory permanently. Otherwise, the\r\nmessages are loaded on demand and are removed from memory when an\r\nexternal command is executed, in order to conserve memory.\r\n\r\nThis feature may help to run FreeCOM on disk- and floppyless boxes.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    LOADFIX - Load an external program above the first 64KB memory\r\n\r\nSee also: CALL <#call>, LOADHIGH <#loadhigh>\r\n\r\n\r\n      Synopsis\r\n\r\nLOADFIX /program/ *[{* /argument/ *}]*\r\nLoads and executes an exepacked program, that would abort execution with\r\nthe error message \"Packed file corrupt\" otherwise.\r\n\r\n/Attention:/ This command is not available in the XMS-only variant of\r\nFreeCOM!\r\n\r\n\r\n        Example:\r\n\r\nLOADFIX <#loadfix> program.exe\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    LOADHIGH - Load an external program into high memory\r\n\r\nSee also: CALL <#call>, LOADFIX <#loadfix>\r\n\r\n\r\n      Synopsis\r\n\r\nLOADHIGH *[{* /option/ *}]* /program/ *[{* /argument/ *}]*\r\nLoads and executes an external program in high memory, also called UMB.\r\nThis command is used to load TSRs, such mouse drivers, into the upper\r\nmemory to conserve the conventional memory for programs.\r\n\r\n\r\n        Example:\r\n\r\nLOADHIGH <#loadhigh> lmouse.com\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    MD - make directory\r\n\r\nSee also: CD <#cd>, MKDIR <#mkdir>, RD <#rd>\r\nRequirements: CMD_MKDIR\r\n\r\n\r\n      Synopsis\r\n\r\nMD /path/\r\nCreates a directory of the specified name /path/. Any parent directories\r\nmust already exist.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nMD <#md> C:\\1\r\n\r\nCreates the directory 1 in the root directory of drive C:.\r\n\r\n\r\n        Example: 2\r\n\r\nMKDIR <#mkdir> C:\\1\\2\\3\r\n\r\nCreates the directory 3 in the directory \\1\\2 of drive C:. If the\r\ndirectory C:\\1\\2 does not exist, yet, the command fails.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    MEMORY - Display the internally used memory\r\n\r\nRequirements: CMD_MEMORY\r\n\r\n\r\n      Synopsis\r\n\r\nMEMORY\r\n\r\nDisplays the useage of internal memory of FreeCOM. Note: The internals\r\nof FreeCOM are currently under heavy construction, the actual output\r\nmight vary heavily from this example.\r\n\r\n\r\n      Examples\r\n\r\nMEMORY <#memory>\r\nmay display this:\r\n\r\nEnvironment segment    : max  1200 bytes; free     8 bytes\r\nContext segment        : max  2304 bytes; free  2252 bytes\r\n        Aliases        : limit  1024 bytes, current     5 bytes,     0 items\r\n        History        : limit   256 bytes, current    34 bytes,     2 items\r\n        Directory stack: limit   256 bytes, current     5 bytes,     0 items\r\n        Last dir cache : used      0 bytes,     0 items\r\n        Swapinfo       : used      0 bytes,     0 items\r\nHeap                   : free 482080 bytes\r\n\r\n    * The Environment segment is the storage area, the environment\r\n      variables are storred in. It may be changed passing the */E*\r\n      option to FreeCOM.\r\n    * FreeCOM stores several internal information into the Context\r\n      segment; the aliases - modified by the ALIAS <#alias> command -,\r\n      the history - displayed using the HISTORY <#history> command,\r\n      accessed by pressing the cursor Up/Down keys on command line -,\r\n      the directory stack - displayed with the DIRS <#dirs> command and\r\n      accessed using the PUSHD <#pushd> and POPD <#popd> commands -, the\r\n      last directory - accessed with the CD <#cd> - command -, and,\r\n      finally, some internal command used by the low-level swap\r\n      interface of FreeCOM.\r\n    * The heap is the storage area FreeCOM can allocated memory from\r\n      itself. This value is useful for FreeCOM developers mostly. \r\n\r\n    * max specifies the maximum amount of bytes allocatable within this\r\n      storage area.\r\n    * free specifies the unused bytes within this storage area.\r\n    * limit specifies the maximum amount of bytes allocatable for the\r\n      particular information within the area.\r\n    * current specifies the amount of bytes currently allocated for the\r\n      particular information.\r\n    * items specifies the number of items storred for the particular\r\n      information, e.g. how many directories have been pushed onto the\r\n      stack using PUSHD <#pushd>. \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    MKDIR - Make directory\r\n\r\nThis command is 100% compatible to MD <#md>, please see there\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    PATH - Display or set the search path\r\n\r\nRequirements: CMD_PATH\r\n\r\n\r\n      Synopsis\r\n\r\n   1. PATH\r\n   2. PATH *[* '=' *]* *{* /path/ *:* ';' *}*\r\n   3. PATH;\r\n\r\nDisplays or assigns a new search path.\r\n\r\nThe first variant displays the currently active search path.\r\n\r\nThe second one assigns the specified paths to the search path. The\r\nleading equal sign, if present, is ignored.\r\n\r\nThe third variant empties the search path.\r\n\r\nWhen FreeCOM searches for an external command or a batch script, which\r\nhas no path specified, it is search for in all the directories specified\r\nin the search path. If the current directory . is not mentioned in the\r\nsearch path, it is searched through first.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nPATH <#path> c:\\fdos\\bin;c:\\tools;d:\\others\\bin;bin\r\n\r\nIf FreeCOM is to execute an external program, e.g. XCOPY, FreeCOM will\r\nsearch for the program in the following directories in the specified\r\norder, the first program file found is executed:\r\n\r\n   1. the current directory\r\n   2. C:\\FDOS\\BIN\r\n   3. C:\\TOOLS\r\n   4. D:\\OTHERS\\BIN\r\n   5. BIN \r\n\r\n\r\nNote: Because the last directory specification is a relative one, rather\r\nthan an absolute one, the program is searched for in the sub-directory\r\nBIN of the current directory.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    PAUSE - Pauses batch file execution\r\n\r\nRequirements: CMD_PAUSE\r\n\r\n\r\n      Synopsis\r\n\r\n   1. PAUSE\r\n   2. PAUSE string\r\n\r\nPauses the batch file execution until a key is pressed.\r\n\r\nPAUSE <#pause> prompts the user with the specified string or, if none is\r\nspecifed, \"Press any key to proceed\"\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nPAUSE <#pause>\r\nJust pauses the execution.\r\n\r\n\r\n        Example: 2\r\n\r\nPAUSE <#pause> Execution paused, press any key to proceed ...\r\nPauses execution displaying this string.\r\n\r\n\r\n        Example: 3\r\n\r\nPAUSE <#pause> >nul\r\nPauses execution, but does not display any prompt.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    POPD - Change back to the last pushed directory\r\n\r\nSee also: CD <#cd>, CDD <#cdd>, DIRS <#dirs>, POPD <#popd>\r\nRequirements: CMD_CDD, CMD_POPD\r\n\r\n\r\n      Synopsis\r\n\r\n   1. POPD\r\n   2. POPD '*'\r\n\r\nThe first variant changes the current directory back to the one, in\r\nwhich the last PUSHD <#pushd> command was executed.\r\n\r\nThe second one clears all entries of the directory stack, but does not\r\nchange the current directory.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    PROMPT - Display or set the shell prompt\r\n\r\nRequirements: CMD_PROMPT\r\n\r\n\r\n      Synopsis\r\n\r\nPROMPT\r\nPROMPT *[* '=' *]* /prompt/\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    PUSHD - Push the current working directory onto the directory stack\r\n\r\nSee also: CD <#cd>, CDD <#cdd>, DIRS <#dirs>, POPD <#popd>\r\nRequirements: CMD_CDD, CMD_PUSHD\r\n\r\n\r\n      Synopsis\r\n\r\nPUSHD /directory/\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    QUIT - Terminate the current script\r\n\r\n\r\n      Synopsis\r\n\r\nQUIT *[* /n/ *]*\r\nTerminates the current active batch script and, if present, assigns the\r\nspecified number /n/ to the errorlevel.\r\n\r\n/Note/: This command is a hidden internal command <#_appendix_hicmd>.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    RD - Remove directory\r\n\r\nSee also: CD <#cd>, MD <#md>, RMDIR <#rmdir>\r\nRequirements: CMD_RMDIR\r\n\r\n\r\n      Synopsis\r\n\r\nRD /path/\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    REM - Marks comments or remarks in batchfiles\r\n\r\nRequirements: CMD_REM\r\n\r\n\r\n      Synopsis\r\n\r\nREM string\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    REN - Rename files\r\n\r\nSee also: RENAME <#rename>\r\nRequirements: CMD_RENAME\r\n\r\n\r\n      Synopsis\r\n\r\nREN /source/ /destination/\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    RENAME - Rename files\r\n\r\nThis command is 100% compatible to REN <#ren>, please see there\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    RMDIR - Remove directory\r\n\r\nThis command is 100% compatible to RD <#rd>, please see there\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    SET - Display or set environment variables\r\n\r\nRequirements: CMD_SET\r\n\r\n\r\n      Synopsis\r\n\r\n   1. SET *[{* /option/ *}]*\r\n   2. SET *[{* /option/ *}]* /variable/ '=' string\r\n\r\nThe first variant (without any argument) displays all the currently\r\ndefined environment variables in the format (without any whitespaces\r\nbefore or after the equal sign): /name/ '=' value\r\n\r\nThe second variant assigns a new value string to the specified\r\n/variable/. If the /variable/ already exists, the old value is\r\noverwritten without notice; otherwise it is newly created.\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>. All options must\r\npreceed the assigment, if present.\r\n\r\n    * */C*: forces to keep the exact case of the letters of the variable\r\n      name; by default all letters are uppercased to keep compatibly.\r\n    * */I*: has been temporarily included to the SET <#set> command to\r\n      allow an easy way to display the current size of the environment\r\n      segment, because it is one of the most frequently reported, but\r\n      not reproduceable bug report. Once this option has been\r\n      encountered, all the remaining command line is ignored.\r\n    * */P*: Prompts the user with the specified string and assigns the\r\n      user's input to the /variable/. If no input is made, hence, one\r\n      taps just ENTER, an empty value is assigned to the /variable/,\r\n      which is then removed from the environment. \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    SHIFT - Shift the arguments of a batch script\r\n\r\nRequirements: CMD_SHIFT\r\n\r\n\r\n      Synopsis\r\n\r\n   1. SHIFT\r\n   2. SHIFT DOWN\r\n\r\nShifts the arguments of a batch script one position up (first variant)\r\nor down (second variant).\r\n\r\nWithin a batch script the automatic variables %0 through %9 are replaced\r\nby the script name and the first nine arguments. This can be imagined as\r\na window to ten arguments of the script. SHIFT <#shift> will allow to\r\nmove this window of ten arguments towards its end (up) or its start (down).\r\n\r\nAfter SHIFT <#shift> has been executed, the former %0 is hidden and\r\ninaccessable, %1 became %0, %2 became %1 a.s.o, %9 became %8 and the\r\nformerly hidden tenth argument became %9.\r\nSHIFT <#shift> DOWN reverses one SHIFT <#shift> command.\r\n\r\nSHIFT <#shift> can be called as many times as wanted, SHIFT <#shift>\r\nDOWN won't allow to underflow the very first argument.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nIf the batch script B.BAT:\r\n@ECHO <#echo> OFF\r\nECHO <#echo> 0: %0\r\nECHO <#echo> 1: %1\r\nECHO <#echo> 2: %2\r\nhad been executed using:\r\nB.BAT 1 2 3 4\r\nit displays:\r\n\r\nB.BAT\r\n1\r\n2\r\n\r\n\r\nIf a SHIFT <#shift> command had been inserted as second line, the same\r\ncall displays:\r\n\r\n1\r\n2\r\n3\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    TIME - Display or set current time\r\n\r\nSee also: DATE <#date>\r\nRequirements: CMD_TIME\r\n\r\n\r\n      Synopsis\r\n\r\n   1. TIME *[* */T* *]*\r\n   2. TIME *[* */T* *]* /time/\r\n\r\nVariant 1 displays the current time, then enters a loop prompting the\r\nuser to enter a new time. The loops terminates when a valid time had\r\nentered or the user just pressed the ENTER key.\r\n\r\nVariant 2 does not display the current time, but tries to change the\r\ncurrent time to the specified /time/, on failure the loop as explained\r\nabove is entered.\r\n\r\nThe individual portions of a time may be sperated by at least: dots .,\r\ncolons : and forward slashes /. Other nationally used characters may be\r\nsupported, too. If a certain number of portions are specified:\r\n\r\n   1. error,\r\n   2. hour:minute; seconds and hundreds default to zero,\r\n   3. hour:minute:seconds; hundreds defaults to zero,\r\n   4. hour:minute:seconds.hundreds;\r\n   5. more than 4 portions result in an error. \r\n\r\nSeparated by no, one or more whitespaces the am/pm modifiers may follow\r\noptionally. If present they alter the given time as follows:\r\n\r\n    * AM: if hour is equal to 12, it becomes 0 (midnight).\r\n    * PM: f hour is greater than 12, it is incremented by 12. \r\n\r\n\r\n      Options\r\n\r\nAll options must preceed any arguments.\r\n\r\n*/T*: prevents from prompting the user.\r\n\r\n   1. In variant 1, the time is displayed only.\r\n   2. In variant 2, the time is tried to be changed, but the loop is not\r\n      entered on failure. \r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nTIME <#time> /T\r\nJust displays the current time.\r\n\r\n\r\n        Example: 2\r\n\r\nTIME <#time> 18:2\r\nSets the current system time to 6:02 PM.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    TRUENAME - Display the true name of a file\r\n\r\nRequirements: CMD_TRUENAME\r\n\r\n\r\n      Synopsis\r\n\r\nTRUENAME /path/\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    TYPE - Display the contents of files\r\n\r\nSee also: DIR <#dir>, ECHO <#echo>\r\nRequirements: CMD_TYPE\r\n\r\n\r\n      Synopsis\r\n\r\nTYPE *{* /pattern/ *}*\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    VER - Display the version information about FreeCOM and DOS\r\n\r\nRequirements: CMD_VER\r\n\r\n\r\n      Synopsis\r\n\r\nVER *[{* /option/ *}]*\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    VERIFY - Display or set verify level\r\n\r\nRequirements: CMD_VERIFY\r\n\r\n\r\n      Synopsis\r\n\r\nVERIFY *[* ON | OFF *]*\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    VOL - Display the volume label of a drive\r\n\r\nSee also: DIR <#dir>\r\n\r\n\r\n      Synopsis\r\n\r\nVOL *[* /drive/ *]*\r\n\r\n\r\n      Options\r\n\r\nUnless stated otherwise all options of this command do follow the\r\nstandard rules for options <#_appendix_options>.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    WHICH - Search and display the executable file of specified commands\r\n\r\nRequirements: CMD_WHICH\r\n\r\n\r\n      Synopsis\r\n\r\nWHICH *[{* /command/ *}]*\r\n\r\nSearches for the specified command(s) the same way as if it would be\r\nspecified on command line as command itself. If an executable file is\r\nfound, its path is displayed in this format:\r\n/command/ tab /path/\r\n\r\nThe tab stands for the tabulator character (ASCII 9).\r\nIf the command is not found only the /command/ part, but neither a\r\n/path/ nor the tab is displayed.\r\n\r\nInternal commands, installable commands and aliases are not found.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\nWHICH <#which> which\r\nReturns a file or nothing, because WHICH <#which> is an internal command.\r\n\r\n\r\n        Example: 2\r\n\r\nWHICH <#which> command\r\nCould display for instance:\r\n\r\ncommand\tC:\\COMMAND.COM\r\n\r\nPlease note that command is the string \"command\" and no placeholder.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    Appendix\r\n\r\n\r\n      Current Directory\r\n\r\nThe current directory is the default directory of a drive.\r\n\r\nDOS stores a default directory for each drive. When a path is specified\r\nwith a drive specification only, such as D:, it is completed with this\r\ndefault directory of that drive to construct the absolute path\r\n<#_appendix_abspath> to be used.\r\n\r\n\r\n      Current Working Direcory\r\n\r\nIn opposite to the current directory the current /working/ directory is\r\nthe absolute path <#_appendix_abspath> constructed out of the currently\r\nselected drive <#chgdrive> and current directory <cd> of that drive.\r\n\r\n\r\n      Path Specification\r\n\r\nIn DOS an absolute path is constructed out of several components:\r\n\r\n   1. drive,\r\n   2. directory,\r\n   3. filename, and\r\n   4. file extension. \r\n\r\nlike this: D:\\DIR1\\DIR2\\FILENAME.EXT.\r\n\r\nThe drive is a single letter from A through Z followed by a colon :.\r\n\r\nThe remaining part of a path consists of similiar components delimited\r\nby a single backslash \\. The last component is also called filename.\r\nEach of these components may be formed of a name, up to eight characters\r\nlong, and an extension, up to three characters long. Both parts are\r\ndelimited by a single dot .. Although the extension may be absent, the\r\nfilename must have at least one character.\r\nNote: The term /filename/ is not limited to /files/ in the usual sense,\r\nbut may apply to any name visible in a directory, such as subdirectories\r\nand volume labels, as well.\r\n\r\nTo ease the way to enter a path the user may specify a relative path,\r\nrather than an absolute one. In such path one or more components may be\r\nmissing:\r\n\r\n    * If no drive is specified, what means that no colon is specified,\r\n      the path is prefixed by the currently selected drive <#chgdrive>.\r\n    * If the directory is not prefixed by the backslash or no directory\r\n      is specified at all, the current directory <#_appendix_currdir> of\r\n      the drive is inserted right behind the colon.\r\n    * Some programs may append an absent extension to the very last\r\n      filename component. \r\n\r\nExamples, assume the current directories of\r\n*Drive* *Current Directory*\r\nC: \\FREEDOS\\HELP\r\nD: \\TEMP\\TEXT\r\n\r\nThe currently selected drive is C:.\r\n\r\n   1. C:\\\r\n      The root directory of drive C:.\r\n   2. .\r\n      The current working directory, ergo: C:\\FREEDOS\\HELP.\r\n   3. ..\r\n      The parent directory, ergo: C:\\FREEDOS.\r\n   4. D:\r\n      The current directory of drive D:, ergo: D:\\TEMP.\r\n   5. D:.\r\n      The current directory of drive D:, ergo: D:\\TEMP.\r\n   6. D:..\r\n      The parent directory of drive D:, ergo: D:\\.\r\n   7. ..\\BIN\r\n      Because there is neither a drive nor a leading backslash, both the\r\n      currently selected drive and the current directory of that drive\r\n      is inserted before the given path, ergo: C:\\FREEDOS\\HELP\\..\\BIN.\r\n      The embedded component .. has the same meaning as when specified\r\n      alone: /parent directory/, though, here in the context of the\r\n      directory C:\\FREEDOS\\HELP\\. That means that the final absolute\r\n      path is: C:\\FREEDOS\\BIN. \r\n\r\nPath specifications that do not conform to above mentioned format lead\r\nto various different behaviour of the various programs, because there is\r\nno standard to scan, parse and interprete such patterns. Problems include:\r\n\r\n    * multiple backslashes,\r\n    * multiple dots,\r\n    * multiple colons, or a colon at a position unequal to two,\r\n    * The current directory . or parent directory .. special directories\r\n      in the context of a root directory, such as C:\\., C:\\.., or\r\n      C:\\TEMP\\..\\... \r\n\r\nNote: The special directories . and .. are no phantom directories or\r\nvirtual entries, but standard entries of every directory except the root\r\ndirectories. These entries help crash recovery tools, such as CHKDSK or\r\nSCANDISK, to find errors within the directory structure and restore it\r\nto a valid file tree. Therefore a common assumption that a tripple dot\r\n... directory means /parent-of-parent/ is incorrect, though, might be\r\nsupported by certain programs.\r\n\r\n\r\n      Standard Rules for Options\r\n\r\nOptions are prefixed by one forward slash \"/\", the following character\r\nidentifies the option and is called option character, for instance: */A*\r\n\r\nSome commands do accept long option names, where a complete word\r\nidentifies the option rather than a single character, e.g. */MSG*.\r\n\r\nSome option may be used in conjunction with an argument. The argument is\r\nappended to the option with one colon \":\" or one equal sign \"=\", for\r\ninstance: */A:hr* or */P=fdexec.bat*.\r\n\r\nMultiple options /without/ argument maybe merged together as a single\r\noption with or without embedded slashes, e.g. */WS* or */W/S*, instead\r\nof */W /S*.\r\nHowever, because some commands do accept long option names, the way with\r\nembedded slashes is more secure and is recommended therefore.\r\nAn option with argument may be the last one of such merged options.\r\n\r\nOptions without arguments enable or disable certain features. Therefore,\r\nthose options are sometimes called /boolean/ options or flags.\r\nBoolean options may be optionally prefixed by a plus \"+\" or minus \"-\"\r\nsign. So, the boolean option *O* can be written in three ways:\r\n\r\n   1. */+O*: The option is enabled.\r\n   2. */-O*: The option is disabled.\r\n   3. */O*: (neither plus nor minus sign) The option is toggled or\r\n      flipped; this means if the option is enabled currently, it is\r\n      disabled; but if it is disabled currently, it is enabled. \r\n\r\n\r\nWithout user invention a boolean option is disabled by default, so both\r\n*/+O* and */O* behave the same most of the time. However, some commands\r\nallow the user to change the default settings of certain options, e.g.\r\nCOPY <#copy> and DIR <#dir>.\r\n\r\n\r\n      I/O Redirection\r\n\r\nIn DOS the standard input and output can be redirected to a file or\r\nanother device; however, although it is common to use these I/O streams\r\ntoday, some programmers cowardly ignore them for reasons of speed or\r\nprogram size.\r\n\r\nIf the *input* stream is redirected to a file or device, instead of\r\npolling the keyboard and request the user to interactively enter\r\ncharacters via the keyboard, those characters are read from the file or\r\ndevice. Usually these programs terminate when the file has been read\r\nwholely.\r\n\r\nIf the *output* stream is redirected to a file or device, instead of\r\nissuing the information onto screen, it is dumped into the file or\r\ndevice. Per convention each program has two output streams: one (called\r\nstandard output) to issue normal information and one (called standard\r\nerror output) for error messages the user should not miss.\r\n\r\nRedirections are specified on command line and effect exactly that\r\ncommand invoked herein, regardless if the command is an external or\r\ninternal one, an alias or batch script. The utter exception is the FOR\r\n<#for> command, which requires that the redirection is to apply to the\r\ncommand specified behind the DO keyword rather than FOR <#for> itself.\r\nIf more than one redirection is specified on the command line and they\r\neffect the same stream (input, output, or error), the rightmost one\r\nsuperceed any previous one.\r\n\r\nRedirections are syntactically specified like this:\r\n/operator/ /target/\r\n/operator/ *::=* '<' | '>' *[* '>' *]* *[* '&' *[* '>' *]* *]*\r\n/target/ *::=* /file/ | /device/\r\n\r\nAlthough it is not relevant where the redirections are placed on the\r\ncommand line, it is common praxis to place them at the end of it.\r\n\r\nThe /operators/ have the following meaning:\r\nOperator Redirection\r\n< Input stream\r\n> Output stream; target file is overwritten\r\n>> Output stream; output is appended to target, if it already exists\r\n>& Output and error stream; target file is overwritten\r\n>>& Output and error stream; output is appended to target, if it already\r\nexists\r\n>&> Error stream; target file is overwritten\r\n>>&> Error stream; output is appended to target, if it already exists\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\ncmd <in1 <in2\r\n\r\nInput stream is redirected to file IN2, because it is the rightmost one.\r\n\r\n\r\n        Example: 2\r\n\r\ncmd <in >&out\r\n\r\nInput stream is redirected to file IN, output and error streams are\r\njoined together and redireced into file OUT. If the file OUT already\r\nexists, the old contents is discarded and replaced by the new one;\r\notherwise, the OUT is created anew.\r\n\r\n\r\n        Example: 3\r\n\r\ncmd <in >>&out\r\n\r\nAs example 2, but instead of replacing the contents of OUT, if the file\r\nalready exists, the new information is appended to the end of the file.\r\n\r\n\r\n        Example: 4\r\n\r\nFOR <#for> %a IN (*.*) DO ECHO <#echo> %a >out\r\n\r\nAs mentioned earlier, FOR <#for> is an exception and passes forth the\r\nredirections to each invocation of the command specified right of the DO\r\nkeyword. So this examples overwrites the output file each time the ECHO\r\n<#echo> command is performed, thus, instead of creating a file list,\r\nonly the last found file is recorded into OUT.\r\n\r\n\r\n        Example: 5\r\n\r\nIF <#if> EXIST out DEL <#del> out\r\nFOR <#for> %a IN (*.*) DO ECHO <#echo> %a >>out\r\n\r\nThis sequence eliminate the problem, the IF <#if> command is required to\r\nactually replace the file rather than appending the file list to the\r\nprobably existent file.\r\n\r\n\r\n        Pipes\r\n\r\nAnother form of redirection is *piping*. Hereby, the output stream of\r\none command is connected to the input stream of another command. Pipes\r\ncan combine any number of commands this way. Because DOS is no\r\nmultitasking system, pipes are simulated by spawning the first command\r\nwith an output redirection capturing the issued information into a\r\ntemporary file and then the second command with an input redirection\r\nfrom that very same temporary file, on completation of the second\r\ncommand the temporary file is deleted.\r\n\r\n\r\n      Examples\r\n\r\n\r\n        Example: 1\r\n\r\ncmd1 | cmd2 | cmd3\r\n\r\nWhich is similiar to this sequence:\r\ncmd1 >%TEMP%\\t1\r\ncmd2 <%TEMP%\\t1 >%TEMP%\\t2\r\nDEL <#del> %TEMP%\\t1\r\ncmd3 <%TEMP%\\t2\r\nDEL <#del> %TEMP%\\t2\r\n\r\n\r\n        Example: 2\r\n\r\nThe first and last command can have an input or output redirection\r\nrespectively, like so:\r\ncmd1 | cmd2 | cmd3 <in >out\r\n\r\nWhich is similiar to this sequence:\r\ncmd1 >%TEMP%\\t1 <in\r\ncmd2 <%TEMP%\\t1 >%TEMP%\\t2\r\nDEL <#del> %TEMP%\\t1\r\ncmd3 <%TEMP%\\t2 >out\r\nDEL <#del> %TEMP%\\t2\r\n\r\n\r\n        Example: 3\r\n\r\nThe error stream can be piped as well:\r\ncmd1 |& cmd2 | cmd3\r\n\r\nWhich is similiar to this sequence:\r\ncmd1 >&%TEMP%\\t1\r\ncmd2 <%TEMP%\\t1 >%TEMP%\\t2\r\nDEL <#del> %TEMP%\\t1\r\ncmd3 <%TEMP%\\t2\r\nDEL <#del> %TEMP%\\t2\r\n\r\nHere only the error messages of cmd1 are passed into cmd2; the error\r\nmessages of both cmd2 and cmd3 are issued to the screen.\r\n\r\n\r\n        Nested redirections\r\n\r\nBatch scripts or when external programs invoke other programs or another\r\nshell, redirections may be nested, e.g.:\r\n\r\nConsider the batch file BATCH.BAT:\r\n\r\n@ECHO <#echo> OFF\r\nECHO <#echo> 1\r\nECHO <#echo> 2 >out_2\r\nECHO <#echo> 3\r\n\r\nwhich is invoked via:\r\nBATCH >out_1\r\n\r\nWhen the script BATCH gets executed, the actual output stream is\r\nredirected to the file OUT_1. Therefore the output of the first ECHO\r\n<#echo> command is redirected into this file.\r\nBecause the second ECHO <#echo> command has its own output redirection,\r\nits output is redirected into the file OUT_2. On completion of ECHO\r\n<#echo> the redirection is closed and the former one is restored.\r\nWhat causes that the output of the third ECHO <#echo> command is\r\nredirected into OUT_1 again.\r\n\r\n\r\n      Hidden Internal Commands\r\n\r\nThere are some special internal commands, that are not directly visible\r\nnor accessable. They are hidden because of two main purposes:\r\n\r\n   1. Many of them are of internal nature and should not used by the user.\r\n   2. They are extensions to the normal batch language and may,\r\n      therefore, clash with a particular installation. To prevent this\r\n      clash those commands are hidden by default and can be made\r\n      directly accessable via the ICMD command. \r\n\r\nHidden internal commands can be access by prefixing the command with\r\n::=. This token usually specifies a label within the batch language,\r\ngiven the nature of the labels, they may be comments as well. Due to the\r\nlatter variant, most non-FreeCOM shells won't see the ::=, hence, ignore\r\nthose commands.\r\n\r\nFor example: C> ::=CANCEL <#cancel> 30\r\n\r\ncancels (terminates) all currently active batch files and assigns /30/\r\nto the current errorlevel.\r\n\r\n------------------------------------------------------------------------\r\n------------------------------------------------------------------------\r\n------------------------------------------------------------------------\r\n\r\n   1. Introduction <#-intro>\r\n   2. FreeCOM Command Line Syntax - Useage, Switches and Options\r\n      <#-cmdline>\r\n   3. Environment Variables <#-envvars>\r\n   4. Internal Commands <#-icmds>\r\n   5. User Prompt <#-userprompt>\r\n         1. Command Line Syntax <#-cmdline-syntax>\r\n         2. Command Line Editing <#-cmdline-editing> \r\n   6. Features of FreeCOM <#-features>\r\n   7. Status of FreeCOM / To-do List <#-status>\r\n   8. Appendix <#-appendix>\r\n         1. Compile FreeCOM - sample <#-compile>\r\n         2. Download <#-download>\r\n         3. CVS Resources <#-cvs-tags>\r\n         4. EBNF <#-ebnf> \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n  Introduction\r\n\r\nFreeCOM is a:\r\n\r\n    * *C*ommand *L*ine *I*nterface,\r\n    * (user) shell and/or\r\n    * COMMAND.COM replacement \r\n\r\nfor DOS. It has been spawned as part of FreeDOS\r\n<http://www.freedos.org>, a project that aims to implement a GNU GPL'ed\r\nDOS.\r\n\r\nThe main duty of FreeCOM is to prompt the user to enter commands\r\n<#-userprompt>, which are interpreted, processed directly by FreeCOM or\r\nexecuted as executable files.\r\n\r\nThose commands processed by FreeCOM directly are called /Internal\r\nCommands/ <#-icmds>.\r\n\r\nNon-internal commands, which cannot be processed by FreeCOM directly,\r\nare called /External Commands/, because FreeCOM will search for files\r\nequally named as typed-in.\r\n\r\nBesides to implement certain commands FreeCOM offers some features\r\n<#-features>.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n  Command Line Syntax, Useage, Switches and Options\r\n\r\nCOMMAND.COM *[* /path/ *[* /console/ *]* *]* *[{* /option/ *}]* *[* '/'\r\n*(* K | C *)* commandline *]*\r\n\r\nIf present, the first non-option argument specifies the location in\r\nwhich FreeCOM resides. This location is later stored in the environment\r\nvariable COMSPEC. Since DOS3+ this option is no longer necessary to find\r\nthe shell invoked during the boot process, but it may be used to let the\r\nsystem boot a primary shell from one location, but use a shell of the\r\nsame version from a different location later on.\r\nOne shallt not point to a RAMdisk at this time, because FreeCOM needs to\r\nreload certain information relatively early during execution, before\r\nAUTOEXEC.BAT had been executed, in which, normally, FreeCOM is copied\r\ninto the RAMdisk.\r\nFor convinience FreeCOM checks, if at the given location a FreeCOM\r\nexists *and* is accessable, if not, the given location is ignored. Also,\r\nthe standard requires to specify a path only, but FreeCOM accepts an\r\nabsolute filename, so accepting that FreeCOM is not necessarily named\r\nCOMMAND.COM.\r\n\r\nThe second non-option argument, if present, specifies the console\r\nFreeCOM shall enable. This setting is system-wide and is not limited to\r\nFreeCOM or just this particular process tree. In its result, this\r\nargument is identical to the CTTY <cmd.html#ctty> command.\r\n\r\nFreeCOM knows the following options:\r\n\r\n    * */?*: Issues a help screen, then exists.\r\n    * */!*: Enable/disable debugging support, if compiled to FreeCOM.\r\n    * */Y*: Enables trace/single step mode. This mode is deaktivated\r\n      when the user prompt has been reached.\r\n    * */D*: Disables to parse AUTOEXEC.BAT, even if the */P* option is\r\n      present. This switch is usually set by the kernel, when F5 had\r\n      been pressed during bootup.\r\n    * */F*: Enables autofail of Critical Errors; then instead of\r\n      displaying the Abort/Retry/Ignore/Fail dialog, Critical Errors are\r\n      automatically answered with Fail.\r\n    * */P*: Installs a primary copy of FreeCOM. Such instance:\r\n         1. cannot be terminated with the EXIT <cmd.html#exit> command.\r\n         2. executes the AUTOEXEC.BAT script before any other command. \r\n      The */P* option may have an argument to specify an alternate name\r\n      for the AUTOEXEC script, e.g.: */P:FDAUTO.BAT*.\r\n    * */E*: Sets another size of the environment segment, in which all\r\n      the environment variables are stored, e.g.: */E:1024*.\r\n    * */L*: Sets the size of the internal command buffer. /Note/: This\r\n      option is ignored currently, the internal buffer always defaults\r\n      to 512 bytes.\r\n    * */U* Sets the size of the internal user input buffer. /Note/: This\r\n      option is ignored currently. The input buffer always defaults to\r\n      255 bytes, which is the maximum.\r\n    * */LOW*: Forces to load FreeCOM low. /Note/: Currently this option\r\n      has no effect, because no part of FreeCOM is loaded high.\r\n    * */MSG*: Installs the message server. /Note/: Because the message\r\n      server is not used nowadays, this option forces to permanently\r\n      load FreeCOM's messages into memory.\r\n    * */SWAP*: Toggles, if to default to swapping or not; due to\r\n      different default values of this /internal/ flag, it is\r\n      recommended to always prefix the option with '|+|' to enable or\r\n      '|-|' to disable swapping. \r\n\r\nThe options */K* and */C* are special cases and do not behave as normal\r\noptions does. They are exclusive and all characters at the right side of\r\nsuch option (except an optional argument sign) specify a command to\r\nexecute, e.g.: /C DIR <cmd.html#dir> /s, /C=DIR <cmd.html#dir> /s, and\r\n/CDIR /s do behave exactly the same and execuate the command DIR\r\n<cmd.html#dir> /s.\r\nIf these options are used in conjunction with the */P* option, the\r\nAUTOEXEC.BAT script is executed prior executing the specified command.\r\nIn opposite to */K* the */C* option does not enter the interactive shell\r\nprompt after executing the specified command unless the */P* options is\r\npresent, too.\r\n\r\nBoolean options, which can only be /enabled/ or /disabled/, may be\r\nprefixed by '|+|' to enable or '|-|' to disable it.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n  Environment Variables\r\n\r\nEnvironment variables can be freely assigned using the SET\r\n<cmd.html#set> command, e.g. executing:\r\nSET <cmd.html#set> var1=tecxsgk;jsdgsdflfsjdflkasjf/lasjflas\r\n\r\nassigns this nonsense to the variable var1. Later on, the value of the\r\nvariable can be used by writing: %var1%, thus, writing the name of the\r\nvariable enclosed without whitespace by two percent signs. *Warning*:\r\nEnvironment variables are expanded fully into plain text before the\r\ncommand line is furtherly parsed. If a variable contains an odd number\r\nof quotes, the remaining command line must contain the closing quote in\r\norder to operate properly. Also see this:\r\nSET <cmd.html#set> var=text del\r\nIF <cmd.html#if> text==%var% GOTO <cmd.html#goto> label\r\n\r\nThe second line looks uninteresting, but once the environment variable\r\nhas been expanded the line has morphed into:\r\nIF <cmd.html#if> text==text del GOTO <cmd.html#goto> label\r\n\r\nnot that funny anymore, because the IF <cmd.html#if> command interpretes\r\nonly the string text==text as condition, but del GOTO <cmd.html#goto>\r\nlabel is executed as command.\r\n\r\nFreeCOM uses a number of environment variables for its own purpose.\r\n\r\n    * *COMSPEC*: FreeCOM loads some information on demand, these data\r\n      are stored in the FreeCOM executable. The value of this\r\n      environment variable contains the filename FreeCOM shall use. The\r\n      contents can be changed with the SET <cmd.html#set> command.\r\n    * *DIRCMD*: The user may define default values for the DIR\r\n      <cmd.html#dir> command. Any options specified within DIRCMD are\r\n      prefixing any entered ones, so to say FreeCOM behaves as if the\r\n      user always types:\r\n      DIR <cmd.html#dir> %DIRCMD% other arguments\r\n\r\n      This variable must be changed using the SET <cmd.html#set> command.\r\n    * *COPYCMD*: This variable contains default options for the COPY\r\n      <cmd.html#copy> command.\r\n    * *PROMPT <cmd.html#prompt>*: FreeCOM prompts the user to enter\r\n      commands to run, the prompt can be customized by changing the\r\n      contents of this variable.\r\n      This variable can be changed using the SET <cmd.html#set> or the\r\n      PROMPT <cmd.html#prompt> commands. Latter one includes a detailed\r\n      description of the format of the prompt string.\r\n    * *PATH <cmd.html#path>*: When FreeCOM is to execute an external\r\n      command and this one does not contain no path, FreeCOM searched\r\n      for the command in a number of paths. These ones are enumerated by\r\n      the PATH <cmd.html#path> environment variable.\r\n      This variable can be changed using the SET <cmd.html#set> or the\r\n      PATH <cmd.html#path> commands. Latter one includes a detailed\r\n      description of the format of the search path. \r\n\r\nThere are a number of automatic variables that do not follow the above\r\nmentioned syntax and which contents is automatically generated. Unlike\r\nthe normal variables these automatic variables are constructed of\r\nexactly two characters, the first one is a single percent sign and the\r\nsecond one the variable identifier:\r\n\r\n    * *%?*: expands to the current errorlevel, which is the exit code of\r\n      the previously executed external command.\r\n    * *%0*: in batch scripts only: is the name of the script currently\r\n      executed.\r\n    * *%1* through *%9*: in batch scripts only: are the first through\r\n      nineth argument passed to the currently executed batch script. If\r\n      less than nine arguments had been passed to the script, they\r\n      return an empty string. To access the tenth argument please refer\r\n      to the SHIFT <cmd.html#shift> command.\r\n    * FOR <cmd.html#for> *%v* IN (...) DO any command: *%v* may use\r\n      any letter, the FOR <cmd.html#for> command creates a new variable,\r\n      which is valid in the any command following the DO keyword.\r\n    * *%%*: Is no real variable, but expands to a single percent sign. \r\n\r\nBecause automatic variables have one percent sign only, it sometimes\r\nlead to confusion within the FOR <cmd.html#for> command, e.g. in:\r\nSET <cmd.html#set> adam=eva\r\nFOR <cmd.html#for> %a in (*.*) DO echo %adam% %a\r\n\r\n%adam is interpreted as [%a]dam.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n  Internal Commands\r\n\r\nInternal commands will be processed by FreeCOM directly, they are\r\navailable to the user without presence of any external files, in fact\r\nthey hide External Commands named equally.\r\n\r\nThe synopsises of the internal commands <cmd.html> are described in a\r\nstyle derived from EBNF <#-ebnf>.\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n  User Prompt\r\n\r\nFreeCOM knows two modes:\r\n\r\n   1. Interactive, and\r\n   2. batch processing. \r\n\r\nThe second one performs batch scripts, which are more or less a sequence\r\nof commands written to a file. Such files may contain any external\r\ncommands, internal commands and calls to other batch files as well.\r\n\r\nIn interactive mode FreeCOM prompts the user to enter a command, the\r\nline is interpreted, parsed and, finally, either rejected because of an\r\nerror or executed.\r\n\r\n\r\n    Command Line Syntax\r\n\r\nFreeCOM accepts the following command line:\r\n*[* ':' *]* *[* '?' *]* *[* '@' *]* *[* '*' *]* *{* /command/ *[{*\r\n/argument/ | /redirection/ *}]* *:* '|' *}*\r\n/redirection/ *::=* *(* '<' | '>' | '>>' *)* /filename/\r\n\r\nThe first optional ? must not be mixed up with the command ?!\r\n\r\n\r\n      Description:\r\n\r\nThe colon marks the line as label, which causes to let FreeCOM ignore\r\nthe line completely as no interpretation is tried on this line, neiter\r\nare any redirections <cmd.html#_appendix_redirection> created.\r\n\r\nThe ? forces FreeCOM to enable the trace mode for this line. In trace\r\nmode FreeCOM prompts the user wether to execute the resulting command.\r\n\r\nThe optional @ disables the echo status for this line. If the echo\r\nstatus is enabled, the line is displayed right before it is executed;\r\nsee ECHO <cmd.html#echo> for more details.\r\n\r\nThe asterisk * is available only, if aliases are compiled into FreeCOM;\r\nif present, the alias expansion <#-features> is skipped.\r\n\r\nIf commands are chained with the | symbols, those commands are to be\r\nexecuted as a /pipe/. For instance the command line:\r\ncmd1 | cmd2 | cmd3\r\n\r\nforms a pipe consisting of the three individual commands cmd1, cmd2, and\r\ncmd3, where the standard output stream of cmd1 is connected to the\r\nstandard input stream of cmd2 and the output of cmd2 to the input of\r\ncmd3. /Note:/ Because DOS is no multitasking environment, pipes are\r\nsimulated with file and the three-command pipe will look like this:\r\ncmd1 >%TEMP%\\cmd###1.tmp\r\ncmd2 <%TEMP%\\cmd###1.tmp >%TEMP%\\cmd###2.tmp\r\ncmd3 <%TEMP%\\cmd###2.tmp\r\n\r\nThe files are temporary ones and will be removed as soon as they are no\r\nlonger required, meaning the tempfile #1 is removed after cmd2\r\nterminates and tempfile #2 upon termination of cmd3.\r\n\r\nRedirections tie the standard input or output stream to a file or\r\ndevice, for instance:\r\ncmd arg >outfile\r\n\r\nredirects the standard input stream of cmd to the file infile and the\r\nstandard output stream to outfile. The double output redirection\r\nspecifies to append to an existing file rather than overwriting it.\r\n\r\n\r\n    Command Line Editing\r\n\r\nFreeCOM offers two methods to interactively enter command lines:\r\n\r\n   1. standard input, and\r\n   2. enhanced input. \r\n\r\nThe first one just calls a DOS function, whereas the second one\r\nprocesses each key for its own. Which method FreeCOM uses is defined at\r\ncompile time.\r\n\r\nIf the echo state is enabled, the user is /prompted/ with the PROMPT\r\n<cmd.html#prompt> string; otherwise no visible or audible prompt is\r\nissued to indicate an user activity request.\r\n\r\nIn either mode the ENTER key terminates the editing and lets FreeCOM\r\nstart to interprete the entered line.\r\n\r\nThe *standard input* mode does neither support command line history,\r\nexcept the last command line in some circumstances, nor file completion.\r\nThe following keys have a special meaning:\r\nKey Meaning\r\nF1 Get next character from last line, if available\r\nF3 Get last line, if available\r\nF5 Place current line in last-line buffer and restart editing on a blank\r\nline\r\nF6 Insert the pseudo-character /End-of-file/\r\nbackspace delete character to the left\r\ncursor left delete character to the left\r\ncursor right Get next character from last line, if available\r\n\r\nThe *enhanced input* mode does support command line history and file\r\ncompletion. The following keys have a special meaning:\r\nKey Meaning\r\nF1 Get next character from last line, if available\r\nF3 Get last line, if available\r\nF5 Place current line in last-line buffer and restart editing on a blank\r\nline\r\nbackspace delete character to the left\r\ncursor down Replace the current input line with the previous line from\r\nthe history\r\ncursor left move cursor one character one position to the left\r\ncursor right Move cursor one position to the right; at the end of the\r\nline get next character from last line, if available\r\ncursor up Replace the current input line with the next line from the\r\nhistory\r\ndelete Deletes the character on the cursor\r\nend Moves the cursor to the end of the line\r\nESC Clear current line\r\nhome moves the cursor to the beginning of the line\r\ninsert Switch between insert and overwrite mode\r\nTAB Take the current word for a file and try to complete it\r\n^C Clear current line and enable echo state. The echo state is enabled\r\nto ensure the user gets to know he is on the command line of FreeCOM\r\nrather than stuck in a non-interruptable program.\r\n\r\n------------------------------------------------------------------------\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n  Features of FreeCOM\r\n\r\nFreeCOM implements the following features:\r\n\r\n    * <cmd.html_aliases>FEATURE_ALIASES <cmd.html#feature_aliases> -\r\n      Command aliases\r\n    * <cmd.html_auto_redirect_to_con>FEATURE_AUTO_REDIRECT_TO_CON\r\n      <cmd.html#feature_auto_redirect_to_con> - Autoswitch CON: to monitor\r\n    * <cmd.html_batch>FEATURE_BATCH <cmd.html#feature_batch> - Batch\r\n      script processing\r\n    * <cmd.html_boot_keys>FEATURE_BOOT_KEYS <cmd.html#feature_boot_keys>\r\n      - check for F5/F8 keys on startup if /P is present\r\n    * <cmd.html_call_logging>FEATURE_CALL_LOGGING\r\n      <cmd.html#feature_call_logging> - Startup logging\r\n    * <cmd.html_dirstack>FEATURE_DIRSTACK <cmd.html#feature_dirstack> -\r\n      Directory stack\r\n    * <cmd.html_enhanced_input>FEATURE_ENHANCED_INPUT\r\n      <cmd.html#feature_enhanced_input> - Enhanced command line editing\r\n    * <cmd.html_filename_completion>FEATURE_FILENAME_COMPLETION\r\n      <cmd.html#feature_filename_completion> - Filename completion\r\n    * <cmd.html_history>FEATURE_HISTORY <cmd.html#feature_history> -\r\n      Command line history\r\n    * <cmd.html_installable_commands>FEATURE_INSTALLABLE_COMMANDS\r\n      <cmd.html#feature_installable_commands> - Installable Commands\r\n      interface (MUX-AE)\r\n    * <cmd.html_last_dir>FEATURE_LAST_DIR <cmd.html#feature_last_dir> -\r\n      Change back to last directory\r\n    * <cmd.html_load_messages>FEATURE_LOAD_MESSAGES\r\n      <cmd.html#feature_load_messages> - Load messages permanently\r\n    * <cmd.html_nls>FEATURE_NLS <cmd.html#feature_nls> - use DOS NLS \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n  Status of FreeCOM\r\n\r\nFreeCOM's development currently targets the v1.0 version, which is to\r\nprovide all functionality (features) of commonly known COMMAND.COMs at\r\nminimum, but probably at the cost of optimization and performance.\r\n\r\nThe To-Do list:\r\nFeature Target\r\nSwapping without any supporting secondary programs (KSSF.COM and\r\nVSPAWN.COM) v0.90\r\nINT-2E backdoor v0.90\r\nWildcards for REN <cmd.html#ren>, same filename pattern matching code\r\nfor REN <cmd.html#ren>, COPY <cmd.html#copy> and DIR <cmd.html#dir> v0.93\r\nDIR <cmd.html#dir> /O and DIR <cmd.html#dir> /A v0.93\r\nIF <cmd.html#if> /I v0.85\r\nInput/output functions to replace <stdio.h> by <io.h> (aka replace\r\nFILE*-based I/O by handle-based one) v0.95 <#-todo1>\r\nStrict error recognition, probably _doserrno based v0.97 <#-todo1>\r\nSupport for DOS=HIGH v0.90\r\nCode sharing of modules v0.91\r\nFull support for DOS NLS pre v0.95\r\nRedirection in conjunction with Swapping v0.90\r\nOptimize FreeCOM for size >= v1.0\r\nOther swap storage areas, e.g. XMS and EMS post v1.0 <#-todo2>\r\nLong filenames post v1.0\r\ninternal commands <#-icmds> mostly done <#-icmds>\r\nAliases: ALIAS <cmd.html#alias> done\r\nCommand line history: HISTORY <cmd.html#history> done\r\nDirectory stack: DIRS <cmd.html#dirs>, PUSHD <cmd.html#pushd>, and POPD\r\n<cmd.html#popd> done\r\nMUX-AE interface done\r\nEnhanced command line editing, file completion <#-cmdline-editing> done\r\nLast directory recognition: CD <cmd.html#cd>, CDD <cmd.html#cdd>, PUSHD\r\n<cmd.html#pushd> done\r\nControl Break handler done\r\nCritical Error handler done\r\nIF <cmd.html#if> ERRORLEVEL H/<letter>/ done (v0.83?48)\r\n\r\n\r\nFootnotes:\r\n\r\n    * I/O replacement shallt preceed error reporting correction as some\r\n      failures are impossible to detect without work-arounds with the\r\n      <stdio.h> functions.\r\n    * If I get contributions after v0.90, those portion may be added\r\n      earlier. \r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n  Appendix\r\n\r\n\r\n    Compile FreeCOM - sample\r\n\r\nDue to heavy request, there is a sample description how to compile\r\nFreeCOM in ten steps <build48.html>.\r\n\r\n\r\n    Download\r\n\r\nFreeCOM can be downloaded from SourceForge in several ways and packages:\r\n\r\n   1. source code files from the CVS repository <#-cvs-tags>\r\n   2. tarball and pre-compiled packages from anonymous FTP <#-download-ftp>\r\n   3. tarball and pre-compiled packages via HTTP <#-download-http>\r\n   4. tarball and one pre-compiled package as file release\r\n      <#-download-filerelease> \r\n\r\n\r\n      Resources accessable via anonymous FTP\r\n\r\nSourceForge closed the FTP - Services, therefore an alternate location\r\nhad been created at:\r\nftp://ftp-fd.inf.fh-rhein-sieg.de/pub/freedos/local/FreeCOM. It contains\r\nthe very same packages available at the HTTP location below.\r\n\r\n\r\n      Resources accessable via HTTP\r\n\r\nhttp://freedos.sourceforge.net/freecom/packages/ contains several\r\nvariants of tarballs and pre-compiled packages of FreeCOM. The files\r\nimmediately located in the directory contain the most current major\r\nrelease of FreeCOM, whereas the subdirectories include Beta releases of\r\nthe upcoming release.\r\n\r\nThe packages themselves include:\r\nfile name contents\r\nCOM###.ZIP or Com###Beta##.ZIP tarball (the source code tree without CVS\r\ninformation)\r\nBINARY.ZIP the most commonly used pre-compiled FreeCOM with almost any\r\nfeature, but debugging enabled.\r\nThis release uses standard swapping mechanisms!\r\nXMSSWAP.ZIP the most commonly used pre-compiled FreeCOM with almost any\r\nfeature, but debugging enabled.\r\nThis release uses XMS-Only swapping mechanism!\r\nPLAINEDT.ZIP As BINARY.ZIP but using the plain command line editor of\r\nthe kernel instead of the enhanced one\r\nDEBUG.ZIP As BINARY.ZIP with debugging support enabled.\r\nThis variant is a lot larger than the standard release and can generate\r\nlots of output.\r\nLOCALIZE.ZIP As BINARY.ZIP but targetted at maintainers of a language\r\ndescription file (*.LNG).\r\nSUPPL.ZIP the SUPPL library required for linking FreeCOM precompiled for\r\nuse with Turbo C++ v1.01\r\nDOCS.ZIP a package with these HTML documents\r\n\r\n\r\n      File Releases on SourceForge\r\n\r\nOn SourceForge <http://sourceforge.net/file/?group_id=5109> so-called\r\n/File Releases/ can be created. The file release section of the FreeCOM\r\nmodule contains a source ZIP and a binary ZIP file, they are equal to\r\nthe tarball and the BINARY.ZIP on the anon FTP space respectively.\r\nUnlike the FTP space, old versions are kept, but no Beta versions or\r\nside branches.\r\n\r\n\r\n    CVS Resources\r\n\r\nOn SourceForge <http://sourceforge.net/project/?group_id=5109> a short\r\ndescription of how to access the CVS repository is located. Following\r\nthose instructions will download the main trunk of the specified module\r\nof the repository, e.g.:\r\n\r\ncvs -z6 co freecom\r\n\r\ndownloads the MAIN trunk, also called HEAD, of FreeCOM.\r\n\r\nAlternatively the WebCVS -- follow the Browse CVS link there -- might be\r\nhelpful in order to download a handful of files.\r\n\r\nHowever, CVS allows to branch the development of a module at some point\r\nfrom the main trunk into side trees. On these branches the module can be\r\ndeveloped further, new features can be added etc., without disturbing\r\nthe main trunk (and therefore the primary release) of the module. When\r\nthe side development proved its worthiness, the changes are merged into\r\nthe main trunk and, hence, becomes part of the primary release.\r\n\r\nBranches are marked by tags, though, unlike normal tags branch tags\r\nautomatically evolve with the file, what means that when a file from a\r\nspecific branch is updated, the branch tag automatically move from the\r\ncurrent version of the file to the new one.\r\nTo check out a branch, create a new directory, change within it and\r\nexecute:\r\n\r\ncvs -z6 co -r tag freecom\r\n\r\n, where tag is the name of the branch you want to download. /Note/: It\r\nis not advisable to use the same directory to manage files for two\r\ndifferent branches.\r\n\r\nThe FreeCOM module has the following /active/ branches:\r\n\r\nTag Meaning\r\nexpExec Stack-based execution context implementation\r\nexpSpawn Module based FreeCOM, bases on expRes branch\r\n\r\nThe FreeCOM module has the following /obsoleted/ branches:\r\n\r\nTag Meaning\r\nexpRes Resource management implementation.\r\nFinally merged into trunk as of 2001/03/10\r\n\r\n------------------------------------------------------------------------\r\n\r\n\r\n    EBNF\r\n\r\nDocuments encode the synopsis of the commands with operators derived\r\nfrom EBNF (*E*xtended *B*ackus-*N*aur *F*ormula).\r\n\r\n\r\n      Type setting\r\n\r\nDepending on different meanings characters are set into various shapes:\r\nName Meaning Example\r\nterminal characters to be enterred on command line or displayed by the\r\ncomputer;EBNF: \"terminal symbols\" ECHO <cmd.html#echo>\r\n'string' The quotes remove the metafunction of the enclosed characters\r\nin order to specify EBNF operators as terminal symbols. EBNF: \"terminal\r\nsymbols\" '|'\r\n*bold* operators that constructs portions together; EBNF: \"operators\" *|*\r\n/italic/ placeholders for arguments, which are explained in the\r\ndescription; EBNF: \"non-terminal symbols\" /varname/\r\n\r\n\r\n      Operators\r\n\r\nThe EBNF uses the following operators:\r\nSymbol Meaning\r\n*|* alternative; use either left or right token\r\n*()* parenthizes enclose tokens limiting the range of *|*\r\n*[]* brackets enclose optional tokens, thus, they may appear zero or one\r\ntime; they also limit the range of *|*\r\n*{}* curly brackets enclose repitive tokens, which may appear one or\r\nmore times; they also limit the range of *|*\r\n*{ : }* as the normal curly brackets, but any repitive tokens are\r\ndelimited by the token(s) right of the colon; for instance:\r\n\r\n    *{* /file/ *:* '+' *}* \r\n\r\nis the same as:\r\n\r\n    /file/ *[{* '+' /file/ *}]* \r\n\r\nand applies to:\r\n\r\n    * /file/\r\n    * /file/ + /file/\r\n    * /file/ + /file/ + /file/\r\n    * /file/ + /file/ + /file/ + /file/\r\n    * ... \r\n\r\n*  * is a placeholder for an arbitary string of terminal symbols,\r\nwhich further syntax is described by the enclosed text in English\r\nnatural language.\r\n*::=* assigns a meaning (right side) to a non-terminal symbol (left\r\nside); for instance\r\n\r\n\tDIR <cmd.html#dir> *[ {* /option/ *|* /filespec/ *} ]*\r\n\t/option/ *::=* / *(* A *|* B *|* C *)*\r\n\r\nAny occurance -- only one here -- of /option/ on the right side of an\r\n*::=* or where no *::=* is present at all is to be replaced by the right\r\nside of /option/*::=*.\r\n\r\nUnless modified by above mentioned operators a sequence of tokens\r\nspecifies that each token must be present exactly one time in exactly\r\nthat order.\r\nNote: For the sake of clearness, spaces are inserted between tokens.\r\nThese spaces do *not* mean that a space is allowed at this place! Also,\r\nthe fact that no *_* is present does *not* mean that at this place is\r\nnone allowed. It is assumed that the reader will find the places where\r\noptional spaces are valid either by \"doing\" or by reading the examples.\r\n\r\n------------------------------------------------------------------------\r\n------------------------------------------------------------------------\r\n------------------------------------------------------------------------\r\n------------------------------------------------------------------------\r\n\r\nCopyright 2000-2001  Steffen Kaiser - current maintainer of FreeCOM\r\n\r\nElvis - The VI clone <ftp://ftp.cs.pdx.edu/pub/elvis/>\r\n\r\n"
  },
  {
    "path": "docs/_config.yml",
    "content": "theme: jekyll-theme-architect\r\ntitle: \"FreeCom : FreeDOS command.com\"\r\ndescription: \"FreeCom is an implementation of the command line interpreter for FreeDOS, command.com\"\r\nshow_downloads: \"true\"\r\n"
  },
  {
    "path": "docs/c0.txt",
    "content": "1999/06/17 - exclusion of argc/argv and C-style environment\r\n\r\nNOTE: Currently no changes have been made to the C0 code itself,\r\nit adjusted itself to most of the changes quite well enough.\r\n\r\nTo save more memory and prevent possible inconsitencies when\r\nFreeCom starts up as the primary shell, when the environment\r\nhas not been setup correctly, the processing of the command\r\nline and the handling of the environment is implemented\r\nmanually.\r\n\r\nargc/argv are replaced by the scanCmdLine() function.\r\nThe environment is replaced by the env*() functions of the SUPPL\r\nlibrary, already wrapped into getEnv*() and putEnv*().\r\n\r\nImplementation problems with Borland C/C++ v5.0:\r\n\r\n+ The Borland startup code processes a bunch of INITDATA entries\r\nthat can be set via the #pragma startup directive.\r\nThey are included, if and only if the module they are defined in\r\nis referenced by the source code or the parts of the C standard\r\nlibrary directly or indirectly referenced by the sources.\r\n\r\n+ The command line handler is included, unless the notation\r\n\"main(void)\" is used to define main().\r\n\r\n+ The environment handler consists of two parts:\r\n#1: Many stuff within the C startup code (C0.ASM) that identifies\r\nand calculates the dimension of the current environment, e.g.\r\nhow many variables are stored there and how large the environment is.\r\n#2: An #pargma startup function that sets up the C-style environment\r\nhandling functions, namely, in near data pointer memory models the\r\nfull environment is copied into the address space of the program and\r\nthe global symbol char *_environ[] constructed to hold an array of\r\npointers to each individual variable.\r\n\r\nThe code within C0.ASM can be disabled.\r\nBut to remove the other code, every reference to a C library function\r\nthat uses the environment must be redesigned.\r\n"
  },
  {
    "path": "docs/cmt1.txt",
    "content": "1999/04/27 ska - Redesign of command line parser for internal commands\r\n\r\nEvery internal command parses the command line individually bestowing\r\nindividual rules what is detected and what is supported. This not\r\nonly results into an inuniform behaviour, it also results into multiple\r\ncode and different maintainance options.\r\n\r\nThe redesign of the command line parsers shall honor all internal\r\ncommands that behave like external ones (e.g. TYPE, DIR, but not\r\nFOR and IF).\r\n\r\nA list follows now that describes the way, how the command line is\r\nscanned by the internal commands:\r\n\r\n\"no arg\" == checks for no argument\r\n\"any string\" == takes a string, not broken into individual arguments\r\n\"ign\" == command line ignored totally\r\n\"!# arg\" == checks for exactly # argument(s)\r\n\"glob opt\" == global option neither mind if it preceeds or follows argument\r\n\"seq\" == sequence (of)\r\n\"specific\" == checks for specific words, e.g. ON or OFF\r\n\"|\" == choices to interprete the command line\r\n\"and\" == must all appear within the same choice\r\n\r\nalias: no arg | any string\r\nbeep: ign\r\nbreak: no arg | specific word\r\ncall: passed back to parsecommandline()\r\nchdir: no arg | !1 arg\r\ncls: ign\r\ncopy: split() heavy detection of options and mbedded '+' and local opt\r\nctty: ign\r\ndate: no arg | interactive loop\r\ndel: glob opt and !1 arg\r\ndir: glob opt and !1 arg\r\ndoskey: ign\r\necho: no arg | specific word | anything else\r\nfor: specific seq of words and trail passed back to parsecommandline()\r\ngoto: first word\r\nhistory: no arg | any arg read as number\r\nif: specific seq of words\r\nloadfix: any string preceeded by switches\r\nloadhigh: any string preceeded by switches\r\nmkdir: !1 arg\r\npath: any string, optional /^=\\s*/ removed\r\npause: no arg | any string\r\nprompt: any string, optional /^=\\s*/ removed\r\nrem: ign\r\nren: !2 arg\r\nrmdir: !1 arg\r\nset: no arg | any string\r\nshift: no arg | specific word\r\ntime: no arg | interactive loop\r\ntruename: no arg | any string\r\ntype: !1 arg\r\nver: glob opt\r\nverify: no arg | specific seq of words\r\nvol: no arg | !1 arg and glob opt\r\n\r\n\r\nI put them into class:\r\n\r\nClass 1 - no command line\r\nbeep, cls, rem, doskey, ctty\r\n\r\nClass 2 - simple command line\r\ncall, break, alias, if, for, goto, truename, date, time, shift,\r\nprompt, pause, path, history, echo, verify\r\n\r\nClass 3 - broken command line\r\nchdir, copy, del, dir, mkdir, ren, rmdir, type, ver, vol\r\n\r\nClass 4 - individual command line\r\nloadhigh, loadfix, set\r\n\r\n\r\n\r\nClass 1 is simple to implement: One need not do nothing at all.\r\n\r\nClass 2 is mostly simple as well, they only:\r\n+ test if there is an argument at all,\r\n+ take the complete command line as it is,\r\n+ test if the command line is a sequence of tokens, or\r\n+ a combination of them.\r\nThese functions can be effeciently achieved by normal string oriented\r\nfunctions already available in C or with ltrim() and matchtok().\r\n\r\nClass 3 becomes a little more problematic, because they:\r\n+ require to get arguments in sequence as placed on command line,\r\n  but also randomly (e.g. COPY uses the last argument first).\r\n+ scan the complete command line for options before the arguments\r\n  are processed.\r\n+ break the command line in individual notions (see COPY).\r\nFrom my point of view these three points can be effeciently implemented\r\nby splitting the complete command line into an argv[] array, then\r\nprocess the embedded options, then pre-process the array in an\r\nindividual manner, and finally read the arguments as necessary.\r\nThe basic part would be the split() function, however, I'd also prefer\r\na shared function to scan the options.\r\n\r\nBy doing so one could simple imagine to extend, say, TYPE for use\r\nwith more arguments than one or use options as well, e.g. /B for\r\nbinary output.\r\n\r\nClass 4 is quite tricky. This is because LOADHIGH should not break\r\nthe complete command line, because this could modify the command\r\nto be invoked by LH in an inproper manner. Therefore it is to\r\ndesign a set of tools to effectively scan the command line that are\r\ncompatible (aka shared) by Class 3 implementation.\r\nAs these commands have in common to read options preceeding the\r\nunstructured string, this would be a function to test for an option\r\nand return its value and argument, if so.\r\n\r\n\r\n\r\n===\r\n\r\nAll internal command will now share the same algorithms to interprete\r\nthe command, well more or less.\r\n\r\nThe currently implemented rules:\r\n+ Quotes are paired \"\", '' and ``. However, they currently do not serve\r\nany particular function other than to quote (rip of any metafunction)\r\nof enclosed characters.\r\n+ Missing right quotes are silently assumed, but not added. Meaning:\r\nThere is no \"Missing quote\" error.\r\n+ Quotes can appear within words, but retain their metafunction.\r\n+ A slash within quotes is never interpreted as option.\r\n+ A slash outside quotes is always interpreted as option.\r\n+ Quotes are removed.\r\n+ Any non-empty and non-quoted sequence of whitespaces, commas and\r\nsemicolons delimit two arguments. It is removed.\r\n"
  },
  {
    "path": "docs/cmt10.txt",
    "content": "$Id$\r\nCritical Error Handler Repeat Check Autofailer\r\n\t-- 2004-09-13 ska\r\n\r\nDue to some heavy and annoying invocations of the Critical Error handler\r\nby some operations the standard Critical Error handler has been extended\r\nby a feature to automatically switch into autofail mode, in which all\r\nrequests are automatically returned by FAIL without displaying the\r\nCritical Error user dialogue.\r\n\r\nCurrently this feature must be activated by FreeCOM before and deactivated\r\nafter the operation.\r\n\r\nCurrent effected operations are:\r\n+ the whole DIR command, and\r\n+ the search for external commands through %PATH%.\r\n\r\nThe algorithm is as followed:\r\n1. FreeCOM turns the CRITER repeat check ON.\r\n2. The operation is performed.\r\n3. FreeCOM turns the CRITER repeat check OFF and, if any, displays how many\r\nCritical Error requests had been hidden.\r\n\r\nThe repeat check works like so:\r\n+ If a Critical Error occurs, the handler checks, if the repeat check is\r\nactive; if not, the standard CRITER dialogue is displayed, nothing\r\nspecial is happening.\r\n+ If the repeat check is active, the handler verifies, if the current\r\nrequest is originated by a block device, that had been FAILed or ABORTed\r\nby the user earlier; if so and there occured less than 256 CRITERs til\r\nthen, the request is silently FAILed, no dialogue is displayed.\r\n+ In all other cases, the standard dialogue is displayed and the user is\r\nprompted for an action; if the action is either FAIL or ABORT, this\r\nparticular block device will autofail the next 255 requests.\r\n\r\n=======================\r\n\r\nThere had been another suggestion by Eric Auer to autofail requests, if\r\nthey come in a short time.\r\n\r\nIn my opinion this idea is nice, if one can decide:\r\n+ if the request is almost similiar as the last request, e.g. it would not\r\nmake sense to autofail a request from a character device or another block\r\ndevice, when block device A: failed last time,\r\n+ what when the reasons of the failings differ heavily,\r\n+ how long is short.\r\n\r\nThe currently implemented solution will help at very context specific\r\noperations, where it is less likely that many different CRITERs occure;\r\ne.g. searching through %PATH% may result in problems accessing block drives,\r\nis it really of any interest whether the find API call failed because of\r\ntrouble in FAT or data portion?\r\nHowever, it would be useful to know, whether drives A: and C: fail,\r\nwould it not?\r\n\r\n\"DIR a:*.* >prn\" may fail very often, because of out-of-paper\r\nconditions, therefore it does not seem helpful to autofail requests for\r\ncharacter devices. Also, there is currently no operation that seems to\r\nbe heavily effected by ignoreable CRITERs for character devices.\r\n"
  },
  {
    "path": "docs/cmt2.txt",
    "content": "$Id$\r\nBatch file processing\r\n\r\nThis document discusses the features and functionality of the\r\nbatch file processing. It does not include help or explanation\r\nfor the batch language itself.\r\n\r\nIn the following \"batch\" files and the like are called \"scripts\"\r\nor \"shell scripts\" most of the time; the author assumes that most\r\npeople running DOS/FreeCOM will associate the COMMAND batch language\r\nwith this term.\r\n\r\nC> is an icon of the command line prompt an user is to enter commands at.\r\nIt shall only visualize the interactive prompt and _not_ the particular\r\ndrive C:.\r\n\r\nA '===' at the first column represents a section header.\r\nA '==' sourrounds file listings and, sometime, output of programs.\r\n\r\n=== Invoking Shell Scripts\r\n\r\nVariant 1:\r\n\r\nShell scripts are invoked like any command:\r\n\r\nSCRIPT arg1 arg2 arg3 arg4 ... argN <in-file >out-file\r\n\r\nThe arguments and the I/O redirection directives are optional, of course.\r\n\r\nBatch scripts are identified by the extension .BAT, it is currently\r\nnot possible to execute a batch script without this file extension.\r\n\r\nThis variant, however, empties the execution context, what means that\r\nany formerly nested script are \"forgotten\". In addition, FOR loops are\r\ndestroyed, too.\r\n\r\nVariant 2:\r\n\r\nIn order to nest script they must be invoked via the CALL command:\r\n\r\nCALL SCRIPT arg1 arg2 arg3 arg4 ... argN <in-file >out-file\r\n\r\nThe arguments and the I/O redirection directives are optional, again.\r\nAlso, the scripts must have the file extension .BAT.\r\n\r\nUnlike to invoke scripts without CALL, the current position within\r\nthe current script is preserved and the execution returns to the next\r\ncommand following the CALL command when the CALL'ed script finishes.\r\nFOR loops are destroyed nonetheless.\r\n\r\nEXAMPLE:\r\n\r\n== BATCH1.BAT\r\necho In Batch1 - arg1 = %1\r\n== BATCH2.BAT\r\n@echo off\r\ncall batch1 first\r\necho second\r\ncall batch1 third\r\n==\r\n\r\nInvoking script BATCH2 from command line:\r\n\r\nC> batch2\r\n\r\nwould output:\r\n\r\n==\r\nIn Batch1 - arg1 = first\r\nsecond\r\nIn Batch1 - arg1 = third\r\n==\r\n\r\nBecause there is no old execution context on command line, the user may\r\ninvoke script BATCH2 with or without CALL; but if BATCH2.BAT would read:\r\n== BATCH2a.BAT\r\n@echo off\r\nbatch1 first\r\necho second\r\nbatch1 third\r\n==\r\n\r\nInvoking the modified script BATCH2 from command line:\r\n\r\nC> batch2a\r\n\r\nwould output:\r\n\r\n==\r\nIn Batch1 - arg1 = first\r\n==\r\n\r\nBecause to invoke a batch script without CALL destroys any former\r\nexecution context, hence, the shell simply forgot where to return to\r\nwhen BATCH1.BAT ends.\r\n\r\n=== Accessing Arguments\r\n\r\nThe argument passed to a script are accessable through the automatic\r\nvariables: %1, %2 through %9 (there is no trailing second percent sign).\r\nVariable %0 returns the name of script in the same way it has been\r\nwritten on invokation, e.g.:\r\n== BATCH.BAT\r\necho %0\r\n==\r\n\r\nC> batch\r\nbatch\r\nC> BATCH\r\nBATCH\r\nC> batch.bat\r\nbatch.bat\r\nC> .\\batch.BAT\r\n.\\batch.BAT\r\n\r\nArguments may be separated on command line with: whitespaces, commas,\r\nsemicolons ';' and equal signs '='. There is no known quotation mechanism.\r\nE.g.:\r\n== BATCH.BAT\r\n@echo :%1: :%2: :%3: :%4: :%5: :%6: :%7: :%8: :%9:\r\n==\r\n\r\nC> batch 1 2,3;4=5 6+7\r\n:1: :2: :3: :4: :5: :6+7: :: :: ::\r\n\r\nThe tenth and later arguments are not accessable directly; to fetch them\r\nthe command SHIFT must be used. Each SHIFT increments a \"shift level\" by\r\none and when using \"%n\", it is replaced by the \"n + shift_level\"'th\r\nargument, e.g.:\r\n\r\n== BATCH.BAT\r\necho %0\r\nSHIFT\r\necho %0\r\nSHIFT\r\necho %0\r\n==\r\n\r\nC> batch 1 2 3\r\nbatch\r\n1\r\n2\r\n\r\nPlease note that %0 is effected by SHIFT, too.\r\n\r\nThere is no upper limit for SHIFT. If \"n + shift_level\" references to a\r\nnon-existant argument, it is replaced by an empty string, aka by nothing.\r\n\r\n=== Noisiness / Echo State\r\n"
  },
  {
    "path": "docs/cmt3.txt",
    "content": "$Id$\r\nCommand line parser\r\n\r\nChanges: single quotes and backticks are valid filename characters,\r\n\ttheir meta function as quotes is dropped therefore -- 2003-03-11 ska\r\n\r\nUnless stated otherwise, double quotes shall mark the beginning and\r\nthe end of strings in the following examples. If the quotes shall\r\nserve a special function, strings are enclosed in [..].\r\n\r\n+ options are separated from arguments and other options, e.g.:\r\n\t\t\"arg1/opt1/opt2\"\r\n\t-->\r\n\t\t%1 == \"arg1\"\r\n\t\t%2 == \"/opt1\"\r\n\t\t%3 == \"/opt2\"\r\n\r\n+ multiple option characters are preserved, e.g.:\r\n\t\t\"///opt1//opt2\"\r\n\t-->\r\n\t\t%1 == \"///opt1\"\r\n\t\t%2 == \"//op2\"\r\n\r\n+ arguments and options have different delimiters, at the time:\r\n\targuments: (isspace(ch) || iscntrl(ch) || strchr(\",;\", ch))\r\n\toptions: (isspace(ch) || iscntrl(ch))\r\n\r\n\tThis also results in different handling of the additional\r\n\tdelimiters command and semicolon, e.g.:\r\n\t\t\"1,2,3,/4,/5,/6 7;8;/9;10\"\r\n\t-->\r\n\t\t%1 == \"1\"\r\n\t\t%2 == \"2\"\r\n\t\t%3 == \"3\"\r\n\t\t%4 == \"/4,\"\r\n\t\t%5 == \"/5,\"\r\n\t\t%6 == \"/6\"\r\n\t\t%7 == \"7\"\r\n\t\t%8 == \"8\"\r\n\t\t%9 == \"/9;10\"\r\n\r\n\tThis is necessary, because options can use comma and semicolon\r\n\ton their own, e.g. LH's /L switch.\r\n\r\n\tAlso note: This rule effects _internal_ commands and batch files\r\n\tonly.\r\n\r\n+ Any number of valid delimiters are interpreted as a single one.\r\n\r\n+ Quotes are removed from the arguments, but hide any metafunction\r\n\tof enclosed characters. The current implemention knows only\r\n\tpaired double quotes.\r\n\r\n\tQuotes can appear within words.\r\n\r\n\tIn the following example any quotes are quotes written on command line:\r\n\t\t\"1 2'3\"  \"4 \"567 \"89/10\"\r\n\t-->\r\n\t\t%1 == [1 2'3]\r\n\t\t%2 == [4 567]\r\n\t\t%3 == [89/10]\r\n\r\n\tNote: The 3rd argument contains the \"/10\", because the quotes\r\n\tremove the special meaning of '/'.\r\n\r\n\tBUT: If the very first character is a slash, the command line parser\r\n\twill still identify the argument as option, e.g.:\r\n\t\t\"/123\" /\"456\"\r\n\t-->\r\n\t\t%1 == [/123]\r\n\t\t%2 == [/456]\r\n\r\nCOMMAND.COM of MS DOS 6 makes heavy useage of the three characters:\r\ncomma ',', semicolon ';' and equal sign '='. Sometimes, but not always\r\nall of those three characters are ignored to extract tokens, sometimes\r\nany number, sometimes only a single character.\r\n\r\nFreeCOM now uses scheme described below when to ignore what character.\r\n\r\nWhitespaces, commas, semicolons and equal signs are ignored in any number\r\nwhen extracting tokens that are a) fixed words, b) filenames or c)\r\noptions. The individual internal commands do treat those characters\r\nspecially, but at places where one whitespace is allowed, there are allowed\r\nmore than one always.\r\n\r\nFixed words are the names of the internal commands, \"IN\", \"DO\", \"EXIST\",\r\n\"ERRORLEVEL\", but %v (in FOR), too.\r\nFilenames are the arguments of DEL, TYPE, FOR ()'s etc.\r\n\r\nFor instance:\r\nC> ==FOR,%A,IN,(*.c,*.h),DO,ECHO %a\r\nis all correct.\r\nC> ECHO,,a\r\nwill display \",a\" ignoring the very first ',' only.\r\nC> IF,,a;;;==a====echo OK\r\nis all correct and will display \"OK\"\r\n"
  },
  {
    "path": "docs/cmt4.txt",
    "content": "How the COPY command works -- 1999/05/10 ska\r\n\r\nThere are several curiosities about the COPY command:\r\n\r\n===\r\nExample: COPY a? + b? c?\r\nFiles in current directory: a1, a2, a3, ba, bb, bc\r\n\r\nMS COMMAND:\r\n+ Matches all files according the first parameter (a?).\r\n+ The other parameters (b? and c?) are matched against the found\r\n  entry, meaning any wildcard is expanded with the text of the first\r\n  paramter.\r\n  E.g. Three files are copied:\r\n  \tCOPY a1 + b1 c1\r\n  \tCOPY a2 + b2 c2\r\n  \tCOPY a3 + b3 c3\r\n  Regardless if the other parameters would match other or more files,\r\n  e.g. because b1 does not exist, an error occures.\r\n\r\n4dos:\r\n+ Matches all pattern against the file system strictly from left to\r\n  the right and concats them. The destination is matched against the\r\n  first parameter.\r\n  E.g. One file is copied:\r\n  \tCOPY a1 + a2 + a3 + ba + bb + bc c1\r\n  However, the order is unspecified, because DOS does not literally\r\n  sort the entries as Unix does. (Maybe 4dos does, but I don't know.)\r\n\r\n===\r\n\r\nExample: COPY a? + b? cc?\r\nFiles in current directory: a1, a2, a3, ba, bb, bc\r\n\r\n4dos:\r\n+ As above, but the files 'cc' is created.\r\n\r\nMS COMMAND:\r\n+ Matches as above, but:\r\n\tCOPY a1 + b1 cc\r\n\tCOPY a2 + b2 cc\r\n\tCOPY a3 + b3 cc\r\n  That means if b[1-3] would exist, COPY would overwrite CC each time.\r\n\r\n===\r\n\r\nExample: COPY /a a + /b b /a c d /b\r\n\r\nMS COMMAND and 4dos:\r\n+ The first '/a' and the last '/b' are ignored.\r\n+ The switches are valid for all destination file specs right of the\r\n  option and one spec left of it.\r\n+ The option right of the destination spec is scanned before all\r\n  other options are scanned.\r\n\r\n\r\n===\r\n\r\n+ COPY will detect if it is copying a file to itself, even recursively, e.g.:\r\n\tCOPY *.c + *.1 *.1\r\n  However, COPY uses the TRUENAME DOS API function, which can fail.\r\n+ COPY mimicks the MS COMMAND behaviour to expand wildcards.\r\n+ COPY checks before overwriting the output file, if it already exists\r\n  with a read-only open call.\r\n+ COPY opens devices (source files only) as ASCII by default, if no switch\r\n  was specified. Otherwise files are opened in BINARY mode.\r\n  An ^Z is appended only, if the /A switch was specified.\r\n+ /-A is not the same as /B, but /A disables /B (and visa verce)\r\n+ \"COPY a+b a\" is the same as: \"COPY a+b .\" and \"COPY a+b\", the latter\r\n  one is a short form of \"COPY a+b .\"\r\n"
  },
  {
    "path": "docs/cmt5.txt",
    "content": "option parser -- 1999/07/09 ska\r\n\r\nAll internal commands and the arguments of COMMAND.COM itself are\r\nscanned and parsed by the same set of functions. This shall serve\r\nas a way that everything within FreeCom behaves the same, the user\r\nneed not use a different syntax for different _internal_ commands.\r\n\r\nThis document describes how the parser works and which functions\r\nare available.\r\n\r\n=== How a command line is interpreted (parsed)\r\n\r\nMost options are parsed as so-called global options. That means that\r\nit is not significat at which place of the command line they appear,\r\ne.g.: \"DIR /w *.c *.txt\" is equal to: \"DIR *.c /w *.txt\" and\r\n\t\"DIR *.c *.txt /w\".\r\n\r\nOptions, that do not follow this rule, are specially remarked in the\r\ndescription of the particular internal command.\r\n\r\nTwo well-know exception shall be included here:\r\ni) /A and /B of the COPY command are local options, e.g.:\r\n\t\tCOPY file1/a + file2 + file3/b fileOUT\r\n\tfile1 and file2 are effected by the /A option, whereas\r\n\tfile3 and fileOUT are effected by /B\r\nii) the /C option of FreeCom itself don't follow any common rule for\r\n\toption, because anything right of it (except one optional argument\r\n\tsign) is interpreted as an argument for this option.\r\n    Note: CALL command is similar, except it supports several optional\r\n        arguments then batch filename followed by its arguments\r\n\r\n\r\n=== How an option is parsed\r\n\r\nThe way how a command line is broken into individual components is\r\nalready described in file CMT3.TXT. There the way is described\r\nhow options are separated from themselves and arguments.\r\n\r\nThis section describes how each individual option is parsed.\r\n\r\nThe syntax of an option looks like this:\r\n\r\noption ::= '/' boolean_sign option_name boolean_sign argument .\r\n\r\nboolean_sign ::= | '+' | '-' .\r\n\r\noption_name ::= single_character_option\r\n\t| longname_option .\r\n\r\nargument ::= | argument_sign string .\r\n\r\nargument_sign ::= ':' | '=' .\r\n\r\nsingle_character_option ::= character .\r\n\r\nlongname_option  ::= character character\r\n\t| character longname_option .\r\n\r\ncharacter ::= <<any character except unquoted whitespaces,\r\n\tboolean_signs or argument_signs, the case is not\r\n\tsignificant>> .\r\n\r\nstring ::= <<any combination of characters>> .\r\n\r\nPlease note that:\r\n+ empty options are ignored.\r\n+ both argument and boolean sign are optional, the option itself is not.\r\n+ the option name itself must not contain the special characters used\r\n\tto identify boolean signs or the argument sign.\r\n+ if the option name has a length of more than 1 character, it is\r\n\tconsidered to be a longname option, otherwise it is a single\r\n\tcharacter option.\r\n+ single character options cannot be combined as in the Unix-style.\r\n+ arguments must be separated from the option name by an argument\r\n\tsign.\r\n+ the boolean sign may lead or trail the option name.\r\n+ syntactically both boolean sign(s) and an argument are accepted.\r\n+ anything right of the argument sign is not interpreted by the option\r\n\tparser at all.\r\n\r\nAfter the syntactical check of the option a semantical check is\r\nperformed. Unlike the syntactical one the semantical check is initiated\r\nby the command the options are scanned for.\r\n\r\nCurrently, there are three semantical contexts an option can be\r\ninterepreted as:\r\n1) string,\r\n2) integer, and\r\n3) boolean.\r\n\r\nType 1: string, data type: (char *)\r\n- The option requires that an argument is present.\r\n- The argument may be empty, which is represented by\r\n\t\tchar[] = { '\\0' }\r\n\trather than a NULL pointer. This can be used to detect if the\r\n\toption was specified at all.\r\n- If the option is specified more than once, the rightmost argument\r\n\tsuperceeds all previous ones.\r\n- The argument string is not changed in any way, except the quotes are\r\n\talready removed by the command line scanner, which is executed\r\n\t_before_ the option parser.\r\n\r\nType 2: integer, data type: (int)\r\n- The option requires that an argument is present.\r\n- The argument must not be empty.\r\n- The argument must be an unsigned 16-bit value. (no overflow test)\r\n- The rightmost argument superceeds any previous value.\r\n\r\nType 3: boolean, data type: (int)\r\n- The option must not be used with an argument.\r\n- If both a leading and a trailing boolean sign are given, the\r\n\ttrailing one superceeds the leading one.\r\n- If the '+' (plus) sign is specified, the option value is set\r\n\tto \"1\" (one).\r\n- If the '-' (minus) sign is specified, the option value is set\r\n\tto \"0\" (zero).\r\n- If no boolean sign is specified, the option value is toggled\r\n\tbetween \"1\" (one) and \"0\" (zero). That means \"1\" is transformed\r\n\tinto \"0\" and \"0\" into \"1\".\r\n\r\nExamples: <<Note each line specifies one option, already preprocessed\r\n\tby the option scanner, meaning quotes are removed and the\r\n\toptions were already separated.>>\r\n\r\n\t\t/+l-=47\r\nIf scanned as string --> \"47\"\r\nIf scanned as integer --> 47\r\nIf scanned as boolean --> error, because argument is present\r\n\r\n\t\t/+l-=\r\nIf scanned as string --> \"\"\r\nIf scanned as integer --> error, because empty argument is present\r\nIf scanned as boolean --> error, because argument is present\r\n\r\n\t\t/+l-\r\nIf scanned as string --> error, because no argument is present\r\nIf scanned as integer --> error, because no argument is present\r\nIf scanned as boolean --> 0, trailing '-' superceeds leading '+'\r\n\r\n\t\t/l\r\nIf scanned as boolean --> !original_value_of_option_L\r\n\r\n\t\t/l/l\r\nIf scanned as boolean --> !!original_value_of_option_L <-> usually no\r\n\t\t\t\t\tchange at all, if it was \"0\" or \"1\" before.\r\n\r\n\r\n\t\t/l/+l\r\nIf scanned as boolean --> \"1\", because /+l assigns regardless of the\r\n\t\t\t\t\tprevious value\r\n\r\n\t\t/msg\r\nlongname option \"msg\"; toggles if scanned as boolean\r\n\r\n\t\t/msg-\r\nlongname option \"msg\"; zeros if scanned as boolean\r\n\r\n\r\n\r\n\r\n== The interface to the implemented functions\r\n\r\nThe option parser is implemented as a callback service: The user (in\r\nthis case the function that shall perform the internal commands) invoke\r\none of the parser functions (see below) and pass along a function (which\r\nis called back from the invoked ones) that assigns a semantic to each\r\nindividual option already passed the syntactical check.\r\n\r\nThe interface of the set of functions is separated into the files\r\nCMDLINE.C and CMDLINE.H, it mainly consists of functions to invoke\r\nthe option parser and functions invoked by the callback function to\r\nactually parse the option under a specific semtantic.\r\n\r\na) Callback functions MUST be defined using the macto optScanFct(), e.g.:\r\n\r\noptScanFct(opt_copy)\r\n{\r\n\t/* ... */\r\n}\r\n\r\nDefines a callback function with the name \"opt_copy\". Note that these\r\nfunctions are static.\r\n\r\nWithin the body of a callback function two variables are officially\r\navailable:\r\n- \"ch\" is the name of the single character option; if the current\r\n\toption is a longname option, ch is 0 (zero).\r\n- \"arg\" is a (void*) pointer passed along with the callback function\r\n\tto one of the parser functions.\r\nThree other variables are passed, though, it is possible that they\r\nchange in the future:\r\n- \"optstr\" is the longname option. It is also valid for\r\n\tsingle character options.\r\n- \"strarg\" is a pointer to the associated argument, or NULL if none\r\n\tis present. The argument is no longer available, once the\r\n\tcallback function returns.\r\n- \"bool\" is the active boolean sign: -1 <-> '-', +1 <-> '+', 0 <-> none\r\n\r\nCallback functions return a value identifying the failure of the\r\nsemantic check: E_None specifies success, everything else some sort\r\nof failure. See below for a detailed description.\r\n\r\nIf possible, use the following semantic functions to make use of this\r\ninformation. These function must not be used outside of a callback\r\nfunction!\r\n\r\nb1) void optErr(void ) prints \"Invalid option - %s\"\r\n\r\nb2) int optLong(char *optname) checks if the current option is a longname\r\n\toption of the given name. 'optname' must be uppercased.\r\nb3) int optScanString(char *lvalue)\r\n\tint optScanInteger(int lvalue)\r\n\tint optScanBool(int lvalue)\r\n\r\n\tChecks and interpreters (on success) the current option into the\r\n\tgiven variable. Note: Actually these functions are macros that\r\n\ttake an address of the passed values, so they must be valid\r\n\tl-values!\r\n\r\n\tThis three functions parses the option as described above and\r\n\tissue an error message on failure.\r\n\r\n\r\nc) The callback function itself is called by one of these parsers:\r\n\r\nc1) int leadOptions(char **line, optScanner fct, void * const arg);\r\n\r\nScan and parse all options at the beginning of the line \"*line\",\r\nbut do not skip any argument.\r\n\r\n'line' is a pointer to the (char*) object with the beginning of the\r\nline to be scanned and parsed. On exit, this value is updated with the\r\nfirst position that could not be parsed as an option.\r\n\r\n'fct' is the pointer to the callback function. If NULL, any option\r\ngenerates an error.\r\n\r\n'arg' is passed unchanged to the callback function.\r\n\r\nThe function returns the return value of the last call to the\r\ncallback function.\r\nThis functions exits if the callback function returns with an exit\r\ncode different of E_None or E_Ignore.\r\n\r\nc2) char **scanCmdline(char *line, optScanner fct, void * const arg, int *argc, int *opts);\r\n\r\nScan and parse a complete line into an array.\r\n\r\n'line' is a pointer to the line to be broken into individual arguments\r\nor parsed as options.\r\n\r\n'fct' is the pointer to the callback function. If NULL, any option\r\ngenerates an error.\r\n\r\n'arg' is passed unchanged to the callback function.\r\n\r\n'argc' is a pointer to an (int) object, which is updated with the number\r\nof arguments (non-option arguments) into which the line has been\r\nbroken.\r\n\r\n'opts' is a pointer to an (int) object, which is updated with the number\r\nof successfully parsed options.\r\n\r\nThis function returns:\r\n\tNULL: on failure (the error message has been issued already)\r\n\telse: a pointer to a dynamically allocated array of pointers\r\n\t\tto also dyncamically allocated strings representing the\r\n\t\tindividual arguments. This array has (*argc + 1) elements,\r\n\t\tthe last one, (*argc) itself, is NULL.\r\n\r\nThis functions fails if the callback function returns with an exit\r\ncode different of E_None or E_Ignore.\r\n\r\n\r\n\r\n\r\n== Error codes\r\n\tE_None = 0,\t\t\tNo error, is always 0 (zero)\r\n\tE_Useage = 1,\t\tuseage error\r\n\tE_Other = 2,\t\tunspecified error\r\n\tE_CBreak = 3,\t\t^Break pressed\r\n\tE_NoMem,\t\t\tout of memory condition\r\n\tE_NoOption,\t\t\tparsed option is no \"real\" option\r\n\tE_Exit,\t\t\t\texit program as soon as possible\r\n\tE_Ignore\t\t\tignore this option\r\n\r\n\r\n\r\n== Implementation example\r\n\r\n#include \"cmdline.h\"\r\n\r\n\r\nint optP, optC;\r\nchar *optMSG = NULL;\r\n\r\noptScanFct(opt_xmpl)\r\n{\tswitch(ch) {\r\n\t\t/* parse single character options */\r\n\tcase 'P':\treturn optScanBool(optP);\r\n\tcase 'C':\treturn optScanBool(optC);\r\n\t\t/* parse longname options */\r\n\tcase 0:\r\n\t\tif(optLong(\"MSG\"))\r\n\t\t\treturn optScanString(optMSG);\r\n\t}\r\n\r\n\toptErr();\r\n\treturn E_Useage;\r\n}\r\n\r\nxmpl(char *line)\r\n{\tchar **argv;\r\n\tint argc, opts;\r\n\r\n\t/* Initialize the default settings of the options */\r\n\t\toptP = 1;\r\n\t\toptC = 0;\r\n\t/* Kill the left-over of the previous call to xmpl() */\r\n\t\tfree(optMSG);\r\n\t\toptMSG = NULL;\r\n\r\n\targv = scanCmdLine(line\t\t/* line to scan & parse */\r\n\t\t, opt_xmpl\t\t\t\t/* callback function */\r\n\t\t, NULL \t\t\t\t\t/* no local 'arg' */\r\n\t\t, &argc, &opts);\t\t/* pointers to the counters */\r\n\r\n\tif(!argv)\t\t/* Failed */\r\n\t\treturn EXIT_FAILURE;\r\n\r\n\tprintf(\"The line had %u options.\\n\", opts);\r\n\tprintf(\"The current state of the /P option is: %s\\n\", optP? \"on\": \"off\");\r\n\tprintf(\"The current state of the /C option is: %s\\n\", optC? \"on\": \"off\");\r\n\tprintf(\"The current valus of the /MSG option is: %s\\n\"\r\n\t\t, optMSG? optMSG: \"<<not set>>\");\r\n\tif(argc) {\r\n\t\tint i;\r\n\r\n\t\tputs(\"The arguments of the line are:\");\r\n\t\tfor(i = 0; i < argc; ++i)\r\n\t\t\tprintf(\"arg[%u] == \\\"%s\\\"\\n\", i + 1, argv[i]);\r\n\t} else {\r\n\t\tputs(\"No non-option argument found.\");\r\n\t}\r\n\r\n\tfreep(argv);\t\t/* free the argument array, NOTE THE 'p' */\r\n\r\n\treturn EXIT_SUCCESS;\r\n}\r\n\r\n== General reflections\r\n\r\n1) The callback mechanism allows a very flexible association between\r\n\ta syntactical correct option to a semantic.\r\n\tHowever, if other semantics are needed, the optScan***() function\r\n\tset should be improved rather than locally implemented into\r\n\tthe callback function.\r\n\r\n2) If the switch() statement in the callbacl functions are kept as\r\n\tshowed (meaning: \"return optScanBool(var);\") for all the entries,\r\n\tBorland C's code optimizer generates something like this:\r\n\t\tis_L:\tmov ax, OFFSET optL\r\n\t\t\t\tjmp short ?1\r\n\t\tis_P:\tmov ax, OFFSET optP\r\n\t\t\t\tjmp short ?1\r\n\t\tis_C:\tmov ax, OFFSET optA\r\n\t\t\t\tjmp short ?1\r\n\t\tis_X:\tmov ax, OFFSET optX\r\n\t\t?1:\t\tpush ax\r\n\t\t\t\t...\r\n\t\t\t\tcall _optScanBool\r\n\t\t\t\t...\r\n\t\t\t\tret\r\n\tGood enough?!\r\n\r\n3) The mechanism allows two non-standard things currently:\r\n3a) to leave options within the argument array, as used within COPY to\r\n\ttread /A and /B as local options, thus, bypass them in the first\r\n\trun to catch all the global options. See COPY.C for implementation\r\n\tdetails.\r\n3b) to use options for something totally different, as used for the\r\n\t/C option of FreeCom itself. See INIT.C for implementation\r\n\tdetails.\r\n"
  },
  {
    "path": "docs/cmt6.txt",
    "content": "MUX-AE handler\r\n\t-- 2000/12/10 ska\r\n\r\nI. Overview\r\n\r\nThe MUX-AE handler allows TSRs and alike programs to install extensions\r\nto COMMAND, hence this function is called \"Installable Commands\".\r\n\r\nNote: The innerworking of the MUX-AE interface has been revised heavily\r\nby Eduardo Casino, mail appended.\r\n\r\nThere are two subfunctions (quote from RBIL):\r\n\r\n--------l-2FAE00-----------------------------\r\nINT 2F U - DOS 3.3+ internal - INSTALLABLE COMMAND - INSTALLATION CHECK\r\n        AX = AE00h\r\n        DX = magic value FFFFh\r\n        CH = FFh\r\n        CL = length of command line tail (4DOS v4.0)\r\n        DS:BX -> command line buffer (see #02977)\r\n        DS:SI -> command name buffer (see #02978)\r\n        DI = 0000h (4DOS v4.0)\r\nReturn: AL = FFh if this command is a TSR extension to COMMAND.COM\r\n        AL = 00h if the command should be executed as usual\r\nNotes:  This call provides a mechanism for TSRs to install permanent\r\n          extensions to the command repertoire of COMMAND.COM.  It appears\r\n          that COMMAND.COM makes this call before executing the current\r\n          command line, and does not execute it itself if the return is FFh.\r\n        APPEND hooks this call, to allow subsequent APPEND commands to\r\n          execute without re-running APPEND\r\nSeeAlso: AX=AE01h\r\n\r\nFormat of COMMAND.COM command line buffer:\r\nOffset  Size    Description     (Table 02977)\r\n 00h    BYTE    max length of command line, as in INT 21/AH=0Ah\r\n 01h    BYTE    count of bytes to follow, excluding terminating 0Dh\r\n      N BYTEs   command line text, terminated by 0Dh\r\n\r\nFormat of command name buffer:\r\nOffset  Size    Description     (Table 02978)\r\n 00h    BYTE    length of command name\r\n 01h  N BYTEs   uppercased command name (blank-padded to 11 chars by 4DOS v4)\r\n--------l-2FAE01-----------------------------\r\nINT 2F U - DOS 3.3+ internal - INSTALLABLE COMMAND - EXECUTE\r\n        AX = AE01h\r\n        DX = magic value FFFFh\r\n        CH = 00h\r\n        CL = length of command name (4DOS v4.0)\r\n        DS:BX -> command line buffer (see #02977)\r\n        DS:SI -> command name buffer (see #02978)\r\nReturn: DS:SI buffer updated\r\n          if length byte is nonzero, the following bytes contain the uppercase\r\n          internal command to execute and the command line buffer contains the\r\n          command's parameters (the first DS:[SI] bytes are ignored)\r\nNotes:  this call requests execution of the command which a previous call to\r\n          AX=AE00h indicated was resident\r\n        APPEND hooks this call\r\n\r\n===\r\n\r\nFreeCOM implements the functionality as FEATURE_INSTALLABLE_COMMANDS\r\nand performs the actions as described as follows.\r\n\r\nII. Order of Execution\r\n\r\nThis pseudocode of how FreeCOM interpretes a parsed command line\r\nshall demonstrate the internals and differences from other implementations.\r\n\r\n1. Expand environment variables\r\n\r\n2. Extract any redirections and decompose pipes\r\n\tin result the command line buffer DS:BX does not contain any\r\n\t\">\", \"<\" or \">>\" metacommands nor does a pipe appears\r\n\tin the buffer -- this may be a violation of compatibly as the\r\n\texample in Undocumented DOS by Schulmann contains code handle\r\n\tredirections, thus, it opens the possibility that an Installed\r\n\tCommand would be allowed to kill pending commands of a pipe.\r\n\r\n3. Extract the first command name (first non-blank word fully constructed\r\nout of characters permisable in filenames, but excluding colon, dot,\r\nand backslash).\r\n\r\n4. If found a word, pass it through MUX-AE-00, on success MUX-AE-01 is called.\r\n\tIf now BYTE DS:[SI] == 0, the interpretation of the command stops.\r\n\r\n5. Search the internal commands list for the word left in STRING DS:[SI+1].\r\n\tIf found, it is executed with the command line arguments starting at\r\n\tSTRING DS:[BX+2+(DS:[SI])]. Note: DS:[SI] is the length of the command\r\n\ton return of MUX-AE-01.\r\n\tThen the interpretation of commands stops.\r\n\r\n\t-> RBIL does not mention any minimum length requirements for the\r\n\t   STRING DS:[SI] buffer. FreeCOM passes a full\r\n  \t   BUFFER_SIZE_MUX_AE (currently 255 bytes) buffer to MUX-AE.\r\n\r\n6. Steps 4 and 5 are repeated until MUX-AE-00 returns false.\r\n\r\n7. The original command line is tried as either drive change (\"?:\" syntax)\r\n\tor external command. Note: Any change of both the command name buffer\r\n\t(DS:[SI]) and command name buffer (DS:[BX}) are ignored.\r\n\r\nIII. Incompatiblies\r\n\r\n- In earlier versions FreeCOM used the command line buffer (DS:[BX])\r\n\tto execute an external command, if applicable; thusm allowing an\r\n\textension to re-write the command line. This is NO LONGER so, for\r\n\tcompatibly with MS COMMAND.\r\n\r\n- FreeCOM always uses BYTE DS:[BX+1] to determine the length of\r\n\tSTRING DS:[BX+2]. If an Installed Command wants to change the\r\n\targuments, this byte must be updated.\r\n\r\n- FreeCOM supports the 4dos v4 extensions mentioned by RBIL.\r\n\r\n- As FreeCOM has no meaning of \"transient\" portion, the segment\r\n\tregisters simply point to the strings. DS == ES always.\r\n\tThis may vary in future!\r\n\r\n- If an extension rewrites the command, FreeCOM is to call MUX-AE again.\r\n\tThis might lead to an infinite loop. In order to prevent such situation,\r\n\tFreeCOM calls the MUX-AE chain only a limited number of times, which\r\n\tcan be customized through the MUX_AE_MAX_REPEAT_CALL setting of\r\n\tCONFIG.H.\r\n\r\nIV. Side definitions\r\n\r\n- The buffer DS:BX will always be larger than 12 bytes:\r\n\t  11 bytes (as 4dos v4 blank padded)\r\n\t+  1 byte (length byte)\r\n\t+  1 byte ('\\0' byte at 13th position)\r\n\r\n- The string at DS:[BX+2] is terminated by '\\xd' and '\\0' on entry to\r\n\tMUX-AE-00.\r\n\tThere will always be a '\\0' character at DS:[BX+2+[DS:BX]],\r\n\tthus the byte following the last byte, which is part of the string.\r\n\r\n- If at any time BYTE DS:[BX+1] becomes greater than or equal to BYTE DS:[BX],\r\n\tFreeCOM aborts due to possible memory hazard.\r\n\r\nV. Installable Command samples\r\n\r\nThe TOOLS subdirectory contains several samples of Installable Commands.\r\nThey shall verify a working MUX-AE interface and are not meant as\r\nsomething useful, hence, they are simple and display a lot of debugging\r\ninformation.\r\n\r\nLOAD_ICD.C implements the loader.\r\nICMD_*.NAS implement various samples. They are NASM sources and must be\r\ncompiled using this command:\r\nC> NASM -f bin ICMD_#.NAS\r\nIn result a ICMD_#.ICD is created.\r\n\r\nThe format of such sample is:\r\n1. The MUX-entry point is the very first byte of the file.\r\n2. A validation area is located at the end of the file:\r\n\tbegin of file --> entry point\r\n\tcode\r\n\tBYTE Pascal string of the name of Installable Command\r\n\tWORD offset within file to DWORD of where to write the original\r\n\t\tvalue of INT-2F to in order to be able to chain the interrupt\r\n\tWORD offset within file to write the name to (see above)\r\n\tBYTE value 0 (zero)\r\n\t.... comment <<is displayed while loading>>\r\n\t.... Installable Command Image ID (see LOAD_ICD.C)\t\r\n\r\nDuring the load and installation of the Installable Command by LOAD_ICD\r\nthe filename without path nor extension is placed as Pascal string\r\nat the position mentioned within the validation record. The last byte\r\nof the name is the last byte of the residently installed image of the\r\nInstalled Command, too.\r\n\r\nThe name is displayed within debug messages and is the name of the\r\nnewly installed internal command. Because LOAD_ICD updates the name\r\nduring the load of the Installable Command, the same Installable\r\nCommand can be installed with different names by copying the file\r\nto a different file.\r\n\r\nVI. Examples\r\n\r\nNOTE: This section is out-dated!\r\n\r\n1) The simplest form is an Installable Command that performs any action\r\n\titself.\r\n-> MUX-AE-00 returns AL == 0xFF\r\n-> MUX-AE-01 performs the action and returns DS:[SI] == 0\r\n\r\n2) Map an Installable Command into another internal command.\r\n-> MUX-AE-00 returns AL == 0xFF\r\n-> MUX-AE-01 modifies Pascal string of command name at DS:[SI]\r\n\r\n3) Map an Installable Command into an external command\r\n-> MUX-AE-00 returns AL == 0xFF\r\n-> MUX-AE-01 modifies Pascal string of command name at DS:[SI]\r\nNote: DS:[BX+2] must be checked that it contains no path delimiter\r\ncharacter, that are colon ':', backslash '\\\\', nor dot '.'. Otherwise\r\nthe remaining command line tail will be appended to the command name\r\nand will complete the name passed back within DS:[SI]. Internal as well\r\nas Installable Commands are separated by such characters!\r\nE.g.: Installable Command \"GO\" and maps to \"WALK\"\r\nC> GO\\THERE\r\n--> GO rewrites the command \"GO\" into \"WALK\" and then appends the\r\nremaining command line tail and, in result, performs:\r\nC> WALK\\THERE\r\n\r\nTo overcome this problem GO must rewrite the command line tail, too,\r\nby inserting a blank at position DS:[BX+DS:[SI]]. (DS:[SI] is the\r\nlength of the original command name, 2 in this example.)\r\n-->\r\nC> WALK \\THERE\r\n\r\n4) Disable an internal command.\r\n-> MUX-AE-00 returns AL == 0xFF\r\n-> MUX-AE-01 returns DS:[SI] == 0\r\nThe Installable Command must be named equal to the internal command,\r\ne.g.: Installable Command \"DEL\" will disable the internal command\r\nDEL and any external one, too.\r\n\r\nVI. Clarifying mail by Eduardo Casino\r\n\r\nHello,\r\n\r\nEl jue, 10-06-2004 a las 15:25, FreeCOM escribi:\r\n\r\n\r\n>> there is another testing release of FreeCOM that should fix the MUX-AE \r\n>> issue. Would you please test it?\r\n>> http://freedos.sourceforge.net/freecom/packages/TESTING/\r\n\r\n\r\nIt works perfectly with FD APPEND, but...\r\n\r\n\r\n>> It has, however, one known incompatibly with MS DOS:\r\n>> \r\n>> It occurs to me that MUX-AE is called recursively (or repeatedly) when \r\n>> MUX-AE-00 returns 0xFF (true), but MUX-AE-01 returns with DS:[SI] != 0 \r\n>> (aka TSR re-wrote the command, but did not executed it itself).\r\n>> FreeCOM does not do this, but calls the MUX-AE pair only one time. Do \r\n>> you know something more about this?\r\n\r\n\r\nI've written a group of silly test programs to check this and the\r\nconclusions are:\r\n\r\nWhen returning from MUX-AE-01 and DS:[SI] != 0, MS COMMAND.COM, again,\r\nchecks DS:[SI+1] and:\r\n* If it is an internal command, executes the internal command without\r\ncalling again MUX-AE.\r\n* If it is not an internal command, calls MUX-AE-00 to check if it is an\r\nextension. In this case, executes the extension using MUX-AE-01.\r\n* If it is not an extension, no matter what the content of DS:[SI+1] is,\r\ntries to load and execute the _typed_ command from disk and with its\r\n_original_ arguments, no matter if the extension has modified the\r\ncommand line buffer.\r\n\r\nExample 1: Extension to DIR\r\nImagine that this extension just prints \"I'm DIR!\" and then:\r\nCase a) DS:[SI] unmodified. The internal DIR command is executed (you\r\nget the directory listing.) This is just the same as the next case.\r\nCase b) DS:[SI] contains 4, \"ECHO\" (or any other internal command). As\r\nthis is an internal command, it is executed.\r\nCase c) DS:[SI] contains 3, \"BAR\" (or anything that it is not an\r\ninternal command). MUX-AE-00 is called and, if the \"BAR\" extension\r\nexists, it is executed with MUX-AE-01. If it doesn't, the shell tries to\r\nexecute DIR from disk (DIR.BAT, DIR.COM or DIR.EXE)\r\n\r\nExample 2: New extension \"FOO\"\r\nIn this case, it prints \"I'm FOO!\" and then:\r\nCase a) DS:[SI] unmodified. The shell looks for the internal command\r\n\"FOO\". As it does not exist, calls MUX-AE-00 and finds that it is an\r\nextension, so it executes it using MUX-AE-01 and enters an endless loop.\r\nThis is, in fact, the same as case c.\r\nCase b) The same as for example 1.\r\nCase c) The same as for example 1, but now it tries to execute \"FOO\"\r\n(FOO.BAT, FOO.COM or FOO.EXE)\r\n\r\nFor all cases in both examples, the shell uses the arguments in the\r\ncommand line buffer (ignoring the first _updated_ DS:[SI] bytes), except\r\nif command is not an extension in case c.\r\n\r\nWith FreeCOM 0.82pl3q two incompatibilities (or differences in\r\nimplementation ;-)) remain:\r\n\r\nThe first one is what you comment about FreeCOM calling the MUX-AE pair\r\nonly once. This prevents the looping problem, that's true, but\r\nextensions should not allow this to happen. And if an extension tries to\r\nexecute another extension on exit, it won't work with FreeCOM, because\r\nit won't call the MUX-AE functions again.\r\n\r\nThe second difference is that FreeCOM, at exit of the MUX-AE-01, uses\r\nthe arguments in the _updated_ command line buffer when it executes the\r\ntyped command from disk (when the command name buffer contains something\r\nthat it is not an internal command nor an extension) instead of the\r\n_original_ command line, like MS-DOS does.  \r\n\r\nThese two programs show the incompatibilities:\r\nhttp <<norobot>> perso.wanadoo.es/samelborp/test1.asm\r\nhttp <<>norobot> perso.wanadoo.es/samelborp/test2.asm\r\n\r\ntest1.asm - Installs two extensions: FOO and BAR. FOO prints \"Hello, I\r\nam FOO!\" and, on exit, calls BAR. BAR prints \"Hello, I am BAR!\" and\r\nterminates\". With MS-DOS, if you type \"FOO\" you see this:\r\n\r\nC:\\> FOO\r\nHello, I am FOO!\r\nHello, I am BAR!\r\n\r\nWith FreeCOM, you get:\r\n\r\nC:\\> FOO\r\nHello, I'm FOO!\r\nBad command or filename - \"FOO\".\r\n\r\n\r\ntest2.asm - Installs the extension \"MORE\". It prints \"Hello, I am MORE!\"\r\nand, on exit, modifies the command name buffer with 8, \"XXXXXXXX\" and\r\nthe command line buffer with 11, \"MORE XX.TXT\", 13 . If you have a\r\nTEST.TXT file with the line \"This is a test.\", in MS-DOS you get:\r\n\r\nC:\\> MORE TEST.TXT\r\nHello, I am MORE!\r\nThis is a test.\r\n\r\n(MORE is executed with the original arguments)\r\n\r\nWith FreeCOM you get:\r\n\r\nC:\\> MORE TEST.TXT\r\nHello, I am MORE!\r\nMORE: XX.TXT: No such file\r\n\r\n(MORE is executed with the modified arguments)\r\n\r\n\r\nWARNING: The programs are horrible, quick and dirty hacks with the only\r\npurpose of showing the incompatibilities. Please, do not use them\r\nagainst me  ;-) \r\n\r\nRegards,\r\nEduardo.\r\n\r\n\r\n"
  },
  {
    "path": "docs/cmt7.txt",
    "content": "Permanent data storage within external memory block\r\n\t-- 20001/03/30 ska\r\n\r\nFreeCOM utilizes several information that need to keep the same\r\nwhen it gets reloaded. The current implementation, esp. ALIAS,\r\ncommand line history, directory stack and batch nesting level,\r\nmaintain their own data within a module-local (aka static)\r\ndata structure that is usually dynamically extended into the heap.\r\nALIAS and batch processing use single linked lists, history and\r\ndirstack use a single memory block.\r\n\r\nDuring a swap of FreeCOM this information must be restored to its\r\nvalues, though, it need not be replicated exactly the same. For instance,\r\nif the \"last command line\" returns the same line, it is uninteresting\r\nwhere this information comes from.\r\n\r\nWhen this information is stored external to FreeCOM right away,\r\nthere is no need to take special care about when FreeCOM swap, but\r\nit will require more time as \"external\" usually means that these\r\nlocations cannot be addressed with near addresses, which are the default\r\nand fastest ones.\r\n\r\nThere is already one data that is maintained external to FreeCOM,\r\nthe block of environment variables. This block must be present in\r\nits format and syntax, because 3rd party tools are silently allowed\r\nto modify its contents.\r\n\r\nAn environment segment is a simple structure, though, mainly implemented\r\nto store character strings within it:\r\n\r\n<name1>=<value1>\\0\r\n<name2>=<value2>\\0\r\n...\r\n<nameN>=<valueN>\\0\r\n\\0\r\n\r\nPer convention \"<name>\"s are printable characters except the equal sign\r\nitself.\r\n\r\nALIASes are by nature already expressed in this syntax.\r\nEntries of the command line history and the directory stack can also\r\nbe expressed as such strings easily.\r\nEven the batch nesting can be easily written as a string.\r\n\r\nHowever, there must be a way to distinguish all different kinds of\r\ninformation stored within such pseudo-environment. Under the\r\nprerequisite that almost all 3rd party tools honor the convention that\r\nnames are constructed out of printable characters, non-printable\r\ncharacters look fine; the low-level functions already implemented and\r\nused by FreeCOM to access an environment segment don't care at all\r\nabout the name of the variable as long as it does not contain no\r\nequal sign or NUL character.\r\n\r\nSome information, for instance how many entries the history\r\nor the directory stack contains, could be located in this block\r\nas well, though it is not really required, because FreeCOM already\r\nutilizes a so-called \"static\" context, which primarily serves as\r\ninterface between the higher and lower portions of the swapping\r\nprocess, but had been designed to include other data as well since\r\nits beginning. The main reason to split permanent information across\r\ntwo structures, the so-called static and dynamic contexts, arise\r\nfrom the fact that the amount of and even the maximal user-specified\r\nsize of such information changes heavily at runtime.\r\n\r\nTo have the static context firmly rooted in the memory of the systems\r\nallows to place vital functions within there, e.g. the Critical\r\nError handler, without to worry about what happen if to resize the\r\ncontext fails. The static context will reference to the associated\r\ndynamic context, which, if lost, is rebuilt by FreeCOM easily, though,\r\nwith 100% loss of all information stored within there.\r\n\r\nThe slightly modified format of the dynamic context looks like this:\r\n\r\n<tag><name>=<value>\\0\r\n...\r\n\\0\r\n\r\n<tag> is a single character that specifies the kind of information\r\nstored in this line.\r\n\r\n<tag> has been choosen like this:\r\n\\2 -> entries of the command line history  (A)\r\n\\3 -> entries of the directory stack (A)\r\n\\4 -> last directory (B)\r\n\\5 -> batch nesting level (A)\r\n\\6 -> swapinfo\r\n\\7 .. ' ' -> reserved for future use\r\n'!' .. -> alias\r\n\r\nTo let the aliases allocate all the remaining tags has the slight\r\nside effect that the syntax of aliases is the same one as of\r\nenvironment variables; and because the syntax of the commands\r\nSET and ALIAS is nearly the same one as well, both commands can\r\nshare a lot of code. Here, SET is to ignore all entries with a\r\nnon-printable first character.\r\n\r\n===\r\n\r\nTheoretical notes:\r\n\r\n+ The lowlevel functions to maintain an environment segment are known,\r\n\tso it is possible to rely on this or that implementation, e.g.\r\n\tnew entries are always appended to the end of the environment\r\n\tand existing entries are changed in place. That means if a variable,\r\n\te.g. with an empty name or unknown tag is create at the very\r\n\tbeginning of the environment, FreeCOM can rely on that the value\r\n\tof the variable is located at easily calculatable addresses.\r\n\tThough, the value must not contain no NUL characters.\r\n\r\n+ The memory block must be located in its own DOS memory block, because\r\n\tthe lowlevel functions rely on information located in the MCB\r\n\tpreceeding the environment segment -- esp. to aquire the length\r\n\tof the segment from.\r\n\r\n===\r\n\r\nAt this time not every instance of FreeCOM maintains a static context,\r\nhence, there is no dynamic context by default.\r\nSo for this time, the values that should normally go into the static\r\ncontext are implemented as global variables and are saved/restored\r\ninto the static context on swap.\r\n"
  },
  {
    "path": "docs/cmt8.txt",
    "content": "$Id$\r\nBatch file processing\r\n\t-- 2001/04/26 ska\r\n\r\nThis document discusses the features and functionality of the\r\nbatch file processing. It does not include help or explanation\r\nfor the batch language itself.\r\n\r\nIn the following \"batch\" files and the like are called \"scripts\"\r\nor \"shell scripts\" most of the time; the author assumes that most\r\npeople running DOS/FreeCOM will associate the COMMAND batch language\r\nwith this term.\r\n\r\nC> is an icon of the command line prompt an user is to enter commands at.\r\nIt shall only visualize the interactive prompt and _not_ the particular\r\ndrive C:.\r\n\r\nA '===' at the first column represents a section header.\r\nA '==' sourrounds file listings and, sometime, output of programs.\r\n\r\n=== Invoking Shell Scripts\r\n\r\nVariant 1:\r\n\r\nShell scripts are invoked like any command:\r\n\r\nSCRIPT arg1 arg2 arg3 arg4 ... argN <in-file >out-file\r\n\r\nThe arguments and the I/O redirection directives are optional, of course.\r\n\r\nBatch scripts are identified by the extension .BAT, it is currently\r\nnot possible to execute a batch script without this file extension.\r\n\r\nIn this variant, however, empties the execution context, what means that\r\nany formerly nested script are \"forgotten\". In addition, FOR loops are\r\ndestroyed, too.\r\n\r\nVariant 2:\r\n\r\nIn order to nest script they must be invoked via the CALL command:\r\n\r\nCALL SCRIPT arg1 arg2 arg3 arg4 ... argN <in-file >out-file\r\n\r\n\r\nThe arguments and the I/O redirection directives are optional, again.\r\nAlso, the scripts must have the file extension .BAT.\r\n\r\nUnlike to invoke scripts without CALL, the current position within\r\nthe current script is preserved and the execution returns to the next\r\ncommand following the CALL command when the CALL'ed script finishes.\r\nFOR loops are destroyed nonetheless.\r\n\r\nEXAMPLE:\r\n\r\n== BATCH1.BAT\r\necho In Batch1 - arg1 = %1\r\n== BATCH2.BAT\r\n@echo off\r\ncall batch1 first\r\necho second\r\ncall batch1 third\r\n==\r\n\r\nInvoking script BATCH2 from command line:\r\n\r\nC> batch2\r\n\r\nwould output:\r\n\r\n==\r\nIn Batch1 - arg1 = first\r\nsecond\r\nIn Batch1 - arg1 = third\r\n==\r\n\r\nBecause there is no old execution context on command line, the user may\r\ninvoke script BATCH2 with or without CALL; but if BATCH2.BAT would read:\r\n== BATCH2a.BAT\r\n@echo off\r\nbatch1 first\r\necho second\r\nbatch1 third\r\n==\r\n\r\nInvoking the modified script BATCH2 from command line:\r\n\r\nC> batch2a\r\n\r\nwould output:\r\n\r\n==\r\nIn Batch1 - arg1 = first\r\n==\r\n\r\nBecause to invoke a batch script without CALL destroys any former\r\nexecution context, hence, the shell simply forgot where to return to\r\nwhen BATCH1.BAT ends.\r\n\r\n=== Accessing Arguments\r\n\r\nThe argument passed to a script are accessable through the automatic\r\nvariables: %1, %2 through %9 (there is no trailing second percent sign).\r\nVariable %0 returns the name of script in the same way it has been\r\nwritten on invokation, e.g.:\r\n== BATCH.BAT\r\necho %0\r\n==\r\n\r\nC> batch\r\nbatch\r\nC> BATCH\r\nBATCH\r\nC> batch.bat\r\nbatch.bat\r\nC> .\\batch.BAT\r\n.\\batch.BAT\r\n\r\nArguments may be separated on command line with: whitespaces, commas,\r\nsemicolons ';' and equal signs '='. There is no known quotation mechanism.\r\nE.g.:\r\n== BATCH.BAT\r\n@echo :%1: :%2: :%3: :%4: :%5: :%6: :%7: :%8: :%9:\r\n==\r\n\r\nC> batch 1 2,3;4=5 6+7\r\n:1: :2: :3: :4: :5: :6+7: :: :: ::\r\n\r\nThe tenth and later arguments are not accessable directly; to fetch them\r\nthe command SHIFT must be used. Each SHIFT increments a \"shift level\" by\r\none and when using \"%n\", it is replaced by the \"n + shift_level\"'th\r\nargument, e.g.:\r\n\r\n== BATCH.BAT\r\necho %0\r\nSHIFT\r\necho %0\r\nSHIFT\r\necho %0\r\n==\r\n\r\nC> batch 1 2 3\r\nbatch\r\n1\r\n2\r\n\r\nPlease note that %0 is effected by SHIFT, too.\r\n\r\nThere is no upper limit for SHIFT. If \"n + shift_level\" references to a\r\nnon-existant argument, it is replaced by an empty string, aka by nothing.\r\n\r\n=== Noisiness / Echo State\r\n"
  },
  {
    "path": "docs/comments.txt",
    "content": "cmt1.txt - Redesign of command line parser for internal commands\r\ncmt2.txt - Batchfile processing\r\ncmt3.txt - Command line parser\r\ncmt4.txt - How the COPY command works\r\ncmt5.txt - option parser\r\ncmt6.txt - MUX-AE handler\r\ncmt7.txt - Permanent data storage within external memory block\r\ncmt8.txt - Batch file processing\r\ncmt9.txt - Context - Description of Interface, Structure and Useage\r\ncmt10.txt - Critical Error Handler Repeat Check Autofailer\r\n"
  },
  {
    "path": "docs/compile.txt",
    "content": "Compile notes:\r\n\r\nNOTE: Use NASM version 0.98.35 or later!\r\nWhen building on Windows a native (win32 or win64) version is recommended.\r\n\r\nThere is a more detailed description located here:\r\nhttp://freedos.sourceforge.net/freecom/build48.html\r\n\r\n1) Setup a compiler: TC++ v1.01 (see www.freedos.org, Links page for a\r\nreference to Borland's museum site), TC 2.01, Borland C++, Open Watcom\r\n(www.openwatcom.org), or ia16-elf-gcc (github.com/tkchia/gcc-ia16).\r\n2) Configure CONFIG.MAK (see below)\r\n3) Configure CONFIG.H   (see there)\r\n4) Run BUILD.BAT** or build.sh (cross compilation from Linux or MinGW/MSYS)\r\n(Some newer MAKE variants may require a space between the -f option\r\n and the makefile name. On trouble try to fix BUILD.BAT.)\r\n\r\n** BUILD.BAT and build.sh accept to following options:\r\nC> BUILD.BAT [-r] [clean] [no-xms-swap] [debug] [compiler] [language]\r\n-r\t\tRebuilt (clean previous files before proceed)\r\nclean\tremove *.COM, *.OBJ, *.LIB etc. files, then exit\r\nno-xms-swap\tcreate FreeCOM without XMS-Only Swap support\r\ndebug\t\tenable debug code in FreeCOM\r\ncompiler\tone of wc, tc, tcpp, bc (build.sh: wc or gcc only)\r\nlanguage\tsets the specified language as the default build language\r\n\r\nYou will find two executables in the FreeCOM directory:\r\nSHELL\\COMMAND.EXE and COMMAND.COM.\r\nThe .COM file is the stand-alone application, which includes the\r\nstrings etc, whereas COMMAND.EXE is the pure executable without the\r\nstrings table for instance.\r\n\r\nNOTE: A message like \"Fatal: command line too long\" was always caused\r\nduring my tests by an invalid settings in CONFIG.MAK, esp. CC_BASE_PATH\r\nand NASM!\r\n\r\nCONFIG.BAT (copied from CONFIG.B)\r\n\r\nThis is the central file to tweak options and environment settings\r\nregarding your compiler.\r\n\r\nCOMPILER\r\ndefault compiler to use, if none of tc, tcpp, bc, or wc is given.\r\n\r\nTC2_BASE\r\nTP1_BASE\r\nBC5_BASE\r\nWATCOM\r\nbase paths (aka \"root\") for Turbo C 2.01, Turbo C++ v1.01, or Borland\r\nC++; usually it is sufficient to modify this macro and all files\r\n(headers and libraries) and programs (C compiler and linker) will be\r\nfound. If not, check the macros at the end of the file and/or the\r\nusage of $(LIBPATH) within COMMAND.MAK or STRINGS.MAK respectively.\r\nFor Open Watcom, the WATCOM environment variable can be adjusted, if\r\nit is not already set.\r\n\r\nUpdate XNASM as needed, if \"nasm\" is not in your PATH.\r\n\r\nCONFIG.MAK (copied from CONFIG.STD)\r\n\r\nThis is the central file to tweak other options and environment settings.\r\n\r\nSUPPL_INC_PATH / SUPPL_LIB_PATH\r\nTo compile this version of command.com, you have to add the SUPPL library.\r\nSUPPL_INC_PATH points to the directory with all the header files, whereas\r\nSUPPL_LIB_PATH contains the pre-compiled library (SUPPL_S.LIB). Due to\r\npopular demand, a variant of SUPPL is integrated into the FreeCOM release\r\nand both settings are pre-configured so that the BUILD.BAT script will\r\npick up the library automatically. Note: See the SUPPL\\README.TXT file,\r\nif you wish to NOT use the integrated SUPPL variant.\r\n\r\n\r\nUpdate NASMFLAGS as needed.\r\n\r\nSHELL_MMODEL\r\nis the memory model used to compile the shell. It should be Small (s),\r\nunless you want to include debugging support; use Large (l) in such case.\r\n\r\n$(CFG): $(CFG_DEPENDENCIES) ../config.mak\r\nThis rule is used to create the default option file for the compiler.\r\nIt should set the header and library search paths and the memory\r\nmodel, disable floating\r\npoint arithmetics (as it is not used by FreeCOM). The default char\r\ntype should be unsigned. There are no known specific alignment\r\nor optimization settings, configure as you wish.\r\n\r\n===\r\n\r\n[this step is optional, recommended to just use included mini SUPPL library]\r\nTo compile the SUPPL library as well do this:\r\n+ download the source code from where SUPPL\\README.TXT points to\r\n+ use one of the COMPILER\\* preparations -or-\r\n  : DEL cfg*.*\r\n  : DEL STRBOOL*.*\r\n  : DEL t.c\r\n  : CALL MKDYNSRC.BAT\r\n  : compile all remaining *.c files\r\n  : check if it is necessary to meddle with any of the assembly files\r\n    and compile them if needed\r\n  : archive all created object files -- usually named .OBJ or .O --\r\n    into a library named SUPPL_#, where # is S for Small memory\r\n    model or L for Large.\r\n+ copy all the INCLUDE\\*.H files and the library from the SUPPL release\r\n  into FREECOM\\SUPPL -or-\r\n  update CONFIG.MAK to let SUPPL_???_PATH point to the SUPPL directory\r\n"
  },
  {
    "path": "docs/contrib.txt",
    "content": "Contributions are welcome!\r\n\r\nCurrently the best way to submit a patch is via a pull request (PR) on GitHub - see https://github.com/FDOS/freecom\r\n\r\nDiscussion and patches may also be done via the FreeDOS developer mailing list or by attaching a patch to an issue on GitHub.\r\n\r\n\r\nMost wanted changes are:\r\n  - translations, fixing any that may need updating or adding new languages\r\n  - bug fixes, see Issues on GitHub site and bugs on Sourceforge https://sourceforge.net/p/freedos/bugs/\r\n  - improvements or compability fixes, i.e. new or update existing commands to better match MS COMMAND.COM or 4DOS\r\n\r\nThank you.\r\n"
  },
  {
    "path": "docs/download.txt",
    "content": "You can download pre-compiled variants of FreeCOM from:\r\n\r\nhttps://github.com/FDOS/freecom\r\n\r\nFor each language supported, a zip archive is provided with the following versions:\r\n\r\n  xmsswap: the latest FreeCOM with XMS-Only swap support\r\n\r\n  kswap: the latest FreeCOM with kswap support\r\n\r\n  plainedt: the latest FreeCOM without the command line editing\r\n            enhancements (history, file complation)\r\n\r\n  debug: the latest FreeCOM with debug information enabled\r\n\r\n\r\nAnd a developer package for localizer (to create new or maintaining existing *.LNG files),\r\nwhich includes latest FreeCOM (xmsswap with enhancements) and precompiled strings (*.dat)\r\nfor each language along with the source (*.lng) language files and fixstrings.exe used to\r\ngenerate new strings.dat file.  See included documentation for further details.\r\n\r\n"
  },
  {
    "path": "docs/faq.txt",
    "content": "$Id$\r\n\r\nFrequently Asked Questions about FreeCOM\r\n\tCopyright (C) 2000 Steffen Kaiser <ska-src@gmx.net>\r\n\r\ncurrent version v0.79b\r\n\r\n-------------------- Glossar\r\nFreeCOM: COMMAND.COM clone\r\n\r\n--------------------\r\nQ: There is an error message like \"Cannot open STRINGS.DAT\"?\r\n\tThere is no text for error messages.\r\n\r\nA: The actual string (or text) of messages has been outsourced from\r\n\tthe program image to:\r\n\ta) save space and\r\n\tb) better support various languages.\r\n\tThe strings are appended to the FreeCOM executable and are read from\r\n\tthere each time a message is to be displayed.\r\n\r\n\tWhen you load FreeCOM from floppy, remove the floppy and an error\r\n\toccurs, FreeCOM tries to reload the messages from the FreeCOM\r\n\texecutable, but because it is no longer there, the actual text\r\n\tcannot be loaded.\r\n\r\n\tIf you invoke FreeCOM with the /MSG switch, the messages are\r\n\tpermanently loaded into memory, in order to skip to reload them.\r\n\r\n\tNote: The messages are loaded on demand and are purged from memory\r\n\twhen an external program is called, therefore problems show up\r\n\tat an unregular base.\r\n\r\n\tTo visualize how loading and purging of messages work, compile FreeCOM\r\n\twith debug option enabled or grab the precompiled COM_DBG.COM, then\r\n \trun:\r\n\r\n \tExample 1\r\n\r\n\tStep #1) COM_DBG.COM /k FDDEBUG ON\r\n\r\n\t[The \"FDDEBUG ON\" enables the debug output.]\r\n\r\n\tStep #2) Now try to invoke a _non_existing_ command. Among others\r\n\tyou should see \"[Messages successfully loaded to segment 0xeb7a]\"\r\n\t(the actual segment will vary) and below the error message that had\r\n\tbeen loaded: \"Bad command or filename.\".\r\n\r\n\tStep #3) Now run an _external_ command, which produces as less output\r\n\tas possible (one line is best). You should see information\r\n\t\"[Message segment deallocated.]\" immediately preceeding the line, the\r\n\tprogram had produced.\r\n\r\n\tStep 4) Now try to invoke the _non_existing_ command again, the\r\n\tmessages are reloaded.\r\n\r\n\tStep 5) Immediately try to invoke the _non_existing_ one again,\r\n\tthe messages are _NOT_ loaded. This is as long you do not terminate\r\n\tthe FreeCOM instance nor call an external command, the message remain\r\n\tin memory.\r\n\r\n\tStep 6) Exit the current copy of FreeCOM, the \"deallocated\" info will\r\n\tappear.\r\n\r\n\t====\r\n\r\n\tExample 2\r\n\r\n\tStep #1) COM_DBG.COM /MSG /k FDDEBUG ON\r\n\r\n\tNow re-run Steps 2 through 6. You will see that the message stay\r\n\tin memory, except in step 6.\r\n"
  },
  {
    "path": "docs/files.txt",
    "content": "Archive Contents\r\n~~~~~~~~~~~~~~~~\r\nbugs.txt        Bug List\r\nfiles.txt       This file list\r\nhistory.txt     History of the shell development\r\nlicense         GNU license - applies to all files named here\r\nreadme.md       General shell info\r\n\r\ncommand.mak     Borland C make file\r\nconfig.mak      Makefile configuration\r\nmodel.def       Model definition for make file\r\n\r\nalias.c         Alias code\r\nalias.h         Alias header file\r\nbatch.c         Batch file interpreter\r\nbeep.c          Implements beep command\r\ncall.c          Implements call command\r\ncls.c           Implements cls command\r\ncmdinput.c      Command-line input functions\r\ncmdtable.c      Table of available internal commands\r\ncommand.c       Main code for command-line interpreter\r\ncommand.h       Command header file\r\ncopy.c          Copy command\r\ncopy.h          Header file for copy command\r\ndate.c          Date command code\r\ndatefunc.c      Get and set date functions for Pacific C compatibility\r\ndel.c           Implements del command\r\ndir.c           Directory listing code\r\ndstack.c        Directory stack commands (DIRS/PUSHD/POPD)\r\necho.c          Implements echo command\r\nenviron.c       Environment handling\r\nerr_hand.c      Critical Error Handling code\r\nerr_hand.h      Critical Error Handling header\r\nerror.c         Error Message Routines\r\nexec.c          Exec C interface code\r\nfilecomp.c      Filename completion functions\r\nfor.c           Implements for command\r\ngoto.c          Implements goto command\r\nhistory.c       Command-line history handling\r\nif.c            Implements if command\r\ninit.c          Functions used in initializing command.com\r\ninternal.c      Internal commands (DIR, RD, etc)\r\nlh.asm          Loadhigh assembler functions\r\nloadhigh.c      Loadhigh C source\r\nloadhigh.h      Loadhigh header file\r\nlowexec.asm     Low-level exec functions\r\nmodel.def       memory model for exec stuff\r\nmisc.c          Misc. Functions\r\nopenf.c         Handle CP/M style devices (i.e. CON:, LPT1:, etc.)\r\nopenf.h\r\npath.c          Implements path command\r\npause.c         Implements pause command\r\nprompt.c        Prompt handling functions\r\nredir.c         Redirection and piping parsing functions\r\nren.c           Implements rename command\r\nset.c           Implements set command\r\nshift.c         Implements shift command\r\ntempfile.c      Re-implementation of tmpfile library function\r\ntempfile.h      tempfile.c header file\r\ntestenv.c       Code to test environment passing\r\ntime.c          Time command code\r\ntimefunc.c      Get and set time functions for Pacific C compatibility\r\ntruename.c      Implements truename command\r\ntype.c          Type command code\r\nver.c           Implements VER command\r\nvol.c           Implements VOL command\r\nwhere.c         Code to search path for executables\r\nverify.c        Implements verify command\r\n\r\n28.com          program to switch to 28-line mode\r\n50.com          program to switch to 43/50-line mode\r\ncommand.com     COMMAND.COM executable\r\n\r\nTESTS/          Test files and documents\r\nSTRINGS/\tStrings file and program(s) to deal with them\r\nTOOLS/\t\tvarious tools, see TOOLS/FILES.TXT\r\n"
  },
  {
    "path": "docs/history.txt",
    "content": "FreeDOS Command Line Interface Development History\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nv0.86\r\n~~~~~\r\n    improved build support (fixes, improved makefiles, add TC support to CI)\r\n    add quotes to command line ENV VAR if has space to better handle LFN commands\r\n    fix IF \"==\" incompatibilities\r\n    (version increment to avoid confusion with any prerelease builds)\r\n\r\nv0.85b\r\n~~~~~\r\n    fix screen corruption that occurs when performing an editing command that clears the command line and the cursor is not at EOL\r\n    fix an error that may overwrite 0x100 of a program when writing command line into PSP\r\n    COPY: allow lowercase drive letter for destination\r\n    COPY: Check that target drive exists and if not return the proper error code\r\n    COPY: We shouldn't error if the target argument is a bare drive\r\n    fix sort order when sorting by date AND time AND results compare identical, return sort by filename\r\n    fix CTTY suitable for serial terminal via AUX (COMn)\r\n    various NLS updates\r\n\r\nv0.85a\r\n~~~~~\r\n    regression fix: ensure not setting errorlevel for all internal commands, exclude commands such IF FOR etc\r\n    documentation update - merge/remove duplicate files, add history, general updates (links, email, etc)\r\n    correct help for 'for' command, add %% escaping to printf so for command shows %a ... do ... %a instead of ?a ... do ... ?a\r\n    use program exit code as errorlevel when using loadfix or loadhigh (unless error invoking program)\r\n    compatibility improvement, don't print % when missing paired % on command lines (show 'somevar' not '%somevar')\r\n    if COMSPEC isn't set, strdup an empty \"\" string instead of potential NULL pointer dereference\r\n    add beginning of more comprehensive test batch file\r\n    prevent debug builds crashing on startup, intr and lowexec needs to retf not retn for medium memory model builds (e.g.debug build)\r\n    fix xms-swap debug build when returning from exec'd programs, fixup return segment and do a far return from xmsexec call\r\n\r\nv0.85\r\n~~~~~\r\nFrom Kenneth J Davis\r\n    support CMDLINE for command lines > 126 characters when invoking COMMAND.COM\r\n    improve compatibility when executing external programs - from RBIL and other sources, the command line should end in just \\r and if greater than 126 chars, the size byte should be 127 not actual size; still keep \\0 if command line is short enough but allow 126 chars without terminating \\0, set size to 127 if >126\r\n    misc batch file updates to aid in building multiple versions (languages/xmswap or not/compiler)\r\n    support /E maxsize of 32768, FreeCOM documentation and MS/PC DOS command.com document max value as 32768, due to use of signed int FreeCOM max size was actually 32766; change argument processing to use unsigned int and support up to 32768 as argument\r\n    git should ignore generated files\r\n    add files to GitHub so http://www.fdos.org/freecom/ directs to GitHub hosted content\r\nFrom Andrew Bird\r\n    fix build due to language keyword in strings file got renamed\r\n    improve fixstrs compatibility with gcc-ia16\r\n    multiple build fixes for Linux due to case sensitive filenames\r\n    muttiple fixes to avoid git encoding issues for translations\r\n    slightly improved French translations from @cardpuncher\r\n    fix so fixstrs does not segfault on incorrect input\r\n    add the remaining translations to the CI build\r\n    setup CI build on GitHub using GCC-ia16 and Open Watcom, multiple improvements to CI build\r\n    remove duplicate translation the translation 'yu852' is identical to 'serbian' so remove it\r\n    Update README - convert to Markdown, add build status badge, add links for Changes and Compile text documents\r\n    fixstrs: Avoid sign extension of chars 128..255 - with GCC on Linux, cp850 char 0xa3 '' was being converted as 0xffffffa3, so be explicit about signedness and size of the parameter.\r\n    fixstrs: fix invalid escape chars\r\n    fixstrs: initialise version number, strupr should return the pointer passed in - fixes gcc warnings\r\n    fixstrs: rename log variable - fix declaration mismatch\r\n    build: Copy default file if config missing\r\nFrom lpproj dbcs fork\r\n    add nls fallback, fix for running on DOS kernels that lack the nls API used\r\n    Add build option `upx' to build a compressed execuable\r\n    alias watcom=wc in build script\r\n    Fix chcp report wrong codepage on old DOS before v3.30 (and v3.30 for NEC PC-9800 series)\r\nFrom p-durlej fork\r\n    CLS: Use appropriate attribute values for common display modes.\r\n    DIR: Fix DIR /O /W not putting newline before the summary.\r\n    TYPE: Fix file open error handling\r\n    TYPE: Fix partial read handling\r\n    displayPrompt: prevent $P from being intermixed with INT 24H and phantom drive messages\r\n    DEL: Fix printing the directory path when deleting all files\r\nFrom Jason Pittman\r\n    Fix for multi-line commands in history, properly wrap and clear lines\r\nFrom Bart Oldeman\r\n    Update French translation (corrected some grammatical errors)\r\n    Add some more GCC options to reduce the size of command.com.\r\n    Add comment about MinGW.\r\nFrom Sampo Hippelinen\r\n    better GOTO help translation\r\n    improve/add Finnish translation\r\nFrom Emir Sari\r\n    Fix typo\r\n    Improve Turkish translations - fixes ambiguities and overall improves current translations\r\nFrom Francesco Sacco\r\n    allow internal commands set the ERRORLEVEL\r\n    Minor fixes for pt-br.\r\nFrom ghderty\r\n    Translations: Update russian translation\r\nFrom Darrin M. Gorski\r\n    Allow non-permanent instances to exit with the last errorlevel instead of zero.\r\n\r\nv0.84pre7\r\n~~~~~~~~~\r\nfix: Check for Win64 in Watcom makefile via %ProgramFiles(x86) (Bart)\r\nchg: Build xms-swap by default (Bart)\r\nfix: Use -fno-builtin for GCC to use libc/overridden functions everywhere (Bart)\r\nchg: Use -mregparmcall for GCC. Needs adjustment of intr() prototype\r\n     (still stdcall) (Bart)\r\nchg: Add linker script command.ld so relocations can be used in NASM code\r\n     for GCC via _TEXTSEG. (Bart)\r\nfix: Force 8086-asm; use direct call far real_XMSexec instead of push/push/retf.\r\n     Fixes #15 (Bart)\r\nfix: Move termination hook into seperate file and always use independent of XMS.\r\n     Closes #16 (Bart)\r\nfix: Fix loadhigh failure when zero-byte free memory block is exist\r\n     (Sava, lpproj)\r\nfix: Allow escape of > < | via ^> ^< and ^|. Fixes #12. (Bart)\r\nfix: Fix build break on msys2 (with *-mingw32-gcc and ia16-elf-gcc)\r\n     (Sava,lpproj)\r\nfix: LH/LOADFIX call execute instead of exec and skip bat files. Fixes #8.\r\n     (Bart)\r\nfix: LOADFIX: stop manipulating UMB link, use first fit>0x10000. Fixes #10.\r\n     (Bart)\r\nfix: dosGetUMBLinkState needs to return state in _AL, not _AX (see #10)\r\n     (Bart)\r\nfix: Avoid possible NULL dereference in dprintf. Fixes #9 (Bart)\r\nfix: XMScopy needs to be declared noinline for GCC to work correctly. (Bart)\r\nfix: Fix \"copy con file\" where file already exists. (Bart)\r\n     We need to use devopen instead of dfnstat to check for src existence.\r\nfix: Create and use sfn_creat() for dos_creatnew() redone.\r\n     Also rename dos_creatnew() to sfn_creatnew().\r\n     Using creat instead of creatnew for file creation avoids\r\n     the need for truncation using write(), and the handle can\r\n     be directly used without needing to reopen the file.\r\n     However, differently from the previous try, LFNs are still reopened for\r\n     compatibility with Windows 2000/XP. (Bart)\r\nfix: dos_read and dos_write now call farread/write for all compilers.\r\n     This is more consistent and fixes truncating writes for GCC. (Bart)\r\nfix: Fix lfnmkdir to really create LFNs; easiest to separate out. (Bart)\r\nfix: Don't use expensive open/close to check for SFN.\r\n     Instead use the boolean, then put in extra check to see if\r\n     int21/ax=7160 works. (Bart)\r\nfix: Add stack checking, adapted from Tom Ehlert (Bart)\r\nfix: Save another 520 bytes of stack by reusing buffers where safe. (Bart)\r\nfix: myfnsplit(): use common buffer to store dir/name/ext to save stack space.\r\n     This saves ~1250 bytes of stack and eliminates stack overflows in the\r\n     ke2041 test in metados. (Bart)\r\nchg: Generate 28.com and 50.com from assembly language. (Bart)\r\n\r\nv0.84pre6\r\n~~~~~~~~~\r\nfix: Revert to first-fit dosalloc for copy&dir buffers for non-large model\r\n     (Bart)\r\nfix: Enable reporting of directory sizes up to 2TB (with Tom Ehlert)\r\nfix: dosalloc: apply carry to flag image for intr(), not directly via stc\r\n     The carry flag was not preserved before. (Bart)\r\nfix: Use intr.asm with OW too, to be able to use SZAPC flags on input. (Bart)\r\nchg: Enable cross-compilation from 64-bit Windows using Open Watcom (Bart)\r\nfix: ia16-elf-gcc: intr( ) now loads flags before invoking interrupt (TK Chia)\r\nfix: compilation errors when LFN is disabled. Fixes #5. (Bart)\r\nfix: Allocate a large enough buffer for the rest of the command line.\r\n     We need to use a full buffer for the rest to allow for alias expansion.\r\n     Fixes #6. (Bart)\r\nfix: GCC: make sure that XMS calls get ds:si, otherwise ds can be wrong. (Bart)\r\nfix: OW: Use xmsfunc typedef and apply #pragma aux to that.\r\n     This way XMScopy actually works, and passes the structure in si,\r\n     so messages are copied correctly. Fixes issues with metados. (Bart)\r\nfix: keep asm inputs & clobbers separate in gcc port of dup2 (TK Chia)\r\nfix: ia16-elf-gcc code wrongly assumed XMS driver preserves %bx (TK Chia)\r\nfix: tell OW that bx/cx can be modified, similar to ia16-elf-gcc (Bart)\r\nfix: cmd: shift: use correct context, Fixes SF Bug #155 (Wolfram Sang)\r\nchg: Replace XMSrequest external asm with inline asm for GCC. (Bart)\r\n\r\nv0.84pre5\r\n~~~~~~~~~\r\nadd: Serbian/Yugoslavian for cp852 from freedoslocal (Dejan Strbac)\r\nadd: Slovenian translations from freedoslocal (Matej Horvat)\r\nadd: Turkish translations from freedoslocal.\r\nfix: Update French translations from freedoslocal (Mateusz Viste)\r\nfix: [bugs:#192] FOR %i IN (*.*) do @ECHO %i does not work\r\nfix: [bugs:#209] The shell doesn't display any error if exec fails.\r\n     It will now say \"EXE file corrupt\" if the .exe file has a bogus header.\r\nchg: Reduce ifdef's for GCC, using new ia16-elf-gcc functionality.\r\nchg: Use cglobal and cextern macros in asm files for globals.\r\nfix: Use last-fit dosalloc for copy&dir buffers to work well with large model\r\nfix: Plug memory leak in and around comResFile().\r\nfix: _dos_allocmem takes a pointer to unsigned, not unsigned long.\r\nfix: Wrap dprintf macro into do { ... } while (0);\r\nfix: Use only libc stdio in DEBUG build, not printf from clib.\r\nchg: Remove no longer used tempfile/rmtmpfile.\r\nfix: cgetchar_timed and eliminate its call to fputmc.\r\nchg: Replace fputmc calls by more direct memset/dos_write calls.\r\nfix: non-small (debug) model compilations for Turbo/Borland.\r\nchg: Compile debug version in medium memory model instead of large.\r\nfix: debug version (large model); enable for watcom.\r\nchg: Create and use sfn_creat() and use instead of dos_creatnew()\r\nfix: lfn_creat needs to truncate files that already exist.\r\nfix: hang for batchfiles that do not end with an EOL character.\r\n     This fixes a hang with Rugxulo's metados.img.\r\n\r\nv0.84pre4\r\n~~~~~~~~~\r\nfix: spelling, by Anders Jonsson <anders.jonsson@norsjovallen.se>\r\nfix: Edits to Swedish translation file, by Anders Jonsson\r\nfix: Make echolib.bat compatible with cmd.exe (Tom Ehlert)\r\nfix: Fix build for GCC-compiled load_icd.exe (Bart)\r\nfix: parsefnm failures and cleanup other inline asm for OW and GCC (Bart)\r\nfix: revert change keeping context alwyas on heap (caused out-of-memory) (Bart)\r\nfix: replace use of inline asm lcall/call for GCC with plain C calls (Bart)\r\n\r\nv0.84pre3\r\n~~~~~~~~~\r\nfix: Make sure that ds=ss in XMSexec call (Bart)\r\nThe newest ia16-elf-gcc floats ds inside functions and with the inline\r\nasm doesn't know it's a function call (Bart)\r\nchg: fmemcpy now compiles properly with ia16-elf-gcc (remove workaround) (Bart)\r\nchg: Use GNU Make instead of OW wmake to compile with ia16-elf-gcc (Bart)\r\nchg: Build strings without needing to create/remove the subdirectory (Bart)\r\nchg: Move xmssave and some related variables to near transient data\r\nThis is possible since the resident code no longer references those\r\nBe careful to not write to any transient data after the save to XMS (Bart)\r\nchg: Fix \"TODO make XMSsave two structures in order to drop this subroutine\"\r\n(Bart)\r\nchg: Make XMSexec function near and move 80 resident code bytes to transient\r\nsection. (Bart)\r\nchg: fix xms-swap TODO: first_time either 04ah or 049h --> no jumps (Bart)\r\nchg: xms-swap: move residentCS from cs: to ds: (Bart)\r\nfix: Stack size for OW needs to be 4K instead of default 2K.\r\nThis matches Turbo C's default, and allows for some large stack\r\nusers with LFNs. (Bart)\r\nchg: Reduce heap memory by only keeping the necessary rest of the command line.\r\n(Bart)\r\nchg: Keep the context permanently on the heap via realloc, to reduce\r\nfragmentation. (Bart)\r\nchg: Properly patch the heap size for Open Watcom\r\nThe memory layout for OW is different from Turbo C.\r\nFor Turbo, heap is below stack, but for OW it's the reverse.\r\nHence OW keeps the data segment much more minimal by default.\r\nThere is however a default sbrk increment of 8096 set by\r\n_amblksiz. If we set that to 6K instead the heap will stay\r\nat that size, so TSRs are loaded beyond that point\r\n(for non-XMS-SWAP that is, with XMS-SWAP it's completely\r\ndifferent) (Bart)\r\nchg: getEnv: remove static pointers, caller responsible for free.\r\nEliminating the 3-pointer dance and free-ing the environment\r\nvariable pointer as soon as possible reduces heap fragmentation. (Bart)\r\nfix: Fix farwrite and hence copy for Turbo/GCC (Bart)\r\nfix: \"dir\" output for dates with our own printf. It supports %02u but not %.2u.\r\nThose produce the same result though (Bart)\r\nchg: port to ia16-elf-gcc (Bart)\r\nfix: kswap_p is a _seg * pointer so we need MK_SEG_PTR for compilers without\r\n_seg (Turbo C 2.01, OW). Otherwise the critical error handler is not installed\r\ncorrectly for non-xms-swap builds. (Bart)\r\nchg: Use \"add si, byte 10\" so old and new NASM generate the same opcodes (Bart)\r\nfix: Use proper prototypes on enum{File}Resources callback function (Bart)\r\nchg: allow Linux cross-compilation, port build utils to GCC-Linux (Bart)\r\nfix: Fix ren for files without extensions (passes NULL ptr for ext) (Bart)\r\nfix: Fix LOADHIGH for compilers without _seg pointers. Use FP_SEG\r\ninstead of casting the pointer to unsigned, as _seg is defined to far on\r\ncompilers without _seg (e.g. Watcom) (Bart)\r\nfix: IF EXIST should auto-fail critical errors due to empty drive (Tom & Jeremy)\r\nadd: %CD% as alternative to %_CWD% (Tom)\r\nfix: Use screen height 25 when 0 returned as current height, from Mateusz\r\nViste, bug #131 see http://sourceforge.net/p/freedos/bugs/131/ (Jeremy)\r\nchg: Merged fcompl1 and fcompl2.c to filecomp.c (Bart)\r\nchg: Untangle findfirst/next/close definitions to make them more explicit (Bart)\r\nchg: Consistently use dos_open/dos_close/dos_read/dos_write, etc\r\nThe problem with _open, _read, etc. is that they mean different things\r\nto Turbo than for OW: Turbo _open is like _dos_open but OW _open is an\r\nalias for open (Bart)\r\nchg: Eliminate open() in favor of _open/_creat/dos_creatnew (Bart)\r\nchg: Eliminate fgets(), replacing with _read() (Bart)\r\nchg: Use backspaces instead of gotoxy calls to clear a command line (Bart)\r\nchg: Use _write for all printf style writes in prf.c and for putc(har).\r\nRemove fflush and setbuf calls (Bart)\r\nchg: Eliminate fputs everywhere except for prf.c (Bart)\r\nchg: Eliminate read() by using _read() everywhere (Bart)\r\nchg: Remove references to fopen / fcloseall for non-debug builds (Bart)\r\nchg: Use open/read/close instead of fopen/fread/fclose everywhere (Bart)\r\nfix: EnumFileResources function arguments to all use handles instead of\r\nstreams (Bart)\r\nfix: Fix loadModule: it should use an int fd for a handle instead of a FILE *.\r\n(Bart)\r\nchg: replaced all text mode write()s by binary _write()s to save RTL usage\r\nspace (Bart)\r\nchg: farread/farwrite cleanup of DOS r/w's (Bart)\r\nchg: Use handle I/O instead of stream I/O for resources to save space (Bart)\r\nchg: Change geninterrupt emulation to use intr() instead of int86x() for\r\nconsistency (Bart)\r\nchg: Centralize LFN functions for mkdir/rmdir/chdir (Bart)\r\nfix: Support precision flag and size/precision from argument list in abbreviated\r\nprintf function, to fix \"dir /lfn\" (Bart)\r\nfix: Don't truncate when not necessary for LFN opens. Works around an FD kernel\r\nbug were truncating a 0-byte file caused an error (Bart).\r\nfix: \"copy con file\" (Bart)\r\nfix: COPY: trailing /a and /b options only apply to the last (destination)\r\nfile, not globally, when concatenating, \"/a\" is the default. (Bart)\r\nchg: Replace stream i/o for COPY by simpler handle i/o, so fileno doesn't need\r\nto be used all the time.  (Bart)\r\nchg: Use BIGcopy() for both ascii and binary copies. ASCII just means to check\r\nfor Ctrl-Z, don't mess with line endings, so do that manually using fmemchr.\r\nWhen eof is detected, no more reads are needed. (Bart)\r\nfix: COPY: The /B switch should switch devices to raw mode (see nansi.sys\r\ndocumentation). Fix errors given for \"copy [/a|/b] file.txt con\".  (Bart)\r\nchg: Use small printf() from the kernel source with a few modifications to do\r\nsome buffering. Saves 3.5K in RTL code for OW. (Bart)\r\nfix: exit() needs to be overriden for OpenWatcom as well as Turbo C. (Bart)\r\nfix: Fix direct _seg pointer casts for Open Watcom (and also Turbo C 2.01)(Bart)\r\nfix: Fix size of LFN in struct locffblk, and make sure the ffblk structs are\r\npacked (Bart)\r\nfix: Fix devopen in OW using stdarg.h and proper prototypes (Bart)\r\nfix: Fix xms-swap for Open Watcom (Bart)\r\nfix: Set stdout to unbuffered for Watcom as it is by default for Turbo C (Bart)\r\nfix: Use stdarg.h to avoid messing with prototypes in, and fixing Open Watcom'\r\nuse of env_replace (Bart)\r\nfix: Update build system to support Open Watcom. Introduce config.b/config.bat\r\nlike in the kernel source to be able to configure make/wmake locations (Bart)\r\nfix: ISR/dir.h/stpcpy/string/?etverify/parsfnm related changes for OW\r\ncompatibility (Bart)\r\nchg: Use IREGS/intrpt instead of struct REGPACK/intr everywhere for OW\r\ncompatibility. Similarly, USEREGS simulates geninterrupt (Bart)\r\nfix: Avoid Turbo C specific use of sizeof in preprocessor expressions (Bart)\r\nfix: Adjust makefiles to be compatible with TC 2.01's very limited MAKE utility\r\n(no redirection) (Bart)\r\nfix: Fix compiler warnings (Bart)\r\nchg: Handle .obj dependencies for suppl instead of rebuilding every time (Bart)\r\nchg: Prune unused files from stripped-down suppl (Bart)\r\nchg: Remove duplicate .h files from suppl source (Bart)\r\nfix: Do not compare (signed) to ' ' but use iscntrl() - otherwise,\r\nFIXSTRS may chop trailing non-ASCII (eg Russian) words away (Eric Auer).\r\nfix: Fixed compilation completely with Turbo C (Blair).\r\nfix: Got rid of all '//' comments (Blair)\r\nfix: Support for BC (Blair)\r\nfix: Fix for compiler oddities (Arkady).\r\nfix: Fixed bug in Truename (Blair).\r\nfix: Print long filename current directory (Blair).\r\nfix: Use safer intr routine rather than directly modify registers (Blair).\r\nfix: Moved lfnsup to a place where it will not be overwritten (Blair).\r\nadd: Add option to compile to support switch character instead of hardcoded '/'\r\n(Blair)\r\nadd: The new SET /E feature. (Blair)\r\nfix: Fixed long filename handling in DIR. (Blair)\r\nfix: COPY uses static-size buffers now to prevent known problems with dynamic\r\nallocation. (Blair)\r\nfix: Improved PATH handling routine (Arkady).\r\nfix: Fixed (hopefully) bug in %PATH% parsing routing and A:/B: random accessing bug (Blair).\r\nfix: Fixed bug where a directory could be found in %PATH% parsing (Blair).\r\nchg: Added Polish translation, updated French&Italian translation (Blair).\r\nchg: Made RD/MD/CD more buggy-lfn-implementation friendly (Blair).\r\nchg: Removed usage of CLIB perror function and reduced executable size by nearly\r\n1 kb.  Since perror was only used in ren and del, and only two possible errnos\r\nexist, the function can be minimized, and also as an added advantage, the\r\nerrors that were printed can now be translated (Blair).\r\n\r\nv0.84pre2\r\n~~~~~~~~~\r\nadd: exec sets CMDLINE if command-line is longer than 125 characters; if setting CMDLINE fails, so does exec. (All DJGPP-compiled apps and various others support CMDLINE for passing parameters)\r\nchg: Size optimizations\r\nchg: CONIO dependencies removed - smaller size\r\nchg: VER /R now prints the FreeDOS version string\r\nchg: SET VAR can display %VAR% instead of syntax error\r\nchg: Remove version strings\r\nfix: COPY now checks for existance of source file before asking to overwrite destination\r\nadd: ukr.lng: Ukrainian translated messages\r\nadd: default.lng: LFNFOR messages\r\nadd: LFN support for REN, COPY, IF EXIST, DEL, FOR (LFNFOR), MKDIR, CHDIR, RMDIR, TYPE, TRUENAME, filename completion (LFNFOR COMPLETE), command execution, and redirection; set LFN=n to disable\r\nchg: DIR/LFN: now displays lfn for all files that return one\r\nfix: IF: /I option parsing interfered with /whatever tests\r\nfix: DIR: divide by 0 {TE, Eric, & Mark Bailey}\r\n\r\nv0.84pre:\r\n~~~~~~~~~\r\nfix: DIR/VOL: bug#1809, volume label missing spaces {KJD}\r\nfix: VOL: syntax error if extra whitespace after drive {KJD}\r\nadd: CDD: if given path to a valid filename, ignore filename portion instead of error\r\nadd: SET /U: indicate that the value will be stored in env var in UPPERCASE\r\nadd: DIR: bug#1889, added limited 4DOS DESCRIPT.ION file support {KJD}\r\nadd: IF: /I option for case insensitive comparisons, if /I \"Aa\"==\"aA\" echo is true\r\nfix: IF: bug#1885, fix if exists on system/hidden files {Erwin Veermans}\r\nfix: LH: fix wrong errorlevel returned when program goes resident {KJD}\r\nfix: default.lng: typos and misc corrections {Bernd Blaauw}\r\nfix: swedish.lng & swedish.err so correctly builds\r\nadd: /Z: lib\\dispexit.c missing, added new implementation {KJD}\r\nadd: /Z: Display exit code after external command {Bernd Blaauw}\r\nfix: LH: Errorlevel of program effects LH's error reporting {Eric Auer}\r\nchg: BUILD.BAT: Removed CONFIG.MAK and add the warning concering CONFIG.STD\r\nfix: CONFIG.MAK: changes of CONFIG.MAK propagate to all make's \r\nchg: SUPPL: integrate a stripoped down variant of SUPPL into CVS {Tom Ehlert} [#1794]\r\nadd: CRITER: Repeat check autofail magic {Tom Ehlert/Eric Auer}\r\nfix: CLS: cut debug message\r\nadd: DIR: display LFNs if enabled with /lfn [Tom Ehlert]\r\nadd: DIR: display FAT32 free space on drive [Tom Ehlert]\r\nchg: res_r.c: don't use relative seek; fails under NTFSdos [Tom Ehlert]\r\nchg: doc DIR: note about how many entries can be sorted with /O [Eric Auer]\r\nbugfix: DIR: /b don't append spurios spaces {fd-doc#226}\r\nbugfix: use of the nls thousands separator in convert() [Eduardo Casino]\r\nadd: ITALIAN.ERR {Roberto Mariottini}\r\nbugfix: CHCP: use n to set new codepage [Eduardo Casino]\r\nadd: cmdinput.c: Ctrl-Left & Ctrl-Right [Tom Ehlert]\r\nfix: xms-swap.mak: dependencies [Tom Ehlert]\r\nchg: init.c: Don't displays command on startup [Tom Ehlert] {common request}\r\nbugfix: init.c: invalid empty MSDOS environment [Tom Ehlert]\r\nfix: appendDisable(): should disable APPEND [Eduardo Casino]\r\nfix: /LOW option\r\nupd: ITALIAN.LNG {Roberto Mariottini}\r\nfix: help screen of internal commands causes \"Unknown command error\" {Bernd Blaauw}\r\nchg: REN: disable APPEND.EXE {Eduardo Casino}\r\nfix: DIR: disable APPEND.EXE during DIR processing {Eduardo Casino}\r\nbugfix: CLS: use BIOS, unless fd1 is file or NUL {Eric Auer}\r\nadd: config.h: MUX_AE_MAX_REPEAT_CALL\r\nbugfix: MUX-AE: useage of DS:[SI] {Eduardo Casino}\r\nbugfix: COPY C: D: heap corruption [#556] {Tom Ehlert}\r\nfix: PROMPT $V: include FreeCOM version information [#1776]\r\nfix: docu: typo and mailing list [#1774]\r\nfix: docu: mailing list at topica {Arkady V.Belousov}\r\nupd: german.lng [Eric Auer]\r\nbugfix: argv[1] and no ComPath stuff [#1761]\r\nfix: typo\r\nupd: documentation: batch processing, Bugzilla\r\nbugfix: documentation of wildcards [#1727]\r\nfix: get_redirection(): double comment mark /* {Arkady V.Belousov}\r\nbugfix: get_redirection(): apostrophe used as quote\r\nbugfix: readcommandline(): spurious \\n after commands [#1721]\r\nbugfix: readbatchline(): permit @ before labels [#1747]\r\nbugfix: onoffStr(): do not ignore leading argument delimiters [#1736]\r\nadd/upd: CVS $id$ keywords to/of files\r\nbugfix: misidentifying unspecific failures from within SUPPL [#1616]\r\n\r\nv0.83 Beta 56:\r\n~~~~~~~~~~~~~~\r\nadd: DIR: /O (single sort order) {Tom Ehlert}\r\nbugfix: CONFIG.H: enabled CHCP by default\r\nfix: typos\r\nbugfix: cached NLS data not flushed\r\nfix: DIR: correct attribute behaviour, no + syntax {Tom Ehlert}\r\nfix: DIR /A-S need to default to attrMay == any\r\nfix: DIR: bailing out if boolean switches found with /A\r\nfix: DIR /S: if not found a single item, display error\r\nadd: SET /P {based on luojiuming}\r\nbugfix: removed /V from CMDHELP_DIR\r\nadd: DIR /A*** (selected attributes) {based on patch from Michael Devore}\r\n\r\nv0.83 Beta 54:\r\n~~~~~~~~~~~~~~\r\nbugfix: prevent from executing non-*.bat/com/exe files [part 1) BugID #966]\r\nbugfix: calling an external program: preserve leading spaces [BugID #752]\r\nbugfix: ECHO: preserve leading spaces [BugID #1081]\r\n\r\nv0.83 Beta 52:\r\n~~~~~~~~~~~~~~\r\nadd: CHCP (disabled by default)\r\nbugfix: COPY: additional output to honor redirection {Eric Auer} [bugID #1313]\r\nbugfix: onOffStr(): zaps trailing argument delimiters, e.g. ECHO set=\r\nadd: save/restore session (swap context) {Tom Ehlert}\r\nbugfix: CTTY CON -> missing CR's {Eric Auer} [bugID #1441]\r\n\r\nv0.83 Beta 50:\r\n~~~~~~~~~~~~~~\r\nbugfix: /?: found on all the command line\r\nfix: %0 to return batchfilename as typed on cmd line (bug: maybe upcased)\r\nchg: enumResources(): handle fnam == 0 (file open error)\r\nbugfix: FreeCOM should accept relative path as argv[0]\r\nbugfix: FreeCOM is to pass the fully-qualified path to DOS-4B-00\r\nbugfix: use %1 (and assoc) in FOR commands (activeBatchContext())\r\nadd: auto-vars ERRORLEVEL and _CWD (current working directory)\r\nbugfix: removed %? because of incompatibly with existing scripts\r\nbugfix: none-working LOADFIX {Tom Ehlert}\r\nbugfix: XMS-Swap/LOADHIGH: crashes {Tom Ehlert}\r\n\r\nv0.83 Beta 48:\r\n~~~~~~~~~~~~~~\r\nbugfix: XMS-Swap/LOADHIGH: wrongly calculated UMBs if loaded into UMB {Tom Ehlert}\r\nfix: expand environment variables within FOR ()'s (utter hack, to be replaced)\r\nchg: do not strip control characters from command line\r\nbugfix: FOR: If a pattern fails to match, --> ignore {Tom Ehlert}\r\nbugfix: FOR and redirection [BugID #1050, #708, #1041]\r\nchg: documentary about new build process, build48.html\r\nadd: DUTCH.LNG {Bernd Blaauw}\r\nchg: BUILD.BAT: To display %LNG% at XMS-Swap remark\r\nadd: to use on a cdrom to create localized versions {Bernd Blaauw}\r\nfix: COMMAND.COM /P/C cmd: hangs in endless loop, should become interactive\r\nbugfix: CONFIG.MAK: default location of SUPPL\r\nfix: IF ERRORLEVEL non-numeric hack (H? / x?) {Tom Ehlert} [Bug #1066]\r\nadd: pt/BR Strings {Max M. Velasques}\r\n\r\nv0.83 Beta 46:\r\n~~~~~~~~~~~~~~\r\nadd: COPY: keep file time if not appending\r\nchg: upload.txt: update options of DIFF utility\r\nbugfix: documentation: link to ftp://sourceforge\r\nbugfix: shell\\batch.c: incorrect dfn.h path\r\n\r\nv0.83 Beta 44:\r\n~~~~~~~~~~~~~~\r\nupd: documented bug of 16bit NASM version 0.98.34 compiled on Jun 17 2002\r\n\r\nv0.83 Beta 42:\r\n~~~~~~~~~~~~~~\r\nadd: feature ENVIRONMENT_KEEP_FREE\r\nbugfix: DOS memory corruption by bad struct MCB declaration\r\n\r\nv0.83 Beta 40:\r\n~~~~~~~~~~~~~~\r\nbugfix: ^Break detection after XMS-Swapping\r\n\r\nv0.83 Beta 38:\r\n~~~~~~~~~~~~~~\r\nchg: cswap.asm: make local stack 256 (as RBIL suggests)\r\nbugfix: cswap.asm: make local stack 200 bytes to let MS NET work (Tom Ehlert)\r\nchg: init.c: removed warning about non-used arguments\r\nbug: config.h: re-enabled LOADHIGH/FIX\r\nchg: BUILD.BAT to handle XMS-Swap better\r\nbugfix: CTTY: added to try to set the device flags\r\nbugfix: LOADHIGH: disable swapping when executing\r\nbugfix: init.c: /p:arg ignores argument\r\nadd: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\nchg: COPY: appFile unneccessarily declared FAR (Tom Ehlert)\r\nbugfix: cmdinput.c: histGet(,str,maxlen) (Tom Ehlert)\r\nbugfix: mux_ae.h: #ifdef --> #if (Tom Ehlert)\r\nbugfix: day/month read from ff_time reversed (John Price)\r\nbugfix: IF lower==LOWER bug; MS COMMAND compares case-sensitively\r\nfix: Several typos in documentation\r\n\r\n2003/03/09 Tom Ehlert\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nadd: DIR /A** and /O***\r\n\r\n2002/10/16 Alain\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nadd: COPY: keep file time\r\n\r\n2002/04/02 Tom Ehlert\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nadd: XMS-Only Swap feature (FEATURE_XMS_SWAP)\r\n\r\n2002/03/31 ska\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nchg: COPY: appFile unneccessarily declared FAR (Tom Ehlert)\r\nbugfix: cmdinput.c: histGet(,str,maxlen) (Tom Ehlert)\r\nbugfix: mux_ae.h: #ifdef --> #if (Tom Ehlert)\r\nbugfix: day/month read from ff_time reversed (John Price)\r\nbugfix: IF lower==LOWER bug; MS COMMAND compares case-sensitively\r\nfix: Several typos in documentation\r\n\r\nv0.83 Beta 32:\r\n~~~~~~~~~~~~~~\r\nbugfix: if FREECOM.COM /P without AUTOEXEC.BAT --> assert() failure.\r\nadd: if DEBUG enabled: internal command EXIT!! that ignores /P\r\nchg: FEATURE_BOOT_KEYS: mandory boot keys (F5/F8) turned into\r\n\toptional compile-time option; disabled by default now as the\r\n\tkernel provides F5/F8 checking\r\nchg: some document updates\r\n\r\nv0.83 Beta 30:\r\n~~~~~~~~~~~~~~\r\nadd: SET /I: To display the size and unused area in env segm\r\n\t(about 700 bytes increase of image; WILL BE REMOVED WITH NEXT\r\n\t STABLE RELEASE)\r\nbugfix: INIT.C/COMMAND.C: in MS DOS environment no program\r\n\texpects that the string area of an environment is used and is\r\n\ttherefore killed. FreeCOM now zeroes the string counter\r\n\tin order to let SUPPL work correctly.\r\n\tWarning: Known Bug: Now test is made, if the two bytes for the\r\n\tcounter is not available, thus, the env_nullStrings() function\r\n\tfails.\r\nbugfix: INIT.C: negated test for FreeDOS's build >= 2025\r\n\r\nv0.83 Beta 28:\r\n~~~~~~~~~~~~~~\r\nbugfix: scancmd.c: /B and /A let COPY fail (ec == E_Ignore) (bug 829)\r\nupd: HTML section\r\n\r\nv0.83 Beta 25:\r\n~~~~~~~~~~~~~~\r\nbugfix: pre-compiled package BINARY.ZIP without command-line editing\r\nchg: FreeCOM archive (== executable) is opened read-only.\r\n\r\nv0.83 Beta 21:\r\n~~~~~~~~~~~~~~\r\nbugfix: process_input(): iscntrl() does not advance ip\r\npossible bugfix: force to default to _unsigned_ char as built-in\r\n\t<ctype.h> macros do not work with signed char > 127\r\n\r\nv0.83 Beta 15:\r\n~~~~~~~~~~~~~~\r\nbugfix: expalias: if malloc() fails, random expanded is free'ed\r\nbugfix: nls_maketime(): 12hour display does not free AM/PM id\r\nfix: dbg_printmem() if compiled in Large memory model, near is invalid\r\n\r\n2001/06/11 ska\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nfix: dbg_printmem() if compiled in Large memory model, near is invalid\r\n\r\n2001/06/11 ska\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nrelease of v0.83 Beta 14:\r\nadd: ALIAS HTML documentation\r\nbugfix: MEMORY displays batch nesting level, although, not implemented, yet\r\n\r\n2001/06/10 ska\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nbugfix: Single point of configuration CONFIG.MAK/.H:\r\n\tCONFIG.MAK <-> Compiler specific settings, paths etc.\r\n\tCONFIG.H <-> FreeCOM releated settings, included commands etc.\r\nbugfix: DEFAULT strings for COMMAND /?, WHICH /?, DOSKEY /?, DIR /? (/A & /O)\r\nadd: error message if debugging when to open the resource file failed\r\nbugfix: links in FreeCOM.html & typos in commands database\r\nadd: check for low memory during init() when debugging\r\nbugfix: TYPE: first argument only\r\nbugfix: DATE: does not accept empty line\r\nbugfix: >>PATH<< with empty %PATH% --> PATH=(null)\r\nfix: BREAK/VERIFY ignore trailing spaces\r\nfix: >>PATH ;<< remove PATH environment variable\r\nfix: cache 3 environment variables to overcome nested useage (e.g. when\r\n\tloading message segment to print environment variable)\r\nbugfix: keep trailing spaces of command line\r\n\r\nv0.83 Beta 14:\r\n~~~~~~~~~~~~~~\r\nadd: ALIAS HTML documentation\r\nbugfix: MEMORY displays batch nesting level, although, not implemented, yet\r\nbugfix: Single point of configuration CONFIG.MAK/.H:\r\n\tCONFIG.MAK <-> Compiler specific settings, paths etc.\r\n\tCONFIG.H <-> FreeCOM releated settings, included commands etc.\r\nbugfix: DEFAULT strings for COMMAND /?, WHICH /?, DOSKEY /?, DIR /? (/A & /O)\r\nadd: error message if debugging when to open the resource file failed\r\nbugfix: links in FreeCOM.html & typos in commands database\r\nadd: check for low memory during init() when debugging\r\nbugfix: TYPE: first argument only\r\nbugfix: DATE: does not accept empty line\r\nbugfix: >>PATH<< with empty %PATH% --> PATH=(null)\r\nfix: BREAK/VERIFY ignore trailing spaces\r\nfix: >>PATH ;<< remove PATH environment variable\r\nfix: cache 3 environment variables to overcome nested useage (e.g. when\r\n\tloading message segment to print environment variable)\r\nbugfix: keep trailing spaces of command line\r\nchg: default heap size (tools\\ptchsize) set to 6KB\r\nchg: error displaying functions centralized into lib\\err_fcts.src\r\nadd: displayError() \r\nchg: all errors are displayed through functions void error_*()\r\nbugfix: somtimes error messages are not displayed (see displayError())\r\nbugfix: docommand(): type:file must pass \":file\" to TYPE\r\nbugfix: error_sfile(): string _SFILE_\r\nbugfix: error message on empty redirection\r\nbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\tof internal commands\r\nfix: config.mak: missing libpath & \"-d\" causes crashes\r\nfix: cmdinput.c: first histGet() is not #if'ed\r\nchg: new directory structure\r\nchg: If DEBUG enabled, no available commands are displayed on startup\r\nfix: PTCHSIZE also patches min extra size to force to have this amount\r\n   of memory available on start\r\nbugfix: CALL doesn't reset options\r\nadd: PTCHSIZE to patch heap size\r\nadd: VSPAWN, /SWAP switch, .SWP resource handling\r\nbugfix: COMMAND.COM A:\\\r\nbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\nadd: command MEMORY\r\nbugfix: runExtension(): destroys command[-2]\r\nadd: clean.bat\r\nadd: localized CRITER strings\r\nchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\tvia STRINGS.LIB\r\nadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\nadd: fixstrs.c: prompts & symbolic keys\r\nadd: fixstrs.c: backslash escape sequences\r\nadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\nchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\nbugfix: IF is now using error system & STRINGS to report errors\r\nadd: CALL: /N\r\nbugfix: mktempfile(): if realloc() fails, fn is not deallocated\r\nbugfix: showcmds(): always display all implemented (though possibly not\r\n\tavailable) features\r\nfix: criter.asm: DEBUG does no longer compile to .COM (for consistency)\r\nchg: removed all NULLs to prevent NULL problematic, functions must be\r\n\tused fully prototyped now\r\n\r\nv0.82 pl 3:\r\n~~~~~~~~~~~\r\nbugfix: Ask for FreeCOM location when STRINGS are missing [#687]\r\nbugfix: INIT: FreeCOM-path and TTY can be in any order\r\nchg: SCRIPTS\\MAKECMD.BAT: replaces MAKE_LNG.BAT, make localized FreeCOMs\r\nadd: SCRIPTS\\MAKE_LNG.BAT: Make language-specific FreeCOM from *.LNG files {Bernd Blaauw}\r\nadd: SPANISH.LNG/ERR {Aitor Santamara Merino}\r\nadd: copy.c: BIGcopy() - large buffer r/w copy {Tom Ehlert}\r\nadd: total update/rewrite GERMAN.LNG {Clemens Lser}\r\nbugfix: FIXSTRS: TEXT_CMDHELP_FOR: Invalid warning for %v {Bernd Blaauw}\r\nbugfix: CRITERR: to use DOS API {Tom Ehlert/Bart Oldeman}\r\nbugfix: LOADHIGH: deallocating context if /L is present {Tom Ehlert}\r\nfix: set.c: warning missing prototype strchr()\r\nbugfix: /F (AutoFail) for the XMS_Swap variant\r\nbugfix: COPY * X: re-linked to correct SUPPL version\r\nfix: typos [#1694,#1696,#1695]\r\nadd: FOR/?: example [#1679]\r\nbugfix: typo: bad varable specification [#1678]\r\nfix: copy(): replace chsize() to not fill with '\\0's {Tom Ehlert}\r\nadd: copy(): Speed-Up by pre-creating the file {Tom Ehlert}\r\nbugfix: BATCH.C: extract of label name failed due to macro {Tom Ehlert}\r\nadd: Serbian CP437 LNG/ERR files {Dejan Strbac}\r\nadd: Swedish CP850 LNG/ERR files {Oscar Molin}\r\n\r\nv0.82 pl 2:\r\n~~~~~~~~~~~\r\nchg: Prevent double-parsing of redirection in CALL and IF\r\nchg: updated FreeCOM implementation status doc\r\nadd: documentation for Benny levels, IF and TESTS\\BENNY.BAT\r\nbugfix: FREECOM.COM /?: is to terminate unless /P is present [Andrew Sly]\r\nbugfix: Cleanup HTML docs to pass W3C validation\r\nfix: typo in HISTORY /? {Andrew Sly}\r\nchg: wilcard matching: COPY/REN *.TXT ???b.*: If length of source filename\r\n\tis less than 3, the superflous question marks are ignored, as in MS\r\n\tCOMMAND v6.22 COPY, but INCOMPATIBLE to same version's REN, which\r\n\tembeds spaces\r\nbugfix: CRITSTRS: hexa-decimal (%&??) interpretation {Strbac Dejan}\r\nupd: STRINGS\\DUTCH.LNG {Bernd Blaauw}\r\nbugfix: CVS problem regarding strings\\dutch.lng\r\nadd: Russian/CP866 language file {Sandul}\r\nbugfix: dfnstat(): Use DOS-44-09 for \"X:\" {Bart Oldeman}\r\nfix: memory leak (newname) in REN\r\nadd: MS COMMAND-style wildcards for REN {Wolf Bergenheim}\r\nadd: Serbian language files {Strbac Dejan}\r\n\r\nv0.82 pl 1:\r\n~~~~~~~~~~~\r\nchg: Version number scheme: all v0.83 Beta <<even number>> really are\r\n\tpredecessors of v0.82 pl 1\r\nfix: DIR: /O default sort order\r\nadd: DEL: /V option [#1587]\r\nchg: tracemode: print prompt prior command [#1487]\r\nadd: CALL /Y: To enable tracemode during command\r\nbugfix: PROMPT $T: hour: space padded; fraction zero padded [#1481]\r\nbugfix: command line scanner: must accept ' and ` as filename characters\r\n\thence dropping them as quote character [#1244]\r\nbugfix: DIR: /4 synonym for /Y [#937]\r\nbugfix: COPY: remove created files on error [#756]\r\nfix: COPY: broken wildcarded source pattern\r\nadd: COPY: colon'ed device names on command line, e.g. COPY CON: file [#225]\r\nfix: COPY: con: is misinterpreted as C:\r\nfix: DIR: /O: endless loop /OU; ignored /OG; /OE: return 0 if no extension\r\nadd: DIR: /O: multiple /O** conditions {Tom Ehlert}\r\nbugfix: COPY: process directories as if \"*.*\" were appended\r\nbugfix: split(): out-of-mem condition during building argument array\r\n\r\nv0.81 beta 1:\r\n~~~~~~~~~~~~~\r\nbugfix: _fstrchr() doesnot find '\\0'\r\nbugfix: NULL problematic\r\n\r\nv0.81 beta 0:\r\n~~~~~~~~~~~~~\r\nbugfix: \"copy 1 + 2 + 3 target\" copies first & last file only\r\nadd: interactive command flag\r\nadd: FDDEBUG may redirect output into file\r\nbugfix: STRINGS resource length value counts 1. string twice\r\nsub: enumResources() won't check secondary files no longer\r\nfix: MKTOOLS must include $(CFG) into list\r\nadd: command WHICH\r\nfix: BUILD.BAT and accompanying makefiles for TC++ v1.01\r\nbugfix: if ENHANCED_INPUT && !HISTORY, CurRight falls through to CurLeft\r\nbugfix: CB_CATCH: In DEBUG mode: recursive test fails always\r\nbugfix: KSSF: restore parentPSP on exit\r\nchg: using STRINGS resource for all non-interactive messages\r\nchg: moved all assembly files to NASM\r\n\r\nv0.80b\r\n~~~~~~\r\nadd: DIR /Y to display 4digit year\r\nfix: DIR displays \"bytes free\" at the very end, but if more than one\r\n\targument is specified, it only displays the free bytes of the\r\n\tvery last argument. The line is now printed after the display\r\n\tof each argument.\r\nbugfix: When the \"bytes free\" are displayed the used drive letter\r\n\thad been deallocated already.\r\nadd: NLS-compatible input of date\r\nadd: NLS-compatible display of date & time (incl DIR)\r\nfix: parse years 80..199 as century 1900 (by Arkady)\r\nchg: removed some static variables\r\nchg: made all global functions & variables static to LOADHIGH.C\r\nsub: LH.ASM/LOADHIGH.C: duplicate functions (memory API, farmemcmp)\r\nfix: doc of DATE, TIME, FreeCOM\r\n\r\nv0.80a\r\n~~~~~~\r\nchg: two-digit year -> 2000 if less than 80\r\nadd: DATE /D and TIME /T\r\n\r\nv0.80:\r\n~~~~~~\r\nchg: canexit disabled by default, allowed within initialize() \r\nchg: command table uppercased as Installable Commands use uppercased names\r\nadd: installable COMMAND extensions FEATURE_EXTENSIONS\r\nadd: F1, F3, F5, cur-right\r\nadd: French Strings file\r\nadd: German Strings file\r\nadd: useage of %COPYCMD%\r\n\r\nv0.79d2:\r\n~~~~~~~~~\r\nbugfix: \"CD.\" and analogeous commands\r\n\r\nv0.79d1:\r\n~~~~~~~~~\r\nadd: FEATURE_ENHANCED_INPUT and it's non-defined variant\r\nbugfix: \"%1\" could writer behind end of string\r\nbugfix: check of length of external command line was considered too long\r\nchg: moved check for length of external command line in order to let\r\n\tbatch files use the internal length\r\n\r\nv0.79d:\r\n~~~~~~~~\r\nbugfix: \"line too long\" error if last line of batch files has no newline\r\nbugfix: root path not recognized, e.g. in \"C:\\PATH> \\program\"\r\n\r\n2001/04/31 ska\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nchg: default heap size (tools\\ptchsize) set to 6KB\r\nchg: error displaying functions centralized into lib\\err_fcts.src\r\nadd: displayError() \r\nchg: all errors are displayed through functions void error_*()\r\nbugfix: somtimes error messages are not displayed (see displayError())\r\nbugfix: docommand(): type:file must pass \":file\" to TYPE\r\nbugfix: error_sfile(): string _SFILE_\r\nbugfix: error message on empty redirection\r\nbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\tof internal commands\r\nfix: config.mak: missing libpath & \"-d\" causes crashes\r\nfix: cmdinput.c: first histGet() is not #if'ed\r\nchg: new directory structure\r\nchg: If DEBUG enabled, no available commands are displayed on startup\r\nfix: PTCHSIZE also patches min extra size to force to have this amount\r\n   of memory available on start\r\nbugfix: CALL doesn't reset options\r\nadd: PTCHSIZE to patch heap size\r\nadd: VSPAWN, /SWAP switch, .SWP resource handling\r\nbugfix: COMMAND.COM A:\\\r\nbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\nadd: command MEMORY\r\nbugfix: runExtension(): destroys command[-2]\r\nadd: clean.bat\r\nadd: localized CRITER strings\r\nchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\tvia STRINGS.LIB\r\nadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\nadd: fixstrs.c: prompts & symbolic keys\r\nadd: fixstrs.c: backslash escape sequences\r\nadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\nchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\nbugfix: IF is now using error system & STRINGS to report errors\r\nadd: CALL: /N\r\nbugfix: mktempfile(): if realloc() fails, fn is not deallocated\r\nbugfix: showcmds(): always display all implemented (though possibly not\r\n\tavailable) features\r\nfix: criter.asm: DEBUG does no longer compile to .COM (for consistency)\r\nchg: removed all NULLs to prevent NULL problematic, functions must be\r\n\tused fully prototyped now\r\n\r\n2001/02/27 ska\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nfix: criter.asm: DEBUG does no longer compile to .COM (for consistency)\r\nchg: removed all NULLs to prevent NULL problematic, functions must be\r\n\tused fully prototyped now\r\n\r\n2001/02/20 ska\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nrelease v0.81 beta 1\r\nbugfix: _fstrchr() doesnot find '\\0'\r\nbugfix: NULL problematic\r\n\r\n2001/02/16 ska\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nbugfix: \"copy 1 + 2 + 3 target\" copies first & last file only\r\nadd: interactive command flag\r\nadd: FDDEBUG: redirect output into file\r\nadd: command WHICH\r\nchg: moved all assembly sources to NASM\r\nchg: using STRINGS resources for all non-interactive strings\r\nbugfix: if ENHANCED_INPUT && !HISTORY, CurRight falls through to CurLeft\r\nbugfix: CB_CATCH: In DEBUG mode: recursive test fails always\r\nbugfix: KSSF: restore parentPSP on exit\r\n\r\n2001/02/14 ska\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nfix: parse years 80..199 as century 1900 (by Arkady)\r\nchg: removed some static variables\r\nchg: made all global functions & variables static to LOADHIGH.C\r\nsub: LH.ASM/LOADHIGH.C: duplicate functions (memory API, farmemcmp)\r\nfix: doc of DATE, TIME, FreeCOM\r\n\r\n2001/02/08 ska\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nchg: two-digit year -> 2000 if less than 80\r\nadd: DATE /D and TIME /T\r\n\r\n2000/12/13 ska\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nreleased v0.80\r\n\r\n2000/12/10 ska\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nadd: Installable Commands interface (MUX_AE.*) FEATURE_INSTALLABLE_COMMANDS\r\nchg: F3 == complete string\r\nadd: cur-right at end of string == F1\r\nfix: F5 removes cursor sometimes\r\n\r\n2000/11/28 (Owen Rudge <orudge@freeuk.com>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\n- Added support for F1, F3 and F5, as in MS COMMAND.COM\r\n\tF1 = Insert next character from last buffer\r\n\tF3 = Complete string (NOTE: in this version, replaces string)\r\n\tF5 = Places current string in buffer, moves to next line\r\n\r\n2002/10/09 Michael Kjrling <michael@kjorling.com>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nbugfix: directory commands now support periods without leading space\r\n\r\n2000/09/26 ska <ska-src@gmx.net>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nbugfix: \"%1\" expansion could overwrite end of string\r\nbugfix: length of external command line was assumed too long\r\nchg: moved check of length of ext cmdline before exec() in order\r\n\tto allow batch files use the internal length\r\n\r\n2000/08/15 ska <ska-src@gmx.net>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nchg: layout of CVS:\r\n\t+ removed all pre-compiled files but COMMAND.COM for English\r\n\t+ pre-compiled files can be downloaded from\r\n\t\tftp://freedos.sourceforge.net/pub/freedos/freecom/\r\n\t\tSee DOWNLOAD.TXT\r\n\t+ created a \"localizer\" package\r\nadd: FIXSTRS.EXE now creates a third file STRINGS.LOG to help\r\n\tto localize the strings; see DOCS\\LOCALIZE.TXT\r\n\r\n2000/08/15 Ron Cemer\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nbugfix: Piping, when the tempfile is opened for read-only access for the\r\n\t2nd command it's still opened for write-only for the 1st one.\r\n\tThis may fail, see DOCS\\PIPING.TXT\r\n\r\n2000/07/24 Ron Cemer\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nfix: COPY\r\nfix: environment handling\r\n\r\n2000/07/10 Ron Cemer\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nbugfix: for DIR /S\r\nfix: COPY (started)\r\n\r\n2000/07/10 ska <ska-src@gmx.net>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nchg: To support to change the STRINGS.DAT file without recompiling\r\n\tFreeCOM, the format of STRINGS.DAT and FIXSTRS was updated\r\n\tsee FIXSTRS.C for more information\r\n\r\n2000/06/22 ska <ska-src@gmx.net>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nAdded TC++1 fix contributed by Ron Cemer\r\n\r\n2000/06/22 ska <ska-src@gmx.net>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nreleased version v0.79b\r\n\r\n2000/06/22 ska <ska-src@gmx.net>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no add: CDD - changes drive and directory\r\no add: FEATURE_LAST_DIR - \"CD -\" as in 4/Ndos\r\no bugfix: \"CD C:\" has to display cwd of drive C:\r\n\r\n01-Jun-2000 (D. Lucas Parker <fuerve@yahoo.com>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no Added PUSHD, POPD, and DIRS commands similar to 4/NDOS, in file DSTACK.C\r\n\r\n1-Apr-2000 0.79 Henry Voigt <Henry.Voigt@gmx.de>\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nbugfix: ver.c : options uninitilized - every second output of ver with the\r\n               same option is empty (except FreeCom-string)\r\n\r\n19-May-2000      James Tabor <jimtabor@infohwy.com>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nImport FreeCom from John Price CVS at gcfl.net to the new CVS at\r\nSourceforge.net.\r\n\r\n30-Mar-2000 0.79 John Price <linux-guru@gcfl.net>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nAdded fddebug command so you can turn debug output on and off.\r\n\r\n30-Mar-2000 0.79 Steffen Kaiser <skaise2a@smail.inf.fh-rhein-sieg.de>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\n(Merged in code from Revision 0.78ska1 & 0.78ska2)\r\nadd: internal command CTTY: redirects the three standard file descriptors\r\n\tstdin, stdout and stderr to the specified device\r\nadd: FEATURE_CALL_LOGGING & tool PTCHLDRV\r\nbugfix: Y2K: DIR displays year 2000 as \"100\"\r\n+ bugfix: if: case-insensitive compare  in \"==\" format\r\n+ bugfix: if: added support for quoted operands of \"==\" format\r\n+ add: if: detailed error messages\r\n+ bugfix: if: keyword \"EXIST\" misspelled\r\n+ bugfix: echo: \"ECHO\" does not display the ECHO status\r\n+ bugfix: goto: label may be prefixed by one colon\r\n+ bugfix: \"skipwd\" is commented out --> SUPPL's skipwd() is used which\r\n\tis not 100% compatible, though\r\n\r\n20-Sep-1999 0.78 Steffen Kaiser <skaise2a@smail.inf.fh-rhein-sieg.de>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\n  chg: added v0.77 patches <<what is the print_free() stuff in DIR.C?>>\r\n  chg: centralized DEBUG stuff (see debug.*)\r\n  add: SET: Issues no-such-variable if a variable could not be removed\r\n  bugfix: COPY *.C A:\r\n  chg: automatic load of messages and keep them in memory\r\n  add: session management\r\n  add: comments\r\n  add: command line scanner acts over both internal command lines and\r\n  \targuments of COMMAND.COM itself ==> added longname options\r\n  chg: replaced access() by dfnstat()\r\n  chg: replaced stat() by dfnstat()\r\n  chg: split() may recieve NULL as line --> empty line\r\n  add: every internal command that can display some information, can\r\n  \tbe called with parameter == NULL and this info is displayed.\r\n  \tcmd_echo(NULL) will display ECHO status.\r\n  add: ECHO. hack\r\n  chg: every internal command detects and scans the options in the\r\n  \tsame way; see CMT3.TXT\r\n  add: DEL accepts multiple arguments\r\n  bugfix: \"FOR %a IN (dir\\*.*) DO\" expands to \"dir\\...\" instead of\r\n  \tjust \"...\"\r\n  bugfix: %9 wrong, if 9 > number of paramters\r\n  chg: %0 returns fullname; see CMT2.TXT\r\n  chg: rewritten COPY. Now behaves as described in CMT4.TXT\r\n\r\n29-Apr-1999 0.77 (John P Price <linux-guru@gcfl.net>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no dir.c: changed dir so it always shows the bytes free.\r\n  Changed so that \"dir command\" with no extension will do as\r\n  \"dir command.*\" (as it should).  Also made the display of the directory\r\n  not include the whole filespec, but only the directory\r\no copy.c: Now works if dest is just a drive letter.\r\n  (i.e \"copy file a:\")\r\n\r\n25-Apr-1999 0.77 Steffen Kaiser <skaise2a@smail.inf.fh-rhein-sieg.de>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nbugfix: alias.c: aliasexpand(): The main loop is multiply executed, if\r\n\tat least one alias was expanded (controlled by variable 'd').\r\n\tHowever, because 'ptr' is never resetted, the second loop\r\n\talways immediately fails, because 'ptr' is still NULL.\r\nbugfix: batch.c: batch_params(): Copying a quoted argument: If the string\r\n\tis not terminated, the do-while loop stops, then copies the '\\0'\r\n\tbyte, then increments s2 --> s2 now behind the string.\r\nbugfix: batch.c: batch(): fullname is duplicated into heap, but\r\n\tnot freed if this function fails\r\nbugfix: batch.c: batch(): no error checking of batch_params()\r\nadd: cmdinput.c: readcommand(): ^C: as ESC, also sets ECHO to ON\r\nbugfix: copy.c: cmd_copy(): If malloc of sources fails, 'p' is not freed\r\nbugfix: dir.c: cmd_dir(): dircmd can be NULL\r\nbugfix: filecomp.c: complete_filename(): makelower undefined if count < 0\r\nbugfix: for.c: cmd_for(): missing out-of-memory check with batch_params()\r\nbugfix: goto.c: cmd_goto(): leave the current FOR contexts\r\nadd: command.h/misc.c: match(), matchtok(), match_() test if a word\r\n\tbegins a line, if so, skip over it and following spaces\r\nadd: misc.c: comFile(): returns the absolute filename of COMMAND.COM\r\nadd: misc.c: comPathFile(): returns the name of a file located in the\r\n\tdirectory as COMMAND.COM\r\nchg: init.c: ComDir: replaced by ComPath, comFile() & comPathFile()\r\nfix: init.c: initialize(): combination of \"/p\" and \"/c\"|\"/k\" did not work\r\nbugfix: command.c: process_input(): FOR hack: On command line one can\r\n\tenter \"FOR %a IN () DO ...\". The current implementation expanded\r\n\tthe %A's.\r\nchg: alias.c: ltrim() & rtrim() moved to MISC.C, all \"skip whitespace\"\r\n\tcode pieces use these functions now\r\nadd: misc.c: trim(): combination of rtrim() & ltrim()\r\nadd: assert()'s to every function\r\n\r\n24-Mar-1999 0.77 (John P Price <linux-guru@gcfl.net>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no Added support for swapable exec.  There is a compile-time directive\r\n  so you can leave it out, or use it.  IT DOES NOT WORK UNDER\r\n  FREEDOS.  Probably a kernel problem, but that has not been\r\n  determined yet.\r\no changed the way we run autoexec.bat or a batch file on the command\r\n  line.  This seemed to clear up some bugs with running autoexec.bat.\r\no Changed set command so you can use a space between the variable and\r\n  the value.  Prints Syntax error if you don't have a space or a '='.\r\n\r\n24-Mar-1999 0.76b Steffen Kaiser <skaise2a@smail.inf.fh-rhein-sieg.de>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no date.c: bugfix: detection for invalid date strings.\r\n   Now the whole string must match: ^\\s*\\d+(.(\\d+(.\\d*)?)?)?\\s*$\r\n   The numbers can be delimited by any character from the 7-bit ASCII set,\r\n   which is printable, but not alphanumerical.\r\n   One need not specify all three parts (in which case the delimiter\r\n   may be omitted, too). If one specify;\r\n     1 number --> only the day changes\r\n     2 numbers --> month/day; year remains unchanged\r\n     3 numbers --> month/day/year\r\no time.c: bugfix: Detection of invalid time strings\r\n   One can specify:\r\n     ^\\s*\\d+.\\d+(.(\\d+(.\\d*)?)?)?\\s*([aApP]([mM]|\\.[mM]\\.)?\\s*$\r\n   If one specifies:\r\n     1 number --> error\r\n     2 numbers --> hour:minute, seconds & hundreds default to zero\r\n     3 numbers --> hour:minute:seconds, hundreds defaults to zero\r\n     4 numbers --> hour:minute:seconds.hundreds\r\n   The numbers may be delimited by any character from the 7-bit ASCII set,\r\n   which is printable, but not alphanumerical.\r\no err_hand.c: bugfix: Print garbage on screen, if no disk in floppy\r\n    drive An \"interrupt\" function saves & restores all registers and\r\n    also sets up DS correctly.\r\no created parsenum.c\r\n\r\n11-Feb-1999 (John P Price <linux-guru@gcfl.net>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no command.c: changed the spawnl call back to using the exec function.\r\n  Now that we are handling the environment correctly, this seems to\r\n  work better.  It passes new environment variables (even ones that\r\n  were created by this copy of command.com) to the child process.\r\n  This was suggested by Steffen Kaiser.\r\no using keypressed() that I wrote instead of Turbo C's kbhit()\r\n  function because for some reason kbhit() hangs under the FreeDOS\r\n  kernel.\r\no prints seconds as it waits for a keypress from user (during initial\r\n  boot)\r\no Fixed path to autoexec.bat.\r\no Changed openStrFile() function to try to read the strings from the\r\n  end of command first, and then to try to read strings.dat in the\r\n  same directory as command.com.  This helps when running from the\r\n  debugger.\r\n\r\n01-Feb-1999 0.76 Rob Linwood <rcl@udel.edu>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no alias.c: added code to allow alias commands to contain extra\r\n  whitespace\r\no added \"?\" command that shows the available commands.\r\n\r\n\r\n31-Jan-1999 0.76 (John P. Price <linux-guru@gcfl.net>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no dir.c: Changed dir_print_header to use function INT21,AH=69 instead\r\n  of the function it was using.  I'm not sure if this will fix\r\n  anything or not.  Also fixed bug with changing and restoring the\r\n  current drive.\r\no ver.c: changed /r to identify the FreeDOS kernel.  If you are using\r\n  kernel build 2000 or greater, it also shows the kernel version!\r\no init.c: when command.com is started, it shows how much memory\r\n  command.com is not hogging!  Hopefully this will increase soon!\r\n\r\n\r\n28-Jan-1999 0.75i (John P. Price <linux-guru@gcfl.net>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no alias.c: Changed noalias character from a dot to an asterisk (*).\r\n\r\n\r\n25-Jan-1999 0.75i Steffen Kaiser <skaise2a@smail.inf.fh-rhein-sieg.de>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no This patch includes the CP/M style device name support:\r\no Changed any open() and fopen() calls, when definitely sure that\r\n  they are called for disk files only, into devopen() and fdevopen().\r\no Support for COPY is a hack. Rob or John should double check it, or\r\n  possibly rewrite the whole file. (Thanx Steffen! - John :-)\r\n  Changes in COPY.C:\r\n  bugfix: setting time in ASCII mode before writing final ^Z\r\n  bugfix: copy(): if bsiz < 128: the opened files are not closed\r\n  chg: all error \"return\" statements perform the actions in the\r\n       same sequence to allow the code optimizer to re-use code\r\n  add: support for CP/M style device names (openf.h)\r\n  chg/bugfix: overwrite(): use vcgetcstr(); could overflow the buffer\r\n  chg: there were two individual flags ASCII and BINARY to indicate\r\n       which option was specified. Internally only the ASCII flag was\r\n       used, if it was clear, the files were copied in binary mode.\r\n       To support devices the two flags are passed unchanged to the\r\n       copy() function and, if both are clear (== none specified on\r\n       command line), it defaults to ASCII for devices, but will not\r\n       append the ^Z character.\r\n       Due to this, the destination file must be opened in ASCII\r\n       mode, too; otherwise the newline character had to be handled\r\n       manually.\r\no Two new files: openf.c & openf.h\r\n\r\n\r\n25-Jan-1999 0.75i Steffen Kaiser <skaise2a@smail.inf.fh-rhein-sieg.de>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no This patch addresses the two bugs reported by Eric Kohl\r\n  <ekohl@abo.rhein-zeitung.de>:\r\no alias.c: aliasdel(): accesses dynamic memory after it was free()'ed.\r\no split()'s code to skip leading whitespaces crashes at end of string.\r\n\r\n22-Jan-1999 0.75i Steffen Kaiser <skaise2a@smail.inf.fh-rhein-sieg.de>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no bugfix: on suggestion of Charles Dye (raster@highfiber.com)\r\n  \"/ccommand\" \"/c\" must work without a space between [MS COMMAND\r\n  compatibly] also mimics: \"/c/? dir\" --> bad command or filename\r\n\r\no add: DR DOS compatibly: \"/c:\" and \"/c=\" even supports wierd\r\n    looking: \"/c:dir/?\"\r\n\r\no add: DR DOS compatibly: \"/p:AUTOEXEC_replacement\"\r\n\r\no sub: calling _fullpath() for ComDir; at this point the path must be\r\n  fully-qualtifed by convention of the environ\r\n\r\n16-Dec-1998 0.75h (John P. Price <linux-guru@gcfl.net>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no alias.c: Changed so that a dot before a command will disable alias\r\n  expansion.  I was \"noalias\" but I prefer the shorter solution.\r\n\r\n16-Dec-1998 0.75h Steffen Kaiser <skaise2a@smail.inf.fh-rhein-sieg.de>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no bugfix in init() for the /C branch (collecting arguments)\r\no tracemode interaction in parsecommandline()\r\no vcgetcstr() to fetch a visible user input, incl. validation check\r\no command line parsing now exactly as the help screen (strings.txt)\r\n  describes\r\no show help screen using display_string()\r\no set exitflag (and exit if allowed) if help screen was issued or a\r\n  bad option was found\r\no load messages into conventional far memory\r\no change in message.c that string_index is not allocated dynamically\r\no The \"load messages into memory\" feature allocates the block the\r\n  messages are read into using the DOS API. It is not guarranteed\r\n  that this block is freed by DOS upon termination of the program,\r\n  therefore the atexit() function (installed by init()) explicitly\r\n  frees the block, because it seems to be the best (and most secure)\r\n  place to do so.\r\no is designed to work for a file STRINGS.DAT *less* than 64KB only!\r\no bugfix: preserve ECHO state of interactive command line (see\r\n  TEST1.BAT)\r\no bugfix with infinite loop in aliasexpand() when the useFlag warps\r\n\r\n04-Dec-1998 0.75g Steffen Kaiser <skaise2a@smail.inf.fh-rhein-sieg.de>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no changed dosalloc.c in the suppl library to fix the environment\r\n  problem.\r\n\r\n03-Dec-1998 0.75f (John P. Price <linux-guru@gcfl.net>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no alias.c: changed to convert to lower case instead of upper\r\no cls.c: cls now sets the text colors to lightgray on black before\r\n  clearing the screen.\r\no command.c: Added code to remove white space from end of command in\r\n  docommand function.  Also added nextcmd char pointer so we don't\r\n  loose the other commands in the line.  This fixes the bug\r\n  with \"type filename.c | more\"\r\no dir.c: Rewrote DIR command.  fixed problem with \"DIR .COM\" and\r\n  other bugs. Recursive switch does not work now, but it will be\r\n  added soon.\r\no init.c: finished batch file trace mode.  Fixed bug with /C command\r\n  line switch running batch files.\r\n  Added about 2 second delay where user can press F8 to run\r\n  autoexec.bat in tracemode, or press F5 to bypass autoexec.bat\r\n  completely.\r\no messages.c: Reduced the ammount of memory allocated by not reading\r\n  in entire index, but only the index element needed.\r\n\r\n27-Oct-1998 0.75e Rob Green <robg@sundial.net>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no command.c: changed line in is_delim function to include backslash\r\n  and period.\r\n\r\n27-Oct-1998 0.75e Steffen Kaiser <skaise2a@smail.inf.fh-rhein-sieg.de>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no bugfix: cmd_del(): Prompting the user for \"DEL ab*.*\"\r\no chg: display_string(): Invalid FreeDOS ID is not displayed on screen\r\no chg: get_redirection(): join '|'-loop with the other loop\r\no chg: get_redirection(): allocate filenames (instead of\r\n  parsecommand())\r\no bugfix: get_redirection(): Missing closing quote\r\no bugfix: parsecommandline(): replace tmpnam() by tmpfn() to ensure\r\n  that the temporary file is placed into the temporary directory\r\n  instead of the current one\r\no chg: alias.c: to reflect changes in tempfile.c\r\no chg: rmtmpfile(): to close file pointer\r\no chg: tempfile(): to use tmpfn()\r\no add: tmpfn(): to create a temporary filename\r\n\r\n13-Sep-1998 0.75d (Hans B Pufal <hansp@digiweb.com>)\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\no added an icon for the program.  fdcom.ico.\r\n\r\n13-Sep-1998 0.75d (John P. Price <linux-guru@gcfl.net>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no added VOL command.\r\no fixed a couple of bugs in the COPY command.\r\no move nearly all messages to external file that is appended to end\r\n  of command.com.  command.com is now an EXE type program, but has\r\n  only been renamed to .COM.  This allowed the file to be longger\r\n  than 64K.  Also changed model to small instead of tiny.\r\no changed VER to print system info when /R is used.  /D shows\r\n  redistribution info now.\r\n\r\n13-Sep-1998 0.75d Steffen Kaiser <skaise2a@smail.inf.fh-rhein-sieg.de>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no Corrected/rewrote ^Break handling to work on external commands.\r\n\r\n13-Sep-1998 0.75d (Rob Lake <rlake@cs.mun.ca>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no added COPY command.  Not all functionality is implemented yet, but\r\n  it's a great start!\r\n\r\n10-Aug-1998 0.75b Steffen Kaiser <skaise2a@smail.inf.fh-rhein-sieg.de>\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no Corrected ^Break handling in batch.c.  If one batch file (BATCH1)\r\n  calls another (BATCH2), pressing ^Break or ^C most of the time asks\r\n  to terminate BATCH1.BAT (Y/N/A). If you press 'Y', you should only\r\n  terminate BATCH1, but BATCH2 should continue.  But if you press 'A'\r\n  (or ^C), all batch files should terminate.\r\no added modifyable batch scripts (following the standard).\r\no bug: nested comments in old split()\r\no bug: DEL memory allocation\r\no added ^Break checks to cmd_type(), cmd_dir()\r\no added: chkCBreak(0) [aka \"cbreak\"] is a generic form that\r\n  autodetects if currently a batchfile is active and displays the\r\n  batchfile prompt, if so.  The batchfile prompt now displays the\r\n  name of the batchfile.\r\n\r\n09-Aug-1998 0.75a (Rob Lake <rlake@cs.mun.ca>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no dir.c: fixed bug that caused blank lines to be printed\r\no dir.c: renamed _Read_Dir to Read_Dir\r\no del.c: changed check for ^C\r\no del.c: alloced mem for char **arg\r\no misc.c: changed split function\r\no misc.c: added freep function\r\no truename.c: _truename now sets errno\r\no created build.bat\r\n\r\n07-Aug-1998 0.75 (John P Price <linux-guru@gcfl.net>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no Fixed carrage return output to better match MSDOS with echo on or off.\r\n\r\n04-Aug-1998 (Hans B Pufal) <hansp@digiweb.com>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no call.c: added lines to initialize for pointers.  This fixed the\r\n  lock-up that happened sometimes when calling a batch file from\r\n  another batch file.\r\n\r\n02-Aug-1998 (Hans B Pufal) <hansp@digiweb.com>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no batch.c: Fixed bug in ECHO flag restoration at exit from batch file\r\no command.c: Fixed return value when called with /C option\r\no Terminate label on first space character, use only first 8 chars of\r\n  label string\r\n\r\n30-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no Fixed bug where if you typed something, then hit HOME, then tried to\r\n  type something else in insert mode, it locked up.\r\no Changed default insert mode to on.  There should be a way to change\r\n  this.  Maybe options to doskey command.\r\no Added VERIFY command\r\n\r\n30-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no Changed filename completion so that a second TAB displays a list of\r\n  matching filenames!\r\no made filename be lower case if last character typed is lower case.\r\no Moved filename completion code to filecomp.c.\r\no Change ver command to display email address to report bugs, and the\r\n  web page address for updates.\r\no fixed so that it find_which returns NULL if filename is not\r\n  executable (does not have .bat, .com, or .exe extension).  Before\r\n  command would to execute any file with any extension. (opps!)\r\n\r\n29 Jul 1998 (Rob Lake rlake@cs.mun.ca)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no changed date.c and time.c, and wrote datefunc.c and timefunc.c to\r\n  impliment _dos_getdate, _dos_setdate, _dos_gettime and _dos_settime.\r\n  This is the first of many steps to make the shell compatible under\r\n  Pacific C.\r\n\r\n28 Jul 1998 (John P Price <linux-guru@gcfl.net>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no Added CLS command.\r\no Put ifdef's around all commands and added include file config.h\r\n  Now you can define exact what commands you want to include in\r\n  command.com.\r\no Also added ifdefs for optional features: aliases, command history\r\n  and filename completion.\r\no Added display of available internal commands and options at startup.\r\n\r\n\r\n20 Jul 1998 (John P Price <linux-guru@gcfl.net>)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no Fixed bug in DATE.C.\r\no Fixed bug in LH.ASM.\r\no Separated commands into individual files.\r\n\r\n\r\n19 Jul 1998 (Hans B Pufal) <hansp@digiweb.com>)\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\no Preserve state of echo flag across batch calls.\r\no Implementation of FOR command\r\n\r\n\r\n16 Jul 1998 (Rob Lake rlake@cs.mun.ca)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nAdded TRUENAME command.\r\n\r\n\r\n16 Jul 1998 (Hans B Pufal <hansp@digiweb.com>)\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nbatch.c\r\n  A new version, implements CALL, ECHO, GOT, IF, PAUSE, SHIFT and\r\n  BEEP. There is a stub for FOR but that's all.\r\n\r\ncmdtable.c\r\n  New file to keep the internal command table. I plan on getting rid\r\n  of the table real soon now and replacing it with a dynamic\r\n  mechanism.\r\n\r\ncommand.c\r\n  A new (improved ;) version. Conforms closely to MS-DOS specs.\r\n  Cleaned up (and fixed) the redirection handler.\r\n\r\ncommand.h\r\n  Version D with changes. Look for the HBP tag.\r\n\r\nredir.c\r\n  Modified file, now supports append redirects.\r\n\r\n\r\n07/13/98 version 0.74d (Rob Lake rlake@cs.mun.ca)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nINTERNAL.C\r\no removed most of the commands and placed them in there own file\r\n  -- del, ren, set and ver\r\no created DEL.C, REN.C SET.C and VER.C\r\no fixed bug that caused del not to delete files with no attributes\r\no the critical error handler count number of times called, autofails\r\n  at 5 calls\r\n\r\n07/12/98 version 0.74c (Rob Lake rlake@cs.mun.ca)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nVarious Files:\r\no removed redundant use of error message defines and moved\r\n  error printing calls to ERROR.C to reduced program size.\r\n\r\no created MISC.C\r\no created ERR_HAND.C/H\r\no created ERROR.C\r\n\r\n07/08/1998 version 0.74b (John P. Price (linux-guru@gcfl.net))\r\n~~~~~~~~~~~~~~~~~~~~~~~~\r\nCOMMAND.C\r\no fixed call to spawnl so that it would pass command line arguments\r\n  correctly.\r\n\r\n07/08/1998 version 0.74 (John P. Price (linux-guru@gcfl.net))\r\n~~~~~~~~~~~~~~~~~~~~~~~~\r\nCOMMAND.C/COMMAND.H:\r\no Now sets COMSPEC environment variable\r\no misc clean up and optimization\r\no added date, time and type commands\r\no changed to using spawnl instead of exec.  exec does not copy the\r\n  environment to the child process!\r\nDIR.C\r\no removed extra returns; closer to MSDOS\r\no fixed wide display so that an extra return is not displayed when\r\n  there is five filenames in the last line.\r\nENVIRON.C\r\no commented out show_environment function.  Not used anymore.\r\nINTERAL.C\r\no removed call to show_environment in set command.\r\no moved test for syntax before allocating memory in set command.\r\no misc clean up and optimization.\r\n\r\no created DATE.C\r\no created TIME.C\r\no created TYPE.C\r\n\r\n07/01/98 version 0.73 (Rob Lake)\r\n~~~~~~~~~~~~~~~~~~~~~~\r\no New DIR commands supported: /S, /B, /L, /A and /W.\r\n  (/R changed to /S).  Also /? added.\r\no Supports DIRCMD in environment.\r\no Supports turning off commands with hyphen (ex. /-S\r\n  turns off recursive listing)\r\no Changed error messages for DIR and DEL to more MS-DOS'ish\r\no Moved error messages from DIR.C and DEL.C to COMMAND.H\r\n  (more may go there soon)\r\no Fixed bug that caused dir *.ext/X not to work (no spaces\r\n  between filespec and slash)\r\no Added wildcard support for DEL command\r\no Added prompt and help switch for DEL command, /P and /?\r\n  respectively.\r\no Added support for /C when envoking the shell\r\no Added /P support when Kernel loads shell.  This means\r\n  the shell now is permanent and runs the autoexec.bat\r\n  (/E is not implemented)\r\no Added my name (Rob Lake) to the developer listing\r\no Changed version routine to print out copyright notice\r\n  with no args, and with appropriate switches, warranty\r\n  and redistribution notices and developer listing\r\n\r\n07/13/97 version 0.72b\r\n~~~~~~~~~~~~~~~~~~~~~~\r\nDisabled a feature that caused a crash on some machines.\r\n\r\no  Replaced setcursor calls in cmdinput.c with _setcursortype\r\no  Added dir.c to the distribution (was left out in 0.72)\r\n\r\n07/12/97 version 0.72\r\n~~~~~~~~~~~~~~~~~~~~~\r\nMore bug fixes and code cleanup\r\n\r\no  Rewrote cmdinput.c to be more efficient (Marc Desrochers)\r\no  Added insert/overstrike modes (Marc Desrochers)\r\no  Replaced findxy() with pointers into BIOS (maxx, maxy) (Marc Desrochers)\r\no  Fixed bug that disallowed listing of root directories\r\no  Fixed bug that didn't search the first path (again!)\r\n\r\n06/14/97 version 0.71\r\n~~~~~~~~~~~~~~~~~~~~~\r\nLots of bug fixes, plus some additional features.\r\n\r\no  New DIR command.  Now more like MS-DOS's DIR.  /p supported, /s coming soon\r\no  bug fix in internal.c - parse_firstarg\r\no  Rewrote parser in batch.c (Steffan Kaiser)\r\no  Ctrl-Break checking in various places (Steffan Kaiser)\r\no  Error level setting/checking (%? in batch files) (Steffan Kaiser)\r\no  bug fix in cmdinput.c (\"%i\" on command-line caused weird behavior)\r\no  bug fix in where.c (first item in path wasn't searched)\r\n\r\n08/27/96 version 0.70\r\n~~~~~~~~~~~~~~~~~~~~~\r\nFinally added Oliver Mueller's ALIAS command!  Also numerous bug fixes.\r\n\r\no  Added ALIAS command\r\no  Removed support for - as a switch in LOADHIGH.C\r\no  Bugfixes in BATCH.C.  %0 was returning garbage\r\no  Removed lots of unused variables, reducing # of warnings when compiling\r\no  Other miscellaneous code clean-ups\r\no  Changed WHERE.C to use a little less memory\r\n\r\n07/26/96 version 0.61\r\n~~~~~~~~~~~~~~~~~~~~~\r\nBugfixes\r\n\r\no  Added hook to the PATH command\r\no  Fixed CD.. bug\r\n\r\n07/26/96 version 0.60\r\n~~~~~~~~~~~~~~~~~~~~~\r\nLots of internal changes here...  Not much added to the interface.\r\n\r\no  Changed internals to use first,rest parameters instead of arrays of params\r\no  Fixed some bugs\r\no  Some other things I don't remember :)\r\n\r\n01/17/96 version 0.50\r\n~~~~~~~~~~~~~~~~~~~~~\r\nVersion 0.40 was never released because I was home on Christmas vacation,\r\nand I couldn't upload it.  By the time I got back to school, I had the\r\nLOADHIGH patch from Svante Frey, so I decided to jump up to 0.50 without any\r\nrelease of 0.40...       - Tim Norman\r\n\r\no  LOADHIGH/LOADFIX/LH support added!!!!  Many thanks go to Svante Frey!\r\no  bug fixed in command parsing that didn't handle / switches correctly...\r\no  removed debugging output from history.c\r\n\r\n01/06/96 version 0.40  (never released)\r\n~~~~~~~~~~~~~~~~~~~~~\r\no  added redirection and piping support!!!  (see redir.c and command.c)\r\no  fixed a stupid pointer problem in where.c that was causing LOTS of\r\n   problems in the strangest places...\r\no  added day of the week support to prompt.c (oops, that was already supposed\r\n   to be there! :)\r\no  fixed and reorganized the EXEC code!!!  Thanks to Svante Frey!\r\no  reorganized command.c and internal.c to handle parsing internal commands\r\n   more efficiently and consistently.\r\no  changed the behavior of MD, CD, RD to work without spaces (e.g. CD\\DOS)\r\no  small changes here and there to make it work with redirection/piping\r\n   (e.g. DIR only pauses if you're not doing redirection)\r\n\r\n12/14/95 version 0.31\r\n~~~~~~~~~~~~~~~~~~~~~\r\no  modified cmdinput.c to work with non-standard screen sizes (see 28.com)\r\no  fixed a bug in history.c that made it not work when you hit the up arrow\r\n   on the first line\r\no  fixed DIR to work a little more like MS-DOS's DIR (see internal.c)\r\no  fixed some code in where.c to make things a bit more efficient and nicer\r\n\r\n12/10/95 version 0.30\r\n~~~~~~~~~~~~~~~~~~~~~\r\no  used Borland's spawnve to fix exec problem\r\no  fixed CD again so you don't need a space after it\r\no  couple of spelling fixes\r\n\r\n08/06/95 prerelease of version 0.30\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\no  reorganized code into separate source modules.\r\no  added batch processing support (thanks to Evan Jeffrey).\r\no  added exec code (thanks to Steffan Kaiser).\r\no  removed environment handling (thanks again to Steffan Kaiser)\r\n\r\n        [ 08/08/95 -- Matt Rains ]\r\no  formatted this development log.\r\no  formatted all existing source modules so that they comply with recommended\r\n        programming practice.\r\no  added MD command.\r\no  added RD command.\r\no  added VER command.\r\no  replaced CD command.\r\no  modified DIR command.\r\no  DIR now called regardless of other DIR.??? files. this is done because of\r\n        exec() problems.\r\n\r\n01/15/95 version 0.20\r\n~~~~~~~~~~~~~~~~~~~~~\r\no  formatted all existing source modules.\r\no  added prompt support.\r\no  added drive selection.\r\no  added dir command.\r\no  started this development log.\r\n\r\n01/01/95 version 0.10\r\n~~~~~~~~~~~~~~~~~~~~~\r\no  removed some scaffolding.\r\no  modified CD.\r\no  added tab file completion.\r\no  added command line history.\r\n\r\n11/11/94 version 0.01\r\n~~~~~~~~~~~~~~~~~~~~~\r\no  initial release.\r\n"
  },
  {
    "path": "docs/html/build48.html",
    "content": "<!-- $Id$ -->\r\n<HTML>\r\n<HEAD>\r\n<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-15\">\r\n<META NAME=\"GENERATOR\" CONTENT=\"VI\">\r\n<META NAME=\"AUTHOR\" CONTENT=\"Steffen Kaiser\">\r\n<TITLE>HOW to compile FreeCOM</TITLE>\r\n</HEAD>\r\n\r\n<BODY>\r\n<H1>HOW to Compile FreeCOM v0.8x in Ten Steps</H1>\r\n\r\nBecause of several complaints about how to compile FreeCOM, this description\r\nhas been crafted to show this process step-by-step.\r\n\r\n<H2>Table of Contents</H2>\r\n\r\n<A HREF=\"#h2-preparations\">Preparations</A>\r\n<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=\"#h3-usedsys\">Used System</A>\r\n<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=\"#h3-libs\">Required Programs and Libraries</A>\r\n<BR><A HREF=\"#h2-sysconfig\">System Configuration</A>\r\n<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=\"#h3-config.sys\">CONFIG.SYS</A>\r\n<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=\"#h3-autoexec.bat\">AUTOEXEC.BAT</A>\r\n<BR><A HREF=\"#h2-one-time\">One-time Preparations</A>\r\n<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=\"#h3-cd-bin\">Contents of Directory C:\\BIN</A>\r\n<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=\"#h3-cd-root\">Contents of Directory C:\\</A>\r\n<BR><A HREF=\"#h2-10steps\">Ten Steps to Compile FreeCOM v0.8x</A>\r\n<BR><P>\r\n\r\n<HR>\r\n\r\n<H2><A NAME=\"h2-preparations\">Preparations</A></H2>\r\n\r\nThis description starts at the scratch, hence, it is assumed that no\r\nother tools are already installed and up and running. If there are some\r\nprogram available, you must take precautions to incorporate them into the\r\nprocess.\r\n\r\n<H3><A NAME=\"h3-usedsys\">Used System</A></H3>\r\n\r\nThis examples uses the following system:\r\n<UL>\r\n<LI>VMware, VirtualBox, DOSEMU2, DOSBOX-X (to emulate an unique PC, with a newly formatted, virtual\r\npartition)\r\n<LI>OS: FreeDOS kernel, binary release downloaded from:\r\n<A HREF=\"https://github.com/FDOS/kernel\">https://github.com/FDOS/kernel</A>;\r\n<LI>Shell: FreeCOM v0.83 Beta 46 or later (tested with both binary release and XMS-Swap\r\nrelease); downloaded from <A HREF=\"https://github.com/FDOS/freecom\">FreeCOM's home page on GitHub</A>\r\n<BR>The <EM>binary</EM> variant is installed as the default shell\r\n<TT>COMMAND.COM</TT>, the XMS-Swapping variant is installed as\r\n<TT>COM-XMS.COM</TT>; both on the root directory of the hard disk parition.\r\n</UL>\r\n\r\n<H3><A NAME=\"h3-libs\">Required Programs and Libraries</A></H3>\r\nAll this stuff will be made accessable to the Virtual PC through CD-Rom,\r\nas this is the only variant for this VMware release.\r\n\r\n<UL>\r\n<LI>Nasm (aka <EM>Netware Assembler</EM>) is used to compile enclosed\r\nassembly files;\r\nNasm is hosted on <A HREF=\"https://www.nasm.us/\">https://www.nasm.us/</A>, too;\r\nVersion 2.15 or newer is recommended of the 16-bit pre-compiled Nasm.\r\n<BR>The Nasm Zip-file is unpacked into directory <TT>nasm</TT> on the CD-Rom.\r\n\r\n<LI>Open Watcom or GCC-ia16 are the recommended compilers, but Borland compilers are still supported.\r\n<LI>Turbo C++ v1.01 is used to compile the enclosed C files, download from\r\nthe <A HREF=\"http://community.borland.com/article/0,1410,21751,00.html\">Borland museum</A>.\r\n<BR>The Turbo C++ Zip-file is unpacked into directory <TT>tcpp101</TT> on\r\nthe CD-Rom.\r\n\r\n<LI>Some <TT>unzip</TT>-utility for DOS, I'm using\r\n<QUOTE>UnZip 5.12 of 28 August 1994, by Info-ZIP</QUOTE>.\r\n<BR>Executable is located at the root directory of the CD-Rom.\r\n\r\n<LI>Some plain text editor for DOS, I'm using <A HREF=\"ftp://ftp.cs.pdx.edu/pub/elvis/\">Elvis v2.1_4 for DOS</A>.\r\n<BR>The executable is named <TT>vi.exe</TT> and is located at the\r\nroot directory of the CD-Rom.\r\n\r\n<LI><A HREF=\"http://freedos.sourceforge.net/freecom/packages/083Beta48/com083beta48.zip\">The source of FreeCOM v0.83 Beta 48</A>, located on the root directory\r\nof the CD-Rom.\r\n<BR>Or pick <A HREF=\"http://freedos.sourceforge.net/freecom/packages/\">some\r\nnewer release</A>.\r\n\r\n<LI><A HREF=\"http://freedos.sourceforge.net/freecom/packages/suppl.zip\">The SUPPL library</A>\r\npre-compiled for Turbo C++ v1.01, located on the root directory of the CD-Rom. \r\n*** SUPPL is now included within the FreeCOM source archive, though it may still work from standalone version.\r\n</UL>\r\n\r\n<H2><A NAME=\"h2-sysconfig\">System Configuration</A></H2>\r\n\r\n<H3><A NAME=\"h3-config.sys\">CONFIG.SYS</A></H3>\r\n<PRE><A HREF=\"#files20\">files=20</A>\r\n<A HREF=\"#fdxms\">device=fdxms.sys</A>\r\n<A HREF=\"#nec_ide\">device=NEC_IDE.SYS /D:CD001</A>\r\n<A HREF=\"#com-xms\">;shell=com-xms.com /p/e:256</A></PRE>\r\n\r\n<H3><A NAME=\"h3-autoexec.bat\">AUTOEXEC.BAT</A></H3>\r\n<PRE><A HREF=\"#path\">path c:\\bin;c:\\tcpp101\\bin</A>\r\n<A HREF=\"#set-temp\">set TEMP=C:\\Temp</A>\r\n<A HREF=\"#shsucdx\">SHSUCDX.EXE  /D:CD001</A></PRE>\r\n\r\n<H2><A NAME=\"h2-one-time\">One-time Preparations</A></H2>\r\n<FONT SIZE=-1>Note: On drive <TT>D:</TT> the CD-Rom has been mounted.</FONT>\r\n<PRE><A HREF=\"#mkdir-temp\">MKDIR %TEMP%</A>\r\n<A HREF=\"#mkdir-bin\">MKDIR C:\\BIN</A>\r\n<A HREF=\"#copy\">COPY D:\\NASM\\NASM.EXE D:\\VI.EXE D:\\UNZIP.EXE C:\\BIN</A>\r\nd:\r\n<A HREF=\"#cd-tcp\">cd tcpp101</A>\r\n<A HREF=\"#install-tcp\">install</A></PRE>\r\n\r\n<H3><A NAME=\"h3-cd-bin\">Contents of Directory C:\\BIN</A></H3>\r\n\r\n<PRE> Volume in drive C has no label\r\n Volume Serial Number is 58EF-6DA7\r\n\r\n Directory of C:\\BIN\r\n\r\n.                    &lt;DIR&gt;  11-03-02  9:44a\r\n..                   &lt;DIR&gt;  11-03-02  9:44a\r\nVI       EXE       372,158  04-25-01 12:37p\r\nSHSUCDX  EXE        15,726  10-20-00 10:34p\r\nNASM     EXE       252,452  09-12-02  6:37p\r\nUNZIP    EXE        43,691  08-29-94  9:37p\r\n         4 file(s)        684,027 bytes\r\n         2 dir(s)      24,221,696 bytes free</PRE>\r\n\r\n<H3><A NAME=\"h3-cd-root\">Contents of Directory C:\\</A></H3>\r\n\r\n<PRE> Volume in drive C has no label\r\n Volume Serial Number is 58EF-6DA7\r\n\r\n Directory of C:\\\r\n\r\nKERNEL   SYS        40,962  10-27-02 11:17p\r\nCOMMAND  COM        86,573  10-16-02  9:10p\r\nCOM-XMS  COM        88,203  10-16-02  9:07p\r\nCONFIG   SYS            86  10-30-02  1:24p\r\nAUTOEXEC BAT            69  10-30-02 11:28a\r\nFDXMS    SYS         4,836  03-02-02  6:55p\r\nNEC_IDE  SYS        29,089  04-26-96  8:37a\r\nTEMP                 &lt;DIR&gt;  04-25-01  1:32p\r\nTCPP101              &lt;DIR&gt;  11-03-02  9:56a\r\nBIN                  &lt;DIR&gt;  11-03-02  9:44a\r\n         7 file(s)        249,818 bytes\r\n         3 dir(s)      24,221,696 bytes free</PRE>\r\n\r\n<H2><A NAME=\"h2-10steps\">Ten Steps to Compile FreeCOM v0.83 Beta 48</A></H2>\r\n<PRE>c:\r\nCD \\\r\n<A HREF=\"#unzip-com\">unzip d:\\COM083BE.ZIP</A>\r\n<A HREF=\"#unzip-fcom\">unzip -q freecom.zip</A>\r\ndel freecom.zip \r\n<A HREF=\"#cd-suppl\">cd freecom\\suppl\\</A>\r\n<A HREF=\"#unzip-suppl\">unzip -n d:\\suppl.zip</A>\r\n<A HREF=\"#cd-main\">cd ..</A>\r\n<A HREF=\"#edit-cfg\">vi config.mak</A>\r\n<A HREF=\"#build\">build</A></PRE>\r\n<P>There should be a <TT>COMMAND.COM</TT> located in the current\r\ndirectory now.\r\n<P>There is also a <A HREF=\"#build-log\">sample build log</A>.\r\n<P>The <TT>build</TT> script uses the <A HREF=\"#build-env\">environment\r\nvariables <TT>SWAP</TT> and <TT>LNG</TT></A>.\r\n\r\n<HR>\r\n\r\n<H1>Appendix A: Description of settings</H1>\r\n\r\n<UL>\r\n<LI><P><A NAME=\"files20\"><TT>FILES=20</TT></A> is required by Turbo C++.\r\n<LI><P><A NAME=\"fdxms\">The driver <TT>fdxms.sys</TT></A> provides a XMS API\r\nsimiliar to <TT>HIMEM.SYS</TT>\r\n<LI><P><A NAME=\"nec_ide\">The driver <TT>NEC_IDE.SYS</TT></A> I've got along\r\nwith some Oak IDE-CD-Rom device and seems to handle all recent IDE-CD-Rom\r\ndrivers pretty well, like the emulated CD-Rom in VMware.\r\n<BR>The option <TT>/D:CD001</TT> causes the driver to install a device\r\nnamed <TT>CD001</TT> for the CD-Rom device in order to be found by the\r\nCD-redirector later on.\r\n<LI><P><A NAME=\"com-xms\">Uncomment <FONT SIZE=-1>(remove the semicolon from the\r\nfirst column of the line)</FONT> the line in order\r\nto use the XMS-Swapping variant</A> of FreeCOM v0.83 Beta 46.\r\n<LI><P><A NAME=\"path\">The two directories in which DOS is to search for\r\nexecutable programs:\r\n<OL>\r\n<LI>In <TT>C:\\BIN</TT> all relevant tools, such as assembler and Unzip,\r\nwill be located.\r\n<LI>In <TT>c:\\tcpp101\\bin</TT> the executables of the Turbo C++ compiler\r\nare located.\r\n</OL>\r\n<LI><P><A NAME=\"set-temp\">The environment variable <TT>TEMP</TT></A> points to the\r\ndirectory temporary files are to be created in.\r\n<LI><P><A NAME=\"shsucdx\">Loads the CD-Rom mid-level driver</A>, similiar to\r\n<TT>MSCDEX</TT>, the option <TT>/D:CD001</TT> must specify the same driver\r\nname as the <A HREF=\"#nec_ide\">low-level CD-Rom driver</A>.\r\n<LI><P><A NAME=\"mkdir-temp\">Create the temporary directory</A>, if not already\r\npresent.\r\n<LI><P><A NAME=\"mkdir-bin\">Create the directory for the executables</A>,\r\nif not already present.\r\n<LI><P><A NAME=\"copy\">Copy all the executables</A>, like assembler, text editor\r\nand unzip-utility, to the central directory.\r\n<LI><P><A NAME=\"cd-tcp\">The unpacked Turbo C++ v1.01 install files</A>\r\nare located in this directory.\r\n<LI><P><A NAME=\"install-tcp\">Runs the Turbo C++ v1.01 installation program</A>. The\r\nfollowing settings are used:\r\n<UL>\r\n<LI>Source drive: <TT>D</TT>\r\n<LI>Source directory: <TT>\\TCPP101</TT>\r\n<LI>select entry <TT>Turbo C++ Directory</TT>\r\n<LI>Target directory: <TT>C:\\TCPP101</TT>\r\n<BR>All the remaining installation directories should automatically be changed\r\nbelow this directory.\r\n<LI>select entry <TT>Start Installation</TT>\r\n</UL>\r\n<LI><P><A NAME=\"unzip-com\">The <TT>SHSUCDX</TT> presents the long filename\r\n<TT>com083Beta48.zip</TT></A> as <TT>COM083BE.ZIP</TT>, hence, unzipping\r\nthe FreeCOM source archive.\r\n<BR><EM>Note:</EM> This is the only point to change when compiling another\r\nFreeCOM release usually; just unpack the particular <TT>.ZIP</TT> file here.\r\nHowever, it is <EM>not</EM> recommended to overwrite an elder release of\r\nFreeCOM; when doing so, you should at least pass the <TT>-r</TT> option\r\nto <TT>build</TT>!\r\n<LI><P><A NAME=\"unzip-fcom\">Because the FreeCOM archive is a double-zipped\r\narchive</A>, <TT>FREECOM.ZIP</TT> is the <EM>real</EM> archive containing\r\nthe source files. In result a new directory <TT>FREECOM</TT> containing all\r\nthe source tree is created. The option <TT>-q</TT> causes <TT>unzip</TT> to\r\nrun quitely.\r\n<LI><P><A NAME=\"cd-suppl\">Go to the default location of the SUPPL library</A>.\r\n<LI><P><A NAME=\"unzip-suppl\">Unzip the pre-compiled SUPPL library</A>, the\r\noption <TT>-n</TT> causes <TT>unzip</TT> to not complain about the already\r\npresent files in the current directory.\r\n<LI><P><A NAME=\"cd-main\">Go to the main directory</A> of FreeCOM.\r\n<LI><P><A NAME=\"edit-cfg\">Edit the configuration</A> of the build process\r\nvia adopting the file <TT>CONFIG.MAK</TT>:\r\n<BR><EM>Note:</EM> The default configuration has been adjusted to\r\ncomply with these steps, hence, no adoptions are required; so you might skip\r\nthis step as well.\r\n<LI><P><A NAME=\"build\">Actually runs the build process</A>:\r\n<UL>\r\n<LI>in order to force to <STRONG>re</STRONG>-built all portions of FreeCOM,\r\ne.g. when the source code was overwritten with another version or\r\nwhen switching between XMS-Swapping enabled or disabled, pass the\r\n<TT>-r</TT> option as the first argument to <TT>build</TT>.\r\n<LI>to build the XMS-Swapping variant of FreeCOM specify <TT>xms-swap</TT>\r\nas the first (or second) argument, e.g.: <PRE>build.bat xms-swap</PRE>.\r\n<LI>to build FreeCOM with some specific language other than English, specify\r\nthe language as the last argument, e.g.: <PRE>build.bat Dutch</PRE> or\r\n<PRE>build.bat xms-swap Dutch</PRE>. For each supported language, a\r\ncorresponding <TT>.LNG</TT> file is located in sub-directory <TT>STRINGS</TT>,\r\nhence, the command <TT>DIR STRINGS\\*.LNG</TT> displays a list of supported\r\nlanguages. Do not specify the extension <TT>.LNG</TT> on <TT>build</TT>'s\r\ncommand line!\r\n</UL>\r\n<BR><A NAME=\"build-env\">The environment variable <TT>SWAP</TT> is\r\ninternally used by the <TT>build</TT> script and is removed upon\r\nsuccessful finish.\r\n<BR>The script stores the selected language, or <TT>English</TT>\r\nif none has been selected on command line <STRONG>and</STRONG> the\r\nvariable is not already defined, into the environment\r\nvariable <TT>LNG</TT>; hence, the selected language keeps permanently\r\nselected between different runs of <TT>build</TT>, until reset by the\r\nuser manually as the last argument of the <TT>build</TT> script, by\r\nremoving or changing the variable directly or by rebooting the system.\r\n\r\n<LI><P><A NAME=\"build-log\">\r\n<EM>Note:</EM> This Logfile stops when building the <TT>TOOLS</TT>\r\ndirectory.</A>\r\n<PRE>File not found. - 'C:\\FREECOM\\LASTMAKE.MK'\r\nFile not found. - 'C:\\FREECOM\\TOOLS\\*.MAP'\r\nFile not found. - 'C:\\FREECOM\\TOOLS\\*.COM'\r\nFile not found. - 'C:\\FREECOM\\UTILS\\*.MAP'\r\nFile not found. - 'C:\\FREECOM\\CRITER\\*.OBJ'\r\nFile not found. - 'C:\\FREECOM\\CRITER\\*.CFG'\r\nMAKE0000.$$$ =&gt; C:\\FREECOM\\UTILS\\TCCDOS.CFG\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nmktools.c:\r\nTurbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nmkctxt.c:\r\nTurbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nchunk.c:\r\nTurbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nmkinfres.c:\r\nTurbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International\r\nMAKE0000.$$$ =&gt; C:\\FREECOM\\STRINGS\\TCCDOS.CFG\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nfixstrs.c:\r\nTurbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International\r\nFIXSTRS: loading file DEFAULT.LNG\r\nFIXSTRS: loading file english\r\nFIXSTRS: building STRINGS resource\r\nFIXSTRS: building STRINGS library source files\r\nstrings.h =&gt; C:\\FREECOM\\STRINGS\\..\\strings.h\r\nMAKE0001.$$$ =&gt; C:\\FREECOM\\STRINGS\\MKSTRLIB.BAT\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\ncritstrs.c:\r\nTurbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International\r\nCRITSTRS: load file DEFAULT.ERR\r\nCRITSTRS: load file english\r\nCRITSTRS: Running validation check\r\nCRITSTRS: Dumping CRITER strings resource\r\nTLIB 3.01 Copyright (c) 1987, 1990 Borland International\r\n+str0000.obj &amp;\r\n+str0001.obj &amp;\r\n+str0002.obj &amp;\r\n+str0003.obj &amp;\r\n+str0004.obj &amp;\r\n+str0005.obj &amp;\r\n+str0006.obj &amp;\r\n+str0007.obj &amp;\r\n+str0008.obj &amp;\r\n+str0009.obj &amp;\r\n+str000a.obj &amp;\r\n+str000b.obj &amp;\r\n+str000c.obj &amp;\r\n+str000d.obj &amp;\r\n+str000e.obj &amp;\r\n+str000f.obj &amp;\r\n+str0010.obj &amp;\r\n+str0011.obj &amp;\r\n+str0012.obj &amp;\r\n+str0013.obj &amp;\r\n+str0014.obj &amp;\r\n+str0015.obj &amp;\r\n+str0016.obj &amp;\r\n+str0017.obj &amp;\r\n+str0018.obj &amp;\r\n+str0019.obj &amp;\r\n+str001a.obj &amp;\r\n+str001b.obj &amp;\r\n+str001c.obj &amp;\r\n+str001d.obj &amp;\r\n+str001e.obj &amp;\r\n+str001f.obj &amp;\r\n+str0020.obj &amp;\r\n+str0021.obj &amp;\r\n+str0022.obj &amp;\r\n+str0023.obj &amp;\r\n+str0024.obj &amp;\r\n+str0025.obj &amp;\r\n+str0026.obj &amp;\r\n+str0027.obj &amp;\r\n+str0028.obj &amp;\r\n+str0029.obj &amp;\r\n+str002a.obj &amp;\r\n+str002b.obj &amp;\r\n+str002c.obj &amp;\r\n+str002d.obj &amp;\r\n+str002e.obj &amp;\r\n+str002f.obj &amp;\r\n+str0030.obj &amp;\r\n+str0031.obj &amp;\r\n+str0032.obj &amp;\r\n+str0033.obj &amp;\r\n+str0034.obj &amp;\r\n+str0035.obj &amp;\r\n+str0036.obj &amp;\r\n+str0037.obj &amp;\r\n+str0038.obj &amp;\r\n+str0039.obj &amp;\r\n+str003a.obj &amp;\r\n+str003b.obj &amp;\r\n+str003c.obj &amp;\r\n+str003d.obj &amp;\r\n+str003e.obj &amp;\r\n+str003f.obj &amp;\r\n+str0040.obj &amp;\r\n+str0041.obj &amp;\r\n+str0042.obj &amp;\r\n+str0043.obj &amp;\r\n+str0044.obj &amp;\r\n+str0045.obj &amp;\r\n+str0046.obj &amp;\r\n+str0047.obj &amp;\r\n+str0048.obj &amp;\r\n+str0049.obj &amp;\r\n+str004a.obj &amp;\r\n+str004b.obj &amp;\r\n+str004c.obj &amp;\r\n+str004d.obj &amp;\r\n+str004e.obj &amp;\r\n+str004f.obj &amp;\r\n+str0050.obj &amp;\r\n+str0051.obj &amp;\r\n+str0052.obj &amp;\r\n+str0053.obj &amp;\r\n+str0054.obj &amp;\r\n+str0055.obj &amp;\r\n+str0056.obj &amp;\r\n+str0057.obj &amp;\r\n+str0058.obj &amp;\r\n+str0059.obj &amp;\r\n+str005a.obj &amp;\r\n+str005b.obj &amp;\r\n+str005c.obj &amp;\r\n+str005d.obj &amp;\r\n+str005e.obj &amp;\r\n+str005f.obj &amp;\r\n+str0060.obj &amp;\r\n+str0061.obj &amp;\r\n+str0062.obj &amp;\r\n+str0063.obj &amp;\r\n+str0064.obj &amp;\r\n+str0065.obj &amp;\r\n+str0066.obj &amp;\r\n+str0067.obj &amp;\r\n+str0068.obj &amp;\r\n+str0069.obj &amp;\r\n+str006a.obj &amp;\r\n+str006b.obj &amp;\r\n+str006c.obj &amp;\r\n+str006d.obj &amp;\r\n+str006e.obj &amp;\r\n+str006f.obj &amp;\r\n+str0070.obj &amp;\r\n+str0071.obj &amp;\r\n+str0072.obj &amp;\r\n+str0073.obj &amp;\r\n+str0074.obj &amp;\r\n+str0075.obj &amp;\r\n+str0076.obj &amp;\r\n+str0077.obj &amp;\r\n+str0078.obj &amp;\r\n+str0079.obj &amp;\r\n+str007a.obj &amp;\r\n+str007b.obj &amp;\r\n+str007c.obj &amp;\r\n+str007d.obj &amp;\r\n+str007e.obj &amp;\r\n+str007f.obj &amp;\r\n+str0080.obj &amp;\r\n+str0081.obj &amp;\r\n+str0082.obj &amp;\r\n+str0083.obj &amp;\r\n+str0084.obj &amp;\r\n+str0085.obj &amp;\r\n+str0086.obj &amp;\r\n+str0087.obj &amp;\r\n+str0088.obj &amp;\r\n+str0089.obj &amp;\r\n+str008a.obj &amp;\r\n+str008b.obj &amp;\r\n+str008c.obj &amp;\r\n+str008d.obj &amp;\r\n+str008e.obj &amp;\r\n+str008f.obj &amp;\r\n+str0090.obj &amp;\r\n+str0091.obj &amp;\r\n+str0092.obj &amp;\r\n+str0093.obj &amp;\r\n+str0094.obj &amp;\r\n+str0095.obj &amp;\r\n+str0096.obj &amp;\r\n+str0097.obj &amp;\r\n+str0098.obj &amp;\r\n+str0099.obj &amp;\r\n+str009a.obj &amp;\r\n+str009b.obj &amp;\r\n+str009c.obj &amp;\r\n+str009d.obj &amp;\r\n+str009e.obj &amp;\r\n+str009f.obj &amp;\r\n+str00a0.obj &amp;\r\n+str00a1.obj &amp;\r\n+str00a2.obj &amp;\r\n+str00a3.obj &amp;\r\n+str00a4.obj &amp;\r\n+str00a5.obj &amp;\r\n+str00a6.obj &amp;\r\n+str00a7.obj &amp;\r\n+str00a8.obj &amp;\r\n+str00a9.obj &amp;\r\n+str00aa.obj &amp;\r\n+str00ab.obj &amp;\r\n+str00ac.obj &amp;\r\n+str00ad.obj &amp;\r\n+str00ae.obj &amp;\r\n+str00af.obj &amp;\r\n+str00b0.obj &amp;\r\n+str00b1.obj &amp;\r\n+str00b2.obj &amp;\r\n+str00b3.obj &amp;\r\n+str00b4.obj &amp;\r\n+str00b5.obj &amp;\r\n+str00b6.obj &amp;\r\n+str00b7.obj &amp;\r\n+str00b8.obj &amp;\r\n+str00b9.obj &amp;\r\n+str00ba.obj &amp;\r\n+str00bb.obj &amp;\r\n+str00bc.obj &amp;\r\n+str00bd.obj &amp;\r\n+str00be.obj &amp;\r\n+str00bf.obj &amp;\r\n+str00c0.obj &amp;\r\n+str00c1.obj &amp;\r\n+str00c2.obj &amp;\r\n+str00c3.obj &amp;\r\n+str00c4.obj &amp;\r\n+str00c5.obj &amp;\r\n+str00c6.obj &amp;\r\n+str00c7.obj &amp;\r\n+str00c8.obj &amp;\r\n+str00c9.obj &amp;\r\n+str00ca.obj &amp;\r\n+str00cb.obj &amp;\r\n+str00cc.obj &amp;\r\n+str00cd.obj &amp;\r\n+str00ce.obj &amp;\r\n+str00cf.obj &amp;\r\n+str00d0.obj &amp;\r\n+str00d1.obj &amp;\r\n+str00d2.obj &amp;\r\n+str00d3.obj &amp;\r\n+str00d4.obj &amp;\r\n+str00d5.obj &amp;\r\n+str00d6.obj &amp;\r\n+str00d7.obj &amp;\r\n+str00d8.obj &amp;\r\n+str00d9.obj &amp;\r\n+str00da.obj &amp;\r\n+str00db.obj &amp;\r\n+str00dc.obj &amp;\r\n+str00dd.obj &amp;\r\n+str00de.obj &amp;\r\n+str00df.obj &amp;\r\n+str00e0.obj &amp;\r\n+str00e1.obj &amp;\r\n+str00e2.obj \r\nstrings.lib =&gt; C:\\FREECOM\\STRINGS\\STRINGS\\..\\strings.lib\r\nstrings.lst =&gt; C:\\FREECOM\\STRINGS\\STRINGS\\..\\strings.lst\r\ncontext.h_c =&gt; C:\\FREECOM\\CRITER\\..\\context.h_c\r\ncontext.inc =&gt; C:\\FREECOM\\CRITER\\..\\context.inc\r\nMAKE0000.$$$ =&gt; C:\\FREECOM\\LIB\\TCCDOS.CFG\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nalprmblk.c:\r\nalsysblk.c:\r\nbeep_l.c:\r\nbeep_n.c:\r\nbrk_get.c:\r\nbrk_set.c:\r\ncbreak.c:\r\ncbs.c:\r\ncd_dir.c:\r\ncgetch.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\ncgettime.c:\r\nchgctxt.c:\r\nchgdrv.c:\r\nchgenv.c:\r\nchgenvc.c:\r\nchgenvr.c:\r\ncmdinput.c:\r\ncomfile.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\ncompfile.c:\r\nctxt.c:\r\nctxt_adr.c:\r\nctxt_as.c:\r\nctxt_chg.c:\r\nctxt_clr.c:\r\nctxt_get.c:\r\nctxt_inf.c:\r\nctxt_mk.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nctxt_mkn.c:\r\nctxt_pop.c:\r\nctxt_psh.c:\r\nctxt_rnu.c:\r\nctxt_set.c:\r\nctxt_ss.c:\r\nctxt_vw.c:\r\ncurdatel.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\ncurtime.c:\r\ncwd.c:\r\ndateget.c:\r\ndateset.c:\r\ndbg_c.c:\r\ndbg_mem.c:\r\ndbg_prnt.c:\r\ndbg_s.c:\r\ndbg_sn.c:\r\ndevopen.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\ndispcnt.c:\r\ndrvnum.c:\r\nefct_001.c:\r\nexec.c:\r\nexec1.c:\r\nfarread.c:\r\nfcompl1.c:\r\nfcompl2.c:\r\nfdattr.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nfdevopen.c:\r\nfdsattr.c:\r\nfillcomp.c:\r\nfind.c:\r\nfreep.c:\r\nfrsysblk.c:\r\nfstpcpy.c:\r\ngallstr.c:\r\nget1mcb.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\ngetenv.c:\r\ngoxy.c:\r\ngrabfcom.c:\r\ngumblink.c:\r\nhdlrctxt.c:\r\nhist_get.c:\r\nhist_set.c:\r\ninputdos.c:\r\nis_empty.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nis_fnamc.c:\r\nis_fnstr.c:\r\nis_pchr.c:\r\nisadev.c:\r\nkeyprsd.c:\r\nkswap_c.c:\r\nlastdget.c:\r\nlastdset.c:\r\nleadopt.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nltrimcl.c:\r\nltrimsp.c:\r\nlwr1wd.c:\r\nmatch.c:\r\nmessages.c:\r\nmk_rddir.c:\r\nmktmpfil.c:\r\nmsg_dflt.c:\r\nmsg_dps.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nmsg_fstr.c:\r\nmsg_get.c:\r\nmsg_gpt.c:\r\nmsg_mkey.c:\r\nmsg_prmp.c:\r\nmux_ae.c:\r\nnls.c:\r\nnls_date.c:\r\nnls_time.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nnum_fmt.c:\r\nonoff.c:\r\nopenf.c:\r\noptsb.c:\r\noptsi.c:\r\noptss.c:\r\nparsenum.c:\r\npr_date.c:\r\npr_prmpt.c:\r\npr_time.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nprprompt.c:\r\nrealnum.c:\r\nres.c:\r\nres_r.c:\r\nres_w.c:\r\nresfile.c:\r\nrmtmpfil.c:\r\nrtrimcl.c:\r\nrtrimsp.c:\r\nsalloc.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nsamefile.c:\r\nscancmd.c:\r\nscanopt.c:\r\nshowcmds.c:\r\nskqwd.c:\r\nsplit.c:\r\nsumblink.c:\r\ntempfile.c:\r\ntimeget.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\ntimeset.c:\r\ntmpnam.c:\r\ntrimcl.c:\r\ntrimsp.c:\r\ntxtlend.c:\r\nunquote.c:\r\nvcgetch.c:\r\nvcgetstr.c:\r\nwhere.c:\r\nerr1.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nerr2.c:\r\nerr3.c:\r\nerr4.c:\r\nerr5.c:\r\nerr6.c:\r\nerr7.c:\r\nerr8.c:\r\nerr9.c:\r\nerr10.c:\r\nerr11.c:\r\nerr12.c:\r\nerr13.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nerr14.c:\r\nerr15.c:\r\nerr16.c:\r\nerr17.c:\r\nerr18.c:\r\nerr19.c:\r\nerr20.c:\r\nerr21.c:\r\nerr22.c:\r\nerr23.c:\r\nerr24.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nerr25.c:\r\nerr26.c:\r\nerr27.c:\r\nerr28.c:\r\nerr29.c:\r\nerr30.c:\r\nerr31.c:\r\nerr32.c:\r\nerr33.c:\r\nerr34.c:\r\nerr35.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nerr36.c:\r\nerr37.c:\r\nerr38.c:\r\nerr39.c:\r\nerr40.c:\r\nerr41.c:\r\nerr42.c:\r\nerr43.c:\r\nerr44.c:\r\nerr45.c:\r\nerr46.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nerr47.c:\r\nerr48.c:\r\nerr49.c:\r\nerr50.c:\r\nerr51.c:\r\nerr52.c:\r\nerr53.c:\r\nerr54.c:\r\nerr55.c:\r\nerr56.c:\r\nerr57.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nerr58.c:\r\nerr59.c:\r\nerr60.c:\r\nerr61.c:\r\nerr62.c:\r\nerr63.c:\r\nerr64.c:\r\nerr65.c:\r\nerr66.c:\r\nerr67.c:\r\nerr68.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nerr69.c:\r\nerr70.c:\r\nerr71.c:\r\nerr72.c:\r\nerr73.c:\r\nerr74.c:\r\nerr75.c:\r\nerr76.c:\r\nerr77.c:\r\nerr78.c:\r\nerr79.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nerr80.c:\r\nTLIB 3.01 Copyright (c) 1987, 1990 Borland International\r\n+alprmblk.obj &amp;\r\n+alsysblk.obj &amp;\r\n+beep_l.obj &amp;\r\n+beep_n.obj &amp;\r\n+brk_get.obj &amp;\r\n+brk_set.obj &amp;\r\n+cbreak.obj &amp;\r\n+cbs.obj &amp;\r\n+cd_dir.obj &amp;\r\n+cgetch.obj &amp;\r\n+cgettime.obj &amp;\r\n+chgctxt.obj &amp;\r\n+chgdrv.obj &amp;\r\n+chgenv.obj &amp;\r\n+chgenvc.obj &amp;\r\n+chgenvr.obj &amp;\r\n+cmdinput.obj &amp;\r\n+comfile.obj &amp;\r\n+compfile.obj &amp;\r\n+ctxt.obj &amp;\r\n+ctxt_adr.obj &amp;\r\n+ctxt_as.obj &amp;\r\n+ctxt_chg.obj &amp;\r\n+ctxt_clr.obj &amp;\r\n+ctxt_get.obj &amp;\r\n+ctxt_inf.obj &amp;\r\n+ctxt_mk.obj &amp;\r\n+ctxt_mkn.obj &amp;\r\n+ctxt_pop.obj &amp;\r\n+ctxt_psh.obj &amp;\r\n+ctxt_rnu.obj &amp;\r\n+ctxt_set.obj &amp;\r\n+ctxt_ss.obj &amp;\r\n+ctxt_vw.obj &amp;\r\n+curdatel.obj &amp;\r\n+curtime.obj &amp;\r\n+cwd.obj &amp;\r\n+dateget.obj &amp;\r\n+dateset.obj &amp;\r\n+dbg_c.obj &amp;\r\n+dbg_mem.obj &amp;\r\n+dbg_prnt.obj &amp;\r\n+dbg_s.obj &amp;\r\n+dbg_sn.obj &amp;\r\n+devopen.obj &amp;\r\n+dispcnt.obj &amp;\r\n+drvnum.obj &amp;\r\n+efct_001.obj &amp;\r\n+exec.obj &amp;\r\n+exec1.obj &amp;\r\n+farread.obj &amp;\r\n+fcompl1.obj &amp;\r\n+fcompl2.obj &amp;\r\n+fdattr.obj &amp;\r\n+fdevopen.obj &amp;\r\n+fdsattr.obj &amp;\r\n+fillcomp.obj &amp;\r\n+find.obj &amp;\r\n+freep.obj &amp;\r\n+frsysblk.obj &amp;\r\n+fstpcpy.obj &amp;\r\n+gallstr.obj &amp;\r\n+get1mcb.obj &amp;\r\n+getenv.obj &amp;\r\n+goxy.obj &amp;\r\n+grabfcom.obj &amp;\r\n+gumblink.obj &amp;\r\n+hdlrctxt.obj &amp;\r\n+hist_get.obj &amp;\r\n+hist_set.obj &amp;\r\n+inputdos.obj &amp;\r\n+is_empty.obj &amp;\r\n+is_fnamc.obj &amp;\r\n+is_fnstr.obj &amp;\r\n+is_pchr.obj &amp;\r\n+isadev.obj &amp;\r\n+keyprsd.obj &amp;\r\n+kswap_c.obj &amp;\r\n+lastdget.obj &amp;\r\n+lastdset.obj &amp;\r\n+leadopt.obj &amp;\r\n+lowexec.obj &amp;\r\n+ltrimcl.obj &amp;\r\n+ltrimsp.obj &amp;\r\n+lwr1wd.obj &amp;\r\n+match.obj &amp;\r\n+messages.obj &amp;\r\n+mk_rddir.obj &amp;\r\n+mktmpfil.obj &amp;\r\n+msg_dflt.obj &amp;\r\n+msg_dps.obj &amp;\r\n+msg_fstr.obj &amp;\r\n+msg_get.obj &amp;\r\n+msg_gpt.obj &amp;\r\n+msg_mkey.obj &amp;\r\n+msg_prmp.obj &amp;\r\n+mux_ae.obj &amp;\r\n+nls.obj &amp;\r\n+nls_date.obj &amp;\r\n+nls_time.obj &amp;\r\n+num_fmt.obj &amp;\r\n+onoff.obj &amp;\r\n+openf.obj &amp;\r\n+optsb.obj &amp;\r\n+optsi.obj &amp;\r\n+optss.obj &amp;\r\n+parsenum.obj &amp;\r\n+pr_date.obj &amp;\r\n+pr_prmpt.obj &amp;\r\n+pr_time.obj &amp;\r\n+prprompt.obj &amp;\r\n+realnum.obj &amp;\r\n+res.obj &amp;\r\n+res_r.obj &amp;\r\n+res_w.obj &amp;\r\n+resfile.obj &amp;\r\n+rmtmpfil.obj &amp;\r\n+rtrimcl.obj &amp;\r\n+rtrimsp.obj &amp;\r\n+salloc.obj &amp;\r\n+samefile.obj &amp;\r\n+scancmd.obj &amp;\r\n+scanopt.obj &amp;\r\n+showcmds.obj &amp;\r\n+skqwd.obj &amp;\r\n+split.obj &amp;\r\n+sumblink.obj &amp;\r\n+tempfile.obj &amp;\r\n+timeget.obj &amp;\r\n+timeset.obj &amp;\r\n+tmpnam.obj &amp;\r\n+trimcl.obj &amp;\r\n+trimsp.obj &amp;\r\n+txtlend.obj &amp;\r\n+unquote.obj &amp;\r\n+vcgetch.obj &amp;\r\n+vcgetstr.obj &amp;\r\n+where.obj &amp;\r\n+err1.obj &amp;\r\n+err2.obj &amp;\r\n+err3.obj &amp;\r\n+err4.obj &amp;\r\n+err5.obj &amp;\r\n+err6.obj &amp;\r\n+err7.obj &amp;\r\n+err8.obj &amp;\r\n+err9.obj &amp;\r\n+err10.obj &amp;\r\n+err11.obj &amp;\r\n+err12.obj &amp;\r\n+err13.obj &amp;\r\n+err14.obj &amp;\r\n+err15.obj &amp;\r\n+err16.obj &amp;\r\n+err17.obj &amp;\r\n+err18.obj &amp;\r\n+err19.obj &amp;\r\n+err20.obj &amp;\r\n+err21.obj &amp;\r\n+err22.obj &amp;\r\n+err23.obj &amp;\r\n+err24.obj &amp;\r\n+err25.obj &amp;\r\n+err26.obj &amp;\r\n+err27.obj &amp;\r\n+err28.obj &amp;\r\n+err29.obj &amp;\r\n+err30.obj &amp;\r\n+err31.obj &amp;\r\n+err32.obj &amp;\r\n+err33.obj &amp;\r\n+err34.obj &amp;\r\n+err35.obj &amp;\r\n+err36.obj &amp;\r\n+err37.obj &amp;\r\n+err38.obj &amp;\r\n+err39.obj &amp;\r\n+err40.obj &amp;\r\n+err41.obj &amp;\r\n+err42.obj &amp;\r\n+err43.obj &amp;\r\n+err44.obj &amp;\r\n+err45.obj &amp;\r\n+err46.obj &amp;\r\n+err47.obj &amp;\r\n+err48.obj &amp;\r\n+err49.obj &amp;\r\n+err50.obj &amp;\r\n+err51.obj &amp;\r\n+err52.obj &amp;\r\n+err53.obj &amp;\r\n+err54.obj &amp;\r\n+err55.obj &amp;\r\n+err56.obj &amp;\r\n+err57.obj &amp;\r\n+err58.obj &amp;\r\n+err59.obj &amp;\r\n+err60.obj &amp;\r\n+err61.obj &amp;\r\n+err62.obj &amp;\r\n+err63.obj &amp;\r\n+err64.obj &amp;\r\n+err65.obj &amp;\r\n+err66.obj &amp;\r\n+err67.obj &amp;\r\n+err68.obj &amp;\r\n+err69.obj &amp;\r\n+err70.obj &amp;\r\n+err71.obj &amp;\r\n+err72.obj &amp;\r\n+err73.obj &amp;\r\n+err74.obj &amp;\r\n+err75.obj &amp;\r\n+err76.obj &amp;\r\n+err77.obj &amp;\r\n+err78.obj &amp;\r\n+err79.obj &amp;\r\n+err80.obj\r\nMAKE0000.$$$ =&gt; C:\\FREECOM\\CMD\\TCCDOS.CFG\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nalias.c:\r\nbeep.c:\r\nbreak.c:\r\ncall.c:\r\ncdd.c:\r\nchdir.c:\r\ncls.c:\r\ncopy.c:\r\nctty.c:\r\ndate.c:\r\ndel.c:\r\ndir.c:\r\ndirs.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\ndoskey.c:\r\necho.c:\r\nexit.c:\r\nexit2.c:\r\nfddebug.c:\r\nfor.c:\r\ngoto.c:\r\nhistory.c:\r\nif.c:\r\nmemory.c:\r\nmkdir.c:\r\npath.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\npause.c:\r\npopd.c:\r\nprompt.c:\r\npushd.c:\r\nrem.c:\r\nren.c:\r\nrmdir.c:\r\nset.c:\r\nshift.c:\r\ntime.c:\r\ntruename.c:\r\ntype.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nverify.c:\r\nwhich.c:\r\nTLIB 3.01 Copyright (c) 1987, 1990 Borland International\r\n+alias.obj &amp;\r\n+beep.obj &amp;\r\n+break.obj &amp;\r\n+call.obj &amp;\r\n+cdd.obj &amp;\r\n+chdir.obj &amp;\r\n+cls.obj &amp;\r\n+copy.obj &amp;\r\n+ctty.obj &amp;\r\n+date.obj &amp;\r\n+del.obj &amp;\r\n+dir.obj &amp;\r\n+dirs.obj &amp;\r\n+doskey.obj &amp;\r\n+echo.obj &amp;\r\n+exit.obj &amp;\r\n+exit2.obj &amp;\r\n+fddebug.obj &amp;\r\n+for.obj &amp;\r\n+goto.obj &amp;\r\n+history.obj &amp;\r\n+if.obj &amp;\r\n+memory.obj &amp;\r\n+mkdir.obj &amp;\r\n+path.obj &amp;\r\n+pause.obj &amp;\r\n+popd.obj &amp;\r\n+prompt.obj &amp;\r\n+pushd.obj &amp;\r\n+rem.obj &amp;\r\n+ren.obj &amp;\r\n+rmdir.obj &amp;\r\n+set.obj &amp;\r\n+shift.obj &amp;\r\n+time.obj &amp;\r\n+truename.obj &amp;\r\n+type.obj &amp;\r\n+verify.obj &amp;\r\n+which.obj\r\nMAKE0000.$$$ =&gt; C:\\FREECOM\\SHELL\\TCCDOS.CFG\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\ncswapc.c:\r\nbatch.c:\r\ncmdtable.c:\r\ncommand.c:\r\nTurbo C++  Version 1.01 Copyright (c) 1990 Borland International\r\nexpalias.c:\r\ninit.c:\r\nkswap.c:\r\nloadhigh.c:\r\nmodule.c:\r\nredir.c:\r\nver.c:\r\nTurbo Link  Version 3.01 Copyright (c) 1987, 1990 Borland International\r\nWarning: __fstpcpy defined in module FSTPCPY.OBJ is duplicated in module FSTPCPY\r\nWarning: _exit defined in module cswapc.c is duplicated in module EXIT\r\nWarning: _putenv defined in module ENV_PUT.OBJ is duplicated in module PUTENV\r\nshell\\command.exe =&gt; C:\\FREECOM\\COMMAND.COM\r\ninfores =&gt;&gt; C:\\FREECOM\\COMMAND.COM\r\ncriter\\criter1 =&gt;&gt; C:\\FREECOM\\COMMAND.COM\r\ncriter\\criter =&gt;&gt; C:\\FREECOM\\COMMAND.COM\r\nstrings\\strings.dat =&gt;&gt; C:\\FREECOM\\COMMAND.COM\r\nPoking: @19DF:0080 = 1</PRE>\r\n\r\n</UL>\r\n\r\n<HR>\r\n<HR WIDTH=50%><HR WIDTH=25%><HR WIDTH=5%><P ALIGN=CENTER>\r\nCopyright 2002 &copy; Steffen Kaiser - former maintainer of FreeCOM\r\n<P>\r\n<FONT SIZE=1>\r\n<A HREF=\"ftp://ftp.cs.pdx.edu/pub/elvis/\"><IMG SRC=\"../images/vi.gif\" ALT=\"Elvis - The VI clone\"></A>\r\n</FONT>\r\n</BODY>\r\n</HTML>\r\n"
  },
  {
    "path": "docs/html/commands/FreeCOM.html",
    "content": "<!-- $Id$ -->\r\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\r\n<HTML>\r\n<HEAD>\r\n<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\r\n<META HTTP-EQUIV=\"Content-Language\" CONTENT=\"en\">\r\n<META NAME=\"GENERATOR\" CONTENT=\"VI\">\r\n<META NAME=\"DESCRIPTION\" CONTENT=\"Description of features and implementation status of FreeCOM, the COMMAND.COM replacement\">\r\n<META NAME=\"AUTHOR\" CONTENT=\"Steffen Kaiser\">\r\n<META NAME=\"KEYWORDS\" CONTENT=\"DOS, FreeDOS, FreeCOM, COMMAND.COM, CLI\">\r\n<META NAME=\"dATE\" CONTENT=\"2001-02-06\">\r\n<TITLE>Description of Features and Implementation Status of FreeCOM</TITLE>\r\n</HEAD>\r\n\r\n<BODY>\r\n<OL>\r\n<LI><A HREF=\"!!:intro\">Introduction</A>\r\n<LI><A HREF=\"!!:cmdline\">FreeCOM Command Line Syntax - Useage, Switches\r\n\tand Options</A>\r\n<LI><A HREF=\"!!:envvars\">Environment Variables</A>\r\n<LI><A HREF=\"!!:icmds\">Internal Commands</A>\r\n<LI><A HREF=\"!!:userprompt\">User Prompt</A>\r\n\t<OL>\r\n\t<LI><A HREF=\"!!:cmdline-syntax\">Command Line Syntax</A>\r\n\t<LI><A HREF=\"!!:cmdline-editing\">Command Line Editing</A>\r\n\t</OL>\r\n<LI><A HREF=\"!!:features\">Features of FreeCOM</A>\r\n<LI><A HREF=\"!!:status\">Status of FreeCOM / To-do List</A>\r\n<LI><A HREF=\"!!:appendix\">Appendix</A>\r\n\t<OL>\r\n\t<LI><A HREF=\"!!:compile\">Compile FreeCOM - sample</A>\r\n\t<LI><A HREF=\"!!:download\">Download</A>\r\n\t<LI><A HREF=\"!!:cvs-tags\">CVS Resources</A>\r\n\t<LI><A HREF=\"!!:bugzilla\">Bug Tracking / Bugzilla</A>\r\n\t<LI><A HREF=\"!!:ebnf\">EBNF</A>\r\n\t</OL>\r\n</OL>\r\n\r\n<P><HR><P>\r\n<H1><A NAME=\"-intro\">Introduction</A></H1>\r\n\r\nFreeCOM is a:\r\n<UL>\r\n<LI><B>C</B>ommand <B>L</B>ine <B>I</B>nterface,\r\n<LI>(user) shell and/or\r\n<LI>COMMAND.COM replacement\r\n</UL>for DOS. It has been spawned as part of\r\n<A HREF=\"http://www.freedos.org\">FreeDOS</A>, a project that aims to implement\r\na GNU GPL'ed DOS.\r\n\r\n<P>The main duty of FreeCOM is to prompt the user\r\n<A HREF=\"!!:userprompt\">to enter commands</A>, which are interpreted,\r\nprocessed directly by FreeCOM or executed as executable files.\r\n\r\n<P>Those commands processed by FreeCOM directly are called\r\n<A HREF=\"!!:icmds\"><EM>Internal Commands</EM></A>.\r\n\r\n<P>Non-internal commands, which cannot be processed by FreeCOM directly,\r\nare called <EM>External Commands</EM>, because FreeCOM will search for\r\nfiles equally named as typed-in.\r\n\r\n<P>Besides to implement certain commands FreeCOM offers some\r\n<A HREF=\"!!:features\">features</A>.\r\n\r\n<P><HR><P>\r\n<H1><A NAME=\"-cmdline\">Command Line Syntax, Useage, Switches and Options</A></H1>\r\n\r\nEBNF: COMMAND.COM [ path [ console ] ] [{ option }] [ '/' ( K | C ) <<commandline>> ]\r\n\r\n<P>If present, the first non-option argument specifies the location in\r\nwhich FreeCOM resides. This location is later stored in the environment\r\nvariable COMSPEC. Since DOS3+ this option is no longer necessary to find\r\nthe shell invoked during the boot process, but it may be used to let the\r\nsystem boot a primary shell from one location, but use a shell of the\r\nsame version from a different location later on.\r\n<BR>One shallt not point to a RAMdisk at this time, because FreeCOM\r\nneeds to reload certain information relatively early during execution,\r\nbefore AUTOEXEC.BAT had been executed, in which, normally, FreeCOM is\r\ncopied into the RAMdisk.\r\n<BR>For convinience FreeCOM checks, if at the given location a FreeCOM\r\nexists <STRONG>and</STRONG> is accessable, if not, the given location is\r\nignored. Also, the standard requires to specify a path only, but\r\nFreeCOM accepts an absolute filename, so accepting that FreeCOM is not\r\nnecessarily named <TT>COMMAND.COM</TT>.\r\n\r\n<P>The second non-option argument, if present, specifies the console FreeCOM\r\nshall enable. This setting is system-wide and is not limited to FreeCOM or\r\njust this particular process tree. In its result, this argument is identical\r\nto the CTTY command.\r\n\r\n<P>FreeCOM knows the following options:\r\n<UL>\r\n<LI><OPT>/?</OPT>: Issues a help screen, then exists.\r\n<LI><OPT>/!</OPT>: Enable/disable debugging support, if compiled to FreeCOM.\r\n<LI><OPT>/Y</OPT>: Enables trace/single step mode. This mode is deaktivated\r\nwhen the user prompt has been reached.\r\n<LI><OPT>/D</OPT>: Disables to parse AUTOEXEC.BAT, even if the\r\n<OPT>/P</OPT> option is present. This switch is usually set by the\r\nkernel, when F5 had been pressed during bootup.\r\n<LI><OPT>/F</OPT>: Enables autofail of Critical Errors; then instead of\r\ndisplaying the Abort/Retry/Ignore/Fail dialog, Critical Errors are\r\nautomatically answered with Fail.\r\n<LI><OPT>/P</OPT>: Installs a primary copy of FreeCOM. Such instance:\r\n\t<OL>\r\n\t<LI>cannot be terminated with the EXIT command.\r\n\t<LI>executes the <CMD>AUTOEXEC.BAT</CMD> script before any other command.\r\n\t</OL>\r\nThe <OPT>/P</OPT> option may have an argument to specify an alternate name for the\r\nAUTOEXEC script, e.g.: <OPT>/P:FDAUTO.BAT</OPT>.\r\n<LI><OPT>/E</OPT>: Sets another size of the environment segment, in which all the\r\nenvironment variables are stored, e.g.: <OPT>/E:1024</OPT>.\r\n<LI><OPT>/L</OPT>: Sets the size of the internal command buffer. <EM>Note</EM>:\r\nThis option is ignored currently, the internal buffer always defaults to 512 bytes.\r\n<LI><OPT>/U</OPT> Sets the size of the internal user input buffer. <EM>Note</EM>:\r\nThis option is ignored currently. The input buffer always defaults to 255 bytes,\r\nwhich is the maximum.\r\n<LI><OPT>/Z</OPT>: Displays the errorlevel whenever an external program\r\nterminates. Avaiable, if FreeCOM had been compiled <CODE>DISP_EXITCODE</CODE>.\r\n<LI><OPT>/LOW</OPT>: Forces to load FreeCOM low. <EM>Note</EM>: Currently this option\r\nhas no effect, because no part of FreeCOM is loaded high.\r\n<LI><OPT>/MSG</OPT>: Installs the message server. <EM>Note</EM>: Because the message\r\nserver is not used nowadays, this option forces to permanently load FreeCOM's\r\nmessages into memory.\r\n<LI><OPT>/SWAP</OPT>: Toggles, if to default to swapping or not; due to different default\r\n\tvalues of this <EM>internal</EM> flag, it is recommended to always prefix the option\r\n\twith '<CODE>+</CODE>' to enable or '<CODE>-</CODE>' to disable swapping.\r\n</UL>\r\n\r\nThe options <OPT>/K</OPT> and <OPT>/C</OPT> are special cases and do not behave as normal\r\noptions does. They are exclusive and all characters at the right side of \r\nsuch option <FONT SIZE=\"-2\">(except an optional argument sign)</FONT> specify a\r\ncommand to execute, e.g.: <CMD>/C DIR /s</CMD>, <CMD>/C=DIR /s</CMD>, and <CMD>/CDIR /s</CMD>\r\ndo behave exactly the same and execuate the command <CMD>DIR /s</CMD>.\r\n<BR>If these options are used in conjunction with the <OPT>/P</OPT> option, the AUTOEXEC.BAT\r\nscript is executed prior executing the specified command.\r\n<BR>In opposite to <OPT>/K</OPT> the <OPT>/C</OPT> option does not enter\r\nthe interactive shell prompt after executing the specified command unless\r\nthe <OPT>/P</OPT> options is present, too.\r\n\r\n<P>Boolean options, which can only be <EM>enabled</EM> or <EM>disabled</EM>, may be\r\nprefixed by '<CODE>+</CODE>' to enable or '<CODE>-</CODE>' to disable it.\r\n\r\n<P><HR><P>\r\n<H1><A NAME=\"-envvars\">Environment Variables</A></H1>\r\n\r\nEnvironment variables can be freely assigned using the SET command,\r\ne.g. executing:<BR>\r\nCMD: SET var1=tecxsgk;jsdgsdflfsjdflkasjf/lasjflas\r\n<BR>assigns this nonsense to the variable <TT>var1</TT>. Later on, the\r\nvalue of the variable can be used by writing: <CMD>%var1%</CMD>, thus, writing\r\nthe name of the variable enclosed without whitespace by two percent\r\nsigns.\r\n<STRONG>Warning</STRONG>: Environment variables are expanded fully into plain\r\ntext before the command line is furtherly parsed. If a variable contains\r\nan odd number of quotes, the remaining command line must contain the closing quote\r\nin order to operate properly. Also see this:<BR>\r\nCMD: SET var=text del\r\nCMD: IF text==%var% GOTO label\r\n<BR>The second line looks uninteresting, but once the environment variable\r\nhas been expanded the line has morphed into:<BR>\r\nCMD: IF text==text del GOTO label\r\n<BR>not that funny anymore, because the IF command\r\ninterpretes only the string <CMD>text==text</CMD> as condition, but <CMD>del GOTO label</CMD>\r\nis executed as command.\r\n\r\n<P>FreeCOM uses a number of environment variables for its own purpose.\r\n\r\n<UL>\r\n<LI><B>COMSPEC</B>: FreeCOM loads some information on demand, these data\r\nare stored in the FreeCOM executable. The value of this environment variable\r\ncontains the filename FreeCOM shall use. The contents can be changed with the\r\nSET command.\r\n<LI><B>DIRCMD</B>: The user may define default values for the\r\nDIR command. Any options specified within <TT>DIRCMD</TT> are prefixing any\r\nentered ones, so to say FreeCOM behaves as if the user always types:<BR>\r\nCMD: DIR %DIRCMD% &laquo;other arguments&raquo;\r\n<BR>This variable must be changed using the SET command.\r\n<LI><B>COPYCMD</B>: This variable contains default options for the COPY command.\r\n<LI><B>PROMPT</B>: FreeCOM prompts the user to enter commands to run, the prompt can be\r\ncustomized by changing the contents of this variable.\r\n<BR>This variable can be changed using the SET or the PROMPT commands. Latter one includes\r\na detailed description of the format of the prompt string.\r\n<LI><B>PATH</B>: When FreeCOM is to execute an external command and this one does not\r\ncontain no path, FreeCOM searched for the command in a number of paths. These ones\r\nare enumerated by the PATH environment variable.\r\n<BR>This variable can be changed using the SET or the PATH commands. Latter one includes\r\na detailed description of the format of the search path.\r\n</UL>\r\n\r\n\r\n<P>There are a number of automatic variables that do not follow the above mentioned\r\nsyntax and which contents is automatically generated. Unlike the normal\r\nvariables these automatic variables are constructed of exactly two characters,\r\nthe first one is a single percent sign and the second one the variable identifier:\r\n<UL>\r\n<LI><B>%?</B>: expands to the current errorlevel, which is the exit code of\r\nthe previously executed external command.\r\n<LI><B>%0</B>: in <A HREF=\"!:batch\">batch scripts</A> only: is the name of the script currently\r\nexecuted.\r\n<LI><B>%1</B> through <B>%9</B>: in <A HREF=\"!:batch\">batch scripts</A> only: are the first through nineth\r\nargument passed to the currently executed batch script. If less than nine arguments\r\nhad been passed to the script, they return an empty string. To access the\r\ntenth argument please refer to the SHIFT command.\r\n<LI> <CMD>FOR <B>%v</B> IN (...) DO &laquo;any command&raquo;</CMD>: <B>%v</B> may use\r\nany letter, the FOR command creates a new\r\nvariable, which is valid in the &laquo;any command&raquo; following the <CMD>DO</CMD>\r\nkeyword.\r\n<LI><B>%%</B>: Is no real variable, but expands to a single percent sign.\r\n</UL>\r\n<P>Because automatic variables have one percent sign only, it sometimes lead to\r\nconfusion within the FOR command, e.g. in:<BR>\r\nCMD: SET adam=eva\r\nCMD: FOR %a in (*.*) DO echo %adam% %a\r\n<BR><CMD>%adam</CMD> is interpreted as [<CMD>%a</CMD>]dam.\r\n\r\n<P><HR><P>\r\n<H1><A NAME=\"-icmds\">Internal Commands</A></H1>\r\nInternal commands will be processed by FreeCOM directly, they are available\r\nto the user without presence of any external files, in fact they hide\r\nExternal Commands named equally.\r\n\r\n<P>The synopsises of the <A HREF=\"cmd.html\">internal commands</A>\r\nare described in a style derived from <A HREF=\"!!:ebnf\">EBNF</A>.\r\n\r\n<P><HR><P>\r\n<H1><A NAME=\"-userprompt\">User Prompt</A></H1>\r\n\r\nFreeCOM knows two modes:\r\n<OL>\r\n<LI>Interactive, and\r\n<LI><A HREF=\"!:batch\">batch processing</A>.\r\n</OL>\r\n\r\nThe second one performs batch scripts, which are more or less a sequence of\r\ncommands written to a file. Such files may contain any external commands,\r\ninternal commands and calls to other batch files as well.\r\n\r\n<P>In interactive mode FreeCOM prompts the user to enter a command, the line is\r\ninterpreted, parsed and, finally, either rejected because of an error or executed.\r\n\r\n<H2><A NAME=\"-cmdline-syntax\">Command Line Syntax</A></H2>\r\n\r\nFreeCOM accepts the following command line:<BR>\r\nEBNF: [ ':' ] [ '?' ] [ '@' ] [ '*' ] { command [{ argument | redirection }] : '|' }\r\nEBNF: redirection ::= ( '<' | '>' | '>>' ) filename\r\n\r\n<P>The first optional <CMD>?</CMD> must not be mixed up with the command <CMD>?</CMD>!\r\n\r\n<H3>Description:</H3>\r\n<P>The colon marks the line as label, which causes to let FreeCOM ignore the line\r\ncompletely as no interpretation is tried on this line, neiter are any <A HREF=\"!:redirection\">redirections</A>\r\ncreated.\r\n<P>The <CMD>?</CMD> forces FreeCOM to enable the trace mode for this line. In trace mode\r\nFreeCOM prompts the user wether to execute the resulting command.\r\n<P>The optional <CMD>@</CMD> disables the echo status for this line. If the echo status\r\nis enabled, the line is displayed right before it is executed; see ECHO for more details.\r\n<P>The asterisk <CMD>*</CMD> is available only, if aliases are compiled into\r\nFreeCOM; if present, the <A HREF=\"!!:features\">alias expansion</A> is skipped.\r\n<P>If commands are chained with the <CMD>|</CMD> symbols, those commands are to be executed\r\nas a <EM>pipe</EM>. For instance the command line:<BR>\r\nCMD: cmd1 | cmd2 | cmd3\r\n<BR>forms a pipe consisting of the three individual commands <CMD>cmd1</CMD>, <CMD>cmd2</CMD>, and\r\n<CMD>cmd3</CMD>, where the standard output stream of <CMD>cmd1</CMD> is connected to the\r\nstandard input stream of <CMD>cmd2</CMD> and the output of <CMD>cmd2</CMD> to the input\r\nof <CMD>cmd3</CMD>. <EM>Note:</EM> Because DOS is no multitasking environment, pipes are\r\nsimulated with file and the three-command pipe will look like this:<BR>\r\nCMD: cmd1 >%TEMP%\\cmd###1.tmp\r\nCMD: cmd2 <%TEMP%\\cmd###1.tmp >%TEMP%\\cmd###2.tmp\r\nCMD: cmd3 <%TEMP%\\cmd###2.tmp\r\n<BR>The files are temporary ones and will be removed as soon as they are\r\nno longer required, meaning the tempfile #1 is removed after <CMD>cmd2</CMD>\r\nterminates and tempfile #2 upon termination of <CMD>cmd3</CMD>.\r\n<P>Redirections tie the standard input or output stream to a file or device,\r\nfor instance:<BR>\r\nCMD: cmd arg <infile >>outfile\r\n<BR>redirects the standard input stream of <CMD>cmd</CMD> to the file <TT>infile</TT> and the\r\nstandard output stream to <TT>outfile</TT>. The double output redirection specifies to append\r\nto an existing file rather than overwriting it.\r\n\r\n<H2><A NAME=\"-cmdline-editing\">Command Line Editing</A></H2>\r\nFreeCOM offers two methods to interactively enter command lines:\r\n<OL>\r\n<LI>standard input, and\r\n<LI>enhanced input.\r\n</OL>\r\nThe first one just calls a DOS function, whereas the second one processes each\r\nkey for its own. Which method FreeCOM uses is defined at compile time.\r\n\r\n<P>If the echo state is enabled, the user is <EM>prompted</EM> with the\r\nPROMPT string; otherwise no visible or audible prompt is issued to\r\nindicate an user activity request.\r\n\r\n<P>In either mode the <TT>ENTER</TT> key terminates the editing and\r\nlets FreeCOM start to interprete the entered line.\r\n\r\n<P>The <STRONG>standard input</STRONG> mode does neither support command line\r\nhistory, except the last command line in some circumstances, nor file completion.\r\nThe following keys have a special meaning:\r\n<BR><TABLE WIDTH=\"100%\" BORDER=1>\r\n<TR>\t<TH>Key</TH>\r\n\t\t<TH>Meaning</TH>\r\n<TR>\t<TD ALIGN=CENTER>F1</TD>\r\n\t\t<TD>Get next character from last line, if available</TD>\r\n<TR>\t<TD ALIGN=CENTER>F3</TD>\r\n\t\t<TD>Get last line, if available</TD>\r\n<TR>\t<TD ALIGN=CENTER>F5</TD>\r\n\t\t<TD>Place current line in last-line buffer and restart editing on a blank line</TD>\r\n<TR>\t<TD ALIGN=CENTER>F6</TD>\r\n\t\t<TD>Insert the pseudo-character <EM>End-of-file</EM></TD>\r\n<TR>\t<TD ALIGN=CENTER>backspace</TD>\r\n\t\t<TD>delete character to the left</TD>\r\n<TR>\t<TD ALIGN=CENTER>cursor left</TD>\r\n\t\t<TD>delete character to the left</TD>\r\n<TR>\t<TD ALIGN=CENTER>cursor right</TD>\r\n\t\t<TD>Get next character from last line, if available</TD>\r\n</TABLE>\r\n\r\n\r\n<P>The <STRONG>enhanced input</STRONG> mode does support command line history and\r\nfile completion.  The following keys have a special meaning:\r\n<BR><TABLE WIDTH=\"100%\" BORDER=1>\r\n<TR>\t<TH>Key</TH>\r\n\t\t<TH>Meaning</TH>\r\n<TR>\t<TD ALIGN=CENTER>F1</TD>\r\n\t\t<TD>Get next character from last line, if available</TD>\r\n<TR>\t<TD ALIGN=CENTER>F3</TD>\r\n\t\t<TD>Get last line, if available</TD>\r\n<TR>\t<TD ALIGN=CENTER>F5</TD>\r\n\t\t<TD>Place current line in last-line buffer and restart editing on a blank line</TD>\r\n<TR>\t<TD ALIGN=CENTER>backspace</TD>\r\n\t\t<TD>delete character to the left</TD>\r\n<TR>\t<TD ALIGN=CENTER>cursor down</TD>\r\n\t\t<TD>Replace the current input line with the previous line from the history</TD>\r\n<TR>\t<TD ALIGN=CENTER>cursor left</TD>\r\n\t\t<TD>move cursor one character one position to the left</TD>\r\n<TR>\t<TD ALIGN=CENTER>cursor right</TD>\r\n\t\t<TD>Move cursor one position to the right; at the end of the line\r\n\t\t\tget next character from last line, if available</TD>\r\n<TR>\t<TD ALIGN=CENTER>cursor up</TD>\r\n\t\t<TD>Replace the current input line with the next line from the history</TD>\r\n<TR>\t<TD ALIGN=CENTER>delete</TD>\r\n\t\t<TD>Deletes the character on the cursor</TD>\r\n<TR>\t<TD ALIGN=CENTER>end</TD>\r\n\t\t<TD>Moves the cursor to the end of the line</TD>\r\n<TR>\t<TD ALIGN=CENTER>ESC</TD>\r\n\t\t<TD>Clear current line</TD>\r\n<TR>\t<TD ALIGN=CENTER>home</TD>\r\n\t\t<TD>moves the cursor to the beginning of the line</TD>\r\n<TR>\t<TD ALIGN=CENTER>insert</TD>\r\n\t\t<TD>Switch between insert and overwrite mode</TD>\r\n<TR>\t<TD ALIGN=CENTER>TAB</TD>\r\n\t\t<TD>Take the current word for a file and try to complete it</TD>\r\n<TR>\t<TD ALIGN=CENTER>^C</TD>\r\n\t\t<TD>Clear current line and enable echo state. <FONT SIZE=\"-1\">The echo state is\r\n\t\t\tenabled to ensure the user gets to know he is on the command line of\r\n\t\t\tFreeCOM rather than stuck in a non-interruptable program.</FONT></TD>\r\n</TABLE>\r\n\r\n<P><HR><P>\r\n\r\n<P><HR><P>\r\n<H1><A NAME=\"-features\">Features of FreeCOM</A></H1>\r\n\r\nFreeCOM implements the following features:\r\n<UL>\r\nSKAUS_EVALUATE_PERL: $_ = $features\r\n</UL>\r\n\r\n<P><HR><P>\r\n<H1><A NAME=\"-status\">Status of FreeCOM</A></H1>\r\n\r\nFreeCOM's development currently targets the v1.0 version, which is to\r\nprovide all functionality (features) of commonly known COMMAND.COMs at\r\nminimum, but probably at the cost of optimization and performance.\r\n\r\n<P>The To-Do list:\r\n<BR><TABLE BORDER=1 WIDTH=\"100%\">\r\n<TR>\t<TH>Feature</TH>\r\n\t\t<TH ALIGN=CENTER>Target</TH>\r\n</TR>\r\n<TR>\t<TD>Swapping without any supporting secondary programs\r\n\t\t\t(<CMD>KSSF.COM</CMD> and <CMD>VSPAWN.COM</CMD>)</TD>\r\n\t\t<TD ALIGN=CENTER><HELL>v0.90</HELL></TD>\r\n</TR>\r\n<TR>\t<TD>INT-2E backdoor</TD>\r\n\t\t<TD ALIGN=CENTER><HELL>v0.90</HELL></TD>\r\n<TR>\t<TD>Wildcards for <CMD>REN</CMD>, same filename pattern matching code\r\n\t\t\tfor <CMD>REN</CMD>, <CMD>COPY</CMD> and <CMD>DIR</CMD></TD>\r\n\t\t<TD ALIGN=CENTER><HELL>v0.93</HELL></TD>\r\n</TR>\r\n<TR>\t<TD><CMD>IF /I</CMD></TD>\r\n\t\t<TD ALIGN=CENTER><HELL>v0.85</HELL></TD>\r\n</TR>\r\n<TR>\t<TD>Input/output functions to replace <TT>&lt;stdio.h&gt;</TT> by\r\n\t\t\t<TT>&lt;io.h&gt;</TT> (aka replace <TT>FILE*</TT>-based\r\n\t\t\tI/O by handle-based one)</TD>\r\n\t\t<TD ALIGN=CENTER><A HREF=\"!!:todo1\"><HELL>v0.95</HELL></A></TD>\r\n</TR>\r\n<TR>\t<TD>Strict error recognition, probably <TT>_doserrno</TT>\r\n\t\t\tbased</TD>\r\n\t\t<TD ALIGN=CENTER><A HREF=\"!!:todo1\"><HELL>v0.97</HELL></A></TD>\r\n</TR>\r\n<TR>\t<TD>Support for <CMD>DOS=HIGH</CMD></TD>\r\n\t\t<TD ALIGN=CENTER><HELL>v0.90</HELL></TD>\r\n</TR>\r\n<TR>\t<TD>Code sharing of modules</TD>\r\n\t\t<TD ALIGN=CENTER><HELL>v0.91</HELL></TD>\r\n</TR>\r\n<TR>\t<TD>Redirection in conjunction with Swapping</TD>\r\n\t\t<TD ALIGN=CENTER><HELL>v0.90</HELL></TD>\r\n</TR>\r\n<TR>\t<TD>Optimize FreeCOM for size</TD>\r\n\t\t<TD ALIGN=CENTER>post v1.0</TD>\r\n</TR>\r\n<TR>\t<TD>Other swap storage areas, e.g. XMS and EMS</TD>\r\n\t\t<TD ALIGN=CENTER><A HREF=\"!!:todo2\">post v1.0</A></TD>\r\n</TR>\r\n<TR>\t<TD>Long filenames</TD>\r\n\t\t<TD ALIGN=CENTER>post v1.0</TD>\r\n</TR>\r\n<TR>\t<TD><A HREF=\"!!:icmds\">internal commands</A></TD>\r\n\t\t<TD ALIGN=CENTER><A HREF=\"!!:icmds\">mostly done</A></TD>\r\n</TR>\r\n<TR>\t<TD>Aliases: ALIAS</TD>\r\n\t\t<TD ALIGN=CENTER><DIMM>done</DIMM></TD>\r\n</TR>\r\n<TR>\t<TD>Command line history: HISTORY</TD>\r\n\t\t<TD ALIGN=CENTER><DIMM>done</DIMM></TD>\r\n</TR>\r\n<TR>\t<TD>Directory stack: DIRS, PUSHD, and POPD</TD>\r\n\t\t<TD ALIGN=CENTER><DIMM>done</DIMM></TD>\r\n</TR>\r\n<TR>\t<TD>MUX-AE interface</TD>\r\n\t\t<TD ALIGN=CENTER><DIMM>done</DIMM></TD>\r\n</TR>\r\n<TR>\t<TD><A HREF=\"!!:cmdline-editing\">Enhanced command line editing,\r\n\t\t\tfile completion</A></TD>\r\n\t\t<TD ALIGN=CENTER><DIMM>done</DIMM></TD>\r\n</TR>\r\n<TR>\t<TD>Last directory recognition: CD, CDD, PUSHD</TD>\r\n\t\t<TD ALIGN=CENTER><DIMM>done</DIMM></TD>\r\n</TR>\r\n<TR>\t<TD>Control Break handler</TD>\r\n\t\t<TD ALIGN=CENTER><DIMM>done</DIMM></TD>\r\n</TR>\r\n<TR>\t<TD>Critical Error handler</TD>\r\n\t\t<TD ALIGN=CENTER><DIMM>done</DIMM></TD>\r\n</TR>\r\n<TR>\t<TD><CMD>IF ERRORLEVEL H<I>&lt;letter&gt;</I></CMD></TD>\r\n\t\t<TD ALIGN=CENTER><DIMM>done (v0.82pl1)</DIMM></TD>\r\n</TR>\r\n<TR>\t<TD>Full support for DOS NLS</TD>\r\n\t\t<TD ALIGN=CENTER><DIMM>done (v0.82pl1)</DIMM></TD>\r\n</TR>\r\n<TR>\t<TD><CMD>DIR /O</CMD> and <CMD>DIR /A</CMD></TD>\r\n\t\t<TD ALIGN=CENTER><DIMM>done (v0.82pl2)</DIMM></TD>\r\n</TR>\r\n</TABLE>\r\n<BR><!-- FONT SIZE=\"-1\" -->Footnotes:\r\n<UL>\r\n<LI><A NAME=\"-todo1\">I/O replacement shallt preceed error reporting\r\ncorrection as some failures are impossible to detect without work-arounds\r\nwith the <TT>&lt;stdio.h&gt;</TT> functions.</A>\r\n<LI><A NAME=\"-todo2\">If I get contributions after v0.90, those portion\r\nmay be added earlier.</A>\r\n</UL>\r\n<!-- /FONT -->\r\n\r\n<P><HR><P>\r\n<H1><A NAME=\"-appendix\">Appendix</A></H1>\r\n\r\n<H2><A NAME=\"-compile\">Compile FreeCOM - sample</A></H2>\r\nDue to heavy request, there is a sample description\r\n<A HREF=\"build48.html\">how to compile FreeCOM in ten steps</A>.\r\n\r\n<H2><A NAME=\"-download\">Download</A></H2>\r\n\r\nFreeCOM can be downloaded from SourceForge in several ways and packages:\r\n\r\n<OL>\r\n<LI><A HREF=\"!!:cvs-tags\">source code files from the CVS repository</A>\r\n<LI><A HREF=\"!!:download-ftp\">tarball and pre-compiled packages from anonymous FTP</A>\r\n<LI><A HREF=\"!!:download-http\">tarball and pre-compiled packages via HTTP</A>\r\n<LI><A HREF=\"!!:download-filerelease\">tarball and one pre-compiled package as file release</A>\r\n</OL>\r\n\r\n\r\n<H3><A NAME=\"-download-ftp\">Resources accessable via anonymous FTP</A></H3>\r\n\r\nSourceForge closed the FTP - Services.\r\n\r\n<H3><A NAME=\"-download-http\">Resources accessable via HTTP</A></H3>\r\n\r\n<A HREF=\"http://freedos.sourceforge.net/freecom/packages/\">http://freedos.sourceforge.net/freecom/packages/</A>\r\ncontains several variants of tarballs and pre-compiled packages of FreeCOM.\r\nThe files immediately located in the directory contain the most current\r\nmajor release of FreeCOM, whereas the subdirectories include Beta releases\r\nof the upcoming release.\r\n\r\n<P>The packages themselves include:\r\n<TABLE BORDER=1>\r\n<TR>\t<TH>file name</TH>\r\n\t\t<TH>contents</TH>\r\n</TR>\r\n<TR>\t<TD><TT>COM###.ZIP</TT> or <TT>Com###Beta##.ZIP</TT></TD>\r\n\t\t<TD>tarball (<FONT SIZE=\"-1\">the source code tree without CVS\r\n\t\t\tinformation</FONT>)</TD>\r\n</TR>\r\n<TR>\t<TD><TT>BINARY.ZIP</TT></TD>\r\n\t\t<TD>the most commonly used pre-compiled FreeCOM with\r\n\t\t\talmost any feature, but debugging enabled.\r\n\t\t\t<BR>This release uses standard swapping mechanisms!</TD>\r\n</TR>\r\n<TR>\t<TD><TT>XMSSWAP.ZIP</TT></TD>\r\n\t\t<TD>the most commonly used pre-compiled FreeCOM with\r\n\t\t\talmost any feature, but debugging enabled.\r\n\t\t\t<BR>This release uses XMS-Only swapping mechanism!</TD>\r\n</TR>\r\n<TR>\t<TD><TT>PLAINEDT.ZIP</TT></TD>\r\n\t\t<TD>As <TT>BINARY.ZIP</TT> but using the plain command line\r\n\t\t\teditor of the kernel instead of the enhanced one</TD>\r\n</TR>\r\n<TR>\t<TD><TT>DEBUG.ZIP</TT></TD>\r\n\t\t<TD>As <TT>BINARY.ZIP</TT> with debugging support enabled.\r\n\t\t\t<BR>This variant is a lot larger than the standard release\r\n\t\t\tand can generate lots of output.</TD>\r\n</TR>\r\n<TR>\t<TD><TT>LOCALIZE.ZIP</TT></TD>\r\n\t\t<TD>As <TT>BINARY.ZIP</TT> but targetted at maintainers of\r\n\t\t\ta language description file (<TT>*.LNG</TT>).</TD>\r\n</TR>\r\n<TR>\t<TD><TT>SUPPL.ZIP</TT></TD>\r\n\t\t<TD>the SUPPL library required for linking FreeCOM precompiled\r\n\t\t\tfor use with Turbo C++ v1.01</TD>\r\n</TR>\r\n<TR>\t<TD><TT>DOCS.ZIP</TT></TD>\r\n\t\t<TD>a package with these HTML documents</TD>\r\n</TR>\r\n</TABLE>\r\n\r\n<H3><A NAME=\"-download-filerelease\">File Releases on SourceForge</A></H3>\r\n\r\nOn <A HREF=\"http://sourceforge.net/file/?group_id=5109\">SourceForge</A>\r\nso-called <EM>File Releases</EM> can be created. The file release section of\r\nthe FreeCOM module contains a source ZIP and a binary ZIP file, they are equal\r\nto the tarball and the <TT>BINARY.ZIP</TT> on the anon FTP space respectively.\r\nUnlike the FTP space, old versions are kept, but no Beta versions or side branches.\r\n\r\n<H2><A NAME=\"-cvs-tags\">CVS Resources</A></H2>\r\n\r\nOn <A HREF=\"http://sourceforge.net/project/?group_id=5109\">SourceForge</A>\r\na short description of how to access the CVS repository is located.\r\nFollowing those instructions will download the main trunk of the\r\nspecified module of the repository,\r\ne.g.: <PRE>cvs -z6 co freecom</PRE> downloads the <TT>MAIN</TT> trunk, also\r\ncalled <TT>HEAD</TT>, of FreeCOM.\r\n\r\n<P>Alternatively the <A HREF=\"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/freedos/freecom/?only_with_tag=MAIN\">WebCVS</A>\r\n-- follow the <TT>Browse CVS</TT> link there and remember to select the\r\n<TT>MAIN</TT> branch\r\n-- might be helpful in order to download a handful of files.\r\n\r\n<P>However, CVS allows to branch the development of a module at some\r\npoint from the main trunk into side trees. On these branches the module\r\ncan be developed further, new features can be added etc., without\r\ndisturbing the main trunk (and therefore the primary release) of the\r\nmodule. When the side development proved its worthiness, the changes are\r\nmerged into the main trunk and, hence, becomes part of the primary\r\nrelease.\r\n\r\n<P>Branches are marked by tags, though, unlike normal tags branch tags\r\nautomatically evolve with the file, what means that when a file from a\r\nspecific branch is updated, the branch tag automatically move from the\r\ncurrent version of the file to the new one.\r\n<BR>To check out a branch, create a new directory, change within it and\r\nexecute:\r\n<PRE>cvs -z6 co -r tag freecom</PRE>,\r\nwhere <TT>tag</TT> is the name of the branch you want to download.\r\n<EM>Note</EM>: It is not advisable to use the same directory to manage\r\nfiles for two different branches.\r\n\r\n<P>The FreeCOM module has the following <EM>active</EM> branches:\r\n<CENTER><TABLE BORDER=1 WIDTH=\"100%\">\r\n<TR>\t<TH ALIGN=CENTER>Tag</TH>\r\n\t\t<TH>Meaning</TH>\r\n<TR>\t<TD ALIGN=CENTER>expExec</TD>\r\n\t\t<TD>Stack-based execution context implementation</TD>\r\n<TR>\t<TD ALIGN=CENTER>expSpawn</TD>\r\n\t\t<TD>Module based FreeCOM, bases on expRes branch</TD>\r\n</TABLE></CENTER>\r\n\r\n<P>The FreeCOM module has the following <EM>obsoleted</EM> branches:\r\n<CENTER><TABLE BORDER=1 WIDTH=\"100%\">\r\n<TR>\t<TH ALIGN=CENTER>Tag</TH>\r\n\t\t<TH>Meaning</TH>\r\n<TR>\t<TD ALIGN=CENTER>expRes</TD>\r\n\t\t<TD>Resource management implementation.\r\n\t\t\t<BR>Finally merged into trunk as of 2001/03/10</TD>\r\n</TABLE></CENTER>\r\n\r\n<HR>\r\n<H2><A NAME=\"-bugzilla\">Bug Tracking / Bugzilla</A></H2>\r\n\r\nFreeCOM uses <A HREF=\"http://www.freedos.org/bugs/bugzilla/query.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bugidtype=include&chfieldto=Now&product=Freecom&short_desc_type=allwordssubstr&long_desc_type=allwordssubstr&bug_file_loc_type=allwordssubstr&cmdtype=doit&order=Reuse+same+sort+as+last+time\">FreeDOS's Bugzilla</A> for tracking bugs and the like.\r\n\r\n<HR>\r\n<H2><A NAME=\"-ebnf\">EBNF</A></H2>\r\n\r\nDocuments encode the synopsis of the commands with operators derived from\r\nEBNF (<B>E</B>xtended <B>B</B>ackus-<B>N</B>aur <B>F</B>ormula).\r\n\r\n<H3>Type setting</H3>\r\n\r\nDepending on different meanings characters are set into various shapes:\r\n\r\n<TABLE BORDER=1 WIDTH=\"100%\">\r\n<TR>\r\n\t<TH>Name\r\n\t<TH>Meaning\r\n\t<TH>Example\r\n<TR>\r\n\t<TD ALIGN=CENTER><TT>terminal</TT>\r\n\t<TD>characters to be enterred on command line or displayed by\r\n\t\tthe computer; EBNF: \"terminal symbols\"\r\n\t<TD><TT>ECHO</TT>\r\n<TR>\r\n\t<TD ALIGN=CENTER><TT>'string'</TT>\r\n\t<TD>The quotes remove the metafunction of the enclosed characters\r\n\t\tin order to specify EBNF operators as terminal symbols.\r\n\t\tEBNF: \"terminal symbols\"\r\n\t<TD><TT>'|'</TT>\r\n<TR>\r\n\t<TD ALIGN=CENTER><B>bold</B>\r\n\t<TD>operators that constructs portions together;\r\n\t\tEBNF: \"operators\"\r\n\t<TD><B>|</B>\r\n<TR>\r\n\t<TD ALIGN=CENTER><I>italic</I>\r\n\t<TD>placeholders for arguments, which are explained in the description;\r\n\t\tEBNF: \"non-terminal symbols\"\r\n\t<TD><I>varname</I>\r\n</TABLE>\r\n\r\n<H3>Operators</H3>\r\n\r\nThe EBNF  uses the following operators:\r\n<TABLE BORDER=1 WIDTH=\"100%\">\r\n<TR>\r\n\t<TH>Symbol\r\n\t<TH>Meaning\r\n<TR>\r\n\t<TD ALIGN=CENTER><B>|</B>\r\n\t<TD>alternative; use either left or right token\r\n<TR>\r\n\t<TD ALIGN=CENTER><B>()</B> \r\n\t<TD>parenthizes enclose tokens limiting the range of <B>|</B>\r\n<TR>\r\n\t<TD ALIGN=CENTER><B>[]</B>\r\n\t<TD>brackets enclose optional tokens, thus, they may appear zero or\r\n\t\tone time; they also limit the range of <B>|</B>\r\n<TR>\r\n\t<TD ALIGN=CENTER><B>{}</B>\r\n\t<TD>curly brackets enclose repitive tokens, which may appear one or\r\n\t\tmore times; they also limit the range of <B>|</B>\r\n<TR>\r\n\t<TD ALIGN=CENTER><B>{ : }</B>\r\n\t<TD>as the normal curly brackets, but any repitive tokens are delimited\r\n\tby the token(s) right of the colon; for instance:\r\n\t<BLOCKQUOTE>\r\n\t<B>{</B> <I>file</I> <B>:</B> <TT>'+'</TT> <B>}</B>\r\n\t</BLOCKQUOTE>\r\n\tis the same as:\r\n\t<BLOCKQUOTE>\r\n\t<I>file</I> <B>[{</B> <TT>'+'</TT> <I>file</I> <B>}]</B>\r\n\t</BLOCKQUOTE>\r\n\tand applies to:\r\n\t<UL>\r\n\t<LI><I>file</I>\r\n\t<LI><I>file</I> + <I>file</I>\r\n\t<LI><I>file</I> + <I>file</I> + <I>file</I>\r\n\t<LI><I>file</I> + <I>file</I> + <I>file</I> + <I>file</I>\r\n\t<LI>...\r\n\t</UL>\r\n<TR>\r\n\t<TD ALIGN=CENTER><B>&laquo;   &raquo;</B>\r\n\t<TD>is a placeholder for an arbitary string of terminal symbols, which\r\n\t\tfurther syntax is described by the enclosed text in English\r\n\t\tnatural language.\r\n<TR>\r\n\t<TD ALIGN=CENTER><B>::=</B>\r\n\t<TD>assigns a meaning (right side) to a non-terminal symbol (left side);\r\n\t\tfor instance<PRE>\r\n\t<TT>DIR</TT> <B>[ {</B> <I>option</I> <B>|</B> <I>filespec</I> <B>} ]</B>\r\n\t<I>option</I> <B>::=</B> <TT>/</TT> <B>(</B> <TT>A</TT> <B>|</B> <TT>B</TT> <B>|</B> <TT>C</TT> <B>)</B><BR></PRE>\r\n\t\tAny occurance -- only one here -- of <I>option</I> on the right\r\n\t\tside of an <B>::=</B> or where no <B>::=</B> is present at all is\r\n\t\tto be replaced by the right side of <I>option</I><B>::=</B>.\r\n\r\n</TABLE>\r\n\r\n<P>Unless modified by above mentioned operators a sequence of tokens\r\nspecifies that each token must be present exactly one time in exactly\r\nthat order.<BR> Note: For the sake of clearness, spaces are inserted\r\nbetween tokens. These spaces do <STRONG>not</STRONG> mean that a space\r\nis allowed at this place!  Also, the fact that no <B>_</B> is present\r\ndoes <STRONG>not</STRONG> mean that at this place is none allowed. It is\r\nassumed that the reader will find the places where optional spaces are\r\nvalid either by \"doing\" or by reading the\r\nexamples.\r\n\r\n<HR>\r\n\r\n\r\n<HR WIDTH=\"50%\"><HR WIDTH=\"25%\"><HR WIDTH=\"5%\"><P ALIGN=CENTER>\r\nCopyright 2000-2001 &copy; Steffen Kaiser - current maintainer of FreeCOM\r\n<P>\r\n<FONT SIZE=1>\r\n<A HREF=\"ftp://ftp.cs.pdx.edu/pub/elvis/\"><IMG SRC=\"../images/vi.gif\" ALT=\"Elvis - The VI clone\"></A>\r\n</FONT>\r\n</BODY>\r\n</HTML>\r\n"
  },
  {
    "path": "docs/html/commands/appendix.html",
    "content": "<!-- $Id$ -->\r\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\r\n<HTML>\r\n<HEAD>\r\n<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\r\n<META HTTP-EQUIV=\"Content-Language\" CONTENT=\"en\">\r\n<META NAME=\"GENERATOR\" CONTENT=\"VI\">\r\n<META NAME=\"DESCRIPTION\" CONTENT=\"Appendix to the Description of Features and Implementation Status of FreeCOM, the COMMAND.COM Replacement\">\r\n<META NAME=\"AUTHOR\" CONTENT=\"Steffen Kaiser\">\r\n<META NAME=\"KEYWORDS\" CONTENT=\"DOS, FreeDOS, FreeCOM, COMMAND.COM, CLI\">\r\n<META NAME=\"dATE\" CONTENT=\"2004-03-22\">\r\n<TITLE>Appendix to the Description of Features and Implementation Status of FreeCOM</TITLE>\r\n</HEAD>\r\n\r\n<BODY>\r\n<H1>Appendix to the Description of Features and Implementation Status of FreeCOM</H1>\r\n\r\n<H2><A NAME=\"currdir\">Current Directory</A></H2>\r\n\r\nThe current directory is the default directory of a drive.\r\n\r\n<P>DOS stores a default directory for each drive. When a path is\r\nspecified with a drive specification only, such as <CMD>D:</CMD>,\r\nit is completed with this default directory of that drive to\r\nconstruct the <A HREF=\"!:abspath\">absolute path</A> to be used.\r\n\r\n<HR>\r\n\r\n<H2><A NAME=\"cwd\">Current Working Direcory</A></H2>\r\n\r\nIn opposite to the current directory the current <EM>working</EM>\r\ndirectory is the <A HREF=\"!:abspath\">absolute path</A> constructed\r\nout of the <A HREF=\"chgdrive:\">currently selected drive</A> and\r\n<A HREF=\"cd:\">current directory</A> of that drive.\r\n\r\n<HR>\r\n\r\n<H2><A NAME=\"abspath\">Path Specification</A></H2>\r\n\r\nIn DOS an absolute path is constructed out of several components:\r\n<OL>\r\n<LI>drive,\r\n<LI>directory,\r\n<LI>filename, and\r\n<LI>file extension.\r\n</OL>\r\nlike this: <CMD>D:\\DIR1\\DIR2\\FILENAME.EXT</CMD>.\r\n\r\n<P>The drive is a single letter from <CMD>A</CMD> through <CMD>Z</CMD>\r\nfollowed by a colon <CMD>:</CMD>.\r\n\r\n<P>The remaining part of a path consists of similiar components\r\ndelimited by a single backslash <CMD>\\</CMD>. The last component\r\nis also called filename. Each of these components may be formed of\r\na name, up to eight characters long, and an extension, up to\r\nthree characters long. Both parts are delimited by a single dot\r\n<CMD>.</CMD>. Although the extension may be absent, the filename\r\nmust have at least one character.\r\n<BR>Note: The term <EM>filename</EM> is not limited to <EM>files</EM>\r\nin the usual sense, but may apply to any name visible in a directory,\r\nsuch as subdirectories and volume labels, as well.\r\n\r\n<P>To ease the way to enter a path the user may specify a relative path,\r\nrather than an absolute one. In such path one or more components may\r\nbe missing:\r\n\r\n<UL>\r\n<LI>If no drive is specified, what means that no colon is specified, the\r\npath is prefixed by the <A HREF=\"chgdrive:\">currently selected\r\ndrive</A>.\r\n\r\n<LI>If the directory is not prefixed by the backslash or no directory\r\nis specified at all, the <A HREF=\"!:currdir\">current directory</A>\r\nof the drive is inserted right behind the colon.\r\n\r\n<LI>Some programs may append an absent extension to the very last\r\nfilename component.\r\n\r\n</UL>\r\n\r\n<P>Examples, assume the current directories of\r\n<TABLE BORDER=1>\r\n<TR>\r\n\t<TD><B>Drive</B></TD>\r\n\t<TD><B>Current Directory</B></TD>\r\n</TR>\r\n<TR>\r\n\t<TD>C:</TD>\r\n\t<TD><CMD>\\FREEDOS\\HELP</CMD></TD>\r\n</TR>\r\n<TR>\r\n\t<TD>D:</TD>\r\n\t<TD><CMD>\\TEMP\\TEXT</CMD></TD>\r\n</TR>\r\n</TABLE>\r\nThe currently selected drive is <CMD>C:</CMD>.\r\n\r\n<OL>\r\n<LI><CMD>C:\\</CMD>\r\n<BR>The root directory of drive <CMD>C:</CMD>.\r\n\r\n<LI><CMD>.</CMD>\r\n<BR>The current working directory, ergo: <CMD>C:\\FREEDOS\\HELP</CMD>.\r\n\r\n<LI><CMD>..</CMD>\r\n<BR>The parent directory, ergo: <CMD>C:\\FREEDOS</CMD>.\r\n\r\n<LI><CMD>D:</CMD>\r\n<BR>The current directory of drive <CMD>D:</CMD>, ergo: <CMD>D:\\TEMP</CMD>.\r\n\r\n<LI><CMD>D:.</CMD>\r\n<BR>The current directory of drive <CMD>D:</CMD>, ergo: <CMD>D:\\TEMP</CMD>.\r\n\r\n<LI><CMD>D:..</CMD>\r\n<BR>The parent directory of drive <CMD>D:</CMD>, ergo: <CMD>D:\\</CMD>.\r\n\r\n<LI><CMD>..\\BIN</CMD>\r\n<BR>Because there is neither a drive nor a leading backslash, both the\r\ncurrently selected drive and the current directory of that drive\r\nis inserted before the given path, ergo: <CMD>C:\\FREEDOS\\HELP\\..\\BIN</CMD>.\r\n<BR>The embedded component <CMD>..</CMD> has the same meaning as when\r\nspecified alone: <EM>parent directory</EM>, though, here in the context\r\nof the directory <CMD>C:\\FREEDOS\\HELP\\</CMD>. That means that the\r\nfinal absolute path is: <CMD>C:\\FREEDOS\\BIN</CMD>.\r\n\r\n</OL>\r\n\r\n<P>Path specifications that do not conform to above mentioned\r\nformat lead to various different behaviour of the various programs,\r\nbecause there is no standard to scan, parse and interprete such\r\npatterns.\r\nProblems include:\r\n<UL>\r\n<LI>multiple backslashes,\r\n<LI>multiple dots,\r\n<LI>multiple colons, or a colon at a position unequal to two,\r\n<LI>The current directory <CMD>.</CMD> or parent directory <CMD>..</CMD>\r\nspecial directories in the context of a root directory, such as\r\n<CMD>C:\\.</CMD>, <CMD>C:\\..</CMD>, or <CMD>C:\\TEMP\\..\\..</CMD>.\r\n</UL>\r\n\r\n<P>Note: The special directories <CMD>.</CMD> and <CMD>..</CMD> are no\r\nphantom directories or virtual entries, but standard entries of\r\nevery directory except the root directories. These entries help\r\ncrash recovery tools, such as <CMD>CHKDSK</CMD> or <CMD>SCANDISK</CMD>,\r\nto find errors within the directory structure and restore it to\r\na valid file tree. Therefore a common assumption that a tripple dot\r\n<CMD>...</CMD> directory means <EM>parent-of-parent</EM> is incorrect,\r\nthough, might be supported by certain programs.\r\n\r\n<HR>\r\n\r\n<H2><A NAME=\"options\">Standard Rules for Options</A></H2>\r\n\r\nOptions are prefixed by one forward slash &quot;<CMD>/</CMD>&quot;,\r\nthe following character identifies the option and is called\r\noption character, for instance: <OPT>/A</OPT>\r\n\r\n<P>Some commands do accept long option names, where a complete word\r\nidentifies the option rather than a single character, e.g. <OPT>/MSG</OPT>.\r\n\r\n<P>Some option may be used in conjunction with an argument. The argument\r\nis appended to the option with one colon &quot;<CMD>:</CMD>&quot; or\r\none equal sign &quot;<CMD>=</CMD>&quot;, for instance: <OPT>/A:hr</OPT>\r\nor <OPT>/P=fdexec.bat</OPT>.\r\n\r\n<P>Multiple options <EM>without</EM> argument maybe merged together\r\nas a single option with embedded slashes, e.g.\r\n<OPT>/W/S</OPT>, instead of <OPT>/W /S</OPT>.\r\n<BR>An option with argument may be the last one of such merged options.\r\n\r\n<P>Options without arguments enable or disable certain features. Therefore,\r\nthose options are sometimes called <EM>boolean</EM> options or flags.\r\n<BR>Boolean options may be prefixed by a minus &quot;<CMD>-</CMD>&quot;\r\nsign, in order to disable or turn off the option; otherwise, the option\r\nis enabled.\r\n<BR>Without user invention a boolean option is disabled by default.\r\nHowever, some commands allow the user to change the default settings of\r\ncertain options, e.g. COPY and DIR.\r\n\r\n<HR>\r\n\r\n<H2><A NAME=\"redirection\">I/O Redirection</A></H2>\r\n\r\nIn DOS the standard input and output can be redirected to a file or\r\nanother device; however, although it is common to use these I/O streams\r\ntoday, some programmers cowardly ignore them for reasons of speed or\r\nprogram size.\r\n\r\n<P>If the <STRONG>input</STRONG> stream is redirected to a file or\r\ndevice, instead of polling the keyboard and request the user to\r\ninteractively enter characters via the keyboard, those characters\r\nare read from the file or device. Usually these programs terminate\r\nwhen the file has been read wholely.\r\n\r\n<P>If the <STRONG>output</STRONG> stream is redirected to a file\r\nor device, instead of issuing the information onto screen,\r\nit is dumped into the file or device. Per convention each program\r\nhas two output streams: one (called standard output)\r\nto issue normal information and one (called standard error output) for\r\nerror messages the user should not miss.\r\n\r\n<P>Redirections are specified on command line and effect exactly that\r\ncommand invoked herein, regardless if the command is an external or\r\ninternal one, an alias or <A HREF=\"!:batch\">batch script</A>. The utter exception is the FOR\r\ncommand, which requires that the redirection is to apply to the command\r\nspecified behind the DO keyword rather than FOR itself.\r\n<BR>If more than one redirection is specified on the command line and\r\nthey effect the same stream (input, output, or error), the rightmost one\r\nsuperceed any previous one.\r\n\r\n<P>Redirections are syntactically specified like this:\r\n<BR>\r\nEBNF: operator target\r\n<!--\r\nEBNF: operator ::= '<' | '>' [ '>' ] [ '&' [ '>' ] ]\r\n-->\r\nEBNF: operator ::= '<' | '>' [ '>' ]\r\nEBNF: target ::= file | device\r\n\r\n<BR>Although it is not relevant where the redirections are placed on the\r\ncommand line, it is common praxis to place them at the end of it.\r\n<P>The <ARG>operators</ARG> have the following meaning:\r\n<TABLE BORDER=1>\r\n<TR>\t<TH>Operator</TH>\r\n\t\t<TH>Redirection</TH>\r\n</TR>\r\n<TR>\t<TD><CMD>&lt;</CMD></TD>\r\n\t\t<TD>Input stream</TD>\r\n</TR>\r\n<TR>\t<TD><CMD>&gt;</CMD></TD>\r\n\t\t<TD>Output stream; target file is overwritten</TD>\r\n</TR>\r\n<TR>\t<TD><CMD>&gt;&gt;</CMD></TD>\r\n\t\t<TD>Output stream; output is appended to target, if it already exists</TD>\r\n</TR>\r\n<!--\r\n<TR>\t<TD><CMD>&gt;&amp;</CMD></TD>\r\n\t\t<TD>Output and error stream; target file is overwritten</TD>\r\n</TR>\r\n<TR>\t<TD><CMD>&gt;&gt;&amp;</CMD></TD>\r\n\t\t<TD>Output and error stream; output is appended to target, if it already exists</TD>\r\n</TR>\r\n<TR>\t<TD><CMD>&gt;&amp;&gt;</CMD></TD>\r\n\t\t<TD>Error stream; target file is overwritten</TD>\r\n</TR>\r\n<TR>\t<TD><CMD>&gt;&gt;&amp;&gt;</CMD></TD>\r\n\t\t<TD>Error stream; output is appended to target, if it already exists</TD>\r\n</TR>\r\n-->\r\n</TABLE>\r\n\r\nEXAMPLES:\r\nEXAMPLE: 1\r\nCMD: cmd <in1 <in2\r\n<BR>Input stream is redirected to file <CMD>IN2</CMD>, because it is the rightmost\r\none.\r\n\r\nEXAMPLE: 2\r\nCMD: cmd <in >out\r\n<BR>Input stream is redirected to file <CMD>IN</CMD>, the output streams is\r\nredireced into file <CMD>OUT</CMD>.\r\nIf the file <CMD>OUT</CMD> already exists, the old contents is discarded and\r\nreplaced by the new one; otherwise, the <CMD>OUT</CMD> is created anew.\r\n\r\nEXAMPLE: 3\r\nCMD: cmd <in >>out\r\n<BR>As example 2, but instead of replacing the contents of <CMD>OUT</CMD>, if the\r\nfile already exists, the new information is appended to the end of the file.\r\n\r\nEXAMPLE: 4\r\nCMD: FOR %a IN (*.*) DO ECHO %a >out\r\n<BR>As mentioned earlier, FOR is an exception and passes forth the redirections\r\nto each invocation of the command specified right of the DO keyword. So this\r\nexamples overwrites the output file each time the ECHO command is performed,\r\nthus, instead of creating a file list, only the last found file is recorded into\r\n<CMD>OUT</CMD>.\r\n\r\nEXAMPLE: 5\r\nCMD: IF EXIST out DEL out\r\nCMD: FOR %a IN (*.*) DO ECHO %a >>out\r\n<BR>This sequence eliminate the problem, the IF command is required to\r\nactually replace the file rather than appending the file list to the\r\nprobably existent file.\r\n\r\n<H3><A NAME=\"pipe\">Pipes</A></H3>\r\n\r\n<P>Another form of redirection is <STRONG>piping</STRONG>. Hereby, the output stream\r\nof one command is connected to the input stream of another command. Pipes can combine\r\nany number of commands this way. Because DOS is no multitasking system, pipes are\r\nsimulated by spawning the first command with an output redirection capturing the\r\nissued information into a temporary file and then the second command with an input\r\nredirection from that very same temporary file, on completation of the second\r\ncommand the temporary file is deleted.\r\n\r\nEXAMPLES:\r\nEXAMPLE: 1\r\nCMD: cmd1 | cmd2 | cmd3\r\n\r\n<BR>Which is similiar to this sequence:\r\n<BR>\r\nCMD: cmd1 >%TEMP%\\t1\r\nCMD: cmd2 <%TEMP%\\t1 >%TEMP%\\t2\r\nCMD: DEL %TEMP%\\t1\r\nCMD: cmd3 <%TEMP%\\t2\r\nCMD: DEL %TEMP%\\t2\r\n\r\nEXAMPLE: 2\r\n\r\nThe first and last command can have an input or output redirection\r\nrespectively, like so:\r\n\r\n<BR>\r\nCMD: cmd1 | cmd2 | cmd3 <in >out\r\n\r\n\r\n<BR>Which is similiar to this sequence:\r\n<BR>\r\nCMD: cmd1 >%TEMP%\\t1 <in\r\nCMD: cmd2 <%TEMP%\\t1 >%TEMP%\\t2\r\nCMD: DEL %TEMP%\\t1\r\nCMD: cmd3 <%TEMP%\\t2 >out\r\nCMD: DEL %TEMP%\\t2\r\n\r\nEXAMPLE: 3\r\n\r\nThe error stream can be piped as well:\r\n\r\n<BR>\r\nCMD: cmd1 |& cmd2 | cmd3\r\n\r\n<BR>Which is similiar to this sequence:\r\n<BR>\r\nCMD: cmd1 >&%TEMP%\\t1\r\nCMD: cmd2 <%TEMP%\\t1 >%TEMP%\\t2\r\nCMD: DEL %TEMP%\\t1\r\nCMD: cmd3 <%TEMP%\\t2\r\nCMD: DEL %TEMP%\\t2\r\n\r\n<BR>Here only the error messages of <CMD>cmd1</CMD> are passed\r\ninto <CMD>cmd2</CMD>; the error messages of both <CMD>cmd2</CMD>\r\nand <CMD>cmd3</CMD> are issued to the screen.\r\n\r\n<H4>Nested redirections</H4>\r\n\r\n<A HREF=\"!:batch\">Batch scripts</A> or when external programs invoke other programs or another shell,\r\nredirections may be nested, e.g.:\r\n\r\n<P>Consider the batch file <CMD>BATCH.BAT</CMD>:\r\n<PRE>\r\n@ECHO OFF\r\nECHO 1\r\nECHO 2 &gt;out_2\r\nECHO 3\r\n</PRE>\r\nwhich is invoked via:\r\n<BR>\r\nCMD: BATCH >out_1\r\n\r\n<BR>When the script <CMD>BATCH</CMD> gets executed, the actual output stream\r\nis redirected to the file <CMD>OUT_1</CMD>. Therefore the output of the first\r\nECHO command is redirected into this file.\r\n<BR>Because the second ECHO command has its own output redirection, its\r\noutput is redirected into the file <CMD>OUT_2</CMD>. On completion of ECHO\r\nthe redirection is closed and the former one is restored.\r\n<BR>What causes that the output of the third ECHO command is redirected\r\ninto <CMD>OUT_1</CMD> again.\r\n\r\n\r\n<!--\r\n<HR>\r\n\r\n<H2><A NAME=\"hicmd\">Hidden Internal Commands</A></H2>\r\n\r\nThere are some special internal commands, that are not directly visible\r\nnor accessable. They are hidden because of two main purposes:\r\n<OL>\r\n<LI>Many of them are of internal nature and should not used by the user.\r\n<LI>They are extensions to the normal batch language and may, therefore,\r\nclash with a particular installation. To prevent this clash those\r\ncommands are hidden by default and can be made directly accessable\r\nvia the ICMD command.\r\n</OL>\r\n\r\n<P>Hidden internal commands can be access by prefixing the command\r\nwith <CMD>::=</CMD>. This token usually specifies a label within the\r\nbatch language, given the nature of the labels, they may be comments\r\nas well. Due to the latter variant, most non-FreeCOM shells won't see\r\nthe <CMD>::=</CMD>, hence, ignore those commands.\r\n\r\n<P>For example:\r\nCMD: C> ::=CANCEL 30\r\n<BR>cancels (terminates) all currently active batch files and assigns\r\n<ARG>30</ARG> to the current errorlevel.\r\n-->\r\n\r\n<HR>\r\n\r\n<H2><A NAME=\"wildcards\">Wildcards</A></H2>\r\n\r\nDOS accepts certain placeholders instead of files, so you can specify\r\none or more files with the same wildcard pattern. In opposite to other\r\nsystems each program expands wildcards individually instead of let the\r\nshell do this; however, the shell must epxand wildcards for its internal\r\ncommands.\r\n\r\n<P>FreeCOM supports the standard DOS wildcards as supported by the DOS\r\nkernel itself:\r\n\r\n<TABLE BORDER=1>\r\n<TR> <TH>Wildcard</TH> <TH>Meaning</TH> </TR>\r\n\r\n<TR> <TD><CMD>*</CMD></TD> <TD>Any remaining body, except a dot (<CMD>.</CMD>)</TD> </TR>\r\n<TR> <TD><CMD>?</CMD></TD> <TD>Any character, except the dos (<CMD>.</CMD>);\r\n\tacts as <CMD>*</CMD>, if the last character</TD> </TR>\r\n\r\n</TABLE>\r\n\r\n<BR>Wildcards are allowed in the last portion of a qualified path, that means\r\nbehind the last backslash (<CMD>\\</CMD>) or colon (<CMD>:</CMD>).\r\n<BR>Wildcards match either before or behind the dot delimiting the\r\nfilename and its extension.\r\n<BR>Whether or not directories or volume lables or hidden and system\r\nfiles do match a pattern depends on the command expanding it.\r\n<BR>Letters match case-insensitively.\r\n\r\n<P>Examples:\r\n<TABLE BORDER=1>\r\n<TR> <TH>Pattern</TH> <TH>Meaning</TH> </TR>\r\n\r\n<TR> <TD><CMD>*.*</CMD></TD> <TD>Any file in the current directory</TD> </TR>\r\n<TR> <TD><CMD>c:*.*</CMD></TD> <TD>Any file in the current\r\nworking directory of drive C:</TD> </TR>\r\n<TR> <TD><CMD>*</CMD></TD> <TD>Any file without an extension. <FONT SIZE=-1>\r\n\tSome commands, such as DIR, interprete a single <CMD>*</CMD>\r\n\tas <CMD>*.*</CMD></FONT></TD> </TR>\r\n<TR> <TD><CMD>a*.*</CMD></TD> <TD>Any file, which first character is\r\n\tan <CMD>A</CMD>, neither the remainder of the filename nor\r\n\tthe extension of the file matters</TD></TR>\r\n<TR> <TD><CMD>a?.*</CMD></TD> <TD>same as above</TD> </TR>\r\n<TR> <TD><CMD>a???.*</CMD></TD> <TD>same as above</TD> </TR>\r\n<TR> <TD><CMD>a*b.*</CMD></TD> <TD>same as above</TD> </TR>\r\n<TR> <TD><CMD>a?b.*</CMD></TD> <TD>Any file, which first character is\r\n\tan <CMD>A</CMD> and the third one is a <CMD>B</CMD>; the remaining\r\n\tcharacters nor the extension matter</TD> </TR>\r\n<TR> <TD><CMD>file?.txt</CMD></TD> <TD>All files, which first four characters\r\n\tare <CMD>FILE</CMD> and which extension is equal to <CMD>TXT</CMD></TD> </TR>\r\n<TR> <TD><CMD>\\scripts\\*.pl</CMD></TD> <TD>Any perl file in the directory <CMD>\\SCRIPTS</CMD> located in the root directory of the currently selected drive</TD> </TR>\r\n\r\n</TABLE>\r\n\r\n\r\n<P><STRONG>Warning:</STRONG> There are common mistakes about wildcards,\r\nas DOS has less functional wildcards than other systems, in particular:\r\n<UL>\r\n<LI><CMD>a*bc.*txt</CMD>: Any character right of an asterisk <CMD>*</CMD>\r\nup to the dot <CMD>.</CMD> or the end of the filename is ignored; this\r\npattern is equal to: <CMD>a*.*</CMD>.\r\n<LI><CMD>a?.?</CMD>: A question mark <CMD>?</CMD> as the last character\r\nof either the filename or file extension has the same effect as an\r\nasterisk <CMD>*</CMD> and does <EM>not</EM> mean <EM>exactly one any\r\ncharacter</EM>, in particular no character must be present; this pattern\r\nis equal to <CMD>a*.*</CMD>.\r\n</UL>\r\n\r\n<HR>\r\n\r\n<H2><A NAME=\"batch\">Batch Scripts</A></H2>\r\n\r\nThe shell lets to automate simple tasks by writing batch scripts.\r\nThese are plain text files with one command is written at one line.\r\nAny command, both internal and external ones, can be used in batch\r\nscripts, along with <A HREF=\"!:redirection\">redirections</A>,\r\n<A HREF=\"!:pipe\">pipes</A>, <A HREF=\"!!:envvars\">environment variable</A>\r\nsubstitions a.s.o. The script is performed line-by-line.\r\n\r\n<P>By default, before executing a line, it is displayed onto the screen,\r\nin order to prevent this, one can turn off this feature with the ECHO command\r\nor prefix each line with the Ad sign (<CMD>@</CMD>), e.g.:\r\n<BR>\r\nCMD: ECHO This line is displayed\r\nCMD: @ECHO This line is NOT displayed\r\n<BR>Commonly batch scripts start with the line:\r\n<BR>\r\nCMD: @ECHO OFF\r\n<BR> in order to turn off to echo each line furtherly in the script\r\nprocessing and to suppress to echo the line itself, too.\r\n\r\n<P>Lines starting with a colon (<CMD>:</CMD>) label this particular script\r\nline, in order to be jumped to with the GOTO command, e.g.:\r\n<BR>\r\nCMD: @ECHO OFF\r\nCMD: IF \"%1\"==\"\" GOTO useage\r\nCMD: ECHO argument1=%1\r\nCMD: ECHO argument2=%2\r\nCMD: ECHO argument3=%3\r\nCMD: GOTO ende\r\nCMD: :useage\r\nCMD: ECHO Useage: %0 {arguments}...\r\nCMD: :ende\r\n<BR><UL>\r\n<LI>If the script is invoked with no argument, line 2 performs the GOTO\r\ncommand and, thus, skips the lines 3 through 7 and proceeds with\r\nline 8.\r\n<LI>Otherwise the three ECHO commands are invoked and the GOTO command of\r\nline 6 skips the ECHO'ing of the error message in line 8 and proceeds in\r\nline 9.\r\n</UL>\r\nIf the shell hits a line starting with a colon, it is silently skipped; not\r\neven redirections are evaluated in opposite to the REM command.\r\n\r\n<P>When the shell reaches the end of the file, the batch processing terminates.\r\nThe errorlevel of the last spawned external command remains unchanged.\r\nBecause the shell closes the batch script and re-opens it each time a\r\ncommand, for both internal and external ones, is invoked, one can savely\r\nreplace floppy disks during a batch processing, e.g.:\r\n<BR>\r\nCMD: @ECHO OFF\r\nCMD: ECHO Copying disk1\r\nCMD: COPY files\\*.* C:%1\r\nCMD: :disk2\r\nCMD: PAUSE Insert disk #2, then hit ENTER\r\nCMD: IF NOT EXIST disk2 GOTO disk2\r\nCMD: ECHO Copying disk2\r\nCMD: COPY files\\*.* C:%1\r\nCMD: :disk3\r\nCMD: PAUSE Insert disk #3, then hit ENTER\r\nCMD: IF NOT EXIST disk2 GOTO disk3\r\nCMD: ECHO Copying disk3\r\nCMD: COPY files\\*.* C:%1\r\nCMD: ECHO Copying done.\r\n\r\n<P>When a batch file is invoked within another batch file, the previous ones\r\ndoes <EM>not</EM> proceed once the called one terminates, regardless of the\r\nnesting level; this is called <EM>chaining</EM>, one chains to another\r\nprogram and does not intend to come back. To have a batch script behave\r\nlike an external program in this regard, it must be invoke via the\r\nCALL command, e.g.:\r\n<BR>\r\nCMD: @ECHO OFF\r\nCMD: ECHO %0 - line 2\r\nCMD: CALL batch2\r\nCMD: ECHO %0 - line 4\r\n<BR>and <CMD>BATCH2.BAT</CMD>:<BR>\r\nCMD: ECHO %0 - line 1\r\n<BR>\r\n\r\n</BODY>\r\n"
  },
  {
    "path": "docs/html/commands/cmd.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\r\n<HTML>\r\n<HEAD>\r\n<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\r\n<META HTTP-EQUIV=\"Content-Language\" CONTENT=\"en\">\r\n<META NAME=\"GENERATOR\" CONTENT=\"VI\">\r\n<META NAME=\"DESCRIPTION\" CONTENT=\"Description of features and implementation status of FreeCOM, the COMMAND.COM replacement\">\r\n<META NAME=\"AUTHOR\" CONTENT=\"Steffen Kaiser\">\r\n<META NAME=\"KEYWORDS\" CONTENT=\"DOS, FreeDOS, FreeCOM, COMMAND.COM, CLI\">\r\n<META NAME=\"DATE\" CONTENT=\"2001-02-06\">\r\n<TITLE>Internal Commands of FreeCOM</TITLE>\r\n</HEAD>\r\n\r\n<BODY>\r\nList of commands and features of FreeCOM:\r\n<UL>\r\n<LI><A HREF=\"#alias\">ALIAS - Display or change an alias</A>\r\n<LI><A HREF=\"#beep\">BEEP - Issue a Beep</A>\r\n<LI><A HREF=\"#break\">BREAK - Display or Set Extended Break Checking</A>\r\n<LI><A HREF=\"#call\">CALL - Call a Nested Batchfile or Program</A>\r\n<LI><A HREF=\"#cancel\">CANCEL - Terminate all scripts</A>\r\n<LI><A HREF=\"#cd\">CD - Change current directory of a drive</A>\r\n<LI><A HREF=\"#cdd\">CDD - Changes the current working directory</A>\r\n<LI><A HREF=\"#chdir\">CHDIR - Change current directory of a drive</A>\r\n<LI><A HREF=\"#cls\">CLS - Clear screen</A>\r\n<LI><A HREF=\"#copy\">COPY - Copy one or more files to another location</A>\r\n<LI><A HREF=\"#ctty\">CTTY - Change TTY (console)</A>\r\n<LI><A HREF=\"#date\">DATE - Display or set current date</A>\r\n<LI><A HREF=\"#del\">DEL - Delete files</A>\r\n<LI><A HREF=\"#dir\">DIR - Displays the contents of the directory</A>\r\n<LI><A HREF=\"#dirs\">DIRS - Display the directory stack</A>\r\n<LI><A HREF=\"#echo\">ECHO - Displays a string onto screen</A>\r\n<LI><A HREF=\"#environment_keep_free\">ENVIRONMENT_KEEP_FREE - keep free space in environment segment</A>\r\n<LI><A HREF=\"#erase\">ERASE - Delete files</A>\r\n<LI><A HREF=\"#exit\">EXIT - Terminate shell</A>\r\n<LI><A HREF=\"#feature_aliases\">FEATURE_ALIASES - Command aliases</A>\r\n<LI><A HREF=\"#feature_auto_redirect_to_con\">FEATURE_AUTO_REDIRECT_TO_CON - Autoswitch CON: to monitor</A>\r\n<LI><A HREF=\"#feature_batch\">FEATURE_BATCH - Batch script processing</A>\r\n<LI><A HREF=\"#feature_boot_keys\">FEATURE_BOOT_KEYS - check for F5/F8 keys on startup if /P is present</A>\r\n<LI><A HREF=\"#feature_call_logging\">FEATURE_CALL_LOGGING - Startup logging</A>\r\n<LI><A HREF=\"#feature_dirstack\">FEATURE_DIRSTACK - Directory stack</A>\r\n<LI><A HREF=\"#feature_enhanced_input\">FEATURE_ENHANCED_INPUT - Enhanced command line editing</A>\r\n<LI><A HREF=\"#feature_filename_completion\">FEATURE_FILENAME_COMPLETION - Filename completion</A>\r\n<LI><A HREF=\"#feature_history\">FEATURE_HISTORY - Command line history</A>\r\n<LI><A HREF=\"#feature_installable_commands\">FEATURE_INSTALLABLE_COMMANDS - Installable Commands interface (MUX-AE)</A>\r\n<LI><A HREF=\"#feature_last_dir\">FEATURE_LAST_DIR - Change back to last directory</A>\r\n<LI><A HREF=\"#feature_load_messages\">FEATURE_LOAD_MESSAGES - Load messages permanently</A>\r\n<LI><A HREF=\"#feature_nls\">FEATURE_NLS - use DOS NLS</A>\r\n<LI><A HREF=\"#for\">FOR - Repeat a command</A>\r\n<LI><A HREF=\"#goto\">GOTO - Goto label</A>\r\n<LI><A HREF=\"#history\">HISTORY - Display command line history</A>\r\n<LI><A HREF=\"#if\">IF - Conditional execution of a command</A>\r\n<LI><A HREF=\"#loadfix\">LOADFIX - Load an external program above the first 64KB memory</A>\r\n<LI><A HREF=\"#loadhigh\">LOADHIGH - Load an external program into high memory</A>\r\n<LI><A HREF=\"#md\">MD - make directory</A>\r\n<LI><A HREF=\"#memory\">MEMORY - Display the internally used memory</A>\r\n<LI><A HREF=\"#mkdir\">MKDIR - Make directory</A>\r\n<LI><A HREF=\"#path\">PATH - Display or set the search path</A>\r\n<LI><A HREF=\"#pause\">PAUSE - Pauses batch file execution</A>\r\n<LI><A HREF=\"#popd\">POPD - Change back to the last pushed directory</A>\r\n<LI><A HREF=\"#prompt\">PROMPT - Display or set the shell prompt</A>\r\n<LI><A HREF=\"#pushd\">PUSHD - Push the current working directory onto the directory stack</A>\r\n<LI><A HREF=\"#quit\">QUIT - Terminate the current script</A>\r\n<LI><A HREF=\"#rd\">RD - Remove directory</A>\r\n<LI><A HREF=\"#rem\">REM - Marks comments or remarks in batchfiles</A>\r\n<LI><A HREF=\"#ren\">REN - Rename files</A>\r\n<LI><A HREF=\"#rename\">RENAME - Rename files</A>\r\n<LI><A HREF=\"#rmdir\">RMDIR - Remove directory</A>\r\n<LI><A HREF=\"#set\">SET - Display or set environment variables</A>\r\n<LI><A HREF=\"#shift\">SHIFT - Shift the arguments of a batch script</A>\r\n<LI><A HREF=\"#time\">TIME - Display or set current time</A>\r\n<LI><A HREF=\"#truename\">TRUENAME - Display the true name of a file</A>\r\n<LI><A HREF=\"#type\">TYPE - Display the contents of files</A>\r\n<LI><A HREF=\"#ver\">VER - Display the version information about FreeCOM and DOS</A>\r\n<LI><A HREF=\"#verify\">VERIFY - Display or set verify level</A>\r\n<LI><A HREF=\"#vol\">VOL - Display the volume label of a drive</A>\r\n<LI><A HREF=\"#which\">WHICH - Search and display the executable file of specified commands</A>\r\n</UL>\r\n<BR><BR><HR><BR>\r\n<H2><A NAME=\"alias\">ALIAS - Display or change an alias</A></H2>\r\nRequirements: <A HREF=\"#feature_aliases\">FEATURE_ALIASES</A><BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>ALIAS</TT><BR>\r\n\r\n<LI>\r\n <TT>ALIAS</TT> <I>name</I> <TT>'='</TT> <B>[</B> &laquo;string&raquo; <B>]</B><BR>\r\n\r\n</OL>\r\n\r\n<P>\r\n\r\n\r\nThe first format without any argument displays all defined aliases.\r\n\r\n<P>The second format assigns the specified <TT><I>string</I></TT> to the alias with\r\nthe specified <TT><I>name</I></TT>. If the <TT><I>string</I></TT> is empty, the named\r\nalias is removed.\r\n\r\n<P>Once an aliase is defined, a command line of the form:\r\n\r\n<TT> name { argument }</TT><BR>\r\nis replaced by:\r\n\r\n<TT> &lt;&lt;string&gt;&gt; { argument }</TT><BR>\r\nThis mechanism is called <EM>alias expansion</EM>, because the alias\r\n<TT><I>name</I></TT> expands to the specified\r\n &laquo;string&raquo;. To\r\nprevent alias expansion the command must be prefixed by one asterisk,\r\ne.g.:\r\n\r\n<TT> *name arguments</TT><BR>\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#alias\">ALIAS</A></TT> dir=dir /w</TT><BR>\r\n\r\n<TT> C&gt; dir</TT><BR>\r\ndisplays short directory listing from now on.\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#alias\">ALIAS</A></TT></TT><BR>\r\ndisplays all currently defined aliases, e.g.:\r\n<PRE><TT><A HREF=\"#dir\">DIR</A></TT>=dir /w</PRE>\r\nin this case.\r\n\r\n\r\n<H4>Example: 3</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#alias\">ALIAS</A></TT> dir=</TT><BR>\r\nremoves the previously defined alias <TT>dir</TT>, thus, <TT><A HREF=\"#dir\">DIR</A></TT> displays\r\nthe long output as by default again.\r\n<P><HR>\r\n<H2><A NAME=\"feature_aliases\">FEATURE_ALIASES - Command aliases</A></H2>\r\nSee also: <A HREF=\"#alias\">ALIAS</A><BR>\r\n<P>\r\n\r\n\r\nIf defined on compilation of FreeCOM, command aliases are supported.\r\n\r\n<P>New aliases are <U>defined</U> using the command:<BR>\r\n <TT>ALIAS</TT> <I>name</I> <TT>'='</TT> &laquo;string&raquo;<BR>\r\n\r\n<P>Aliases are <U>removed</U> using the command:<BR>\r\n <TT>ALIAS</TT> <I>name</I> <TT>'='</TT><BR>\r\n\r\n<P>When FreeCOM is interpreting a command line, the command -- the very\r\nfirst word -- is matched against all defined aliases. This word is\r\nseparated from its arguments by whitespaces and cannot contain any\r\npath delimiters, such as backslashes or colons.\r\n<BR>If the command matches an alias, the name is <U>substituted</U> by the\r\n &laquo;string&raquo;associated to the aliases, e.g. by defining the alias <TT>ls</TT> by:<BR>\r\n\r\n<TT> <TT><A HREF=\"#alias\">ALIAS</A></TT> ls=dir /w/o</TT><BR>\r\n<BR>let FreeCOM interprete the command line:<BR>\r\n\r\n<TT> C&gt; ls /a</TT><BR>\r\n<BR>exactly as if one had typed in:<BR>\r\n\r\n<TT> C&gt; dir /w/o /a</TT><BR>\r\n\r\n<P>To <U>prevent</U> the alias expansion an asterisk is prefixed before the\r\ncommand, e.g.:<BR>\r\n\r\n<TT> C&gt; *ls /a</TT><BR>\r\n<BR>really tries to execute the command:<BR>\r\n\r\n<TT> ls /a</TT><BR>\r\n<BR>which usually is an external command.\r\n\r\n<P>Aliases may be used to <U>hide or re-place internal commands</U>, e.g.:<BR>\r\n\r\n<TT> <TT><A HREF=\"#alias\">ALIAS</A></TT> dir=xdir</TT><BR>\r\n<BR>effectively hides the internal command <TT><TT><A HREF=\"#dir\">DIR</A></TT></TT> and will always\r\nexecute the -- usually -- external command <TT>XDIR</TT>.\r\n\r\n<P>Aliases <U>may be nested</U>, so if both alias definitions mentioned\r\nabove are in place, the command:<BR>\r\n\r\n<TT> C&gt; ls /a</TT><BR>\r\n<BR>is really executed as:<BR>\r\n\r\n<TT> xdir /w/o /a</TT><BR>\r\n<BR>where the <TT>ls</TT> command is substituted by the command\r\n<TT>dir /w/o</TT>, then <TT>dir</TT> is detected as alias, too, and\r\nhence replaced by <TT>xdir</TT>.\r\n<BR>The same alias is <U>never substituted twice</U>, neither directly nor\r\ntransitively, so:<BR>\r\n\r\n<TT> <TT><A HREF=\"#alias\">ALIAS</A></TT> dir=dir /w</TT><BR>\r\n<BR>is allowed as well as:<BR>\r\n\r\n<TT> <TT><A HREF=\"#alias\">ALIAS</A></TT> ls=dir /w/o</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#alias\">ALIAS</A></TT> dir=ls -l</TT><BR>\r\n<BR><TABLE BORDER=1>\r\n<TR>\r\n  <TH>command</TH>\r\n  <TH>results in</TH>\r\n</TR>\r\n<TR>\r\n  <TD><TT>ls</TT></TD>\r\n  <TD><TT>ls -l /w/o</TT></TD>\r\n</TR>\r\n<TR>\r\n  <TD><TT>dir</TT></TD>\r\n  <TD><TT>dir /w/o -l</TT></TD>\r\n</TR>\r\n</TABLE>\r\n<P>As implied above, aliases are expanded when needed and <EM>not</EM>\r\nwhen they are defined.\r\n\r\n<P>Aliases are storred <U>for each instance of FreeCOM individually</U>\r\nand are inherited by secondary instances from the parent.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nCompile-time options:\r\n<UL>\r\n<LI><TT>ALIAS_DEFAULT_SIZE</TT>: The size reserved for all aliases\r\nper FreeCOM instance. Default: 1024\r\n</UL>\r\n<P><HR>\r\n<H2><A NAME=\"beep\">BEEP - Issue a Beep</A></H2>\r\nRequirements: CMD_BEEP<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>BEEP</TT><BR>\r\n\r\n\r\n<P>\r\n\r\n\r\nIssues a beep.\r\n<BR>At this time FreeCOM supports audible beeps only.\r\n<P><HR>\r\n<H2><A NAME=\"break\">BREAK - Display or Set Extended Break Checking</A></H2>\r\nRequirements: CMD_BREAK<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>BREAK</TT> <B>[</B> <TT>ON</TT> | <TT>OFF</TT> <B>]</B><BR>\r\n\r\n\r\n<P>\r\n\r\n\r\nDisplays or sets the Extended Break status.\r\n<P>By pressing ^Break or ^C (Control-Break or Control-C) an user\r\nmay signal the currently running program to halt. Most programs will\r\nabort to the prompt, but some may decide to just cancel the current\r\naction, but remain active.\r\n<P>DOS checks for ^Break/^C (Control-Break or Crontrol-C) each time\r\na program issues a console input/output request. When Extended Break\r\nchecking is enabled (<EM>ON</EM>), DOS checks for ^Break each time\r\na program issues a request.\r\n<P><HR>\r\n<H2><A NAME=\"call\">CALL - Call a Nested Batchfile or Program</A></H2>\r\nSee also: <A HREF=\"#loadfix\">LOADFIX</A>, <A HREF=\"#loadhigh\">LOADHIGH</A><BR>\r\nOptional requirements: FEATURE_KERNEL_SWAP_SHELL<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>CALL</TT> <B>[/Y]</B> <I>program</I> <B>[</B> &laquo;arguments&raquo; <B>]</B><BR>\r\n\r\n<LI>\r\n <TT>CALL</TT> <B>[/Y]</B> <B>[</B> <B>/S</B> | <B>/N</B> <B>]</B> <I>program</I> <B>[</B> &laquo;arguments&raquo; <B>]</B><BR>\r\n\r\n</OL>\r\n\r\n<P>\r\n\r\n\r\nCalls a program or batch script.\r\n\r\n<P>If the <TT><I>program</I></TT> is a <A HREF=\"#_appendix_batch\">batch script</A>,\r\nthat means it has the\r\nextension <TT>.BAT</TT>, <TT><TT><A HREF=\"#call\">CALL</A></TT></TT> nests the batch script within\r\nthe already running one. Without <TT><TT><A HREF=\"#call\">CALL</A></TT></TT> the invoked batch\r\nscript would terminate all already running batch scripts.\r\n<P>If present, the arguments are passed unchanged to the invoked program.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n<UL>\r\n<LI><TT><B>/S</B></TT>: If <TT><I>program</I></TT> is not a batch script, the external\r\nprogram is executed by swapping FreeCOM out of memory. This process will\r\nrequire more time, especially if FreeCOM is to be reloaded from a floppy,\r\nsome internal settings are lost, e.g. command line history, but it will\r\nfree as much memory as possible for the external program.\r\n<P>This option and, thereby, this function is available only, if FreeCOM\r\nhad been compiled with some support for swapping.\r\n\r\n<LI><TT><B>/N</B></TT>: If <TT><I>program</I></TT> is not a batch script, the external\r\nprogram is executed directly, with swapping disabled. <TT><B>/N</B></TT> superceeds\r\n<TT><B>/S</B></TT>.\r\n\r\n<LI><TT><B>/Y</B></TT>: Enables tracemode during execution of the command.\r\n\r\n</UL>\r\n\r\n<P>Note: In the future to swap FreeCOM out of memory during the execution\r\nof an external program will be the default behaviour.\r\n<P><HR>\r\n<H2><A NAME=\"cancel\">CANCEL - Terminate all scripts</A></H2>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>CANCEL</TT> <B>[</B> <I>n</I> <B>]</B><BR>\r\n\r\n\r\nTerminates all currently active batch scripts and, if present, assigns\r\nthe specified number <TT><I>n</I></TT> to the errorlevel.\r\n\r\n<P><EM>Note</EM>: This command is a <A HREF=\"#_appendix_hicmd\">hidden internal command</A>.\r\n<P><HR>\r\n<H2><A NAME=\"cd\">CD - Change current directory of a drive</A></H2>\r\nSee also: <A HREF=\"#cdd\">CDD</A>, <A HREF=\"#chdir\">CHDIR</A>, <A HREF=\"#dir\">DIR</A>, <A HREF=\"#dirs\">DIRS</A>, <A HREF=\"#md\">MD</A>, <A HREF=\"#pushd\">PUSHD</A>, <A HREF=\"#rd\">RD</A><BR>\r\nRequirements: CMD_CHDIR<BR>\r\nOptional requirements: <A HREF=\"#feature_last_dir\">FEATURE_LAST_DIR</A><BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>CD</TT><BR>\r\n\r\n<LI>\r\n <TT>CD</TT> <B>[</B> <I>drive</I> <TT>':'</TT> <B>]</B> <I>path</I><BR>\r\n\r\n<LI>\r\n <TT>CD</TT> <TT>'-'</TT><BR>\r\n\r\n</OL>\r\n\r\n<TT><TT><A HREF=\"#cd\">CD</A></TT></TT> is 100% compatible with the <TT><TT><A HREF=\"#chdir\">CHDIR</A></TT></TT> command; there\r\nis no difference -- beside the spelling -- between them.\r\n\r\n<P>The first variant shows the <A HREF=\"#_appendix_cwd\">current working\r\ndirectory</A> as absolute path.\r\n\r\n<P>The second variant changes the <A HREF=\"#_appendix_currdir\">current\r\ndirectory</A> of the given drive.  If no drive is specified on command\r\nline, the current directory of the <A HREF=\"#chgdrive\">currently\r\nselected drive (disk)</A> is changed.  This command does\r\n<STRONG>not</STRONG> change the currently selected drive in opposite to\r\n<TT><TT><A HREF=\"#cdd\">CDD</A></TT></TT>!\r\n\r\n<P>The third variant changes back into the last visited directory\r\n<STRONG>and</STRONG> drive.  The commands <TT><TT><A HREF=\"#cd\">CD</A></TT></TT>,\r\n<TT><TT><A HREF=\"#chdir\">CHDIR</A></TT></TT>, <TT><TT><A HREF=\"#cdd\">CDD</A></TT></TT>, and <TT><TT><A HREF=\"#pushd\">PUSHD</A></TT></TT> save the current\r\nworking directory before performing the specified directory change; the\r\ncommand <TT><TT><A HREF=\"#cd\">CD</A></TT> '-'</TT> restores this saved directory. This command is\r\navailable only, if the feature LAST_DIR has been enabled during the\r\ncompilation of FreeCOM.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nThere are no options for this command.\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#cd\">CD</A></TT> \\freedos\\help</TT><BR>\r\n\r\nChanges the current working directory of the currently selected drive to\r\nthe path <TT>\\FREEDOS\\HELP</TT>.\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#cd\">CD</A></TT> c:\\freedos\\help</TT><BR>\r\n\r\nChanges the current directory of drive <TT>C:</TT>.\r\n\r\n\r\n<H4>Example: 3</H4>\r\n\r\nAssuming the current working directory is <TT>\\FREEDOS\\HELP</TT> and\r\nthe currently selected drive is <TT>C:</TT>.\r\n\r\n\r\n<TT> <TT><A HREF=\"#cd\">CD</A></TT> </TT><BR>\r\n\r\nDisplays <TT>C:\\FREEDOS\\HELP</TT>\r\n\r\n\r\n<H4>Example: 3</H4>\r\n\r\nThe command sequence, provided the first two worked successfully:<BR>\r\n\r\n<TT> <TT><A HREF=\"#cd\">CD</A></TT> \\FREEDOS\\HELP</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#cd\">CD</A></TT> ..</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#cd\">CD</A></TT> -</TT><BR>\r\n\r\nchanges first into the directory <TT>\\FREEDOS\\HELP</TT>, then into\r\nits parent directory, which is <TT>\\FREECOM</TT>. And finally\r\n<TT><TT><A HREF=\"#cd\">CD</A></TT> -</TT> changes back to <TT>\\FREEDOS\\HELP</TT>, because this\r\nwas the previous directory before previous <TT><TT><A HREF=\"#cd\">CD</A></TT></TT>-like command.\r\n<P>Because <TT><TT><A HREF=\"#cd\">CD</A></TT> -</TT> saves the previous directory, too, any\r\nsubsequent:\r\n\r\n<TT> <TT><A HREF=\"#cd\">CD</A></TT> -</TT><BR>\r\nwill switch between these two directories; until another directory is\r\nchanged to.\r\n<P><HR>\r\n<H2><A NAME=\"cdd\">CDD - Changes the current working directory</A></H2>\r\nSee also: <A HREF=\"#cd\">CD</A>, <A HREF=\"#dir\">DIR</A>, <A HREF=\"#md\">MD</A>, <A HREF=\"#pushd\">PUSHD</A>, <A HREF=\"#rd\">RD</A><BR>\r\nRequirements: CMD_CDD<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>CDD</TT><BR>\r\n\r\n<LI>\r\n <TT>CDD</TT> <B>[</B> <I>drive</I> <TT>':'</TT> <B>]</B> <I>path</I><BR>\r\n\r\n<LI>\r\n <TT>CDD</TT> <TT>'-'</TT><BR>\r\n\r\n</OL>\r\n\r\nThe behaviour of <TT><TT><A HREF=\"#cdd\">CDD</A></TT></TT> is similiar to the <TT><TT><A HREF=\"#cd\">CD</A></TT></TT>\r\ncommand, but it always changes both the currently selected drive and\r\nthe current directory, thus, it changes the current working directory.\r\n\r\n<P>For further details please see the <TT><TT><A HREF=\"#cd\">CD</A></TT></TT> command.\r\n<P><HR>\r\n<H2><A NAME=\"chdir\">CHDIR - Change current directory of a drive</A></H2>\r\nThis command is 100% compatible to <A HREF=\"#cd\">CD</A>, please see there\r\n<P><HR>\r\n<H2><A NAME=\"cls\">CLS - Clear screen</A></H2>\r\nSee also: <A HREF=\"#echo\">ECHO</A>, <A HREF=\"#type\">TYPE</A><BR>\r\nRequirements: CMD_CLS<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>CLS</TT><BR>\r\n\r\n\r\nClears the screen and resets the character colours to\r\nwhite on black.\r\n<P><HR>\r\n<H2><A NAME=\"copy\">COPY - Copy one or more files to another location</A></H2>\r\nSee also: <A HREF=\"#del\">DEL</A>, <A HREF=\"#ren\">REN</A><BR>\r\nRequirements: CMD_COPY<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n\r\n<OL>\r\n<LI>\r\n <TT>COPY</TT> <B>[{</B> <I>option</I> <B>}]</B> <I>source</I> <B>[{</B> <I>option</I> <B>}]</B> <I>target</I> <B>[{</B> <I>option</I> <B>}]</B><BR>\r\n\r\n</OL>\r\n\r\nCopies the source file into the target file. See also: \\REF{wildcards}\r\n\r\n<P>Before parsing its command line <TT><A HREF=\"#copy\">COPY</A></TT> parses any <EM>option</EM> specified\r\nby the environment variable <TT><B>COPYCMD</B></TT>.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n<UL>\r\n<LI><TT><B>/A</B></TT> see below\r\n<LI><TT><B>/B</B></TT>: Specifies the mode, in which the file is copied,\r\n\t<TT><B>/A</B></TT> forces ASCII\r\n\tand <TT><B>/B</B></TT> forces binary mode.\r\n\t<P>These options do alter the mode of the file immediately\r\n\tpreceeding them and all following ones, until changed again.\r\n\t<P>In binary mode the file is copied and nothing is changed at all.\r\n\t<P>In ASCII mode <TT><A HREF=\"#copy\">COPY</A></TT> takes special care about linefeeds / newline\r\n\tcharacters and the end-of-line character.\r\n\t<UL>\r\n\t<LI>On read, the newline characters, which are a sequence of two\r\n\tdifferent bytes in DOS, are transformed into a single character, as\r\n\tknown from Unix-style systems. On write, this single character is\r\n\ttransformed into the two-byte sequence.\r\n\t<BR>So, if both files are copied with different modes, newline\r\n\tcharacters are transformed into either way.\r\n\t<LI>If the end-of-file character is found on read, the remaining\r\n\tcontents of the file is ignored. On write, such character is appended\r\n\tafter the last character has been written.\r\n\t</UL>\r\n\tBy default, files are copied in binary mode, whereas devices, e.g.\r\n\t<TT>CON:</TT>, are copied in ASCII mode, but no end-of-file is appended.\r\n</UL>\r\n\r\n\r\n<H3>Arguments</H3>\r\n\r\n<UL>\r\n<LI><TT><I>source</I></TT>: The source file.\r\n\t<BR>If more than one source file is specified, the target must be\r\n\ta directory.\r\n\r\n<LI><TT><I>target</I></TT>: The target of the <TT><A HREF=\"#copy\">COPY</A></TT> process.\r\n\t<BR>If target is a directory, the destination file is placed into this\r\n\tdirectory, but with the same filename as the source file.\r\n\t<BR>If exactly one source is specified, but no target, target defaults\r\n\tto just <TT>.</TT>, which represant the current directory.\r\n\r\n</UL>\r\n<P><HR>\r\n<H2><A NAME=\"ctty\">CTTY - Change TTY (console)</A></H2>\r\nRequirements: CMD_CTTY<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>CTTY</TT> <I>device</I><BR>\r\n\r\n\r\nWith this command the console device can be changed. A console device performs\r\nall basic input and output operations. This change is more complete\r\nthan <A HREF=\"#_appendix_redirection\">IO-redirections</A>, because latter one might\r\nnot catch all output, for instance the error messages. See example 3 below.\r\n<BR>Because the console is a bidirectional virtual device, meaning it\r\nis to perform input <STRONG>and</STRONG> output, the specified\r\n<TT><I>device</I></TT> must not a unidirectional device, such as <TT>PRN</TT>.\r\n<P>To specify a second argument on the command line of FreeCOM has the\r\nsame effect.\r\n<P><STRONG>Attention</STRONG>: This command is to effect the whole system,\r\nnot only FreeCOM itself; so the effect of <TT><A HREF=\"#ctty\">CTTY</A></TT> does not only depend on the\r\nimplementation status of FreeCOM, but on the DOS kernel, too.\r\n<P>Also, some programs access the screen or keyboard directly, rather than\r\nusing the DOS functions; these programs are <STRONG>not</STRONG> effected\r\nby <TT><A HREF=\"#ctty\">CTTY</A></TT>.\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n\r\n<TT> <TT><A HREF=\"#ctty\">CTTY</A></TT> aux</TT><BR>\r\n\r\nChanges the console to the <TT><I>AUX:</I></TT> device, which is usually the\r\nfirst serial communication port <TT>COM1:</TT>. If this line is connected\r\nto a terminal or a terminal emulator, the system can be controlled from the\r\nterminal by now.\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n\r\n<TT> <TT><A HREF=\"#ctty\">CTTY</A></TT> nul</TT><BR>\r\nany command sequence<BR>\r\n\r\n<TT> <TT><A HREF=\"#ctty\">CTTY</A></TT> con</TT><BR>\r\n\r\nThe first command discards any output. If a program attempts any input\r\noperation, it gets none. Some programs may not handle such situation\r\ncorrectly.\r\n<BR>So, any output, even error messages, are discarded during the command\r\nsequence.\r\n<BR>The second command changes the console back to the screen/keyboard pair.\r\n<BR>To display a string onto screen or read from keybord the usual\r\n<A HREF=\"#_appendix_redirection\">I/O-redirections</A> may be used, for instance:\r\n<UL>\r\n<LI>\r\n\r\n<TT> <TT><A HREF=\"#echo\">ECHO</A></TT> This line appears on the screen &gt;CON</TT><BR>\r\n<LI>\r\n\r\n<TT> <TT><A HREF=\"#pause\">PAUSE</A></TT> &gt;CON</TT><BR>\r\nThis <TT><A HREF=\"#pause\">PAUSE</A></TT> command will get its input even within the\r\n\"<TT><TT><A HREF=\"#ctty\">CTTY</A></TT> nul</TT>\" environment.\r\n</UL>\r\n<P><HR>\r\n<H2><A NAME=\"date\">DATE - Display or set current date</A></H2>\r\nSee also: <A HREF=\"#time\">TIME</A><BR>\r\nRequirements: CMD_DATE<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>DATE</TT> <B>[</B> <B>/D</B> <B>]</B><BR>\r\n\r\n<LI>\r\n <TT>DATE</TT> <B>[</B> <B>/D</B> <B>]</B> <I>date</I><BR>\r\n\r\n</OL>\r\n\r\nThe first variant displays the current system date, then enters a loop\r\nprompting the user for a new date. The loop terminates, if the user\r\nentered a valid new date or just pressed the <TT>ENTER</TT> key.\r\n\r\n<P>The second variant does not display the current date and tries to\r\nchange the date to the specified <TT><I>date</I></TT>. On success the\r\ncommand terminates, otherwise enters the loop explained above.\r\n\r\n<P>The individual portions of a date may be separated by at least:\r\ndots <TT>.</TT>, forward slashes <TT>/</TT> or dashes <TT>-</TT>.\r\nOther nationally used characters may be supported, too.\r\n<BR><TT><A HREF=\"#date\">DATE</A></TT> will support partial formats:\r\n<UL>\r\n<LI>A <EM>single numnber</EM>: specifies the day only.\r\n<LI><EM>Two numbers</EM>: specifies the day and the month in the order\r\nused by the national date format, which is MM/DD for American and Japanese\r\nand DD/MM for European format.\r\n<LI><EM>Three numbers</EM>: specifies a full date including day, month and\r\nyear in the order suitable for the national date format, which is:\r\n<UL>\r\n<LI>MM/DD/[CC]YY: for American,\r\n<LI>DD/MM/[CC]YY: for European and\r\n<LI>[CC]YY/MM/DD: for Japanese format.\r\n</UL>\r\nIf the year portion is less than 100, the century is assumed to be 1900, if\r\nit is greater or equal than 80; otherwise the century is 2000.\r\n<P><EM>Note</EM>: Some European countries introduced the so-called\r\nbusiness date in 1996 or so, which is the same as the Japanese format;\r\nit makes sorting of literal dates a lot easier. If FreeCOM will or will not\r\nsupport it, will depend on the NLS used by DOS.\r\n</UL>\r\n\r\n<BR>Symbolical names of monthes are not support (yet).\r\n\r\n\r\n<H3>Options</H3>\r\n\r\n\r\nAll options must precced any argument.\r\n\r\n<P><TT><B>/D</B></TT> prevents from prompting the user.\r\n<OL>\r\n<LI>In variant 1, the date is displayed only.\r\n<LI>In variant 2, the date is tried to be changed, but the loop is not\r\nentered on failure.\r\n</OL>\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n\r\n<TT> <TT><A HREF=\"#date\">DATE</A></TT> /D</TT><BR>\r\n\r\nJust display the current system date.\r\n\r\n\r\n<H4>Example: 3</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#date\">DATE</A></TT> 2/1/00</TT><BR>\r\n\r\nSets the current date to 1st February of 2000.\r\n<P><HR>\r\n<H2><A NAME=\"del\">DEL - Delete files</A></H2>\r\nSee also: <A HREF=\"#dir\">DIR</A><BR>\r\nRequirements: CMD_DELETE<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>DEL</TT> <B>[{</B> <I>options</I> | <I>pattern</I> <B>}]</B><BR>\r\n\r\n\r\nDeletes files, if <TT><I>pattern</I></TT> matches a directory, all files within\r\nthis directory are deleted.\r\n<P>When all files are to be deleted, a warning prompt is issued.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n\r\n<UL>\r\n<LI><TT><B>/P</B></TT>: Prompts the user before delete a file.\r\n<LI><TT><B>/V</B></TT>: Displays, which files are deleted.\r\n</UL>\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#del\">DEL</A></TT> FILE1.EXT FILE2.EXT</TT><BR>\r\nDeletes the files <TT>FILE1.EXT</TT> and <TT>FILE2.EXT</TT>.\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#del\">DEL</A></TT> /P *.bak</TT><BR>\r\nDeletes all files with extension <TT>BAK</TT>, but prompts the\r\nuser for each single file before deleting it.\r\n\r\n\r\n<H4>Example: 3</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#del\">DEL</A></TT>.</TT><BR>\r\nDeletes all files within the current directory.\r\n<P><HR>\r\n<H2><A NAME=\"dir\">DIR - Displays the contents of the directory</A></H2>\r\nSee also: <A HREF=\"#chdir\">CHDIR</A>, <A HREF=\"#mkdir\">MKDIR</A>, <A HREF=\"#rmdir\">RMDIR</A><BR>\r\nRequirements: CMD_DIR<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>DIR</TT> <B>[{</B> <I>options</I> | <I>pattern</I> <B>}]</B><BR>\r\n\r\n\r\n<P><TT><TT><A HREF=\"#dir\">DIR</A></TT></TT> displays the contents of direcories and/or\r\nthe attributes of files, whatever the <TT><I>pattern</I></TT> specifies.\r\nIf no <TT><I>pattern</I></TT> is specified on command line, the current\r\nworking directory is displayed. The actual information displayed\r\ndepends on the specified options and is explained below.\r\n<P>A <TT><I>pattern</I></TT> may contain <A HREF=\"#_appendix_wildcards\">wildcards</A>,\r\nwhich are expanded against both files and directories. To specify a\r\ndirectory is essentially equal to write: <TT>directory\\*.*</TT>.\r\n<P>Unlike options patterns are performed in sequence, that means that\r\nif two patterns are specified, first all entries matching the first one,\r\nthen all entries matching the second one are displayed;\r\n<FONT SIZE=-1>instead of to display the matching entries intermixed</FONT>.\r\n\r\n<P>Before parsing its command line <TT><A HREF=\"#dir\">DIR</A></TT> parses any <EM>option</EM> specified\r\nby the environment variable <TT><B>DIRCMD</B></TT>.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n<UL>\r\n<LI><TT><B>/A</B></TT>: (All) Wildcards are matched against System and Hidden\r\nfiles, too.\r\n<LI><TT><B>/A**</B></TT>: (Attribute) Wildcards are matched against files\r\nwith selected attributes set or clear. The argument\r\nof the <TT><B>/A</B></TT> option is a sequence of:\r\n\t<UL>\r\n\t<LI><TT><B>?</B></TT> meaning: attribute <TT><B>?</B></TT> must be set, or\r\n\t<LI><TT><B>-?</B></TT> meaning: attribute <TT><B>?</B></TT> must not be set.\r\n\t</UL>\r\n\t<P>The following attributes, the <TT><B>?</B></TT> above, are supported:\r\n\t<UL>\r\n\t<LI><TT><B>R</B></TT> for: read-only,\r\n\t<LI><TT><B>H</B></TT> for: hidden,\r\n\t<LI><TT><B>S</B></TT> for: system,\r\n\t<LI><TT><B>D</B></TT> for: directory, and\r\n\t<LI><TT><B>A</B></TT> for: archive.\r\n\t</UL>\r\n\t<P>If the same attribute is specified twice within the same\r\n\t<TT><B>/A</B></TT> option, the last one superceeds previous ones; if\r\n\tmore than one <TT><B>/A</B></TT> option is specified, the last one\r\n\tsuperceeds all previous ones.\r\n<LI><TT><B>/B</B></TT>: (Bare) Displays the lines with the information of\r\nfiles and directories only. The ones displaying the volume label,\r\nthe serial number, totals etc. are suppressed. In combination with\r\n<TT><B>/S</B></TT> the absolute path of the files is displayed.\r\n<LI><TT><B>/L</B></TT>: (Lower-case) Filenames are displayed in lower-case\r\nletters rather than capitol ones.\r\n<LI><TT><B>/O</B></TT>: (Order default) is a synonym of <TT><B>/ONG</B></TT>.\r\n<LI><TT><B>/O**</B></TT>: (Order) Sort the entries displayed in a specific order.\r\n\tThe following sort orders are supported:\r\n\t<UL>\r\n\t<LI><TT><B>D</B></TT> sort by last modification <B>d</B>ate (earliest first)\r\n\t<LI><TT><B>E</B></TT> sort by file <B>e</B>xtension\r\n\t<LI><TT><B>G</B></TT> <B>g</B>roup directories first\r\n\t<LI><TT><B>N</B></TT> sort by file <B>n</B>ame\r\n\t<LI><TT><B>S</B></TT> sort by size (smallest first)\r\n\t<LI><TT><B>U</B></TT> do not sort (<B>u</B>nsorted)\r\n\t</UL>\r\n\t<P>Each sort order, except <TT><B>U</B></TT>, may be prefixed by\r\n\ta hyphen to reverse the sort order. <TT><B>U</B></TT> effectively\r\n\tcancels any previous setting or specified sort order, e.g. to\r\n\toverride an <TT><B>/O</B></TT> option from the <TT><B>DIRCMD</B></TT>\r\n\tenvironment variable.\r\n\t<P>If the same sort order is specified twice within the same\r\n\t<TT><B>/O</B></TT> option, the last one superceeds previous ones; if\r\n\tmore than one <TT><B>/O</B></TT> option is specified, the last one\r\n\tsuperceeds all previous ones.\r\n\t<P><STRONG>Warning</STRONG>: The entries are cached within memory\r\n\tbefore displaying them; if FreeCOM runs short on memory, to sort is\r\n\tdisabled completely or the entries are sorted in chunks only.\r\n<LI><TT><B>/P</B></TT>: (Page) Page the output -- pause the display after\r\n\tissuing one screen-full.\r\n<LI><TT><B>/S</B></TT>: (Subdirectories) Recursively display directories.\r\n<LI><TT><B>/W</B></TT>: (Wide) Displays five filenames per line and suppress\r\nthe information about the file size, date etc.\r\n<LI><TT><B>/Y</B></TT>: (Year) Displays a 4-digit year, rather than just two\r\n\tdigits.\r\n<LI><TT><B>/4</B></TT>: (4digit Year) is a synonym of <TT><B>/Y</B></TT>.\r\n</UL>\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n\r\n<TT> <TT><A HREF=\"#dir\">DIR</A></TT></TT><BR>\r\nDisplays the contents of the current directory, but ignore System and\r\nHidden files. The output may look like this:\r\n\r\n<PRE>\r\n!!todo!!\r\n</PRE>\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n\r\n<TT> <TT><A HREF=\"#dir\">DIR</A></TT> a* bb* *.txt</TT><BR>\r\nFirst displays all files, that begin with the letter <TT>A</TT>; then\r\nall files, that begin with two letters <TT>B</TT>, are displayed and\r\nat last all files with the extension <TT>TXT</TT>.\r\n\r\n\r\n<H4>Example: 3</H4>\r\n\r\n\r\n\r\n<TT> <TT><A HREF=\"#dir\">DIR</A></TT> /w a* b*</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#dir\">DIR</A></TT> a* /w b*</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#dir\">DIR</A></TT> a* b* /w</TT><BR>\r\nBecause the position of options is not significant,\r\nall these examples behave the same way and display the matching files\r\nin <EM>wide</EM> or also called <EM>short</EM> form, which may look\r\nlike this:\r\n\r\n<PRE>\r\n!!todo!!\r\n</PRE>\r\n\r\n<P><HR>\r\n<H2><A NAME=\"dirs\">DIRS - Display the directory stack</A></H2>\r\nSee also: <A HREF=\"#cd\">CD</A>, <A HREF=\"#chdir\">CHDIR</A>, <A HREF=\"#popd\">POPD</A>, <A HREF=\"#pushd\">PUSHD</A><BR>\r\nRequirements: CMD_DIRS<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>DIRS</TT><BR>\r\n\r\n\r\nDisplays all directories stacked with the <TT><A HREF=\"#pushd\">PUSHD</A></TT> command.\r\n<P><HR>\r\n<H2><A NAME=\"echo\">ECHO - Displays a string onto screen</A></H2>\r\nSee also: <A HREF=\"#type\">TYPE</A><BR>\r\nRequirements: CMD_ECHO<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>ECHO</TT> <B>[</B> <TT>ON</TT> | <TT>OFF</TT> <B>]</B><BR>\r\n\r\n<LI>\r\n <TT>ECHO</TT> &laquo;string&raquo;<BR>\r\n\r\n<LI>\r\n <TT>ECHO.</TT><BR>\r\n\r\n</OL>\r\n\r\nWhen executing a batch script each line is displayed to the console\r\nbefore executing it by default. The first variant of <TT><A HREF=\"#echo\">ECHO</A></TT> enables or\r\ndisables this behaviour. To disable echoing the commands is equal to\r\nprefix each line of a batch script with the Ad-symbol <TT>@</TT>.\r\n<BR>If <TT><A HREF=\"#echo\">ECHO</A></TT> is invoked with no argument at all, the current echo status\r\nis displayed.\r\n<BR>When entered on an interactive command line the echo status controls\r\nwhether or not the <TT><A HREF=\"#prompt\">PROMPT</A></TT> string is displayed.\r\n\r\n<P>The second variant displays the specified\r\n &laquo;string&raquo;.\r\n<BR>Note: Because of variant 1\r\n &laquo;string&raquo; may not expand\r\nto the single words <TT>ON</TT> or <TT>OFF</TT> without another\r\ncharacter.\r\n\r\n<P>The third variant displays an empty line. No space must be\r\nplaced between the dot and <TT><A HREF=\"#echo\">ECHO</A></TT>.\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#echo\">ECHO</A></TT></TT><BR>\r\n\r\nDisplays the current echo status, e.g. responding:\r\n<PRE><TT><A HREF=\"#echo\">ECHO</A></TT> is on</PRE>\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n<TT> @<TT><A HREF=\"#echo\">ECHO</A></TT> OFF</TT><BR>\r\n\r\nDisables the echo status. Because the Ad-sign <TT>@</TT> disables the\r\necho status right for this line, this command disable echoing all the\r\nnext lines of a batch script and is not echoed to the console itself.\r\nIt is, therefore, best placed in the first line of a batch script.\r\n\r\n\r\n<H4>Example: 3</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#echo\">ECHO</A></TT> Just a text</TT><BR>\r\n\r\nDisplays <TT>Just a text</TT>\r\n<P><HR>\r\n<H2><A NAME=\"feature_enhanced_input\">FEATURE_ENHANCED_INPUT - Enhanced command line editing</A></H2>\r\nSee also: <A HREF=\"#feature_filename_completion\">FEATURE_FILENAME_COMPLETION</A>, <A HREF=\"#feature_history\">FEATURE_HISTORY</A><BR>\r\n<P>\r\n\r\n\r\nIf enabled on compilation of FreeCOM, enhanced command line editing\r\nfeatures are activated. Otherwise, FreeCOM uses the default\r\nbuffered input DOS API function #0A.\r\n\r\n<P>If this feature is disabled, neither command line history\r\nnor filename completion is available.\r\n\r\n<P>Besides the other features various key bindings recognized, which are\r\nlisted in the general FreeCOM documentation.\r\n<P><HR>\r\n<H2><A NAME=\"erase\">ERASE - Delete files</A></H2>\r\nThis command is 100% compatible to <A HREF=\"#del\">DEL</A>, please see there\r\n<P><HR>\r\n<H2><A NAME=\"exit\">EXIT - Terminate shell</A></H2>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>EXIT</TT><BR>\r\n\r\n\r\nTerminates the currently running shell, unless FreeCOM had been started with\r\nthe <TT><B>/P</B></TT> option. In this case, <TT><A HREF=\"#exit\">EXIT</A></TT> works like <TT><A HREF=\"#cancel\">CANCEL</A></TT>.\r\n<P><HR>\r\n<H2><A NAME=\"feature_auto_redirect_to_con\">FEATURE_AUTO_REDIRECT_TO_CON - Autoswitch CON: to monitor</A></H2>\r\n<P>\r\n\r\n\r\nIf defined on compilation of FreeCOM and if FreeCOM is to terminate\r\nalthough it is forbidden -- e.g. by passing the <TT><B>/P</B></TT> option\r\nwhen executing FreeCOM --, the console is changed to the keyboard/monitor\r\npair automatically after some insuccessful prompts to reboot the system.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nCompile-time options:\r\n<UL>\r\n<LI><TT><TT><A HREF=\"#feature_auto_redirect_to_con\">FEATURE_AUTO_REDIRECT_TO_CON</A></TT></TT>: How many loops may pass before\r\nswitching the console CON: to the monitor. Default: 5.\r\n</UL>\r\n<P><HR>\r\n<H2><A NAME=\"feature_batch\">FEATURE_BATCH - Batch script processing</A></H2>\r\nRequirements: IMPLICIT<BR>\r\n<P>\r\n\r\n\r\nThe batch script processing is always enabled.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nCompile-time options:\r\n<UL>\r\n<LI><TT>BATCH_NESTLEVEL_MIN</TT>: Minimal supported batch nesting level.\r\nDefault: 5\r\n</UL>\r\n<P><HR>\r\n<H2><A NAME=\"environment_keep_free\">ENVIRONMENT_KEEP_FREE - keep free space in environment segment</A></H2>\r\n<P>\r\n\r\n\r\nIf defined on compilation of FreeCOM, FreeCOM tries to keep the unused\r\nspace in the environment segment equal to or greater than\r\n<TT><TT><A HREF=\"#environment_keep_free\">ENVIRONMENT_KEEP_FREE</A></TT></TT>. The default value is 256.\r\n<P><HR>\r\n<H2><A NAME=\"feature_boot_keys\">FEATURE_BOOT_KEYS - check for F5/F8 keys on startup if /P is present</A></H2>\r\n<P>\r\n\r\n\r\nIf defined on compilation of FreeCOM, FreeCOM waits three seconds on\r\nstartup, if the <TT><B>/P</B></TT> switch is present. If during this time\r\na key has been pressed, <CODE>F5</CODE> will bypass AUTOEXEC.BAT execution\r\nand <CODE>F8</CODE> will enable trace mode.\r\n\r\n<BR><CODE>F5</CODE> is equal to to pass <A HREF=\"FreeCOM.html#-cmdline\">the <TT><B>/D</B></TT>\r\nswitch</A> to FreeCOM.\r\n<BR><CODE>F8</CODE> is equal to to pass <A HREF=\"FreeCOM.html#-cmdline\">the <TT><B>/Y</B></TT>\r\nswitch</A> to FreeCOM.\r\n<P><HR>\r\n<H2><A NAME=\"feature_installable_commands\">FEATURE_INSTALLABLE_COMMANDS - Installable Commands interface (MUX-AE)</A></H2>\r\n<P>\r\n\r\n\r\nIf defined on compilation of FreeCOM, calls to the Installable Commands\r\nAPI are made before executing any command. The API is situated at MUX-AE,\r\nthe Multiplexer interrupt 0x2F function 0xAE.\r\n\r\n<P>The interface is documented elsewhere, for instance RBIL (Ralph\r\nBrown's interrupt list).\r\n<P><HR>\r\n<H2><A NAME=\"feature_nls\">FEATURE_NLS - use DOS NLS</A></H2>\r\n<P>\r\n\r\n\r\nIf defined on compilation of FreeCOM, FreeCOM uses the information\r\nretrievable by the currently active DOS NLS using the API functions #65.\r\n\r\n<P>These information influence:\r\n<UL>\r\n<LI>the format displaying time and date information,\r\n<LI>the characters to delimit items in lists,\r\n<LI>the currency string and display format,\r\n<LI>how to up- (and supported by some NLS only) to lower-case characters,\r\n<LI>how to sort characters.\r\n</UL>\r\n<P><HR>\r\n<H2><A NAME=\"feature_call_logging\">FEATURE_CALL_LOGGING - Startup logging</A></H2>\r\n<P>\r\n\r\n\r\nIf defined on compilation of FreeCOM, all startups of a FreeCOM instance\r\nis logged into a file.\r\n<P>The drive the logfile is created on can be changed at run-time\r\nwith the external tool <TT>PTCHLDRV</TT>.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nCompile-time options:\r\n<UL>\r\n<LI><TT>LOG_FILE</TT>: The name of the logfile. Default: <TT>C:\\FreeCom.log</TT>\r\n</UL>\r\n<P><HR>\r\n<H2><A NAME=\"feature_filename_completion\">FEATURE_FILENAME_COMPLETION - Filename completion</A></H2>\r\nRequirements: <A HREF=\"#feature_enhanced_input\">FEATURE_ENHANCED_INPUT</A><BR>\r\n<P>\r\n\r\n\r\nIf defined on compilation of FreeCOM and if the enhanced command line\r\nediting is activated as well, the tabulatur key binding becomes available.\r\n\r\n<P>When the tabulator key is pressed, the word the cursor is located\r\non actually or is immediately preceeding is separated and tried to\r\nmatch against files, like a <TT><A HREF=\"#dir\">DIR</A></TT> command would do, e.g. when hitting tab\r\nat the command line:<BR>\r\n\r\n<TT> bar\\f_ some arguments</TT><BR>\r\n<BR>-- where the underscore <TT>_</TT> is to mark the location of the cursor and\r\nis <EM>no</EM> actual character -- causes FreeCOM to try to locate any\r\nfiles or directories matching the filename pattern <TT>bar\\f*.*</TT>.\r\n<BR>If none is found, a beep is issued to indicate that error and the\r\ncommand line remains unchanged.\r\n<BR>Otherwise as many characters are appended to the filename as are\r\nthe same for all found matches, e.g.:\r\n<BR><OL>\r\n<LI>if exactly one match was found, its name is appened.\r\n<LI>if, for example, the files or directories: <TT>FOO</TT>, <TT>FUU.TXT</TT>\r\nor <TT>FUU</TT> are present in the directory <TT>BAR</TT>, no character\r\nis appened, because there are no equal characters following the already\r\npresent <TT>f</TT> character.\r\n<LI>if, for example, the files or directories: <TT>FOO</TT>, <TT>FOO.TXT</TT>\r\nor <TT>FOO1.TXT</TT> are present in the directory <TT>BAR</TT>, the\r\ntwo characters <TT>OO</TT> are appened, because all found matches\r\nshare these two characters immediately following the already present\r\ncharacers. Hence, the command line is expanded to:<BR>\r\n\r\n<TT> bar\\FOO_ some arguments</TT><BR>\r\n<BR>Please note that the case of all characters will match the case\r\nof the retrieved filenames.\r\n</OL>\r\nIn addition, because in the cases 2 and 3 the file completion was not\r\ncomplete because more than one match was found, a beep is issued.\r\nIn this situation to hit the tabulator key a second time, without\r\nan intervueing other key press, causes to display all available matches,\r\nbut keeps the command line unchanged otherwise.\r\n<BR>If exactly one filename match was found, hence the file completion\r\nwas complete, and if the found match is a directory, a backslash is\r\nappended to. This allows to walk into deep levels of directories speededly.\r\n\r\n<P>If the cursor had been placed, for instance, under the backslash\r\nin above mentioned command line, the full string <TT>bar\\f</TT> had\r\nbeen tried to be completed as well. This behaviour differs from other\r\nimplementations.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nCompile-time options:\r\n<UL>\r\n<LI><TT>FILE_SEARCH_MODE</TT>: Filemode passed to the DOS API to aquire\r\nmatching directory entries. Default: Read-Only, Archive, Directory\r\n</UL>\r\n<P><HR>\r\n<H2><A NAME=\"feature_dirstack\">FEATURE_DIRSTACK - Directory stack</A></H2>\r\nSee also: <A HREF=\"#dirs\">DIRS</A>, <A HREF=\"#popd\">POPD</A>, <A HREF=\"#pushd\">PUSHD</A><BR>\r\n<P>\r\n\r\n\r\nThis feature is automatically enabled, if <TT><A HREF=\"#pushd\">PUSHD</A></TT> is enabled.\r\n\r\n<P>The directory stack pushes and pops directories on demand via the\r\ncommands <TT><A HREF=\"#pushd\">PUSHD</A></TT> and <TT><A HREF=\"#popd\">POPD</A></TT>. <TT><A HREF=\"#dirs\">DIRS</A></TT> displays all pushed directories.\r\n<P>Please see the documentation of the mentioned commands.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nCompile-time options:\r\n<UL>\r\n<LI><TT>DIRSTACK_DEFAULT_SIZE</TT>: The amount of bytes reserved to store\r\nitems of the directory stack. Default: 256\r\n</UL>\r\n<P><HR>\r\n<H2><A NAME=\"feature_history\">FEATURE_HISTORY - Command line history</A></H2>\r\nSee also: <A HREF=\"#history\">HISTORY</A><BR>\r\nRequirements: <A HREF=\"#feature_enhanced_input\">FEATURE_ENHANCED_INPUT</A><BR>\r\n<P>\r\n\r\n\r\nIf enabled on compilation of FreeCOM and the enhanced command line\r\nediting is acivated as well, the command line history becomes available.\r\n\r\n<P>When commands are enterred manually on the command line prompt\r\nof FreeCOM, old command lines are storred in the history and can\r\nbe retrieved later using the key bindings of <TT>F3</TT>, <TT>F1</TT>\r\nand the cursor Up and Down keys.\r\n<BR>Without the command line history at most one line is cached.\r\n\r\n<P>The command:<BR>\r\n\r\n<TT> <TT><A HREF=\"#history\">HISTORY</A></TT></TT><BR>\r\n<BR>displays all cached command lines.\r\n\r\n<P>The command:<BR>\r\n <TT>HISTORY</TT> <I>number</I><BR>\r\n\r\n<BR>resizes the amount of bytes reserved to cache command lines to\r\n<TT><I>number</I></TT> bytes. Doing so all cached command lines are deleted.\r\n\r\n<P>Each instance of FreeCOM maintains its own command line history,\r\nwhich is initially inherited from the particular parent instance,\r\nif any.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nCompile-time options:\r\n<UL>\r\n<LI><TT>HISTORY_DEFAULT_SIZE</TT>: The amount of bytes reserved initially.\r\nDefault: 256\r\n</UL>\r\n<P><HR>\r\n<H2><A NAME=\"feature_last_dir\">FEATURE_LAST_DIR - Change back to last directory</A></H2>\r\nSee also: <A HREF=\"#cd\">CD</A>, <A HREF=\"#cdd\">CDD</A>, <A HREF=\"#chdir\">CHDIR</A>, <A HREF=\"#popd\">POPD</A>, <A HREF=\"#pushd\">PUSHD</A><BR>\r\n<P>\r\n\r\n\r\nIf defined on compilation of FreeCOM, every change of the current\r\ndirectory using an internal command records the previous directory\r\nand enables the <TT><I>-</I></TT> shortcut for <TT><A HREF=\"#cd\">CD</A></TT>, <TT><A HREF=\"#cdd\">CDD</A></TT> and <TT><A HREF=\"#chdir\">CHDIR</A></TT>.\r\n\r\n\r\n<H4>Example: </H4>\r\n\r\n\r\n<TT> C&gt; <TT><A HREF=\"#cd\">CD</A></TT> \\</TT><BR>\r\n\r\n<TT> C&gt; <TT><A HREF=\"#cd\">CD</A></TT> freedos\\bin</TT><BR>\r\n\r\n<TT> C&gt; <TT><A HREF=\"#cd\">CD</A></TT> -</TT><BR>\r\n\r\n<TT> C&gt; <TT><A HREF=\"#cd\">CD</A></TT> -</TT><BR>\r\n<BR>The first <TT><A HREF=\"#cd\">CD</A></TT> command changes into the root direcotry, the second into\r\nthe directory <TT>\\FREEDOS\\BIN</TT>, any subsequent <TT><TT><A HREF=\"#cd\">CD</A></TT> -</TT> commands\r\nwill change between the root directory and <TT>\\FREEDOS\\BIN</TT>.\r\n<P><HR>\r\n<H2><A NAME=\"for\">FOR - Repeat a command</A></H2>\r\nRequirements: CMD_FOR<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>FOR</TT> <TT>'%'</TT> <I>letter</I> <TT>IN</TT> <TT>'('</TT> <B>{</B> <I>word</I> | <I>pattern</I> <B>}</B> <TT>')'</TT> <TT>DO</TT> &laquo;any command&raquo;<BR>\r\n\r\n\r\nExecutes\r\n &laquo;any command&raquo; for several values assigned to\r\nthe variable <TT><I>letter</I></TT>. The values are read strictly left to right\r\nfrom the <TT><I>word</I></TT>s and <TT><I>pattern</I></TT>s enclosed in\r\nparenthises; where <TT><I>pattern</I></TT>s are words containing\r\nwildcards and are replaced by all matching filenames.\r\n<P>Any occurence of a percent sign <TT>%</TT> and the specified letter\r\nis replaced by the current value of the <TT><A HREF=\"#for\">FOR</A></TT> loop. <EM>Note:</EM> The\r\nletter is case-sensitively matched!\r\n\r\n<P><STRONG>Warning #1</STRONG>: Unlike most commands\r\n<A HREF=\"#_appendix_redirection\">I/O-redirections</A> are passed forth to the\r\ncommand instead of to apply them to <TT><A HREF=\"#for\">FOR</A></TT> itself, e.g.:<BR>\r\n\r\n<TT> <TT><A HREF=\"#for\">FOR</A></TT> %a IN (*.*) DO <TT><A HREF=\"#echo\">ECHO</A></TT> %a &gt;q</TT><BR>\r\nrepeatedly executes the <TT><A HREF=\"#echo\">ECHO</A></TT> command with the redirection <TT>>q</TT>,\r\nhence, effectively overwriting the file each time.\r\n\r\n<BR><STRONG>Warning #2</STRONG>: Due the syntactical problem that the\r\n<TT><A HREF=\"#for\">FOR</A></TT> variable is specified as \r\n <TT>'%'</TT> <I>letter</I>, which is also\r\na legal start of an environment variable, the following kludge had\r\nbeen included to support <TT><A HREF=\"#for\">FOR</A></TT> and its special variables:\r\n<UL>\r\n<LI>You can use as many percent character as you wish as long as you\r\nuse exactly the same number for a particular <TT><A HREF=\"#for\">FOR</A></TT> variable.\r\n<LI>Before any environment variables are expanded, the command line\r\nis checked for the skeleton specified within the synopsis (there must\r\nnot be specified no redirection between the <TT><A HREF=\"#for\">FOR</A></TT> and DO keywords), if\r\nit is found, the <TT><A HREF=\"#for\">FOR</A></TT> command is executed <EM>without</EM> expanding\r\nany environment variables -- they get expanded each time the\r\ncommand is invoked.\r\n<LI><STRONG><FONT SIZE=\"+1\">Known Bug</FONT></STRONG>: Otherwise any\r\nenvironment variables are expanded and, if it happens\r\nthat a valid <TT><A HREF=\"#for\">FOR</A></TT> command is found now, the environment variables within\r\nthe command are expanded a second time.\r\nIn this case the I/O redirections are applied to <TT><A HREF=\"#for\">FOR</A></TT>, too, instead of\r\npassing them forth to the command.\r\n<LI><TT><A HREF=\"#for\">FOR</A></TT> commands as part of the command of <TT><A HREF=\"#call\">CALL</A></TT>, <TT><A HREF=\"#if\">IF</A></TT>, and <TT><A HREF=\"#for\">FOR</A></TT> itself are\r\nnever found before expanding the environment variables.\r\n</UL>\r\n\r\n<BR><STRONG>Warning #3</STRONG>: Due a bug in MS COMMAND (BugID #1050) the right\r\nparenthesis <STRONG>must</STRONG> be followed by at least one whitespace,\r\nthis allows the \"<EM>feature</EM>\" to embed such characters within the\r\nwords and patterns, e.g.:<BR>\r\n\r\n<TT> <TT><A HREF=\"#for\">FOR</A></TT> %a in (a()a b()b) DO command</TT><BR>\r\nexecutes the <TT>command</TT> two times, first replacing <TT>%a</TT>\r\nby <TT>a()a</TT>, second by <TT>b()b</TT>.\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#for\">FOR</A></TT> %z IN (*.*) DO copy %a a:</TT><BR>\r\n\r\nPerforms a <TT><TT><A HREF=\"#copy\">COPY</A></TT> xyz A:</TT> command for each file in the current\r\ndirectory. Its behaviour is equal to <TT><TT><A HREF=\"#copy\">COPY</A></TT> *.* A:</TT>\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#for\">FOR</A></TT> %z IN (a?b*.TXT) DO <TT><A HREF=\"#call\">CALL</A></TT> batch arg %z</TT><BR>\r\n\r\nExecutes the batch script <TT>batch.bat</TT> for each file matching\r\nthe pattern <TT>A?B*.TXT</TT> located in the current directory. Within the\r\nscript, the automatic variable <TT><I>%1</I></TT> always expands to the constant\r\nargument <TT><I>arg</I></TT>, whereas <TT><I>%2</I></TT> expands to the filename\r\nof the current loop.\r\n\r\n\r\n<H4>Example: 3</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#for\">FOR</A></TT> %a IN (1 2 3 4 5) DO <TT><A HREF=\"#echo\">ECHO</A></TT> %a</TT><BR>\r\n\r\nIs equal to the command sequence:<BR>\r\n\r\n<TT> <TT><A HREF=\"#echo\">ECHO</A></TT> 1</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#echo\">ECHO</A></TT> 2</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#echo\">ECHO</A></TT> 3</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#echo\">ECHO</A></TT> 4</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#echo\">ECHO</A></TT> 5</TT><BR>\r\n\r\nBecause these words do <EM>not</EM> contain no wildcards, they are <EM>not</EM>\r\nmatched as filenames.\r\n\r\n\r\n<H4>Example: 4</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#for\">FOR</A></TT> %g IN (1 2 3*) DO <TT><A HREF=\"#echo\">ECHO</A></TT> %g</TT><BR>\r\n\r\nPerforms the commands:<BR>\r\n\r\n<TT> <TT><A HREF=\"#echo\">ECHO</A></TT> 1</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#echo\">ECHO</A></TT> 2</TT><BR>\r\n\r\nand the <TT><A HREF=\"#echo\">ECHO</A></TT> command for each file in the current directory, that has no\r\nextension and which name starts with the digit three.\r\n<P><HR>\r\n<H2><A NAME=\"goto\">GOTO - Goto label</A></H2>\r\nRequirements: CMD_GOTO<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>GOTO</TT> <B>[</B> <TT>':'</TT> <B>]</B> <I>label</I><BR>\r\n\r\n\r\nNormally all commands of a batch script are executed in the sequence\r\nin which they are appear with the script. <TT><A HREF=\"#goto\">GOTO</A></TT> controls the command flow\r\nby unconditionally jumping to the specified <TT><I>label</I></TT>; the commands following that label\r\nwill be executed then. A label is written as a colon in the first\r\ncolumn of a line and the name of the label immediately behind. If FreeCOM\r\nhits a label in the normal flow, it is ignored completely, even any redirection\r\ncharacters are ignored.\r\n\r\n<P>The <TT><I>label</I></TT> must be located in the same script file as the\r\n<TT><A HREF=\"#goto\">GOTO</A></TT> itself, if it appears more than once, the first occurance takes\r\nprecedence.\r\n\r\n<P>Conditional jumps can be contructed with help of the <TT><A HREF=\"#if\">IF</A></TT> command, see\r\nexample 2.\r\n\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#goto\">GOTO</A></TT> ende</TT><BR>\r\n\r\nJumps the to label <TT>:ende</TT>\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> \"%1\"==\"\" <TT><A HREF=\"#goto\">GOTO</A></TT> emptyCommandLine</TT><BR>\r\n\r\nJumps to label <TT>:emptyCommandLine</TT>, if no argument had been\r\npassed to the batch script.\r\nFor instance:\r\n<PRE>@<TT><A HREF=\"#echo\">ECHO</A></TT> OFF\r\n<TT><A HREF=\"#if\">IF</A></TT> \"%1\"==\"\" <TT><A HREF=\"#goto\">GOTO</A></TT> error\r\n<TT><A HREF=\"#rem\">REM</A></TT> do something sane here\r\n<TT><A HREF=\"#goto\">GOTO</A></TT> ende\r\n\r\n:error\r\n<TT><A HREF=\"#echo\">ECHO</A></TT> You must pass an argument to me!\r\n\r\n:ende\r\n</PRE>\r\n<P><HR>\r\n<H2><A NAME=\"history\">HISTORY - Display command line history</A></H2>\r\nRequirements: <A HREF=\"#feature_history\">FEATURE_HISTORY</A><BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>HISTORY</TT><BR>\r\n\r\n<LI>\r\n <TT>HISTORY</TT> <I>number</I><BR>\r\n\r\n</OL>\r\n\r\n<P>\r\n\r\n\r\nThe first format without any argument displays all cached command\r\nlines.\r\n\r\n<P>The second format resizes the memory pre-allocated for the\r\ncommand line history cache to <TT><I>number</I></TT> bytes.\r\n\r\n<P><HR>\r\n<H2><A NAME=\"if\">IF - Conditional execution of a command</A></H2>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>IF</TT> <B>[</B> <TT>NOT</TT> <B>]</B> <TT>EXIST</TT> <I>file</I> &laquo;command&raquo;<BR>\r\n\r\n<LI>\r\n <TT>IF</TT> <B>[</B> <TT>NOT</TT> <B>]</B> <TT>ERRORLEVEL</TT> <I>number</I> &laquo;command&raquo;<BR>\r\n\r\n<LI>\r\n <TT>IF</TT> <B>[</B> <TT>NOT</TT> <B>]</B> <I>string</I> <TT>'=='</TT> <I>word</I> &laquo;command&raquo;<BR>\r\n\r\n<LI>\r\n <TT>IF</TT> <B>[</B> <TT>NOT</TT> <B>]</B> <I>quoted-string</I> <TT>'=='</TT> <I>quoted-string</I> &laquo;command&raquo;<BR>\r\n\r\n</OL>\r\n\r\nConditionally executes the specified\r\n &laquo;command&raquo;. If the keyword\r\n <TT>NOT</TT> is specified, the condition is negated, meaning, the\r\n &laquo;command&raquo; is executed, if the condition evaluates to false.\r\n\r\n<P>The first condition evaluates to true, if the specified <TT><I>file</I></TT>\r\nexists. Wildcards are supported. On local file systems one can test for\r\ncharacter devices, too.\r\n\r\n<P>The second variant evaluates to true, if the errorlevel is currently\r\nassigned to a number greater or equal than the specified <TT><I>number</I></TT>.\r\nErrorlevels are assigned when external commands terminates or via\r\n<TT><A HREF=\"#cancel\">CANCEL</A></TT> or <TT><A HREF=\"#quit\">QUIT</A></TT>.\r\n<BR>Due to compatibly with other DOS shells FreeCOM does not check, if\r\nthe specified errorlevel is a number, but silently accepts any string.\r\nThis allows to use the so-called <EM>Benny levels</EM>, where you\r\ncan specify <TT>HA</TT>, <TT>HB</TT>, ... , <TT>HZ</TT> or\r\n<TT>xa</TT>, <TT>xb</TT>, ... , <TT>xz</TT> instead of\r\n<TT>1</TT>, <TT>2</TT>, ... , <TT>26</TT>. Some malformed\r\nbatch script use this syntax to make mapping of errorlevels to\r\ndrive letters <EM>more visible</EM>. See example 5.\r\n\r\n<P>The third and four ones are true, when the left string is case-sensitively\r\nequal to the string on the right side of the double equal sign.\r\nEither side may be quoted by double quotes, though, if the right side\r\nis <EM>not</EM> quoted, the first word is tested only.\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> NOT EXIST c:\\command.com <TT><A HREF=\"#echo\">ECHO</A></TT> There is no COMMAND.COM in C:\\</TT><BR>\r\n<BR>Executes the <TT><A HREF=\"#echo\">ECHO</A></TT> command, if a file <TT>C:\\COMMAND.COM</TT>\r\ndoes <EM>not</EM> exist.\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> EXIST c:\\fdos\\nul <TT><A HREF=\"#goto\">GOTO</A></TT> have_fdos_directory</TT><BR>\r\n<BR>Branch the interpretation of the batch script to the label, if\r\nthe file <TT>C:\\FDOS\\NUL</TT> exists. Because the filename <TT>NUL</TT>\r\ncorresponds to the character device <TT>NUL:</TT>, which always exists,\r\nthis test may be used to probe for the existance of the path\r\n<TT>C:\\FDOS</TT>, because all character devices are virtually present in\r\nevery directory of local filesystems.\r\n\r\n\r\n<H4>Example: 3</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> %1==name <TT><A HREF=\"#echo\">ECHO</A></TT> First argument is \"name\"</TT><BR>\r\n<BR><TT><A HREF=\"#echo\">ECHO</A></TT> is executed, if the first argument of the current batch script\r\nis <TT><I>\"name\"</I></TT> (without the quotes). <TT>%1</TT> may expand to\r\nany string, even with embedded whitespaces, but without an embedded\r\ndouble equal sign. Also, metacharacters included within the argument\r\nare evaluated.\r\n\r\n\r\n<H4>Example: 4</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> \"%1\"==\"first name\" <TT><A HREF=\"#echo\">ECHO</A></TT> First argument is \"first name\"</TT><BR>\r\n<BR><TT><A HREF=\"#echo\">ECHO</A></TT> is executed, if the first argument of the current batch script\r\nis <TT><I>\"first name\"</I></TT> (without the quotes). <TT>%1</TT> may expand\r\nto any string, even with embedded whitespaces or an embedded double\r\nequal sign or metacharacters.\r\n\r\n\r\n<H4>Example: 5</H4>\r\n\r\n &laquo;program&raquo;<BR>\r\n\r\n\r\n<TT> <TT><A HREF=\"#set\">SET</A></TT> drv=</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#for\">FOR</A></TT> %%Z IN (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO <TT><A HREF=\"#if\">IF</A></TT> ERRORLEVEL H%%Z <TT><A HREF=\"#set\">SET</A></TT> drv=%%Z</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> ERRORLEVEL 27 <TT><A HREF=\"#set\">SET</A></TT> drv=</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> \"%drv%\"==\"\" goto error_no_drive_letter</TT><BR>\r\n<BR>Assuming that\r\n &laquo;program&raquo; is setting the exit code to 1..26 for the drive letter, e.g. when\r\nsearching for RAMdisks, this code snippet assigns the drive letter to\r\nthe environment variable <TT>drv</TT> or unsets the variable on error.\r\n\r\n<P><STRONG>Note:</STRONG> The following code is equal to the above one\r\nand fully compatible to all shells:\r\n &laquo;program&raquo;<BR>\r\n\r\n\r\n<TT> <TT><A HREF=\"#set\">SET</A></TT> drv=</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> ERRORLEVEL 1 <TT><A HREF=\"#set\">SET</A></TT> drv=A</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> ERRORLEVEL 2 <TT><A HREF=\"#set\">SET</A></TT> drv=B</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> ERRORLEVEL 3 <TT><A HREF=\"#set\">SET</A></TT> drv=C</TT><BR>\r\n<BR>...  <BR>\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> ERRORLEVEL 25 <TT><A HREF=\"#set\">SET</A></TT> drv=Y</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> ERRORLEVEL 26 <TT><A HREF=\"#set\">SET</A></TT> drv=Z</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> ERRORLEVEL 27 <TT><A HREF=\"#set\">SET</A></TT> drv=</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> \"%drv%\"==\"\" goto error_no_drive_letter</TT><BR>\r\n<P><HR>\r\n<H2><A NAME=\"feature_load_messages\">FEATURE_LOAD_MESSAGES - Load messages permanently</A></H2>\r\n<P>\r\n\r\n\r\nIf enabled on compilation of FreeCOM, the <TT><B>/MSG</B></TT> becomes\r\navailable.\r\n\r\n<P>If this option is present, when an instance of FreeCOM is created,\r\nthe FreeCOM messages are loaded into memory permanently. Otherwise,\r\nthe messages are loaded on demand and are removed from memory when an\r\nexternal command is executed, in order to conserve memory.\r\n\r\n<P>This feature may help to run FreeCOM on disk- and floppyless boxes.\r\n<P><HR>\r\n<H2><A NAME=\"loadfix\">LOADFIX - Load an external program above the first 64KB memory</A></H2>\r\nSee also: <A HREF=\"#call\">CALL</A>, <A HREF=\"#loadhigh\">LOADHIGH</A><BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>LOADFIX</TT> <I>program</I> <B>[{</B> <I>argument</I> <B>}]</B><BR>\r\n\r\n\r\nLoads and executes an exepacked program, that would abort execution\r\nwith the error message \"Packed file corrupt\" otherwise.\r\n\r\n<P><EM>Attention:</EM> This command is not available in the\r\nXMS-only variant of FreeCOM!\r\n\r\n\r\n<H4>Example: </H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#loadfix\">LOADFIX</A></TT> program.exe</TT><BR>\r\n<P><HR>\r\n<H2><A NAME=\"loadhigh\">LOADHIGH - Load an external program into high memory</A></H2>\r\nSee also: <A HREF=\"#call\">CALL</A>, <A HREF=\"#loadfix\">LOADFIX</A><BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>LOADHIGH</TT> <B>[{</B> <I>option</I> <B>}]</B> <I>program</I> <B>[{</B> <I>argument</I> <B>}]</B><BR>\r\n\r\n\r\nLoads and executes an external program in high memory, also called UMB.\r\nThis command is used to load TSRs, such mouse drivers, into the upper\r\nmemory to conserve the conventional memory for programs.\r\n\r\n\r\n<H4>Example: </H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#loadhigh\">LOADHIGH</A></TT> lmouse.com</TT><BR>\r\n<P><HR>\r\n<H2><A NAME=\"md\">MD - make directory</A></H2>\r\nSee also: <A HREF=\"#cd\">CD</A>, <A HREF=\"#mkdir\">MKDIR</A>, <A HREF=\"#rd\">RD</A><BR>\r\nRequirements: CMD_MKDIR<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>MD</TT> <I>path</I><BR>\r\n\r\n\r\nCreates a directory of the specified name <TT><I>path</I></TT>. Any parent\r\ndirectories must already exist.\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#md\">MD</A></TT> C:\\1</TT><BR>\r\n<BR>Creates the directory <TT>1</TT> in the root directory of drive\r\n<TT>C:</TT>.\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#mkdir\">MKDIR</A></TT> C:\\1\\2\\3</TT><BR>\r\n<BR>Creates the directory <TT>3</TT> in the directory <TT>\\1\\2</TT> of\r\ndrive <TT>C:</TT>. If the directory <TT>C:\\1\\2</TT> does not exist, yet,\r\nthe command fails.\r\n<P><HR>\r\n<H2><A NAME=\"memory\">MEMORY - Display the internally used memory</A></H2>\r\nRequirements: CMD_MEMORY<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>MEMORY</TT><BR>\r\n\r\n\r\n<P>\r\n\r\n\r\nDisplays the useage of internal memory of FreeCOM.\r\n\r\n<FONT COLOR=\"#CC0000\">Note</FONT>: The internals of FreeCOM are currently under heavy\r\nconstruction, the actual output might vary heavily from this example.\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<TT> <TT><A HREF=\"#memory\">MEMORY</A></TT></TT><BR>\r\n\r\nmay display this:\r\n<PRE>\r\nEnvironment segment    : max  1200 bytes; free     8 bytes\r\nContext segment        : max  2304 bytes; free  2252 bytes\r\n        Aliases        : limit  1024 bytes, current     5 bytes,     0 items\r\n        History        : limit   256 bytes, current    34 bytes,     2 items\r\n        Directory stack: limit   256 bytes, current     5 bytes,     0 items\r\n        Last dir cache : used      0 bytes,     0 items\r\n        Swapinfo       : used      0 bytes,     0 items\r\nHeap                   : free 482080 bytes\r\n</PRE>\r\n<UL>\r\n<LI>The <TT>Environment segment</TT> is the storage area, the environment\r\nvariables are storred in. It may be changed passing the <TT><B>/E</B></TT>\r\noption to FreeCOM.\r\n<LI>FreeCOM stores several internal information into the\r\n<TT>Context segment</TT>; the aliases - modified by the <TT><A HREF=\"#alias\">ALIAS</A></TT> command -,\r\nthe history - displayed using the <TT><A HREF=\"#history\">HISTORY</A></TT> command, accessed by pressing\r\nthe cursor Up/Down keys on command line -, the directory stack - displayed\r\nwith the <TT><A HREF=\"#dirs\">DIRS</A></TT> command and accessed using the <TT><A HREF=\"#pushd\">PUSHD</A></TT> and <TT><A HREF=\"#popd\">POPD</A></TT> commands -,\r\nthe last directory - accessed with the <TT><TT><A HREF=\"#cd\">CD</A></TT> -</TT> command -, and,\r\nfinally, some internal command used by the low-level swap interface of\r\nFreeCOM.\r\n<LI>The <TT>heap</TT> is the storage area FreeCOM can allocated\r\nmemory from itself. This value is useful for FreeCOM developers\r\nmostly.\r\n</UL>\r\n<UL>\r\n<LI><TT>max</TT> specifies the maximum amount of bytes allocatable\r\nwithin this storage area.\r\n<LI><TT>free</TT> specifies the unused bytes within this storage area.\r\n<LI><TT>limit</TT> specifies the maximum amount of bytes allocatable\r\nfor the particular information within the area.\r\n<LI><TT>current</TT> specifies the amount of bytes currently allocated\r\nfor the particular information.\r\n<LI><TT>items</TT> specifies the number of items storred\r\nfor the particular information, e.g. how many directories have been\r\npushed onto the stack using <TT><A HREF=\"#pushd\">PUSHD</A></TT>.\r\n</UL>\r\n<P><HR>\r\n<H2><A NAME=\"mkdir\">MKDIR - Make directory</A></H2>\r\nThis command is 100% compatible to <A HREF=\"#md\">MD</A>, please see there\r\n<P><HR>\r\n<H2><A NAME=\"path\">PATH - Display or set the search path</A></H2>\r\nRequirements: CMD_PATH<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>PATH</TT><BR>\r\n\r\n<LI>\r\n <TT>PATH</TT> <B>[</B> <TT>'='</TT> <B>]</B> <B>{</B> <I>path</I> <B>:</B> <TT>';'</TT> <B>}</B><BR>\r\n\r\n<LI>\r\n <TT>PATH;</TT><BR>\r\n\r\n</OL>\r\n\r\nDisplays or assigns a new search path.\r\n\r\n<P>The first variant displays the currently active search path.\r\n\r\n<P>The second one assigns the specified paths to the search path.\r\nThe leading equal sign, if present, is ignored.\r\n\r\n<P>The third variant empties the search path.\r\n\r\n<P>When FreeCOM searches for an external command or a batch script, which\r\nhas no path specified, it is search for in all the directories specified\r\nin the search path. If the current directory <TT>.</TT> is not mentioned\r\nin the search path, it is searched through first.\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#path\">PATH</A></TT> c:\\fdos\\bin;c:\\tools;d:\\others\\bin;bin</TT><BR>\r\n<BR>If FreeCOM is to execute an external program, e.g. <TT>XCOPY</TT>,\r\nFreeCOM will search for the program in the following directories in the\r\nspecified order, the first program file found is executed:\r\n<OL>\r\n<LI>the current directory\r\n<LI><TT>C:\\FDOS\\BIN</TT>\r\n<LI><TT>C:\\TOOLS</TT>\r\n<LI><TT>D:\\OTHERS\\BIN</TT>\r\n<LI><TT>BIN</TT>\r\n</OL>\r\n<BR>Note: Because the last directory specification is a relative one,\r\nrather than an absolute one, the program is searched for in the\r\nsub-directory <TT>BIN</TT> of the current directory.\r\n<P><HR>\r\n<H2><A NAME=\"pause\">PAUSE - Pauses batch file execution</A></H2>\r\nRequirements: CMD_PAUSE<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>PAUSE</TT><BR>\r\n\r\n<LI>\r\n <TT>PAUSE</TT> &laquo;string&raquo;<BR>\r\n\r\n</OL>\r\n\r\n\r\n<P>Pauses the batch file execution until a key is pressed.\r\n<P><TT><TT><A HREF=\"#pause\">PAUSE</A></TT></TT> prompts the user with the specified string or,\r\nif none is specifed, \"<TT>Press any key to proceed</TT>\"\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#pause\">PAUSE</A></TT></TT><BR>\r\nJust pauses the execution.\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#pause\">PAUSE</A></TT> Execution paused, press any key to proceed ...</TT><BR>\r\nPauses execution displaying this string.\r\n\r\n\r\n<H4>Example: 3</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#pause\">PAUSE</A></TT> &gt;nul</TT><BR>\r\nPauses execution, but does not display any prompt.\r\n<P><HR>\r\n<H2><A NAME=\"popd\">POPD - Change back to the last pushed directory</A></H2>\r\nSee also: <A HREF=\"#cd\">CD</A>, <A HREF=\"#cdd\">CDD</A>, <A HREF=\"#dirs\">DIRS</A>, <A HREF=\"#popd\">POPD</A><BR>\r\nRequirements: CMD_CDD, CMD_POPD<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>POPD</TT><BR>\r\n\r\n<LI>\r\n <TT>POPD</TT> <TT>'*'</TT><BR>\r\n\r\n</OL>\r\n\r\n<P>The first variant changes the current directory back to the one,\r\nin which the last <TT><A HREF=\"#pushd\">PUSHD</A></TT> command was executed.\r\n\r\n<P>The second one clears all entries of the directory stack, but does\r\nnot change the current directory.\r\n<P><HR>\r\n<H2><A NAME=\"prompt\">PROMPT - Display or set the shell prompt</A></H2>\r\nRequirements: CMD_PROMPT<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>PROMPT</TT><BR>\r\n\r\n <TT>PROMPT</TT> <B>[</B> <TT>'='</TT> <B>]</B> <I>prompt</I><BR>\r\n\r\n\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<P><HR>\r\n<H2><A NAME=\"pushd\">PUSHD - Push the current working directory onto the directory stack</A></H2>\r\nSee also: <A HREF=\"#cd\">CD</A>, <A HREF=\"#cdd\">CDD</A>, <A HREF=\"#dirs\">DIRS</A>, <A HREF=\"#popd\">POPD</A><BR>\r\nRequirements: CMD_CDD, CMD_PUSHD<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>PUSHD</TT> <I>directory</I><BR>\r\n\r\n\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<P><HR>\r\n<H2><A NAME=\"quit\">QUIT - Terminate the current script</A></H2>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>QUIT</TT> <B>[</B> <I>n</I> <B>]</B><BR>\r\n\r\n\r\nTerminates the current active batch script and, if present, assigns\r\nthe specified number <TT><I>n</I></TT> to the errorlevel.\r\n\r\n<P><EM>Note</EM>: This command is a <A HREF=\"#_appendix_hicmd\">hidden internal command</A>.\r\n<P><HR>\r\n<H2><A NAME=\"rd\">RD - Remove directory</A></H2>\r\nSee also: <A HREF=\"#cd\">CD</A>, <A HREF=\"#md\">MD</A>, <A HREF=\"#rmdir\">RMDIR</A><BR>\r\nRequirements: CMD_RMDIR<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>RD</TT> <I>path</I><BR>\r\n\r\n\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<P><HR>\r\n<H2><A NAME=\"rem\">REM - Marks comments or remarks in batchfiles</A></H2>\r\nRequirements: CMD_REM<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>REM</TT> &laquo;string&raquo;<BR>\r\n\r\n\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<P><HR>\r\n<H2><A NAME=\"ren\">REN - Rename files</A></H2>\r\nSee also: <A HREF=\"#rename\">RENAME</A><BR>\r\nRequirements: CMD_RENAME<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>REN</TT> &laquo;source&raquo; &laquo;destination&raquo;<BR>\r\n\r\n\r\nRenames the source file(s) into the target file(s). See also: \\REF{wildcards}\r\n\r\n<P>The\r\n &laquo;destination&raquo; must not contain any path specification, the\r\n &laquo;source&raquo; file is renamed within the directory it is currently located in, see\r\nexample 2 below. Any wildcards used within\r\n &laquo;destination&raquo; are replaced by the corresponding character of the source filename,\r\nsee example 4 below.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n\r\n<TT> <TT><A HREF=\"#ren\">REN</A></TT> file1.txt file2.txt</TT><BR>\r\n\r\nRenames <TT>file1.txt</TT> into <TT>file2.txt</TT>\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n\r\n<TT> <TT><A HREF=\"#ren\">REN</A></TT> path\\file1.txt file2.txt</TT><BR>\r\n\r\nRenames <TT>path\\file1.txt</TT> into <TT>path\\file2.txt</TT>\r\n\r\n\r\n<H4>Example: 3</H4>\r\n\r\n\r\n\r\n<TT> <TT><A HREF=\"#ren\">REN</A></TT> path\\file*.txt *.bak</TT><BR>\r\n\r\nRenames all files located within directory <TT>path</TT> with extension\r\n<TT>.txt</TT> and which filename is beginning with <TT>file</TT>,\r\nsuch as <TT>file.txt</TT>, <TT>filea.txt</TT> and <TT>file99xx.txt</TT>,\r\ninto <TT>*.bak</TT> files.\r\n\r\n\r\n<H4>Example: 4</H4>\r\n\r\n\r\n\r\n<TT> <TT><A HREF=\"#ren\">REN</A></TT> *.DAT A*.*</TT><BR>\r\n\r\nRenames all files located within the current directory with extension\r\n<TT>.DAT</TT> into files by replacing the very first character of\r\nthe filename by the letter <TT>A</TT>, all other characters, the\r\nfile extension and path are remain unchanged.\r\n\r\n\r\n<H4>Example: 5</H4>\r\n\r\n\r\n\r\n<TT> <TT><A HREF=\"#ren\">REN</A></TT> *.TXT ??b*.bak</TT><BR>\r\n\r\nRenames all files located within the current directory with extension\r\n<TT>.TXT</TT> into files by replacing the <EM>third</EM> character of\r\nthe filename by the letter <TT>B</TT> and the file extension to\r\n<TT>.BAK</TT>, all other characters and the\r\nfile path are remain unchanged.\r\n\r\n<P><STRONG>Warning:</STRONG> If the source file name consists of one\r\ncharacter only, the second question mark in the destination pattern\r\nis ignored, hence, e.g. the file <TT>A.TXT</TT> is renamed into\r\n<TT>AB.BAK</TT> by this example, what is <EM>incompatible</EM> to\r\nMS COMMAND v6.22 <FONT SIZE=-1>(maybe others, too)</FONT>, which\r\nembedds a space as second character making the file inaccessable,\r\nbut what is exactly the same behaviour of the same MS COMMAND's <TT><A HREF=\"#copy\">COPY</A></TT>\r\ncommand.\r\n<P><HR>\r\n<H2><A NAME=\"rename\">RENAME - Rename files</A></H2>\r\nThis command is 100% compatible to <A HREF=\"#ren\">REN</A>, please see there\r\n<P><HR>\r\n<H2><A NAME=\"rmdir\">RMDIR - Remove directory</A></H2>\r\nThis command is 100% compatible to <A HREF=\"#rd\">RD</A>, please see there\r\n<P><HR>\r\n<H2><A NAME=\"set\">SET - Display or set environment variables</A></H2>\r\nRequirements: CMD_SET<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>SET</TT> <B>[{</B> <I>option</I> <B>}]</B><BR>\r\n\r\n<LI>\r\n <TT>SET</TT> <B>[{</B> <I>option</I> <B>}]</B> <I>variable</I> <TT>'='</TT> &laquo;string&raquo;<BR>\r\n\r\n</OL>\r\n\r\n<P>\r\n\r\n\r\nThe first variant <FONT SIZE=-1>(without any argument)</FONT> displays\r\nall the currently defined environment variables in the format\r\n<FONT SIZE=-1>(without any whitespaces before or after the equal sign)</FONT>:\r\n <I>name</I> <TT>'='</TT> &laquo;value&raquo;<BR>\r\n\r\n\r\n<P>The second variant assigns a new value\r\n &laquo;string&raquo; to the specified\r\n <I>variable</I>. If the\r\n <I>variable</I> already exists, the old value is overwritten without notice; otherwise\r\nit is newly created.\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n\r\nAll options must preceed the assigment, if present.\r\n\r\n<P><UL>\r\n<LI><TT><B>/C</B></TT>: forces to keep the exact case of the letters\r\nof the variable name; by default all letters are uppercased to\r\nkeep compatibly.\r\n<LI><TT><B>/I</B></TT>: has been temporarily included to the <TT><A HREF=\"#set\">SET</A></TT> command to\r\nallow an easy way to display the current size of the environment segment,\r\nbecause it is one of the most frequently reported, but not reproduceable\r\nbug report. Once this option has been encountered, all the remaining command\r\nline is ignored.\r\n<LI><TT><B>/P</B></TT>: Prompts the user with the specified \r\n &laquo;string&raquo; and assigns the user's input to the \r\n <I>variable</I>. If no input is made, hence,\r\none taps just <TT>ENTER</TT>, an empty value is assigned to the\r\n <I>variable</I>, which is then removed from the environment.\r\n</UL>\r\n<P><HR>\r\n<H2><A NAME=\"shift\">SHIFT - Shift the arguments of a batch script</A></H2>\r\nRequirements: CMD_SHIFT<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>SHIFT</TT><BR>\r\n\r\n<LI>\r\n <TT>SHIFT</TT> <TT>DOWN</TT><BR>\r\n\r\n</OL>\r\n\r\n<P>\r\n\r\nShifts the arguments of a batch script one position up (first\r\nvariant) or down (second variant).\r\n\r\n<P>Within a batch script the automatic variables %0 through %9\r\nare replaced by the script name and the first nine arguments.\r\nThis can be imagined as a window to ten arguments of the script.\r\n<TT><A HREF=\"#shift\">SHIFT</A></TT> will allow to move this window of ten arguments towards its\r\nend (up) or its start (down).\r\n\r\n<P>After <TT><A HREF=\"#shift\">SHIFT</A></TT> has been executed, the former %0 is hidden and inaccessable,\r\n%1 became %0, %2 became %1 a.s.o, %9 became %8 and the formerly hidden\r\ntenth argument became %9.\r\n<BR><TT><TT><A HREF=\"#shift\">SHIFT</A></TT> DOWN</TT> reverses one <TT><A HREF=\"#shift\">SHIFT</A></TT> command.\r\n\r\n<P><TT><A HREF=\"#shift\">SHIFT</A></TT> can be called as many times as wanted, <TT><TT><A HREF=\"#shift\">SHIFT</A></TT> DOWN</TT>\r\nwon't allow to underflow the very first argument.\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\nIf the batch script B.BAT:<BR>\r\n\r\n<TT> @<TT><A HREF=\"#echo\">ECHO</A></TT> OFF</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#echo\">ECHO</A></TT> 0: %0</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#echo\">ECHO</A></TT> 1: %1</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#echo\">ECHO</A></TT> 2: %2</TT><BR>\r\nhad been executed using:<BR>\r\n\r\n<TT> B.BAT 1 2 3 4</TT><BR>\r\nit displays:\r\n<PRE>B.BAT\r\n1\r\n2</PRE>\r\n<BR>If a <TT><A HREF=\"#shift\">SHIFT</A></TT> command had been inserted as second line, the\r\nsame call displays:\r\n<PRE>1\r\n2\r\n3</PRE>\r\n<P><HR>\r\n<H2><A NAME=\"time\">TIME - Display or set current time</A></H2>\r\nSee also: <A HREF=\"#date\">DATE</A><BR>\r\nRequirements: CMD_TIME<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n<OL>\r\n<LI>\r\n <TT>TIME</TT> <B>[</B> <B>/T</B> <B>]</B><BR>\r\n\r\n<LI>\r\n <TT>TIME</TT> <B>[</B> <B>/T</B> <B>]</B> <I>time</I><BR>\r\n\r\n</OL>\r\n\r\nVariant 1 displays the current time, then enters a loop prompting the\r\nuser to enter a new time. The loops terminates when a valid time had\r\nentered or the user just pressed the <TT>ENTER</TT> key.\r\n\r\n<P>Variant 2 does not display the current time, but tries to change the\r\ncurrent time to the specified <TT><I>time</I></TT>, on failure the loop as\r\nexplained above is entered.\r\n\r\n<P>The individual portions of a time may be sperated by at least:\r\ndots <TT>.</TT>, colons <TT>:</TT> and forward slashes <TT>/</TT>. Other\r\nnationally used characters may be supported, too.\r\nIf a certain number of portions are specified:\r\n<OL>\r\n<LI>error,\r\n<LI>hour:minute; seconds and hundreds default to zero,\r\n<LI>hour:minute:seconds; hundreds defaults to zero,\r\n<LI>hour:minute:seconds.hundreds;\r\n<LI>more than 4 portions result in an error.\r\n</OL>\r\nSeparated by no, one or more whitespaces the am/pm modifiers may follow\r\noptionally. If present they alter the given time as follows:\r\n<UL>\r\n<LI>AM: if hour is equal to 12, it becomes 0 (midnight).\r\n<LI>PM: f hour is greater than 12, it is incremented by 12.\r\n</UL>\r\n\r\n\r\n<H3>Options</H3>\r\n\r\n\r\nAll options must preceed any arguments.\r\n\r\n\r\n<P><TT><B>/T</B></TT>: prevents from prompting the user.\r\n<OL>\r\n<LI>In variant 1, the time is displayed only.\r\n<LI>In variant 2, the time is tried to be changed, but the loop is not\r\nentered on failure.\r\n</OL>\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#time\">TIME</A></TT> /T</TT><BR>\r\n\r\nJust displays the current time.\r\n\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#time\">TIME</A></TT> 18:2</TT><BR>\r\n\r\nSets the current system time to 6:02 PM.\r\n<P><HR>\r\n<H2><A NAME=\"truename\">TRUENAME - Display the true name of a file</A></H2>\r\nRequirements: CMD_TRUENAME<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>TRUENAME</TT> <I>path</I><BR>\r\n\r\n\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<P><HR>\r\n<H2><A NAME=\"type\">TYPE - Display the contents of files</A></H2>\r\nSee also: <A HREF=\"#dir\">DIR</A>, <A HREF=\"#echo\">ECHO</A><BR>\r\nRequirements: CMD_TYPE<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>TYPE</TT> <B>{</B> <I>pattern</I> <B>}</B><BR>\r\n\r\n\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<P><HR>\r\n<H2><A NAME=\"ver\">VER - Display the version information about FreeCOM and DOS</A></H2>\r\nRequirements: CMD_VER<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>VER</TT> <B>[{</B> <I>option</I> <B>}]</B><BR>\r\n\r\n\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<P><HR>\r\n<H2><A NAME=\"verify\">VERIFY - Display or set verify level</A></H2>\r\nRequirements: CMD_VERIFY<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>VERIFY</TT> <B>[</B> <TT>ON</TT> | <TT>OFF</TT> <B>]</B><BR>\r\n\r\n\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<P><HR>\r\n<H2><A NAME=\"vol\">VOL - Display the volume label of a drive</A></H2>\r\nSee also: <A HREF=\"#dir\">DIR</A><BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>VOL</TT> <B>[</B> <I>drive</I> <B>]</B><BR>\r\n\r\n\r\n\r\n\r\n<H3>Options</H3>\r\n\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"#_appendix_options\">standard rules for options</A>.\r\n\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<P><HR>\r\n<H2><A NAME=\"which\">WHICH - Search and display the executable file of specified commands</A></H2>\r\nRequirements: CMD_WHICH<BR>\r\n\r\n<H3>Synopsis</H3>\r\n\r\n <TT>WHICH</TT> <B>[{</B> <I>command</I> <B>}]</B><BR>\r\n\r\n<P>Searches for the specified command(s) the same way as if it would\r\nbe specified on command line as command itself. If an executable\r\nfile is found, its path is displayed in this format:<BR>\r\n <I>command</I> &laquo;tab&raquo; <I>path</I><BR>\r\n\r\n<BR>The \r\n &laquo;tab&raquo; stands for the tabulator character (ASCII 9).\r\n<BR>If the command is not found only the\r\n <I>command</I> part, but neither a\r\n <I>path</I> nor the\r\n &laquo;tab&raquo; is displayed.\r\n<P>Internal commands, installable commands and aliases are not found.\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#which\">WHICH</A></TT> which</TT><BR>\r\n\r\nReturns a file or nothing, because <TT><A HREF=\"#which\">WHICH</A></TT> is an internal command.\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#which\">WHICH</A></TT> command</TT><BR>\r\nCould display for instance:\r\n<PRE>command\tC:\\COMMAND.COM</PRE>\r\n<P>Please note that <TT>command</TT> is the string \"command\"\r\nand no placeholder.\r\n<P><HR>\r\n<H2><A NAME=\"_appendix\">Appendix</A></H2>\r\n<H3><A NAME=\"_appendix_currdir\">Current Directory</A></H3>\r\n\r\nThe current directory is the default directory of a drive.\r\n\r\n<P>DOS stores a default directory for each drive. When a path is\r\nspecified with a drive specification only, such as <TT>D:</TT>,\r\nit is completed with this default directory of that drive to\r\nconstruct the <A HREF=\"#_appendix_abspath\">absolute path</A> to be used.\r\n\r\n<H3><A NAME=\"_appendix_cwd\">Current Working Direcory</A></H3>\r\n\r\nIn opposite to the current directory the current <EM>working</EM>\r\ndirectory is the <A HREF=\"#_appendix_abspath\">absolute path</A> constructed\r\nout of the <A HREF=\"#chgdrive\">currently selected drive</A> and <A\r\nHREF=\"cd\">current directory</A> of that drive.\r\n\r\n<H3><A NAME=\"_appendix_abspath\">Path Specification</A></H3>\r\n\r\nIn DOS an absolute path is constructed out of several components:\r\n<OL>\r\n<LI>drive,\r\n<LI>directory,\r\n<LI>filename, and\r\n<LI>file extension.\r\n</OL>\r\nlike this: <TT>D:\\DIR1\\DIR2\\FILENAME.EXT</TT>.\r\n\r\n<P>The drive is a single letter from <TT>A</TT> through <TT>Z</TT>\r\nfollowed by a colon <TT>:</TT>.\r\n\r\n<P>The remaining part of a path consists of similiar components\r\ndelimited by a single backslash <TT>\\</TT>. The last component\r\nis also called filename. Each of these components may be formed of\r\na name, up to eight characters long, and an extension, up to\r\nthree characters long. Both parts are delimited by a single dot\r\n<TT>.</TT>. Although the extension may be absent, the filename\r\nmust have at least one character.\r\n<BR>Note: The term <EM>filename</EM> is not limited to <EM>files</EM>\r\nin the usual sense, but may apply to any name visible in a directory,\r\nsuch as subdirectories and volume labels, as well.\r\n\r\n<P>To ease the way to enter a path the user may specify a relative path,\r\nrather than an absolute one. In such path one or more components may\r\nbe missing:\r\n\r\n<UL>\r\n<LI>If no drive is specified, what means that no colon is specified, the\r\npath is prefixed by the <A HREF=\"#chgdrive\">currently selected\r\ndrive</A>.\r\n\r\n<LI>If the directory is not prefixed by the backslash or no directory\r\nis specified at all, the <A HREF=\"#_appendix_currdir\">current directory</A>\r\nof the drive is inserted right behind the colon.\r\n\r\n<LI>Some programs may append an absent extension to the very last\r\nfilename component.\r\n\r\n</UL>\r\n\r\n<P>Examples, assume the current directories of\r\n<TABLE BORDER=1>\r\n<TR>\r\n\t<TD><B>Drive</B></TD>\r\n\t<TD><B>Current Directory</B></TD>\r\n</TR>\r\n<TR>\r\n\t<TD>C:</TD>\r\n\t<TD><TT>\\FREEDOS\\HELP</TT></TD>\r\n</TR>\r\n<TR>\r\n\t<TD>D:</TD>\r\n\t<TD><TT>\\TEMP\\TEXT</TT></TD>\r\n</TR>\r\n</TABLE>\r\nThe currently selected drive is <TT>C:</TT>.\r\n\r\n<OL>\r\n<LI><TT>C:\\</TT>\r\n<BR>The root directory of drive <TT>C:</TT>.\r\n\r\n<LI><TT>.</TT>\r\n<BR>The current working directory, ergo: <TT>C:\\FREEDOS\\HELP</TT>.\r\n\r\n<LI><TT>..</TT>\r\n<BR>The parent directory, ergo: <TT>C:\\FREEDOS</TT>.\r\n\r\n<LI><TT>D:</TT>\r\n<BR>The current directory of drive <TT>D:</TT>, ergo: <TT>D:\\TEMP</TT>.\r\n\r\n<LI><TT>D:.</TT>\r\n<BR>The current directory of drive <TT>D:</TT>, ergo: <TT>D:\\TEMP</TT>.\r\n\r\n<LI><TT>D:..</TT>\r\n<BR>The parent directory of drive <TT>D:</TT>, ergo: <TT>D:\\</TT>.\r\n\r\n<LI><TT>..\\BIN</TT>\r\n<BR>Because there is neither a drive nor a leading backslash, both the\r\ncurrently selected drive and the current directory of that drive\r\nis inserted before the given path, ergo: <TT>C:\\FREEDOS\\HELP\\..\\BIN</TT>.\r\n<BR>The embedded component <TT>..</TT> has the same meaning as when\r\nspecified alone: <EM>parent directory</EM>, though, here in the context\r\nof the directory <TT>C:\\FREEDOS\\HELP\\</TT>. That means that the\r\nfinal absolute path is: <TT>C:\\FREEDOS\\BIN</TT>.\r\n\r\n</OL>\r\n\r\n<P>Path specifications that do not conform to above mentioned\r\nformat lead to various different behaviour of the various programs,\r\nbecause there is no standard to scan, parse and interprete such\r\npatterns.\r\nProblems include:\r\n<UL>\r\n<LI>multiple backslashes,\r\n<LI>multiple dots,\r\n<LI>multiple colons, or a colon at a position unequal to two,\r\n<LI>The current directory <TT>.</TT> or parent directory <TT>..</TT>\r\nspecial directories in the context of a root directory, such as\r\n<TT>C:\\.</TT>, <TT>C:\\..</TT>, or <TT>C:\\TEMP\\..\\..</TT>.\r\n</UL>\r\n\r\n<P>Note: The special directories <TT>.</TT> and <TT>..</TT> are no\r\nphantom directories or virtual entries, but standard entries of\r\nevery directory except the root directories. These entries help\r\ncrash recovery tools, such as <TT>CHKDSK</TT> or <TT>SCANDISK</TT>,\r\nto find errors within the directory structure and restore it to\r\na valid file tree. Therefore a common assumption that a tripple dot\r\n<TT>...</TT> directory means <EM>parent-of-parent</EM> is incorrect,\r\nthough, might be supported by certain programs.\r\n\r\n<H3><A NAME=\"_appendix_options\">Standard Rules for Options</A></H3>\r\n\r\nOptions are prefixed by one forward slash \"<TT>/</TT>\",\r\nthe following character identifies the option and is called\r\noption character, for instance: <TT><B>/A</B></TT>\r\n\r\n<P>Some commands do accept long option names, where a complete word\r\nidentifies the option rather than a single character, e.g. <TT><B>/MSG</B></TT>.\r\n\r\n<P>Some option may be used in conjunction with an argument. The argument\r\nis appended to the option with one colon \"<TT>:</TT>\" or\r\none equal sign \"<TT>=</TT>\", for instance: <TT><B>/A:hr</B></TT>\r\nor <TT><B>/P=fdexec.bat</B></TT>.\r\n\r\n<P>Multiple options <EM>without</EM> argument maybe merged together\r\nas a single option with or without embedded slashes, e.g. <TT><B>/WS</B></TT>\r\nor <TT><B>/W/S</B></TT>, instead of <TT><B>/W /S</B></TT>.\r\n<BR>However, because some commands do accept long option names, the\r\nway with embedded slashes is more secure and is recommended therefore.\r\n<BR>An option with argument may be the last one of such merged options.\r\n\r\n<P>Options without arguments enable or disable certain features. Therefore,\r\nthose options are sometimes called <EM>boolean</EM> options or flags.\r\n<BR>Boolean options may be optionally prefixed by a plus \"<TT>+</TT>\"\r\nor minus \"<TT>-</TT>\" sign. So, the boolean option <TT><B>O</B></TT>\r\ncan be written in three ways:\r\n<OL>\r\n<LI><TT><B>/+O</B></TT>: The option is enabled.\r\n<LI><TT><B>/-O</B></TT>: The option is disabled.\r\n<LI><TT><B>/O</B></TT>: (<FONT SIZE=-1>neither plus nor minus sign</FONT>)\r\nThe option is toggled or flipped; this means if the option is\r\nenabled currently, it is disabled; but if it is disabled currently,\r\nit is enabled.\r\n</OL>\r\n<BR>Without user invention a boolean option is disabled by default, so\r\nboth <TT><B>/+O</B></TT> and <TT><B>/O</B></TT> behave the same most\r\nof the time. However, some commands allow the user to change the default\r\nsettings of certain options, e.g. <TT><A HREF=\"#copy\">COPY</A></TT> and\r\n<TT><A HREF=\"#dir\">DIR</A></TT>.\r\n\r\n<H3><A NAME=\"_appendix_redirection\">I/O Redirection</A></H3>\r\n\r\nIn DOS the standard input and output can be redirected to a file or\r\nanother device; however, although it is common to use these I/O streams\r\ntoday, some programmers cowardly ignore them for reasons of speed or\r\nprogram size.\r\n\r\n<P>If the <STRONG>input</STRONG> stream is redirected to a file or\r\ndevice, instead of polling the keyboard and request the user to\r\ninteractively enter characters via the keyboard, those characters\r\nare read from the file or device. Usually these programs terminate\r\nwhen the file has been read wholely.\r\n\r\n<P>If the <STRONG>output</STRONG> stream is redirected to a file\r\nor device, instead of issuing the information onto screen,\r\nit is dumped into the file or device. Per convention each program\r\nhas two output streams: one (called standard output)\r\nto issue normal information and one (called standard error output) for\r\nerror messages the user should not miss.\r\n\r\n<P>Redirections are specified on command line and effect exactly that\r\ncommand invoked herein, regardless if the command is an external or\r\ninternal one, an alias or batch script. The utter exception is the <TT><A HREF=\"#for\">FOR</A></TT>\r\ncommand, which requires that the redirection is to apply to the command\r\nspecified behind the DO keyword rather than <TT><A HREF=\"#for\">FOR</A></TT> itself.\r\n<BR>If more than one redirection is specified on the command line and\r\nthey effect the same stream (input, output, or error), the rightmost one\r\nsuperceed any previous one.\r\n\r\n<P>Redirections are syntactically specified like this:\r\n<BR>\r\n <I>operator</I> <I>target</I><BR>\r\n\r\n <I>operator</I> <B>::=</B> <TT>'&lt;'</TT> | <TT>'&gt;'</TT> <B>[</B> <TT>'&gt;'</TT> <B>]</B> <B>[</B> <TT>'&amp;'</TT> <B>[</B> <TT>'&gt;'</TT> <B>]</B> <B>]</B><BR>\r\n\r\n <I>target</I> <B>::=</B> <I>file</I> | <I>device</I><BR>\r\n\r\n\r\n<BR>Although it is not relevant where the redirections are placed on the\r\ncommand line, it is common praxis to place them at the end of it.\r\n<P>The <TT><I>operators</I></TT> have the following meaning:\r\n<TABLE BORDER=1>\r\n<TR>\t<TH>Operator</TH>\r\n\t\t<TH>Redirection</TH>\r\n</TR>\r\n<TR>\t<TD><TT>&lt;</TT></TD>\r\n\t\t<TD>Input stream</TD>\r\n</TR>\r\n<TR>\t<TD><TT>&gt;</TT></TD>\r\n\t\t<TD>Output stream; target file is overwritten</TD>\r\n</TR>\r\n<TR>\t<TD><TT>&gt;&gt;</TT></TD>\r\n\t\t<TD>Output stream; output is appended to target, if it already exists</TD>\r\n</TR>\r\n<TR>\t<TD><TT>&gt;&amp;</TT></TD>\r\n\t\t<TD>Output and error stream; target file is overwritten</TD>\r\n</TR>\r\n<TR>\t<TD><TT>&gt;&gt;&amp;</TT></TD>\r\n\t\t<TD>Output and error stream; output is appended to target, if it already exists</TD>\r\n</TR>\r\n<TR>\t<TD><TT>&gt;&amp;&gt;</TT></TD>\r\n\t\t<TD>Error stream; target file is overwritten</TD>\r\n</TR>\r\n<TR>\t<TD><TT>&gt;&gt;&amp;&gt;</TT></TD>\r\n\t\t<TD>Error stream; output is appended to target, if it already exists</TD>\r\n</TR>\r\n</TABLE>\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> cmd &lt;in1 &lt;in2</TT><BR>\r\n<BR>Input stream is redirected to file <TT>IN2</TT>, because it is the rightmost\r\none.\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\n<TT> cmd &lt;in &gt;&amp;out</TT><BR>\r\n<BR>Input stream is redirected to file <TT>IN</TT>, output and error streams are\r\njoined together and redireced into file <TT>OUT</TT>.\r\nIf the file <TT>OUT</TT> already exists, the old contents is discarded and\r\nreplaced by the new one; otherwise, the <TT>OUT</TT> is created anew.\r\n\r\n\r\n<H4>Example: 3</H4>\r\n\r\n\r\n<TT> cmd &lt;in &gt;&gt;&amp;out</TT><BR>\r\n<BR>As example 2, but instead of replacing the contents of <TT>OUT</TT>, if the\r\nfile already exists, the new information is appended to the end of the file.\r\n\r\n\r\n<H4>Example: 4</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#for\">FOR</A></TT> %a IN (*.*) DO <TT><A HREF=\"#echo\">ECHO</A></TT> %a &gt;out</TT><BR>\r\n<BR>As mentioned earlier, <TT><A HREF=\"#for\">FOR</A></TT> is an exception and passes forth the redirections\r\nto each invocation of the command specified right of the DO keyword. So this\r\nexamples overwrites the output file each time the <TT><A HREF=\"#echo\">ECHO</A></TT> command is performed,\r\nthus, instead of creating a file list, only the last found file is recorded into\r\n<TT>OUT</TT>.\r\n\r\n\r\n<H4>Example: 5</H4>\r\n\r\n\r\n<TT> <TT><A HREF=\"#if\">IF</A></TT> EXIST out <TT><A HREF=\"#del\">DEL</A></TT> out</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#for\">FOR</A></TT> %a IN (*.*) DO <TT><A HREF=\"#echo\">ECHO</A></TT> %a &gt;&gt;out</TT><BR>\r\n<BR>This sequence eliminate the problem, the <TT><A HREF=\"#if\">IF</A></TT> command is required to\r\nactually replace the file rather than appending the file list to the\r\nprobably existent file.\r\n\r\n<H4>Pipes</H4>\r\n\r\n<P>Another form of redirection is <STRONG>piping</STRONG>. Hereby, the output stream\r\nof one command is connected to the input stream of another command. Pipes can combine\r\nany number of commands this way. Because DOS is no multitasking system, pipes are\r\nsimulated by spawning the first command with an output redirection capturing the\r\nissued information into a temporary file and then the second command with an input\r\nredirection from that very same temporary file, on completation of the second\r\ncommand the temporary file is deleted.\r\n\r\n\r\n<H3>Examples</H3>\r\n\r\n\r\n<H4>Example: 1</H4>\r\n\r\n\r\n<TT> cmd1 | cmd2 | cmd3</TT><BR>\r\n\r\n<BR>Which is similiar to this sequence:\r\n<BR>\r\n\r\n<TT> cmd1 &gt;%TEMP%\\t1</TT><BR>\r\n\r\n<TT> cmd2 &lt;%TEMP%\\t1 &gt;%TEMP%\\t2</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#del\">DEL</A></TT> %TEMP%\\t1</TT><BR>\r\n\r\n<TT> cmd3 &lt;%TEMP%\\t2</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#del\">DEL</A></TT> %TEMP%\\t2</TT><BR>\r\n\r\n\r\n<H4>Example: 2</H4>\r\n\r\n\r\nThe first and last command can have an input or output redirection\r\nrespectively, like so:\r\n\r\n<BR>\r\n\r\n<TT> cmd1 | cmd2 | cmd3 &lt;in &gt;out</TT><BR>\r\n\r\n\r\n<BR>Which is similiar to this sequence:\r\n<BR>\r\n\r\n<TT> cmd1 &gt;%TEMP%\\t1 &lt;in</TT><BR>\r\n\r\n<TT> cmd2 &lt;%TEMP%\\t1 &gt;%TEMP%\\t2</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#del\">DEL</A></TT> %TEMP%\\t1</TT><BR>\r\n\r\n<TT> cmd3 &lt;%TEMP%\\t2 &gt;out</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#del\">DEL</A></TT> %TEMP%\\t2</TT><BR>\r\n\r\n\r\n<H4>Example: 3</H4>\r\n\r\n\r\nThe error stream can be piped as well:\r\n\r\n<BR>\r\n\r\n<TT> cmd1 |&amp; cmd2 | cmd3</TT><BR>\r\n\r\n<BR>Which is similiar to this sequence:\r\n<BR>\r\n\r\n<TT> cmd1 &gt;&amp;%TEMP%\\t1</TT><BR>\r\n\r\n<TT> cmd2 &lt;%TEMP%\\t1 &gt;%TEMP%\\t2</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#del\">DEL</A></TT> %TEMP%\\t1</TT><BR>\r\n\r\n<TT> cmd3 &lt;%TEMP%\\t2</TT><BR>\r\n\r\n<TT> <TT><A HREF=\"#del\">DEL</A></TT> %TEMP%\\t2</TT><BR>\r\n\r\n<BR>Here only the error messages of <TT>cmd1</TT> are passed\r\ninto <TT>cmd2</TT>; the error messages of both <TT>cmd2</TT>\r\nand <TT>cmd3</TT> are issued to the screen.\r\n\r\n<H4>Nested redirections</H4>\r\n\r\nBatch scripts or when external programs invoke other programs or another shell,\r\nredirections may be nested, e.g.:\r\n\r\n<P>Consider the batch file <TT>BATCH.BAT</TT>:\r\n<PRE>\r\n@<TT><A HREF=\"#echo\">ECHO</A></TT> OFF\r\n<TT><A HREF=\"#echo\">ECHO</A></TT> 1\r\n<TT><A HREF=\"#echo\">ECHO</A></TT> 2 &gt;out_2\r\n<TT><A HREF=\"#echo\">ECHO</A></TT> 3\r\n</PRE>\r\nwhich is invoked via:\r\n<BR>\r\n\r\n<TT> BATCH &gt;out_1</TT><BR>\r\n\r\n<BR>When the script <TT>BATCH</TT> gets executed, the actual output stream\r\nis redirected to the file <TT>OUT_1</TT>. Therefore the output of the first\r\n<TT><A HREF=\"#echo\">ECHO</A></TT> command is redirected into this file.\r\n<BR>Because the second <TT><A HREF=\"#echo\">ECHO</A></TT> command has its own output redirection, its\r\noutput is redirected into the file <TT>OUT_2</TT>. On completion of <TT><A HREF=\"#echo\">ECHO</A></TT>\r\nthe redirection is closed and the former one is restored.\r\n<BR>What causes that the output of the third <TT><A HREF=\"#echo\">ECHO</A></TT> command is redirected\r\ninto <TT>OUT_1</TT> again.\r\n\r\n\r\n<H3><A NAME=\"_appendix_hicmd\">Hidden Internal Commands</A></H3>\r\n\r\nThere are some special internal commands, that are not directly visible\r\nnor accessable. They are hidden because of two main purposes:\r\n<OL>\r\n<LI>Many of them are of internal nature and should not used by the user.\r\n<LI>They are extensions to the normal batch language and may, therefore,\r\nclash with a particular installation. To prevent this clash those\r\ncommands are hidden by default and can be made directly accessable\r\nvia the ICMD command.\r\n</OL>\r\n\r\n<P>Hidden internal commands can be access by prefixing the command\r\nwith <TT>::=</TT>. This token usually specifies a label within the\r\nbatch language, given the nature of the labels, they may be comments\r\nas well. Due to the latter variant, most non-FreeCOM shells won't see\r\nthe <TT>::=</TT>, hence, ignore those commands.\r\n\r\n<P>For example:\r\n\r\n<TT> C&gt; ::=<TT><A HREF=\"#cancel\">CANCEL</A></TT> 30</TT><BR>\r\n<BR>cancels (terminates) all currently active batch files and assigns\r\n<TT><I>30</I></TT> to the current errorlevel.\r\n</BODY>\r\n"
  },
  {
    "path": "docs/html/commands/db2html",
    "content": "#!perl\r\n\r\n## Formats the command DB files into HTML.\r\n## See INFO\r\n\r\n## if the TOC exists, it is inserted right at the start of the\r\n## HTML file\r\n\r\n#na)me: of object described herein; should match the filename\r\n#de)scription: one line description\r\n#eq)ual to: name of object 100% equal to this one, no further entries\r\n#\tallowed\r\n#se)e also: references\r\n#re)quirements: which other objects this object depends on\r\n#op)tional: optional requirements for certain features\r\n#co)nflicts: which other objects this object conflicts with\r\n\r\nrequire 'parse.pl';\r\n\r\n$ref = {\r\n\t'appendix' => sub { '<A HREF=\"appendix.html#' . lc($_[0]) . \"\\\">\"; }\r\n\t, 'cmd' => sub { '<A HREF=\"#' . lc($_[0].$_[1]) . '\">'; }\r\n\t, 'main' => sub { my $n = shift;\r\n\t\t$n =~ s/^[_-]+//g;\r\n\t\treturn '<A HREF=\"FreeCOM.html##-' . lc($n) . \"\\\">\"; }\r\n\t, 'section' => sub { \"\\n<H3>\" . ucfirst(lc($_[0])) . \"</H3>\\n\"; }\r\n\t, 'subsection' => sub { \"\\n<H4>\" . $_[0] . \"</H4>\\n\"; }\r\n};\r\n\r\n$file_toc = \"TOC\";\r\n$file_html = \"../cmd.html\";\r\n## $file_cmd = \"CMDLIST\";\t# List of commands to be automatically linked\r\n\r\n%headers = (\r\n\t'na', 'name',\r\n\t'de', 'description',\r\n\t'eq', 'equal to',\r\n\t'se', 'see also',\r\n\t're', 'requirements',\r\n\t'op', 'optional requirements',\r\n\t'co', 'conflicts with'\r\n);\r\nmy($na, $de, $eq, $se, $re, $op, $co);\r\nmy(               @se, @re, @op, @co);\r\n\r\n%toc = ();\r\n\r\n\r\n$htmlHowToFormatOptions = '\r\nUnless stated otherwise all options of this command do follow the\r\n<A HREF=\"!:options\">standard rules for options</A>.\r\n';\r\n\r\n&openCmdList;\r\n\r\n&htmlOpenHtml;\r\n&htmlOpenTOC;\r\n\r\n@ARGV = glob(\"*.db\") unless $#ARGV >= 0;\r\n\r\nfor (@ARGV) {\r\n\t&handle($_);\r\n}\r\n\r\n# &dumpAppendix;\r\n&htmlCloseTOC;\r\n&htmlCloseHtml;\r\n\r\n&closeCmdList;\r\n\r\nexit 0;\r\n\r\nsub handle {\r\n\tmy($file) = @_;\r\n\r\n\t## Read header of file\r\n\tif(!open(IN, $file)) {\r\n\t\t&log(\"Cannot open file \\\"$file\\\": $!\");\r\n\t} else {\r\n\t\t($na, $de, $eq, $se, $re, $op, $co) = ();\r\n\r\n\t\twhile(<IN>) {\r\n\t\t\tchomp;\r\n\t\t\tlast if /^\\s*$/;\r\n\t\t\tif(/^(.+?):\\s*/) {\r\n\t\t\t\tmy($key) = $1;\r\n\t\t\t\tmy($value) = $';\r\n\t\t\t\tnext unless $value;\r\n\r\n\t\t\t\t$key =~ tr/A-Z/a-z/;\r\n\t\t\t\t$key =~ s/\\s+/ /g;\r\n\t\t\t\tif(length($key) < 2) {\r\n\t\t\t\t\t&log(\"Invalid header key '$key' in $file\\n\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmy($keyname) = substr($key, 0, 2);\r\n\t\t\t\t\tif(substr($headers{$keyname}, 0, length($key)) eq $key) {\r\n\t\t\t\t\t \teval \"\\$$keyname = \\$value\";\r\n\t\t\t\t\t } else {\r\n\t\t\t\t\t \t&log(\"Unknown header key '$key' in $file\");\r\n\t\t\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t&log(\"Syntax error in header section of $file\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($na && $de) {\r\n\t\t\t$na = &mangleName($na);\r\n\t\t\t&dumpHeader($na, $de);\r\n\t\t\tif($eq) {\r\n\t\t\t\t&dumpEqual($eq);\r\n\t\t\t} else {\r\n\t\t\t\t@se = sort map { &mangleName($_) }  split(/[,\\s;]+/, $se);\r\n\t\t\t\t@re = sort map { &mangleName($_) }  split(/[,\\s;]+/, $re);\r\n\t\t\t\t@op = sort map { &mangleName($_) }  split(/[,\\s;]+/, $op);\r\n\t\t\t\t@co = sort map { &mangleName($_) }  split(/[,\\s;]+/, $co);\r\n\t\t\t\t&dumpHeaderEntry;\r\n\t\t\t\t&dumpBodyEntry;\r\n\t\t\t}\r\n\t\t\t&dumpFooter;\r\n\t\t} else {\r\n\t\t\t&log(\"Missing header keys 'name' or 'description' in $file\");\r\n\t\t}\r\n\r\n\t\tclose IN;\r\n\t}\r\n}\r\n\r\n## Dump \"equal-to\" command in HTML\r\nsub dumpEqual {\r\n\tmy($eq) = &mangleName(@_);\r\n\r\n\tprint HTML \"This command is 100% compatible to \",\r\n\t htmlCommandRef($ref, $eq), \", please see there\\n\";\r\n}\r\n\r\n## Dump new command header\r\nsub dumpHeader {\r\n\tmy($na, $de) = @_;\r\n\r\n\t&dumpTOC($na, $de);\r\n\tprint HTML '<H2><A NAME=\"', lc($na), \"\\\">$na - $de</A></H2>\\n\";\r\n\t&writeCmdList(uc($na));\r\n}\r\nsub dumpAppendix {\r\n\tprint HTML '<H2><A NAME=\"_appendix\">Appendix</A></H2>',\"\\n\";\r\n\topen(IN, \"stuff\")\r\n\t\tor die \"Cannot open Appendix: $!\\n\";\r\n\t$na = \"_Appendix\";\r\n\t&dumpBodyEntry;\r\n\tclose IN;\r\n}\r\n\r\n## Dump Headers for normal entry\r\nsub dumpHeaderEntry {\r\n\tif($#se >= 0) {\r\n\t\tprint HTML \"See also: \"\r\n\t\t , join(', ', (map { &htmlRefWord($_) } @se))\r\n\t\t , \"<BR>\\n\";\r\n\t}\r\n\tif($#re >= 0) {\r\n\t\tprint HTML \"Requirements: \"\r\n\t\t , join(', ', (map { &htmlRefWord($_) } @re))\r\n\t\t , \"<BR>\\n\";\r\n\t}\r\n\tif($#op >= 0) {\r\n\t\tprint HTML \"Optional requirements: \"\r\n\t\t , join(', ', (map { &htmlRefWord($_) } @op))\r\n\t\t , \"<BR>\\n\";\r\n\t}\r\n\tif($#co >= 0) {\r\n\t\tprint HTML \"Conflicts with: \"\r\n\t\t , join(', ', (map { &htmlRefWord($_) } @co))\r\n\t\t , \"<BR>\\n\";\r\n\t}\r\n}\r\nsub dumpBodyEntry {\r\n\t&parseEBNF($ref, lc($na));\r\n}\r\n\r\nsub dumpFooter {\r\n\t&htmlFooter;\r\n}\r\n\r\n\r\nsub htmlRefWord {\r\n\tmy($cmd) = @_;\r\n\r\n\treturn $cmd unless defined($cmdlist{uc($cmd)});\r\n\treturn htmlCommandRef($ref, $cmd);\r\n}\r\n\r\n## Dump the command footer\r\nsub htmlFooter {\r\n\tprint HTML \"<P><HR>\\n\";\r\n}\r\n\r\n# command name\r\nsub mangleName {\r\n\treturn uc($_[0]);\r\n}\r\n\r\nsub dumpTOC {\r\n\tmy($na, $de) = @_;\r\n\r\n\t$toc{$na} = $de;\r\n}\r\n\r\n#############################3\r\nsub htmlOpenTOC {\r\n\topen(TOC, \">$file_toc\")\r\n\t\tor die \"Cannot create TOC: $file_toc: $!\\n\";\r\n}\r\nsub htmlCloseTOC {\r\n\tmy($na, $de);\r\n\r\n\tforeach $na (sort keys %toc) {\r\n\t\tprint TOC '<LI><A HREF=\"#', lc($na), \"\\\">$na - $toc{$na}</A>\\n\";\r\n\t}\r\n\tclose TOC;\r\n}\r\nsub htmlOpenHtml {\r\n\topen(HTML, \">$file_html\")\r\n\t\tor die \"Cannot create HTML: $file_html: $!\\n\";\r\nprint HTML '<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\r\n<HTML>\r\n<HEAD>\r\n<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\r\n<META HTTP-EQUIV=\"Content-Language\" CONTENT=\"en\">\r\n<META NAME=\"GENERATOR\" CONTENT=\"VI\">\r\n<META NAME=\"DESCRIPTION\" CONTENT=\"Description of features and implementation status of FreeCOM, the COMMAND.COM replacement\">\r\n<META NAME=\"AUTHOR\" CONTENT=\"Steffen Kaiser\">\r\n<META NAME=\"KEYWORDS\" CONTENT=\"DOS, FreeDOS, FreeCOM, COMMAND.COM, CLI\">\r\n<META NAME=\"DATE\" CONTENT=\"2001-02-06\">\r\n<TITLE>Internal Commands of FreeCOM</TITLE>\r\n</HEAD>\r\n\r\n<BODY>\r\nList of commands and features of FreeCOM:\r\n<UL>\r\n';\r\n\tif(open(TOC, $file_toc)) {\t\t# Import the previously created TOC\r\n\t\tprint HTML <TOC>;\r\n\t\tclose TOC;\r\n\t}\r\n\tprint HTML \"</UL>\\n<BR><BR><HR><BR>\\n\";\r\n}\r\nsub htmlCloseHtml {\r\n\tprint HTML \"</BODY>\\n\";\r\n\tclose HTML;\r\n}\r\n\r\n##################3\r\nsub openCmdList {\r\n\t&readCmdList($ref);\r\n\topen(CMDLIST, \">$file_cmd\")\r\n\t\tor die \"Cannot create command list file: $!\\n\";\r\n}\r\nsub closeCmdList {\r\n\tclose CMDLIST;\r\n}\r\nsub writeCmdList {\r\n\tprint CMDLIST $_[0] . \"\\n\";\r\n}\r\n\r\n\r\n## Log an error to the console and the logfile\r\nsub log {\r\n\tlocal($logging) = 0;\r\n\r\n\tif(!$logging) {\r\n\t\tmy($file) = \"$0.LOG\";\r\n\t\tdie \"Cannot create logfile: $!\\n\" unless open(LOG, \">$file\");\r\n\t\t$logging = 1;\r\n\t}\r\n\r\n\tprint LOG join(\"\\n\", @_) . \"\\n\";\r\n\tprint STDERR join(\"\\n\", @_) . \"\\n\";\r\n}\r\n\r\n"
  },
  {
    "path": "docs/html/commands/info",
    "content": "File format of .DB files:\r\n\r\nHeader:\r\nna)me: of object described herein; should match the filename\r\nde)scription: one line description\r\neq)ual to: name of object 100% equal to this one, no further entries\r\n\tallowed\r\nse)e also: references\r\nre)quirements: which other objects this object depends on\r\nop)tional: optional requirements for certain features\r\nco)nflicts: which other objects this object conflicts with\r\n\r\n<empty line>\t-- delimits header and body\r\n\r\nBody: The rest of the file is plain HTML text, except:\r\n\r\n+ <OPT>...</OPT> encloses names of options\r\n+ <ARG>...</ARG> encloses names of arguments\r\n+ <CMD>...</CMD> encloses a command line embedded into HTML text\r\n+ <HELL>...</HELL> encloses text to set \"bright\" (e.g. red colour)\r\n+ <DIMM>...</DIMM> encloses text to set \"dark\" (e.g. dark gray colour)\r\n+ CMD: prefixes a line that solemny consits of a command line\r\n\talso quotes all HTML characters\r\n+ EBNF: prefixes a line that solemny consists of a EBNF expression\r\n+ EBNF!: prefixes a line that solemny consists of a EBNF expression, which\r\nis part of the surrounding HTML text.\r\n+ Labels (aka: <A NAME=\"letters\">) are mangeled to automatically be unique\r\nthroughout the whole generated HTML files.\r\n+ References to labels must be written like this:\r\n<A HREF=\"object:label\"> where \"object\" is the name of the object the\r\nlabel is part of; an empty label references to the object itself, an\r\nempty object  references to the label within the same object.\r\nBoth 'object' and 'label' must consist of letters only.\r\n\r\nThe special object \"!\" refers to a central explanation location:\r\n\t!:wildcards\tExplains how wildcards are matched and their syntax\r\n\t!:options\tExplains how options are parsed standardly\r\n\t!:path\t\tExplains how path specification is formatted, abs/rel path\r\nThe special object \"!!\" refers to the FreeCOM.html primary source.\r\n\r\nHREF's with a leading \"ftp/http/about\" are considered \"absolute\"\r\nhyperlinks and are not mangled.\r\nHyperlinks local to a certain HTML file should beginn with a dash. And\r\ntheir HREF's should be complete (beginning with the hash mark '#').\r\n\r\n+ SYNOPSIS: is substituted by a \"Synopsis\" section header line.\r\n+ ARGUMENTS: is substituted by a \"Arguments\" section header line.\r\n+ OPTIONS: is substituted by a \"Options\" section header line.\r\n+ STD_OPTIONS: is substituted by a standard \"Options\" section header line\r\n\tincluding the reference to how to format options.\r\n+ EXAMPLES: is substituted by a \"Examples\" section header line.\r\n+ EXAMPLE: <<string>> is substituted by a \"Example <<string>>\"\r\n\tsubsection header line.\r\n\r\nEBNF (enhanced Backus-Naur-Format):\r\n+ Tokens must be surrounded by at least one whitespace.\r\n+ Tokens must not contain whitespaces.\r\n+ Variants of tokens:\r\n++ first character is a capitol letter:\r\n\tFixed part of a command, set in <CMD> tags.\r\n++ first character is a lower-case letter:\r\n\tVariable part of a command, a place holder; set in <I> tags.\r\n++ a sequence of characters enclosed in single quotes:\r\n\tCharacters to be written on command line; set in <CMD> tags\r\n\tquotes not stripped.\r\n++ else:\r\n\tMetacharacters for EBNF:\r\n+++ ( ) narrows other operators\r\n+++ | either left or right token list (*)\r\n+++ [ ] encloses optional tokens, which may appear exactly once or not at all.\r\n+++ { } encloses tokens, which must appear at least once.\r\n+++ { : } as { }, but the tokens placed right of the colon are to be inserted\r\n\tbetween two or more apearances of the tokens left of the colon (**)\r\n+++ ::= assignes a meaning to a placeholder.\r\n+++ << >> encloses an informal comment (expressed in natural language) (***)\r\n+++ No special metacharacter is required to form a sequence of tokens.\r\n+ Spaces, which must appear on the command line, are usually not explicitly\r\n\texpressed within EBNF neither does the existance of a space imply that\r\n\tsuch space must be entered on command line, see (***).\r\n\tIt is assumed that the reader knows the basic rules where to have to\r\n\tinsert spaces.\r\n\r\n\r\n(*) A sequence of |'s form an either-or-operator.\r\n(**) E.g.: COPY { srcfile : '+' } dstfile\r\n\tis a short-hand form of:\tCOPY srcfile [{ '+' srcfile }] dstfile\r\n(***) E.g.: SET varname '=' <<any string>>\r\n"
  },
  {
    "path": "docs/html/commands/parse.pl",
    "content": "#!perl\r\n\r\n# Parses <IN> as EBNF HTML into HTML\r\n\r\n$file_cmd = \"CMDLIST\";\t# List of commands to be automatically linked\r\n\r\nsub parseEBNF ($;$) {\r\n\tmy($ref, $ref_na) = @_;\t\t# reference makers & reference name of this object\r\n\r\n\twhile(<IN>) {\r\n\t\tchomp;\r\n\t\tmy($own_line) = 1;\r\n\r\n\t\tif(/^CMD:/) {\r\n\t\t\tmy $l = $';\r\n\t\t\t$_ = \"\\n<CMD>\" . &htmlXLat($l) . \"</CMD><BR>\";\r\n\t\t} elsif(/^(SYNOPSIS):/ || /^(OPTIONS):/ || /^(EXAMPLES):/\r\n\t\t || /^(ARGUMENTS):/) {\r\n\t\t\t$_ = $ref->{'section'}($1);\r\n\t\t} elsif(/^STD_OPTIONS:/) {\r\n\t\t\t$_ = $ref->{'section'}('Options') . $htmlHowToFormatOptions;\r\n\t\t} elsif(/^EXAMPLE:\\s*/) {\r\n\t\t\t$_ = $ref->{'subsection'}(\"Example: $'\");\r\n\t\t} elsif(/^DESCRIPTION:/) {\r\n\t\t\t$_ = \"<P>\\n\";\r\n\t\t} elsif(/^SKAUS_EVALUATE_PERL:/) {\r\n\t\t\teval $';\r\n\t\t}\r\n\r\n\t\t# Process the EBNF tag\r\n\t\tif(/^EBNF(\\!)?:/) {\r\n\t\t\tmy($line) = $';\r\n\t\t\t$own_line = !$1;\r\n\r\n\t\t\t$_ = '';\r\n\t\t\tmy $delim = '';\r\n\t\t\twhile($line =~ /^\\s*('.*?'|<<.*?>>)/\r\n\t\t\t || $line =~ /^\\s*(\\S+)/) {\r\n\t\t\t\tmy($token) = $1;\r\n\t\t\t\t$line = $delim . $';\r\n\t\t\t\t$delim = '';\r\n\t\t\t\tmy($tag) = '';\r\n\r\n\t\t\t\tif($token =~ /^[A-Z']/) {\t\t# terminal characters\r\n\t\t\t\t\t$tag = 'CMD';\r\n\t\t\t\t} elsif($token =~ /^[a-z]/) {\t# placeholder\r\n\t\t\t\t\t$tag = 'I';\r\n\t\t\t\t} elsif(index(',./[]{}():;', substr($token, 0, 1)) >= 0) {\r\n\t\t\t\t\t$tag = 'B';\r\n\t\t\t\t}\r\n\t\t\t\tif($token =~ /^<<(.*?)>>$/) {\r\n\t\t\t\t\t$token = '&laquo;' . &htmlXLat($1) . '&raquo;';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$token = &htmlXLat($token);\r\n\t\t\t\t}\r\n\t\t\t\tif($token) {\r\n\t\t\t\t\t$_ .= ' ';\r\n\t\t\t\t\t$_ .= \"<$tag>\" if $tag;\r\n\t\t\t\t\t$_ .= $token;\r\n\t\t\t\t\t$_ .= \"</$tag>\" if $tag;\r\n\t\t\t\t\t$delim = ' ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$_ .= \"<BR>\\n\" if $own_line;\r\n\t\t} else {\r\n\t\t\teval $cmdExpr;\t# perform the linkaging of the commands\r\n\t\t}\r\n\r\n\t\t# Basic special tags\r\n\t\ts:<OPT>:<TT><B>:ig;\r\n\t\ts:</OPT>:</B></TT>:ig;\r\n\t\ts:<ARG>:<TT><I>:ig;\r\n\t\ts:</ARG>:</I></TT>:ig;\r\n\t\ts:<CMD>:<TT>:ig;\r\n\t\ts:</CMD>:</TT>:ig;\r\n\t\ts:<HELL>:<FONT COLOR=\"#CC0000\">:ig;\r\n\t\ts:</HELL>:</FONT>:ig;\r\n\t\ts:<DIMM>:<FONT COLOR=\"#999999\">:ig;\r\n\t\ts:</DIMM>:</FONT>:ig;\r\n\t\ts:\\&quot\\;:\\\":g;\r\n\r\n\t\t# Modify references\r\n\t\ts:<A\\s+NAME=\"([a-zA-Z].+?)\"\\s*>:<A NAME=\"${ref_na}_\\1\">:ig;\r\n\t\tmy $line = '';\r\n\t\twhile(m!<A\\s+HREF=\\\"([^:\\\"]*?):([^\\\"]*?)\\\"\\s*>!i) {\r\n\t\t\t$line .= $`;\r\n\t\t\tmy $post = $';\r\n\t\t\tmy $all = $&;\r\n\t\t\tmy $obj = lc($1);\r\n\t\t\tmy $label = lc($2);\r\n\t\t\tif($obj =~ /^ftp|http|about$/) {\r\n\t\t\t\t# This is an absolute URL\r\n\t\t\t\t$line .= $all;\r\n\t\t\t} else {\r\n\t\t\t\t$label = \"_\" . $label if $label;\r\n\t\t\t\t$obj = $ref_na unless $obj;\r\n\t\t\t\tif($obj eq '!') {\t## command appendix\t\r\n\t\t\t\t\t$line .= $ref->{'appendix'}($label);\r\n\t\t\t\t} elsif($obj eq '!!') {\t## FreeCOM\r\n\t\t\t\t\t$line .= $ref->{'main'}($label);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$line .= $ref->{'cmd'}($obj, $label);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$_ = $post;\r\n\t\t}\r\n\t\t$line .= $_;\r\n\r\n\r\n\t\tprint HTML $line;\r\n\t\tprint HTML \"\\n\" if $own_line;\r\n\t}\r\n}\r\n\r\n2;\r\n\r\nsub htmlXLat {\r\n\tmy($line) = @_;\r\n\r\n\t$line =~ s/\\&/\\&amp;/g;\r\n\t$line =~ s/\\</\\&lt;/g;\r\n\t$line =~ s/\\>/\\&gt;/g;\r\n\r\n\treturn $line;\r\n}\r\n\r\nsub htmlCommandRef ($$;$) {\r\n\tmy($ref, $cmd, $label) = @_;\r\n\r\n\tmy $s = '';\r\n\t$s = \" - $label\" if $label;\r\n\r\n\treturn $ref->{'cmd'}($cmd,$label) . \"$cmd$s</A>\";\r\n}\r\nsub readCmdList ($) {\r\n\tmy $ref = shift;\r\n\r\n\tif(open(CMDLIST, $file_cmd)) {\r\n\t\t# Read them\r\n\t\t$cmdExpr = '';\r\n\t\t%cmdlist = ();\r\n\t\twhile(<CMDLIST>) {\r\n\t\t\tchomp;\r\n\t\t\t$cmdlist{$_} = 1;\r\n\t\t\t$cmdExpr .=  \", s/\\\\b$_\\\\b/\"\r\n\t\t\t . quotemeta(\"<CMD>\" . htmlCommandRef($ref, $_) . \"</CMD>\")\r\n\t\t\t . \"/g\";\r\n\t\t}\r\n\t\tclose CMDLIST;\r\n\t\t$cmdExpr = substr($cmdExpr, 2);\t\t# Kill the leading \", \"\r\n\t}\r\n}\r\n"
  },
  {
    "path": "docs/html/commands/parseHTML",
    "content": "#!perl\r\n\r\n# Parse additional *.html files useing parse.pl\r\n\r\nrequire 'parse.pl';\r\n\r\ndie \"Cannot open TOC: $!\\n\"\r\n\tunless open(TOC, \"TOC\");\r\nwhile(<TOC>) {\r\n\tif(/FEATURE_/) {\r\n#\t\ts/#feature/cmd.html$1/;\r\n#\tDecorate string as it gets HTML'ed when included later\r\n\t\ts:<.*?>::g;\r\n\t\t$features .= '<LI>' . $_;\r\n\t}\r\n}\r\nclose TOC;\r\n\r\n$ref = {\r\n\t'appendix' => sub { '<A HREF=\"appendix.html#' . lc($_[0]) . \"\\\">\"; }\r\n\t, 'cmd' => sub { '<A HREF=\"cmd.html#' . lc($_[0].$_[1]) . '\">'; }\r\n\t, 'main' => sub { my $n = shift;\r\n\t\t$n =~ s/^[_-]+//g;\r\n\t\treturn '<A HREF=\"#-' . lc($n) . \"\\\">\"; }\r\n\t, 'section' => sub { \"\\n<H3>\" . ucfirst(lc($_[0])) . \"</H3>\\n\"; }\r\n\t, 'subsection' => sub { \"\\n<H4>\" . $_[0] . \"</H4>\\n\"; }\r\n};\r\nreadCmdList($ref);\r\n\r\nforeach $file ('FreeCOM.html') {\r\n\tdie \"Cannot open '$file': $!\\n\"\r\n\t\tunless open(IN, $file);\r\n\tdie \"Cannot create '../$file': $!\\n\"\r\n\t\tunless open(HTML, \">../$file\");\r\n\t&parseEBNF($ref);\r\n\tclose HTML;\r\n\tclose IN;\r\n}\r\n\r\n$ref = {\r\n\t'appendix' => sub { '<A HREF=\"#' . lc($_[0]) . \"\\\">\"; }\r\n\t, 'cmd' => sub { '<A HREF=\"cmd.html#' . lc($_[0].$_[1]) . '\">'; }\r\n\t, 'main' => sub { my $n = shift;\r\n\t\t$n =~ s/^[_-]+//g;\r\n\t\treturn '<A HREF=\"FreeCOM.html#-' . lc($n) . \"\\\">\"; }\r\n\t, 'section' => sub { \"\\n<H3>\" . ucfirst(lc($_[0])) . \"</H3>\\n\"; }\r\n\t, 'subsection' => sub { \"\\n<H4>\" . $_[0] . \"</H4>\\n\"; }\r\n};\r\nreadCmdList($ref);\r\n\r\nforeach $file ('appendix.html') {\r\n\tdie \"Cannot open '$file': $!\\n\"\r\n\t\tunless open(IN, $file);\r\n\tdie \"Cannot create '../$file': $!\\n\"\r\n\t\tunless open(HTML, \">../$file\");\r\n\t&parseEBNF($ref);\r\n\tclose HTML;\r\n\tclose IN;\r\n}\r\n\r\n"
  },
  {
    "path": "docs/index.md",
    "content": "FreeCOM - FreeDOS Command Interpreter - COMMAND.COM\r\n"
  },
  {
    "path": "docs/k-swap.txt",
    "content": "Description of kernel-supoorted swapping of FreeCOM\r\n\t-- 2001/01/21 ska\r\n\r\n===> Please also read VSPAWN.TXT.\r\n\r\nThis sort of swap is incompatible with XMS-Only swap!\r\n\r\n=== Preface\r\n\r\nThis technique is an experimental implementation of a general purpose\r\nswap technique applyable to FreeCOM that does not require any special\r\nsupport of the kernel.\r\n\r\nIt will therefore not support swapping in any circumstances and is intended\r\nto work as a \"boot-through\" shell for memory hungry programs, which\r\nnormally don't require no function of a resident shell.\r\n\r\n=== Supported Swappings\r\n\r\nThe swapping is activated via the CALL command in this way:\r\n\r\nC> CALL /S prg [{ args }]\r\n\r\nThe /S switch forces the swapping mechanism to be activated on executation\r\nof the next command.\r\n\r\nSwapping is NOT supported in:\r\n- secondary shells or other programs,\r\n- pipes, e.g. CALL /S prg1 | prg2, nor prg1 | CALL /s prg2 ,\r\n- conjunction with redirections, e.g. CALL /s prg <input\r\n- batch files,\r\n- called batch files accessing any shell functions or patch the master\r\n\tenvironment.\r\n\r\nSwapping does not preserve the history.\r\n\r\n=== How to use KSSF?\r\n\r\nIn CONFIG.SYS:\r\nSHELL=C:\\KSSF.COM C:\\COMMAND.COM /E:2048 /P\r\n\r\nFrom command line:\r\nCALL /S KSSF.COM c:\\command.com /e:2048\r\n\r\n[[The CALL /S will force the previously loaded FreeCOM to swap;\r\n  don't use it if you doesn't use FreeCOM.]]\r\n\r\nYou can even nest KSSFs.\r\nDoing so KSSF and FreeCOM associate together very tidly, you will need\r\nto spawn FreeCOM via KSSF whenever you want to use the Swapping Support\r\nfrom within the spawned shell.\r\n\r\nAlways use the absolute path to the shell.\r\nYou cannot change the path to the shell once KSSF has been loded.\r\n\r\n=== Implementation\r\n\r\nThe code of the kernel spawning process 0 (the primary shell) has been\r\nextended as loop. When process 0 finishes, the kernel checks a special\r\ninternal variable, if this one points to a valid argument structure,\r\nthe program mentioned herein is executed as process 0 and, then, FreeCOM\r\nis re-invoked. The only information passed from FreeCOM to the new process\r\nare the command line and the environment, no file descriptors are preserved!\r\nSee below about Critical Error handler and ^Break handler.\r\n\r\nThe argument structure contains the following information:\r\n#pragma -a-\t\t\t/* byte aligned members of structure */\r\ntypedef struct {\r\n\tuint16\tenvSegm;\t/* segment to be passed forth as environment */\r\n\tchar far *prg;\t\t/* program to be executed */\r\n\tchar far *cmdline;\t/* command line arguments of program */\r\n\tchar far *shell;\t/* absolute path to shell to be executed */\r\n\t/* ... internal information for FreeCOM */\r\n}\r\n\r\nenvSegm is to be passed as environment segment to both the program and the\r\nre-invoked shell.\r\n\r\nThe code to spawn process 0 passes NULL for both fcb1 and fcb2 pointers,\r\nneither is any support for both programs.\r\n\r\nThe command line is empty for the re-invoked shell.\r\n\r\nIf prg is equal to NULL, no external program is to be invoked.\r\nIf shell is equal to NULL, the shell is not to be invoked --> shut down\r\ncomputer.\r\n\r\nThe argument structure is made known to the system via an interrupt call,\r\nhere are the specs:\r\n\r\nDOS-4B-FD:\t\t\tSet Segment of Argument Structure\r\n\tAH = 0x4B\r\n\tAL = 0xFD\t\t\r\n\tBX = segment\r\n\tDX = 0x4446 == 'FD'\t(magic number)\r\nReturn:\r\n\tCarry == 1 on error (see below)\r\n\tCarry == 0 on success\r\n\t\tBX := _previous_ segment\r\n\r\nDOS-4B-FE:\t\t\tGet Segment of Argument Structure\r\n\tAH = 0x4B\r\n\tAL = 0xFE\r\n\tDX = 0x4446 == 'FD'\t(magic number)\r\nReturn:\r\n\tCarry == 1 on error (see below)\r\n\t\tif AX == 5 (Access Denied) --> BX := current segment\r\n\tCarry == 0 on success\r\n\t\tBX := current segment\r\n\r\nNote:\r\n\tIf DEBUG was enabled during compilation of KSSF && Carry == 0,\r\n\t\tAX := PID of KSSF\r\n\tOnly one process may use these functions, any other process gets the\r\n\t  error 1 (invalid function). Therefore the primary shell MUST invoke\r\n\t  DOS-4B-F? to lock this function for other processes.\r\n\tSecondary shells may use DOS-4B-FE/Carry/AX==5 to detect a context\r\n\t  of the primary shell and re-use it's critical error handler.\r\n\tIf segment == 0, no segment has been assigned so far.\r\n\t  The kernel interpretes this situation as prg == NULL && shell == NULL.\r\n\r\n\r\nFreeCOM performs a swap-out request as follows:\r\n\r\n+ Parse a \"CALL /S prg argument\" as \"CALL prg arguments\", but enable the\r\nflag swapOnExec.\r\n\r\n+ Eventually the interpreter reaches the \"exec()\" function, that\r\nexecutes an external command. At this point all the remaining command\r\nline has been broken into the external program's name and it's command\r\nline.\r\nIf at this point the flag \"swapOnExec\" is true, the argument structure\r\nis prepared and FreeCOM terminates with a DOS-4C API command.\r\n\r\n+ Whenever FreeCOM is to read \"the next input line\" from whichever media\r\nis currently active, the flag is deactived, thus unless the CALL/S\r\ncommand is immediately followed by an external program, this switch is\r\nignored completely.\r\n\r\nBecause the shell provides two core functions, the Critical Error\r\nhandler and the ^Break handler, which are not always included within\r\nevery program, both handlers must be installed residently even if the\r\nprimary copy of FreeCOM unloads on a swap request. That's why both\r\nhandlers are installed when FreeCOM loads the first time and FreeCOM's\r\nown previous handlers are settings are tweaked in such way that when\r\nFreeCOM terminates for swapping, the addresses of the installed handlers\r\nare copied back into the system and, thus, furtherly re-used for both\r\nthe external program and the re-invoked shell.\r\n\r\nFreeCOM knows two variants of the Critical Error handler:\r\n\r\nType 1: displays the known menu Abort/Retry/Ignore/Fail.\r\n\r\nType 2: is installed when the primary copy had been invoked with the /F\r\nswitch == AutoFail. In this case the handler will automatically return\r\n\"Fail\" for all and any Critical Error.\r\nThis variant is much smaller (about 5 bytes rather than approx. 390 bytes),\r\nbut may cause unexpected and unretraceable behaviour.\r\n\r\nFreeCOM installs a ^Break handler, that will always \"Abort\" the program.\r\nThis is required in order to make the handler independed on the context,\r\nin which it is triggered, aka if within FreeCOM or a spawned program.\r\nIn most circumstances the external program spawned by a swaped-out\r\nFreeCOM will get the same PID as FreeCOM itself.\r\n\r\n"
  },
  {
    "path": "docs/language.txt",
    "content": "How to change the language of FreeCOM?\r\n\t-- 2000/07/10 ska\r\n\r\n\r\nAt this time not all strings can be customized, but it will change!\r\n\r\nWAY 1\t- using pre-compiled FreeCOM images\r\n\r\nThere are four precompiled FreeCOMs:\r\n                - Debugging - Language\r\n+ COMMAND.COM\t-   none    - English (Default)\r\n+ CMDDEBUG.COM  -   yes     - English (Default)\r\n+ COMMAND.CLN\t-   none    - none\r\n+ CMDDEBUG.CLN  -   yes     - none\r\n\r\nYou need:\r\n+ one of the *.CLN files\r\n+ STRINGS\\FIXSTRS.EXE\r\n+ STRINGS\\DEFAULT.LNG\r\n+ STRINGS\\<your_desired_language>.LNG\r\n\r\nWhat do to:\r\n1) enter STRINGS subdirectory: cd strings\r\n2) create the string database for your language: fixstrs <language>\r\n\tDon't write the angle brackets, e.g. to create Spanish string\r\n\trun:\t\tfixstrs spanish\r\n3) attach the strings to FreeCOM:\r\n\t\tcopy /b ..\\command.cln + strings.dat command.com\r\n\tIf you want to include FreeCOM's debugging support run:\r\n\t\tcopy /b ..\\cmddebug.cln + strings.dat cmddebug.com\r\n\r\nIf you want to test several languages, do this:\r\n3) Perform steps 1) and 2) above, but NOT step 3)!\r\n4) Copy either COMMAND.CLN or CMDDEBUG.CLN into any directory you\r\n\tlike and rename it into COMMAND.COM, e.g.:\r\n\t\tcopy ..\\CMDDEBUG.CLN a:\\command.com\r\n5) Copy STRINGS.DAT (the strings database) into the same directory\r\n\tas you copied the clean FreeCOM image above, e.g.:\r\n\t\tcopy STRINGS.DAT a:\r\n\r\nIf you run A:\\COMMAND.COM now, it will miss the embedded strings, but\r\nwill use the external STRINGS.DAT file. To change FreeCOM's language\r\njust replace the STRINGS.DAT file.\r\nIf you use the clean FreeCOM image, but do NOT supply an external\r\nSTRINGS.DAT file, all strings appear as placeholders, e.g.:\r\n\"Error #93\"\r\n\r\n\r\nWAY 2\t- Compile FreeCOM yourself\r\n\r\nBefore you run dmake, create the environment variable LNG and specify\r\nthe language as its contents, e.g.:\r\n\tSET LNG=spanish\r\n\r\n"
  },
  {
    "path": "docs/loadhigh.txt",
    "content": "$Id$\r\nImplementation of the LOADHIGH (aka LH) command\r\n\t-- 2002/04/12 ska\r\n\r\nSee below test results (tools reside in TOOLS directory).\r\n\r\nDISP_AST reveals that LH:\r\n1) enables \"High First\" within the allocation strategy,&\r\n2) Links in the UMB chain.\r\n\r\nMCB_VIEW reveals that MS COMMAND'S LH:\r\n1) leaves the conventional memory untouched,\r\n2) if /L switch is present, \"hides\" unused UMB regions (see below),&\r\n3) when the LH'ed command terminates, all \"hidden\" UMB regions\r\n\tare restorred, regardless if the particular block was hidden by\r\n\tthe particular instance of COMMAND.\r\n\r\nMS COMMAND locks currently unused MCB's by allocating them for\r\nthe system (owner PSP == 8). The useage of system MCBs can be\r\ndetermined from the name field of the MCB, e.g.:\r\nSC = System Code / lock outs\r\nSD = System Data (contains subchain)\r\nHIDDEN = MCBs hidden from DOS's memory management\r\n\r\nConsiderations:\r\n1) If /L is present, all non-present UMB regions are hidden; but the\r\nones \"present\" are _not_ unhidden.\r\n2) When loading high (regardless if with or without /L) _all_ hidden UMB\r\nregions are unhidden upon return of the LH'ed command.\r\n--> Ergo: There is no record to keep, which MCB had been hidden.\r\n\r\nAn implementation of LOADHIGH might look like this:\r\ncmd_loadhigh(char *cmdline)\r\n{\r\n\tquaff /L and /S option(s) from begin of cmdline;\r\n\tif(/L present) {\r\n\t\tfor all UMB regions {\r\n\t\t\tif(UMB region listed in /L) {\r\n\t\t\t\tif(size is specified for UMB region) {\r\n\t\t\t\t\thide all unused MCBs in UMB region, but the\r\n\t\t\t\t\tsmallest one larger than or equal to size;\r\n\t\t\t\t\t/* keep just _one_ MCB that has the requested\r\n\t\t\t\t\t\tsize at minimum */\r\n\t\t\t\t\tif(/S && there is one unused MCB left therein) {\r\n\t\t\t\t\t\tshrink this MCB to size;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/* no size --> use all MCBs therein */\r\n\t\t\t} else {\r\n\t\t\t\thide all unused MCBs in UMB region;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tsave allocation strategy and UMB link state;\r\n\tallocation strategy |= 0x80;\t/* include UMBs in mem alloc */\r\n\tUMB Link state := 1;\r\n\texec(cmdline);\r\n\trestore allocation strategy and UMB link state;\r\n\tunhide all MCBs;\r\n}\r\n\r\n\r\n======== Display the allocation stratedy and UMB Link state\r\nC> ver/r\r\nMS-DOS Version 6.20\r\nRevision A\r\nDOS ist im oberen Speicherbereich (High Memory Area)\r\nC> DISP_AST\r\nAllocation strategy: 0x0000\r\nUMB link state: 0x0000\r\nC> LH DISP_AST\r\nAllocation strategy: 0x0080\r\nUMB link state: 0x0001\r\n\r\n======== Test the MCB chain #1\r\n\r\nMS-DOS Version 6.20\r\nRevision A\r\nDOS ist im oberen Speicherbereich (High Memory Area)\r\n==== CONFIG.SYS\r\ndevice=himem.sys\r\ndos=high,umb\r\ndevice=emm386.exe noems\r\n==== AUTOEXEC.BAT <<empty>>\r\n===\r\n>> Started: mcb_view\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 0006 054b >n?Zu vie< myEnv\r\n054b 0523 054b >MCB_VIEW< itsMe\r\n0a6f 94c9 0000 >????P.< unused\r\n9f39 0001 0000 >???,   < unused\r\n9f3b 0004 054b >\\tool;c:< mySecondaryBlocks\r\n9f40 282e 0008 >SC      < system\r\nc76f 008f 0000 >        < unused\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0000 >        < unused\r\n>> Started: LH /L:1 mcb_view mcb_view.exe\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 0523 0544 >MCB_VIEW< itsMe\r\n0a68 94d7 0000 >!=t?=< unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0544 >        < myEnv\r\nc776 0081 0000 >        < unused\r\nc7f8 0001 0000 >        < unused\r\nc7fa 0004 0544 >        < mySecondaryBlocks\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0008 >HIDDEN  < system\r\nChain to next program: 'mcb_view.exe'\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 0523 0544 >MCB_VIEW< isPSP\r\n0a68 0006 0a6f >!=t?=< myEnv\r\n0a6f 0523 0a6f >mcb_view< itsMe\r\n0f93 8fac 0000 >Sie kann< unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0544 >        < env(MCB_VIEW)\r\nc776 007c 0000 >        < unused\r\nc7f3 0001 0000 >        < unused\r\nc7f5 0004 0a6f >        < mySecondaryBlocks\r\nc7fa 0004 0544 >        < ownedBy(MCB_VIEW)\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0008 >HIDDEN  < system\r\n>> Started: mcb_view\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 0006 054b >MCB_VIEW< myEnv\r\n054b 0523 054b >MCB_VIEW< itsMe\r\n0a6f 94c9 0000 >mcb_view< unused\r\n9f39 0001 0000 >???,   < unused\r\n9f3b 0004 054b >        < mySecondaryBlocks\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0000 >        < unused\r\nc776 007c 0000 >        < unused\r\nc7f3 0001 0000 >        < unused\r\nc7f5 0004 0000 >        < unused\r\nc7fa 0004 0000 >        < unused\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0000 >        < unused\r\n>> Started: LH /L:1 mcb_view c:\\command.com /c mcb_view\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 0523 0544 >MCB_VIEW< itsMe\r\n0a68 94d7 0000 >G?|u?&< unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0544 >        < myEnv\r\nc776 0081 0000 >        < unused\r\nc7f8 0001 0000 >< unused\r\nc7fa 0004 0544 >        < mySecondaryBlocks\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0008 >HIDDEN  < system\r\nChain to next program: 'c:\\command.com'\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 0523 0544 >MCB_VIEW< isPSP\r\n0a68 0006 0a6f >G?|u?&< ownedBy(command )\r\n0a6f 00bc 0a6f >command < isPSP\r\n0b2c 0010 0a6f >arameter< env(command )\r\n0b3d 0006 0b44 >??????< myEnv\r\n0b44 0523 0b44 >MCB_VIEW< itsMe\r\n1068 8ed7 0000 >!  < unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0544 >        < env(MCB_VIEW)\r\nc776 007c 0000 >        < unused\r\nc7f3 0001 0000 >        < unused\r\nc7f5 0004 0b44 >        < mySecondaryBlocks\r\nc7fa 0004 0544 >        < ownedBy(MCB_VIEW)\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0008 >HIDDEN  < system\r\n>> Started: LH /L:1 mcb_view +c:\\command.com /c LH /L:2 mcb_view\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 1370 0544 >MCB_VIEW< itsMe\r\n18b5 868a 0000 >h?^?&_< unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0544 >        < myEnv\r\nc776 0081 0000 >        < unused\r\nc7f8 0001 0000 >< unused\r\nc7fa 0004 0544 >        < mySecondaryBlocks\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0008 >HIDDEN  < system\r\nChain to next program: 'c:\\command.com'\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 1370 0544 >MCB_VIEW< isPSP\r\n18b5 0006 18bc >h?^?&_< ownedBy(command )\r\n18bc 00bc 18bc >command < isPSP\r\n1979 0010 18bc >arameter< env(command )\r\n198a 0006 1991 >??????< myEnv\r\n1991 1370 1991 >MCB_VIEW< itsMe\r\n2d02 7236 0000 >F?     < unused\r\n9f39 0001 0000 >???,   < unused\r\n9f3b 0004 1991 >        < mySecondaryBlocks\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0544 >        < env(MCB_VIEW)\r\nc776 0083 0008 >HIDDEN  < system\r\nc7fa 0004 0544 >        < ownedBy(MCB_VIEW)\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0008 >HIDDEN  < system\r\n>> This is the 2nd output of the 1st MCB_VIEW when COMMAND returned!!\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 1370 0544 >MCB_VIEW< itsMe\r\n18b5 0006 0000 >h?^?&_< unused\r\n18bc 00bc 0000 >command < unused\r\n1979 0010 0000 >arameter< unused\r\n198a 85b5 0000 >??????< unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0544 >        < myEnv\r\nc776 0083 0000 >        < unused\r\nc7fa 0004 0544 >        < mySecondaryBlocks\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0000 >        < unused\r\n>> Started: LH /L:1 mcb_view +c:\\command.com /c LH mcb_view\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 1370 0544 >MCB_VIEW< itsMe\r\n18b5 868a 0000 >        < unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0544 >        < myEnv\r\nc776 0081 0000 >        < unused\r\nc7f8 0001 0000 >        < unused\r\nc7fa 0004 0544 >        < mySecondaryBlocks\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0008 >HIDDEN  < system\r\nChain to next program: 'c:\\command.com'\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 1370 0544 >MCB_VIEW< isPSP\r\n18b5 0006 18bc >        < ownedBy(command )\r\n18bc 00bc 18bc >command < isPSP\r\n1979 0010 18bc >arameter< env(command )\r\n198a 1370 198a >MCB_VIEW< itsMe\r\n2cfb 7244 0000 >        < unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0544 >        < env(MCB_VIEW)\r\nc776 0006 198a >        < myEnv\r\nc77d 0075 0000 >        < unused\r\nc7f3 0001 0000 >        < unused\r\nc7f5 0004 198a >        < mySecondaryBlocks\r\nc7fa 0004 0544 >        < ownedBy(MCB_VIEW)\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0008 >HIDDEN  < system\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 1370 0544 >MCB_VIEW< itsMe\r\n18b5 0006 0000 >        < unused\r\n18bc 00bc 0000 >command < unused\r\n1979 0010 0000 >arameter< unused\r\n198a 85b5 0000 >MCB_VIEW< unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0544 >        < myEnv\r\nc776 0083 0000 >        < unused\r\nc7fa 0004 0544 >        < mySecondaryBlocks\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0000 >        < unused\r\n>> Started: LH /L:1 mcb_view +c:\\command.com /c mcb_view\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 1370 0544 >MCB_VIEW< itsMe\r\n18b5 868a 0000 >h?^?&_< unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0544 >        < myEnv\r\nc776 0081 0000 >        < unused\r\nc7f8 0001 0000 >< unused\r\nc7fa 0004 0544 >        < mySecondaryBlocks\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0008 >HIDDEN  < system\r\nChain to next program: 'c:\\command.com'\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 1370 0544 >MCB_VIEW< isPSP\r\n18b5 0006 18bc >h?^?&_< ownedBy(command )\r\n18bc 00bc 18bc >command < isPSP\r\n1979 0010 18bc >arameter< env(command )\r\n198a 0006 1991 >??????< myEnv\r\n1991 1370 1991 >MCB_VIEW< itsMe\r\n2d02 723d 0000 >F?     < unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0544 >        < env(MCB_VIEW)\r\nc776 007c 0000 >        < unused\r\nc7f3 0001 0000 >        < unused\r\nc7f5 0004 1991 >        < mySecondaryBlocks\r\nc7fa 0004 0544 >        < ownedBy(MCB_VIEW)\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0008 >HIDDEN  < system\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0254 0217 0008 >SDR?< system\r\n046c 0004 0008 >SC&???< system\r\n0471 00bc 0471 >COMMAND < isPSP\r\n052e 0004 0000 >arameter< unused\r\n0533 0010 0471 >lwort? '< env(COMMAND )\r\n0544 1370 0544 >MCB_VIEW< itsMe\r\n18b5 0006 0000 >h?^?&_< unused\r\n18bc 00bc 0000 >command < unused\r\n1979 0010 0000 >arameter< unused\r\n198a 85b5 0000 >??????< unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0006 0544 >        < myEnv\r\nc776 0083 0000 >        < unused\r\nc7fa 0004 0544 >        < mySecondaryBlocks\r\nc7ff 2402 0008 >SC      < system\r\nec02 02fe 0008 >HIDDEN  < system\r\n\r\n======== Test the MCB chain #2\r\n\r\nWindows 98 [Version 4.10.2222]\r\nVersion A\r\nDOS ist im hohen Speicherbereich (HMA)\r\n==== CONFIG.SYS\r\ndevice=himem.sys /verbose\r\ndos=high,umb\r\ndevice=emm386.exe noems /verbose\r\n==== AUTOEXEC.BAT <<empty>>\r\n===\r\n>> Started: LH /L:1 mcb_view +c:\\command.com /c LH /L:2 mcb_view\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0209 0189 0008 >SD      < system\r\n0393 0004 0008 >SC?v?< system\r\n0398 0002 039b >?4?t?< ownedBy(COMMAND )\r\n039b 0165 039b >COMMAND < isPSP\r\n0501 1370 0501 >MCB_VIEW< itsMe\r\n1872 86cd 0000 >4u?T?~< unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0059 039b >        < env(COMMAND )\r\nc7c9 0008 0501 >        < myEnv\r\nc7d2 0025 0000 >        < unused\r\nc7f8 0001 0000 >        < unused\r\nc7fa 0004 0501 >        < mySecondaryBlocks\r\nc7ff 2402 0008 >SC      < system\r\nec02 01e0 0008 >SD      < system\r\nede3 011d 0008 >HIDDEN  < system\r\nChain to next program: 'c:\\command.com'\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0209 0189 0008 >SD      < system\r\n0393 0004 0008 >SC?v?< system\r\n0398 0002 039b >?4?t?< ownedBy(COMMAND )\r\n039b 0165 039b >COMMAND < isPSP\r\n0501 1370 0501 >MCB_VIEW< isPSP\r\n1872 0007 187a >4u?T?~< ownedBy(command )\r\n187a 0159 187a >command < isPSP\r\n19d4 0059 187a >????< env(command )\r\n1a2e 0005 1a34 >?؎q< myEnv\r\n1a34 1370 1a34 >MCB_VIEW< itsMe\r\n2da5 7193 0000 >3< unused\r\n9f39 0001 0000 >bel ist.< unused\r\n9f3b 0004 1a34 >kette f< mySecondaryBlocks\r\n9f40 282e 0008 >SC      < system\r\nc76f 0059 039b >        < env(COMMAND )\r\nc7c9 0008 0501 >        < env(MCB_VIEW)\r\nc7d2 0027 0008 >HIDDEN  < system\r\nc7fa 0004 0501 >        < ownedBy(MCB_VIEW)\r\nc7ff 2402 0008 >SC      < system\r\nec02 01e0 0008 >SD      < system\r\nede3 011d 0008 >HIDDEN  < system\r\n>> This is the 2nd output of the 1st MCB_VIEW when COMMAND returned\r\nUMBs not linked into the MCB chain\r\nAllocation strategy: 0x00\r\n0209 0189 0008 >SD      < system\r\n0393 0004 0008 >SC?v?< system\r\n0398 0002 039b >?4?t?< ownedBy(COMMAND )\r\n039b 0165 039b >COMMAND < isPSP\r\n0501 1370 0501 >MCB_VIEW< itsMe\r\n1872 0007 0000 >4u?T?~< unused\r\n188a 0159 0000 >command < unused\r\n19d4 0059 0000 >????< unused\r\n1a2e 0041 0000 >?؎q< unused\r\n1a70 84cf 0000 >        < unused\r\n9f40 282e 0008 >SC      < system\r\nc76f 0059 039b >        < env(COMMAND )\r\nc7c9 0008 0501 >        < myEnv\r\nc7d2 0027 0000 >        < unused\r\nc7fa 0004 0501 >        < mySecondaryBlocks\r\nc7ff 2402 0008 >SC      < system\r\nec02 01e0 0008 >SD      < system\r\nede3 011d 0000 >        < unused\r\n\r\n"
  },
  {
    "path": "docs/localize.txt",
    "content": "How to localize FreeCOM -- 2000/08/16 ska\r\n\r\nCurrently FreeCOM contains only one point, where it can be \"localized\"\r\naka made ready for national languages other than English, --> the\r\nstrings.\r\n\r\nThe strings can be prepared for each language separately, prepared for\r\nFreeCOM, added to FreeCOM and at an instant FreeCOM speaks the new\r\nlanguage to its user.\r\n\r\nNote: The Critical Error handler can be localized during compilation\r\n\tof the CRITER module only, currently.\r\n\r\n== The basics\r\n\r\nFreeCOM references all strings by a number (see the \"Current\r\nimplementation\" section), however, because it's hard to remember plenty\r\nof numbers even for programmers, in FreeCOM these numbers are hidden by\r\nC-macros. The association between the numbers and their names is\r\n#include'ed from the file STRINGS.H.\r\n\r\nSo when FreeCOM wants to display a certain string, it uses for instance:\r\n\tdisplay_string(TEXT_ERROR_LONG_LINE_BATCHFILE, linenr, filename);\r\n\r\nThe \"TEXT_ERROR_LONG_LINE_BATCHFILE\" is a C-macro defined in the header\r\nfile \"STRINGS.H\", whereas \"linenr\" and \"filename\" are some normal C\r\nvariables. This particular call should display something like this:\r\n\r\nLine #%ld in batchfile '%s' too long.\\n\r\n\r\nSo, FreeCOM knows how to reference to a particular string by its\r\nsymbolical name, FreeCOM also needs to know how to retreive the actual\r\nstring.\r\n\r\nThe file STRINGS.DAT contains all these strings and a little control\r\narea that allows to easily map a string's number into its data, thus\r\nin the example above, to map TEXT_ERROR_LONG_LINE_BATCHFILE into\r\n\"Line #%ld in batchfile '%s' too long.\\n\"\r\nOnce this line has been retreived and loaded into memory, it is\r\ndisplayed like with a printf()-style function, so above display_string()\r\ncall is at the end equal to:\r\n\tprintf(\"Line #%ld in batchfile '%s' too long.\\n\", linenr, filename);\r\n\r\nBoth files STRINGS.H and STRINGS.DAT are created by the utility named\r\nFIXSTRS included in the FreeCOM distribution in subdirectory STRINGS.\r\n\r\nBecause FreeCOM is a COMMAND.COM replacement it must come as a single\r\nfile. Therefore the FreeCOM executable and STRINGS.DAT are merged\r\ntogether in such way that wherever FreeCOM is located, STRINGS.DAT is\r\npresent, too, but it does not add to the size of FreeCOM, when loaded\r\ninto memory.\r\n\r\n== The generation of STRINGS.H and STRINGS.DAT\r\n\r\nThe following interesting files are located in the subdirectory STRINGS:\r\n\r\nFIXSTRS.C   - The source of FIXSTRS.EXE\r\nFIXSTRS.EXE - The utility to create STRINGS.H and STRINGS.DAT\r\n\r\nDEFAULT.LNG - A very important source file for FIXSTRS.EXE\r\n*.LNG       - Local language definition files (see below)\r\n\r\nTo create both files one must invoke:\r\n\r\nC> FIXSTRS.EXE language\r\n\r\nwhere \"language\" is to be replaced by the actual language to create the\r\nfiles for, e.g.:\r\n\r\n\tFIXSTRS SPANISH\r\n\r\nwill create the Spanish strings for FreeCOM.\r\n\r\nThe syntax of all *.LNG files, including DEFAULT.LNG, is identical and\r\nis described in DEFAULT.LNG. These files actually define what strings\r\nFIXSTRS shall include into STRINGS.DAT associated with a particular\r\nname, e.g.i the following 4 (four) lines:\r\n\r\n:TEXT_ERROR_LONG_LINE_BATCHFILE\r\nLine #%ld in batchfile '%s' too long.\r\n.\r\n\r\ndefine above mentioned error message string.\r\nThe single dot in line #4 specify that there is a final newline\r\ncharacter at the string, thus, it's \"Line #%ld in batchfile '%s' too\r\nlong.\\n\" rather than just \"Line #%ld in batchfile '%s' too long.\" as\r\nwhen the last line contains a single comma.\r\n\r\nBecause the localization process shall NOT include to re-compile or\r\nre-link FreeCOM, the numbers (hidden by the C-macro names) FreeCOM uses\r\ninternally and the numbers the strings have within a STRINGS.DAT file\r\n_must_ be the same. And here is where the \"very important\" part of\r\nDEFAULT.LNG comes in:\r\n\r\nFIXSTRS does not only read the local LNG file for the particular\r\nlanguage, but first DEFAULT.LNG, too!\r\n\r\nIn the first step DEFAULT.LNG is imported. Doing so all strings defined\r\nin there are associated with continueous numbers. Then in a second step\r\nthe local LNG file is imported, although overwriting strings already\r\ndefined within DEFAULT.LNG, but the original order of the strings is\r\nretained.\r\n\r\nBecause _all_ LNG files will first read DEFAULT.LNG, all strings defined\r\nin DEFAULT.LNG will be associated with the same number independed on the\r\norder these strings have in the local LNG file or whether or not they\r\nare defined there at all.\r\n\r\nAs a sideeffect, all strings not defined in the local LNG file are\r\ncopied from DEFAULT.LNG. Doing so will help to keep up with the\r\ndevelopment process of FreeCOM, although it will not cleanly speak the\r\nsame language.\r\n\r\n== Short description to create a local LNG file anew\r\n\r\nCopy DEFAULT.LNG to language.LNG, where \"language\" is the best\r\n8-character string describing the target language, and translate.\r\n\r\nThen proceed to section \"Short description to maintain a present LNG\r\nfile\".\r\n\r\n== Short description to maintain a present LNG file\r\n\r\nRun:\r\n\r\nC> FIXSTRS language\r\n\r\nOn success _three_ files have been created:\r\n\r\nSTRINGS.H - the #include file for FreeCOM\r\nSTRINGS.DAT - the binary strings data file\r\nSTRINGS.LOG - the error/mismatch log file\r\n\r\nThe latter one STRINGS.LOG will contain mismatches found between the LNG\r\nfile and DEFAULT.LNG, there are listed the string's name and if 1) the\r\nstring is missing from the LNG file or 2) is no real resource (aka is\r\nnot present in DEFAULT.LNG).\r\nWhen no STRINGS.LOG file has been created by FIXSTRS, there either was a\r\nfatal error or no mismatch was found.\r\n\r\nIn case #1 copy over the string from DEFAULT.LNG into the local LNG file\r\nand translate it.\r\nIn case #2 you can savely remove the string, or you might leave it in\r\nthere, if you think it will be used in future, though, it will add to\r\nthe overall size of FreeCOM.\r\n\r\nOnce you are happy with your strings run:\r\n\r\nC> COPY /B COMMAND.CLN + STRINGS.DAT COMMAND.COM\r\n\r\nOn success run FreeCOM by invoking:\r\n\r\nC> COMMAND.COM\r\n\r\nand test it.\r\n\r\nWhen you are completely happy with your local LNG file, mail it to the\r\ncurrent maintainer of FreeCOM (see UPLOAD.TXT).\r\n\r\n== Current implementation\r\n\r\nThere are still plenty of strings hardcoded within FreeCOM, especially\r\nthe response keys.\r\nSo:\r\n1) do not translate the response keys, or\r\n2) help to find all these hardcoded strings and replace them with\r\ndynamically loadable strings.\r\n"
  },
  {
    "path": "docs/module.txt",
    "content": "Description of Modules Used Within FreeCOM\r\n\t-- 2000/07/15 ska\r\n\r\nThe information of this document is obsolte!\r\n\r\nFreeCOM uses some kind of free-standing pieces of code that perform\r\nsome low-level functions and are shared among all copies of FreeCOM\r\ncurrently loaded into memory. These modules are plain memory images\r\ntypically less than 64KB and are loaded into their own block of memory.\r\nBecause their useage is no furtherly predefined and they do not\r\nnecessarily hook any interrupts or such they are tagged by magic\r\nnumber and actively searched by any program that needs to find them.\r\n\r\nWhen loaded a module is just a block of memory, but owned by the system.\r\nThe tag is located within their MCB, within the lower eight bytes.\r\nFreeCOM uses the tags \"FCOM_###\", where the \"###\" identifies the\r\nmodule, e.g. ERR is the Critical Error handler.\r\nTo find such module a program must work the MCB chain and search the\r\nlower part of the MCB for the tag. To do this, the mcb_forAll()\r\nenumerator of the SUPPL library is used.\r\nWhen a module is removed from memory, the underscore is changed into\r\na dash in order to leave the knowledge behind that the module existed\r\nthere some time, but invalidate it for module searches.\r\n\r\nTo load a module the DOS API is used in order to guarranty that really\r\na new MCB is created and the necessary changes to the MCB are made.\r\nTo unload a module the changes are reversed and the block memory\r\nremoved.\r\n\r\nThe communication between a module and the copies of FreeCOM sharing\r\nthe module among them will be accomplished by a far pointer that\r\npoints to the data required by the module, but generated by or for\r\na particular copy of FreeCOM. This pointer is located at the very\r\nbeginning of the module, thus, the four bytes at\r\n\tMK_FP(segment_of_module, 0)\r\n\r\nThis pointer references a structure containing all necessary data fields.\r\n\r\nIn FreeCOM modules are stored as resources, appended to the executable\r\nand, therefore, can be easily located and loaded into memory.\r\n\r\n====\r\n\r\nExample: The Critical Error handler\r\n\r\nIts resource ID is major: 0x01.\r\nThe \"structure\" used to pass data between the module and the copy of FreeCOM\r\njust contains a flag, whether or not AutoFail is active.\r\n\r\nBecause during the run of some programs new copies of FreeCOM could be spawned,\r\nthey search the MCB chain for the already loaded module and overwrite the\r\npointer with their own, then the current INT-24 handler is overwritten\r\nby the address of the module. On termination they restore the previous pointer.\r\n\r\n====\r\n\r\nProblems with this implementation:\r\n\r\nP1: Invalid pointers\r\nThis scenario assumes that no copy of FreeCOM dies before restoring the\r\nprevious pointer and that no third copy is spawned asynchroneously,\r\nwhich does _not_ terminate before the second copy terminates.\r\n\r\nI don't know if there is a solution for the second case in DOS at all,\r\nbut the first one can seriously trash the system and may come up especially\r\nduring the early implementation days quite often.\r\nOne possible solution is to rely on already available mechanism of DOS,\r\nthough, they might not exist for all specific modules.\r\n\r\nThe algorithm DOS handles the Critical Error handler is as follows:\r\nOn creation of a process the current INT-24 handler is saved into a\r\nfield of the PSP of the process. On run-time the process can overwrite\r\nthe INT-24 handler with its own, but is not required to restore the\r\nprevious handler, because on termination of the process the saved\r\ncopy of INT-24 is restored automatically.\r\n\r\nThis mechanism could be used to overcome above problem by this:\r\nEach copy FreeCOM contains a stub that hooks INT-24, loads some registers\r\nwith a pointer to the module and jumps into the shared code.\r\nThat way the pointer that identifies which context to process is indirectly\r\npart of the actual INT-24 pointer, which, as shown above, is stabilized by\r\nDOS mechanisms. That way a valid INT-24 automatically implies a valid\r\ncontext pointer.\r\n"
  },
  {
    "path": "docs/notes.txt",
    "content": "Notes from contributors....\r\n\r\nNotes from Hans B Pufal <hansp@digiweb.com>:\r\n\r\nHere is my package of changes to COMMAND, my coding was based on version\r\n74B, but I downloaded version 74D and modified my files accordingly.\r\n\r\nI use BC 4.5 and had some problems with the makefile, it was generating\r\na .COM file of 102Kb!. I have included my modified makefile for your\r\nreference.\r\n\r\nFor the files I have modified, I have reformatted them to my style (sorry).\r\nTake a look and see if you can live with it. I find that procedure headers\r\nare easier to find and that putting the history in reverse order helps\r\nquickly find the latest changes.\r\n\r\n\r\n\r\n   File   Description\r\n\r\n   batch.c  A new version, implements CALL, ECHO, GOT, IF, PAUSE, SHIFT\r\n    and BEEP. There is a stub for FOR but that's all.\r\n\r\n   cmdtable.c New file to keep the internal command table. I plan on\r\n    getting rid of the table real soon now and replacing it\r\n    with a dynamic mechanism.\r\n\r\n   command.c  A new (improved ;) version. Conforms closely to MS-DOS\r\n    specs. Cleaned up (and fixed) the redirection handler.\r\n\r\n   command.h  Your version D with changes. Look for the HBP tag.\r\n\r\n   makefile My version of the makefile, for BC 4.5. Sorry don't use\r\n    the IDE so could not make a .prj file.\r\n\r\n   notes.txt  This file...\r\n\r\n   redir.c  Modified file, now supports append redirects.\r\n\r\n   where.c  Modified, made it a little safer and quicker...\r\n\r\n\r\nThe test subdirectory has some batch file tests. I run T.BAT which uses\r\nruns the test and sends output to a file. The tests are run twice once\r\nfor a COMMAND.COM on the patch (presumably ours) and once with\r\nC:\\COMMAND.COM, presumed to be the MSDOS version. Compare the outputs in\r\nMSDOS.OUT and FDOS.OUT to look for any problems.\r\n\r\nThat's about it, ask if you have any questions.\r\n\r\nRegards,\r\n\r\nHans <mailto:hansp@digiweb.com>\r\n\r\n-----------------------------------------------------------------------------\r\n\r\n10-Aug-1998 0.75b Steffen Kaiser <skaise2a@smail.inf.fh-rhein-sieg.de>\r\n\r\n+ Corrected ^Break handling in batch.c\r\n  Try something like this:\r\n  ===== File batch1.bat\r\n  @echo off\r\n  echo Hi Batch1.bat\r\n  echo Hi Batch1.bat\r\n  ===== File batch2.bat\r\n  @echo off\r\n  :loop\r\n  call batch1.bat\r\n  goto loop\r\n  =====\r\n  The press ^Break or ^C. Most of the time you are asked to\r\n  terminate BATCH1.BAT (Y/N/A), if you press 'Y', you only terminate\r\n  BATCH1, but BATCH2 continue. But if you press 'A' (or ^C),\r\n  even BATCH2 is terminated.\r\n\r\n+ added modifyable batch scripts (following the standard)\r\n\r\n+ bug: nested comments in old split()\r\n\r\n+ bug: DEL memory allocation\r\n\r\n+ added ^Break checks to cmd_type(), cmd_dir()\r\n\r\n+ added: chkCBreak(0) [aka \"cbreak\"] is a generic form that autodetects\r\n  if currently a batchfile is active and displays the batchfile\r\n  prompt, if so.\r\n  The batchfile prompt now displays the name of the batchfile.\r\n\r\n\r\n+ echo off on command line --> frozen computer\r\n\r\n+ The initialization code init() is still broken (included in my last\r\n  patch).\r\n\r\n+ In init() the errorlevel of the processed command is returned.\r\n  This is a nice feature, however, MS COMMAND returns '0' to\r\n  indicate a successful run of COMMAND itself. It's non-standard,\r\n  offer an option.\r\n\r\n+ fixed DEL char **arg allocation --> allocating a dynamic memory area\r\n  for each arg[] element, however, split() simply overwrites them and\r\n  they are no dynamic pointers for their own.\r\n\r\n+ The DEL access()/stat() stuff is still broken (included in my last\r\n  buglist report)\r\n\r\n+ The find_which() is still broken as it searches through PATH prior\r\n  testing all extensions within one directory.\r\n\r\n+ Someone removed the ^Break catcher. It makes not much sense to incorporate\r\n  ^Break checks, but running without a ^C catcher. Therefore I have\r\n  re-added the catcher, this time using signals (the DOS emulation of\r\n  them, however).\r\n\r\n-----------------------------------------------------------------------------\r\nCOPY.TXT\r\nRob Lake\r\nAug-19-98\r\n\r\nNotes:\r\no Crashes when returning from cmd_copy.  Works fine on its own\r\n(see mod_copy.zip).  I can't figure out why myself.  I think that\r\nthere is a memory allocation problem somewhere.  Hopefully someone\r\nmore experienced can track it down.\r\n\r\no I named the module version of copy `cp' to resolve possible abiguity of\r\nnaming it copy.\r\n\r\no I don't remember exactly what time I started writing, so I figured around\r\nAug 1.\r\n\r\no Although the program accepts the /Y or /-Y switches, it does not do\r\nanything with them, yet.\r\n\r\no The default mode for copying is BINARY\r\n\r\no Specify /a before or after the destination file, if one is given,\r\nwill append the destination with a ^Z character.  Place appropriate\r\nwarning here.  Ex. These commands will add the ^Z character:\r\n        cp \"/a cp.com cp.txt\"\r\n        cp \"cp.com + /a cp.obj cp.txt\"\r\n        cp \"cp.com /a cp.txt\"\r\n        cp \"cp.com cp.txt /a\"\r\n\r\no You can define the mode for all files in the command line.  Ex.\r\n        cp \"/b cp.com + /a copy.c + /a copy.obj /b cp.txt\"\r\nworks (for whatever reason someone would want to do that:-).\r\n\r\no The following commands where tested with the module copy:\r\n        cp c:\\autoexec.bat\r\n        cp \"c:\\autoexec.bat test.bat\"\r\n        cp \"..\\ temp\"\r\n- Given that ..\\ has files.  If temp is a directory, will copy all files\r\nto it.  If temp is a file or does not exist, all the files with be copied\r\nto .\\temp.  NOTE: Appended to temp, not over written each time.\r\n        cp \"cp.com test.com\"\r\n        cp \"/a cp.com cp.txt\"\r\n        cp \"file1+file2+file3 file4\"\r\n- Will ask to overwrite file4 after file1 has been copied.  This will be\r\nfixed later.\r\n        cp \"file5+file1+file2+file3\"\r\n- This appends file1, file2 and file3 to file5.  Will ask to overwrite\r\nfile5 when file2 has been copied, if file5 does not exist.  Will be fixed\r\nlater.\r\n- MS-DOS copy doesn't create file5 if it does not exist.  It\r\nconcatenates all to file1, it should print an error message.  This copy\r\ncreates a file5 if one does not exist.  This can be changed later.\r\n\r\no This command doesn't work yet:\r\n        cp \"*.c+*.h *.txt\"\r\n- If tried, will print \"NOT IMPLEMENTED YET\" message.  This command may be\r\nkind of confusing.  Take for example you have a directory with these files:\r\nfile1.c file1.h\r\nfile2.c file2.h\r\nThe command above will copy file1.c and file1.h to file1.txt and file2.c\r\nand file2.h to file2.txt.  If, say, file1.h does not exist, copy will\r\nproduce the messages:\r\nFILE1.C\r\nFILE1.H\r\nFile not found - FILE1.H\r\nInvalid handle - FILE1.TXT\r\n        0 file(s) copied\r\n-----------------------------------------------------------------------------\r\n\r\n"
  },
  {
    "path": "docs/piping.txt",
    "content": "Piping -- 2000/08/16 ska\r\n\r\n\r\nPiping, e.g. \"cmd1 | cmd2\", is actually spawned as:\r\n\r\n1\tSET some_internal_variable=%TEMP%\\non-existant-file\r\n2\tcmd1 >%some_internal_variable%\r\n3\tcmd2 <%some_internal_variable%\r\n4\tDEL %some_internal_variable%\r\n\r\nThe original implementation failed because the file was left open\r\nfor writing in statement 2 before the temporary file was tried to\r\nbe opened for reading in statement 3.\r\nThis served to deny accidential deletation of the temporary file,\r\nbut could fail, esp. if SHARE is not loaded.\r\n\r\nThe new implementation really behaves as shown above and closes\r\nthe file during to step from statement 2 to 3. At exactly this time\r\nthe file is no longer protected by the system to be removed or\r\nopened by another process, thus, blocking the operation of FreeCOM\r\nto re-open the file for statement 3.\r\n\r\nTo open the temporary file in read-write mode -- which means that the file\r\nneed not to be re-opened for statement #3 -- would open the Potential\r\nProblem that cmd1 or cmd2 could \"work\" with the temporary file, but\r\nthe \">\" stream is entitled to be a write-only and \"<\" a read-only stream.\r\n\r\nFor now the possibility that the temporary file is removed seems to be\r\nless than the other, so the lesser devil was choosen to be implemented.\r\n"
  },
  {
    "path": "docs/pt_br/config.h",
    "content": "/*\r\n * config.h - Usado para configurar o que ser compilado para interpretador.\r\n *\r\n */\r\n\r\n/* Defina DEBUG para adicionar cdigo de  add depurao */\r\n#ifndef DEBUG\t\t\t/* possivelmente j definido via linha de comando */\r\n//#define DEBUG\r\n#endif\r\n\r\n/* Defina para ativar o comando alias, e atalhos. */\r\n#define FEATURE_ALIASES\r\n#define ALIAS_DEFAULT_SIZE 1024\r\n\r\n/* Defina para ativar entrada de dados avanada (pre-requisito de Histrico e complementao \r\n\tnome de arquivo  */\r\n#define FEATURE_ENHANCED_INPUT\r\n\r\n/* Defina ativar histrico(DOSKEY); requer: Entrada de dados avanada */\r\n#define FEATURE_HISTORY\r\n#define HISTORY_DEFAULT_SIZE 256\r\n\r\n/* Defina para ativar complementao de nome de arquivo; requer: Entrada de dados avanada */\r\n#define FEATURE_FILENAME_COMPLETION\r\n\r\n/* Defina para ativar para carregar menssagens na memoria */\r\n#define FEATURE_LOAD_MESSAGES\r\n\r\n/* Defina para ativar DOS NLS */\r\n#define FEATURE_NLS\r\n\r\n/* Defina para ativar teste das teclas F5/F8 na inicializao se /P estiver presente na\r\n\tlinha de comando */\r\n/* #define FEATURE_BOOT_KEYS */\r\n\r\n/* LOG de caractersticas da linha de comando */\r\n/* #define FEATURE_CALL_LOGGING */\r\n\r\n/* Preserva o ltimo diretorio (CD, CHDIR, CDD, PUSHD, POPD);\r\n\t\"CD -\" l est chdir */\r\n#define FEATURE_LAST_DIR\r\n\r\n/* Ativa o suporte para instalao de extenes de COMANDO (MUX-AE)\r\n */\r\n#define FEATURE_INSTALLABLE_COMMANDS\r\n\r\n/* Nome do executvel */\r\n#define COM_NAME \"COMMAND.COM\"\r\n/* Nome padro do AUTOEXEC.BAT */\r\n#define AUTO_EXEC \"\\\\autoexec.bat\"\r\n/* Arquivo de LOG para registrar algumas caracteristicas; PRECISA estar altamente-qualificado! */\r\n#define LOG_FILE \"C:\\\\FreeCom.log\"\r\n\r\n/* Define o numero de loops quando redirecionar para o CON se o\r\n\tinterpretados ficar em um loop - \"hangForEver()\" - para sempre\r\n   No defina para remover esta caracterstica */\r\n#define FEATURE_AUTO_REDIRECT_TO_CON 5\r\n\r\n/* Quantos arquivo de lote devem ser aninhados minimamente */\r\n#define BATCH_NESTLEVEL_MIN 5\r\n\r\n/* Defina para adicionar suporte ao swapout do FreeCOM\r\n\tsee DOCS\\K-SWAP.TXT\r\n*/\r\n#define FEATURE_KERNEL_SWAP_SHELL\r\n\r\n/* Defina para adicionar suportr para troca XMS-only do FreeCOM\r\n\tEst definio  incompatvel com a definio acima.\r\n*/\r\n/* #define FEATURE_XMS_SWAP */\r\n\r\n/* Define o tamanho do buffer usado para guardar todos os caminhos antigos para o PUSHD/POPD */\r\n#define DIRSTACK_DEFAULT_SIZE 256\r\n\r\n/* Use isto se um programa externo foi terminado por\r\n\t^C or ^Break */\r\n#define CBREAK_ERRORLEVEL 3\r\n\r\n/* Use este modos_de_arquivos enquanto localizando por complementao do arquivo */\r\n#define FILE_SEARCH_MODE FA_RDONLY | FA_ARCH | FA_DIREC\r\n\r\n\r\n/* Configurao de menssagens padro:\r\n  PATTERN: como a string  construida pelo ID (com \\n)\r\n  OUTOFMEMORY: string para informar uma condio de falta-de-memria(no \\n)\r\n  ID_: O ID do erro quando no h modelo padro para ser criado, mas\r\n  \ta string de falta-de-memoria for mostrada\r\n*/\r\n#define MSG_DFL_PATTERN \"String #%u\\n\"\r\n#define MSG_DFL_OUTOFMEMORY \"Falta de memoria!\"\r\n#define MSG_ERR_ID_OUTOFMEMORY TEXT_ERROR_OUT_OF_MEMORY\r\n\r\n\r\n/* Prompt padro */\r\n#define DEFAULT_PROMPT \"$P$G\"\r\n\r\n/* Prove o maior tamanho que o contexto pode ter */\r\n#define CONTEXT_MAX_SIZE (65535U - 12)\r\n\r\n/* Defina este valor para selecionar o valor de FDDEBUG para a inicializao */\r\n#define FDDEBUG_INIT_VALUE 1\r\n\r\n#define INCLUDE_CMD_BEEP\r\n#define INCLUDE_CMD_BREAK\r\n#define INCLUDE_CMD_CHDIR\r\n#define INCLUDE_CMD_CDD\r\n#define INCLUDE_CMD_CLS\r\n#define INCLUDE_CMD_COPY\r\n#define INCLUDE_CMD_CTTY\r\n#define INCLUDE_CMD_DATE\r\n#define INCLUDE_CMD_DEL\r\n#define INCLUDE_CMD_DIR\r\n#define INCLUDE_CMD_DIRS\r\n#define INCLUDE_CMD_LOADFIX\r\n#define INCLUDE_CMD_LOADHIGH\r\n#define INCLUDE_CMD_MEMORY\r\n#define INCLUDE_CMD_MKDIR\r\n#define INCLUDE_CMD_PATH\r\n#define INCLUDE_CMD_PAUSE\r\n#define INCLUDE_CMD_PROMPT\r\n#define INCLUDE_CMD_PUSHD\r\n#define INCLUDE_CMD_POPD\r\n#define INCLUDE_CMD_REM\r\n#define INCLUDE_CMD_RENAME\r\n#define INCLUDE_CMD_RMDIR\r\n#define INCLUDE_CMD_SET\r\n#define INCLUDE_CMD_TIME\r\n#define INCLUDE_CMD_TRUENAME\r\n#define INCLUDE_CMD_TYPE\r\n#define INCLUDE_CMD_VER\r\n#define INCLUDE_CMD_VERIFY\r\n#define INCLUDE_CMD_VOL\r\n#define INCLUDE_CMD_QUESTION\r\n#define INCLUDE_CMD_WHICH\r\n#ifdef DEBUG\r\n#define INCLUDE_CMD_FDDEBUG\r\n#endif\r\n/*\r\n   comando que no tem uma definio:\r\n\r\n   exit\r\n   call\r\n   echo\r\n   goto\r\n   for\r\n   if\r\n   shift\r\n\r\n */\r\n\r\n/********\r\n\t***** Desfazer dependencias\r\n\t***** No mude a no ser que mude o fonte apropriado!\r\n\t************/\r\n#if defined(INCLUDE_CMD_PUSHD) || defined(INCLUDE_CMD_POPD)\r\n#define\tINCLUDE_CMD_CDD\r\n#endif\r\n\r\n/* No disponvel com TURBOC++ 1.0 ou posteriores: */\r\n#ifdef __TURBOC__\r\n\r\n#if __TURBOC__ > 0x297\r\n#define _TC_LATER_\r\n#else\r\n#define _TC_EARLY_\r\n#endif\r\n\r\n#endif\r\n\r\n/* Define se seu compilador no tem 'dosdate_t' or 'dostime_t' */\r\n#ifdef _TC_EARLY_\r\n\t/* TC++1 */\r\n#define _NO__DOS_DATE\r\n#define _NO__DOS_TIME\r\n#define _NO_FMEMCHR\r\n#define _NO_FMEMCMP\r\n#endif\r\n\r\n\r\n\t/* definido por MKDIST.BAT */\r\n#ifdef IGNORE_ENHANCED_INPUT\r\n#undef FEATURE_ENHANCED_INPUT\r\n#endif\r\n\r\n#ifndef FEATURE_ENHANCED_INPUT\r\n#undef FEATURE_HISTORY\r\n#undef FEATURE_FILENAME_COMPLETION\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_PUSHD\r\n#define FEATURE_DIRSTACK\r\n#endif\r\n\r\n#if CONTEXT_MAX_SIZE > 65535U - 12\r\n#error \"O tamanho do contexto mximo no pode exeder 65535 - 12 bytes\"\r\n#endif\r\n\r\n#if defined(FEATURE_KERNEL_SWAP_SHELL) && defined(FEATURE_XMS_SWAP)\r\n#error \"FreeCOM no pode suportar ambos o Kernel- e XMS-based swapping simultaneamente\r\n#endif\r\n\r\n/* Externamente definida para compilar com suporte a XMS-Swap */\r\n#if defined(XMS_SWAP)\r\n#undef FEATURE_KERNEL_SWAP_SHELL\r\n#define FEATURE_XMS_SWAP\r\n#endif\r\n\r\n#ifdef __TURBOC__\r\n#if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__)\r\n/* Compilando em modelo de memria larga --> deslisga AVISO:\r\n\t\"Conveso pode perder digitos significantes\"\t*/\r\n#pragma warn -sig\r\n#endif\r\n#endif\r\n\r\n#include \"../include/debug.h\"\r\n"
  },
  {
    "path": "docs/pt_br/config.mak",
    "content": "## Diretrio base do Turbo C++ v1.01\r\nCC_BASE_PATH = D:\\TC101\r\n\r\n## Onde os arquivo SUPPL(suplementares) pre-compilados esto\r\n## Veja DOCS\\SUPPL.TXT para informaes sobre ela\r\nSUPPL_INC_PATH = .\\SUPPL\r\nSUPPL_LIB_PATH = $(SUPPL_INC_PATH)\r\n\r\n## Localizao dos programas\r\nBINPATH = $(CC_BASE_PATH)\\BIN\r\nLIBPATH = $(CC_BASE_PATH)\\LIB\r\nINCLUDEPATH = $(CC_BASE_PATH)\\INCLUDE;$(SUPPL_INC_PATH)\r\n\r\n## Que programas usar\r\nCC = $(BINPATH)\\TCC +$(CFG)\r\nAR = $(BINPATH)\\Tlib\r\nLD = $(BINPATH)\\Tlink\r\nNASM = nasm.exe\r\n\r\n## Adicione -DDEBUG=1 a seguir para ativar o suporte a depurao para arquivos assembly\r\nNASMFLAGS =\r\n## Adicione -DDEBUG=1 a seguir para ativar o suporte a depurao para arquivos C\r\n## Adicione -DNDEBUG=1 a seguir para desativar qualquer suporte a depurao\r\nCFLAGS =\r\n\r\n## Modelo de memoria do FreeCOM\r\nSHELL_MMODEL=s\r\n\r\n!if $(XMS_SWAP)\r\n__XMS_SWAP = -DXMS_SWAP=1\r\n!endif\r\n\r\n# Configurao padro\r\n# adicionado strings.h aqui por que $(CFG) j est incluido em tudo\r\n## Adicione -D_NO__DOS_DATE se seu compilador no tem o dosdate_t (*)\r\n## Adicione -D_NO__DOS_TIME se seu compilador no tem o dostime_t (*)\r\n## Adicione -D_NO_FMEMCHR se seu compilador no tem o _fmemchr() (*)\r\n## Adicione -D_NO_FMEMCMP se seu compilador no tem o _fmemcmp() (*)\r\n##\r\n## (*) Nota: Deve ser detectado pelo CONFIG.H automaticamente pelo Turbo C\r\n##     e compiladores Borland C.\r\n##\r\n$(CFG): $(CFG_DEPENDENCIES)\r\n  copy &&|\r\n-1-\r\n-a\r\n-f-\r\n-ff-\r\n-K\r\n-w+\r\n-O\r\n-Z\r\n-b-\r\n-I$(INCLUDEPATH)\r\n-L$(LIBPATH)\r\n-m$(SHELL_MMODEL)\r\n-DNDEBUG\r\n-UDEBUG\r\n$(__XMS_SWAP)\r\n| $(CFG)\r\n\r\n\r\n#-k-\r\n\r\n#\t\t*Regras Implicitas*\r\n.c.exe:\r\n  $(CC) $< \r\n.c.obj:\r\n  $(CC) -c {$< }\r\n.asm.obj:\r\n\t$(NASM) $(NASMFLAGS) -f obj -DMODEL=$(SHELL_MMODEL) $<\r\n"
  },
  {
    "path": "docs/pt_br/download.txt",
    "content": "Voc pode fazer o download de variantes pre-compiladas do FreeCOM de:\r\n\r\nhttps://github.com/FDOS/freecom\r\n\r\noutros lugares para o download so mostrados em:\r\n\r\nbinary.zip: o ltimo FreeCOM, apenas Binrios\r\n\r\nplainedt.zip: o ltimo FreeCOM sem os melhoramentos de edio de linha\r\n\tde comando (histria, arquivo de reclamaes)\r\n\r\ndebug.zip: o ltimo FreeCOM com informaes de debug ativadas\r\n\r\nlocalize.zip: Pacote para desenvolvedores para linguagens (para criar um novo ou\r\n\talterar arquivo *.LNG existentes), incluie o ltimo FreeCOM\r\n"
  },
  {
    "path": "docs/pt_br/file_id.diz",
    "content": "Este  interpretados de comandos do FreeDOS(command.com).\r\n\r\nPara saber informaes sobre a ltima verso visite:\r\nhttp://wiki.freedos.org/wiki/index.php/FreeCOM\r\n\r\nVeja LICENSE para informaes sobre licensa."
  },
  {
    "path": "docs/pt_br/readme",
    "content": "Cdigo fonte para distribuio do FreeCOM - um programa de interface de linha\r\nde comando, que substitue o COMMAND.COM\r\n\r\nOs fontes esto em:\r\nhttp://sourceforge.net/project/?group_id=5109\r\n\r\n\r\nCHANGED\t\tMudanas desde a ltima verso oficial\r\nDOCS\\COMPILE.TXT\tComo compilar o FreeCOM\r\n"
  },
  {
    "path": "docs/ptchldrv.txt",
    "content": "Start logging feature 2000/01/05 ska\r\n\r\nThis feature logs, if compiled in, the command line into a file,\r\nwhenever FreeCom is started. This feature shall help to identify\r\ncalling problems with by default invalid command lines, but supported\r\n(or ignored) by other COMMAND.COM's.\r\n\r\nThe logfile can be used for other logging purposes later, too.\r\n\r\nThe logfile is specified as an hard-coded fully-qualified filename\r\nwithin CONFIG.H, see the macro LOG_FILE. This is necessary that all\r\nentries are collected into the same file and at various times some\r\nlog entries will be written the actual location of FreeCom.COM itself\r\nis not known. Therefore the path of the logfile cannot be derived from\r\nthe location of the executable.\r\n\r\nIn order to change the drive the logfile is created on without the\r\nneed to re-compile FreeCom, the utility PTCHLDRV (== PaTCH Logging\r\nDRiVe) is provided. To view the current drive just run \"PTCHLDRV\";\r\nto change the drive specify it on command line, e.g.: \"PTCHLDRV A\".\r\n\r\n"
  },
  {
    "path": "docs/resource.txt",
    "content": "Description of layout of COMMAND.COM image\r\n\t-- 2000/07/11 ska\r\n\r\n\r\nGeneral layout:\r\n+ start of file at file offset 0\r\n+ COMMAND.EXE : This is the product of the actual MAKE run or\r\n\thowever the FreeCOM executable was generated.\r\n\tUsually this is in EXE format\r\n+ some compiler/linker depend stuff, e.g. debug information\r\n+ any number of modularized resources (see below)\r\n+ end of file at topmost offset\r\n\r\nResources:\r\nTil now only one type of resource was known to FreeCOM, though, due to\r\nthe introduction of the external Critical Error handler a second one\r\nshowed up. Therefore it was time to re-organize the way resources are\r\nattached to FreeCOM.\r\n\r\nPurpose of resources:\r\nResources are information of any kind not included into the program\r\nimage of FreeCOM. In order to access them they must be manually handled\r\nby FreeCOM.\r\nExamples:\r\n+ Strings (already known since some releases) [data],\r\n+ Critical Error handler [mixture of data and code].\r\n\r\nProblems to cope with:\r\n+ FreeCOM should come as a single physically file, that means that all\r\ninformation must be \"archived\" together one way or another, but the\r\nresult must be an executable file, which invokes a new copy of the\r\ncommand line interface by default.\r\n+ The more complex the make process is the more problems will show up\r\nand the more possible contributers will be intimidated.\r\n\r\nTherefore the resources shall be as free-standing as possible and\r\neasily archived together, but still easily accessable from with\r\nFreeCOM.\r\n\r\nDesign of resources:\r\nEach resource contructs its own block of data in this format:\r\n+ lowest file offset\r\n+ data of resource\t\t\t[unlimited]\r\n+ size of \"data\" portion\t[4 bytes]\r\n+ major resource ID\t\t\t[2 bytes]\r\n+ minor resource ID\t\t\t[2 bytes]\r\n+ cookie\t\t\t\t\t[8 bytes]\r\n+ highest file offset\r\n\r\nThe latter 4 entries form the control area of the resource indicating:\r\n+ how much data is included with this resource;\r\n+ what type of resource it is via the resource ID, however, only the\r\nmajor resource ID is considered by the general resource locator, the\r\nminor ID is reserved for use by the loader specialized for the\r\nparticular resource only; and\r\n+ the cookie provides a validation mechanism like the magic number\r\nsystem. This cookie is the same for all resources throughout FreeCOM\r\nand all control areas with a valid cookies are considered valid themselves.\r\n\r\nTo place the control area at the end of the resource has one fundamental\r\ndisadvantage and one fundamental advantage:\r\ncon: It is less efficient than placing it in front of the data, because\r\nfiles are read sequentially from beginning to the end most efficiently.\r\npro: Those resources can be created individually into individual files.\r\nTo create the desired \"archive\" the only thing to do is to append\r\none by another to FreeCOM's executable.\r\n\r\nNow the process to locate the resource from inside FreeCOM arises:\r\nIf the control area would be located at the beginning of the resource,\r\nthere is no fixed way to seek to it, but because the controls are\r\nlocated behind the data at the end and because resources are appended\r\nto the executable, the control area of the last resources resides at\r\nthe end of the file.\r\n\r\nThis place is easy to seek to.\r\n\r\nAnd because the control area knows the length of the data of the\r\ncurrent resource, it can seek before to the preceeding resource,\r\nif any.\r\n\r\nIn opposite, to locate a control area at the beginning would require\r\nsome algorithm to find the first resource located _somewhere_within_\r\nthe file. The current implementation used some fields of the EXE header\r\ndescribing how much code/data the executable allocates. Unfortunately\r\n.COM files do not include this information and some compilers may\r\nappend own information there, e.g. debug information.\r\nOne would need sort of management program that keeps track of\r\nwhere the first resource is located within the executable and writes\r\nthis information at a well-known location, e.g. at the end of the file.\r\nThe message library MSGLIB includes such program, but although\r\nit is nearly required there, it adds a remarkable step to the complexity\r\nof the process to create a final program file.\r\n\r\nAssignments:\r\nCookie: \"FREECOM \"\r\n\r\nMajor resource IDs (hexadecimal):\r\n00: Strings\r\n01: Critial Error handler\r\n\r\nMinor resource IDs (hexadecimal):\r\n00:**: none particular, used for version control\r\n01:00: code of the Critical Error handler\r\n01:01: strings used by the handler\r\n01:02: already merged code and strings of the handler as one resource\r\n01:10: code of the \"autofail\" variant of the handler\r\n01:11: strings used by the \"autofail\" handler\r\n01:12: already merged code and strings of the \"autofail\" handler\r\n"
  },
  {
    "path": "docs/todo.txt",
    "content": "Things to do\r\n~~~~~~~~~~~~\r\n\r\n(#) is the suggested priority, the lower the more urgent.\r\n\r\n\r\n\r\n(0) Fix bugs :)\r\n\r\n(2) Ensure the documentation matches current implementation.\r\n\r\n(3) Optimize the code!  For size and speed.  There are numerous places\r\nwhere the code is hardly optimal for either.\r\n\r\n(1) Swap out when exec'ing? YES! Unless running from a floppy?\r\n\r\n(1) Add wildcard support to REN.\r\n\r\n(4) Add support for Win95 long filenames.\r\n\r\n(1) Make the permanent command.com (/p) store the messages in memory\r\n(this is already implemented) and have some way for other instances\r\nof command.com to use these same messages in memory.  Maybe the\r\nMultiplexer interrupt (2Fh)?  Does command.com have a MSDOS reserved\r\nmux handler number?\r\n\r\n(1) Critical Error handler: Conditions and rules must be defined\r\nin which cases what action has to be done in order to prevent\r\naccidently kill FreeCOM on INT-24. Some recover mechanism must be\r\nimplemented in hopeless situations, where the normal processing\r\ncan not proceed.\r\n\r\n(2) Use all information available through DOS NLS API in all places\r\nthey apply to.\r\n\r\n"
  },
  {
    "path": "docs/upload.txt",
    "content": "(this file is now obsolete, please submit changes as patches to FreeDOS mailing list or as Pull Request via GitHub)\r\n\r\nHow to contribute to the FreeCOM project\r\n\t-- 2000/12/10 Steffen Kaiser (ska)\r\n\r\n0. General\r\n1. Patches\r\n2. Addresses\r\n\r\n===\r\n\r\n0. General\r\n\r\nThe maintainer(s) of FreeCOM can be reached by:\r\na) E-Mail: freecom@freedos.org,\r\nb) mailling list: freedos-freecom@lists.sourceforge.net, and\r\nc) bug report form: http://www.freedos.org/bugs.\r\n\r\nBug reports should be entered into the bug tracking database using the\r\nbug report form, though, on urgency it might be a good idea to post to\r\nthe mailling list as well.\r\n\r\nAny comments regarding implementation details, questions etc. should be\r\ndirected to the mailling list.\r\n\r\nPatches should NOT be send to the mailling list, but to the maintainer,\r\nsee section \"Patches\".\r\n\r\n===\r\n\r\n1. Patches\r\n\r\nSmaller patches, say smaller than 30KB in compressed form, may be sent\r\nto the maintainer by E-Mail. For larger patches please request a FTP\r\naccess, where to upload the patch to, or put the patch onto a WWW or FTP\r\nspace and mail the location to the maintainer.\r\n\r\nMost often you can make the patches remarkable smaller by using the\r\n\"diff\" utility; a GNU port is to be found on every SimTel(.Net)\r\nmirror out there.\r\nJust run this command **):\r\n\tdiff -dsbBU 5 old_file new_file >patch\r\n-or-\r\n\tdiff -dsbBNrU 5 old_freecom_dir new_freecom_dir >patch\r\n\r\nThe file \"patch\" will contain the \"patch\".\r\n\r\nIn the second form (diff'ing the complete file tree) if you added some\r\nnew files, you don't want to submit within your patch, you could revise\r\nthe patch file and delete any such entries or pass the option \"-X\r\nignore\" to \"diff\" and create the file \"ignore\" with one file to be\r\nignored per line, they may contain wildcards.\r\n\r\nPlease add an info file describing the patch with a few words. Doing so\r\nwill make the life easier for the maintainer, if the mail and the file\r\ngets separated.\r\n\r\nThen compress the file, e.g. using Info-Zip:\r\n\tzip -9 patch.zip patch info.txt\r\n\r\nOnce the patch has been incorporated into FreeCOM your name and the\r\ndescription of the patch will be added to the DOCS\\HISTORY.TXT file.\r\n\r\n**) The meaning of the options used:\r\n-d\tChange the algorithm to perhaps find a smaller set of changes. This\r\n\tmakes diff slower (sometimes much slower).\r\n-s\tReport when two files are the same.\r\n-b\tIgnore changes in amount of white space.\r\n-B\tIgnore changes that just insert or delete blank lines.\r\n-N\tIn directory comparison, if a file is found in only one directory,\r\n\ttreat it as present but empty in the other directory.\r\n-r\tWhen comparing directories, recursively compare any subdirectories\r\n\tfound.\r\n-U 5\tUse the unified output format, showing lines (an integer) lines of\r\n\tcontext, or three if lines is not given. For proper operation, patch\r\n\ttypically needs at least two lines of context.\r\n\r\n===\r\n\r\n2. Addresses\r\n\r\nMaintainer of FreeCOM: freecom@freedos.org\r\n"
  },
  {
    "path": "docs/vspawn.txt",
    "content": "Swap Support #2\r\n\t-- 2001/04/01 ska\r\n\r\nThis style of swapping is incompatible with XMS-Only swapping!\r\n\r\nThis swapping is derived from KSSF (see k-swap.txt), but instead of\r\nlet the user decide what shell to execute, this swap faker uses a fixed\r\nfilename.\r\n\r\nUseage:\tVSPAWN [{ argument }]\r\n\r\nVSpawn creates the filename of the shell to execute itself by replacing\r\nits own file extension by .SWP. All the arguments are passed to the\r\ninvoked shell unchanged.\r\n\r\nMost useful installation:\r\n\r\nMake COMMAND.COM and TOOLS\\VPSAWN.COM by running BUILD.BAT.\r\n\r\nRename COMMAND.COM into COMMAND.SWP.\r\n\r\nMove TOOLS\\VPSAWN.COM to COMMAND.COM.\r\n\r\nRun COMMAND.COM.\r\nVSpawn automatically invokes COMMAND.SWP;\r\nCOMMAND.SWP determines that it has been invoked using the VSpawn\r\nfeature and will maintain %COMSPEC%==*.COM, but will use *.SWP as\r\nresource file.\r\n\r\nBecause the COMSPEC variable contains the *.COM filename, which is the\r\nVSpawn wrapper, all subsequent invocations of a secondary shell will\r\nuse the VSpawn wrapper as well.\r\n\r\n===\r\n\r\nIf FreeCOM detects the VSpawn feature beeing used, it defaults to\r\nswap when executing external commands.\r\nThis can be suppressed by invoking external commands by:\r\nCALL /N prg\r\nor passing the option /SWAP to FreeCOM.\r\n\r\nIf auto-swap is not active, /SWAP enables it.\r\n"
  },
  {
    "path": "err_fcts.h",
    "content": "void error_env(int base, int err_no, const char * const var);\r\nvoid error_invalid_switch(char c);\r\nvoid error_invalid_lswitch(const char * const str);\r\nvoid error_too_many_parameters(const char * const s);\r\nvoid error_path_not_found(void);\r\nvoid error_file_not_found(void);\r\nvoid error_sfile_not_found(const char * const f);\r\nvoid error_req_param_missing(void);\r\nvoid error_bad_command(const char * const f);\r\nvoid error_no_pipe(void);\r\nvoid error_out_of_memory(void);\r\nvoid error_syntax(const char * const s);\r\nvoid error_nothin_to_do(void);\r\nvoid error_selfcopy(const char * const s);\r\nvoid error_long_batchline(const char * const fnam, long linenr);\r\nvoid error_bfile_vanished(const char * const fnam);\r\nvoid error_bfile_no_such_label(const char * const fnam, const char * const label);\r\nvoid error_invalid_time(void);\r\nvoid error_env_var(const char * const var);\r\nvoid error_env_var_not_found(const char * const var);\r\nvoid error_filename_too_long(const char * const fname);\r\nvoid error_command_too_long(void);\r\nvoid error_line_too_long(void);\r\nvoid error_tempfile(void);\r\nvoid error_close_quote(int quote);\r\nvoid error_illformed_option(const char * const s);\r\nvoid error_opt_arg(const char * const  str);\r\nvoid error_opt_noarg(const char * const  str);\r\nvoid error_leading_plus(void);\r\nvoid error_trailing_plus(void);\r\nvoid error_open_file(const char * const fnam);\r\nvoid error_read_file(const char * const fnam);\r\nvoid error_write_file(const char * const fnam);\r\nvoid error_write_file_disc_full(const char * const fnam, const unsigned long size);\r\nvoid error_copy(void);\r\nvoid error_nothing_to_do(void);\r\nvoid error_invalid_number(const char * const s);\r\nvoid error_init_fully_qualified(const char * const s);\r\nvoid error_corrupt_command_line(void);\r\nvoid error_quoted_c_k(void);\r\nvoid error_ctty_excluded(void);\r\nvoid error_l_notimplemented(void);\r\nvoid error_u_notimplemented(void);\r\nvoid error_restore_session(void);\r\nvoid error_save_session(void);\r\nvoid error_no_rw_device(const char * const devname);\r\nvoid error_ctty_dup(const char * const devname);\r\nvoid error_no_cwd(int drive);\r\nvoid error_kswap_alias_size(void);\r\nvoid error_kswap_allocmem(void);\r\nvoid error_if_exist(void);\r\nvoid error_if_errorlevel(void);\r\nvoid error_if_errorlevel_number(void);\r\nvoid error_if_command(void);\r\nvoid error_alias_out_of_memory(void);\r\nvoid error_alias_insert(void);\r\nvoid error_alias_no_such(const char * const name);\r\nvoid error_loading_context(void);\r\nvoid error_dirfct_failed(const char * const fctname, const char * const dirname);\r\nvoid error_no_alias_name(const char name[]);\r\nvoid error_history_size(const char s[]);\r\nvoid error_context_out_of_memory(void);\r\nvoid error_no_context_after_swap(void);\r\nvoid error_out_of_dos_memory(void);\r\nvoid error_context_length(unsigned long islen, unsigned maxlen);\r\nvoid error_context_add_status(void);\r\nvoid error_empty_redirection(void);\r\nvoid error_redirect_from_file(const char * const fnam);\r\nvoid error_redirect_to_file(const char * const fnam);\r\nvoid error_bad_mcb_chain(void);\r\nvoid error_unknown(int err);\r\nvoid error_invalid_drive(int drive);\r\nvoid error_no_env(void);\r\nvoid error_on_off(void);\r\nvoid error_invalid_date(void);\r\nvoid error_for_bad_var(void);\r\nvoid error_for_in(void);\r\nvoid error_for_parens(void);\r\nvoid error_for_do(void);\r\nvoid error_for_no_command(void);\r\nvoid error_goto_label(void);\r\nvoid error_get_codepage(void);\r\nvoid error_set_codepage(void);\r\nvoid error_copy_plus_destination(void);\r\nvoid error_invalid_parameter(const char * const str);\r\nvoid error_fcom_is_device(const char * const fnam);\r\nvoid error_fcom_invalid(const char * const fnam);\r\nvoid error_exe_corrupt(void);\r\n"
  },
  {
    "path": "include/batch.h",
    "content": "/* A structure to preserve the context of a batch file */\r\n\r\n/*  Added:\r\n   bfnam -- name of batchfile for modifyable scripts if bfile == NULL\r\n   bpos -- position within batchfile, if bfile == NULL\r\n   blinecnt  -- line counter\r\n   bclose -- close file if it was opened temporarily\r\n   brewind -- rewind file instead of positioning to bpos\r\n   blabel -- to search for if != NULL\r\n*/\r\n\r\n#include <stdio.h>\r\n#include <suppl.h>\r\n\r\n#define __LFNFUNCS_C\r\n#include \"../include/lfnfuncs.h\"\r\n\r\nstruct bcontext\r\n{\r\n  struct bcontext *prev;\r\n  int bfile;\r\n  char *bfnam;                  /* abs filename of batchfile */\r\n  char *bfirst;                 /* name of batchfile as typed on cmd line */\r\n  char *forproto;\t\t\t\t/* command to execute */\r\n  char *forvar;\t\t\t\t\t/* current FOR variable */\r\n  char **params;\t\t\t\t/* FOR/batch parameter list */\r\n  char *blabel;                 /* label to search for */\r\n#ifdef FEATURE_LONG_FILENAMES\r\n  struct lfnffblk *ffind;\r\n#else\r\n  struct ffblk *ffind;\t\t\t/* already started FOR wildcard expand loop */\r\n#endif\r\n  long bpos;                    /* position within file if bfile == NULL */\r\n  long blinecnt;                /* line counter */\r\n  int shiftlevel;\t\t\t\t/* number of skipped arguments */\r\n  int echo;                     /* Preserve echo flag across batch calls */\r\n  int bclose;\t\t\t\t\t/* close batch file on exit */\r\n  int brewind;\t\t\t\t\t/* rewind batch file next time */\r\n  int numParams;\t\t\t\t/* number of parameters */\r\n  int forFlags; \t\t\t\t/* optional flags to FOR command */\r\n};\r\n\r\n/*  The stack of current batch contexts.\r\n * NULL when no batch is active\r\n */\r\nextern struct bcontext *bc;\r\n\r\nvoid exit_batch(void);\r\nvoid exit_all_batch(void);\r\n\r\nextern int setBatchParams(char *s);\r\n\r\nextern struct bcontext *newBatchContext(void);\r\n/* static void initBatchContext(struct bcontext *b); */\r\nextern struct bcontext *activeBatchContext(void);\r\nchar *find_arg_bc(struct bcontext const * const b, int n);\r\n\r\n#define\tfind_arg(num)\tfind_arg_bc(activeBatchContext(), (num))\r\n#define getArgCur(num)\tfind_arg_bc(bc, (num))\r\n\r\n/* flags used by FOR */\r\n/* #define FLAG_HACKERY_FOR 1 */\r\n#define FLAG_OPT_DIRECTORY 2\r\n#define FLAG_OPT_FILEPARSE 4\r\n#define FLAG_OPT_RECURSE   8\r\n"
  },
  {
    "path": "include/cmdline.h",
    "content": "/*\r\n  Declaration for the command line parsing interface\r\n */\r\n\r\n#ifndef __CMDLINE_H\r\n#define __CMDLINE_H\r\n\r\n/* What quotes COMMAND shell honor (only paired quotes) */\r\n/* Note: at least the double quotes MUST be included */\r\n/* #define QUOTE_STR \"\\\"'`\" others are valid filename chars */\r\n#define QUOTE_STR \"\\\"\"\r\n\r\n/* What characters COMMAND shall delimit arguments and\r\n  options, useable w/in if() */\r\n/* Note: Do not include the option character */\r\n/* Also note: Do not include ',' or ';' within isoptdelim() */\r\n#define isargdelim(ch) (isspace(ch) || iscntrl(ch) || strchr(\",;=\", ch))\r\n#define isoptdelim(ch) (isspace(ch) || iscntrl(ch))\r\n\r\n/* What option character COMMAND shell honor, used within arguments too */\r\n#ifdef FEATURE_SWITCHAR\r\n#define isoptch(ch) (ch == switchar())\r\n#else\r\n#define isoptch(ch) (ch == '/')\r\n#endif\r\n\r\n/* Test if an argument is an option */\r\n#define isoption(string)  isoptch(*(string))\r\n\r\n/* String ID of helpscreen of current internal command */\r\nextern unsigned currCmdHelpScreen;\r\n\r\n/* Trimming command line (arguments) basing on isargdelim() */\r\nchar *trimcl(char *str);\r\nchar *ltrimcl(const char *str);\r\nvoid rtrimcl(char * const str);\r\n\r\nchar switchar(void);\r\n\r\n/*\r\n * Callback function invoked when an option is scanned\r\n *\r\n *  optstr := long option string\r\n *  ch := single character option (upcased) or 0 if none\r\n *  bool := -1: '-' found; +1: '+' found; 0: neither\r\n *  strarg := NULL: no argument; else: pointer to option argument\r\n *    This string must be duplicated, because it will be removed as\r\n *    soon as the function returns.\r\n *\r\n *  Return:\r\n *    0 (E_None): OK\r\n *    else: some kind of error; error message already displayed\r\n *\r\n *  Note: BC5 with optimization enabled glues sequences like:\r\n *  switch(ch) {\r\n *  case 'A': return optScanBool(ch, bool, arg, &optA);\r\n *  case 'B': return optScanBool(ch, bool, arg, &optB);\r\n *    ...\r\n *  together. The generated code looks like:\r\n *  case 'A': push &optA\r\n *        goto callFct\r\n *  case 'B': push &optB\r\n *  callFct:  push arg\r\n *        push bool\r\n *        push ch\r\n *        call optScanBool\r\n *        add sp, 8\r\n *  One could say that no manual optimization is needed, couldn't one?\r\n */\r\ntypedef int (* const optScanner)(const char * const optstr, int ch, int bool, const char *strarg, void * const arg);\r\n\r\n\r\n/*\r\n *  Define a callback function\r\n */\r\n#define optScanFct(name)    \\\r\n  static int name (const char * const optstr, int ch, int bool, const char *strarg, void * const arg)\r\n\r\n/*\r\n *  Print error message \"Invalid option\"\r\n */\r\n#define optErr()  error_invalid_lswitch(optstr)\r\n\r\n/*\r\n *  Check if a longname option matches, the argument must be in\r\n *  uppercase!\r\n */\r\n#define optLong(str)  (strcmpi(optstr, (str)) == 0)\r\n\r\n\r\nchar *skipqword(char *str, const char * const stop);\r\n\r\n/* Use matchtok() to compare string constants */\r\n#define match(line,word,len) match_(&(line), (word), (len))\r\n#define matchtok(line,word) match_(&(line), word, sizeof(word) - 1)\r\nint match_(char ** const p, const char * const word, int len);\r\n\r\nchar *skip_word(char *line);\r\nchar *skipdm(char *line);\r\n\r\nchar *unquote(const char *str, const char * const strend);\r\nchar **split(char *line, int *args);\r\nvoid freep(char **p);\r\n\r\n/* int isoption(char *str)  Return: 0: if str is no option */\r\nint optScanString_(const char * const optstr, int bool, const char *arg, char **value);\r\nint optScanBool_(const char * const optstr, int bool, const char *arg, int *value, int flip);\r\nint optScanInteger_(const char * const optstr, int bool, const char *arg, unsigned int *value);\r\n#define optHasArg()\t(strarg != 0)\r\n\r\n#define optScanString(var)    \\\r\n  optScanString_(optstr, bool, strarg, &(var))\r\n#define optScanBool(var)    \\\r\n  optScanBool_(optstr, bool, strarg, &(var), 1)\r\n#define optScanBool2(var)    \\\r\n  optScanBool_(optstr, bool, strarg, &(var), 0)\r\n#define optScanInteger(var)   \\\r\n  optScanInteger_(optstr, bool, strarg, &(var))\r\n\r\nint scanOption(optScanner fct, void * const ag, char *rest);\r\nint leadOptions(char **line, optScanner fct, void * const arg);\r\nchar **scanCmdline(char *line, optScanner fct, void * const arg, int *argc, int *opts);\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/command.h",
    "content": "/* COMMAND.H\r\n * header file for the modules in COMMAND.COM\r\n */\r\n\r\n#ifndef FREECOM_COMMAND_H\r\n#define FREECOM_COMMAND_H\r\n\r\n#define MAX_INTERNAL_COMMAND_SIZE 256\r\n\r\n#ifndef MKINFRES\r\n#include <dos.h>\r\n#include <stdio.h>\r\n#include <portable.h>\r\n#include <fmemory.h>\r\n#include \"../include/misc.h\"\r\n\r\n#define LONG_CMDLINE_ENV_NAME \"CMDLINE\"\r\n#define MAX_EXTERNAL_COMMAND_SIZE 126\r\n\t/* The maximal external command line is:\r\n\t\t  128: overall space for the command line)\r\n\t\t- 1: Pascal string length byte\r\n\t\t- 1: '\\r' (at the end)\r\n\t\t= 126\r\n\t\tNote: prior versions of FreeCOM also had a '\\0' after the '\\r', \r\n\t\tbut per RBIL & other documents, the command line is only terminated by a '\\r' (0Dh value)\r\n\t*/\r\n\r\nenum InternalErrorCodes {\r\n\tE_None = 0,\r\n\tE_Useage = 1,\r\n\tE_Other = 2,\r\n\tE_CBreak = 3,\r\n\tE_NoMem,\r\n\tE_CorruptMemory,\r\n\tE_NoOption,\r\n\tE_Exit,\r\n\tE_Ignore,\t\t\t/* Error that can be ignored */\r\n\tE_Empty,\r\n\tE_Syntax,\r\n\tE_Range,\t\t\t\t/* Numbers out of range */\r\n\tE_NoItems,\r\n\tE_Help,\t\t/* Help screen */\r\n\tE_User\t\t/* MUST be the last one */\r\n};\r\n\r\n#define PROMPTVAR \"PROMPT\"\r\n#define PATHVAR \"PATH\"\r\n\r\n#define EnvSeg (*(unsigned far*)MK_FP(_psp, 0x2c))\r\n#define OwnerPSP (*(unsigned far *)MK_FP(_psp, 0x16))\r\n\r\nextern const char shellver[];\r\nextern const char shellname[];\r\n\r\n#ifndef FA_NORMAL\r\n#define FA_NORMAL 0\r\n#endif\r\n\r\n/* Useage:\r\n\tFALSE: no, false etc.\r\n\tTRUE: yes, OK, etc.\r\n\tERROR: only used in tri-state flags, in binary flags same as TRUE\r\n*/\r\nenum\r\n{\r\n  FALSE, TRUE, ERROR\r\n};\r\n\r\n/* prototypes for INIT.C */\r\nextern void ASMINTERRUPT dummy_criter_handler();\r\nextern void ASMINTERRUPT cbreak_handler();\r\nextern void far cdecl terminateFreeCOMHook(void);\r\nextern void far * far termAddr;\r\nextern word far myPID;\r\nextern word far origPPID;\r\n/* extern void initCBreak(void);*/\r\n\r\n/* prototypes for COMMAND.C */\r\nextern int interactive_command;\r\nextern int persistentMSGs;\r\nextern int far CBreakCounter;\r\n#define ctrlBreak CBreakCounter\r\n/* extern int ctrlBreak;*/\r\nextern int exitflag;\r\nextern unsigned int echo;       /* The echo flag */\r\nextern int tracemode;                   /* debug script? */\r\nextern int autofail;\r\n#ifdef FEATURE_XMS_SWAP\r\nextern byte far canexit;\r\n#else\r\nextern int canexit;\r\n#endif\r\nextern int inInit;\r\nextern int errorlevel;\r\nextern int isSwapFile;\r\nextern int forceLow;\r\nextern unsigned far *maxx;\r\nextern unsigned char far *maxy;\r\nextern char *ComPath;            /* absolute filename of COMMAND shell */\r\nextern int oldinfd, oldoutfd;\r\n\r\nvoid fatal_error(char *);\r\nint is_delim(int);\r\nvoid command(char *);\r\nvoid parsecommandline(char *, int);\r\nint initialize(void);\r\nvoid short_version(void);\r\nint process_input(int xflg, char *cmdline);\r\n/* void perform_exec_result(int rc); */\r\nint expandEnvVars(char *ip, char * const line);\r\n\r\n/* prototypes for INTERNAL.C */\r\nint cmd_break(char *);\r\nint cmd_chdir(char *);\r\nint cmd_chcp(char *);\r\nint cmd_cdd(char *);\r\nint cmd_cls(char *);\r\nint cmd_copy(char *);\r\nint cmd_ctty(char *);\r\nint cmd_date(char *);\r\nint cmd_del(char *);\r\nint cmd_dir(char *);\r\nint cmd_doskey(char *);\r\nint cmd_fddebug(char *);\r\nint cmd_history(char *);\r\nint cmd_lfnfor(char *);\r\nint cmd_loadfix(char *);\r\nint cmd_loadhigh(char *);\r\nint cmd_memory(char *);\r\nint cmd_mkdir(char *);\r\nint cmd_path(char *);\r\nint cmd_prompt(char *);\r\nint cmd_rem(char *);\r\nint cmd_rename(char *);\r\nint cmd_rmdir(char *);\r\nint cmd_set(char *);\r\nint cmd_time(char *);\r\nint cmd_truename(char *);\r\nint cmd_type(char *);\r\nint cmd_ver(char *);\r\nint cmd_verify(char *);\r\nint cmd_vol(char *);\r\nint internal_exit(char *);\r\nint force_exit(char *);\r\nint cmd_pushd(char *);          /*DLP 06/01/2000 */\r\nint cmd_popd(char *);           /*DLP 06/01/2000 */\r\nint cmd_dirs(char *);           /*DLP 06/01/2000 */\r\nint cmd_which(char *);\r\nvoid history(int, char *);      /* prototype for the command-line history */\r\nvoid complete_filename(char *str, unsigned charcount);\r\nint show_completion_matches(char *str, unsigned charcount);\r\n\r\n\r\n/* prototypes from PROMPT.C */\r\nvoid printprompt(void);\r\n\r\n/* prototypes for ALIAS.C */\r\nvoid aliasexpand(char *, int);\r\nint aliasswapout(void);\r\nint aliasswapin(void);\r\nint cmd_alias(char *);\r\n\r\n#define D_ON         \"on\"\r\n#define D_OFF        \"off\"\r\n\r\n/* Flags used in CMDTABLE */\r\n\r\n/* CMD_SPECIAL_* modify the default behaviour, which delimiters are\r\n\tignored and which are passed into the internal command.\r\n\tALL --> everything is passed into the cmd [ECHO only]\r\n\tDIR --> passed: \"\\\\/\", ignored: \",;=\"\r\n\twithout --> passed: \"/\", ignored: \",;=\"\r\n*/\r\n#define CMD_SPECIAL_ALL 1\t\t/* pass unmodified line into cmd */\r\n#define CMD_SPECIAL_DIR\t2\t\t/* pass directory specific chars into cmd */\r\n#define CMD_BATCHONLY   4\r\n#define CMD_NO_ERRORLEVEL 8     /* command should not set errorlevel */\r\n\r\nstruct CMD\r\n{\r\n  char *name;\r\n  int flags;\r\n  int (*func) (char *);\r\n  unsigned help_id;\r\n};\r\nextern struct CMD internalCommands[];\r\n\r\n/* New procs in BATCH.C */\r\n\r\nchar *readbatchline(int *, char *, int);\r\n/* char *find_arg(int); */\r\n\r\n/* The MSDOS Batch Commands [MS-DOS 5.0 User's Guide and Reference p359] */\r\nint cmd_call(char *);\r\nint cmd_echo(char *);\r\nint cmd_for(char *);\r\nint cmd_for_hackery(char *);\r\nint cmd_goto(char *);\r\nint cmd_if(char *);\r\nint cmd_pause(char *);\r\nint cmd_shift(char *);\r\n\r\nint cmd_beep(char *);\r\n\r\nint get_redirection(char *, char **, char **, int *);\r\n\r\nint batch(char *, char *, char *);\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/context.h",
    "content": "/* $id$\r\n\r\n\tContext declarations\r\n\r\n*/\r\n\r\n#ifndef CONTEXT__H_\r\n#define CONTEXT__H_\r\n\r\n#include <portable.h>\r\n\r\n#define MAX_FNAME\t89\t\t/* max size of string for one filename */\r\n\r\ntypedef word ctxt_t;\t\t/* general context type <-> segment */\r\n#define CTXT_INVALID ((ctxt_t)0)\r\n\r\nextern ctxt_t ctxt;\t\t\t/* currently there is just one context\r\n\t\t\t\t\t\t\t\t-> so-called dynamic context\r\n\t\t\t\t\t\t\t\t-> all data is located in there */\r\n/* Major IDs of context tags */\r\ntypedef enum {\r\n\tCTXT_TAG_ERROR = 0\r\n\r\n\t\t/* with size restriction */\r\n#define CTXT_FIRST_TAG CTXT_TAG_HISTORY\r\n\t,CTXT_TAG_HISTORY = 2\r\n\t,CTXT_TAG_DIRSTACK\r\n\t,CTXT_TAG_BATCH\r\n\t,CTXT_TAG_LASTDIR\r\n\t,CTXT_TAG_SWAPINFO\r\n} Context_Tag;\r\n#define CTXT_LAST_TAG CTXT_TAG_SWAPINFO\r\n\r\n/* Minor IDs of CTXT_TAG_SWAPINFO */\r\nenum {\r\n\tCTXT_SWAPINFO_PRGNAME = 1\r\n\t, CTXT_SWAPINFO_CMDLINE\r\n\t, CTXT_SWAPINFO_SHELLNAME\r\n};\r\n\r\n#define ctxtAlias ctxt\r\n#define ctxtHistory ctxt\r\n#define ctxtBatch ctxt\r\n#define ctxtDirstack ctxt\r\n\r\n#define ctxtEnvironment 0\t\t/* the environment is the default\r\n\t\t\t\t\t\t\t\t\tenvironment segment */\r\n\r\n#define ctxtIsValid()\t(ctxt != CTXT_INVALID)\r\n\r\ntypedef struct {\r\n\tunsigned c_sizemax, c_sizecur;\t/* total size of tag */\r\n\tunsigned c_nummax,  c_nummin;\t/* min/max number assigned */\r\n} ctxt_info_t;\r\n\r\nextern ctxt_info_t ctxt_info[];\r\n#define CTXT_TAG_ALIAS (CTXT_LAST_TAG + 1)\r\n#define CTXT_join(a,b)\ta##b\r\n#define CTXT_INFO_STRUCT(tag)\tctxt_info[(tag) - CTXT_FIRST_TAG]\r\n#define CTXT_INFO(tag,member)\tCTXT_INFO_STRUCT(tag).CTXT_join(c_,member)\r\n\r\n/*\r\n#define alias_maxsize\tCTXT_INFO(CTXT_TAG_ALIAS, sizemax)\r\n#define hist_maxsize\tCTXT_INFO(CTXT_TAG_HISTORY, sizemax)\r\n#define dstack_maxsize\tCTXT_INFO(CTXT_TAG_DIRSTACK, sizemax)\r\n*/\r\n\r\n#define ctxtFromTag(tag)\tctxt\t\t/* all tags in the same context */\r\n#define ctxtIsInfoTag(tag) \t\t\\\r\n\t((tag) >= CTXT_FIRST_TAG && (tag) <= CTXT_TAG_ALIAS)\r\n#define ctxtCheckInfoTag(tag)\tassert(ctxtIsInfoTag(tag))\r\n/* probe if the item tag is of the format: <tag><count>=\r\n\tbecause just <tag>= is not valid as _item_, but may contain\r\n\tstatus information */\r\n#define ctxtProbeItemTag(segm,ofs,tag)\t\t\t\t\t\t\t\\\r\n\t(peekb((segm), (ofs)) == (unsigned char)(Context_Tag)(int)(tag)\t\\\r\n\t\t && peekb((segm), (ofs) + 1) != '=')\r\n#define CTXT_ITEMNAME_LENGTH (sizeof(unsigned) * 2 + 2)\r\n\r\nvoid ctxtCreate(void);\t\t\t/* Create the local context */\r\nvoid ctxtCreateMemBlock(unsigned length);\r\nint ctxtAddStatus(const Context_Tag tag);\r\nint ctxtPop(const Context_Tag, char ** const);\r\nint ctxtPush(const Context_Tag, const char * const);\r\nint ctxtGet(const int, const Context_Tag, const unsigned, char ** const);\r\nint ctxtSet(const Context_Tag, const unsigned, const char * const);\r\nchar far*ctxtAddress(const Context_Tag tag, const unsigned num);\r\nint ctxtClear(const Context_Tag);\r\nint ctxtView(const Context_Tag, const unsigned);\r\nvoid ctxtRenumberItems(const Context_Tag);\r\nvoid ctxtMkItemName(char * const, const Context_Tag, const unsigned num);\r\nint breakVarAssign(ctxt_t context, char * const s, char ** const value);\r\nint chgCtxt(const Context_Tag tag, const char * const, const char * const);\r\nunsigned realNum(const Context_Tag tag, const int num);\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/crossjmp.h",
    "content": "/*\r\n * Allows to longjmp through FreeCOM at abort-type error states.\r\n *\r\n */\r\n\r\n#ifndef FREECOM_CROSSJMP_H\r\n#define FREECOM_CROSSJMP_H\r\n\r\n#include <setjmp.h>\r\n\r\nextern jmp_buf jmp_beginning;\r\n\r\n#define jmp_fatal(err) longjmp(jmp_beginning, (err))\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/cswap.h",
    "content": "/*\r\n\tCSWAP.H\r\n*/\r\n\r\n#ifdef FEATURE_XMS_SWAP\r\n\r\n#ifndef __XMS_SWAP_H\r\n#define __XMS_SWAP_H\r\n\r\n#include \"../include/misc.h\"\r\n\r\n#include \"algnbyte.h\"\r\nstruct ParamDosExec {\r\n\tunsigned short envSeg;\r\n\tvoid far *cmdtail;\r\n\tvoid far *FCB1;\r\n\tvoid far *FCB2;\r\n\tvoid far *overlPtr1;\r\n\tvoid far *overlPtr2;\t\r\n\t};\r\n#include \"algndflt.h\"\r\n\r\nextern char far dosFCB1[128];\t\t\t/* must be setup correctly */\r\nextern char far dosFCB2[128];\t\t\r\n\r\nextern struct ParamDosExec far dosParamDosExec;\r\n\r\nextern unsigned char far dosCMDNAME[128];\r\n/*extern unsigned char far dosCMDTAIL[128];*/\r\n#define dosCMDTAIL  ((char far*)MK_FP(_psp, 0x80))\r\n\r\nextern int cdecl XMSexec(void);\t\r\n\r\n#if defined(__WATCOMC__)\r\ntypedef unsigned long xmsfunc(unsigned request, unsigned dx, void *si);\r\n#pragma aux xmsfunc = __parm [__ax] [__dx] [__si] __modify [__bx __cx]\r\nextern xmsfunc far *far XMSdriverAdress;\r\n#elif defined(__GNUC__)\r\nextern unsigned far *far XMSdriverAdress;\r\nstatic inline unsigned long XMSrequest(unsigned request, unsigned dx, void *si)\r\n{\r\n\tlong ret;\r\n\t/* N.B. the XMS driver may clobber %bx even if the call is successful,\r\n\t   so we need to mark %bx as clobbered.  Also include %cx, the flags,\r\n\t   and main memory in the clobber list, for good measure.\r\n\t\t-- tkchia 2018/08/24 */\r\n\tasm volatile(\"lcall *%%cs:XMSdriverAdress\" :\r\n\t\t     \"=A\"(ret) :\r\n\t\t     \"a\"(request), \"d\"(dx), \"S\"(si), \"Rds\"(FP_SEG(si)) :\r\n\t\t     \"bx\", \"cx\", \"cc\", \"memory\");\r\n\treturn ret;\r\n}\r\n#else\r\nextern unsigned (far *far XMSdriverAdress)(void);\r\nextern void far XMSrequest(void);\r\n#endif\r\n\t\r\nextern unsigned char far SWAPresidentEnd;          /* label: end of resident code */\r\nextern unsigned short SwapResidentSize;\t  /* paras of the swap handler */\t\r\nextern unsigned short far SwapTransientSize;  /* paras of total command */\t\r\n\r\nstruct XMScopy{\r\n        long length;\r\n        short shandle;\r\n        long soffset;\r\n        short dhandle;\r\n        long  doffset;\r\n        } ;\r\n\r\nextern struct XMScopy XMSsave;\r\nextern struct XMScopy far XMSrestore;\r\n\r\n/* Handlers in resident portion for external program execution */\r\nextern void far ASMINTERRUPT lowlevel_cbreak_handler();\r\nextern void far ASMINTERRUPT lowlevel_err_handler();\r\nextern void far ASMINTERRUPT autofail_err_handler();\r\nextern void far ASMINTERRUPT lowlevel_int_2e_handler();\r\n\r\n/* functions */\r\nword XMSswapmessagesIn(loadStatus *status);\r\nvoid XMSinit(void);\r\nint XMSisactive(void);\r\nvoid XMSexit(void);\r\n\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/datefunc.h",
    "content": "/*\r\n\r\n   DateFunc -- DOS Date Functions\r\n   Copyright (C) 1998 Rob Lake\r\n\r\n   This program is free software; you can redistribute it and/or modify\r\n   it under the terms of the GNU General Public License as published by\r\n   the Free Software Foundation; either version 2 of the License, or\r\n   (at your option) any later version.\r\n\r\n   This program is distributed in the hope that it will be useful,\r\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n   GNU General Public License for more details.\r\n\r\n   You should have received a copy of the GNU General Public License\r\n   along with this program; if not, write to the Free Software\r\n   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n\r\n   Rob Lake can be contacted at\r\n   email: rlake@cs.mun.ca\r\n\r\n */\r\n\r\n#ifndef H__DATEFUNC_\r\n#define H__DATEFUNC_\r\n\r\n#if defined _NO__DOS_DATE || (defined __TURBOC__ && __TURBOC__ <= 0x296) || defined(__GNUC__) /* TC/TC++ 1.01 or GCC */\r\n\r\nstruct dosdate_t\r\n{\r\n  unsigned char day;            /* 1--31 */\r\n  unsigned char month;          /* 1--12 */\r\n  unsigned int year;            /* 1980--2099 */\r\n  unsigned char dayofweek;      /* 0--6; 0 = Sunday */\r\n};\r\n\r\nunsigned _dos_setdate(struct dosdate_t *);\r\nvoid _dos_getdate(struct dosdate_t *);\r\n\r\n#endif /* _NO__DOS_DATE */\r\n#endif /* H__DATEFUNC_ */\r\n"
  },
  {
    "path": "include/debug.h",
    "content": "/*\r\n\tDeclaration & settings for debugging\r\n\r\n\tThe following functions expand to nothing, if DEBUG is not defined,\r\n\totherwise they expand to the given statement.\r\n\r\n\tdprintf( a )\t--> print\ta\t[ printf() enable while debugging ]\r\n\tdbg_printmem()\t--> displays the memory and how it changed\r\n*/\r\n\r\n#ifndef H__DEBUG__\r\n#define H__DEBUG__\r\n\r\n#ifdef DEBUG\t\t/* DEBUG ENABLED */\r\n\r\n#include <stdio.h>\r\n\r\nextern FILE *dbg_logfile;\r\nextern int fddebug;\r\n\r\n#define dprintf(p) do { if (fddebug) dbg_print p; } while(0)\r\nvoid dbg_printmem (void);\r\nvoid dbg_print    (const char fmt [], ...);\r\nvoid dbg_outc     (int ch);\r\nvoid dbg_outs     (const char *const s);\r\nvoid dbg_outsn    (const char *const s);\r\n\r\n#else\t\t\t/* NO DEBUG */\r\n\r\n#define dprintf(p)\r\n#define dbg_printmem()\r\n\r\n#endif /* DEBUG */\r\n#endif /* H__DEBUG__ */\r\n"
  },
  {
    "path": "include/infores.h",
    "content": "/* $Id$\r\n\r\n\tInfo resource\r\n\r\n\tStructure of the resource:\r\n\t<tag1>\r\n\t<tag2>\r\n\t...\r\n\t<tagN>\r\n\r\n\ta <tag> is of the structure:\r\n\tOffset\tType\tMeaning\r\n\t0\t\t1 BYTE\ttag type\r\n\t1\t\t1 BYTE\ttag length\r\n\t2..N+2\tN BYTE\ttag value\r\n\r\n\tlength may 0..255;\r\n\r\n\ttag type:\r\n\tType\tMeaing\r\n\t0\t\tend of structure (may be absent)\r\n\t1\t\tminimum extra paragaphes required by C host environment\r\n\t\t\tlength := 2\r\n\t\t\tvalue  := number of paragraphes that need to be additionally\r\n\t\t\t\t\t\tallocated by the program minimally\r\n\t2\t\tlocation of _heaplen variable\r\n\t\t\tlength := 4\r\n\t\t\tvalue  := offset within file where the (unsigned)_heaplen\r\n\t\t\t\t\t\tvariable is located\r\n\t3\t\tAliases present in FreeCOM\r\n\t\t\tlength := 2\r\n\t\t\tvalue  := default size of aliases buffer\r\n\t4\t\tHistory present in FreeCOM\r\n\t\t\tlength := 2\r\n\t\t\tvalue  := default size of history buffer\r\n\t5\t\tDirstack present in FreeCOM\r\n\t\t\tlength := 2\r\n\t\t\tvalue  := default size of dirstack buffer\r\n\t6\t\tInternal command line size\r\n\t\t\tlength := 2\r\n\t\t\tvalue  := size of internal command line\r\n\r\n*/\r\n\r\n#ifndef INFORES__H_\r\n#define INFORES__H_\r\n\r\ntypedef enum {\r\n\tINFO_END = 0\r\n\t,INFO_EXTRA_SPACE\r\n\t,INFO_POS_HEAPLEN\r\n\t,INFO_ALIASES\r\n\t,INFO_HISTORY\r\n\t,INFO_DIRSTACK\r\n\t,INFO_BUFSIZE\r\n} infotags;\r\n\r\ntypedef struct {\r\n\tunsigned char type;\r\n\tunsigned char length;\r\n} infotag;\r\n\r\n#include <algnbyte.h>\r\nstruct EXE_header {\r\n\tunsigned short sig, lastFill, numBlocks, numReloc;\r\n\tunsigned short header;\r\n\tunsigned short extraMin, extraMax;\r\n\tunsigned short fSS, fSP, checksum, fIP, fCS;\r\n\tunsigned short offReloc, ovrlyNum;\r\n};\r\n#include <algndflt.h>\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/keys.h",
    "content": "/*\r\n *\tDefines keys without ASCII representation\r\n *\r\n *\tInternally a key is an (int) value, the low byte encodes the keycode\r\n *\tthe high byte the mode the keycode has to be interpreted by.\r\n *\tmode\tmeaning of keycode\r\n *\t0\t\tASCII code\r\n *\t1\t\tscan code\r\n */\r\n\r\n#ifndef KEYS__H\r\n#define KEYS__H\r\n\r\n#define SCANCODE(key)\t(key | 256)\r\n#define ASCIICODE(key)\t(key)\r\n\r\n#define KEY_F1\tSCANCODE(59)\r\n#define KEY_F2\tSCANCODE(60)\r\n#define KEY_F3\tSCANCODE(61)\r\n#define KEY_F4\tSCANCODE(62)\r\n#define KEY_F5\tSCANCODE(63)\r\n#define KEY_F6\tSCANCODE(64)\r\n#define KEY_F7\tSCANCODE(65)\r\n#define KEY_F8\tSCANCODE(66)\r\n#define KEY_F9\tSCANCODE(67)\r\n#define KEY_F10\tSCANCODE(68)\r\n#define KEY_F11\tSCANCODE(133)\r\n#define KEY_F12\tSCANCODE(134)\r\n\r\n#define KEY_LEFT\tSCANCODE(75)\r\n#define KEY_CTRL_LEFT\tSCANCODE(0x73)\r\n#define KEY_RIGHT\tSCANCODE(77)\r\n#define KEY_CTRL_RIGHT\tSCANCODE(0x74)\r\n#define KEY_UP\tSCANCODE(72)\r\n#define KEY_DOWN\tSCANCODE(80)\r\n#define KEY_INS\tSCANCODE(82)\r\n#define KEY_INSERT\tSCANCODE(82)\r\n#define KEY_DEL\tSCANCODE(83)\r\n#define KEY_DELETE\tSCANCODE(83)\r\n#define KEY_HOME\tSCANCODE(71)\r\n#define KEY_END\tSCANCODE(79)\r\n#define KEY_PUP\tSCANCODE(73)\r\n#define KEY_PDOWN\tSCANCODE(81)\r\n\r\n#define KEY_TAB\tASCIICODE('\\t')\r\n#define KEY_NL\tASCIICODE('\\n')\r\n#define KEY_CR\tASCIICODE('\\r')\r\n#define KEY_ENTER\tASCIICODE('\\r')\r\n#define KEY_BS\tASCIICODE('\\b')\r\n#define KEY_ESC\tASCIICODE(27)\r\n\r\n#define KEY_CTL_A\tASCIICODE(1)\r\n#define KEY_CTL_B\tASCIICODE(2)\r\n#define KEY_CTL_C\tASCIICODE(3)\r\n#define KEY_CTL_D\tASCIICODE(4)\r\n#define KEY_CTL_E\tASCIICODE(5)\r\n#define KEY_CTL_F\tASCIICODE(6)\r\n#define KEY_CTL_G\tASCIICODE(7)\r\n#define KEY_CTL_H\tASCIICODE(8)\r\n#define KEY_CTL_I\tASCIICODE(9)\r\n#define KEY_CTL_J\tASCIICODE(10)\r\n#define KEY_CTL_K\tASCIICODE(11)\r\n#define KEY_CTL_L\tASCIICODE(12)\r\n#define KEY_CTL_M\tASCIICODE(13)\r\n#define KEY_CTL_N\tASCIICODE(14)\r\n#define KEY_CTL_O\tASCIICODE(15)\r\n#define KEY_CTL_P\tASCIICODE(16)\r\n#define KEY_CTL_Q\tASCIICODE(17)\r\n#define KEY_CTL_R\tASCIICODE(18)\r\n#define KEY_CTL_S\tASCIICODE(19)\r\n#define KEY_CTL_T\tASCIICODE(20)\r\n#define KEY_CTL_U\tASCIICODE(21)\r\n#define KEY_CTL_V\tASCIICODE(22)\r\n#define KEY_CTL_W\tASCIICODE(23)\r\n#define KEY_CTL_X\tASCIICODE(24)\r\n#define KEY_CTL_Y\tASCIICODE(25)\r\n#define KEY_CTL_Z\tASCIICODE(26)\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/kswap.h",
    "content": "/* Kernel-supported swapping */\r\n\r\n#ifndef FEATURE_XMS_SWAP\r\n\r\n#ifndef H__KSWAP__\r\n#define H__KSWAP__\r\n\r\n#include <portable.h>\r\n\r\n#include \"../context.h_c\"\r\n\r\n#define\tFREECOM_NEED_MODULES\r\n\r\ntypedef  kswap_t _seg *kswap_p;\r\nextern kswap_p kswapContext;\t\t/* static context */\r\n\r\n/* Lock kswap feature within kernel and invalidate a previous external prg\r\n\tReturn:  TRUE if re-invoked */\r\nint kswapInit(void);\r\n\r\n/* (De-)Register the static context with the kernel\r\n */\r\nvoid kswapRegister(kswap_p ctxt);\r\nvoid kswapDeRegister(kswap_p ctxt);\r\n\r\n/* Update the kswap argument block\r\n\tReturn: 0 on error <-> no swapping possible\r\n\t\telse: segment of structure */\r\nunsigned kswapMkStruc(const char * const prg, const char * const cmdline);\r\n\r\n/* Restore the kswap argument block */\r\nint kswapLoadStruc(void);\r\n\r\n#endif /* H__KSWAP__ */\r\n\r\n#endif /* FEATURE_XMS_SWAP */\r\n"
  },
  {
    "path": "include/large.inc",
    "content": "\r\n; Large header\r\ngroup\tDGROUP\t\t_DATA _BSS\r\nsegment\t_TEXT\t\tclass=CODE\r\nsegment\t_DATA\t\tclass=DATA align=2\r\nsegment\t_BSS\t\tclass=BSS align=2\r\n\r\n@CodeSize EQU 1\r\n@DataSize EQU 1\r\n\r\n%macro ret 0-1\r\n\tretf %1\r\n%endmacro\r\n"
  },
  {
    "path": "include/lfnfuncs.h",
    "content": "/* \r\n * Header file for the long filename-related functions\r\n */\r\n\r\n#ifndef H__LFNFUNCS_\r\n#define H__LFNFUNCS_\r\n\r\n/*#ifdef __TURBOC__*/ /* OpenWatcom has an LFN CLIB Extension available \r\n\t\t\t but not used yet */\r\n\r\n#ifdef FEATURE_LONG_FILENAMES\r\n\r\n#include <stdio.h>\r\n\r\n#include <algnbyte.h>\r\nstruct lfnffblk {\r\n        unsigned short cr_time; /* time of file creation      */\r\n        unsigned short cr_date; /* date of file creation      */\r\n        unsigned short ac_time; /* time of last file access   */\r\n        unsigned short ac_date; /* date of last file access   */\r\n        unsigned short lfnax;   /* DOS LFN search handle      */\r\n        char ff_reserved[11];   /* reserved for use by DOS    */\r\n        char ff_attrib;         /* attribute byte for file    */\r\n        unsigned short ff_ftime;/* time of last write to file */\r\n        unsigned short ff_fdate;/* date of last write to file */\r\n        unsigned long  ff_fsize;/* length of file in bytes    */\r\n        char ff_name[260];      /* null-terminated filename   */\r\n        unsigned char  lfnsup;  /* DOS LFN support status     */\r\n};\r\n#include <algndflt.h>\r\n\r\n#ifdef __LFNFUNCS_C\r\n\r\n#include <algnbyte.h>\r\nstruct locffblk {\r\n    long attributes;\r\n    long creattime;\r\n    long creatdate;\r\n    long accesstime;\r\n    long accessdate;\r\n    long wrtime;\r\n    long wrdate;\r\n    long hifilesize;\r\n    long filesize;\r\n    char reserved[8];\r\n    char lfn[260];\r\n    char sfn[14];\r\n};\r\n#include <algndflt.h>\r\n\r\n#endif /* __LFNFUNCS_C */\r\n\r\nconst char * getshortfilename( const char *longfilename );\r\nint          lfn_chmod( const char *filename, int func, ... );\r\nint          lfn_creat( const char *filename, int mode );\r\nFILE *       lfnfopen( const char *filename, const char *mode );\r\nint          lfnopen( const char *filename, int access, ... );\r\nint          lfnrename( const char *oldfilename, const char *newfilename );\r\nint          lfnfindfirst( const char *path, struct lfnffblk *buf,\r\n                           unsigned attr );\r\nint          lfnfindnext( struct lfnffblk *buf );\r\nint          lfnfindclose( struct lfnffblk *buf );\r\nint          lfnmkdir( const char *path );\r\nint          lfnrmdir( const char *path );\r\nint          lfnchdir( const char *path );\r\n\r\nextern unsigned char __supportlfns;\r\nextern unsigned char lfncomplete;\r\n\r\n#ifndef __LFNFUNCS_C\r\n\r\n#undef remove\r\n#define access( x, y )    access( getshortfilename( x ), y )\r\n#define chmod( x, y )     chmod( getshortfilename( x ), y )\r\n#define creattemp( x, y ) creattemp( getshortfilename( x ), y )\r\n#define dfnstat( x )      dfnstat( getshortfilename( x ) )\r\n#undef dos_open\r\n#define dos_open( x, y )  sfn_open( getshortfilename( x ), y )\r\n#define unlink( x )       unlink( getshortfilename( x ) )\r\n#define _chmod            lfn_chmod\r\n#undef dos_creat\r\n#define dos_creat         lfn_creat\r\n#define fopen             lfnfopen\r\n#define remove            unlink\r\n#define open              lfnopen\r\n#define rename            lfnrename\r\n#define stat( x, y )      stat( getshortfilename( x ), y )\r\n#undef  dos_findfirst\r\n#undef  dos_findnext\r\n#undef  dos_findclose\r\n#define dos_findfirst     lfnfindfirst\r\n#define dos_findnext      lfnfindnext\r\n#define dos_findclose     lfnfindclose\r\n#define dos_ffblk         lfnffblk\r\n#define mkdir             lfnmkdir\r\n#define rmdir             lfnrmdir\r\n#define chdir             lfnchdir\r\n\r\n#undef MAXFILE\r\n#undef MAXDIR\r\n#undef MAXPATH\r\n#undef MAXEXT\r\n#define MAXFILE 255\r\n#define MAXDIR  255\r\n#define MAXEXT  255\r\n#define MAXPATH 260\r\n\r\n#endif /* __LFNFUNCS_C */\r\n\r\n#else\r\n\r\n#define dos_ffblk         ffblk\r\n\r\n#endif /* FEATURE_LONG_FILENAMES */\r\n/*#endif*/ /* __TURBOC__ */\r\n#endif /* H__LFNFUNCS_ */\r\n"
  },
  {
    "path": "include/medium.inc",
    "content": "\r\n; Medium header\r\ngroup\tDGROUP\t\t_DATA _BSS\r\nsegment\t_TEXT\t\tclass=CODE\r\nsegment\t_DATA\t\tclass=DATA align=2\r\nsegment\t_BSS\t\tclass=BSS align=2\r\n\r\n@CodeSize EQU 1\r\n@DataSize EQU 0\r\n\r\n%macro ret 0-1\r\n\tretf %1\r\n%endmacro\r\n"
  },
  {
    "path": "include/misc.h",
    "content": "/*\r\n * MISC.C -- Misc. Functions declarations\r\n *\r\n * 2000/07/13 ska\r\n *\tstarted\r\n */\r\n\r\n#ifndef MISC_H\r\n#define MISC_H\r\n\r\n#include <stdio.h>\r\n#include <portable.h>\r\n\r\n#ifndef DEBUG\r\n#undef stdin\r\n#undef stdout\r\n#undef stderr\r\nextern FILE *stdin, *stdout, *stderr;\r\n#undef fileno\r\n#define fileno(f) ((int)(f))\r\n#endif\r\n\r\n#include \"../include/datefunc.h\"\r\n#include \"../include/timefunc.h\"\r\n\r\nenum OnOff {\t\t/* ON/OFF tester */\r\n\tOO_Empty = 0,\t\t/* Empty line */\r\n\tOO_Null,\t\t\t/* NULL line */\r\n\tOO_On,\t\t\t\t/* \"ON\" */\r\n\tOO_Off,\t\t\t\t/* \"OFF\" */\r\n\tOO_Other\t\t\t/* else */\r\n};\r\n\r\ntypedef enum {\r\n\t  STRINGS_LOADED\r\n\t, STRINGS_ID_MISMATCH\r\n\t, STRINGS_SIZE_MISMATCH\r\n\t, STRINGS_NOT_FOUND\r\n\t, STRINGS_READ_ERROR\r\n\t, STRINGS_OUT_OF_MEMORY\r\n} loadStatus;\r\n\r\n#define BREAK_BATCHFILE 1\r\n#define BREAK_ENDOFBATCHFILES 2\r\n#define BREAK_INPUT 3\r\n#define BREAK_IGNORE 4\r\n#define BREAK_FORCMD 5\r\n\r\n#define cbreak chkCBreak(0)\r\n\r\n#define MAXARGS 20\r\n#define MAXLEN  256\r\n#define exist dfnstat\r\n\r\n/* transformed into constants\r\n\tunsigned far *maxx = MK_FP(0x40, 0x4a);\r\n\tunsigned char far *maxy = MK_FP(0x40, 0x84);\r\n*/\r\n#define MAX_X (*(unsigned int  far*)MK_FP(0x40, 0x4a))\r\n#define MAX_Y (*(unsigned char far*)MK_FP(0x40, 0x84) == 0 ? 24 : *(unsigned char far*)MK_FP(0x40, 0x84)) /* when 0040:0084 contains 0, assume 25 rows (CGA...) */\r\n#define SCREEN_COLS MAX_X\r\n#define SCREEN_ROWS (MAX_Y + 1)\r\n\r\nextern FILE *errStream;\r\n#define outStream stdout\r\nextern int swapOnExec, defaultToSwap, swapContext;\r\n\r\nvoid display_errno_fnam_error(const char * const fnam);\r\nvoid displayExitcode(void);\r\n\r\nvoid outc( char c );\r\nvoid outs( const char * const s );\r\nint cgetchar(void);\r\nint vcgetchar(void);\r\nint vcgetcstr(const char *const legalCh);\r\nint keypressed(void);\r\nint cgetchar_timed(int secs);\r\nint chkCBreak(int mode);\r\nconst char *getCurrenConDev(void);\r\nint setCurrentConDev(const char * dnam);\r\nvoid beep(void);\r\nvoid beep_low(void);\r\nchar *comFile(void);\r\nchar *comPathFile(const char * fnam);\r\nchar *comResFile(void);\r\n#define comRespawnFile comResFile\r\nint validResFile(const char * const fnam);\r\nvoid dispCount(int cnt, unsigned base_id);\r\nint drvNum(int drive);\r\nchar *cwd(int drive);\r\nchar *abspath(const char * const fnam, const int warn);\r\nchar *truepath(const char * const fnam);\r\nint changeDrive(int drive);\r\nint mk_rd_dir(char *param, int (*func) (const char *, int recursiveMode, int quiet), char *fctname);\r\nvoid cutBackslash(char * const s);\r\nint cd_dir(char *param, int cdd, const char * const fctname);\r\nenum OnOff onoffStr(char *line);\r\n#if defined(__TURBOC__)\r\n#define sfn_open _open\r\n#define dos_close _close\r\n#else\r\nint sfn_open(const char *pathname, int flags);\r\n#if defined(__GNUC__)\r\n#define stricmp strcasecmp\r\n#define strcmpi strcasecmp\r\n#define strnicmp strncasecmp\r\n#define memicmp strncasecmp\r\nint dos_close(int fd);\r\n#else\r\n#define dos_close _dos_close\r\n#endif\r\n#endif\r\nint dos_read(int fd, void *buf, unsigned int len);\r\nint dos_write(int fd, const void *buf, unsigned int len);\r\n#define sfnfindfirst(path,attrib,ffblk) findfirst(path,attrib,ffblk)\r\n#define sfnfindnext(ffblk)  findnext(ffblk)\r\n#ifndef dos_open\r\n#define dos_open sfn_open\r\n#define dos_creat sfn_creat\r\n#define dos_findfirst sfnfindfirst\r\n#define dos_findnext sfnfindnext\r\n#define dos_findclose(ffblk)\r\n#endif\r\nint sfn_creat(const char *pathname, int attr);\r\nint sfn_creatnew(const char *pathname, int attr);\r\nsize_t farread(int fd, void far*buf, size_t length);\r\nsize_t farwrite(int fd, void far*buf, size_t length);\r\nunsigned allocPermBlk(const unsigned size, const unsigned mode);\r\nunsigned allocSysBlk(const unsigned size, const unsigned mode);\r\nunsigned allocMemBlk(const unsigned size, const unsigned mode);\r\nvoid freeSysBlk(const unsigned segm);\r\n\r\nvoid myperror(const char *msg);\r\nvoid myfnsplit(const char *path, char *buf,\r\n               char *drv, char **dir, char **name, char **ext);\r\nvoid myfnmerge(char *path,\r\n               const char *drive,\r\n               const char *dir,\r\n               const char *fname,\r\n               const char *ext);\r\n\r\nchar far *_fstpcpy(char far *dst, const char far *src);\r\nvoid partstrlower(char *str);\r\nvoid readcommand(char * const str, int maxlen);\r\nvoid readcommandDOS(char * const str, int maxlen);\r\nvoid readcommandEnhanced(char * const str, const int maxlen);\r\nint set_readcommandType(int enhanced);\r\nvoid convert(unsigned long num, unsigned int billions, char * const des);\r\n\r\nvoid goxy(const unsigned char x, const unsigned char y);\r\n\r\nvoid setErrorLevel(int rc);\r\nvoid execute(char *first, char *rest, int lh_lf);\r\nint exec(const char *, char *, const unsigned);\r\nvoid restoreSession(void);\r\nvoid saveSession(void);\r\n\r\nint samefile(const char * const f1, const char * const f2);\r\nvoid fillFnam(char *dest, const char * const pattern, const char * const fnam);\r\nint is_fnchar(const int c);\r\nint is_fnstr(const char * const s);\r\nint is_pathdelim(const int c);\r\nint is_empty(const char *s);\r\n#define is_quote(c)\t((c) == '\"')\r\nchar *skipfnam(const char * const fnam);\r\n\r\nunsigned mywherex(void);\r\nunsigned mywherey(void);\r\n\r\n/************* Imported from LH.ASM        */\r\n\r\nint dosGetUMBLinkState(void);\r\nvoid dosSetUMBLinkState(int newState);\r\nint dosGetAllocStrategy(void);\r\nvoid dosSetAllocStrategy(int newState);\r\nword GetFirstMCB(void);\r\n\r\n\r\n\r\nchar *curTime(void);\r\nchar *curDateLong(void);\r\nint parsedate(const char * s, struct dosdate_t * const datep);\r\nint parsetime(const char * s, struct dostime_t * const timep);\r\n\r\nvoid displayPrompt(const char *pr);\r\nvoid printprompt(void);\r\nint showcmds(char *rest);\r\nint grabComFilename(const int warn, const char far * const fnam);\r\n\r\nvoid displayString(unsigned id,...);\r\nvoid displayError(unsigned id,...);\r\nint userprompt(unsigned id,...);\r\nint getPromptString(unsigned id, char ** const chars, char ** const fmt);\r\n#define freePromptString(chars,fmt)\tfree(chars)\r\nint mapMetakey(const char * const chars, int ch);\r\nchar *getMessage(unsigned id);\r\nchar *defaultMessage(unsigned id);\r\nchar *getString(unsigned id);\r\nvoid unloadMsgs(void);\r\nunsigned msgSegment(void);\r\n\r\nchar *tmpfn(void);\r\nchar *mktempfile(const char * const path, const char *ext);\r\nvoid killtmpfn(char * const);\r\n\r\nchar *find_which(const char * const fname);\r\nint getbreak(void);\r\nvoid setbreak(const int OnOff);\r\n\r\nchar *getEnv(char *);\r\nint chgEnv(const char[], const char[]);\r\nint chgEnvRemove(const char[], const char[]);\r\nint chgEnvCase(const int, char[], const char[]);\r\n\r\nchar *trimsp(char *str);\r\nchar *ltrimsp(const char *str);\r\nvoid rtrimsp(char * const str);\r\nchar *parsenum(const char *s, int maxCnt, int *cnt, int nums[]);\r\nchar *textlineEnd(const char * const buf, const size_t buflen);\r\n\r\nint truncate(int fd);\r\n\r\n/*\r\nvoid aliasprint(void);\r\nvoid aliaschange(const char * const name, const char * const value);\r\n\r\nchar *alias_mangleFNam(const char * const name);\r\nword alias_find(char * const tagged_name);\r\n*/\r\n\r\n\r\n/* wrapper functions for ..\\include\\context.h\r\n\t- may disapeear in the future */\r\n/* history wrapper: negative idx --> from end of buffer;\r\n\tcurrently no non-negative idx used */\r\nint histGet(const int num, char * const str, const unsigned len);\r\nvoid histSet(const int num, const char * const str);\r\n\r\nvoid lastDirSet(void);\r\nvoid lastDirGet(char ** const buf);\r\n\r\nint appendDisable(void);\r\nvoid appendRestore(const int state);\r\n\r\nvoid registerCriterRepeatCheckAddr(word far *);\r\nchar *critDriveReport(void);\r\nvoid critEnableRepeatCheck(void);\r\nunsigned critDisableRepeatCheck(void);\r\nvoid critEndRepCheck(void);\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/model.inc",
    "content": "%ifidni MODEL,s\r\n%include \"small.inc\"\r\n%elifidni MODEL,m\r\n%include \"medium.inc\"\r\n%elifidni MODEL,l\r\n%include \"large.inc\"\r\n%else\r\n%error \"Unsupported MODEL; assign 's', 'm' or 'l' to macro MODEL\"\r\n%endif\r\n"
  },
  {
    "path": "include/module.h",
    "content": "/*\r\n *\tSpecial FreeCOM declaration for the module management\r\n *\r\n * 2000/07/12 ska\r\n * started\r\n */\r\n\r\n#ifndef MODULE_H\r\n#define MODULE_H\r\n\r\n#include \"../include/kswap.h\"\r\n\r\n#ifdef FREECOM_NEED_MODULES\r\n\r\n\t/* Retruns the pointer of the context pointer of the\r\n\t\tCritical Error handler */\r\nextern kswap_p modContext(void);\r\n\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/mux_ae.h",
    "content": "/*\r\n\tDeclaration for Installable COMMAND extensions (MUX-AE)\r\n\r\n\t2000/12/10 ska\r\n\tstarted\r\n*/\r\n\r\n#ifndef FREECOM_MUX_AE_H\r\n#define FREECOM_MUX_AE_H\r\n\r\n#include \"../include/command.h\"\r\n\r\n/* minimal size of buffer passed into runExtension() for both\r\n\tcommand and line. Also, command[-2] & command[-1] must be available as\r\n\twell as line[-2], line[-1] and line[BUFFER_SIZE_MUX_AE] */\r\n#if MAX_INTERNAL_COMMAND_SIZE > 255\r\n#define BUFFER_SIZE_MUX_AE 255\r\n#else\r\n#define BUFFER_SIZE_MUX_AE MAX_INTERNAL_COMMAND_SIZE\r\n#endif\r\n\r\n/* Check for extensions and perform it, on success return != 0 */\r\n/* Also: The contents of both buffers is monitored in order to\r\n\tcheck if they got overflowed during the MUX call. If so,\r\n\tthe executation is aborted. */\r\nint runExtension(char * const command, char * const line);\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/nls.h",
    "content": "/*\t$Id$\r\n\r\n\tDeclarations to access the DOS NLS information\r\n\r\n\t$Log$\r\n\tRevision 1.2  2003/03/05 17:43:42  skaus\r\n\tbugfix: cached NLS data not flushed\r\n\r\n\tRevision 1.1  2001/04/12 00:09:06  skaus\r\n\tchg: New structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n*/\r\n\r\n#ifndef __NLS_H\r\n#define __NLS_H\r\n\r\n#include <cntry.h>\r\n\r\nextern Country *nlsBuf;\t\t/* internally cached NLS info buffer */\r\n\r\nvoid refreshNLS(void);\t\t/* make sure the nlsBuf is valid */\r\n\r\n#define invalidateNLSbuf() nlsBuf = 0\r\n\r\n/* The mode parameter is an OR combination of the following\r\n\tdefines */\r\n#define NLS_MAKE_SHORT_AMPM\t1\t\t/* AM/PM as single letters */\r\n\r\n\r\n\t/* Create a correctly constructed DATE string from the\r\n\t\tgiven parameters, the result is located in a dynamically\r\n\t\tallocated buffer */\r\nchar *nls_makedate(int mode, int year, int month, int day);\r\nchar *nls_maketime(int mode, int hour, int minute, int second, int fraction);\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/openf.h",
    "content": "/*\r\n *      Prototypes for the CP/M-style device name-aware open functions\r\n */\r\n#ifndef __OPENF_H\r\n#define __OPENF_H\r\n\r\n#include <stdio.h>\r\n\r\n/*\r\n *      Check if the passed file descriptor is connected to a\r\n *      character device rather than a block device\r\n *\r\n *      Return:\r\n *              0: block device (disk file)\r\n *              else: character device\r\n */\r\nint isadev(const int fd);\r\n\r\n/*\r\n *\tReturn the attributes of an opened handle; 0 on error\r\n */\r\nint fdattr(const int fd);\r\nint fdsetattr(const int fd, const int attr);\r\n\r\n/*\r\n *      Check for a CP/M-style device name\r\n *\r\n *      Return:\r\n *              0: no, fnam[] unchanged\r\n *              else: yes, fnam[] is modifed to contain a valid DOS filename\r\n */\r\nint isDeviceName(char * const fnam);\r\n\r\n/*\r\n *      IO-style CP/M aware open() function\r\n *\r\n *      If it is a device name, fnam[] is modified to contain a valid\r\n *      DOS filename.\r\n */\r\nint devopen(char * const fnam, int mode);\r\n\r\n/*\r\n *      FIO-style CP/M aware fopen() function\r\n *\r\n *      If it is a device name, fnam[] is modified to contain a valid\r\n *      DOS filename.\r\n */\r\nFILE *fdevopen(char * const fnam, const char * const mode);\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/res.h",
    "content": "/*\r\n *\tSpecial FreeCOM declaration for the resource management\r\n *\r\n *\tenumResources()\tenumerates all resources of the specified major ID\r\n *\t\tand invokes a callback function; if the primary resource file\r\n *\t\tis not avilable, the passe din alternate file is tried.\r\n */\r\n\r\n#ifndef RES_H\r\n#define RES_H\r\n\r\n#include \"../include/resource.h\"\r\n\r\nint enumResources(res_majorid_t id, res_callbackp_t fct, void * const arg);\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/resource.h",
    "content": "/*\r\n *\tDeclarations of resource management of FreeCOM\r\n *\r\n *\tSee DOCS\\RESOURCE.TXT\r\n *\r\n *\tenumFileResources()\tenumerates all resources of the specified major ID\r\n *\t\tand invokes a callback function\r\n *\tstartResource() prepares a stream that a new resources is about to\r\n *\t\tbe written into it\r\n *\tendResource() cleans up the resource prepared by startResource()\r\n *\r\n */\r\n\r\n#ifndef RESOURCE_H\r\n#define RESOURCE_H\r\n\r\n#include <stdio.h>\r\n\r\n#include \"algnbyte.h\"\r\n\r\ntypedef unsigned short res_minorid_t;\t/* must be exactly unsigned 16bit */\r\n#ifdef __LP64__\r\ntypedef unsigned int res_length_t;\r\n#else\r\ntypedef unsigned long res_length_t;\r\n#endif\r\n\r\nenum {\r\n\tRES_ID_NONE = -0x7ffe,\r\n\tRES_ID_ANY = -0x7fff,\r\n\tRES_ID_STRINGS = 0,\r\n\tRES_ID_CRITER,\r\n\tRES_ID_INFO\r\n};\r\ntypedef short res_majorid_t;\r\n\r\ntypedef struct {\t\t/* type of a control area */\r\n\tres_length_t res_length;\r\n\tres_majorid_t res_majorID;\r\n\tres_minorid_t res_minorID;\r\n\tunsigned char res_cookie[8];\t/* NOT '\\0' terminated! */\r\n} resource_t;\r\n\r\n#include \"algndflt.h\"\r\n\r\ntypedef int (*res_callbackp_t)(res_majorid_t, res_minorid_t\r\n , unsigned long, int, void * const);\r\n\r\n#define RES_COOKIE \"FREECOM \"\r\n\r\n\r\n/****************************\r\n ****** Prototypes **********\r\n ****************************/\r\n\r\n\r\nint enumFileResources(const char * const fnam, res_majorid_t id\r\n , res_callbackp_t fct, void * const arg);\r\nvoid startResource(FILE *f, res_majorid_t majorID, res_minorid_t minorID);\r\nvoid endResource(FILE *f);\r\n\r\n#ifdef __TURBOC__\r\n#if sizeof(res_majorid_t) != 2\r\n#error \"res_id_t must be exactly 16bit!\"\r\n#endif\r\n#if sizeof(res_minorid_t) != 2\r\n#error \"res_id_t must be exactly 16bit!\"\r\n#endif\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "include/small.inc",
    "content": "\r\n; Small header\r\n%ifidn __OUTPUT_FORMAT__, obj\r\ngroup\tDGROUP\t\t_DATA _BSS\r\nsegment\t_TEXT\t\tclass=CODE\r\nsegment\t_DATA\t\tclass=DATA align=2\r\nsegment\t_BSS\t\tclass=BSS align=2\r\n%else\r\nbits 16\r\n%define _TEXT .text\r\n%define _DATA .data\r\n%define _BSS .bss\r\n%endif\r\n\r\n@CodeSize EQU 0\r\n@DataSize EQU 0\r\n"
  },
  {
    "path": "include/strings.typ",
    "content": "/*\r\n * STRINGS.TYP - Shared types of STRINGS.DAT implementation\r\n *\t\trequired to ensure FIXSTRS and FREECOM use the same\r\n *\t\tbinary representation\r\n *\r\n * 2000/07/09 ska\r\n * started\r\n */\r\n\r\n\r\ntypedef unsigned short string_count_t;\t/* number of strings */\r\ntypedef unsigned short string_size_t;\t/* number of size of strings */\r\ntypedef struct \r\n{\r\n  string_count_t index;\r\n  string_size_t size;\r\n} string_index_t;\r\n\r\n#define STRING_NONE ((string_count_t)-1)\r\n#define STRING_RESOURCE_MINOR_ID 3\r\nextern string_count_t strCnt;\r\nextern unsigned msgSegm;\r\n"
  },
  {
    "path": "include/stuff.inc",
    "content": "cpu 8086\r\n\r\n;; Multi-Push/Pop\r\n;; Both take the registers in the same order, \"F\"==Flags\r\n;; Push pushes left to right; pop right to left\r\n\r\n%macro pushm 2-*\r\n%rep %0\r\n%ifidni %1,f\r\n\tpushf\r\n%else\r\n\tpush %1 \r\n%endif\r\n%rotate 1 \r\n%endrep \r\n%endmacro\r\n%macro popm 2-*\r\n%rep %0\r\n%rotate -1 \r\n%ifidni %1,f\r\n\tpopf\r\n%else\r\n\tpop %1 \r\n%endif\r\n%endrep \r\n%endmacro\r\n\r\n;; declare global and extern with underscore for OMF, without for ELF\r\n\r\n%macro  cglobal 1-*\r\n%rep %0\r\n%ifnidn __OUTPUT_FORMAT__,elf\r\n\t%define %1 _%1 \r\n%endif\r\n\tglobal\t%1\r\n%rotate 1 \r\n%endrep \r\n%endmacro\r\n\r\n%macro  cextern 1-*\r\n%rep %0\r\n%ifnidn __OUTPUT_FORMAT__,elf\r\n\t%define %1 _%1 \r\n%endif\r\n\textern\t%1\r\n%rotate 1 \r\n%endrep \r\n%endmacro\r\n"
  },
  {
    "path": "include/timefunc.h",
    "content": "/*\r\n\r\n   TimeFunc -- DOS Time Functions\r\n   Copyright (C) 1998 Rob Lake\r\n\r\n   This program is free software; you can redistribute it and/or modify\r\n   it under the terms of the GNU General Public License as published by\r\n   the Free Software Foundation; either version 2 of the License, or\r\n   (at your option) any later version.\r\n\r\n   This program is distributed in the hope that it will be useful,\r\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n   GNU General Public License for more details.\r\n\r\n   You should have received a copy of the GNU General Public License\r\n   along with this program; if not, write to the Free Software\r\n   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n\r\n   Rob Lake can be contacted at\r\n   email: rlake@cs.mun.ca\r\n\r\n */\r\n\r\n#ifndef H__TIMEFUNC_\r\n#define H__TIMEFUNC_\r\n\r\n#if defined _NO__DOS_DATE || (defined __TURBOC__ && __TURBOC__ <= 0x296) || defined(__GNUC__) /* TC/TC++ 1.01 or GCC */\r\n\r\n/* The time structure, compatible with dostime_t */\r\nstruct dostime_t\r\n{\r\n  unsigned char hour;           /* Hours */\r\n  unsigned char minute;         /* Minutes */\r\n  unsigned char second;         /* Seconds */\r\n  unsigned char hsecond;        /* Hundredths of seconds */\r\n};\r\n\r\nunsigned _dos_settime(struct dostime_t *);\r\nvoid _dos_gettime(struct dostime_t *);\r\n\r\n#ifdef __GNUC__\r\nvoid delay(unsigned ms);\r\n#endif\r\n\r\n#endif /* _NO__DOS_TIME */\r\n#endif /* H__TIMEFUNC_ */\r\n"
  },
  {
    "path": "lib/absfile.c",
    "content": "/*\t$Id$\r\n\r\n *\tMake the given file spec an absolute path/file name.\r\n *\tReturns in a dynamically allocated buffer (free'ed by the caller)\r\n *\ton error: Displays \"out of memory\" (or appropriate)\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2004/02/01 13:24:22  skaus\r\n\tbugfix: misidentifying unspecific failures from within SUPPL\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <errno.h>\r\n\r\n#include <dfn.h>\r\n\r\n#include \"../err_fcts.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n\r\nchar *abspath(const char * const fnam, const int warn)\r\n{\tchar *h;\r\n\r\n\tassert(fnam);\r\n\r\n\tif((h = dfnfullpath(fnam)) != 0)\r\n\t\treturn h;\r\n\r\n\tif(warn) display_errno_fnam_error(fnam);\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "lib/almemblk.c",
    "content": "/*\t$Id$\r\n\r\n\tAllocate a block of memory.\r\n\tRemove \"Use UMB\" if forceLow is true.\r\n\r\n\t$Log$\r\n\tRevision 1.1  2004/06/29 21:57:20  skaus\r\n\tfix: /LOW option\r\n\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include <suppl.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n\r\nunsigned allocMemBlk(const unsigned size, const unsigned Xmode)\r\n{\tunsigned mode = Xmode;\r\n\r\n\tassert(size);\r\n\tif(forceLow)\r\n\t\tmode &= ~0x80;\t\t/* Remove the \"Use UMB\" bit */\r\n\treturn allocBlk(size, mode);\r\n}\r\n"
  },
  {
    "path": "lib/alprmblk.c",
    "content": "/*\t$Id$\r\n\r\n\tAllocate a permanent block of memory.\r\n\tThese blocks are system memory blocks, if swapping is enabled;\r\n\totherwise \"normal\" ones.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/06/29 21:57:20  skaus\r\n\tfix: /LOW option\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include <suppl.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/kswap.h\"\r\n#include \"../include/misc.h\"\r\n\r\nunsigned allocPermBlk(const unsigned size, const unsigned mode)\r\n{\tassert(size);\r\n\tif(swapOnExec == ERROR)\r\n\t\treturn allocMemBlk(size, mode);\r\n\treturn allocSysBlk(size, mode);\r\n}\r\n"
  },
  {
    "path": "lib/alsysblk.c",
    "content": "/*\t$Id$\r\n\r\n\tAllocate system memory block. This block is not deallocated if\r\n\tthe process dies.\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.4  2006/09/11 00:07:22  blairdude\r\n\tFixed compilation completely with Turbo C\r\n\r\n\tRevision 1.3  2004/06/29 21:57:20  skaus\r\n\tfix: /LOW option\r\n\t\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"mcb.h\"\r\n#include \"suppl.h\"\r\n\r\n#include \"../include/misc.h\"\r\n\r\nunsigned allocSysBlk(const unsigned size, const unsigned mode)\r\n{\tunsigned segm;\r\n\tstruct MCB _seg *mcb;\r\n\r\n\tif((segm = allocMemBlk(size, mode)) != 0) {\r\n\t\tmcb = MK_SEG_PTR (struct MCB, SEG2MCB (segm));\r\n\t\tmcb->mcb_ownerPSP = 8;\r\n\t\tdprintf((\"[MEM: allocated system memory block: %04x/%u]\\n\"\r\n\t\t , segm, size));\r\n\t}\r\n\r\n\treturn segm;\r\n}\r\n"
  },
  {
    "path": "lib/app_get.c",
    "content": "/*\t$Id$\r\n\r\n\tEnable DOS/APPEND if it was enabled before.\r\n\r\n\tint appendDisable()\r\n\r\n\tDisable DOS/APPEND and return the previous state;\r\n\tReturn 0 if no APPEND is loaded.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\r\n\tRevision 1.2  2004/07/12 18:48:38  skaus\r\n\tfix: appendDisable(): should disable APPEND [Eduardo Casino]\r\n\t\r\n\tRevision 1.1  2004/06/21 17:49:25  skaus\r\n\tfix: DIR: disable APPEND.EXE during DIR processing {Eduardo Almao}\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint appendDisable(void)\r\n{\tIREGS r;\r\n\tint state;\r\n#if 1\r\n\tr.r_ax = 0xb700;\t\t/* APPEND installation check */\r\n\tintrpt(0x2f, &r);\r\n#endif\r\n#if 0\r\n    r.x.ax = 0xB700;\r\n    int86( 0x2F, &r, &r );\r\n#endif\r\n\tif(0xFF != (r.r_ax & 0xFF)) {\t/* Not loaded */\r\n#ifndef NDEBUG\r\n\t\tstatic int dispCnt = 1;\r\n\t\tif(r.r_ax & 0xFF)\r\n\t\t\tdprintf((\"[INTERNAL: Unknown return value of MUX-B7-00: %u]\\n\", r.r_ax & 0xFF));\r\n\t\tif(--dispCnt <= 0) {\r\n\t\t\tdprintf((\"[MUX-B7: No APPEND loaded]\\n\"));\r\n\t\t\tdispCnt = 10;\r\n\t\t}\r\n#endif\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/* APPEND is loaded */\r\n\tr.r_ax = 0xb706;\t\t/* Get APPEND function state */\r\n\tintrpt(0x2f, &r);\r\n\r\n\tdprintf((\"[MUX-B7: get state 0x%04x]\\n\", r.r_bx));\r\n\r\n\tstate = r.r_bx;\r\n\tif(state & 1) {\r\n\r\n\t\tr.r_ax = 0xb707;\t\t/* Set APPEND function state */\r\n\t\tr.r_bx = state & ~1;\r\n\t\tintrpt(0x2f, &r);\r\n\r\n\t\tdprintf((\"MUX-B7: set state 0x%04x]\\n\", r.r_bx));\r\n\t}\r\n\r\n\treturn state;\r\n}\r\n"
  },
  {
    "path": "lib/app_set.c",
    "content": "/*\t$Id$\r\n\r\n\tEnable DOS/APPEND if it was enabled before.\r\n\r\n\tvoid appendRestore(int state)\r\n\r\n\tEnable DOS/APPEND if state & 1\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/07/12 18:48:38  skaus\r\n\tfix: appendDisable(): should disable APPEND [Eduardo Casino]\r\n\r\n\tRevision 1.1  2004/06/21 17:49:26  skaus\r\n\tfix: DIR: disable APPEND.EXE during DIR processing {Eduardo Almao}\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nvoid appendRestore(const int state)\r\n{\tif(state & 1) {\t\t/* Re-enable DOS/APPEND */\r\n\t\tIREGS r;\r\n\r\n\t\tr.r_ax = 0xb707;\t\t/* Set APPEND function state */\r\n\t\tr.r_bx = state;\r\n\t\tintrpt(0x2f, &r);\r\n\r\n\t\tdprintf((\"MUX-B7: set state 0x%04x]\\n\", state) );\r\n\t}\r\n}\r\n"
  },
  {
    "path": "lib/beep_l.c",
    "content": "/*\t$Id$\r\n\r\n\tissue low beep\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nvoid beep_low(void)\r\n{\r\n  sound(900);\r\n  delay(200); /* 400 */\r\n  nosound();\r\n  delay(100);\r\n}\r\n"
  },
  {
    "path": "lib/beep_n.c",
    "content": "/*\t$Id$\r\n\r\n * Internally BEEP (getting the user's attention)\r\n * Note: One should consider implementing a _visual_ beep\r\n *   rather an audible beep and an option to switch between them.\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nvoid beep(void)\r\n{\r\n  sound(900);\r\n  delay(200); /* 400 */\r\n  nosound();\r\n  delay(100);\r\n}\r\n"
  },
  {
    "path": "lib/brk_get.c",
    "content": "/*\t$Id$\r\n\r\n\tGet Break status\r\n\r\n\tThis file bases on BREAK.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <portable.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint getbreak(void)\r\n{\tUSEREGS\r\n\r\n\t_AX = 0x3300;\r\n\tgeninterrupt(0x21);\r\n\treturn _DL;\r\n}\r\n"
  },
  {
    "path": "lib/brk_set.c",
    "content": "/*\t$Id$\r\n\r\n\tSet Break status\r\n\r\n\tThis file bases on BREAK.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <portable.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nvoid setbreak(const int OnOff)        /* Off = 0, On = 1 */\r\n{\tUSEREGS\r\n\r\n \t_DX = OnOff; \r\n \t_AX = 0x3301; \r\n \tgeninterrupt(0x21); \r\n}\r\n"
  },
  {
    "path": "lib/c16.mac",
    "content": "; NASM macro set to make interfacing to 16-bit programs easier -*- nasm -*-\r\n\r\n\r\n\r\n%imacro proc 1\t\t\t; begin a procedure definition\r\n\r\n%push proc\r\n\r\n\t  global %1\r\n\r\n%1:\t  push bp\r\n\r\n\t  mov bp,sp\r\n\r\n%ifdef FARCODE PASCAL\t\t; arguments may start at bp+4 or bp+6\r\n\r\n%assign %$arg 6\r\n\r\n%define %$firstarg 6\r\n\r\n%else\r\n\r\n%assign %$arg 4\r\n\r\n%define %$firstarg 4\r\n\r\n%endif\r\n\r\n%define %$procname %1\r\n\r\n%endmacro\r\n\r\n\r\n\r\n%imacro arg 0-1 2\t\t; used with the argument name as a label\r\n\r\n%00\t  equ %$arg\r\n\r\n\t\t\t\t; we could possibly be adding some\r\n\r\n\t\t\t\t; debug information at this point...?\r\n\r\n%assign %$arg %1+%$arg\r\n\r\n%endmacro\r\n\r\n\r\n\r\n%imacro endproc 0\r\n\r\n%ifnctx proc\r\n\r\n%error Mismatched `endproc'/`proc'\r\n\r\n%else\r\n\r\n          mov sp,bp\r\n\r\n          pop bp\r\n\r\n%ifdef PASCAL\r\n\r\n          retf %$arg - %$firstarg\r\n\r\n%elifdef FARCODE\r\n\r\n\t  retf\r\n\r\n%else\r\n\r\n\t  retn\r\n\r\n%endif\r\n\r\n__end_%$procname:\t\t; useful for calculating function size\r\n\r\n%pop\r\n\r\n%endif\r\n\r\n%endmacro\r\n\r\n"
  },
  {
    "path": "lib/cbreak.c",
    "content": "/*\t$Id$\r\n\r\n * Check if Ctrl-Break was pressed during the last calls\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.6  2006/09/04 20:14:23  blairdude\r\n\tSupport for BC\r\n\r\n\tRevision 1.5  2006/06/17 06:10:31  blairdude\r\n\tOptimization\r\n\t\r\n\tRevision 1.4  2006/06/13 02:10:19  blairdude\r\n\tCleaned up some code, moved write in outc to fwrite to make everybody happy (thanks to Arkady for the reports)\r\n\t\r\n\tRevision 1.3  2006/06/12 04:55:42  blairdude\r\n\tAll putchar's now use outc which first flushes stdout and then uses write to write the character to the console.  Some potential bugs have been fixed ( Special thanks to Arkady for noticing them :-) ).  All CONIO dependencies have now been removed and replaced with size-optimized functions (for example, mycprintf, simply opens \"CON\" and directly writes to the console that way, and mywherex and mywherey use MK_FP to access memory and find the cursor position).  FreeCOM is now\r\n\tsignificantly smaller.\r\n\t\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <string.h> /* strlen */\r\n#include <stdlib.h> /* free */\r\n#include <fcntl.h>  /* O_WRONLY */\r\n#include <stdarg.h>\r\n#include <io.h>     /* _open, _write, _close */\r\n\r\n#include <dfn.h>\r\n#include \"../include/batch.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/command.h\"\r\n#include \"../strings.h\"\r\n\r\nstatic char condev[13] = \"CON\";\r\n\r\nconst char * getCurrentConDev(void)\r\n{\r\n  return (const char *)condev;\r\n}\r\n\r\nint setCurrentConDev(const char * dnam)\r\n{\r\n  const char *nam = dfnfilename(dnam);\r\n  size_t len = strlen(nam);\r\n\r\n  if (len == 0 || len >= sizeof(condev))\r\n    return -1; /* failed */\r\n  memcpy(condev, nam, len + 1);\r\n  return 0; /* ok */\r\n}\r\n\r\n/* This is to prevent all that Turbo C CONIO stuff from being linked in */\r\nstatic void mycprintf( char *fmt, ... )\r\n{\r\n    va_list args;\r\n    char buffer[ 512 ];\r\n    int consolehandle = dos_open( condev, O_WRONLY );\r\n    /* \r\n     * Just as cprintf _ensures_ printing directly to the console, so will\r\n     * opening the console and writing to it do the same\r\n     */\r\n\r\n    va_start( args, fmt );\r\n    vsprintf( buffer, fmt, args );\r\n    dos_write( consolehandle, buffer, strlen( buffer ) );\r\n    dos_close( consolehandle );\r\n    va_end( args );\r\n}\r\n\r\nint chkCBreak(int mode)\r\n{\r\n  static int leaveAll = 0;      /* leave all batch files */\r\n\r\n  switch (mode)\r\n  {\r\n    case BREAK_ENDOFBATCHFILES:\r\n      leaveAll = 0;\r\n      return 0;\r\n\r\n    case 0:\r\n      if (!bc)\r\n        goto justCheck;\r\n\r\n    case BREAK_BATCHFILE:\r\n      if (leaveAll)\r\n        return 1;\r\n      if (!ctrlBreak)\r\n        return 0;\r\n\r\n      /* we need to be sure the string arrives on the screen!\r\n      \tTherefore userprompt() is not we need. */\r\n      {\tchar *fmt, *chars;\r\n      \tint ch;\r\n\r\n      \tif(!getPromptString(PROMPT_CANCEL_BATCH, &chars, &fmt)) {\r\n      \t\t\t/* Fatal error <-> Terminate all batches */\r\n      \t\tleaveAll = 1;\r\n      \t\tbreak;\r\n      \t}\r\n      \tif(bc && bc->bfnam)\r\n\t\t\tmycprintf(fmt, bc->bfnam);\r\n      \telse {\r\n      \t\tchar *fnam = getString( TEXT_UNKNOWN_FILENAME );\r\n            \r\n            mycprintf( fmt, fnam ? fnam : \"<<unknown>>\" );\r\n            free( fnam );\r\n\t\t}\r\n\r\n\t\twhile((ch = cgetchar()) == 0 || (ch = mapMetakey(chars, ch)) == 0)\r\n\t\t\tbeep();\r\n\r\n\t\tmycprintf(\"\\r\\n\");\r\n\t\tfreePromptString(chars, fmt);\r\n\r\n\t\tswitch(ch) {\r\n\t\t/* case 1:\t\tYes -> just fall through */\r\n\t\tcase 2:\t\t\t/* No */\r\n\t\t\treturn ctrlBreak = 0;   /* ignore */\r\n\t\tcase 3:\t\t\t/* leave All batchfiles */\r\n\t\t  leaveAll = 1;\r\n\t\t  break;\r\n\t\t}\r\n\t  }\r\n\r\n      break;\r\n\r\n    justCheck:\r\n    case BREAK_FORCMD:         /* FOR commands are part of batch processing */\r\n      if (leaveAll)\r\n        return 1;\r\n      /* fall through */\r\n\r\n    case BREAK_INPUT:\r\n      if (!ctrlBreak)\r\n        return 0;\r\n      break;\r\n  }\r\n\r\n  ctrlBreak = 0;                /* state processed */\r\n  return 1;\r\n}\r\n"
  },
  {
    "path": "lib/cbs.c",
    "content": "/* $Id$\r\n\r\n\tCut trailing backslashes\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\n\r\nvoid cutBackslash(char * const s)\r\n{\tchar *p;\r\n\r\n\tassert(s);\r\n\r\n\tp = strchr(s, '\\0');\r\n\r\n\t/* take off trailing \\ if any, but ONLY if dir is not the root dir */\r\n\twhile(p > &s[1] && *--p == '\\\\' && p[-1] != ':')\r\n\t\t*p = '\\0';\r\n}\r\n"
  },
  {
    "path": "lib/cd_dir.c",
    "content": "/* $Id$\r\n * CDD & CD handler\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n#include <stdio.h>\r\n#include <string.h>\r\n#include <io.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../suppl/dfn.h\"\r\n#include \"../include/lfnfuncs.h\"\r\n\r\nint cd_dir(char *param, int cdd, const char * const fctname)\r\n{\tchar **argv, *dir;\r\n\tint argc, opts;\r\n\tint rv, freeDir;\r\n\r\n\tif((argv = scanCmdline(param, 0, 0, &argc, &opts)) == 0)\r\n\t\treturn 1;\r\n\r\n\tfreeDir = 0;\r\n\trv = 1;\r\n\r\n\t/* if doing a CD and no parameters given, print out current directory */\r\n\tif(argc == 0) {\r\n\t\tif((dir = cwd(0)) != 0) {\r\n\t\t\tputs(dir);\r\n\t\t\tfreeDir = 1;\r\n\t\t\tgoto okRet;\r\n\t\t}\r\n\t\tgoto errRet;\r\n\t} else if(argc != 1) {\r\n\t\terror_syntax(0);\r\n\t\tgoto errRet;\r\n\t}\r\n\telse {\r\n\t\tassert(argv[0]);\r\n\r\n#ifdef FEATURE_CDD_FNAME\r\n\t\t/* if path refers to an existing file and not directory, ignore filename portion */\r\n            if (cdd && (dfnstat(argv[0]) & DFN_FILE))\r\n\t\t{\r\n\t\t\tdir = strrchr(argv[0], '\\\\');\r\n\t\t\tif (dir == NULL)\r\n\t\t\t{\r\n\t\t\t\tdir = argv[0];\r\n\t\t\t\tif (dir[1] == ':') dir[2]='\\0';  /* change drive only, no path */\r\n\t\t\t\telse goto okRet;                 /* no drive, no path, so exit early */\r\n\t\t\t}\r\n\t\t\telse /* includes a path or refers to root dir */\r\n\t\t\t{\r\n\t\t\t\t*(dir+1) = '\\0';\r\n\t\t\t}\r\n\t\t}\r\n#endif\r\n\r\n\t\tdir = strchr(argv[0], '\\0');\r\n\t\t/* take off trailing \\ if any, but ONLY if dir is not the root dir */\r\n\t\twhile(dir > &argv[0][1] && *--dir == '\\\\' && dir[-1] != ':')\r\n\t\t\t*dir = '\\0';\r\n\r\n\t\tdir = argv[0];\r\n\r\n#ifdef FEATURE_LAST_DIR\r\n\t\tif(strcmp(dir, \"-\") == 0) {\r\n\t\t\tassert(!freeDir);\r\n\t\t\t/* change to last directory */\r\n\t\t\tlastDirGet(&dir);\r\n\t\t\tfreeDir = 1;\r\n\t\t}\r\n\r\n\t\tlastDirSet();\r\n\t\tif(!dir) \t/* \"CD -\" without a CD before at all */\r\n\t\t\tgoto okRet;\r\n#endif\r\n\t\tif(*dir && dir[1] == ':') {\r\n\t\t\tif(cdd) {\r\n\t\t\t\tif(changeDrive(*dir) != 0)\r\n\t\t\t\t\tgoto errRet;\r\n\t\t\t\tif(!dir[2])\t\t/* only change drive */\r\n\t\t\t\t\tgoto okRet;\r\n\t\t\t} else if(!dir[2]) {\t/* Real CHDIR displays CWD of\r\n\t\t\t\t\t\t\t\t\t\tspecified drive */\r\n\t\t\t\tassert(freeDir == 0);\r\n\r\n\t\t\t\tif((dir = cwd(*dir)) != 0) {\r\n\t\t\t\t\tputs(dir);\r\n\t\t\t\t\tfreeDir = 1;\r\n\t\t\t\t\tgoto okRet;\r\n\t\t\t\t}\r\n\t\t\t\tgoto errRet;\r\n\t\t\t}\r\n\t\t}\r\n\t\tdprintf((\"%s: '%s'\\n\", fctname, dir));\r\n\t\tif(chdir(dir) != 0) {\r\n\t\t\terror_dirfct_failed(fctname, dir);\r\n\t\t\tgoto errRet;\r\n\t\t}\r\n\t}\r\n\r\nokRet:\r\n\trv = 0;\r\nerrRet:\r\n\tfreep(argv);\r\n\tif(freeDir)\r\n\t\tfree(dir);\r\n\treturn rv;\r\n}\r\n"
  },
  {
    "path": "lib/cgetch.c",
    "content": "/*\t$Id$\r\n\r\n\tGet a character out-of-band and honor Ctrl-Break characters\r\n\tInvisible.\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.4  2006/06/12 04:55:42  blairdude\r\n\tAll putchar's now use outc which first flushes stdout and then uses write to write the character to the console.  Some potential bugs have been fixed ( Special thanks to Arkady for noticing them :-) ).  All CONIO dependencies have now been removed and replaced with size-optimized functions (for example, mycprintf, simply opens \"CON\" and directly writes to the console that way, and mywherex and mywherey use MK_FP to access memory and find the cursor position).  FreeCOM is now\r\n\tsignificantly smaller.\r\n\r\n\tRevision 1.3  2006/06/11 06:50:49  blairdude\r\n\tRemoved usage of Turbo C's getch to remove idle ...getch... object modules being compiled in.\r\n\t\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <conio.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/keys.h\"\r\n#include \"../include/misc.h\"\r\n\r\nstatic int mygetch( void )\r\n{\r\n    IREGS regs;\r\n    regs.r_ax = 0x0700;\r\n    intrpt(0x21, &regs);\r\n    return (regs.r_ax)&0xFF;\r\n}\r\n\r\n#define getch mygetch\r\n\r\n\r\nint cgetchar(void)\r\n{\tint c;\r\n\r\n\tif((c = getch()) == 0)\r\n\t\tc = SCANCODE(getch());\t\t/* Scan code */\r\n\r\n\tif(c == KEY_CTL_C) {\r\n\t\tctrlBreak = 1;\r\n\t}\r\n\r\n\treturn c;\r\n}\r\n"
  },
  {
    "path": "lib/cgettime.c",
    "content": "/*\t$Id$\r\n\r\n\tWaits about N secs for a keypress.\r\n\treturns 0 if none else returns key pressed invisibly.\r\n\r\n\tThis file bases on INIT.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <stdio.h>\r\n#include <string.h>\r\n#include <io.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint cgetchar_timed(int secs)\r\n{\r\n\tstruct dostime_t start;\r\n\tstruct dostime_t now;\r\n\tint num;\r\n\tstatic char space[1] = {' '};\r\n\tstatic char backspaces[2] = {'\\b', '\\b'};\r\n\r\n\tstart.second = 60;\t/* force decrement secs first time in loop */\r\n\t++secs;\r\n\twhile(!keypressed()) {\r\n\t\t_dos_gettime(&now);\r\n\t\tif(now.second != start.second) {\r\n\t\t\tif(!--secs)\r\n\t\t\t\treturn 0;\r\n\t\t\tmemcpy(&start, &now, sizeof(now));\r\n\t\t\tprintf(\"%d\", secs);\r\n\t\t\tnum = secs > 8 ? 2 : 1;\r\n\t\t\tif(secs == 9)\r\n\t\t\t\tdos_write(1, space, 1);\r\n\t\t\tdos_write(1, backspaces, num);\r\n\t\t}\r\n\t\tdelay(100);\r\n\t}\r\n\t\t/* Because \"keypressed()\" returned true, getchar() does not block */\r\n\treturn cgetchar();\r\n}\r\n"
  },
  {
    "path": "lib/chgctxt.c",
    "content": "/*\t$Id$\r\n\r\n \tchgCtxt():\r\n *  Insert/replace/delete a case-sensitive variable into the specified\r\n *\tcontext\r\n *\r\n *  If value == NULL, the variable is deleted.\r\n *  If value == \"\", a variable with an empty body is created.\r\n *  If name == \"\", a body with an empty name is created.\r\n *\r\n *  Return: 0 on success;; !0 on failure\r\n\r\n \tchgCtxtRemove():\r\n \t\tas chgEnv(), but value == \"\" deletes the variable, too\r\n\r\n\tThis file bases on ENVIRON.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\r\n\r\n#include <environ.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/context.h\"\r\n#include \"../err_fcts.h\"\r\n\r\n/* Weight two context items which one uses more memory than\r\n\tacutally is allowed to do so */\r\nstatic unsigned long weight(ctxt_info_t *info)\r\n{\tunsigned long n;\r\n\r\n\tn = (unsigned long)info->c_sizecur << 16;\r\n\tn /= (unsigned)info->c_sizemax;\r\n\treturn n;\r\n}\r\n/*\r\n#define weight(info)\t\\\r\n\t(((unsigned)info->c_sizecur << 16) / (unsigned)info->c_sizemax)\r\n\r\n*/\r\n\r\nint chgCtxt(const Context_Tag tag, const char * const name, const char * const value)\r\n{\tword segm, ofs;\r\n\tint newlen;\r\n\r\n\tassert(name);\r\n\tctxtCheckInfoTag(tag);\r\n\r\n\tsegm = ctxtFromTag(tag);\r\n\tassert(segm);\r\n\r\n\tnewlen = value? strlen(name) + strlen(value) + 2: 0;\r\n\tif((ofs = env_findVar(segm, name)) != (word)-1)\r\n\t\tnewlen -= env_varlen(segm, ofs);\r\n\r\n\t/* Make sure the context has enough room to add the value to */\r\n\tif(newlen > 0) {\t/* contents size will grow */\r\n\t\tctxt_info_t *hinfo, *dinfo;\r\n\r\n\t\t/* aliases may not exceed sizemax */\r\n\t\tif(tag == CTXT_TAG_ALIAS) {\r\n\t\t\tif(CTXT_INFO(CTXT_TAG_ALIAS, sizemax)\r\n\t\t\t - CTXT_INFO(CTXT_TAG_ALIAS, sizecur) < newlen) {\r\n\t\t\t\terror_alias_out_of_memory();\r\n\t\t\t\treturn E_NoMem;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/* Otherwise a removeable entry is removed;\r\n\t\t\tthose are:\r\n\t\t\t\toldest item of history\r\n\t\t\t\toldest item of dirstack */\r\n\t\thinfo = segm == ctxtFromTag(CTXT_TAG_HISTORY)\r\n\t\t\t? &CTXT_INFO_STRUCT(CTXT_TAG_HISTORY): 0;\r\n\t\tdinfo = segm == ctxtFromTag(CTXT_TAG_DIRSTACK)\r\n\t\t\t? &CTXT_INFO_STRUCT(CTXT_TAG_DIRSTACK): 0;\r\n\t\twhile(env_freeCount(segm) < newlen) {\r\n\t\t\t/* There are two structures that can shrink:\r\n\t\t\t\thistory & dirstack */\r\n\t\t\tif(hinfo && (hinfo->c_sizecur <= hinfo->c_sizemax\r\n\t\t\t\t\t\t\t/* inconsitency of redundant info */\r\n\t\t\t\t\t\t|| hinfo->c_nummin >= hinfo->c_nummax))\r\n\t\t\t\t/* in range -> ignore */\r\n\t\t\t\thinfo = 0;\r\n\t\t\tif(dinfo && (dinfo->c_sizecur <= dinfo->c_sizemax\r\n\t\t\t\t\t\t\t/* inconsitency of redundant info */\r\n\t\t\t\t\t\t|| dinfo->c_nummin >= dinfo->c_nummax))\r\n\t\t\t\t/* in range -> ignore */\r\n\t\t\t\tdinfo = 0;\r\n\t\t\tif(hinfo && dinfo) {\t\t/* Choose one */\r\n\t\t\t\tif(weight(hinfo) < weight(dinfo))\r\n\t\t\t\t\tctxtGet(1, CTXT_TAG_DIRSTACK, ++dinfo->c_nummin, 0);\r\n\t\t\t\telse\r\n\t\t\t\t\tctxtGet(1, CTXT_TAG_HISTORY, ++hinfo->c_nummin, 0);\r\n\t\t\t} else if(dinfo)\r\n\t\t\t\tctxtGet(1, CTXT_TAG_DIRSTACK, ++dinfo->c_nummin, 0);\r\n\t\t\telse if(hinfo)\r\n\t\t\t\tctxtGet(1, CTXT_TAG_HISTORY, ++hinfo->c_nummin, 0);\r\n\t\t\telse { /* no space left */\r\n\t\t\t\terror_context_out_of_memory();\r\n\t\t\t\treturn E_NoMem;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/* return values 1 and 3 are OK */\r\n\tswitch(env_change(segm, name, value)) {\r\n\tcase 2:\t\t\t/* variable to delete not found <-> no problem */\r\n\tcase 1: case 3:   /* var replaced | deleted | inserted ==> OK */\r\n\t\tCTXT_INFO(tag, sizecur) += newlen;\r\n\t\treturn 0;\r\n\tcase 0:       /* Cannot insert */\r\n\t\tdprintf((\"chgCtxt(): out-of-mem shouldn't occure here!\\n\"));\r\n\t\terror_context_out_of_memory();\r\n\t\treturn E_NoMem;\r\n\tdefault:\r\n\t\treturn E_Syntax;\r\n\t}\r\n\r\n}\r\n"
  },
  {
    "path": "lib/chgdrv.c",
    "content": "/*\t$Id$\r\n\r\n\tChange drive and display an appropriate message on error.\r\n\tInput:\t0 == current drive\r\n\t\t\t1..32 == A: ..\r\n\t\t\t'A'.. == A: ..\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.2  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include \"../err_fcts.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n\r\nint changeDrive(int drive)\r\n{\tdrive = drvNum(drive);\r\n\r\n    setdisk(drive);\r\n\r\n    if (getdisk() == drive) \r\n    \treturn 0;\r\n\r\n    error_invalid_drive(drive);\r\n\r\n    return 1;\r\n}\r\n"
  },
  {
    "path": "lib/chgenv.c",
    "content": "/*\t$Id$\r\n\r\n \tchgCtxt():\r\n *  Insert/replace/delete a case-sensitive variable into the specified\r\n *\tcontext\r\n *\r\n *  If value == NULL, the variable is deleted.\r\n *  If value == \"\", a variable with an empty body is created.\r\n *  If name == \"\", a body with an empty name is created.\r\n *\r\n *  Return: 0 on success;; !0 on failure\r\n\r\n \tchgCtxtRemove():\r\n \t\tas chgEnv(), but value == \"\" deletes the variable, too\r\n\r\n\tThis file bases on ENVIRON.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.2  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include <environ.h>\r\n\r\n#include \"../err_fcts.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n\r\nint chgEnv(const char name[], const char value[])\r\n{\r\n\tassert(name);\r\n\r\n\t/* return values 1 and 3 are OK */\r\n\tswitch(env_change(0, name, value)) {\r\n\tcase 2:\t\t\t/* variable to delete not found <-> no problem */\r\n\tcase 1: case 3:   /* var replaced | deleted | inserted ==> OK */\r\n\t\treturn 0;\r\n\tcase 0:       /* Cannot insert */\r\n\t\tif(!inInit)\r\n\t\t\terror_env_var(name);\r\n\t\treturn E_NoMem;\r\n\tdefault:\r\n\t\terror_no_env();\r\n\t\treturn E_Syntax;\r\n\t}\r\n\r\n}\r\n"
  },
  {
    "path": "lib/chgenvc.c",
    "content": "/*\t$Id$\r\n\r\n *  Insert/replace/delete an environment variable\r\n *\r\n *  If the variable already exists within the environment,\r\n *  its case is retained {So one can modify \"winbootdir\", for\r\n *  example}. If the variable shall be added to the environment,\r\n *  but is not (in any case-insensitive match) contained within the\r\n *  environment, the name is uppercased.\r\n *\r\n *  Return: 0 on success\r\n *      !0 on failure\r\n\r\n\tThis file bases on ENVIRON.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\r\n\r\n#include <environ.h>\r\n#include <nls_c.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n\r\nint chgEnvCase(const int keepCase, char var[], const char value[])\r\n{\r\n\tassert(var);\r\n\r\n\tif(!keepCase && (env_matchVar(0, var) & 7) != 0)\r\n\t/* no match --> upcase variable */\r\n\t\tStrUpr(var);\r\n\r\n\treturn chgEnv(var, value);\r\n}\r\n"
  },
  {
    "path": "lib/chgenvr.c",
    "content": "/*\t$Id$\r\n\r\n \tchgEnvRemove():\r\n *  Insert/replace/delete a case-sensitive variable into the specified\r\n *\tcontext\r\n *\r\n *  If value == NULL || *value == 0, the variable is deleted.\r\n *  If name == \"\", a body with an empty name is created.\r\n *\r\n *  Return: 0 on success;; !0 on failure\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include <environ.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n\r\nint chgEnvRemove(const char name[], const char value[])\r\n{\r\n\treturn chgEnv(name, (value && *value)? value: 0);\r\n}\r\n"
  },
  {
    "path": "lib/cmdinput.c",
    "content": "/* $Id$\r\n *  CMDINPUT.C - handles command input (tab completion, history, etc.)\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <conio.h>\r\n#include <dos.h>\r\n#include <stdio.h>\r\n#include <io.h>\r\n#include <string.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/keys.h\"\r\n#include \"../include/misc.h\"\r\n\r\nstatic unsigned orgx, orgy;\t\t/* start of current command input */\r\n\r\n#define MK_PTR(type,seg,ofs) ((type FAR*) MK_FP (seg, ofs))\r\n/* safer edition of MK_FP (Arkady) */\r\ntypedef struct { unsigned char col, row; } SCRPOS;\r\n#define _scr_page      (* MK_PTR (volatile const unsigned char, 0, 0x462))\r\n#define _scr_pos_array    MK_PTR (volatile const SCRPOS, 0, 0x450)\r\nunsigned mywherex (void) {\r\n    return _scr_pos_array [_scr_page].col + 1;\r\n}\r\n\r\nunsigned mywherey (void) {\r\n    return _scr_pos_array [_scr_page].row + 1;\r\n}\r\n\r\n#undef _NOCURSOR\r\n#undef _NORMALCURSOR\r\n#undef _SOLIDCURSOR\r\n#undef _HALFCURSOR\r\n#define _NOCURSOR     3\r\n#define _HALFCURSOR   2\r\n#define _NORMALCURSOR 0\r\n#define _SOLIDCURSOR  1\r\n\r\nstatic void my_setcursortype( unsigned short state )\r\n{\r\n   IREGS regs;\r\n   int cur_mode;\r\n\r\n   regs.r_ax = 0x0F00;\r\n   intrpt( 0x10, &regs );\r\n   cur_mode = regs.r_ax & 0xFF;\r\n   regs.r_ax = 0x0100;\r\n   /* ch == start line. cl == end line */\r\n\r\n   switch (state)\r\n   {\r\n          case _SOLIDCURSOR :\r\n             regs.r_cx = (cur_mode == 7) ? 0x010C : 0x0107;\r\n             break;\r\n          case _NORMALCURSOR:\r\n             regs.r_cx = (cur_mode == 7) ? 0x0B0C : 0x0607;\r\n             break;\r\n#if 0 /* Unused */\r\n          case _NOCURSOR    :\r\n             regs.r_cx = 0x2020;\r\n             break;\r\n          case _HALFCURSOR  :\r\n             regs.r_cx = (cur_mode == 7) ? 0x070C :  0x0407;\r\n             break;\r\n          default           :\r\n             regs.r_cx = state;\r\n             break;\r\n#endif\r\n   }\r\n   intrpt( 0x10, &regs );\r\n}\r\n\r\n#define wherex mywherex\r\n#define wherey mywherey\r\n#define _setcursortype my_setcursortype\r\n\r\nstatic int isworddelimiter(unsigned c)\r\n{\r\n\treturn c == ' ' || c == '\\t';\r\n}\r\n\r\n/* Print a character to current cursor position\r\n\tUpdates cursor postion\r\n */\r\nvoid outc(char c)\r\n{\r\n\tif (c == '\\n') dos_write(1, \"\\r\\n\", 2); else dos_write(1, &c, 1);\r\n}\r\n/* Print a blank to current cursor postion\r\n\tUpdates cursor position\r\n */\r\nstatic void outblank(void)\r\n{\toutc(' ');\r\n}\r\n\r\n/* Print string to current cursor position\r\n\tUpdates cursor position\r\n */\r\nvoid outs(const char * const s)\r\n{\tassert(s);\r\n\tprintf(\"%s\", s);\r\n}\r\n/* Print string to cursor position and append one blank\r\n\tUpdates cursor postion\r\n */\r\nstatic void outsblank(const char * const s)\r\n{\touts(s);\r\n\toutblank();\r\n}\r\n\r\nstatic void clrcmdline(char * const str, const unsigned pos, const int maxlen)\r\n{\r\n\tsize_t len = strlen(str);\r\n\tint x = wherex();\r\n\tint y = wherey();\r\n\r\n\tif(len > 0) {\r\n\t\tunsigned step;\r\n\r\n\t\tfor(step = pos; step > 0; step--) {\r\n\t\t\tx--;\r\n\t\t\tif(x<0) {\r\n\t\t\t\ty--;\r\n\t\t\t\tx=SCREEN_COLS-1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tassert(str);\r\n\t\tgoxy(x, y);\r\n\t\tmemset(str, ' ', len);\r\n\t\tdos_write(1, str, len);\r\n\t\tgoxy(x, y);\r\n\t\tmemset(str, 0, maxlen);\r\n\t}\r\n}\r\n\r\n/* calculates the number of lines to scroll if cursor is initially at position\r\n   curx,cury and cursor is advanced numchars characters */\r\nstatic unsigned numLinesToScroll(const unsigned curx, unsigned cury, const unsigned numchars)\r\n{\r\n\tcury += (curx + numchars - 1) / SCREEN_COLS;\r\n\treturn (cury <= SCREEN_ROWS) ? 0 : cury - SCREEN_ROWS;\r\n}\r\n\r\n/* read in a command line */\r\nvoid readcommandEnhanced(char * const str, const int maxlen)\r\n{\r\n\tunsigned char insert = 1;\r\n\tunsigned ch;\r\n#ifdef FEATURE_FILENAME_COMPLETION\r\n\tunsigned lastch = 0;\r\n#endif\r\n#ifdef FEATURE_HISTORY\r\n\tint histLevel = 0;\r\n\tchar prvLine[MAX_INTERNAL_COMMAND_SIZE] = { '\\0' };\r\n#endif\r\n\tunsigned curx;\r\n\tunsigned cury;\r\n\tunsigned lines;\r\n\tint count;\r\n\tunsigned current = 0;\r\n\tunsigned charcount = 0;\r\n\r\n\tassert(str);\r\n\tassert(maxlen <= MAX_INTERNAL_COMMAND_SIZE);\r\n\r\n\t/* if echo off, don't print prompt */\r\n\tif(echo)\r\n\t\tprintprompt();\r\n\r\n\torgx = wherex();\r\n\torgy = wherey();\r\n\r\n\tmemset(str, 0, maxlen);\r\n\r\n\t_setcursortype(_NORMALCURSOR);\r\n\r\n#ifdef FEATURE_HISTORY\r\n\thistGet(histLevel - 1, prvLine, sizeof(prvLine));\r\n#endif\r\n\r\n\tdo {\r\n\t\tch = cgetchar();\r\n\r\n\t\tif(cbreak)\r\n\t\t\tch = KEY_CTL_C;\r\n\r\n\t\tswitch(ch) {\r\n\t\tcase KEY_BS:               /* delete character to left of cursor */\r\n\r\n\t\t\tif(current > 0 && charcount > 0) {\r\n\t\t\t  if(current == charcount) {     /* if at end of line */\r\n\t\t\t\tstr[current - 1] = 0;\r\n\t\t\t\tif (wherex() != 1)\r\n\t\t\t\t  outs(\"\\b \\b\");\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t  goxy(MAX_X, wherey() - 1);\r\n\t\t\t\t  outblank();\r\n\t\t\t\t  goxy(MAX_X, wherey() - 1);\r\n\t\t\t\t}\r\n\t\t\t  }\r\n\t\t\t  else\r\n\t\t\t  {\r\n\t\t\t\tfor (count = current - 1; count < charcount; count++)\r\n\t\t\t\t  str[count] = str[count + 1];\r\n\t\t\t\tif (wherex() != 1)\r\n\t\t\t\t  goxy(wherex() - 1, wherey());\r\n\t\t\t\telse\r\n\t\t\t\t  goxy(MAX_X, wherey() - 1);\r\n\t\t\t\tcurx = wherex();\r\n\t\t\t\tcury = wherey();\r\n\t\t\t\toutsblank(&str[current - 1]);\r\n\t\t\t\tgoxy(curx, cury);\r\n\t\t\t  }\r\n\t\t\t  charcount--;\r\n\t\t\t  current--;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase KEY_INSERT:           /* toggle insert/overstrike mode */\r\n\t\t\tinsert ^= 1;\r\n\t\t\tif (insert)\r\n\t\t\t  _setcursortype(_NORMALCURSOR);\r\n\t\t\telse\r\n\t\t\t  _setcursortype(_SOLIDCURSOR);\r\n\t\t\tbreak;\r\n\r\n\t\tcase KEY_DELETE:           /* delete character under cursor */\r\n\r\n\t\t\tif (current != charcount && charcount > 0)\r\n\t\t\t{\r\n\t\t\t  for (count = current; count < charcount; count++)\r\n\t\t\t\tstr[count] = str[count + 1];\r\n\t\t\t  charcount--;\r\n\t\t\t  curx = wherex();\r\n\t\t\t  cury = wherey();\r\n\t\t\t  outsblank(&str[current]);\r\n\t\t\t  goxy(curx, cury);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase KEY_HOME:             /* goto beginning of string */\r\n\r\n\t\t\tif (current != 0)\r\n\t\t\t{\r\n\t\t\t  goxy(orgx, orgy);\r\n\t\t\t  current = 0;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase KEY_END:              /* goto end of string */\r\n\r\n\t\t\tif (current != charcount)\r\n\t\t\t{\r\n\t\t\t  goxy(orgx, orgy);\r\n\t\t\t  outs(str);\r\n\t\t\t  current = charcount;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n#ifdef FEATURE_FILENAME_COMPLETION\r\n\t\tcase KEY_TAB:\t\t /* expand current file name */\r\n\t\t\tif(current == charcount) {      /* only works at end of line */\r\n\t\t\t  if(lastch != KEY_TAB) { /* if first TAB, complete filename */\r\n\t\t\t\tcomplete_filename(str, charcount);\r\n\t\t\t\tcharcount = strlen(str);\r\n\t\t\t\tcurrent = charcount;\r\n\t\t\t\tgoxy(orgx, orgy);\r\n\t\t\t\touts(str);\r\n\t\t\t\torgy -= numLinesToScroll(orgx, orgy, charcount);\r\n\t\t\t  } else {                 /* if second TAB, list matches */\r\n\t\t\t\tif (show_completion_matches(str, charcount))\r\n\t\t\t\t{\r\n\t\t\t\t  printprompt();\r\n\t\t\t\t  orgx = wherex();\r\n\t\t\t\t  orgy = wherey();\r\n\t\t\t\t  outs(str);\r\n\t\t\t\t  orgy -= numLinesToScroll(orgx, orgy, charcount);\r\n\t\t\t\t}\r\n\t\t\t  }\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t  beep();\r\n\t\t\tbreak;\r\n#endif\r\n\r\n\t\tcase KEY_ENTER:            /* end input, return to main */\r\n\t\t\tif (current != charcount) {\r\n\t\t\t\t/* make sure we locate cursor to end of command before \r\n\t\t\t\t   spawning process */\r\n\t\t\t\tgoxy(orgx, orgy);\r\n\t\t\t\touts(str);\r\n\t\t\t}\r\n\r\n#ifdef FEATURE_HISTORY\r\n\t\t\tif(str[0])\r\n\t\t\t  histSet(0, str);      /* add to the history */\r\n#endif\r\n\r\n\t\t\toutc('\\n');\r\n\t\t\tbreak;\r\n\r\n\t\tcase KEY_CTL_C:       \t\t/* ^C */\r\n\t\tcase KEY_ESC:              /* clear str  Make this callable! */\r\n\r\n\t\t\tclrcmdline(str, current, maxlen);\r\n\t\t\tcurrent = charcount = 0;\r\n\r\n\t\t\tif(ch == KEY_CTL_C && !echo) {\r\n\t\t\t  /* enable echo to let user know that's this\r\n\t\t\t\tis the command line */\r\n\t\t\t  echo = 1;\r\n\t\t\t  printprompt();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase KEY_RIGHT:            /* move cursor right */\r\n\r\n\t\t\tif (current != charcount)\r\n\t\t\t{\r\n\t\t\t  current++;\r\n\t\t\t  if (wherex() == MAX_X)\r\n\t\t\t\tgoxy(1, wherey() + 1);\r\n\t\t\t  else\r\n\t\t\t\tgoxy(wherex() + 1, wherey());\r\n\t\t\t  break;\r\n\t\t\t}\r\n\t\t\t/* cursor-right at end of string grabs the next character\r\n\t\t\t\tfrom the previous line */\r\n\t\t\t/* FALL THROUGH */\r\n\r\n#ifndef FEATURE_HISTORY\r\n\t\t\tbreak;\r\n#else\r\n\t\tcase KEY_F1:       /* get character from last command buffer */\r\n\t\t\t  if (current < strlen(prvLine)) {\r\n\t\t\t\t outc(str[current] = prvLine[current]);\r\n\t\t\t\t charcount = ++current;\r\n\t\t\t  }\r\n\t\t\t  break;\r\n\t\t\t  \r\n\t\tcase KEY_F3:               /* get previous command from buffer */\r\n\t\t\tif(charcount < strlen(prvLine)) {\r\n\t\t\t\touts(strcpy(&str[charcount], &prvLine[charcount]));\r\n\t\t\t   current = charcount = strlen(str);\r\n\t\t\t\torgy -= numLinesToScroll(orgx, orgy, charcount);\r\n\t\t   }\r\n\t\t   break;\r\n\r\n\t\tcase KEY_UP:               /* get previous command from buffer */\r\n\t\t\tif(!histGet(--histLevel, prvLine, sizeof(prvLine)))\r\n\t\t\t\t++histLevel;\t\t/* failed -> keep current command line */\r\n\t\t\telse {\r\n\t\t\t\tclrcmdline(str, current, maxlen);\r\n\t\t\t\tstrcpy(str, prvLine);\r\n\t\t\t\tcurrent = charcount = strlen(str);\r\n\t\t\t\torgy -= numLinesToScroll(orgx, orgy, charcount);\r\n\t\t\t\touts(str);\r\n\t\t\t\thistGet(histLevel - 1, prvLine, sizeof(prvLine));\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase KEY_DOWN:             /* get next command from buffer */\r\n\t\t\tif(histLevel) {\r\n\t\t\t\tclrcmdline(str, current, maxlen);\r\n\t\t\t\tstrcpy(prvLine, str);\r\n\t\t\t\thistGet(++histLevel, str, maxlen);\r\n\t\t\t\tcurrent = charcount = strlen(str);\r\n\t\t\t\torgy -= numLinesToScroll(orgx, orgy, charcount);\r\n\t\t\t\touts(str);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase KEY_F5: /* keep cmdline in F3/UP buffer and move to next line */\r\n\t\t\tstrcpy(prvLine, str);\r\n\t\t\tclrcmdline(str, current, maxlen);\r\n\t\t\toutc('@');\r\n\t\t\tif(orgy >= MAX_Y) {\r\n\t\t\t\toutc('\\n');\t\t\t/* Force scroll */\r\n\t\t\t\torgy = MAX_Y;\r\n\t\t\t} else {\r\n\t\t\t\t++orgy;\r\n\t\t\t}\r\n\t\t\tgoxy(orgx, orgy);\r\n\t\t\tcurrent = charcount = 0;\r\n\r\n\t\t\tbreak;\r\n\r\n#endif\r\n\r\n\t\tcase KEY_LEFT:             /* move cursor left */\r\n\t\t\tif(current > 0) {\r\n\t\t\t  current--;\r\n\t\t\t  if (wherex() == 1)\r\n\t\t\t\tgoxy(MAX_X, wherey() - 1);\r\n\t\t\t  else\r\n\t\t\t\tgoxy(wherex() - 1, wherey());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase KEY_CTRL_LEFT:\t/* move cursor left to begin of word */\r\n\t\t\twhile(current > 0) {\r\n\t\t\t  current--;\r\n\t\t\t  if (wherex() == 1)\r\n\t\t\t\tgoxy(MAX_X, wherey() - 1);\r\n\t\t\t  else\r\n\t\t\t\tgoxy(wherex() - 1, wherey());\r\n\r\n\t\t\t  if(isworddelimiter(str[current-1])\t/* ignore current == 0 */\r\n\t\t\t   && !isworddelimiter(str[current]))\r\n\t\t\t     break;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tcase KEY_CTRL_RIGHT:\t/* move cursor right to begin of word */\r\n\t\t\twhile(current < charcount) {\r\n\t\t\t  current++;\r\n\t\t\t  if (wherex() == MAX_X)\r\n\t\t\t\tgoxy(1, wherey() + 1);\r\n\t\t\t  else\r\n\t\t\t\tgoxy(wherex() + 1, wherey());\r\n\r\n\t\t\t  if(isworddelimiter(str[current-1])\r\n\t\t\t   && !isworddelimiter(str[current]))\r\n\t\t\t     break;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:                 /* insert character into string... */\r\n\r\n\t\t\tif ((ch >= 32 && ch <= 255) && (charcount != (maxlen - 2)))\r\n\t\t\t{\r\n\t\t\t  if (insert && current != charcount)\r\n\t\t\t  {\r\n\t\t\t\tfor (count = charcount; count > current; count--)\r\n\t\t\t\t  str[count] = str[count - 1];\r\n\t\t\t\tstr[current++] = ch;\r\n\t\t\t\tcharcount++;\r\n\t\t\t\tcurx = wherex() + 1;\r\n\t\t\t\tcury = wherey();\r\n\t\t\t\tif (curx > MAX_X) { curx = 1; cury++; };\r\n\t\t\t\touts(&str[current - 1]);\r\n\t\t\t\tlines = numLinesToScroll(orgx, orgy, charcount);\r\n\t\t\t\tcury -= lines;\r\n\t\t\t\torgy -= lines;\r\n\t\t\t\tgoxy(curx, cury);\r\n\t\t\t  }\r\n\t\t\t  else\r\n\t\t\t  {\r\n\t\t\t\tif (current == charcount)\r\n\t\t\t\t  charcount++;\r\n\t\t\t\tstr[current++] = ch;\r\n\t\t\t\toutc(ch);\r\n\t\t\t\tlines = numLinesToScroll(orgx, orgy, charcount);\r\n\t\t\t\torgy -= lines;\r\n\t\t\t  }\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t  beep();\r\n\t\t\tbreak;\r\n\t\t}\r\n#ifdef FEATURE_FILENAME_COMPLETION\r\n\t\tlastch = ch;\r\n#endif\r\n\t} while(ch != KEY_ENTER);\r\n\r\n\t_setcursortype(_NORMALCURSOR);\r\n}\r\n"
  },
  {
    "path": "lib/comfile.c",
    "content": "/*\t$Id$\r\n\r\n *  Return the absolute filename of the current COMMAND shell\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n\r\nchar *comFile(void)\r\n{ char *fnam;\r\n  \r\n  if(inInit || (fnam = getEnv(\"COMSPEC\")) == 0) {\r\n    /* ComPath may be a NULL reference */\r\n\tif (!ComPath) return strdup(\"\");\r\n    return strdup(ComPath);\r\n  }\r\n  \r\n  return fnam;\r\n}\r\n"
  },
  {
    "path": "lib/compfile.c",
    "content": "/*\t$Id$\r\n\r\n * Construct the path of a file to be located in the same directory\r\n *  as COMMAND.\r\n *  Dynamically allocated.\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:52  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include <dfn.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nchar *comPathFile(const char * fnam)\r\n{ char *com, *h;\r\n  unsigned pathLen;\r\n\r\n  assert(fnam);\r\n\r\n  if((com = comFile()) == 0)\r\n    return strdup(fnam);\r\n\r\n  h = malloc((pathLen = dfnfilename(com) - com) + strlen(fnam) + 1);\r\n  if(!h)\r\n    return 0;\r\n\r\n  memcpy(h, com, pathLen);\r\n  strcpy(h + pathLen, fnam);\r\n  free(com);\r\n\r\n  return h;\r\n}\r\n"
  },
  {
    "path": "lib/critend.c",
    "content": "/*\t$Id$\r\n\r\n\tDisplay the result of a CRITER repeat check autofail\r\n\r\n\t$Log$\r\n\tRevision 1.1  2004/09/13 18:59:39  skaus\r\n\tadd: CRITER: Repeat check autofail magic {Tom Ehlert/Eric Auer}\r\n\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\nvoid critEndRepCheck(void)\r\n{\tunsigned critCount;\r\n\r\n\tif(0 != (critCount = critDisableRepeatCheck())) {\r\n\t\tdisplayString(TEXT_HIDDEN_CRITER, critCount);\r\n\t}\r\n}\r\n"
  },
  {
    "path": "lib/critrchk.c",
    "content": "/*\t$Id$\r\n\r\n\tCriter repeat check interface\r\n\r\n\t$Log$\r\n\tRevision 1.4  2006/07/02 08:15:10  blairdude\r\n\t#if 0'd out 2 unused functions.\r\n\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\t\r\n\t\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\t\r\n\tRevision 1.2  2005/12/10 10:09:43  perditionc\r\n\tbased on patches from Blair Campbell, additional LFN support (slim print,\r\n\tadd initial cd,rd,md support, make compile time optional), remove some\r\n\tcompiler warnings, and prevent extra linebreak for compatibility\r\n\t\r\n\tRevision 1.1  2004/09/13 18:59:39  skaus\r\n\tadd: CRITER: Repeat check autofail magic {Tom Ehlert/Eric Auer}\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <stdlib.h>\r\n\r\n#include <dynstr.h>\r\n#include <fmemory.h>\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nstatic word far *repCheckAddr = 0;\r\nstatic int drives = 0;\r\n#define chkByteArea ((byte far *)(&repCheckAddr[1]))\r\n\r\nvoid registerCriterRepeatCheckAddr(word far *p)\r\n{\r\n\tif(p) {\r\n\t\tif(*p == (unsigned)-1) {\r\n\t\t\tbyte far *q = (byte far *)(&p[1]);\r\n\r\n\t\t\twhile(*q == (byte)-1) {\r\n\t\t\t\t++drives;\r\n\t\t\t\t++q;\r\n\t\t\t}\r\n\t\t\tdprintf((\"[CRITER: Repeat check addr %Fp, drives = %u]\\n\", p, drives));\r\n\t\t\tif(drives)\r\n\t\t\t\trepCheckAddr = p;\r\n\t\t} else {\r\n\t\t\tdprintf((\"[CRITER: Invalid repeat check addr given: %Fp]\\n\", p));\r\n\t\t}\r\n\t}\r\n}\r\n\r\n#if 0 /* Unused?? */\r\nvoid critEnableRepeatCheck(void)\r\n{\r\n\tif(drives) {\r\n\t\tassert(repCheckAddr);\r\n\t\t_fmemset(chkByteArea, -1, drives);\r\n\t\t*repCheckAddr = 0;\r\n\t\tdprintf((\"{CRITER: Enabled repeat check]\\n\"));\r\n\t}\r\n}\r\nunsigned critDisableRepeatCheck(void)\r\n{\tif(drives) {\r\n\t\tunsigned count = *repCheckAddr;\r\n\r\n\t\tassert(repCheckAddr);\r\n\t\t*repCheckAddr = (unsigned)-1;\r\n\t\tdprintf((\"{CRITER: Disabled repeat check: count = %u]\\n\", count));\r\n\t\treturn count;\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n#endif\r\n#if 0\r\nchar *critDriveReport(void)\r\n{\tif(drives) {\r\n\t\tchar *rep = malloc(drives + 1);\r\n\r\n\t\tif(rep) {\r\n\t\t\tint i;\r\n\t\t\tassert(repCheckAddr);\r\n\t\t\tassert(drives > 0 && drives < 256);\r\n\r\n\t\t\t*rep = drives;\r\n\t\t\t_fmemcpy(&rep[1], chkByteArea, drives);\r\n\t\t\tfor(i = 1; i <= drives; ++i)\r\n\t\t\t\t ++rep[i];\r\n\r\n\t\t\treturn rep;\r\n\t\t} else\r\n\t\t\terror_out_of_memory();\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n#endif\r\n"
  },
  {
    "path": "lib/ctxt.c",
    "content": "/* $Id$\r\n\r\n\tDynamic context of the FreeCOM instance\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/context.h\"\r\n\r\nctxt_t ctxt = 0;\r\n"
  },
  {
    "path": "lib/ctxt_adr.c",
    "content": "/* $Id$\r\n\r\n\tReturns the far address to the value of a specified tag item\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\r\n\r\n#include <environ.h>\r\n\r\n#include \"../include/context.h\"\r\n\r\nchar far*ctxtAddress(const Context_Tag tag, const unsigned num)\r\n{\tchar name[CTXT_ITEMNAME_LENGTH];\r\n\tword ofs, segm;\r\n\r\n\tctxtMkItemName(name, tag, num);\r\n\tsegm = ctxtFromTag(tag);\r\n\tassert(segm && segm != CTXT_INVALID);\r\n\tif((ofs = env_findVar(segm, name)) != (word)-1)\r\n\t\treturn MK_FP(segm, ofs + strlen(name) + 1);\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "lib/ctxt_as.c",
    "content": "/* $Id$\r\n\r\n\tAdd status entry of a tag into context\r\n\r\n\tsilent\r\n\r\n\tThe status is sizemax encoded like this:\r\n\t\tsizemax | 0x8001\r\n\t--> neither of the bytes can become 0\r\n\r\n\tReturn:\r\n\t\tE_None on success\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <limits.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/context.h\"\r\n\r\n#if UINT_MAX != 65535U\r\n#error \"sizeof(unsigned) != 2 is not supported\"\r\n#endif\r\n\r\nint ctxtAddStatus(const Context_Tag tag)\r\n{\r\n\tchar value[3];\r\n\r\n\tctxtCheckInfoTag(tag);\r\n\r\n\t*(unsigned*)value = CTXT_INFO(tag, sizemax) | 0x8001;\r\n\tvalue[sizeof(unsigned)] = 0;\r\n\r\n\r\n\treturn ctxtSet(tag, 0, value);\r\n}\r\n"
  },
  {
    "path": "lib/ctxt_chg.c",
    "content": "/* $Id$\r\n\r\n\tChange the size of the local context. It will never shrink\r\n\tso that stored data is corrupted. If necessary, the context\r\n\tis relocated to another physical location.\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <environ.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/context.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nint ctxtChgSize(unsigned tosize)\r\n{\tctxt_t new_context;\r\n\r\n\tassert(tosize);\r\n\r\n\tenv_resizeCtrl = ENV_USEUMB | ENV_FIRSTFIT | ENV_ALLOWMOVE;\r\n  if(forceLow)\r\n\t  env_resizeCtrl &= ~ENV_USEUMB;\r\n\tnew_context = ctxt? env_setsize(ctxt, tosize)\t/* alter context */\r\n\t                  : env_create(tosize);\t\t\t/* new context */\r\n\r\n\tif(new_context) {\r\n\t\tctxt = new_context;\r\n\t\treturn E_None;\r\n\t}\r\n\r\n\terror_out_of_memory();\r\n\treturn E_NoMem;\r\n}\r\n"
  },
  {
    "path": "lib/ctxt_clr.c",
    "content": "/* $Id$\r\n\r\n\tClear all items of a specified context tag\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <environ.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n\r\nstatic int clear(void *arg, word segm, word ofs)\r\n{\r\n\tassert(segm);\r\n\tassert(ofs != 0xffff);\r\n\r\n\twhile(ctxtProbeItemTag(segm, ofs, arg))\r\n\t \tenv_subVarOffset(segm, ofs);\r\n\r\n\treturn 0;\t\t/* proceed loop */\r\n}\r\n\r\nint ctxtClear(const Context_Tag tag)\r\n{\tctxt_info_t *info;\r\n\r\n\tctxtCheckInfoTag(tag);\r\n\tassert(ctxtFromTag(tag) != CTXT_INVALID);\r\n\r\n\t/* Clear the useage information */\r\n\tinfo = &CTXT_INFO_STRUCT(tag);\r\n\tinfo->c_sizecur = 0;\r\n\tinfo->c_nummax = info->c_nummin= 0;\r\n\r\n\t/* Clear the items within the context */\r\n\treturn env_forAll(ctxtFromTag(tag), clear, (void*)tag);\r\n}\r\n"
  },
  {
    "path": "lib/ctxt_get.c",
    "content": "/* $Id$\r\n\r\n\tGet the n'th item of the specified context tag.\r\n\tIt is duplicated into dynamic memory.\r\n\r\n\tReturns:\t0: OK\r\n\t\t\t\t1: no such item\r\n\t\t\t\t2: out of memory\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\r\n\r\n#include \"environ.h\"\r\n#include \"fmemory.h\"\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n\r\nint ctxtGet (const int remove, const Context_Tag tag,\r\n             const unsigned num, char ** const buf) {\r\n        word ofs, segm;\r\n\tchar name[CTXT_ITEMNAME_LENGTH];\r\n\r\n\tctxtCheckInfoTag(tag);\r\n\tassert(ctxtFromTag(tag) != CTXT_INVALID);\r\n\r\n\tsegm = (word)ctxtFromTag(tag);\r\n\tassert(segm);\r\n\tctxtMkItemName(name, tag, num);\r\n\tif((ofs = env_findVar(segm, name)) != (word)-1) {\r\n\t\tassert(peekb(segm, ofs + strlen(name)) == '=');\r\n\t\tif(buf) {\t\t/* Retreive the contents */\r\n\t\t\tif((*buf = _fdupstr(MK_FP(segm, ofs + strlen(name) + 1))) == 0)\r\n\t\t\t\treturn 2;\t\t/* out of memory */\r\n\t\t}\r\n\t\tif(remove) {\t/* remove the item from context */\r\n\t\t\tif(CTXT_INFO(tag, sizecur) < env_varlen(segm, ofs))\r\n\t\t\t\tCTXT_INFO(tag, sizecur) = 0;\t/* inconsistent redundant\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tinformation */\r\n\t\t\telse\r\n\t\t\t\tCTXT_INFO(tag, sizecur) -= env_varlen(segm, ofs);\r\n\t\t\tenv_subVarOffset(segm, ofs);\r\n\t\t}\r\n\t\treturn 0;\r\n\t}\r\n\r\n\treturn 1;\t\t/* No such item */\r\n}\r\n"
  },
  {
    "path": "lib/ctxt_inf.c",
    "content": "/* $Id$\r\n\r\n\tContext status information \r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/context.h\"\r\n\r\nctxt_info_t ctxt_info[] = {\r\n\t/* CTXT_TAG_HISTORY */\r\n\t{ HISTORY_DEFAULT_SIZE, 0, 0, 0 }\r\n\t/* CTXT_TAG_DIRSTACK */\r\n\t,{ DIRSTACK_DEFAULT_SIZE, 0, 0, 0 }\r\n\t/* CTXT_TAG_BATCH \t\t-- sizemax is just a hint */\r\n\t,{ BATCH_NESTLEVEL_MIN, 0, 0, 0 }\r\n\t/* CTXT_TAG_LASTDIR */\r\n\t,{ (unsigned)-1, 0, 0, 0 }\r\n\t/* CTXT_TAG_SWAPINFO */\r\n\t,{ (unsigned)-1, 0, 0, 0 }\r\n/* pseudo entries */\r\n\t/* CTXT_TAG_ALIAS */\r\n\t,{ ALIAS_DEFAULT_SIZE, 0, 0, 0 }\r\n};\r\n\r\n#ifdef __TURBOC__\r\n#if sizeof(ctxt_info) / sizeof(ctxt_info_t) != CTXT_TAG_ALIAS - CTXT_FIRST_TAG + 1\r\n#error \"Not all tags have an ctxt_info entry\"\r\n#endif\r\n#endif\r\n"
  },
  {
    "path": "lib/ctxt_mk.c",
    "content": "/* $Id$\r\n\r\n\tCreate local context\r\n\r\n\tThe size is currently fixed to the default sizes of stuff\r\n\tlocated into the context: Aliases, History, Dirstack and a\r\n\testimated size for batch nesting, shell and external program\r\n\tcommand line\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/context.h\"\r\n#include \"../include/crossjmp.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nvoid ctxtCreate(void)\r\n{\tunsigned long length;\r\n\r\n\tlength =\r\n\t\tMAX_FNAME\t\t\t/* filename of shell */\r\n\t\t+ MAX_FNAME\t\t\t/* filename of external program */\r\n\t\t+ CTXT_INFO(CTXT_TAG_BATCH, sizemax) * (MAX_FNAME + 10)\r\n#ifdef FEATURE_LAST_DIR\r\n\t\t+ MAX_FNAME\r\n#endif\r\n#ifdef FEATURE_ALIASES\r\n\t\t+ CTXT_INFO(CTXT_TAG_ALIAS, sizemax)\r\n#endif\r\n#ifdef FEATURE_HISTORY\r\n\t\t+ CTXT_INFO(CTXT_TAG_HISTORY, sizemax)\r\n#endif\r\n#ifdef FEATURE_DIRSTACK\r\n\t\t+ CTXT_INFO(CTXT_TAG_DIRSTACK, sizemax)\r\n#endif\r\n\t;\r\n\r\n\tif(length > CONTEXT_MAX_SIZE) {\r\n\t\terror_context_length(length, CONTEXT_MAX_SIZE);\r\n\t\tlength = CONTEXT_MAX_SIZE;\r\n\t}\r\n\tctxtCreateMemBlock((unsigned)length);\r\n#if 0\r\n\tenv_resizeCtrl = ENV_USEUMB | ENV_ALLOWMOVE | ENV_LASTFIT;\r\n  if(forceLow)\r\n\t  env_resizeCtrl &= ~ENV_USEUMB;\r\n\tif((ctxt = env_create((unsigned)length)) == 0) {\r\n\t\terror_out_of_dos_memory();\r\n\t\tjmp_fatal(E_NoMem);\r\n\t}\r\n\tdprintf((\"[MEM: create context: %u bytes @0x%04x]\\n\"\r\n\t , (unsigned)length, ctxt));\r\n#endif\r\n\r\n\tif(ctxtAddStatus(CTXT_TAG_BATCH)\r\n#ifdef FEATURE_ALIASES\r\n\t || ctxtAddStatus(CTXT_TAG_ALIAS)\r\n#endif\r\n#ifdef FEATURE_HISTORY\r\n\t || ctxtAddStatus(CTXT_TAG_HISTORY)\r\n#endif\r\n#ifdef FEATURE_DIRSTACK\r\n\t || ctxtAddStatus(CTXT_TAG_DIRSTACK)\r\n#endif\r\n\t) {\r\n\t\terror_context_add_status();\r\n\t\tjmp_fatal(E_CorruptMemory);\r\n\t}\r\n}\r\n"
  },
  {
    "path": "lib/ctxt_mkb.c",
    "content": "/* $Id$\r\n\tCreates a block of memory suiteable to hold the\r\n\tcontext.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/06/29 21:57:20  skaus\r\n\tfix: /LOW option\r\n\r\n\tRevision 1.1  2002/11/12 18:31:57  skaus\r\n\tadd: save/restore session (swap context) {Tom Ehlert}\r\n\t\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include <environ.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/context.h\"\r\n#include \"../include/crossjmp.h\"\r\n#include \"../err_fcts.h\"\r\n\r\n\r\nvoid ctxtCreateMemBlock(unsigned length)\r\n{\r\n\tenv_resizeCtrl = ENV_USEUMB | ENV_ALLOWMOVE | ENV_LASTFIT;\r\n  if(forceLow)\r\n\t  env_resizeCtrl &= ~ENV_USEUMB;\r\n\tif((ctxt = env_create((unsigned)length)) == 0) {\r\n\t\terror_out_of_dos_memory();\r\n\t\tjmp_fatal(E_NoMem);\r\n\t}\r\n\tdprintf((\"[MEM: create context: %u bytes @0x%04x]\\n\"\r\n\t , (unsigned)length, ctxt));\r\n}\r\n"
  },
  {
    "path": "lib/ctxt_mkn.c",
    "content": "/* $Id$\r\n\r\n\tCreate an item name.\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdio.h>\r\n\r\n#include \"../include/context.h\"\r\n\r\nvoid ctxtMkItemName(char * const name\r\n\t, const Context_Tag tag\r\n\t, const unsigned num)\r\n{\tassert(name);\r\n\r\n\tif(num)\r\n\t\tsprintf(name, \"%c%04x\", (unsigned char)tag, num);\r\n\telse {\r\n\t\t*name = (unsigned char)tag;\r\n\t\tname[1] = 0;\r\n\t}\r\n}\r\n"
  },
  {
    "path": "lib/ctxt_pop.c",
    "content": "/* $Id$\r\n\r\n\tPops the last added entry of the specified context tag.\r\n\tIt is duplicated into dynamic memory.\r\n\r\n\tReturns:\ttrue on success\r\n\t\telse displays any appropriate error message except \"empty\"\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include <environ.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nint ctxtPop(const Context_Tag tag, char ** const Xbuf)\r\n{\tctxt_info_t *info;\r\n\tchar *buf;\r\n\r\n\tctxtCheckInfoTag(tag);\r\n\tassert(Xbuf);\r\n\r\n\tinfo = &CTXT_INFO_STRUCT(tag);\r\n\twhile(info->c_nummax > info->c_nummin)\r\n\t\tswitch(ctxtGet(1, tag, info->c_nummax--, &buf)) {\r\n\t\tcase 0:\t\t\t/* OK */\r\n\t\t\t*Xbuf = buf;\r\n\t\t\treturn 1;\r\n\t\tcase 1:\t\t\t/* no such entry */\r\n\t\t\tbreak;\t\t/* --> ifgnore silently */\r\n\t\tcase 2:\t\t\t/* out of memory */\r\n\t\t\terror_out_of_memory();\r\n\t\t\treturn 0;\t/* will case \"context empty\" message */\r\n\t\t}\r\n\r\n\t/* Nothing in the stack ==> make sure it's consistent */\r\n\tctxtClear(tag);\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "lib/ctxt_psh.c",
    "content": "/* $Id$\r\n\r\n\tPushes a new item to the end of the context tag\r\n\r\n\tReturn:\tE_None, E_NoMem, E_NoItems\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/command.h\"\r\n\r\nint ctxtPush(const Context_Tag tag, const char * const buf)\r\n{\tctxt_info_t *info;\r\n\r\n\tctxtCheckInfoTag(tag);\r\n\tassert(buf);\r\n\r\n\tinfo = &CTXT_INFO_STRUCT(tag);\r\n\tif(info->c_nummax == (unsigned)-1) {\r\n\t\t/* numbers will wrap  -> recalculate them */\r\n\t\tctxtRenumberItems(tag);\r\n\t\tif(info->c_nummax == (unsigned)-1)\r\n\t\t\treturn E_NoItems;\r\n\t}\r\n\r\n\tif(ctxtSet(tag, info->c_nummax + 1, buf) == E_None)\r\n\t\treturn E_None;\r\n\r\n\treturn E_NoMem;\r\n}\r\n"
  },
  {
    "path": "lib/ctxt_rnu.c",
    "content": "/* $Id$\r\n\r\n\tRenumbers all items of the context tag\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\r\n\r\n#include <environ.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/command.h\"\r\n\r\nstatic int renumber(void *arg, word segm, word ofs)\r\n{\tchar buf[CTXT_ITEMNAME_LENGTH];\r\n\r\n#define tag (Context_Tag)(int)arg\r\n\r\n\tassert(segm);\r\n\tassert(ofs != (word)-1);\r\n\r\n\tif(ctxtProbeItemTag(segm, ofs, arg)) {\r\n\t\tctxtMkItemName(buf, tag, ++CTXT_INFO(tag, nummax));\r\n\t\tassert(peekb(segm , ofs + strlen(buf)) == '=');\r\n\t\t_fmemcpy(MK_FP(segm, ofs), TO_FP(buf), strlen(buf));\r\n\t}\r\n\r\n#undef tag\r\n\treturn 0;\r\n}\r\n\r\nvoid ctxtRenumberItems(const Context_Tag tag)\r\n{\r\n\tctxtCheckInfoTag(tag);\r\n\tassert(ctxtFromTag(tag) != CTXT_INVALID);\r\n\r\n\tCTXT_INFO(tag, nummin) = CTXT_INFO(tag, nummax) = 0;\r\n\r\n\tenv_forAll(ctxtFromTag(tag), renumber, (void*)tag);\r\n}\r\n"
  },
  {
    "path": "lib/ctxt_set.c",
    "content": "/* $Id$\r\n\r\n\tChanges a context tag item \r\n\r\n\tReturn: E_None on success\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/context.h\"\r\n\r\nint ctxtSet(const Context_Tag tag\r\n\t, const unsigned num\r\n\t, const char * const value)\r\n{\tchar name[CTXT_ITEMNAME_LENGTH];\r\n\tint rc;\r\n\r\n\tctxtMkItemName(name, tag, num);\r\n\tif((rc = chgCtxt(tag, name, value)) == 0) {\r\n\t\t/* Update min/max to reflect the added value */\r\n\t\tif(CTXT_INFO(tag, nummin) > num)\r\n\t\t\tCTXT_INFO(tag, nummin) = num;\r\n\t\tif(CTXT_INFO(tag, nummax) < num)\r\n\t\t\tCTXT_INFO(tag, nummax) = num;\r\n\t}\r\n\treturn rc;\r\n}\r\n"
  },
  {
    "path": "lib/ctxt_ss.c",
    "content": "/* $Id$\r\n\r\n\tScan status from context\r\n\tAssumes that the entries are in \"init\" state!!\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n\r\n#include \"environ.h\"\r\n#include \"../include/context.h\"\r\n\r\nstatic int scan (void * arg, word segm, word ofs) {\r\n        Context_Tag tag;\r\n\tctxt_info_t *info;\r\n\r\n        (void)arg;\r\n\tassert(segm);\r\n\tassert(ofs != (word)-1);\r\n\r\nredo:\r\n\tif((tag = peekb(segm, ofs), ctxtIsInfoTag(tag))) {\r\n\t\tinfo = &CTXT_INFO_STRUCT(tag);\r\n\t\tif(peekb(segm, ofs + 1) == '=' && peekb(segm, ofs + 4) == 0) {\r\n\t\t\t/* status entry */\r\n\t\t\tinfo->c_sizemax = peekw(segm, ofs + 2) & ~0x8001;\r\n\t\t} else {\t\t/* normal entry */\r\n\t\t\tchar far *p = MK_FP(segm, ofs + 1);\r\n\t\t\tunsigned num;\r\n\r\n\t\t\tfor(num = 0; isxdigit(*p); ++p) {\r\n\t\t\t\tnum <<= 8;\r\n\t\t\t\tif(isdigit(*p))\r\n\t\t\t\t\tnum |= *p & 0xf;\r\n\t\t\t\telse {\r\n\t\t\t\t\tassert(islower(*p));\r\n\t\t\t\t\tnum |= *p - 'a' + 10;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(*p == '=') {\r\n\t\t\t\tinfo->c_sizecur += env_varlen(segm, ofs);\r\n\t\t\t\tif(num < info->c_nummin)\r\n\t\t\t\t\tinfo->c_nummin = num;\r\n\t\t\t\tif(num > info->c_nummax)\r\n\t\t\t\t\tinfo->c_nummax = num;\r\n\t\t\t} else {\r\n\t\t\t\t/* Invalid entry -> remove to make room for useful stuff */\r\n\t\t\t\tenv_subVarOffset(segm, ofs);\r\n\t\t\t\tgoto redo;\r\n\t\t\t}\r\n\t\t}\r\n\t} else if(tag > ' ') {\t\t\t/* Alias */\r\n\t\tCTXT_INFO(CTXT_TAG_ALIAS, sizecur) += env_varlen(segm ,ofs);\r\n\t}\r\n\r\n\treturn 0;\t\t/* proceed */\r\n}\r\n\r\nvoid ctxtScanStatus(void)\r\n{\r\n\tassert(ctxt);\r\n\r\n\tenv_forAll(ctxt, scan, 0);\r\n}\r\n"
  },
  {
    "path": "lib/ctxt_vw.c",
    "content": "/* $Id$\r\n\r\n\tView all entries of the specified type\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdio.h>\r\n\r\n#include <environ.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n\r\ntypedef struct {\r\n\tunsigned char tag;\r\n\tunsigned count;\r\n} view_t;\r\n\r\n/* Because new items are appended to the context, the items\r\n\tare automatically sorted ascending */\r\n\r\nstatic int view (void * arg, word segm, word ofs) {\r\n\tassert(segm);\r\n\tif(ctxtProbeItemTag(segm, ofs, ((view_t*)arg)->tag)) {\r\n\t\t++((view_t*)arg)->count;\r\n\t\tprintf(\"%Fs\\n\", MK_FP(segm, ofs + 1));\r\n\t}\r\n\treturn 0;                     /* don't stop */\r\n}\r\n\r\n\r\nint ctxtView(const Context_Tag tag, const unsigned empty)\r\n{\r\n\tint rc;\r\n\tview_t param;\r\n\r\n\tassert(ctxtFromTag(tag) != CTXT_INVALID);\r\n\r\n\tparam.tag = (unsigned char)tag;\r\n\tparam.count = 0;\r\n\r\n\t\t/* return value == 0 --> OK */\r\n\tif((rc = env_forAll(ctxtFromTag(tag), view, (void*)&param)) == 0) {\r\n\t\tif(param.count)\r\n\t\t\tdisplayString(TEXT_MSG_ITEMS_DISPLAYED, param.count);\r\n\t\telse\tdisplayString(empty);\r\n\t}\r\n\r\n\treturn rc;\r\n}\r\n"
  },
  {
    "path": "lib/curdatel.c",
    "content": "/*\t$Id$\r\n\r\n\tGet the current date in a long format (day_of_week date)\r\n\tin a dynamically allocated buffer\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/nls.h\"\r\n#include \"../strings.h\"\r\n\r\nchar *curDateLong(void)\r\n{\r\n\tstruct dosdate_t d;\r\n\tchar *date, *h, *p;\r\n\r\n\t_dos_getdate(&d);\r\n\r\n\tif((date = nls_makedate(0, d.year, d.month, d.day)) == 0) {\r\n\t\terror_out_of_memory();\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tif((h = getString(TEXT_WEEKDAY_SHORT_NAME_SUNDAY + d.dayofweek)) == 0) {\r\n\t\tfree(date);\r\n\t\terror_out_of_memory();\r\n\t\treturn 0;\r\n\t}\r\n\r\n#ifdef FEATURE_NLS\r\n\tp = malloc(strlen(h) + strlen(date) + 4);\r\n\tif (!p) {\r\n\t\tfree(h);\r\n\t\tfree(date);\r\n\t\terror_out_of_memory();\r\n\t\treturn 0;\r\n\t}\r\n\tif (nlsBuf->datefmt == 2) {\r\n\t\tstrcpy(p, date);\r\n\t\tstrcat(p, \" (\");\r\n\t\tstrcat(p, h);\r\n\t\tstrcat(p, \")\");\r\n\t}\r\n\telse {\r\n\t\tstrcpy(p, h);\r\n\t\tstrcat(p, \" \");\r\n\t\tstrcat(p, date);\r\n\t}\r\n\tfree(h);\r\n#else\r\n\tif((p = realloc(h, strlen(h) + strlen(date) + 2)) == 0) {\r\n\t\tfree(h);\r\n\t\tfree(date);\r\n\t\terror_out_of_memory();\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tstrcpy(stpcat(p, \" \"), date);\r\n#endif\r\n\tfree(date);\r\n\r\n\treturn p;\r\n}\r\n"
  },
  {
    "path": "lib/curtime.c",
    "content": "/*\t$Id$\r\n\r\n\tGet the current time in a dynamically allocated buffer\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/nls.h\"\r\n\r\nchar *curTime(void)\r\n{\tchar *time;\r\n\tstruct dostime_t t;\r\n\r\n    _dos_gettime(&t);\r\n\r\n    time = nls_maketime(0, t.hour, t.minute, t.second, t.hsecond);\r\n    if(!time)\r\n    \terror_out_of_memory();\r\n\r\n    return time;\r\n}\r\n"
  },
  {
    "path": "lib/cwd.c",
    "content": "/*\t$Id$\r\n\r\n *\tRetreive the current working directory including drive letter\r\n *\tReturns in a dynamically allocated buffer (free'ed by the caller)\r\n *\ton error: Displays \"out of memory\"\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.2  2004/02/01 13:24:22  skaus\r\n\tbugfix: misidentifying unspecific failures from within SUPPL\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <errno.h>\r\n\r\n#include <dfn.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/misc.h\"\r\n\r\nchar *cwd(int drive)\r\n{\tchar *h;\r\n\r\n\tif((h = dfnpath(drive)) != 0)\r\n\t\treturn h;\r\n\r\n\tswitch(errno) {\r\n\tcase ERANGE:\tdprintf( (\"[FATAL: dfnpath() buffer too small]\\n\") );\r\n\tcase ENOMEM:\terror_out_of_memory(); break;\r\n\tdefault:\t\terror_no_cwd(drive);\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "lib/dateget.c",
    "content": "/*\t$Id$\r\n\r\n\tGet DOS date (for Turbo C prior v3)\r\n\r\n\tThis file bases on DATEFUNC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#ifdef _NO__DOS_DATE\r\n\t/* Use this source only if the compiler does no provide this\r\n\t\tfunction of its own. */\r\n\r\n#include <assert.h>\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <portable.h>\r\n#include \"../include/datefunc.h\"\r\n\r\nvoid _dos_getdate(struct dosdate_t *d)\r\n{\r\n  IREGS r;\r\n\r\n  assert(d);\r\n\r\n  r.r_ax = 0x2A00;\r\n\r\n  intrpt(0x21, &r);\r\n\r\n  d->year = r.r_cx;\r\n  d->month = r.r_dx >> 8;\r\n  d->day = r.r_dx & 0xFF;\r\n  d->dayofweek = r.r_ax & 0xFF;\r\n}\r\n\r\n\r\n#endif                          /* _NO_DATE */\r\n"
  },
  {
    "path": "lib/dateset.c",
    "content": "/*\t$Id$\r\n\r\n\tSet DOS date (for Turbo C prior v3)\r\n\r\n\tThis file bases on DATEFUNC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#ifdef _NO__DOS_DATE\r\n\t/* Use this source only if the compiler does no provide this\r\n\t\tfunction of its own. */\r\n\r\n#include <assert.h>\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <portable.h>\r\n#include \"../include/datefunc.h\"\r\n\r\nunsigned _dos_setdate(struct dosdate_t *d)\r\n{\r\n  IREGS r;\r\n\r\n  assert(d);\r\n  r.r_ax = 0x2B00;\r\n  r.r_cx = d->year;\r\n  r.r_dx = d->month << 8;\r\n  r.r_dx += d->day & 0xFF;\r\n\r\n  intrpt(0x21, &r);\r\n\r\n  if (r.r_ax & 0x00FF)\r\n    return 1;\r\n  return 0;\r\n}\r\n\r\n\r\n#endif                          /* _NO_DATE */\r\n"
  },
  {
    "path": "lib/dbg_c.c",
    "content": "/*\t$Id$\r\n\r\n *  Defines the functions only necessary while debugging is active\r\n\r\n\tThis file bases on DEBUG.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/09/11 00:07:22  blairdude\r\n\tFixed compilation completely with Turbo C\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#ifdef DEBUG\r\n\r\nvoid dbg_outc (int ch) { putc (ch, dbg_logfile); }\r\n\r\n#endif /* DEBUG */\r\n"
  },
  {
    "path": "lib/dbg_mem.c",
    "content": "/*\t$Id$\r\n\r\n *  Defines the functions only necessary while debugging is active\r\n\r\n\tThis file bases on DEBUG.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.5  2006/09/11 00:07:22  blairdude\r\n\tFixed compilation completely with Turbo C\r\n\r\n\tRevision 1.4  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.3  2001/06/11 20:45:38  skaus\r\n\tfix: dbg_printmem() #if must be #ifdef\r\n\t\r\n\tRevision 1.2  2001/06/11 20:33:37  skaus\r\n\tfix: dbg_printmem() if compiled in Large memory model, near is invalid\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#ifdef DEBUG\r\n\r\n#include <conio.h>\t/* cputs */\r\n#ifdef __WATCOMC__\r\n#include <malloc.h>\t/* _heapchk */\r\n#else\r\n#include <alloc.h>\t/* heapcheck, coreleft, farcoreleft */\r\n#endif\r\n#include <stdlib.h>\t/* abort */\r\n#include <dos.h>    /* _dos_allocmem */\r\n\r\n#if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)\r\n#define DISP_NEAR\r\n#endif\r\n\r\nvoid dbg_printmem (void) {\r\n#ifdef DISP_NEAR\r\n\tstatic unsigned nearLast = 0;\r\n#endif\r\n\tstatic unsigned long farLast = 0;\r\n\r\n#ifdef DISP_NEAR\r\n\tunsigned nearThis;\r\n#endif\r\n\tunsigned long farThis;\r\n\r\n#if __TURBOC__ > 0x201 || defined(__WATCOMC__)\r\n#ifdef __WATCOMC__\r\n\tswitch(_heapchk())\r\n#else\r\n\tswitch(heapcheck())\r\n#endif\r\n\t{\r\n#ifdef __WATCOMC__\r\n\tcase _HEAPBADBEGIN:\r\n\tcase _HEAPBADNODE:\r\n\tcase _HEAPEND:\r\n\tcase _HEAPBADPTR:\r\n#else\r\n\tcase _HEAPCORRUPT:\r\n#endif\r\n\t\tcputs(\"HEAP CORRUPTED. Cannot proceed!\\r\\n\");\r\n\t\tabort();\r\n\tcase _HEAPEMPTY:\r\n\t\tcputs(\"NO HEAP. Cannot proceed!\\r\\n\");\r\n\t\tabort();\r\n\tdefault:\r\n\t\tcputs(\"Unknown heapcheck() error. Cannot proceed!\\r\\n\");\r\n\t\tabort();\r\n\tcase _HEAPOK:\r\n\t\tdprintf( (\"HEAP: OK\\r\\n\") );\r\n\t\tbreak;\r\n\t}\r\n#endif\r\n\r\n#ifdef __WATCOMC__\r\n#ifdef DISP_NEAR\r\n\tnearThis = _memavl();\r\n#endif\r\n\t{\r\n\t\tunsigned avail;\t  \r\n\t\t_dos_allocmem(0xffff, &avail);\r\n\t\tfarThis = (unsigned long)avail << 4;\r\n\t}\r\n#else\r\n#ifdef DISP_NEAR\r\n\tnearThis = coreleft();\r\n#endif\r\n\tfarThis = farcoreleft();\r\n#endif\r\n\r\n#ifdef DISP_NEAR\r\n\tdprintf((\"[free memory: near=%6u far=%13lu]\\n\", nearThis, farThis));\r\n\tif(nearLast)\r\n\t\tdprintf((\"[changed    : near=%6d far=%13ld]\\n\"\r\n\t\t , nearThis - nearLast , farThis - farLast));\r\n#else\r\n\tdprintf((\"[free memory: far=%13lu]\\n\", farThis));\r\n\tif(farLast)\r\n\t\tdprintf((\"[changed    : far=%13ld]\\n\", farThis - farLast));\r\n#endif\r\n\r\n#ifdef DISP_NEAR\r\n\tnearLast = nearThis;\r\n#endif\r\n\tfarLast = farThis;\r\n}\r\n\r\n#endif /* DEBUG */\r\n"
  },
  {
    "path": "lib/dbg_prnt.c",
    "content": "/*\t$Id$\r\n\r\n *  Defines the functions only necessary while debugging is active\r\n\r\n\tThis file bases on DEBUG.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/09/11 00:07:22  blairdude\r\n\tFixed compilation completely with Turbo C\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#ifdef DEBUG\r\n\r\n#include <stdarg.h>\r\n#include \"../include/misc.h\"\r\n\r\nFILE *dbg_logfile = stdout;\r\nchar *dbg_logname /*= NULL*/;\r\n\r\nvoid dbg_print(const char fmt[], ...)\r\n{\tva_list ap;\r\n\r\n\tva_start(ap, fmt);\r\n\tvfprintf(dbg_logfile, fmt, ap);\r\n\tva_end(ap);\r\n\tfflush(dbg_logfile);\r\n}\r\n\r\n#endif /* DEBUG */\r\n"
  },
  {
    "path": "lib/dbg_s.c",
    "content": "/*\t$Id$\r\n\r\n *  Defines the functions only necessary while debugging is active\r\n\r\n\tThis file bases on DEBUG.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/09/11 00:07:22  blairdude\r\n\tFixed compilation completely with Turbo C\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:36:10  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#ifdef DEBUG\r\n\r\nvoid dbg_outs (const char *const s) {\r\n\tif (s) {\r\n\t\tfputs (s, dbg_logfile);\r\n\t\tfflush (dbg_logfile);\r\n\t}\r\n}\r\n\r\n#endif /* DEBUG */\r\n"
  },
  {
    "path": "lib/dbg_sn.c",
    "content": "/*\t$Id$\r\n\r\n *  Defines the functions only necessary while debugging is active\r\n\r\n\tThis file bases on DEBUG.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/09/11 00:07:22  blairdude\r\n\tFixed compilation completely with Turbo C\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#ifdef DEBUG\r\n\r\nvoid dbg_outsn (const char *const s) {\r\n\tif (s) fputs (s, dbg_logfile);\r\n\tdbg_outs (\"\\n\");\r\n}\r\n\r\n#endif /* DEBUG */\r\n"
  },
  {
    "path": "lib/delay.c",
    "content": "/*\t$Id: $\r\n\r\n\tdelay function for ia16-elf-gcc with newlib\r\n\tuses _dos_gettime, only for delays < 1 minute (60000 ms)\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#ifdef __GNUC__\r\n\r\n#include <portable.h>\r\n#include \"../include/timefunc.h\"\r\n\r\nvoid delay(unsigned ms)\r\n{\r\n  struct dostime_t t;\r\n  int diff, cnt = -1, v;\r\n\r\n  while (1) {\r\n    _dos_gettime(&t);\r\n    v = 100 * t.second + t.hsecond;\r\n    if (cnt == -1)\r\n      cnt = v;\r\n    diff = v - cnt;\r\n    if (diff < 0) diff += 6000;\r\n    if (diff >= ms/10) break;\r\n    asm volatile (\"int $0x28\");\r\n  }\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "lib/depend.mk",
    "content": "lib .SEQUENTIAL : utils err_fcts.h strings context lib_dir\r\n\r\nlib_dir .SETDIR=lib :\r\n\t@echo Entering $(PWD)\r\n\t$(RUNMAKE) all\r\n\t@echo Leaving $(PWD)\r\n\r\nCLEAN_DEPENDENCIES += lib_clean\r\nlib_clean .SETDIR=lib :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) clean\r\n\t@echo Leaving  $(PWD)\r\n\r\nCLOBBER_DEPENDENCIES += lib_clobber\r\nlib_clobber .SETDIR=lib :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) clobber\r\n\t@echo Leaving  $(PWD)\r\n\r\nDIST_DEPENDENCIES += lib_dist\r\nlib_dist .SETDIR=lib :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) dist\r\n\t@echo Leaving  $(PWD)\r\n"
  },
  {
    "path": "lib/devopen.c",
    "content": "/*\t$Id$\r\n\r\n \tlike open() supporting device names\r\n\r\n\tThis file bases on OPENF.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/06/19 04:12:46  blairdude\r\n\tFile redirection now supports long filenames, bug fixed in __creat_or_truncate\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n#include <io.h>\r\n#include <fcntl.h>\r\n#include <dos.h>\r\n#if defined (__TURBOC__)\r\n# include <dir.h>\r\n#endif\r\n\r\n#include \"../include/openf.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/lfnfuncs.h\"\r\n\r\nint devopen(char *const fnam, int mode)\r\n{\r\n  int fd;\r\n\r\n  isDeviceName(fnam);           /* modify fnam if device */\r\n  fd = -1;\r\n  if((mode & (O_CREAT|O_TRUNC)) != (O_CREAT|O_TRUNC))\r\n    fd = dos_open(fnam, mode & ~(O_APPEND|O_CREAT|O_TRUNC));\r\n  if(fd == -1 && (mode & O_CREAT))\r\n    return dos_creat(fnam, 0);\r\n  if (mode & O_APPEND)\r\n    lseek(fd, 0, SEEK_END);\r\n  return fd;\r\n}\r\n"
  },
  {
    "path": "lib/dfn_err.c",
    "content": "/*\t$Id$\r\n\r\n\tDisplay a nice errno-depend error message for\r\n\tdfn*() functions.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2004/02/01 13:24:22  skaus\r\n\tbugfix: misidentifying unspecific failures from within SUPPL\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <errno.h>\r\n\r\n#include \"../err_fcts.h\"\r\n#include \"../include/misc.h\"\r\n\r\nvoid display_errno_fnam_error(const char * const fnam)\r\n{\r\n\tassert(fnam);\r\n\r\n\tswitch(errno) {\r\n\tcase ERANGE:\tdprintf( (\"[FATAL: dfnpath() buffer too small]\\n\") );\r\n\tcase ENOMEM:\terror_out_of_memory(); break;\r\n\tdefault:\t\terror_sfile_not_found(fnam);\r\n\t}\r\n}\r\n"
  },
  {
    "path": "lib/dispcnt.c",
    "content": "/*\t$Id$\r\n\r\n * Display the result of a count\r\n\tDiffers between 0, 1, and more hits/counts\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdio.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nvoid dispCount(int cnt, unsigned base_id)\r\n{\tswitch(cnt) {\r\n\tcase 0: displayString(base_id); break;\r\n\tcase 1: displayString(base_id + 1); break;\r\n\tdefault: displayString(base_id + 2, cnt); break;\r\n\t}\r\n}\r\n"
  },
  {
    "path": "lib/dispexit.c",
    "content": "/* Note: this is file here to allow compilation and is not in FreeCom's cvs,\r\n   as I'm sure Steffen has an implementation already.\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#ifdef DISP_EXITCODE\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n\r\n\r\nint exitReason;\t        /* defined in dispexit.c, set in exec1.c, reason program terminated */\r\nextern int dispExitcode;  /* defined in shell/init.c, nonzero to display (/Z) */\r\nextern int errorlevel;    /* defined ???, holds errorlevel command returned, set in exec1.c */\r\n\r\n\r\nvoid displayExitcode(void)\r\n{\r\n\tif (dispExitcode)\r\n\t{\r\n\t\t/* printf(\"Return code (ERRORLEVEL): %i\\n\", errorlevel); */\r\n\t\t/* Exit code (ERRORLEVEL): %u, reason: %u (%s) */\r\n\t\tdisplayString(TEXT_DISP_EXITCODE, errorlevel, exitReason,\r\n\t\t\t(!exitReason)?getMessage(TEXT_EXIT_REASON_0):    /* 0==normal */\r\n\t\t\t(exitReason==1)?getMessage(TEXT_EXIT_REASON_1):  /* Ctrl-Break */\r\n\t\t\t(exitReason==2)?getMessage(TEXT_EXIT_REASON_2):  /* Critical Error */\r\n\t\t\t(exitReason==3)?getMessage(TEXT_EXIT_REASON_3):  /* TSR ??? */\r\n\t\t\t(exitReason==-1)?getMessage(TEXT_EXIT_REASON_NEG_1): /* DOS API error */\r\n\t\t\t\"Unknown\"\r\n\t\t);\r\n\t}\r\n}\r\n\r\n#endif /* DISP_EXITCODE */\r\n"
  },
  {
    "path": "lib/drvnum.c",
    "content": "/*\t$Id$\r\n\r\n\tReturns the number of a drive (0..31)\r\n\t0 -> current drive\r\n\t1..32 -> input - 1\r\n\telse -> input - 'A'\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint drvNum(int drive)\r\n{\r\n\tif(drive == 0)\t\t/* change to current drive */\r\n\t\treturn getdisk();\r\n\tif(drive <= 32)\r\n\t\treturn drive - 1;\r\n\treturn toupper(drive) - 'A';\r\n}\r\n"
  },
  {
    "path": "lib/efct_001.c",
    "content": "/*\t$Id$\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n\r\n\tThis file bases on ERROR.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\nvoid error_env(int base, int err_no, const char * const var)\r\n{\r\n  switch(err_no) {\r\n  case -1:\r\n    displayString(/*TEXT_ERROR_SET_ENV_VAR*/ base+1, var);\r\n    break;\r\n    case -2:\r\n    displayString(/*TEXT_ERROR_ENV_VAR_NOT_FOUND*/ base+2, var);\r\n    break;\r\n    case -4:\r\n      displayString(/*TEXT_ERROR_NO_ENVIRONMENT*/ base+3);\r\n    case 0:\r\n      break;\r\n    default:\r\n      displayString(TEXT_ERROR_SYNTAX);\r\n      break;\r\n    }\r\n}\r\n"
  },
  {
    "path": "lib/err1.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_invalid_switch\r\nvoid error_invalid_switch(char c)\r\n{\tdisplayError(TEXT_ERROR_INVALID_SWITCH, c);\r\n}\r\n"
  },
  {
    "path": "lib/err10.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_out_of_memory\r\nvoid error_out_of_memory(void)\r\n{\tdisplayError(TEXT_ERROR_OUT_OF_MEMORY);\r\n}\r\n"
  },
  {
    "path": "lib/err11.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_syntax\r\nvoid error_syntax(const char * const s)\r\n{\tdisplayError(s? TEXT_ERROR_SYNTAX_STR: TEXT_ERROR_SYNTAX, s);\r\n}\r\n"
  },
  {
    "path": "lib/err12.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_nothin_to_do\r\nvoid error_nothin_to_do(void)\r\n{\tdisplayError(TEXT_ERROR_NOTHING_TO_DO);\r\n}\r\n"
  },
  {
    "path": "lib/err13.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_selfcopy\r\nvoid error_selfcopy(const char * const s)\r\n{\tdisplayError(TEXT_ERROR_SELFCOPY, s);\r\n}\r\n"
  },
  {
    "path": "lib/err14.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_long_batchline\r\nvoid error_long_batchline(const char * const fnam, long linenr)\r\n{\tdisplayError(TEXT_ERROR_LONG_LINE_BATCHFILE, linenr, fnam);\r\n}\r\n"
  },
  {
    "path": "lib/err15.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_bfile_vanished\r\nvoid error_bfile_vanished(const char * const fnam)\r\n{\tdisplayError(TEXT_ERROR_BFILE_VANISHED, fnam);\r\n}\r\n"
  },
  {
    "path": "lib/err16.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_bfile_no_such_label\r\nvoid error_bfile_no_such_label(const char * const fnam, const char * const label)\r\n{\tdisplayError(TEXT_ERROR_BFILE_LABEL, fnam, label);\r\n}\r\n"
  },
  {
    "path": "lib/err17.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_invalid_time\r\nvoid error_invalid_time(void)\r\n{\tdisplayError(TEXT_ERROR_INVALID_TIME);\r\n}\r\n"
  },
  {
    "path": "lib/err18.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_env_var\r\nvoid error_env_var(const char * const var)\r\n{\tdisplayError(TEXT_ERROR_SET_ENV_VAR, var);\r\n}\r\n"
  },
  {
    "path": "lib/err19.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_env_var_not_found\r\nvoid error_env_var_not_found(const char * const var)\r\n{\tdisplayError(TEXT_ERROR_ENV_VAR_NOT_FOUND, var);\r\n}\r\n"
  },
  {
    "path": "lib/err2.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_invalid_lswitch\r\nvoid error_invalid_lswitch(const char * const str)\r\n{\tdisplayError(TEXT_ERROR_INVALID_LSWITCH, str);\r\n}\r\n"
  },
  {
    "path": "lib/err20.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_filename_too_long\r\nvoid error_filename_too_long(const char * const fname)\r\n{\tdisplayError(TEXT_ERROR_FILENAME_TOO_LONG, fname);\r\n}\r\n"
  },
  {
    "path": "lib/err21.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_command_too_long\r\nvoid error_command_too_long(void)\r\n{\tdisplayError(TEXT_ERROR_COMMAND_TOO_LONG);\r\n}\r\n"
  },
  {
    "path": "lib/err22.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_line_too_long\r\nvoid error_line_too_long(void)\r\n{\tdisplayError(TEXT_ERROR_LINE_TOO_LONG);\r\n}\r\n"
  },
  {
    "path": "lib/err23.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_tempfile\r\nvoid error_tempfile(void)\r\n{\tdisplayError(TEXT_ERROR_TEMPFILE);\r\n}\r\n"
  },
  {
    "path": "lib/err24.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_close_quote\r\nvoid error_close_quote(int quote)\r\n{\tdisplayError(TEXT_ERROR_CLOSE_QUOTE, quote);\r\n}\r\n"
  },
  {
    "path": "lib/err25.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_illformed_option\r\nvoid error_illformed_option(const char * const s)\r\n{\tdisplayError(TEXT_ERROR_ILLFORMED_OPTION, s);\r\n}\r\n"
  },
  {
    "path": "lib/err26.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_opt_arg\r\nvoid error_opt_arg(const char * const  str)\r\n{\tdisplayError(TEXT_ERROR_OPT_ARG, str);\r\n}\r\n"
  },
  {
    "path": "lib/err27.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_opt_noarg\r\nvoid error_opt_noarg(const char * const  str)\r\n{\tdisplayError(TEXT_ERROR_OPT_NOARG, str);\r\n}\r\n"
  },
  {
    "path": "lib/err28.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_leading_plus\r\nvoid error_leading_plus(void)\r\n{\tdisplayError(TEXT_ERROR_LEADING_PLUS);\r\n}\r\n"
  },
  {
    "path": "lib/err29.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_trailing_plus\r\nvoid error_trailing_plus(void)\r\n{\tdisplayError(TEXT_ERROR_TRAILING_PLUS);\r\n}\r\n"
  },
  {
    "path": "lib/err3.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_too_many_parameters\r\nvoid error_too_many_parameters(const char * const s)\r\n{\tdisplayError(TEXT_ERROR_TOO_MANY_PARAMETERS_STR, s);\r\n}\r\n"
  },
  {
    "path": "lib/err30.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_open_file\r\nvoid error_open_file(const char * const fnam)\r\n{\tdisplayError(TEXT_ERROR_OPEN_FILE, fnam);\r\n}\r\n"
  },
  {
    "path": "lib/err31.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_read_file\r\nvoid error_read_file(const char * const fnam)\r\n{\tdisplayError(TEXT_ERROR_READ_FILE, fnam);\r\n}\r\n"
  },
  {
    "path": "lib/err32.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_write_file\r\nvoid error_write_file(const char * const fnam)\r\n{\tdisplayError(TEXT_ERROR_WRITE_FILE, fnam);\r\n}\r\n"
  },
  {
    "path": "lib/err33.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_write_file_disc_full\r\nvoid error_write_file_disc_full(const char * const fnam, const unsigned long size)\r\n{\tdisplayError(TEXT_ERROR_WRITE_FILE_DISC_FULL, fnam, size);\r\n}\r\n"
  },
  {
    "path": "lib/err34.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_copy\r\nvoid error_copy(void)\r\n{\tdisplayError(TEXT_ERROR_COPY);\r\n}\r\n"
  },
  {
    "path": "lib/err35.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_nothing_to_do\r\nvoid error_nothing_to_do(void)\r\n{\tdisplayError(TEXT_ERROR_NOTHING_TO_DO);\r\n}\r\n"
  },
  {
    "path": "lib/err36.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_invalid_number\r\nvoid error_invalid_number(const char * const s)\r\n{\tdisplayError(TEXT_INVALID_NUMBER, s);\r\n}\r\n"
  },
  {
    "path": "lib/err37.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_init_fully_qualified\r\nvoid error_init_fully_qualified(const char * const s)\r\n{\tdisplayError(TEXT_INIT_FULLY_QUALIFIED, s);\r\n}\r\n"
  },
  {
    "path": "lib/err38.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_corrupt_command_line\r\nvoid error_corrupt_command_line(void)\r\n{\tdisplayError(TEXT_CORRUPT_COMMAND_LINE);\r\n}\r\n"
  },
  {
    "path": "lib/err39.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_quoted_c_k\r\nvoid error_quoted_c_k(void)\r\n{\tdisplayError(TEXT_QUOTED_C_OR_K);\r\n}\r\n"
  },
  {
    "path": "lib/err4.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_path_not_found\r\nvoid error_path_not_found(void)\r\n{\tdisplayError(TEXT_ERROR_PATH_NOT_FOUND);\r\n}\r\n"
  },
  {
    "path": "lib/err40.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_ctty_excluded\r\nvoid error_ctty_excluded(void)\r\n{\tdisplayError(TEXT_CTTY_NOTIMPLEMENTED);\r\n}\r\n"
  },
  {
    "path": "lib/err41.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_l_notimplemented\r\nvoid error_l_notimplemented(void)\r\n{\tdisplayError(TEXT_ERROR_L_NOTIMPLEMENTED);\r\n}\r\n"
  },
  {
    "path": "lib/err42.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_u_notimplemented\r\nvoid error_u_notimplemented(void)\r\n{\tdisplayError(TEXT_ERROR_U_NOTIMPLEMENTED);\r\n}\r\n"
  },
  {
    "path": "lib/err43.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_restore_session\r\nvoid error_restore_session(void)\r\n{\tdisplayError(TEXT_ERROR_RESTORE_SESSION);\r\n}\r\n"
  },
  {
    "path": "lib/err44.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_save_session\r\nvoid error_save_session(void)\r\n{\tdisplayError(TEXT_ERROR_SAVE_SESSION);\r\n}\r\n"
  },
  {
    "path": "lib/err45.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_no_rw_device\r\nvoid error_no_rw_device(const char * const devname)\r\n{\tdisplayError(TEXT_ERROR_NORW_DEVICE, devname);\r\n}\r\n"
  },
  {
    "path": "lib/err46.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_ctty_dup\r\nvoid error_ctty_dup(const char * const devname)\r\n{\tdisplayError(TEXT_ERROR_CTTY_DUP, devname);\r\n}\r\n"
  },
  {
    "path": "lib/err47.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_no_cwd\r\nvoid error_no_cwd(int drive)\r\n{\tdisplayError(TEXT_ERROR_CWD_FAILED, drvNum(drive) + 'A');\r\n}\r\n"
  },
  {
    "path": "lib/err48.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_kswap_alias_size\r\nvoid error_kswap_alias_size(void)\r\n{\tdisplayError(TEXT_ERROR_KSWAP_ALIAS_SIZE);\r\n}\r\n"
  },
  {
    "path": "lib/err49.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_kswap_allocmem\r\nvoid error_kswap_allocmem(void)\r\n{\tdisplayError(TEXT_ERROR_KSWAP_ALLOCMEM);\r\n}\r\n"
  },
  {
    "path": "lib/err5.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_file_not_found\r\nvoid error_file_not_found(void)\r\n{\tdisplayError(TEXT_ERROR_FILE_NOT_FOUND);\r\n}\r\n"
  },
  {
    "path": "lib/err50.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_if_exist\r\nvoid error_if_exist(void)\r\n{\tdisplayError(TEXT_ERROR_IF_EXIST_NO_FILENAME);\r\n}\r\n"
  },
  {
    "path": "lib/err51.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_if_errorlevel\r\nvoid error_if_errorlevel(void)\r\n{\tdisplayError(TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER);\r\n}\r\n"
  },
  {
    "path": "lib/err52.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_if_errorlevel_number\r\nvoid error_if_errorlevel_number(void)\r\n{\tdisplayError(TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER);\r\n}\r\n"
  },
  {
    "path": "lib/err53.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_if_command\r\nvoid error_if_command(void)\r\n{\tdisplayError(TEXT_ERROR_IF_MISSING_COMMAND);\r\n}\r\n"
  },
  {
    "path": "lib/err54.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_alias_out_of_memory\r\nvoid error_alias_out_of_memory(void)\r\n{\tdisplayError(TEXT_ERROR_ALIAS_OUT_OF_MEM);\r\n}\r\n"
  },
  {
    "path": "lib/err55.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_alias_insert\r\nvoid error_alias_insert(void)\r\n{\tdisplayError(TEXT_ERROR_ALIAS_INSERT);\r\n}\r\n"
  },
  {
    "path": "lib/err56.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_alias_no_such\r\nvoid error_alias_no_such(const char * const name)\r\n{\tdisplayError(TEXT_ERROR_ALIAS_NO_SUCH, name);\r\n}\r\n"
  },
  {
    "path": "lib/err57.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_loading_context\r\nvoid error_loading_context(void)\r\n{\tdisplayError(TEXT_ERROR_LOADING_CONTEXT);\r\n}\r\n"
  },
  {
    "path": "lib/err58.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_dirfct_failed\r\nvoid error_dirfct_failed(const char * const fctname, const char * const dirname)\r\n{\tdisplayError(TEXT_ERROR_DIRFCT_FAILED, fctname, dirname);\r\n}\r\n"
  },
  {
    "path": "lib/err59.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_no_alias_name\r\nvoid error_no_alias_name(const char name[])\r\n{\tdisplayError(TEXT_ALIAS_INVALID_NAME, name);\r\n}\r\n"
  },
  {
    "path": "lib/err6.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_sfile_not_found\r\nvoid error_sfile_not_found(const char * const f)\r\n{\tdisplayError(TEXT_ERROR_SFILE_NOT_FOUND, f);\r\n}\r\n"
  },
  {
    "path": "lib/err60.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_history_size\r\nvoid error_history_size(const char s[])\r\n{\tdisplayError(TEXT_ERROR_HISTORY_SIZE, s);\r\n}\r\n"
  },
  {
    "path": "lib/err61.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_context_out_of_memory\r\nvoid error_context_out_of_memory(void)\r\n{\r\n#ifndef NO_CONTEXT_ERROR\r\n\tdisplayError(TEXT_ERROR_CONTEXT_OUT_OF_MEMORY);\r\n#endif\r\n}\r\n"
  },
  {
    "path": "lib/err62.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_no_context_after_swap\r\nvoid error_no_context_after_swap(void)\r\n{\tdisplayError(TEXT_ERROR_CONTEXT_AFTER_SWAP);\r\n}\r\n"
  },
  {
    "path": "lib/err63.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_out_of_dos_memory\r\nvoid error_out_of_dos_memory(void)\r\n{\tdisplayError(TEXT_ERROR_OUT_OF_DOS_MEMORY);\r\n}\r\n"
  },
  {
    "path": "lib/err64.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_context_length\r\nvoid error_context_length(unsigned long islen, unsigned maxlen)\r\n{\tdisplayError(TEXT_ERROR_CONTEXT_LENGTH, islen, maxlen);\r\n}\r\n"
  },
  {
    "path": "lib/err65.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_context_add_status\r\nvoid error_context_add_status(void)\r\n{\tdisplayError(TEXT_ERROR_CONTEXT_ADD_STATUS);\r\n}\r\n"
  },
  {
    "path": "lib/err66.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_empty_redirection\r\nvoid error_empty_redirection(void)\r\n{\tdisplayError(TEXT_ERROR_EMPTY_REDIRECTION);\r\n}\r\n"
  },
  {
    "path": "lib/err67.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_redirect_from_file\r\nvoid error_redirect_from_file(const char * const fnam)\r\n{\tdisplayError(TEXT_ERROR_REDIRECT_FROM_FILE, fnam);\r\n}\r\n"
  },
  {
    "path": "lib/err68.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_redirect_to_file\r\nvoid error_redirect_to_file(const char * const fnam)\r\n{\tdisplayError(TEXT_ERROR_REDIRECT_TO_FILE, fnam);\r\n}\r\n"
  },
  {
    "path": "lib/err69.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_bad_mcb_chain\r\nvoid error_bad_mcb_chain(void)\r\n{\tdisplayError(TEXT_ERROR_BAD_MCB_CHAIN);\r\n}\r\n"
  },
  {
    "path": "lib/err7.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_req_param_missing\r\nvoid error_req_param_missing(void)\r\n{\tdisplayError(TEXT_ERROR_REQ_PARAM_MISSING);\r\n}\r\n"
  },
  {
    "path": "lib/err70.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_unknown\r\nvoid error_unknown(int err)\r\n{\tdisplayError(TEXT_ERROR_UNDEFINED_ERROR, err);\r\n}\r\n"
  },
  {
    "path": "lib/err71.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_invalid_drive\r\nvoid error_invalid_drive(int drive)\r\n{\tdisplayError(TEXT_ERROR_INVALID_DRIVE, drive + 'A');\r\n}\r\n"
  },
  {
    "path": "lib/err72.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_no_env\r\nvoid error_no_env(void)\r\n{\tdisplayError(TEXT_ERROR_NO_ENVIRONMENT);\r\n}\r\n"
  },
  {
    "path": "lib/err73.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_on_off\r\nvoid error_on_off(void)\r\n{\tdisplayError(TEXT_ERROR_ON_OR_OFF);\r\n}\r\n"
  },
  {
    "path": "lib/err74.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_invalid_date\r\nvoid error_invalid_date(void)\r\n{\tdisplayError(TEXT_ERROR_INVALID_DATE);\r\n}\r\n"
  },
  {
    "path": "lib/err75.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_for_bad_var\r\nvoid error_for_bad_var(void)\r\n{\tdisplayError(TEXT_ERROR_BAD_VARIABLE);\r\n}\r\n"
  },
  {
    "path": "lib/err76.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_for_in\r\nvoid error_for_in(void)\r\n{\tdisplayError(TEXT_ERROR_IN_MISSING);\r\n}\r\n"
  },
  {
    "path": "lib/err77.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_for_parens\r\nvoid error_for_parens(void)\r\n{\tdisplayError(TEXT_ERROR_MISSING_PARENTHESES);\r\n}\r\n"
  },
  {
    "path": "lib/err78.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_for_do\r\nvoid error_for_do(void)\r\n{\tdisplayError(TEXT_ERROR_DO_MISSING);\r\n}\r\n"
  },
  {
    "path": "lib/err79.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_for_no_command\r\nvoid error_for_no_command(void)\r\n{\tdisplayError(TEXT_ERROR_NO_COMMAND_AFTER_DO);\r\n}\r\n"
  },
  {
    "path": "lib/err8.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_bad_command\r\nvoid error_bad_command(const char * const f)\r\n{\tdisplayError(TEXT_ERROR_BADCOMMAND, f);\r\n}\r\n"
  },
  {
    "path": "lib/err80.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_goto_label\r\nvoid error_goto_label(void)\r\n{\tdisplayError(TEXT_ERROR_NO_GOTO_LABEL);\r\n}\r\n"
  },
  {
    "path": "lib/err81.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_get_codepage\r\nvoid error_get_codepage(void)\r\n{\tdisplayError(TEXT_ERROR_GET_CODEPAGE);\r\n}\r\n"
  },
  {
    "path": "lib/err82.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_set_codepage\r\nvoid error_set_codepage(void)\r\n{\tdisplayError(TEXT_ERROR_SET_CODEPAGE);\r\n}\r\n"
  },
  {
    "path": "lib/err83.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_copy_plus_destination\r\nvoid error_copy_plus_destination(void)\r\n{\tdisplayError(TEXT_ERROR_COPY_PLUS_DESTINATION);\r\n}\r\n"
  },
  {
    "path": "lib/err84.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_invalid_parameter\r\nvoid error_invalid_parameter(const char * const str)\r\n{\tdisplayError(TEXT_ERROR_INVALID_PARAMETER, str);\r\n}\r\n"
  },
  {
    "path": "lib/err85.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_fcom_is_device\r\nvoid error_fcom_is_device(const char * const fnam)\r\n{\tdisplayError(TEXT_ERROR_FCOM_IS_DEVICE, fnam);\r\n}\r\n"
  },
  {
    "path": "lib/err86.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_fcom_invalid\r\nvoid error_fcom_invalid(const char * const fnam)\r\n{\tdisplayError(TEXT_ERROR_FCOM_INVALID, fnam);\r\n}\r\n"
  },
  {
    "path": "lib/err87.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_exe_corrupt\r\nvoid error_exe_corrupt(void)\r\n{\tdisplayError(TEXT_ERROR_EXE_CORRUPT);\r\n}\r\n"
  },
  {
    "path": "lib/err9.c",
    "content": "/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#undef error_no_pipe\r\nvoid error_no_pipe(void)\r\n{\tdisplayError(TEXT_ERROR_CANNOTPIPE);\r\n}\r\n"
  },
  {
    "path": "lib/err_fcts.mk",
    "content": "SRC_ERR =  \\\r\n\terr1.c \\\r\n\terr2.c \\\r\n\terr3.c \\\r\n\terr4.c \\\r\n\terr5.c \\\r\n\terr6.c \\\r\n\terr7.c \\\r\n\terr8.c \\\r\n\terr9.c \\\r\n\terr10.c \\\r\n\terr11.c \\\r\n\terr12.c \\\r\n\terr13.c \\\r\n\terr14.c \\\r\n\terr15.c \\\r\n\terr16.c \\\r\n\terr17.c \\\r\n\terr18.c \\\r\n\terr19.c \\\r\n\terr20.c \\\r\n\terr21.c \\\r\n\terr22.c \\\r\n\terr23.c \\\r\n\terr24.c \\\r\n\terr25.c \\\r\n\terr26.c \\\r\n\terr27.c \\\r\n\terr28.c \\\r\n\terr29.c \\\r\n\terr30.c \\\r\n\terr31.c \\\r\n\terr32.c \\\r\n\terr33.c \\\r\n\terr34.c \\\r\n\terr35.c \\\r\n\terr36.c \\\r\n\terr37.c \\\r\n\terr38.c \\\r\n\terr39.c \\\r\n\terr40.c \\\r\n\terr41.c \\\r\n\terr42.c \\\r\n\terr43.c \\\r\n\terr44.c \\\r\n\terr45.c \\\r\n\terr46.c \\\r\n\terr47.c \\\r\n\terr48.c \\\r\n\terr49.c \\\r\n\terr50.c \\\r\n\terr51.c \\\r\n\terr52.c \\\r\n\terr53.c \\\r\n\terr54.c \\\r\n\terr55.c \\\r\n\terr56.c \\\r\n\terr57.c \\\r\n\terr58.c \\\r\n\terr59.c \\\r\n\terr60.c \\\r\n\terr61.c \\\r\n\terr62.c \\\r\n\terr63.c \\\r\n\terr64.c \\\r\n\terr65.c \\\r\n\terr66.c \\\r\n\terr67.c \\\r\n\terr68.c \\\r\n\terr69.c \\\r\n\terr70.c \\\r\n\terr71.c \\\r\n\terr72.c \\\r\n\terr73.c \\\r\n\terr74.c \\\r\n\terr75.c \\\r\n\terr76.c \\\r\n\terr77.c \\\r\n\terr78.c \\\r\n\terr79.c \\\r\n\terr80.c \\\r\n\terr81.c \\\r\n\terr82.c \\\r\n\terr83.c \\\r\n\terr84.c \\\r\n\terr85.c \\\r\n\terr86.c \\\r\n\terr87.c\r\n\r\nOBJ_ERR =  \\\r\n\terr1.obj \\\r\n\terr2.obj \\\r\n\terr3.obj \\\r\n\terr4.obj \\\r\n\terr5.obj \\\r\n\terr6.obj \\\r\n\terr7.obj \\\r\n\terr8.obj \\\r\n\terr9.obj \\\r\n\terr10.obj \\\r\n\terr11.obj \\\r\n\terr12.obj \\\r\n\terr13.obj \\\r\n\terr14.obj \\\r\n\terr15.obj \\\r\n\terr16.obj \\\r\n\terr17.obj \\\r\n\terr18.obj \\\r\n\terr19.obj \\\r\n\terr20.obj \\\r\n\terr21.obj \\\r\n\terr22.obj \\\r\n\terr23.obj \\\r\n\terr24.obj \\\r\n\terr25.obj \\\r\n\terr26.obj \\\r\n\terr27.obj \\\r\n\terr28.obj \\\r\n\terr29.obj \\\r\n\terr30.obj \\\r\n\terr31.obj \\\r\n\terr32.obj \\\r\n\terr33.obj \\\r\n\terr34.obj \\\r\n\terr35.obj \\\r\n\terr36.obj \\\r\n\terr37.obj \\\r\n\terr38.obj \\\r\n\terr39.obj \\\r\n\terr40.obj \\\r\n\terr41.obj \\\r\n\terr42.obj \\\r\n\terr43.obj \\\r\n\terr44.obj \\\r\n\terr45.obj \\\r\n\terr46.obj \\\r\n\terr47.obj \\\r\n\terr48.obj \\\r\n\terr49.obj \\\r\n\terr50.obj \\\r\n\terr51.obj \\\r\n\terr52.obj \\\r\n\terr53.obj \\\r\n\terr54.obj \\\r\n\terr55.obj \\\r\n\terr56.obj \\\r\n\terr57.obj \\\r\n\terr58.obj \\\r\n\terr59.obj \\\r\n\terr60.obj \\\r\n\terr61.obj \\\r\n\terr62.obj \\\r\n\terr63.obj \\\r\n\terr64.obj \\\r\n\terr65.obj \\\r\n\terr66.obj \\\r\n\terr67.obj \\\r\n\terr68.obj \\\r\n\terr69.obj \\\r\n\terr70.obj \\\r\n\terr71.obj \\\r\n\terr72.obj \\\r\n\terr73.obj \\\r\n\terr74.obj \\\r\n\terr75.obj \\\r\n\terr76.obj \\\r\n\terr77.obj \\\r\n\terr78.obj \\\r\n\terr79.obj \\\r\n\terr80.obj \\\r\n\terr81.obj \\\r\n\terr82.obj \\\r\n\terr83.obj \\\r\n\terr84.obj \\\r\n\terr85.obj \\\r\n\terr86.obj \\\r\n\terr87.obj\r\n\r\nerr1.obj : err1.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr2.obj : err2.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr3.obj : err3.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr4.obj : err4.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr5.obj : err5.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr6.obj : err6.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr7.obj : err7.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr8.obj : err8.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr9.obj : err9.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr10.obj : err10.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr11.obj : err11.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr12.obj : err12.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr13.obj : err13.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr14.obj : err14.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr15.obj : err15.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr16.obj : err16.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr17.obj : err17.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr18.obj : err18.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr19.obj : err19.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr20.obj : err20.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr21.obj : err21.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr22.obj : err22.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr23.obj : err23.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr24.obj : err24.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr25.obj : err25.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr26.obj : err26.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr27.obj : err27.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr28.obj : err28.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr29.obj : err29.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr30.obj : err30.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr31.obj : err31.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr32.obj : err32.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr33.obj : err33.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr34.obj : err34.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr35.obj : err35.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr36.obj : err36.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr37.obj : err37.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr38.obj : err38.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr39.obj : err39.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr40.obj : err40.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr41.obj : err41.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr42.obj : err42.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr43.obj : err43.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr44.obj : err44.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr45.obj : err45.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr46.obj : err46.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr47.obj : err47.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr48.obj : err48.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr49.obj : err49.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr50.obj : err50.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr51.obj : err51.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr52.obj : err52.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr53.obj : err53.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr54.obj : err54.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr55.obj : err55.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr56.obj : err56.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr57.obj : err57.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr58.obj : err58.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr59.obj : err59.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr60.obj : err60.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr61.obj : err61.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr62.obj : err62.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr63.obj : err63.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr64.obj : err64.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr65.obj : err65.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr66.obj : err66.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr67.obj : err67.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr68.obj : err68.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr69.obj : err69.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr70.obj : err70.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr71.obj : err71.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr72.obj : err72.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr73.obj : err73.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr74.obj : err74.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr75.obj : err75.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr76.obj : err76.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr77.obj : err77.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr78.obj : err78.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr79.obj : err79.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr80.obj : err80.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr81.obj : err81.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr82.obj : err82.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr83.obj : err83.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr84.obj : err84.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr85.obj : err85.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr86.obj : err86.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\nerr87.obj : err87.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\r\n"
  },
  {
    "path": "lib/err_fcts.src",
    "content": "error_invalid_switch(char c):=TEXT_ERROR_INVALID_SWITCH, c\r\nerror_invalid_lswitch(const char * const str):=TEXT_ERROR_INVALID_LSWITCH, str\r\nerror_too_many_parameters(const char * const s):=TEXT_ERROR_TOO_MANY_PARAMETERS_STR, s\r\nerror_path_not_found:=TEXT_ERROR_PATH_NOT_FOUND\r\nerror_file_not_found:=TEXT_ERROR_FILE_NOT_FOUND\r\nerror_sfile_not_found(const char * const f):=TEXT_ERROR_SFILE_NOT_FOUND, f\r\nerror_req_param_missing:=TEXT_ERROR_REQ_PARAM_MISSING\r\nerror_bad_command(const char * const f):=TEXT_ERROR_BADCOMMAND, f\r\nerror_no_pipe:=TEXT_ERROR_CANNOTPIPE\r\nerror_out_of_memory:=TEXT_ERROR_OUT_OF_MEMORY\r\nerror_syntax(const char * const s):=s? TEXT_ERROR_SYNTAX_STR: TEXT_ERROR_SYNTAX, s\r\nerror_nothin_to_do:=TEXT_ERROR_NOTHING_TO_DO\r\nerror_selfcopy(const char * const s):=TEXT_ERROR_SELFCOPY, s\r\nerror_long_batchline(const char * const fnam, long linenr):=TEXT_ERROR_LONG_LINE_BATCHFILE, linenr, fnam\r\nerror_bfile_vanished(const char * const fnam):=TEXT_ERROR_BFILE_VANISHED, fnam\r\nerror_bfile_no_such_label(const char * const fnam, const char * const label):=TEXT_ERROR_BFILE_LABEL, fnam, label\r\nerror_invalid_time:=TEXT_ERROR_INVALID_TIME\r\nerror_env_var(const char * const var):=TEXT_ERROR_SET_ENV_VAR, var\r\nerror_env_var_not_found(const char * const var):=TEXT_ERROR_ENV_VAR_NOT_FOUND, var\r\nerror_filename_too_long(const char * const fname):=TEXT_ERROR_FILENAME_TOO_LONG, fname\r\nerror_command_too_long:=TEXT_ERROR_COMMAND_TOO_LONG\r\nerror_line_too_long:=TEXT_ERROR_LINE_TOO_LONG\r\nerror_tempfile:=TEXT_ERROR_TEMPFILE\r\nerror_close_quote(int quote):=TEXT_ERROR_CLOSE_QUOTE, quote\r\nerror_illformed_option(const char * const s):=TEXT_ERROR_ILLFORMED_OPTION, s\r\nerror_opt_arg(const char * const  str):=TEXT_ERROR_OPT_ARG, str\r\nerror_opt_noarg(const char * const  str):=TEXT_ERROR_OPT_NOARG, str\r\nerror_leading_plus:=TEXT_ERROR_LEADING_PLUS\r\nerror_trailing_plus:=TEXT_ERROR_TRAILING_PLUS\r\nerror_open_file(const char * const fnam):=TEXT_ERROR_OPEN_FILE, fnam\r\nerror_read_file(const char * const fnam):=TEXT_ERROR_READ_FILE, fnam\r\nerror_write_file(const char * const fnam):=TEXT_ERROR_WRITE_FILE, fnam\r\nerror_write_file_disc_full(const char * const fnam, const unsigned long size):=TEXT_ERROR_WRITE_FILE_DISC_FULL, fnam, size\r\nerror_copy:=TEXT_ERROR_COPY\r\nerror_nothing_to_do:=TEXT_ERROR_NOTHING_TO_DO\r\nerror_invalid_number(const char * const s):=TEXT_INVALID_NUMBER, s\r\nerror_init_fully_qualified(const char * const s):=TEXT_INIT_FULLY_QUALIFIED, s\r\nerror_corrupt_command_line:=TEXT_CORRUPT_COMMAND_LINE\r\nerror_quoted_c_k:=TEXT_QUOTED_C_OR_K\r\nerror_ctty_excluded:=TEXT_CTTY_NOTIMPLEMENTED\r\nerror_l_notimplemented:=TEXT_ERROR_L_NOTIMPLEMENTED\r\nerror_u_notimplemented:=TEXT_ERROR_U_NOTIMPLEMENTED\r\nerror_restore_session:=TEXT_ERROR_RESTORE_SESSION\r\nerror_save_session:=TEXT_ERROR_SAVE_SESSION\r\nerror_no_rw_device(const char * const devname):=TEXT_ERROR_NORW_DEVICE, devname\r\nerror_ctty_dup(const char * const devname):=TEXT_ERROR_CTTY_DUP, devname\r\nerror_no_cwd(int drive):=TEXT_ERROR_CWD_FAILED, drvNum(drive) + 'A'\r\nerror_kswap_alias_size:=TEXT_ERROR_KSWAP_ALIAS_SIZE\r\nerror_kswap_allocmem:=TEXT_ERROR_KSWAP_ALLOCMEM\r\nerror_if_exist:=TEXT_ERROR_IF_EXIST_NO_FILENAME\r\nerror_if_errorlevel:=TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER\r\nerror_if_errorlevel_number:=TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER\r\nerror_if_command:=TEXT_ERROR_IF_MISSING_COMMAND\r\nerror_alias_out_of_memory:=TEXT_ERROR_ALIAS_OUT_OF_MEM\r\nerror_alias_insert:=TEXT_ERROR_ALIAS_INSERT\r\nerror_alias_no_such(const char * const name):=TEXT_ERROR_ALIAS_NO_SUCH, name\r\nerror_loading_context:=TEXT_ERROR_LOADING_CONTEXT\r\nerror_dirfct_failed(const char * const fctname, const char * const dirname):=TEXT_ERROR_DIRFCT_FAILED, fctname, dirname\r\nerror_no_alias_name(const char name[]):=TEXT_ALIAS_INVALID_NAME, name\r\nerror_history_size(const char s[]):=TEXT_ERROR_HISTORY_SIZE, s\r\nerror_context_out_of_memory:=TEXT_ERROR_CONTEXT_OUT_OF_MEMORY\r\nerror_no_context_after_swap:=TEXT_ERROR_CONTEXT_AFTER_SWAP\r\nerror_out_of_dos_memory:=TEXT_ERROR_OUT_OF_DOS_MEMORY\r\nerror_context_length(unsigned long islen, unsigned maxlen):=TEXT_ERROR_CONTEXT_LENGTH, islen, maxlen\r\nerror_context_add_status:=TEXT_ERROR_CONTEXT_ADD_STATUS\r\nerror_empty_redirection:=TEXT_ERROR_EMPTY_REDIRECTION\r\nerror_redirect_from_file(const char * const fnam):=TEXT_ERROR_REDIRECT_FROM_FILE, fnam\r\nerror_redirect_to_file(const char * const fnam):=TEXT_ERROR_REDIRECT_TO_FILE, fnam\r\nerror_bad_mcb_chain:=TEXT_ERROR_BAD_MCB_CHAIN\r\nerror_unknown(int err):=TEXT_ERROR_UNDEFINED_ERROR, err\r\nerror_invalid_drive(int drive):=TEXT_ERROR_INVALID_DRIVE, drive + 'A'\r\nerror_no_env:=TEXT_ERROR_NO_ENVIRONMENT\r\nerror_on_off:=TEXT_ERROR_ON_OR_OFF\r\nerror_invalid_date:=TEXT_ERROR_INVALID_DATE\r\nerror_for_bad_var:=TEXT_ERROR_BAD_VARIABLE\r\nerror_for_in:=TEXT_ERROR_IN_MISSING\r\nerror_for_parens:=TEXT_ERROR_MISSING_PARENTHESES\r\nerror_for_do:=TEXT_ERROR_DO_MISSING\r\nerror_for_no_command:=TEXT_ERROR_NO_COMMAND_AFTER_DO\r\nerror_goto_label:=TEXT_ERROR_NO_GOTO_LABEL\r\nerror_get_codepage:=TEXT_ERROR_GET_CODEPAGE\r\nerror_set_codepage:=TEXT_ERROR_SET_CODEPAGE\r\nerror_copy_plus_destination:=TEXT_ERROR_COPY_PLUS_DESTINATION\r\nerror_invalid_parameter(const char * const str):=TEXT_ERROR_INVALID_PARAMETER, str\r\nerror_fcom_is_device(const char * const fnam):=TEXT_ERROR_FCOM_IS_DEVICE, fnam\r\nerror_fcom_invalid(const char * const fnam):=TEXT_ERROR_FCOM_INVALID, fnam\r\nerror_exe_corrupt:=TEXT_ERROR_EXE_CORRUPT\r\n"
  },
  {
    "path": "lib/exec.c",
    "content": "/*\t$Id$\r\n\r\n\tExecute an external program using DOS-4B-00\r\n\r\n\tThis file bases on EXEC.C of FreeCOM v0.81 beta 1.\r\n\r\n\tReturns: DOS error code of DOS-4B\r\n\r\n\t$Log$\r\n\tRevision 1.7  2006/09/05 01:44:33  blairdude\r\n\tMassive patches from Arkady that I'm way too lazy to sort through.  If anything happens, Arkady can answer for it.\r\n\r\n\tRevision 1.6  2004/10/25 19:37:34  skaus\r\n\tfix: LH: Errorlevel of program effects LH's error reporting {Eric Auer}\r\n\t\r\n\tRevision 1.5  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.4  2003/03/05 17:43:52  skaus\r\n\tbugfix: cached NLS data not flushed\r\n\t\r\n\tRevision 1.3  2002/11/12 18:31:57  skaus\r\n\tadd: save/restore session (swap context) {Tom Ehlert}\r\n\t\r\n\tRevision 1.2  2002/04/02 18:09:31  skaus\r\n\tadd: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdio.h>\r\n#include <dos.h>\r\n#include <string.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/cswap.h\"\r\n#include \"../include/nls.h\"\r\n\r\n#include \"algnbyte.h\"\r\n\r\n#if defined(__WATCOMC__) || defined(__GNUC__)\r\nstruct fcb     {\r\n\tchar bytes[0x25];\r\n};\r\n\r\n#ifdef __WATCOMC__\r\nchar *parsfnm(const char *cmdline, struct fcb far *fcbptr, int option);\r\n#if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)\r\n#pragma aux parsfnm = \\\r\n\t\"mov ah, 29h\" \\\r\n\t\"int 21h\" \\\r\n\t\"inc al\" \\\r\n\t\"jnz ok\" \\\r\n\t\"xor si, si\" \\\r\n\t\"ok:\" \\\r\n\t__parm [__si] [__es __di] [__ax] __value [__si] __modify [__ax __es]\r\n#else\r\n#pragma aux parsfnm = \\\r\n\t\"mov ah, 29h\" \\\r\n\t\"int 21h\" \\\r\n\t\"inc al\" \\\r\n\t\"jnz ok\" \\\r\n\t\"xor si, si\" \\\r\n\t\"ok:\" \\\r\n\t__parm [__ds __si] [__es __di] [__ax] __value [__ds __si] __modify [__ax __es]\r\n#endif\r\n#else /* __GNUC__ */\r\nstatic char *parsfnm(const char *cmdline, struct fcb far *fcbptr, int option)\r\n{\r\n\tchar *ret;\r\n\tunsigned char opt = option;\r\n\tasm volatile(\"int $0x21\" :\r\n\t\t\"=S\"(ret), \"+Ral\"(opt) :\r\n\t\t\"Rah\"((unsigned char)0x29), \"e\"(FP_SEG(fcbptr)), \"D\"(FP_OFF(fcbptr)),\r\n\t\t\"Rds\"(FP_SEG(cmdline)), \"0\"(cmdline) :\r\n\t\t\"cc\", \"memory\");\r\n\treturn opt == 0xff ? NULL : ret;\r\n}\r\n#endif\r\n#endif\r\n\r\nstruct ExecBlock\r\n{\r\n\tword segOfEnv;\r\n\tchar far *cmdLine;\r\n\tstruct fcb far *fcb1;\r\n\tstruct fcb far *fcb2;\r\n};\r\n\r\n#include \"algndflt.h\"\r\n\r\nint cdecl lowLevelExec(char far * cmd, struct ExecBlock far * bl);\r\n\r\nint exec(const char *cmd, char *cmdLine, const unsigned segOfEnv)\r\n{\r\n#ifdef FEATURE_XMS_SWAP\r\n#\tdefine buf dosCMDTAIL\r\n#\tdefine memcpy _fmemcpy\r\n#else\r\n\tunsigned char buf[MAX_EXTERNAL_COMMAND_SIZE+2]; /* 128 bytes is max size in PSP, 2 bytes for size and terminator */\r\n#endif\r\n\tstruct fcb fcb1, fcb2;\r\n\tstruct ExecBlock execBlock;\r\n\tint retval;\r\n\tint cmdLen;\r\n\r\n\tassert(cmd);\r\n\tassert(cmdLine);\r\n\r\n\tinvalidateNLSbuf();\r\n\r\n\t/* generate Pascal string from the command line */\r\n\t/* we assume passed in c string (ASCIIZ) */\r\n\tcmdLen = strlen(cmdLine);\r\n\tif (cmdLen > MAX_EXTERNAL_COMMAND_SIZE) {\r\n\t\t/* we assume CMDLINE environment variable already set with full cmdLine */\r\n\t\t/* so we simply truncate passed command line to max size, terminated by \\r, no \\0 for callee */\r\n\t\t/* for maximum compatibility set size to 127 (0x7f) */\r\n\t\tbuf[0] = (unsigned char)(MAX_EXTERNAL_COMMAND_SIZE+1);\r\n\t\tmemcpy(&buf[1], cmdLine, MAX_EXTERNAL_COMMAND_SIZE);\r\n\t\t/* terminate with just carriage return \\r */\r\n\t\tbuf[MAX_EXTERNAL_COMMAND_SIZE+1] = '\\x0d';\r\n\t} else {\r\n\t\t/* set size of actual command line and copy to buffer */\r\n\t\tbuf[0] = (unsigned char)cmdLen;\r\n\t\tmemcpy(&buf[1], cmdLine, cmdLen);\r\n\t\t/* ensure terminated with \\r\\0, if less then 126 characters\r\n\t\t   or \\r, if exactly 126 characters */\r\n\t\tmemcpy(&buf[1] + cmdLen, \"\\x0d\", (cmdLen < MAX_EXTERNAL_COMMAND_SIZE) ? 2 : 1);\r\n\t}\r\n\r\n\t/* fill FCBs */\r\n\tif ((cmdLine = parsfnm(cmdLine, &fcb1, 1)) != 0) {\r\n\t\tparsfnm(cmdLine, &fcb2, 1);\r\n\t}\r\n\r\n\tsaveSession();\r\n\r\n#ifdef FEATURE_XMS_SWAP\r\n\tif(XMSisactive() && swapOnExec == TRUE) {\r\n\t\t/* Copy the prepared values into the buffers in CSWAP.ASM module */\r\n\t\t_fmemcpy(dosFCB1, &fcb1, sizeof(fcb1));\r\n\t\t_fmemcpy(dosFCB2, &fcb2, sizeof(fcb1));\r\n\t\tassert(strlen(cmd) < 128);\r\n\t\t_fstrcpy((char far *)dosCMDNAME, cmd);\r\n\t\tdosParamDosExec.envSeg = segOfEnv; \r\n\r\n\t\tretval = XMSexec();\r\n\t\t} else\r\n#endif\r\n\t{\r\n\t\t/* fill execute structure */\r\n\t\texecBlock.segOfEnv = segOfEnv;\r\n\t\texecBlock.cmdLine = (char far *)buf;\r\n\t\texecBlock.fcb1 = (struct fcb far *)&fcb1;\r\n\t\texecBlock.fcb2 = (struct fcb far *)&fcb2;\r\n\r\n\t\tretval = lowLevelExec((char far*)cmd, (struct ExecBlock far*)&execBlock);\r\n\t}\r\n\r\n\trestoreSession();\r\n\t\t\t\t\r\n\treturn retval;\r\n}\r\n"
  },
  {
    "path": "lib/exec1.c",
    "content": "/*\t$Id$\r\n\r\n\tDecode the return code of the execution of an external program:\r\n\t\terrorlevel := input? input\r\n\t\t\t\t\t   : normal exit? errorlevel\r\n\t\t\t\t\t                : ^CBreak errorlevel\r\n\r\n\tThis file bases on EXEC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.5  2005/07/10 04:46:39  perditionc\r\n\tbuild fixes and minor enhancements\r\n\r\n\tRevision 1.4  2004/12/01 21:15:48  skaus\r\n\tadd: /Z: Display exit code after external command {Bernd Blaauw}\r\n\t\r\n\tRevision 1.3  2004/10/25 19:37:34  skaus\r\n\tfix: LH: Errorlevel of program effects LH's error reporting {Eric Auer}\r\n\t\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n\r\n#ifdef DISP_EXITCODE\r\n\textern int exitReason;\t/* global variable, defined in dispexit.c, set in exec1.c */\r\n\tvoid displayExitcode(void); /* also in include/misc.h */\r\n#endif\r\n\r\nvoid setErrorLevel(int rc)\r\n{\tIREGS rp;\r\n\r\n\tdprintf((\"[exec: DOS error code of exec(): %d]\\n\", rc));\r\n\r\n\tif(!rc) {\r\n#ifndef DISP_EXITCODE\r\n\t\tint exitReason;\t\t/* else we use the global variable */\r\n#endif\r\n\t\trp.r_ax = 0x4d00;           /* get return code */\r\n\t\tintrpt(0x21, &rp);\r\n\t\trc = rp.r_ax & 0xFF;\r\n\t\texitReason = (rp.r_ax >> 8) & 0xFF;\r\n\t\t\t/*\t0 -> normal\r\n\t\t\t\t1 -> ^Break / ^C\r\n\t\t\t\t2 -> Critical Error\r\n\t\t\t\t3 -> TSR\r\n\t\t\t*/\r\n\t\tdprintf((\"[exec: exit code: %u:%u]\\n\", exitReason, rc));\r\n\t\tif(exitReason == 0x1)\r\n\t\t\tctrlBreak = 1;\r\n\t\tif(exitReason == 0x2)\t/* Shallt change in the future */\r\n\t\t\tctrlBreak = 1;\r\n\t\tif(ctrlBreak && !rc)\t/* Make sure this condition is reflected */\r\n\t\t\trc = CBREAK_ERRORLEVEL;\r\n\t}\r\n\telse {\r\n#ifdef DISP_EXITCODE\r\n\t\texitReason = -1;\r\n#endif\r\n\t\tswitch (rc) {\r\n\t\tcase 7: /* DE_MCBDESTRY */\r\n\t\t\terror_bad_mcb_chain();\r\n\t\t\tbreak;\r\n\t\tcase 8: /* DE_NOMEM */\r\n\t\t\terror_out_of_dos_memory();\r\n\t\t\tbreak;\r\n\t\tcase 13: /* DE_INVLDDATA */\r\n\t\t\terror_exe_corrupt();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\terror_unknown(rc);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\terrorlevel = rc;\t/* assign DOS error code, if the call failed itself */\r\n#ifdef DISP_EXITCODE\r\n\tdisplayExitcode();\r\n#endif\r\n}\r\n\r\n"
  },
  {
    "path": "lib/farread.c",
    "content": "/*\t$Id$\r\n\r\n *\tRead a block of data from a FILE* into far memory\r\n *\tReturn 0 on failure, otherwise the number of read bytes\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <io.h>\r\n#include <fcntl.h>\r\n#include <stdio.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\n#if defined(__TURBOC__) || defined(__GNUC__)\r\nstatic unsigned DOSreadwrite(int fd, void far *buffer, unsigned size,\r\n                             unsigned short func )\r\n{\r\n\tIREGS r;\r\n\r\n\tr.r_ax = func;\r\n\tr.r_bx = fd;\r\n\tr.r_cx = size;\r\n\tr.r_dx = FP_OFF(buffer);\r\n    r.r_ds = FP_SEG(buffer);\r\n\tintrpt(0x21, &r);\r\n    return( ( r.r_flags & 1 ) ? 0xFFFF : r.r_ax );\r\n}\r\n\r\n\r\nsize_t farread(int fd, void far*buf, size_t length)\r\n{\r\n\t/* Use DOS API in order to read the strings directly to the\r\n\t\tfar address */\r\n    return( DOSreadwrite( fd, buf, length, 0x3F00 ) );\r\n}\r\n\r\nsize_t farwrite(int fd, void far*buf, size_t length)\r\n{\r\n    return( DOSreadwrite( fd, buf, length, 0x4000 ) );\r\n}\r\n#else\r\nsize_t farread(int fd, void far*buf, size_t length)\r\n{\r\n\t/* Use DOS API in order to read the strings directly to the\r\n\t\tfar address */\r\n\tsize_t bytes;\r\n\tif( _dos_read(fd, buf, length, &bytes) )\r\n\t\treturn 0xffff;\r\n\treturn bytes;\r\n}\r\n\r\nsize_t farwrite(int fd, void far*buf, size_t length)\r\n{\r\n\tsize_t bytes;\r\n\tif( _dos_write(fd, buf, length, &bytes) )\r\n\t\treturn 0xffff;\r\n\treturn bytes;\r\n}\r\n#endif\r\n\r\n#if !defined(__TURBOC__)\r\nint sfn_open(const char *pathname, int flags)\r\n{\r\n#if defined(__GNUC__)\r\n\tIREGS r;\r\n\tr.r_ax = 0x3d00 | flags;\r\n\tr.r_dx = FP_OFF(pathname);\r\n\tr.r_ds = FP_SEG(pathname);\r\n\tintrpt(0x21, &r);\r\n\treturn (r.r_flags & 1) ? -1 : (int)r.r_ax;\r\n#else\r\n\tint handle;\r\n\tint result = _dos_open(pathname, flags,\t&handle);\r\n\treturn (result == 0 ? handle : -1);\r\n#endif\r\n}\r\n#endif\r\n\r\n#if defined(__GNUC__)\r\nint dos_close(int fd)\r\n{\r\n\tIREGS r;\r\n\tr.r_ax = 0x3e00;\r\n\tr.r_bx = fd;\r\n\tintrpt(0x21, &r);\r\n\treturn (r.r_flags & 1) ? -1 : 0;\r\n}\r\n#endif\r\n\r\nint dos_read(int fd, void *buf, unsigned int len)\r\n{\r\n\treturn farread(fd, buf, len);\r\n}\r\n\r\nint dos_write(int fd, const void *buf, unsigned int len)\r\n{\r\n\treturn farwrite(fd, (void far *)buf, len);\r\n}\r\n\r\nstatic int sfn_creat_common(const char *pathname, int attr, int new)\r\n{\r\n#ifdef __WATCOMC__\r\n\tint handle;\r\n\tint result = (new ? _dos_creatnew : _dos_creat)(pathname, attr, &handle);\r\n\treturn (result == 0 ? handle : -1);\r\n#else\r\n\tIREGS r;\r\n\r\n\tr.r_ds = FP_SEG( pathname );\r\n\tr.r_dx = FP_OFF( pathname );\r\n\tr.r_cx = attr;\r\n\tr.r_ax = new ? 0x5B00 : 0x3C00;\r\n\r\n\tintrpt( 0x21, &r );\r\n\r\n\tif( ( r.r_flags & 1 ) ) r.r_ax = 0xFFFF;\r\n\r\n\treturn( r.r_ax );\r\n#endif\r\n}\r\n\r\nint sfn_creat(const char *pathname, int attr)\r\n{\r\n\treturn sfn_creat_common(pathname, attr, 0);\r\n}\r\n\r\nint sfn_creatnew(const char *pathname, int attr)\r\n{\r\n  return sfn_creat_common(pathname, attr, 1);\r\n}\r\n"
  },
  {
    "path": "lib/fdattr.c",
    "content": "/*\t$Id$\r\n\r\n *  Return attributes of an opened handle\r\n *\r\n *  Return:\r\n *    0: on failure (means: modified regular file on fixed drv A:)\r\n *    else: attributes\r\n\r\n\tThis file bases on OPENF.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include <dos.h>\r\n#include <portable.h>\r\n#include \"../config.h\"\r\n\r\nint fdattr(const int fd)\r\n{\r\n  IREGS r;\r\n\r\n  r.r_ax = 0x4400;              /* Get handle information */\r\n  r.r_bx = fd;\r\n  intrpt(0x21, &r);\r\n  return (!( r.r_flags & 1 ) )         /* call OK */\r\n  ? r.r_dx          /* attributes */\r\n  : 0;            /* error */\r\n}\r\n"
  },
  {
    "path": "lib/fdevopen.c",
    "content": "/*\t$Id$\r\n\r\n \tlike open() supporting device names\r\n\r\n\tThis file bases on OPENF.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/06/19 01:37:06  blairdude\r\n\tFixed some bugs in LFN support, copy now fully supports long filenames\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <stdio.h>\r\n\r\n#include \"../include/openf.h\"\r\n#include \"../include/lfnfuncs.h\"\r\n\r\nFILE *fdevopen(char *const fnam, const char *const mode)\r\n{\r\n  isDeviceName(fnam);           /* modify fnam if device */\r\n  return fopen(fnam, mode);\r\n}\r\n"
  },
  {
    "path": "lib/fdsattr.c",
    "content": "/*\t$Id$\r\n\r\n *  Set attributes of an opened handle\r\n *\r\n *  Return:\r\n *    0: on succes\r\n *    else: DOS error code\r\n\r\n\t$Log$\r\n\tRevision 1.4  2006/06/11 02:47:05  blairdude\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\r\n\tRevision 1.3  2005/12/16 12:03:39  perditionc\r\n\tuse proper subfunction to set attributes (from Eric)\r\n\t\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2002/04/08 16:02:22  skaus\r\n\tbugfix: CTTY: added to try to set the device flags\r\n\t\r\n */\r\n\r\n#include <dos.h>\r\n#include <portable.h>\r\n#include \"../config.h\"\r\n\r\nint fdsetattr(const int fd, const int attr)\r\n{\r\n  IREGS r;\r\n\r\n  r.r_ax = 0x4401;              /* Get handle information */\r\n  r.r_bx = fd;\r\n  r.r_dx = attr;\r\n  intrpt(0x21, &r);\r\n  return ( r.r_flags & 1 )         /* call failed */\r\n  ? r.r_ax          /* error code */\r\n  : 0;            /* OK */\r\n}\r\n"
  },
  {
    "path": "lib/filecomp.c",
    "content": "/*\t$Id$\r\n\r\n\tComplete a given filename\r\n\r\n\tThis file bases on FILECOMP.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.4  2006/09/04 21:22:32  blairdude\r\n\tGot rid of all '//' comments\r\n\r\n\tRevision 1.3  2006/06/26 19:54:12  blairdude\r\n\tLong filename filename completion can be enabled with LFNFOR COMPLETE ON\r\n\t\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <dos.h>\r\n#include <stdio.h>\r\n#include <string.h>\r\n#ifdef __TURBOC__\r\n#include <dir.h>\r\n#endif\r\n\r\n#include \"../include/lfnfuncs.h\"\r\n#include <suppl.h>\r\n#include \"../include/command.h\"\r\n#include \"../strings.h\"\r\n\r\nstatic int do_complete(char *str, unsigned charcount, int show)\r\n{\r\n  /* variables found within code */\r\n  struct dos_ffblk file;\r\n\r\n  int found_dot = 0;\r\n  int curplace = 0;\r\n  int start;\r\n  int count;\r\n  int perfectmatch = 1;\r\n  int makelower;\r\n  char path[128];\r\n  char fname[14];\r\n  char maxmatch[13] = \"\";\r\n  char directory[128];\r\n\r\n  assert(str);\r\n\r\n  /* expand current file name */\r\n  count = charcount - 1;\r\n  if (count < 0)\r\n    makelower = count = 0;\r\n  else\r\n  {\r\n    /* if last character is lower case, then make lookup lower case. */\r\n    makelower = islower(str[count]);\r\n  }\r\n\r\n  while (count > 0 && str[count] != ' ')  /* find front of word */\r\n\r\n    count--;\r\n\r\n  if (str[count] == ' ')        /* if not at beginning, go forward 1 */\r\n\r\n    count++;\r\n\r\n  start = count;\r\n\r\n  /* extract directory from word */\r\n  strcpy(directory, &str[start]);\r\n  curplace = strlen(directory) - 1;\r\n  while (curplace >= 0 && directory[curplace] != '\\\\' &&\r\n         directory[curplace] != ':')\r\n  {\r\n    directory[curplace] = 0;\r\n    curplace--;\r\n  }\r\n\r\n  strcpy(path, &str[start]);\r\n\r\n  /* look for a . in the filename */\r\n  for (count = strlen(directory); path[count] != 0; count++)\r\n    if (path[count] == '.')\r\n    {\r\n      found_dot = 1;\r\n      break;\r\n    }\r\n  if (found_dot)\r\n    strcat(path, \"*\");\r\n  else\r\n    strcat(path, \"*.*\");\r\n\r\n  curplace = 0;                 /* current fname */\r\n\r\n  if(\r\n#ifdef FEATURE_LONG_FILENAMES\r\n      lfncomplete ? lfnfindfirst( path, &file, FILE_SEARCH_MODE ) == 0 :\r\n#endif\r\n                    sfnfindfirst( path, ( struct ffblk * )&file, FILE_SEARCH_MODE )\r\n                    != 0 )\r\n    /* no match found */\r\n    return 0;\r\n\r\n  /* find anything */\r\n  if (show)\r\n  {\r\n    outc('\\n');\r\n    count = found_dot = 0; /* Use found_dot as waslfn */\r\n  }\r\n  do\r\n  {\r\n    if (file.ff_name[0] == '.' &&\r\n        (!file.ff_name[1] ||\r\n        (file.ff_name[1] == '.' && !file.ff_name[2]))) /* ignore . and .. */\r\n      continue;\r\n\r\n    if (show)\r\n    {\r\n      if (file.ff_attrib == FA_DIREC)\r\n        sprintf(fname, \"[%s]\", file.ff_name);\r\n      else\r\n        strcpy(fname, file.ff_name);\r\n/*      displayString(TEXT_FILE_COMPLATION_DISPLAY, fname); */\r\n#ifdef FEATURE_LONG_FILENAMES\r\n      if( ( found_dot = strlen( fname ) ) > 13 && count > 1 ) {\r\n        outc( '\\n' );\r\n        count = 0;\r\n      }\r\n#endif\r\n      printf(\"%-14s\", fname);\r\n      if( \r\n#ifdef FEATURE_LONG_FILENAMES\r\n          found_dot > 13 ||\r\n#endif\r\n          ++count == 5)\r\n      {\r\n        outc('\\n');\r\n        count = 0;\r\n      }\r\n    }\r\n    else\r\n    {\r\n      strcpy(fname, file.ff_name);\r\n      if (makelower)\r\n        strlwr(fname);\r\n      strcat(fname, file.ff_attrib == FA_DIREC ? \"\\\\\" : \" \");\r\n\r\n      if (!maxmatch[0] && perfectmatch)\r\n        strcpy(maxmatch, fname);\r\n      else\r\n      {\r\n        for (count = 0; maxmatch[count] && fname[count]; count++)\r\n          if (maxmatch[count] != fname[count])\r\n          {\r\n            perfectmatch = 0;\r\n            maxmatch[count] = 0;\r\n            break;\r\n          }\r\n      }\r\n    }\r\n  }\r\n  while(\r\n#ifdef FEATURE_LONG_FILENAMES\r\n    lfncomplete ? lfnfindnext( &file ) == 0 :\r\n#endif\r\n                  sfnfindnext( ( struct ffblk * )&file ) == 0 );\r\n  dos_findclose(&file);\r\n\r\n  if (show)\r\n  {\r\n    if (mywherex() > 1)\r\n      outc('\\n');\r\n  }\r\n  else\r\n  {\r\n    strcpy(&str[start], directory);\r\n    strcat(&str[start], maxmatch);\r\n  }\r\n\r\n  if (!show && !perfectmatch)\r\n    return 0;\r\n  return 1;\r\n}\r\n\r\nvoid complete_filename(char *str, unsigned charcount)\r\n{\r\n  if (!do_complete(str, charcount, 0)) beep();\r\n}\r\n\r\nint show_completion_matches(char *str, unsigned charcount)\r\n{\r\n  int ret = do_complete(str, charcount, 1);\r\n  if (!ret) beep_low();\r\n  return ret;\r\n}\r\n"
  },
  {
    "path": "lib/files.txt",
    "content": "These source files provide a library of functions used by all parts\r\nof FreeCOM. They have been broken into smallest pieces in order to\r\nuse the linker ability to choose only those portions (one portion\r\nis exactly one source file) needed to successfully bind the whole\r\nexecutable.\r\n"
  },
  {
    "path": "lib/fillcomp.c",
    "content": "/*\t$Id$\r\n\r\n\tSubstitute wildcards in filenames\r\n\r\n\tfillFnam():\r\n\tSubstitutes the wildcards of the last filename component.\r\n\r\n\tfillComp():\r\n\treplaces the wildcards ? and * of a filename pattern with characters\r\n\tfrom a source filename (useful in COPY a*.* b?1.*).\r\n\tIf a question mark appears bejond the end of the file name, it\r\n\tis silently ignored, e.g. in above example if copy'ing A.TXT)\r\n\r\n\tThis file bases on COPY.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.5  2006/09/04 19:34:08  blairdude\r\n\tUse static-sized buffers for safety\r\n\r\n\tRevision 1.4  2006/06/19 01:37:06  blairdude\r\n\tFixed some bugs in LFN support, copy now fully supports long filenames\r\n\t\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.2  2003/04/08 13:37:57  skaus\r\n\tchg: wilcard matching: COPY/REN *.TXT ???b.*: If length of source filename\r\n\t\tis less than 3, the superflous question marks are ignored, as in MS\r\n\t\tCOMMAND v6.22 COPY, but INCOMPATIBLE to same version's REN, which\r\n\t\tembeds spaces\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include <suppl.h>\r\n#include <dfn.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/lfnfuncs.h\"\r\n\r\nstatic void fillComp(char * const dst\r\n , const char *pattern\r\n , const char *src\r\n , int len)\r\n{ char *s;\r\n\r\n  assert(len);\r\n  assert(dst);\r\n\r\n  if(!pattern)\r\n    pattern = \"\";\r\n  if(!src)\r\n    src = \"\";\r\n\r\n  s = dst;\r\n  while(--len) {\r\n    switch(*s = *pattern++) {\r\n    case '\\0':\r\n      goto ende;\r\n    case '?':\r\n    \tif(!*src)\r\n    \t\tcontinue;\r\n/*      if(*src) do not keep ? bejond end-of-filename */\r\n        *s = *src;\r\n    default:\r\n      ++s;\r\n      break;\r\n    case '*':\r\n      memcpy(s, src, len);\r\n      s[len] = '\\0';\r\n      return;\r\n    }\r\n    if(*src)\r\n      ++src;\r\n  }\r\nende:\r\n#if 0\t\t/* don't keep ? bejond end-of-filename */\r\n  /* The pattern may have less characters than the source, because\r\n  \ttrailing '?'s do match \"nothing\" in DOS. */\r\n  while(--s >= dst && *s == '?');\r\n  s[1] = '\\0';\r\n#else\r\n  *s = '\\0';\r\n  assert(strchr(dst, '?') == 0);\r\n#endif\r\n}\r\n\r\nvoid fillFnam(char *dest, const char * const pattern\r\n , const char * const fnam)\r\n{ \r\n#if 0\r\n  char *dr;\r\n#else\r\n  char buf[MAXPATH], dr[MAXDRIVE];\r\n#endif\r\n  char *pa, *fn, *ex;\r\n  char *pfn, *pex;\r\n  char dfn[MAXFILE], dex[MAXEXT];\r\n\r\n  assert(fnam);\r\n  assert(pattern);\r\n\r\n  if(strchr(pattern, '?') == 0 && strchr(pattern, '*') == 0)\r\n#if 0\r\n    return strdup(pattern);\r\n#else\r\n    strcpy(dest, pattern);\r\n#endif\r\n\r\n#if 0\r\n  if(!dfnsplit(pattern, &dr, &pa, &fn, &ex))\r\n    return 0;\r\n\r\n  if(!dfnsplit(fnam, 0, 0, &pfn, &pex)) {\r\n    free(fn);\r\n    free(ex);\r\n    free(dr);\r\n    free(pa);\r\n    return 0;\r\n  }\r\n#else\r\n  myfnsplit(pattern, buf, dr, &pa, &fn, &ex);\r\n  myfnsplit(fnam, dest, 0, 0, &pfn, &pex);\r\n#endif\r\n\r\n  fillComp(dfn, fn, pfn, MAXFILE);\r\n  fillComp(dex, ex, pex, MAXEXT);\r\n\r\n#if 0\r\n  p = dfnmerge(0, dr, pa, dfn, dex);\r\n#else\r\n  myfnmerge(dest, dr, pa, dfn, dex);\r\n#endif\r\n\r\n#if 0\r\n  free(pfn);\r\n  free(pex);\r\n  free(dr);\r\n  free(pa);\r\n  free(fn);\r\n  free(ex);\r\n\r\n  return p;\r\n#endif\r\n}\r\n"
  },
  {
    "path": "lib/find.c",
    "content": "/*\t$Id$\r\n\r\n * skip_word - skip a word / find next word delimiter\r\n *  word delimiters are whitespaces and non-leading option characters\r\n * skipdm - skip all word delimiters / find next non-word delimiter\r\n *  word delimiters are whitespaces only\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n\r\n/*\r\n * Find the next delimiter/non-delimiter within p\r\n *  Honor quotes and leading option characters\r\n */\r\nstatic char *find(char *p, int delim)\r\n{ int ch, quote;\r\n  int isopt;\r\n\r\n  assert(p);\r\n\r\n#define isdelim(ch) (isopt? isoptdelim(ch): isargdelim(ch))\r\n\r\n  if((isopt = isoption(p)) != 0 && delim) {\r\n    /* Assume the following example:\r\n        p == \"arg/opt\"\r\n      first find(\"arg/opt\", 1) == find next delimiter\r\n      returns pointer to \"/opt\"\r\n      Now the process would call skip delimiters to reach the\r\n      next argument --> find(\"/opt\", 0) == find next non-delimiter\r\n      will return \"/opt\", because '/' is delimiter only when\r\n      searching for delimiters.\r\n      Now the process would call skip non-delimiters to reach the\r\n      end of the arg --> find(\"/opt\", 1) == find next delimiter\r\n      This time the leading optch's are part of the argument.\r\n      ===> This is performed in this branch.\r\n\r\n      If the string would be \"/opt1/opt2\", the call of\r\n      find(\"/opt1/opt2\", 1) == find next delimiter must stop\r\n      at the second '/'.\r\n    */\r\n    while((ch = *++p) != 0 && isoptch(ch));\r\n  }\r\n\r\n  quote = 0;\r\n  while((ch = *p++) != '\\0' && (quote\r\n   || (delim && !(isdelim(ch) || isoptch(ch)))\r\n   || (!delim && isdelim(ch))))\r\n    if(quote == ch)\r\n      quote = 0;\r\n    else if(strchr(QUOTE_STR, ch))\r\n      quote = ch;\r\n\r\n  return p - 1;\r\n#undef isdelim\r\n}\r\n\r\nchar *skip_word(char *p)\r\n{ return find(p, 1);\r\n}\r\n\r\nchar *skipdm(char *p)\r\n{ return find(p, 0);\r\n}\r\n\r\n/*\r\n * Find the next delimiter/non-delimiter within p\r\n *  Honor quotes and leading option characters\r\n */\r\nstatic char *find_batch(char *p, int delim)\r\n{ int ch, quote;\r\n\r\n  assert(p);\r\n\r\n  dprintf((\"find_batch(%s, %i) -- \", p, delim));\r\n  quote = 0;\r\n  while((ch = *p++) != '\\0' && (quote\r\n   || (delim && !(isargdelim(ch)))\r\n   || (!delim && isargdelim(ch))))\r\n   {\r\n    if(quote == ch)\r\n      quote = 0;\r\n    else if(strchr(QUOTE_STR, ch))\r\n      quote = ch;\r\n   }\r\n   \r\n  dprintf((\"returning %s\\n\", (p-1)));\r\n  return p - 1;\r\n}\r\n\r\n\r\nchar *skipnonoptdm(char *p)\r\n{ return find_batch(p, 0);\r\n}\r\n\r\nchar *skipnonopt_word(char *p)\r\n{ return find_batch(p, 1);\r\n}\r\n"
  },
  {
    "path": "lib/freep.c",
    "content": "/*\t$Id$\r\n\r\n * freep -- frees a dynamically allocated array of dynamically allocated\r\n \tstrings\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n\r\nvoid freep(char **p)\r\n{\r\n\tchar **q;\r\n\r\n\tif((q = p) != 0) {\r\n\t\twhile (*q)\r\n\t\t\tfree(*q++);\r\n\t\tfree(p);\r\n\t}\r\n}\r\n"
  },
  {
    "path": "lib/frsysblk.c",
    "content": "/*\t$Id$\r\n\r\n\tDeallocate a system memory block.\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/09/05 01:44:33  blairdude\r\n\tMassive patches from Arkady that I'm way too lazy to sort through.  If anything happens, Arkady can answer for it.\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include \"mcb.h\"\r\n#include \"suppl.h\"\r\n#include \"../include/misc.h\"\r\n\r\nvoid freeSysBlk (const unsigned segm) {\t\r\n\tstruct MCB _seg *mcb;\r\n\r\n\tassert(segm);\r\n\r\n\tmcb = MK_SEG_PTR(struct MCB, SEG2MCB(segm));\r\n\tmcb->mcb_ownerPSP = _psp;\r\n\tfreeBlk(segm);\r\n\tdprintf((\"[MEM: deallocated system memory block: %04x]\\n\", segm));\r\n}\r\n"
  },
  {
    "path": "lib/fstpcpy.c",
    "content": "/*\t$Id$\r\n\r\n\tfar stpcpy()\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nchar far *_fstpcpy(char far *dst, const char far *src)\r\n{\t\r\n\twhile((*dst++ = *src++) != 0);\r\n\r\n\treturn dst - 1;\r\n}\r\n"
  },
  {
    "path": "lib/gallstr.c",
    "content": "/*\t$Id$\r\n\r\n\tGet allocation strategy\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\tThis function had been imported from LH.ASM.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include <portable.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint dosGetAllocStrategy(void)\r\n{\tUSEREGS\r\n\r\n\t_AX = 0x5800;\t\t\t/* get allocation strategy */\r\n\tgeninterrupt(0x21);\r\n\treturn _CFLAG & 1 ? 0 : _AX;\r\n}\r\n"
  },
  {
    "path": "lib/get1mcb.c",
    "content": "/*\t$Id$\r\n\r\n\tGet start of MCB chain, from word ptr SYSVARS[-2]\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\tThis function had been imported from LH.ASM.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include <portable.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\n\r\nword GetFirstMCB(void)\r\n{\tUSEREGS\r\n\r\n\t_AH = 0x52;\r\n\tgeninterrupt(0x21);\r\n\treturn peekw(_ES, _BX - 2);\r\n}\r\n"
  },
  {
    "path": "lib/getenv.c",
    "content": "/*\t$Id$\r\n\r\n *  Return the value of the variable\r\n *\r\n *  The returned pointer needs to be freed by the caller.\r\n *\r\n *  If the case-insensitive match is used, the var[] array is updated with\r\n *  the variable name that was retrieved.\r\n *\r\n *  Return: NULL, on failure\r\n\r\n\tThis file bases on ENVIRON.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.2  2001/04/29 12:24:36  skaus\r\n\tbugfix: >>PATH<< with empty %PATH% --> PATH=(null)\r\n\tfix: BREAK/VERIFY ignore trailing spaces\r\n\tfix: >>PATH ;<< remove PATH environment variable\r\n\tfix: cache 3 environment variables to overcome nested useage (e.g. when\r\n\t\tloading message segment to print environment variable)\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n\r\n#include <environ.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nchar *getEnv(char var[])\r\n{\r\n  assert(var);\r\n\r\n  /* To have case-sensitive variable names, just delete the\r\n     env_matchVar() call and the if() */\r\n  /* To let var[] unaltered, use env_findAnyVar() instead of the\r\n     combination of matchVar() & dupvar().\r\n     However, the caller will know the correct variable name, if\r\n     you don't. */\r\n  if (env_matchVar(0, var) & 7) /* found? */\r\n    return 0;                /* no match found */\r\n\r\n  /* var now contains the correct variable name and we can be\r\n     sure that's there */\r\n  return dupvar(var);\r\n}\r\n"
  },
  {
    "path": "lib/goxy.c",
    "content": "/*\t$Id$\r\n\r\n * goxy\r\n *\r\n * move the cursor on the screen\r\n\r\n\tThis file bases on CMDINPUT.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.4  2006/06/14 05:25:06  blairdude\r\n\tgoxy now uses the current video page for setting the cursor position\r\n\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\t\r\n\t\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\t\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <portable.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nvoid goxy(const unsigned char x, const unsigned char y)\r\n{\r\n    USEREGS\r\n    _AH = 0x0F;\r\n    geninterrupt( 0x10 );\r\n    _AH = 0x02;\r\n    _DH = ( y - 1 );\r\n    _DL = ( x - 1 );\r\n    geninterrupt( 0x10 );\r\n}\r\n"
  },
  {
    "path": "lib/grabfcom.c",
    "content": "/*\t$Id$\r\n\r\n * Grab the filename of COMMAND.COM\r\n *\r\n *  If warn != 0, warnings can be issued; otherwise this functions\r\n *  is silent.\r\n\r\n\tThis file bases on INIT.C of FreeCOM v0.81 beta 1.\r\n\r\n\t0 -> is valid\r\n\t1 -> no such file\r\n\t2 -> is a device\r\n\t3 -> not valid\r\n\t4 -> out of memory / syntax error ... .\r\n\r\n\t$Log$\r\n\tRevision 1.6  2004/06/29 14:14:55  skaus\r\n\tfix: help screen of internal commands causes \"Unknown command error\" {Bernd Blaauw}\r\n\r\n\tRevision 1.5  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.4  2004/02/01 13:24:22  skaus\r\n\tbugfix: misidentifying unspecific failures from within SUPPL\r\n\t\r\n\tRevision 1.3  2003/12/09 20:25:34  skaus\r\n\tbugfix: INIT: FreeCOM-path and TTY can be in any order\r\n\t\r\n\tRevision 1.2  2002/11/05 19:29:21  skaus\r\n\tbugfix: FreeCOM should accept relative path as argv[0]\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <limits.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include <dfn.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/misc.h\"\r\n\r\nint grabComFilename(const int warn, const char far * const fnam)\r\n{\r\n  char *buf;\r\n  size_t len;\r\n  int rc;\r\n\r\n  dprintf( (\"[INIT: grabComFilename(%s)]\\n\", fnam) );\r\n  if(!fnam)\r\n  \treturn 4;\r\n\r\n  /* Copy the filename into the local heap */\r\n  len = _fstrlen(fnam);\r\n  if(len >= INT_MAX || len < 1) {\r\n    /* no filename specified */\r\n    if(warn)\r\n      error_syntax(0);\r\n    return 4;\r\n  }\r\n\r\n  if((buf = malloc(len + 1)) == 0) {\r\n    if(warn) error_out_of_memory();\r\n    return 4;\r\n  }\r\n  _fmemcpy((char far*)buf, fnam, len);\r\n  buf[len] = '\\0';\r\n\r\n    if (buf[1] != ':' || buf[2] != '\\\\')\r\n    { char *p;\r\n\r\n        /* expand the string for the user */\r\n      p = abspath(buf, warn);\r\n      free(buf);\r\n      if((buf = p) == 0)\r\n\t\t  return 4;\r\n      if(warn)\r\n          error_init_fully_qualified(buf);\r\n\r\n    \tlen = strlen(buf);\r\n    }\r\n\r\n    while(buf[len - 1] == '\\\\')\r\n    \t--len;\r\n    buf[len] = 0;\r\n\r\n    if(dfnstat(buf) & DFN_DIRECTORY) {\r\n      /* The user specified a directory, try if we can find the\r\n        COMMAND.COM with the standard name in there */\r\n      char *p;\r\n\r\n      if((p = realloc(buf, len + sizeof(COM_NAME) + 1)) == 0) {\r\n        if(warn) error_out_of_memory();\r\n        free(buf);\r\n        return 4;\r\n      }\r\n      buf = p;\r\n      strcpy(&buf[len], \"\\\\\" COM_NAME);\r\n    }\r\n\r\n\r\n\tif(0 != (rc = validResFile(buf))) {\r\n\t\tif(warn) switch(rc) {\r\n\t\tdefault:\r\n\t#ifdef NDEBUG\r\n\t\t\tassert(0);\r\n\t#endif\r\n\t\tcase 1: error_open_file(buf); break;\r\n\t\tcase 2: error_fcom_is_device(buf); break;\r\n\t\tcase 3: error_fcom_invalid(buf); break;\r\n\t\t}\r\n\r\n\t\tfree(buf);\r\n\t\treturn rc;\r\n\t}\r\n\r\n  free(ComPath);    /* Save the found file */\r\n  ComPath = buf;\r\n\tdprintf((\"[INIT: new resource file name: %s]\\n\", ComPath));\r\n\r\n  isSwapFile = 0;\r\n  buf = dfnfilename(ComPath);\r\n  assert(buf);\r\n  if((buf = strchr(buf, '.')) != 0\r\n   && stricmp(buf, \".swp\") == 0) {\r\n       dprintf((\"[INIT: VSpawn file found: %s]\\n\", ComPath));\r\n       memcpy(++buf, \"COM\", 3);\r\n       isSwapFile = buf - ComPath;\r\n  }\r\n\r\n  return 0;\r\n}\r\n"
  },
  {
    "path": "lib/gumblink.c",
    "content": "/*\t$Id$\r\n\r\n\tGet UMB Link state\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\tThis function had been imported from LH.ASM.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include <portable.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint dosGetUMBLinkState(void)\r\n{\tUSEREGS\r\n\r\n\t_AX = 0x5802;\t\t\t/* get UMB link */\r\n\tgeninterrupt(0x21);\r\n\treturn _CFLAG ? 0 : _AL;\r\n}\r\n"
  },
  {
    "path": "lib/hdlrctxt.c",
    "content": "/* $Id$\r\n\r\n\tBreaks up var=value like strings and displays the set if\r\n\tno argument\r\n\r\n\tUsing the environment subsystem of SUPPL\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\r\n\r\n#include \"environ.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n\r\nstatic int view (void *arg, word segm, word ofs) {\r\n  (void)arg;\r\n  if (peekb (segm, ofs) > ' ') /* control characters tag hidden features */\r\n    printf (\"%Fs\\n\", MK_FP (segm, ofs));\r\n  return 0;                    /* don't stop */\r\n}\r\n\r\n\r\nint breakVarAssign(ctxt_t context, char * const s, char ** const value)\r\n{\r\n\tchar *p;\r\n\r\n\tassert(value);\r\n\tassert(s);\r\n\r\n\t/* if no parameters, show the environment */\r\n\tif(!*s) {\r\n\t\tenv_forAll(context, view, 0);\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/* make sure there is an = in the command */\r\n\tif((p = strchr(s, '=')) == 0 || p == s)\r\n    /* Should this print the value for the environment variable? */\r\n\t\treturn 1;\r\n\r\n\t*p = 0;\t\t\t/* separate name and value */\r\n\t*value = p + 1;\r\n\treturn 2;\r\n}\r\n"
  },
  {
    "path": "lib/hist_get.c",
    "content": "/* $Id$\r\n\r\n\tSet a specific item of the history\r\n\r\n\tUseage: histGet(num, buflen, string)\r\n\r\n\tnum == 0 -> add a \"newest\" entry to the history\r\n\tnum <  0 -> change the num'th newest entry of the history\r\n\tnum >  0 -> change the num'th oldest entry of the history\r\n\t\tpositive num's correspond to item ID (not relative to nummin!)\r\n\t\tnegative ones are added to nummax\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n\r\nint histGet(const int num, char * const str, const unsigned len)\r\n{\tchar *p;\r\n\r\n\tassert(str);\r\n\tassert(len);\r\n\r\n\tif(ctxtIsValid()\r\n\t && ctxtGet(0, CTXT_TAG_HISTORY, realNum(CTXT_TAG_HISTORY, num), &p) == 0) {\r\n\t\tassert(p);\r\n\t\tstrncpy(str, p, len);\r\n\t\tstr[len - 1] = 0;\t\t/* Make sure the string is terminated */\r\n\t\tfree(p);\r\n\t\treturn 1;\r\n\t}\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "lib/hist_set.c",
    "content": "/* $Id$\r\n\r\n\tSet a specific item of the history\r\n\r\n\tUseage: histSet(num, string)\r\n\r\n\tnum == 0 -> add a \"newest\" entry to the history\r\n\tnum <  0 -> change the num'th newest entry of the history\r\n\tnum >  0 -> change the num'th oldest entry of the history\r\n\t\tpositive num's correspond to item ID (not relative to nummin!)\r\n\t\tnegative ones are added to nummax\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n\r\nvoid histSet(const int num, const char * const str)\r\n{\tif(ctxtIsValid())\r\n\t\tctxtSet(CTXT_TAG_HISTORY, realNum(CTXT_TAG_HISTORY, num), str);\r\n}\r\n"
  },
  {
    "path": "lib/inputdos.c",
    "content": "/*\t$Id$\r\n\r\n\tInput a line via DOS-0A\r\n\r\n\tThis file bases on CMDINPUT.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.5  2006/06/12 04:55:42  blairdude\r\n\tAll putchar's now use outc which first flushes stdout and then uses write to write the character to the console.  Some potential bugs have been fixed ( Special thanks to Arkady for noticing them :-) ).  All CONIO dependencies have now been removed and replaced with size-optimized functions (for example, mycprintf, simply opens \"CON\" and directly writes to the console that way, and mywherex and mywherey use MK_FP to access memory and find the cursor position).  FreeCOM is now\r\n\tsignificantly smaller.\r\n\r\n\tRevision 1.4  2006/06/11 02:47:05  blairdude\r\n\t\r\n\t\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\t\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.2  2003/12/09 21:29:24  skaus\r\n\tbugfix: Ask for FreeCOM location when STRINGS are missing [#687]\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <stdio.h>\r\n#include <string.h>\r\n\r\n#include \"../include/command.h\"\r\n\r\n#if MAX_INTERNAL_COMMAND_SIZE > 253\r\n#define CMD_SIZE 253\r\n#else\r\n#define CMD_SIZE MAX_INTERNAL_COMMAND_SIZE\r\n#endif\r\n\r\nstatic unsigned char iobuf[CMD_SIZE + 2] = { CMD_SIZE, '\\0'};\r\n\r\nvoid readcommandDOS(char * const str, int maxlen)\r\n{\tIREGS r;\r\n\r\n\tassert(str);\r\n\tassert(maxlen);\r\n\r\n\tiobuf[0] = (maxlen < CMD_SIZE)? maxlen: CMD_SIZE;\r\n\tif(iobuf[1] > iobuf[0])\r\n\t\tiobuf[1] = iobuf[0];\r\n\r\n\tdprintf((\"[CMDINPUT characters max:%u in:%u]\\n\", iobuf[0], iobuf[1]));\r\n\tif(echo)\r\n\t\tprintprompt();\r\n\r\n\tr.r_ax = 0xa00;\r\n\tr.r_ds = FP_SEG(iobuf);\r\n\tr.r_dx = FP_OFF(iobuf);\r\n\tintrpt(0x21, &r);\r\n\r\n\tdprintf((\"[CMDINPUT characters max:%u out:%u]\\n\", iobuf[0], iobuf[1]));\r\n\tif(iobuf[1]) \t\t/* could bug if == 0 */\r\n\t\tmemcpy(str, &iobuf[2], iobuf[1]);\r\n\tstr[iobuf[1]] = 0;\r\n    outc('\\n');\r\n}\r\n"
  },
  {
    "path": "lib/is_empty.c",
    "content": "/* $Id$\r\n\r\n\tReturns true if the strings is NULL, \"\" or consists of\r\n\twhitespaces only.\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <ctype.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint is_empty(const char *s)\r\n{\tif(s) {\r\n\t\t--s;\r\n\t\twhile(*++s)\r\n\t\t\tif(!isspace(*s))\r\n\t\t\t\treturn 0;\r\n\t}\r\n\treturn 1;\r\n}\r\n"
  },
  {
    "path": "lib/is_fnamc.c",
    "content": "/*\t$Id$\r\n\r\n\tint is_fnchar()\r\n\r\n\tis filename character?\r\n\r\n\tNote: These are none: .\"/\\\\[]:|<>+=;,\r\n\r\n\tThis file bases on COMMAND.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include <string.h>\r\n#include <portable.h>\r\n#include <fmemory.h>\r\n\r\n#include \"../include/nls.h\"\r\n\r\nint is_fnchar(const int c)\r\n{\r\n\r\n#ifdef FEATURE_NLS\r\n  refreshNLS();   /* refresh the NLS information */\r\n\r\n#define uc unsigned char\r\n  return !(c < (uc)nlsBuf->inclFirst || c > (uc)nlsBuf->inclLast\r\n   || (c >= (uc)nlsBuf->exclFirst && c <= (uc)nlsBuf->exclLast)\r\n   || _fmemchr(nlsBuf->illegalChars, c, nlsBuf->illegalLen));\r\n#undef uc\r\n#else\r\n  return !(c <= ' ' || c == 0x7f || strchr(\".\\\"/\\\\[]:|<>+=;,\", c));\r\n#endif\r\n}\r\n"
  },
  {
    "path": "lib/is_fnstr.c",
    "content": "/* $Id$\r\n\r\n\tTests if the string is constructed out of is_fnchar()\r\n\tcharacters only\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint is_fnstr(const char * const s)\r\n{\tconst char *p;\r\n\r\n\tassert(s);\r\n\tfor(p = s; *p; ++p)\r\n\t\tif(!is_fnchar(*p))\r\n\t\t\treturn 0;\r\n\r\n\treturn 1;\r\n}\r\n"
  },
  {
    "path": "lib/is_pchr.c",
    "content": "/*\t$Id$\r\n\r\n\tint is_pathdelim()\r\n\r\n\tis path delimiter character?\r\n\r\n\tNote: These are \\\\ : \r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\nint is_pathdelim(const int c)\r\n{\treturn c == '\\\\' || c == ':';\r\n}\r\n"
  },
  {
    "path": "lib/isadev.c",
    "content": "/*\t$Id$\r\n\r\n *      Check if the passed file descriptor is connected to a\r\n *      character device rather than a block device\r\n *\r\n *      Return:\r\n *              0: block device (disk file)\r\n *              else: character device\r\n\r\n\tThis file bases on OPENF.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../include/openf.h\"\r\n\r\nint isadev(const int fd)\r\n{\r\n  return (fdattr(fd) & 0x80) != 0; /* is character device */\r\n}\r\n"
  },
  {
    "path": "lib/keyprsd.c",
    "content": "/*\t$Id$\r\n\r\n\tCheck if a key is pressed currently\r\n\r\n\tThis file bases on INIT.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint keypressed(void)\r\n{\r\n  IREGS r;\r\n\r\n  r.r_ax = 0x0100;\r\n\r\n  intrpt(0x16, &r);\r\n\r\n  /* Check the zero flag.  Z=0 means a key was pressed; Z=1 means no key */\r\n  if (r.r_flags & 0x40)\r\n    return 0;\r\n  else\r\n    return 1;\r\n}\r\n"
  },
  {
    "path": "lib/kswap_c.c",
    "content": "/* $Id$\r\n\tDefines the central pointer to the KSWAP primary data structure.\r\n*/\r\n\r\n#include \"../config.h\"\r\n#include \"../include/kswap.h\"\r\n\r\n#ifndef FEATURE_XMS_SWAP\r\nkswap_p kswapContext = 0;\r\n#endif\r\n"
  },
  {
    "path": "lib/lastdget.c",
    "content": "/* $Id$\r\n\r\n\tGet Last Directory\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nvoid lastDirGet(char ** const buf)\r\n{\r\n\tassert(buf);\r\n\r\n\tswitch(ctxtGet(0, CTXT_TAG_LASTDIR, 1, buf)) {\r\n\tcase 2:\t\terror_out_of_memory();\r\n\tdefault:\t*buf = 0;\r\n\tcase 0:\t\tbreak;\r\n\t}\r\n}\r\n"
  },
  {
    "path": "lib/lastdset.c",
    "content": "/* $Id$\r\n\r\n\tSet Last Directory with current directory\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <stdlib.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nvoid lastDirSet(void)\r\n{\tchar *dir;\r\n\r\n\tif((dir = cwd(0)) != 0) {\r\n\t\tctxtSet(CTXT_TAG_LASTDIR, 1, dir);\r\n\t\tfree(dir);\r\n\t} else\r\n\t\terror_out_of_memory();\r\n}\r\n"
  },
  {
    "path": "lib/leadopt.c",
    "content": "/*\t$Id$\r\n\r\n * Scan all leading options\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.4  2006/09/05 01:44:33  blairdude\r\n\tMassive patches from Arkady that I'm way too lazy to sort through.  If anything happens, Arkady can answer for it.\r\n\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.2  2001/12/03 20:10:52  skaus\r\n\tbugfix: if FREECOM.COM /P without AUTOEXEC.BAT --> assert() failure.\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/cmdline.h\"\r\n\r\nint leadOptions (char **Xline, optScanner fct, void *const arg){\r\n  int ec = E_None;\r\n  char *p, *q, *line;\r\n\r\n  assert(Xline);\r\n\r\n  p = *Xline;\r\n  if(!p)\r\n  \tp = \"\";\r\n\r\n  while(*(line = skipdm(p))) {\r\n    q = unquote(line, p = skip_word(line));\r\n    if(!q) {\r\n      error_out_of_memory();\r\n      return E_NoMem;\r\n    }\r\n\r\n    if(!isoption(q)\r\n     || ((ec = scanOption(fct, arg, q)) != E_None\r\n          && ec != E_Ignore)) {\r\n      free(q);\r\n      break;\r\n    }\r\n\r\n    free(q);\r\n  }\r\n\r\n  *Xline = line;\r\n\r\n  return ec;\r\n}\r\n"
  },
  {
    "path": "lib/lfnfuncs.c",
    "content": "/* \r\n * Gets the short filename equivalent \r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <fcntl.h>\r\n#include <sys/stat.h>\r\n#include <errno.h>\r\n#include <dos.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <stdarg.h>\r\n#include <string.h>\r\n#include <suppl.h>\r\n#include <dfn.h>\r\n#include <sstr.h>\r\n#include <io.h>\r\n\r\n#define __LFNFUNCS_C\r\n\r\n#include \"suppl.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/lfnfuncs.h\"\r\n\r\n\r\n#ifdef FEATURE_LONG_FILENAMES\r\n\r\n/*#ifdef __TURBOC__*/ /* OpenWatcom has an LFN CLIB Extension available \r\n\t\t\t but not used yet */\r\n\r\n#define _STC     __emit__(0xF9)\r\n#define _PUSH_DS __emit__(0x1E)\r\n#define _PUSH_ES __emit__(0x06)\r\n#define _POP_DS  __emit__(0x1F)\r\n#define _POP_ES  __emit__(0x07)\r\n\r\n/*\r\n * The following function copies a short filename equivalent of a long\r\n * filename into a local static buffer, which will be overwritten on\r\n * subsequent calls\r\n */\r\nconst char * getshortfilename( const char *longfilename )\r\n{\r\n    static char shortfilename[ 128 ];\r\n    IREGS r;\r\n\r\n    if (!__supportlfns) return( longfilename );\r\n\r\n    r.r_ds = FP_SEG( longfilename );\r\n    r.r_si = FP_OFF( longfilename );\r\n    r.r_es = FP_SEG( shortfilename );\r\n    r.r_di = FP_OFF( shortfilename );\r\n    shortfilename[0] = '\\0';\r\n    r.r_cx = 0x8001; /* Get short filename */\r\n    r.r_flags = 1;\t/* CY before 21.71 calls! */\r\n    r.r_ax = 0x7160;/* LFN truename function */\r\n\r\n    intrpt( 0x21, &r );\r\n\r\n    return( ( ( r.r_flags & 1 ) || r.r_ax == 0x7100 || !shortfilename[0] ) ?\r\n            longfilename : shortfilename );\r\n}\r\n\r\n/* creates or keeps/truncates the LFN in filename\r\n   if the LFN already exists and code == 0x12, then truncate it\r\n   if the LFN already exists and code == 0x10, then do nothing\r\n   returns 1 if the LFN already exists or has been created, else 0\r\n   LFN handles are avoided for compatibility with buggy LFN implementations,\r\n   most notably NTVDM in Windows 2000 and XP.\r\n*/\r\nstatic int __creat_or_truncate( const char * filename, int mode, int code )\r\n{\r\n    int handle;\r\n    IREGS r;\r\n\r\n    if( !__supportlfns ) {\r\n        return 0;\r\n    }\r\n\r\n    r.r_ds = FP_SEG( filename );\r\n    r.r_si = FP_OFF( filename );\r\n    r.r_bx = O_WRONLY;\r\n    r.r_cx = mode;\r\n    r.r_dx = code;\r\n    r.r_flags = 1;\t/* CY before 21.71 calls! */\r\n    r.r_ax = 0x716C;\r\n\r\n    intrpt( 0x21, &r );\r\n\r\n    if( ( r.r_flags & 1 ) || r.r_ax == 0x7100 )\r\n        return r.r_ax == 0x50; /* file already exists for error 0x50 */\r\n    handle = r.r_ax;\r\n    /*\r\n     * Win2k always returns handle == 2, which is a bug.\r\n     * File handle 2 is already used for stderr\r\n     * Fortunately, FreeCOM never actually expects to get file handle 2\r\n     * ( as it does for '1' and '0', when redirecting stdin and stdout )\r\n     */\r\n    if( handle != 2 )dos_close( handle );\r\n    return 1;\r\n}\r\n\r\n#if defined(DEBUG) || defined(FEATURE_CALL_LOGGING)\r\nFILE * lfnfopen( const char *filename, const char *mode )\r\n{\r\n    /* only used with \"at\" in debugging code */\r\n    if( strpbrk( mode, \"aw\" ) )\r\n        __creat_or_truncate( filename, 0, 0x10 );\r\n    return( fopen( getshortfilename( filename ), mode ) );\r\n}\r\n#endif\r\n\r\nint lfn_creat( const char *filename, int attr )\r\n{\r\n    if ( __creat_or_truncate( filename, attr, 0x12 ) )\r\n        return sfn_open( getshortfilename( filename ), O_WRONLY );\r\n    return sfn_creat( filename, attr );\r\n}\r\n\r\nint lfnrename( const char *oldfilename, const char *newfilename )\r\n{   /* Must use the actual interrupt for this */\r\n    IREGS r;\r\n\r\n    if(dfnstat(newfilename) != 0) {\r\n        errno = EACCES;\r\n        return( -1 );\r\n    }\r\n\r\n    r.r_ds = FP_SEG( oldfilename );\r\n    r.r_dx = FP_OFF( oldfilename );\r\n    r.r_es = FP_SEG( newfilename );\r\n    r.r_di = FP_OFF( newfilename );\r\n    r.r_flags = 1;\t/* CY before 21.71 calls! */\r\n    r.r_ax = 0x7156;\r\n\r\n    intrpt( 0x21, &r );\r\n\r\n    if( ( r.r_flags & 1 ) || r.r_ax == 0x7100 ) {\r\n        r.r_ax = 0x5600;\r\n\r\n        intrpt( 0x21, &r );\r\n\r\n        if( ( r.r_flags & 1 ) ) {\r\n            errno = r.r_ax;\r\n            return( -1 );\r\n        }\r\n    }\r\n\r\n    return( 0 );\r\n}\r\n\r\nstatic void convert_to_ffblk( struct lfnffblk *dosblock,\r\n                              struct locffblk *lfnblock )\r\n{\r\n    dosblock->ff_attrib = lfnblock->attributes;\r\n    dosblock->cr_time   = lfnblock->creattime;\r\n    dosblock->cr_date   = lfnblock->creatdate;\r\n    dosblock->ac_time   = lfnblock->accesstime;\r\n    dosblock->ac_date   = lfnblock->accessdate;\r\n    dosblock->ff_ftime  = lfnblock->wrtime;\r\n    dosblock->ff_fdate  = lfnblock->wrdate;\r\n    dosblock->ff_fsize  = lfnblock->filesize;\r\n    if( lfnblock->lfn ) {\r\n        memcpy( dosblock->ff_name, lfnblock->lfn, sizeof( lfnblock->lfn ) );\r\n    } else {\r\n        memcpy( dosblock->ff_name, lfnblock->sfn, sizeof( lfnblock->sfn ) );\r\n    }\r\n}\r\n\r\nint lfnfindfirst( const char *path, struct lfnffblk *buf, unsigned attr )\r\n{\r\n    struct locffblk lfnblock;\r\n    IREGS r;\r\n\r\n    buf->lfnax = buf->lfnsup = 0; /* Zero find handle and LFN-supported flag */\r\n\r\n    if( !__supportlfns )\r\n        return( sfnfindfirst( path, ( struct ffblk * )buf, attr ) );\r\n\r\n    r.r_ds = FP_SEG( path );\r\n    r.r_dx = FP_OFF( path );       /* path goes in DS:DX */\r\n    r.r_es = FP_SEG( &lfnblock );\r\n    r.r_di = FP_OFF( &lfnblock );  /* LFN find block goes in ES:DI */\r\n    r.r_si = 1;                    /* Use DOS date/time format */\r\n    r.r_cx = attr;\r\n    r.r_flags = 1;\t/* CY before 21.71 calls! */\r\n    r.r_ax = 0x714E;               /* LFN Findfirst */\r\n\r\n    intrpt( 0x21, &r );\r\n\r\n    /*\r\n     * If ax = 7100, there is probably an LFN TSR but no LFN support for\r\n     * whatever drive or directory is being searched. In that case, fall back on\r\n     * the old findfirst.  Also if the function fails, it could be because of\r\n     * no LFN TSR so fall back to the old findfirst.\r\n     */\r\n    if( ( r.r_flags & 1 ) || r.r_ax == 0x7100 )\r\n        return( sfnfindfirst( path, ( struct ffblk * )buf, attr ) );\r\n\r\n    /*\r\n     * If there was no failure, the next step is to move the values from the\r\n     * LFN block into the non-lfn block\r\n     */\r\n    buf->lfnax = r.r_ax;\r\n    buf->lfnsup = 1;\r\n    convert_to_ffblk( buf, &lfnblock );\r\n    /*\r\n     * 0 is always returned because we've already checked cflag; the\r\n     * old_dos_findfirst will handle any errors\r\n     */\r\n    return( 0 );\r\n}\r\n\r\nint lfnfindnext( struct lfnffblk *buf )\r\n{\r\n    struct locffblk lfnblock;\r\n    IREGS r;\r\n\r\n    /*\r\n     * Before going through the possibly unnecessary steps of calling the LFN\r\n     * function first, buf->lfnsup will tell us if LFN was supported with the\r\n     * previous call to findfirst.\r\n     */\r\n    if( !buf->lfnsup || !__supportlfns ) {\r\n        return( sfnfindnext( ( struct ffblk * )buf ) );\r\n    }\r\n\r\n    r.r_es = FP_SEG( &lfnblock );\r\n    r.r_di = FP_OFF( &lfnblock );          /* The LFN find block */\r\n    r.r_bx = buf->lfnax;                   /* The lfn handle set by findfirst */\r\n    r.r_si = 1;                            /* Use DOS times */\r\n    r.r_flags = 1;\t/* CY before 21.71 calls! */\r\n    r.r_ax = 0x714F;\r\n\r\n    intrpt( 0x21, &r );\r\n\r\n    /* Check for errors */\r\n    if( ( r.r_flags & 1 ) ) {\r\n        errno = r.r_ax;\r\n        return( -1 );\r\n    }\r\n    convert_to_ffblk( buf, &lfnblock );\r\n    return( 0 );\r\n}\r\n\r\nint lfnfindclose( struct lfnffblk *buf )\r\n{\r\n    IREGS r;\r\n\r\n    /* Let's check if LFN was used; if not, there is no need for findclose */\r\n    if( !buf->lfnsup || !__supportlfns ) return( 0 );\r\n\r\n    r.r_bx = buf->lfnax;        /* Findfirst handle */\r\n    r.r_flags = 1;\t/* CY before 21.71 calls! */\r\n    r.r_ax = 0x71A1;            /* LFN findclose */\r\n\r\n    intrpt( 0x21, &r );\r\n\r\n    /*\r\n     * Check for errors (which really shouldn't be a problem anyways\r\n     * except for bad code)\r\n     */\r\n    if( ( r.r_flags & 1 ) ) {\r\n        errno = r.r_ax;\r\n        return( -1 );\r\n    }\r\n    return( 0 );\r\n}\r\n\r\nint lfnmkdir( const char *path )\r\n{\r\n\tIREGS r;\r\n\r\n    r.r_dx = FP_OFF( path );\r\n\tr.r_ds = FP_SEG( path );\r\n\tr.r_flags = 1;\r\n    if (__supportlfns) {\r\n        r.r_ax = 0x7139;\r\n        intrpt( 0x21, &r );\r\n\t}\r\n    if ( ( r.r_flags & 1 ) || r.r_ax == 0x7100 ) {\r\n        r.r_ax = 0x3900;\r\n        intrpt( 0x21, &r );\r\n\t}\r\n    return( -( r.r_flags & 1 ) );\r\n}\r\n\r\nstatic int lfn_rc_dir( const char *path, int func )\r\n{\r\n\tIREGS r;\r\n\r\n    path = getshortfilename( path );\r\n    r.r_ax = func;\r\n    r.r_dx = FP_OFF( path );\r\n\tr.r_ds = FP_SEG( path );\r\n    intrpt( 0x21, &r );\r\n    return( -( r.r_flags & 1 ) );\r\n}\r\n\r\nint lfnrmdir( const char *path )\r\n{\r\n\treturn lfn_rc_dir( path, 0x3a00 );\r\n}\r\n\r\nint lfnchdir( const char *path )\r\n{\r\n\treturn lfn_rc_dir( path, 0x3b00 );\r\n}\r\n\r\n/* #endif */\r\n\r\n#endif\r\n"
  },
  {
    "path": "lib/lib.m1",
    "content": ".AUTODEPEND\r\n\r\nCFG_DEPENDENCIES = makefile.mak\r\n\r\n!include \"..\\config.mak\"\r\n\r\nall: $(CFG) freecom.lib\r\n\r\n"
  },
  {
    "path": "lib/lib.m2",
    "content": "\r\n"
  },
  {
    "path": "lib/lowexec.asm",
    "content": "; $Id$\r\n;  LOWEXEC.ASM\r\n;\r\n;\r\n;  Comments:\r\n;\r\n;  ??/??/95 (Steffen Kaiser)\r\n;    started.\r\n;\r\n;  12/??/95 (Svante Frey)\r\n;    reorganized the code\r\n;\r\n;  01/06/96 (Tim Norman)\r\n;    added this history\r\n;\r\n;  08/07/96 (Steffen Kaiser)\r\n;    made argument handling independent of memory model\r\n; $Log$\r\n; Revision 1.1  2001/04/12 00:33:53  skaus\r\n; chg: new structure\r\n; chg: If DEBUG enabled, no available commands are displayed on startup\r\n; fix: PTCHSIZE also patches min extra size to force to have this amount\r\n;    of memory available on start\r\n; bugfix: CALL doesn't reset options\r\n; add: PTCHSIZE to patch heap size\r\n; add: VSPAWN, /SWAP switch, .SWP resource handling\r\n; bugfix: COMMAND.COM A:\\\r\n; bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n; add: command MEMORY\r\n; bugfix: runExtension(): destroys command[-2]\r\n; add: clean.bat\r\n; add: localized CRITER strings\r\n; chg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n; \tvia STRINGS.LIB\r\n; add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n; add: fixstrs.c: prompts & symbolic keys\r\n; add: fixstrs.c: backslash escape sequences\r\n; add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n; chg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n; bugfix: IF is now using error system & STRINGS to report errors\r\n; add: CALL: /N\r\n;\r\n; Revision 1.1.1.1.4.1  2001/02/18 17:59:36  skaus\r\n; bugfix: KSSF: restore parentPSP on exit\r\n; chg: Using STRINGS resource for all non-interactive messages\r\n; chg: moving all assembly files to NASM\r\n;\r\n\r\n%include \"model.inc\"\r\n%include \"stuff.inc\"\r\n\r\nsegment _TEXT\r\n\tcglobal lowLevelExec\r\n\r\nlowLevelExec:\r\n\tpush    bp\r\n\tmov     bp, sp\r\n\tpushm   si, di, ds\r\n\r\n%ifidn __OUTPUT_FORMAT__, elf\r\n\tpush    es\r\n%endif\r\n\tlds     dx, [bp+4+2*@CodeSize]      ; load file name\r\n\tles     bx, [bp+8+2*@CodeSize]      ; load parameter block\r\n\tmov     ax, 4b00h\r\n\r\n\tmov     Word [cs:saveSP], sp\r\n\tmov     Word [cs:saveSS], ss\r\n\tint     21h\r\n\tcli\t\t\t\t\t\t;; Can be removed for post-8086 CPUs\r\n\tmov     ss, [cs:saveSS]\r\n\tmov     sp, [cs:saveSP]\r\n\tsti\r\n\r\n\tjc      exec_error   ; if there was an error, the error code is in AX\r\n\txor     ax, ax       ; otherwise, clear AX\r\n\r\nexec_error:\r\n%ifidn __OUTPUT_FORMAT__, elf\r\n\tpop     es\r\n%endif\r\n\tpopm    si, di, ds\r\n\tpop     bp\r\n\tret\t\t\t\t\t; retf/retn model specific, see model.inc\r\n\r\nsaveSP dw 0\r\nsaveSS dw 0\r\n"
  },
  {
    "path": "lib/ltrimcl.c",
    "content": "/*\t$Id$\r\n\r\n * Name: ltrimcl() - left trims a string by removing leading spaces\r\n \tThe string itself is not changed.\r\n * Input: str - a pointer to a string\r\n * Output: returns a trimmed copy of str\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n\r\nchar *ltrimcl(const char *str)\r\n{ char c;\r\n\r\n  assert(str);\r\n\r\n  while ((c = *str++) != '\\0' && isargdelim(c))\r\n    ;\r\n\r\n  return (char *)str - 1;\t\t/* strip const */\r\n}\r\n"
  },
  {
    "path": "lib/ltrimsp.c",
    "content": "/*\t$Id$\r\n\r\n * Name: ltrimsp() - left trims a string by removing leading spaces\r\n \tThe string itself is not changed.\r\n * Input: str - a pointer to a string\r\n * Output: returns a trimmed copy of str\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nchar *ltrimsp(const char *str)\r\n{ char c;\r\n\r\n  assert(str);\r\n\r\n  while ((c = *str++) != '\\0' && isspace(c))\r\n    ;\r\n\r\n  return (char *)str - 1;\t\t/* strip const */\r\n}\r\n"
  },
  {
    "path": "lib/lwr1wd.c",
    "content": "/*\t$Id$\r\n\r\n\tstrlwr() only for the first word in string\r\n\r\n\tThis file bases on ALIAS.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n\r\n#include \"../include/command.h\"\r\n\r\nvoid partstrlower(char *str)\r\n{\tint c;\r\n\r\n\tassert(str);\r\n\r\n\twhile ((c = *str) != '\\0' && !isspace(c))\r\n\t\t*str++ = tolower(c);\r\n}\r\n"
  },
  {
    "path": "lib/makefile",
    "content": "# $Id$\r\n#\r\n# Makefile for the FreeCOM library\r\n#\r\n# $Log$\r\n# Revision 1.17  2004/12/01 21:15:31  skaus\r\n# add: /Z: Display exit code after external command {Bernd Blaauw}\r\n#\r\n# Revision 1.16  2004/09/13 18:59:39  skaus\r\n# add: CRITER: Repeat check autofail magic {Tom Ehlert/Eric Auer}\r\n#\r\n# Revision 1.15  2004/06/21 17:49:25  skaus\r\n# fix: DIR: disable APPEND.EXE during DIR processing {Eduardo Almao}\r\n#\r\n# Revision 1.14  2004/02/01 13:24:22  skaus\r\n# bugfix: misidentifying unspecific failures from within SUPPL\r\n#\r\n# Revision 1.13  2003/12/09 21:29:24  skaus\r\n# bugfix: Ask for FreeCOM location when STRINGS are missing [#687]\r\n#\r\n# Revision 1.12  2003/12/09 20:25:34  skaus\r\n# bugfix: INIT: FreeCOM-path and TTY can be in any order\r\n#\r\n# Revision 1.11  2003/09/01 14:14:30  skaus\r\n# bugfix: typo: bad varable specification [#1678]\r\n#\r\n# Revision 1.10  2002/11/12 19:48:47  skaus\r\n# bugfix: COPY: additional output to honor redirection {Eric Auer} [bugID #1313]\r\n#\r\n# Revision 1.9  2002/04/25 18:50:40  skaus\r\n# v0.83 Beta 38:\r\n#\r\n# Revision 1.8  2002/04/23 16:40:41  skaus\r\n# bugfix: CTTY: added to try to set the device flags\r\n#\r\n# Revision 1.7  2002/04/02 23:36:37  skaus\r\n# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n#\r\n# Revision 1.6  2002/04/02 20:58:13  skaus\r\n# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n#\r\n# Revision 1.5  2002/04/02 18:09:31  skaus\r\n# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n#\r\n# Revision 1.3  2001/06/10 17:17:24  skaus\r\n# bugfix: Single point of configuration CONFIG.MAK/.H\r\n#\r\n# Revision 1.2  2001/04/29 11:33:51  skaus\r\n# chg: default heap size (tools\\ptchsize) set to 6KB\r\n# chg: error displaying functions centralized into lib\\err_fcts.src\r\n# add: displayError()\r\n# chg: all errors are displayed through functions void error_*()\r\n# bugfix: somtimes error messages are not displayed (see displayError())\r\n# bugfix: docommand(): type:file must pass \":file\" to TYPE\r\n# bugfix: error_sfile(): string _SFILE_\r\n# bugfix: error message on empty redirection\r\n# bugfix: comma and semicolon ';' are recognized as argument seperators\r\n# \tof internal commands\r\n#\r\n# Revision 1.1  2001/04/12 00:33:53  skaus\r\n# chg: new structure\r\n# chg: If DEBUG enabled, no available commands are displayed on startup\r\n# fix: PTCHSIZE also patches min extra size to force to have this amount\r\n#    of memory available on start\r\n# bugfix: CALL doesn't reset options\r\n# add: PTCHSIZE to patch heap size\r\n# add: VSPAWN, /SWAP switch, .SWP resource handling\r\n# bugfix: COMMAND.COM A:\\\r\n# bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n# add: command MEMORY\r\n# bugfix: runExtension(): destroys command[-2]\r\n# add: clean.bat\r\n# add: localized CRITER strings\r\n# chg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n# \tvia STRINGS.LIB\r\n# add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n# add: fixstrs.c: prompts & symbolic keys\r\n# add: fixstrs.c: backslash escape sequences\r\n# add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n# chg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n# bugfix: IF is now using error system & STRINGS to report errors\r\n# add: CALL: /N\r\n#\r\n#\r\n\r\nMAXLINELENGTH !:= 4096\r\n\r\n.INCLUDE : ../_config.mk\r\n\r\n# Sources of this make target\r\nSRC = absfile.c almemblk.c alprmblk.c alsysblk.c app_get.c app_set.c \\\r\n\tbeep_l.c beep_n.c brk_get.c brk_set.c cbreak.c cbs.c cd_dir.c cgetch.c \\\r\n\tcgettime.c chgctxt.c chgdrv.c chgenv.c chgenvc.c chgenvr.c \\\r\n\tcmdinput.c comfile.c compfile.c critend.c critrchk.c ctxt.c ctxt_adr.c \\\r\n\tctxt_as.c ctxt_chg.c ctxt_clr.c ctxt_get.c ctxt_inf.c ctxt_mk.c \\\r\n\tctxt_mkb.c ctxt_mkn.c ctxt_pop.c ctxt_psh.c ctxt_rnu.c ctxt_set.c \\\r\n\tctxt_ss.c ctxt_vw.c curdatel.c curtime.c cwd.c dateget.c dateset.c \\\r\n\tdbg_c.c dbg_mem.c dbg_prnt.c dbg_s.c dbg_sn.c devopen.c dfn_err.c \\\r\n\tdispcnt.c dispexit.c drvnum.c efct_001.c exec.c exec1.c farread.c \\\r\n\tfcompl1.c fcompl2.c fdattr.c fdevopen.c fdsattr.c fillcomp.c find.c \\\r\n\tfreep.c frsysblk.c fstpcpy.c gallstr.c get1mcb.c getenv.c goxy.c \\\r\n\tgrabfcom.c gumblink.c hdlrctxt.c hist_get.c hist_set.c inputdos.c \\\r\n\tis_empty.c is_fnamc.c is_fnstr.c is_pchr.c isadev.c keyprsd.c kswap_c.c \\\r\n\tlastdget.c lastdset.c leadopt.c lowexec.asm ltrimcl.c ltrimsp.c lwr1wd.c \\\r\n\tmatch.c messages.c mk_rddir.c mktmpfil.c msg_dflt.c msg_dps.c msg_fstr.c \\\r\n\tmsg_get.c msg_gpt.c msg_mkey.c msg_prmp.c mux_ae.c nls.c nls_date.c \\\r\n\tnls_time.c num_fmt.c onoff.c openf.c optsb.c optsi.c optss.c parsenum.c \\\r\n\tpr_date.c pr_prmpt.c pr_time.c prprompt.c readcmd.c realnum.c res.c \\\r\n\tres_r.c res_vald.c res_w.c resfile.c rmtmpfil.c rtrimcl.c rtrimsp.c \\\r\n\tsalloc.c samefile.c scancmd.c scanopt.c session.c showcmds.c skqwd.c \\\r\n\tspfnam.c split.c sumblink.c timeget.c timeset.c tmpnam.c \\\r\n\ttrimcl.c trimsp.c truepath.c truncate.c txtlend.c unquote.c vcgetch.c \\\r\n\tvcgetstr.c where.c\r\nOBJ = absfile.obj almemblk.obj alprmblk.obj alsysblk.obj app_get.obj \\\r\n\tapp_set.obj beep_l.obj beep_n.obj brk_get.obj brk_set.obj cbreak.obj \\\r\n\tcbs.obj cd_dir.obj cgetch.obj cgettime.obj chgctxt.obj chgdrv.obj \\\r\n\tchgenv.obj chgenvc.obj chgenvr.obj cmdinput.obj comfile.obj \\\r\n\tcompfile.obj critend.obj critrchk.obj ctxt.obj ctxt_adr.obj ctxt_as.obj \\\r\n\tctxt_chg.obj ctxt_clr.obj ctxt_get.obj ctxt_inf.obj ctxt_mk.obj \\\r\n\tctxt_mkb.obj ctxt_mkn.obj ctxt_pop.obj ctxt_psh.obj ctxt_rnu.obj \\\r\n\tctxt_set.obj ctxt_ss.obj ctxt_vw.obj curdatel.obj curtime.obj cwd.obj \\\r\n\tdateget.obj dateset.obj dbg_c.obj dbg_mem.obj dbg_prnt.obj dbg_s.obj \\\r\n\tdbg_sn.obj devopen.obj dfn_err.obj dispcnt.obj dispexit.obj drvnum.obj \\\r\n\tefct_001.obj exec.obj exec1.obj farread.obj fcompl1.obj fcompl2.obj \\\r\n\tfdattr.obj fdevopen.obj fdsattr.obj fillcomp.obj find.obj freep.obj \\\r\n\tfrsysblk.obj fstpcpy.obj gallstr.obj get1mcb.obj getenv.obj goxy.obj \\\r\n\tgrabfcom.obj gumblink.obj hdlrctxt.obj hist_get.obj hist_set.obj \\\r\n\tinputdos.obj is_empty.obj is_fnamc.obj is_fnstr.obj is_pchr.obj \\\r\n\tisadev.obj keyprsd.obj kswap_c.obj lastdget.obj lastdset.obj leadopt.obj \\\r\n\tlowexec.obj ltrimcl.obj ltrimsp.obj lwr1wd.obj match.obj messages.obj \\\r\n\tmk_rddir.obj mktmpfil.obj msg_dflt.obj msg_dps.obj msg_fstr.obj \\\r\n\tmsg_get.obj msg_gpt.obj msg_mkey.obj msg_prmp.obj mux_ae.obj nls.obj \\\r\n\tnls_date.obj nls_time.obj num_fmt.obj onoff.obj openf.obj optsb.obj \\\r\n\toptsi.obj optss.obj parsenum.obj pr_date.obj pr_prmpt.obj pr_time.obj \\\r\n\tprprompt.obj readcmd.obj realnum.obj res.obj res_r.obj res_vald.obj \\\r\n\tres_w.obj resfile.obj rmtmpfil.obj rtrimcl.obj rtrimsp.obj salloc.obj \\\r\n\tsamefile.obj scancmd.obj scanopt.obj session.obj showcmds.obj skqwd.obj \\\r\n\tspfnam.obj split.obj sumblink.obj timeget.obj timeset.obj \\\r\n\ttmpnam.obj trimcl.obj trimsp.obj truepath.obj truncate.obj txtlend.obj \\\r\n\tunquote.obj vcgetch.obj vcgetstr.obj where.obj\r\nHDR = ..\\config.h ..\\context.h_c ..\\err_fcts.h ..\\include/batch.h \\\r\n\t..\\include/cmdline.h ..\\include/command.h ..\\include/context.h \\\r\n\t..\\include/crossjmp.h ..\\include/cswap.h ..\\include/datefunc.h \\\r\n\t..\\include/debug.h ..\\include/keys.h ..\\include/kswap.h \\\r\n\t..\\include/misc.h ..\\include/mux_ae.h ..\\include/nls.h \\\r\n\t..\\include/openf.h ..\\include/res.h ..\\include/resource.h \\\r\n\t..\\include/strings.typ ..\\include/timefunc.h ..\\include\\command.h \\\r\n\t..\\include\\context.h ..\\include\\crossjmp.h ..\\include\\large.inc \\\r\n\t..\\include\\misc.h ..\\include\\model.inc ..\\include\\small.inc \\\r\n\t..\\include\\stuff.inc\r\n\r\n\r\n#\tDefault target\r\nall: freecom.lib\r\n\r\n# Error functions generated by scanerr.pl\r\n.INCLUDE : err_fcts.mk\r\nSRC += $(SRC_ERR)\r\nOBJ += $(OBJ_ERR)\r\n\r\n\r\ndist : makefile.mak\r\n\r\n%.obj : %.asm ; $(NASM) $(NASMFLAGS) -f obj -F borland -o $@ $< >>errlist\r\n\r\n### Utils are required by build process\r\n.INIT .PHONY .SEQUENTIAL : verscheck $(CFG) __errl\r\n\r\n.IF $(THISMAKE) == $(LASTMAKE)\r\nverscheck :;\r\n.ELSE\r\nverscheck : \r\n\t@+-echo Changed Make parameters, already made files invalid!\r\n\t+-echo LASTMAKE = $(THISMAKE) >lastmake.mk\r\n\t$(RUNMAKE) clobber\r\n.IF $(CFG)\r\n\t$(RUNMAKE) $(CFG)\r\n.ENDIF\r\n.ENDIF\r\n\r\n__errl:\r\n\t@+-if exist errlist del errlist >nul\r\n\t-ctags *.c ..\\cmd\\*.c ..\\shell\\*.c $(FREEDOS)\\SRC\\LIB\\SUPPL\\*.c\r\n\r\nfreecom.lib .LIBRARY : $(OBJ)\r\n\r\n#MAKEDEP START\r\nabsfile.obj : absfile.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nalmemblk.obj : almemblk.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nalprmblk.obj : alprmblk.c \\\r\n\t ../config.h ../context.h_c ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/kswap.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nalsysblk.obj : alsysblk.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\napp_get.obj : app_get.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\napp_set.obj : app_set.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nbeep_l.obj : beep_l.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nbeep_n.obj : beep_n.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nbrk_get.obj : brk_get.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nbrk_set.obj : brk_set.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\ncbreak.obj : cbreak.c \\\r\n\t ../config.h ../include/batch.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h ../strings.h\r\ncbs.obj : cbs.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\ncd_dir.obj : cd_dir.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\ncgetch.obj : cgetch.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/keys.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\ncgettime.obj : cgettime.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nchgctxt.obj : chgctxt.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/context.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nchgdrv.obj : chgdrv.c \\\r\n\t ../config.h ../err_fcts.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h ../strings.h\r\nchgenv.obj : chgenv.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\nchgenvc.obj : chgenvc.c \\\r\n\t ../config.h ../include/context.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nchgenvr.obj : chgenvr.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\ncmdinput.obj : cmdinput.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/keys.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\ncomfile.obj : comfile.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\ncompfile.obj : compfile.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\ncritend.obj : critend.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\ncritrchk.obj : critrchk.c \\\r\n\t ../config.h ../err_fcts.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nctxt.obj : ctxt.c \\\r\n\t ../config.h ../include/context.h ../include/debug.h\r\nctxt_adr.obj : ctxt_adr.c \\\r\n\t ../config.h ../include/context.h ../include/debug.h\r\nctxt_as.obj : ctxt_as.c \\\r\n\t ../config.h ../include/command.h ../include/context.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nctxt_chg.obj : ctxt_chg.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/context.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nctxt_clr.obj : ctxt_clr.c \\\r\n\t ../config.h ../include/context.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nctxt_get.obj : ctxt_get.c \\\r\n\t ../config.h ../include/context.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nctxt_inf.obj : ctxt_inf.c \\\r\n\t ../config.h ../include/context.h ../include/debug.h\r\nctxt_mk.obj : ctxt_mk.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/context.h \\\r\n\t../include/crossjmp.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nctxt_mkb.obj : ctxt_mkb.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/context.h \\\r\n\t../include/crossjmp.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nctxt_mkn.obj : ctxt_mkn.c \\\r\n\t ../config.h ../include/context.h ../include/debug.h\r\nctxt_pop.obj : ctxt_pop.c \\\r\n\t ../config.h ../err_fcts.h ../include/context.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nctxt_psh.obj : ctxt_psh.c \\\r\n\t ../config.h ../include/command.h ../include/context.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nctxt_rnu.obj : ctxt_rnu.c \\\r\n\t ../config.h ../include/command.h ../include/context.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nctxt_set.obj : ctxt_set.c \\\r\n\t ../config.h ../include/context.h ../include/debug.h\r\nctxt_ss.obj : ctxt_ss.c \\\r\n\t ../config.h ../include/context.h ../include/debug.h\r\nctxt_vw.obj : ctxt_vw.c \\\r\n\t ../config.h ../include/context.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\ncurdatel.obj : curdatel.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/nls.h \\\r\n\t../include/timefunc.h ../strings.h\r\ncurtime.obj : curtime.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/nls.h \\\r\n\t../include/timefunc.h\r\ncwd.obj : cwd.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\ndateget.obj : dateget.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h\r\ndateset.obj : dateset.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h\r\ndbg_c.obj : dbg_c.c \\\r\n\t ../config.h ../include/debug.h\r\ndbg_mem.obj : dbg_mem.c \\\r\n\t ../config.h ../include/debug.h\r\ndbg_prnt.obj : dbg_prnt.c \\\r\n\t ../config.h ../include/debug.h\r\ndbg_s.obj : dbg_s.c \\\r\n\t ../config.h ../include/debug.h\r\ndbg_sn.obj : dbg_sn.c \\\r\n\t ../config.h ../include/debug.h\r\ndevopen.obj : devopen.c \\\r\n\t ../include/openf.h\r\ndfn_err.obj : dfn_err.c \\\r\n\t ../config.h ../err_fcts.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\ndispcnt.obj : dispcnt.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\ndispexit.obj : dispexit.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\ndrvnum.obj : drvnum.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nefct_001.obj : efct_001.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\nexec.obj : exec.c \\\r\n\t ../config.h ../include/command.h ../include/cswap.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/nls.h ../include/timefunc.h\r\nexec1.obj : exec1.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nfarread.obj : farread.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nfcompl1.obj : fcompl1.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\nfcompl2.obj : fcompl2.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\nfdattr.obj : fdattr.c\r\nfdevopen.obj : fdevopen.c \\\r\n\t ../include/openf.h\r\nfdsattr.obj : fdsattr.c\r\nfillcomp.obj : fillcomp.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nfind.obj : find.c \\\r\n\t ../config.h ../include/cmdline.h ../include/debug.h\r\nfreep.obj : freep.c \\\r\n\t ../config.h ../include/cmdline.h ../include/debug.h\r\nfrsysblk.obj : frsysblk.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nfstpcpy.obj : fstpcpy.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\ngallstr.obj : gallstr.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nget1mcb.obj : get1mcb.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\ngetenv.obj : getenv.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\ngoxy.obj : goxy.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\ngrabfcom.obj : grabfcom.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\ngumblink.obj : gumblink.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nhdlrctxt.obj : hdlrctxt.c \\\r\n\t ../config.h ../err_fcts.h ../include/context.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nhist_get.obj : hist_get.c \\\r\n\t ../config.h ../include/context.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nhist_set.obj : hist_set.c \\\r\n\t ../config.h ../include/context.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\ninputdos.obj : inputdos.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nis_empty.obj : is_empty.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nis_fnamc.obj : is_fnamc.c \\\r\n\t ../config.h ../include/debug.h ../include/nls.h\r\nis_fnstr.obj : is_fnstr.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nis_pchr.obj : is_pchr.c\r\nisadev.obj : isadev.c \\\r\n\t ../include/openf.h\r\nkeyprsd.obj : keyprsd.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nkswap_c.obj : kswap_c.c \\\r\n\t ../config.h ../context.h_c ../include/debug.h ../include/kswap.h\r\nlastdget.obj : lastdget.c \\\r\n\t ../config.h ../err_fcts.h ../include/context.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nlastdset.obj : lastdset.c \\\r\n\t ../config.h ../err_fcts.h ../include/context.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nleadopt.obj : leadopt.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nlowexec.obj : lowexec.asm \\\r\n\t .\\..\\include\\large.inc .\\..\\include\\model.inc .\\..\\include\\small.inc \\\r\n\t.\\..\\include\\stuff.inc\r\nltrimcl.obj : ltrimcl.c \\\r\n\t ../config.h ../include/cmdline.h ../include/debug.h\r\nltrimsp.obj : ltrimsp.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nlwr1wd.obj : lwr1wd.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nmatch.obj : match.c \\\r\n\t ../config.h ../include/cmdline.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nmessages.obj : messages.c \\\r\n\t ../config.h ../include/command.h ../include/cswap.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/res.h ../include/resource.h ../include/strings.typ \\\r\n\t../include/timefunc.h ../strings.h\r\nmk_rddir.obj : mk_rddir.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\nmktmpfil.obj : mktmpfil.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nmsg_dflt.obj : msg_dflt.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h ../strings.h\r\nmsg_dps.obj : msg_dps.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nmsg_fstr.obj : msg_fstr.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/strings.typ ../include/timefunc.h \\\r\n\t../strings.h\r\nmsg_get.obj : msg_get.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nmsg_gpt.obj : msg_gpt.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nmsg_mkey.obj : msg_mkey.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nmsg_prmp.obj : msg_prmp.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nmux_ae.obj : mux_ae.c \\\r\n\t ../config.h ../include/command.h ../include/crossjmp.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/mux_ae.h ../include/nls.h ../include/timefunc.h\r\nnls.obj : nls.c \\\r\n\t ../config.h ../include/debug.h ../include/nls.h\r\nnls_date.obj : nls_date.c \\\r\n\t ../config.h ../include/debug.h ../include/nls.h\r\nnls_time.obj : nls_time.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/nls.h ../include/timefunc.h ../strings.h\r\nnum_fmt.obj : num_fmt.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/nls.h ../include/timefunc.h\r\nonoff.obj : onoff.c \\\r\n\t ../config.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nopenf.obj : openf.c \\\r\n\t ../config.h ../include/debug.h ../include/openf.h\r\noptsb.obj : optsb.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\noptsi.obj : optsi.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\noptss.obj : optss.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nparsenum.obj : parsenum.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\npr_date.obj : pr_date.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/nls.h \\\r\n\t../include/timefunc.h\r\npr_prmpt.obj : pr_prmpt.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\npr_time.obj : pr_time.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/nls.h \\\r\n\t../include/timefunc.h\r\nprprompt.obj : prprompt.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/context.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nreadcmd.obj : readcmd.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nrealnum.obj : realnum.c \\\r\n\t ../config.h ../include/context.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nres.obj : res.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/resource.h \\\r\n\t../include/timefunc.h\r\nres_r.obj : res_r.c \\\r\n\t ../config.h ../include/debug.h ../include/resource.h\r\nres_vald.obj : res_vald.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/openf.h \\\r\n\t../include/resource.h ../include/strings.typ ../include/timefunc.h\r\nres_w.obj : res_w.c \\\r\n\t ../include/resource.h\r\nresfile.obj : resfile.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nrmtmpfil.obj : rmtmpfil.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nrtrimcl.obj : rtrimcl.c \\\r\n\t ../config.h ../include/cmdline.h ../include/debug.h\r\nrtrimsp.obj : rtrimsp.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nsalloc.obj : salloc.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nsamefile.obj : samefile.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nscancmd.obj : scancmd.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nscanopt.obj : scanopt.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nsession.obj : session.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/context.h \\\r\n\t../include/crossjmp.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nshowcmds.obj : showcmds.c \\\r\n\t ../config.h ../context.h_c ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/kswap.h ../include/misc.h \\\r\n\t../include/timefunc.h ../strings.h\r\nskqwd.obj : skqwd.c \\\r\n\t ../config.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nspfnam.obj : spfnam.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nsplit.obj : split.c \\\r\n\t ../config.h ../include/cmdline.h ../include/debug.h\r\nsumblink.obj : sumblink.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\ntimeget.obj : timeget.c \\\r\n\t ../config.h ../include/debug.h ../include/timefunc.h\r\ntimeset.obj : timeset.c \\\r\n\t ../config.h ../include/debug.h ../include/timefunc.h\r\ntmpnam.obj : tmpnam.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\ntrimcl.obj : trimcl.c \\\r\n\t ../config.h ../include/cmdline.h ../include/debug.h\r\ntrimsp.obj : trimsp.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\ntruepath.obj : truepath.c \\\r\n\t ../config.h ../err_fcts.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\ntruncate.obj : truncate.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\ntxtlend.obj : txtlend.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nunquote.obj : unquote.c \\\r\n\t ../config.h ../include/cmdline.h ../include/debug.h\r\nvcgetch.obj : vcgetch.c \\\r\n\t ../config.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/keys.h ../include/misc.h ../include/timefunc.h\r\nvcgetstr.obj : vcgetstr.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h\r\nwhere.obj : where.c \\\r\n\t ../config.h ../err_fcts.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h\r\nDYNSOURCES =\r\n#MAKEDEP STOP\r\n\r\nclobber : clean\r\n\t$(RM) $(RMFLAGS) *.com *.cln *.lib *.lst *.cfg makefile.mak\r\n\r\nclean : \r\n\t$(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj *.exe $(CFG) *.dmp com.com tags errlist lib.m3\r\n\r\n\r\nmakefile.mak : makefile lib.m1 lib.m2\r\n\t..\\utils\\chunk freecom_deps <$(mktmp $(OBJ:t\"\\n\")\\n) >lib.m3\r\n\t+copy lib.m1 + lib.m3 + $(mktmp freecom.lib : \\44(CFG) freecom_deps \\n\\tif exist freecom.lib \\44(AR) freecom.lib /c @&&|\\n+-$(OBJ:t\" &\\\\n+-\")\\n| , freecom.lst \\n\\tif not exist freecom.lib \\44(AR) freecom.lib /c @&&|\\n+$(OBJ:t\" &\\\\n+\")\\n| , freecom.lst \\n) + lib.m2 $@\r\n#\t+copy lib.m1 + $(mktmp freecom.lib : \\44(CFG) $(OBJ:t\" \\\\\\\\\\\\n\\\\t\") \\n\\tif exist freecom.lib \\44(AR) freecom.lib /c @&&|\\n+-$(OBJ:t\" &\\\\n+-\")\\n| , freecom.lst \\n\\tif not exist freecom.lib \\44(AR) freecom.lib /c @&&|\\n+$(OBJ:t\" &\\\\n+\")\\n| , freecom.lst \\n) + lib.m2 $@\r\n\r\n"
  },
  {
    "path": "lib/makefile.mak",
    "content": "#.AUTODEPEND\r\n\r\nCFG_DEPENDENCIES = makefile.mak\r\n\r\nTOP = ..\r\n!include \"$(TOP)/config.mak\"\r\n\r\nall: freecom.lib\r\n\r\nOBJS1 = absfile.obj almemblk.obj alprmblk.obj alsysblk.obj app_get.obj app_set.obj beep_l.obj\r\nOBJS2 = beep_n.obj brk_get.obj brk_set.obj cbreak.obj cbs.obj cd_dir.obj cgetch.obj\r\nOBJS3 = cgettime.obj chgctxt.obj chgdrv.obj chgenv.obj chgenvc.obj chgenvr.obj cmdinput.obj\r\nOBJS4 = comfile.obj compfile.obj critend.obj critrchk.obj ctxt.obj ctxt_adr.obj ctxt_as.obj\r\nOBJS5 = ctxt_chg.obj ctxt_clr.obj ctxt_get.obj ctxt_inf.obj ctxt_mk.obj ctxt_mkb.obj ctxt_mkn.obj\r\nOBJS6 = ctxt_pop.obj ctxt_psh.obj ctxt_rnu.obj ctxt_set.obj ctxt_ss.obj ctxt_vw.obj curdatel.obj\r\nOBJS7 = curtime.obj cwd.obj dateget.obj dateset.obj dbg_c.obj dbg_mem.obj dbg_prnt.obj\r\nOBJS8 = dbg_s.obj dbg_sn.obj devopen.obj dfn_err.obj dispcnt.obj dispexit.obj drvnum.obj\r\nOBJS9 = efct_001.obj exec.obj exec1.obj farread.obj filecomp.obj fdattr.obj fdevopen.obj\r\nOBJS10 = fdsattr.obj fillcomp.obj find.obj freep.obj frsysblk.obj fstpcpy.obj gallstr.obj\r\nOBJS11 = get1mcb.obj getenv.obj goxy.obj grabfcom.obj gumblink.obj hdlrctxt.obj hist_get.obj\r\nOBJS12 = hist_set.obj inputdos.obj is_empty.obj is_fnamc.obj is_fnstr.obj is_pchr.obj isadev.obj\r\nOBJS13 = keyprsd.obj kswap_c.obj lastdget.obj lastdset.obj leadopt.obj lfnfuncs.obj lowexec.obj\r\nOBJS14 = ltrimcl.obj ltrimsp.obj lwr1wd.obj match.obj messages.obj mk_rddir.obj mktmpfil.obj\r\nOBJS15 = msg_dflt.obj msg_dps.obj msg_fstr.obj msg_get.obj msg_gpt.obj msg_mkey.obj msg_prmp.obj\r\nOBJS16 = mux_ae.obj myperror.obj nls.obj nls_date.obj nls_time.obj num_fmt.obj onoff.obj\r\nOBJS17 = openf.obj optsb.obj optsi.obj optss.obj parsenum.obj pr_date.obj pr_prmpt.obj\r\nOBJS18 = pr_time.obj prf.obj prprompt.obj readcmd.obj realnum.obj res.obj res_r.obj\r\nOBJS19 = res_vald.obj res_w.obj resfile.obj rmtmpfil.obj rtrimcl.obj rtrimsp.obj salloc.obj\r\nOBJS20 = samefile.obj scancmd.obj scanopt.obj session.obj showcmds.obj skqwd.obj spfnam.obj\r\nOBJS21 = split.obj sumblink.obj timeget.obj timeset.obj tmpnam.obj trimcl.obj trimsp.obj\r\nOBJS22 = truepath.obj truncate.obj txtlend.obj unquote.obj vcgetch.obj vcgetstr.obj where.obj\r\nOBJS23 = delay.obj\r\nOBJS24 = err1.obj err2.obj err3.obj err4.obj err5.obj err6.obj err7.obj\r\nOBJS25 = err8.obj err9.obj err10.obj err11.obj err12.obj err13.obj err14.obj\r\nOBJS26 = err15.obj err16.obj err17.obj err18.obj err19.obj err20.obj err21.obj\r\nOBJS27 = err22.obj err23.obj err24.obj err25.obj err26.obj err27.obj err28.obj\r\nOBJS28 = err29.obj err30.obj err31.obj err32.obj err33.obj err34.obj err35.obj\r\nOBJS29 = err36.obj err37.obj err38.obj err39.obj err40.obj err41.obj err42.obj\r\nOBJS30 = err43.obj err44.obj err45.obj err46.obj err47.obj err48.obj err49.obj\r\nOBJS31 = err50.obj err51.obj err52.obj err53.obj err54.obj err55.obj err56.obj\r\nOBJS32 = err57.obj err58.obj err59.obj err60.obj err61.obj err62.obj err63.obj\r\nOBJS33 = err64.obj err65.obj err66.obj err67.obj err68.obj err69.obj err70.obj\r\nOBJS34 = err71.obj err72.obj err73.obj err74.obj err75.obj err76.obj err77.obj\r\nOBJS35 = err78.obj err79.obj err80.obj err81.obj err82.obj err83.obj err84.obj\r\nOBJS36 = err85.obj err86.obj err87.obj\r\n\r\nfreecom.rsp : $(ECHOLIBDEP) makefile.mak\r\n\t$(RMFILES) freecom.rsp\r\n\t$(ECHOLIB) freecom.rsp $(OBJS1)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS2)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS3)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS4)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS5)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS6)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS7)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS8)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS9)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS10)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS11)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS12)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS13)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS14)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS15)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS16)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS17)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS18)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS19)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS20)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS21)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS22)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS23)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS24)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS25)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS26)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS27)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS28)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS29)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS30)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS31)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS32)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS33)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS34)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS35)\r\n\t$(ECHOLIB) freecom.rsp $(OBJS36)\r\n\r\nfreecom_deps1 : $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) $(OBJS6) $(OBJS7) \\\r\n$(OBJS8) $(OBJS9) $(OBJS10) $(OBJS11) $(OBJS12) $(OBJS13) $(OBJS14) $(OBJS15) \\\r\n$(OBJS16) $(OBJS17) $(OBJS18)\r\n\r\nfreecom_deps2 : $(OBJS19) $(OBJS20) $(OBJS21) $(OBJS22) $(OBJS23) $(OBJS24) \\\r\n$(OBJS25) $(OBJS26) $(OBJS27) $(OBJS28) $(OBJS29) $(OBJS30) $(OBJS31) $(OBJS32) \\\r\n$(OBJS33) $(OBJS34) $(OBJS35) $(OBJS36)\r\n\r\nfreecom.lib : $(CFG) freecom_deps1 freecom_deps2 freecom.rsp\r\n\t$(RMFILES) freecom.lib\r\n\t$(AR) freecom.lib @freecom.rsp $(LIBLIST) freecom.lst\r\n"
  },
  {
    "path": "lib/match.c",
    "content": "/*\t$Id$\r\n\r\n *  Check if the passed line begins with a specified word\r\n *  The word is matched case-insensitively.\r\n *  'len' is the length of the word.\r\n *  On success, the pointer is placed onto the next word.\r\n *  Return: 0: on failure\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.2  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/misc.h\"\r\n\r\nint match_(char ** const Xp, const char * const word, int len)\r\n{\tchar *p;\r\n\r\n\tassert(Xp && *Xp);\r\n\tassert(word && *word);\r\n\tassert(len > 0);\r\n\r\n\tif(strnicmp(p = *Xp, word, len) == 0) {\r\n\t\t/* line begins with string, now test if it is a word */\r\n\t\tp += len;\r\n\t\tif(*p) {\r\n\t\t\tchar *q = ltrimcl(p);\t/* skip to next token */\r\n\t\t\tif(q == p) \t\t\t\t/* no word boundary */\r\n\t\t\t\treturn 0;\r\n\t\t\tp = q;\r\n\t\t}\r\n\t\t*Xp = p;\r\n\t\treturn 1;   /* found */\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "lib/messages.c",
    "content": "/*\t$Id$\r\n\r\n\tmsgSegment() - return the segment of memory the STRINGS have been\r\n\t\tloaded to; if they are not present in memory, they are loaded\r\n\t\tfrom the resources\r\n\tunloadMsgs() - deallocate the loaded STRINGS segment\r\n\r\n\tThis file bases on MESSAGES.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.8  2006/09/11 00:07:22  blairdude\r\n\tFixed compilation completely with Turbo C\r\n\r\n\tRevision 1.7  2004/06/29 21:57:20  skaus\r\n\tfix: /LOW option\r\n\t\r\n\tRevision 1.6  2004/06/29 14:14:56  skaus\r\n\tfix: help screen of internal commands causes \"Unknown command error\" {Bernd Blaauw}\r\n\t\r\n\tRevision 1.5  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.4  2003/12/09 21:29:24  skaus\r\n\tbugfix: Ask for FreeCOM location when STRINGS are missing [#687]\r\n\t\r\n\tRevision 1.3  2002/04/02 23:36:37  skaus\r\n\tadd: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n\t\r\n\tRevision 1.2  2002/04/02 18:09:31  skaus\r\n\tadd: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#include <io.h>\r\n\r\n#include <suppl.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/res.h\"\r\n#include \"../strings.h\"\r\n#include \"../include/strings.typ\"\r\n#include \"../include/cswap.h\"\r\n\r\nunsigned msgSegm = 0;                   /* strings segment if loaded */\r\nstring_count_t strCnt = 0;\t\t/* number of strings */\r\n\r\n/* Remove the string segment from memory */\r\nvoid unloadMsgs(void) \r\n{\r\n  if(msgSegm) {\r\n    freeBlk(msgSegm);\r\n    dprintf( (\"[Message segment 0x%04x deallocated.]\\n\", msgSegm) );\r\n  }\r\n  msgSegm = 0;\r\n}\r\n\r\n/* Number of bytes of preceeding the index array:\r\n\tID string\r\n\t+ trailer (\\r\\n\\x1a\\0)\r\n\t+ count of entries\r\n\t+ size of data portion\r\n*/\r\n#define STRINGS_HEADER_SIZE sizeof(STRINGS_ID) + STRINGS_ID_TRAILER\t\\\r\n\t+ sizeof(string_size_t) + sizeof(string_count_t) - 1\r\n\r\n/* Callback function for enumResources() */\r\n/* Called if the resource locator found a resource with a matching\r\n\tmajor ID --> we ignore all the rest of IDs and probe for the\r\n\tvalidation string at the beginning of the resource data */\r\n\r\nstatic int loadStrings (res_majorid_t major,\r\n\t\t        res_minorid_t minor,\r\n\t\t        unsigned long length,\r\n\t\t\tint fd,\r\n\t\t\tvoid *const arg) {\r\n\tloadStatus *ls = arg;\r\n\tchar fdid[sizeof(STRINGS_ID)];\r\n\tstring_size_t len, firstStr;\r\n\tstring_index_t far*idx;\r\n\tint i, error;\r\n\r\n\t(void)major, (void)minor;\r\n\tif((unsigned long)length >= 0x10000ul\r\n\t || (unsigned)length < STRINGS_HEADER_SIZE) {\r\n\t\t*ls = STRINGS_SIZE_MISMATCH;\r\n\t\treturn 0;\r\n\t}\r\n\r\n\terror = 0;\r\n\tif(dos_read(fd, fdid, sizeof(STRINGS_ID) - 1) != sizeof(STRINGS_ID) - 1)\r\n\t\terror = 1;\r\n\r\n\tif (memcmp(fdid, STRINGS_ID, sizeof(STRINGS_ID) - 1)) {\r\n\t\t*ls = STRINGS_ID_MISMATCH;\r\n\t\treturn 0;\t\t\t/* Continue searching */\r\n\t}\r\n\t/* immediately after the ID a trailer follows */\r\n\tif(lseek(fd, (long)STRINGS_ID_TRAILER, 1) < 0)\r\n\t\terror = 1;\r\n\r\n\t\t/* Read the strings dimensionating parameters */\r\n\tif(error\r\n\t || dos_read(fd, &strCnt, sizeof(strCnt)) != sizeof(strCnt)\r\n\t || dos_read(fd, &len, sizeof(len)) != sizeof(len)) { /* Read error */\r\n\t \t*ls = STRINGS_READ_ERROR;\r\n\t \treturn 0;\t\t\t/* Continue searching */\r\n\t}\r\n\t/* At this point f is positioned at the very first string index\r\n\t the data area is NUMBER_OF_STRINGS * sizeof(index) +\r\n\t SIZE_OF_STRINGS   */\r\n\tlen += firstStr = strCnt * sizeof(string_index_t);\r\n\tif((unsigned)length - STRINGS_HEADER_SIZE < len) {\r\n\t\t*ls = STRINGS_SIZE_MISMATCH;\r\n\t\treturn 0;\r\n\t}\r\n\t\t/* allocation mode: last fit, high first */\r\n\tif ((msgSegm = allocMemBlk(len, 0x82)) == 0) {\r\n\t\t*ls = STRINGS_OUT_OF_MEMORY;\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tif(farread(fd, MK_FP(msgSegm, 0), len) != len) {\r\n\t\tunloadMsgs();\t\t\t/* Remove the message segment */\r\n\t\t*ls = STRINGS_READ_ERROR;\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t/* Now the offset of the index array are updated to point to the\r\n\t\treal offset instead of the displacement based on the first\r\n\t\tbyte of the string data area */\r\n\tidx = MK_FP(msgSegm, 0);\r\n\tfor(i = 0; i < strCnt; ++i)\r\n\t\tidx[i].index += firstStr;\r\n\r\n\t*ls = STRINGS_LOADED;\r\n\treturn 1;\t\t/* Stop searching */\r\n}\r\n\r\n/*\r\n *  If the messages are NOT loaded and if there is an error during\r\n *  the load, the automatic load process might hang here infinitely.\r\n */\r\nunsigned msgSegment(void)              /* load messages into memory */\r\n{\tstatic int recurs = 1;\r\n\tloadStatus status;\r\n\r\n\tif(msgSegm)\r\n\t\treturn msgSegm;\r\n\r\n\t\t/* prevent reentrance */\r\n\tif(--recurs == 0) {\t\t/* OK */\r\n\t\tfor(;;) {\r\n\t\tstatus = STRINGS_NOT_FOUND;\r\n#ifdef FEATURE_XMS_SWAP\r\n\t\tmsgSegm = XMSswapmessagesIn(&status);\r\n\t\tif(status == STRINGS_NOT_FOUND)\r\n#endif\r\n\t\t\tenumResources(RES_ID_STRINGS, loadStrings, &status);\r\n\t\tswitch(status) {\r\n\t\tcase STRINGS_LOADED:\r\n\t\t  assert(msgSegm);\r\n\t\t  dprintf((\"[Messages successfully loaded to segment 0x%04x]\\n\"\r\n\t\t   , msgSegm));\r\n\t\t\tbreak;\r\n#ifdef DEBUG\r\n\t\t/* Don't use dprintf() to ensure the message is issued, even\r\n\t\t\tif fddebug is OFF */\r\n\t\tcase STRINGS_NOT_FOUND:\r\n\t\t\tassert(msgSegm == 0);\r\n\t\t\tdbg_outsn(\"[No STRINGS resource found!]\");\r\n\t\t\tbreak;\r\n\t\tcase STRINGS_ID_MISMATCH:\r\n\t\t\tassert(msgSegm == 0);\r\n\t\t\tdbg_outsn(\"[STRINGS ID string mismatch.]\");\r\n\t\t\tbreak;\r\n\t\tcase STRINGS_READ_ERROR:\r\n\t\t\tassert(msgSegm == 0);\r\n\t\t\tdbg_outsn(\"[Read error while loading STRINGS.]\");\r\n\t\t\tbreak;\r\n\t\tcase STRINGS_SIZE_MISMATCH:\r\n\t\t\tassert(msgSegm == 0);\r\n\t\t\tdbg_outsn(\"[STRINGS resource has invalid size.]\");\r\n\t\t\tbreak;\r\n\t\tcase STRINGS_OUT_OF_MEMORY:\r\n\t\t\tassert(msgSegm == 0);\r\n\t\t\tdbg_outsn(\"[Out of memory loading STRINGS.]\");\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tassert(msgSegm == 0);\r\n\t\t\tdbg_outsn(\"[Unknown error loading STRINGS.]\");\r\n\t\t\tbreak;\r\n#else\t/* Even in non-debugging, an error should\r\n\t\t\t\t\t\t\tbe displayed */\r\n\t\tcase STRINGS_NOT_FOUND:\r\n\t\tcase STRINGS_ID_MISMATCH:\r\n\t\tcase STRINGS_READ_ERROR:\r\n\t\tcase STRINGS_SIZE_MISMATCH:\r\n\t\t\tbreak;\r\n\t\tcase STRINGS_OUT_OF_MEMORY:\r\n\t\t\tassert(msgSegm == 0);\r\n\t\t\tputs(\"[Out of memory loading STRINGS.]\");\r\n\t\t\tbreak;\r\n#endif\r\n\t\t}\r\n\r\n\t\t\tif(msgSegm)\r\n\t\t\t\tbreak;\r\n\t\t\tif(inInit > 1)\t/* Don't fetch the name interactively too early */\r\n\t\t\t\tbreak;\r\n#undef TEXT_ERROR_OUT_OF_MEMORY\r\n#undef TEXT_ERROR_LOADING_STRINGS\r\n\t\t\tputs(TEXT_ERROR_LOADING_STRINGS);\r\n\t\t\t{\tchar *buf = malloc(128 + 1);\r\n\r\n\t\t\t\tif(!buf) {\r\n\t\t\t\t\tdos_write(2, (void *)TEXT_ERROR_OUT_OF_MEMORY,\r\n\t\t\t\t\t   strlen(TEXT_ERROR_OUT_OF_MEMORY));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tint orgEcho = echo;\r\n\r\n\t\t\t\t\techo = 0;\r\n\t\t\t\t\treadcommand(buf, 128);\r\n\t\t\t\t\techo = orgEcho;\r\n\t\t\t\t\tif(!*buf) {\r\n\t\t\t\t\t\tfree(buf);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(0 == grabComFilename(1, (char far*)buf)) {\r\n\t\t\t\t\t\t\t/* Try to set the valid %COMSPEC% */\r\n\t\t\t\t\t\tif(!inInit && chgEnv(\"COMSPEC\", ComPath))\r\n\t\t\t\t\t\t\tchgEnv(\"COMSPEC\", 0);\t/* Zap the old one */\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfree(buf);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t++recurs;\r\n\t}\r\n\r\n\treturn msgSegm;\r\n}\r\n"
  },
  {
    "path": "lib/mk_rddir.c",
    "content": "/* $Id$\r\n * MD & RD handler\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <io.h>\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/lfnfuncs.h\"\r\n\r\nstatic int optRecursiveMode, optQuiet;\r\n\r\n#define COMMAND_EXTENSIONS\r\n#ifdef COMMAND_EXTENSIONS\r\noptScanFct(opt_md_rd)\r\n{\r\n  (void)arg;\r\n  switch(ch) {\r\n  case 'S': return optScanBool(optRecursiveMode);  /* rmdir */\r\n  case 'P': return optScanBool(optRecursiveMode);  /* mkdir */\r\n  case 'Q': return optScanBool(optQuiet);          /* don't display error and don't prompt to remove files/directories */\r\n  }\r\n  optErr();\r\n  return E_Useage;\r\n}\r\n\r\n#define SCANNER_FCT opt_md_rd\r\n#else\r\n#define SCANNER_FCT 0\r\n#endif\r\n\r\nint mk_rd_dir(char *param, int (*func) (const char *, int recursiveMode, int quiet), char *fctname)\r\n{\tchar **argv;\r\n\tint argc, opts;\r\n\tint rv;\r\n\r\n\tassert(func);\r\n\r\n\t/* initialize options */\r\n\toptRecursiveMode = optQuiet = 0;\r\n\r\n\tif((argv = scanCmdline(param, SCANNER_FCT, 0, &argc, &opts)) == 0)\r\n\t\treturn E_Useage;\r\n\r\n\tif(argc != 1) {\r\n\t\terror_syntax(0);\r\n\t\trv = 1;\r\n\t} else {\r\n\t\tcutBackslash(argv[0]);\r\n\r\n\t\tdprintf((\"%s: '%s'\\n\", fctname, argv[0]));\r\n\t\tif((rv = func(argv[0], optRecursiveMode, optQuiet)) != 0) {\r\n\t\t\tif (!optQuiet) error_dirfct_failed(fctname, argv[0]);\r\n\t\t}\r\n\t}\r\n\r\n\tfreep(argv);\r\n\treturn rv;\r\n}\r\n"
  },
  {
    "path": "lib/mktmpfil.c",
    "content": "/*\t$Id$\r\n\r\n \tTry to create a temporary file in a specified directory\r\n \twith a given extension.\r\n \tOn success the name of the temporary file is returned in a\r\n \tdynamically allocated buffer.\r\n \tThe extension is simply appended to the randomized filename and\r\n \tmust contain the leading dot.\r\n *\r\n *  Comments:\r\n *    Creates unique filenames and creates the files, too.\r\n *    The filenames do not contain an extension, but my\r\n *    consume up to eight (8) characters as filename.\r\n *\r\n *    The filenames are prefixed by %TEMP%, %TMP%, %TEMPDIR%,\r\n *    %TMPDIR%, \"\\\\TEMP\", \"\\\\TMP\", fullpath_of(\".\"), \"<bootdrive>:\\\\\",\r\n *    \".\"; in that order, whichever returns a writeable location first\r\n *\r\n *    The filenames are created within dymamic memory and must be\r\n *    free()'ed by the caller himself.\r\n *    The files are touched, meaning they are created with zero\r\n *    length and no special attributes, but closed; the caller must\r\n *    remove the file himself.\r\n *\r\n\r\n\tThis file bases on TMPNAM.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.2  2004/02/01 13:24:22  skaus\r\n\tbugfix: misidentifying unspecific failures from within SUPPL\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n#include \"../config.h\"\r\n\r\n#include <dos.h>\r\n#include <errno.h>\r\n#include <fcntl.h>\r\n#include <io.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#include <sys/stat.h>\r\n\r\n#include <dfn.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/misc.h\"\r\n\r\n#define nomem error_out_of_memory\r\n\r\n/*\r\n *  Try to create a temporary file with the supplied path, also\r\n *  fully-qualify it\r\n *\r\n *  If ext != NULL, its contents is appended to a randomized prefix,\r\n *  most useful, if 'ext' begins with a dot, to give the file to be\r\n *  created an extension.\r\n */\r\nchar *mktempfile(const char * const path, const char *ext)\r\n{\r\n  char *fn, *newpath;\r\n  int cnt,\r\n    fd;\r\n\r\n  if (!path)                    /* to simplify the caller function */\r\n    return 0;\r\n\r\n  if((fn = abspath(path, 0)) == 0)  /* out-of-mem */\r\n    return 0;\r\n\r\n  if (!ext)                     /* make sure it's a legal string */\r\n    ext = \"\";\r\n\r\n  /* The completed name consits of:\r\n     + the absolute path name,\r\n     + the '\\\\' path component delimited path vs. filename\r\n     + eight (8) characters randomized filename\r\n     + the user-supplied extension\r\n     + the '\\0' terminator byte\r\n   */\r\n  if ((newpath = realloc(fn, strlen(fn) + strlen(ext) + 10)) == 0)\r\n  {\r\n    /* out of mem */\r\n    free(fn);\r\n    nomem();\r\n    return 0;\r\n  }\r\n\r\n  fn = strchr(newpath, '\\0');      /* where the '\\\\' is to be */\r\n  if (fn[-1] != '\\\\')           /* maybe 1 byte is wasted here */\r\n    *fn++ = '\\\\';\r\n\r\n  cnt = 0;\r\n  do {             /* randomize filename and probe if it can be created */\r\n    /* OK, this is not that efficient, but easy to implement\r\n       right now -- 1998/10/27 ska */\r\n    sprintf(fn, \"CMD%x%s\", cnt, ext);\r\n    if (!++cnt)                 /* overflow */\r\n      goto errRet;\r\n\r\n    /* loop until either the open succeeded or failed with\r\n       something different then \"file already exists\"\r\n\r\n       However, this failed in Win98 DOSbox on root of\r\n       CD-Rom drive:\r\n       (fd = open(path, O_CREAT | O_EXCL | O_WRONLY\r\n       , S_IREAD | S_IWRITE)) == -1 && errno == EACCES);\r\n\r\n       Because DOS returned: EACCES\r\n\r\n       Let's assume access() does not fail on directories:\r\n     */\r\n  }\r\n  while(dfnstat(newpath)); /* such entry already exists */\r\n\r\n  /* Make semaphore test */\r\n  fd = sfn_creatnew(newpath, 0);\r\n  if (fd != -1)\r\n  {                             /* success */\r\n    dos_close(fd);\r\n    return newpath;\r\n  }\r\n\r\nerrRet:\r\n  free(newpath);\r\n  return 0;\r\n}\r\n"
  },
  {
    "path": "lib/msg_dflt.c",
    "content": "/*\t$Id$\r\n\r\n\tCreate default message or display Out-of-memory error onto screen\r\n\r\n\tThis file bases on MESSAGES.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/06/29 14:14:56  skaus\r\n\tfix: help screen of internal commands causes \"Unknown command error\" {Bernd Blaauw}\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n\r\nstatic struct {\r\n\tunsigned id;\r\n\tconst char *string;\r\n} cached_ids[] = {\r\n\t{ TEXT_ERROR_OUT_OF_MEMORY,\r\n#undef TEXT_ERROR_OUT_OF_MEMORY\r\n\t\tTEXT_ERROR_OUT_OF_MEMORY }\r\n\t, { TEXT_ERROR_OPEN_FILE,\r\n#undef TEXT_ERROR_OPEN_FILE\r\n\t\tTEXT_ERROR_OPEN_FILE }\r\n\t, { TEXT_ERROR_FCOM_INVALID,\r\n#undef TEXT_ERROR_FCOM_INVALID\r\n\t\tTEXT_ERROR_FCOM_INVALID }\r\n\t, { TEXT_ERROR_SET_ENV_VAR,\r\n#undef TEXT_ERROR_SET_ENV_VAR\r\n\t\tTEXT_ERROR_SET_ENV_VAR }\r\n\t, { ~0, 0 }\r\n};\r\n\r\nchar *defaultMessage(unsigned id)\r\n{\r\n\tchar *h;\r\n\tint i;\r\n\r\n\tfor(i = 0; cached_ids[i].id != (unsigned)~0; ++i) {\r\n\t\tif(id == cached_ids[i].id) {\r\n\t\t\th = strdup(cached_ids[i].string);\r\n\t\t\tif(h) return h;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n  /* Allocate 5 bytes for the numerical ID itself */\r\n  if(id != cached_ids[0].id\r\n   && (h = malloc(sizeof(MSG_DFL_PATTERN) + 5)) != 0) {\r\n    /* Got enough memory to allocate the stuff */\r\n    sprintf(h, MSG_DFL_PATTERN, id);\r\n    return h;\r\n  }\r\n\r\n  puts(cached_ids[0].string);\r\n  return 0;\r\n}\r\n"
  },
  {
    "path": "lib/msg_dps.c",
    "content": "/*\t$Id$\r\n\r\n\tDisplay a STRING\r\n\r\n\tThis file bases on MESSAGES.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.4  2006/06/11 02:47:05  blairdude\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.2  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdarg.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\n#ifdef DEBUG\r\nFILE *errStream = 0;\r\n#else\r\n/* static FILE *errStream = 0; */\r\n#endif\r\n\r\nstatic void displayXString(FILE *stream, unsigned id, va_list args)\r\n{\tchar *str;\r\n\r\n\tif((str = getString(id)) != 0) {\r\n\t\tvfprintf(stream, str, args);\r\n\t\tfree(str);\r\n\t}\r\n}\r\nvoid displayString(unsigned id,...)\r\n{\tva_list ap;\r\n\r\n\tva_start(ap, id);\r\n\tdisplayXString(outStream, id, ap);\r\n\tva_end(ap);\r\n}\r\nvoid displayError(unsigned id,...)\r\n{\tva_list ap;\r\n\r\n\tva_start(ap, id);\r\n#ifdef DEBUG\r\n\tdisplayXString(errStream? errStream: stderr, id, ap);\r\n#else\r\n    displayXString( stderr, id, ap );\r\n#endif\r\n\tva_end(ap);\r\n}\r\n"
  },
  {
    "path": "lib/msg_fstr.c",
    "content": "/*\t$Id$\r\n\r\n\tread the string from the resource and return a dummy entry\r\n\ton failure\r\n\r\n\tThis file bases on MESSAGES.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.4  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.3  2002/04/02 23:36:37  skaus\r\n\tadd: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n\t\r\n\tRevision 1.2  2002/04/02 18:09:31  skaus\r\n\tadd: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include <portable.h>\r\n#include <fmemory.h>\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n#include \"../include/strings.typ\"\r\n\r\nchar *getString(unsigned id)\r\n{\r\n\tchar *thisstr;\r\n\tunsigned segm;\r\n    string_index_t far *idx;\r\n\r\n\t  /* Issue the default message, if:\r\n  \t\t+ strings could not be loaded into memory,\r\n  \t\t+ requested string ID is not included with resource\r\n  \t\t\t(too high, or not defined).\r\n\t*/\r\n\tif((segm = msgSegment()) == 0\r\n\t || id >= strCnt\r\n\t || (idx = MK_FP(segm, id * sizeof(*idx)))->size == 0)\r\n\t\treturn defaultMessage(id);\r\n\r\n\t/* pointer to id's control data */\r\n\tif((thisstr = malloc(idx->size)) == 0)\r\n\t\treturn defaultMessage(MSG_ERR_ID_OUTOFMEMORY);\r\n\r\n\t_fmemcpy((char far*)thisstr, MK_FP(segm, idx->index), idx->size);\r\n\r\n\treturn thisstr;\r\n}\r\n"
  },
  {
    "path": "lib/msg_get.c",
    "content": "/*\t$Id$\r\n\r\n * As getString(), but removes the last character.\r\n *\r\n *  This is necessary, because there is always a newline character\r\n *  at the end of the last line.\r\n\r\n\tThis file bases on MESSAGES.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nchar *getMessage(unsigned id)\r\n{\tchar *h, *q;\r\n\r\n\tif((h = getString(id)) != 0 && *h) {\r\n\t\tq = strchr(h, '\\0');\r\n\t\tassert(q);\r\n\t\tif(*--q == '\\n')\r\n\t\t\t*q = '\\0';\r\n\t}\r\n\treturn h;\r\n}\r\n"
  },
  {
    "path": "lib/msg_gpt.c",
    "content": "/*\t$Id$\r\n\r\n\tGet a prompt string\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint getPromptString(unsigned id\r\n , char ** const promptChars\r\n , char ** const fmtString)\r\n{\r\n\tchar *fmt, *str;\r\n\r\n\tif((str = getString(id)) == 0)\r\n\t\treturn 0;\r\n\r\n\tfmt = str + 2 * *(unsigned char*)str + 1;\r\n\tassert(strlen(str) >= fmt - str);\r\n\r\n\tassert(fmtString);\r\n\tassert(promptChars);\r\n\t*fmtString = fmt;\r\n\t*promptChars = str;\r\n\r\n\treturn 1;\r\n}\r\n"
  },
  {
    "path": "lib/msg_mkey.c",
    "content": "/*\t$Id$\r\n\r\n\tMap an input key into its associated metakey\r\n\r\n\tReturn:\r\n\t\t0: on error\r\n\t\t1..26: metakey\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint mapMetakey(const char * const str, int ch)\r\n{\tconst char *q;\r\n\r\n\tif((q = memchr(str + 1, ch, *(const unsigned char*)str)) == 0) \r\n\t\treturn 0;                     /* hit erroreous character */\r\n\r\n\treturn str[(q - str) + *(unsigned char*)str];\t/* metakey */\r\n}\r\n"
  },
  {
    "path": "lib/msg_prmp.c",
    "content": "/*\t$Id$\r\n\r\n\tPerforms an user prompt\r\n\r\n\tDisplay prompt (if any), get user input via vcgetchar(),\r\n\tmap key to metakey, return metakey if valid.\r\n\r\n\t$Log$\r\n\tRevision 1.4  2006/06/12 04:55:42  blairdude\r\n\tAll putchar's now use outc which first flushes stdout and then uses write to write the character to the console.  Some potential bugs have been fixed ( Special thanks to Arkady for noticing them :-) ).  All CONIO dependencies have now been removed and replaced with size-optimized functions (for example, mycprintf, simply opens \"CON\" and directly writes to the console that way, and mywherex and mywherey use MK_FP to access memory and find the cursor position).  FreeCOM is now\r\n\tsignificantly smaller.\r\n\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\t\r\n\t\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\t\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdarg.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint userprompt(unsigned id,...)\r\n{\r\n\tchar *fmt, *str;\r\n\tint ch;\r\n\r\n\tif(!getPromptString(id, &str, &fmt))\r\n\t\treturn 0;\r\n\r\n\t/* Issue message */\r\n\tif(*fmt) {\r\n\t\tva_list ap;\r\n\r\n\t\tva_start(ap, id);\r\n\t\tvprintf(fmt, ap);\r\n\t\tva_end(ap);\r\n\t}\r\n\r\n\twhile((ch = vcgetchar()) == 0 || (ch = mapMetakey(str, ch)) == 0)\r\n\t\tbeep();                     /* hit erroreous character */\r\n\r\n\toutc('\\n');                /* advance to next line */\r\n\tfreePromptString(str, fmt);\r\n\r\n\treturn ch;\r\n}\r\n"
  },
  {
    "path": "lib/mux_ae.c",
    "content": "/*\t$Id$\r\n\r\n\tImplementation for Installable COMMAND extensions (MUX-AE)\r\n\r\n\tReturn:\r\n\t\t0 - No extension\r\n\t\t1 - Extension performed\r\n\t\t2 - rewrote command line/name\r\n\r\n\tThis file bases on MUX_AE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.6  2006/06/11 02:47:05  blairdude\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\r\n\tRevision 1.5  2004/06/14 18:38:08  skaus\r\n\tbugfix: MUX-AE: useage of DS:[SI] {Eduardo Almao}\r\n\t\r\n\tRevision 1.4  2004/06/07 19:32:14  skaus\r\n\tbugfix: MUX-AE: useage of DS:[SI] {Eduardo Almao}\r\n\t\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.2  2003/03/05 17:53:01  skaus\r\n\tbugfix: cached NLS data not flushed\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <dos.h>\r\n#include <string.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/crossjmp.h\"\r\n#include \"../include/mux_ae.h\"\r\n#include \"../include/nls.h\"\r\n\r\n#if BUFFER_SIZE_MUX_AE > 255\r\n#error \"BUFFER_SIZE_MUX_AE must not exceed 255\"\r\n#endif\r\n\r\n/* Check for extensions and perform it, on success return != 0 */\r\n/* Also: The contents of both buffers is monitored in order to\r\n\tcheck if they got overflowed during the MUX call. If so,\r\n\tthe executation is aborted. */\r\nint runExtension(char * const command, char * const line)\r\n{\tint clen, llen;\r\n\tIREGS r;\r\n\tchar *p;\r\n\tint rc = 0;\t\t\t/* Default: is no extension */\r\n\r\n\tassert(command);\r\n\tassert(line);\r\n\r\n\tassert(strlen(command) < BUFFER_SIZE_MUX_AE);\r\n\tassert(strlen(line) <= BUFFER_SIZE_MUX_AE);\r\n\r\n\tassert(FP_SEG(command) == FP_SEG(line));\r\n\r\n\t/* Fill the length bytes */\r\n\tcommand[-1] = (char)(clen = strlen(command));\r\n\tline[-1]    = (char)(llen = strlen(line));\r\n\tcommand[-2] = line[-2] = (char)BUFFER_SIZE_MUX_AE;\r\n\r\n\t/* 4dos v4 compatible space padding */\r\n\tmemset(command + clen, ' ', BUFFER_SIZE_MUX_AE - clen);\r\n\t/* The command line is \\xd terminated, for savety reasons an \\0 is\r\n\t\tadded too */\r\n\tstrcat(line + llen, \"\\xd\");\r\n\tline[BUFFER_SIZE_MUX_AE] = '\\0';\r\n\r\n/* Both strings have been prepared now; the MUX call is going to happen */\r\n\tr.r_ax = 0xae00;\t\t/* Installable Commands check for extension */\r\n\tr.r_dx = 0xffff;\t\t/* Magic value */\r\n\tr.r_cx = -llen;\t\t\t/* length of command line tail (4dos v4) */\r\n\tr.r_ds = r.r_es = FP_SEG(command);\r\n\tr.r_bx = FP_OFF(line) - 2;\r\n\tr.r_si = FP_OFF(command) - 1;\r\n\tr.r_di = 0;\t\t\t\t/* Magic value 4dos v4 */\r\n\r\n    intrpt(0x2F, &r);\r\n\r\n\tswitch(r.r_ax & 0xFF) {\r\n\tcase 0x00:\t\t/* No appropriate extension found */\r\n\t\tbreak;\r\n\r\n\tdefault:\t\t/* Invalid response */\r\n\t\tdprintf( (\"[Invalid response from Installable Commands handler: 0x%02x]\\n\", r.r_ax & 0xFF) );\r\n\t\tbreak;\r\n\r\n\tcase 0xFF:\t\t/* Is an extension -> execute the Installable Command */\r\n\t\tr.r_ax = 0xae01;\r\n        intrpt(0x2F, &r);\r\n\t\tinvalidateNLSbuf();\r\n\t\tif(command[-1] == 0)\t\t/* The command had been processed */\r\n\t\t\trc = 1;\t\t\t\t/* Stop interpreting the command */\r\n\t\telse rc = 2;\t\t\t/* buffers rewritten */\r\n\r\n\t\tbreak;\r\n\t}\r\n\r\n/* Cleanup: Adjust buffers and check for overflow */\r\n\tif((unsigned char)line[-2] != BUFFER_SIZE_MUX_AE\r\n#if BUFFER_SIZE_MUX_AE < 255\r\n\t || (unsigned char)line[-1] > BUFFER_SIZE_MUX_AE\r\n#endif\r\n\t || line[BUFFER_SIZE_MUX_AE]) {\r\n\t\t/* Yiek! That looks very much like an overflow!! */\r\n\t\tdprintf( (\"[Memory corrupted during Installable Commands handler]\\n\") );\r\n\t\tlongjmp(jmp_beginning, E_CorruptMemory);\r\n\t}\r\n\r\n\t/* Check command and transform it back into C-style string */\r\n\tp = command + command[-1];\r\n\twhile(--p >= command && isspace(*p));\r\n\tp[1] = 0;\r\n\r\n\t/* Check the command line and transform it into a C-style string */\r\n\t/* Must terminate as line[BUFFER_SIZE] == 0 */\r\n\tline[(unsigned char)line[-1]]\r\n\t = line[(unsigned char)line[-2]]\r\n\t = '\\0';\r\n\tif(0 != (p = strchr(line, '\\xd')))\r\n\t\t*p = 0;\r\n\r\n\treturn rc;\r\n}\r\n"
  },
  {
    "path": "lib/myperror.c",
    "content": "/* Smaller PERROR replacement for FreeCOM (only used in REN and DEL) */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <errno.h>\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n\r\nvoid myperror( const char *msg )\r\n{\r\n    displayError( errno == EACCES ? TEXT_ERROR_PERMISSION_DENIED :\r\n                  errno == ENOENT ? TEXT_ERROR_NO_SUCH_FILE :\r\n                  TEXT_ERROR_UNKNOWN_ERROR, msg );\r\n}\r\n"
  },
  {
    "path": "lib/nls.c",
    "content": "/*\t$Id$\r\n\r\n *  By default COMMAND assumes that the NLS information do change.\r\n *  refreshNLS() will make sure that nlsBuf is updated and on\r\n *  occasion when the information could have been changed, nlsBuf\r\n *  is invalidated in order to be re-read by refreshNLS().\r\n\r\n\tThis file bases on NLS.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/nls.h\"\r\n\r\nCountry *nlsBuf = 0;\r\n\r\nvoid refreshNLS(void)\r\n{ if(!nlsBuf)\r\n    nlsBuf = nlsNewInfo();\r\n}\r\n"
  },
  {
    "path": "lib/nls_date.c",
    "content": "/*\t$Id$\r\n\r\n\treturns the dynamically allocated ASCII representation\r\n\tof the passed in date\r\n\r\n\tThis file bases on NLS.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/09/05 01:44:33  blairdude\r\n\tMassive patches from Arkady that I'm way too lazy to sort through.  If anything happens, Arkady can answer for it.\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <stdio.h>\r\n#include <string.h>\r\n\r\n#include \"../include/nls.h\"\r\n\r\nchar *nls_makedate (int mode, int year, int month, int day) {\r\n        char buf[4 + 3 + sizeof(int) * 8 * 3];\r\n        (void)mode;\r\n\r\n#ifdef FEATURE_NLS\r\n\trefreshNLS();\r\n\r\n\tswitch(nlsBuf->datefmt) {\r\n\tcase 0:\t\t\t/* mm/dd/yy */\r\n\t\tsprintf(buf, \"%02u%s%02u%s%02u\", month, nlsBuf->dateSep, day\r\n\t\t , nlsBuf->dateSep, year);\r\n\t\tbreak;\r\n\tcase 1:\t\t\t/* dd/mm/yy */\r\n\t\tsprintf(buf, \"%02u%s%02u%s%02u\", day, nlsBuf->dateSep, month\r\n\t\t , nlsBuf->dateSep, year);\r\n\t\tbreak;\r\n\tcase 2:\t\t\t/* yy/mm/dd */\r\n\t\tsprintf(buf, \"%02u%s%02u%s%02u\", year, nlsBuf->dateSep, month\r\n\t\t , nlsBuf->dateSep, day);\r\n\t\t \r\n\t\tbreak;\r\n\t}\r\n#else\r\n\tsprintf(buf, \"%02u-%02u-%02u\", month, day, year);\r\n#endif\r\n\r\n\treturn strdup(buf);\r\n}\r\n"
  },
  {
    "path": "lib/nls_time.c",
    "content": "/*\t$Id$\r\n\r\n\tReturn the dynamically allocated ASCII representation of\r\n\tthe passed in time\r\n\r\n\tThis file bases on NLS.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.5  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.4  2003/03/11 20:01:14  skaus\r\n\tbugfix: PROMPT $T: hour: space padded; fraction zero padded [#1481]\r\n\t\r\n\tRevision 1.3  2001/06/12 22:56:59  skaus\r\n\tbugfix: nls_maketime(): 12hour display does not free AM/PM id\r\n\t\r\n\tRevision 1.2  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../include/nls.h\"\r\n#include \"../strings.h\"\r\n\r\nchar *nls_maketime(int mode, int hour, int minute, int second, int fraction)\r\n{\tchar buf[4 + 4 + sizeof(int) * 8 * 4 + 6];\r\n\tchar *p;\r\n\tint i, pm = 0;\r\n\r\n#ifdef FEATURE_NLS\r\n\trefreshNLS();\r\n#define fmt nlsBuf->timefmt\r\n#define sep nlsBuf->timeSep\r\n#define dsep nlsBuf->decimalSep\r\n#else\r\n#define fmt 0\r\n#define sep \":\"\r\n#define dsep \".\"\r\n#endif\r\n\r\n\t/** Warning: condition always true -- if !NLS **/\r\n\tif(fmt == 0) {\t\t/* 12hour display */\r\n\r\n\t\tif((pm = hour >= 12) != 0) {\r\n\t\t\thour -= 12;\r\n\t\t}\r\n\t\tif(hour == 0)\r\n\t\t\thour = 12;\r\n\r\n\t\ti = sprintf(p = buf, \"%2u%s%02u\", hour, sep, minute);\r\n\t} else {\r\n\t\t/** Warning: unreachable code -- if !defined(NLS) **/\r\n\t\ti = sprintf(p = buf, \"%2u%s%02u\", hour, sep, minute);\r\n\t}\r\n\r\n\tassert(strlen(buf) < sizeof(buf));\r\n\r\n\tif(i == EOF) return 0;\r\n\tif(second >= 0) {\r\n\t\ti = sprintf(p += i, \"%s%02u\", sep, second);\r\n\t\tif(i == EOF) return 0;\r\n\t\tif(fraction) {\r\n\t\t\ti = sprintf(p += i, \"%s%-2u\", dsep, fraction);\r\n\t\t\tif(i == EOF) return 0;\r\n\t\t\t{\tchar *q = p + i;\r\n\t\t\t\twhile(*--q == ' ')\r\n\t\t\t\t\t*q = '0';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tassert(strlen(buf) < sizeof(buf));\r\n\r\n\t/** Warning: conditional always true -- if !NLS **/\r\n\tif(fmt == 0) {\r\n\t\tchar *q = getString(pm? TEXT_STRING_PM: TEXT_STRING_AM);\r\n\t\tif(!q)\t\treturn 0;\r\n\t\tif(mode & NLS_MAKE_SHORT_AMPM) {\r\n\t\t\t*(p += i) = *ltrimsp(q);\r\n\t\t\tp[1] = 0;\r\n\t\t} else\r\n\t\t\tstrcpy(p + i, q);\r\n\t\tfree(q);\r\n\t}\r\n\r\n\tassert(strlen(buf) < sizeof(buf));\r\n\r\n\treturn strdup(buf);\r\n}\r\n\r\n"
  },
  {
    "path": "lib/num_fmt.c",
    "content": "/*\t$Id$\r\n\r\n * convert\r\n *\r\n * insert commas into a number\r\n\r\n\tThis file bases on DIR.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/08/02 20:38:56  skaus\r\n\tbugfix: use of the nls thousands separator in convert() [Eduardo Casino]\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../include/nls.h\"\r\n\r\nvoid convert(unsigned long num, unsigned int billions, char * const des)\r\n{\r\n  char temp[sizeof(num) * 8];\r\n  int c = 0;\r\n\r\n  assert(des);\r\n\r\n  if(num == 0) {\r\n    des[0] = '0';\r\n    des[1] = 0;\r\n  } else {\r\n    refreshNLS();\r\n    assert(nlsBuf);\r\n    temp[31] = 0;\r\n   \tdo { \r\n      if (((c + 1) % 4) == 0)\r\n        temp[30 - c++] = nlsBuf->thousendsSep[0];\r\n      temp[30 - c++] = (char)(num % 10) + '0';\r\n      num /= 10;\r\n      if (c == 11 && num == 0) {\r\n        num = billions;\r\n        billions = 0;\r\n      }\r\n    } while(num != 0 || billions != 0);\r\n    strcpy(des, &temp[31 - c]);\r\n  }\r\n}\r\n"
  },
  {
    "path": "lib/onoff.c",
    "content": "/*\t$Id$\r\n\r\n *\tTests if a string is ON or OFF\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.5  2004/02/10 19:10:02  skaus\r\n\tbugfix: onoffStr(): do not ignore leading argument delimiters [#1736]\r\n\r\n\tRevision 1.4  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.3  2002/11/12 18:56:48  skaus\r\n\tbugfix: onOffStr(): zaps trailing argument delimiters, e.g. ECHO set=\r\n\t\r\n\tRevision 1.2  2001/04/29 12:24:36  skaus\r\n\tbugfix: >>PATH<< with empty %PATH% --> PATH=(null)\r\n\tfix: BREAK/VERIFY ignore trailing spaces\r\n\tfix: >>PATH ;<< remove PATH environment variable\r\n\tfix: cache 3 environment variables to overcome nested useage (e.g. when\r\n\t\tloading message segment to print environment variable)\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n\r\nenum OnOff onoffStr(char *line)\r\n{\tenum OnOff state = OO_Other;\r\n\r\n\tif(!line)\r\n\t\treturn OO_Null;\r\n\tline = ltrimsp(line);\r\n\tif(!*line)\r\n\t\treturn OO_Empty;\r\n\tif(matchtok(line, D_OFF))\r\n\t\tstate = OO_Off;\r\n\telse if(matchtok(line, D_ON))\r\n\t\tstate = OO_On;\r\n\treturn *line? OO_Other: state;\r\n}\r\n"
  },
  {
    "path": "lib/openf.c",
    "content": "/*\t$Id$\r\n\r\n *      Check if the passed filename is a CP/M style device\r\n *\r\n *      These device names must not contain any drive or path or\r\n *      extension component, but have a colon ':' at their end.\r\n *\r\n *      Return:\r\n *              0: no\r\n *              else: yes; fnam contains a valid filename now\r\n\r\n *      To handle CP/M style devices, like \"CON:\" and \"LPT1:\", which\r\n *      are not understood by the DOS kernel directly, these functions\r\n *      wrap the open() and fopen() functions and deal with it.\r\n *\r\n *    Also included are some low-level functions dealing with\r\n *    file descriptors, such as \"isadev()\".\r\n\r\n\tThis file bases on OPENF.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <fcntl.h>\r\n#include <io.h>\r\n#include <stdio.h>\r\n#include <string.h>\r\n\r\n#include \"../include/misc.h\"\r\n#include \"../include/openf.h\"\r\n\r\n/*\r\n *      Just for the algorithm:\r\n *              One could just transform the \"XXXX:\" style into\r\n *              \"\\dev\\XXXX\". However, WinNT DOSbox does not support\r\n *              this as it seems (\"copy \\dev\\con test\" says path not found).\r\n *\r\n *              On the other hand, how many other DOS clones don't support\r\n *              the \\DEV\\ prefix, too?\r\n *\r\n *      So I open the device and check the handle if it's connected to\r\n *      a character device rather than a block device.\r\n */\r\n\r\n\r\nint isDeviceName(char *const fnam)\r\n{\r\n  char *p;\r\n\r\n  assert(fnam);\r\n\r\n  if ((p = strpbrk(fnam, \":\\\\/\")) != 0 /* has a colon or path component */\r\n      && *p == ':'              /* has colon --> no path component */\r\n      && p[1] == '\\0'           /* at end of string */\r\n      && p >= fnam + 2)\r\n  {                             /* no simple drive letter */\r\n    int fd;\r\n\r\n    *p = '\\0';                  /* strip off the colon to make it valid for DOS */\r\n\r\n    /* open with read access only to prevent from creating\r\n       disk fiels accidently */\r\n    if ((fd = dos_open(fnam, O_RDONLY)) >= 0)\r\n    {                           /* open OK */\r\n      int rv;\r\n\r\n      /* check for character device */\r\n      rv = isadev(fd);\r\n      dos_close(fd);\r\n      if (rv)\r\n        return 1;               /* is device name */\r\n    }\r\n    *p = ':';                   /* restore the original filename */\r\n  }\r\n\r\n  return 0;                     /* no device name */\r\n}\r\n"
  },
  {
    "path": "lib/optsb.c",
    "content": "/*\t$Id$\r\n\r\n *  Perform an option check and parse value for boolean\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.4  2005/12/10 10:09:43  perditionc\r\n\tbased on patches from Blair Campbell, additional LFN support (slim print,\r\n\tadd initial cd,rd,md support, make compile time optional), remove some\r\n\tcompiler warnings, and prevent extra linebreak for compatibility\r\n\r\n\tRevision 1.3  2005/09/03 18:15:10  perditionc\r\n\tdir /p /p works same as dir /p\r\n\t\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <process.h>\r\n#include <stdio.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nint optScanBool_(const char * const optstr, int bool, const char *arg, int *value, int flip)\r\n{\r\n  assert(optstr);\r\n  assert(value);\r\n\r\n  if(arg) {\r\n    error_opt_arg(optstr);\r\n    return E_Useage;\r\n  }\r\n  switch(bool) {\r\n  case -1:  *value = 0; break;\r\n  case 0:   if (flip) {*value = !*value; break; } /* else fall through to case 1 */\r\n  case 1:   *value = 1; break;\r\n#ifndef NDEBUG\r\n  default:  fprintf(stderr, \"Invalid boolean option value: in file %s line %u\\n\", __FILE__, __LINE__);\r\n    abort();\r\n#endif\r\n  }\r\n  return 0;\r\n}\r\n"
  },
  {
    "path": "lib/optsi.c",
    "content": "/*\t$Id$\r\n\r\n *  Perform an option check and parse value for integer\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/09/05 01:44:33  blairdude\r\n\tMassive patches from Arkady that I'm way too lazy to sort through.  If anything happens, Arkady can answer for it.\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nint optScanInteger_ (const char *const optstr, int bool_v,\r\n                     const char * arg, unsigned int * value) {\r\n  unsigned int v;\r\n\r\n  (void)bool_v;\r\n  assert(optstr);\r\n  assert(value);\r\n\r\n  if(!arg || !*arg) {\r\n    error_opt_noarg(optstr);\r\n    return E_Useage;\r\n  }\r\n\r\n  v = 0;\r\n  --arg;\r\n  while(isdigit(*++arg))\r\n    v = v * 10 + *arg - '0';\r\n\r\n  if(*arg) {\r\n    error_invalid_number(optstr);\r\n    return E_Useage;\r\n  }\r\n\r\n  *value = v;\r\n  return 0;\r\n}\r\n"
  },
  {
    "path": "lib/optss.c",
    "content": "/*\t$Id$\r\n\r\n *  Perform an option check and parse value for string\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/09/05 01:44:33  blairdude\r\n\tMassive patches from Arkady that I'm way too lazy to sort through.  If anything happens, Arkady can answer for it.\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nint optScanString_ (const char *const optstr, int bool_v,\r\n                    const char * arg, char ** value) {\r\n  (void)bool_v;\r\n  assert(optstr);\r\n  assert(value);\r\n\r\n  if(!arg) {\r\n    error_opt_noarg(optstr);\r\n    return E_Useage;\r\n  }\r\n  free(*value);\r\n  if((*value = strdup(arg)) == 0) {\r\n    error_out_of_memory();\r\n    return E_NoMem;\r\n  }\r\n  return 0;\r\n}\r\n"
  },
  {
    "path": "lib/parsenum.c",
    "content": "/*\t$Id$\r\n\r\n *  Parse any number of unsigned integer numbers in the range:\r\n *    0..9999\r\n *\r\n *  Input:  s: String, != NULL\r\n *    maxCnt: maximum number of numbers to parse\r\n *    *cnt: receives the number of parsed numbers, != NULL\r\n *    nums[]: receives the parsed numbers\r\n *\r\n *  The string may consists of:\r\n *  string ::= [whitespaces] [num_list [whitespaces]]\r\n *  whitespaces ::= whitespace | whitespaces whitespace\r\n *  whitespace ::= any_character_isspace()_returns_true_for\r\n *  num_list ::= delimited_numbers [delimiter]\r\n *  delimited_numbers ::= number | delimited_numbers delimiter number\r\n *  number ::= digit | number digit\r\n *  digit ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'\r\n *  delimiter ::= any_character_ispunct()_and_isascii()_are_true_for\r\n *\r\n *  There can be at maximum one spurious delimiter behind all the\r\n *  numbers, except behind the maxCnt'th number. This allows to\r\n *  type in \"half\" dates, e.g.: \"3.3.\" for 3rd March (equal to: \"3.3\");\r\n *  but this is forbidden for: \"3.3.1999.\", because maxCnt is equal to\r\n *  three, when dates are parsed.\r\n *\r\n *  Return:\r\n *    NULL: Fatal error, e.g. number exceeds boundary\r\n *    else: pointer to first character not parsed\r\n\r\n\tThis file bases on PARSENUM.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.2  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nchar *parsenum(const char *s, int maxCnt, int *cnt, int nums[])\r\n{ int n;\r\n\r\n  if(!s || !cnt || !nums || maxCnt <= 0)\r\n    return 0;\r\n\r\n  *cnt = 0;\r\n\r\n  /* skip leading whitespaces */\r\n  s = ltrimsp(s);\r\n\r\n  while(isdigit(*s)) {\r\n    /* scan next number */\r\n    n = 0;\r\n    do {\r\n      if(n >= 10000)\r\n        return 0;\r\n      n = n * 10 + *s - '0';\r\n    } while(isdigit(*++s));\r\n    nums[(*cnt)++] = n;\r\n    if(!isascii(*s) || !ispunct(*s) || !--maxCnt)\r\n      break;\r\n    ++s;      /* skip delimiter */\r\n  }\r\n\r\n  return ltrimsp(s);\r\n}\r\n"
  },
  {
    "path": "lib/pr_date.c",
    "content": "/*\t$Id$\r\n\r\n\tParses a date given in ASCIIZ into a dosdate_t structure.\r\n\r\n\t1 number -> day only (month & year filled with current values)\r\n\t2 numbers -> day & month (year filled with current value)\r\n\t3 numbers -> day, month,& year\r\n\r\n\tif datep == NULL, the result is not returned in *datep\r\n\t\t-> thus checking for valid values only\r\n\r\n\tReturn:\r\n\t\tE_None: *datep filled\r\n\t\tE_Empty: empty line\r\n\t\telse: some error\r\n\r\n\tThis file bases on DATE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.4  2006/09/05 01:44:33  blairdude\r\n\tMassive patches from Arkady that I'm way too lazy to sort through.  If anything happens, Arkady can answer for it.\r\n\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.2  2001/04/29 12:56:57  skaus\r\n\tbugfix: DATE: does not accept empty line\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <string.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/nls.h\"\r\n\r\n\r\nstatic unsigned char months[2][13] =\r\n{\r\n  {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},\r\n  {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}\r\n};\r\n\r\nint parsedate (const char * s, struct dosdate_t *const datep) {\r\n  struct dosdate_t d;\r\n  unsigned char leap;\r\n  int nums[3],\r\n    items;\r\n\r\n  assert(s);\r\n\r\n  /* Parse at maximum three numbers */\r\n  s = parsenum(s, 3, &items, nums);\r\n\r\n  if (!s || *s)                 /* general error or too many characters */\r\n    return E_Empty;\r\n\r\n  _dos_getdate(&d);             /* fetch current info */\r\n#ifdef FEATURE_NLS\r\n\trefreshNLS();\r\n\tassert(nlsBuf);\r\n\tassert(/*0 <= nlsBuf->datefmt && */ nlsBuf->datefmt <= 2);\r\n\tassert(nlsBuf->dateSep);\r\n\tswitch(nlsBuf->datefmt) {\r\n\tcase 0:\t\t/* mm/dd/yy */\r\n#endif\r\n\t\tswitch (items) {\r\n\t\tcase 0:                    /* empty line --> always OK */\r\n\t\t  return E_Empty;\r\n\r\n\t\tcase 1:                    /* single number --> day only */\r\n\t\t  d.day = nums[0];\r\n\t\t  break;\r\n\r\n\t\tcase 3:                    /* three numbers --> year, month & day */\r\n\t\t  d.year = nums[2];\r\n\t\t  /* fall through */\r\n\r\n\t\tcase 2:                    /* two numbers --> month & day */\r\n\t\t  d.day = nums[1], d.month = nums[0];\r\n\t\t  break;\r\n\t\t}\r\n\r\n#ifdef FEATURE_NLS\r\n\t\tbreak;\r\n\tcase 1:\t\t/* dd/mm/yy */\r\n\t\tswitch (items) {\r\n\t\tcase 0:                    /* empty line --> always OK */\r\n\t\t  return E_Empty;\r\n\r\n\t\tcase 3:                    /* three numbers --> year, month & day */\r\n\t\t  d.year = nums[2];\r\n\t\t  /* fall through */\r\n\r\n\t\tcase 2:                    /* two numbers --> month & day */\r\n\t\t  d.month = nums[1];\r\n\t\t  /* fall through */\r\n\r\n\t\tcase 1:\r\n\t\t  d.day = nums[0]; \r\n\t\t  break;\r\n\t\t}\r\n\t\tbreak;\r\n\r\n\tcase 2:\t\t/* yy/mm/dd */\r\n\t\tswitch (items) {\r\n\t\tcase 0:                    /* empty line --> always OK */\r\n\t\t  return E_Empty;\r\n\r\n\t\tcase 3:                    /* three numbers --> year, month & day */\r\n\t\t  d.year = nums[0];\r\n\t\t  d.month = nums[1];\r\n\t\t  d.day = nums[2]; \r\n\t\t  break;\r\n\r\n\t\tcase 2:                    /* two numbers --> month & day */\r\n\t\t  d.month = nums[0];\r\n\t\t  d.day = nums[1]; \r\n\t\t  break;\r\n\r\n\t\tcase 1:\r\n\t\t  d.day = nums[0]; \r\n\t\t  break;\r\n\t\t}\r\n\t\tbreak;\r\n\t}\r\n#endif\r\n\r\n  /* if only entered two digits for year, assume 1900's */\r\n  if (d.year < 80)\r\n    d.year += 2000;\r\n  else if (d.year < 200)\r\n    d.year += 1900;\r\n\r\n  leap = (!(d.year % 4) && (d.year % 100)) || !(d.year % 400);\r\n\r\n  if ((d.month >= 1 && d.month <= 12) &&\r\n      (d.day >= 1 && d.day <= months[leap][d.month]) &&\r\n      (d.year >= 1980 && d.year <= 2099))\r\n  {\r\n    if(datep)\r\n    \tmemcpy(datep, &d, sizeof(d));\r\n    return E_None;\r\n  }\r\n\r\n  return E_Range;\r\n}\r\n"
  },
  {
    "path": "lib/pr_prmpt.c",
    "content": "/* $Id$\r\n * print the command-line prompt\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <stdlib.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n\r\nvoid printprompt(void)\r\n{\tchar *pr;\r\n\r\n\tdbg_printmem();\r\n\r\n\tpr = getEnv(PROMPTVAR);        /* get PROMPT environment var. */\r\n\r\n\tdisplayPrompt(pr? pr: DEFAULT_PROMPT);\r\n\tfree(pr);\r\n}\r\n"
  },
  {
    "path": "lib/pr_time.c",
    "content": "/*\t$Id$\r\n\r\n\tparsetime() parses the ASCII representation of a time into\r\n\ta dostime_t\r\n\r\n *  One can specify:\r\n *    ^\\s*\\d+.\\d+(.(\\d+(.\\d*)?)?)?\\s*([aApP]([mM]|\\.[mM]\\.)?\\s*$\r\n *  If one specifies:\r\n *    1 number --> error\r\n *    2 numbers --> hour:minute, seconds & hundreds default to zero\r\n *    3 numbers --> hour:minute:seconds, hundreds defaults to zero\r\n *    4 numbers --> hour:minute:seconds.hundreds\r\n *  The numbers may be delimited by any character from the 7-bit ASCII set,\r\n *  which is printable, but not alphanumerical.\r\n\r\n\tThis file bases on TIME.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.2  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/nls.h\"\r\n\r\n\r\nint parsetime(const char *s, struct dostime_t * const timep)\r\n{\r\n  struct dostime_t t;\r\n  int nums[4],\r\n    items;\r\n  int pm;\r\n\r\n  assert(s);\r\n\r\n  memset(nums, 0, sizeof(nums));  /* let default everything to zero */\r\n\r\n  /* Parse at maximum three numbers */\r\n  s = parsenum(s, 4, &items, nums);\r\n\r\n  if (!s)                       /* general error */\r\n    return E_Syntax;\r\n\r\n  /* 12 hour time format? */\r\n  pm = 0;                       /* no such flag */\r\n  switch(toupper(*s))\r\n  {\r\n    case 'P':\r\n      ++pm;                     /* post meridian */\r\n    case 'A':\r\n      ++pm;                     /* ante meridian */\r\n      /* strip ?M or ?.M. */\r\n      if(toupper(s[1]) == 'M')\r\n      \ts += 2;\r\n      else if(memicmp(s + 1, \".M.\", 3) == 0)\r\n        s += 4;\r\n  }\r\n  if(*ltrimsp(s))\r\n    return E_Syntax;            /* too many characters on line */\r\n\r\n  switch (items)\r\n  {\r\n    case 0:                    /* empty line --> always OK */\r\n      return E_Empty;\r\n\r\n    case 1:                    /* single number --> error */\r\n      return E_Useage;\r\n\r\n#if 0\r\n    default:                   /* four numbers --> 1/100s, s, min, h */\r\n      /* else: 1/100s and/or s default to zero */\r\n      break;\r\n#endif\r\n  }\r\n\r\n  t.hour = nums[0];\r\n  t.minute = nums[1];\r\n  t.second = nums[2];\t\t/* if missing defaults to previously set */\r\n  t.hsecond = nums[3];\t\t/* values, aka 0 */\r\n\r\n  switch (pm)\r\n  {\r\n    case 2:                    /* post meridian */\r\n      if(t.hour != 12) t.hour += 12;\r\n      break;\r\n    case 1:                    /* antes meridian */\r\n      if (t.hour == 12)\r\n        t.hour = 0;\r\n      break;\r\n      /* default:   not specified --> nothing to do */\r\n  }\r\n\r\n  if (t.hour >= 24 || t.minute >= 60 || t.second >= 60 || t.hsecond > 99)\r\n    return E_Range;\r\n\r\n  if(timep)\r\n  \tmemcpy(timep, &t, sizeof(t));\r\n  return E_None;\r\n}\r\n"
  },
  {
    "path": "lib/prf.c",
    "content": "/****************************************************************/\r\n/*                                                              */\r\n/*                            prf.c                             */\r\n/*                                                              */\r\n/*                  Abbreviated printf Function                 */\r\n/*                                                              */\r\n/*                      Copyright (c) 1995                      */\r\n/*                      Pasquale J. Villani                     */\r\n/*                      All Rights Reserved                     */\r\n/*                                                              */\r\n/* This file is part of DOS-C.                                  */\r\n/*                                                              */\r\n/* DOS-C is free software; you can redistribute it and/or       */\r\n/* modify it under the terms of the GNU General Public License  */\r\n/* as published by the Free Software Foundation; either version */\r\n/* 2, or (at your option) any later version.                    */\r\n/*                                                              */\r\n/* DOS-C is distributed in the hope that it will be useful, but */\r\n/* WITHOUT ANY WARRANTY; without even the implied warranty of   */\r\n/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See    */\r\n/* the GNU General Public License for more details.             */\r\n/*                                                              */\r\n/* You should have received a copy of the GNU General Public    */\r\n/* License along with DOS-C; see the file COPYING.  If not,     */\r\n/* write to the Free Software Foundation, 675 Mass Ave,         */\r\n/* Cambridge, MA 02139, USA.                                    */\r\n/****************************************************************/\r\n\r\n#include <stdarg.h>\r\n#include <stdlib.h>\r\n#include <stdio.h>\r\n#include <io.h>\r\n#include <string.h>\r\n#include <../include/misc.h>\r\n#include <fmemory.h>\r\n\r\n#define FALSE 0\r\n#define TRUE 1\r\n\r\nstatic char *charp, *pbuf;\r\n\r\nstatic void handle_char(int, FILE *);\r\nstatic char * ltob(long, char *, int);\r\nstatic int do_printf(FILE *f, const char *, register va_list);\r\n\r\n#ifndef DEBUG\r\nFILE *stdin = (FILE *)0, *stdout= (FILE *)1, *stderr = (FILE *)2;\r\n#endif\r\n\r\nstatic void flushbuf(FILE *f)\r\n{\r\n  dos_write(fileno(f), pbuf, charp - pbuf);\r\n  charp = pbuf;\r\n}\r\n\r\nint puts(const char *s)\r\n{\r\n  return printf(\"%s\\n\", s);\r\n}\r\n\r\n/* special handler to switch between sprintf and printf */\r\nstatic void handle_char(int c, FILE *f)\r\n{\r\n  if (c == '\\n')\r\n    *charp++ = '\\r';\r\n  *charp++ = c;\r\n  /* flush buffer for '\\n' or if full */\r\n  if (f && (charp - pbuf >= 79 || c == '\\n'))\r\n    flushbuf(f);\r\n}\r\n\r\n/* ltob -- convert an long integer to a string in any base (2-16) */\r\nchar *ltob(long n, char * s, int base)\r\n{\r\n  unsigned long u;\r\n  char *p, *q;\r\n  int c;\r\n\r\n  u = n;\r\n\r\n  if (base == -10)              /* signals signed conversion */\r\n  {\r\n    base = 10;\r\n    if (n < 0)\r\n    {\r\n      u = -n;\r\n      *s++ = '-';\r\n    }\r\n  }\r\n\r\n  p = q = s;\r\n  do\r\n  {                             /* generate digits in reverse order */\r\n    *p++ = \"0123456789ABCDEF\"[(unsigned short) (u % base)];\r\n  }\r\n  while ((u /= base) > 0);\r\n\r\n  *p = '\\0';                    /* terminate the string */\r\n  while (q < --p)\r\n  {                             /* reverse the digits */\r\n    c = *q;\r\n    *q++ = *p;\r\n    *p = c;\r\n  }\r\n  return s;\r\n}\r\n\r\n#define LEFT    0\r\n#define RIGHT   1\r\n\r\n/* printf -- short version of printf to conserve space */\r\nint vprintf(const char * fmt, va_list arg)\r\n{\r\n  return vfprintf(stdout, fmt, arg);\r\n}\r\n\r\nint vfprintf(FILE *f, const char * fmt, va_list arg)\r\n{\r\n  char buf[80];\r\n  int ret;\r\n  charp = pbuf = buf;\r\n  ret = do_printf(f, fmt, arg);\r\n  flushbuf(f);\r\n  return ret;\r\n}\r\n\r\nint printf(const char * fmt, ...)\r\n{\r\n  va_list arg;\r\n\r\n  va_start(arg, fmt);\r\n  return vfprintf(stdout, fmt, arg);\r\n}\r\n\r\nint fprintf(FILE *f, const char * fmt, ...)\r\n{\r\n  va_list arg;\r\n\r\n  va_start(arg, fmt);\r\n  return vfprintf(f, fmt, arg);\r\n}\r\n\r\nint sprintf(char * buff, const char * fmt, ...)\r\n{\r\n  va_list arg;\r\n\r\n  va_start(arg, fmt);\r\n  return vsprintf(buff, fmt, arg);\r\n}\r\n\r\nint vsprintf(char *buff, const char * fmt, va_list arg)\r\n{\r\n  charp = buff;\r\n  do_printf(NULL, fmt, arg);\r\n  handle_char(0, NULL);\r\n  return charp - buff - 1;\r\n}\r\n\r\nint do_printf(FILE *f, const char * fmt, va_list arg)\r\n{\r\n  int base;\r\n  char s[11];\r\n  char far * p;\r\n  int c, flag, size, fill, precision;\r\n  int longarg;\r\n  long currentArg;\r\n\r\n  while ((c = *fmt++) != '\\0')\r\n  {\r\n    if (c != '%')\r\n    {\r\n      handle_char(c, f);\r\n      continue;\r\n    }\r\n\r\n    longarg = FALSE;\r\n    flag = RIGHT;\r\n    fill = ' ';\r\n\r\n    if (*fmt == '0')\r\n    {\r\n      fill = '0';\r\n      fmt++;\r\n    }\r\n\r\n    if (*fmt == '-')\r\n    {\r\n      flag = LEFT;\r\n      fmt++;\r\n    }\r\n\r\n    for(;;)\r\n    {\r\n      if (*fmt == '*')\r\n      {\r\n        precision = va_arg(arg, int);\r\n        fmt++;\r\n      }\r\n      else\r\n      {\r\n        precision = 0;\r\n        while (*fmt >= '0' && *fmt <= '9')\r\n        {\r\n          precision = precision * 10 + (*fmt++ - '0');\r\n        }\r\n      }\r\n\r\n      if(c == '%')\r\n      {\r\n        size = precision;\r\n        precision = -1;\r\n        if (size < 0)\r\n        {\r\n          size = -size;\r\n          flag = LEFT;\r\n        }\r\n      }\r\n      if((c = *fmt) != '.')break;\r\n      fmt++;\r\n    }\r\n\r\n    if (c == 'l')\r\n    {\r\n      longarg = TRUE;\r\n      fmt++;\r\n    }\r\n\r\n    c = *fmt++;\r\n    switch (c)\r\n    {\r\n      case '\\0':\r\n        return 0;\r\n\r\n      case 'c':  \r\n        handle_char(va_arg(arg, int), f);\r\n        continue;\r\n\r\n      case 'p':\r\n        {\r\n          unsigned short w0 = va_arg(arg, unsigned int);\r\n          char *tmp = charp;\r\n          sprintf(s, \"%04x:%04x\", va_arg(arg, unsigned int), w0);\r\n          p = s;\r\n          charp = tmp;\r\n          goto do_outputstring;\r\n        }\r\n\r\n      case 's':\r\n        p = va_arg(arg, char *);\r\n        goto do_outputstring;\r\n\r\n      case 'F':\r\n        fmt++;\r\n        /* we assume %Fs here */\r\n      case 'S':\r\n        p = va_arg(arg, char far *);\r\n        goto do_outputstring;\r\n\r\n      case 'i':\r\n      case 'd':\r\n        base = -10;\r\n        goto lprt;\r\n\r\n      case 'o':\r\n        base = 8;\r\n        goto lprt;\r\n\r\n      case 'u':\r\n        base = 10;\r\n        goto lprt;\r\n\r\n      case 'X':\r\n      case 'x':\r\n        base = 16;\r\n\r\n      lprt:\r\n        if (longarg)\r\n          currentArg = va_arg(arg, long);\r\n        else\r\n          currentArg = base < 0 ? (long)va_arg(arg, int) :\r\n              (long)va_arg(arg, unsigned int);\r\n        ltob(currentArg, s, base);\r\n\r\n        p = s;\r\n      do_outputstring:\r\n\r\n        size -= _fstrlen(p);\r\n\r\n        if (flag == RIGHT)\r\n        {\r\n          for (; size > 0; size--)\r\n            handle_char(fill, f);\r\n        }\r\n        for (; *p != '\\0' && precision != 0; p++, precision--)\r\n          handle_char(*p, f);\r\n\r\n        for (; size > 0; size--)\r\n          handle_char(fill, f);\r\n\r\n        continue;\r\n\r\n      case '%':\r\n        handle_char(c, f);\r\n        break;\r\n      default:\r\n        handle_char('?', f);\r\n\r\n        handle_char(c, f);\r\n        break;\r\n\r\n    }\r\n  }\r\n  va_end(arg);\r\n  return 0;\r\n}\r\n\r\n#ifdef TEST\r\n/*\r\n\tthis testprogram verifies that the strings are printed correctly\r\n\t( or the way, I expect them to print)\r\n\t\r\n\tcompile like (note -DTEST !)\r\n\r\n\tc:\\tc\\tcc -DTEST -DI86 -I..\\hdr prf.c\r\n\t\r\n\tand run. if strings are wrong, the program will wait for the ANYKEY\r\n\r\n*/\r\n#include <conio.h>\r\nvoid cso(char c)\r\n{\r\n  putch(c);\r\n}\r\n\r\nstruct {\r\n  char *should;\r\n  char *format;\r\n  unsigned lowint;\r\n  unsigned highint;\r\n\r\n} testarray[] = {\r\n  {\r\n  \"hello world\", \"%s %s\", (unsigned)\"hello\", (unsigned)\"world\"},\r\n  {\r\n  \"hello\", \"%3s\", (unsigned)\"hello\", 0},\r\n  {\r\n  \"  hello\", \"%7s\", (unsigned)\"hello\", 0},\r\n  {\r\n  \"hello  \", \"%-7s\", (unsigned)\"hello\", 0},\r\n  {\r\n  \"hello\", \"%s\", (unsigned)\"hello\", 0},\r\n  {\r\n  \"1\", \"%d\", 1, 0},\r\n  {\r\n  \"-1\", \"%d\", -1, 0},\r\n  {\r\n  \"65535\", \"%u\", -1, 0},\r\n  {\r\n  \"-32768\", \"%d\", 0x8000, 0},\r\n  {\r\n  \"32767\", \"%d\", 0x7fff, 0},\r\n  {\r\n  \"-32767\", \"%d\", 0x8001, 0},\r\n  {\r\n  \"8000\", \"%x\", 0x8000, 0},\r\n  {\r\n  \"   1\", \"%4x\", 1, 0},\r\n  {\r\n  \"0001\", \"%04x\", 1, 0},\r\n  {\r\n  \"1   \", \"%-4x\", 1, 0},\r\n  {\r\n  \"1000\", \"%-04x\", 1, 0},\r\n  {\r\n  \"1\", \"%ld\", 1, 0},\r\n  {\r\n  \"-1\", \"%ld\", -1, -1},\r\n  {\r\n  \"65535\", \"%ld\", -1, 0},\r\n  {\r\n  \"65535\", \"%u\", -1, 0},\r\n  {\r\n  \"8000\", \"%lx\", 0x8000, 0},\r\n  {\r\n  \"80000000\", \"%lx\", 0, 0x8000},\r\n  {\r\n  \"   1\", \"%4lx\", 1, 0},\r\n  {\r\n  \"0001\", \"%04lx\", 1, 0},\r\n  {\r\n  \"1   \", \"%-4lx\", 1, 0},\r\n  {\r\n  \"1000\", \"%-04lx\", 1, 0},\r\n  {\r\n  \"-2147483648\", \"%ld\", 0, 0x8000},\r\n  {\r\n  \"2147483648\", \"%lu\", 0, 0x8000},\r\n  {\r\n  \"2147483649\", \"%lu\", 1, 0x8000},\r\n  {\r\n  \"-2147483647\", \"%ld\", 1, 0x8000},\r\n  {\r\n  \"32767\", \"%ld\", 0x7fff, 0},\r\n  {\r\n\"ptr 1234:5678\", \"ptr %p\", 0x5678, 0x1234}, 0};\r\n\r\ntest(char *should, char *format, unsigned lowint, unsigned highint)\r\n{\r\n  char b[100];\r\n\r\n  sprintf(b, format, lowint, highint);\r\n\r\n  printf(\"'%s' = '%s'\\n\", should, b);\r\n\r\n  if (strcmp(b, should))\r\n  {\r\n    printf(\"\\nhit the ANYKEY\\n\");\r\n    getch();\r\n  }\r\n}\r\n\r\nmain()\r\n{\r\n  int i;\r\n  printf(\"hello world\\n\");\r\n\r\n  for (i = 0; testarray[i].should; i++)\r\n  {\r\n    test(testarray[i].should, testarray[i].format, testarray[i].lowint,\r\n         testarray[i].highint);\r\n  }\r\n}\r\n#endif\r\n\r\n"
  },
  {
    "path": "lib/prprompt.c",
    "content": "/*\t$Id$\r\n\r\n\tParses a string as PROMPT string and display the result onto the screen\r\n\r\n\tThis file bases on OPENF.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.8  2006/09/04 19:35:42  blairdude\r\n\tPrint long filename current directory\r\n\r\n\tRevision 1.7  2006/06/13 02:10:19  blairdude\r\n\tCleaned up some code, moved write in outc to fwrite to make everybody happy (thanks to Arkady for the reports)\r\n\t\r\n\tRevision 1.6  2006/06/12 14:43:59  blairdude\r\n\tFix for potential bug noticed by Arkady\r\n\t\r\n\tRevision 1.5  2006/06/12 04:55:42  blairdude\r\n\tAll putchar's now use outc which first flushes stdout and then uses write to write the character to the console.  Some potential bugs have been fixed ( Special thanks to Arkady for noticing them :-) ).  All CONIO dependencies have now been removed and replaced with size-optimized functions (for example, mycprintf, simply opens \"CON\" and directly writes to the console that way, and mywherex and mywherey use MK_FP to access memory and find the cursor position).  FreeCOM is now\r\n\tsignificantly smaller.\r\n\t\r\n\tRevision 1.4  2006/06/11 02:47:05  blairdude\r\n\t\r\n\t\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\t\r\n\tRevision 1.3  2004/05/03 20:36:50  skaus\r\n\tfix: PROMPT $V: include FreeCOM version information [#1776]\r\n\t\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n#define FEATURE_ENVVARS_IN_PROMPT\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <dos.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#include <io.h>\r\n\r\n#include <suppl.h>\r\n#include <dfn.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n\r\n#define PROMPTVAR \"PROMPT\"\r\n\r\nvoid displayPrompt(const char *pr)\r\n{\r\n#ifdef FEATURE_ENVVARS_IN_PROMPT\r\n\tchar *buf = strdup(pr);\r\n\tchar *expanded = malloc(MAX_INTERNAL_COMMAND_SIZE + sizeof(errorlevel) * 8);\r\n\r\n\tif(buf && expanded) {\r\n\t\tif(!expandEnvVars(buf, expanded))\r\n\t\t\terror_line_too_long();\r\n\t\telse\r\n\t\t\tpr = expanded;\r\n\t}\r\n\tfree(buf);\r\n#endif\r\n\r\n  while (*pr)\r\n  {\r\n    if(*pr != '$') {\r\n      outc(*pr);\r\n    } else {\r\n      switch (toupper(*++pr)) {\r\n      case 'A': outc('&'); break;\r\n      case 'B': outc('|'); break;\r\n      case 'C': outc('('); break;\r\n      /* case 'D': see below */\r\n      case 'E': outc(27);  break; /* Decimal 27 */\r\n      case 'F': outc(')');  break;\r\n      case 'G': outc('>'); break;\r\n      case 'H': outc(8);   break; /* Decimal 8 */\r\n      case 'L': outc('<'); break;\r\n      /* case 'M': outc('<'); break; remote name of current drive */\r\n      /* case 'N': see below */\r\n      /* case 'P': see below */\r\n      case 'Q': outc('='); break;\r\n      case 'S': outc(' '); break;\r\n      /* case 'T': see below */\r\n      /* case 'V': see below */\r\n\r\n      case '$': outc('$'); break;\r\n      case '_': outc('\\n'); break;\r\n      /* case '+': see below */\r\n\r\n        case 'D':\r\n          {\t char *p;\r\n          \t if((p = curDateLong()) != 0) {\r\n          \t \touts(p);\r\n          \t \tfree(p);\r\n          \t }\r\n            break;\r\n          }\r\n        case 'N':\r\n          {\r\n            outc( ( getdisk() + 'A' ) );\r\n            break;\r\n          }\r\n        case 'P':\r\n          {\r\n#ifdef FEATURE_LONG_FILENAMES\r\n            char pathname[MAXDIR];\r\n            IREGS r;\r\n            int d;\r\n\r\n            d = getdisk();\r\n\r\n\t    r.r_flags = 1;\t/* CY before 21.71 calls! */\r\n            r.r_ax = 0x7147;\r\n            r.r_dx = 0;\r\n            r.r_si = FP_OFF(pathname);\r\n            r.r_ds = FP_SEG(pathname);\r\n\r\n            intrpt(0x21, &r);\r\n\r\n            if(r.r_flags & 1 || r.r_ax == 0x7100) {\r\n                r.r_ax = 0x4700;\r\n                intrpt(0x21, &r);\r\n            }\r\n\r\n            if(r.r_flags & 1) break;\r\n\r\n            printf(\"%c:\\\\\", d + 'A');\r\n            outs(pathname);\r\n#else\r\n            char *p;\r\n\r\n            if((p = cwd(0)) != 0) {\r\n                outs(p);\r\n                free(p);\r\n            }\r\n#endif\r\n\r\n            break;\r\n          }\r\n        case 'T':\r\n          {\r\n            char *p;\r\n\r\n            if((p = curTime()) != 0) {\r\n\t\t\t\touts(p);\r\n\t\t\t\tfree(p);\r\n\t\t\t}\r\n\r\n            break;\r\n          }\r\n        case 'V':\r\n          {\r\n            /* #1776 fputs(shellname, stdout); */\r\n            printf(\"%s v%s\", shellname, shellver);\r\n            break;\r\n          }\r\n        case '+':\t/* Levels of PUSHD */\r\n         {\r\n#ifdef INCLUDE_CMD_PUSHD\r\n\t\t\tctxt_info_t *info;\r\n\t\t\tint i;\r\n\r\n\t\t\tinfo = &CTXT_INFO_STRUCT(CTXT_TAG_DIRSTACK);\r\n\t\t\tassert(info);\r\n\t\t\tif((i = info->c_nummax) > 0) do {\r\n\t\t\t\toutc('+');\r\n\t\t\t} while(--i);\r\n#endif\r\n         }\r\n      }\r\n    }\r\n    pr++;\r\n  }\r\n#ifdef FEATURE_ENVVARS_IN_PROMPT\r\n\tfree(expanded);\r\n#endif\r\n}\r\n\r\n"
  },
  {
    "path": "lib/readcmd.c",
    "content": "/*\t$Id$\r\n\r\n\tRead a line from stdin\r\n\r\n*/\r\n\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"../include/command.h\"\r\n\r\n#ifdef FEATURE_ENHANCED_INPUT\r\nstatic int use_enh = 1;\r\nint set_readcommandType(int enhanced)\r\n{\r\n\tint rv = use_enh;\r\n\tuse_enh = ( enhanced != 0 );\r\n\treturn rv;\r\n}\r\n#else\r\nint set_readcommandType(int enhanced)\r\n{\r\n\t(void)enhanced;\r\n\treturn 0;\r\n}\r\n#endif\r\n\r\nvoid readcommand(char * const str, int maxlen)\r\n{\r\n#ifdef FEATURE_ENHANCED_INPUT\r\n\t/* If redirected from file or so, should use normal one */\r\n\tif (use_enh)\r\n\t\treadcommandEnhanced(str, maxlen);\r\n\telse\r\n\t\treadcommandDOS(str, maxlen);\r\n#else\r\n\treadcommandDOS(str, maxlen);\r\n#endif\r\n}\r\n\r\n"
  },
  {
    "path": "lib/realnum.c",
    "content": "/* $Id$\r\n\r\n\tcreate an absolute number from the relative one\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n\r\nunsigned realNum(const Context_Tag tag, const int num)\r\n{\tctxt_info_t *info;\r\n\r\n\tctxtCheckInfoTag(tag);\r\n\tinfo = &CTXT_INFO_STRUCT(tag);\r\n\r\n\tif(num == 0)\r\n\t\treturn info->c_nummax + 1;\r\n\telse if(num < 0) {\r\n\t\tint i = info->c_nummax + 1 + num;\r\n\t\tif(i > (int)info->c_nummin)\r\n\t\t\treturn i;\r\n\t\treturn (unsigned)-1;\r\n\t}\r\n\treturn num;\r\n}\r\n"
  },
  {
    "path": "lib/res.c",
    "content": "/*\t$Id$\r\n *  RES.C - Resource handling for FreeCOM\r\n *\r\n *\tContains all functions specific for FreeCOM\r\n *\r\n *\tint enumResources(altFnam, res_majorid_t, res_callbackp_t fct, void * arg)\r\n *\t\tSearches for all resources of the specified major ID in the\r\n *\t\tprimary resource file, which is usually the execuatble itself.\r\n *\t\tOn \"open error: (rc == -1) the alternate filename \"altFnam\" is\r\n *\t\ttried, too.\r\n *\t\tThe callback function is called like this:\r\n *\t\t\tint fct(res_majorid_t, res_minorid_t, length, int, arg)\r\n *\t\tThe \"length\" parameter specifies the length of the data\r\n *\t\tblock (unsigned long), the int fd is the resource file opened\r\n *\t\tin \"r+b\" modus <<be careful!!>>, \"arg\" is the pointer passed to\r\n *\t\tenumREsources().\r\n *\t\tThe callback function may reposition the file, though, the file\r\n *\t\titself must not be closed.\r\n *\r\n *\t\tIf the callback function returns 0 (zero), the loop continues,\r\n *\t\totherwise enumResource() is terminated and this value is returned.\r\n *\r\n *\r\n *\tReturn:\r\n *\t\t0: Nothing found or callback function always returned \"0\" itself\r\n *\t\telse: return value of callback function\r\n *\t\t-1: file open error\r\n *\r\n\r\n\tThis file bases on OPENF.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/09/11 00:07:22  blairdude\r\n\tFixed compilation completely with Turbo C\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n\r\n#include \"../include/res.h\"\r\n#include \"../include/command.h\"\r\n\r\nint enumResources(res_majorid_t id\r\n\t, res_callbackp_t fct\r\n\t, void * const arg)\r\n{\r\n\tint ret;\r\n\tchar *p = comResFile();\r\n\tdprintf((\"[RES: searching file '%s']\\n\", p));\r\n\tret = enumFileResources(p, id, fct, arg);\r\n\tfree(p);\r\n\treturn ret;\r\n}\r\n"
  },
  {
    "path": "lib/res_r.c",
    "content": "/*\t$id$\r\n\t$Locker$\t$Name$\t$State$\r\n\r\n *  RES_R.C - Read resource\r\n *\r\n *\tContains all functions to encapsule to \"read\" resources.\r\n *\r\n *\tint enumFileResources(fnam, res_majorid_t, int (*fct)(), void * arg)\r\n *\t\tSearches for all resources of the specified major ID in the\r\n *\t\tspecified file.\r\n *\t\tThe callback function is called like this:\r\n *\t\t\tint fct(res_majorid_t, res_minorid_t, length, FILE*, arg)\r\n *\t\tThe \"length\" parameter specifies the length of the data\r\n *\t\tblock (unsigned long), the file is the resource file opened\r\n *\t\tin \"rb\" modus, \"arg\" is the pointer passed to enumREsources().\r\n *\t\tThe callback function may reposition the file, though, the file\r\n *\t\titself must not be closed.\r\n *\r\n *\t\tIf the callback function returns 0 (zero), the loop continues,\r\n *\t\totherwise enumResource() is terminated and this value is returned.\r\n *\r\n *\tReturn:\r\n *\t\t0: Nothing found or callback function always returned \"0\" itself\r\n *\t\telse: return value of callback function\r\n *\t\t-1: file open error\r\n *\r\n\r\n\tThis file bases on OPENF.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.8  2006/09/11 00:07:22  blairdude\r\n\tFixed compilation completely with Turbo C\r\n\r\n\tRevision 1.7  2006/09/04 20:03:14  blairdude\r\n\tSupport compiler oddity (Arkady)\r\n\t\r\n\tRevision 1.6  2004/08/18 17:18:10  skaus\r\n\tchg: res_r.c: don#('t use relative seek; fails under NTFSdos [Tom Ehlert]\r\n\t\r\n\tRevision 1.4  2002/11/05 19:34:38  skaus\r\n\tchg: enumResources(): handle fnam == 0 (file open error)\r\n\t\r\n\tRevision 1.3  2001/07/27 22:37:35  skaus\r\n\tbugfix: pre-compiled package BINARY.ZIP without command-line editing\r\n\tchg: FreeCOM archive (== executable) is opened read-only.\r\n\t\r\n\tRevision 1.2  2001/06/10 15:20:39  skaus\r\n\tadd: error message if debugging when to open the resource file failed\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n\tTE 14 may 2004: there was some bug wrt NTFS4DOS, fixed.\r\n\t                unwound this beautiful C puzzle to do this\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\t/* memcmp */\r\n#include <fcntl.h>\r\n#if !defined(__GNUC__) && !defined(__WATCOMC__) || !defined(PTCHSIZE) || defined(__MINGW32__)\r\n#include <io.h>\t\t/* filelength */\r\n#endif\r\n\r\n#include \"../include/resource.h\"\r\n#ifdef PTCHSIZE\r\n#define dos_open open\r\n#define dos_read read\r\n#define dos_close close\r\n#if defined(__GNUC__) && !defined(__MINGW32__)\r\n#ifndef O_BINARY\r\n#define O_BINARY 0\r\n#endif\r\n#include <sys/types.h>\r\n#include <unistd.h>\r\nstatic long int filelength(int fd)\r\n{\r\n  long int cur = lseek(fd, 0, SEEK_CUR);\r\n  long int fsize = lseek(fd, 0, SEEK_END);\r\n  lseek(fd, cur, SEEK_SET);\r\n  return fsize;\r\n}\r\n#elif defined(__WATCOMC__)\r\n#include <sys/types.h>\r\n#include <unistd.h>\r\n#endif\r\n#else\r\n#include \"../include/misc.h\"\r\n#endif\r\n\r\nint enumFileResources(const char *const fnam\r\n\t, res_majorid_t id\r\n\t, res_callbackp_t fct\r\n\t, void * const arg)\r\n{\tresource_t res;\r\n\tunsigned long pos;\r\n\tint rc;\r\n\tint fd;\r\n\r\n\tassert(fct);\r\n\tif(!fnam)\r\n\t\treturn -1;\r\n\r\n\trc = 0;\r\n#ifdef PTCHSIZE\r\n\t#define OMODE O_RDONLY | O_BINARY\r\n#else\r\n\t#define OMODE O_RDONLY\r\n#endif\r\n\tif((fd = dos_open(fnam, OMODE)) < 0) {\r\n\t \trc = -1;\r\n\t \tdprintf((\"[RES: Failed to open file: %s]\\n\", fnam));\r\n#ifdef DEBUG\r\n\t\tperror(\"Open\");\r\n#endif\r\n\t\t/* resource file could be opened\r\n\t\t\tThe first resource item is located at the end of the file,\r\n\t\t\tthe var #(\"pos#(\" is used to indicate the absolute position\r\n\t\t\twithin the file as relative positioning is failing under\r\n\t\t\tNTFSdos {Tom Ehlert} */\r\n\t} else if((pos = filelength(fd)) != (unsigned long)-1L)\r\n   \t  while (1) {\r\n\t\tif(pos <= sizeof(res)\t\t\t\t/* file corruption */\r\n\t\t \t\t/* read and verify the resource ID block */\r\n\t\t || lseek(fd, pos -= sizeof(res), SEEK_SET) < 0\t\t/* seek error */\r\n\t     || dos_read(fd, &res, sizeof(res)) != sizeof(res)\t\t/* read error */\r\n\t\t \t\t\t\t\t/* file corruption as magic string is missing */\r\n\t\t || memcmp(res.res_cookie, RES_COOKIE, sizeof(res.res_cookie)) != 0\r\n\t\t \t\t/* file corruption: not that many bytes left in file */\r\n\t\t || pos < res.res_length\r\n\t\t \t\t/* failed to position to data block in the file */\r\n\t\t || lseek(fd, pos -= res.res_length, SEEK_SET) < 0\r\n\t\t)\r\n\t\t \tbreak;\r\n\t\t \r\n\t\t if (res.res_majorID == id || id == RES_ID_ANY)\r\n\t\t \tif ((rc = fct(res.res_majorID\r\n\t\t\t\t , res.res_minorID\r\n\t\t\t\t , res.res_length\r\n\t\t\t\t , fd\r\n\t\t\t\t , arg)) != 0)\r\n\t\t    break;\r\n\t}  \r\n\r\n\tdos_close(fd);\r\n\treturn rc;\r\n}\r\n"
  },
  {
    "path": "lib/res_vald.c",
    "content": "/* $Id$\r\n\r\n\tReturns whether the passed-in file is a probably\r\n\tvalid resource file.\r\n\r\n\t0 -> is valid\r\n\t1 -> no such file\r\n\t2 -> is a device\r\n\t3 -> not valid\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <fcntl.h>\r\n#include <io.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/openf.h\"\r\n#include \"../include/resource.h\"\r\n#include \"../include/strings.typ\"\r\n\r\n/* Is called only, if the Strings resource had been found,\r\n\thence, returning TRUE alsways. */\r\n\r\nstatic int test_fct (res_majorid_t major,\r\n\t\t     res_minorid_t minor,\r\n\t\t     unsigned long length,\r\n\t\t     int fd,\r\n\t\t     void *const arg) {\r\n\t(void)major, (void)length, (void)fd, (void)arg;\r\n\tassert(major == RES_ID_STRINGS);\r\n\treturn minor == STRING_RESOURCE_MINOR_ID? 1 : 2;\r\n}\r\n\r\nint validResFile(const char * const fnam)\r\n{\tint fd;\r\n\r\n\tassert(fnam);\r\n\r\n\tif((fd = dos_open(fnam, O_RDONLY)) < 0)\r\n\t\treturn 1;\r\n\r\n\tif(isadev(fd)) {\r\n\t\tdos_close(fd);\r\n\t\treturn 2;\r\n\t}\r\n\r\n\tdos_close(fd);\r\n\tif(enumFileResources(fnam\r\n\t , RES_ID_STRINGS, test_fct, (void*)0) != 1)\r\n\t\treturn 3;\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "lib/res_w.c",
    "content": "/*\t$Id$\r\n\r\n *  RES_W.C - Write resource\r\n *\r\n *\tContains all functions to encapsule to \"write\" resources.\r\n *\r\n *\tstartResource(FILE *f, res_majorid_t , res_minorid_t)\r\n *\t\tStarts a new resource and issues the necessary prologue.\r\n *\t\tAll the data should be dumped immediately now.\r\n *\r\n *\tendResource(FILE *f)\r\n *\t\tends the resource and write the necessary epilogue. The\r\n *\t\tshould be called when all data has been dumped; when the function\r\n *\t\treturns the file is positioned immediately behind the last byte\r\n *\t\tallocated by the resource.\r\n *\r\n *\r\n *\tBoth functions must be called in sequence, that means first\r\n *\tstartResource(), then endResource(), but no intermixing or\r\n *\tend() before start().\r\n *\r\n\r\n\tThis file bases on OPENF.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include <assert.h>\r\n#include <stdio.h>\r\n\r\n#include \"../include/resource.h\"\r\n\r\n\t/* information about the currently opened resource */\r\nstatic resource_t res = {\r\n\t(long)-1, RES_ID_NONE, 0, RES_COOKIE\r\n};\r\n\r\nvoid startResource(FILE *f, res_majorid_t major, res_minorid_t minor)\r\n{\r\n\r\n\tassert(f != 0);\r\n\t\t/* none resource is currently opened */\r\n\tassert(res.res_majorID == RES_ID_NONE);\r\n\r\n\tres.res_length = ftell(f);\r\n\tassert(res.res_length != (unsigned long)-1);\r\n\r\n\tres.res_majorID = major;\r\n\tres.res_minorID = minor;\r\n\r\n}\r\n\r\nvoid endResource(FILE *f)\r\n{\tunsigned long pos;\r\n\r\n\tassert(f != 0);\r\n\tassert(res.res_majorID != RES_ID_NONE);\r\n\r\n\tpos = ftell(f);\r\n\tassert(pos != (unsigned long)-1);\r\n\tassert(pos >= res.res_length);\r\n\r\n\tres.res_length = pos - res.res_length;\r\n\tfwrite(&res, sizeof(res), 1, f);\r\n}\r\n"
  },
  {
    "path": "lib/resfile.c",
    "content": "/* $Id$\r\n\r\n\tReturn the name of the resource file\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include <dfn.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n\r\nchar *comResFile(void)\r\n{  if(isSwapFile) {\r\n       char *p;\r\n       if((p = comFile()) != 0) {\r\n           assert(strlen(p) == isSwapFile + 3);\r\n           memcpy(p + isSwapFile, \"SWP\", 3);\r\n           if(exist(p))\r\n\t\t\t   return p;\r\n           free(p);\r\n       }\r\n   }\r\n\r\n   return comFile();\r\n}\r\n"
  },
  {
    "path": "lib/rmtmpfil.c",
    "content": "/*\t$Id$\r\n\r\n\tRemove temporary file, the filename is stored in a dynamically\r\n\tallocated buffer, which is also deallocated.\r\n\r\n *\r\n *  Comments:\r\n *    Creates unique filenames and creates the files, too.\r\n *    The filenames do not contain an extension, but my\r\n *    consume up to eight (8) characters as filename.\r\n *\r\n *    The filenames are prefixed by %TEMP%, %TMP%, %TEMPDIR%,\r\n *    %TMPDIR%, \"\\\\TEMP\", \"\\\\TMP\", fullpath_of(\".\"), \"<bootdrive>:\\\\\",\r\n *    \".\"; in that order, whichever returns a writeable location first\r\n *\r\n *    The filenames are created within dymamic memory and must be\r\n *    free()'ed by the caller himself.\r\n *    The files are touched, meaning they are created with zero\r\n *    length and no special attributes, but closed; the caller must\r\n *    remove the file himself.\r\n *\r\n\r\n\tThis file bases on TMPNAM.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n#include \"../config.h\"\r\n\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nvoid killtmpfn(char * const fn)\r\n{\r\n  if (fn)\r\n  {\r\n    remove(fn);\r\n    free(fn);\r\n  }\r\n}\r\n"
  },
  {
    "path": "lib/rtrimcl.c",
    "content": "/*\t$Id$\r\n\r\n * Name: rtrimcl() - right trims a string by removing trailing spaces\r\n \tA '\\0' is placed to terminate the string.\r\n * Input: str - a pointer to a string\r\n * Output: str will have all spaces removed from the right.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n\r\nvoid rtrimcl(char * const str)\r\n{ char *p;\r\n\r\n  assert(str);\r\n\r\n  p = strchr(str, '\\0');\r\n  while (--p >= str && isargdelim(*p))\r\n    ;\r\n  p[1] = '\\0';\r\n}\r\n"
  },
  {
    "path": "lib/rtrimsp.c",
    "content": "/*\t$Id$\r\n\r\n * Name: rtrimsp() - right trims a string by removing trailing spaces\r\n \tA '\\0' is placed to terminate the string.\r\n * Input: str - a pointer to a string\r\n * Output: str will have all spaces removed from the right.\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nvoid rtrimsp(char * const str)\r\n{ char *p;\r\n\r\n  assert(str);\r\n\r\n  p = strchr(str, '\\0');\r\n  while (--p >= str && isspace(*p))\r\n    ;\r\n  p[1] = '\\0';\r\n}\r\n"
  },
  {
    "path": "lib/salloc.c",
    "content": "/*\t$Id$\r\n\r\n\tset allocation strategy\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\tThis function had been imported from LH.ASM.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include <portable.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\n\r\nvoid dosSetAllocStrategy(int newState)\r\n{\tUSEREGS\r\n\r\n\t_BX = newState;\r\n\t_AX = 0x5801;\t\t\t/* set allocation strategy */\r\n\tgeninterrupt(0x21);\t\t/* result ignored */\r\n}\r\n"
  },
  {
    "path": "lib/samefile.c",
    "content": "/*\t$Id$\r\n\r\n\tReturn:\r\n\t\t-1: on out-of-memory error\r\n\t\t 0: if both true filenames differ\r\n\t\t 1: if both true filenames are the same\r\n\r\n\tThis file bases on COPY.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.2  2004/02/01 13:24:22  skaus\r\n\tbugfix: misidentifying unspecific failures from within SUPPL\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include <dfn.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint samefile(const char * const f1, const char * const f2)\r\n{ char *t1, *t2;\r\n  int differ;\r\n\r\n  assert(f1);\r\n  assert(f2);\r\n\r\n  t1 = truepath(f1);\r\n  t2 = truepath(f2);\r\n\r\n  if(!t1 || !t2)\r\n    differ = -1;\r\n  else differ = strcmp(t1, t2) == 0;\r\n\r\n  free(t1);\r\n  free(t2);\r\n\r\n  return differ;\r\n}\r\n"
  },
  {
    "path": "lib/scancmd.c",
    "content": "/*\t$Id$\r\n\r\n * Scan command line and handle options\r\n *  line may be NULL and is treated as empty.\r\n *  opt may be NULL and is treated as \"no valid option\".\r\n *    This will print an error message, if an option is specified.\r\n *  Return:\r\n *    == NULL: error, message already on screen any argument possibly\r\n *      modified\r\n *    != NULL: argument buffer, must be freed with \"freep()\"\r\n *      + *argc := number of non-option arguments within array, &\r\n *      + *opts := number of parsed options.\r\n *      + array contains *argc entries now.\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.2  2001/08/15 00:12:27  skaus\r\n\tbugfix: scancmd.c: /B and /A let COPY fail (ec == E_Ignore) (bug 829)\r\n\tupd: HTML docs\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../err_fcts.h\"\r\n\r\n/*\r\n * Parse global options\r\n */\r\nstatic int parseOptions(optScanner fct, void * const arg, char **argv, int *argc, int *optcnt)\r\n{ int ec = E_None;\r\n  char **argp, *a;\r\n\r\n  assert(argv);\r\n  assert(argc);\r\n  assert(optcnt);\r\n\r\n  *optcnt = 0;\r\n  argp = argv;\r\n  while((*argp++ = a = *argv++) != 0)\r\n    if(isoption(a)) {\r\n      if((ec = scanOption(fct, arg, a)) == E_None) {\r\n        free(*--argp);  /* ignore (overwrite) it */\r\n        ++*optcnt;\r\n      } else if(ec != E_Ignore) { /* the entry caused an error */\r\n        /* Copy the remaining entries */\r\n        while((*argp++ = *argv++) != 0);\r\n        break;\r\n      }\r\n    }\r\n\r\n  *argc -= *optcnt;\r\n  return ec == E_Ignore? E_None: ec;    /* everything done */\r\n}\r\n\r\nchar **scanCmdline(char *line, optScanner fct, void * const arg\r\n  , int *argc, int *opts)\r\n{ char **argv;\r\n\r\n  assert(argc);\r\n  assert(opts);\r\n\r\n  if((argv = split(line, argc)) == 0) {\r\n    error_out_of_memory();\r\n    return 0;\r\n  }\r\n\r\n  if(parseOptions(fct, arg, argv, argc, opts) != E_None) {\r\n    freep(argv);\r\n    return 0;\r\n  }\r\n\r\n  return argv;\r\n}\r\n"
  },
  {
    "path": "lib/scanerr.pl",
    "content": "#!perl\r\n\r\n# Scan the err*.c files and create the ERROR.H include file.\r\n\r\n$src = shift;\r\n\r\nfor (@ARGV) {\r\n\tpush(@h, glob($_));\r\n}\r\n@ARGV = @h;\r\n\r\nwhile(<>) {\r\n\tnext unless /^void\\s+[a-z]/;\r\n\tchomp;\r\n\tif(/^([^\\(]+\\([^\\)]+\\))\\s*$/) {\r\n\t\t# simple case\r\n\t\tprint \"$1;\\n\";\r\n\t} else {\r\n\t\t$line = $_ . \"\\n\";\r\n\t\t$cnt = 1;\r\n\t\tdie \"Syntax error in function definition\"\r\n\t\t\tunless ($i = index($line, '(')) >= 0;\r\n\t\t$fnam = $ARGV;\r\n\t\twhile($cnt) {\r\n\t\t\tif(++$i >= length($line)) {\r\n\t\t\t\t$_ = <>;\r\n\t\t\t\tdie \"Missing right parenthesis in file $fnam\\n\"\r\n\t\t\t\t\tif !$_ || $ARGV != $fnam;\r\n\t\t\t\t$line .= $_;\r\n\t\t\t}\r\n\t\t\t++$cnt if substr($line, $i, 1) eq '(';\r\n\t\t\t--$cnt if substr($line, $i, 1) eq ')';\r\n\t\t}\r\n\t\tprint substr($line, 0, $i) . \";\\n\";\r\n\t}\r\n}\r\n\r\nif($src) {\r\n\tdie \"Cannot open file $src: $!\\n\"\r\n\t\tunless open(SRC, $src);\r\n\t$i = rindex($src, \"\\\\\");\r\n\t$j = rindex($src, '/');\r\n\tif($i < 0 && $j < 0) {\r\n\t\t$dir = '.';\r\n\t} else {\r\n\t\t$dir = substr($src, 0, $i > $j? $i: $j);\r\n\t}\r\n\t$cnt = 0;\r\n\tdie \"Cannot create Makefile include file: $dir/err_fcts.mk: $!\\n\"\r\n\t\tunless open(MK, \">$dir/err_fcts.mk\");\r\n\twhile(<SRC>) {\r\n\t\tchop;\r\n\t\tdie \"Syntax error\"\r\n\t\t\tunless /:=/;\r\n\t\t$header = $`;\r\n\t\t$body = \"displayError($');\";\r\n\t\tif($header =~ /\\(/) {\r\n\t\t\t$fctname = $`;\r\n\t\t} else {\r\n\t\t\t$fctname = $header;\r\n\t\t\t$header .= '(void)';\r\n\t\t}\r\n\t\t$fnam = \"$dir/err\" . ++$cnt . '.c';\r\n\t\tdie \"Cannot create $fnam: $!\\n\"\r\n\t\t\tunless open(OUT, \">$fnam\");\r\n\t\tprint \"void $header;\\n\";\r\n\t\tprint OUT \"/*\tThis is an automatic generated file\r\n\r\n\tDO NOT EDIT! SEE ERR_FCTS.SRC and SCANERR.PL.\r\n\r\n\tError printing function providing a wrapper for STRINGS\r\n */\r\n\r\n#include \\\"../config.h\\\"\r\n\r\n#include \\\"../include/misc.h\\\"\r\n#include \\\"../err_fcts.h\\\"\r\n#include \\\"../strings.h\\\"\r\n\r\n#undef $fctname\r\nvoid $header\r\n{\t$body\r\n}\r\n\";\r\n\t\tclose OUT;\r\n\t}\r\n\tprint MK \"SRC_ERR = \";\r\n\tforeach $i (1..$cnt) {\r\n\t\tprint MK \" \\\\\\n\\terr$i.c\"\r\n\t}\r\n\tprint MK \"\\n\\nOBJ_ERR = \";\r\n\tforeach $i (1..$cnt) {\r\n\t\tprint MK \" \\\\\\n\\terr$i.obj\"\r\n\t}\r\n\tprint MK \"\\n\\n\";\r\n\tforeach $i (1..$cnt) {\r\n\t\tprint MK \"err$i.obj : err$i.c ../config.h ../strings.h ../err_fcts.h ../include/misc.h\\n\"\r\n\t}\r\n\tclose MK;\r\n}\r\n"
  },
  {
    "path": "lib/scanopt.c",
    "content": "/*\t$Id$\r\n\r\n * Scan an option and update its value within the option array\r\n *  Return: 0 on success\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.2  2002/11/06 20:36:37  skaus\r\n\tbugfix: /?: found on all the command line\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nunsigned currCmdHelpScreen = 0;\r\n\r\nint scanOption(optScanner fct, void * const ag, char *rest)\r\n{\r\n  char *line, *arg, *optend;\r\n  int ch, bool;\r\n\r\n  assert(rest);\r\n\r\n  if(!isoption(line = rest))  return -1;\r\n\r\n  /* check for leading boolean character */\r\n  switch(*++line) {\r\n  case '\\0':    return E_None;    /* empty option */\r\n  case '-':   bool = -1; ++line; break;\r\n  case '+':   bool = 1; ++line; break;\r\n  default:    bool = 0; break;\r\n  }\r\n\r\n  if(!isprint(ch = toupper(*line)) || strchr(\"-+=:\", ch)) {\r\n    error_illformed_option(rest);\r\n    return E_Useage;\r\n  }\r\n\r\n  if(ch == '?' && currCmdHelpScreen) {\r\n  \tdisplayString(currCmdHelpScreen);\r\n  \treturn E_Help;\r\n  }\r\n\r\n  if((optend = strpbrk(line, \"=:\")) != 0) {  /* option has argument */\r\n    arg = optend + 1;\r\n  } else {\r\n    arg = 0;\r\n    optend = strchr(line, '\\0');\r\n  }\r\n\r\n  /* check for trailing boolean character */\r\n  switch(optend[-1]) {\r\n  case '-': bool = -1;\r\n        --optend;\r\n        break;\r\n  case '+': bool = 1;\r\n        --optend;\r\n        break;\r\n  }\r\n\r\n  *optend = '\\0';\r\n\r\n  if(!fct) {\r\n    error_invalid_lswitch(line);\r\n    return E_Useage;\r\n  }\r\n\r\n  return fct(line, line[1]? 0: ch, bool, arg, ag);\r\n}\r\n"
  },
  {
    "path": "lib/session.c",
    "content": "/*\t$Id$\r\n\r\n\tSave/restore the current session\r\n\r\n\tthis copies the Context into near memory (if space allows)\r\n\tand restores it later\r\n\r\n\t$Log$\r\n\tRevision 1.5  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.4  2003/09/01 15:04:26  skaus\r\n\tbugfix: LOADHIGH: deallocating context if /L is present {Tom Ehlert}\r\n\t\r\n\tRevision 1.3  2002/11/12 21:56:17  skaus\r\n\tv0.83 Beta 52:\r\n\t\r\n\tRevision 1.2  2002/11/12 19:48:48  skaus\r\n\tbugfix: COPY: additional output to honor redirection {Eric Auer} [bugID #1313]\r\n\t\r\n\tRevision 1.1  2002/11/12 18:31:57  skaus\r\n\tadd: save/restore session (swap context) {Tom Ehlert}\r\n\t\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include <suppl.h>\r\n#include <mcb.h>\r\n#include <environ.h>\r\n\r\n#include \"../err_fcts.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/context.h\"\r\n#include \"../include/crossjmp.h\"\r\n#include \"../include/misc.h\"\r\n\r\nstatic unsigned ctxtSavedSize;\r\nstatic void *ctxtSavePtr;\r\n\r\nvoid saveSession(void)\r\n{\r\n\tif(ctxt && swapContext) {\r\n\t\tctxtSavedSize = mcb_length(ctxt);\r\n\t\tdprintf((\"[MEM: save context: %u bytes from 0x%04x]\\n\"\r\n\t\t , ctxtSavedSize, ctxt)); \r\n\t\tctxtSavePtr = malloc(ctxtSavedSize);\r\n\t\tif(ctxtSavePtr) {\r\n\t\t\t_fmemcpy(ctxtSavePtr, MK_FP(ctxt,0), ctxtSavedSize);\t\t\r\n\t\t\tDOSfree(ctxt);\r\n#ifdef DEBUG\r\n\t\t\tctxt = 0;\r\n#endif\r\n\t\t}\r\n\t}\r\n}\r\nvoid restoreSession(void)\r\n{\r\n\tassert(ctxt == 0);\r\n\tif(ctxtSavePtr) {\r\n\t\tdprintf((\"[MEM: restore context: %u bytes]\\n\", ctxtSavedSize));\r\n\t\tctxtCreateMemBlock(ctxtSavedSize);\r\n\t\t_fmemcpy( MK_FP(ctxt,0), ctxtSavePtr, ctxtSavedSize);\t\t\r\n\t\tfree(ctxtSavePtr);\r\n\t\tctxtSavePtr = 0;\r\n\t}\r\n}\r\n"
  },
  {
    "path": "lib/showcmds.c",
    "content": "/*\t$Id$\r\n\r\n * show commands and options that are available.\r\n\r\n\tThis file bases on INIT.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.7  2006/09/05 01:44:33  blairdude\r\n\tMassive patches from Arkady that I'm way too lazy to sort through.  If anything happens, Arkady can answer for it.\r\n\r\n\tRevision 1.6  2006/06/22 06:39:43  blairdude\r\n\tThe FOR command now supports long filenames through LFNFOR (off by default), as in MS-DOS 7.0.  Since REN is buggy with long filenames at the moment, this change also ensures that it is compiled without long filename support.  the '?' command also now shows whether or not FreeCOM was compiled with long filename support or not (as it is becoming a major feature).\r\n\t\r\n\tRevision 1.5  2006/06/12 04:55:42  blairdude\r\n\tAll putchar's now use outc which first flushes stdout and then uses write to write the character to the console.  Some potential bugs have been fixed ( Special thanks to Arkady for noticing them :-) ).  All CONIO dependencies have now been removed and replaced with size-optimized functions (for example, mycprintf, simply opens \"CON\" and directly writes to the console that way, and mywherex and mywherey use MK_FP to access memory and find the cursor position).  FreeCOM is now\r\n\tsignificantly smaller.\r\n\t\r\n\tRevision 1.4  2006/06/11 02:47:05  blairdude\r\n\t\r\n\t\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\t\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.2  2002/04/02 18:09:31  skaus\r\n\tadd: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <stdio.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/kswap.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n\r\nint showcmds (char * rest) {\r\n  struct CMD *cmdptr;\r\n  int y;\r\n\r\n  (void)rest;\r\n  displayString(TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS);\r\n  y = 0;\r\n  cmdptr = internalCommands;\r\n  while (cmdptr->name)\r\n  {\r\n    if (++y == 8)\r\n    {\r\n      puts(cmdptr->name);\r\n      y = 0;\r\n    }\r\n    else\r\n      printf(\"%-10s\", cmdptr->name);\r\n\r\n    cmdptr++;\r\n  }\r\n  if (y != 0)\r\n    outc('\\n');\r\n\r\n  displayString(TEXT_MSG_SHOWCMD_FEATURES);\r\n#ifdef FEATURE_ALIASES\r\n\tdisplayString(TEXT_SHOWCMD_FEATURE_ALIASES);\r\n#endif\r\n#ifdef FEATURE_ENHANCED_INPUT\r\n\tdisplayString(TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT);\r\n#endif\r\n#ifdef FEATURE_HISTORY\r\n\tdisplayString(TEXT_SHOWCMD_FEATURE_HISTORY);\r\n#endif\r\n#ifdef FEATURE_FILENAME_COMPLETION\r\n\tdisplayString(TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION);\r\n#endif\r\n#ifdef FEATURE_SWAP_EXEC\r\n\tdisplayString(TEXT_SHOWCMD_FEATURE_SWAP_EXEC);\r\n#endif\r\n#ifdef FEATURE_CALL_LOGGING\r\n\tdisplayString(TEXT_SHOWCMD_FEATURE_CALL_LOGGING);\r\n#endif\r\n#ifdef FEATURE_LAST_DIR\r\n\tdisplayString(TEXT_SHOWCMD_FEATURE_LAST_DIR);\r\n#endif\r\n#ifdef FEATURE_LONG_FILENAMES\r\n    displayString(TEXT_SHOWCMD_FEATURE_LONG_FILENAMES);\r\n#endif\r\n#ifdef FEATURE_KERNEL_SWAP_SHELL\r\n\tdisplayString(TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL);\r\n#define INIT_DISPLAY_DEFAULT_SWAP_VALUE\r\n#endif\r\n#ifdef FEATURE_XMS_SWAP\r\n\tdisplayString(TEXT_SHOWCMD_FEATURE_XMS_SWAP);\r\n#define INIT_DISPLAY_DEFAULT_SWAP_VALUE\r\n#endif\r\n#ifdef INIT_DISPLAY_DEFAULT_SWAP_VALUE\r\n\tif(swapOnExec != ERROR && defaultToSwap == TRUE)\r\n\t\tdisplayString(TEXT_SHOWCMD_DEFAULT_TO_SWAP);\r\n#endif\r\n#ifdef FEATURE_INSTALLABLE_COMMANDS\r\n\tdisplayString(TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS);\r\n#endif\r\n#ifdef FEATURE_NLS\r\n\tdisplayString(TEXT_SHOWCMD_FEATURE_NLS);\r\n#endif\r\n#ifdef FEATURE_DIRSTACK\r\n\tdisplayString(TEXT_SHOWCMD_FEATURE_DIRSTACK);\r\n#endif\r\n#ifdef DEBUG\r\n\tdisplayString(TEXT_SHOWCMD_FEATURE_DEBUG);\r\n#endif\r\n  outc('\\n');\r\n\r\n  return 0;\r\n}\r\n"
  },
  {
    "path": "lib/skqwd.c",
    "content": "/*\t$Id$\r\n\r\n *  Skip a quoted word, stop at end of string or at the given string\r\n \tcompared case-sensitively or, if not specified, any argument delimter.\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.2  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/cmdline.h\"\r\n\r\n#if 0\r\nchar *skipqword(const char *pp, const char * const stop)\r\n{\tsize_t len;\r\n\tint quote = 0;\r\n\r\n\tlen = stop? strlen(stop): 0;\r\n\r\n\tif(*pp) do {\r\n\t\tif(quote) {\r\n\t\t\tif(quote == *pp)\r\n\t\t\t\tquote = 0;\r\n\t\t} else if(strchr(QUOTE_STR, *pp))\r\n\t\t\tquote = *pp;\r\n\t\telse if(len? (memcmp(pp, stop, len) == 0): isargdelim(*pp))\r\n\t\t\tbreak;\r\n\t} while(*++pp);\r\n\r\n\treturn (char *) pp;\t\t/* strip const */\r\n}\r\n#else\r\nchar *skipqword(char *pp, const char * const stop)\r\n{\tsize_t len;\r\n\tint quote = 0;\r\n\tchar *pp_trunc = 0;\r\n\r\n\tlen = stop? strlen(stop): 0;\r\n\r\n\tif(*pp) do {\r\n        /* if we find a quote then continue until terminator or end of string found */\r\n\t\tif(quote) {\r\n\t\t\tif(quote == *pp) {\r\n                pp_trunc = 0;\r\n\t\t\t\tquote = 0;\r\n            } else if(len && (memcmp(pp, stop, len) == 0)) {\r\n                /* no matching quote, so back up to delimiter and mark end of pp */\r\n\t\t\t\tchar *p = pp;\r\n\t\t\t\twhile(*p && (!quote || (quote != *p)) && !isargdelim(*p)) p--;\r\n                p++;\r\n                if (p < pp) *p='\\0';\r\n                break;\r\n            } else if(!pp_trunc && isargdelim(*pp)) {\r\n                pp_trunc = pp; /* if end of string but no matching quote, terminate at 1st delimiter instead */\r\n            }\r\n\t\t} else if(strchr(QUOTE_STR, *pp))\r\n\t\t\tquote = *pp;\r\n\t\telse if(len && (memcmp(pp, stop, len) == 0)) {\r\n                /* no matching quote, so back up to delimiter and mark end of pp */\r\n\t\t\t\tchar *p = pp;\r\n\t\t\t\twhile(*p && (!quote || (quote != *p)) && !isargdelim(*p)) p--;\r\n                p++;\r\n                if (p < pp) *p='\\0';\r\n                break;\r\n        } else if(!pp_trunc && isargdelim(*pp)) {\r\n            pp_trunc = pp;  /* truncate at delimter if not in quoted string */\r\n\t\t\tbreak;\r\n        }\r\n\t} while(*++pp);\r\n\tif (pp_trunc) {\r\n        *pp_trunc = '\\0'; /* never found end of quote so stop at first delimiter */\r\n        dprintf((\"returning [%s]\\n\", pp_trunc+1));\r\n        return pp_trunc+1;\r\n    }\r\n\r\n    dprintf((\"returning [%s]\\n\", pp));\r\n\treturn (char *) pp;\t\t/* strip const */\r\n}\r\n#endif\r\n"
  },
  {
    "path": "lib/spfnam.c",
    "content": "/* $Id$\r\n\r\n\tskip filename token\r\n\r\n\treturn the pointer of the next character that is no is_fnchar()\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nchar *skipfnam(const char * const fnam)\r\n{\tconst char *p;\r\n\r\n\tassert(fnam);\r\n\tp = fnam - 1;\r\n\twhile(is_fnchar(*++p));\r\n\treturn (char*)p;\r\n}\r\n"
  },
  {
    "path": "lib/split.c",
    "content": "/*\t$Id$\r\n\r\n * split - splits a line up into separate arguments, deliminators\r\n *      are spaces and /'s\r\n *  Each option is placed into one individual argument.\r\n *  The passed in string is preserved.\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.2  2003/03/09 12:09:40  skaus\r\n\tbugfix: split(): out-of-mem condition during building argument array\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n\r\nchar *skipnonoptdm(char *p);  /* lib/find.c */\r\nchar *skipnonopt_word(char *p);\r\n\r\n\r\nstatic int addArg(char ***Xarg, int *argc, char *sBeg, char **sEnd, int ignore_options)\r\n{ char **arg;\r\n\r\n  assert(Xarg);\r\n  assert(argc);\r\n  assert(sEnd);\r\n  assert(sBeg);\r\n\r\n    *sEnd = (ignore_options ? skipnonopt_word(sBeg) : skip_word(sBeg));   /* find end of argument */\r\n\r\n    /* Because *start != '\\0' && !isargdelim(*start) ==> s != start */\r\n    assert(*sEnd > sBeg);\r\n\r\n      /* add new entry for new argument */\r\n      if((arg = realloc(*Xarg, (*argc + 2) * sizeof(char *))) ==  0) {\r\n        freep(*Xarg);\r\n        return 1;\r\n      }\r\n      /* create new entry */\r\n      if((arg[*argc] = unquote(sBeg, *sEnd)) == 0) {\r\n        freep(arg);\r\n        return 1;\r\n      }\r\n      arg[++*argc] = 0;\t\t/* keep it a correct argv[] array if a freep()\r\n      \t\t\t\t\t\t\tis triggered above */\r\n      *Xarg = arg;\r\n\r\n    return 0;\r\n  }\r\n\r\nstatic char **split_cmdline(char *s, int *args, int ignore_options)\r\n{\r\n  char **arg,\r\n   *start;\r\n  int ac;\r\n\r\n  assert(args);\r\n\r\n  arg = malloc(sizeof(char *));\r\n  if (!arg)\r\n    return 0;\r\n  ac = 0;\r\n\r\n    /* skip to next argument */\r\n  if(s) while (*(start = (ignore_options?skipnonoptdm(s):skipdm(s))) != '\\0')\r\n  {\r\n    if(addArg(&arg, &ac, start, &s, ignore_options))\r\n      return 0;\r\n  }\r\n\r\n  arg[*args = ac] = 0;\r\n  return arg;\r\n}\r\n\r\nchar **split(char *s, int *args)\r\n{\r\n\treturn split_cmdline(s, args, 0);\r\n}\r\n\r\n/* we must not split on option delimiters, only argument delimiters, see issue#52 */\r\nchar **split_batchargs(char *s, int *args)\r\n{\r\n\treturn split_cmdline(s, args, 1);\r\n}\r\n"
  },
  {
    "path": "lib/sumblink.c",
    "content": "/*\t$Id$\r\n\r\n\tSet UMB Link state\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\tThis function had been imported from LH.ASM.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include <portable.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nvoid dosSetUMBLinkState(int newState)\r\n{\tUSEREGS\r\n\r\n\t_BX = newState;\r\n\t_AX = 0x5803;\t\t\t/* set UMB link */\r\n\tgeninterrupt(0x21);\t\t/* result ignored */\r\n}\r\n"
  },
  {
    "path": "lib/timeget.c",
    "content": "/*\t$Id$\r\n\r\n\tgettime for TurboC++ prior v3\r\n\r\n\tThis file bases on TIMEFUNC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#ifdef _NO__DOS_TIME\r\n\r\n#include <dos.h>\r\n#include <portable.h>\r\n#include \"../include/timefunc.h\"\r\n\r\nvoid _dos_gettime(struct dostime_t *t)\r\n{\r\n  IREGS r;\r\n\r\n  r.r_ax = 0x2C00;\r\n  intrpt(0x21, &r);\r\n\r\n  t->hour = r.r_cx >> 8;\r\n  t->minute = r.r_cx & 0xFF;\r\n  t->second = r.r_dx >> 8; /* high bit */\r\n  t->hsecond = r.r_dx & 0xFF; /* low bit */\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "lib/timeset.c",
    "content": "/*\t$Id$\r\n\r\n\tsettime for TurboC++ prior v3\r\n\r\n\tThis file bases on TIMEFUNC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.4  2006/06/12 04:55:42  blairdude\r\n\tAll putchar's now use outc which first flushes stdout and then uses write to write the character to the console.  Some potential bugs have been fixed ( Special thanks to Arkady for noticing them :-) ).  All CONIO dependencies have now been removed and replaced with size-optimized functions (for example, mycprintf, simply opens \"CON\" and directly writes to the console that way, and mywherex and mywherey use MK_FP to access memory and find the cursor position).  FreeCOM is now\r\n\tsignificantly smaller.\r\n\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\t\r\n\t\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\t\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#ifdef _NO__DOS_TIME\r\n\r\n#include <dos.h>\r\n#include <portable.h>\r\n#include \"../include/timefunc.h\"\r\n\r\nunsigned _dos_settime(struct dostime_t *t)\r\n{\r\n  IREGS r;\r\n\r\n  r.r_ax = 0x2D00;\r\n  r.r_cx = ( ( t->hour & 0xFF ) << 8 ) | ( t->minute & 0xFF );\r\n  r.r_dx = ( ( t->second & 0xFF ) << 8 ) | ( t->hsecond & 0xFF );\r\n\r\n  intrpt(0x21, &r);\r\n\r\n  if (( r.r_ax & 0xFF ) == 0xFF)           /* Error occured setting time */\r\n    return -1;\r\n\r\n  return 0;\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "lib/tmpnam.c",
    "content": "/*\t$Id$\r\n\r\n\tmake a filename of a temporary file.\r\n\tFor consistency (atomic operation) the file is created as a\r\n\tzero-length file without special file permissions.\r\n *\r\n *  Comments:\r\n *    Creates unique filenames and creates the files, too.\r\n *    The filenames do not contain an extension, but my\r\n *    consume up to eight (8) characters as filename.\r\n *\r\n *    The filenames are prefixed by %TEMP%, %TMP%, %TEMPDIR%,\r\n *    %TMPDIR%, \"\\\\TEMP\", \"\\\\TMP\", fullpath_of(\".\"), \"<bootdrive>:\\\\\",\r\n *    \".\"; in that order, whichever returns a writeable location first\r\n *\r\n *    The filenames are created within dymamic memory and must be\r\n *    free()'ed by the caller himself.\r\n *    The files are touched, meaning they are created with zero\r\n *    length and no special attributes, but closed; the caller must\r\n *    remove the file himself.\r\n *\r\n\r\n\tThis file bases on TMPNAM.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n#include \"../config.h\"\r\n\r\n#include <dos.h>\r\n#include <stdlib.h>\r\n\r\n#include <portable.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/misc.h\"\r\n\r\n#define probefn(path) mktempfile(path, 0)\r\n\r\nstatic char *probefnEnv(char *var)\r\n{\r\n  char *p;\r\n  char *fn = probefn(p = getEnv(var));\r\n  free(p);\r\n  return fn;\r\n}\r\n\r\nchar *tmpfn(void)\r\n{\tUSEREGS\r\n  char *fn;                     /* filename */\r\n  static char buf[] = \"?:\\\\\";\r\n\r\n  if ((fn = probefnEnv(\"TEMP\")) == 0\r\n      && (fn = probefnEnv(\"TMP\")) == 0\r\n      && (fn = probefnEnv(\"TEMPDIR\")) == 0\r\n      && (fn = probefnEnv(\"TMPDIR\")) == 0\r\n      && (fn = probefn(\"\\\\TEMP\")) == 0\r\n      && (fn = probefn(\"\\\\TMP\")) == 0\r\n      && (fn = probefn(\".\")) == 0)\r\n  {\r\n    /* everything failed --> probe the boot drive */\r\n\r\n    _DL = 0xff;                 /* to be safe for old DOS */\r\n    _AX = 0x3305;               /* Get Boot drive, DOS 4+ */\r\n    geninterrupt(0x21);\r\n    /* note: func 3305h will not return with setting CF on old DOS (3.x or earlier) */\r\n    buf[0] = (_CFLAG || _DL == 0xff) ? 'C' : _DL + 'A' - 1;\r\n    fn = probefn(buf);          /* If fn is NULL still, no temporary\r\n                                   file can be created */\r\n    if (!fn)\r\n      error_tempfile();\r\n  }\r\n\r\n  return fn;\r\n}\r\n"
  },
  {
    "path": "lib/trimcl.c",
    "content": "/*\t$Id$\r\n\r\n *  Combines ltrimcl() & rtrimcl()\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n\r\nchar *trimcl(char *str)\r\n{ assert(str);\r\n  rtrimcl(str);\r\n  return ltrimcl(str);\r\n}\r\n"
  },
  {
    "path": "lib/trimsp.c",
    "content": "/*\t$Id$\r\n\r\n *  Combines ltrimsp() & rtrimsp()\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/29 11:33:51  skaus\r\n\tchg: default heap size (tools\\ptchsize) set to 6KB\r\n\tchg: error displaying functions centralized into lib\\err_fcts.src\r\n\tadd: displayError()\r\n\tchg: all errors are displayed through functions void error_*()\r\n\tbugfix: somtimes error messages are not displayed (see displayError())\r\n\tbugfix: docommand(): type:file must pass \":file\" to TYPE\r\n\tbugfix: error_sfile(): string _SFILE_\r\n\tbugfix: error message on empty redirection\r\n\tbugfix: comma and semicolon ';' are recognized as argument seperators\r\n\t\tof internal commands\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nchar *trimsp(char *str)\r\n{ assert(str);\r\n  rtrimsp(str);\r\n  return ltrimsp(str);\r\n}\r\n"
  },
  {
    "path": "lib/truepath.c",
    "content": "/*\t$Id$\r\n\r\n *\tMake the given file spec an absolute path/file name.\r\n *\tReturns in a dynamically allocated buffer (free'ed by the caller)\r\n *\ton error: Displays \"out of memory\" (or appropriate)\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/06/28 06:29:11  blairdude\r\n\tTRUENAME now supports long filenames\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2004/02/01 13:24:22  skaus\r\n\tbugfix: misidentifying unspecific failures from within SUPPL\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <errno.h>\r\n\r\n#include <dfn.h>\r\n\r\n#include \"../include/lfnfuncs.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n\r\nchar *truepath(const char * const fnam)\r\n{\tchar *h;\r\n\r\n\tassert(fnam);\r\n\r\n#ifdef FEATURE_LONG_FILENAMES\r\n\tif((h = dfntruename(getshortfilename(fnam))) != 0)\r\n#else\r\n    if((h = dfntruename(fnam)) != 0)\r\n#endif\r\n\t\treturn h;\r\n\r\n\tdisplay_errno_fnam_error(fnam);\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "lib/truncate.c",
    "content": "/*\t$Id$\r\n\r\n\tTruncate an opened file at the current position of the file\r\n\tpointer by file descriptor.\r\n\tReturn: 0 -> OK\r\n\t\t\t!= 0 -> error\r\n\r\n\t$Log$\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2003/05/12 16:52:41  skaus\r\n\tadd: copy(): Speed-Up by pre-creating the file {Tom Ehlert}\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include <suppl.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nint truncate(int fd)\r\n{\tIREGS r;\r\n\r\n\tr.r_ax = 0x4000;\t/* Write to file descriptor */\r\n\tr.r_bx = fd;\r\n\tr.r_cx = 0;\t\t\t/* Indicates \"truncate\" */\r\n\tintrpt( 0x21, &r );\r\n\treturn r.r_ax;\r\n}\r\n"
  },
  {
    "path": "lib/txtlend.c",
    "content": "/*\t$Id$\r\n\r\n *\tReturns the position of the first '\\n' or '\\0' character;\r\n *\t\tor NULL if the line overflows the buffer.\r\n *\t\"overflow\" means that no '\\n' character was found and the line\r\n *\tis completely full, so, if the very last line has no newline character,\r\n *\tit is still considered \"not overflowed\".\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n\r\n#include \"../include/misc.h\"\r\n\r\nchar *textlineEnd(const char * const buf, const size_t buflen)\r\n{\tconst char *p, *end;\r\n\r\n\tif(!buf)\treturn 0;\r\n\tend = buflen + (p = buf - 1);\r\n\tdo { if(++p == end)\t\t/* The very last byte of the buffer is\r\n\t\t\t\t\t\t\t\thit ==> there ougth to be a '\\0' there\r\n\t\t\t\t\t\t\t\t==> no '\\n' AND no place for further\r\n\t\t\t\t\t\t\t\tcharacter ==> overflow */\r\n\t\treturn 0;\r\n\t} while(*p && *p != '\\n');\r\n\r\n\treturn (char *)p;\t\t/* strip \"const\" */\r\n}\r\n"
  },
  {
    "path": "lib/unquote.c",
    "content": "/*\t$Id$\r\n\r\n * removeQuotes - generates a new dynamically allocated string that\r\n *  contains no quotes (outer most quotes).\r\n *  The passed in string is preserved.\r\n *  Return: NULL on memory allocation problems\r\n\r\n\tThis file bases on CMDLINE.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n\r\nchar *unquote(const char *str, const char * const end)\r\n{ char *h, *newStr;\r\n  const char *q;\r\n  size_t len;\r\n\r\n  assert(str);\r\n  assert(end);\r\n  assert(end >= str);\r\n\r\n  if((h = newStr = malloc(end - str + 1)) == 0)\r\n    return 0;\r\n\r\n  while((q = strpbrk(str, QUOTE_STR)) != 0 && q < end) {\r\n  /* there is a quote at *q */\r\n    /* copy the portion before q */\r\n    memcpy(h, str, len = q++ - str);\r\n    h += len;\r\n    if((str = strchr(q, q[-1])) == 0 || str >= end) {\r\n      /* no right quote */\r\n      str = q;\r\n      break;\r\n    }\r\n    /* copy the quoted portion */\r\n    memcpy(h, q, len = str++ - q);\r\n    h += len;\r\n  }\r\n  /* copy the remaining unquoted portion */\r\n  memcpy(h, str, len = end - str);\r\n  h[len] = '\\0';\r\n  /* to not waste one byte per deleted quote use this:\r\n    h = realloc(newStr, strlen(newStr) + 1);\r\n    assert(h);\r\n    return h;\r\n      -or- if you assume that to shrink can fail\r\n    return (h = realloc(newStr, strlen(newStr) + 1)) != 0\r\n      ? h: newStr;\r\n  */\r\n  return newStr;\r\n}\r\n"
  },
  {
    "path": "lib/vcgetch.c",
    "content": "/*\t$Id$\r\n\r\n\tGet a character out-of-band and honor Ctrl-Break characters\r\n\tVisible, but does not advance the cursor.\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.4  2006/06/12 04:55:42  blairdude\r\n\tAll putchar's now use outc which first flushes stdout and then uses write to write the character to the console.  Some potential bugs have been fixed ( Special thanks to Arkady for noticing them :-) ).  All CONIO dependencies have now been removed and replaced with size-optimized functions (for example, mycprintf, simply opens \"CON\" and directly writes to the console that way, and mywherex and mywherey use MK_FP to access memory and find the cursor position).  FreeCOM is now\r\n\tsignificantly smaller.\r\n\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\t\r\n\t\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\t\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <conio.h>\r\n#include <ctype.h>\r\n#include <stdio.h>\r\n\r\n#include \"../include/keys.h\"\r\n#include \"../include/misc.h\"\r\n\r\nint vcgetchar(void)\r\n{\r\n\tint ch;\r\n\r\n\tch = cgetchar();\r\n\toutc(isprint(ch) ? ch : ' ');\r\n\toutc('\\b');\r\n\r\n\treturn cbreak? KEY_CTL_C: ch;\r\n}\r\n"
  },
  {
    "path": "lib/vcgetstr.c",
    "content": "/*\t$Id$\r\n\r\n\tget a visual character that must match one of the supplied ones\r\n\r\n\tThis file bases on MISC.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.4  2006/06/12 04:55:42  blairdude\r\n\tAll putchar's now use outc which first flushes stdout and then uses write to write the character to the console.  Some potential bugs have been fixed ( Special thanks to Arkady for noticing them :-) ).  All CONIO dependencies have now been removed and replaced with size-optimized functions (for example, mycprintf, simply opens \"CON\" and directly writes to the console that way, and mywherex and mywherey use MK_FP to access memory and find the cursor position).  FreeCOM is now\r\n\tsignificantly smaller.\r\n\r\n\tRevision 1.3  2006/06/11 02:47:05  blairdude\r\n\t\r\n\t\r\n\tOptimized FreeCOM for size, fixed LFN bugs, and started an int 2e handler (which safely fails at the moment)\r\n\t\r\n\tRevision 1.2  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <conio.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n#include <io.h>\r\n#include <stdio.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/misc.h\"\r\n\r\nint vcgetcstr(const char *const legalCh)\r\n{\tint ch;\r\n\r\n\tassert(legalCh);\r\n\r\n\twhile ((ch = vcgetchar()) == 0 || !strchr(legalCh, ch))\r\n\t\tbeep();                     /* hit erroreous character */\r\n\toutc('\\n');                /* advance to next line */\r\n\treturn ch;\r\n}\r\n"
  },
  {
    "path": "lib/where.c",
    "content": "/*\t$Id$\r\n\r\n\tSearch for an external program and return it in a static buffer,\r\n\twhich is overwritten the next time this function is called.\r\n\r\n\tThis file bases on OPENF.C of FreeCOM v0.81 beta 1.\r\n\r\n\t$Log$\r\n\tRevision 1.12  2006/08/23 06:45:37  blairdude\r\n\tUpdated the PATH parsing routine (Arkady)\r\n\r\n\tRevision 1.8  2006/06/27 07:09:26  blairdude\r\n\tfind_which now uses simpler functions to parse %PATH% to find executables.\r\n\t\r\n\tRevision 1.7  2006/06/26 18:36:36  blairdude\r\n\tFreeCOM can now execute long filenamed executable files.\r\n\t\r\n\tRevision 1.6  2005/12/10 10:09:43  perditionc\r\n\tbased on patches from Blair Campbell, additional LFN support (slim print,\r\n\tadd initial cd,rd,md support, make compile time optional), remove some\r\n\tcompiler warnings, and prevent extra linebreak for compatibility\r\n\t\r\n\tRevision 1.5  2004/09/13 18:59:40  skaus\r\n\tadd: CRITER: Repeat check autofail magic {Tom Ehlert/Eric Auer}\r\n\t\r\n\tRevision 1.4  2004/02/01 13:52:17  skaus\r\n\tadd/upd: CVS $id$ keywords to/of files\r\n\t\r\n\tRevision 1.3  2004/02/01 13:24:22  skaus\r\n\tbugfix: misidentifying unspecific failures from within SUPPL\r\n\t\r\n\tRevision 1.2  2002/11/05 19:27:37  skaus\r\n\tbugfix: FreeCOM is to pass the fully-qualified path to DOS-4B-00\r\n\t\r\n\tRevision 1.1  2001/04/12 00:33:53  skaus\r\n\tchg: new structure\r\n\tchg: If DEBUG enabled, no available commands are displayed on startup\r\n\tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n\t   of memory available on start\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\tbugfix: COMMAND.COM A:\\\r\n\tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n\tadd: command MEMORY\r\n\tbugfix: runExtension(): destroys command[-2]\r\n\tadd: clean.bat\r\n\tadd: localized CRITER strings\r\n\tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n\t\tvia STRINGS.LIB\r\n\tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n\tadd: fixstrs.c: prompts & symbolic keys\r\n\tadd: fixstrs.c: backslash escape sequences\r\n\tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n\tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n\tbugfix: IF is now using error system & STRINGS to report errors\r\n\tadd: CALL: /N\r\n\t\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <stdlib.h>\t/* free */\r\n#include <string.h>\t/* strlen, strcpy, memcpy */\r\n\r\n#include \"suppl.h\"\r\n#include \"dfn.h\"\t/* dfnstat, DFN_FILE, dfnfullpath */\r\n\r\n#include \"../include/lfnfuncs.h\" /* getshortfilename */\r\n#include \"../include/misc.h\"\t/* getEnv, display_errno_fnam_error */\r\n\r\n/*\r\n- Name without suffix(es) (\"cmd\") always searched with implicit suffixes\r\n  (\"cmd.com\", \"cmd.exe\" and \"cmd.bat\").\r\n- Name with explicit suffix(es) (\"cmd.\", \"cmd.exe\", \"cmd.exe.bat\") searched\r\n  only with these suffix(es).\r\n- Found directory names are skiped.\r\n- PATH variable interated only for name without path (\"cmd\") or with\r\n  relative path (\"dir\\cmd\"); name with drive letter (\"d:cmd\") or absolute\r\n  path (\"\\cmd\", \"\\dir\\cmd\") searched only at this path.\r\n\r\n   Returned pointer references heap, and this memory area\r\n   will be freed on subsequent calls.\r\n*/\r\n\r\nchar *find_which (const char *const name) {\r\n  static char *pbuf = NULL;\t\t/* previously returned pointer\t*/\r\n  char *envptr, *path;\t\t\t/* content of PATH env variable\t*/\r\n  char buf [MAXPATH + 4];\t\t/* buffer for PATH entry + name\t*/\r\n  char *pname, *p;\r\n  size_t len;\r\n\r\n  free (pbuf), pbuf = NULL;\r\n\r\n  /* copy name at end of buffer */\r\n  len = strlen (name);\r\n  if (len > sizeof buf - 5)\t\t\t/* not enough space?\t*/\r\n    return pbuf;\r\n  p = buf + sizeof buf - 5,\r\n  pname = strcpy (p - len, name);\r\n\r\n  /* check for explicit suffix in name */\r\n  /*if (p > pname)*/\r\n  for (;;) {\r\n    --p;\r\n    if (*p == '.') break;\t\t\t/* explicit suffix?\t*/\r\n    if (p <= pname ||\t\t\t\t/* start of name?\t*/\r\n        *p == '\\\\' || *p == '/' || *p == ':') {\t/* path separator?\t*/\r\n      buf [sizeof buf - 5] = '.';\t\t/* use implicit suffixes */\r\n      break;\r\n    }\r\n  }\r\n\r\n  /* check for drive letter or absolute path */\r\n  p = pname, envptr = NULL;\r\n  if (p [1] != ':' && *p != '\\\\' && *p != '/')\r\n    envptr = getEnv (\"PATH\");\r\n  path = envptr;\r\n\r\n  /* check current directory, then all entries in PATH */\r\n  for (;;) {\r\n    if (buf [sizeof buf - 5] == '.') {\r\n      strcpy (buf + sizeof buf - 4, \"COM\"); if (dfnstat (p) & DFN_FILE) break;\r\n      strcpy (buf + sizeof buf - 4, \"EXE\"); if (dfnstat (p) & DFN_FILE) break;\r\n      strcpy (buf + sizeof buf - 4, \"BAT\");\r\n    }\r\n\t\t\t\t\t    if (dfnstat (p) & DFN_FILE) break;\r\n\r\n    /* find next PATH entry, which fit in buf */\r\n    if (envptr == NULL || pname == buf) { free(path); return pbuf; }\r\n    do {\r\n      while (*envptr == ';') ++envptr;\t\t/* skip sequence of ';'\t*/\r\n      if (*envptr == '\\0') return pbuf;\t\t/* no more PATH entries? */\r\n\r\n      /* count PATH entry len */\r\n      len = 0;\r\n      do ++len, ++envptr;\r\n      while (*envptr && *envptr != ';');\r\n\r\n      /* add separator, if necessary, between name and path */\r\n      p = pname;\r\n      if (envptr [-1] != '\\\\' && envptr [-1] != '/' && envptr [-1] != ':')\r\n        --p, *p = '\\\\';\r\n    } while (len > p - buf);\r\n\r\n    /* add path before name */\r\n    p = memcpy (p - len, envptr - len, len);\r\n  }\r\n  free(path);\r\n\r\n  /* file found, now convert its path to full-qualified absolute one */\r\n#ifdef FEATURE_LONG_FILENAMES\r\n  if ((pbuf = dfnfullpath (getshortfilename (p))) == NULL)\r\n    display_errno_fnam_error (getshortfilename (p));\r\n#else\r\n  if ((pbuf = dfnfullpath (p)) == NULL)\r\n    display_errno_fnam_error (p);\r\n#endif\r\n  return pbuf;\r\n}\r\n"
  },
  {
    "path": "license",
    "content": "\t\t    GNU GENERAL PUBLIC LICENSE\r\n\t\t       Version 2, June 1991\r\n\r\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.\r\n                          675 Mass Ave, Cambridge, MA 02139, USA\r\n Everyone is permitted to copy and distribute verbatim copies\r\n of this license document, but changing it is not allowed.\r\n\r\n\t\t\t    Preamble\r\n\r\n  The licenses for most software are designed to take away your\r\nfreedom to share and change it.  By contrast, the GNU General Public\r\nLicense is intended to guarantee your freedom to share and change free\r\nsoftware--to make sure the software is free for all its users.  This\r\nGeneral Public License applies to most of the Free Software\r\nFoundation's software and to any other program whose authors commit to\r\nusing it.  (Some other Free Software Foundation software is covered by\r\nthe GNU Library General Public License instead.)  You can apply it to\r\nyour programs, too.\r\n\r\n  When we speak of free software, we are referring to freedom, not\r\nprice.  Our General Public Licenses are designed to make sure that you\r\nhave the freedom to distribute copies of free software (and charge for\r\nthis service if you wish), that you receive source code or can get it\r\nif you want it, that you can change the software or use pieces of it\r\nin new free programs; and that you know you can do these things.\r\n\r\n  To protect your rights, we need to make restrictions that forbid\r\nanyone to deny you these rights or to ask you to surrender the rights.\r\nThese restrictions translate to certain responsibilities for you if you\r\ndistribute copies of the software, or if you modify it.\r\n\r\n  For example, if you distribute copies of such a program, whether\r\ngratis or for a fee, you must give the recipients all the rights that\r\nyou have.  You must make sure that they, too, receive or can get the\r\nsource code.  And you must show them these terms so they know their\r\nrights.\r\n\r\n  We protect your rights with two steps: (1) copyright the software, and\r\n(2) offer you this license which gives you legal permission to copy,\r\ndistribute and/or modify the software.\r\n\r\n  Also, for each author's protection and ours, we want to make certain\r\nthat everyone understands that there is no warranty for this free\r\nsoftware.  If the software is modified by someone else and passed on, we\r\nwant its recipients to know that what they have is not the original, so\r\nthat any problems introduced by others will not reflect on the original\r\nauthors' reputations.\r\n\r\n  Finally, any free program is threatened constantly by software\r\npatents.  We wish to avoid the danger that redistributors of a free\r\nprogram will individually obtain patent licenses, in effect making the\r\nprogram proprietary.  To prevent this, we have made it clear that any\r\npatent must be licensed for everyone's free use or not licensed at all.\r\n\r\n  The precise terms and conditions for copying, distribution and\r\nmodification follow.\r\n\f\r\n\t\t    GNU GENERAL PUBLIC LICENSE\r\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r\n\r\n  0. This License applies to any program or other work which contains\r\na notice placed by the copyright holder saying it may be distributed\r\nunder the terms of this General Public License.  The \"Program\", below,\r\nrefers to any such program or work, and a \"work based on the Program\"\r\nmeans either the Program or any derivative work under copyright law:\r\nthat is to say, a work containing the Program or a portion of it,\r\neither verbatim or with modifications and/or translated into another\r\nlanguage.  (Hereinafter, translation is included without limitation in\r\nthe term \"modification\".)  Each licensee is addressed as \"you\".\r\n\r\nActivities other than copying, distribution and modification are not\r\ncovered by this License; they are outside its scope.  The act of\r\nrunning the Program is not restricted, and the output from the Program\r\nis covered only if its contents constitute a work based on the\r\nProgram (independent of having been made by running the Program).\r\nWhether that is true depends on what the Program does.\r\n\r\n  1. You may copy and distribute verbatim copies of the Program's\r\nsource code as you receive it, in any medium, provided that you\r\nconspicuously and appropriately publish on each copy an appropriate\r\ncopyright notice and disclaimer of warranty; keep intact all the\r\nnotices that refer to this License and to the absence of any warranty;\r\nand give any other recipients of the Program a copy of this License\r\nalong with the Program.\r\n\r\nYou may charge a fee for the physical act of transferring a copy, and\r\nyou may at your option offer warranty protection in exchange for a fee.\r\n\r\n  2. You may modify your copy or copies of the Program or any portion\r\nof it, thus forming a work based on the Program, and copy and\r\ndistribute such modifications or work under the terms of Section 1\r\nabove, provided that you also meet all of these conditions:\r\n\r\n    a) You must cause the modified files to carry prominent notices\r\n    stating that you changed the files and the date of any change.\r\n\r\n    b) You must cause any work that you distribute or publish, that in\r\n    whole or in part contains or is derived from the Program or any\r\n    part thereof, to be licensed as a whole at no charge to all third\r\n    parties under the terms of this License.\r\n\r\n    c) If the modified program normally reads commands interactively\r\n    when run, you must cause it, when started running for such\r\n    interactive use in the most ordinary way, to print or display an\r\n    announcement including an appropriate copyright notice and a\r\n    notice that there is no warranty (or else, saying that you provide\r\n    a warranty) and that users may redistribute the program under\r\n    these conditions, and telling the user how to view a copy of this\r\n    License.  (Exception: if the Program itself is interactive but\r\n    does not normally print such an announcement, your work based on\r\n    the Program is not required to print an announcement.)\r\n\f\r\nThese requirements apply to the modified work as a whole.  If\r\nidentifiable sections of that work are not derived from the Program,\r\nand can be reasonably considered independent and separate works in\r\nthemselves, then this License, and its terms, do not apply to those\r\nsections when you distribute them as separate works.  But when you\r\ndistribute the same sections as part of a whole which is a work based\r\non the Program, the distribution of the whole must be on the terms of\r\nthis License, whose permissions for other licensees extend to the\r\nentire whole, and thus to each and every part regardless of who wrote it.\r\n\r\nThus, it is not the intent of this section to claim rights or contest\r\nyour rights to work written entirely by you; rather, the intent is to\r\nexercise the right to control the distribution of derivative or\r\ncollective works based on the Program.\r\n\r\nIn addition, mere aggregation of another work not based on the Program\r\nwith the Program (or with a work based on the Program) on a volume of\r\na storage or distribution medium does not bring the other work under\r\nthe scope of this License.\r\n\r\n  3. You may copy and distribute the Program (or a work based on it,\r\nunder Section 2) in object code or executable form under the terms of\r\nSections 1 and 2 above provided that you also do one of the following:\r\n\r\n    a) Accompany it with the complete corresponding machine-readable\r\n    source code, which must be distributed under the terms of Sections\r\n    1 and 2 above on a medium customarily used for software interchange; or,\r\n\r\n    b) Accompany it with a written offer, valid for at least three\r\n    years, to give any third party, for a charge no more than your\r\n    cost of physically performing source distribution, a complete\r\n    machine-readable copy of the corresponding source code, to be\r\n    distributed under the terms of Sections 1 and 2 above on a medium\r\n    customarily used for software interchange; or,\r\n\r\n    c) Accompany it with the information you received as to the offer\r\n    to distribute corresponding source code.  (This alternative is\r\n    allowed only for noncommercial distribution and only if you\r\n    received the program in object code or executable form with such\r\n    an offer, in accord with Subsection b above.)\r\n\r\nThe source code for a work means the preferred form of the work for\r\nmaking modifications to it.  For an executable work, complete source\r\ncode means all the source code for all modules it contains, plus any\r\nassociated interface definition files, plus the scripts used to\r\ncontrol compilation and installation of the executable.  However, as a\r\nspecial exception, the source code distributed need not include\r\nanything that is normally distributed (in either source or binary\r\nform) with the major components (compiler, kernel, and so on) of the\r\noperating system on which the executable runs, unless that component\r\nitself accompanies the executable.\r\n\r\nIf distribution of executable or object code is made by offering\r\naccess to copy from a designated place, then offering equivalent\r\naccess to copy the source code from the same place counts as\r\ndistribution of the source code, even though third parties are not\r\ncompelled to copy the source along with the object code.\r\n\f\r\n  4. You may not copy, modify, sublicense, or distribute the Program\r\nexcept as expressly provided under this License.  Any attempt\r\notherwise to copy, modify, sublicense or distribute the Program is\r\nvoid, and will automatically terminate your rights under this License.\r\nHowever, parties who have received copies, or rights, from you under\r\nthis License will not have their licenses terminated so long as such\r\nparties remain in full compliance.\r\n\r\n  5. You are not required to accept this License, since you have not\r\nsigned it.  However, nothing else grants you permission to modify or\r\ndistribute the Program or its derivative works.  These actions are\r\nprohibited by law if you do not accept this License.  Therefore, by\r\nmodifying or distributing the Program (or any work based on the\r\nProgram), you indicate your acceptance of this License to do so, and\r\nall its terms and conditions for copying, distributing or modifying\r\nthe Program or works based on it.\r\n\r\n  6. Each time you redistribute the Program (or any work based on the\r\nProgram), the recipient automatically receives a license from the\r\noriginal licensor to copy, distribute or modify the Program subject to\r\nthese terms and conditions.  You may not impose any further\r\nrestrictions on the recipients' exercise of the rights granted herein.\r\nYou are not responsible for enforcing compliance by third parties to\r\nthis License.\r\n\r\n  7. If, as a consequence of a court judgment or allegation of patent\r\ninfringement or for any other reason (not limited to patent issues),\r\nconditions are imposed on you (whether by court order, agreement or\r\notherwise) that contradict the conditions of this License, they do not\r\nexcuse you from the conditions of this License.  If you cannot\r\ndistribute so as to satisfy simultaneously your obligations under this\r\nLicense and any other pertinent obligations, then as a consequence you\r\nmay not distribute the Program at all.  For example, if a patent\r\nlicense would not permit royalty-free redistribution of the Program by\r\nall those who receive copies directly or indirectly through you, then\r\nthe only way you could satisfy both it and this License would be to\r\nrefrain entirely from distribution of the Program.\r\n\r\nIf any portion of this section is held invalid or unenforceable under\r\nany particular circumstance, the balance of the section is intended to\r\napply and the section as a whole is intended to apply in other\r\ncircumstances.\r\n\r\nIt is not the purpose of this section to induce you to infringe any\r\npatents or other property right claims or to contest validity of any\r\nsuch claims; this section has the sole purpose of protecting the\r\nintegrity of the free software distribution system, which is\r\nimplemented by public license practices.  Many people have made\r\ngenerous contributions to the wide range of software distributed\r\nthrough that system in reliance on consistent application of that\r\nsystem; it is up to the author/donor to decide if he or she is willing\r\nto distribute software through any other system and a licensee cannot\r\nimpose that choice.\r\n\r\nThis section is intended to make thoroughly clear what is believed to\r\nbe a consequence of the rest of this License.\r\n\f\r\n  8. If the distribution and/or use of the Program is restricted in\r\ncertain countries either by patents or by copyrighted interfaces, the\r\noriginal copyright holder who places the Program under this License\r\nmay add an explicit geographical distribution limitation excluding\r\nthose countries, so that distribution is permitted only in or among\r\ncountries not thus excluded.  In such case, this License incorporates\r\nthe limitation as if written in the body of this License.\r\n\r\n  9. The Free Software Foundation may publish revised and/or new versions\r\nof the General Public License from time to time.  Such new versions will\r\nbe similar in spirit to the present version, but may differ in detail to\r\naddress new problems or concerns.\r\n\r\nEach version is given a distinguishing version number.  If the Program\r\nspecifies a version number of this License which applies to it and \"any\r\nlater version\", you have the option of following the terms and conditions\r\neither of that version or of any later version published by the Free\r\nSoftware Foundation.  If the Program does not specify a version number of\r\nthis License, you may choose any version ever published by the Free Software\r\nFoundation.\r\n\r\n  10. If you wish to incorporate parts of the Program into other free\r\nprograms whose distribution conditions are different, write to the author\r\nto ask for permission.  For software which is copyrighted by the Free\r\nSoftware Foundation, write to the Free Software Foundation; we sometimes\r\nmake exceptions for this.  Our decision will be guided by the two goals\r\nof preserving the free status of all derivatives of our free software and\r\nof promoting the sharing and reuse of software generally.\r\n\r\n\t\t\t    NO WARRANTY\r\n\r\n  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\r\nFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\r\nOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\r\nPROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\r\nOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\r\nTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\r\nPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\r\nREPAIR OR CORRECTION.\r\n\r\n  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\r\nREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\r\nINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\r\nOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\r\nTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\r\nYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\r\nPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\r\nPOSSIBILITY OF SUCH DAMAGES.\r\n\r\n\t\t     END OF TERMS AND CONDITIONS\r\n\f\r\n\tAppendix: How to Apply These Terms to Your New Programs\r\n\r\n  If you develop a new program, and you want it to be of the greatest\r\npossible use to the public, the best way to achieve this is to make it\r\nfree software which everyone can redistribute and change under these terms.\r\n\r\n  To do so, attach the following notices to the program.  It is safest\r\nto attach them to the start of each source file to most effectively\r\nconvey the exclusion of warranty; and each file should have at least\r\nthe \"copyright\" line and a pointer to where the full notice is found.\r\n\r\n    <one line to give the program's name and a brief idea of what it does.>\r\n    Copyright (C) 19yy  <name of author>\r\n\r\n    This program is free software; you can redistribute it and/or modify\r\n    it under the terms of the GNU General Public License as published by\r\n    the Free Software Foundation; either version 2 of the License, or\r\n    (at your option) any later version.\r\n\r\n    This program is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n    GNU General Public License for more details.\r\n\r\n    You should have received a copy of the GNU General Public License\r\n    along with this program; if not, write to the Free Software\r\n    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n\r\nAlso add information on how to contact you by electronic and paper mail.\r\n\r\nIf the program is interactive, make it output a short notice like this\r\nwhen it starts in an interactive mode:\r\n\r\n    Gnomovision version 69, Copyright (C) 19yy name of author\r\n    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r\n    This is free software, and you are welcome to redistribute it\r\n    under certain conditions; type `show c' for details.\r\n\r\nThe hypothetical commands `show w' and `show c' should show the appropriate\r\nparts of the General Public License.  Of course, the commands you use may\r\nbe called something other than `show w' and `show c'; they could even be\r\nmouse-clicks or menu items--whatever suits your program.\r\n\r\nYou should also get your employer (if you work as a programmer) or your\r\nschool, if any, to sign a \"copyright disclaimer\" for the program, if\r\nnecessary.  Here is a sample; alter the names:\r\n\r\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\r\n  `Gnomovision' (which makes passes at compilers) written by James Hacker.\r\n\r\n  <signature of Ty Coon>, 1 April 1989\r\n  Ty Coon, President of Vice\r\n\r\nThis General Public License does not permit incorporating your program into\r\nproprietary programs.  If your program is a subroutine library, you may\r\nconsider it more useful to permit linking proprietary applications with the\r\nlibrary.  If this is what you want to do, use the GNU Library General\r\nPublic License instead of this License.\r\n\r\n"
  },
  {
    "path": "makefile",
    "content": "# $Id$\r\n#\r\n# Makefile for the FreeDOS kernel's command interpreter\r\n#\r\n# $Log$\r\n# Revision 1.18  2003/04/28 15:57:43  skaus\r\n# v0.82 pl 2:\r\n#\r\n# Revision 1.17  2002/05/11 22:10:36  skaus\r\n# v0.83 Beta 40:\r\n# bugfix: ^Break detection after XMS-Swapping\r\n#\r\n# Revision 1.16  2001/07/27 22:37:34  skaus\r\n# bugfix: pre-compiled package BINARY.ZIP without command-line editing\r\n# chg: FreeCOM archive (== executable) is opened read-only.\r\n#\r\n# Revision 1.15  2001/04/29 11:33:50  skaus\r\n# chg: default heap size (tools\\ptchsize) set to 6KB\r\n# chg: error displaying functions centralized into lib\\err_fcts.src\r\n# add: displayError()\r\n# chg: all errors are displayed through functions void error_*()\r\n# bugfix: somtimes error messages are not displayed (see displayError())\r\n# bugfix: docommand(): type:file must pass \":file\" to TYPE\r\n# bugfix: error_sfile(): string _SFILE_\r\n# bugfix: error message on empty redirection\r\n# bugfix: comma and semicolon ';' are recognized as argument seperators\r\n# \tof internal commands\r\n#\r\n# Revision 1.14  2001/04/12 00:09:06  skaus\r\n# chg: New structure\r\n# chg: If DEBUG enabled, no available commands are displayed on startup\r\n# fix: PTCHSIZE also patches min extra size to force to have this amount\r\n#    of memory available on start\r\n# bugfix: CALL doesn't reset options\r\n# add: PTCHSIZE to patch heap size\r\n# add: VSPAWN, /SWAP switch, .SWP resource handling\r\n# bugfix: COMMAND.COM A:\\\r\n# bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n# add: command MEMORY\r\n# bugfix: runExtension(): destroys command[-2]\r\n# add: clean.bat\r\n# add: localized CRITER strings\r\n# chg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n# \tvia STRINGS.LIB\r\n# add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n# add: fixstrs.c: prompts & symbolic keys\r\n# add: fixstrs.c: backslash escape sequences\r\n# add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n# chg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n# bugfix: IF is now using error system & STRINGS to report errors\r\n# add: CALL: /N\r\n#\r\n#\r\n\r\n.IMPORT : FREEDOS\r\n# # .IMPORT .IGNORE : LNG DEBUG NDEBUG\r\n\r\n# # INCDIR+=;$(FREEDOS)\\SRC\\INCLUDE;$(PWD:u)\\\\INCLUDE\r\n# # LIBDIR+=;$(FREEDOS)\\SRC\\LIB\\$(_COMPILER)\r\n# # LDLIBS = $(FREEDOS)\\SRC\\LIB\\$(_COMPILER)\\Suppl_$(_MODEL).lib CMD\\\\CMDS.LIB LIB\\\\FREECOM.LIB STRINGS\\\\STRINGS.LIB\r\n# # LDFLAGS += /msl\r\n# # NASM *= c:\\TOOL\\NASMW.EXE\r\n\r\n# Use BC5 linker in order to use TD of BC5\r\n# # LD_TLINK != D:\\BC5\\BIN\\TLINK.EXE\r\n\r\n# Project specific C compiler flags\r\n# # MYCFLAGS_DBG = -UNDEBUG $(null,$(DEBUG) $(NULL) -DDEBUG=1)\r\n# # MYCFLAGS_NDBG = -DNDEBUG=1 -UDEBUG\r\n# # MYCFLAGS = $(null,$(NDEBUG) $(MYCFLAGS_DBG) $(MYCFLAGS_NDBG))\r\n\r\n# Project specific NASM compiler flags\r\n# # NASMFLAGS_DBG = $(null,$(DEBUG) $(NULL) -DDEBUG=1) -s\r\n# # NASMFLAGS_NDBG = -s\r\n# # NASMFLAGS = $(null,$(NDEBUG) $(NASMFLAGS_DBG) $(NASMFLAGS_NDBG))\r\n\r\n# # RUNMAKE = $(MAKE) LNG=$(LNG) NASM=$(NASM) DEBUG=$(DEBUG) NDEBUG=$(NDEBUG) MODEL=$(MODEL)\r\n\r\n.INCLUDE : _config.mk\r\n\r\nGLOBAL_DEPS = err_fcts.h\r\n\r\n# # .SOURCE.lib := $(LIBDIR:s/;/ /:u)\r\n\r\n# Sources of this make target\r\nSRC = \r\n\r\n\r\n# # .INCLUDE .IGNORE : lastmake.mk\r\n\r\n# # THISMAKE !:= $(_COMPILER):$(_MODEL):$(LNG):$(null,$(NDEBUG) DBG NDBG):$(LNG)\r\n\r\n#\tDefault target\r\nall: com.com tools\r\n\r\n.INIT .PHONY .SEQUENTIAL : verscheck $(CFG) __errl tags\r\n\r\ntags :\r\n\tctags cmd\\*.c lib\\*.c shell\\*.c\r\n\r\n.IF $(THISMAKE) == $(LASTMAKE)\r\nverscheck :;\r\n.ELSE\r\nverscheck : \r\n\t@+-echo Changed Make parameters, already made files invalid!\r\n\t+-echo LASTMAKE = $(THISMAKE) >lastmake.mk\r\n\t$(RUNMAKE) clobber\r\n.IF $(CFG)\r\n\t$(RUNMAKE) $(CFG)\r\n.ENDIF\r\n.ENDIF\r\n\r\n__errl:\r\n\t@+-if exist errlist del errlist >nul\r\n#\t-ctags *.c\r\n\r\ncom.com .SEQUENTIAL : utils strings criter lib cmd shell\\\\com.exe infores\r\n\t@+copy /b shell\\\\com.exe + infores + criter\\\\criter + criter\\\\criter1 + strings\\\\strings.dat $@\r\n\r\ninfores : config.h include/command.h shell\\\\com.exe shell/com.map\r\n\tutils\\mkinfres.exe /T$@.txt $@ shell\\\\com.map shell\\\\com.exe\r\n\r\ncontext : criter\r\n\r\nshell\\\\com.exe : shell\r\n\r\nsubdirs.mk : makefile\r\n\tperl mksubmk.pl >$@\r\n\r\n.INCLUDE : subdirs.mk\r\n\r\nerr_fcts.h : lib\\\\err_fcts.src lib\\\\efct_*.c ; perl lib\\\\scanerr.pl lib\\\\err_fcts.src lib\\\\efct_*.c >$@\r\n\r\n#MAKEDEP START\r\n#MAKEDEP STOP\r\n\r\nclobber : $(CLOBBER_DEPENDENCIES) my_clean\r\n\t$(RM) $(RMFLAGS) *.com *.cln subdirs.mk err_fcts.h *.cfg\r\n\r\nclean : $(CLEAN_DEPENDENCIES) \r\n\r\ndist : err_fcts.h utils $(DIST_DEPENDENCIES)\r\n\r\ncommand.lsm : command.com\r\n\tperl get_vers.pl $<\r\n\r\n\r\nmy_clean :\r\n\t$(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj *.exe $(CFG) *.dmp\r\n\t$(RM) $(RMFLAGS) strings.dat strings.h context.h_c criter1 criter2 context.inc infores\r\n\r\ndoc .SETDIR=docs/html/commands :\r\n\tupd_html.bat\r\n"
  },
  {
    "path": "mkdist.bat",
    "content": "@echo off\r\n: Prepare binary distribution\r\nset DBG=Yes\r\nset DBG=\r\n\r\n: don't forget to pass on the default rather than mine\r\ncopy config.std config.mak\r\ncopy /u docs\\download.txt .\r\n\r\nfor %pkg in (binary debug plainedt xmsswap) for %fnam in (ptchldrv.exe ptchsize.exe kssf.com vspawn.com command.com) (set fn=packages\\%pkg.std\\%fnam %+ if exist %fn del /q %fn)\r\n\r\n\r\nset _DBG=REM\r\nif NOT \"%DBG%\"==\"\" set _DBG=\r\n\r\n%_DBG setdos /y1 %+ %_DBG echo on\r\n\r\nset compiler=tc101\r\nset compiler=bc5\r\nset lng=english\r\nset model=\r\nset xms_swap=\r\n\r\niff exist config.h.backup then\r\n\techo config.h.backup exists\r\n\techo something went wrong last time\r\n\tcancel 30\r\nendiff\r\n\r\niff not isdir old then\r\n\tmkdir old\r\n\tif not isdir old (echo Cannot create OLD %+ quit 10)\r\nelse\r\n\tdel /y old\\*.*\r\nendiff\r\nfor %stem in (cmddebug command kssf kssf_dbg) do for %ext in (new exe com cln) do (set file=%stem.%ext %+ if exist %file move %file old\\%file)\r\n\r\n%_DBG setdos /y0 %+ %_DBG echo off\r\ndmake clobber || quit\r\n%_DBG setdos /y1 %+ %_DBG echo on\r\n\r\n: pause\r\n\r\n: Make the \"with debug\" binary\r\nset ndebug=\r\nset debug=1\r\nset compiler=bc5\r\n\r\n%_DBG setdos /y0 %+ %_DBG echo off\r\ndmake MODEL!:=l || quit\r\n%_DBG setdos /y1 %+ %_DBG echo on\r\n: pause\r\n\r\nif not exist com.com goto ende\r\nmove com.com packages\\debug.std\\command.com\r\nif exist com.com goto ende\r\nfor %file in (tools\\kssf.com tools\\vspawn.com tools\\ptchldrv.exe tools\\ptchsize.exe) (if exist %file move %file packages\\debug.std\\ %+ if exist %file goto ende)\r\n:noKSSFDBG\r\n: pause\r\n\r\n: Disable all debug stuff\r\nset ndebug=Yes\r\nset debug=\r\nset compiler=tc101\r\nset model=s\r\n\r\nset XMS_SWAP=Yes\r\n%_DBG setdos /y0 %+ %_DBG echo off\r\ndmake || quit\r\n%_DBG setdos /y1 %+ %_DBG echo on\r\nif not exist com.com goto ende\r\niff not exist utils\\ptchsize.exe then\r\n\techo no PTCHSIZE\r\n\tgoto ende\r\nendiff\r\nutils\\ptchsize.exe com.com +7KB\r\nif errorlevel 1 goto ende\r\nmove com.com packages\\xmsswap.std\\command.com\r\ncopy /b shell\\com.exe +infores + criter\\criter + criter\\criter1 packages\\localize.std\\xmsswap.cln\r\nif exist com.com goto ende\r\nset XMS_SWAP=\r\n: pause\r\n\r\n\r\nren /q config.h config.h.backup || cancel 20\r\necho #define IGNORE_ENHANCED_INPUT >config.h\r\ntype config.h.backup >>config.h\r\n\r\n\r\nset err=\r\n%_DBG setdos /y0 %+ %_DBG echo off\r\ndmake || set err=%?\r\n%_DBG setdos /y1 %+ %_DBG echo on\r\n\r\ndel /q config.h\r\nren /q config.h.backup config.h || cancel 21\r\n\r\nif not x%err == x cancel %err\r\nif not exist com.com goto ende\r\niff not exist utils\\ptchsize.exe then\r\n\techo no PTCHSIZE\r\n\tgoto ende\r\nendiff\r\nutils\\ptchsize.exe com.com +6KB\r\nif errorlevel 1 goto ende\r\nmove com.com packages\\plainedt.std\\command.com\r\nif exist com.com goto ende\r\n: pause\r\n\r\n\r\ndel /q shell\\*.exe lastmake.mk\r\ntouch config.h\r\n%_DBG setdos /y0 %+ %_DBG echo off\r\ndmake -W config.h || quit\r\n%_DBG setdos /y1 %+ %_DBG echo on\r\n: pause\r\n\r\nif not exist com.com goto ende\r\ncopy /b shell\\com.exe +infores + criter\\criter + criter\\criter1 command.cln\r\nren com.com command.com\r\nif exist com.com goto ende\r\niff not exist utils\\ptchsize.exe then\r\n\techo no PTCHSIZE\r\n\tgoto ende\r\nendiff\r\nutils\\ptchsize.exe command.com +6KB\r\nif errorlevel 1 goto ende\r\n\r\nfor %file in (tools\\kssf.com tools\\vspawn.com tools\\ptchldrv.exe tools\\ptchsize.exe) (if exist %file copy %file packages\\plainedt.std\\ %+ if exist %file move %file packages\\binary.std\\ %+ if exist %file goto ende)\r\n\r\nperl get_ver.pl .\\command.com\r\n\r\n: %_DBG echo on %+ setdos /y1\r\n\r\n:: Make HTML documents\r\npushd docs\\html\\commands || quit\r\necho Updating HTML documents\r\ncall upd_html.bat\r\npopd\r\n\r\n: %_DBG echo on %+ setdos /y1\r\ncall mkpkgs.bat\r\n\r\n%_DBG setdos /y0 %+ %_DBG echo off\r\ndmake clean dist || quit\r\n%_DBG setdos /y1 %+ %_DBG echo on\r\n\r\nrm -frd old\r\n\r\n:ende\r\n"
  },
  {
    "path": "mkfiles/bc5.mak",
    "content": ".AUTODEPEND\r\n\r\nCC_BASE_PATH = $(BC5_BASE)\r\nBINPATH = $(CC_BASE_PATH)\\BIN\t# Turbo/Borland C++\r\nLIBPATH = $(CC_BASE_PATH)\\LIB\r\nINCLUDEPATH = -I$(CC_BASE_PATH)\\INCLUDE\r\nCC = $(BINPATH)\\BCC\t\t# Borland C++\r\nCL = $(CC)\r\nAR = $(BINPATH)\\Tlib /C\r\nLD_RSP = command.rsp\r\nLD = $(BINPATH)\\Tlink /m/s/l /c/d /i @$(LD_RSP)\r\n\r\nOBJC0 = $(LIBPATH)\\c0$(SHELL_MMODEL).obj\r\nLIBC = $(LIBPATH)\\c$(SHELL_MMODEL).lib\r\n\r\nFIXSTRSOPT = --lib1\r\n\r\nCFG = TURBOC.CFG\r\nCFLAGS1 = -1- -a -f- -ff- -K -w+ -O -Z\r\nCFLAGS2 = -b- -v -L$(LIBPATH)\r\n\r\n#\t\t*Implicit Rules*\r\n.c.exe:\r\n  $(CC) $< $(SUPPL_LIB_PATH)\\SUPPL_$(SHELL_MMODEL).LIB\r\n.c.obj:\r\n  $(CC) -c {$< }\r\n"
  },
  {
    "path": "mkfiles/gcc.mak",
    "content": "# Linux only for now\r\nDIRSEP = /\r\nECHOTO = echo >>\r\nECHOTODEP =\r\nLIBLIST = >\r\nECHOLIB = echo >>\r\nECHOLIBDEP =\r\nRMFILES = rm -f\r\nCP = cp\r\nLIBC = -li86\r\nNASMFLAGS := $(NASMFLAGS) -felf\r\nSHELL_MMODEL_COMP = cmodel=small\r\nINCLUDEPATH = -I. -I../compat -I../suppl/compat\r\nCOMPACT_MMODEL = -mcmodel=compact\r\n\r\nCC = ia16-elf-gcc\r\nCL = ia16-elf-gcc -mcmodel=small\r\nCLO = -o $@\r\nAR = ia16-elf-ar crsv\r\nLD = $(CL) $(CFLAGS1) -o command.exe $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) command.ld $(LIBS) $(LIBC) -Wl,-Map,command.map\r\n\r\nCFG = gcc.cfg\r\nCFLAGS1 = -Os -Wall -Werror -Wno-pointer-to-int-cast -Wno-incompatible-pointer-types -mregparmcall -fno-builtin -fno-strict-aliasing -Wno-format -mfar-function-if-far-return-type -fno-caller-saves -fno-optimize-sibling-calls -fno-move-loop-invariants -fno-tree-loop-optimize -fno-rerun-cse-after-loop\r\n\r\n#\t\t*Implicit Rules*\r\n.SUFFIXES:\r\n.SUFFIXES: .c .asm .com .exe .obj\r\nifeq ($(UTILS_BUILD),1)\r\n.c.exe:\r\n\tgcc -x c -Og -g -Wall -DGCC -D__GETOPT_H -I../suppl $< -o $@\r\nelse ifeq ($(COMPACT_MODEL),1)\r\n.c.obj .c.exe:\r\n\t@echo ------------------------------------------------------\r\n\t@echo \"$@ (DOS version) is not build because\"\r\n\t@echo ia16-elf-gcc does not support the compact memory model\r\n\t@echo ------------------------------------------------------\r\n\r\n.obj.exe:\r\n\r\nelse\r\n.c.obj:\r\n\t$(CC) -c $< @$(CFG) -o $@\r\n\r\n.c.exe .obj.exe:\r\n\t$(CL) $< @$(CFG) $(LIBS) $(LIBC) -o $@\r\n\r\nendif\r\n"
  },
  {
    "path": "mkfiles/tc2.mak",
    "content": "CC_BASE_PATH = $(TC2_BASE)\r\nBINPATH = $(CC_BASE_PATH)\t# Turbo C\r\nLIBPATH = $(CC_BASE_PATH)\\LIB\r\nINCLUDEPATH = -I$(CC_BASE_PATH)\\INCLUDE\r\nCC = $(BINPATH)\\TCC\t\t# Turbo C/C++\r\nCL = $(CC)\r\nAR = $(BINPATH)\\Tlib /C\r\nLD_RSP = command.rsp\r\nLD = $(BINPATH)\\Tlink /m/s/l /c/d @$(LD_RSP)\r\n\r\nOBJC0 = $(LIBPATH)\\c0$(SHELL_MMODEL).obj\r\nLIBC = $(LIBPATH)\\c$(SHELL_MMODEL).lib\r\n\r\nFIXSTRSOPT = --lib2\r\n\r\nCFG = TURBOC.CFG\r\nCFLAGS1 = -1- -a- -f- -ff- -K -w+ -O -Z\r\nCFLAGS2 = -L$(LIBPATH)\r\n\r\n#\t\t*Implicit Rules*\r\n.c.exe:\r\n  $(CC) $< $(SUPPL_LIB_PATH)\\SUPPL_$(SHELL_MMODEL).LIB\r\n.c.obj:\r\n  $(CC) -c $<\r\n"
  },
  {
    "path": "mkfiles/turbocpp.mak",
    "content": ".AUTODEPEND\r\n\r\nCC_BASE_PATH = $(TP1_BASE)\r\nBINPATH = $(CC_BASE_PATH)\\BIN\t# Turbo/Borland C++\r\nLIBPATH = $(CC_BASE_PATH)\\LIB\r\nINCLUDEPATH = -I$(CC_BASE_PATH)\\INCLUDE\r\nCC = $(BINPATH)\\TCC\t\t# Turbo C/C++\r\nCL = $(CC)\r\nAR = $(BINPATH)\\Tlib /C\r\nLD_RSP = command.rsp\r\nLD = $(BINPATH)\\Tlink /m/s/l /c/d @$(LD_RSP)\r\n\r\nOBJC0 = $(LIBPATH)\\c0$(SHELL_MMODEL).obj\r\nLIBC = $(LIBPATH)\\c$(SHELL_MMODEL).lib\r\n\r\nFIXSTRSOPT = --lib2\r\n\r\nCFG = TURBOC.CFG\r\nCFLAGS1 = -1- -a -f- -ff- -K -w+ -O -Z\r\nCFLAGS2 = -b- -L$(LIBPATH)\r\n\r\n#\t\t*Implicit Rules*\r\n.c.exe:\r\n  $(CC) $< $(SUPPL_LIB_PATH)\\SUPPL_$(SHELL_MMODEL).LIB\r\n.c.obj:\r\n  $(CC) -c {$< }\r\n"
  },
  {
    "path": "mkfiles/watcom.mak",
    "content": "!ifdef __UNIX__\r\nDIRSEP = /\r\nRMFILES = rm -f\r\nECHOTO = echo >>\r\nECHOTODEP =\r\nCP = cp\r\n!endif\r\nLIBLIST = >\r\nECHOLIB = echo >>\r\nECHOLIBDEP =\r\n\r\n!ifdef __UNIX__\r\nLD = $(CL) -l=dos -fe=command.exe $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(LIBS) -\\\"op map,statics,verbose,stack=4k\\\"\r\n!else\r\nLD_RSP = command.rsp\r\nLD = wlinker /ma/nologo @$(LD_RSP)\r\n!endif\r\nINCLUDEPATH = -I$(WATCOM)$(DIRSEP)h\r\nCC = wcc -zq -fo=.obj\r\nCL = wcl -zq -fo=.obj -bcl=dos\r\nCL386 = wcl386 -zq -fo=.obj\r\nAR = wlib -n -c\r\n\r\nCFG = watcomc.cfg\r\nCFLAGS1 = -os-s-wx\r\n\r\n#\t\t*Implicit Rules*\r\n!ifeq UTILS_BUILD 1\r\n.c.exe:\r\n! ifdef __LINUX__\r\n  $(CL386) -I$(WATCOM)$(DIRSEP)lh $< -fm -fe=$@ -I..$(DIRSEP)suppl\r\n! else ifdef __MSDOS__\r\n!  ifeq COMPACT_MODEL 1\r\n  $(CL) -mc -I$(WATCOM)$(DIRSEP)h $< -fm -fe=$@ -I..$(DIRSEP)suppl\r\n!  else\r\n  $(CL) -ms -I$(WATCOM)$(DIRSEP)h $< -fm -fe=$@ -I..$(DIRSEP)suppl\r\n!  endif\r\n! else ifdef __OSX__\r\n  clang -x c -Og -g -Wall -Wno-pragma-pack -DGCC -D__GETOPT_H -I../suppl $< -o $@\r\n! else\r\n  $(CL386) -I$(WATCOM)$(DIRSEP)h $< -fm -fe=$@ -I..$(DIRSEP)suppl\r\n! endif\r\n!else\r\n.c.obj:\r\n  $(CC) $< -bt=dos @$(CFG)\r\n\r\n.obj.exe:\r\n  wlink sys DOS f $< lib $(SUPPL_LIB_PATH)$(DIRSEP)suppl_$(SHELL_MMODEL).lib op q,map\r\n\r\n.c.exe:\r\n  $(CL) $< @$(CFG) -\\\"op map,statics,verbose,stack=4k\\\"\r\n\r\n!endif\r\n"
  },
  {
    "path": "scripts/complng.pl",
    "content": "#!perl\r\n\r\n# Compare a language file of two different ages\r\n\r\n# Useage: $0 new old\r\n\r\ndie \"Useage: $0 new old\\n\"\r\n\tunless $ARGV[0] && $ARGV[1];\r\n\r\ndie \"Cannot open $ARGV[1]: $!\\n\"\r\n\tunless open(IN, $ARGV[1]);\r\nwhile(<IN>) {\r\n\tnext unless /^:/;\r\n\t$name = $';\r\n\t$name = $` if $name =~ /\\#/;\r\n\t$name =~ s/\\s+//g;\r\n\t$body = '';\r\n\twhile(<IN>) {\r\n\t\t$body .= $_;\r\n\t\tlast if /^[\\.\\,]\\s*$/;\r\n\t}\r\n\t$string{$name} = $body;\r\n}\r\nclose IN;\r\n\r\nunlink(\"$ARGV[0].old\");\r\ndie \"Cannot backup $ARGV[0]: $!\\n\"\r\n\tunless rename($ARGV[0], \"$ARGV[0].old\");\r\ndie \"Cannot open backup $ARGV[0].old: $!\\n\"\r\n\tunless open(IN, \"$ARGV[0].old\");\r\ndie \"Cannot create $ARGV[0]: $!\\n\"\r\n\tunless open(OUT, \">$ARGV[0]\");\r\nwhile(<IN>) {\r\n\tif(/^:/) {\r\n\t\t$name = $';\r\n\t\t$name = $` if $name =~ /\\#/;\r\n\t\t$name =~ s/\\s+//g;\r\n\t\t$body = '';\r\n\t\twhile(<IN>) {\r\n\t\t\t$body .= $_;\r\n\t\t\tlast if /^[\\.\\,]\\s*$/;\r\n\t\t}\r\n\t\t$name .= '#1' unless $string{$name} eq $body;\r\n\t\tprint OUT \":$name\\n\", $body;\r\n\t} else {\r\n\t\tprint OUT;\r\n\t}\r\n}\r\nclose IN;\r\nclose OUT;\r\n\r\n"
  },
  {
    "path": "scripts/compsyms.pl",
    "content": "\r\ndie \"Useage: $0 this_map previous_map\" unless $#ARGV == 1;\r\n\r\ndie \"Cannot open this map $ARGV[0]\" unless open(IN, $ARGV[0]);\r\nwhile( ($_ = <IN>) && !/^\\s*Address/ )\r\n{}\r\n\r\nLOOP1: while(<IN>) {\r\n\ts/^\\s*//;\r\n\ts/\\s*$//;\r\n\t@F = split(/\\s+/, $_);\r\n\tlast LOOP1 if $F[0] eq 'Address';\r\n\r\n\tif($#F == 1) {\r\n\t\t$sym{$F[1]} = 1;\r\n\t} elsif($#F == 2 && $F[1] eq 'Abs') {\r\n\t\t$sym{$F[2]} = 1;\r\n\t}\r\n}\r\nclose IN;\r\n\r\ndie \"Cannot open previous map $ARGV[1]\" unless open(IN, $ARGV[1]);\r\nwhile( ($_ = <IN>) && !/^\\s*Address/ )\r\n{}\r\n\r\nLOOP1: while(<IN>) {\r\n\ts/^\\s*//;\r\n\ts/\\s*$//;\r\n\t@F = split(/\\s+/, $_);\r\n\tlast LOOP1 if $F[0] eq 'Address';\r\n\r\n\tif($#F == 1) {\r\n\t\t$nam = $F[1];\r\n\t} elsif($#F == 2 && $F[1] eq 'Abs') {\r\n\t\t$nam = $F[2];\r\n\t} else {\r\n\t\tnext;\r\n\t}\r\n\r\n\tif(defined $sym{$nam}) {\r\n\t\tdelete $sym{$nam};\r\n\t} else {\r\n\t\tprint \"- $nam\\n\";\r\n\t}\r\n}\r\nclose IN;\r\n\r\nforeach $nam (sort keys %sym) {\r\n\tprint \"+ $nam\\n\";\r\n}\r\n"
  },
  {
    "path": "scripts/director.bat",
    "content": ": $Id$\r\n: Maintainer: Bernd Blaauw, bblnews@hotmail.com\r\n: to use on a cdrom to create localized versions\r\n@echo off\r\nctty nul\r\nif [%1]==[makesys] goto makesys\r\n@REM Using auxiliary program to get current dir in variable %basepath%, set by prog\r\n@REM basepath.exe, ftp://garbo.uwasa.fi/pc/link/tsbat.zip (freeware, prof Timo Salmi) \r\n@REM  TODO: also fix case of multiple FreeDOS installations! (easily done by above)\r\n\r\n@REM  TODO: fix Xkeyb support.\r\n@REM  TODO: how about mouse support? cdrom support [atapicdd.sys]?\r\n\r\nrem Detecting sample config.sys in freedos install destination dir,\r\nrem UPDATE THE FILESIZE NUMBER in line below (4749) if editing sample\r\nrem before distribution!!!!!!!!!!!!!!!!!!!!!!!\r\nif not exist %cdrom%\\FREEDOS\\INSTALL\\BASEPATH.EXE goto end\r\n\r\nset destvar=\r\n%cdrom%\\FREEDOS\\FDOS\\BIN\\locate.com config.sys /S:4749! /O:&D /N /F:1 /G\r\n%cdrom%\\FREEDOS\\INSTALL\\BASEPATH.EXE CONFIG.SYS\r\nPUSHD\r\nset destvar=%basepath%\r\nrem destvar has value C:\\FDOS\\ for example, inclusing ending \\ !!!\r\nset basepath=\r\nrem %destvar% is the freedos install directory which was created, so alreadyy exists...\r\nif not exist %destvar%nul goto end\r\nset name1=c:\\config.sys\r\nset name2=c:\\autoexec.bat\r\nset name3=c:\\command.com\r\ngoto makeconf\r\nfor %%x in ( c:\\autoexec.bat c:\\config.sys c:\\command.com ) do if exist %%x goto FDname\r\ngoto makeconf\r\n\r\n:FDname\r\nset name1=c:\\fdconfig.sys\r\nset name2=%destvar%fdauto.bat\r\nset name3=%destvar%bin\\command.com\r\ngoto makeconf\r\n\r\n:makeconf\r\ncls\r\nif exist %name1% echo Skipped updating %name1%\r\nif exist %name1% goto makeauto\r\necho Creating system configuration file . . .\r\necho Creating multimenu templates for %name1%\r\n\r\necho MENU 1 - Load FreeDOS and XMS-memory driver                         > %name1%\r\necho MENU 2 - Load FreeDOS without drivers                              >> %name1%\r\necho MENUDEFAULT=1,5                                                    >> %name1%\r\necho 1?DEVICE=%destvar%BIN\\FDXXMS.SYS                                   >> %name1%\r\necho 1?DOS=HIGH                                                         >> %name1%\r\necho 1?SHELL=%destvar%BIN\\CMDXSWP.COM /P=%name2%                        >> %name1%\r\necho 2?SHELL=%name3% /P=%name2%                                         >> %name1%\r\necho !LASTDRIVE=Z                                                       >> %name1%\r\necho ECHO Loading remaining configuration files . . .                   >> %name1%\r\n\r\ngoto makeauto\r\n\r\n\r\n\r\n:makeauto\r\nif exist %name2% echo Skipped updating %name2%\r\nif exist %name2% %name2%\r\necho Creating system startup automation file [%name2%]\r\necho @echo off                                                                          > %name2%\r\necho set lang=%lang%                                                                   >> %name2%\r\nif not [%key%]==[false] echo set key=%key%                                             >> %name2%\r\necho set path=C:\\;%destvar%;%destvar%bin                                               >> %name2%\r\ntype %cdrom%\\FREEDOS\\INSTALL\\autofill.txt>>%name2%\r\necho echo BootFiles: %name1%, %name2%, %name3%>> %name2%\r\necho echo.                                                                             >> %name2%\r\necho echo Welcome to FreeDOS                                                           >> %name2%\r\nrem adding more files\r\ncls\r\n\r\nrem 1024 bytes Environment (almost) full, so clearing things....\r\nset name1=\r\nset name2=\r\nset findfile=\r\nfor %%x in ( [] [EN] [en] ) do if [%lang%]==%%x goto final\r\nset workdir=%cdrom%\\freedos\\install\\freecom\r\nif not exist %workdir%\\strings.%lang% echo Could not find FreeCOM %lang% messagefile for command.com translation.\r\nif not exist %workdir%\\strings.%lang% goto final\r\nset copycmd=/y\r\ncopy /b %workdir%\\command.cln + %workdir%\\strings.%lang%  %name3%\r\ncopy /b %workdir%\\xms_swap.cln + %workdir%\\strings.%lang% %destvar%\\bin\\cmdxswp.com\r\ncls\r\necho FreeDOS command interpreter succesfully translated to language %lang%\r\nset workdir=\r\ngoto final\r\n\r\n:final\r\nREM for easy adding to possible bootloader:\r\nREM we first save command.com if it exists, then run SYS with bootsector2file option, then restore the command.com\r\nif exist c:\\command.fd8 del c:\\command.fd8\r\nif exist c:\\fdbtsect.bin del c:\\fdbtsect.bin\r\nif exist c:\\command.com ren c:\\command.com c:\\command.fd8\r\nSYS A: C: C:\\FDBTSECT.BIN \r\nif exist c:\\command.com del c:\\command.com\r\nif exist c:\\command.fd8 ren c:\\command.fd8 c:\\command.com\r\nrem prevent any SYS C: from overwriting the (localized) newest command.com!!!\r\n%cdrom%\\freedos\\fdos\\bin\\attrib +r %name3%\r\ncls\r\nalias boot = %cdrom%\\freedos\\install\\director.bat makesys\r\nctty con\r\nrem Configuring a graphical program like Seal2 is pointless in VMware!\r\nif [%VM%]==[TRUE] goto the_end\r\nif exist %destvar%seal2\\install.exe Pause press a key to start manual Seal Desktop install\r\nif exist %destvar%seal2\\install.exe %destvar%seal2\\install.exe\r\ngoto the_end\r\n:the_end\r\nctty con\r\n\r\necho Following things have just been done during postconfiguration:\r\necho.\r\necho * Set up alternate Config.sys file\r\necho * Set up alternate Autoexec.bat file\r\necho * Transfer FREEDOS core files, so your harddisk is almost bootable.\r\necho * Save bootsector in C:\\FDBTSECT.BIN for easy adding to a bootmanager \r\necho   - like Boot.ini for example\r\necho * Translate command.com into the language you used during installation.\r\necho * loading of some drivers and boot-settings.\r\necho.\r\necho Please type BOOT if you want to make your harddisk bootable,\r\necho else reboot the system now.\r\npopd\r\npushd\r\ngoto end\r\n\r\n:makesys\r\nrem being called by the alias called BOOT to transfer bootsector and files,\r\nrem without overwriting the created translated command.com file\r\nsys a: c:\r\nif exist c:\\command.com attrib -r -s -h c:\\command.com\r\nattrib -r -s -h %name3%\r\nctty con\r\ncls\r\necho Your system is now bootable. We recommend to reboot the system\r\ngoto end\r\n\r\n:end\r\nctty con\r\n"
  },
  {
    "path": "scripts/disp_cmd.asm",
    "content": "; Display the command line\r\n; THE LAST CHARACTER MUST BE A DOLLAR SIGN!!!\r\n; e.g.:\r\n; C> disp_cmd=abcd$\r\n\r\n\tmov ah, 9\r\n\tmov dx, 81h\r\n\tint 21h\r\n\tmov ax, 4c00h\r\n\tint 21h\r\n\tint 20h\r\n\r\n"
  },
  {
    "path": "scripts/echolib.bat",
    "content": "@echo off\r\nif \"%2%3%4%5%6%7%8%9\" == \"\" goto nothing\r\nif '^(' == '(' goto :cmd_shell\r\necho +%2 & >>%1\r\nif \"%3%\" == \"\" goto nothing\r\necho +%3 & >>%1\r\nif \"%4%\" == \"\" goto nothing\r\necho +%4 & >>%1\r\nif \"%5\" == \"\" goto nothing\r\necho +%5 & >>%1\r\nif \"%6\" == \"\" goto nothing\r\necho +%6 & >>%1\r\nif \"%7\" == \"\" goto nothing\r\necho +%7 & >>%1\r\nif \"%8\" == \"\" goto nothing\r\necho +%8 & >>%1\r\nif \"%9\" == \"\" goto nothing\r\necho +%9 & >>%1\r\ngoto :args_check\r\n:cmd_shell\r\necho +%2 ^& >>%1\r\nif \"%3%\" == \"\" goto nothing\r\necho +%3 ^& >>%1\r\nif \"%4%\" == \"\" goto nothing\r\necho +%4 ^& >>%1\r\nif \"%5\" == \"\" goto nothing\r\necho +%5 ^& >>%1\r\nif \"%6\" == \"\" goto nothing\r\necho +%6 ^& >>%1\r\nif \"%7\" == \"\" goto nothing\r\necho +%7 ^& >>%1\r\nif \"%8\" == \"\" goto nothing\r\necho +%8 ^& >>%1\r\nif \"%9\" == \"\" goto nothing\r\necho +%9 ^& >>%1\r\n:args_check\r\nshift\r\nif \"%9\" == \"\" goto nothing\r\necho echolib.bat arguments overflow\r\n:nothing\r\n"
  },
  {
    "path": "scripts/echoto.bat",
    "content": "@echo off\r\nif \"%2%3%4%5%6%7%8%9\" == \"\" goto nothing\r\necho %2 %3 %4 %5 %6 %7 %8 %9 >>%1\r\nshift\r\nif \"%9\" == \"\" goto nothing\r\necho echoto.bat arguments overflow\r\n:nothing\r\n"
  },
  {
    "path": "scripts/fetchseg.pl",
    "content": "\r\ndie \"Useage: $0 this_map previous_map\\n\" unless $#ARGV == 1;\r\n\r\ndie \"Cannot open this map file $ARGV[0]\" unless open(IN, $ARGV[0]);\r\nLOOP1: while(<IN>) {\r\n\ts/^\\s+//;\r\n\ts/\\s+$//;\r\n\t@F = split(/\\s+/, $_);\r\n\tnext if $#F < $[;\r\n\tlast LOOP1 if $#F != 4;\r\n\tnext if $F[4] eq 'Class';\r\n\t$segs{$F[3]} = hex(substr($F[2], 0, length($F[2]) - 1));\r\n}\r\nclose IN;\r\n\r\ndie \"Cannot open previous map file $ARGV[1]\" unless open(IN, $ARGV[1]);\r\nLOOP2: while(<IN>) {\r\n\ts/^\\s+//;\r\n\ts/\\s+$//;\r\n\t@F = split(/\\s+/, $_);\r\n\tnext if $#F < $[;\r\n\tlast LOOP2 if $#F != 4;\r\n\tnext if $F[4] eq 'Class';\r\n\t$len = hex(substr($F[2], 0, length($F[2]) - 1));\r\n\tif(defined $segs{$F[3]}) {\r\n\t\t$len = $segs{$F[3]} - $len;\r\n\t\tdelete $segs{$F[3]};\r\n\t}\r\n\t$total += $len;\r\n\t$len = \"+\" . $len if $len > 0;\r\n\t(print(\"$F[3]: $len\\n\"), $disp = 1) if $len;\r\n}\r\nclose IN;\r\n$total = \"+\" . $total if $total > 0;\r\nprint \"Total: $total\\n\" if $disp;\r\n"
  },
  {
    "path": "scripts/findstrg.pl",
    "content": "#!perl\r\n\r\n# Searches for string codes in sources\r\n\r\n$lng = shift;\r\n\r\ndie \"Useage: $0 lng-file {source-files}\\n\"\r\n\tunless $lng;\r\n\r\nforeach $pattern (@ARGV) {\r\n\tif(substr($pattern, 0, 1) eq '-') {\r\n\t\t$pattern = substr($pattern ,1);\r\n\t\t$negate = 1;\r\n\t} else {\r\n\t\t$negate = 0;\r\n\t}\r\n\tforeach $file (glob($pattern)) {\r\n\t\tif(-f $file) {\r\n\t\t\t$ofile = lc($file);\r\n\t\t\tif($negate) {\r\n\t\t\t\tdelete $files{$ofile};\r\n\t\t\t} else {\r\n\t\t\t\t$files{$ofile} = $file;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nforeach $ofile (sort keys %files) {\r\n\t$file = $files{$ofile};\r\n\twarn \"Cannot open file $file: $!\\n\"\r\n\t\tunless open(IN, $file);\r\n\twhile(<IN>) {\r\n\t\twhile(/\\b(TEXT|PROMPT)_[A-Z_]+\\b/) {\r\n\t\t\t$string{$&} = 1;\r\n\t\t\t$_ = $';\r\n\t\t}\r\n\t}\r\n\tclose IN;\r\n}\r\n\r\n\r\ndie \"Cannot open lng file: $!\\n\"\r\n\tunless open(IN, $lng);\r\nwhile(<IN>) {\r\n\tnext unless /^:/;\r\n\t$name = $';\r\n\t$name = $` if $name =~ /\\#/;\r\n\t$name =~ s/\\s+//g;\r\n\t$body = '';\r\n\twhile(<IN>) {\r\n\t\t$body .= $_;\r\n\t\tlast if /^[\\.\\,]\\s*$/;\r\n\t}\r\n\tprint $name . \"\\n\" unless $string{$name};\r\n}\r\nclose IN;\r\n"
  },
  {
    "path": "scripts/makecmd.bat",
    "content": "@echo off\r\n: Copyright (C) Bernd Blaauw\r\n: Creates localized FreeCOM-versions depending on which language files\r\n: are available in the current directory\r\n: Note: all versions use default lang (compiled in) for critical errors, usually English\r\n: Usage: makecmd\r\n:        makecmd YY Name\r\n: where no arguments creates all variants\r\n: where YY Name just creates version for specified language\r\nif \"%1\"==\"continue\" goto loop\r\nSET MAKEALL=%1\r\nif \"%1\"==\"\" SET MAKEALL=EN\r\nif \"%1\"==\"\" del strings.* > NUL\r\nset languages=%1 %2\r\nif \"%1\"==\"\" set languages=NL Dutch ES Spanish DE German FI Finnish FR French IT Italian PO Polish PTR PT_BR RU Russian SE Swedish Ser Serbian SI Slovene TR Turkish UKR Ukr YUG YU437\r\ncall %0  continue %languages%\r\n:: do english last and keep the strings.dat\r\nif \"%1\"==\"\" call %0 continue EN English\r\nset languages=\r\nset MAKEALL=\r\ngoto end\r\n\r\n:loop\r\nshift\r\nif \"%1\"==\"\" goto end\r\nset lang=%1\r\ngoto compile\r\n::if exist %1.lng del %1.lng\r\ngoto end\r\n\r\n:compile\r\nif \"%2\"==\"\" goto end\r\nfor %%x in ( command.cln xmsswap.cln fixstrs.exe default.lng %2.lng ) do if not exist %%x goto end\r\nif exist strings.err del strings.err\r\nif exist strings.log del strings.log\r\nfixstrs %2.lng\r\ncopy strings.dat strings.%1 > NUL\r\nif \"%MAKEALL%\"==\"%1\" copy /b command.cln + strings.dat command.com > NUL\r\nif \"%MAKEALL%\"==\"%1\" copy /b xmsswap.cln + strings.dat xmsswap.com > NUL\r\nif exist strings.err echo Translation file out of date for language %2 [file: %2.lng]!\r\nif exist strings.log echo Translation file out of date for language %2 [file: %2.lng]!\r\n:: leave strings.dat if matches MAKEALL, which must be last language specified, i.e. leave a default STRINGS.DAT\r\nif NOT \"%MAKEALL%\"==\"%1\" if exist strings.dat del strings.dat\r\nif NOT \"%MAKEALL%\"==\"%1\" if exist strings.log del strings.log\r\nif exist strings.h   del strings.h\r\nshift\r\ngoto loop\r\n:end\r\nif \"%lang%\"==\"\" echo Warning: nothing done due to LANG variable not set\r\n"
  },
  {
    "path": "scripts/mkxref.pl",
    "content": "#!perl\r\n\r\n# Generate Xref from all local *.OBJ files and the C standard library\r\n\r\n##### Environmental settings\r\n\r\n# How to dump .OBJ/.LIB files\r\n## '%f%' is substituted by the source filename\r\n$dump = 'tdump %f%';\r\n\r\n# Name of C standard library\r\n$clib = 'd:\\bc5\\lib\\cs.lib';\r\n\r\n# Name of SUPPL library\r\n$suppl = 'suppl_s.lib';\r\n\r\n# Names of files to be ignored while generted the dependency\r\n%ignoreFile = ('c0.asm' => 1);\r\n\r\n\r\n##### End of user-configurable settings\r\n\r\nopen(LOG, \">mkxref.log\")\r\n\tor die \"Cannot create mkxfer.log: $!\";\r\n\r\n@files = <*.dmp>;\r\n\r\n# Read in all local source files\r\n\r\n$mkextref = sub {\r\n\t\t\t$ext{$name} .= ',' . $file;\r\n\t\t\t$extf{$file} .= ',' . $name;\r\n\t\t};\r\n\r\nforeach $file (@files) {\r\n\tprint STDERR \"Processing $file ...\\n\";\r\n\t$file =~ tr/A-Z/a-z/;\r\n\tnext if $file =~ /^(suppl|clib)_.\\.dmp$/;\r\n\t&scan($file, sub { $file = $name; }\r\n\t , sub {\r\n\t\t\tif(defined $pub{$name}) {\r\n\t\t\t\t&warning(\"$name multiply defined: $pub{$name} and $file\");\r\n\t\t\t} else {\r\n\t\t\t\t$pub{$name} = $file;\r\n\t\t\t\t$pubf{$file} .= \",$name\";\r\n\t\t\t}\r\n\t\t}\r\n\t , $mkextref);\r\n}\r\n\r\nprint STDERR \"Processing SUPPL library...\\n\";\r\n&scan('suppl_s.dmp', sub { $file = \"Suppl<$name>\"; }\r\n , sub {\r\n\t\tif(defined $pub{$name}) {\r\n\t\t\t&warning(\"$name in $file overridden by $pub{$name}\");\r\n\t\t\t--$warning;\r\n\t\t} else {\r\n\t\t\t$pub{$name} = $file;\r\n\t\t\t$pubf{$file} .= \",$name\";\r\n\t\t}\r\n\t}\r\n , $mkextref);\r\n\r\n\r\nprint STDERR \"Processing C library...\\n\";\r\n&scan('clib_s.dmp', sub { $file = \"Clib<$name>\"; }\r\n , sub {\r\n\t\tif(defined $pub{$name}) {\r\n\t\t\t&warning(\"$name in $file overridden by $pub{$name}\");\r\n\t\t\t--$warning;\r\n\t\t} else {\r\n\t\t\t$pub{$name} = $file;\r\n\t\t\t$pubf{$file} .= \",$name\";\r\n\t\t}\r\n\t}\r\n , $mkextref);\r\n\r\ndie \"Solve the warnings before proceed\" if $warning;\r\n\r\n\r\nprint STDERR \"Generating file dependency information...\\n\";\r\n# \"What files reference a given symbol\"\r\nforeach $symbol (keys %pubf) {\r\n\t$reftbl{$symbol} = '';\r\n\t%refby = ('' => -1, $symbol => -1);\r\n\t# $refSyms: symbols exports the given file and can be\r\n\t#\treferenced by other files\r\n\t$refSyms = $pubf{$symbol};\r\n\t$depth = 0;\r\n\twhile($refSyms) {\r\n\t\t++$depth;\r\n\t\t# Aquire where these symbols are located\r\n\t\t$files = '';\r\n\t\tforeach $name (split(',', $refSyms)) {\r\n\t\t\t# The exported symbols of the files referenced at this depth are\r\n\t\t\t# referenced are referenced themselves by these files\r\n\t\t\t$files .= $ext{$name};\r\n\t\t}\r\n\t\t$refSyms = '';\r\n\t\t# Aquire which symbols are externally referenced by the new files\r\n\t\t$sym = '|';\r\n\t\tforeach $file (split(',', $files)) {\r\n\t\t\tif(!defined $refby{$file} && !defined $ignoreFile{$file}) {\r\n\t\t\t\t$reftbl{$symbol} .= $sym . $file;\r\n\t\t\t\t$sym = ',';\r\n\t\t\t\t$refby{$file} = $depth;\r\n\t\t\t\t# the $file references the current file, now determine\r\n\t\t\t\t# which files reference symbols exported by this one\r\n\t\t\t\t# to get a recursive list\r\n\t\t\t\t$refSyms .= $pubf{$file};\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n# \"What files a given symbol references\"\r\nforeach $symbol (keys %extf) {\r\n\t$needtbl{$symbol} = '';\r\n\t%needs = ('' => -1, $symbol => -1);\r\n\t$needSyms = $extf{$symbol};\r\n\t$depth = 0;\r\n\twhile($needSyms) {\r\n\t\t++$depth;\r\n\t\t# Aquire which files the imported symbols are located in\r\n\t\t$newneedSyms = '';\r\n\t\t$sym = '|';\r\n\t\tforeach $name (split(',', $needSyms)) {\r\n\t\t\t$file = $pub{$name};\r\n\t\t\tif(!defined $needs{$file} && !defined $ignoreFile{$file}) {\r\n\t\t\t\t$needs{$file} = $depth;\r\n\t\t\t\t$needtbl{$symbol} .= $sym . $file;\r\n\t\t\t\t$sym = ',';\r\n\t\t\t\t# $file is referenced by the current file, now determine\r\n\t\t\t\t# which symbols are referenced by this one\r\n\t\t\t\t$newneedSyms .= $extf{$file};\r\n\t\t\t}\r\n\t\t}\r\n\t\t$needSyms = $newneedSyms;\r\n\t}\r\n}\r\n\r\n\r\nprint STDERR \"Processing MAP file...\\n\";\r\n@ARGV = <*.map> unless @ARGV;\r\n\r\nwhile(<>) {\r\n\tlast if /Publics by Value/;\r\n}\r\n\r\n$lastSegm = $lastAddr = '';\r\n@names = ();\r\n@files = ();\r\nwhile(<>) {\r\n\tnext unless /^\\s*([0-9a-fA-F]+):([0-9a-fA-F]+)\\s+(\\S+)\\s*$/;\r\n\t$segm = $1;\r\n\t$addr = $2;\r\n\t$name = $3;\r\n\r\n\tpush(@names, $name);\r\n\r\n\tif(defined $pub{$name}) {\r\n\t\t$file = $pub{$name};\r\n\t\t$files{$file} = 1;\r\n\t}\r\n\r\n\tif($lastSegm eq $segm) {\r\n\t\t$len{$lastName} = hex($addr) - hex($lastAddr);\r\n\t}\r\n\r\n\t$lastSegm = $segm;\r\n\t$lastAddr = $addr;\r\n\t$lastName = $name;\r\n}\r\n\r\nprint \"Imported symbols:\\n\\t\" . join(\"\\n\\t\", sort @names) . \"\\n\";\r\nprint \"Linked files:\\n\\t\" . join(\"\\n\\t\", sort keys %files) . \"\\n\";\r\n\r\n\r\nforeach $name (sort @names) {\r\n\tprint \"\\n$name: \";\r\n\tif(defined $pub{$name}) {\r\n\t\t$file = $pub{$name};\r\n\t\tprint \"PUBDEF in $file\\n\";\r\n\t} else {\r\n\t\tprint \"no PUBDEF\\n\";\r\n\t}\r\n\tif(defined $len{$name}) {\r\n\t\tprint \"\\testimated length: $len{$name} byte\\n\";\r\n\t}\r\n\r\n\t&printRec(\"references\", 'references nothing', $needtbl{$pub{$name}});\r\n\t&printRec(\"referenced by\", 'never referenced', $reftbl{$pub{$name}});\r\n\r\n}\r\n\r\nsub files {\r\n\tlocal($files) = @_;\r\n\tlocal($file);\r\n\tlocal($h) = '';\r\n\r\n\tforeach $file (split(',', $files)) {\r\n\t\tif($file && defined $files{$file}) {\r\n\t\t\t$h .= \", $file\";\r\n\t\t}\r\n\t}\r\n\r\n\treturn substr($h, 2);\r\n}\r\n\r\nsub warning {\r\n\t++$warning;\r\n\tprint LOG join(\"\\n\", @_) . \"\\n\";\r\n\tprint STDERR join(\"\\n\", @_) . \"\\n\";\r\n}\r\n\r\nsub scan {\r\n\tlocal($file, $thecode, $pubcode, $extcode) = @_;\r\n\r\n\topen(IN, \"$file\")\r\n\t\tor die \"Cannot open $file\";\r\n\twhile(<IN>) {\r\n\t\t$code = '' if /^\\S/;\r\n\t\tif(/\\bTHEADR\\s+(\\S+)\\s*$/) {\r\n\t\t\t$name = $1;\r\n\t\t\t$name =~ tr/A-Z/a-z/;\r\n\t\t\t&$thecode;\r\n\t\t} elsif(!$code && /\\bPUBDEF\\b/) {\r\n\t\t\t$_ = $';\r\n\t\t\t$code = $pubcode;\r\n\t\t} elsif(!$code && /\\bEXTDEF\\b/) {\r\n\t\t\t$_ = $';\r\n\t\t\t$code = $extcode;\r\n\t\t}\r\n\t\t&processList($code) if $code;\r\n\t}\r\n\tclose IN;\r\n}\r\n\r\nsub processList {\r\n\tlocal($code) = @_;\r\n\r\n\tif(/\\'([^\\']+)\\'/) {\r\n\t\t$name = $1;\r\n\t\t&$code;\r\n\t}\r\n}\r\n\r\nsub printRec {\r\n\tlocal($yesStr, $noStr, $files) = @_;\r\n\tlocal(@files, $depth, $prompt, $fil, $dep);\r\n\r\n\tif(length($files) > 1) {\r\n\t\t@files = split(/\\|/, $files);\r\n\t\t$prompt = \"==$yesStr\";\r\n\t\t$dep = 0;\r\n\t\tforeach $depth ($[..$#files) {\r\n\t\t\t$fil = &files($files[$depth])\r\n\t\t\t and (print \"$prompt: $fil\\n\"), $prompt = \"  depth #\" . ++$dep;\r\n\t\t}\r\n\t} else {\r\n\t\t$noStr and print \"==$noStr\\n\";\r\n\t}\r\n}\r\n"
  },
  {
    "path": "scripts/rmfiles.bat",
    "content": "@echo off\r\n:loop_commandline\r\n\r\nif \\%1 == \\ goto done_with_commandline\r\nif exist %1 del %1>nul\r\nshift\r\ngoto loop_commandline\r\n\r\n:done_with_commandline\r\n\r\n"
  },
  {
    "path": "scripts/sav.btm",
    "content": "@echo off\r\n: setdos /y1  echo on\r\n\r\niff %# == 0 then\r\n\techo Useage: %@name[%0] COM.* description\r\nelse\r\n\tset max=0\r\n\tfor /a:d %dir in (c[1-9]*) (set num=%@substr[%dir,1]if %num GT %max set max=%num)\r\n\tset ldir=..\\c%max\r\n\tset dir=c%@eval[%max+1]\r\n\tmkdir %dir\r\n\tiff not isdir %dir then\r\n\t\techo Cannot create directory %dir\r\n\telse\r\n\t\tdmake32 xref || (Echo failed to create XREF  quit 20)\r\n\t\tpushd %dir\r\n\t\techo %& >info\r\n\t\tcopy /q ..\\com.* ..\\xref ..\\mkxref.log .\r\n\t\tperl ..\\fetchseg.pl com.map %ldir\\com.map >chg_segs\r\n\t\tperl ..\\compsyms.pl com.map %ldir\\com.map >chg_syms\r\n\t\techo Backup %dir created\r\n\t\tiff %@filesize[chg_segs,b] GT 0 then\r\n\t\t\techo Changes of the length of the segments:\r\n\t\t\ttype chg_segs\r\n\t\tendiff\r\n\t\tiff %@lines[chg_syms] GE 0 then\r\n\t\t\techo The number of symbols changed by %@eval[%@lines[chg_syms]+1]\r\n\t\tendiff\r\n\t\tpopd\r\n\tendiff\r\nendiff\r\n"
  },
  {
    "path": "shell/batch.c",
    "content": "/* $Id$\r\n *  BATCH.C - batch file processor for COMMAND.COM.\r\n *\r\n *  Comments:\r\n *\r\n * ??/??/?? (Evan Jeffrey)\r\n *   started.\r\n *\r\n * 15 Jul 1995 (Tim Norman)\r\n *   modes and bugfixes.\r\n *\r\n * 08 Aug 1995 (Matt Rains)\r\n *   i have cleaned up the source code. changes now bring this source\r\n *   into guidelines for recommended programming practice.\r\n *\r\n *   i have added some constants to help making changes easier.\r\n *\r\n * 29 Jan 1996 (Steffan Kaiser)\r\n *   made a few cosmetic changes\r\n *\r\n * 05 Feb 1996 (Tim Norman)\r\n * - changed to comply with new first/rest calling scheme\r\n *\r\n * 14 Jun 1997 (Steffen Kaiser)\r\n * - bug fixes.  added error level expansion %?.  ctrl-break handling\r\n *\r\n * 16 Jul 1998 (Hans B Pufal)\r\n * - Totally reorganised in conjunction with COMMAND.C (cf) to implement\r\n *   proper BATCH file nesting and other improvements.\r\n *\r\n * 16 Jul 1998 (John P Price <linux-guru@gcfl.net>)\r\n * - Seperated commands into individual files.\r\n *\r\n * 19 Jul 1998 (Hans B Pufal) [HBP_001]\r\n * - Preserve state of echo flag across batch calls.\r\n *\r\n * 19 Jul 1998 (Hans B Pufal) [HBP_002]\r\n * - Implementation of FOR command\r\n *\r\n * 20-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added error checking after malloc calls\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 02-Aug-1998 (Hans B Pufal) [HBP_003]\r\n * - Fixed bug in ECHO flag restoration at exit from batch file\r\n *\r\n * 10-Aug-1998 ska\r\n * - added modifyable batchfile (standard behaviour)\r\n * - corrected ^Break processing\r\n * - added \"newBatchContext()\" to create/clear/chain a bcontext variable\r\n * - added initBatchContext() & clearBatchContext() to make changes in the\r\n *   bcontext structure easier.\r\n *\r\n * 12-Aug-1998 ska\r\n * - added tracemode variable, however, it's currently ignored\r\n *\r\n * 1998/12/05 ska\r\n * - fix: ECHO state of interactive command line was not properly preserved\r\n *\r\n * 1999/04/23 ska\r\n * bugfix: batch_param(): Missing right quote, after stopping the do-while\r\n *\tloop, the '\\0' byte is copied, then s2 incremented --> right of string.\r\n * bugfix: batch(): fullname is duplicated into heap, but\r\n *\tnot freed if this function fails\r\n * bugfix: batch(): no error checking of batch_params()\r\n *\r\n * 1999/05/06 ska\t\t(see CMT2.TXT)\r\n * bugfix: FOR %a IN (dir\\*.*) :: must expand to dir\\...\r\n * bugfix: %9 wrong, if 9 > number of parameters\r\n * chg: %0 returns full name now\r\n * add: exit_all_batch() for session management\r\n *\r\n * 1999/07/08 ska\r\n * add: find_arg() returns a valid string for all, even negative indexes\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <io.h>\r\n#include <fcntl.h>\r\n#include <stdlib.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n\r\n#include <dfn.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/batch.h\"\r\n#include \"../err_fcts.h\"\r\n\r\n#ifdef INCLUDE_CMD_LFNFOR\r\nextern unsigned char lfnfor;\r\n#else\r\n#define lfnfor 0\r\n#endif\r\n\r\nstruct bcontext *bc = 0;     /* The stack of current batch contexts.\r\n                                 * NULL when no batch is active\r\n                                 */\r\n\r\nunsigned int echo = 1;          /* The echo flag */\r\nint tracemode = 0;              /* debug trace of scripts */\r\n\r\n\r\n/* Returns a pointer to the n'th parameter of the current batch file.\r\n * If no such parameter exists returns pointer to empty string.\r\n * If no batch file is current, returns NULL\r\n */\r\nchar *find_arg_bc(struct bcontext const * const b, int n)\r\n{\r\n  dprintf((\"[find_arg (%d)]\\n\", n));\r\n\r\n\tif(!b)\r\n\t\treturn 0;\r\n\r\n  n += b->shiftlevel;\r\n  if(n == 0)\r\n  \treturn b->bfirst;\r\n  if(n > b->numParams || n < 0)\r\n  \treturn \"\";\r\n  return b->params[n - 1];\r\n}\r\n\r\nstruct bcontext *activeBatchContext(void)\r\n{\tstruct bcontext *b = bc;\r\n\r\n\twhile(b && b->forvar)\r\n\t\tb = b->prev;\r\n\r\n\treturn b;\r\n}\r\n\r\n\r\n/* see split(...) in lib\\split.c \r\n   -- we must not split on option delimiters, only argument delimiters, see issue#52\r\n */\r\nchar **split_batchargs(char *s, int *args);\r\n\r\n/*\r\n * setBatchParams builds a parameter list in newly allocated memory.\r\n * The parameters consist of null terminated strings with a final\r\n * NULL character signalling the end of the parameters.\r\n */\r\nint setBatchParams(char *s)\r\n{\r\n  if((bc->params = split_batchargs(s, &bc->numParams)) == 0)\r\n  {\r\n    error_out_of_memory();\r\n    return 0;\r\n  }\r\n  return 1;\r\n}\r\n\r\n/* Move init/clear functionality out of the files in order to centralize\r\n * the low-level functionality --> easier to add/remove members of bcontext\r\n */\r\nstatic void clearBatchContext(struct bcontext *b)\r\n{\r\n\tassert(b);\r\n\r\n  if (b->bfile)\r\n    dos_close(b->bfile);\r\n  if (b->bfnam)\r\n    free(b->bfnam);\r\n  if (b->bfirst)\r\n    free(b->bfirst);\r\n  if (b->blabel)\r\n    free(b->blabel);\r\n\r\n  if (b->ffind)\r\n    free(b->ffind);\r\n  if (b->forproto)\r\n    free(b->forproto);\r\n  if (b->forvar)\r\n    free(b->forvar);\r\n  if (b->params)\r\n    freep(b->params);\r\n}\r\n\r\nstatic void initBatchContext(struct bcontext *b)\r\n{\r\n\tassert(b);\r\n  memset(b, 0, sizeof(*b));\r\n\r\n  b->brewind = 1;\r\n}\r\n\r\nvoid exit_batch(void)\r\n{\r\n/*\r\n * If a batch file is current, exits it, freeing the context block and\r\n * chaining back to the previous one.\r\n *\r\n * If no new batch context is found, sets ECHO back ON.\r\n *\r\n * If the parameter is non-null or not empty, it is printed as an exit\r\n * message\r\n */\r\n\r\n  dprintf((\"exit_batch (..)\\n\"));\r\n\r\n  if (bc)\r\n  {\r\n    struct bcontext\r\n     *t = bc;\r\n\r\n    if (bc->blabel)\r\n      error_bfile_no_such_label(bc->bfnam, bc->blabel);\r\n\r\n    clearBatchContext(bc);\r\n\r\n    echo = bc->echo;            /* Preserve echo state across batch calls */\r\n    bc = bc->prev;\r\n    free(t);\r\n  }\r\n\r\n  if (!bc)                      /* Notify ^Break handler to cancel\r\n  \t\t\t\t\t\t\t\t\t\"leave all\" state */\r\n    chkCBreak(BREAK_ENDOFBATCHFILES);\r\n}\r\n\r\n#if 0\r\n/* kill all batch contexts */\r\nvoid exit_all_batch(void)\r\n{\twhile(bc)\r\n\t\texit_batch();\r\n}\r\n#endif\r\n\r\n\r\n/*  Create/Clear/Chain all fields of the structure */\r\nstruct bcontext *newBatchContext(void)\r\n{\r\n  struct bcontext *b;\r\n\r\n  b = malloc(sizeof(*b));\r\n  if (!b)\r\n  {\r\n    error_out_of_memory();\r\n    return 0;\r\n  }\r\n\r\n  initBatchContext(b);\r\n  b->echo = echo;               /* a new context must always preserve the\r\n                                   current ECHO state */\r\n\r\n  b->prev = bc;\r\n  return bc = b;\r\n}\r\n\r\n/*\r\n *  Batch files are entitled to be \"modifyable\" and may span across\r\n *  floppy disks (you know: calling an external program that says\r\n *  \"Please insert next floppy\", then the INSTALL.BAT file on the\r\n *  the \"next floppy\" is accessed rather the originally opened one).\r\n *  The current implementation keeps the batchfile open, which is not\r\n *  the standard behaviour.\r\n */\r\nint batch (char * fullname, char * firstword, char * param) {\r\n  /*\r\n   * Start batch file execution\r\n   *\r\n   * The firstword parameter is the full filename of the batch file.\r\n   */\r\n\r\n   assert(fullname);\r\n   assert(firstword);\r\n   assert(param);\r\n\r\n  if((fullname = abspath(fullname, 1)) == 0)\r\n    return 1;\r\n\r\n  dprintf((\"batch ('%s', '%s', '%s')\\n\", fullname, firstword,\r\n           param));\r\n\r\n  while (bc && bc->forvar)      /* Kill any and all FOR contexts */\r\n    exit_batch();\r\n\r\n  if (bc == 0)               /* No current batch file, create new context */\r\n  {\r\n    if (!newBatchContext()) {\r\n    \tfree(fullname);\r\n      return 1;\r\n    }\r\n  }\r\n  else\r\n  {                             /* Then we are transferring to another batch */\r\n    struct bcontext *q;\r\n    int echo;\r\n\r\n    clearBatchContext(bc);\r\n\r\n    q = bc->prev;               /* preserve context chain intact */\r\n    echo = bc->echo;            /* preserve former ECHO state */\r\n    /* if the _current_ ECHO state would be preserved,\r\n       the following case would forget about the\r\n       ECHO state on the interactive command line:\r\n       === File BATCH1.BAT\r\n       @echo off\r\n       batch2\r\n       === File BATCH2.BAT\r\n       @echo off\r\n       ===\r\n       The transfer to BATCH2 would destroy BTACH1's\r\n       context and therefore the original ECHO state.\r\n       because BATCH2 is called with ECHO OFF, this\r\n       state would be preserved as the command line's\r\n       ECHO state */\r\n    initBatchContext(bc);\r\n    bc->prev = q;\r\n    bc->echo = echo;\r\n  }\r\n\r\n  bc->bfnam = fullname;         /* already duplicated */\r\n  if(0 == (bc->bfirst = strdup(firstword))\r\n   || !setBatchParams(param)) {\t /* out of memory condition */\r\n  \texit_batch();\t\t/* clear this erroreous batch context */\r\n  \treturn 1;\r\n  }\r\n\r\n  return 0;\r\n}\r\n\r\nstatic int getbline(int fd, char *textline, int len, int bufsize)\r\n{\r\n  /* get line from batchfile, and fill textline buffer if necessary */\r\n  /* input:\r\n\t fd = file descriptor\r\n\t textline = buffer\r\n\t len = length of previous line, if len>0 the buffer needs to be shifted.\r\n\t bufsize = total length of the buffer, except for trailing '\\n'.\r\n\t output:\r\n\t returns static variable size = active length of buffer, or 0 if error.\r\n\t textline contains a batch file window on demand.\r\n  */\r\n  static int size;\r\n  if (len == 0)\r\n\tsize = len;\r\n  else {\r\n\tsize -= len;\r\n\tif (size > 0) {\r\n\t  memmove(textline, &textline[len], size+1);\r\n\t  if (textlineEnd(textline, size))\r\n\t    return size;\r\n\t} else\r\n\t  size = 0;\r\n  }\r\n  if (size < bufsize) {\r\n\tint sz = dos_read(fd, &textline[size], bufsize - size);\r\n\tif (sz >= 0) {\r\n\t  size += sz;\r\n\t  textline[size] = '\\n';\r\n\t  return size;\r\n\t}\r\n  }\r\n  return 0;\r\n}\r\n\r\nchar *readbatchline(int *eflag, char *textline, int size)\r\n{\r\n  /*\r\n   * Read and return the next executable line from the current batch file\r\n   *\r\n   * If no batch file is current or no further executable lines are found\r\n   * return NULL.\r\n   *\r\n   * Here we also look out for FOR bcontext structures which trigger the\r\n   * FOR expansion code.\r\n   *\r\n   * Set eflag to 0 if line is not to be echoed else 1\r\n   */\r\n\r\n  char *first;\r\n  char *ip;\r\n  int len;\r\n\r\n  if (bc == 0)               /* No batch */\r\n    return 0;\r\n\r\n  dprintf((\"readbatchline ()\\n\"));\r\n  assert(textline);\r\n  assert(size > 1);\r\n  assert(eflag);\r\n\r\n  ip = \"\";                      /* make sure ip != NULL in the first\r\n  \t\t\t\t\t\t\t\t\titeration of the loop */\r\n  len = 0;\r\n  first = 0;\r\n  while (bc)\r\n  {\r\n    first = 0;               /* by default return \"no file\" */\r\n\r\n    if (bc->forvar)             /* If its a FOR context... */\r\n    {\r\n      int forvarlen;\r\n      char\r\n       *fv1,\r\n       *sp,      /* pointer to prototype command */\r\n       *dp,          /* Place to expand protoype */\r\n       *fv;\t\t\t\t       /* Next list element */\r\n\r\n      if (chkCBreak(BREAK_FORCMD) || bc->shiftlevel > bc->numParams)\r\n        /* End of list or User break so... */\r\n      {\r\n        exit_batch();           /* just exit this context */\r\n        continue;\r\n      }\r\n\r\n      fv1 = fv = getArgCur(0);\r\n\r\n\tif (bc->ffind) {          /* First already done fo do next */\r\n        if(\r\n#ifdef FEATURE_LONG_FILENAMES\r\n            lfnfor ? lfnfindnext( bc->ffind ) != 0 :\r\n#endif\r\n\t\t\tsfnfindnext((struct ffblk *)bc->ffind) != 0) /* no next file */\r\n        {\r\n          dos_findclose( bc->ffind );\r\n          free(bc->ffind);      /* free the buffer */\r\n          bc->ffind = 0;\r\n          bc->shiftlevel++;     /* On to next list element */\r\n          continue;\r\n        }\r\n\t  fv = bc->ffind->ff_name;\r\n\t} else {\r\n      if (strpbrk(fv, \"?*\") == 0) {      /* element is not wild file */\r\n        bc->shiftlevel++;       /* No -> use it and shift list */\r\n        fv1 = \"\";\t\t\t\t/* No additional info */\r\n      } else {\r\n        /* Wild file spec, find first (or next) file name */\r\n\r\n\t  /*  For first find, allocate a find first block */\r\n          if ((bc->ffind = malloc(sizeof(*bc->ffind))) == 0)\r\n          {\r\n            error_out_of_memory();\r\n            exit_batch();\t\t/* kill this FOR context */\r\n            break;\r\n          }\r\n\r\n         if(\r\n#ifdef FEATURE_LONG_FILENAMES\r\n             lfnfor ? lfnfindfirst( fv, bc->ffind, (bc->forFlags&FLAG_OPT_DIRECTORY? FA_DIREC:FA_NORMAL) ) == 0 :\r\n#endif\r\n                      sfnfindfirst( fv, ( struct ffblk * )bc->ffind, (bc->forFlags&FLAG_OPT_DIRECTORY? FA_DIREC:FA_NORMAL) )\r\n                      == 0 ) {\r\n         \t/* found a file */\r\n         \t*dfnfilename(fv) = '\\0';\t/* extract path */\r\n        \tfv = bc->ffind->ff_name;\r\n         } else {\t\t\t/* if not found use the string itself */\r\n#if 0\r\n\t\t\t/* To use the pattern is not compatible with MS COMMAND */\r\n\t\t\t++bc->shiftlevel;\r\n\t\t\tfv1 = \"\";\t\t\t\t/* No additional info */\r\n#else\r\n          free(bc->ffind);      /* free the buffer */\r\n          bc->ffind = 0;\r\n          bc->shiftlevel++;     /* On to next list element */\r\n          continue;\r\n#endif\r\n        }\r\n\r\n      }\r\n      }\r\n\r\n      /* At this point, fv points to parameter string */\r\n      /* fv1 is the string usually set to the path to the\r\n      \tfound file, otherwise it points to \"\" */\r\n\r\n       sp = bc->forproto;      /* pointer to prototype command */\r\n       dp = textline;          /* Place to expand protoype */\r\n\r\n       assert(sp);\r\n       assert(bc->forvar);\r\n\r\n      forvarlen = strlen(bc->forvar);\r\n      while (*sp)\r\n      {\r\n        if (memcmp(sp, bc->forvar, forvarlen) == 0)\r\n          dp = stpcpy(stpcpy(dp, fv1), fv), sp += forvarlen;\r\n        else\r\n          *dp++ = *sp++;        /* Else just copy */\r\n      }\r\n\r\n      *dp = '\\0';\r\n\r\n      assert(dp - textline <= size);\r\n\r\n      *eflag = echo;\r\n\r\n      first = textline;\r\n      if(*first == '@') {\t/* don't echo this line */\r\n        first = ltrimcl(first + 1);\r\n        *eflag = 0;\r\n      }\r\n      break;\r\n    }\r\n\r\n    if (!bc->bfile)\r\n    {                           /* modifyable batchfiles */\r\n      if ((bc->bfile = dos_open(bc->bfnam, O_RDONLY)) == 0)\r\n      {\r\n        error_bfile_vanished(bc->bfnam);\r\n        exit_batch();\r\n        continue;\r\n      }\r\n      bc->bclose = 1;\r\n      if (bc->brewind)\r\n      {\r\n        bc->brewind = 0;        /* fopen() position at start of file */\r\n        bc->blinecnt = 0;\r\n        bc->bpos = 0;\t\t\r\n      }\r\n      else if (lseek(bc->bfile, bc->bpos, SEEK_SET) == -1)\r\n      {                         /* end of file reached */\r\n        /* so says MS COMMAND */\r\n        exit_batch();\r\n        continue;\r\n      }\r\n    }\r\n    else if(bc->brewind) {\r\n    \tlseek(bc->bfile, 0, SEEK_SET);\r\n    \tbc->brewind = 0;\r\n    \tbc->blinecnt = 0;\r\n    \tbc->bpos = 0;\t\t\r\n    }\r\n\r\n    assert(ip != 0);\r\n    ++bc->blinecnt;\r\n    if (chkCBreak(BREAK_BATCHFILE)      /* User break */\r\n        || getbline(bc->bfile, textline, len, size-1) == 0  /* End of file.... */\r\n        || (ip = textlineEnd(textline, size)) == 0)  /* line too long */\r\n    {\r\n      if (!ip)\r\n        error_long_batchline(bc->bfnam, bc->blinecnt);\r\n\r\n      exit_batch();\r\n\r\n      continue;\r\n    }\r\n\r\n    /* Strip leading spaces and \\n chars */\r\n/*    rtrimsp(textline);\tmust not remove trailing spaces */\r\n\tfirst = memchr(textline, '\\n', size);\r\n\tlen = first + 1 - textline;\r\n\tbc->bpos += len;\r\n\twhile(--first >= textline && ( *first == '\\n' || *first == '\\r' ) );\r\n\tfirst[1] = '\\0';\r\n    first = ltrimcl(textline);\r\n\r\n    assert(first);\r\n\r\n    if(*first == '@') {\t/* don't echo this line */\r\n\t\tfirst = ltrimcl(first + 1);\r\n\t\t*eflag = 0;\r\n    } else\r\n\t\t*eflag = echo;\r\n\r\n    /* ignore empty lines */\r\n    if(!*first)\r\n      continue;\r\n\r\n    if(*first == ':') {\r\n      /* if a label is searched for test if we reached it */\r\n      if(bc->blabel) {\r\n        /* label: the 1st word immediately following the colon ':' */\r\n\t\tfor(ip = ++first; isgraph(*ip); ++ip)\r\n\t\t\t;\r\n        *ip = '\\0';\r\n        if (stricmp(first, bc->blabel) == 0)\r\n        {                       /* OK found */\r\n          free(bc->blabel);\r\n          bc->blabel = 0;\r\n        }\r\n      }\r\n      continue;                 /* ignore label */\r\n    }\r\n\r\n    if(bc->blabel)\r\n      continue;                 /* we search for a label! */\r\n\r\n    /* Got a line to execute */\r\n    break;\r\n  }\r\n\r\n  if (bc && bc->bclose)\r\n  {                             /* modifyable batchfiles - ska */\r\n    dos_close(bc->bfile);\r\n    bc->bfile = 0;\r\n    bc->bclose = 0;\r\n  }\r\n\r\n  return first;\r\n}\r\n"
  },
  {
    "path": "shell/cb_catch.asm",
    "content": ";   $Id$\r\n\r\n;\t^Break signal catcher and initialization function.\r\n;\tBases on CB_CATCH.ASM\r\n;\tIt is activated only, if FreeCOM is active.\r\n;\t--> FreeCOM polls the ^Break state actively, so the ^C press is\r\n;\t\trecorded, but ignored otherwise\r\n\r\n;\tThere are several possibility to communicate with FreeCOM, because\r\n;\tFreeCOM actively polls the ^Break status, this implementation\r\n;\toptimizes for the polling rather this handler.\r\n\r\n;   $Log$\r\n;   Revision 1.3  2004/02/01 13:52:18  skaus\r\n;   add/upd: CVS $id$ keywords to/of files\r\n;\r\n;   Revision 1.2  2002/04/02 18:09:31  skaus\r\n;   add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n;\r\n;   Revision 1.1  2001/04/12 00:09:06  skaus\r\n;   chg: New structure\r\n;   chg: If DEBUG enabled, no available commands are displayed on startup\r\n;   fix: PTCHSIZE also patches min extra size to force to have this amount\r\n;      of memory available on start\r\n;   bugfix: CALL doesn't reset options\r\n;   add: PTCHSIZE to patch heap size\r\n;   add: VSPAWN, /SWAP switch, .SWP resource handling\r\n;   bugfix: COMMAND.COM A:\\\r\n;   bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n;   add: command MEMORY\r\n;   bugfix: runExtension(): destroys command[-2]\r\n;   add: clean.bat\r\n;   add: localized CRITER strings\r\n;   chg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n;   \tvia STRINGS.LIB\r\n;   add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n;   add: fixstrs.c: prompts & symbolic keys\r\n;   add: fixstrs.c: backslash escape sequences\r\n;   add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n;   chg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n;   bugfix: IF is now using error system & STRINGS to report errors\r\n;   add: CALL: /N\r\n;\r\n;   Revision 1.1.1.1.4.2  2001/02/18 21:08:23  skaus\r\n;   add: command WHICH\r\n;   fix: BUILD.BAT and accompanying makefiles for TC++ v1.01\r\n;\r\n;   Revision 1.1.1.1.4.1  2001/02/18 17:59:36  skaus\r\n;   bugfix: KSSF: restore parentPSP on exit\r\n;   chg: Using STRINGS resource for all non-interactive messages\r\n;   chg: moving all assembly files to NASM\r\n;\r\n\r\n%include \"../include/model.inc\"\r\n%include \"../include/stuff.inc\"\r\n\r\n;segment _DATA\r\n;\tEXTERN _ctrlBreak\r\n\r\nsegment _TEXT\r\n;\tGLOBAL _initCBreak\r\n\tcglobal cbreak_handler\r\n\tcglobal CBreakCounter\r\n\r\n;_initCBreak:\r\n;\t;; At this point DS is the segment of _ctrlBreak\r\n;\tmov WORD [CS:?freecomSegment], ds\r\n;\tret\r\n\r\n;?freecomSegment DW 0\r\nCBreakCounter DW 0\r\n\r\ncbreak_handler:\r\n%ifdef DEBUG\r\n\t\tdec BYTE [CS:strEnd]\r\n\t\tjz noRecurs\r\n\t\tinc BYTE [CS:strEnd]\r\n\t\tjmp short recurs\r\n\r\nnoRecurs:\r\n\t\tpush ds, dx, ax, bp\r\n\t\tmov dx, strBeg\r\n\t\tmov ax, cs\r\n\t\tmov ds, ax\r\n\t\tmov ah, 9\r\n\t\tint 21h\r\n\t\tinc BYTE [strEnd]\r\n\t\tpop ds, dx, ax, bp\r\n%endif\r\n\r\n\t\t;; ^Break of COMAMND --> just set the variable\r\n\t\tinc WORD [CS:CBreakCounter]\r\n\r\nrecurs:\r\n\t\tclc\t\t\t;; tell DOS to proceed\r\n\t\tretf 2\r\n\r\n%ifdef DEBUG\r\nstrBeg:\r\n\tdb 0dh, 0ah, 'COMMAND: ^Break detected.  ', 0dh, 0ah, 0dh, 0ah, '$'\r\nstrEnd db 1\r\n%endif\r\n\r\n"
  },
  {
    "path": "shell/cmdtable.c",
    "content": "/* $Id$\r\n *  CMDTABLE.C - table of internal commands.\r\n *\r\n *  Comments:\r\n *\r\n * 16 Jul 1998 (Hans B Pufal)\r\n *   started.\r\n *   New file to keep the internal command table. I plan on\r\n *   getting rid of the table real soon now and replacing it\r\n *   with a dynamic mechnism.\r\n *\r\n *\r\n * 27 Jul 1998  John P. Price\r\n * - added config.h include\r\n *\r\n * 12-Aug-1998 ska\r\n * - enabled the reference to the CTTY dummy\r\n *\r\n * 2000/01/15 ska\r\n * - CTTY is dummy no longer\r\n *\r\n * 2000/06/22 ska\r\n *\tadd: DIRS/PUSHD/POPD patch D. Lucas Parker\r\n *\tadd: CDD\r\n *\r\n * 2000/12/10 ska\r\n *\tchg: Uppercased command names (support for Installable Commands)\r\n *\r\n * 2001/02/16 ska\r\n * add: command WHICH\r\n */\r\n\r\n#include <stdlib.h>\r\n\r\n#include \"../config.h\"\r\n#include \"../include/command.h\"\r\n#include \"../strings.h\"\r\n\r\n\r\n/* a list of all the internal commands, associating their command names */\r\n/* to the functions to process them                                     */\r\n\r\n/* Lines marked\r\n\r\n * $$ are external commands\r\n * !! internal commands which are not yet implemented\r\n * ** special FREEDOS specific implementation\r\n */\r\n\r\nstruct CMD internalCommands[] =\r\n{\r\n#ifdef FEATURE_ALIASES\r\n        {\"ALIAS\", 0, cmd_alias, TEXT_CMDHELP_ALIAS},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_BEEP\r\n        {\"BEEP\", 0, cmd_beep, TEXT_CMDHELP_BEEP},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_BREAK\r\n        {\"BREAK\", CMD_NO_ERRORLEVEL, cmd_break, TEXT_CMDHELP_BREAK},\r\n#endif\r\n\r\n        {\"CALL\", CMD_SPECIAL_DIR | CMD_BATCHONLY, cmd_call, TEXT_CMDHELP_CALL},\r\n\r\n#ifdef INCLUDE_CMD_CHDIR\r\n  {\"CD\", CMD_SPECIAL_DIR, cmd_chdir, TEXT_CMDHELP_CD},\r\n  {\"CHDIR\", CMD_SPECIAL_DIR, cmd_chdir, TEXT_CMDHELP_CD},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_CDD\r\n\t{\"CDD\", CMD_SPECIAL_DIR, cmd_cdd, TEXT_CMDHELP_CDD},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_CHCP\r\n    { \"CHCP\",     0,             cmd_chcp, TEXT_CMDHELP_CHCP},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_CLS\r\n  {\"CLS\", CMD_NO_ERRORLEVEL, cmd_cls, TEXT_CMDHELP_CLS},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_COPY\r\n        { \"COPY\", CMD_SPECIAL_DIR,      cmd_copy, TEXT_CMDHELP_COPY },\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_CTTY\r\n        { \"CTTY\",     0,             cmd_ctty      , TEXT_CMDHELP_CTTY},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_DATE\r\n  {\"DATE\", CMD_NO_ERRORLEVEL, cmd_date, TEXT_CMDHELP_DATE},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_DEL\r\n  {\"DEL\", CMD_SPECIAL_DIR, cmd_del, TEXT_CMDHELP_DEL},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_DIR\r\n  {\"DIR\", CMD_SPECIAL_DIR, cmd_dir, TEXT_CMDHELP_DIR},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_DIRS\r\n  {\"DIRS\", 0, cmd_dirs, TEXT_CMDHELP_DIRS},\r\n#endif\r\n\r\n#ifdef FEATURE_HISTORY\r\n  {\"DOSKEY\", CMD_NO_ERRORLEVEL, cmd_doskey, TEXT_CMDHELP_DOSKEY},\r\n#endif\r\n\r\n  {\"ECHO\", CMD_SPECIAL_ALL | CMD_NO_ERRORLEVEL, cmd_echo, TEXT_CMDHELP_ECHO},\r\n\r\n#ifdef INCLUDE_CMD_DEL\r\n  {\"ERASE\", CMD_SPECIAL_DIR, cmd_del, TEXT_CMDHELP_DEL},\r\n#endif\r\n\r\n  {\"EXIT\", 0, internal_exit, TEXT_CMDHELP_EXIT},\r\n#ifdef DEBUG\r\n  {\"EXIT!!\", 0, force_exit, TEXT_CMDHELP_EXIT},\r\n#endif\r\n\r\n  {\"FOR\", CMD_NO_ERRORLEVEL, cmd_for, TEXT_CMDHELP_FOR},\r\n\r\n  {\"GOTO\", CMD_BATCHONLY | CMD_NO_ERRORLEVEL, cmd_goto, TEXT_CMDHELP_GOTO},\r\n\r\n#ifdef FEATURE_HISTORY\r\n  {\"HISTORY\", 0, cmd_history, TEXT_CMDHELP_HISTORY},\r\n#endif\r\n\r\n  {\"IF\", CMD_NO_ERRORLEVEL, cmd_if, TEXT_CMDHELP_IF},\r\n\r\n#ifdef FEATURE_LONG_FILENAMES\r\n#ifdef INCLUDE_CMD_LFNFOR\r\n  {\"LFNFOR\", CMD_NO_ERRORLEVEL, cmd_lfnfor, TEXT_CMDHELP_LFNFOR},\r\n#endif\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_FAKELOADHIGH\r\n  {\"LH\", CMD_SPECIAL_DIR, cmd_call, TEXT_CMDHELP_CALL},\r\n  {\"LOADHIGH\", CMD_SPECIAL_DIR, cmd_call, TEXT_CMDHELP_CALL},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_LOADHIGH\r\n  {\"LH\", CMD_SPECIAL_DIR, cmd_loadhigh, TEXT_CMDHELP_LH},\r\n  {\"LOADHIGH\", CMD_SPECIAL_DIR, cmd_loadhigh, TEXT_CMDHELP_LH},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_LOADFIX\r\n  {\"LOADFIX\", CMD_SPECIAL_DIR, cmd_loadfix, TEXT_CMDHELP_LOADFIX},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_MEMORY\r\n  {\"MEMORY\", CMD_NO_ERRORLEVEL, cmd_memory, TEXT_CMDHELP_MEMORY},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_MKDIR\r\n  {\"MD\", CMD_SPECIAL_DIR, cmd_mkdir, TEXT_CMDHELP_MD},\r\n  {\"MKDIR\", CMD_SPECIAL_DIR, cmd_mkdir, TEXT_CMDHELP_MD},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_PATH\r\n  {\"PATH\", CMD_SPECIAL_ALL, cmd_path, TEXT_CMDHELP_PATH},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_PAUSE\r\n  {\"PAUSE\", CMD_NO_ERRORLEVEL, cmd_pause, TEXT_CMDHELP_PAUSE},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_PROMPT\r\n  {\"PROMPT\", 0, cmd_prompt, TEXT_CMDHELP_PROMPT},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_PUSHD\r\n  {\"PUSHD\", CMD_SPECIAL_DIR | CMD_NO_ERRORLEVEL, cmd_pushd, TEXT_CMDHELP_PUSHD},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_POPD\r\n  {\"POPD\", CMD_NO_ERRORLEVEL, cmd_popd, TEXT_CMDHELP_POPD},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_RMDIR\r\n  {\"RD\", CMD_SPECIAL_DIR | CMD_NO_ERRORLEVEL, cmd_rmdir, TEXT_CMDHELP_RD},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_REM\r\n  {\"REM\", CMD_NO_ERRORLEVEL, cmd_rem, TEXT_CMDHELP_REM},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_RENAME\r\n  {\"REN\", CMD_SPECIAL_DIR, cmd_rename, TEXT_CMDHELP_REN},\r\n  {\"RENAME\", CMD_SPECIAL_DIR, cmd_rename, TEXT_CMDHELP_REN},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_RMDIR\r\n  {\"RMDIR\", CMD_SPECIAL_DIR | CMD_NO_ERRORLEVEL, cmd_rmdir, TEXT_CMDHELP_RD},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_SET\r\n  {\"SET\", CMD_NO_ERRORLEVEL, cmd_set, TEXT_CMDHELP_SET},\r\n#endif\r\n\r\n  {\"SHIFT\", CMD_BATCHONLY | CMD_NO_ERRORLEVEL, cmd_shift, TEXT_CMDHELP_SHIFT},\r\n\r\n#ifdef INCLUDE_CMD_TIME\r\n  {\"TIME\", CMD_NO_ERRORLEVEL, cmd_time, TEXT_CMDHELP_TIME},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_REM\r\n  {\"TITLE\", CMD_NO_ERRORLEVEL, cmd_rem, TEXT_CMDHELP_REM},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_TRUENAME\r\n  {\"TRUENAME\", CMD_SPECIAL_DIR | CMD_NO_ERRORLEVEL, cmd_truename, TEXT_CMDHELP_TRUENAME},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_TYPE\r\n  {\"TYPE\", CMD_SPECIAL_DIR, cmd_type, TEXT_CMDHELP_TYPE},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_VER\r\n  {\"VER\", CMD_NO_ERRORLEVEL, cmd_ver, TEXT_CMDHELP_VER},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_VERIFY\r\n  {\"VERIFY\", 0, cmd_verify, TEXT_CMDHELP_VERIFY},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_VOL\r\n        {\"VOL\", 0, cmd_vol, TEXT_CMDHELP_VOL},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_QUESTION\r\n  {\"?\", CMD_NO_ERRORLEVEL, showcmds, TEXT_CMDHELP_QUESTION},\r\n#endif\r\n\r\n#ifdef DEBUG\r\n  {\"FDDEBUG\", CMD_NO_ERRORLEVEL, cmd_fddebug, TEXT_CMDHELP_FDDEBUG},\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_WHICH\r\n  {\"WHICH\", 0, cmd_which, TEXT_CMDHELP_WHICH},\r\n#endif\r\n\r\n\r\n        {0, 0, 0, 0}\r\n};\r\n\r\n/*    append,                             $$    */\r\n/*    assign,                             $$    */\r\n/*    attrib,                             $$    */\r\n/*    backup,                             $$    */\r\n/*    chkdsk,                             $$    */\r\n/*    command,                              $$    */\r\n/*    comp,                               $$    */\r\n/*    debug,                              $$    */\r\n/*    diskcomp,                           $$    */\r\n/*    diskcopy,                           $$    */\r\n/*    doskey,                             **    */\r\n/*    dosshell,                           $$    */\r\n/*    edit,                               $$    */\r\n/*    edlin,                              $$    */\r\n/*    emm386,                             $$    */\r\n/*    exe2bin,                              $$    */\r\n/*    expand,                             $$    */\r\n/*    fastopen,                           $$    */\r\n/*    fc,                                 $$    */\r\n/*    fdisk,                              $$    */\r\n/*    find,                               $$    */\r\n/*    format,                             $$    */\r\n/*    graftabl,                           $$    */\r\n/*    graphics,                           $$    */\r\n/*    help,                               $$    */\r\n/*    join,                               $$    */\r\n/*    keyb,                               $$    */\r\n/*    label,                              $$    */\r\n/*    mem,                                $$    */\r\n/*    mirror,                             $$    */\r\n/*    mode,                               $$    */\r\n/*    more,                               $$    */\r\n/*    nlsfunc,                              $$    */\r\n/*    print,                              $$    */\r\n/*    qbasic,                             $$    */\r\n/*    recover,                              $$    */\r\n/*    replace,                              $$    */\r\n/*    restore,                              $$    */\r\n/*    setver,                             $$    */\r\n/*    share,                              $$    */\r\n/*    sort,                               $$    */\r\n/*    subst,                              $$    */\r\n/*    sys,                                $$    */\r\n/*    tree,                                $$    */\r\n/*    undelete,                           $$    */\r\n/*    unformat,                           $$    */\r\n/*    xcopy,                              $$    */\r\n/*    pushd,                              **    */\r\n/*    popd,                               **    */\r\n"
  },
  {
    "path": "shell/command.c",
    "content": "/* $Id$\r\n * COMMAND.C - command-line interface.\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdio.h>\r\n#include <conio.h>\r\n#include <stdlib.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n#include <dos.h>\r\n#include <process.h>\r\n#include <time.h>\r\n#include <errno.h>\r\n#include <fcntl.h>\r\n#include <io.h>\r\n#include <sys/stat.h>\r\n\r\n#include <suppl.h>\r\n#include <dfn.h>\r\n#include \"../include/lfnfuncs.h\"\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/batch.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n#ifdef FEATURE_NLS\r\n#include \"../include/nls.h\"\r\n#endif\r\n#include \"../include/openf.h\"\r\n#include \"../include/kswap.h\"\r\n#include \"../include/cswap.h\"\r\n\r\n#include <environ.h>\r\n\r\n#ifdef FEATURE_INSTALLABLE_COMMANDS\r\n#include \"../include/mux_ae.h\"\r\n#endif\r\n#include \"../include/crossjmp.h\"\r\n\r\n#ifdef I_AM_TOM\r\n#ifndef DEBUG\r\nvoid suppl_testMemChain() {}\r\n#endif\r\n#endif\r\n\r\n  /* Shall the message block remain in memory when an external\r\n    program is executed */\r\nint persistentMSGs = 0;\r\nint interactive_command = 0;\t/* command directly entered by user */\r\nint exitflag = 0;               /* indicates EXIT was typed */\r\n#ifndef FEATURE_XMS_SWAP\r\n\t/* If XMS-Swap, this variable is located in resident portion */\r\nint canexit = 0;                /* indicates if this shell is exitable\r\n\t\t\t\t\t\t\t\t\tenable within initialize() */\r\n#endif\r\n/*int ctrlBreak = 0;*/              /* Ctrl-Break or Ctrl-C hit */\r\nint errorlevel = 0;             /* Errorlevel of last launched external prog */\r\nint forceLow = 0;               /* load resident copy into low memory */\r\nint oldinfd = -1;       /* original file descriptor #0 (stdin) */\r\nint oldoutfd = -1;        /* original file descriptor #1 (stdout) */\r\nint autofail = 0;\t\t\t\t/* Autofail <-> /F on command line */\r\nint inInit = 2;\r\nint isSwapFile = 0;\r\njmp_buf jmp_beginning;\r\n\r\n\t/* FALSE: no swap this time\r\n\t\tTRUE: swap this time\r\n\t\tERROR: no swap avilable at all\r\n\t*/\r\nint swapOnExec = FALSE;\r\nint defaultToSwap = FALSE;\r\n\t/* if != 0, pointer to static context\r\n\t\tNOT allowed to alter if swapOnExec == ERROR !!\r\n\t*/\r\nint swapContext = TRUE;\t\t\t\t\t/* may destroy external context */\r\n\r\n#ifdef FEATURE_LONG_FILENAMES\r\nunsigned char __supportlfns = 1;\r\n#endif\r\n\r\n/*\r\n\tstack checking:\r\n\r\n\tinitialize memory at the bottom of stack to some\r\n\tknown state (actually its own address)\r\n\r\n\tlater verify that at least some of this memory is still\r\n\tleft unchanged.\r\n*/\r\nstatic void **stack_bottom, **stack_unused;\r\nvoid stack_check_init(void)\r\n{\r\n  void *current_stack_location;\r\n  volatile void * volatile *barrier;\r\n\r\n  /* place a barrier at the bottom of the stack\r\n     code assumes 4 K right now */\r\n  stack_bottom = &current_stack_location - (4*1024 - 50) / sizeof(void *);\r\n  stack_unused = &current_stack_location;\r\n\r\n  for (barrier = (volatile void * volatile *)stack_bottom; (void **)barrier < stack_unused ; barrier++)\r\n    *barrier = barrier;\r\n}\r\nint stack_check(const char *commandline)\r\n{\r\n  void **barrier;\r\n\r\n  for (barrier = stack_bottom; barrier < stack_unused; barrier++)\r\n    if (*barrier != barrier)\r\n      break;\r\n\r\n  if (barrier < stack_unused) {\r\n    unsigned stack_left = (barrier - stack_bottom) * sizeof(void *);\r\n\r\n    if (stack_left < 0x300) {\r\n      fprintf(stderr, \"stack left %u after <%.60s>\\n\",stack_left,commandline);\r\n      if (stack_left < 0x100) {\r\n        fprintf(stderr, \"hit any key to continue\");\r\n        cgetchar();\r\n      }\r\n    }\r\n\r\n    stack_unused = barrier;\r\n  }\r\n  return 0;\r\n}\r\n\r\n#ifdef __GNUC__\r\nint dup(int fd)\r\n{\r\n  int ret;\r\n  asm volatile(\"int $0x21\" : \"=a\"(ret): \"Rah\"((char)0x45), \"b\"(fd));\r\n  return ret;\r\n}\r\n\r\nint dup2(int oldfd, int newfd)\r\n{\r\n  int scratch;\r\n  asm volatile(\"int $0x21\" : \"=a\" (scratch) :\r\n\t\t\t     \"Rah\"((char)0x46), \"b\"(oldfd), \"c\"(newfd));\r\n  return 0;\r\n}\r\n#endif\r\n\r\n#ifdef FEATURE_SWITCHAR\r\nchar switchar(void)\r\n{\r\n    USEREGS\r\n    _AX = 0x3700;\r\n\r\n    geninterrupt(0x21);\r\n\r\n    return(_AL == 0x00 ? _DL : '/');\r\n}\r\n#endif\r\n\r\nunsigned isdrive(unsigned char cc) {\r\n  if (isalpha(cc))\r\n    return 1;\r\n  if ((cc - 'A') < 32)\r\n    return 1;\r\n  return 0;\r\n}\r\n\r\nvoid execute(char *first, char *rest, int lh_lf)\r\n{\r\n  /*\r\n   * This command (in first) was not found in the command table\r\n   *\r\n   *\r\n   * first - first word on command line\r\n   * rest  - rest of command line\r\n   *\r\n   */\r\n\r\n  char *fullname;\r\n  char *extension;\r\n\r\n  assert(first);\r\n  assert(rest);\r\n\r\n  /* check for a drive change (not for loadhigh/loadfix) */\r\n  if (!lh_lf && (strcmp(first + 1, \":\") == 0) && isdrive(*first))\r\n  {\r\n  \tchangeDrive(*first);\r\n    return;\r\n  }\r\n\r\n  if(strchr(first,'?') || strchr(first,'*')) {\r\n    error_bad_command(first);\r\n    return;\r\n  }\r\n\r\n  /* search through %PATH% for the binary */\r\n  errno = 0;\r\n  fullname = find_which(first);\r\n\r\n  if(!fullname) {\r\n    error_bad_command(first);\r\n    return;\r\n  }\r\n\r\n  dprintf((\"[find_which(%s) returned %s]\\n\", first, fullname));\r\n\r\n  /* check if this is a .BAT file */\r\n  extension = strrchr(dfnfilename(fullname), '.');\r\n  assert(extension);\r\n\r\n  /* loadhigh/loadfix don't do batch files */\r\n  if(!lh_lf && ((stricmp(extension, \".bat\") == 0) || (stricmp(extension, \".cmd\") == 0))) {\r\n    dprintf((\"[BATCH: %s %s]\\n\", fullname, rest));\r\n    batch(fullname, first, rest);\r\n  } else if(stricmp(extension, \".exe\") == 0\r\n   || stricmp(extension, \".com\") == 0) {\r\n    /* exec the program */\r\n    int result;\r\n\r\n    dprintf((\"[EXEC: %s %s]\\n\", fullname, rest));\r\n\r\n\tif(strlen(rest) > MAX_EXTERNAL_COMMAND_SIZE) {\r\n        char *fullcommandline = malloc( strlen( first ) + strlen( rest ) + 3 );\r\n        if( fullcommandline == NULL ) return;\r\n        if ( strchr( first, ' ' ) ) {\r\n          sprintf( fullcommandline, \"\\\"%s\\\"%s\", first, rest );\r\n\r\n        }\r\n        else {\r\n          sprintf( fullcommandline, \"%s%s\", first, rest );\r\n        }\r\n        if( chgEnv( LONG_CMDLINE_ENV_NAME, fullcommandline ) != 0 ) {\r\n            free( fullcommandline );\r\n            return;\r\n        }\r\n        free( fullcommandline );\r\n\t}\r\n\r\n/* Prepare to call an external program */\r\n\r\n\t/* Unload the message block if not loaded persistently */\r\n\tif(!persistentMSGs)\r\n\t\tunloadMsgs();\r\n\r\n/* Execute the external program */\r\n#ifdef FEATURE_KERNEL_SWAP_SHELL\r\n    if(swapOnExec == TRUE\r\n\t && kswapMkStruc(fullname, rest)) {\r\n\t \t/* The Criter and ^Break handlers has been installed within\r\n\t \t\tthe PSP in kswapRegister() --> nothing to do here */\r\n\t \tdprintf((\"[EXEC: exiting to kernel swap support]\\n\"));\r\n\t \texit(123);\t\t/* Let the kernel swap support do the rest */\r\n\t}\r\n#ifdef DEBUG\r\n\tif(swapOnExec == TRUE)\r\n\t\tdprintf((\"KSWAP: failed to save context, proceed without swapping\\n\"));\r\n#endif\r\n#endif\r\n\t\t/* Install the dummy (always abort) handler */\r\n#ifdef FEATURE_XMS_SWAP\r\n    set_isrfct(0x23,\r\n            MK_FP(FP_SEG(lowlevel_cbreak_handler)-0x10,\r\n            FP_OFF(lowlevel_cbreak_handler)+0x100));\r\n    /*\r\n     * some tools expect this interrupt to  have the same segment as the\r\n     * command.com PSP, but FreeCOM is an exe...\r\n     */\r\n#else\r\n\tset_isrfct(0x23, kswapContext->cbreak_hdlr);\r\n#endif\r\n#ifdef FEATURE_XMS_SWAP\r\n    {\r\n    isr v;\r\n    get_isr(0x2e, v);\r\n    if( *(unsigned char far *)v == 0xCF && !canexit) /* IRET? */\r\n        set_isrfct( 0x2E,\r\n                 MK_FP(FP_SEG(lowlevel_int_2e_handler)-0x10,\r\n                 FP_OFF(lowlevel_int_2e_handler)+0x100));\r\n    }\r\n#endif\r\n    result = exec(fullname, rest, 0);\r\n\tset_isrfct(0x23, cbreak_handler);\t\t/* Install local CBreak handler */\r\n\t/* The external command might has killed the string area. */\r\n\tenv_nullStrings(0);\r\n\r\n    setErrorLevel(result);\r\n  } else { /* not bat, exe, or com file */\r\n    error_bad_command(first);\r\n  }\r\n\r\n  /* clear CMDLINE once return from program execution so not still in environment */\r\n  chgEnv( \"CMDLINE\", NULL );\r\n}\r\n\r\nstatic void docommand(char *line)\r\n{\r\n  /*\r\n   * look through the internal commands and determine whether or not this\r\n   * command is one of them.  If it is, call the command.  If not, call\r\n   * execute to run it as an external program.\r\n   *\r\n   * line - the command line of the program to run\r\n   */\r\n  char *cp;\r\n  char *rest;            /* pointer to the rest of the command line */\r\n  struct CMD *cmdptr = 0;\r\n\r\n#ifdef FEATURE_INSTALLABLE_COMMANDS\r\n\t/* Duplicate the command line into such buffer in order to\r\n\t\tallow Installable Commands to alter the command line.\r\n\t\t*line cannot be modified as pipes would be destroyed. */\r\n\t/* Place both buffers immediately following each other in\r\n\t\torder to make sure the contents of args can be appended\r\n\t\tto com without any buffer overflow checks.\r\n\t\t*2 -> one buffer for com and one for args\r\n\t\t+2 -> max length byte of com + cur length of com\r\n\t\t+3 -> max length byte of args + cur length of args + additional '\\0'\r\n\t*/\r\n\tchar *buf = malloc(2+2*BUFFER_SIZE_MUX_AE+2+1);\r\n#define args  (buf + 2)\r\n#define ARGS_BUFFER_SIZE (2 + BUFFER_SIZE_MUX_AE + 3)\r\n#define com (buf + ARGS_BUFFER_SIZE)\r\n#define BUFFER_SIZE BUFFER_SIZE_MUX_AE\r\n#else\r\n\tchar *com = malloc(MAX_INTERNAL_COMMAND_SIZE);\r\n#define args line\r\n#define buf com\r\n#define BUFFER_SIZE MAX_INTERNAL_COMMAND_SIZE\r\n#endif\r\n\r\n  assert(line);\r\n\r\n\tif(!buf) {\r\n\t  error_out_of_memory();\r\n\t  return;\r\n\t}\r\n\r\n  /* delete leading spaces, but keep trailing whitespaces */\r\n  line = ltrimcl(line);\r\n\r\n#ifdef FEATURE_INSTALLABLE_COMMANDS\r\n#if BUFFER_SIZE < MAX_INTERNAL_COMMAND_SIZE\r\n\tif(strlen(line) > BUFFER_SIZE) {\r\n\t\terror_line_too_long();\r\n\t\tgoto errRet;\r\n\t}\r\n#endif\r\n\tstrcpy(args, line);\r\n#endif\r\n\r\n  if (*(rest = args))                    /* Anything to do ? */\r\n  {\r\n    cp = com;\r\n\r\n  /* Copy over 1st word as upper case */\r\n  /* Internal commands are constructed out of non-delimiter\r\n  \tcharacters; ? had been parsed already */\r\n    while(*rest && is_fnchar(*rest) && !strchr(QUOTE_STR, *rest))\r\n      *cp++ = toupper(*rest++);\r\n\r\n    if(*rest && strchr(QUOTE_STR, *rest))\r\n      /* If the first word is quoted, it is no internal command */\r\n      cp = com;   /* invalidate it */\r\n    *cp = '\\0';                 /* Terminate first word */\r\n\r\n\tif(*com) {\r\n#ifdef FEATURE_INSTALLABLE_COMMANDS\r\n\t\tint tryMUXAE;\r\n\t\tfor(tryMUXAE = MUX_AE_MAX_REPEAT_CALL; tryMUXAE > 0; --tryMUXAE) {\r\n\t\t\t/* Check for installed COMMAND extension */\r\n\t\t\tswitch(runExtension(com, args)) {\r\n\t\t\t\tcase 1:\t\t/* OK, done */\r\n\t\t\t\t\tgoto errRet;\r\n\t\t\t\tcase 0:\t\t/* no extension */\r\n\t\t\t\t\ttryMUXAE = 0;\r\n\t\t\t}\r\n\t\t\t/* reset the argument pointer */\r\n\t\t\trest = &args[(unsigned char)com[-1]];\r\n\r\n\t\t\tdprintf( (\"[Command on return of Installable Commands check: >%s]\\n\", com) );\r\n#ifndef NDEBUG\r\n\t\t\tdprintf( (\"[Command line: >\") );\r\n\t\t\tfor(cp = args; cp < rest; ++cp)\r\n\t\t\t\tdprintf( (\"%c\", *cp) );\r\n\t\t\tdprintf( (\"|%s]\\n\", rest) );\r\n#endif\t/* !defined(NDEBUG) */\r\n\r\n#endif\r\n\r\n\t\t/* Scan internal command table */\r\n\t\tfor (cmdptr = internalCommands\r\n\t\t ; cmdptr->name && strcmp(com, cmdptr->name) != 0\r\n\t\t ; cmdptr++);\r\n\r\n    if(cmdptr && cmdptr->name) {    /* internal command found */\r\n\r\n#ifdef FEATURE_INSTALLABLE_COMMANDS\r\n\tcp = malloc(ARGS_BUFFER_SIZE);\r\n\tstrcpy(cp, rest);\r\n\trest = cp;\r\n\tfree(buf);\r\n\tbuf = rest;\r\n#else\r\n\tfree(buf);  buf = 0;\t/* no further useage of this buffer */\r\n#endif\r\n      switch(cmdptr->flags & (CMD_SPECIAL_ALL | CMD_SPECIAL_DIR)) {\r\n      case CMD_SPECIAL_ALL: /* pass everything into command */\r\n        break;\r\n      case CMD_SPECIAL_DIR: /* pass '\\\\' & '.' too */\r\n        if(*rest == '\\\\' || *rest == '.' || *rest == ':') break;\r\n      default:        /* pass '/', ignore ',', ';' & '=' */\r\n        if(!*rest || *rest == '/') break;\r\n        if(isargdelim(*rest)) {\r\n\t\t\trest = ltrimcl(rest);\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n        /* else syntax error */\r\n        error_syntax(0);\r\n        goto errRet;\r\n      }\r\n\r\n        currCmdHelpScreen = cmdptr->help_id;\r\n        /* JPP this will print help for any command */\r\n        if(memcmp(ltrimcl(rest), \"/?\", 2) == 0)  {\r\n          displayString(currCmdHelpScreen);\r\n        } else {\r\n          int internal_errorlevel;  /* error level for internal command */\r\n          dprintf((\"CMD '%s' : '%s'\\n\", cmdptr->name, rest));\r\n          internal_errorlevel = cmdptr->func(rest);\r\n\t\t  /* don't set errorlevel for some commands such as IF, GOTO, FOR, etc. */\r\n\t\t  if (!(cmdptr->flags & CMD_NO_ERRORLEVEL)) errorlevel = internal_errorlevel;\r\n        }\r\n        goto errRet;\r\n\t}\r\n#ifdef FEATURE_INSTALLABLE_COMMANDS\r\n\t  }\r\n#endif\r\n      }\r\n\r\n        free(buf); buf = 0;\t\t/* no longer used */\r\n        /* no internal command --> spawn an external one */\r\n        cp = unquote(line, rest = skip_word(line));\r\n        if(!cp) {\r\n          error_out_of_memory();\r\n          goto errRet;\r\n        }\r\n\t\texecute(cp, rest, 0);\r\n\t\tfree(cp);\r\n      }\r\n\r\n#undef com\r\n#undef args\r\n#undef BUFFER_SIZE\r\n#undef ARGS_BUFFER_SIZE\r\n\r\nerrRet:\r\n\t  free(buf);\r\n}\r\n\r\n/*\r\n * process the command line and execute the appropriate functions\r\n * full input/output redirection and piping are supported\r\n */\r\nvoid parsecommandline(char *s, int redirect)\r\n{\r\n  char *in = 0;\r\n  char *out = 0;\r\n  char *fname0 = 0;\r\n  char *fname1 = 0;\r\n  char *nextcmd;\r\n\r\n  int of_attrib = O_CREAT | O_TRUNC | O_WRONLY;\r\n  int num;\r\n\r\n  assert(s);\r\n\r\n  dprintf((\"[parsecommandline (%s)]\\n\", s));\r\n\r\n#ifdef FEATURE_ALIASES\r\n  aliasexpand(s, MAX_INTERNAL_COMMAND_SIZE);\r\n  dprintf((\"[alias expanded to (%s)]\\n\", s));\r\n#endif\r\n\r\n  if (tracemode)\r\n  {                             /* Question after the variables expansion\r\n                                   and make sure _all_ executed commands will\r\n                                   honor the trace mode */\r\n    /* \r\n     * Commands may be nested (\"if errorlevel 1 echo done>test\"). To\r\n     * prevent redirecting FreeCOM prompts to user file, temporarily\r\n     * revert redirection.\r\n     */\r\n    int redir_fdin = -1, redir_fdout = -1, answer;\r\n\r\n    if (oldinfd != -1) {\r\n        redir_fdin = dup (0);\r\n        dup2 (oldinfd,  0);\r\n    }\r\n    if (oldoutfd != -1) {\r\n        redir_fdout = dup (1);\r\n        dup2 (oldoutfd, 1);\r\n    }\r\n\r\n    printprompt();\r\n    outs(s);\r\n    /* If the user hits ^Break, it has the same effect as\r\n       usually: If he is in a batch file, he is asked if\r\n       to abort all the batchfiles or just the current one */\r\n    answer = userprompt(PROMPT_YES_NO);\r\n\r\n    if (oldinfd  != -1) {\r\n        dup2 (redir_fdin,  0);\r\n        dos_close (redir_fdin);\r\n    }\r\n    if (oldoutfd != -1) {\r\n        dup2 (redir_fdout, 1);\r\n        dos_close (redir_fdout);\r\n    }\r\n\r\n    if (answer != 1) return;              /* \"No\" or ^Break   */\r\n  }\r\n\r\n  if(!redirect) {\r\n  \tdocommand(s);\r\n  \treturn;\r\n  }\r\n\r\n  assert(oldinfd == -1);  /* if fails something is wrong; should NEVER */\r\n  assert(oldoutfd == -1); /* happen! -- 2000/01/13 ska*/\r\n\r\n  num = get_redirection(s, &in, &out, &of_attrib);\r\n  if (num < 0)                  /* error */\r\n    goto abort;\r\n\r\n  /* Set up the initial conditions ... */\r\n\r\n  if (in || (num > 1))          /* Need to preserve stdin */\r\n    oldinfd = dup(0);\r\n\r\n  if (in)                       /* redirect input from this file name */\r\n  {\r\n    dos_close(0);\r\n    if (0 != devopen(in, O_RDONLY))\r\n    {\r\n\t\terror_redirect_from_file(in);\r\n      goto abort;\r\n    }\r\n  }\r\n\r\n  if (out || (num > 1))         /* Need to preserve stdout */\r\n    oldoutfd = dup(1);\r\n\r\n  /* Now do all but the last pipe command */\r\n  while (num-- > 1)\r\n  {\r\n    dos_close(1);               /* Close current output file */\r\n    if ((fname0 = tmpfn()) == 0)\r\n      goto abort;\r\n    dos_creat(fname0, 0);\r\n\r\n    nextcmd = s + strlen(s) + 1;\r\n    docommand(s);\r\n\r\n    dos_close(1);\r\n    dup2(oldoutfd, 1);\r\n\r\n    dos_close(0);\r\n    killtmpfn(fname1);          /* fname1 can by NULL */\r\n    fname1 = fname0;\r\n    fname0 = 0;\r\n    dos_open(fname1, O_RDONLY);\r\n\r\n    s = nextcmd;\r\n  }\r\n\r\n  /* Now set up the end conditions... */\r\n\r\n  if (out)                      /* Final output to here */\r\n  {\r\n    dos_close(1);\r\n    if (1 != devopen(out, of_attrib))\r\n    {\r\n\t\terror_redirect_to_file(out);\r\n      goto abort;\r\n    }\r\n  }\r\n  else if (oldoutfd != -1)      /* Restore original stdout */\r\n  {\r\n    dos_close(1);\r\n    dup2(oldoutfd, 1);\r\n    dos_close(oldoutfd);\r\n    oldoutfd = -1;\r\n  }\r\n\r\n  docommand(s);                 /* process final command */\r\n\r\nabort:\r\n  if (oldinfd != -1)            /* Restore original STDIN */\r\n  {\r\n    dos_close(0);\r\n    dup2(oldinfd, 0);\r\n    dos_close(oldinfd);\r\n    oldinfd = -1;\r\n  }\r\n\r\n  if (oldoutfd != -1)           /* Restore original STDOUT */\r\n  {\r\n    dos_close(1);\r\n    dup2(oldoutfd, 1);\r\n    dos_close(oldoutfd);\r\n    oldoutfd = -1;\r\n  }\r\n\r\n  killtmpfn(fname1);\r\n  killtmpfn(fname0);\r\n\r\n  if (out)\r\n    free(out);\r\n\r\n  if (in)\r\n    free(in);\r\n}\r\n\r\n/* line -- min size: MAX_INTERNAL_COMMAND_SIZE + sizeof(errorlevel) * 8\r\n */\r\nint expandEnvVars(char *ip, char * const line)\r\n{\tchar *cp, *tp;\r\n\r\n\tassert(ip);\r\n\tassert(line);\r\n\r\n/* Return the maximum pointer into parsedline to add 'numbytes' bytes */\r\n#define parsedMax(numbytes)   \\\r\n  (line + MAX_INTERNAL_COMMAND_SIZE - 1 - (numbytes))\r\n\r\n\tcp = line;\r\n\r\n\twhile(*ip) {\r\n\t  /* Assume that at least one character is added, place the\r\n\t\ttest here to simplify the switch() statement */\r\n\t  if(cp >= parsedMax(1))\r\n\t\treturn 0;\r\n\r\n\t  if(*ip == '%') {\r\n\t\tswitch(*++ip) {\r\n\t\t  case '\\0':\r\n\t\t\t*cp++ = '%';\r\n\t\t\tbreak;\r\n\r\n\t\t  case '%':\r\n\t\t\t*cp++ = *ip++;\r\n\t\t\tbreak;\r\n\r\n\t\t  case '0':\r\n\t\t  case '1':\r\n\t\t  case '2':\r\n\t\t  case '3':\r\n\t\t  case '4':\r\n\t\t  case '5':\r\n\t\t  case '6':\r\n\t\t  case '7':\r\n\t\t  case '8':\r\n\t\t  case '9':\r\n\t\t\tif(0 != (tp = find_arg(*ip - '0'))) {\r\n\t\t\t  if(cp >= parsedMax(strlen(tp)))\r\n\t\t\t\treturn 0;\r\n\t\t\t  cp = stpcpy(cp, tp);\r\n\t\t\t  ip++;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t  *cp++ = '%';\r\n\t\t\t  /* Let the digit be copied in the cycle */\r\n\r\n\t\t\tbreak;\r\n\r\n#if 0\r\n\t\t  \t/* Caused conflicts with some batches,\r\n\t\t  \t\tsee %ERRORLEVEL% */\r\n\t\t  case '?':\r\n\t\t\t/* overflow check: parsedline has that many character\r\n\t\t\t  \"on reserve\" */\r\n\t\t\tcp += sprintf(cp, \"%u\", errorlevel);\r\n\t\t\tip++;\r\n\t\t\tbreak;\r\n#endif\r\n\r\n\t\t  default:\r\n#if 0\r\n\t\t\tif(forvar == toupper(*ip)) {    /* FOR hack */\r\n\t\t\t  *cp++ = '%';\t\t\t/* let the var be copied in next cycle */\r\n\t\t\t  break;\r\n\t\t\t}\r\n#endif\r\n\t\t\tif((tp = strchr(ip, '%')) != 0) {\r\n\t\t\t\tchar *evar;\r\n\t\t\t  *tp = '\\0';\r\n\r\n\t\t\t  if((evar = getEnv(ip)) != 0) {\r\n\t\t\t\tif(cp >= parsedMax(strlen(evar))) {\r\n                                        free(evar);\r\n                                        return 0;\r\n                                }\r\n\t\t\t\tcp = stpcpy(cp, evar);\r\n\t\t\t\tfree(evar);\r\n\t\t\t  } else if(matchtok(ip, \"ERRORLEVEL\")) {\r\n\t\t\t\t/* overflow check: parsedline has that many character\r\n\t\t\t\t  \"on reserve\" */\r\n\t\t\t\tcp += sprintf(cp, \"%u\", errorlevel);\r\n\t\t\t  } else if(matchtok(ip, \"_CWD\") || matchtok(ip, \"CD\")) {\r\n\t\t\t  \tif(0 == (evar = cwd(0))) {\r\n\t\t\t\t    return 0;\r\n\t\t\t  \t} else {\r\n\t\t\t\t\tif(cp >= parsedMax(strlen(evar))) {\r\n                                                free(evar);\r\n                                                return 0;\r\n                                        }\r\n\t\t\t\t\tcp = stpcpy(cp, evar);\r\n\t\t\t\t\tfree(evar);\r\n\t\t\t  \t}\r\n\t\t\t  }\r\n\r\n\t\t\t  ip = tp + 1;\r\n\t\t\t} else {\r\n#if 0\r\n\t\t\t  *cp++ = '%';  /* don't copy over % if no match, e.g. %somevar should print somevar not %somevar */\r\n#endif\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcontinue;\r\n\t  }\r\n\r\n#if 0\r\n\t  if(iscntrl(*ip)) {\r\n\t\t*cp++ = ' ';\r\n\t\t++ip;\r\n\t  } else \r\n#endif\r\n\t\t*cp++ = *ip++;\r\n\t}\r\n\r\n\tassert(cp);\r\n\tassert(cp < line + MAX_INTERNAL_COMMAND_SIZE);\r\n\r\n\t*cp = 0;\r\n\treturn 1;\r\n}\r\n\r\n/*\r\n * do the prompt/input/process loop\r\n *\r\n *  If xflg is true, the function will not go interactive, but returns.\r\n *  If commandline != NULL, this command is processed first.\r\n *\r\n *  Return: 0: on success\r\n */\r\nint process_input(int xflag, char *commandline)\r\n{\r\n    /* Dimensionate parsedline that no sprintf() can overflow the buffer\r\n     */\r\n  char parsedline[MAX_INTERNAL_COMMAND_SIZE + sizeof(errorlevel) * 8]\r\n    , *readline;\r\n#if 0\r\n/* Return the maximum pointer into parsedline to add 'numbytes' bytes */\r\n#define parsedMax(numbytes)   \\\r\n  (parsedline + MAX_INTERNAL_COMMAND_SIZE - 1 - (numbytes))\r\n  char *evar;\r\n  char *tp;\r\n  char *cp;\r\n#endif\r\n  char *ip;\r\n#if 0\r\n  char forvar;\r\n#endif\r\n  int echothisline;\r\n  int tracethisline;\r\n\r\n  do\r\n  {\r\n#ifdef FEATURE_LONG_FILENAMES\r\n    char *lfn = getEnv(\"LFN\");\r\n    if( lfn && toupper( *lfn ) == 'N' )\r\n         __supportlfns = 0;\r\n    else __supportlfns = 1;\r\n    free(lfn);\r\n#endif\r\n  \tinteractive_command = 0;\t\t/* not directly entered by user */\r\n  \techothisline = tracethisline = 0;\r\n    if(commandline) {\r\n      ip = commandline;\r\n      readline = commandline = 0;\r\n    } else {\r\n    if ((readline = malloc(MAX_INTERNAL_COMMAND_SIZE + 1)) == 0)\r\n    {\r\n      error_out_of_memory();\r\n      return 1;\r\n    }\r\n\r\n      if (0 == (ip = readbatchline(&echothisline, readline,\r\n                      MAX_INTERNAL_COMMAND_SIZE)))\r\n      { /* if no batch input then... */\r\n      int attr;\r\n      if (xflag   /* must not go interactive */\r\n       || ((attr = fdattr(0)) & 0x84) == 0x84  /* input is NUL device */\r\n       || (attr & 0xc0) == 0x80) /* no further input */\r\n      {\r\n        free(readline);\r\n        break;\r\n      }\r\n\r\n      /* Go Interactive */\r\n\t\tinteractive_command = 1;\t\t/* directly entered by user */\r\n\t\t/* Ensure the prompt starts at column #0 */\r\n\t\tif(echo && (mywherex()>1))\r\n\t\t\toutc('\\n');\r\n      readcommand(ip = readline, MAX_INTERNAL_COMMAND_SIZE);\r\n      tracemode = 0;          /* reset trace mode */\r\n      }\r\n    }\r\n\r\n    \t/* Make sure there is no left-over from last run */\r\n    currCmdHelpScreen = 0;\r\n\r\n    /* \r\n     * The question mark '?' has a double meaning:\r\n     *\tC:\\> ?\r\n     *\t\t==> Display short help\r\n     *\r\n     *\tC:\\> ? command arguments\r\n     *\t\t==> enable tracemode for just this line\r\n     */\r\n    if(*(ip = ltrimcl(ip)) == '?') {\r\n    \t ip = ltrimcl(ip + 1);\r\n    \t if(!*ip) {\t\t/* is short help command */\r\n#ifdef INCLUDE_CMD_QUESTION\r\n    \t \tshowcmds(ip);\r\n#endif\r\n\t\t\tfree(readline);\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t/* this-line-tracemode */\r\n\t\techothisline = 0;\r\n\t\ttracethisline = 1;\r\n\t}\r\n\r\n#if 0\r\n  /* The FOR hack\r\n    If the line matches /^\\s*for\\s+\\%[a-z]\\s/, the FOR hack\r\n    becomes active, because FOR requires the sequence \"%<ch>\"\r\n    in its input.\r\n    When the percent (%) expansion is made later on, any\r\n    sequence \"%<ch>\" is retained.\r\n  */\r\n  cp = ip;\r\n  if(matchtok(cp, \"for\") && *cp == '%' && isalpha(cp[1])\r\n   && isargdelim(cp[2]))   /* activate FOR hack */\r\n    forvar = toupper(cp[1]);\r\n  else forvar = 0;\r\n\r\n#else\r\n\tif(cmd_for_hackery(ip)) {\r\n\t\tfree(readline);\r\n\t\tcontinue;\r\n\t}\r\n#endif\r\n\r\n\t{\tint rc = expandEnvVars(ip, parsedline);\r\n\t\tfree(readline);\r\n\t\tif(!rc) {\r\n\t\t\terror_line_too_long();\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t}\r\n  \r\n    if (echothisline)           /* Echo batch file line */\r\n    {\r\n      printprompt();\r\n      puts(parsedline);\r\n    }\r\n\r\n    if (*parsedline)\r\n    {\r\n      if(swapOnExec != ERROR)\r\n      \tswapOnExec = defaultToSwap;\r\n      if(tracethisline)\r\n      \t++tracemode;\r\n      parsecommandline(parsedline, TRUE);\r\n      if(tracethisline)\r\n      \t--tracemode;\r\n    }\r\n\r\n    stack_check(parsedline);\r\n  }\r\n  while (!canexit || !exitflag);\r\n\r\n  return 0;\r\n}\r\n\r\nstatic void hangForever(void)\r\n{\r\n#ifdef FEATURE_AUTOREDIRECT_TO_CON\r\n  int i;\r\n\r\n  i = FEATURE_AUTOREDIRECT_TO_CON + 1;\r\n#endif\r\n    /* this might happen in certain \"emergency\"-level problems.\r\n      The \"cannot_exit\" state must be honored, though.\r\n      Also, it cannot be considered that the string area is\r\n      available -- 1999/07/06 ska*/\r\n  for(;;) {\r\n#ifdef FEATURE_AUTOREDIRECT_TO_CON\r\n    if(--i == 0)\r\n      cmd_ctty(\"CON\");\r\n#endif\r\n#if 0\r\n    puts(\r\n     \"\\r\\n\\r\\n\"\r\n     \"The shell is about to be terminated, though, this is\\r\\n\"\r\n     \"forbidden (usually by enabling the \\\"/P\\\" option).\\r\\n\"\r\n     \"You must reboot the system or, if this shell runs in\\r\\n\"\r\n     \"a multitasking environment, terminate this process/task manually.\\r\\n\"\r\n    );\r\n#else\r\n#undef \tTEXT_MSG_REBOOT_NOW\r\n\tputs(TEXT_MSG_REBOOT_NOW);\r\n#endif\r\n    beep();\r\n    delay(9000);  /* Keep the message on the screen for\r\n              at least 1s, in case FreeCom has some problems\r\n              with the keyboard */\r\n  }\r\n}\r\n\r\nint cdecl my2e_parsecommandline( char *s )\r\n{\r\n    s[ (unsigned char)s[ 0 ] ] = '\\0';\r\n/*    printf(\"_my2e_parsecommandline( %s )\\n\", s );*/\r\n    parsecommandline( &s[ 1 ], 1 );\r\n    return( errorlevel );\r\n}\r\n\r\nint main(void)\r\n{\r\n  /*\r\n   * * main function\r\n   */\r\n\r\n  stack_check_init();\r\n\r\n  if(setjmp(jmp_beginning) == 0 && initialize() == E_None)\r\n    process_input(0, 0);\r\n\r\n  if(!canexit)\r\n    hangForever();\r\n\r\n#ifdef FEATURE_KERNEL_SWAP_SHELL\r\n\tkswapDeRegister(kswapContext);\r\n#endif\r\n\r\n  return errorlevel;\r\n}\r\n"
  },
  {
    "path": "shell/command.ld",
    "content": "/* value for text segment (like _TEXT for OMF), same calculation\r\n   as in main linker script\r\n */\r\n_TEXTSEG = LOADADDR (.text) / 16 - __msdos_mz_hdr_paras -\r\n           ADDR (.text) / 16 + 0x10000;\r\n"
  },
  {
    "path": "shell/command.m1",
    "content": ".AUTODEPEND\r\n\r\nCFG_DEPENDENCIES = makefile.mak ..\\strings.h\r\n\r\n!include \"..\\config.mak\"\r\n\r\nall: $(CFG) command.exe\r\n\r\n"
  },
  {
    "path": "shell/command.m2",
    "content": "command\r\n\t\t# no map file\r\n$(SUPPL_LIB_PATH)\\suppl_s.lib +\r\n..\\cmd\\cmds.lib +\r\n..\\lib\\freecom.lib +\r\n..\\strings\\strings.lib +\r\n$(LIBPATH)\\cs.lib\r\n|\r\n"
  },
  {
    "path": "shell/cswap.asm",
    "content": "; $Id$\r\n; File:\r\n;                          cswap.asm\r\n; Description:\r\n;                       command.com swapping\r\n;\r\n;                    Copyright (c) 2001 tom ehlert\r\n;                       All Rights Reserved\r\n;\r\n; This file is part of DOS-C.\r\n;\r\n; DOS-C is free software; you can redistribute it and/or\r\n; modify it under the terms of the GNU General Public License\r\n; as published by the Free Software Foundation; either version\r\n; 2, or (at your option) any later version.\r\n;\r\n; DOS-C is distributed in the hope that it will be useful, but\r\n; WITHOUT ANY WARRANTY; without even the implied warranty of\r\n; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See\r\n; the GNU General Public License for more details.\r\n;\r\n; You should have received a copy of the GNU General Public\r\n; License along with DOS-C; see the file COPYING.  If not,\r\n; write to the Free Software Foundation, 675 Mass Ave,\r\n; Cambridge, MA 02139, USA.\r\n;\r\n;\r\n\r\n%include \"model.inc\"\r\n%include \"stuff.inc\"\r\n\r\nsegment _BSS \t\t\t; transient data (in DS)\r\n\r\n \tcglobal SwapResidentSize\r\nSwapResidentSize  resw 1\r\n\r\n\tcglobal XMSsave\r\nXMSsave\tresw 8\r\n%define currentSegmOfFreeCOMsave\tXMSsave+8\r\n\r\nexecSS resw 1\r\nexecSP resw 1\r\n\r\nsegment _DATA\r\n\r\nresize_free db 4ah\r\n\r\nsegment _TEXT\r\n\r\n%ifidn __OUTPUT_FORMAT__,elf ; GCC/ELF: no seg so use linker script symbol\r\nextern _TEXTSEG\r\n%else\r\n%define _TEXTSEG _TEXT\r\n%endif\r\n\r\n\tcglobal dosFCB1,dosFCB2\r\ndosFCB1 times 37 db 0\r\ndosFCB2 times 37 db 0\r\n\r\n;;\tglobal _dosCMDTAIL, _dosCMDNAME\t\tuse command line from within PSP\r\n\tcglobal dosCMDNAME\r\n;;_dosCMDTAIL  times 128 db 0\r\ndosCMDNAME times 128 db 0\r\n\t\ttimes 256\tdb 0\r\n    global localStack\r\nlocalStack:\r\n\r\n\tcglobal dosParamDosExec\r\ndosParamDosExec times 22\tdb 0\r\n\r\n\r\n\tcglobal XMSdriverAdress\r\nXMSdriverAdress dd 0\r\n%define callXMS\t\tcall far [XMSdriverAdress]\r\n\r\n \tcglobal SwapTransientSize\r\nSwapTransientSize  dw 0\r\n\r\n\tcglobal XMSrestore\r\nXMSrestore\ttimes 8 DW 0\r\n%define xms_handle\tXMSrestore+4\r\n%define currentSegmOfFreeCOM\tXMSrestore+14\r\n\r\n\tcglobal canexit\r\ncanexit\tDB 0\t\t; 1 -> can exit; _else_ --> cannot exit\r\nfiller  DB 0\r\n\r\n    cglobal mySS, mySP\r\nmySS DW 0\r\nmySP DW 0\r\n\r\nexecRetval dw 0\r\n\r\nreal_XMSexec:\r\n\t\tint 21h\t; shrink/free: first thing done from resident code\r\n\r\n\t\t; do exec\r\n\r\n\r\n;;\t\tmov ax, cs\r\n                   \t\t; ds:dx = ASCIZ program name\r\n;;\t\tmov ds, ax\r\n\t\tmov  dx,dosCMDNAME\r\n\t\t       \r\n                        ; es:bx = parameter block\r\n\t\tmov es, cx\r\n\t\tmov bx, dosParamDosExec\r\n\r\n\r\n\t\t\t\t\t\t; our temporary stack\r\n;;        mov ss, ax\r\n;;        mov  sp,localStack\r\n\r\n\r\n\t\tmov ax,04b00h\t\t; load & execute\r\n\t\tint 21h\r\n\r\n\t\tjc  exec_error\r\n\t\txor ax,ax\r\n\r\n\r\nexec_error:\r\n\t\tcld\t\t\t\t\t; don't rely on that\r\n\r\n\t; reload into memory\r\n\r\n        mov cx, cs\r\n        mov ss, cx\r\n        mov  sp,localStack-6\t; location on stack of return cs:ip and ds\r\n\r\n\t\t; restore:\r\n\r\n        mov ds, cx\r\n\t\tmov [execRetval],ax\r\n\t\t\t\t\t\t\t; we need some memory\r\n\r\n\t\t;; First ensure that FreeCOM is reloaded in low memory\r\n\t\t;; so that LOADHIGH would come into problems\r\n;;ska\t\tmov ax, 5800h\t\t; Get current allocation strategy\r\n;;ska\t\tint 21h\r\n;;ska\t\tmov dx, ax\r\n\r\n;;ska\t\tmov ax, 5801h\t\t; Set current allocation strategy\r\n;;ska\t\tmov bx, 0\t\t\t; low memory / first fit\r\n;;ska\t\tint 21h\r\n\t\t; ignore any errors\r\n\r\n\t\tmov ah,48h\r\n\t\tmov bx,[SwapTransientSize]\r\n\t\tint 21h\r\n\r\n;;ska\t\tpushf\r\n\r\n\t\t; Restore Alloc Strat\r\n;;ska\t\tmov ax, 5801h\t\t; Set current allocation strategy\r\n;;ska\t\tmov bx, dx\r\n;;ska\t\tint 21h\r\n\r\n;;ska\t\tpopf\r\n\t\tjc DOS_trouble_while_swapping_in\r\n\r\n                                ; calculate relocation factor\r\n\r\n\t\tmov bx,ax\t\t\t\t; new execute address\r\n\t\tsub bx,[currentSegmOfFreeCOM]\t\t; new address - old address\r\n\t\tpush bx\t\t\t\t\t;\r\n\t\tmov  [currentSegmOfFreeCOM],ax\t; new prog address\r\n\r\n\t\t\t\t\t\t\t\t; restore everything to XMS\r\n\t\tmov ah,0bh\r\n\t\tmov si,XMSrestore\r\n\t\tcallXMS\r\n\r\n\t\tpop bx                  ; get relocation factor back\r\n\r\n\t\tcmp ax,1\r\n\t\tjnz XMS_trouble_while_swapping_in\r\n\r\n\t\tmov bp,sp\r\n\t\tadd [bp+2],bx\t\t; relocate return segment\r\n\r\n\t\tretf\t\t\t\t\t\t; done\r\n\r\nXMS_err \t\tdb 'XMS copy error$'\r\nDOS_err \t\tdb 'Memory allocation error$'\r\ncommon_error\tdb 0dh,0ah,0ah,'FreeCOM: XMSSwap-In: $'\r\n\r\nXMS_trouble_while_swapping_in:\r\n\tmov bx,XMS_err\r\n\tjmp short trouble_while_swapping_in\r\n\r\nDOS_trouble_while_swapping_in:\r\n\tmov bx,DOS_err\r\n\r\ntrouble_while_swapping_in:\r\n;\t\tpush cs\t\t\t\t\t\t\t; do some error message\r\n;\t\tpop  ds\r\n\t\tmov dx, common_error\r\n\t\tmov ah,09\r\n\t\tint 21h\r\n\r\n\t\tmov dx,bx\r\n\t\tmov ah,09\r\n\t\tint 21h\r\n\r\nterminate_myself:\r\n\t\tmov ax,04cffh\t\t\t\t\t; and die ...\r\n\t\tint 21h\r\n\r\n\t\t;; FALL THROUGH for elder FreeCOM kernels that simply ignore\r\n\t\t;; DOS-4C for shells\r\n\t\tcextern terminateFreeCOMHook\r\n\t\tjmp terminateFreeCOMHook\r\n\r\n\tglobal xms_kill\r\nxms_kill:\r\n\t; Kill the XMS memory block\r\n\tmov dx, [xms_handle]\r\n\tor dx, dx\r\n\tjz terminate_myself\t\t; no block to deallocate\r\n\tmov ah, 0ah\t\t\t\t; deallocate XMS memory block\r\n\tcallXMS\r\n\tret\r\n\r\n;\r\n; as I don't know how to set the old interrupt handler\r\n; I write my own\r\n; or we use the TURBO_C _restorezero() and use the\r\n; DOS default handler for that\r\n\r\n%if 0\r\nMsgZerodivide db 'integer zero divide$'\r\n\tglobal _ZeroDivideInterrupt\r\n_ZeroDivideInterrupt:\r\n\r\n\t\tpush cs\r\n\t\tpop ds\r\n\t\tmov dx,MsgZerodivide\r\n\t\tmov ah,09\r\n\t\tint 21h\r\n\r\n        mov ax,04c7fh       ; terminate with errorlevel 127\r\n        int 21h\r\n\t\tjmp _ZeroDivideInterrupt\r\n%endif\r\n\r\n\r\n;********************************************************************\r\n; *************   END OF RESIDENT AREA ******************************\r\n;********************************************************************\r\n\tcglobal SWAPresidentEnd\r\nSWAPresidentEnd:\r\n\r\n%if 0\r\n;\r\n; normal EXEC\r\n;\r\n\r\n\t\tglobal _DosEXEC\r\n_DosEXEC:\r\n\t\t\t\t\t\t; save ALL registers needed later\r\n\t\tpush si\r\n\t\tpush di\r\n\t\tpush bp\r\n\t\tpush ds\r\n\r\n\t\tpush cs                   \t\t; ds:dx = ASCIZ program name\r\n\t\tpop\t ds\r\n\r\n\t\tmov  dx,_dosCMDNAME\r\n\r\n\t\tmov [execSS],ss\r\n\t\tmov [execSP],sp\r\n\r\n\t\tpush cs\r\n\t\tpop  es\r\n\t\tmov bx, _dosParamDosExec\r\n\r\n\t\tmov ax,04b00h\r\n\t\tint 21h\r\n\r\n\t\tjc      exec_error2  ; if there was an error, the error code is in AX\r\n\r\n\t\txor ax,ax\r\n\r\nexec_error2:\r\n\r\n\t\tcld\t\t\t\t\t; don't rely on that\r\n\r\n\t\tmov ss,[cs:execSS]\r\n\t\tmov sp,[cs:execSP]\r\n\r\n\t\tpop ds\r\n\t\tpop bp\r\n\t\tpop di\r\n\t\tpop\tsi\r\n\t\tretf\r\n%endif\r\n\r\n;; Added here to make it more easier for the C-part to make a XMS\r\n;; request, because the code:\r\n;;\t\t(*XMSdriverAdress)();\r\n;; is translated into something like:\r\n;;\t\tmov ax, _CODE\t\t;; immediate value\r\n;;\t\tmov es, ax\r\n;;\t\tcall DWORD PTR es:[_XMSdriverAdress]\r\n;; detroying AX already holding the API function number\r\n\r\n;; To be called with _far_!!\r\n\tcglobal XMSrequest\r\n\t;; Note: Because [CS:driverAdress] == [residentCS:driverAdress]\r\n\t;; we need not use a similiar approach as with XMSexec\r\nXMSrequest:\r\n\t\tjmp far [cs:XMSdriverAdress]\r\n\r\n;; Added here to make it more easier for the C-part to call functions\r\n;; located in the resident part, because:\r\n;;\t\t_XMSexec();\r\n;; is translated into something like:\r\n;;\t\tnop\r\n;;\t\tpush cs\t\t\t<-> WRONG!!\r\n;;\t\tcall _XMSexec\r\n;; now also used to contain code that does not need to be resident.\r\n\r\n;;TODO: DS ought to be equal to SS, DS could be reconstructed from\r\n;;\tSS at the end of the XMSexec function\r\n\t\tcglobal\tXMSexec\r\nXMSexec:\r\n\t\t\t\t\t\t; save ALL registers needed later\r\n%ifidn __OUTPUT_FORMAT__,elf \t; GCC: need to preserve es\r\n\t\tpush es\r\n%endif\r\n\t\tpush si\r\n\t\tpush di\r\n\t\tpush bp\r\n\r\n\t\tmov [execSS],ss\r\n\t\tmov [execSP],sp\r\n\r\n\t\t\t\t\t\t; save everything to XMS\r\n\t\tmov ah,0bh\r\n\t\tmov si,XMSsave\r\n\t\tcall far [cs:XMSdriverAdress]\r\n\r\n;;TODO: test of result\r\n\r\n\t\tmov es,[currentSegmOfFreeCOMsave]\r\n\t\t\t\t\t\t; first time: shrink current psp\r\n\t\tmov ah,[resize_free]\r\n\t\tmov bx,[SwapResidentSize]\r\n\r\n\t\tmov dx, ds\r\n\t\tmov cx, _TEXTSEG\r\nreloc1 equ $-2\r\n\t\tmov ds, cx\r\n\r\n        mov [mySS],ss  ; 2E\r\n        mov [mySP],sp  ; 2E\r\n\r\n\t\tmov ss, cx\t\t; this stack is definitely large enough AND present\r\n        mov  sp,localStack\r\n\r\n\t\tpush dx\t\t\t; save DS of transient portion\r\n\t\tcall _TEXTSEG:real_XMSexec\r\nreloc2 equ $-2\r\n\r\nret_from_resident:\r\n\t\tmov ax,[execRetval]\r\n\r\n                                    ; relocate segment registers\r\n\t\tadd [bp+4],bx\t\t\t\t; ds\r\n\t\tpop ds\r\n\r\n\t\tmov byte [resize_free],49h ; change to \"free\" for next times\r\n\r\n\t\tadd [currentSegmOfFreeCOMsave],bx\r\n\t\tmov cx,[execSS]\r\n\t\tadd cx,bx\r\n\t\tmov ss,cx\r\n\t\tmov sp,[execSP]\r\n\r\n%ifidn MODEL, m                     ; in medium & large need to fixup return segment\r\n\t\tmov bp, sp\r\n\t\tadd [bp+8],bx\r\n%endif\r\n\t\tpop bp\r\n\t\tpop di\r\n\t\tpop\tsi\r\n%ifidn __OUTPUT_FORMAT__,elf \t; GCC: need to preserve es\r\n\t\tpop es\r\n%endif\r\n\t\tret\t\t\t\t\t\t\t; done (really), retn/retf based on memory model, see model.inc\r\n\r\n%ifidn __OUTPUT_FORMAT__,elf\r\n; NASM does not support segment relocations so add them\r\n; manually\r\nsegment .msdos_mz_reloc\r\n\t\tdw reloc1, _TEXTSEG\r\n\t\tdw reloc2, _TEXTSEG\r\n%endif\r\n"
  },
  {
    "path": "shell/cswapc.c",
    "content": "/* $Id$\r\n File:\r\n                          cswapc.c\r\n Description:\r\n                       command.com swapping\r\n\r\n                    Copyright (c) 2001 tom ehlert\r\n                       All Rights Reserved\r\n\r\n\r\n more description:\r\n \tthis allows COMMAND.COM swapping to XMS memory, completely\r\n \tignoring all poor XT's ;-) (AT's would be handled if HIMEM\r\n \twould handle them)\r\n\r\n\tcommand.com is split into 2 parts - the resident part, located\r\n\tint CSWAP.ASM, which should be located at or near begin of command.com\r\n\tand the transient part.\r\n\r\n\tduring command execution, the transient portion is freed.\r\n\tafter execution, DOS is asked to give us some memory again,\r\n\r\n\tthe complete image is then copied there, and SS,CS,DS located to the\r\n\tnew position.\r\n\r\n\tthis works as long as the rest of command.com nowhere references\r\n\t_TEXT, _DATA like\r\n\t\tmov ax,_TEXT\r\n\t\tmov ax,DGROUP\r\n\r\n\tuseful to verify this is\r\n\r\n\tkernel2025c\\utils\\exeflat command.exe\r\n\r\n\twhich will show, where what segments are referenced\r\n\r\n\t============\r\n\r\n\tStructure of XMS memory block:\r\n\toffset \t\tuseage\r\n\t0\t\t\tStrings resource\r\n\tN*16\t\tFreeCOM\r\n\r\n\tN == number of paragraphes required to store the STRINGS\r\n\tresource into (XMSmsglen).\r\n\r\n;\r\n; This file is part of DOS-C.\r\n...\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <suppl.h>\r\n#include <mcb.h>\r\n#include <portable.h>\r\n#include \"../include/command.h\"\r\n\r\n#include \"../include/cswap.h\"\r\n\r\n/*#define XMSALLOCSIZE 128*/\t/* 128Kb available */\r\n\r\n#if 0\r\n\t#define MK_FP(seg,ofs)\t((void far *) \\\r\n\t\t\t\t   (((unsigned long)(seg) << 16) | (unsigned)(ofs)))\r\n\r\n\t#define FP_OFF(fp)\t((unsigned)(fp))\r\n\t#define FP_SEG(fp)\t((unsigned)((unsigned long)(fp) >> 16))\r\n#endif\r\n\r\n#define RM2PHYS_ADDR(segm,ofs)\t(SEG2PHYS_ADDR((segm)) | (ofs))\r\n#define SEG2PHYS_ADDR(segm)\t\t((unsigned long)(segm) << 16)\r\n\r\nstatic word XMSmsglen = 0;\r\nstatic enum {\r\n\tINIT_NO\r\n\t,INIT_FAILED\r\n\t,INIT_SUCCEEDED\r\n} initialized = INIT_NO;\r\n\r\nint XMSisactive(void)\r\n{\treturn initialized == INIT_SUCCEEDED;\r\n}\r\n\r\n#if 0\r\nvoid fmemcpy(void far *d1, void far *s1, unsigned len)\r\n{\r\n\tchar far *d=d1, far *s=s1;\r\n\r\n\tfor ( ; len ; --len)\r\n\t\t*d++ = *s++;\r\n}\r\n#endif\r\n\r\n#ifdef __GNUC__\r\n__attribute__((noinline))\r\n#endif\r\nstatic int XMScopy(\r\n        long length, ...\r\n/*      short shandle,\r\n        long soffset,\r\n        short dhandle,\r\n        long  doffset */\r\n        )\r\n{\r\n\tassert(XMSdriverAdress);\r\n\r\n/*\tasm push si;\r\n\tasm lea si,length\r\n\tasm mov ah,0bh;\t*/\r\n#if defined(__TURBOC__)\r\n\t_SI = (unsigned)&length;\r\n\t_AH = 0xb;\r\n\tXMSrequest();\r\n/*\tasm pop si; */\r\n\r\n\treturn _AX;\t\t/* shut up warning */\r\n#elif defined(__GNUC__)\r\n\treturn XMSrequest(0xb00, 0, &length);\r\n#else\r\n\treturn XMSdriverAdress(0xb00, 0, &length);\r\n#endif\r\n}\r\n\r\n\r\n/* #pragma warn -asc */\r\n\r\n/* cannot use inline assembly without external assembler in TC++1 */\r\nvoid XMSinit(void)\r\n{\r\n\tUSEREGS\r\n#if defined(__WATCOMC__)\r\n\tunsigned long res;\r\n\txmsfunc far *xmsaddr;\r\n#elif defined(__GNUC__)\r\n\tunsigned long res;\r\n\tvoid far *xmsaddr;\r\n#else\r\n\tunsigned (far *xmsaddr)(void);\r\n#endif\r\n\tunsigned xmshandle;\r\n\tunsigned msglen, segm;\r\n\tstruct MCB _seg *mcb;\r\n\tunsigned /*long*/ xms_block_size; \r\n\r\n\tif(initialized != INIT_NO)\t/* already checked --> no changed possible */\r\n\t\treturn;\r\n\tswapOnExec = ERROR;\t\t\t/* just in case */\r\n\tinitialized = INIT_FAILED;\r\n\r\n\t/* Fetch the size of the message segment */\r\n\tsegm = msgSegment();\r\n\tif(segm) {\r\n\t\tmcb = MK_SEG_PTR (struct MCB, SEG2MCB (segm));\r\n\t\tmsglen = mcb->mcb_size;\r\n\t} else {\r\n\t\tmsglen = 0;\t\t/* do not load messages into XMS?? */\r\n\t}\r\n\r\n/*   asm     mov ax, 4300h; */\r\n/*   asm     int 2fh; */                /*  XMS installation check */\r\n\t_AX = 0x4300;\r\n\tgeninterrupt(0x2f);\r\n\r\n\tif(_AL != 0x80)\t\t\t/* No XMS driver installed */\r\n\t\treturn;\r\n/*   asm     cmp al, 80h;\t\t*/\r\n/*   asm     jne not_detected;\t*/\r\n\r\n/*   asm     mov ax, 4310h; */          /*  XMS get driver address */\r\n/*   asm     int 2fh; */\r\n\t_AX = 0x4310;\r\n\tgeninterrupt(0x2f);\r\n\r\n\txmsaddr = MK_FP(_ES, _BX);\r\n/*   asm     mov word ptr xmsaddr, bx;\t*/\r\n/*   asm     mov word ptr xmsaddr+2, es;\t*/\r\n\tif(!xmsaddr)\t\treturn;\t\t/* sanity check */\r\n\r\n\tXMSdriverAdress = xmsaddr;\r\n\tSwapResidentSize =\r\n\t\t FP_SEG(&SWAPresidentEnd)\r\n\t\t + (FP_OFF(&SWAPresidentEnd) + 0x0f) / 16\r\n\t\t - _psp + 1;\r\n\r\n\tmcb = MK_SEG_PTR (struct MCB, SEG2MCB (_psp));\r\n\txms_block_size = SwapTransientSize = mcb->mcb_size;\r\n\r\n\txms_block_size += msglen;\t\t/* both messages and FreeCOM into\r\n\t\t\t\t\t\t\t\t\t\tthe XMS block */\r\n/*\txms_block_size *= 16; */\t\t\t/* the sizes are in paragraphes */\r\n/*\txms_block_size /= 1024; */\r\n\txms_block_size /= 1024 / 16;\t\t/* total size in KB */\r\n\r\n/*\tasm\tmov ah, 09\t*/\r\n/*\tasm mov dx, XMSALLOCSIZE; */\t\t/* will do for first try */\r\n\r\n#if defined(__WATCOMC__)\r\n\tres = xmsaddr(0x900, xms_block_size + 1, NULL);\r\n#elif defined(__GNUC__)\r\n\tres = XMSrequest(0x900, xms_block_size + 1, NULL);\r\n#else\r\n\t_DX = xms_block_size + 1;\r\n\t_AH = 9;\r\n\r\n\t(*xmsaddr)();\r\n#endif\r\n#if defined(__WATCOMC__) || defined(__GNUC__)\r\n\t_AX = res & 0xffff;\r\n\t_DX = res >> 16;\t\r\n#endif\r\n\r\n\tif(_AX) {\t\t\t/* Got the XMS block */\r\n/*\tasm or ax,ax\t\t\t*/\r\n/*\tasm jz not_detected\t\t\t*/\r\n\r\n/*\t\tasm mov xmshandle,dx\t*/\r\n\t\txmshandle = _DX;\r\n\r\n\t\tXMSsave.length = SwapTransientSize * 16l;\r\n/*\t\tXMSsave.shandle = 0;\t\t\tdefault value */\r\n/*\t\tXMSsave.soffset = (long)MK_FP(_psp,0); */\r\n\t\tXMSsave.soffset = SEG2PHYS_ADDR(_psp);\r\n\t\tXMSsave.dhandle = xmshandle;\r\n/*\t\tXMSsave.doffset = 0;\t\t\tdefault value */\r\n\t\tXMSsave.doffset = msglen * 16l;\t/* STRINGS resource preceeds the\r\n\t\t\t\t\t\t\t\t\t\t\tFreeCOM swap area */\r\n\r\n\t\t/* restore: same as above with d and s swapped */\r\n\t\tXMSrestore.length = SwapTransientSize * 16l;\r\n\t\tXMSrestore.doffset = SEG2PHYS_ADDR(_psp);\r\n\t\tXMSrestore.shandle = xmshandle;\r\n\t\tXMSrestore.soffset = msglen * 16l;\r\n\r\n\t\tswapOnExec = FALSE;\t\t\t\t/* to swap is allowed now */\r\n\t\tdefaultToSwap = TRUE;\t\t\t/* make it the default for XMSwap */\r\n\t\tinitialized = INIT_SUCCEEDED;\r\n\r\n\t\t/* Unregister the Division by zero handler installed by the\r\n\t\t\tC startup code */\r\n#if 0\r\n\t\t{\r\n\t\textern void interrupt far ZeroDivideInterrupt();\r\n\t\tset_isr(0,ZeroDivideInterrupt);\r\n        }\r\n#endif\r\n#ifdef __TURBOC__\r\n        {\r\n        extern void _restorezero(void);\r\n        _restorezero();\r\n        }\r\n#endif\r\n\r\n\t\tif(msglen\r\n\t\t\t/* Because the STRINGS resource never changes,\r\n\t\t\t\tit is copied statically into the XMS mem block */\r\n\t\t && XMScopy(\r\n\t\t\t\tmsglen * 16l,\r\n\t\t\t\t0,\t\t\t\t\t\t\t/* from DOS */\r\n\t\t\t\tSEG2PHYS_ADDR(segm),\t\t/* message segment */\r\n\t\t\t\tXMSsave.dhandle,\t\t\t/* our common XMS handle */\r\n\t\t\t\t0l  /* at beginning of the allocated blk */\r\n\t\t  )) {\r\n\t\t\tXMSmsglen = msglen;\r\n#ifdef DEBUG\r\n\t\t\tif(persistentMSGs)\r\n\t\t\t\tdbg_outsn(\"MEM: active XMS Swap superceeds persistent messages\");\r\n#endif\r\n\t\t\tpersistentMSGs = FALSE;\t/* when the messages are in XMS, there\r\n\t\t\t\t\t\t\t\t\t\tis no need to keep them in\r\n\t\t\t\t\t\t\t\t\t\tconvential memory */\r\n\t\t}\r\n\t}\r\n\r\n/*not_detected:\t\t\t*/\r\n/*\t;\t\t\t*/\r\n}\r\n\r\n\r\n\r\nvoid XMSexit(void)\r\n{\r\n/*\tunsigned (far *xmsaddr)(void) = XMSdriverAdress; */\r\n/*\tunsigned handle = XMSsave.dhandle; */\r\n\r\n\tif(initialized == INIT_SUCCEEDED) {\r\n#if 0\r\n\t\tasm     mov dx, XMSsave.dhandle;\r\n\t\tasm     mov ah, 0ah;   \t\t\t/* free XMS memory */\r\n#endif\r\n#if defined(__WATCOMC__)\r\n\t\tXMSdriverAdress(0xa00, XMSsave.dhandle, NULL);\r\n#elif defined(__GNUC__)\r\n\t\tXMSrequest(0xa00, XMSsave.dhandle, NULL);\r\n#else\r\n\t\t_DX = XMSsave.dhandle;\r\n\t\t_AH = 0xa;   \t\t\t/* free XMS memory */\r\n\t\tXMSrequest();\r\n#endif\r\n\t}\r\n\r\n}\r\n\r\n#if 0\r\n\t/* Joined with XMSinit() in order to allocate a block\r\n\t\tof memory large enough ska*/\r\nvoid InitSwapping(void)\r\n{\r\n\r\n\tif (initialized)\r\n\t\treturn;\r\n\r\n\tinitialized = 1;\r\n\r\n\t\tXMSinit();\r\n\r\n\t\tSwapResidentSize =\r\n\t\t\t\t  FP_SEG(&SWAPresidentEnd) +\r\n\t\t\t\t (FP_OFF(&SWAPresidentEnd) +0x0f) / 16 -\r\n\t\t\t\t _psp ;\r\n\r\n        SwapTransientSize = *(short far *)MK_FP(_psp-1,3);\r\n\r\n\t\tXMSsave.length = (unsigned long)SwapTransientSize * 16;\r\n/*\t\tXMSsave.shandle = 0;\t\t\t\t\tby init */\r\n\t\tXMSsave.soffset = (long)MK_FP(_psp,0);\r\n/*\t\tXMSsave.dhandle = XMShandle;\t\t\t\tabove\t*/\r\n/*\t\tXMSsave.doffset = 0;\t\t\t\t\tby init */\r\n\r\n\t\t/* printf(\"resident  bytes %lu\\n\",\t(long)SwapResidentSize*16);  */\r\n\t\t/* printf(\"transient bytes %lu\\n\",\t(long)SwapTransientSize*16); */\r\n}\r\n#endif\r\n\r\n\r\n#if 0\r\n\t/* Joined with XMSinit ska*/\r\nvoid XMSswapmessagesOut(void)\r\n{\r\n\r\n  InitSwapping();\r\n\r\n  if(msgSegm == 0)\r\n  \treturn;\r\n\r\n  if(XMSdriverAdress == 0) return;\r\n\r\n  XMSmsglen = *(word far *)MK_FP(msgSegm-1,3);\r\n\r\n  XMScopy(\r\n  \t\tXMSmsglen * 16l,\r\n  \t\t0,\t\t\t\t\t\t\t/* from DOS */\r\n  \t\t(long)MK_FP(msgSegm,0),\t\t/* message segment */\r\n\t\tXMSsave.dhandle,\t\t\t/* our common XMS handle */\r\n  \t\t(long)XMSALLOCSIZE*1024l - XMSmsglen  /* at end off allocated blk */\r\n  \t\t);\r\n  \r\n    freeBlk(msgSegm);\r\n    msgSegm = 0;\r\n}\r\n#endif\r\n\r\nword XMSswapmessagesIn(loadStatus *status)\r\n{\tword segm;\r\n\r\n\tassert(status);\r\n\r\n\t/* Strings in XMS at all? */\r\n\tif(!XMSmsglen)\treturn 0;\r\n\r\n\tassert(XMSdriverAdress);\r\n\r\n\t/* Allocate swap buffer in conventional memory\r\n\t\tmode: last fit, high first */\r\n\tsegm = DOSalloc(XMSmsglen, 0x82);\r\n\tif(!segm) {\r\n\t\t*status = STRINGS_OUT_OF_MEMORY;\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tif(XMScopy(\r\n\t   XMSmsglen * 16l\r\n\t  ,XMSsave.dhandle\t\t\t/* our common XMS handle */\r\n\t  ,0l  \t\t\t\t\t/* at beginning of allocated blk */\r\n\t  ,0\t\t\t\t\t/* to DOS */\r\n\t  ,SEG2PHYS_ADDR(segm)\t\t/* message segment */\r\n\t)) {\r\n\t\t*status = STRINGS_LOADED;\r\n\t\treturn segm;\r\n\t}\r\n\r\n\tDOSfree(segm);\r\n\treturn 0;\r\n}\r\n\r\n#if 0\r\n\r\nDoExec(char *command,char *cmdtail)\r\n{\r\n\tint len;\r\n\tshort retval;\r\n\r\n\t/* printf(\"executing %s - %s\\n\",command, cmdtail); */\r\n\r\n\tdosParamDosExec.envSeg = 0;\r\n\r\n\tdosParamDosExec.cmdtail = &dosCMDTAIL;\r\n\tdosParamDosExec.cmdtail = &dosCMDTAIL;\r\n\r\n\r\n\t_fmemcpy(dosCMDTAIL+1, cmdtail,128-1);\r\n\r\n\tlen = strlen(cmdtail);\r\n\tif (len >= 127) len = 127;\r\n\tdosCMDTAIL[0] = len;\r\n\tdosCMDTAIL[1+ len] = '\\r';\r\n\r\n\t_fmemcpy(dosCMDNAME, command,128);\r\n\r\n\tif(initialized == INIT_SUCCEEDED)\r\n\t\tretval = DosEXECSwap();\r\n\telse\r\n\t\tretval = DosEXEC();\r\n\r\n\treturn retval;\r\n}\r\n#endif\r\n\r\n\r\n#define FREECOM_NEED_EXIT\r\n#ifdef __BORLANDC__\r\n#if __BORLANDC__ >= 0x500\r\n#undef FREECOM_NEED_EXIT\r\n#endif\r\n#endif\r\n#ifdef __GNUC__\r\n#undef FREECOM_NEED_EXIT\r\n#endif\r\n\r\n#ifdef FREECOM_NEED_EXIT\r\n/* Using the original exit() function crashes in TC++ v1.01 */\r\n/* And it uses invalid segment relocations (for FreeCOM!) in OpenWatcom */ \r\nvoid exit(int status)\r\n{\r\n\tUSEREGS\r\n\textern void exitfct(void);\t/* from INIT.C */\r\n\r\n\texitfct();\t\t\t\t\t/* restore the old owner_psp */\r\n\r\n\t_AX = 0x4c00 | status;\r\n\tgeninterrupt(0x21);\r\n}\r\n#endif\r\n"
  },
  {
    "path": "shell/depend.mk",
    "content": "shell .SEQUENTIAL : utils err_fcts.h strings context lib cmd shell_dir\r\n\r\nshell_dir .SETDIR=shell :\r\n\t@echo Entering $(PWD)\r\n\t$(RUNMAKE) all\r\n\t@echo Leaving $(PWD)\r\n\r\nCLEAN_DEPENDENCIES += shell_clean\r\nshell_clean .SETDIR=shell :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) clean\r\n\t@echo Leaving  $(PWD)\r\n\r\nCLOBBER_DEPENDENCIES += shell_clobber\r\nshell_clobber .SETDIR=shell :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) clobber\r\n\t@echo Leaving  $(PWD)\r\n\r\nDIST_DEPENDENCIES += shell_dist\r\nshell_dist .SETDIR=shell :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) dist\r\n\t@echo Leaving  $(PWD)\r\n"
  },
  {
    "path": "shell/dummies.asm",
    "content": "; $Id$\r\n\r\n; Dummy drivers to be included into FreeCOM itself\r\n\r\n%include \"../include/model.inc\"\r\n%include \"../include/stuff.inc\"\r\n\r\nsegment _TEXT\r\n\tcglobal dummy_criter_handler\r\n\tcglobal end_dummy_criter_handler\r\ndummy_criter_handler:\r\n\tmov al, 3\t\t\t; always fail\r\n\tiret\r\nend_dummy_criter_handler:\r\n"
  },
  {
    "path": "shell/expalias.c",
    "content": "/* $Id$\r\n\r\n\tExpand aliases\r\n\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include <environ.h>\r\n#include <fmemory.h>\r\n#include <nls_f.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/context.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nvoid aliasexpand(char * const cmd, const int maxlen)\r\n{\tchar *hbuf;\t\t\t\t/* work buffer */\r\n\tchar *cp, *p;\r\n\tunsigned ofs, *expanded, *he;\r\n\tint i, numExpanded;\r\n\r\n\tassert(cmd);\r\n\tassert(strlen(cmd) < maxlen);\r\n\r\n\tif((hbuf = malloc(maxlen)) == 0) {\r\n\t\terror_out_of_memory();\r\n\t\treturn;\r\n\t}\r\n\tnumExpanded = 0;\r\n\texpanded = 0;\r\n\r\nredo:\t\t\t\t\t\t/* iteration to expand all aliases */\r\n\tcp = ltrimcl(cmd);\t\t/* skip leading whitespaces */\r\n\r\n\t/* Check if the user disabled alias expansion */\r\n\tif(*cp == '*') {\r\n\t\tmemmove(cmd, cp + 1, strlen(cp));\r\n\t\tgoto errRet;\r\n\t}\r\n\r\n\t/* Get the name of this command */\r\n\tfor(p = hbuf; is_fnchar(*cp) || *cp == '.';)\r\n\t\t*p++ = *cp++;\r\n\tif(p == hbuf || is_pathdelim(*cp) || is_quote(*cp))\r\n\t\t/* no name || part of path -> no alias */\r\n\t\tgoto errRet;\r\n\r\n\t*p = 0;\r\n\tStrFUpr(hbuf);\t\t\t/* all aliases are uppercased */\r\n\tif((ofs = env_findVar(ctxtAlias, hbuf)) == (unsigned)-1)\r\n\t\t/* not found -> no alias */\r\n\t\tgoto errRet;\r\n\r\n\t/* Prevent recursion by recording the offset of the found variable */\r\n\tfor(i = 0; i < numExpanded; ++i)\r\n\t\tif(expanded[i] == ofs)\t\t/* already used -> ignore */\r\n\t\t\tgoto errRet;\r\n\r\n\tif((he = realloc(expanded, ++numExpanded)) == 0) {\r\n\t\terror_out_of_memory();\r\n\t\tgoto errRet;\r\n\t}\r\n\texpanded = he;\r\n\texpanded[numExpanded - 1] = ofs;\r\n\r\n\t/************ Expand the command line \"cp\" with the alias at\r\n\t\t\t\t\t\tMK_FP(ctxtAlias, ofs)  ***********************/\r\n\tofs += strlen(hbuf) + 1;\t\t/* advance to value */\r\n\tif(_fstrlen(MK_FP(ctxtAlias, ofs)) < maxlen - strlen(cp)) {\r\n\t\t/* prepend alias value to remaining command line */\r\n\t\t_fstrcpy(TO_FP(hbuf), MK_FP(ctxtAlias, ofs));\r\n\t\tstrcat(hbuf, cp);\r\n\t\tassert(strlen(hbuf) < maxlen);\r\n\t\tstrcpy(cmd, hbuf);\r\n\t\tgoto redo;\t\t\t\t/* next expansion */\r\n\t}\r\n\r\n\terror_command_too_long();\r\n\r\nerrRet:\t\t\t\t\t\t\t/* return to caller */\r\n\tfree(expanded);\r\n\tfree(hbuf);\r\n}\r\n"
  },
  {
    "path": "shell/init.c",
    "content": "/* $Id$\r\n *  INIT.C - initialization code\r\n *\r\n *      This is more or less a complete rewrite based on the\r\n *      initialize() code of v0.74c, but also some changes of 0.75b.\r\n *\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <process.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"mcb.h\"\r\n#include \"environ.h\"\r\n#include \"dfn.h\"\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../include/context.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../include/module.h\"\r\n#include \"../include/keys.h\"\r\n#include \"../strings.h\"\r\n#include \"../include/kswap.h\"\r\n#include \"../include/cswap.h\"\r\n\r\n#define pspTermAddr *(void far* far*)MK_FP(_psp, 0xa)\r\n\r\n        /* Check for an argument; ch may be evaluated multiple times */\r\n#define isargsign(ch)           \\\r\n        ((ch) == ':' || (ch) == '=')\r\n\r\n#ifdef FEATURE_CALL_LOGGING\r\n#ifndef INCLUDE_CMD_FDDEBUG\r\nstatic char logFilename[] = LOG_FILE;\r\n#endif\r\n#endif\r\n\r\n#define oldPSP\torigPPID\r\nchar *ComPath;                   /* absolute filename of COMMAND shell */\r\n\r\n#if defined(__WATCOMC__)\r\nunsigned _heaplen = 0; /* NOT in BSS */\r\n#elif defined(DEBUG)\r\nextern unsigned _heaplen;\r\n#endif\r\n\r\n#ifndef FDDEBUG_INIT_VALUE\r\n#define FDDEBUG_INIT_VALUE 0\r\n#endif\r\n#ifdef DEBUG\r\nint fddebug = FDDEBUG_INIT_VALUE;    /* debug flag */\r\n#else\r\nstatic int fddebug = FDDEBUG_INIT_VALUE;\r\n#endif\r\n#ifdef DISP_EXITCODE\r\nint dispExitcode = 0;\r\n#endif\r\n\r\n/* Without resetting the owner PSP, the program is not removed\r\n   from memory */\r\nvoid exitfct(void)\r\n{\r\n\tunloadMsgs();        /* free the message strings segment */\r\n\tOwnerPSP = oldPSP;\r\n\tpspTermAddr = termAddr;\r\n#ifdef FEATURE_XMS_SWAP\r\n\tXMSexit();\r\n#endif\r\n}\r\n\r\n\r\nstatic unsigned int showhelp = 0, internalBufLen = 0, inputBufLen = 0,\r\n           spawnAndExit = E_None, newEnvSize = 0;\r\nstatic int skipAUTOEXEC = 0;\r\n/* static int newEnvSize = 0;          Min environment table size */\r\nstatic char *user_autoexec = 0;\r\n\r\noptScanFct(opt_init)\r\n{\r\n  int ec = E_None;\r\n\r\n  (void)arg;\r\n  switch(ch) {\r\n  case '?': showhelp = 1; return E_None;\r\n  case '!': return optScanBool(fddebug);\r\n  case 'Y': return optScanBool(tracemode);\r\n#ifdef DISP_EXITCODE\r\n  case 'Z': return optScanBool(dispExitcode);\r\n#endif\r\n  case 'F': return optScanBool(autofail);\r\n  case 'D': return optScanBool(skipAUTOEXEC);\r\n  case 'P':\r\n    if(optHasArg())     /* change autoexec.bat */\r\n      ec = optScanString(user_autoexec);\r\n    canexit = 0;\r\n    return ec;\r\n  case 'E': return optScanInteger(newEnvSize);\r\n  case 'L': return optScanInteger(internalBufLen);\r\n  case 'U': return optScanInteger(inputBufLen);\r\n  case 'C': /* spawn command, then exit */\r\n    spawnAndExit = E_Exit;\r\n  case 'K':   /* spawn command */\r\n    return E_NoOption;    /* don't tread as option */\r\n  case 0:   /* longname option */\r\n    switch(toupper(*optstr)) {\r\n    case 'C': /* spawn command, then exit */\r\n      spawnAndExit = E_Exit;\r\n    case 'K':   /* spawn command */\r\n      return E_NoOption;    /* don't tread as option */\r\n    case 'L':\r\n      if(optLong(\"LOW\"))\r\n        return optScanBool(forceLow);\r\n      break;\r\n    case 'M':\r\n      if(optLong(\"MSG\"))\r\n        return optScanBool(persistentMSGs);\r\n      break;\r\n    case 'S':\r\n    \tif(optLong(\"SWAP\"))\r\n    \t\treturn optScanBool(defaultToSwap);\r\n      break;\r\n    }\r\n    break;\r\n  }\r\n  optErr();\r\n  return E_Useage;\r\n}\r\n\r\n\r\n#ifndef INCLUDE_CMD_CTTY\r\n#define cmd_ctty(q) error_ctty_excluded()\r\n#endif\r\n\r\n/*\r\n * set up global initializations and process parameters\r\n *\r\n *      This function will:\r\n *      1) Set up the host environment (Create a new environment segment if\r\n *              necessary, alter the parent process ID, catch ^Break etc.)\r\n *      2) Create the COMSPEC variable\r\n *      3) Parse the command line parameters passed to COMMAND.COM\r\n *      4) Perform all command line actions (spawn \"/c\" commands, alter\r\n *              size of environment etc.)\r\n *      5) If shell is interactive, invoke a ver() command.\r\n *\r\n * If a serious problem occurs, e.g. FreeCom has received an invalid\r\n * command line from the system (e.g. 128 bytes), FreeCom assumes that the\r\n * user wants an interactive shell. So the command line is scanned until\r\n * the problem occurs, but the rest is ignored.\r\n */\r\n\r\nint initialize(void)\r\n{\r\n  int comPath;                /* path to COMMAND.COM (for COMSPEC/reload) */\r\n  int newTTY;                 /* what to change TTY to */\r\n  int showinfo;                 /* show initial info only if no command line options */\r\n\r\n  int ec;           /* error code */\r\n  unsigned offs;        /* offset into environment segment */\r\n\r\n  unsigned cmdlen;      /* length of command line */\r\n  char *cmdline;        /* command line duplicated into heap */\r\n  char *p, *h, *q;\r\n#ifdef FEATURE_CALL_LOGGING\r\n#ifndef INCLUDE_CMD_FDDEBUG\r\n  FILE *f;\r\n#endif\r\n#endif\r\n#ifdef DEBUG\r\n\tint orig_env;\r\n#endif\r\n\r\n\tdprintf( (\"[INIT: initialise()]\\n\") );\r\n\r\n/* Set up the host environment of COMMAND.COM */\r\n\r\n\t/* Give us shell privileges */\r\n\tmyPID = _psp;\r\n\ttermAddr = pspTermAddr;\r\n\tpspTermAddr = terminateFreeCOMHook;\r\n\toldPSP = OwnerPSP;\r\n\tatexit(exitfct);\r\n\tOwnerPSP = _psp;\r\n\r\n\t/* Install the dummy handlers for Criter and ^Break */\r\n/*\tinitCBreak(); */\r\n\tset_isrfct(0x23, cbreak_handler);\r\n#ifdef FEATURE_XMS_SWAP\r\n\t/* There is no special handler for FreeCOM currently\r\n\t\t--> activate the real one */\r\n\tset_isrfct(0x24, lowlevel_err_handler);\r\n\t{\textern word far criter_repeat_checkarea;\r\n\t\tregisterCriterRepeatCheckAddr(&criter_repeat_checkarea);\r\n\t}\r\n#else\r\n\tset_isrfct(0x24, dummy_criter_handler);\r\n#endif\r\n\r\n  /* DOS shells patch the PPID to the own PID, how stupid this is, however,\r\n    because then DOS won't terminate them, e.g. when a Critical Error\r\n    occurs that is not detected by COMMAND.COM */\r\n\r\n#ifdef __WATCOMC__\r\n\t/* minimum block size requested for HEAP from DOS */\r\n\t_amblksiz = _heaplen;\r\n#endif\r\n\t\r\n#ifdef DEBUG\r\n\t{ void* p;\r\n\t\tif((p = malloc(5*1024)) == 0)\r\n\t\t\tdprintf((\"[MEM: Out of memory allocating test block during INIT]\"));\r\n\t\telse free(p);\r\n\t}\r\n#endif\r\n\tdbg_printmem();\r\n\r\n#ifdef FEATURE_KERNEL_SWAP_SHELL\r\n\tif(kswapInit()) {\t\t/* re-invoked */\r\n\t\tif(kswapLoadStruc()) {\r\n\t\t\t/* OK, on success we need not really keep the shell trick\r\n\t\t\t\t(pretend we are our own parent), which might cause\r\n\t\t\t\tproblems with beta-software-bugs ;-)\r\n\t\t\t\tIn fact, KSSF will catch up our crashes and re-invoke\r\n\t\t\t\tFreeCOM, probably with the loss of any internal\r\n\t\t\t\tsettings. */\r\n\t\t\t  OwnerPSP = oldPSP;\r\n\t\t\treturn E_None;\r\n\t\t}\r\n\t}\r\n#endif\r\n\r\n  /* Some elder DOSs may not pass an initializied environment segment */\r\n  if(env_glbSeg && !isMCB(SEG2MCB(env_glbSeg))) {\r\n    env_setGlbSeg(0);       /* Disable the environment */\r\n    dprintf((\"[ENV: Disabled invalid environment]\"));\r\n  }\r\n\r\n/* Now parse the command line parameters passed to COMMAND.COM */\r\n  /* Preparations */\r\n  newTTY = 0;\r\n  comPath = tracemode = 0;\r\n  showinfo = 1;\r\n\r\n\tdprintf( (\"[INIT: grab argv[0] ]\\n\") );\r\n  /* Because FreeCom should be executed in a DOS3+ compatible\r\n    environment most of the time, it is assumed that its path\r\n    can be determined from the environment.\r\n    This has the advantage that the string area is accessable\r\n    very early in the run.\r\n    The name of the current file is string #0. */\r\n  if((offs = env_string(0, 0)) != 0) {    /* OK, environment filled */\r\n\t\t/* this fails for MSDOS, if the environment is empty: passed one:\r\n\t\t   00 00 01 00 a:command.com 00 */   \r\n/*    if (*(char far *)MK_FP(env_glbSeg, offs) == 0) */\r\n    if (peekb(env_glbSeg, offs) == 0)\t/* empty ergv[0] assume broken */\r\n      offs++;\t\t\t\t\t\t\t/* MSDOS environment */\r\n    grabComFilename(0, (char far *)MK_FP(env_glbSeg, offs));\r\n  }\r\n#ifdef DEBUG\r\n  else dprintf((\"[ENV: No argv[0]!]\\n\"));\r\n#endif\r\n\r\n  /* After that argv[0] is no longer used and maybe zapped.\r\n  \tThis also will help, as most programs altering the environment\r\n  \tsegment externally don't expect a string area. */\r\n  env_nullStrings(0);\r\n\r\n  /* Aquire the command line, there are three possible sources:\r\n    1) DOS command line @PSP:0x80 as pascal string,\r\n    2) extended DOS command line environment variable CMDLINE,\r\n      if peekb(PSP, 0x80) == 127,&\r\n    3) MKS command line @ENV:2, if peekb(ENV, 0) == '~'\r\n    \t&& peekb(ENV, 1) == '='\r\n\r\n    Currently implemented is version #1 and #2\r\n  */\r\n  /* get size of command line, if <= 126 then assume actual size\r\n     >126 treat as flag indicating to use CMDLINE env variable */\r\n  cmdlen = (unsigned)peekb(_psp, 0x80);\r\n  /* #2 extended command line in CMDLINE env var */\r\n  /* printf(\"Command line is %u chars long\\n\", cmdlen); */\r\n  if (cmdlen > MAX_EXTERNAL_COMMAND_SIZE) {\r\n    cmdlen = 0;\r\n\tcmdline = 0;\r\n\t/* see if CMDLINE env var exists, if so use it, should be \\0 terminated\r\n\t   we need to see if it exists, copy to local address space skipping past command.com */\r\n\tif (!(env_matchVar(0, LONG_CMDLINE_ENV_NAME) & 7)) { /* found? ==0 */\r\n\t    word segm;\r\n\t\tint ofs;\r\n\t\tsegm = env_dfltSeg? env_dfltSeg : env_glbSeg; /* get env segment */\r\n\t\tif (segm) { \r\n\t\t    if ((ofs = env_findVar(segm, LONG_CMDLINE_ENV_NAME)) >= 0) { /* get offset to CMDLINE env var if exists */\r\n\t            char far *p = MK_FP(segm, ofs + strlen(LONG_CMDLINE_ENV_NAME) + 1); /* skip past CMDLINE= */\r\n    \t        while (*p && !isargdelim(*p)) { p++; } /* skip past argv[0] ~= COMMAND.COM */\r\n\t\t        if (0 == (cmdline = _fdupstr(p))) { /* copy into local address space just cmd tail */\r\n                   error_out_of_memory();\r\n                   return E_NoMem;\r\n\t\t        }\t\t\t\r\n\t\t        cmdlen = strlen(cmdline);\r\n\t\t    }\r\n\t\t}\r\n\t}\r\n    if (cmdline == 0) {\r\n\t\t/* either no free memory or no CMDLINE env var found */\r\n        error_corrupt_command_line();\r\n\t}\r\n  }\r\n  if (cmdlen <= MAX_EXTERNAL_COMMAND_SIZE) {\r\n    /* duplicate the command line into the local address space */\r\n  if((cmdline = malloc(cmdlen + 1)) == 0) {\r\n    error_out_of_memory();  /* Cannot recover from this problem */\r\n    return E_NoMem;\r\n  }\r\n  _fmemcpy((char far*)cmdline, MK_FP(_psp, 0x81), cmdlen);\r\n  cmdline[cmdlen] = '\\0';\r\n  }\r\n  /* printf(\"CMDLINE:[%s]\\n\", cmdline); */\r\n#ifdef FEATURE_CALL_LOGGING\r\n#ifndef INCLUDE_CMD_FDDEBUG\r\n  if((f = fopen(logFilename, \"at\")) == 0) {\r\n    fprintf(stderr, \"Cannot open logfile: \\\"%s\\\"\\n\", logFilename);\r\n  } else {\r\n\r\n  putc('\"', f);\r\n  if(ComPath)   /* path to command.com already known */\r\n    fputs(ComPath, f);\r\n  putc('\"', f);\r\n  putc(':', f);\r\n\r\n  fputs(cmdline, f);\r\n  putc('\\n', f);\r\n  fclose(f);\r\n  }\r\n#else\r\n\tcmd_fddebug(logFilename);\r\n\r\n\tdbg_outc('\"');\r\n\tdbg_outs(ComPath);\r\n\tdbg_outc('\"');\r\n\tdbg_outc(':');\r\n\tdbg_outsn(cmdline);\r\n#endif\r\n#endif\r\n\r\n  canexit = 1;\r\n  p = cmdline;    /* start of the command line */\r\n  do {\r\n  ec = leadOptions(&p, opt_init, 0);\r\n  if(ec == E_NoOption) {    /* /C or /K */\r\n    assert(p && *p);\r\n    if(!isoption(p)) {\r\n      error_quoted_c_k();\r\n      p = 0;\r\n      break;\r\n    }\r\n    assert(p[1] && strchr(\"kKcC\", p[1]));\r\n    p += 2;   /* p := start of command line to execute */\r\n    break;\r\n  } else if(ec != E_None) {\r\n        showhelp = 1;\r\n    p = 0;\r\n    break;\r\n  }\r\n\r\n  assert(p && !isoption(p) && !isspace(*p));\r\n  if(!*p) {\r\n    p = 0;\r\n    break;      /* end of line reached */\r\n  }\r\n  q = unquote(p, h = skip_word(p));\r\n  p = h;      /* Skip this word */\r\n  if(!q) {\r\n    error_out_of_memory();\r\n    p = 0;\r\n    break;\r\n  }\r\n  if(!comPath || !newTTY) {\r\n  \tint rc = grabComFilename(0, (char far*)q);\r\n\r\n  \tif(rc == 2 && !newTTY) {\r\n\t\tcmd_ctty(q);\r\n\t\tnewTTY = 1;\r\n\t} else if(!comPath) {\r\n\t\tif(rc)\t\t/* Display the error mesg */\r\n\t\t\tgrabComFilename(1, (char far*)q);\r\n\t\telse\r\n\t\t\tcomPath = 1;\r\n\t} else {\t\t\t/* has to be CTTY */\r\n\t\tcmd_ctty(q);\r\n\t\tnewTTY = 1;\r\n\t}\r\n  } else {\r\n\terror_too_many_parameters(q);\r\n\tshowhelp = 1;\r\n  }\r\n   free(q);\r\n   } while(1);\r\n\r\n   /*\r\n    * Now:\r\n    * + autoexec: AUTOEXEC.BAT file to be executed if /P switch\r\n    *   is enabled; if NULL, use default\r\n    * + comPath: user-defined PATH to COMMAND.COM; if NULL, use\r\n    *   the one from the environment\r\n    * + newTTY: the name of the device to be CTTY'ed; if NULL,\r\n    *   no change\r\n    * + p: pointer to the command to be executed:\r\n    *   *p == 'c' or 'C' --> spawn command, then terminate shell\r\n    *   *p == 'k' or 'K' --> spawn command, then go interactive\r\n    *   &p[1] --> command line, unless the first character is an\r\n    *   argument character\r\n    */\r\n\r\n/* Now process the options */\r\n\r\n#ifdef FEATURE_XMS_SWAP\r\n\tif(autofail) {\r\n\t\tdprintf((\"[INIT: Activate AutoFail handler]\\n\"));\r\n\t\tset_isrfct(0x24, autofail_err_handler);\r\n\t}\r\n#endif\r\n\r\n  if(!ComPath) {\t/* Force interactive querying of the executable */\r\n  \tinInit = 1;\r\n  \tmsgSegment();\r\n  \tif(!ComPath) {\r\n\t\t/* FreeCom is unable to find itself --> print error message */\r\n\t\t/* Emergency error */\r\n#undef TEXT_MSG_FREECOM_NOT_FOUND\r\n\t\tputs(TEXT_MSG_FREECOM_NOT_FOUND);\r\n#undef TEXT_TERMINATING\r\n\t\tputs(TEXT_TERMINATING);\r\n\t\treturn E_Useage;\r\n\t}\r\n  }\r\n\r\n  /* First of all, set up the context */\r\n#ifndef FEATURE_XMS_SWAP\r\n\t/* Install INT 24 Critical error handler */\r\n\t/* Needs the ComPath variable, eventually */\r\n\tif(!kswapContext) {\r\n\t\t/* Load the module/context into memory */\r\n\t\tif((kswapContext = modContext()) == 0) {\r\n\t\t\terror_loading_context();\r\n\t\t\treturn E_NoMem;\r\n\t\t}\r\n#ifdef FEATURE_KERNEL_SWAP_SHELL\r\n\t\tif(swapOnExec != ERROR)\r\n\t\t\tkswapRegister(kswapContext);\r\n#endif\r\n\t}\r\n\tctxtCreate();\t/* Create context before env seg, as it is\r\n\t\t\t\t\t\tpersistent in non-XMS-Mode */\r\n#endif\r\n\r\n  /* Now set up the environment */\r\n    /* If a new valid size is specified, use that */\r\n#ifdef DEBUG\r\n\torig_env = env_glbSeg;\r\n#endif\r\n  env_resizeCtrl |= ENV_USEUMB | ENV_ALLOWMOVE | ENV_LASTFIT;\r\n  if(forceLow)\r\n\t  env_resizeCtrl &= ~ENV_USEUMB;\r\n  if(newEnvSize > 16 && newEnvSize < 32769u)\r\n    env_setsize(0, newEnvSize);\r\n#ifdef ENVIRONMENT_KEEP_FREE \r\n#if ENVIRONMENT_KEEP_FREE > 0\r\n  else if(env_freeCount(env_glbSeg) < ENVIRONMENT_KEEP_FREE) {\r\n\tdprintf((\"[ENV: auto-resize environment because too small: %d]\\n\"\r\n\t\t, env_freeCount(env_glbSeg)) );\r\n\tenv_replace(0\t\t/* Modify the default segment */\r\n\t , ENV_DELETE | ENV_COPY | ENV_CREATE | ENV_FREECOUNT\r\n\t , ENVIRONMENT_KEEP_FREE);\r\n\t}\r\n#else\r\n#error ENVIRONMENT_KEEP_FREE is non-positive\r\n#endif\r\n#endif\r\n\r\n  /* Otherwise the path is placed into the environment */\r\n    /* Set the COMSPEC variable. */\r\n  if(chgEnv(\"COMSPEC\", ComPath)) {\t\t/* keep it silent */\r\n    /* Failed to add this variable, the most likely problem should be that\r\n      the environment is too small --> it is increased and the\r\n      operation is redone */\r\n    env_resize(0, strlen(ComPath) + 10);\r\n    if(chgEnv(\"COMSPEC\", ComPath))\r\n    \tchgEnv(\"COMSPEC\",  NULL);\t/* Cannot set -> zap an old one */\r\n  }\r\n  \tinInit = 0;\r\n#ifdef DEBUG\r\n\tif(orig_env != env_glbSeg) {\r\n\t\tdprintf((\"[ENV: Environment changed: @%04x -> @%04x; free %u]\\n\"\r\n\t\t , orig_env, env_glbSeg, env_freeCount(env_glbSeg)));\r\n\t}\r\n#endif\r\n\r\n#ifdef FEATURE_XMS_SWAP\r\n\tctxtCreate();\t/* Create context after env seg, as it is\r\n\t\t\t\t\t\tfloating in XMS-Mode */\r\n\r\n\t/* Now everything is setup --> initialize the XMS stuff */\r\n\tXMSinit();\r\n\t/* Initialize the EXEC Block structure used by XMS Swap Exec\r\n\t\tinterface */\r\n\t/* envSeg = 0;\t\tdefault & always updated by caller */\r\n\tdosParamDosExec.cmdtail = dosCMDTAIL;\r\n\tdosParamDosExec.FCB1 = dosFCB1;\r\n\tdosParamDosExec.FCB2 = dosFCB2;\r\n\t/* overlPtr1;\t\tnot used by this exec */\r\n\t/* overlPtr2;\t\tnot used by this exec */\r\n#else\r\n\t/* re-use the already loaded Module */\r\n\tset_isrfct(0x24,\r\n\t MK_FP(FP_SEG(kswapContext->cbreak_hdlr), kswapContext->ofs_criter));\r\n#endif\r\n\r\n  if(internalBufLen)\r\n    error_l_notimplemented();\r\n  if(inputBufLen)\r\n    error_u_notimplemented();\r\n\r\n  if(tracemode)\r\n    showinfo = 0;\r\n\r\n  if (showhelp)\r\n    displayString(TEXT_CMDHELP_COMMAND);\r\n\r\n  if ((showhelp || exitflag) && canexit)\r\n    return E_Exit;\t\t/* Terminate this session */\r\n\r\n  /* Now the /P option can be processed */\r\n\tif(!canexit) {\r\n\t\tchar *autoexec;\r\n\r\n\t\tspawnAndExit = E_None;\r\n\t\tautoexec = user_autoexec? user_autoexec: AUTO_EXEC;\r\n\r\n\t\tshowinfo = 0;\r\n/*\t\tshort_version(); */\r\n\t\tcmd_ver(NULL);\r\n\r\n\t\tif(skipAUTOEXEC) {\t\t/* /D option */\r\n\t\t\tshowinfo = 0;\r\n\t\t\tdisplayString(TEXT_MSG_INIT_BYPASSING_AUTOEXEC, autoexec);\r\n\t\t} else {\r\n\t\t\tif(exist(autoexec)) {\r\n#ifdef FEATURE_BOOT_KEYS\r\n\t\t\t\tIREGS r;\r\n\t\t\t\tint key;\r\n\r\n\t\t\t\tr.r_ax = 0x3000;\t/* Get DOS version & OEM ID */\r\n\t\t\t\tintrpt(0x21, &r);\r\n\t\t\t\tif(!tracemode\t/* /Y --> F8 on CONFIG.SYS */\r\n\t\t\t\t || ((r.r_bx & 0xff00) == 0xfd00\t/* FreeDOS >= build 2025 */\r\n\t\t\t\t      && !(r.r_cx > 0x101 || (r.r_bx & 0xff) > 24))) {\r\n\t\t\t\t\tdisplayString(TEXT_MSG_INIT_BYPASS_AUTOEXEC, autoexec);\r\n\t\t\t\t\tkey = cgetchar_timed(3);\r\n\t\t\t\t\toutc('\\n');\r\n\t\t\t\t} else key = 0;\r\n\r\n\t\t\t\tif(key == KEY_F8)\r\n\t\t\t\t\ttracemode = 1;\r\n\r\n\t\t\t\tif(key == KEY_F5)\r\n\t\t\t\t\tdisplayString(TEXT_MSG_INIT_BYPASSING_AUTOEXEC, autoexec);\r\n\t\t\t\telse\r\n#endif\r\n\t\t\t\t\tprocess_input(1, autoexec);\r\n\t\t\t} else {\r\n\t\t\t\tif(user_autoexec)\r\n\t\t\t\t\terror_sfile_not_found(user_autoexec);\r\n#ifdef INCLUDE_CMD_DATE\r\n\t\t\t\t\tcmd_date(0);\r\n#endif\r\n#ifdef INCLUDE_CMD_TIME\r\n\t\t\t\t\tcmd_time(0);\r\n#endif\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfree(user_autoexec);\r\n\t} else {\r\n\t\tassert(user_autoexec == 0);\r\n\t}\r\n\r\n  /* Now the /C or /K option can be processed */\r\n  if (p)\r\n  {\r\n    process_input(1, p);\r\n    return spawnAndExit;\r\n  }\r\n\r\n  /* Don't place something here that must be executed after a /K or /C */\r\n\r\n  if (showinfo)\r\n  {\r\n/*    short_version(); */\r\n    cmd_ver(NULL);\r\n/* #ifndef DEBUG\t\tNo more commands\r\n    putchar('\\n');\r\n    showcmds(0);\r\n    putchar('\\n');\r\n#endif */\r\n  }\r\n\r\n  return E_None;\r\n}\r\n"
  },
  {
    "path": "shell/kswap.c",
    "content": "/* $Id$\r\n\r\n    Kernel-supported swapping\r\n\r\n    2001/01/21 ska\r\n    started\r\n*/\r\n\r\n#include \"../config.h\"\r\n\r\n#ifdef FEATURE_KERNEL_SWAP_SHELL\r\n\r\n#include <assert.h>\r\n#include <dos.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include <suppl.h>\r\n#include <environ.h>\r\n#include <mcb.h>\r\n\r\n#include \"../include/context.h\"\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/kswap.h\"\r\n\r\n#define FD_MAGIC 0x4446 /* 'FD' */\r\n\r\n/* Lock kswap feature within kernel and invalidate a previous external prg\r\n    Return:  FALSE  no swap feature within kernel */\r\nint kswapInit(void)\r\n{   IREGS r;\r\n\r\n    r.r_ax = 0x4bfe;        /* Get kswap argument structure segm */\r\n    r.r_dx = FD_MAGIC;\r\n    intrpt(0x21, &r);\r\n\r\n    if(!( r.r_flags & 1 )) {\r\n        dprintf((\"[KSWAP: using kernel swapping support (KSSF eventually at %04x)]\\n\", r.r_ax));\r\n        if(r.r_bx)   {          /* segment found */\r\n            kswapContext = (kswap_p)MK_SEG_PTR(kswap_t, r.r_bx);\r\n                /* invalidate external program if this shell\r\n                                aborts accidently */\r\n            kswapContext->prg = 0;\r\n            dprintf((\"[KSWAP: static context found at 0x%04x]\\n\", r.r_bx));\r\n            return TRUE;        /* re-invoked */\r\n        }\r\n        return FALSE;           /* not _re-_ invoked */\r\n    } else if(r.r_ax == 5) {    /* Access denied -> there exists a\r\n                        static context with embedded Criter, but this\r\n                        copy of FreeCOM is NOT allowed to alter it */\r\n        kswapContext = (kswap_p)MK_SEG_PTR(kswap_t, r.r_bx);\r\n        dprintf((\"[KSWAP: static context found at 0x%04x]\\n\", r.r_bx));\r\n    }\r\n\r\n    dprintf((\"[KSWAP: kernel swapping support is not used]\\n\"));\r\n    swapOnExec = ERROR;     /* No swapping allowed */\r\n    return FALSE;\r\n}\r\n\r\nstatic void kswapSetISR(void)\r\n{\r\n    *(void far* far*)MK_FP(_psp, 0xe) = kswapContext->cbreak_hdlr;\r\n    /* The ^Break handler has been set already in INIT.C\r\n        as it is an internal one (no part of the module) */\r\n    *(void far* far*)MK_FP(_psp, 0x12) =\r\n     MK_FP(FP_SEG(kswapContext->cbreak_hdlr), kswapContext->ofs_criter);\r\n    set_isrfct(0x24,\r\n     MK_FP(FP_SEG(kswapContext->cbreak_hdlr), kswapContext->ofs_criter));\r\n}\r\n\r\nvoid kswapRegister(kswap_p ctxt)\r\n{   IREGS r;\r\n\r\n    dprintf((\"[KSWAP: Registering static context at: 0x%04x]\\n\", (word)ctxt));\r\n    assert(ctxt);\r\n    /* our own PSP gets patched in order to load the values of the\r\n        Criter and ^Break handlers of the context on termination\r\n        of this instance of FreeCOM.\r\n        It is save, because this function is activated only, if\r\n        the KSS is present, which faker has the previous values\r\n        stored. */\r\n    kswapSetISR();\r\n\r\n    r.r_ax = 0x4bfd;    /* Set kswap argument structure segm */\r\n    r.r_bx = (word)ctxt;\r\n    r.r_dx = FD_MAGIC;\r\n    intrpt(0x21, &r);\r\n    if(r.r_flags & 1) { /* failed */\r\n        swapOnExec = ERROR;     /* cannot register -> cannot use */\r\n        dprintf((\"[KSWAP: Registering failed, kernel swap deactivated]\\n\"));\r\n        return;\r\n    }\r\n    /* Initialize the constant values */\r\n    /* environment block required only, if swapping is avail */\r\n    ctxt->envSize = mcb_length(env_glbSeg);\r\n    ctxt->envSegm = allocSysBlk(ctxt->envSize, 0x82);\r\n    if(!ctxt->envSegm) {\r\n        error_kswap_allocmem();\r\n        swapOnExec = ERROR;\r\n    }\r\n    else\r\n        dprintf((\"[KSWAP: master environment allocated at 0x%04x]\\n\"\r\n         , ctxt->envSegm));\r\n}\r\nvoid kswapDeRegister(kswap_p ctxt)\r\n{\r\n    if(swapOnExec != ERROR) {   /* context belongs to this FreeCOM */\r\n        dprintf((\"[KSWAP: DeRegistering static context at: 0x%04x]\\n\", (word)ctxt));\r\n        assert(ctxt);\r\n        ctxt->shell = 0;        /* causes the kernel swap support to exit */\r\n    }\r\n}\r\n\r\n\r\n/* Update the kswap argument block\r\n    Return: 0 on error <-> no swapping possible\r\n        else: segment of structure */\r\nunsigned kswapMkStruc(const char * const prg, const char * const cmdline)\r\n{\r\n    word shellname;\r\n    word segm;\r\n    char *q, *h;\r\n\r\n    assert(prg);\r\n    assert(cmdline);\r\n\r\n    if(swapOnExec == ERROR) /* missing kernel support */\r\n        return FALSE;\r\n\r\n    assert(kswapContext);\r\n\r\n    /* To update the static context is a good idea even if we don't\r\n        swap after all */\r\n\r\n    /* preserve the environment */\r\n    assert(kswapContext->envSegm);\r\n    assert(kswapContext->envSize);\r\n    segm = kswapContext->envSegm;\r\n    dprintf((\"[KSWAP: Updating master environment at 0x%04x]\\n\", segm));\r\n    assert(isMCB(SEG2MCB(segm)));\r\n    assert(isMCB(SEG2MCB(env_glbSeg)));\r\n    assert(mcb_length(env_glbSeg) <= mcb_length(segm));\r\n    _fmemcpy(MK_FP(segm, 0), MK_FP(env_glbSeg, 0), mcb_length(env_glbSeg));\r\n\r\n    /* Update the shell name as maybe %COMSPEC% was changed */\r\n    /* COMSPEC is the central and traditionally the only place of the name of\r\n        the shell */\r\n    if(isSwapFile\r\n     || (shellname = env_findVar(segm, \"COMSPEC\") + 8) == (unsigned)-1 + 8) {\r\n        char *p = comResFile();\r\n        ctxtSet(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_SHELLNAME, p);\r\n        free(p);\r\n        if((kswapContext->shell /* fetch first in case of failure */\r\n         = ctxtAddress(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_SHELLNAME)) == 0)\r\n           return FALSE;\r\n    } else\r\n        kswapContext->shell = MK_FP(segm, shellname);\r\n\r\n    /* Update central settings of FreeCOM */\r\n    kswapContext->canexit = canexit;\r\n    kswapContext->dfltSwap = defaultToSwap;\r\n#ifdef NDEBUG\r\n    kswapContext->debug = (word)stderr;\r\n#else\r\n    kswapContext->debug = fddebug;\r\n#endif\r\n\r\n/* Create the dynamic portion of the context */\r\n    /* Construct command line string */\r\n    if(*cmdline) {\r\n        if((q = malloc(strlen(cmdline) + 4)) == 0) {\r\n            error_out_of_memory();\r\n            return FALSE;\r\n        }\r\n        h = stpcpy(q + 1, cmdline);\r\n        *q = h - q - 1;         /* command line length */\r\n        *h = '\\r';              /* command line terminator */\r\n        h[1] = 0;               /* ASCIIZ */\r\n        ctxtSet(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_CMDLINE, q);\r\n        free(q);\r\n    } else\r\n        ctxtSet(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_CMDLINE, \"\\1 \\r\");\r\n    ctxtSet(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_PRGNAME, prg);\r\n\r\n    return (kswapContext->cmdline   /* fetch first in case of failure */\r\n       = ctxtAddress(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_CMDLINE)) != 0\r\n     && (kswapContext->prg\r\n       = ctxtAddress(CTXT_TAG_SWAPINFO, CTXT_SWAPINFO_PRGNAME)) != 0;\r\n\r\n}\r\n\r\n/* Restore the kswap argument block */\r\nint kswapLoadStruc(void)\r\n{\r\n    kswapSetISR();\r\n    if(swapOnExec == ERROR) /* missing kernel support */\r\n        return FALSE;\r\n\r\n    assert(kswapContext);\r\n\r\n    /* kswapContext->prg had been disabled in kswapInit() */\r\n    assert(!kswapContext->prg);\r\n    setErrorLevel(kswapContext->execErr);\r\n\r\n    canexit = kswapContext->canexit;\r\n    defaultToSwap = kswapContext->dfltSwap;\r\n#ifndef NDEBUG\r\n    fddebug = kswapContext->debug;\r\n#endif\r\n    grabComFilename(1, kswapContext->shell);\r\n    if((ctxt = kswapContext->dyn_ctxt) == 0) {\r\n        error_no_context_after_swap();\r\n        ctxtCreate();\r\n    }\r\n\r\n    /* if the SHELL= statement specified the size of the environment, it\r\n        must be applied each time FreeCOM is re-invoked, because DOS does\r\n        not preserve the size of the original environment. */\r\n    env_resizeCtrl = ENV_ALLOWMOVE | ENV_LASTFIT | ENV_USEUMB;\r\n  if(forceLow)\r\n      env_resizeCtrl &= ~ENV_USEUMB;\r\n    /* if the size does not change this function performs no actions */\r\n    env_setsize(0, kswapContext->envSize);\r\n\r\n    return TRUE;\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "shell/loadhigh.c",
    "content": "/* $Id$\r\n * LOADHIGH.C - command that loads a DOS executable into upper memory.\r\n *\r\n *   Comments\r\n *\r\n * ??/??/96 (Svante Frey)\r\n *   began.\r\n *\r\n * 01/17/96 (Tim Norman)\r\n *   plugged into COMMAND.COM\r\n *\r\n * 02/05/96 (Tim Norman)\r\n *   converted to new first/rest calling scheme\r\n *\r\n * 08/27/96 (Tim Norman)\r\n *   removed support for - as a switch character\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 2000/07/05 Ron Cemer\r\n *\tbugfix: renamed skipwd() -> skip_word() to prevent duplicate symbol\r\n *\r\n * 2001/02/14 ska\r\n *\tchg: made all helper functions and variables 'static'\r\n *\tchg: clean up code to not implement some functions twice\r\n *\tchg: reduced some static variables\r\n *\r\n * 2002/02/14 ska\r\n *\tchg: to behave as documented in DOCS\\LOADHIGH.TXT\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <string.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n\r\n#include \"mcb.h\"\r\n#include \"suppl.h\"\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../include/misc.h\"\r\n#include \"../strings.h\"\r\n\r\n/* Macro to convert bytes to paragraphs */\r\n#define topara(x) (((x) + 0xf) >> 4)\r\n#define mcbAssign(mcb,wordValue)\t(mcb = MK_SEG_PTR(struct MCB,wordValue))\r\n\t/* skip to next MCB in chain */\r\n#define mcbNext(mcb)\tmcbAssign(mcb, nxtMCB(FP_SEG(mcb)))\r\n#define DosAlloc(value)\tDOSalloc((value), 0xF)\r\n\r\n#define BLOCKMAX 256\r\n#define AVAILBLOCKMAX 256\r\n#define REGIONMAX 64\r\n\r\nenum error_codes\r\n{\r\n  err_help = -1, OK,\r\n  err_silent = -2,\r\n\r\n  /* These error codes are more or less DOS-compatible */\r\n  err_file_not_found = 2, err_mcb_chain = 7,\r\n  err_out_of_memory = 8, err_invalid_parms = 87\r\n};\r\n\r\nstatic int lh_lf(char *c);\r\nstatic int loadhigh_prepare(void);\r\nstatic int loadfix_prepare(void);\r\nstatic int findUMBRegions(void);\r\nstatic int parseArgs(char *cmdline, char **fnam, char **rest);\r\nstatic void lh_error(int errcode);\r\n\r\n/* This module takes care of both the LOADHIGH and the LOADFIX command,\r\n * since those two commands have much in common.\r\n *\r\n * The global variable 'loadfix_flag' is used to keep track of which\r\n * command is currently executing. If this variable is non-zero, it's\r\n * LOADFIX, otherwise LOADHIGH.\r\n */\r\n\r\n#ifdef INCLUDE_CMD_LOADHIGH\r\n\r\nstatic int loadfix_flag;         /* Flag: LOADFIX instead of LOADHIGH? */\r\n#define INCLUDE_LOADHIGH_HANDLER\r\n\r\n/* This is the loadhigh handler */\r\nint cmd_loadhigh(char *rest)\r\n{\r\n        int ret;\r\n        int old_link = dosGetUMBLinkState();\r\n        int oldSwapContext = swapContext;\r\n\r\n        loadfix_flag = 0;\r\n        ret = lh_lf(rest);\r\n\r\n        /* Restore UMB link state to its original value. */\r\n\r\n        dosSetUMBLinkState(old_link);\r\n        swapContext = oldSwapContext;\r\n\r\n        return ret;\r\n}\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_LOADFIX\r\n\r\n#ifndef INCLUDE_LOADHIGH_HANDLER\r\nstatic int loadfix_flag;         /* Flag: LOADFIX instead of LOADHIGH? */\r\n#define INCLUDE_LOADHIGH_HANDLER\r\n#endif\r\n\r\n/* This is the loadfix handler */\r\nint cmd_loadfix(char *rest)\r\n{\r\n  loadfix_flag = 1;\r\n  return lh_lf(rest);\r\n}\r\n#endif\r\n\r\n\r\n\r\n#ifdef INCLUDE_LOADHIGH_HANDLER\r\n\r\n/* This array will contain the memory blocks that the new program can't use */\r\nstatic int allocatedBlocks = 0;\r\nstatic word *block = 0;\r\n\r\nstatic int upper_flag;           /* Flag: should the program be loaded high? */\r\n\r\n/* UMB region info */\r\nstatic int umbRegions = 0;       /* How many UMB regions are there? */\r\n\r\nstatic struct UMBREGION\r\n{\r\n  word start;             /* start of the region */\r\n  word end;               /* end of the region */\r\n  word minSize;           /* minimum free size, given by the L switch */\r\n  int access;             /* does the program have access to this region? */\r\n}\r\n *umbRegion = 0;\r\n\r\n\r\nstatic int optS;\r\nstatic char *optL = 0;\r\n\r\n/* Helper functions */\r\n\r\nstatic int initialise(void)\r\n{\r\n  /* reset global variables */\r\n  allocatedBlocks = 0;\r\n  upper_flag = 1;\r\n  /* initialize options */\r\n  optS = 0;\r\n\r\n  /* Allocate dynamic memory for some arrays */\r\n  if ((block = malloc(BLOCKMAX * sizeof(*block))) == 0)\r\n    return err_out_of_memory;\r\n\r\n#ifdef FEATURE_XMS_SWAP\r\n\tif(_CS >= 0xa000 || _CS < 0x2000) {\r\n\t\t/* Try to relocate the transient portion to the\r\n\t\t\tend of the lower memory so *prepare won't\r\n\t\t\tmiscalculate our own memory block */\r\n\t\tdprintf((\"[MEM: Relocate our transient portion from: 0x%04x\", _CS));\r\n\t\tdosSetAllocStrategy(0x02);\t\t/* low memory last fit */\r\n\t\texec(\";=/\",\"\",0);     \r\n\t\t\t/* Note:\r\n\t\t\t\t1) Due to the invalid file name, exec() will fail,\r\n\t\t\t\t\tbut won't display an error message.\r\n\t\t\t\t\tThe ERRORLEVEL is destroyed, though, but there will\r\n\t\t\t\t\tbe started a program anyway (unless systax errors).\r\n\t\t\t\ta) If XMS is not active or swapping is disabled,\r\n\t\t\t\t\tto call exec() won't help anything, but won't hurt\r\n\t\t\t\t\ton the other hand. */\r\n\t\tdprintf((\" to: 0x%04x\\n\", _CS));\r\n\t}\r\n#endif\r\n\r\n  if ((umbRegion = malloc(REGIONMAX * sizeof(*umbRegion))) == 0)\r\n    return err_out_of_memory;\r\n\r\n  /* find the UMB regions */\r\n\treturn findUMBRegions();\r\n}\r\n\r\n\r\n/* This is the \"real\" handler of the two commands. The argument is\r\n * the original command line.\r\n */\r\n\r\nstatic int lh_lf(char *args)\r\n{\r\n  int rc;\r\n  char *fnam;\r\n\tint i;\t\r\n\r\n  int old_strat = dosGetAllocStrategy();\r\n\r\n  assert(args);\r\n  assert(umbRegion == 0);\r\n  assert(block == 0);\r\n  assert(optL == 0);\r\n\r\n    if((rc = initialise()) == OK)\r\n    {\r\n      if ((rc = parseArgs(args, &fnam, &args)) == OK)\r\n      {\r\n        /* command line was OK - allocate the memory */\r\n        if (loadfix_flag)\r\n          rc = loadfix_prepare();\r\n        else\r\n          rc = loadhigh_prepare();\r\n\r\n        /* finally, execute the file */\r\n        if (!rc)\r\n          execute(fnam, args, 1);\r\n        free(fnam);\r\n      }\r\n    }\r\n\r\n\r\n  \t/** Clean Up **/\r\n  /* free any memory that was allocated to prevent the program from using it */\r\n  for (i = 0; i < allocatedBlocks; i++)\r\n    DOSfree(block[i]);\r\n\r\n\t/* free dynamic arrays */\r\n\tfree(umbRegion);\r\n\tfree(block);\r\n\tfree(optL);\r\n\toptL = 0;\r\n\tumbRegion = 0;\r\n\tblock = 0;\r\n\r\n  /* Restore DOS malloc strategy to its original value. */\r\n\r\n  dosSetAllocStrategy(old_strat);\r\n\r\n\r\n  /* if any error occurred, print & return the error */\r\n  if (rc) {\r\n    lh_error(rc);\r\n    return rc;\r\n  }\r\n\r\n  /* otherwise return the exit code of the program that ran */\r\n  return errorlevel;\r\n}\r\n\r\n\r\n/* lh_error(): print error messages to stderr */\r\n\r\nstatic void lh_error(int errcode)\r\n{\r\n  switch (errcode)\r\n  {\r\n    case err_invalid_parms:\r\n      error_syntax(0);\r\n      break;\r\n\r\n    case err_file_not_found:\r\n      error_file_not_found();\r\n      break;\r\n\r\n    case err_out_of_memory:\r\n      error_out_of_memory();\r\n      break;\r\n\r\n    case err_mcb_chain:        /* error while searching the MCB chain */\r\n\t\terror_bad_mcb_chain();\r\n      break;\r\n\r\n    default:\r\n      error_unknown(errcode);\r\n      break;\r\n\r\n    case err_silent:\r\n      break;\r\n  }\r\n}\r\n\r\n/* findUMBRegions():\r\n * This routine scans the MCB chain to find all active memory regions.\r\n * Info about the regions is written to the array \"umbRegions\".\r\n *\r\n * Each continous region is numbered. Region 0 is the conventional\r\n * memory.\r\n */\r\n\r\nstatic int findUMBRegions(void)\r\n{\r\n  struct UMBREGION *region = umbRegion;\r\n  struct MCB _seg *mcb;\r\n  char sig;\r\n  int i;\r\n\r\n\tmcbAssign(mcb, GetFirstMCB());  /* get start of MCB chain */\r\n  umbRegions = 0;\r\n  region->start = FP_SEG(mcb);\r\n\r\n  /* First, find the end of the conventional memory:\r\n   * Turn UMB link off, and track the MCB chain to the end. */\r\n\r\n  dosSetUMBLinkState(0);\r\n\r\n  while (mcb->mcb_type == 'M')\r\n    mcbNext(mcb);\r\n\r\n  if (mcb->mcb_type != 'Z')\r\n    return err_mcb_chain;\r\n\r\n  /* If the last memory block in conventional memory is \"reserved\",\r\n   * conventional memory ends at the paragraph before the block. If\r\n   * the last block is an ordinary one, conventional memory ends at\r\n   * the last paragraph of the block. */\r\n\r\n  if (mcb->mcb_ownerPSP == 8 && !_fmemcmp(mcb->mcb_name, \"SC\", 2))\r\n    region->end = FP_SEG(mcb) - 1;\r\n  else\r\n    region->end = FP_SEG(mcb) + mcb->mcb_size;\r\n\r\n  region++;\r\n  region->start = 0;\r\n\r\n  /* Turn UMB link on. If MS-DOS UMBs are available, the signature of\r\n   * the last conventional memory block will change from 'Z' to 'M'. */\r\n\r\n  dosSetUMBLinkState(1);\r\n\r\n  if (mcb->mcb_type == 'M')\r\n  {                             /* UMBs are available */\r\n    mcbNext(mcb); /* go to next block */\r\n\r\n    /* This loop searches for the regions, by searching either for\r\n     * special MCBs or 'reserved' memory regions. */\r\n\r\n    do\r\n    {\r\n      sig = mcb->mcb_type;\r\n\r\n      if (mcb->mcb_ownerPSP == 8\r\n        && (!_fmemcmp(mcb->mcb_name, \"SC\", 2)\r\n          || !_fmemcmp(mcb->mcb_name, \"S\\x00\\x30\", 3))) /* lDOS S MCB type 30h */\r\n      {\r\n        /* this is a 'hole' in memory */\r\n        if (region->start)\r\n        {\r\n          region->end = FP_SEG(mcb) - 1;\r\n          if (! (mcb->mcb_type == 'Z' && 0 == mcb->mcb_size)) {\r\n            if ((region - umbRegion) >= REGIONMAX) {\r\n              return err_out_of_memory;\r\n            }\r\n            region++;\r\n            region->start = 0;\r\n          }\r\n        }\r\n      }\r\n      else\r\n      {\r\n        /* In MS-DOS 6.x, each UMB region starts with a 'major' mcb\r\n         * that is outside the ordinary MCB chain. This mcb defines\r\n         * the size of the whole region. */\r\n\r\n        struct MCB _seg *umb_mcb;\r\n        mcbAssign(umb_mcb, FP_SEG(mcb) - 1);\r\n\r\n        if((umb_mcb->mcb_type == 'Z' || umb_mcb->mcb_type == 'M')\r\n         && !_fmemcmp(umb_mcb->mcb_name, \"UMB     \", 8))\r\n          {\r\n            /* This is the signature of the special MS-DOS MCBs */\r\n\r\n            region->start = umb_mcb->mcb_ownerPSP;\r\n            region->end = umb_mcb->mcb_ownerPSP + umb_mcb->mcb_size - 1;\r\n            if ((sig = umb_mcb->mcb_type) == 'M')\r\n              region->end--;\r\n            if ((region - umbRegion) >= REGIONMAX) {\r\n              return err_out_of_memory;\r\n            }\r\n            region++;\r\n            region->start = 0;\r\n            mcbAssign(mcb, FP_SEG(umb_mcb) + umb_mcb->mcb_size);\r\n            if (sig == 'Z')\r\n              break;\r\n            continue;\r\n          }\r\n        if (!region->start)\r\n          region->start = FP_SEG(mcb);\r\n      }\r\n\r\n      if (sig == 'Z')\r\n      {\r\n        region->end = FP_SEG(mcb) + mcb->mcb_size;\r\n        if ((region - umbRegion) >= REGIONMAX) {\r\n          return err_out_of_memory;\r\n        }\r\n        region++;\r\n        break;\r\n      }\r\n\r\n      mcbNext(mcb);\r\n    }\r\n    while (sig == 'M');\r\n\r\n    if (sig != 'Z')\r\n      return err_mcb_chain;\r\n  }\r\n  umbRegions = region - umbRegion;\r\n\r\n  /* By default, the program will have access to all UMB regions. This\r\n   * may be modified by command-line arguments. */\r\n\r\n  for (i = 0; i < umbRegions; i++)\r\n  {\r\n    umbRegion[i].access = 1;\r\n    umbRegion[i].minSize = 0xffff;\r\n  }\r\n\r\n  return OK;\r\n}\r\n\r\n/* loadhigh_prepare():\r\n\r\n * This routine allocates memory as necessary. All memory that the\r\n * program is not allowed to access must be temporarily allocated\r\n * while the program is running.\r\n */\r\n\r\nstatic int loadhigh_prepare(void)\r\n{\r\n  int i;\r\n  struct UMBREGION far *region = umbRegion;\r\n  word *availBlock;\r\n  word availBlocks = 0;\r\n\r\n  /* Set the UMB link and malloc strategy */\r\n  dosSetUMBLinkState(1);\r\n  dosSetAllocStrategy(0);\r\n\r\n  if ((availBlock = malloc(AVAILBLOCKMAX * sizeof(*availBlock))) == 0)\r\n    return err_out_of_memory;\r\n\r\n  /* Call to force DOS to catenate any successive free memory blocks */\r\n  DosAlloc(0xffff);\r\n\r\n  /* This loop sets up each UMB region as specified:\r\n   * If the 'L' switch was present on the command line, any memory\r\n   * region not listed there will be disabled for the program.\r\n   *\r\n   * If a minimal size was specified, the memory region will only be\r\n   * available to the program if it contains a free memory block of\r\n   * at least this size. If the 'S' switch was present, the memory\r\n   * region will be shrunk to the minimal size.\r\n   *\r\n   * When the loop finishes, the array 'block' will contain the memory\r\n   * handles of every free memory block that the program was not\r\n   * allowed to access.\r\n   *\r\n   * The array 'availBlock' will contain the memory handles of every\r\n   * free memory block that the program can use.\r\n   */\r\n\r\n  for (i = 0; i < umbRegions; i++, region++)\r\n  {\r\n    struct MCB _seg *mcb;\r\n    word startBlock = allocatedBlocks;\r\n    int found_one = 0;\r\n\r\n    for (mcbAssign(mcb, region->start)\r\n     ; FP_SEG(mcb) < region->end && mcb->mcb_type == 'M'\r\n     ; mcbNext(mcb))\r\n    {\r\n      if (!mcb->mcb_ownerPSP)\r\n      {\r\n        /* Found a free memory block: allocate it */\r\n        word bl = DosAlloc(mcb->mcb_size);\r\n\r\n        if (bl != FP_SEG(mcb) + 1) {  /* Did we get the block we wanted? */\r\n          DOSfree(bl);\r\n          for (i = 0; i < availBlocks; i++)\r\n            DOSfree(availBlock[i]);\r\n          free(availBlock);\r\n          return err_mcb_chain;\r\n        }\r\n\r\n        if (region->access)\t\t/* /L option allows access to this region */\r\n        {\r\n          if (region->minSize == 0xffff ||\t\t/* no minimum size set\r\n          \t\t\t\t\t\t\t\t\t\t\t--> use it */\r\n              (!optS && found_one) ||\t/* a found previous block means to\r\n              \t\t\t\t\tmake this region available regardless\r\n              \t\t\t\t\tof the size of this block; with an active\r\n              \t\t\t\t\t/S option only one block per region is\r\n              \t\t\t\t\tallowed. */\r\n              (!(optS && found_one) &&\r\n               mcb->mcb_size >= region->minSize))\r\n          {\r\n\r\n            if (availBlocks >= AVAILBLOCKMAX) {\r\n              DOSfree(bl);\r\n              for (i = 0; i < availBlocks; i++)\r\n                DOSfree(availBlock[i]);\r\n              free(availBlock);\r\n              return err_out_of_memory;\r\n            }\r\n            availBlock[availBlocks++] = bl;\r\n\r\n            if (optS)\r\n              DOSresize(bl, region->minSize);\r\n            else if (allocatedBlocks > startBlock)\r\n            {\r\n              /* These _previously_ found blocks had been found\r\n              \ttoo small, but must be made available now as this\r\n              \tregion is available */\r\n              memcpy(availBlock + availBlocks\r\n               , block + startBlock\r\n               , (allocatedBlocks - startBlock) * sizeof(*block));\r\n              availBlocks += allocatedBlocks - startBlock;\r\n              allocatedBlocks = startBlock;\r\n            }\r\n            found_one = 1;\r\n\r\n            continue;\r\n          }\r\n        }\r\n        if (allocatedBlocks >= BLOCKMAX) {\r\n          DOSfree(bl);\r\n          for (i = 0; i < availBlocks; i++)\r\n            DOSfree(availBlock[i]);\r\n          free(availBlock);\r\n          return err_out_of_memory;\r\n        }\r\n        block[allocatedBlocks++] = bl;  /* no access to this block */\r\n      }\r\n    }\r\n  }\r\n\r\n  /* Now, block[] contains the blocks that can't be used by the\r\n   * program, and availBlock[] contains the blocks that can be used.\r\n   * Those blocks will be released. */\r\n\r\n  for (i = 0; i < availBlocks; i++)\r\n    DOSfree(availBlock[i]);\r\n  free(availBlock);\r\n\r\n  /* If the program is to be loaded in upper memory, set the malloc\r\n   * strategy to 'first fit high', otherwise to 'first fit low'. */\r\n\r\n  dosSetAllocStrategy(upper_flag ? 0x80 : 0);\r\n  return OK;\r\n}\r\n\r\n/* loadfix_prepare(): Allocates all memory up to 1000:0000. */\r\n\r\n#if 0\r\nstatic int loadfix_prepare(void)\r\n{\r\n  struct MCB _seg *mcb;\r\n\r\n  mcbAssign(mcb, umbRegion[0].start);\r\n  \r\n  dosSetAllocStrategy(0);\r\n\r\n  while (FP_SEG(mcb) < 0x1000)\r\n  {\r\n    if (mcb->mcb_type != 'M' && mcb->mcb_type != 'Z')\r\n      return err_mcb_chain;\r\n\r\n    if (!mcb->mcb_ownerPSP)\r\n    {\r\n      word bl = DosAlloc(mcb->mcb_size);\r\n\r\n      if (bl != FP_SEG(mcb) + 1)  /* Did we get the block we wanted? */\r\n      \t{\r\n        return err_mcb_chain;\r\n        }\r\n\r\n      block[allocatedBlocks++] = bl;\r\n\r\n      if (bl + mcb->mcb_size > 0x1000)  /* Don't allocate more than necessary */\r\n        DOSresize(bl, 0x1000 - bl);\r\n    }\r\n    mcbNext(mcb);\r\n  }\r\n  return OK;\r\n}\r\n#else\r\n\r\n\r\n/* loadfix_prepare(): Allocates all memory up to 1000:0000. */\r\n\r\nstatic int loadfix_prepare(void)\r\n{\tunsigned bl;\r\n\r\n\tdosSetAllocStrategy(0x0);\r\n\r\n\twhile((bl = DosAlloc(1)) != 0) {\r\n\t\tif(bl >= 0x1000) {\r\n\t\t\tDOSfree(bl);\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tdprintf((\"loadfix: allocated 0x%04x\\n\",bl));\r\n\t\tDOSresize(bl, 0x1000 - bl);  \t\t\r\n\t        if (allocatedBlocks >= BLOCKMAX) {\r\n\t          DOSfree(bl);\r\n\t          return err_out_of_memory;\r\n\t        }\r\n\t\tblock[allocatedBlocks++] = bl;\r\n\t}\r\n\r\n\treturn OK;\r\n}\r\n\r\n#endif\r\n\r\noptScanFct(opt_lh)\r\n{\r\n  (void)arg;\r\n  switch(ch) {\r\n  case 'S': return optScanBool(optS);\r\n  case 'L': return optScanString(optL);\r\n  }\r\n  optErr();\r\n  return E_Useage;\r\n}\r\n\r\n\r\n/*  parseArgs(): parse the command line\r\n\r\n *  Only '/' is recognized as switch characters.\r\n *  The first argument not starting with '/' will be\r\n *  considered to be the filename.\r\n *\r\n *  The LOADFIX command only accepts the '?' switch.\r\n */\r\n\r\nstatic int parseArgs(char *cmdline, char **fnam, char **rest)\r\n{\r\n  char *c;\r\n\r\n  assert(fnam);\r\n  assert(rest);\r\n\r\n  if(leadOptions(&cmdline, loadfix_flag? 0: opt_lh, 0) != E_None)\r\n      return err_silent;\r\n\r\n  if((c = optL) != 0) {\r\n    int i, r;\r\n\r\n    /* If the /L option is present, we must not deallocate the\r\n    \tcontext */\r\n\tswapContext = FALSE;\r\n\r\n    /* Disable access to all UMB regions not listed here */\r\n    for (i = 1; i < umbRegions; i++)\r\n      umbRegion[i].access = 0;\r\n\r\n    r = 0;\r\n\r\n    do\r\n    {\r\n    dword region_minSize = 0xffff;  /* flag value, indicating no minsize was specified */\r\n\r\n    int region_number = (int)strtol(c, &c, 10);\r\n\r\n    if (*c == ',')\r\n    {\r\n    long larg;\r\n      c++;\r\n      if ((larg = strtol(c, &c, 10)) != -1L)\r\n      region_minSize = topara(larg);\r\n    }\r\n\r\n    if (region_number >= umbRegions)\r\n      displayString(TEXT_ERROR_REGION_WARNING, region_number);\r\n    else\r\n    {\r\n      if (!r && !region_number)\r\n      upper_flag = 0;\r\n\r\n      r++;\r\n      assert(region_minSize < 0x10000ul);\r\n      umbRegion[region_number].minSize = (unsigned)region_minSize;\r\n      umbRegion[region_number].access = 1;\r\n    }\r\n    }\r\n    while (*c++ == ';');\r\n    if(c[-1])\r\n            cmdline = \"\"; /* to cause an error later */\r\n  }\r\n\r\n  /* does a file name follow? */\r\n  if (!*cmdline)\r\n    return err_invalid_parms;\r\n\r\n  if (optS && !optL)\r\n    return err_invalid_parms;\r\n\r\n  /* The next argument is the file name. The rest of the command line\r\n   * are passed as parameters to the new program. */\r\n\r\n  if((*fnam = unquote(cmdline, c = skip_word(cmdline))) == 0)\r\n    return err_out_of_memory;\r\n\r\n  *rest = skipdm(c);\r\n\r\n  return OK;\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "shell/makefile",
    "content": "# $Id$\r\n#\r\n# Makefile for the FreeDOS kernel's command interpreter\r\n#\r\n# $Log$\r\n# Revision 1.11  2003/08/03 16:00:57  skaus\r\n# bugfix: /F (AutoFail) for the XMS_Swap variant\r\n#\r\n# Revision 1.10  2002/05/11 22:50:32  skaus\r\n# v0.83 Beta 40:\r\n# bugfix: ^Break detection after XMS-Swapping\r\n#\r\n# Revision 1.9  2002/05/11 22:10:40  skaus\r\n# v0.83 Beta 40:\r\n# bugfix: ^Break detection after XMS-Swapping\r\n#\r\n# Revision 1.8  2002/05/11 20:10:59  skaus\r\n# bugfix: ^Break detection after XMS-Swapping\r\n#\r\n# Revision 1.7  2002/04/23 16:34:51  skaus\r\n# chg: BUILD.BAT to handle XMS-Swap better\r\n#\r\n# Revision 1.6  2002/04/03 01:10:31  skaus\r\n# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n#\r\n# Revision 1.5  2002/04/02 23:36:37  skaus\r\n# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n#\r\n# Revision 1.4  2002/04/02 20:58:13  skaus\r\n# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n#\r\n# Revision 1.3  2002/04/02 18:09:31  skaus\r\n# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n#\r\n# Revision 1.2  2001/06/10 17:17:24  skaus\r\n# bugfix: Single point of configuration CONFIG.MAK/.H\r\n#\r\n# Revision 1.1  2001/04/12 00:09:06  skaus\r\n# chg: New structure\r\n# chg: If DEBUG enabled, no available commands are displayed on startup\r\n# fix: PTCHSIZE also patches min extra size to force to have this amount\r\n#    of memory available on start\r\n# bugfix: CALL doesn't reset options\r\n# add: PTCHSIZE to patch heap size\r\n# add: VSPAWN, /SWAP switch, .SWP resource handling\r\n# bugfix: COMMAND.COM A:\\\r\n# bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n# add: command MEMORY\r\n# bugfix: runExtension(): destroys command[-2]\r\n# add: clean.bat\r\n# add: localized CRITER strings\r\n# chg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n# \tvia STRINGS.LIB\r\n# add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n# add: fixstrs.c: prompts & symbolic keys\r\n# add: fixstrs.c: backslash escape sequences\r\n# add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n# chg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n# bugfix: IF is now using error system & STRINGS to report errors\r\n# add: CALL: /N\r\n#\r\n#\r\n\r\n.INCLUDE : ../_config.mk\r\n\r\n# Sources of this make target\r\nSRC = batch.c cmdtable.c command.c dummies.asm expalias.c init.c kswap.c \\\r\n\tloadhigh.c module.c redir.c ver.c\r\nOBJ = batch.obj cmdtable.obj command.obj dummies.obj expalias.obj init.obj \\\r\n\tkswap.obj loadhigh.obj module.obj redir.obj ver.obj\r\nHDR = ..\\config.h ..\\include/batch.h ..\\include/cmdline.h \\\r\n\t..\\include/command.h ..\\include/context.h ..\\include/crossjmp.h \\\r\n\t..\\include/cswap.h ..\\include/datefunc.h ..\\include/debug.h \\\r\n\t..\\include/keys.h ..\\include/kswap.h ..\\include/misc.h \\\r\n\t..\\include/module.h ..\\include/mux_ae.h ..\\include/nls.h \\\r\n\t..\\include/openf.h ..\\include/res.h ..\\include/resource.h \\\r\n\t..\\include/timefunc.h ..\\include\\large.inc ..\\include\\model.inc \\\r\n\t..\\include\\small.inc\r\n\r\nXMS_SWAP_PRE_OBJ = cb_catch.obj xms_crit.obj xms_brk.obj cswap.obj\r\nXMS_SWAP_ADD_OBJ = cswapc.obj\r\n\r\n.IF $(XMS_SWAP) == $(NULL)\r\nSRC += cb_catch.asm\r\nOBJ += cb_catch.obj\r\n.ELSE\r\nSRC += cswap.asm cswapc.c xms_crit.asm xms_brk.asm cb_catch.asm\r\nHDR += ../include/cswapc.h\r\nOBJ += $(XMS_SWAP_ADD_OBJ)\r\nPRE_OBJ = $(XMS_SWAP_PRE_OBJ)\r\n.ENDIF\r\n\r\n\r\n#\tDefault target\r\nall: com.exe\r\n\r\ndist : makefile.mak xms-swap.mak\r\n\r\n%.obj : %.asm ; $(NASM) $(NASMFLAGS) -f obj -F borland -o $@ $< >>errlist\r\n\r\n### Utils are required by build process\r\n.INIT .PHONY .SEQUENTIAL : verscheck $(CFG) __errl\r\n\r\n.IF $(THISMAKE) == $(LASTMAKE)\r\nverscheck :;\r\n.ELSE\r\nverscheck : \r\n\t@+-echo Changed Make parameters, already made files invalid!\r\n\t+-echo LASTMAKE = $(THISMAKE) >lastmake.mk\r\n\t$(RUNMAKE) clobber\r\n.IF $(CFG)\r\n\t$(RUNMAKE) $(CFG)\r\n.ENDIF\r\n.ENDIF\r\n\r\n__errl:\r\n\t@+-if exist errlist del errlist >nul\r\n\t-ctags *.c ..\\lib\\*.c ..\\cmd\\*.c \\freedos\\src\\lib\\suppl\\*.c\r\n\r\ncom.exe ?= _OBJS := $(PRE_OBJ) $(OBJ:s/c0.obj//)\r\n# STD_OBJ !:= C0.OBJ\r\ncom.exe com.map .UPDATEALL : $(PRE_OBJ) $(OBJ) ../cmd/cmds.lib ../lib/freecom.lib\r\n\t$(MAK_EXE)\r\n\r\n#MAKEDEP START\r\nexpalias.obj : expalias.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/context.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\ncommand.obj : command.c \\\r\n\t ../config.h ../context.h_c ../err_fcts.h ../include/batch.h \\\r\n\t../include/cmdline.h ../include/command.h ../include/crossjmp.h \\\r\n\t../include/cswap.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/kswap.h ../include/misc.h ../include/mux_ae.h \\\r\n\t../include/nls.h ../include/openf.h ../include/timefunc.h ../strings.h\r\nmodule.obj : module.c \\\r\n\t ../config.h ../context.h_c ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/kswap.h ../include/misc.h \\\r\n\t../include/module.h ../include/res.h ../include/resource.h \\\r\n\t../include/timefunc.h\r\nkswap.obj : kswap.c \\\r\n\t ../config.h ../context.h_c ../err_fcts.h ../include/command.h \\\r\n\t../include/context.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/kswap.h ../include/misc.h ../include/timefunc.h\r\nver.obj : ver.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h ../strings.h\r\ninit.obj : init.c \\\r\n\t ../config.h ../context.h_c ../err_fcts.h ../include/cmdline.h \\\r\n\t../include/command.h ../include/context.h ../include/cswap.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/keys.h \\\r\n\t../include/kswap.h ../include/misc.h ../include/module.h \\\r\n\t../include/timefunc.h ../strings.h\r\ncmdtable.obj : cmdtable.c \\\r\n\t ../config.h ../include/command.h ../include/datefunc.h \\\r\n\t../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h\r\nloadhigh.obj : loadhigh.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h ../strings.h\r\nbatch.obj : batch.c \\\r\n\t ../config.h ../err_fcts.h ../include/batch.h ../include/cmdline.h \\\r\n\t../include/command.h ../include/datefunc.h ../include/debug.h \\\r\n\t../include/misc.h ../include/timefunc.h \\\r\n\t/freedos/src/include/../include/dfn.h\r\ndummies.obj : dummies.asm \\\r\n\t .\\..\\include\\large.inc .\\..\\include\\model.inc .\\..\\include\\small.inc\r\nredir.obj : redir.c \\\r\n\t ../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \\\r\n\t../include/datefunc.h ../include/debug.h ../include/misc.h \\\r\n\t../include/timefunc.h\r\nDYNSOURCES =\r\n#MAKEDEP STOP\r\n\r\ncswapc.c : ../include/cswap.h ../include/misc.h\r\n\r\nxms_crit.asm : ../criter/criter.asm\r\n\r\nclobber : clean\r\n\t$(RM) $(RMFLAGS) *.com *.cln makefile.mak com.exe *.cfg\r\n\r\nclean :\r\n\t$(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj *.exe $(CFG) *.dmp com.com tags errlist\r\n\r\n.IF $(XMS_SWAP) == $(NULL)\r\n\r\nmakefile.mak : makefile command.m1 command.m2\r\n\t+copy command.m1 + $(mktmp command.exe : \\44(CFG) $(OBJ:t\" \\\\\\\\\\\\n\\\\t\") \\n\\t\\44(LD) /m/s/l /c /d @&&|\\n\\44(LIBPATH)\\\\c0s.obj+\\n$(OBJ:t\"+\\\\n\")\\n) + command.m2 $@\r\n\r\nALL_OBJ = $(XMS_SWAP_ADD_OBJ) $(OBJ:s/cb_catch.obj//)\r\nxms-swap.mak : makefile command.m1 command.m2\r\n\t+copy command.m1 + $(mktmp command.exe : \\44(CFG) $(ALL_OBJ:t\" \\\\\\\\\\\\n\\\\t\") $(XMS_SWAP_PRE_OBJ)\\n\\t\\44(LD) /m/s/l /c /d @&&|\\n\\44(LIBPATH)\\\\c0s.obj+\\n$(XMS_SWAP_PRE_OBJ)+\\n$(ALL_OBJ:t\"+\\\\n\")\\n) + command.m2 $@\r\n\r\n.ENDIF\r\n"
  },
  {
    "path": "shell/makefile.mak",
    "content": "CFG_DEPENDENCIES = makefile.mak ../strings.h\r\n\r\nTOP = ..\r\n!include \"$(TOP)/config.mak\"\r\n\r\nall: command.exe\r\n\r\nOBJ1 =\t$(OBJC0) cb_catch.obj termhook.obj\r\n!if $(XMS_SWAP)0 == 0\r\nOBJ2 =\tdummies.obj\r\n!else\r\nOBJ2 =\txms_crit.obj\\\r\n\txms_brk.obj\\\r\n\txms_2e.obj\\\r\n\tcswap.obj\\\r\n\tcswapc.obj\r\n!endif\r\nOBJ3 =\tbatch.obj\\\r\n\tcmdtable.obj\\\r\n\tcommand.obj\\\r\n\texpalias.obj\\\r\n\tinit.obj\\\r\n\tkswap.obj\\\r\n\tloadhigh.obj\\\r\n\tmodule.obj\r\nOBJ4 =\tredir.obj\\\r\n\tver.obj\r\nLIBS = \t..$(DIRSEP)cmd$(DIRSEP)cmds.lib ..$(DIRSEP)lib$(DIRSEP)freecom.lib \\\r\n..$(DIRSEP)strings$(DIRSEP)strings.lib \\\r\n$(SUPPL_LIB_PATH)$(DIRSEP)suppl_$(SHELL_MMODEL).lib\r\n\r\ncommand.rsp : $(ECHOTODEP) makefile.mak\r\n\t$(RMFILES) command.rsp\r\n\t$(ECHOTO) command.rsp $(OBJ1)+\r\n\t$(ECHOTO) command.rsp $(OBJ2)+\r\n\t$(ECHOTO) command.rsp $(OBJ3)+\r\n\t$(ECHOTO) command.rsp $(OBJ4)\r\n\t$(ECHOTO) command.rsp command.exe\r\n\t$(ECHOTO) command.rsp command.map\r\n\t$(ECHOTO) command.rsp $(LIBS)+\r\n\t$(ECHOTO) command.rsp $(LIBC)\r\n\r\ncommand.exe : $(CFG) $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(LIBS) $(LD_RSP)\r\n\t$(LD)\r\n"
  },
  {
    "path": "shell/module.c",
    "content": "/* $Id$\r\n *\tSpecial FreeCOM defuinitions for the module management\r\n *\r\n * 2000/07/12 ska\r\n * started\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"mcb.h\"\r\n#include \"suppl.h\"\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/debug.h\"\r\n#include \"../include/module.h\"\r\n#include \"../include/res.h\"\r\n#include \"../include/kswap.h\"\r\n#include \"../include/misc.h\"\r\n\r\n#ifdef FREECOM_NEED_MODULES\r\n\r\nstatic int loadModule (res_majorid_t major,\r\n                       res_minorid_t minor,\r\n                       unsigned long length,\r\n                       int fd,\r\n                       void *const arg) {\t\r\n\tword segm;\r\n\r\n        (void)major;\r\n\tif(length > 0xfffful) {\r\n\t\tdprintf((\"[CRITER resource too large.]\\n\"));\r\n\t\treturn 0;\r\n\t}\r\n\tswitch(minor) {\r\n\tcase 0x00:\t\t/* CRITER autofail */\r\n\t\tif(!autofail) break;\r\n\t\tdprintf((\"[INIT: Loading AutoFail context]\\n\"));\r\n\t\tgoto loadMod;\r\n\r\n\tcase 0x03:\t\t/* CRITER code & strings */\r\n\t\tif(autofail) break;\r\n\t\tdprintf((\"[INIT: Loading Interactive context]\\n\"));\r\n\r\n\tloadMod:\r\n\t\t/* If we reach here and swapOnExec == ERROR\r\n\t\t\t--> kernel does not allow swapping\r\n\t\t\t<-> each instance is loading its own context\r\n\t\t\t<-> the block is loaded is not detached from this instance */\r\n\t\tsegm = allocPermBlk((unsigned)length, 0x82);\r\n\t\tif(!segm) {\r\n\t\t\tdprintf((\"[Out of memory loading CRITER module.]\\n\"));\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif(farread(fd, MK_FP(segm, 0), (unsigned)length) != (unsigned)length) {\r\n\t\t  \tdprintf((\"[Error reading CRITER module.]\\n\"));\r\n\t\t  \tfreeSysBlk(segm);\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tregisterCriterRepeatCheckAddr(MK_FP(segm, peekw(segm, length - 2)));\r\n\t\t*(word *)arg = segm;\r\n\t\treturn 1;\t\t/* stop enumRes() */\r\n\r\n#ifdef DEBUG\r\n\tdefault:\r\n\t\tdprintf((\"Error: Unsupported minor resource ID: %u\\n\"\r\n\t\t , minor) );\r\n\t\tbreak;\r\n#endif\r\n\t}\r\n\r\n\treturn 0;\t\t/* Other minor IDs are happily ignored */\r\n}\r\n\r\n\r\n/* Returns the pointer to the context pointer of the Critical Error\r\n\thandler and, if not loaded so far, loads it */\r\nkswap_p modContext(void)\r\n{\tword segm;\r\n\r\n\tsegm = 0;\r\n\tenumResources(RES_ID_CRITER, loadModule, &segm);\r\n#ifdef DEBUG\r\n\tif(segm)\r\n\t\tdprintf((\"[CRITER loaded to segment 0x%04x.]\\n\", segm));\r\n#endif\r\n\r\n\treturn (kswap_p)MK_SEG_PTR(kswap_t, segm);\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "shell/redir.c",
    "content": "/* $Id$\r\n * REDIR.C\r\n *\r\n * Comments:\r\n *\r\n * 12/15/95 (Tim Norman)\r\n * started.\r\n *\r\n * 12 Jul 98 (Hans B Pufal)\r\n * - Rewrote to make more efficient and to conform to new command.c and\r\n *   batch.c processing.\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 1998/10/27 ska\r\n * - bugfix: get_redirection() failed for non-paired quotes\r\n * - changed: joined to loop for checking for pipes & redirections\r\n * - changed: allocate the filename of redirection here to make the\r\n *      allocated space fit tightly\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <assert.h>\r\n#include <ctype.h>\r\n#include <fcntl.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/cmdline.h\"\r\n#include \"../include/command.h\"\r\n#include \"../err_fcts.h\"\r\n\r\nstatic int is_redir(char c)\r\n{\r\n  return (c == '<') || (c == '>') || (c == '|');\r\n}\r\n\r\nint get_redirection(char *s, char **ifn, char **ofn, int *ofatt)\r\n{\r\n  /*\r\n   * Gets the redirection info from the command line and copies the\r\n   * file names into ifn and ofn removing them from the command line.\r\n   * The names are allocated here and passed back to the caller, on\r\n   * malloc() failure, -1 is returned. These names are trimmed,\r\n   * meaning they do not contain any leading or trailing whitespaces.\r\n   *\r\n   * Converts remaining command line into a series of null terminated\r\n   * strings defined by the pipe char '|'. Each string corresponds\r\n   * to a single executable command. A double null terminates the\r\n   * command strings.\r\n   *\r\n   * Check for, but do not implement, output append redirect.\r\n   *\r\n   * Return number of command strings found.\r\n   *\r\n   */\r\n\r\n  int num = 1;\r\n  int ch;\r\n\r\n  char *dp = s;\r\n  char *sp = s;\r\n\r\n  assert(s);\r\n  assert(ifn);\r\n  assert(ofn);\r\n  assert(ofatt);\r\n\r\n  /* find and remove all the redirections first */\r\n\r\n  while ((ch = *dp++ = *sp++) != 0)\r\n    switch (ch)\r\n    {\r\n      case '^':               /* escape special character */\r\n        if (is_redir(*sp))\r\n          dp[-1] = *sp++;\r\n        break;\r\n      case '\"':               /* No redirects inside quotes */\r\n/*      case '\\'':\t\t\tsingle quotes don't quote ska*/\r\n        {\r\n          char *p;\r\n          int len;\r\n\r\n          /* If there is no closing quote, then go to end of line. */\r\n          if ((p = strchr(sp, ch)) == 0)\r\n          {\r\n            p = sp + strlen(sp) - 1;\r\n          }\r\n\r\n          /* closing quote found, move that area */\r\n          /* need memmove() because both areas overlap each other */\r\n          memmove(dp, sp, len = p - sp + 1);\r\n          dp += len;\r\n          sp += len;\r\n\r\n        }\r\n        break;\r\n\r\n      case '<':\r\n      case '>':\r\n        {\r\n          /* MS-DOS ignores multiple redirection symbols and uses the last */\r\n          /* redirection, so we'll emulate that and not check */\r\n\r\n          char **op = (ch == '<') ? ifn : ofn;\r\n          char *p;\r\n\r\n          if ((ch == '>') && (*sp == '>'))      /* Append request ? */\r\n          {\r\n            *ofatt = O_CREAT | O_APPEND | O_WRONLY;\r\n            sp++;\r\n          }\r\n\r\n          p = sp = ltrimcl(sp);\r\n\r\n          while (*sp && !is_redir(*sp) && !isargdelim(*sp)) ++sp;\r\n          free(*op);            /* ignore any previous one */\r\n          ch = *sp;\r\n          *sp = '\\0';\r\n          if ((*op = strdup(p)) == 0)\r\n          {                     /* out of mem */\r\n            error_out_of_memory();\r\n            return -1;\r\n          }\r\n\r\n          *sp = ch;\r\n          --dp;                 /* ignore the already copied '<' or '>' */\r\n        }\r\n        break;\r\n\r\n      case '|':\r\n\r\n        dp[-1] = '\\0';          /* overwrite the already copied '|' */\r\n        ++num;\r\n        break;\r\n\r\n    }                           /* end switch */\r\n\r\n  return num;\r\n}\r\n"
  },
  {
    "path": "shell/termhook.asm",
    "content": "; File:\r\n;                          termhook.asm\r\n; Description:\r\n;                       command.com termination hook\r\n;\r\n; This program is free software; you can redistribute it and/or\r\n; modify it under the terms of the GNU General Public License\r\n; as published by the Free Software Foundation; either version\r\n; 2, or (at your option) any later version.\r\n;\r\n; This program is distributed in the hope that it will be useful, but\r\n; WITHOUT ANY WARRANTY; without even the implied warranty of\r\n; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See\r\n; the GNU General Public License for more details.\r\n;\r\n; You should have received a copy of the GNU General Public\r\n; License along with this program; see the file COPYING.  If not,\r\n; write to the Free Software Foundation, 675 Mass Ave,\r\n; Cambridge, MA 02139, USA.\r\n;\r\n;\r\n\r\n%include \"../include/model.inc\"\r\n%include \"../include/stuff.inc\"\r\n\r\nsegment _TEXT\r\n\r\n\tcglobal termAddr\r\ntermAddr:\r\nterminationAddressOffs\tDW 0\r\nterminationAddressSegm\tDW 0\r\n\r\n\tcextern canexit\r\n\tcglobal myPID\r\nmyPID\tDW 0\r\n\tcglobal origPPID\r\norigPPID DW 0\r\n\r\n\t;; central PSP:0xa hook <-> may be called in every circumstance\r\n\tcglobal terminateFreeCOMHook\r\nterminateFreeCOMHook:\r\n%ifndef XMS_SWAP\r\n\tdec BYTE [canexit]\r\n%endif\r\n\tmov ax, cs\t\t\t\t; setup run environment (in this module)\r\n\tmov ds, ax\r\n%ifdef XMS_SWAP\r\n\textern localStack\r\n\tmov ss, ax\r\n\tmov sp, localStack\r\n\r\n\t; Next time we hit here it's != 1 --> no zero flag --> I_AM_DEAD status\r\n\tdec BYTE [canexit]\r\n%endif\r\n\tjnz I_AM_DEAD\r\n\r\n\tmov ax, [myPID]\t\t; our own PSP [in case we arrived here\r\n\tmov es, ax\t\t\t\t; in some strange ways]\r\n\r\n\t; Make sure the current PSP hasn't patched to nonsense already\r\n\tmov bx, ax\r\n\tmov ah, 50h\t\t\t\t; Set PSP\r\n\tint 21h\r\n\r\n\t; Reset old termination address\r\n\tmov ax, [terminationAddressOffs]\r\n\tmov [es:0ah], ax\r\n\tmov ax, [terminationAddressSegm]\r\n\tmov [es:0ch], ax\r\n\r\n\t; Drop our \"Shell\" privileges\r\n\tmov ax, [origPPID]\t\t; original parent process ID\r\n\tmov [es:16h], ax\r\n\r\n\t; Kill the XMS memory block\r\n%ifdef XMS_SWAP\r\n\textern xms_kill\r\n\tcall xms_kill\r\n%endif\r\n\r\n\t; Now, DOS-4C should proceed correctly\r\n\tmov ax,04cffh\t\t\t\t\t; and die ...\r\n\tint 21h\r\n\r\n\r\nI_AM_DEAD:\t\t\t\t\t\t\t\t; process 0 can't terminate ...\r\n\tmov dx, dead_loop_string\r\n\tmov ah, 9\r\n\tint 21h\r\nI_AM_DEAD_loop:\r\n\tint3\r\n\tsti\r\n\thlt\r\n\tjmp short I_AM_DEAD_loop\r\n\r\ndead_loop_string\tDB 13,10,7,'Cannot terminate permanent FreeCOM instance'\r\n\tDB 13,10,'System halted ... reboot or power off now $'\r\n"
  },
  {
    "path": "shell/ver.c",
    "content": "/* $Id$\r\n * VER.C\r\n *\r\n *  06/30/98 (Rob Lake)\r\n *      rewrote ver command to accept switches, now ver alone prints\r\n *      copyright notice only.\r\n *\r\n * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added config.h include\r\n *\r\n * 30-Jul-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - added text about where to send bug reports and get updates.\r\n *\r\n * 13-Sep-1998 (John P Price <linux-guru@gcfl.net>)\r\n * - change /r to print info. /d shows redistribution info now.\r\n *\r\n * 30-Jan-1999 (John P Price <linux-guru@gcfl.net>)\r\n * - changed /r to show FreeDOS kernel version\r\n *\r\n * 1-Apr-2000 0.79 Henry Voigt <Henry.Voigt@gmx.de>\r\n * bugfix: ver.c : options uninitilized\r\n *\r\n * 2000/06/22 ska\r\n *\tnew version: v0.79b\r\n *\r\n * 2000/12/10 ska\r\n *\tnew minor version: v0.80\r\n *\r\n * 2001/02/16 ska\r\n * bugfix: VER (without option) displays too much information\r\n * chg: using strings (except FreeCOM's own name)\r\n */\r\n\r\n#include \"../config.h\"\r\n\r\n#include <stdio.h>\r\n#include <dos.h>\r\n\r\n#include \"../include/command.h\"\r\n#include \"../include/cmdline.h\"\r\n#include \"../err_fcts.h\"\r\n#include \"../strings.h\"\r\n\r\n#include \"../version.h\"\r\nconst char shellver[] = FREECOM_VERSION  \" - \"\r\n#if defined(__BORLANDC__)\r\n\t\"BORLANDC\"\r\n#elif defined(__TURBOC__)\r\n\t\"TURBOC\"\r\n#elif defined(__WATCOMC__)\r\n\t\"WATCOMC\"\r\n#elif defined(__GNUC__)\r\n\t\"GNUC\"\r\n#endif\r\n#ifdef FEATURE_XMS_SWAP\r\n\t\" - XMS_Swap\"\r\n#endif\r\n;\r\nstatic const char shelldate[] = __DATE__ \" \" __TIME__;\r\nconst char shellname[] = \"FreeCom\";\r\n\r\n#if 0\r\nvoid short_version(void)\r\n{\r\n  printf(\"\\n%s version %s [%s]\\n\", shellname, shellver, shelldate);\r\n}\r\n#endif\r\n\r\n#ifdef INCLUDE_CMD_VER\r\n\r\nstatic int optR, optW, optD, optC;\r\n\r\noptScanFct(opt_ver)\r\n{\r\n  (void)arg;\r\n  switch(ch) {\r\n  case 'R': return optScanBool(optR);\r\n  case 'W': return optScanBool(optW);\r\n  case 'D': return optScanBool(optD);\r\n  case 'C': return optScanBool(optC);\r\n  }\r\n  optErr();\r\n  return E_Useage;\r\n}\r\n\r\n\r\n/*\r\n *  display shell version info internal command.\r\n *\r\n *\r\n */\r\nint cmd_ver (char * rest) {\r\n  char **argv;\r\n  int argc, opts, ec = E_None;\r\n\r\n#if 0\r\n  short_version();\r\n#else\r\n  printf(\"\\n%s version %s [%s]\\n\", shellname, shellver, shelldate);\r\n#endif\r\n\r\n\toptR = optW = optD = optC = 0;\r\n\r\n  if((argv = scanCmdline(rest, opt_ver, 0, &argc, &opts)) == 0)\r\n    return 1;\r\n\r\n  /* arguments are simply ignored */\r\n\r\n  if(optR) {                         /* version information */\r\n        unsigned int major, minor;\r\n        IREGS regs;\r\n        regs.r_ax = 0x3306;\r\n        regs.r_bx = 0;\r\n        intrpt(0x21, &regs);\r\n        major = regs.r_bx & 255;\r\n        minor = regs.r_bx >> 8;\r\n        regs.r_ax = 0x3000;\r\n        intrpt(0x21, &regs);\r\n        if (major == 0) {\r\n          major = regs.r_ax & 255;\r\n          minor = regs.r_ax >> 8;\r\n        }\r\n        displayString(TEXT_MSG_VER_DOS_VERSION, major, minor);\r\n\r\n        if ((regs.r_bx >> 8) == 0xfd && (regs.r_bx & 0xFF) == 0xff)\r\n        {\r\n          displayString(TEXT_MSG_VER_EARLY_FREEDOS);\r\n        }\r\n        else\r\n        {\r\n           unsigned char far * pstart;\r\n           unsigned char far * pend;\r\n/*         displayString(TEXT_MSG_VER_LATER_FREEDOS\r\n           , regs.r_cx >> 8, regs.r_cx & 0xFF, regs.r_bx & 0xFF);\r\n           , 2, 0, regs.r_bx & 0xFF ); */\r\n           regs.r_ax = 0x33FF;\r\n           regs.r_dx = 0;\r\n           intrpt( 0x21, &regs );\r\n           if (regs.r_dx) {\r\n             pstart = MK_FP( regs.r_dx, regs.r_ax );\r\n             for (pend = pstart; *pend; ++ pend) /* empty loop body */;\r\n             while (pend > pstart &&\r\n               (pend[-1] == ' ' || pend[-1] == 9\r\n                 || pend[-1] == 10 || pend[-1] == 13)) {\r\n               -- pend;\r\n             }\r\n             printf( \"%.*Fs\\n\", pend - pstart, pstart);\r\n           }\r\n        }\r\n      }\r\n      if (optW)\r\n      {                         /* Warranty notice */\r\n        displayString(TEXT_MSG_VER_WARRANTY);\r\n      }\r\n      if (optD)\r\n      {                         /* Redistribution notice */\r\n        displayString(TEXT_MSG_VER_REDISTRIBUTION);\r\n      }\r\n      if (optC)\r\n      {                         /* Developer listing */\r\n        displayString(TEXT_MSG_VER_DEVELOPERS);\r\n      }\r\n\r\n  freep(argv);\r\n  return ec;\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "shell/wlinker.bat",
    "content": "@echo off\r\nms2wlink %1 %2 %3 %4 %5 %6 %7 %8 %9 ,,,, > tmp.lnk\r\necho op map,statics,verbose,stack=4k >> tmp.lnk\r\ncall wlink @tmp.lnk\r\ndel tmp.lnk\r\n"
  },
  {
    "path": "shell/xms_2e.asm",
    "content": "; $Id$\r\n;\tInt2e handler for XMS Swap\r\n;\tvariant\r\n; int process_input(int xflag, char *commandline)\r\n\r\n%if 1\r\n\r\n%include \"../include/model.inc\"\r\n%include \"../include/stuff.inc\"\r\nsegment _TEXT\r\n\r\ncglobal lowlevel_int_2e_handler\r\n    lowlevel_int_2e_handler:\r\n        mov ax, 0FFFFh\r\n        iret\r\n\r\n%else\r\n\r\nsegment _TEXT class=CODE\r\n\r\nextern _residentCS, _mySS, _mySP, _XMSsave, _XMSdriverAdress, _SwapTransientSize, _my2e_parsecommandline, SWAPXMSdirection, _SwapResidentSize\r\n%define callXMS     call far [cs:_XMSdriverAdress]\r\n%define currentSegmOfFreeCOM    _XMSsave+8\r\n\r\n    global myfar2e_parsecommandline\r\nmyfar2e_parsecommandline:\r\n    call _my2e_parsecommandline\r\n    retf\r\n\r\n\tglobal _lowlevel_int_2e_handler\r\n_lowlevel_int_2e_handler:\r\n        cld\r\n        push si\r\n;       lss sp,[_mySP]\r\n        mov ss,[cs:_mySS]\r\n        mov sp,[cs:_mySP]\r\n;       mov cs,[_residentCS]\r\n;       mov ds,sp\r\n;       mov es,ds\r\n;       mov ds,ss\r\n        mov ah,48h       ; move into conventional memory\r\n        mov bx,[cs:_SwapTransientSize]\r\n        int 21h\r\n        jc swaperr\r\n        mov bx,ax\r\n        sub bx,[cs:currentSegmOfFreeCOM]\r\n        push bx\r\n        mov [cs:currentSegmOfFreeCOM],ax\r\n        call SWAPXMSdirection\r\n        mov ah,0bh\r\n        mov si,_XMSsave\r\n        callXMS\r\n;        call SWAPXMSdirection\r\n        pop bx\r\n        cmp ax,1\r\n        jnz swaperr\r\n;       mov ax,[_mySS]\r\n;       add ax,bx\r\n;       mov ss,ax\r\n;       mov sp,[_mySP]\r\n%if 0\r\n        mov ax,[_mySS]\r\n        sub ax,10\r\n        mov ss,ax\r\n        mov sp,[_mySP]\r\n%endif\r\n       ; calling stuff here\r\n;       push es\r\n        push ds\r\n        pop si\r\n        push si\r\n        mov ds,sp\r\n;       push word 1\r\n;       call _process_input\r\n        call far [myfar2e_parsecommandline]\r\n%if 0\r\n        push ax\r\n        mov ah,0bh       ; move into XMS again\r\n        mov si,_XMSsave\r\n        callXMS\r\n        call SWAPXMSdirection\r\n        pop ax\r\n%endif\r\n        jmp finish\r\nswaperr:\r\n        mov ax,0FFFFh\r\nfinish:\r\n        iret\r\n%endif\r\n"
  },
  {
    "path": "shell/xms_brk.asm",
    "content": "; $Id$\r\n;\tCriter and ^Break handler for external programs for XMS Swap\r\n;\tvariant\r\n\r\n%include \"../include/model.inc\"\r\n%include \"../include/stuff.inc\"\r\nsegment _TEXT\r\n\r\n\tcglobal lowlevel_cbreak_handler\r\nlowlevel_cbreak_handler:\r\n%include \"../criter/dmy_cbrk.asm\"\r\n"
  },
  {
    "path": "shell/xms_crit.asm",
    "content": "; $Id$\r\n;\tCriter and ^Break handler for external programs for XMS Swap\r\n;\tvariant\r\n\r\n%include \"../include/model.inc\"\r\nsegment _TEXT\r\n\r\n;; If the include is in here, NASM locks up, suck all CPU\r\n;\tglobal _lowlevel_cbreak_handler\r\n;_lowlevel_cbreak_handler:\r\n;%include \"../criter/dmy_cbrk.asm\"\r\n\r\n%define XMS_SWAP_CRITER\r\n%define NO_RESOURCE_BLOCK\r\n\r\n%include \"../criter/criter.asm\"\r\n"
  },
  {
    "path": "strings/CHANGED",
    "content": "add: EXIT: unless loaded with /P\r\nadd: useage example into FOR\r\nren: TEXT_ERROR_BAD_VERABLE into TEXT_ERROR_BAD_VARIABLE\r\n"
  },
  {
    "path": "strings/DEFAULT.err",
    "content": "# $Id$\n#\n# Critical error national customization file\n#\n#\tLanguage: English\n#\tCodepage: ASCII (7bit) / any codepage\n#\tAuthor:   FreeCOM maintainer\n# \n# The critical error (criter) handler receives some information\n# from the kernel about what error condition happens, generates some\n# human friendly message from it, requests the user's opinion about\n# how to proceed and, finally, returns to the kernel.\n# \n# The human friendly message is generated using one of the following\n# templates:\n# BLOCK_DEVICE (for criters on block devices)\n# \tError %1 drive %A: %2 area: %3\n# -and- CHAR_DEVICE (for criters on character devices)\n# \tError %1 device %A: %3\n# \n# Two-character sequences, which first character is a percent sign '%',\n# are placeholders for other information:\n# %% -> a single percent sign\n# %1 -> either READ or WRITE, depending on what kind of operation\n# \tcaused the criter\n# %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA\n# %3 -> the actual error string; these are the strings associated to\n# \ta number 0 through N, and must correspond to the number passed in\n# \tlowbyte(DI) to the criter handler (see RBIL INT-24 for details)\n# %A -> drive letter (for block devices); name of device (character devices)\n# \n# Below the line describing the error the user is prompted for the action\n# to proceed. This line is dynamically constructed depending on which\n# action are available at all. The full line may look like this:\n# \t(A)bort, (I)gnore, (R)etry, (F)ail?_\n# \n# The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They\n# should indicate which user response keys is associated with them;\n# suggested is to use the first letter and enclose it in parentheses.\n# The delimiter \", \" can be defined with DELIMITER and is the same\n# for all slots.\n# The \"? \" sequence is defined by QUESTION.\n# The order of the actions is fixed and cannot be customized.\n# \n# With each action a number of user response keys must be associated.\n# They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ...\n# strings. Because the key is searched in the same format as returned\n# by INT-16-00, both upper and lower case must be specified and\n# certain special keys cannot be used.\n# \n# The individual error strings are defined by the #: lines, where\n# the hash sign '#' refers to the number the kernel passes to the\n# criter handler. The UNKNOWN string is displayed for all error\n# numbers not specified.\n#\n# NOTE #1: The percent rule applies to _all_ criter strings!\n# NOTE #2: Each string occupies exactly one line.\n# NOTE #3: Any leading or trailing whitespaces are removed. Prefix the\n#\tfirst or suffix the last whitespace with '%.' (one percent sign and\n#\tone dot). This sequence is removed from the string totally.\n# NOTE #4: To embed any character use: %&## (one percent sign,\n#\t\tone ampersand and exactly two hexa-decimal digits)\n\n## Primary strings\nS2\nBLOCK_DEVICE: Error %1 drive %A: %2 area: %3\nS3\nCHAR_DEVICE: Error %1 device %A: %3\n\n## kind of operation\nS0\nREAD: reading from\nS1\nWRITE: writing to\n\n## kind of failed area of block devices\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: root\nS7\nDATA: data\n\n## action strings\nS8\nIGNORE: (I)gnore\nS9\nRETRY: (R)etry\nS10\nABORT: (A)bort\nS11\nFAIL: (F)ail\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: iI\nKEYS_RETRY:  rR\nKEYS_ABORT:  aA\nKEYS_FAIL:   fF\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN: Unknown error code\nS15\n0: write-protection violation attempted\n1: unknown unit for driver\n2: drive not ready\n3: unknown command given to driver\n4: data error (bad CRC)\n5: bad device driver request structure length\n6: seek error\n7: unknown media type\n8: sector not found\n9: printer out of paper\n10: write fault\n11: read fault\n12: general failure\n13: sharing violation\n14: lock violation\n15: invalid disk change\n16: FCB unavailable\n17: sharing buffer overflow\n18: code page mismatch\n19: out of input\n20: insufficient disk space\n"
  },
  {
    "path": "strings/DEFAULT.lng",
    "content": "# $Id$\n#\n# FreeCOM national customization file\n#\n#\tLanguage: English\n#\tCodepage: ASCII (7bit) / any codepage\n#\tAuthor:   FreeCOM maintainer\n# Changelog by W. Spiegl (2024-12-21).\n# TEXT_CMDHELP_IF: added /I string==STRING\n# TEXT_CMDHELP_ECHO: added ECHO.\n# TEXT_CMDHELP_SHIFT: fixed (%0) to be (%%0).\n# Changelog by W. Spiegl (2024-10-15):\n# \"FOR - Example: replaced %% by %%%%\"\n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retrieve the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#\t:TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n# If there is a percent sign (%) appended to the version, the printf()\n# format string %-style placeholders are compared for the strings. The\n# sign need to be set in DEFAULT.lng only.  Use a double %, %% to display a %.\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carriage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause an user interaction. Those ones should be in sync\n# with the issued text. To define how to interpret a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#YyNn\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitrary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the question\n# mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readability of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH#0%\nInvalid switch. - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH#0%\nInvalid switch. - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION#0%\nIll-formed option: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG#0%\nOption '%s' can not have an argument\n.\n\n:TEXT_ERROR_OPT_NOARG#0%\nOption '%s' must have an argument\n.\n\n:TEXT_INVALID_NUMBER#0%\nInvalid number specified in '%s'\n.\n\n:TEXT_ERROR_CLOSE_QUOTE#0%\nMissing closing quote: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nCan not create temporary file\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0%\nToo many parameters. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nToo many parameters.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER#0%\nInvalid parameter. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nPath not found.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nFile not found.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND#0%\nFile not found. - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING#0%\nRequired parameter missing.\n.\n\n:TEXT_ERROR_INVALID_DRIVE#0%\nInvalid drive %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2%\nBad command or filename - \"%s\".\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nOut of memory error.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nAllocation of DOS memory failed.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nCannot pipe!  Cannot open temporary file!\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE#0%\nLine #%ld in batchfile '%s' too long.\n.\n\n:TEXT_ERROR_BFILE_VANISHED#0%\nBatchfile '%s' not found.\n.\n\n:TEXT_ERROR_BFILE_LABEL#0%\nBatchfile '%s' does not contain label '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1%\n%s failed for '%s'.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR#0%\nCan not set environment variable '%s'.\nEnvironment full?\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND#0%\nEnvironment variable '%s' not found.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nNo environment. Maybe memory short. Specify /E option.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1%\nCan not set alias '%s'. Alias space full?\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1%\nAlias '%s' not found.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nNo alias space. Maybe memory short.\n.\n\n:TEXT_ERROR_SYNTAX_STR#0%\nSyntax error. - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nSyntax error.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG#0%\nFilename too long. - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY#0%\nCannot copy '%s' to itself\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nCommand line too long after alias expansion!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nCommandline longer than 125 characters.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1%\nInvalid history size '%s'.\n.\n\n:TEXT_HISTORY_EMPTY#1\nCommand line history empty.\n.\n\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nMCB chain corrupt, or MS-DOS incompatible system.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR#0%\nUndefined error %d.\n.\n\n:TEXT_ERROR_REGION_WARNING#0%\nIllegal memory region %d - ignored.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nMust specify ON or OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nBad variable specification.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR: IN missing.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nOne or both parentheses missing.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR: DO missing.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR: No command after DO statement.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE#0%\nCan not redirect input from file '%s'.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE#0%\nCan not redirect output to file '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nEmpty redirection.\n.\n\n:TEXT_ERROR_INVALID_DATE\nInvalid date.\n.\n\n:TEXT_ERROR_INVALID_TIME\nInvalid time.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nNo label specified for GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nThe CTTY command has been excluded from this COMMAND.COM.\n.\n\n:TEXT_ERROR_NORW_DEVICE#0%\nInvalid or no read-write device '%s'.\n.\n\n:TEXT_ERROR_CTTY_DUP#0%\nFailed to change file descriptors to TTY '%s'.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\n/L not implemented yet.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\n/U not implemented yet.\n.\n\n:TEXT_ERROR_WRITING_DEST\nError writing to destination.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE#0%\nUnable to open source. - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE#0%\nUnable to open file '%s'\n.\n\n:TEXT_ERROR_READ_FILE#0%\nUnable to read from file '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE#0%\nUnable to write to file '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\nThe concatenation character '+' cannot lead the arguments.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nThe concatenation character '+' cannot trail the arguments.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nNothing to do.\n.\n\n:TEXT_ERROR_COPY\nCOPY failed\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: missing filename\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: missing number\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: invalid number\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: Missing command\n.\n\n:TEXT_NOT_IMPLEMENTED_YET\nSorry...not implemented yet.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nFailed to load messages into memory.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nThe /MSG option has been excluded from this COMMAND.COM.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1%\n%u items displayed.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nCorrupt command line. This is an internal error and is related to\nthe system COMMAND.COM runs in. Please report this error.\n.\n\n:TEXT_QUOTED_C_OR_K#1\nThe /C and /K options cannot be quoted, they are ignored.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1%\nThe path to COMMAND.COM must be fully qualified!\nThat means including drive letter and beginning with a backslash.\nFor example: C:\\\\FDOS\n\nCOMMAND.COM assumes this path now:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nThe session information could not be restored, any local settings\nare lost. Please refer to above error messages for the reason\nof this problem.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nThe current information cannot be preserved during the call of the\nprogram. Please refer to above error messages for the reason of\nthis problem.\n.\n\n:TEXT_ERROR_CWD_FAILED#1%\nDrive %c: not responding.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nSwapping failed: Aliases allocate too much memory.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nSwapping failed: Cannot allocate far memory.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nOut of alias space.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1%\nNo such alias: '%s'\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nFailed to insert alias.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1%\nInvalid alias name '%s'.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nCannot load Context module or Critical Error handler.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nContext out of memory.\nIf this error persists, consider to increase some internal buffer,\nsuch as history, directory stack etc.\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1%\nSize of context totals %lu bytes exceeding maximal limit.\nResizing context to %u bytes.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nFailed to add status information into context. This error may indicate\nmemory corruption or an incorrectly determined minimum size of\nthe context. Please inform the maintainer of FreeCOM at:\nfreedos-devel@lists.sourceforge.net mailing list.\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nThe context is missing after swap. The context is re-created,\nbut all aliases etc. are lost.\n.\n\n:TEXT_ERROR_PERMISSION_DENIED#1%\n%s: Permission denied\n.\n\n:TEXT_ERROR_NO_SUCH_FILE#1%\n%s: No such file or directory\n.\n\n:TEXT_ERROR_UNKNOWN_ERROR#1%\n%s: Unknown error\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nPress any key to continue . . .\\\n.\n\n:TEXT_MSG_HISTORY_SIZE#0%\nHistory size is %d bytes.\n.\n\n:TEXT_MSG_DOSKEY\nDOSKEY features are already enabled in the shell.\n.\n\n:TEXT_MSG_ECHO_STATE#0%\nECHO is %s\n.\n\n:TEXT_MSG_VERIFY_STATE#0%\nVERIFY is %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE#0%\nDEBUG output is %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET#0%\nDEBUG output is printed to '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE#0%\nBREAK is %s\n.\n\n:TEXT_MSG_LFNFOR_STATE#0%\nLFNFOR is %s\n.\n\n:TEXT_MSG_LFNFOR_COMPLETE_STATE#0%\nLFN Complete is %s\n.\n\n:TEXT_MSG_CURRENT_DATE#0%\nCurrent date is %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1%\nEnter new date (mm%sdd%s[cc]yy): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1%\nEnter new date (dd%smm%s[cc]yy): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1%\nEnter new date ([cc]yy%smm%sdd): \\\n.\n\n:TEXT_MSG_CURRENT_TIME#0%\nCurrent time is %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nEnter new time: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING#0%\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1%\nYyNn{CR}{LF}{CBREAK}\naabb   b   b       b\nAll files in '%s' will be deleted!\nAre you sure (Y/N)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nYyNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [Yes=ENTER, No=ESC] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#\tby \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1%\nYyNnAaQq{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\nControl-Break pressed.\\r\nTerminate batch file '%s' (Yes/No/All) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1%\nYyNnAaQq{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nOverwrite '%s' (Yes/No/All/Quit) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_APPEND_FILE#1%\nYyNnAaQq{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nAppend to '%s' (Yes/No/All/Quit) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1%\nYyNnAaQq{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nDelete '%s' (Yes/No/All/Quit) ? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<unknown>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nDirectory stack empty.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1%\n Volume in drive %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING#0%\nis %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nhas no label\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER#0%\n Volume Serial Number is %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1%\n%10s file(s)\\\n.\n:TEXT_DIR_FTR_BYTES#0%\n   %12s bytes\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nTotal files listed:\n.\n:TEXT_DIR_FTR_DIRS#1%\n%10s dir(s)\\\n.\n:TEXT_DIR_FTR_BYTES_FREE#0%\n %15s bytes free\n.\n:TEXT_DIR_DIRECTORY#0%\nDirectory of %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE#0%\n Directory of %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1%\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE#1%\n%s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1%\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1%\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <DIR> \\\n.\n:TEXT_DIR_LINE_SIZE#1%\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1%\n%-14s\\\n.\n\n:TEXT_MSG_PATH#0%\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nNo search path defined.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nSun\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nMon\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nTue\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nWed\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\nThu\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\nFri\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nSat\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\nno file removed.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\none file removed.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1%\n%u files removed.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nInternal commands available:\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\nFeatures available:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[aliases] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[enhanced input] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[history] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[filename completion] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[swapping] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[start logging] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[last dir] \\\n.\n:TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1\n[long filenames] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[kernel swap] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[XMS swap] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[default to swap] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[installable commands] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[directory stack (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[FreeCOM debugging] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nPress F8 for trace mode, or F5 to bypass %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0%\nBypassing '%s'.\n.\n\n:TEXT_MSG_VER_DOS_VERSION#0%\nDOS version %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nFreeDOS kernel (build 1933 or prior)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS#0%\nFreeDOS kernel version %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\nCopyright (C) 1994-2005 Tim Norman and others.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nGeneral Public License for more details.\n\nSend bug reports to freedos-devel@lists.sourceforge.net.\nUpdates are available from http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\nCopyright (C) 1994-2005 Tim Norman and others.\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2 of the License, or (at\nyour option) any later version.\n\nSend bug reports to freedos-devel@lists.sourceforge.net.\nUpdates are available from http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\nThe FreeDOS Command Shell developed by many developers, please refer\nto the enclosed HISTORY.TXT file.\n\nSend bug reports to freedos-devel@lists.sourceforge.net.\nUpdates are available from http://freedos.sourceforge.net/freecom\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nThe shell is about to be terminated, though, this is\\r\nforbidden (usually by enabling the \"/P\" option).\\r\nYou must reboot the system or, if this shell runs in\\r\na multitasking environment, terminate this process/task manually.\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nFreeCOM executable not found.\nYou must specify the complete path to COMMAND.COM\nas the first argument of COMMAND, for instance:\nC:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1%\nEnvironment segment    : max %5u bytes; free %5u bytes\n.\n:TEXT_MEMORY_CONTEXT#1%\nContext segment        : max %5u bytes; free %5u bytes\n.\t\n:TEXT_MEMORY_HEAP#1%\nHeap                   : free %5lu bytes\n.\n:TEXT_MEMORY_CTXT_ALIAS#1%\n\\tAliases        : limit %5u bytes, current %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_HISTORY#1%\n\\tHistory        : limit %5u bytes, current %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1%\n\\tDirectory stack: limit %5u bytes, current %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1%\n\\tLast dir cache : used  %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_BATCH#1%\n\\tBatch nesting  : used  %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1%\n\\tSwapinfo       : used  %5u bytes, %5u items\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nFailed to acquire current code page from system.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nFailed to change current code page.\n.\n:TEXT_DISPLAY_CODEPAGE#1%\nThe current codepage is %u.\nThe system codepage (properly) is: %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nDisplays, sets, or removes aliases.\n\nALIAS [variable[=][string]]\n\n\tvariable  Specifies the alias name.\n\tstring    Specifies a series of characters to assign to the alias.\n\n\nType ALIAS without parameters to display the current aliases.\n.\n\n:TEXT_CMDHELP_BEEP\nMake a beep sound.\n.\n\n:TEXT_CMDHELP_BREAK\nSets or clears extended CTRL+C checking.\n\nBREAK [ON | OFF]\n\nType BREAK without a parameter to display the current BREAK setting.\n.\n\n:TEXT_CMDHELP_CALL#1\nCalls one batch program from another.\n\nCALL [/S | /N] [/Y] [drive:][path]filename [batch-parameters]\n\n  batch-parameters   Specifies any command-line information required by\n                     the batch program.\n  /S enforces, /N denies swapping of FreeCOM.\n  /Y enables tracemode during execution of the command.\n.\n\n:TEXT_CMDHELP_CD\nDisplays the name of or changes the current directory.\n\nCHDIR [drive:][path]\nCHDIR[..]\nCD [drive:][path]\nCD[..]\nCD -\n\n  ..   Specifies that you want to change to the parent directory.\n  -    If \"last directory\" feature is enabled, change to last directory.\n\nType CD drive: to display the current directory in the specified drive.\nType CD without parameters to display the current drive and directory.\nSee also: CDD\n.\n\n:TEXT_CMDHELP_CDD\nDisplays the name of or changes the current directory and drive.\n\nCDD [drive:][path]\nCDD[..]\n\n  ..   Specifies that you want to change to the parent directory.\n  -    If \"last directory\" feature is enabled, change to last directory.\n\nIf drive: is specified, the current working drive is changed; this\nis the only different to \"CHDIR\".\nType CD without parameters to display the current drive and directory.\n.\n\n:TEXT_CMDHELP_CHCP\nDisplays or sets the active code page number.\n\nCHCP [nnn]\n\n  nnn   Specifies a code page number.\n\nType CHCP without a parameter to display the active code page number.\n.\n\n:TEXT_CMDHELP_CLS\nClears the screen.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\nStarts a new copy of the FreeDOS command shell.\n\nCOMMAND [[drive:]path] [device] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG]\n                       [/LOW] [/Y [/[C|K] command]]\n  [drive:]path    Specifies the directory containing COMMAND.COM.\n  device          Specifies the device to use for command input and output.\n  /E:nnnnn        Sets the initial environment size to nnnnn bytes.\n                  (nnnnn should be between 256 and 32,768).\n  /L:nnnn         Specifies internal buffers length (requires /P as well).\n                  (nnnn should be between 128 and 1,024).\n  /U:nnn          Specifies the input buffer length (requires /P as well).\n                  (nnn should be between 128 and 255).\n  /P              Makes the new command shell permanent (can't exit).\n  /MSG            Stores all error messages in memory (requires /P as well).\n  /LOW            Forces the command shell to keep its resident data in\n                  low memory.\n  /Y              Steps through the batch program specified by /C or /K.\n  /C command      Executes the specified command and returns.\n  /K command      Executes the specified command and continues running.\n.\n\n:TEXT_CMDHELP_COPY\nCopies one or more files to another location.\n\nCOPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination\n  [/A | /B]] [/V] [/Y | /-Y]\n\n  source       Specifies the file or files to be copied.\n  /A           Indicates an ASCII text file.\n  /B           Indicates a binary file.\n  destination  Specifies the directory and/or filename for the new file(s).\n  /V           Verifies that new files are written correctly.\n  /Y           Suppresses prompting to confirm you want to overwrite an\n               existing destination file.\n  /-Y          Causes prompting to confirm you want to overwrite an\n               existing destination file.\n\nThe switch /Y may be preset in the COPYCMD environment variable.\nThis may be overridden with /-Y on the command line.\n\nTo append files, specify a single file for destination, but multiple files\nfor source (using wildcards or file1+file2+file3 format).\n.\n\n:TEXT_CMDHELP_CTTY\nChanges the terminal device used to control your system.\n\nCTTY device\n\n  device   The terminal device you want to use, such as COM1.\n.\n\n:TEXT_CMDHELP_DATE#1\nDisplays or sets the date.\n\nDATE [/D] [date]\n\nType DATE without parameters to display the current date setting and a\nprompt for a new one.  Press ENTER to keep the same date.\n\n/D prevents DATE to become interactive.\n.\n\n:TEXT_CMDHELP_DEL#2\nDeletes one or more files.\n\nDEL [drive:][path]filename [/P] [/V]\nERASE [drive:][path]filename [/P] [/V]\n\n  [drive:][path]filename  Specifies the file(s) to delete.  Specify multiple\n                          files by using wildcards.\n  /P\tPrompts for confirmation before deleting each file.\n  /V\tDisplays all deleted files.\n.\n\n:TEXT_CMDHELP_DIR#4\nDisplays a list of files and subdirectories in a directory.\n\nDIR [drive:][path][filename] [/P] [/W] [/A[[:]attributes]]\n  [/O[[:]sortorder]] [/S] [/B] [/L]\n\n  [drive:][path][filename]\n            Specifies drive, directory, and/or files to list.\n            (Could be enhanced file specification or multiple filespecs.)\n /P         Pauses after each screenful of information.\n /W         Uses wide list format.\n /A         Displays files with specified attributes. (Defaults to /ADHSRA)\n attributes  D  Directories                R  Read-only files\n             H  Hidden files               A  Files ready for archiving\n             S  System files               -  Prefix meaning not\n /O         List by files in sorted order.\n sortorder   N  By name (alphabetic)       S  By size (smallest first)\n             E  By extension (alphabetic)  D  By date & time (earliest first)\n             G  Group directories first    -  Prefix to reverse order\n             U  Unsorted\t\t   Defaults to /ONG\n /S         Displays files in specified directory and all subdirectories.\n /B         Uses bare format (no heading information or summary).\n /L         Uses lowercase.\n /Y or /4   Display 4-digit year.\n\nSwitches may be preset in the DIRCMD environment variable.  Override\npreset switches by prefixing any switch with - (hyphen)--for example, /-W.\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nThe external DOSKEY utility had been incorporated into FreeCOM.\nUse cursor UP,& DOWN keys to recall the history and HISTORY to display it.\nUse cursor LEFT,& RIGHT and the END and HOME keys to navigate within\nthe command line and toggle INSERT between overstrike and insert mode.\nUse the TAB key to complete the current word as filename; use it twice\nto show all matching files.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nEdits command lines, recalls command lines, and creates macros\n\nDOSKEY [/switch ...] [macroname=[text]]\n\n  /BUFSIZE:size Sets size of macro and command buffer            (default:512)\n  /ECHO:on|off  Enables/disables echo of macro expansions        (default:on)\n  /FILE:file    Specifies file containing a list of macros\n  /HISTORY      Displays all commands stored in memory\n  /INSERT       Inserts new characters into line when typing\n  /KEYSIZE:size Sets size of keyboard type-ahead buffer          (default:15)\n  /LINE:size    Sets maximum size of line edit buffer            (default:128)\n  /MACROS       Displays all DOSKey macros\n  /OVERSTRIKE   Overwrites new characters onto line when typing  (default)\n  /REINSTALL    Installs a new copy of DOSKey\n  macroname     Specifies a name for a macro you create\n  text          Specifies commands you want to assign to the macro\n\n  UP,DOWN arrows recall commands\n      Esc clears current command\n       F7 displays command history\n   Alt+F7 clears command history\n[chars]F8 searches for command beginning with [chars]\n       F9 selects a command by number\n  Alt+F10 clears macro definitions\n\nThe following are special codes you can use in DOSKey macro definitions:\n  $T     Command separator: allows multiple commands in a macro\n  $1-$9  Batch parameters: equivalent to %1-%9 in batch programs\n  $*     Symbol replaced by everything following macro name on the command line\n.\n\n:TEXT_CMDHELP_ECHO\nDisplays messages, or turns command-echoing on or off.\n\n  ECHO [ON | OFF]\n  ECHO [message]\n  ECHO.\n\nECHO. displays an empty line (only in batch files)\nType ECHO without parameters to display the current echo setting.\n.\n\n:TEXT_CMDHELP_EXIT\nQuits the FreeDOS command shell unless loaded with /P.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\nRuns a specified command for each file in a set of files.\n\nFOR %%variable IN (set) DO command [command-parameters]\n\n  %%variable  Specifies a replaceable parameter.\n  (set)      Specifies a set of one or more files.  Wildcards may be used.\n  command    Specifies the command to carry out for each file.\n  command-parameters\n             Specifies parameters or switches for the specified command.\n\nTo use the FOR command in a batch program, specify %%%%variable instead of\n%%variable.\n\nFor example:\n  FOR %%%%f IN (---start--- a*.* ---end---) DO ECHO - %%%%f -\n.\n\n:TEXT_CMDHELP_GOTO\nDirects the command shell to a labelled line in a batch program.\n\nGOTO label\n\n  label   Specifies a text string used in the batch program as a label.\n\nYou type a label on a line by itself, beginning with a colon.\n.\n\n:TEXT_CMDHELP_HISTORY#1\nHistory command.\n\nHISTORY [size]\n\nWithout \"size\" the current contents of the command line history\nbuffer is displayed.\nWith the size, the size of the history buffer is changed.\n.\n\n:TEXT_CMDHELP_IF\nPerforms conditional processing in batch programs.\n\nIF [NOT] ERRORLEVEL number command\nIF [NOT] string1==string2 command\nIF [NOT] EXIST filename command\nIF /I string==STRING\n\n  NOT                Specifies that the command shell should carry out\n                     the command only if the condition is false.\n  ERRORLEVEL number  Specifies a true condition if the last program run\n                     returned an exit code equal to or greater than the\n                     number specified.\n  command            Specifies the command to carry out if the condition\n                     is met.\n  string1==string2   Specifies a true condition if the specified text\n                     strings match.\n  EXIST filename     Specifies a true condition if the specified filename\n                     exists.\n  /I string==STRING  Ignores uppercase / lowercase\n.\n\n:TEXT_CMDHELP_LFNFOR\nEnables/Disables long filenames within the FOR command or filename completion.\n\nLFNFOR [ON | OFF]\nLFNFOR COMPLETE [ON | OFF]\n\nType LFNFOR or LFNFOR COMPLETE without a parameter to display the current\nLFNFOR setting.\n.\n\n:TEXT_CMDHELP_LH\nLoads a program into the upper memory area.\n\nLOADHIGH [drive:][path]filename [parameters]\nLOADHIGH [/L:region1[,minsize1][;region2[,minsize2]...] [/S]]\n         [drive:][path]filename [parameters]\n\n/L:region1[,minsize1][;region2[,minsize2]]...\n            Specifies the region(s) of memory into which to load the\n            program.  Region1 specifies the number of the first memory\n            region; minsize1 specifies the minimum size, if any, for\n            region1.  Region2 and minsize2 specify the number and minimum\n            size of the second region, if any.  You can specify as many\n            regions as you want.\n\n/S          Shrinks a UMB to its minimum size while the program is\n            loading.\n\n[drive:][path]filename\n            Specifies the location and name of the program.\n.\n\n:TEXT_CMDHELP_LOADFIX\nLoads a program above the first 64K of memory, and runs the program.\n\nLOADFIX [drive:][path]filename\n\nUse LOADFIX to load a program if you have received the message \"Packed\nfile corrupt\" when trying to load it in low memory.\n.\n\n:TEXT_CMDHELP_MD\nCreates a directory.\n\nMKDIR [drive:]path\nMD [drive:]path\n.\n\n:TEXT_CMDHELP_PATH\nDisplays or sets a search path for executable files.\n\nPATH [[drive:]path[;...]]\nPATH ;\n\nType PATH ; to clear all search-path settings and direct the command shell\nto search only in the current directory.\nType PATH without parameters to display the current path.\n.\n\n:TEXT_CMDHELP_PAUSE\nSuspends processing of a batch program and displays the message:\n\"Press any key to continue....\" or an optional specified message.\n\nPAUSE [message]\n.\n\n:TEXT_CMDHELP_PROMPT\nChanges the command prompt.\n\nPROMPT [text]\n\n  text    Specifies a new command prompt.\n\nPrompt can be made up of normal characters and the following special\ncodes:\n\n  $Q   = (equal sign)\n  $$   $ (dollar sign)\n  $T   Current time\n  $D   Current date\n  $P   Current drive and path\n  $V   the FreeDOS command shell version number\n  $N   Current drive\n  $G   > (greater-than sign)\n  $L   < (less-than sign)\n  $B   | (pipe)\n  $H   Backspace (erases previous character)\n  $E   Escape code (ASCII code 27)\n  $_   Carriage return and linefeed\n\nType PROMPT without parameters to reset the prompt to the default setting.\n.\n\n:TEXT_CMDHELP_PUSHD\nPushes current directory onto the directory stack, with the option to\nchange current working directory.\n\nPUSHD [[drive:]path]\n  Where [drive:]path is a path to which you wish to change.\n.\n\n:TEXT_CMDHELP_POPD\nPops a directory off of the directory stack, and changes to it.\n\nPOPD [*]\n  The '*' parameter clears the directory stack.\n.\n\n:TEXT_CMDHELP_DIRS\nDisplays the contents of the directory stack.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\nRemoves (deletes) an empty directory.\n\nRMDIR [drive:]path\nRD [drive:]path\n.\n\n:TEXT_CMDHELP_REM\nRecords comments (remarks) in a batch file or CONFIG.SYS.\n\nREM [comment]\n.\n\n:TEXT_CMDHELP_REN\nRenames a file/directory or files/directories.\n\nRENAME [drive:][path][directoryname1 | filename1] [directoryname2 | filename2]\nREN [drive:][path][directoryname1 | filename1] [directoryname2 | filename2]\n\nNote that you cannot specify a new drive or path for your destination. Use\nthe MOVE command for that purpose.\n.\n\n:TEXT_CMDHELP_SET#1\nDisplays, sets, or removes environment variables.\n\nSET [/C] [/P] [/E] [/U] [variable[=[string]]]\n\n  variable  Specifies the environment-variable name.\n  string    Specifies a series of characters to assign to the variable.\n\n* If no string is specified, the variable is removed from the environment.\n\nType SET without parameters to display the current environment variables.\n\nType SET VAR to display the value of VAR\n\n/C forces to keep the case of the variable; by default the variable is\nuppercased, if it is not located in the environment already, otherwise\nthe case is retained.\n\n/P prompt the user with string, and assigns the user input to the variable.\n\n/E sets the given variable to the first line of output of the command\npointed to by [string].\n\n/U changes the case of [string] to uppercase.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nChanges the position of replaceable parameters in a batch file.\n\nSHIFT [DOWN]\n\nDOWN shifts the argument window toward the beginning (%%0); otherwise\ntoward the end.\n.\n\n:TEXT_CMDHELP_TIME#1\nDisplays or sets the system time.\n\nTIME [/T] [time]\n\nType TIME with no parameters to display the current time setting and a\nprompt for a new one.  Press ENTER to keep the same time.\n\n/T prevents TIME from becoming interactive.\n.\n\n:TEXT_CMDHELP_TRUENAME\nDisplays the full path name of the path specified.\n\nTRUENAME [drive:][path][filename]\n.\n\n:TEXT_CMDHELP_TYPE\nDisplays the contents of text files.\n\nTYPE [drive:][path]filename\n.\n\n:TEXT_CMDHELP_VER\nDisplays the FreeDOS command shell version and other information.\n\nVER [/R] [/W] [/D] [/C]\n\n /R         Shows kernel version and other information.\n /W         FreeDOS command shell warranty.\n /D         FreeDOS command shell redistribution information.\n /C         FreeDOS command shell contributors.\n.\n\n:TEXT_CMDHELP_VERIFY\nTells the FreeDOS file system whether to verify that your files are\nwritten correctly to a disk.\n\nVERIFY [ON | OFF]\n\nType VERIFY without a parameter to display the current VERIFY setting.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nIf debugging is compiled into FreeDOS, this command will turn debug\noutput on or off, or tell you if it is on or off.\n\nFDDEBUG [ON | OFF | file]\n\nType FDDEBUG without a parameter to display the current debug output\nsetting.\nIf a file is specified, all debug output is redirected into that file;\nthe output is appended to the file, if it already exists. The special\nnames \"stdout\" and \"stderr\" may be used to redirect the output\nto the standard output or standard error stream.\n.\n\n:TEXT_CMDHELP_VOL\nDisplays the disk volume label and serial number, if they exist.\n\nVOL [drive:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nDisplays a list of commands and features available with in the shell.\n\n?\n?command [argument]\n\nThe first variant displays any available internal command and feature.\nThe second one will prompt whether or not to execute the specified\ncommand as if trace mode would be active.\n.\n\n:TEXT_CMDHELP_WHICH\nSearches and displays the executable file for each specified command.\n\nWHICH command...\n.\n\n:TEXT_CMDHELP_MEMORY#1\nDisplays the internal memory used by FreeCOM internally.\n\nMEMORY\n\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\nThe COPY destination must not contain plus ('+') characters.\n.\n\n:TEXT_DELETE_FILE#1%\nDeleting file \"%s\".\n.\n\n:TEXT_ERROR_WRITE_FILE_DISC_FULL#0%\nUnable to write to file '%s';\nprobably disc full? (%lu bytes required)\n.\n\n# Displayed for BIGcopy(), when copying takes quite a long time.\n# **_NO_END if the input file size is unknown.\n# Both must end in \\r rather than \\n!!\n:TEXT_COPY_COPIED_NO_END#0%\ncopied %luKB/???KB\\r\\\n.\n:TEXT_COPY_COPIED#0%\ncopied %luKB/%luKB\\r\\\n.\n\n:TEXT_ERROR_FCOM_IS_DEVICE#0%\nFreeCOM cannot be a device: \"%s\"\n.\n:TEXT_ERROR_FCOM_INVALID#0%\nThis file is no valid FreeCOM or of an incompatible version:\n%s\n.\n\n:TEXT_ERROR_LOADING_STRINGS\nFailed to load the strings resource into memory, the location\npointed to in %COMSPEC% seems to be invalid. Please specify another\nlocation of FreeCOM to try to load the strings from, e.g.:\nC:\\\\COMMAND.COM\nor just hit enter to cancel to load the strings.\n.\n\n:TEXT_TERMINATING\nTerminating now.\n.\n\n:TEXT_HIDDEN_CRITER#0%\n%u Critical Error requests suppressed.\n.\n\n# The exit reasons MUST be kept in this order!\n:TEXT_DISP_EXITCODE#0%\nExit code (ERRORLEVEL): %u, reason: %u (%s)\n.\n:TEXT_EXIT_REASON_NEG_1\nDOS API error\\\n.\n:TEXT_EXIT_REASON_0\nterminated normally\\\n.\n:TEXT_EXIT_REASON_1\nterminated by ^Break\\\n.\n:TEXT_EXIT_REASON_2\nterminated by critical error\\\n.\n:TEXT_EXIT_REASON_3\ngone resident\\\n.\n:TEXT_ERROR_EXE_CORRUPT\nEXE file corrupt\\\n.\n"
  },
  {
    "path": "strings/depend.mk",
    "content": "strings .SEQUENTIAL : utils strings_dir\r\n\r\nstrings_dir .SETDIR=strings :\r\n\t@echo Entering $(PWD)\r\n\t$(RUNMAKE) all\r\n\t@echo Leaving $(PWD)\r\n\r\nCLEAN_DEPENDENCIES += strings_clean\r\nstrings_clean .SETDIR=strings :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) clean\r\n\t@echo Leaving  $(PWD)\r\n\r\nCLOBBER_DEPENDENCIES += strings_clobber\r\nstrings_clobber .SETDIR=strings :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) clobber\r\n\t@echo Leaving  $(PWD)\r\n\r\nDIST_DEPENDENCIES += strings_dist\r\nstrings_dist .SETDIR=strings :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) dist\r\n\t@echo Leaving  $(PWD)\r\n"
  },
  {
    "path": "strings/dutch.err",
    "content": "# No translations. Dummy file. See the DEFAULT.err file\n"
  },
  {
    "path": "strings/dutch.lng",
    "content": "# $Id$\n#\n# FreeCOM national customization file\n#\n#\tLanguage: Dutch\n#\tAuthor:   Bernd Blaauw, bblnews@hotmail.com\n# \n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retreive the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#\t:TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carrage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause an user interaction. Those ones should be in sync\n# with the issued text. To define how to interprete a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#YyNn\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceeding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the\n# question mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readibility of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH\nOngeldige schakeloptie. - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH\nOngeldige schakeloptie. - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION\nSlecht-gevormde optie: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG\nOptie '%s' kan geen parameter hebben\n.\n\n:TEXT_ERROR_OPT_NOARG\nOptie '%s' dient een parameter te hebben\n.\n\n:TEXT_INVALID_NUMBER\nOngeldig nummer opgegeven in '%s'\n.\n\n:TEXT_ERROR_CLOSE_QUOTE\nSluit-quote-teken mist (\"): %c\n.\n\n:TEXT_ERROR_TEMPFILE\nKan geen tijdelijk bestand aanmaken\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR\nTe veel parameters. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nTe veel parameters.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER\nOngeldige parameter. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nPad niet gevonden.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nBestand niet gevonden.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND\nBestand niet gevonden. - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING\nVereiste parameter ontbreekt.\n.\n\n:TEXT_ERROR_INVALID_DRIVE\nOngeldige schijf %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2\nOngeldige opdracht of bestandsnaam - \"%s\".\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nGeheugengebrek-fout.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nToewijzing van DOS geheugen is mislukt.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nKan geen pijp maken! Kan tijdelijk bestand niet openen!\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE\nRegel #%ld in batch-bestand '%s' is te lang.\n.\n\n:TEXT_ERROR_BFILE_VANISHED\nBatch-bestand '%s' niet gevonden.\n.\n\n:TEXT_ERROR_BFILE_LABEL\nBatch-bestand '%s' draagt niet het label '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1\n%s mislukt voor '%s'.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR\nKan omgevingsvariable '%s' niet aanmaken.\nOmgevingsruimte vol?\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND\nOmgevingsvariabele '%s' niet gevonden.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nGeen omgevingsruimte. Wellicht geheugentekort. Geef de /E optie op.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1\nKan alias '%s' niet maken. Alias ruimte vol?\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1\nAlias '%s' niet gevonden.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nGeen alias ruimte. Waarschijnlijk geheugen tekort.\n.\n\n:TEXT_ERROR_SYNTAX_STR\nSyntax fout. - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nSyntax fout.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG\nBestandsnaam te lang. - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY\nKan '%s' niet naar zichzelf kopieren\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nOpdrachtregel te lang na ALIAS uitbreiding!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nRegel te lang.  Kan opdracht niet uitvoeren.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1\nOngeldige geschiedenisgrootte '%s'.\n.\n\n:TEXT_HISTORY_EMPTY#1\nGeschiedenis van opdrachtregel is leeg.\n.\n\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nMCB keten corrupt, of MS-DOS incompatibel systeem.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR\nOngedefinieerde fout %d.\n.\n\n:TEXT_ERROR_REGION_WARNING\nIllegaal geheugenmemorybereik %d - achterwege gelaten.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nU dient ON of OFF op te geven.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nSlechte variabele definitie.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR: IN ontbreekt.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nEen of beide haakjes missen \"(\" \")\".\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR: DO ontbreekt.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR: geen opdracht na DO statement opgegeven.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE\nKan invoer van bestand '%s' niet omleiden.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE\nKan uitvoer niet omleiden naar bestand '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nLege omleiding.\n.\n\n:TEXT_ERROR_INVALID_DATE\nOngeldige datum.\n.\n\n:TEXT_ERROR_INVALID_TIME\nOngeldige tijd.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nGeen label opgegeven voor opdracht GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nDe CTTY opdracht is uit deze versie van COMMAND.COM weggelaten.\n.\n\n:TEXT_ERROR_NORW_DEVICE\nApparaat '%s' is een ongeldig of niet leesbaar/schrijfbaar apparaat.\n.\n\n:TEXT_ERROR_CTTY_DUP\nHet veranden van de bestandsbeschrijvingen naar TTY '%s' is mislukt.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\n/L is nog niet geimplementeerd.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\n/U is nog niet geimplementeerd.\n.\n\n:TEXT_ERROR_WRITING_DEST\nFout bij het schrijven naar de bestemming.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE\nNiet in staat om de bron te openen. - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE\nNiet in staat om bestand '%s' te openen\n.\n\n:TEXT_ERROR_READ_FILE\nNiet in staat om te lezen van bestand '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE\nNiet in staat om te schrijven naar bestand '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\nHet concatenatieteken '+' kan niet geplaatst worden voor de argumenten.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nHet concatenatie teken '+' kan niet achter de argumenten geplaatst worden.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nEr valt niets te doen.\n.\n\n:TEXT_ERROR_COPY\nKopieren is mislukt\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: ontbrekende bestandsnaam\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: ontbrekend getal\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: ongeldig nummer\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: uit te voeren opdracht ontbreekt\n.\n\n:TEXT_NOT_IMPLEMENTED_YET\nSorry...nog niet geimplementeerd.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nHet laden van de berichten in het systeemgeheugen is mislukt.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nDe /MSG optie is weggelaten uit deze COMMAND.COM.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1\n%u items weergegeven.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nCorrupte opdrachtregel. Dit is een interne fout en heeft te maken met het\nsysteem waarop COMMAND.COM draait. Rapporteer deze fout alstublieft.\n.\n\n:TEXT_QUOTED_C_OR_K#1\nDe /C en /K opties kunnen niet gequote worden, en worden genegeerd.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1\nHet pad naar COMMAND.COM dient volledig opgegeven te worden!\nDat betekent inclusief schijfletter en beginnend met een backslash.\nBijvoorbeeld: C:\\\\FDOS\n\nCOMMAND.COM veronderstelt nu als pad:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nDe sessie-informatie kon niet hersteld worden, en alle lokale instellingen\nzijn verloren gegaan. Kijk alstublieft bij bovenstaande foutberichten voor\nde oorzaak van dit probleem.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nDe huidige gegevens konden niet behouden blijven gedurende de aanroep van het \nprogramma. Kijk alstublieft bij bovenstaande foutberichten voor de oorzaak\nvan dit probleem.\n.\n\n:TEXT_ERROR_CWD_FAILED\nSchijf %c: reageert niet, of er is een gebrek aan intern geheugen.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nSwappen mislukt: Aliassen hebben teveel geheugenruimte toegewezen gekregen.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nSwappen mislukt: Kan geen ver/afgelegen geheugen toewijzen.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nGeen ALIAS ruimte meer.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1\nGeen dergelijke alias aanwezig: '%s'\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nToevoegen van alias is mislukt.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1\nOngeldige aliasnaam '%s'.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nKan Context module of Kritieke Fouten afhandeling niet laden.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nContext geheugentekort.\nAls u deze fout blijft houden, overweeg dan om een interne buffer,\nzoals geschiedenis, directory stack, etc te verhogen.\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1\nGrootte van context is in totaal %lu bytes en overschrijdt\nde maximale limiet. Context wordt aangepast tot %u bytes.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nDe poging om status-informatie aan de context toe te voegen is mislukt.\nDeze fout kan geheugencorruptie of een onjuist vastgestelde minimumgrootte\nvan de context aangeven. Informeer alstublieft de beheerder van FreeCOM op:\nfreedos-devel@lists.sourceforge.net\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nDe context ontbreekt na swap. De context wordt opnieuw aangemaakt,\nmaar alle aliassen en dergelijke gaan hierbij verloren.\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nDruk op een toets zoals bv spatie om door te gaan . . .\\\n.\n\n:TEXT_MSG_HISTORY_SIZE\nGeschiedenis grootte is %d bytes.\n.\n\n:TEXT_MSG_DOSKEY\nDOSKEY mogelijkheden zijn al in werking in de schil.\n.\n\n:TEXT_MSG_ECHO_STATE\nECHO staat ingesteld op %s\n.\n\n:TEXT_MSG_VERIFY_STATE\nVERIFY staat ingesteld op %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE\nDEBUG uitvoer staat ingesteld op %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET\nDEBUG uitvoer wordt geprint naar '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE\nBREAK staat ingesteld op %s\n.\n\n:TEXT_MSG_CURRENT_DATE\nDe huidige datum is %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1\nGeef nieuwe datum op (mm%sdd%sjjjj): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1\nGeef nieuwe datum op (dd%smm%sjjjj): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1\nGeef nieuwe datum op (jjjj%smm%sdd): \\\n.\n\n:TEXT_MSG_CURRENT_TIME\nHet is nu %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nGeef nieuwe tijd op: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1\nJjNn{CR}{LF}{CBREAK}\naabb   b   b       b\nAlle bestanden in '%s' zullen worden verwijderd!\nWeet u dit zeker (J/N)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nJjNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [Ja=ENTER, Nee=ESC] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#\tby \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1\nJjNnAaQq{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\nControl-Break of Control-C ingedrukt.\\r\nWilt u batchbestand '%s' be-eindigen (Ja/Nee/Alles) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1\nJjNnAaSs{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nWilt u '%s' overschrijven (Ja/Nee/Alles/Stoppen) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1\nJjNnAaSs{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nBestand '%s' verwijderen (Ja/Nee/Alles/Stoppen) ? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<onbekend>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nDirectory stack leeg.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1\n Volume van drive %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING\nis %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nheeft geen label\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER\n Volume Serienummer is %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1\n%10s bestand(en)\\\n.\n:TEXT_DIR_FTR_BYTES\n   %12s bytes\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nTotaal aantal genoemde bestanden:\n.\n:TEXT_DIR_FTR_DIRS#1\n%10s dir(s)\\\n.\n:TEXT_DIR_FTR_BYTES_FREE\n %15s bytes vrij\n.\n:TEXT_DIR_DIRECTORY\nDirectory van %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE\n Directory van %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE\n%-13s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <DIR> \\\n.\n:TEXT_DIR_LINE_SIZE#1\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1\n%-14s\\\n.\n\n:TEXT_MSG_PATH\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nGeen zoekpad gedefinieerd.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nZo\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nMa\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nDi\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nWoe\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\nDo\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\nVr\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nZa\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\ngeen bestand verwijderd.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\nEen bestand verwijderd.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1\n%u bestanden verwijderen.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nInterne beschikbare opdrachten:\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\nBeschikbare voorzieningen:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[aliassen] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[uitgebreide invoer] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[geschiedenis] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[bestandsnaam aanvulling] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[swapping] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[start loggen] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n       [laatste directory] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[kernel swap] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[XMS swap] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[default to swap] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[installeerbare commando's] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n   [DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[directory stack (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[FreeCOM debugging] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nDruk op F8 voor traceermodus, of op F5 om %s te omzeilen... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC\n'%s' wordt omzeild.\n.\n\n:TEXT_MSG_VER_DOS_VERSION\nDOS versie %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nFreeDOS kernel (bouwversie 1933 of eerder)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS\nFreeDOS kernel versie %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\nCopyright (C) 1994-2001 Tim Norman en anderen.\n\nDit programma wordt verspreid in de hoop dat het bruikbaar zal zijn, \nmaar ZONDER ENIGE GARANTIE; zelfs zonder de veronderstelde garantie op\nMERCHANTABILITY of BRUIKBAARHEID VOOR EEN BEPAALDE DOEL(STELLING). \nRaadpleeg de GNU General Public License (GPL) voor meer details hierover.\n\nStuur foutmeldingsberichten naar freedos-devel@lists.sourceforge.net.\nNieuwere versies zijn verkrijgbaar van http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\nCopyright (C) 1994-2001 Tim Norman en anderen.\n\nDit programma is vrije programmatuur; u kunt het herverpreiden en/of wijzigen\nmet inachtneming van de voorwaarden van de GNU General Public License zoals\ndie beschikbaar wordt gesteld door de Free Software Foundation;\nof versie 2 van de Licentie, of (zo u wilt) enige latere versie.\n\nStuur foutmeldingsberichten naar freedos-devel@lists.sourceforge.net.\nNieuwere versies zijn verkrijgbaar van http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\nDe FreeDOS opdrachtverwerker is ontwikkeld door vele ontwikkelaars,\nzie het bijgevoegde HISTORY.TXT bestand.\n\nStuur foutmeldingsberichten naar freedos-devel@lists.sourceforge.net.\nNieuwere versies zijn verkrijgbaar van http://freedos.sourceforge.net/freecom\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nDe opdrachtverwerker staat op het punt beeindigd te worden, ook al\\r\nis dit niet toegestaan (meestal door de \"/P\" optie te gebruiken).\\r\nU dient het systeem te herstarten, of, als deze schil draait in een\\r\nmultitasking omgeving, dit proces/deze taak handmatig te beeindigen.\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nFreeCOM uitvoerbaar bestand niet gevonden.\nU dient het complete pad naar COMMAND.COM op te geven \nals eerste argument van COMMAND.COM, bijvoorbeeld:\nC:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1\nOmgevings-segment    : max %5u bytes; beschikbaar %5u bytes\n.\n:TEXT_MEMORY_CONTEXT#1\nContext segment          : max %5u bytes; beschikbaar %5u bytes\n.\t\n:TEXT_MEMORY_HEAP#1\n        Heap           : beschikbaar %5lu bytes\n.\n:TEXT_MEMORY_CTXT_ALIAS#1\n\\tAliassen       : limiet %5u bytes, huidig %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_HISTORY#1\n\\tHistory        : limiet %5u bytes, huidig %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1\n\\tDirectory stack: limiet %5u bytes, huidig %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1\n\\tLaatste directory cache : gebruikt %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_BATCH#1\n\\tBatch nesten  : gebruikt %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1\n\\tSwapinfo       : gebruikt %5u bytes, %5u items\n.\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nHet opvragen van de huidige codepagina is niet gelukt.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nHet veranderen van de huidige codepagina is niet gelukt.\n.\n:TEXT_DISPLAY_CODEPAGE#1\nDe huidige codepagina is %u.\nDe (correcte) systeem-codepagina is: %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nToont, maakt, of verwijdert aliassen.\n\nALIAS [variabele[=][tekenreeks]]\n\n\tvariabele   is de te gebruiken alias-naam.\n\ttekenreeks  een aantal op te geven letters die\n                    toegewezen worden aan de alias.\n\n\nTyp ALIAS zonder parameters om de huidige aliassen te tonen.\n.\n\n:TEXT_CMDHELP_BEEP\nMaak een klikgeluid.\n.\n\n:TEXT_CMDHELP_BREAK\nZet uitgebreide CTRL+C controle aan of uit.\n\nBREAK [ON | OFF]\n\nTyp BREAK zonder parameters om de huidige instelling te tonen.\n.\n\n:TEXT_CMDHELP_CALL#1\nRoept tijdelijk een batchprogramma vanuit een ander batchprogramma aan.\n\nCALL [/S | /N] [drive:][pad]bestandsnaam [batch-parameters]\n\n  batch-parameters   Duidt mogelijke opdrachtregel-informatie aan die het \n\t\t     batchprogramma kan vereisen.\n/S forceert, /N weigert het swappen van FreeCOM.\n.\n\n:TEXT_CMDHELP_CD\nToont de naam van de huidige directory of verandert deze.\n\nCHDIR [drive:][pad]\nCHDIR[..]\nCD [drive:][pad]\nCD[..]\nCD -\n\n  ..   Duidt aan dat u naar de bovenliggende directory wilt gaan.\n  -    springt, indien \"laatste directory\" optie is aangezet, naar\n       de laatst onthouden directory.\n\nTyp CD drive: om de huidige directory in de opgegeven schijf weer te geven.\nTyp CD zonder parameters om de huidige schijf en directory weer te geven.\nZie ook: CDD\n.\n\n:TEXT_CMDHELP_CDD\nToont de naam van de huidige schijf en directory of verandert deze.\n\nCDD [drive:][pad]\nCDD[..]\n\n  ..   Geeft aan dat u naar de bovenliggende directory wilt gaan.\n  -    springt, indien \"laaatste directory\" optie is aangezet, naar\n       de laatste onthouden directory.\n\nIndien drive: opgegeven is, wordt de huidige werkdirectory veranderd; dit\nis het enige waarmee \"CDD\" zich onderscheidt van \"CHDIR\".\nTyp CDD zonder parameters om de huidige schijf en directory weer te geven.\n\n.\n\n:TEXT_CMDHELP_CHCP\nGeeft het nummer van de actieve codepagina weer of verandert deze.\n\nCHCP [nnn]\n\n  nnn   Duidt het nummer van een codepagina aan.\n\nTyp CHCP zonder parameter om het nummer van de actieve codepagina te tonen.\n.\n\n:TEXT_CMDHELP_CLS\nWist de scherminhoud.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\nStart een nieuwe kopie van de FreeDOS opdrachtschil.\n\nCOMMAND [[drive:]pad] [apparaat] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG]\n                       [/LOW] [/Y [/[C|K] opdracht]]\n  [drive:]pad     Duidt de directory aan waarin COMMAND.COM zich bevindt.\n  device          Duidt het voor in- en uitvoer te gebruiken apparaat aan.\n  /E:nnnnn        Stelt de aanvankelijke omgevingsgrootte in op nnnnn bytes.\n                  (nnnnn dient een waarde tussen 256 en 32.768 te zijn).\n  /L:nnnn         Duidt de interne bufferlengte aan (vereist eveneens /P ).\n                  (nnnn dient te liggen tussen 128 en 1.024).\n  /U:nnn          Duidt de invoer-bufferlengte aan (vereist ook /P ).\n                  (nnn dient te liggen tussen 128 and 255).\n  /P              Maakt de nieuwe opdrachtschil permanent (niet te verlaten).\n  /MSG            Bewaart alle foutmeldingen in het systeemgeheugen (vereist /P).\n  /LOW            Forceert plaatsing van residente data in het lage geheugen.\n  /Y              Stapt per regel door het mbv /C or /K opgegeven batbestand.\n  /C opdracht     Voert de opgegeven opdracht uit en komt weer terug.\n  /K opdracht     Voert de opgegeven opdracht uit en blijft draaien.\n.\n\n:TEXT_CMDHELP_COPY\nKopieert een of meer bestanden naar een andere locatie.\n\nCOPY [/A | /B] bron [/A | /B] [+ bron [/A | /B] [+ ...]] [bestemming\n  [/A | /B]] [/V] [/Y | /-Y]\n\n  bron         Duidt de te kopieren bestand(en) aan.\n  /A           Geeft een ASCII tekstbestand aan.\n  /B           Geeft een binair bestand aan.\n  bestemming   Duidt de bestemming en/of naam aan voor het nieuwe bestand(en).\n  /V           Verifieert dat bestanden wel juist geschreven zijn.\n  /Y           Onderdrukt het vragen naar of u een bestaand (bestemmings-)\n               bestand wilt overschrijven door uw kopieeractie.\n  /-Y          Vraagt of u het doelbestand wilt overschrijven\n\nDe schakeloptie /Y mag alvast ingesteld worden in de COPYCMD omgevings-\nvariabele. Dit kan genegeerd worden door /-Y op de opdrachtregel.\n\nGeef, om bestanden achter elkaar te plakken (laatste bestand achteraan),\nslechts een bestemmingsbestand op, maar meerdere bestanden als bron\n(gebruikmakend van jokertekens of bestand1+bestand2+bestand3 formaat).\n.\n\n:TEXT_CMDHELP_CTTY\nVerandert het terminal apparaat dat gebruikt wordt om uw pc te bedienen.\n\nCTTY apparaat\n\n  apparaat   Het te gebruiken terminal apparaat, zoals bijvoorbeeld COM1.\n.\n\n:TEXT_CMDHELP_DATE#1\nToont de datum of stelt deze in.\n\nDATE [/D] [datum]\n\nTyp DATE zonder parameters om de huidige datum weer te geven en te vragen om \neen nieuwe. Druk op ENTER om de huidig ingestelde datum te behouden.\n\n/D voorkomt dat DATE u vraagt om een nieuwe datum op te geven.\n.\n\n:TEXT_CMDHELP_DEL#2\nVerwijdert een of meer bestanden.\n\nDEL [drive:][pad]bestandsnaam [/P]\nERASE [drive:][pad]bestandsnaam [/P]\n\n [drive:][pad]bestandnaam  Duidt de te verwijderen bestand(en) aan. Geef meer \n                           bestanden op door jokertekens (*, ?) te gebruiken.\n /P                        Vraagt u steeds om bevestiging alvorens elk\n                           bestand afzonderlijk te verwijderen.\n /V                        Toont alle verwijderde bestanden\n.\n\n:TEXT_CMDHELP_DIR#4\nToont een lijst van bestanden en directories in een directory.\n\nDIR [drive:][pad][bestandsnaam] [/P] [/W] [/A[[:]attributen]]\n  [/O[[:]sorteervolgorde]] [/S] [/B] [/L]\n\n  [drive:][pad][bestandsnaam]\n            Duidt de weer te geven schijf, directorie, en/of bestanden aan.\n            (Kan uitgebreide bestandskeuze zijn of opgave meerdere bestanden.)\n /P         Pauzeert na ieder volgeschreven scherm met informatie.\n /W         Gebruikt het brede-lijst formaat.\n /A         Toont bestanden met de door u opgegeven kenmerken. (standaard /ADHSRA)\n attributen  D  Directories                R  Alleen-lezen bestanden\n             H  Verborgen bestanden        A  Archiveringsbestanden\n             S  Systeembestanden           -  Voorkomt tonen op basis van het\n                                              opgegeven attribuut\n /O         Geef bestanden weer op gesorteerde volgorde\n sortorder   N  Op naam (alphabetisch)       S  Op grootte (smalste eerst)\n             E  Op extensie (alphabetisch)   D  Op datum en tijd (vroegste 1st)\n             G  Directories eerst groeperen  -  Prefix v. omgekeerde volgorde\n             U  Ongesorteerde                Standaard /ONG\n /S         Toont bestanden in de opgegeven en onderliggende directories\n /B         Gebruik gestript formaat (geen extra informatie of opsomming).\n /L         Toon bestandsnamen in kleine letters.\n /Y of /4   Geeft het jaartal viercijferig weer.\n\nSchakelopties mogen vooraf ingesteld worden in de DIRCMD omgevingsvariabele.\nNegeer deze vooraf ingestelde schakelopties door een optie te voorzien van\neen - (streepje) -- bijvoorbeeld /-W of /-P\n\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nHet losse programma DOSKEY zit ingebouwd in FreeCOM.\nGebruik de pijltoetsen OMHOOG en OMLAAG om de geschiedenis terug te roepen\nen HISTORY om deze weer te geven.\nGebruik de pijltoetsen LINKS en RECHTS en de toetsen END en HOME om te\nnavigeren binnen de opdrachtregel en gebruik INSERT om te schakelen tussen\nde invoeg- en de overschrijfmodus(standaard).\nGebruikt de TAB toets om het huidige woord als bestandsnaam aan te vullen;\ngebruik het tweemaal om alle gevonden bestanden te tonen.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nBewerkt opdrachtregels, roept opdrachtregels terug, en maakt macro's aan\n\nDOSKEY [/schakeloptie ...] [macronaam=[tekst]]\n\n  /BUFSIZE:grootte Stelt grootte van macro en opdrachtbuffer in (standaard:512)\n  /ECHO:on|off     Stelt weergave van macro-expansie in of uit  (default:ON)\n  /FILE:bestand    Duidt bestand met lijst van macro's aan\n  /HISTORY         Toont alle in geheugen opgeslagen opdrachten\n  /INSERT          Voegt nieuwe tekens tussen woorden in bij typen\n  /KEYSIZE:grootte Bepaalt grootte v keyboard type-ahead buffer (standaard:15)\n  /LINE:grootte    Bepaalt max grootte van regelbewerkinsbuffer (standaard:128)\n  /MACROS          Geeft alle DOSKey macro's weer\n  /OVERSTRIKE      Overschrijft nieuwe tekens bij het typen (standaard)\n  /REINSTALL       Installeert een nieuwe kopie van DOSKey\n  macronaam        Duidt de voor de macro te gebruiken naam aan\n  tekst            Duidt de aan de macro toe te wijzen opdrachten aan\n\n  OMHOOG,OMLAAG pijlen roepen opdrachten terug\n       Esc wist het huidige commando\n        F7 toont de lijst van reeds gegeven opdrachten\n    Alt+F7 wist de hierboven genoemde opdrachtgeschiedenis\n[tekens]F8 zoekt naar opdrachten beginnend met [tekens]\n        F9 selecteert een opdracht op geschiedenisnummer\n   Alt+F10 wist alle macro definities\n\nDe volgende tekens zijn speciale codes die u kunt gebruiken bij het\nopgeven van DOSKey macro definities:\n  $T     Opdracht-scheiding: staat meerder opdrachten in een regel toe\n  $1-$9  Batch parameters: equivalent van %1-%9 in batch programma's\n  $*     Symbool dat vervangen wordt door alle volgende aan de macro\n         opgegeven parameters op de opdrachtregel\n.\n\n:TEXT_CMDHELP_ECHO\nGeeft berichten weer, of zet opdracht-echo aan of uit.\n\n  ECHO [ON | OFF]\n  ECHO [bericht]\n\nTyp ECHO zonder parameters om de huidige instelling te laten zien.\n.\n\n:TEXT_CMDHELP_EXIT\nStopt de FreeDOS opdrachtverwerkings-schil.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\nVoert de opgegeven opdracht uit voor elk bestand in een verzameling bestanden\n\nFOR %%variabele IN (verzameling) DO opdracht [opdrachtparameters]\n\n %%variabele  Duidt een vervangbare parameter aan.\n (set)       Duidt een verzameling bestanden aan(1+). Jokertekens toegestaan\n opdracht    Voert de op elk bestand uit te voeren opdracht uit.\n opdrachtparameters\n             Duidt parameters of schakelopties voor de opgegeven opdracht aan\n\nOm de opdracht FOR te gebruiken in een batchprogramma,\nmoet u %%%%variabele opgeven in plaats van %%variable.\n.\n\n:TEXT_CMDHELP_GOTO\nStuurt de opdrachtverwerker naar een gelabelde regel in een batchprogramma.\n\nGOTO label\n\n  label   Duidt een tekenreeks aan welke als label wordt gebruikt\n\nEen label is een woord op een regel voorafgegaan door een dubbele punt (\":\").\n.\n\n:TEXT_CMDHELP_HISTORY#1\nHistory opdracht.\n\nHISTORY [grootte]\n\nZonder \"grootte\" wordt de huidige inhoud van de opdrachtregelhistorie-\nbuffer weergegeven.\nAls grootte is aangegeven, wordt de historiebuffer op deze waarde ingesteld.\n.\n\n:TEXT_CMDHELP_IF\nVoert conditionele verwerking uit binnen batchprogramma's.\n\nIF [NOT] ERRORLEVEL nummer opdracht\nIF [NOT] reeks1==reeks2 opdracht\nIF [NOT] EXIST bestandsnaam opdracht\n\n  NOT                Geeft aan dat de opdrachtverwerker de opdracht alleen\n                     mag uit voeren als de voorwaarde vals/ongeldig is.\n  ERRORLEVEL getal   Duidt een bepaalde conditie aan als het laatst\n                     uitgevoerde programma een afsluitwaarde retourneert\n                     groter dan of gelijk aan het opgegeven getal.                                   \n  opdracht           Duidt de uit te voeren opdracht uit indien aan de\n                     voorwaarde wordt voldaan.\n  reeks1==reeks2     Duidt een geldige voorwaarde aan als de opgegeven\n                     tekenreeksen overeenkomen.\n  EXIST bestandnaam  Duidt een geldige voorwaarde aan als het opgegeven\n                     bestand bestaat.\n.\n\n:TEXT_CMDHELP_LH\nLaadt een programma in het upper memory area.\n\nLOADHIGH [drive:][pad]bestandsnaam [parameters]\nLOADHIGH [/L:gebied1[,mingrootte1][;regio2[,mingrootte2]...] [/S]]\n         [drive:][pad]bestandsnaam [parameters]\n\n/L:regio1[,mingrootte1][;regio2[,mingrootte2]]...\n            Duidt de geheugengebieden aan waarin u een programma wilt laden.\n            Regio1 duidt het nummer van het eerste geheugengebied aan\n            mingrootte1 duidt de minimale grootte, indien enige, voor regio1.\n            aan. Regio2 en mingrootte2 duiden het nummer en minimale grootte \n\t    van het tweede geheugengebied aan, indien opgegeven. U kunt zoveel \n            gebieden opgeven als u wilt.\n\n/S          Dwingt een UMB te krimpen naar minimale grootte terwijl het\n            programma aan het laden is.\n\n[drive:][pad]bestandsnaam\n            Duidt de locatie en naam van het programma aan\n.\n\n:TEXT_CMDHELP_LOADFIX\nLaadt een programma boven de eerste 64K geheugen, en voert het programma uit.\n\nLOADFIX [drive:][pad]bestandsnaam\n\nGebruik LOADFIX om een programma te laden indien u het bericht \"Packed\nfile corrupt\" hebt gekregen terwijl u het programma poogde te laden in\nhet lage systeemgeheugen.\n.\n\n:TEXT_CMDHELP_MD\nMaakt een directory.\n\nMKDIR [drive:]pad\nMD [drive:]pad\n.\n\n:TEXT_CMDHELP_PATH\nToont of stelt het zoekpad voor uitvoerbare bestanden in.\n\nPATH [[drive:]pad[;...]]\nPATH ;\n\nTyp PATH ; om alle zoekpad instellingen te wissen en om de opdrachtschil\nte dwingen alleen te zoeken in de huidige directory.\nTyp PATH zonder parameters om het huidige pad weer te geven.\n.\n\n:TEXT_CMDHELP_PAUSE\nOnderbreekt het verwerken van een batchprogramma tijdelijk en toont \nhet bericht: \"Druk op een toets om door te gaan....\" of een eigen melding.\n\nPAUSE [bericht]\n.\n\n:TEXT_CMDHELP_PROMPT\nWijzigt de opdracht prompt .\n\nPROMPT [tekst]\n\n  tekst    De te gebruiken nieuwe opdrachtprompt.\n\nPrompt kan worden opgebouwd uit gewonen tekens en de volgende speciale codes:\n\n  $Q   = (is-teken)\n  $$   $ (dollar teken)\n  $T   Huidige tijd\n  $D   Huidige datum\n  $P   Huidige schijf en pad\n  $V   Het versienummer van de FreeDOS opdrachtverwerker\n  $N   Huidige schijf(-letter)\n  $G   > (groter-dan teken)\n  $L   < (kleiner-dan teken)\n  $B   | (pijpsymbool)\n  $H   Backspace (wist vorige teken)\n  $E   Escape code (ASCII code 27)\n  $_   Carriage return en linefeed\n\nTyp alleen PROMPT om de prompt in te stellen op de standaardinstellingen.\n.\n\n:TEXT_CMDHELP_PUSHD\nGooit de huidige directorie op de directory stack, met de optie om de \nhuidige werkdirectory te wijzigen.\n\nPUSHD [[drive:]pad]\n  Waarbij [drive:]pad het pad waarna u wilt overschakelen is.\n.\n\n:TEXT_CMDHELP_POPD\nGooit een directory van de directory stack, en schakelt ernaar over.\n\nPOPD [*]\n  De '*' parameter maakt de directory stack leeg.\n.\n\n:TEXT_CMDHELP_DIRS\nToont de inhoud van de directory stack.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\nVerwijdert een directory.\n\nRMDIR [drive:]pad\nRD [drive:]pad\n.\n\n:TEXT_CMDHELP_REM\nLegt commentaarberichten (opmerkingen) vast in een batchbestand of CONFIG.SYS\n\nREM [commentaarbericht]\n.\n\n:TEXT_CMDHELP_REN\nHernoemt een bestand/directory of bestanden/directories.\n\nRENAME [drive:][pad][dirnaam1 | bestandnaam1] [directorynaam2 | bestandnaam2]\nREN [drive:][pad][dirnaam1 | bestandnaam1] [directorynaam2 | bestandnaam2]\n\nMerk op dat u geen nieuwe schijf of pad als bestemming kunt opgeven.\nGebruik voor dat doeleinde de opdracht MOVE.\n.\n\n:TEXT_CMDHELP_SET#1\nToont, stelt in, of verwijdert omgevingsvariabelen.\n\nSET [/C] [variabele=[tekenreeks]]\n\n  variabele   Duidt de naam van de omgevingsvariabele aan.\n  tekenreeks  Een reeks karakters die u toewijst aan de variabele.\n\n* Als geen tekenreeks wordt opgegeven wordt de variabele gewist.\n\nTyp SET zonder parameters om de huidige omgevingsvariabelen weer te geven.\n\n/C dwingt om kleine letters te behouden; standaard wordt de naam van de\nvariabele naar hoofdletters omgezet indien nog niet in de omgevingsruimte\naanwezig.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nVerandert de positie van vervangbare parameters in een batchbestand.\n\nSHIFT [DOWN]\n\nDOWN schuift de argumenten volgorde vanaf het begin (%%0); anders\nnaar het einde.\n.\n\n:TEXT_CMDHELP_TIME#1\nGeeft de huidige tijd aan of stelt deze in.\n\nTIME [/T] [tijd]\n\nTyp TIME zonder parameters om de huidige tijd op te geven en om te vragen\nnaar een nieuwe tijd. Druk op ENTER om dezelfde tijd te behouden.\n\n/T voorkomt dat TIME u vraagt een nieuwe tijd op te geven.\n.\n\n:TEXT_CMDHELP_TRUENAME\nGeeft de volledige padnaam weer van het opgegeven pad.\n\nTRUENAME [drive:][pad][bestandsnaam]\n.\n\n:TEXT_CMDHELP_TYPE\nToont de inhoud van een tekstbestand.\n\nTYPE [drive:][pad]bestandsnaam\n.\n\n:TEXT_CMDHELP_VER\nToont de versie van de FreeDOS opdrachtverwerker en andere informatie.\n\nVER [/R] [/W] [/D] [/C]\n\n /R         Toont kernel versie en andere informatie.\n /W         FreeDOS opdrachtverwerker garantiebepalingen.\n /D         FreeDOS opdrachtverwerker verspreidingsinformatie.\n /C         FreeDOS opdrachtverwerker medewerkers.\n.\n\n:TEXT_CMDHELP_VERIFY\nVertelt het FreeDOS bestandssysteem of er uitgebreid gecontroleerd\ndient te worden of bestanden juist naar schijf zijn geschreven.\n\nVERIFY [ON | OFF]\n\nTyp VERIFY zonder parameters om de huidige instelling te tonen.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nAls debuggen is gecompileerd binnen FreeDOS zal deze opdracht debug uitvoer\naan of uitzetten, of u vertellen of deze aan of uit staat.\n\nFDDEBUG [ON | OFF | bestand]\n\nTyp FDDEBUG zonder parameters om de huidige instelling te zien.\nAls een bestand wordt opgegeven zal alle uitvoer naar dat bestand gestuurd\nworden; Als het bestand al bestaat, wordt de uitvoer eraan toegevoegd.\nDe speciale namen \"stdout\" en \"stderr\" mogen gebruikt worden om de uitvoer\nte verwijzen naar de standaard uitvoer of standaard foutmeldingsstroom.\n.\n\n:TEXT_CMDHELP_VOL\nToont het schijf volume label en serienummer indien deze bestaan.\n\nVOL [schijf:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nToont een lijst van opdrachten en voorzieningen beschikbaar binnenin de schil\n\n?\n?opdracht [argument]\n\nDe eerste variant toont elke beschikbare interne opdracht en voorzieningen.\nDe tweede zal u vragen of een opgegeven opdracht al dan niet moet worden\nuitgevoerd, net zoals dat gebeurt als traceer-modus actief is.\n.\n\n:TEXT_CMDHELP_WHICH\nZoekt en toont het uitvoerbare bestand voor elke opgegeven opdracht.\n\nWHICH {opdracht}\n.\n\n:TEXT_CMDHELP_MEMORY#1\nGeeft het binnen FreeCOM gebruikte interne systeemgeheugen aan\n\nMEMORY\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\nDe eindbestemming van COPY mag geen plus-tekens ('+') bevatten.\n.\n\n:TEXT_DELETE_FILE#1\nBezig met verwijderen van bestand \"%s\".\n.\n"
  },
  {
    "path": "strings/english.err",
    "content": "# Dummy file as the English language is the default\n# However, can be used to include non-7bit-ASCII characters forbidden\n# in DEFAULT.err\n"
  },
  {
    "path": "strings/english.lng",
    "content": "# Dummy file as the English language is the default\n# However, can be used to include non-7bit-ASCII characters forbidden\n# in DEFAULT.lng\n"
  },
  {
    "path": "strings/finnish.err",
    "content": "# $Id$\n#\n# Critical error national customization file\n#\n#       Language: Finnish\n#       Codepage: 850\n#       Author:   Sampo Hippelinen\n# \n# The critical error (criter) handler receives some information\n# from the kernel about what error condition happens, generates some\n# human friendly message from it, requests the user's opinion about\n# how to proceed and, finally, returns to the kernel.\n# \n# The human friendly message is generated using one of the following\n# templates:\n# BLOCK_DEVICE (for criters on block devices)\n# \tError %1 drive %A: %2 area: %3\n# -and- CHAR_DEVICE (for criters on character devices)\n# \tError %1 device %A: %3\n# \n# Two-character sequences, which first character is a percent sign '%',\n# are placeholders for other information:\n# %% -> a single percent sign\n# %1 -> either READ or WRITE, depending on what kind of operation\n# \tcaused the criter\n# %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA\n# %3 -> the actual error string; these are the strings associated to\n# \ta number 0 through N, and must correspond to the number passed in\n# \tlowbyte(DI) to the criter handler (see RBIL INT-24 for details)\n# %A -> drive letter (for block devices); name of device (character devices)\n# \n# Below the line describing the error the user is prompted for the action\n# to proceed. This line is dynamically constructed depending on which\n# action are available at all. The full line may look like this:\n# \t(A)bort, (I)gnore, (R)etry, (F)ail?_\n# \n# The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They\n# should indicate which user response keys is associated with them;\n# suggested is to use the first letter and enclose it in parenthesises.\n# The delimiter \", \" can be defined with DELIMITER and is the same\n# for all slots.\n# The \"? \" sequence is defined by QUESTION.\n# The order of the actions is fixed and cannot be customized.\n# \n# With each action a number of user response keys must be associated.\n# They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ...\n# strings. Because the key is searched in the same format as returned\n# by INT-16-00, both upper and lower case must be specified and\n# certain special keys cannot be used.\n# \n# The individual error strings are defined by the #: lines, where\n# the hash sign '#' refers to the number the kernel passes to the\n# criter handler. The UNKNOWN string is displayed for all error\n# numbers not specified.\n#\n# NOTE #1: The percent rule applies to _all_ criter strings!\n# NOTE #2: Each string occupies exactly one line.\n# NOTE #3: Any leading or trailing whitespaces are removed. Prefix the\n#\tfirst or suffix the last whitespace with '%.' (one percent sign and\n#\tone dot). This sequence is removed from the string totally.\n# NOTE #4: To embed any character use: %&## (one percent sign,\n#\t\tone ampersand and exactly two hexa-decimal digits)\n\n## Primary strings\nS2\nBLOCK_DEVICE: Virhe %1 aseman %A: %2aluetta: %3\nS3\nCHAR_DEVICE: Virhe %1 laitetta %A: %3\n\n## kind of operation\nS0\nREAD: lukiessa\nS1\nWRITE: kirjoittaessa\n\n## kind of failed area of block devices\nS4\nDOS: DOS-\nS5\nFAT: FAT-\nS6\nROOT: juuri\nS7\nDATA: tieto\n\n## action strings\nS8\nIGNORE: (O)hitus\nS9\nRETRY: (U)usinta\nS10\nABORT: (L)opetus\nS11\nFAIL: (V)irhe\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: oO\nKEYS_RETRY:  uU\nKEYS_ABORT:  lL\nKEYS_FAIL:   vV\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN: Tuntematon virhekoodi\nS15\n0: kirjoitussuojausvirhe\n1: ajuri ei tunnista yksikk\n2: asema ei valmis\n3: ajuri ei tunnista komentoa\n4: tietovirhe (CRC)\n5: virheellinen laiteajuripyynttietueen koko\n6: hakuvirhe\n7: tunnistamaton tietovline\n8: sektoria ei lydy\n9: tulostimen paperi loppu\n10: kirjoitusvirhe\n11: lukuvirhe\n12: yleinen virhe\n13: yhteiskyttvirhe\n14: lukitusvirhe\n15: vr levynvaihto\n16: tiedoston ohjauslohko ei kytettviss\n17: yhteiskyttpuskurin ylivuoto\n18: koodisivut eivt tsm\n19: syte loppu\n20: levytila ei riit\n"
  },
  {
    "path": "strings/finnish.lng",
    "content": "# $Id$\n#\n# FreeCOM national customization file\n#\n#       Language: Finnish\n#       Codepage: 850\n#       Author:   Sampo Hippelinen\n# \n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retreive the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#\t:TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n# If there is a percent sign (%) appended to the version, the printf()\n# format string %-style placeholders are compared for the strings. The\n# sign need to be set in DEFAULT.lng only.\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carrage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause an user interaction. Those ones should be in sync\n# with the issued text. To define how to interprete a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#KkEe\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceeding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the question\n# mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readibility of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH#0%\nVirheellinen valitsin. - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH#0%\nVirheellinen valitsin. - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION#0%\nVrnmuotoinen valitsin: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG#0%\nValitsimella '%s' ei kuulu olla argumenttia\n.\n\n:TEXT_ERROR_OPT_NOARG#0%\nValitsimella '%s' pit olla argumentti\n.\n\n:TEXT_INVALID_NUMBER#0%\nVirheellinen luku valitsimelle '%s'\n.\n\n:TEXT_ERROR_CLOSE_QUOTE#0%\nPuuttuva loppulainausmerkki: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nVliaikaistiedoston luonti eponnistui\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0%\nLiikaa parametreja. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nLiikaa parametreja.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER#0%\nVirheellinen parametri. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nPolkua ei lydy.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nTiedostoa ei lydy.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND#0%\nTiedostoa ei lydy. - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING#0%\nVaadittu parametri puuttuu.\n.\n\n:TEXT_ERROR_INVALID_DRIVE#0%\nVirheellinen asema %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2%\nKomento tai tiedostonimi tuntematon - \"%s\".\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nMuisti loppu.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nDOS-muistin varausvirhe.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nPutkivirhe!  Vliaikaistiedoston avaus eponnistui!\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE#0%\nRivi #%ld komentojonossa '%s' liian pitk.\n.\n\n:TEXT_ERROR_BFILE_VANISHED#0%\nKomentojonoa '%s' ei lydy.\n.\n\n:TEXT_ERROR_BFILE_LABEL#0%\nKomentojonossa '%s' ei ole nimit '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1%\n%s '%s' eponnistui.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR#0%\nEi voitu asettaa ympristmuuttujaa '%s'.\nYmprist tynn?\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND#0%\nYmpristmuuttujaa '%s' ei lydy.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nYmprist puuttuu. Muisti ehk vhiss. Kyt /E-valitsinta.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1%\nAliasta '%s' ei voitu asettaa. Aliastila tynn?\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1%\nAliasta '%s' ei lydy.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nEi aliastilaa. Muisti ehk vhiss.\n.\n\n:TEXT_ERROR_SYNTAX_STR#0%\nSyntaksivirhe. - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nSyntaksivirhe.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG#0%\nTiedostonimi liian pitk. - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY#0%\nEi voi kopioida '%s' itseens\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nKomentorivi liian pitk aliaslaajennuksineen!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nKomentorivi yli 125 merkki pitk.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1%\nHistorian koko '%s' virheellinen.\n.\n\n:TEXT_HISTORY_EMPTY#1\nKomentorivihistoria tyhj.\n.\n\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nMuistin ohjauslohkoketju virheellinen tai MS-DOS ei yhteensopiva.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR#0%\nTuntematon virhe %d.\n.\n\n:TEXT_ERROR_REGION_WARNING#0%\nMuistialue %d virheellinen - ohitetaan.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nTytyy olla ON tai OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nVirheellinen muuttujan mrittely.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR: IN puuttuu.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nSulku tai molemmat sulut puuttuu.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR: DO puuttuu.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR: komento puuttuu DO:n perst.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE#0%\nSytett ei voi ohjata tiedostosta '%s'.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE#0%\nTulostetta ei voi ohjata tiedostoon '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nTyhj ohjaus.\n.\n\n:TEXT_ERROR_INVALID_DATE\nVirheellinen pivmr.\n.\n\n:TEXT_ERROR_INVALID_TIME\nVirheellinen aika.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nGOTO:lle ei mritelty nimit.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nTm COMMAND.COM ei tue CTTY-komentoa.\n.\n\n:TEXT_ERROR_NORW_DEVICE#0%\nPuuttuva tai virheellinen siirrntlaite '%s'.\n.\n\n:TEXT_ERROR_CTTY_DUP#0%\nTiedostokuvaajia ei voitu muuttaa TTY-laitteelle '%s'.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\n/L ei viel toteutettu.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\n/U ei viel toteutettu.\n.\n\n:TEXT_ERROR_WRITING_DEST\nKirjoitus kohteeseen eponnistui.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE#0%\nLhteen avaus eponnistui. - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE#0%\nEi voitu avata tiedostoa '%s'\n.\n\n:TEXT_ERROR_READ_FILE#0%\nEi voitu lukea tiedostosta '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE#0%\nEi voitu kirjoittaa tiedostoon '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\nYhdistysmerkki '+' ei voi olla argumenttien edell.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nYhdistysmerkki '+' ei voi olla argumenttien perss.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nEi mitn tehtv.\n.\n\n:TEXT_ERROR_COPY\nCOPY eponnistui\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: tiedostonimi puuttuu\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: luku puuttuu\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: luku virheellinen\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: komento puuttuu\n.\n\n:TEXT_NOT_IMPLEMENTED_YET\nEi viel toteutettu... pahoittelemme.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nEi voitu ladata viestej muistiin.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nTm COMMAND.COM ei toteuta /MSG-valitsinta.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1%\n%u kohdetta.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nKomentorivi vioittunut. Sisinen virhe, joka johtuu jrjestelmst,\njolla COMMAND.COM:ia ajetaan. Ilmoita tst virheest, kiitos.\n.\n\n:TEXT_QUOTED_C_OR_K#1\n/C ja /K -valitsimet eivt tue lainausmerkkej, ohitetaan.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1%\nCOMMAND.COM:in polku tulee olla kokonaan mritetty!\nSen tulee sislt aseman kirjain ja alkaa kenoviivalla.\nEsimerkki: C:\\\\FDOS\n\nCOMMAND.COM olettaa polun nyt olevan:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nIstuntotietoja ei voitu palauttaa. Paikalliset asetukset\nmenetetn. Yll olevat virheviestit kuvaavat ongelmaa.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nNykyisi tietoja ei voida silytt ohjelmaa kutsuessa.\nYll olevat virheviestit kuvaavat ongelmaa.\n.\n\n:TEXT_ERROR_CWD_FAILED#1%\nAsema %c: ei vastaa.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nHeittovaihto eponnistui: aliakset vievt liikaa muistia.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nHeittovaihto eponnistui: etmuistin varaus eponnistui.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nAliastila loppu.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1%\nEi aliasta: '%s'\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nAliaksen lisys eponnistui.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1%\nAliaksen nimi '%s' virheellinen.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nKontekstimoduulin tai virheenksittelijn latausvirhe.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nKontekstilta loppui muisti.\nJos virhe toistuu, harkitse sisisen puskurin tilan kasvatusta,\nkuten historian, hakemistopinon, tms.\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1%\nKontekstin yhteiskoko %lu tavua ylitt enimmisrajan.\nKooksi asetetaan %u tavua.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nTilatiedon lukeminen kontekstiin eponnistui. Virhe voi johtua\nmuistin vioittumisesta tai kontekstin vhimmiskoon vrin\nmrittelyst. Ilmoitathan FreeCOM:n yllpitjlle:\nfreedos-devel@lists.sourceforge.net\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nKonteksti puuttuu heittovaihdon jlkeen. Se luodaan uudelleen,\nmutta aliakset ym. menetetn.\n.\n\n:TEXT_ERROR_PERMISSION_DENIED#1%\n%s: Psy evtty\n.\n\n:TEXT_ERROR_NO_SUCH_FILE#1%\n%s: Tiedostoa tai hakemistoa ei lydy\n.\n\n:TEXT_ERROR_UNKNOWN_ERROR#1%\n%s: Tuntematon virhe\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nPaina mit tahansa nppint jatkaaksesi . . .\\\n.\n\n:TEXT_MSG_HISTORY_SIZE#0%\nHistorian koko %d tavua.\n.\n\n:TEXT_MSG_DOSKEY\nDOSKEY on jo kytss tss kehotteessa.\n.\n\n:TEXT_MSG_ECHO_STATE#0%\nECHO on %s\n.\n\n:TEXT_MSG_VERIFY_STATE#0%\nVERIFY on %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE#0%\nDEBUG-tuloste on %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET#0%\nDEBUG-tuloste sijaintiin '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE#0%\nBREAK on %s\n.\n\n:TEXT_MSG_LFNFOR_STATE#0%\nLFNFOR on %s\n.\n\n:TEXT_MSG_LFNFOR_COMPLETE_STATE#0%\nLFN-tydennys on %s\n.\n\n:TEXT_MSG_CURRENT_DATE#0%\nPivmr nyt on %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1%\nSyt uusi pivmr (kk%spp%s[vv]vv): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1%\nSyt uusi pivmr (pp%skk%s[vv]vv): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1%\nSyt uusi pivmr ([vv]vv%skk%spp): \\\n.\n\n:TEXT_MSG_CURRENT_TIME#0%\nAika nyt on %s\n.\n\n:TEXT_STRING_PM#1\n ip.\\\n.\n:TEXT_STRING_AM#1\n ap.\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nSyt uusi aika: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING#0%\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (K/E) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1%\nKkEe{CR}{LF}{CBREAK}\naabb   b   b       b\nKaikki tiedostot sijainnissa '%s' poistetaan!\nOletko varma (K/E)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nKkEe{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [Kyll=ENTER, Ei=ESC] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#\tby \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1%\nKkEeAaLl{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\nControl-Break painettu.\\r\nLopetetaanko komentojono '%s' (Kyll/Ei/kAikki) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1%\nKkEeAaLl{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nKorvataanko '%s' (Kyll/Ei/kAikki/Lopeta) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_APPEND_FILE#1%\nKkEeAaLl{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nLiitetnk tiedostoon '%s' (Kyll/Ei/kAikki/Lopeta) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1%\nKkEeAaLl{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nPoistetaanko '%s' (Kyll/Ei/kAikki/Lopeta) ? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<tuntematon>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nHakemistopino tyhj.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1%\n Taltio asemassa %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING#0%\non %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nnimetn\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER#0%\n Taltion sarjanumero on %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1%\n%10s tiedosto(a)\\\n.\n:TEXT_DIR_FTR_BYTES#0%\n   %12s tavua\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nYhteens lueteltu:\n.\n:TEXT_DIR_FTR_DIRS#1%\n%10s hakemisto(a)\\\n.\n:TEXT_DIR_FTR_BYTES_FREE#0%\n%15s tavua vapaana\n.\n:TEXT_DIR_DIRECTORY#0%\nHakemisto: %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE#0%\n Hakemisto: %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1%\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE#1%\n%s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1%\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1%\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <HAK> \\\n.\n:TEXT_DIR_LINE_SIZE#1%\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1%\n%-14s\\\n.\n\n:TEXT_MSG_PATH#0%\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nHakupolkua ei mritelty.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nsu\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nma\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nti\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nke\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\nto\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\npe\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nla\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\nmitn ei poistettu.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\nyksi tiedosto poistettu.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1%\n%u tiedostoa poistettu.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nSaatavilla olevat sisiset komennot:\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\nSaatavilla olevat toiminnallisuudet:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[aliakset] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[paranneltu syte] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[historia] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[tiedostonimen tydennys] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[heittovaihto] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[kynnistysloki] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[viime hakemisto] \\\n.\n:TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1\n[pitkt tiedostonimet] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[ytimen heittovaihto] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[XMS-heittovaihto] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[heittovaihto oletuksena] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[asennettavat komennot] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[hakemistopino (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[FreeCOM-virheenkorjaus] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nF8 kynnist jljitystilan, F5 ohittaa %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0%\nOhitetaan '%s'.\n.\n\n:TEXT_MSG_VER_DOS_VERSION#0%\nDOS-versio %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nFreeDOS-ydin (koontiversio 1933 tai vanhempi)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS#0%\nFreeDOS-ydin versio %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\n(C) 1994-2005 Tim Norman ja muut.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nGeneral Public License for more details.\n\nVikailmoitukset (englanniksi) osoitteeseen\nfreedos-devel@lists.sourceforge.net.\nPivitykset osoitteesta http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\n(C) 1994-2005 Tim Norman ja muut.\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2 of the License, or (at\nyour option) any later version.\n\nVikailmoitukset (englanniksi) osoitteeseen\nfreedos-devel@lists.sourceforge.net.\nPivitykset osoitteesta http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\nFreeDOS-komentokehotteella on ollut monta kehittj, ks.\nsisllytetty HISTORY.TXT-tiedosto.\n\nVikailmoitukset (englanniksi) osoitteeseen\nfreedos-devel@lists.sourceforge.net.\nPivitykset osoitteesta http://freedos.sourceforge.net/freecom\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nKomentokehote on sulkeutumassa, mutta sen ei pitisi\\r\n(yleens \"/P\"-valitsimen takia).\\r\nKynnist jrjestelm uudelleen, tai jos kehote on moniajo-\\r\nympristss, lopeta tm tehtv tai prosessi manuaalisesti.\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nFreeCOM-ohjelmaa ei lydy.\nCOMMAND.COM:n koko polku tulee mritt COMMAND:n\nensimmiseksi argumentiksi, esimerkiksi:\nC:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1%\nYmpristsegmentti     : maks. %5u tavua; vapaa %5u tavua\n.\n:TEXT_MEMORY_CONTEXT#1%\nKontekstisegmentti     : maks. %5u tavua; vapaa %5u tavua\n.\t\n:TEXT_MEMORY_HEAP#1%\nKeko                   : %5lu tavua vapaana\n.\n:TEXT_MEMORY_CTXT_ALIAS#1%\n\\tAliakset       : raja  %5u tavua, kytss %5u tavua, %5u kohdetta\n.\n:TEXT_MEMORY_CTXT_HISTORY#1%\n\\tHistoria       : raja  %5u tavua, kytss %5u tavua, %5u kohdetta\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1%\n\\tHakemistopino  : raja  %5u tavua, kytss %5u tavua, %5u kohdetta\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1%\n\\tViime hak. -VM : kyt. %5u tavua, %5u kohdetta\n.\n:TEXT_MEMORY_CTXT_BATCH#1%\n\\tKJ-siskkisyys: kyt. %5u tavua, %5u kohdetta\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1%\n\\tHV-tiedot      : kyt. %5u tavua, %5u kohdetta\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nNykyist koodisivua ei voitu mritt.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nKoodisivua ei voitu vaihtaa.\n.\n:TEXT_DISPLAY_CODEPAGE#1%\nNykyinen koodisivu on: %u.\nJrjestelmn (oikea) koodisivu on: %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nNytt, asettaa tai poistaa aliaksia.\n\nALIAS [muuttuja[=][merkkijono]]\n\n\tmuuttuja    Mritt aliaksen nimen.\n\tmerkkijono  Mritt aliaksen merkkijonon.\n\n\nALIAS ilman parametreja nytt nykyiset aliakset.\n.\n\n:TEXT_CMDHELP_BEEP\nSoittaa merkkinen.\n.\n\n:TEXT_CMDHELP_BREAK\nOttaa kyttn tai poistaa kytst laajennetun Ctrl+C-tarkistuksen.\n\nBREAK [ON | OFF]\n\nBREAK ilman parametreja nytt nykyisen BREAK-tilan.\n.\n\n:TEXT_CMDHELP_CALL#1\nKutsuu komentojonoa toisesta komentojonosta.\n\nCALL [/S | /N] [/Y] [asema:][polku]tiedostonimi [parametrit]\n\n  parametrit   Mritt kutsuttavan komentojonon vaatimat\n               komentojonoparametrit.\n  /S pakottaa ja /N est FreeCOM:n heittovaihdon.\n  /Y ottaa jljitystilan kyttn kutsutulle komentojonolle.\n.\n\n:TEXT_CMDHELP_CD\nNytt nykyisen hakemiston nimen tai vaihtaa hakemistoa.\n\nCHDIR [asema:][polku]\nCHDIR[..]\nCD [asema:][polku]\nCD[..]\nCD -\n\n  ..   Siirtyy ylhakemistoon.\n  -    Jos \"viime hakemisto\" on kytss, vaihtaa viime hakemistoon.\n\nCD asema: nytt mritetyn aseman nykyisen hakemiston.\nCD ilman parametreja nytt nykyisen aseman ja hakemiston.\nKatso mys: CDD\n.\n\n:TEXT_CMDHELP_CDD\nNytt nykyisen aseman sek hakemiston tai vaihtaa asemaa sek hakemistoa.\n\nCDD [asema:][polku]\nCDD[..]\n\n  ..   Siirtyy ylhakemistoon.\n  -    Jos \"viime hakemisto\" on kytss, vaihtaa viime hakemistoon.\n\nJos asema: mritetn, nykyist asemaa vaihdetaan;\ntm on ainoa ero \"CHDIR\"-komentoon.\nCDD ilman parametreja nytt nykyisen aseman ja hakemiston.\n.\n\n:TEXT_CMDHELP_CHCP\nNytt nykyisen koodisivun numeron tai vaihtaa koodisivua.\n\nCHCP [nnn]\n\n  nnn   Mritt koodisivun numeron.\n\nCHCP ilman parametreja nytt nykyisen koodisivun numeron.\n.\n\n:TEXT_CMDHELP_CLS\nTyhjent kuvaruudun.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\nAloittaa uuden FreeDOS-komentokehotteen.\n\nCOMMAND [[asema:]polku] [laite] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG]\n                       [/LOW] [/Y [/[C|K] komento]]\n  [asema:]polku   Mritt COMMAND.COM-ohjelman sisltvn hakemiston.\n  laite           Asettaa kytettvn syte- ja tulostelaitteen.\n  /E:nnnnn        Asettaa ympristn aloituskoon olemaan nnnnn tavua.\n                  (nnnnn on oltava 256 ja 32 768 vlilt).\n  /L:nnnn         Asettaa sisisen puskurin koon (vaatii /P-valitsimen).\n                  (nnnnn on oltava 128 ja 1 024 vlilt).\n  /U:nnn          Asettaa sytepuskurin koon (vaatii /P-valitsimen).\n                  (nnnnn on oltava 128 ja 255 vlilt).\n  /P              Tekee kehotteesta pysyvn (est lopettamisen).\n  /MSG            Sil virheviestit muistiin (vaatii /P-valitsimen).\n  /LOW            Pakottaa komentokehotteen pitmn tytietonsa\n                  alamuistissa.\n  /Y              Suorittaa /C tai /K-valitsimen komentojonon vaiheittain.\n  /C komento      Suorittaa annetun komennon ja lopettaa.\n  /K komento      Suorittaa annetun komennon ja jatkaa suoritusta.\n.\n\n:TEXT_CMDHELP_COPY\nKopioi yhden tai useamman tiedoston eri sijaintiin.\n\nCOPY [/A | /B] lhde [/A | /B] [+ lhde [/A | /B] [+ ...]] [kohde\n  [/A | /B]] [/V] [/Y | /-Y]\n\n  lhde        Mritt kopioitavat tiedostot.\n  /A           Ilmaisee, ett kyseess on ASCII-tekstitiedosto.\n  /B           Ilmaisee, ett kyseess on binritiedosto.\n  kohde        Mritt tiedostojen uuden sijainnin ja/tai uudet nimet.\n  /V           Tarkistaa, ett tiedostot kirjoitetaan oikein.\n  /Y           Est korvauskehotteen ja korvaa kaikki jo olemassa olevat\n               kohdetiedostot lhdetiedostoilla.\n  /-Y          Kysyy kehotteella jokaiselle tiedostolle erikseen,\n               tulisiko jo olemassa oleva kohdetiedosto korvata.\n\nCOPYCMD-ympristmuuttuja saattaa mritell /Y-valitsimen.\nJos tm asetus halutaan ohittaa, kyt valitsinta /-Y.\n\nJos haluat liitt tiedostoja yhteen, mrit kohteeksi yksi tiedosto ja\nlhteeksi useampi (yleismerkeill tai muodossa tiedosto1+tiedosto2+tiedosto3).\n.\n\n:TEXT_CMDHELP_CTTY\nVaihtaa jrjestelm ohjaavaa ptelaitetta.\n\nCTTY laite\n\n  laite    Haluamasi ptelaite, kuten COM1.\n.\n\n:TEXT_CMDHELP_DATE#1\nNytt tai asettaa pivmrn.\n\nDATE [/D] [date]\n\nDATE ilman parametreja tuo nyttn nykyisen pivmrn ja kehotteen\nuudesta pivmrst. Paina ENTER pitksesi saman pivmrn.\n\n/D est komentoa esittmst kehotteita.\n.\n\n:TEXT_CMDHELP_DEL#2\nPoistaa yhden tai useamman tiedoston.\n\nDEL [asema:][polku]tiedostonimi [/P] [/V]\nERASE [asema:][polku]tiedostonimi [/P] [/V]\n\n  [asema:][polku]tiedostonimi   Mritt poistettavat tiedostot. Useamman\n                                tiedoston voi mritt yleismerkeill.\n  /P    Varmistaa kehotteella ennen jokaisen tiedoston poistoa.\n  /V    Nytt kaikki poistetut tiedostot.\n.\n\n:TEXT_CMDHELP_DIR#4\nNytt hakemistossa olevat tiedostot ja alihakemistot.\n\nDIR [asema:][polku][tiedostonimi] [/P] [/W] [/A[[:]mritteet]]\n  [/O[[:]jrjestys]] [/S] [/B] [/L]\n\n  [asema:][polku][tiedostonimi]\n            Mritt aseman, hakemiston ja/tai lueteltavat tiedostot.\n            (Voi olla laajennettu mrittely tai monta mrittely.)\n /P         Tauko jokaisen ruudullisen jlkeen.\n /W         Kytt leve luettelomuotoa.\n /A         Nytt tiedostot, joilla on tietyt mritteet. (Oletus /ADHSRA)\n mritteet  D  Hakemistot                 R  Vain luku -tiedostot\n             H  Piilotiedostot             A  Arkistoitavat tiedostot\n             S  Jrjestelmtiedostot       -  Knteinen (l nyt, etuliite)\n /O         Luettelee tiedostot annetussa jrjestyksess.\n jrjestys   N  Nimen mukaan (aakkosjrj.) S  Koon mukaan (pienin ensin)\n             E  Tiedostoptteen mukaan    D  Vanhimmasta uusimpaan\n             G  Hakemistot ensin           -  Knteinen jrjestys (etuliite)\n             U  l lajittele\t\t   Oletuksena /ONG\n /S         Luettelee mys kaikissa alihakemistoissa olevat tiedostot.\n /B         Kytt pelkistetty muotoa (ei otsaketietoa tai yhteenvetoa).\n /L         Kytt pieni kirjaimia.\n /Y or /4   Nytt vuosiluvun nelinumeroisena.\n\nDIRCMD-ympristmuuttuja saattaa mritell valitsimia. Ne voidaan\npoistaa kytst sijoittamalla - (vliviiva) ennen valitsinta, kuten /-W.\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nUlkoinen DOSKEY-tykalu on otettu osaksi FreeCOM:ia.\nYl- ja alanuolinppimet selaavat historiaa ja HISTORY nytt sen.\nVasemmat ja oikeat nuolinppimet sek HOME ja END siirtyvt\nkomentorivin sisll ja INSERT vaihtaa pllekirjoitus- ja lisystilan\nvlill. Sarkainnppin tydent nykyisen sanan tiedostonimen;\nkahdesti painettuna se nytt luettelon lydetyist tiedostonimist.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nMuokkaa komentorivej, muistaa niit ja luo makroja\n\nDOSKEY [/valitsin ...] [makro=[teksti]]\n\n  /BUFSIZE:koko   Asettaa makro- ja komentopuskurin koon         (oletus:512)\n  /ECHO:on|off    Mritt makrolaajennusten kaiutustilan       (oletus:on)\n  /FILE:tiedosto  Mritt makroja sisltvn tiedoston\n  /HISTORY        Nytt kaikki muistissa olevat komennot\n  /INSERT         Uusien merkkien lisys riville kirjoittaessa\n  /KEYSIZE:koko   Asettaa nppimistn nppilypuskurin koon     (oletus:15)\n  /LINE:koko      Asettaa rivin muokkauspuskurin enimmiskoon    (oletus:128)\n  /MACROS         Nytt kaikki DOSKey-makrot\n  /OVERSTRIKE     Kirjoitus rivill olevien merkkien plle      (oletus)\n  /REINSTALL      Asentaa DOSKey:n uudelleen muistiin\n  makro           Mritt luotavan makron nimen\n  teksti          Mritt makroon kuuluvat komennot\n\n YLS,ALAS-nuolinppimet kyvt historiaa lpi\n       Esc tyhjent komentorivin\n        F7 nytt komentohistorian\n    Alt+F7 tyhjent komentohistorian\n[teksti]F8 hakee tekstill alkavaa komentoa\n        F9 hakee komentoa numerolla\n   Alt+F10 poistaa kaikki makrot\n\nSeuraavia erityiskoodeja voi kytt DOSKeyn makrojen mritelmiss:\n  $T     Komentoerotin: makroissa voi olla useampi komento\n  $1-$9  Parametrit: toimivat samoin kuin %1-%9 komentojonoissa\n  $*     Korvautuu tekstill, joka on makron nimen jlkeen komennossa\n.\n\n:TEXT_CMDHELP_ECHO\nNytt viestej tai kytkee komentokaiutuksen plle tai pois.\n\n  ECHO [ON | OFF]\n  ECHO [viesti]\n\nECHO ilman parametreja nytt nykyisen komentokaiutustilan.\n.\n\n:TEXT_CMDHELP_EXIT\nLopettaa FreeDOS-komentokehotteen, ellei /P-valitsinta ole kytetty.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\nSuorittaa komennon jokaiselle tiedostolle tiedostoryhmss.\n\nFOR %%muuttuja IN (ryhm) DO komento [komento-parametrit]\n\n  %%muuttuja  Mritt tiedostomuuttujan nimen.\n  (ryhm)    Mritt ryhmn tiedostoja, yleismerkit sallittu.\n  komento    Mritt suoritettavan komennon.\n  komento-parametrit\n             Mritt komennon parametrit.\n\nKomentojonoissa FOR-komennon muuttuja on mriteltv kahdella\nprosenttimerkill, esimerkiksi %%%%muuttuja (eik %%muuttuja).\n\nEsimerkiksi:\n  FOR %%f IN (---start--- a*.* ---end---) DO ECHO - %%f -\n.\n\n:TEXT_CMDHELP_GOTO\nSiirt komentojonon suorituksen annetun nimin kohdalle.\n\nGOTO nimi\n\n  nimi   Mritt komentojonossa olevan nimin, josta suoritus jatkuu.\n\nNimi luodaan kirjoittamalla se omalle rivilleen kaksoispisteen pern.\n.\n\n:TEXT_CMDHELP_HISTORY#1\nNytt komentohistorian tai mritt sen koon.\n\nHISTORY [koko]\n\nIlman parametreja komento nytt komentorivihistorian sislln.\nJos koko annetaan, komentorivihistorian puskurin kokoa muutetaan.\n.\n\n:TEXT_CMDHELP_IF\nSuorittaa komennon ehdollisesti komentojonoissa.\n\nIF [NOT] ERRORLEVEL luku komento\nIF [NOT] mjono1==mjono2 komento\nIF [NOT] EXIST tnimi komento\n\n  NOT               Mritt, ett komento tulee suorittaa vain,\n                    jos ehto ei ole tosi (normaalisti toisinpin).\n  ERRORLEVEL luku   Mritt ehdon olevan tosi, jos edellisen ohjelman\n                    palauttama lopetuskoodi on suurempi tai yht kuin\n                    annettu luku.\n  komento           Mritt komennon, joka suoritetaan ehdollisesti.\n  mjono1==mjono2    Mritt ehdon olevan tosi, jos annetut kaksi\n                    merkkijonoa ovat samat.\n  EXIST tnimi       Mritt ehdon olevan tosi, jos tiedosto on\n                    olemassa annetulla tiedostonimell.\n.\n\n:TEXT_CMDHELP_LFNFOR\nOttaa kyttn tai poistaa kytst pitkt tiedostonimet FOR-komennolle\nja tiedostonimien tydennykselle.\n\nLFNFOR [ON | OFF]\nLFNFOR COMPLETE [ON | OFF]\n\nLFNFOR tai LFNFOR COMPLETE ilman parametreja nytt nykyisen LFNFOR-tilan.\n.\n\n:TEXT_CMDHELP_LH\nLataa ohjelman ylmuistiin.\n\nLOADHIGH [asema:][polku]tiedostonimi [parametrit]\nLOADHIGH [/L:alue1[,vkoko1][;alue2[,vkoko2]]...] [/S]]\n         [asema:][polku]tiedostonimi [parametrit]\n\n/L:alue1[,vkoko1][;alue2[,vkoko2]]...\n            Mritt muistialueet, joihin ohjelma ladataan.\n            alue1 mritt muistialueen numeron ja vkoko1 mritt\n            alueelle mahdollisen vhimmiskoon. alue2 ja vkoko2\n            mritt toisen alueen numeron ja vhimmiskoon.\n            Alueiden lukumr ei ole rajoitettu.\n\n/S          Pienent ylmuistilohkon (UMB) vhimmiskokoonsa\n            ohjelman lataamisen ajaksi.\n\n[asema:][polku]tiedostonimi\n            Mritt ohjelman nimen ja sijainnin.\n.\n\n:TEXT_CMDHELP_LOADFIX\nLataa ohjelman muistin ensimmisen 64 kilotavun ylpuolelle ja ajaa sen.\n\nLOADFIX [asema:][polku]tiedostonimi\n\nJos ohjelma tulostaa virheen pakatun tiedoston vioittumisesta alamuistista\najettaessa, voit kokeilla ajaa sen LOADFIX-komennolla.\n.\n\n:TEXT_CMDHELP_MD\nLuo hakemiston.\n\nMKDIR [asema:]polku\nMD [asema:]polku\n.\n\n:TEXT_CMDHELP_PATH\nNytt tai asettaa ohjelmatiedostojen hakupolun.\n\nPATH [[asema:]polku[;...]]\nPATH ;\n\nPATH ; tyhjent hakupolkuluettelon, jolloin komentokehote hakee\nohjelmia vain nykyisest hakemistosta.\nPATH ilman parametreja nytt nykyiset hakupolut.\n.\n\n:TEXT_CMDHELP_PAUSE\nKeskeytt komentojonon suorituksen ja pyyt kyttjlt\nnppinpainallusta viestill, joka on oletuksena\n\"Paina mit tahansa nppint jatkaaksesi...\".\n\nPAUSE [viesti]\n.\n\n:TEXT_CMDHELP_PROMPT\nVaihtaa komentokehotteen esitysmuotoa.\n\nPROMPT [teksti]\n\n  teksti  Mritt uuden komentokehotteen esitysmuodon.\n\nKehotteen muoto voi koostua normaalimerkkien lisksi seuraavista\nerityiskoodeista.\n\n  $Q   = (yht kuin -merkki)\n  $$   $ (dollarin merkki)\n  $T   Nykyinen aika\n  $D   Nykyinen pivmr\n  $P   Nykyinen asema ja polku\n  $V   FreeDOS-komentokehotteen versio\n  $N   Nykyinen asema\n  $G   > (suurempi kuin -merkki)\n  $L   < (pienempi kuin -merkki)\n  $B   | (putkimerkki tai pystyviiva)\n  $H   Askelpalautin (poistaa edellisen merkin)\n  $E   Escape-koodi (ASCII-koodi 27)\n  $_   Rivinvaihto\n\nPROMPT ilman parametreja palauttaa esitysmuodon oletusasetukseen.\n.\n\n:TEXT_CMDHELP_PUSHD\nLis nykyisen hakemiston hakemistopolun ylimmksi ja mahdollisesti\nvaihtaa toiseen hakemistoon.\n\nPUSHD [[asema:]polku]\n  [asema:]polku on polku, johon halutaan vaihtaa.\n.\n\n:TEXT_CMDHELP_POPD\nPoimii ylimmn hakemiston hakemistopinosta ja vaihtaa siihen.\n\nPOPD [*]\n  '*' tyhjent hakemistopinon.\n.\n\n:TEXT_CMDHELP_DIRS\nNytt hakemistopinon sislln.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\nPoistaa tyhjn hakemiston.\n\nRMDIR [asema:]polku\nRD [asema:]polku\n.\n\n:TEXT_CMDHELP_REM\nEsitt kommenttia komentojonossa tai CONFIG.SYS-tiedostossa.\n\nREM [kommentti]\n.\n\n:TEXT_CMDHELP_REN\nNime tiedoston/hakemiston tai tiedostot/hakemistot uudelleen.\n\nRENAME [asema:][polku][hnimi1 | tnimi1] [hnimi2 | tnimi2]\nREN [asema:][polku][hnimi1 | tnimi1] [hnimi2 | tnimi2]\n\nTlle komennolle ei voi mritt kohdeasemaa tai -polkua tiedostolle\ntai hakemistolle. Siirtmiseen tulee kytt MOVE-komentoa.\n.\n\n:TEXT_CMDHELP_SET#1\nNytt, asettaa tai poistaa ympristmuuttujia.\n\nSET [/C] [/P] [/E] [/U] [muuttuja[=[arvo]]]\n\n  muuttuja  Mritt ympristmuuttujan nimen.\n  arvo      Mritt merkkijonon, joka asetetaan muuttujan arvoksi.\n\n* Jos arvoa ei anneta (VAR=), ympristmuuttuja poistetaan\n\nKirjoita SET ilman parametreja nyttksesi nykyiset ympristmuuttujat.\nKirjoita SET VAR nyttksesi muuttujan VAR arvon.\n\n/C pakottaa pitmn muuttujan kirjainkoot samana; oletuksena muuttujan\nnimi muutetaan isoiksi kirjaimiksi, jos se ei ole jo mritelty\nympristss, ja muuten pidetn samana.\n\n/P kysyy kyttjlt kehotteella arvoa ja asettaa sen muuttujalle.\n\n/E suorittaa arvon mukaisen komennon ja asettaa muuttujan arvoksi\nkyseisen komennon ensimmisen tulosterivin.\n\n/U muuttaa arvon kirjaimet isoiksi kirjaimiksi.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nVaihtaa numeroitujen parametrien paikkaa komentojonossa.\n\nSHIFT [DOWN]\n\nDOWN siirt parametri-ikkunaa alkua kohti (%%0); muuten\nsit siirretn loppua kohti.\n.\n\n:TEXT_CMDHELP_TIME#1\nNytt tai asettaa jrjestelmn ajan.\n\nTIME [/T] [aika]\n\nTIME ilman parametreja tuo nyttn nykyisen kellonajan ja\nkehotteen uudesta ajasta. Paina ENTER pitksesi saman ajan.\n\n/T est komentoa esittmst kehotteita.\n.\n\n:TEXT_CMDHELP_TRUENAME\nNytt annetun polun koko polkunimen.\n\nTRUENAME [asema:][polku][tiedostonimi]\n.\n\n:TEXT_CMDHELP_TYPE\nNytt tekstitiedoston sislln.\n\nTYPE [asema:][polku]tiedostonimi\n.\n\n:TEXT_CMDHELP_VER\nNytt FreeDOS-komentokehotteen version ja muut tiedot.\n\nVER [/R] [/W] [/D] [/C]\n\n /R         Ytimen versio ja muut tiedot.\n /W         FreeDOS-komentokehotteen takuutiedot.\n /D         FreeDOS-komentokehotteen jakelutiedot.\n /C         FreeDOS-komentokehotteen tekijt.\n.\n\n:TEXT_CMDHELP_VERIFY\nKertoo FreeDOS:n tiedostojrjestelmlle, tuleeko sen varmistaa tiedostoihin\nkirjoitusten tapahtuneen oikein.\n\nVERIFY [ON | OFF]\n\nVERIFY ilman parametria nytt nykyisen VERIFY-tilan.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nJos FreeDOS:iin on knnetty virheenkorjaustoiminnot, tm komento\nkytkee virheenkorjaustulostuksen plle tai pois tai kertoo sen tilan.\n\nFDDEBUG [ON | OFF | tiedosto]\n\nFDDEBUG ilman parametreja nytt nykyisen tilan.\n\nJos tiedosto mritelln, virheenkorjaustuloste ohjataan siihen;\ntuloste liitetn tiedoston loppuun, jos se on jo olemassa.\nErikoistiedostonimet \"stdout\" ja \"stderr\" ohjaavat tulosteen joko\nstandardituloste- tai standardivirhevirtaan.\n.\n\n:TEXT_CMDHELP_VOL\nNytt levyn taltion nimen ja sarjanumeron, jos ne on mritelty.\n\nVOL [asema:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nNytt kehotteessa saatavilla olevat komennot ja toiminnallisuudet.\n\n?\n?komento [argumentti]\n\nEnsimminen versio nytt kaikki saatavilla olevat komennot ja\ntoiminnallisuudet. Toinen versio kysyy kehotteella, suoritetaanko\nkyseist komentoa (niin kuin jljitystilassa).\n.\n\n:TEXT_CMDHELP_WHICH\nHakee ja nytt komennon toteuttavan ohjelman polun.\n\nWHICH komento...\n.\n\n:TEXT_CMDHELP_MEMORY#1\nNytt FreeCOM:n sisisesti kyttmn muistin.\n\nMEMORY\n\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\nCOPY-komennon kohde ei voi sislt plus-merkkej ('+').\n.\n\n:TEXT_DELETE_FILE#1%\nPoistetaan tiedostoa \"%s\".\n.\n\n:TEXT_ERROR_WRITE_FILE_DISC_FULL#0%\nEi voi kirjoittaa tiedostoon '%s';\nlevy ehk tynn? (%lu tavua vaaditaan)\n.\n\n# Displayed for BIGcopy(), when copying takes quite a long time.\n# **_NO_END if the input file size is unknown.\n# Both must end in \\r rather than \\n!!\n:TEXT_COPY_COPIED_NO_END#0%\nkopioitu %luKt/???Kt\\r\\\n.\n:TEXT_COPY_COPIED#0%\nkopioitu %luKt/%luKt\\r\\\n.\n\n:TEXT_ERROR_FCOM_IS_DEVICE#0%\nFreeCOM ei voi olla laite: \"%s\"\n.\n:TEXT_ERROR_FCOM_INVALID#0%\nTiedosto ei ole kelvollinen FreeCOM tai on vr versio:\n%s\n.\n\n:TEXT_ERROR_LOADING_STRINGS\nMerkkijonoresurssia ei voitu ladata muistiin. %COMSPEC%-muuttujan\nosoittama sijainti nyttisi olevan virheellinen. Mrit toinen\nsijainti, josta FreeCOM lataa merkkijonot, kuten:\nC:\\\\COMMAND.COM\ntai paina Enter, jolloin merkkijonojen lataus peruutetaan.\n.\n\n:TEXT_TERMINATING\nLopetetaan ohjelmaa nyt.\n.\n\n:TEXT_HIDDEN_CRITER#0%\n%u kriittisen virheen pyynt hiljennetty.\n.\n\n# The exit reasons MUST be kept in this order!\n:TEXT_DISP_EXITCODE#0%\nLopetuskoodi (ERRORLEVEL): %u, syy: %u (%s)\n.\n:TEXT_EXIT_REASON_NEG_1\nDOS-rajapintavirhe\\\n.\n:TEXT_EXIT_REASON_0\npttyi normaalisti\\\n.\n:TEXT_EXIT_REASON_1\npttyi ^Break:iin\\\n.\n:TEXT_EXIT_REASON_2\npttyi virheeseen\\\n.\n:TEXT_EXIT_REASON_3\nsiirtyi muistiin\\\n.\n:TEXT_ERROR_EXE_CORRUPT\nEXE-tiedosto vioittunut\\\n.\n"
  },
  {
    "path": "strings/fixstrs.c",
    "content": "/*\r\nThis program will read in the language file and create three files:\r\n\r\nstrings.dat - contains all the strings. will be appended on the end\r\n              of the exe file.\r\n\r\nstrings.h - include file that contains all the defines.\r\n\r\nstrings.log - contains all warnings of the local LNG file, the\r\n              which resources (strings) are missing from it and\r\n              which ones are not specified in the DEFAULT.lng, thus,\r\n              are most likely unknown to FreeCOM\r\n              This file is present only, if there are such warnings,\r\n              but no message is printed onto screen!\r\n\r\nThen, if the \"/lib\" option is present, it creates the\r\nSTRINGS library source files into the subdirectory STRINGS.\r\n\r\nThere are two input files:\r\nDEFAULT.lng and the language file passed as argument to FIXSTRS.\r\nDEFAULT.lng has two meanings making it a fundamental file, which\r\nensures the integrity of the multi-language support of FreeCOM:\r\n\r\n1) The order of strings noted in DEFAULT.lng will be kept the same in\r\n\tall *.LNG files.\r\n2) If an individual *.LNG file does not define a certain string, its\r\n\tcontents is taken from the DEFAULT file.\r\n\r\nBecause each string is assigned a certain number and only this number\r\nis known to FreeCOM internally, especially meaning 1) will ensure that\r\neach STRINGS.DAT assigns the same semantic to those numbers.\r\n\r\nThe STRINGS.DAT file generated in the following steps:\r\n1) DEFAULT.lng is read; all strings are copied into memory,\r\n\tthe string_index_t array is generated with these strings.\r\n\tAt the end, one could generate STRINGS.DAT with all the default\r\n\tstrings, which are usually in English.\r\n2) the specified *.LNG file is read; if a string is defined in this file,\r\n\ttoo, its contents overwrites the default string already present.\r\n\tNew strings are assigned a new number above the already allocated\r\n\tstring numbers.\r\n3) Now all strings are known, there sizes and offsets within the file,\r\n\tthe STRINGS.DAT and STRINGS.H files are generated.\r\n\r\n2000/07/09 ska\r\nchg: to read STRINGS.H to keep the same order of strings\r\nchg: to let STRINGS.TXT read only once (temporary binary file)\r\nchg: The format of STRINGS.DAT has been changed in order to support\r\n\tdifferent languages _without_ recompiling.\r\n\r\n2000/07/11 ska\r\nchg: To use STRINGS.H to keep up the order becomes problematic, as this\r\n\tfile is regenerated each time FIXSTRS is run. On failure, this\r\n\tfile is destroyed. Therefore STRINGS.TXT will be renamed into\r\n\tDEFAULT.lng and is used to a) specify the order and, if missing,\r\n\tthe default string text.\r\n\r\n2001/03/15 ska\r\nadd: version number of strings and logfile entries\r\n*/\r\n\r\n\r\n#include <ctype.h>\r\n#if defined(__TURBOC__)\r\n#include <dir.h>\r\n#elif defined(__GNUC__) && !defined(__MINGW32__)\r\n#include <unistd.h>\r\n#include <sys/stat.h>\r\n#define stricmp strcasecmp\r\n#define mkdir(x) mkdir(x, 0777)\r\nstatic char *strupr(char *s)\r\n{\r\n  char *p;\r\n\r\n  for (p = s; *p; p++)\r\n    *p = toupper(*p);\r\n  return s;\r\n}\r\n#elif defined(__WATCOMC__) && defined(__UNIX__)\r\n#include <unistd.h>\r\n#include <sys/stat.h>\r\n#define mkdir(x) mkdir(x, 0777)\r\n#else\r\n#include <direct.h>\r\n#include <io.h>\r\n#endif\r\n#include <stdio.h>\r\n#include <string.h>\r\n#include <stdlib.h>\r\n\r\n#undef DEBUG\r\n#include \"../config.h\"\r\n#include \"../include/strings.typ\"\r\n#include \"../include/resource.h\"\r\n#include \"../include/keys.h\"\r\n\r\n#define logfile \"strings.log\"\r\n#define fDAT \"strings.dat\"\r\n#define fTXT \"DEFAULT.lng\"\r\n#define fH \"strings.h\"\r\n#define fEXT \".lng\"\r\n#define fDMAKEFILE \"makefile\"\r\n#define fTCMAKEFILE \"strings.rsp\"\r\n#define fTCMAKFILE \"strings.mak\"\r\n\r\ntypedef enum STATE {\r\n\t LOOKING_FOR_START\r\n\t,GETTING_PROMPT_LINE_1\r\n\t,GETTING_PROMPT_LINE_2\r\n\t,GETTING_STRING\r\n} read_state;\r\n\r\n#define MAXSTRINGS       256\r\n\r\n#define VERSION_MISMATCH 128\r\n#define VALIDATION_MISMATCH 64\r\n#define PERFORM_VALIDATION 32\r\n\r\nconst char id[]=\"FreeDOS STRINGS v\";\r\n\t/* all prompts within *.LNG files start with */\r\nconst char promptID[] = \"PROMPT_\";\r\n#define promptIDlen (sizeof(promptID) - 1)\r\n\r\n#define STRINGLIB_DIR \"strings\"\r\n#define stringdir cfile\r\n#define cfilename (&cfile[sizeof(STRINGLIB_DIR)])\r\n#define cfmt \"str%04x.c\"\r\n#define objfmt \"str%04x.obj\"\r\nchar cfile[] = STRINGLIB_DIR \"\\0str45678.obj\";\r\n\r\n/*\r\n\tImplementation details about to cache the strings within memory:\r\n\r\n\t+ Because the strings are currently entitled to fit into 64KB,\r\n\t\tthey should fit into memory during runtime of this program.\r\n\t\tTherefore FIXSTRS will be compiled in Compact memory model.\r\n\r\n*/\r\n\r\ntypedef struct {\r\n\tchar *text;\r\n\tint length;\r\n} dynstring;\r\ntypedef struct {\r\n\tconst int keycode;\r\n\tconst char * const keyname;\r\n} symKey;\r\n\r\nFILE *lgf = 0;\r\n\r\nint in_file = 0;\r\nstring_index_t string[MAXSTRINGS];\r\nstruct {\r\n\tint flags;\t\t\t\t/* bitfield: #0 -> DEFAULT, #1 -> special LNG file\r\n\t\t\t\t\t\t\t\tmeaning: present in particular file\r\n\t\t\t\t\t\t\t\t#5: perform printf() validation\r\n\t\t\t\t\t\t\t\t#6: printf() validation failed\r\n\t\t\t\t\t\t\t\t#7: Version mismatch */\r\n\tchar *name;\t\t\t\t/* name of string */\r\n\tchar *text;\t\t\t\t/* text of this string */\r\n\tint version;\r\n\tchar *vstring;\t\t\t/* validation string */\r\n} strg[MAXSTRINGS];\r\nstring_count_t cnt = 0;\t\t/* current string number */\r\nstring_count_t maxCnt = 0;\t/* number of strings within array */\r\n\r\n#if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)\r\n#error \"This program must be compiled with far data pointers\"\r\n#endif\r\n\r\nchar temp[1024];\r\n\r\nstatic const char besFromChar[] =\r\n \"abcdefghijklmnopqrstuvwxyz,.[{}]\\\\?0\";\r\nstatic const char besToChar[] =\r\n \"\\a\\bcd\\e\\fghijklm\\nopq\\rs\\t\\x0\\vw\\x0yz,.[{}]\\\\?\";\r\n\r\nsymKey symkeys[] = {\t\t/* symbolic keynames, uppercased! */\r\n\t { KEY_CTL_C,\t\"BREAK\" }\t\t/* Pseudo-^Break */\r\n\t,{ KEY_CTL_C,\t\"CBREAK\" }\r\n\t,{ KEY_NL,\t\"LF\" }\r\n\t,{ KEY_NL,\t\"NL\" }\r\n\t,{ KEY_NL,\t\"LINEFEED\" }\r\n\t,{ KEY_NL,\t\"NEWLINE\" }\r\n\t,{ KEY_CR,\t\"CR\" }\r\n\t,{ KEY_CR,\t\"ENTER\" }\r\n\t,{ KEY_ESC,\t\"ESC\" }\r\n\t,{ KEY_ESC,\t\"ESCAPE\" }\r\n\t,{ ASCIICODE('\\f'),\t\"FF\" }\r\n\t,{ ASCIICODE('\\f'),\t\"FORMFEED\" }\r\n\t,{ ASCIICODE('\\a'),\t\"ALARM\" }\r\n\t,{ ASCIICODE('\\a'),\t\"BELL\" }\r\n\t,{ ASCIICODE('\\a'),\t\"BEEP\" }\r\n\t,{ KEY_BS,\t\"BS\" }\r\n\t,{ KEY_BS,\t\"BACKSPACE\" }\r\n\t,{ KEY_TAB,\t\"HT\" }\r\n\t,{ KEY_TAB,\t\"TAB\" }\r\n\t,{ ASCIICODE('\\v'),\t\"VT\" }\r\n\t,{ ASCIICODE('\\0'),\t\"NUL\" }\r\n\t,{ ASCIICODE('\\x1'),\t\"SOH\" }\r\n\t,{ ASCIICODE('\\x2'),\t\"STX\" }\r\n\t,{ ASCIICODE('\\x3'),\t\"ETX\" }\r\n\t,{ ASCIICODE('\\x4'),\t\"EOT\" }\r\n\t,{ ASCIICODE('\\x5'),\t\"ENQ\" }\r\n\t,{ ASCIICODE('\\x6'),\t\"ACK\" }\r\n\t,{ ASCIICODE('\\x7'),\t\"BEL\" }\r\n\t\t/* 8 -> BS, 9 -> HT, A -> LF, B ->VT, C -> FF, D -> CR */\r\n\t,{ ASCIICODE('\\xe'),\t\"SO\" }\r\n\t,{ ASCIICODE('\\xf'),\t\"SI\" }\r\n\t,{ ASCIICODE('\\x10'),\t\"DLE\" }\r\n\t,{ ASCIICODE('\\x11'),\t\"DC1\" }\r\n\t,{ ASCIICODE('\\x12'),\t\"DC2\" }\r\n\t,{ ASCIICODE('\\x13'),\t\"DC3\" }\r\n\t,{ ASCIICODE('\\x14'),\t\"DC4\" }\r\n\t,{ ASCIICODE('\\x15'),\t\"NAK\" }\r\n\t,{ ASCIICODE('\\x16'),\t\"SYN\" }\r\n\t,{ ASCIICODE('\\x17'),\t\"ETB\" }\r\n\t,{ ASCIICODE('\\x18'),\t\"CAN\" }\r\n\t,{ ASCIICODE('\\x19'),\t\"EM\" }\r\n\t,{ ASCIICODE('\\x1a'),\t\"SUB\" }\r\n\t\t/* 1b -> ESC */\r\n\t,{ ASCIICODE('\\x1c'),\t\"FS\" }\r\n\t,{ ASCIICODE('\\x1d'),\t\"GS\" }\r\n\t,{ ASCIICODE('\\x1e'),\t\"RS\" }\r\n\t,{ ASCIICODE('\\x1f'),\t\"US\" }\r\n\r\n\t,{ KEY_F1, \"F1\" }\r\n\t,{ KEY_F2, \"F2\" }\r\n\t,{ KEY_F3, \"F3\" }\r\n\t,{ KEY_F4, \"F4\" }\r\n\t,{ KEY_F5, \"F5\" }\r\n\t,{ KEY_F6, \"F6\" }\r\n\t,{ KEY_F7, \"F7\" }\r\n\t,{ KEY_F8, \"F8\" }\r\n\t,{ KEY_F9, \"F9\" }\r\n\t,{ KEY_F10, \"F10\" }\r\n\t,{ KEY_F11, \"F11\" }\r\n\t,{ KEY_F12, \"F12\" }\r\n\r\n\t,{ KEY_LEFT, \"LEFT\" }\r\n\t,{ KEY_RIGHT, \"RIGHT\" }\r\n\t,{ KEY_UP, \"UP\" }\r\n\t,{ KEY_DOWN, \"DOWN\" }\r\n\t,{ KEY_INS, \"INS\" }\r\n\t,{ KEY_DEL, \"DEL\" }\r\n\t,{ KEY_HOME, \"HOME\" }\r\n\t,{ KEY_END, \"END\" }\r\n\t,{ KEY_PUP, \"PUP\" }\r\n\t,{ KEY_PDOWN, \"PDOWN\" }\r\n\r\n\t,{ 0, \"\"}\r\n};\r\n\r\n\r\n\t/* keep it a single-file project */\r\n#include \"../lib/res_w.c\"\r\n\r\n/*\r\n * Append the passed in string onto strg[cnt].text\r\n */\r\n#define app(s)\tappStr(text, (s))\r\n#define appStr(vs,s) appMem((vs), (s), strlen((s)))\r\n#define appMem(vs,s,l) appMem_(&(vs), (s), (l))\r\nint appMem_(dynstring *vs, char *s, int length)\r\n{\r\n\tif((vs->text = realloc(vs->text, 1 + vs->length + length)) != 0) {\r\n\t\tchar *p;\r\n\r\n\t\tp = vs->text + vs->length;\r\n\t\tif(length) memcpy(p, s, length);\r\n\t\tp[length] = 0;\r\n\t\tvs->length += length;\r\n\t\treturn 1;\r\n\t}\r\n\r\n\tfputs(\"Out of memory\\n\", stderr);\r\n\treturn 0;\r\n}\r\n\r\nunsigned fromxdigit(int ch)\r\n{\tif(isdigit(ch))\r\n\t\treturn ch - '0';\r\n\treturn toupper(ch) - 'A';\r\n}\r\n\r\n#ifdef __TURBOC__\r\n#define join(s1,s2)\tstrcpy(stpcpy(temp, s1), s2);\r\n#else\r\n#define join(s1,s2)\tstrcat(strcpy(temp, s1), s2);\r\n#endif\r\nvoid pxerror(const char * const msg1, const char * const msg2)\r\n{\tjoin(msg1, msg2);\r\n\tperror(temp);\r\n}\r\n\r\nvoid dumpCh(FILE * const f, const unsigned char ch)\r\n{\tstatic const char from[] = \"'\\\\\\n\\t\\a\\b\\f\";\r\n\tstatic const char to[]   = \"'\\\\ntabf0\";\r\n\tconst char *p;\r\n\r\n\tif((p = strchr(from, ch)) != 0)\r\n\t\tfprintf(f, \"'\\\\%c'\", to[(int)(p - from)]);\r\n\telse if(isprint(ch))\r\n\t\tfprintf(f, \" '%c'\", ch);\r\n\telse fprintf(f, \"0x%02x\", ch);\r\n}\r\n\r\nvoid dumpString(const int stringId)\r\n{\tFILE *f;\r\n\tint len, cnt;\r\n\tunsigned char *p;\r\n\r\n\tsprintf(cfilename, cfmt, stringId);\r\n\tif((f = fopen(cfile, \"wt\")) == NULL) {\r\n\t\tpxerror(\"creating \", cfile);\r\n\t\texit(102);\r\n\t}\r\n\tfprintf(f, \"const char %s[] = {\\n\\t\", strg[stringId].name);\r\n\tp = (unsigned char*)strg[stringId].text;\r\n\tif(string[stringId].size > 1) {\r\n\t\tfor(len = string[stringId].size, cnt = 9; --len;) {\r\n\t\t\tchar ch;\r\n\r\n\t\t\tdumpCh(f, ch = *p++);\r\n\t\t\tputc(',', f);\r\n\t\t\tputc(' ', f);\r\n\t\t\tif(--cnt == 0 || ch == '\\n') {\r\n\t\t\t\tputc('\\n', f);\r\n\t\t\t\tputc('\\t', f);\r\n\t\t\t\tcnt = 9;\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\tif(string[stringId].size)\r\n\t\tdumpCh(f, *p);\r\n\tfputs(\"\\n};\\n\", f);\r\n\tfclose(f);\r\n}\r\n\r\n\r\n/* map a backslash sequence */\r\nint mapBSEscape(char ** const s)\r\n{\tchar *p;\r\n    const char *q;\r\n\tint ch;\r\n\r\n\tp = *s;\r\n\tif((ch = *p++) == 0)\t/* Don't advance pointer */\r\n\t\treturn 0;\r\n\r\n\tif(ch == 'x') {\t/* Hexadecimal */\r\n\t\tif(isxdigit(*p)) {\r\n\t\t\tch = fromxdigit(*p++);\r\n\t\t\tif(isxdigit(*p))\r\n\t\t\t\tch = (ch << 4) | fromxdigit(*p++);\r\n\t\t} else\r\n\t\t\tch = 0;\r\n\t} else if((q = strchr(besFromChar, ch)) != 0) {\r\n\t\tch = besToChar[(unsigned)(q - besFromChar)];\r\n\t} /* else  ch remains the character behind the backslash */\r\n\r\n\t*s = p;\t\t\t/* Advance pointer */\r\n\treturn ch;\r\n}\r\n\r\n/* map a symbolic key */\r\nint mapSymKey(char * const p)\r\n{\tsymKey *q;\r\n\r\n\tstrupr(p);\t\t/* Uppercase here to speed up process later */\r\n\tq = symkeys;\r\n\tdo if(strcmp(q->keyname, p) == 0)\t/* found */\r\n\t\tbreak;\r\n\twhile((q++)->keycode);\r\n\r\n\treturn q->keycode;\r\n}\r\n\r\nint loadFile(const char * const fnam)\r\n{\tunsigned long linenr;\r\n\tchar *p;\r\n\tread_state state = LOOKING_FOR_START;\r\n\tFILE *fin;\r\n\tdynstring text;\t\t\t/* Current text */\r\n\tdynstring vstring;\t\t/* Validation string */\r\n\tint version;\r\n\r\n\ttext.text = vstring.text = 0;\r\n\tversion = 0;\r\n\r\n\tprintf(\"FIXSTRS: loading file %s\\n\", fnam);\r\n\r\n\tjoin(fnam, fEXT);\r\n\tif((fin = fopen(fnam, \"rt\")) == NULL\r\n\t && (fin = fopen(temp, \"rt\")) == NULL) {\r\n\t\tpxerror(\"opening \", fnam);\r\n\t\treturn 33;\r\n\t}\r\n\r\n\tlinenr = 0;\r\n\twhile (fgets(temp, sizeof(temp), fin)) {\r\n\t\t++linenr;\r\n\t\tp = strchr(temp, '\\0');\r\n\t\tif(p[-1] != '\\n') {\r\n\t\t\tfprintf(stderr, \"Line %lu too long\\n\", linenr);\r\n\t\t\treturn 41;\r\n\t\t}\r\n\t\t\t/* Cut trailing control characters */\r\n\t\twhile (--p >= temp && iscntrl(*p));\r\n\t\tp[1] = '\\0';\r\n\r\n\t\tswitch (state) {\r\n\t\tcase LOOKING_FOR_START:\r\n\t\t\tswitch(*temp) {\r\n\t\t\tcase ':': {\r\n\t\t\t\tchar *vers;\r\n\r\n\t\t\t\tif((vers = strchr(temp + 1, '#')) != 0) {\r\n\t\t\t\t\t*vers = '\\0';\r\n\t\t\t\t}\r\n\t\t\t\t/* Locate the string name */\r\n\t\t\t\tfor(cnt = 0; cnt < maxCnt; ++cnt)\r\n\t\t\t\t\tif(strcmp(strg[cnt].name, temp + 1) == 0)\r\n\t\t\t\t\t\tgoto strnameFound;\r\n\t\t\t\t/* string name was not found --> create a new one */\r\n\t\t\t\t++maxCnt;\r\n\t\t\tstrnameFound:\r\n\t\t\t\tif(!strg[cnt].name) {\r\n\t\t\t\t\tif((strg[cnt].name = strdup(temp + 1)) == 0) {\r\n\t\t\t\t\t\tfputs(\"Out of memory\\n\", stderr);\r\n\t\t\t\t\t\treturn 80;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvstring.length = text.length = 0;\r\n\t\t\t\tversion = (vers && *++vers)? atoi(vers): 0;\r\n\t\t\t\tif(vers && strchr(vers, '%'))\r\n\t\t\t\t\tstrg[cnt].flags |= PERFORM_VALIDATION;\r\n\t\t\t\tif(memcmp(strg[cnt].name, promptID, promptIDlen) == 0)\r\n\t\t\t\t\tstate = GETTING_PROMPT_LINE_1;\r\n\t\t\t\telse\r\n\t\t\t\t\tstate = GETTING_STRING;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\twhile(p >= temp && isspace(*p)) --p;\r\n\t\t\t\tif(p >= temp) {\r\n\t\t\t\t\tfprintf(stderr, \"Syntax error in line #%lu\\n\", linenr);\r\n\t\t\t\t\treturn 44;\r\n\t\t\t\t}\r\n\t\t\t\t/** fall through **/\r\n\t\t\tcase '\\0': case '#':\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\tbreak;\r\n\r\n\t\tcase GETTING_PROMPT_LINE_1:\r\n\t\t\t{\r\n\t\t\t\tchar *p, *q, len;\r\n\t\t\t\tint ch;\r\n\r\n\t\t\t\tif((*temp == '.' || *temp == ',') && (temp[1] == '\\0')) {\r\n\t\t\t\t\tfprintf(stderr, \"%s: %s: prompt syntax error\\n\"\r\n\t\t\t\t\t , fnam, strg[cnt].name);\r\n\t\t\t\t\treturn 41;\r\n\t\t\t\t}\r\n\t\t\t\tq = p = temp;\r\n\t\t\t\twhile((ch = *p++) != 0)\r\n\t\t\t\t\tswitch(ch) {\r\n\t\t\t\t\tcase '\\\\':\r\n\t\t\t\t\t\tif(*p && (*q++ = mapBSEscape(&p)) == 0) {\r\n\t\t\t\t\t\t\tfprintf(stderr\r\n\t\t\t\t\t\t\t , \"%s: %s: ASCII(0) is no valid key\\n\"\r\n\t\t\t\t\t\t\t , fnam, strg[cnt].name);\r\n\t\t\t\t\t\t\treturn 49;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase '{':\r\n\t\t\t\t\t\t{\tchar *h;\r\n\t\t\t\t\t\t\tint thisCh;\r\n\r\n\t\t\t\t\t\t\tif((p = strchr(h = p, '}')) == 0) {\r\n\t\t\t\t\t\t\t\tfprintf(stderr\r\n\t\t\t\t\t\t\t\t , \"%s: %s: invalid symbolic key\\n\"\r\n\t\t\t\t\t\t\t\t , fnam, strg[cnt].name);\r\n\t\t\t\t\t\t\t\treturn 46;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t*p++ = 0;\r\n\t\t\t\t\t\t\tif((thisCh = mapSymKey(h)) == 0) {\r\n\t\t\t\t\t\t\t\tfprintf(stderr\r\n\t\t\t\t\t\t\t\t , \"%s: %s: unknown symbolic key\\n\"\r\n\t\t\t\t\t\t\t\t , fnam, strg[cnt].name);\r\n\t\t\t\t\t\t\t\treturn 47;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(thisCh >= 256) {\r\n\t\t\t\t\t\t\t\tfprintf(stderr\r\n\t\t\t\t\t\t\t\t , \"%s: %s: non-ASCII keys not supported, yet\\n\"\r\n\t\t\t\t\t\t\t\t , fnam, strg[cnt].name);\r\n\t\t\t\t\t\t\t\treturn 55;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t*q++ = thisCh;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase '[':\r\n\t\t\t\t\t\tfprintf(stderr\r\n\t\t\t\t\t\t , \"%s: %s: brackets are not supported, yet\\n\"\r\n\t\t\t\t\t\t , fnam, strg[cnt].name);\r\n\t\t\t\t\t\treturn 48;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t*q++ = ch;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t*q = 0;\r\n\t\t\t\tif(q == temp) {\r\n\t\t\t\t\tfprintf(stderr\r\n\t\t\t\t\t , \"%s: %s: empty key sequence\\n\"\r\n\t\t\t\t\t , fnam, strg[cnt].name);\r\n\t\t\t\t\t return 52;\r\n\t\t\t\t}\r\n\t\t\t\tif((unsigned)(q - temp) > 255) {\r\n\t\t\t\t\tfprintf(stderr\r\n\t\t\t\t\t , \"%s: %s: too many keys\\n\"\r\n\t\t\t\t\t , fnam, strg[cnt].name);\r\n\t\t\t\t\t return 55;\r\n\t\t\t\t}\r\n\t\t\t\tlen = (char)(q - temp);\r\n\t\t\t\t\t/* Prompts are PStrings in this form:\r\n\t\t\t\t\t\tLKKKKMMMM\r\n\t\t\t\t\t\twhere number of K's == number of M's == L\r\n\t\t\t\t\t\tK -> key (1..255); M -> metakey (range 1..26);\r\n\t\t\t\t\t\t0 < L < 256\r\n\t\t\t\t\t*/\r\n\t\t\t\tif(!appMem(text, &len, 1) || !app(temp))\r\n\t\t\t\t\treturn 42;\r\n\t\t\t\tstate = GETTING_PROMPT_LINE_2;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\r\n\t\tcase GETTING_PROMPT_LINE_2:\r\n\t\t{\r\n\t\t\tchar *p, *q;\r\n\r\n\t\t\tif ((*temp == '.' || *temp == ',') && (temp[1] == '\\0')) {\r\n\t\t\t\tfprintf(stderr, \"%s: %s: prompt syntax error\\n\"\r\n\t\t\t\t , fnam, strg[cnt].name);\r\n\t\t\t\treturn 43;\r\n\t\t\t}\r\n\r\n\t\t\tp = q = temp;\r\n\t\t\twhile((*q = *p++) != 0)\r\n\t\t\t\tif(*q >= 'a' && *q <= 'z') {\r\n\t\t\t\t\t*q++ -= 'a' - 1;\t/* valid metakey */\r\n\t\t\t\t} else if(!isspace(*q)) {\r\n\t\t\t\t\tfprintf(stderr, \"%s: %s: invalid target metakey\\n\"\r\n\t\t\t\t\t , fnam, strg[cnt].name);\r\n\t\t\t\t\treturn 44;\r\n\t\t\t\t}\r\n\t\t\tif((unsigned)(q - temp) + 1 != text.length) {\r\n\t\t\t\tfprintf(stderr\r\n\t\t\t\t , \"%s: %s: number of metakeys does not match input keys\\n\"\r\n\t\t\t\t , fnam, strg[cnt].name);\r\n\t\t\t\treturn 53;\r\n\t\t\t}\r\n\t\t\tif(!app(temp))\r\n\t\t\t\treturn 54;\r\n\t\t\tstate = GETTING_STRING;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\r\n\t\tcase GETTING_STRING:\r\n\t\t\tif ((*temp == '.' || *temp == ',') && (temp[1] == '\\0')) {\r\n\t\t\t\tif (*temp == ',' &&\ttext.length\r\n\t\t\t\t && text.text[text.length - 1] == '\\n') {\r\n\t\t\t\t \t/* Cut the text as there is to always be a '\\0' at the\r\n\t\t\t\t\t\tend of the string */\r\n\t\t\t\t \ttext.text[--text.length] = '\\0';\r\n\t\t\t\t}\r\n\t\t\t\tstate = LOOKING_FOR_START;\r\n\t\t\t\tappMem(vstring, \"\", 0);\t\t/* ensure vstring.text is != NULL */\r\n\t\t\t\tassert(vstring.text);\r\n\t\t\t\tassert((strg[cnt].flags & 3) == 0\t\t/* New string */\r\n\t\t\t\t || strg[cnt].vstring);\r\n\t\t\t\t/* Apply the cached text */\r\n\t\t\t\tif((strg[cnt].flags & 3) == 0\t\t/* New string */\r\n\t\t\t\t || (strg[cnt].version == version\r\n\t\t\t\t     && ((strg[cnt].flags & PERFORM_VALIDATION) == 0\r\n\t\t\t\t      || strcmp(strg[cnt].vstring, vstring.text) == 0))) {\r\n\t\t\t\t\t/* OK -> replace it */\r\n\t\t\t\t\tstrg[cnt].version = version;\r\n\t\t\t\t\tfree(strg[cnt].text);\r\n\t\t\t\t\tstrg[cnt].text = text.text;\r\n\t\t\t\t\tstring[cnt].size = text.length + 1;\r\n\t\t\t\t\tfree(strg[cnt].vstring);\r\n\t\t\t\t\tstrg[cnt].vstring = vstring.text;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(strg[cnt].version != version)\r\n\t\t\t\t\t\tstrg[cnt].flags |= VERSION_MISMATCH;\r\n\t\t\t\t\tif(strcmp(strg[cnt].vstring, vstring.text) != 0)\r\n\t\t\t\t\t\tstrg[cnt].flags |= VALIDATION_MISMATCH;\r\n\t\t\t\t\t/* Failed -> ignore the read text */\r\n\t\t\t\t\tfree(text.text);\r\n\t\t\t\t\tfree(vstring.text);\r\n\t\t\t\t}\r\n\t\t\t\ttext.text = vstring.text = 0;\r\n\t\t\t\tstrg[cnt].flags |= in_file;\r\n\t\t\t} else {\r\n\t\t\t\tchar *p, *q, ch;\r\n\t\t\t\t/* Fetch the '%' format sequences */\r\n\t\t\t\tq = temp - 1;\r\n\t\t\t\twhile((p = strchr(q + 1, '%')) != 0) {\r\n\t\t\t\t\tif((q = strpbrk(p, \"%diouxXfegEGcsnp\")) == 0)\r\n\t\t\t\t\t\tq = strchr(p, '\\0') - 1;\r\n\t\t\t\t\tif(!appMem(vstring, p, (unsigned)(q - p) + 2))\r\n\t\t\t\t\t\treturn 51;\r\n\t\t\t\t}\r\n\t\t\t\t/* Replace backslash escape sequences */\r\n\t\t\t\tp = q = temp;\r\n\t\t\t\twhile((ch = *p++) != 0) {\r\n\t\t\t\t\tif(ch != '\\\\')\r\n\t\t\t\t\t\t*q++ = ch;\r\n\t\t\t\t\telse if(!*p) goto noAppendNL;\r\n\t\t\t\t\telse *q++ = mapBSEscape(&p);\r\n\t\t\t\t}\r\n\t\t\t\t*q++ = '\\n';\r\nnoAppendNL:\r\n\t\t\t\tif(!appMem(text, temp, (unsigned)(q - temp)))\r\n\t\t\t\t\treturn 82;\r\n\t\t\t}\r\n\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tif(ferror(fin)) {\r\n\t\tpxerror(\"reading \", fnam);\r\n\t\treturn 34;\r\n\t}\r\n\tfclose(fin);\r\n\tif(state != LOOKING_FOR_START) {\r\n\t\tfprintf(stderr, \"%s: Last string not terminated\\n\", fnam);\r\n\t\treturn 40;\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n\r\nstatic int create_make_dependency(void)\r\n{\r\n\tstring_count_t cnt1;\r\n\tstring_count_t maxCnt1;\r\n\tstring_count_t cnt2;\r\n\r\n\tstrcpy(cfilename, fTCMAKFILE);\r\n\tif((lgf = fopen(cfile, \"wt\")) == NULL) {\r\n\t\tpxerror(\"creating \", cfile);\r\n\t\treturn 101;\r\n\t}\r\n\tcnt1 = maxCnt1 = cnt2 = 0;\r\n\tfor(cnt = 0; cnt < maxCnt; ++cnt) {\r\n\t\tif( cnt1 == 0 ) {\r\n\t\t\tif( cnt > 0 )\r\n\t\t\t\tfprintf(lgf, \"\\n\");\r\n\t\t\tfprintf(lgf, \"strings_deps%d : \\\\\\n\", maxCnt1++);\r\n\t\t\tcnt2 = 0;\r\n\t\t}\r\n\t\tfprintf(lgf, \" \" objfmt, cnt);\r\n\t\tif(++cnt1 > 127) {\r\n\t\t\tcnt1 = 0;\r\n\t\t}\r\n\t\tif(++cnt2 > 7 && cnt1 > 0) {\r\n\t\t\tfprintf(lgf, \" \\\\\\n\");\r\n\t\t\tcnt2 = 0;\r\n\t\t}\r\n\t}\r\n\tfor(cnt = 0; cnt < maxCnt1; ++cnt) {\r\n\t\tif( cnt == 0 )\r\n\t\t\tfprintf(lgf, \"\\nSTRINGS_DEPS =\");\r\n\t\tfprintf(lgf, \" strings_deps%d\", cnt);\r\n\t}\r\n\tfflush(lgf);\r\n\tif(ferror(lgf)) {\r\n\t\tputs(\"Unspecific error writing to \" fTCMAKFILE);\r\n\t\treturn 104;\r\n\t}\r\n\tfclose(lgf);\r\n\treturn 0;\r\n}\r\n\r\nint main(int argc, char **argv)\r\n{\r\n\tFILE *dat, *inc;\r\n\tint rc;\r\n\tunsigned long size;\r\n\tstring_count_t cnt;\t\t/* current string number */\r\n\tstring_size_t lsize;\r\n\tint makeLib = 0;\r\n\tconst char *fmt;\r\n\r\n\tunlink(logfile);\r\n\r\n\twhile(argv[1] != NULL ) {\r\n\t\tif(stricmp(argv[1], \"/lib\") == 0 || stricmp(argv[1], \"--lib\") == 0) {\r\n\t\t\t--argc;\r\n\t\t\t++argv;\r\n\t\t\tmakeLib = 1;\r\n\t\t} else if(stricmp(argv[1], \"/lib1\") == 0 || stricmp(argv[1], \"--lib1\") == 0) {\r\n\t\t\t--argc;\r\n\t\t\t++argv;\r\n\t\t\tmakeLib = 2;\r\n\t\t} else if(stricmp(argv[1], \"/lib2\") == 0 || stricmp(argv[1], \"--lib2\") == 0) {\r\n\t\t\t--argc;\r\n\t\t\t++argv;\r\n\t\t\tmakeLib = 3;\r\n\t\t} else {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t/*\r\n\t * Hidden options lib and lib1 and lib2\r\n\t *\r\n\t * if one of these option is used then program generate strings library\r\n\t * source files and generate make files and response file for make utility\r\n\t *\r\n\t * lib.. options control response file format\r\n\t * lib2  format is '+<file name> &'\r\n\t * lib1  format is '+<file name>'\r\n\t * lib   format is '<file name>' only\r\n\t */\r\n\tif(argc > 2 ) {\r\n\t\tputs(\"FIXSTRS - Generate STRINGS.DAT and STRINGS.H for a language\\n\"\r\n\t\t\t\"Useage: FIXSTRS [/lib|/lib1|/lib2] [language]\\n\"\r\n\t\t\t\"\\tIf no language is specified, only the default strings are read.\\n\"\r\n\t\t\t\"\\tThe <language>.LNG file must reside in the current directory.\\n\"\r\n\t\t\t\"Note: DEFAULT.lng must be present in the current directory, too.\");\r\n\t\treturn 127;\r\n\t}\r\n\r\n\r\n\tin_file = 1;\r\n\tif((rc = loadFile(fTXT)) != 0)\r\n\t\treturn rc;\r\n\tin_file = 2;\r\n\tif(argc > 1 && (rc = loadFile(argv[1])) != 0)\r\n\t\treturn rc;\r\n\r\n/* Now all the strings are cached into memory */\r\n\r\n\tif(maxCnt < 2) {\r\n\t\tfputs(\"No string definition found.\\n\", stderr);\r\n\t\treturn 43;\r\n\t}\r\n\r\n\t/* Create the LOG file */\r\n\tif(argc > 1) {\t\t/* Only if a local LNG file was specified */\r\n\t\tlgf = NULL;\t\t\t/* No LOG entry til this time */\r\n\t\tfor(cnt = 0; cnt < maxCnt; ++cnt) {\r\n\t\t\tswitch(strg[cnt].flags & 3) {\r\n\t\t\tcase 0:\t\t/* Er?? */\r\n\t\t\t\tfputs(\"Internal error assigned string has no origin?!\\n\"\r\n\t\t\t\t , stderr);\r\n\t\t\t\treturn 99;\r\n\t\t\tcase 1:\t\t/* DEFAULT.lng only */\r\n\t\t\t\tif(!lgf && (lgf = fopen(logfile, \"wt\")) == NULL) {\r\n\t\t\t\t\tfprintf(stderr, \"Cannot create logfile: '%s'\\n\"\r\n\t\t\t\t\t , logfile);\r\n\t\t\t\t\tgoto breakLogFile;\r\n\t\t\t\t}\r\n\t\t\t\tfprintf(lgf, \"%s: Missing from local LNG file\\n\"\r\n\t\t\t\t , strg[cnt].name);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\t\t/* local.LNG only */\r\n\t\t\t\tif(!lgf && (lgf = fopen(logfile, \"wt\")) == NULL) {\r\n\t\t\t\t\tfprintf(stderr, \"Cannot create logfile: '%s'\\n\"\r\n\t\t\t\t\t , logfile);\r\n\t\t\t\t\tgoto breakLogFile;\r\n\t\t\t\t}\r\n\t\t\t\tfprintf(lgf, \"%s: No such string resource\\n\"\r\n\t\t\t\t , strg[cnt].name);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\t\t/* OK */\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(strg[cnt].flags & VERSION_MISMATCH) {\r\n\t\t\t\tif(!lgf && (lgf = fopen(logfile, \"wt\")) == NULL) {\r\n\t\t\t\t\tfprintf(stderr, \"Cannot create logfile: '%s'\\n\"\r\n\t\t\t\t\t , logfile);\r\n\t\t\t\t\tgoto breakLogFile;\r\n\t\t\t\t}\r\n\t\t\t\tfprintf(lgf, \"%s: Version mismatch, current is: %u\\n\"\r\n\t\t\t\t , strg[cnt].name, strg[cnt].version);\r\n\t\t\t}\r\n\t\t\tif(strg[cnt].flags & VALIDATION_MISMATCH) {\r\n\t\t\t\tif(!lgf && (lgf = fopen(logfile, \"wt\")) == NULL) {\r\n\t\t\t\t\tfprintf(stderr, \"Cannot create logfile: '%s'\\n\"\r\n\t\t\t\t\t , logfile);\r\n\t\t\t\t\tgoto breakLogFile;\r\n\t\t\t\t}\r\n\t\t\t\tfprintf(lgf, \"%s: printf() format string mismatch, should be: %s\\n\"\r\n\t\t\t\t , strg[cnt].name, strg[cnt].vstring);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(lgf)\r\n\t\t\tfclose(lgf);\r\n\t}\r\nbreakLogFile:\r\n\r\n\t/* 1. Adjust the offset and generate the overall size */\r\n\tfor(size = string[0].size, cnt = 1; cnt < maxCnt; ++cnt) {\r\n\t\tstring[cnt].index = string[cnt-1].index + string[cnt-1].size;\r\n\t\tsize += string[cnt].size;\r\n\t}\r\n\r\n\tif(size >= 0x10000ul - sizeof(string_index_t) * maxCnt) {\r\n\t\tfputs(\"Overall size of strings exceeds 64KB limit\\n\", stderr);\r\n\t\treturn 44;\r\n\t}\r\n\r\n\t/* 2. Open STRINGS.DAT and STRINGS.H and dump control information */\r\n\tif ((dat = fopen(fDAT,\"wb\")) == NULL) {\r\n\t\tperror(\"creating \" fDAT);\r\n\t\treturn 36;\r\n\t}\r\n\tif ((inc = fopen(fH,\"wt\")) == NULL) {\r\n\t\tperror(\"creating \" fH);\r\n\t\treturn 37;\r\n\t}\r\n\r\nputs(\"FIXSTRS: building STRINGS resource\");\r\n\r\n\tfputs(\"/*\\n\"\r\n\t\t\" * This file was automatically generated by FIXSTRS.\\n\"\r\n\t\t\" * Any modifications will be lost next time this tool\\n\"\r\n\t\t\" * is invoked.\\n\"\r\n\t\t\" */\\n\\n\", inc);\r\n\tfprintf(inc,\"#define  STRINGS_ID         \\\"%s%u\\\"\\n\"\r\n\t , id, STRING_RESOURCE_MINOR_ID);\r\n\r\n\tstartResource(dat, RES_ID_STRINGS, STRING_RESOURCE_MINOR_ID);\r\n\t\t/* Preamble of STRINGS.DAT file */\r\n\tfprintf(dat, \"%s%u\", id, STRING_RESOURCE_MINOR_ID);\r\n/*\tfwrite(id, sizeof(id) - 1, 1, dat);\t\t*//* file contents ID */\r\n\tfwrite(\"\\r\\n\\x1a\", 4, 1, dat);\t\t\t/* text file full stop */\r\n\tfputs(\"#define  STRINGS_ID_TRAILER 4\\n\", inc);\t/* 4 additional bytes */\r\n\tfputs(\"\\n\\n\", inc);\t\t\t\t\t\t/* delimiter */\r\n\r\n\t\t/* parameters of strings */\r\n\tfwrite(&maxCnt, sizeof(maxCnt), 1, dat);\t/* number of strings */\r\n\tlsize = (string_size_t)size;\r\n\tfwrite(&lsize, sizeof(lsize), 1, dat);\t\t/* total size of string text */\r\n\r\n\t\t/* string control area */\r\n\tfwrite(string, sizeof(string[0]), maxCnt, dat);\r\n\t/* append the strings */\r\n\tfor(cnt = 0; cnt < maxCnt; ++cnt) {\r\n\t\tfwrite(strg[cnt].text, string[cnt].size, 1, dat);\r\n\t\tif(makeLib)\r\n\t\t\tfprintf(inc, \"extern const char %s[];\\n\", strg[cnt].name);\r\n\t\tfprintf(inc, \"#define  %-34s 0x%02x  /* @ 0x%04x */\\n\"\r\n\t\t , strg[cnt].name, cnt, string[cnt].index);\r\n\t}\r\n\tfputs(\"\\n/* END OF FILE */\\n\", inc);\r\n\tendResource(dat);\r\n\r\n\tfflush(dat);\r\n\tif(ferror(dat)) {\r\n\t\tfputs(\"Unspecific write error into \" fDAT \"\\n\", stderr);\r\n\t\treturn 38;\r\n\t}\r\n\tfflush(inc);\r\n\tif(ferror(inc)) {\r\n\t\tfputs(\"Unspecific write error into \" fH \"\\n\", stderr);\r\n\t\treturn 39;\r\n\t}\r\n\r\n\tfclose(dat);\r\n\tfclose(inc);\r\n\r\n\tif(makeLib) {\r\n\t\tmkdir(stringdir);\r\n#define fdmake inc\r\n#define ftc101 dat\r\n\t\tcfilename[-1] = '/';\r\n\t\tstrcpy(cfilename, fDMAKEFILE);\r\n\t\tif((fdmake = fopen(cfile, \"wt\")) == NULL) {\r\n\t\t\tpxerror(\"creating \", cfile);\r\n\t\t\treturn 100;\r\n\t\t}\r\n\t\tif((rc = create_make_dependency()) != 0)\r\n\t\t\treturn rc;\r\n\t\tstrcpy(cfilename, fTCMAKEFILE);\r\n\t\tif((ftc101 = fopen(cfile, \"wt\")) == NULL) {\r\n\t\t\tpxerror(\"creating \", cfile);\r\n\t\t\treturn 101;\r\n\t\t}\r\n\r\nputs(\"FIXSTRS: building STRINGS library source files\");\r\n\t\t/********************** prologue */\r\n\t\tfputs(\"\\\r\nMAXLINELENGTH := 8192\\n\\\r\n# Project specific C compiler flags\\n\\\r\nMYCFLAGS_DBG = -UNDEBUG $(null,$(DEBUG) $(NULL) -DDEBUG=1)\\n\\\r\nMYCFLAGS_NDBG = -DNDEBUG=1 -UDEBUG\\n\\\r\nMYCFLAGS = $(null,$(NDEBUG) $(MYCFLAGS_DBG) $(MYCFLAGS_NDBG))\\n\\\r\n\\n\\\r\n#\tDefault target\\n\\\r\nall: $(CFG) strings.lib\\n\\\r\n\\n\\\r\nstrings.lib .LIBRARY : \", fdmake);\r\n\r\n\t\t/********************* individual files */\r\n\t\tfor(cnt = 0; cnt < maxCnt; ++cnt) {\r\n\t\t\tdumpString(cnt);\r\n\t\t\tfprintf(fdmake, \"\\\\\\n\\t\" objfmt, cnt);\r\n\t\t}\r\n\t\tif(makeLib == 3) {\r\n\t\t\t/* Turbo C */\r\n\t\t\tfmt = \"+\" objfmt \" &\\n\";\r\n\t\t} else if(makeLib == 2) {\r\n\t\t\t/* Borland C */\r\n\t\t\tfmt = \"+\" objfmt \"\\n\";\r\n\t\t} else {\r\n\t\t\t/* GCC, Open Watcom */\r\n\t\t\tfmt = objfmt \"\\n\";\r\n\t\t}\r\n\t\tfor(cnt = 0; cnt < maxCnt - 1; ++cnt) {\r\n\t\t\tfprintf(ftc101, fmt, cnt);\r\n\t\t}\r\n\t\tif(makeLib > 1) {\r\n\t\t\t/* Borland C, Turbo C */\r\n\t\t\tfmt = \"+\" objfmt \"\\n\";\r\n\t\t} else {\r\n\t\t\t/* GCC, Open Watcom */\r\n\t\t\tfmt = objfmt \"\\n\";\r\n\t\t}\r\n\t\tfprintf(ftc101, fmt, cnt);\r\n\t\t/********************** epilogue */\r\n\r\n\t\tfputs(\"\\n\\\r\n\\n\\\r\n.IF $(CFG) != $(NULL)\\n\\\r\n\\n\\\r\nCONFIGURATION = $(CONF_BASE)\\n\\\r\n\\n\\\r\n.IF $(_COMPTYPE) == BC\\n\\\r\nCONF_BASE =\t\\\\\\n\\\r\n-f- \\\\\\n\\\r\n-I$(INCDIR:s/;/ /:t\\\";\\\")\t\\\\\\n\\\r\n-L$(LIBDIR:s/;/ /:t\\\";\\\")\t\\\\\\n\\\r\n-w\\n\\\r\n\\n\\\r\n.IF $(_COMPILER)==BC5\\n\\\r\nCONFIGURATION += -RT- -x-\\n\\\r\n.ENDIF\\n\\\r\n\\n\\\r\nCONF_DBG =\t$(MYCFLAGS_DBG)\\n\\\r\nCONF_NDBG =\t$(MYCFLAGS_NDBG)\\n\\\r\n\\n\\\r\n.ENDIF\\n\\\r\n\\n\\\r\n.IF $(_COMPTYPE) == TC\\n\\\r\nCONF_BASE =\t\\\\\\n\\\r\n-I$(INCDIR:s/;/ /:t\\\";\\\")\t\\\\\\n\\\r\n-L$(LIBDIR:s/;/ /:t\\\";\\\")\t\\\\\\n\\\r\n-w\\n\\\r\n\\n\\\r\nCONF_DBG =\t$(MYCFLAGS_DBG)\\n\\\r\nCONF_NDBG =\t$(MYCFLAGS_NDBG)\\n\\\r\n\\n\\\r\n.ENDIF\\n\\\r\n.ENDIF\\n\", fdmake);\r\n\r\n\t\tfflush(ftc101);\r\n\t\tif(ferror(ftc101)) {\r\n\t\t\tputs(\"Unspecific error writing to \" fTCMAKEFILE);\r\n\t\t\treturn 104;\r\n\t\t}\r\n\t\tfclose(ftc101);\r\n\t\tfflush(fdmake);\r\n\t\tif(ferror(fdmake)) {\r\n\t\t\tputs(\"Unspecific error writing to \" fDMAKEFILE);\r\n\t\t\treturn 105;\r\n\t\t}\r\n\t\tfclose(fdmake);\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "strings/french.err",
    "content": "# $Id$\n#\n# Critical error national customization file\n#\n#       Language: French\n#       Codepage: 850\n#       Author:   Mateusz Viste\n#\n# The critical error (criter) handler receives some information\n# from the kernel about what error condition happens, generates some\n# human friendly message from it, requests the user's opinion about\n# how to proceed and, finally, returns to the kernel.\n#\n# The human friendly message is generated using one of the following\n# templates:\n# BLOCK_DEVICE (for criters on block devices)\n# \tError %1 drive %A: %2 area: %3\n# -and- CHAR_DEVICE (for criters on character devices)\n# \tError %1 device %A: %3\n#\n# Two-character sequences, which first character is a percent sign '%',\n# are placeholders for other information:\n# %% -> a single percent sign\n# %1 -> either READ or WRITE, depending on what kind of operation\n# \tcaused the criter\n# %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA\n# %3 -> the actual error string; these are the strings associated to\n# \ta number 0 through N, and must correspond to the number passed in\n# \tlowbyte(DI) to the criter handler (see RBIL INT-24 for details)\n# %A -> drive letter (for block devices); name of device (character devices)\n#\n# Below the line describing the error the user is prompted for the action\n# to proceed. This line is dynamically constructed depending on which\n# action are available at all. The full line may look like this:\n# \t(A)bort, (I)gnore, (R)etry, (F)ail?_\n#\n# The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They\n# should indicate which user response keys is associated with them;\n# suggested is to use the first letter and enclose it in parenthesises.\n# The delimiter \", \" can be defined with DELIMITER and is the same\n# for all slots.\n# The \"? \" sequence is defined by QUESTION.\n# The order of the actions is fixed and cannot be customized.\n#\n# With each action a number of user response keys must be associated.\n# They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ...\n# strings. Because the key is searched in the same format as returned\n# by INT-16-00, both upper and lower case must be specified and\n# certain special keys cannot be used.\n#\n# The individual error strings are defined by the #: lines, where\n# the hash sign '#' refers to the number the kernel passes to the\n# criter handler. The UNKNOWN string is displayed for all error\n# numbers not specified.\n#\n# NOTE #1: The percent rule applies to _all_ criter strings!\n# NOTE #2: Each string occupies exactly one line.\n# NOTE #3: Any leading or trailing whitespaces are removed. Prefix the\n#\tfirst or suffix the last whitespace with '%.' (one percent sign and\n#\tone dot). This sequence is removed from the string totally.\n# NOTE #4: To embed any character use: %&## (one percent sign,\n#\t\tone ampersand and exactly two hexa-decimal digits)\n\n## Primary strings\nS2\nBLOCK_DEVICE: Erreur %1 lecteur %A: %2 zone : %3\nS3\nCHAR_DEVICE: Erreur %1 lecteur %A: %3\n\n## kind of operation\nS0\nREAD: lecture de\nS1\nWRITE: criture vers\n\n## kind of failed area of block devices\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: root\nS7\nDATA: donnes\n\n## action strings\nS8\nIGNORE: (I)gnorer\nS9\nRETRY: (R)ecommencer\nS10\nABORT: (A)nnuler\nS11\nFAIL: (E)chec\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: iI\nKEYS_RETRY:  rR\nKEYS_ABORT:  aA\nKEYS_FAIL:   eE\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN: Code d'erreur inconnu\nS15\n0: tentative de violation de protection en criture\n1: unit inconnue pour pilote\n2: lecteur non prt\n3: commande inconnue donne au pilote\n4: erreur de donnes (mauvais CRC)\n5: mauvaise structure de taille pour la requte de pilote de priphrique\n6: erreur de recherche\n7: type de support inconnu\n8: secteur non trouv\n9: imprimante  court de papier\n10: erreur d'criture\n11: erreur de lecture\n12: erreur gnrale\n13: violation de partage\n14: violation de verrou\n15: changement de disque invalide\n16: FCB indisponible\n17: tampon de partage satur\n18: page de code manquante\n19: fin de l'entre\n20: espace disque insuffisant\n"
  },
  {
    "path": "strings/french.lng",
    "content": "# $Id$\n#\n# FreeCOM national customization file\n#\n#       Language: French\n#       Codepage: 850\n#       Author:   Mateusz Viste\n#\n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retrieve the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#\t:TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n# If there is a percent sign (%) appended to the version, the printf()\n# format string %-style placeholders are compared for the strings. The\n# sign need to be set in DEFAULT.LNG only.\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carriage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause an user interaction. Those ones should be in sync\n# with the issued text. To define how to interpret a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#YyNn\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitrary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the question\n# mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readability of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH#0%\nParamtre incorrect. - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH#0%\nParamtre incorrect. - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION#0%\nOption mal forme: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG#0%\nL'option '%s' n'accepte pas d'arguments\n.\n\n:TEXT_ERROR_OPT_NOARG#0%\nl'option \"%s\" ncessite un plusieurs paramtre(s)\n.\n\n:TEXT_INVALID_NUMBER#0%\nNombre invalide spcifi dans '%s'\n.\n\n:TEXT_ERROR_CLOSE_QUOTE#0%\nIl manque la fermeture des guillemets: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nImpossible de crer le fichier temporaire\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0%\nTrop de paramtres. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nTrop de paramtres.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER#0%\nParamtre invalide. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nChemin introuvable.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nFichier introuvable.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND#0%\nFichier introuvable. - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING#0%\nParamtre requis absent.\n.\n\n:TEXT_ERROR_INVALID_DRIVE#0%\nSpcification de lecteur invalide: %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2%\nCommande ou nom de fichier incorrect - \"%s\".\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nPlus de mmoire disponible.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nL'allocation de mmoire DOS a chou.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nImpossible d'tablir un pipe !  Impossible d'ouvrir le fichier temporaire !\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE#0%\nLa ligne #%ld dans le fichier BATCH '%s' est trop longue.\n.\n\n:TEXT_ERROR_BFILE_VANISHED#0%\nLe fichier BATCH '%s' est introuvable.\n.\n\n:TEXT_ERROR_BFILE_LABEL#0%\nLe fichier BATCH '%s' ne contient pas d'tiquette '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1%\n%s a chou pour '%s'.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR#0%\nImpossible de dfinir la variable '%s'.\nL'environnement serait-il satur ?\n.\n\n:TEXT_ERROR_ENV_VAR_NOT_FOUND#0%\nLa variable d'environnement '%s' est introuvable.\n.\n\n:TEXT_ERROR_NO_ENVIRONMENT\nAucun environnement ! La mmoire est peut-tre  bout. Utilisez l'option /E.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1%\nImpossible de dfinir l'alias '%s'. L'espace des alias serait-il satur ?\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1%\nAlias '%s' non trouv.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nPas d'espace pour les alias. La mmoire est peut-tre insuffisante.\n.\n\n:TEXT_ERROR_SYNTAX_STR#0%\nErreur de syntaxe. - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nErreur de syntaxe.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG#0%\nNom de fichier trop long. - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY#0%\nImpossible de copier '%s' sur lui-mme\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nLigne de commande trop longue aprs expansion d'alias !\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nLigne trop longue.  Impossible d'excuter la commande.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1%\nTaille de l'historique invalide '%s'.\n.\n\n:TEXT_HISTORY_EMPTY#1\nL'historique de la ligne de commande est vide.\n.\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nLa chane MCB ou le systme de compatibilit MS-DOS est corrompu.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR#0%\nErreur non dfinie %d.\n.\n\n:TEXT_ERROR_REGION_WARNING#0%\nRgion de mmoire invalide %d - ignor.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nVous devez spcifier ON ou OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nMauvaise spcification de variable.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nIN oubli dans la commande FOR.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nUne ou plusieurs parenthse(s) oublie(s).\n.\n\n:TEXT_ERROR_DO_MISSING#1\nDO oubli dans la commande FOR.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR: Aucune commande aprs DO.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE#0%\nImpossible de rediriger l'entre depuis le fichier '%s'.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE#0%\nImpossible de rediriger la sortie vers le fichier '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nLa redirection est vide.\n.\n\n:TEXT_ERROR_INVALID_DATE\nDate invalide.\n.\n\n:TEXT_ERROR_INVALID_TIME\nHeure invalide.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\ntiquette de destination non dfinie dans GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nLa commande CTTY a t exclue de ce COMMAND.COM.\n.\n\n:TEXT_ERROR_NORW_DEVICE#0%\nPriphrique '%s' invalide ou protg en criture.\n.\n\n:TEXT_ERROR_CTTY_DUP#0%\nchec lors du changement des descripteurs du fichier vers TTY '%s'.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\n/L pas encore implment.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\n/U pas encore implment.\n.\n\n:TEXT_ERROR_WRITING_DEST\nErreur lors de l'criture sur la destination.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE#0%\nImpossible d'ouvrir la source. - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE#0%\nImpossible d'ouvrir le fichier '%s'\n.\n\n:TEXT_ERROR_READ_FILE#0%\nImpossible de lire le fichier '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE#0%\nImpossible d'crire dans le fichier '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\nLe caractre '+' ne peut pas prcder les arguments.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nLe caractre '+' ne peut pas suivre les arguments.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nRien  faire.\n.\n\n:TEXT_ERROR_COPY\nCOPY a chou.\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: il manque le nom du fichier\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: il manque le numro\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: numro non valide\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: Commande manquante\n.\n\n:TEXT_NOT_IMPLEMENTED_YET\nDsol... pas encore implment.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nchec lors du transfert des messages en mmoire.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nL'option /MSG  t exclue de ce COMMAND.COM.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1%\n%u lments affichs.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nLigne de commande corrompue ! Ceci est une erreur interne lie  COMMAND.COM,\nmerci de la rapporter (par exemple sur www.freedos.org/bugs).\n.\n\n:TEXT_QUOTED_C_OR_K#1\nLes options /C et /K ne peuvent pas tre ajoutes, elles sont ignores.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1%\nLe rpertoire de COMMAND.COM doit tre compltement dfini !\ncela signifie que la lettre du lecteur doit tre prcise.\nPar exemple: C:\\\\FREEDOS\n\nCOMMAND.COM utilise actuellement le rpertoire suivant :\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nLes informations de la session ne peuvent pas tre restaures, tous les\nparamtres locaux sont perdus. Rfrez-vous aux messages d'erreurs ci-dessus\npour connatre la raison de ce problme...\n.\n\n:TEXT_ERROR_SAVE_SESSION\nL'information courante ne peut tre prserve durant l'appel\ndu programme. Rfrez-vous aux messages d'erreurs ci-dessus pour\nconnatre la raison de ce problme...\n.\n\n:TEXT_ERROR_CWD_FAILED#1%\nLe lecteur %c: ne rpond pas.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nchec de l'change : Les alias allouent trop de mmoire.\n.\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nchec de l'change : impossible d'allouer de la mmoire distante.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nFin d'espace pour les alias.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1%\nCet alias n'existe pas: '%s'\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nchec de l'insertion de l'alias.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1%\nNom d'alias invalide '%s'.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nImpossible de charger le module contextuel ou le pilote d'erreurs critiques.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nContexte  bout de mmoire.\nSi cette erreur persiste, envisagez d'allouer plus de tampons internes,\ncomme l'historique, la pile de rpertoires etc.\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1%\nLa taille totale des contextes (%lu octets) excde la limite maximale.\nLa taille des contextes a t modifie  %u octets.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nchec de l'ajout d'informations d'tat au contexte. Cette erreur peut indiquer\nune corruption mmoire ou une taille minimale mal dtermine du contexte.\nVeuillez informer le mainteneur de FreeCOM  l'adresse :\nfreedos-devel@lists.sourceforge.net\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nLe contexte a t perdu aprs le swap. Un contexte va tre recr, mais\ntous les alias etc. seront perdus.\n.\n\n:TEXT_ERROR_PERMISSION_DENIED#1%\n%s: Permission refuse\n.\n\n:TEXT_ERROR_NO_SUCH_FILE#1%\n%s: Aucun fichier ou rpertoire de ce nom\n.\n\n:TEXT_ERROR_UNKNOWN_ERROR#1%\n%s: Erreur inconnue\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nAppuyez sur une touche pour continuer . . .\\\n.\n\n:TEXT_MSG_HISTORY_SIZE#0%\nLa taille de l'historique est de %d octets.\n.\n\n:TEXT_MSG_DOSKEY\nLes fonctionnalits DOSKEY sont dj actives dans le shell.\n.\n\n:TEXT_MSG_ECHO_STATE#0%\nECHO est %s\n.\n\n:TEXT_MSG_VERIFY_STATE#0%\nVERIFY est %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE#0%\nLa sortie de DEBUG est %s.\n.\n\n:TEXT_MSG_FDDEBUG_TARGET#0%\nLa sortie de DEBUG est imprime sur '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE#0%\nBREAK est %s\n.\n\n:TEXT_MSG_LFNFOR_STATE#0%\nLFNFOR est %s\n.\n\n:TEXT_MSG_LFNFOR_COMPLETE_STATE#0%\nLFN Complete est %s\n.\n\n:TEXT_MSG_CURRENT_DATE#0%\nLa date actuelle est %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1%\nEntrez une nouvelle date (mm%sjj%s[aa]aa): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1%\nEntrez une nouvelle date (jj%smm%s[aa]aa): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1%\nEntrez une nouvelle date ([aa]aa%smm%sjj): \\\n.\n\n:TEXT_MSG_CURRENT_TIME#0%\nL'heure actuelle est %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nEntrez une nouvelle heure : \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING#0%\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1%\nOoNn{CR}{LF}{CBREAK}\naabb   b   b       b\nTous les fichiers dans '%s' vont tre dtruits !\ntes-vous sr (O/N) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nOoNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [Oui=ENTRE, Non=CH] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#\tby \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1%\nOoNnTtQq{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\nAppui de Control-Break dtect.\\r\nTerminer le fichier batch '%s' (Oui/Non/Tous) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1%\nOoNnTtQq{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\ncraser '%s' (Oui/Non/Tous/Quitter) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_APPEND_FILE#1%\nOoNnTtQq{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nAjouter  '%s' (Oui/Non/Tous/Quitter) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1%\nOoNnTtQq{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nEffacer '%s' (Oui/Non/Tous/Quitter) ? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<inconnu>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nLa pile de rpertoires est vide.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1%\n Le volume dans le lecteur %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING#0%\nest %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nn'a pas d'tiquette\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER#0%\n Le numro de srie du volume est %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1%\n%10s fichier(s)\\\n.\n:TEXT_DIR_FTR_BYTES#0%\n   %12s octets\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nTotal des fichiers lists :\n.\n:TEXT_DIR_FTR_DIRS#1%\n%10s rpertoire(s)\\\n.\n:TEXT_DIR_FTR_BYTES_FREE#0%\n %15s octets de libre\n.\n:TEXT_DIR_DIRECTORY#0%\nRpertoire de %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE#0%\n Rpertoire de %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1%\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE#1%\n%s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1%\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1%\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <REP> \\\n.\n:TEXT_DIR_LINE_SIZE#1%\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1%\n%-14s\\\n.\n\n:TEXT_MSG_PATH#0%\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nAucun chemin de recherche dfini.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nDim\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nLun\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nMar\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nMer\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\nJeu\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\nVen\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nSam\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\naucun fichier effac.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\nun fichier effac.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1%\n%u fichiers effacs.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nCommandes internes disponibles :\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\nFonctionnalits prsentes :\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[alias] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[saisie tendue] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[historique] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[compltion des noms de fichiers] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[swapping] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[commencer la journalisation] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[dernier rpertoire] \\\n.\n:TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1\n[longs noms de fichiers] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[swap noyau] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[swap XMS] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[swap par dfaut] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[commandes installables] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[pile de rpertoires (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[dbogage FreeCOM] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nAppuyez sur F8 pour le mode pas--pas, ou sur F5 pour passer %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0%\nContournement de '%s'.\n.\n\n:TEXT_MSG_VER_DOS_VERSION#0%\nDOS version %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nNoyau FreeDOS (build 1933 ou plus rcent)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS#0%\nVersion du noyau FreeDOS : %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\nCopyright (C) 1994-2001 Tim Norman et d'autres.\n\nCe programme est distribu dans l'espoir qu'il sera utile, mais SANS\nAUCUNE GARANTIE, ni explicite ni implicite, y compris les garanties de\ncommercialisation ou d'adaptation dans un but spcifique. Prenez\nconnaissance de la Licence Publique Gnrale GNU pour plus de dtails.\n\nEnvoyez les rapports de bugs  freedos-devel@lists.sourceforge.net.\nLes mises  jour sont disponibles sur https://github.com/FDOS/freecom\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\nCopyright (C) 1994-2001 Tim Norman et d'autres.\n\nCe programme est libre, vous pouvez le redistribuer et/ou le modifier\nselon les termes de la Licence Publique Gnrale GNU publie par la Free\nSoftware Foundation (version 2 ou bien toute autre version ultrieure\nchoisie par vous).\n\nEnvoyez les rapports de bugs  freedos-devel@lists.sourceforge.net.\nLes mises  jour sont disponibles sur https://github.com/FDOS/freecom\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\nLe shell de commandes FreeDOS est dvelopp par de nombreux dveloppeurs,\nconsultez le fichier HISTORY.TXT attach.\n\nEnvoyez les rapports de bugs  freedos-devel@lists.sourceforge.net.\nLes mises  jour sont disponibles sur https://github.com/FDOS/freecom\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nLe shell est sur le point d'tre termin, bien que cela soit interdit\\r\n(habituellement par la spcification de l'option \"/P\")\\r\nVous devez relancer le systme ou, si le shell fonctionne dans un\\r\nenvironnement multitche, terminer la tche manuellement.\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nExcutable FreeCOM non trouv.\nVous devez spcifier le chemin complet vers COMMAND.COM\ncomme premier argument de COMMAND, par exemple :\nC:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1%\nSegment d'environnement : max %5u octets ; %5u octets libres\n.\n:TEXT_MEMORY_CONTEXT#1%\nSegment de contexte     : max %5u octets ; %5u octets libres\n.\n:TEXT_MEMORY_HEAP#1%\nMmoire du tas          : %5lu octets disponibles\n.\n:TEXT_MEMORY_CTXT_ALIAS#1%\n\\tAliases      : limite %5u octets, actuel %5u octets, %5u lments\n.\n:TEXT_MEMORY_CTXT_HISTORY#1%\n\\tHistorique   : limite %5u octets, actuel %5u octets, %5u lments\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1%\n\\tPile rpert. : limite %5u octets, actuel %5u octets, %5u lments\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1%\n\\tCache rpert.: %5u octets utiliss, %5u lments\n.\n:TEXT_MEMORY_CTXT_BATCH#1%\n\\tEmpilement bat : %5u octets utiliss, %5u lments\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1%\n\\tSwapinfo       : %5u octets utiliss, %5u lments\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nImpossible d'identifier la page de code actuelle depuis le systme.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nLe changement de page de code en cours a chou.\n.\n:TEXT_DISPLAY_CODEPAGE#1%\nLa page de code actuelle est %u.\nLa page de code systme est : %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nAffiche, dtermine ou enlve les alias\n\nALIAS [variable[=][chane]]\n\n        variable  Spcifie le nom de l'alias\n        chane    Spcifie la chane de caractres qui activera l'alias.\n\n\nTapez ALIAS sans paramtres pour afficher les alias actuels.\n.\n\n:TEXT_CMDHELP_BEEP\nGnre un bip sonore.\n.\n\n:TEXT_CMDHELP_BREAK\nActive ou dsactive l'usage de CTRL+C.\n\nBREAK [ON | OFF]\n\nTapez BREAK sans paramtres pour afficher le statut actuel de BREAK.\n.\n\n:TEXT_CMDHELP_CALL#1\nExcute un fichier batch  partir d'un autre fichier batch.\n\nCALL [/S | /N] [/Y] [lecteur:][chemin]fichier [paramtres batch]\n\n  paramtres batch   Spcifie les paramtres du fichier batch  invoquer.\n\n  /S force, /N renie le swapping de FreeCOM.\n  /Y active le traage pendant l'excution de la commande.\n.\n\n:TEXT_CMDHELP_CD\nChange de rpertoire ou affiche le nom du rpertoire en cours.\n\nCHDIR [lecteur:][chemin]\nCHDIR[..]\nCD [lecteur:][chemin]\nCD[..]\nCD -\n\n ..   Indique que vous souhaitez changer vers le rpertoire-parent.\n -    Si l'option \"dernier rpertoire\" est active, change vers le\n      dernier rpertoire.\n\nTapez CD lecteur: pour afficher le rpertoire en cours sur le lecteur spcifi.\nTapez CD sans paramtres pour afficher le lecteur et rpertoire actuels.\nRegardez aussi : CDD\n.\n\n:TEXT_CMDHELP_CDD\nAffiche le nom ou change le rpertoire et le lecteur en cours.\n\nCDD [lecteur:][chemin]\nCDD[..]\n\n ..  Change vers le rpertoire parent.\n -   Si l'option \"dernier rpertoire\" est active, revient au dernier rpertoire.\n\nSi lecteur: est spcifi, le lecteur en cours est chang ; c'est la seule\ndiffrence avec \"CHDIR\".\nTapez CD sans paramtres pour afficher le lecteur et rpertoire en cours.\n.\n\n:TEXT_CMDHELP_CHCP\nAffiche ou dfinit la page de code en cours.\n\nCHCP [nnn]\n\n  nnn   Indique le numro de page de code.\n\nTapez CHCP sans paramtres afin d'afficher la page de code en cours.\n.\n\n:TEXT_CMDHELP_CLS\nNettoie l'cran.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\nDmarre une nouvelle copie du shell de commande de FreeDOS.\n\nCOMMAND [[lecteur:]chemin] [appareil] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG]\n                       [/LOW] [/Y [/[C|K] commande]]\n  [drive:]path    Spcifie le rpertoire contenant COMMAND.COM.\n  device          Spcifie le dispositif pour l'entre et sortie de commandes.\n  /E:nnnnn        Dfinit la taille initiale d'environnement  nnnnn octets.\n                  (nnnnn devrait tre entre 256 et 32.768).\n  /L:nnnn         Spcifie la taille des tampons internes (ncessite /P aussi).\n                  (nnnn devrait tre entre 128 et 1.024).\n  /U:nnn          Spcifie la taille du tampon d'entre (ncessite /P aussi).\n                  (nnn devrait tre entre 128 et 255).\n  /P              Rend le nouveau shell de commandes permanent (pas de sortie).\n  /MSG            Stocke tous les messages d'erreur en mmoire (ncessite /P).\n  /LOW            Force le shell de commandes  garder ses donnes rsidentes\n                  dans la mmoire basse.\n  /Y              Passe par le programme batch spcifi par /C ou /K.\n  /C command      Excute la commande spcifie et retourne.\n  /K command      Excute la commande spcifie et continue de fonctionner.\n.\n\n:TEXT_CMDHELP_COPY\nCopie un ou plusieurs fichiers vers un autre emplacement.\n\nCOPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination\n  [/A | /B]] [/V] [/Y | /-Y]\n\n  source       Spcifie le ou les fichiers  copier.\n  /A           Indique un fichier texte ASCII.\n  /B           Indique un fichier binaire.\n  destination  Spcifie le rpertoire et/ou le nom du nouveau fichier.\n  /V           Vrifie que les nouveaux fichiers sont bien enregistrs.\n  /Y           Supprime la demande de confirmation de rcriture d'une\n               destination dj existante.\n  /-Y          Force une demande de confirmation avant toute rcriture\n               d'un fichier dj existant.\n\nLe paramtre /Y peut tre ajout  la variable d'environnement COPYCMD.\nCeci peut tre dsactiv en ligne de commande avec /-Y.\n\nPour joindre des fichiers, spcifiez un seul fichier de destination mais\nplusieurs de source (avec des jokers ou au format file1+file2+file3).\n.\n\n:TEXT_CMDHELP_CTTY\nChange le priphrique utilis pour contrler le systme.\n\nCTTY priphrique\n\n priphrique  Le priphrique que vous voulez utiliser, comme COM1.\n.\n\n:TEXT_CMDHELP_DATE#1\nAffiche ou rgle la date.\n\nDATE [/D] [date]\n\nTapez DATE sans paramtres pour afficher la date actuelle et une demande\nde nouvelle date. Appuyez sur ENTRE pour garder la mme date.\n\n/D Bloque l'interactivit de DATE.\n.\n\n:TEXT_CMDHELP_DEL#2\nEfface un ou plusieurs fichiers.\n\nDEL [lecteur:][chemin]fichier [/P] [/V]\nERASE [lecteur:][chemin]fichier [/P] [/V]\n\n  [lecteur:][chemin]fichier Spcifie le/les fichier(s)  effacer. Vous pouvez\n                            spcifier plusieurs fichiers  l'aide de masques.\n  /P    Demande confirmation avant d'effacer chaque fichier.\n  /V    Affiche tous les fichiers effacs.\n.\n\n:TEXT_CMDHELP_DIR#4\nAffiche une liste des fichiers et de sous rpertoires dans un rpertoire.\n\nDIR [lecteur:][chemin][nom-de-fichier] [/P] [/W] [/A[[:]attributs]]\n  [/O[[:]ordre-de-tri]] [/S] [/B] [/L]\n\n  [lecteur:][chemin][nom-de-fichier]\n            Spcifie le lecteur, le rpertoire et/ou les fichiers  lister.\n            (Peut tre amlior spcification de fichier ou plusieurs spcs.)\n /P         Effectue une pause aprs chaque cran d'information.\n /W         Utilise le format de liste largie.\n /A         Affiche les fichiers avec attributs spcifis. (Dfaut : /ADHSRA)\n attributs   D  Rpertoires                R  Fichiers en lecture seule\n             H  Fichiers cachs            A  Fichiers prts  tre archivs\n             S  Fichiers systme           -  Prfixe signifiant non\n /O         Liste les fichiers dans l'ordre de tri.\n ordre tri   N  Par le nome (alphabtique) S  Par la taille (petits d'abord)\n             E  Par extension              D  Par horodatage (d'abord l'ancien)\n             G  Groupe d'abord les dossiers-  Prfixe pour inverser l'ordre\n             U  Sans tri\t\t   Par dfaut quivalent  /ONG\n /S         Affiche les fichiers dans le dossier spcifi et tous sous dossiers\n /B         Utilise le format nu (pas d'en-tte ou de rsum).\n /L         Utilise des minuscules.\n /Y or /4   Affiche l'anne en 4 chiffres.\n\nLes commutateurs peuvent tre rgls dans la variable d'env DIRCMD. Annuler\nles commutateurs prrgls en prfixant avec - (tiret)--par exemple, /-W.\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nL'utilitaire externe DOSKEY a t incorpor dans FreeCOM.\nUtilisez curseur HAUT & BAS pour l'historique et HISTORY pour l'afficher.\nUtilisez curseur GAUCHE & DROIT et les touches FIN et HOME pour naviguer dans\nla ligne de commande et avec INSER changez les modes insertion et crasement.\nUtilisez TAB pour complter le mot actuel comme nom de fichier, utilisez-le\ndeux fois pour afficher tous les fichiers correspondants.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\ndite les lignes de commande, les rappelle et cre des macros\n\nDOSKEY [/commutateur ...] [nom-de-macro=[texte]]\n\n  /BUFSIZE:size Dfinit la taille de la macro et du tampon       (dfaut : 512)\n  /ECHO:on|off  Active/dsactive l'cho des expansions des macros(dfaut : on)\n  /FILE:file    Spcifie un fichier contenant la liste des macros\n  /HISTORY      Affiche toutes les commandes stockes en mmoire\n  /INSERT       Insre de nouveaux caractres sur la ligne lors de la frappe\n  /KEYSIZE:size Dfinit la taille du tampon du clavier type-ahead(dfaut:15)\n  /LINE:size    Dfinit la taille du tampon d'dition de ligne   (dfaut:128)\n  /MACROS       Affiche toutes les macros DOSKEY\n  /OVERSTRIKE   crase les anciens caractres lors de la frappe  (par dfaut)\n  /REINSTALL    Installe une nouvelle copie de DOSKey\n  macroname     Spcifie un nom pour la macro que vous crez\n  text          Spcifie les commandes que vous voulez assigner  la macro\n\n  HAUT, BAS rappellent les commandes\n      chap efface la commande actuelle\n       F7 affiche l'historique des commandes\n   Alt+F7 efface l'historique des commandes\n[cars] F8 recherche les commandes commenant par [cars]\n       F9 slectionne une commande en fonction du nombre\n  Alt+F10 efface les dfinitions des macros\n\nCi-dessous des codes spciaux utilisables dans les dfinitions de macros DOSKEY:\n  $T     Sparateur de commande : commandes multiples dans une macro\n  $1-$9  Paramtres batch : quivalent  %1-%9 dans les programmes batch\n  $*     Symbole remplac par tout ce qui suit le nom de la macro\n.\n\n:TEXT_CMDHELP_ECHO\nAffiche des messages, ou active ou dsactive l'cho des commandes.\n\n  ECHO [ON | OFF]\n  ECHO [message]\n\nTapez ECHO sans paramtres pour afficher le rglage echo actuel.\n.\n\n:TEXT_CMDHELP_EXIT\nQuitte le shell FreeDOS sauf s'il est charg avec /P.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\nExcute une commande spcifie pour chaque fichier dans un jeu de fichiers.\n\nFOR %%variable IN (set) DO commande [paramtres-de-commande]\n\n  %%variable Spcifie un paramtre remplaable.\n  (set)      Spcifie un jeu d'un ou plusieurs fichiers.  Jokers accepts.\n  commande   Spcifie la commande  excuter pour chaque fichier.\n  paramtres-de-commande\n             Spcifie des paramtres ou options pour la commande spcifie.\n\nPour utiliser la commande FOR dans un programme batch, spcifiez %%%%variable\nau lieu de %%variable.\n\nPar exemple :\n  FOR %%%%f IN (---dbut--- a*.* ---fin---) DO ECHO - %%%%f -\n.\n\n:TEXT_CMDHELP_GOTO\nDirige le shell de commande vers une ligne tiquete dans un programme batch.\n\nGOTO tiquette\n\n  tiquette Spcifie du texte utilis dans un batch en tant qu'tiquette.\n\nVous tapez une tiquette sur une ligne, en commenant par un deux-points.\n.\n\n:TEXT_CMDHELP_HISTORY#1\nCommande history.\n\nHISTORY [taille]\n\nSans la \"taille\" le contenu actuel du tampon de l'historique de la ligne de\ncommande est affiche.\nAvec la taille, la taille du tampon de l'historique est modifie.\n.\n\n:TEXT_CMDHELP_IF\nEffectue des traitements conditionnels dans les programmes batch.\n\nIF [NOT] ERRORLEVEL nombre commande\nIF [NOT] chane1==chane2 commande\nIF [NOT] EXIST nom-de-fichier commande\n\n  NOT               Spcifie que le shell de commande ne doit excuter la\n                    commande seulement si la condition est fausse.\n  ERRORLEVEL nombre Spcifie une condition vraie si le dernier programme\n                    excut a retourn un code de sortie gal ou suprieur au\n                    nombre spcifi.\n  commande          Spcifie la commande  excuter si la condition est\n                    satisfaite.\n  chane1==chane2  Spcifie une condition vraie si les chanes de texte\n                    spcifies correspondent.\n  EXIST nom-de-fich.Spcifie une condition vraie a si le nom de fichier\n                    spcifi existe.\n.\n\n:TEXT_CMDHELP_LFNFOR\nActive/Dsactive les noms de fichiers longs dans la commande FOR ou pour Tab.\n\nLFNFOR [ON | OFF]\nLFNFOR COMPLETE [ON | OFF]\n\nTapez LFNFOR ou LFNFOR COMPLETE sans paramtre pour afficher le rglage actuel\nde LFNFOR.\n.\n:TEXT_CMDHELP_LH\nCharge un programme dans la zone de mmoire haute.\n\nLOADHIGH [lecteur:][chemin]nom-de-fichier [paramtres]\nLOADHIGH [/L:rgion1[,taillemin1][;rgion2[,taillemin2]...] [/S]]\n         [lecteur:][chemin]nom-de-fichier [paramtres]\n\n/L:rgion1[taillemin1][;rgion2[,taillemin2]]...\n            Spcifie les zones de mmoire dans lesquelles charger le\n            programme. Rgion1 spcifie le nombre de la premire zone de la\n            mmoire ; taillemin1 spcifie la taille minimale (optionnelle)\n            pour rgion1.  Rgion2 et taillemin2 spcifient le nombre et la\n            taille minimale de la seconde zone (optionnelle). Vous pouvez\n            spcifier autant de zones que vous le souhaitez.\n\n/S          Rtrcit un UMB  sa taille minimale pendant le chargement du\n            programme.\n\n[lecteur:][chemin]nom-de-fichier\n            Spcifie la localisation et le nom du programme.\n.\n\n:TEXT_CMDHELP_LOADFIX\nCharge un programme au-dessus des premiers 64K de mmoire et l'excute.\n\nLOADFIX [lecteur:][chemin]nom-de-fichier\n\nUtilisez LOADFIX pour charger un programme si vous avec reu le message\n\"Fichier compress corrompu\" lorsque vous le chargez dans la mmoire basse.\n.\n\n:TEXT_CMDHELP_MD\nCre un rpertoire.\n\nMKDIR [lecteur:]chemin\nMD [lecteur:]chemin\n.\n\n:TEXT_CMDHELP_PATH\nAffiche ou dfinit un chemin de recherche pour les fichiers excutables.\n\nPATH [[lecteur:]chemin[;...]]\nPATH ;\n\nTapez PATH ; pour effacer tous les rglages de recherche et forcer le shell\nde commande  rechercher uniquement dans le rpertoire courant.\nTapez PATH sans paramtres pour afficher le chemin actuel.\n.\n\n:TEXT_CMDHELP_PAUSE\nSuspend le traitement d'un programme batch et affiche le message :\n\"Appuyez sur une touche pour continuer....\" ou un message optionnel spcifi.\n\nPAUSE [message]\n.\n\n:TEXT_CMDHELP_PROMPT\nModifie l'invite de commande.\n\nPROMPT [texte]\n\n  texte    Spcifie une nouvelle invite de commande.\n\nL'invite peut tre constitue de caractres normaux et des codes spciaux\nsuivants :\n\n  $Q   = (signe d'galit)\n  $$   $ (signe du dollar)\n  $T   Heure actuelle\n  $D   Date actuelle\n  $P   Lecteur et chemin actuels\n  $V   nombre de version du shell de commande de FreeDOS\n  $N   Lecteur actuel\n  $G   > (signe de supriorit)\n  $L   < (signe d'infriorit)\n  $B   | (pipe)\n  $H   Retour arrire (efface le caractre prcdent)\n  $E   Code d'chappement (code ASCII 27)\n  $_   Retour charriot et avance d'une ligne\n\nTapez PROMPT sans paramtre pour remettre  zro le rglage de l'invite.\n.\n\n:TEXT_CMDHELP_PUSHD\nPousse le rpertoire courant dans la pile de rpertoires, avec la possibilit\nde modifier le rpertoire de travail courant.\n\nPUSHD [[lecteur:]chemin]\n  O [lecteur:]chemin est le chemin pour lequel vous souhaitez changer.\n.\n\n:TEXT_CMDHELP_POPD\nAffiche un rpertoire de la pile de rpertoires et y apporte des modifications.\n\nPOPD [*]\n  Le paramtre '*' nettoie la pile de rpertoires.\n.\n\n:TEXT_CMDHELP_DIRS\nAffiche le contenu de la pile de rpertoires.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\nEfface un rpertoire.\n\nRMDIR [lecteur:]chemin\nRD [lecteur:]chemin\n.\n\n:TEXT_CMDHELP_REM\nEnregistre des commentaires (remarques) dans un fichier batch ou CONFIG.SYS.\n\nREM [commentaire]\n.\n\n:TEXT_CMDHELP_REN\nRenomme un fichier/rpertoire ou des fichiers/rpertoires.\n\nRENAME [lecteur:][chemin][nomrp1 | nomfichier1] [nomrp2 | nomfichier2]\nREN [lecteur:][chemin][nomrp1 | nomfichier1] [nomrp2 | nomfichier2]\n\nNotez que vous ne pouvez pas spcifier un nouveau lecteur ou chemin pour votre\ndestination. Utilisez la commande MOVE pour cela.\n.\n\n:TEXT_CMDHELP_SET#1\nAffiche, dfinit ou enlve des variables d'environnement.\n\nSET [/C] [/P] [/E] [/U] [variable=[chane]]\n\n  variable  Spcifie le nom de la variable d'environnement.\n  chane    Spcifie une srie de caractres  assigner  la variable.\n\n* Si aucune chane n'est spcifie, la variable est enleve de l'environnement.\n\nTapez SET sans paramtres pour afficher les variables d'environnement actuels.\n\nTapez SET VAR pour afficher la valeur de VAR\n\n/C force  conserver la casse de la variable, par dfaut la variable est en\nmajuscules s'il ne se trouve pas dj dans l'environnement, sinon la casse est\ngarde.\n\n/P demande une chane, et assigne l'entre de l'utilisateur  la variable.\n\n/E rgle la variable donne  la premire ligne de la sortie de la commande\nsouligne par [chane].\n\n/U modifie la casse de [chane] en majuscules.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nModifie la position des paramtres remplaables dans un fichier batch.\n\nSHIFT [DOWN]\n\nDOWN dplace la fentre d'argument vers le dbut (%%0) ; sinon vers la fin.\n\n.\n\n:TEXT_CMDHELP_TIME#1\nAffiche ou dfinit l'heure du systme.\n\nTIME [/T] [heure]\n\nTapez TIME sans paramtre pour afficher l'heure actuelle et une invite pour\nentrez une nouvelle heure. Appuyez sur ENTRE pour garder l'heure.\n\n/T empche TIME de devenir interactif.\n.\n\n:TEXT_CMDHELP_TRUENAME\nAffiche le nom de chemin complet du chemin spcifi.\n\nTRUENAME [lecteur:][chemin][nom-de-fichier]\n.\n\n:TEXT_CMDHELP_TYPE\nAffiche le contenu d'un fichier texte.\n\nTYPE [lecteur:][chemin]fichier\n.\n\n:TEXT_CMDHELP_VER\nAffiche la version du shell FreeDOS et d'autres informations.\n\nVER [/R] [/W] [/D] [/C]\n\n /R         Montre la version du noyau et d'autres informations.\n /W         Garantie du shell FreeDOS.\n /D         Informations sur la redistribution du shell FreeDOS.\n /C         Contributeurs du shell FreeDOS.\n.\n\n:TEXT_CMDHELP_VERIFY\nIndique au systme de fichiers FreeDOS s'il doit vrifier si vos fichiers sont\ncorrectement crits sur un disque.\n\nVERIFY [ON | OFF]\n\nTapez VERIFY sans paramtre pour afficher l'tat actuel du rglage de VERIFY.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nSi le dbogage est compil dans FreeDOS, cette commande activera ou dsactivera\nla sortie de dbogage, ou vous dira si elle est active ou dsactive.\n\nFDDEBUG [ON | OFF | fichier]\n\nTapez FDDEBUG sans paramtre pour afficher le rglage actuel de sortie de\ndbogage.\nSi un fichier est spcifi toute la sortie de dbogage est fait dans ce\nfichier ; la sortie est ajoute au fichier, s'il existe dj. Les noms\nspciaux \"stdout\" et \"stderr\" peuvent tre utiliss pour rediriger la sortie\nvers la sortie standard ou le flux d'erreurs standard.\n.\n\n:TEXT_CMDHELP_VOL\nAffiche l'tiquette du volume ainsi que le numro de srie, s'ils existent.\n\nVOL [lecteur:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nAffiche une liste des commandes et des fonctions disponibles dans le shell.\n\n?\n?commande [argument]\n\nLa premire variante affiche toutes les commandes et fonctions internes.\nLa seconde demandera s'il faut ou non excuter la commande spcifie comme si\nle mode trace tait actif.\n.\n\n:TEXT_CMDHELP_WHICH\nRecherche et affiche le fichier excutable pour chaque commande spcifie.\n\nWHICH commande...\n.\n\n:TEXT_CMDHELP_MEMORY#1\nAffiche la mmoire interne utilise par FreeCOM en interne.\n\nMEMORY\n\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\nLa destination de COPY ne doit pas contenir des caractres plus ('+').\n.\n\n:TEXT_DELETE_FILE#1%\nEffacement du fichier \"%s\".\n.\n\n:TEXT_ERROR_WRITE_FILE_DISC_FULL#0%\nImpossible d'crire sur le fichier '%s' ;\nle disque serait-il satur ? (%lu octets requis)\n.\n\n# Displayed for BIGcopy(), when copying takes quite a long time.\n# **_NO_END if the input file size is unknown.\n# Both must end in \\r rather than \\n!!\n:TEXT_COPY_COPIED_NO_END#0%\n%luKo/???Ko copis \\r\\\n.\n:TEXT_COPY_COPIED#0%\n%luKo/%luKo copis\\r\\\n.\n\n:TEXT_ERROR_FCOM_IS_DEVICE#0%\nFreeCOM ne peut pas tre un appareil : \"%s\"\n.\n:TEXT_ERROR_FCOM_INVALID#0%\nCe fichier FreeCOM n'est pas valide ou provient d'une version incompatible :\n%s\n.\n\n:TEXT_ERROR_LOADING_STRINGS\nchec du chargement la ressource des chanes dans la mmoire, l'endroit indiqu\ndans %COMSPEC% semble tre invalide. Veuillez spcifier une autre localisation\nde FreeCOM pour tenter de charger les chanes, par exemple :\nC:\\\\COMMAND.COM\nou appuyez simplement sur entre pour annuler le chargement des chanes.\n.\n\n:TEXT_TERMINATING\nArrt maintenant.\n.\n\n:TEXT_HIDDEN_CRITER#0%\n%u requtes d'erreur critique ont t supprimes.\n.\n\n# The exit reasons MUST be kept in this order!\n:TEXT_DISP_EXITCODE#0%\nCode de sortie (ERRORLEVEL) : %u, raison : %u (%s)\n.\n:TEXT_EXIT_REASON_NEG_1\nErreur d'API DOS\\\n.\n:TEXT_EXIT_REASON_0\ntermin normalement\\\n.\n:TEXT_EXIT_REASON_1\ntermin par ^Break\\\n.\n:TEXT_EXIT_REASON_2\ntermin par une erreur critique\\\n.\n:TEXT_EXIT_REASON_3\ndevenu rsident\\\n.\n:TEXT_ERROR_EXE_CORRUPT\nfichier EXE corrompu\\\n.\n"
  },
  {
    "path": "strings/german.err",
    "content": "# $Id$\n#\n# Critical error national customization file\n#\n#\tLanguage: German\n#\tAuthor: Steffen Kaiser (ska-src@gmx.net)\n# \n# The critical error (criter) handler receives some information\n# from the kernel about what error condition happens, generates some\n# human friendly message from it, requests the user's opinion about\n# how to proceed and, finally, returns to the kernel.\n# \n# The human friendly message is generated using one of the following\n# templates:\n# BLOCK_DEVICE (for criters on block devices)\n# \tError %1 drive %A: %2 area: %3\n# -and- CHAR_DEVICE (for criters on character devices)\n# \tError %1 device %A: %3\n# \n# Two-character sequences, which first character is a percent sign '%',\n# are placeholders for other information:\n# %% -> a single percent sign\n# %1 -> either READ or WRITE, depending on what kind of operation\n# \tcaused the criter\n# %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA\n# %3 -> the actual error string; these are the strings associated to\n# \ta number 0 through N, and must correspond to the number passed in\n# \tlowbyte(DI) to the criter handler (see RBIL INT-24 for details)\n# %A -> drive letter (for block devices); name of device (character devices)\n# \n# Below the line describing the error the user is prompted for the action\n# to proceed. This line is dynamically constructed depending on which\n# action are available at all. The full line may look like this:\n# \t(A)bort, (I)gnore, (R)etry, (F)ail?_\n# \n# The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They\n# should indicate which user response keys is associated with them;\n# suggested is to use the first letter and enclose it in parenthesises.\n# The delimiter \", \" can be defined with DELIMITER and is the same\n# for all slots.\n# The \"? \" sequence is defined by QUESTION.\n# The order of the actions is fixed and cannot be customized.\n# \n# With each action a number of user response keys must be associated.\n# They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ...\n# strings. Because the key is searched in the same format as returned\n# by INT-16-00, both upper and lower case must be specified and\n# certain special keys cannot be used.\n# \n# The individual error strings are defined by the #: lines, where\n# the hash sign '#' refers to the number the kernel passes to the\n# criter handler. The UNKNOWN string is displayed for all error\n# numbers not specified.\n#\n# NOTE #1: The percent rule applies to _all_ criter strings!\n# NOTE #2: Each string occupies exactly one line.\n# NOTE #3: Any leading or trailing whitespaces are removed. Prefix the\n#\tfirst or suffix the last whitespace with '%.' (one percent sign and\n#\tone dot). This sequence is removed from the string totally.\n# NOTE #4: To embed any character use: %&## (one percent sign,\n#\t\tone ampersand and exactly two hexa-decimal digits)\n\n## Primary strings\nS2\nBLOCK_DEVICE: Fehler %1 Laufwerk %A: im %2-Bereich: %3\nS3\nCHAR_DEVICE: Fehler %1 Gert %A: %3\n\n## kind of operation\nS0\nREAD: beim Lesen von\nS1\nWRITE: beim Schreiben auf\n\n## kind of failed area of block devices\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: Verzeichnis\nS7\nDATA: Daten\n\n## action strings\nS8\nIGNORE: (I)gnorieren\nS9\nRETRY: (W)iederholen\nS10\nABORT: (A)bbrechen\nS11\nFAIL: (F)ehler\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: iI\nKEYS_RETRY:  wW\nKEYS_ABORT:  aA\nKEYS_FAIL:   fF\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN: Unbekannter Fehler\nS15\n0: Laufwerk ist schreibgeschtzt\n1: Unbekannte Treiberuntereinheit\n2: Gert nicht bereit\n3: Treiber erhielt ein unbekanntes Kommando\n4: Daten- bzw. CRC-Fehler\n5: Inkorrekte Lnge der Treiberkommandostruktur\n6: Positionierungsfehler\n7: Unbekannter Medientyp\n8: Sektor wurde nicht gefunden\n9: Papier zu Ende\n10: Allgemeiner Schreibfehler\n11: Allgemeiner Lesefehler\n12: Allgemeiner Fehler\n13: Verletzung der SHARE-Rechte\n14: Lock-Verletzung\n15: inkorrekter Medienwechsel\n16: Zugriff auf FCB verweigert\n17: berlauf des SHARE-Puffers\n18: unterschiedliche Codepages\n19: Ende der Eingabe erreicht\n20: Laufwerk voll\n"
  },
  {
    "path": "strings/german.lng",
    "content": "# FreeCOM national customization file\n#\n#   Language: German\n#   Codepage: 858 (850 plus Euro currency sign)\n#   Author: Clemens Lser (Cl.Loeser@web.de)\n# Changelog by W. Spiegl (2024-12-21).\n# TEXT_CMDHELP_IF: added /I string==STRING\n# TEXT_CMDHELP_ECHO: added ECHO.\n# TEXT_CMDHELP_SHIFT: removed (%0) \"the beginning (%0); otherwise\" (?).\n# Changelog by W. Spiegl (2024-10-15):\n# \"FOR - Example: replaced %% by %%%%\"\n#   2022-01-19 / 2022-06-01 by W. Spiegl: corrected: line 287, \"Eigabe\", 311 \"ngltig\",\n#   434 \"Speicherpatz\", 439 \"Speicherpaltz\",\n#   1121 \"Dienstrogramm\", 1395 \"richtung\", 1405 \"double space\",\n#   1456 \"Standart\" by W. Spiegl.\n#   modified the line breaks of command, del, dir, erase, history, if,\n#   lh, loadhigh, set and memory (second fixes by W. Spiegl: 2024-10-13)\n#   Added a lot of test: TEXT_ERROR_PERMISSION_DENIED, TEXT_ERROR_NO_SUCH_FILE,\n#   TEXT_ERROR_UNKNOWN_ERROR, TEST_MSG_LFNFOR_STATE, TEST_MSG_LFNFOR_COMPLETE_STATE,\n#   PROMPT_APPEND_FILE, TEXT_SHOWCMD_FEATURE_LONG_FILENAMES, TEXT_CMDHELP_LFNFOR,\n#   TEXT_CMDHELP_SET, TEXT_TERMINATING, TEXT_HIDDEN_CRITER, TEXT_DISP_EXITCODE,\n#   TEXT_EXIT_REASON_NEG1, TEXT_EXIT_REASON_0 till _3, TEXT_ERROR_EXE_CORRUPT\n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retreive the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#   :TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carrage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause an user interaction. Those ones should be in sync\n# with the issued text. To define how to interprete a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#YyNn\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceeding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the question\n# mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readibility of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH#0%\nFalscher Parameter. - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH#0%\nFalscher Parameter. - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION#0%\nUngltige Option: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG#0%\nOption '%s' erfordert keine Parameter.\n.\n\n:TEXT_ERROR_OPT_NOARG#0%\nOption '%s' erfordert einen Parameter.\n.\n\n:TEXT_INVALID_NUMBER#0%\nUngltige Nummer in '%s'.\n.\n\n:TEXT_ERROR_CLOSE_QUOTE#0%\nSchlieendes Anfhrungszeichen fehlt: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nKann temporre Datei nicht erstellen.\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0%\nZu viele Parameter. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nZu viele Parameter.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER#0%\nUngltiger Parameter. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nPfad nicht gefunden.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nDatei nicht gefunden.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND#0%\nDatei nicht gefunden. - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING#0%\nErforderlicher Parameter fehlt.\n.\n\n:TEXT_ERROR_INVALID_DRIVE#0%\nUngltiges Laufwerk %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2%\nBefehl oder Dateiname nicht gefunden. - \"%s\"\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nNicht gengend Speicher.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nZuteilung von DOS-Speicher fehlgeschlagen.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nKann keine Pipe erstellen! Kann temporre Datei nicht ffnen!\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE#0%\nZeile Nr. %ld in Stapeldatei '%s' zu lang.\n.\n\n:TEXT_ERROR_BFILE_VANISHED#0%\nStapeldatei '%s' nicht gefunden.\n.\n\n:TEXT_ERROR_BFILE_LABEL#0%\nStapeldatei '%s' enthlt keine Sprungmarke '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1%\n%s ist fr '%s' fehlgeschlagen.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR#0%\nKann Umgebungsvariable '%s' nicht setzen.\nUmgebung voll?\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND#0%\nUmgebungsvariable '%s' nicht gefunden.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nKeine Umgebung verfgbar.\nMgliche Ursache: Nicht gengend Speicher verfgbar.\nSetzen Sie die Umgebungsgre durch die COMMAND.COM Option '/E'.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1%\nKann Alias '%s' nicht setzen. Aliasspeicher voll?\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1%\nAlias '%s' nicht gefunden.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nKein Aliasspeicher verfgbar.\nMgliche Ursache: Nicht gengend Speicher verfgbar.\n.\n\n:TEXT_ERROR_SYNTAX_STR#0%\nSyntaxfehler. - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nSyntaxfehler.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG#0%\nDateiname zu lang. - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY#0%\nDatei '%s' kann nicht auf sich selbst kopiert werden.\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nBefehlszeile nach Aliaserweiterung zu lang!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nBefehlszeile zu lang. Kann Befehl nicht ausfhren.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1%\nUngltige History-Gre '%s'.\n.\n\n:TEXT_HISTORY_EMPTY#1\nBefehlszeilen-History ist leer.\n.\n\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nUngltige MCB-Kette oder MS-DOS inkompatibles System.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR#0%\nUnbekannter Fehler %d aufgetreten.\n.\n\n:TEXT_ERROR_REGION_WARNING#0%\nUngltiger Speicherbereich %d. Wird ignoriert.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nBitte verwenden Sie /ON oder /OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nUngltige Variablenangabe.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nIN fehlt in der FOR-Anweisung.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nEine oder beide Klammern fehlen.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nDO fehlt in der FOR-Anweisung.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR-Anweisung: Kein Befehl nach DO.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE#0%\nKann Eingabe von Datei '%s' nicht umleiten.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE#0%\nKann Eingabe in Datei '%s' nicht umleiten.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nLeere Umleitung.\n.\n\n:TEXT_ERROR_INVALID_DATE\nUngltiges Datum.\n.\n\n:TEXT_ERROR_INVALID_TIME\nUngltige Zeit.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nGOTO bentigt eine Sprungmarkenangabe.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nDer CTTY-Befehl wurde nicht in diese COMMAND.COM implementiert.\n.\n\n:TEXT_ERROR_NORW_DEVICE#0%\nUngltiges oder kein Lese-/Schreib-Gert '%s'.\n.\n\n:TEXT_ERROR_CTTY_DUP#0%\nnderung der Dateibeschreibung zu TTY '%s' fehlgeschlagen.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\nParameter /L ist noch nicht implementiert.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\nParameter /U ist noch nicht implementiert.\n.\n\n:TEXT_ERROR_WRITING_DEST\nFehler beim Schreiben.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE#0%\nKann Quelle nicht ffnen. - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE#0%\nKann Datei '%s' nicht ffnen.\n.\n\n:TEXT_ERROR_READ_FILE#0%\nKann nicht von Datei '%s' lesen.\n.\n\n:TEXT_ERROR_WRITE_FILE#0%\nKann nicht auf Datei '%s' schreiben.\n.\n\n:TEXT_ERROR_LEADING_PLUS\nDer Verkettungsoperator '+' kann den Parametern nicht voranstehen.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nDer Verkettungsoperator '+' kann den Parametern nicht nachstehen.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nNichts zu tun.\n.\n\n:TEXT_ERROR_COPY\nCOPY fehlgeschlagen.\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: Dateiname fehlt.\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: Nummer fehlt.\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: Ungltige Nummer.\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: Befehl fehlt.\n.\n\n:TEXT_NOT_IMPLEMENTED_YET\nNoch nicht implementiert.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nFehler beim Laden der Sprachnachrichten.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nDie /MSG Option wurde in dieser COMMAND.COM deaktiviert.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1\n%u Elemente angezeigt.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nEin interner Fehler ist aufgetreten. Dies hat mit dem System zu tun\nauf dem COMMAND.COM luft. Bitte melden Sie diesen Fehler.\n.\n\n:TEXT_QUOTED_C_OR_K#1\nDie Optionen /C und /K knnen nicht quotiert werden.\nOptionen werden ignoriert.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1%\nDer Pfad zur COMMAND.COM muss vollstndig angegeben werden.\nDas heit mit Laufwerksbuchstabe und fhrendem Backslash.\nZum Beispiel: C:\\\\FREEDOS\n\nCOMMAND.COM geht von folgendem Pfad aus:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nDie Sitzungsinformationen konnten nicht wiederhergestellt werden.\nAlle lokalen Einstellungen sind verloren.\nHinweise auf die Ursache dieses Problems entnehmen Sie bitte\nden vorangegangenen Fehlermeldungen.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nDie aktuellen Informationen konnten whrend des Programmaufrufs\nnicht gesichert werden.\nHinweise auf die Ursache dieses Problems entnehmen Sie bitte\nden vorangegangenen Fehlermeldungen.\n.\n\n:TEXT_ERROR_CWD_FAILED#1%\nLaufwerk %c: Keine Antwort oder interner Speicherfehler.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nTausch fehlgeschlagen: Aliase reservieren zu viel Speicher.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nTausch fehlgeschlagen: Kann keinen weiteren Speicherplatz\nreservieren.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nKein weiterer Aliasspeicherplatz verfgbar.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1%\nAlias '%s' unbekannt.\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nEinfgen des Alias fehlgeschlagen.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1%\nAliasname '%s' ungltig.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nKontextmodul der Ausnahmefehlerroutine kann nicht geladen werden.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nKein weiterer Kontextspeicher verfgbar.\nFalls dieser Fehler weiterhin auftritt ziehen Sie bitte in Erwgung\ndie internen Puffer wie z.B. History, Dateiverzeichnis oder\nStack zu vergrern.\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1\nDie Gesamtkontextgre %lu Bytes berschreitet\ndie Maximalgrenze. Der Kontext wird auf %u Bytes reduziert.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nDas Einfgen von Statusinformationen in den Kontext ist\nfehlgeschlagen. Dieser Fehler kann auf Speicherfehler oder\neine falsch bestimmte Minimalgre des Kontexts hindeuten.\nBitte benachrichtigen Sie die Verantwortlichen von FreeCOM:\nfreedos-devel@lists.sourceforge.net\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nDer Kontext ging beim Tauschen verloren. Der Kontext wird\nneu erstellt, aber alle Aliase etc. sind verloren.\n.\n\n:TEXT_ERROR_PERMISSION_DENIED#1%\n%s: Erlaubnis verweigert.\n.\n\n:TEXT_ERROR_NO_SUCH_FILE#1%\n%s: Datei oder Verzeichnis existiert nicht.\n.\n\n:TEXT_ERROR_UNKNOWN_ERROR#1%\n%s: Unbekannter Fehler.\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nDrcken Sie eine beliebige Taste, um fortzufahren...\\\n.\n\n:TEXT_MSG_HISTORY_SIZE#0%\nDie Gre der History betrgt %d Bytes.\n.\n\n:TEXT_MSG_DOSKEY\nDie DOSKey Fhigkeiten sind bereits in der Shell freigegeben.\n.\n\n:TEXT_MSG_ECHO_STATE#0%\nECHO ist %s\n.\n\n:TEXT_MSG_VERIFY_STATE#0%\nVERIFY ist %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE#0%\nDEBUG-Ausgabe ist %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET#0%\nDEBUG-Ausgabe wird nach '%s' geleitet.\n.\n\n:TEXT_MSG_BREAK_STATE#0%\nBREAK ist %s\n.\n\n:TEXT_MSG_LFNFOR_STATE#0%\nLFNFOR ist %s\n.\n\n:TEXT_MSG_LFNFOR_COMPLETE_STATE#0%\nLFN Complete ist %s\n.\n\n:TEXT_MSG_CURRENT_DATE#0%\nAktuelles Datum ist %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1%\nGeben Sie ein neues Datum (mm%sdd%s[cc]yy) ein: \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1%\nGeben Sie ein neues Datum (dd%smm%s[cc]yy) ein: \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1%\nGeben Sie ein neues Datum ([cc]yy%smm%sdd) ein: \\\n.\n\n:TEXT_MSG_CURRENT_TIME#0%\nAktuelle Zeit ist %s.\n.\n\n:TEXT_STRING_PM#1\n PM\\\n.\n:TEXT_STRING_AM#1\n AM\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nGeben Sie die neue Zeit ein: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING#0%\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1%\nJjNn{CR}{LF}{CBREAK}\naabb   b   b       b\nAlle Dateien in '%s' werden gelscht!\nMchten Sie fortfahren (J/N) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nJjNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [Ja=ENTER, Nein=ESC] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be\n# prefixed by \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1%\nJjNnAaQq{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\nSteuerung+Pause gedrckt.\\r\nVerarbeitung der Stapeldatei '%s' abbrechen (Ja/Nein/Alle) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1%\nJjNnAaSs{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\n'%s' berschreiben (Ja/Nein/Alle/Stoppen) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_APPEND_FILE#1%\nJjNnAaSs{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nAnwenden auf '%s' (Ja/Nein/Alle/Stoppen) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1%\nJjNnAaSs{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\n'%s' lschen (Ja/Nein/Alle/Stoppen) ? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<unbekannt>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nDateiverzeichnis-Stack ist leer.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1%\n Volumen in Laufwerk %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING#0%\nist %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nhat keine Bezeichnung\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER#0%\n Volumen-Seriennummer ist %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1%\n%10s Datei(en)\\\n.\n:TEXT_DIR_FTR_BYTES#0%\n   %12s Bytes\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nGesamtanzahl der aufgelisteten Dateien:\n.\n:TEXT_DIR_FTR_DIRS#1%\n%10s Verzeichnis(se)\\\n.\n:TEXT_DIR_FTR_BYTES_FREE#0%\n %15s Bytes frei\n.\n:TEXT_DIR_DIRECTORY#0%\nVerzeichnis von %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE#0%\n Verzeichnis von %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1%\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE#1%\n%-13s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1%\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1%\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <DIR> \\\n.\n:TEXT_DIR_LINE_SIZE#1%\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1%\n%-14s\\\n.\n\n:TEXT_MSG_PATH#0%\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nKein Suchpfad angegeben.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nSo\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nMo\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nDi\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nMi\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\nDo\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\nFr\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nSa\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\nkeine Datei entfernt.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\neine Datei entfernt.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1%\n%u Dateien entfernt.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nVerfgbare interne Befehle:\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\nVerfgbare Befehle:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[Aliase] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[erweiterte Eingabe] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[History] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[Dateinamenergnzung] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[Tauschen (Swapping)] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[Protokollierung starten] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[vorheriges Verzeichnis] \\\n.\n:TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1\n[lange Dateinamen] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[Kernel Tausch (Swap)] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[XMS Tausch (Swap)] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[Swap als Voreinstelung] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[installierbare Befehle] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[Dateiverzeichnis-Stack (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[FreeCOM Fehlersuche (Debug)] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nDrcken Sie F8 fr den Einzelschritt-Modus,\noder F5 um %s zu bergehen... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0%\nbergehe '%s'.\n.\n\n:TEXT_MSG_VER_DOS_VERSION#0%\nDOS Version %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nFreeDOS Kernel (build 1933 oder frher)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS#0%\nFreeDOS Kernel Version %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\nCopyright (C) 1994-2001 Tim Norman und andere.\n\nDieses Programm wird in der Hoffnung vertrieben, dass es ntzlich ist,\njedoch OHNE JEGLICHE GEWHR; ohne auch nur die implizierte\nGewhr der MARKTGNGIGKEIT oder TAUGLICHKEIT FR EINEN\nBESTIMMTEN ZWECK. Bitte lesen Sie die GNU General Public License\nfr nhere Informationen hierzu.\n\nBitte senden Sie Fehlerberichte an freedos-devel@lists.sourceforge.net.\nUpdates sind unter http://freedos.sourceforge.net/freecom erhltlich.\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\nCopyright (C) 1994-2001 Tim Norman und andere.\n\nDieses Programm ist freie Software. Sie knnen es unter den\nBedingungen der GNU General Public License, wie von der\nFree Software Foundation verffentlicht, weitergeben und/oder\nmodifizieren, entweder gem Version 2 der Lizenz oder (nach\nIhrer Option) jeder spteren Version.\n\nBitte senden Sie Fehlerberichte an freedos-devel@lists.sourceforge.net.\nUpdates sind unter http://freedos.sourceforge.net/freecom erhltlich.\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\nDie FreeDOS Command Shell wurde von vielen Entwicklern entwickelt,\nfr nhere Informationen greifen Sie bitte auf die Datei\nHISTORY.TXT zurck.\n\nBitte senden Sie Fehlerberichte an freedos-devel@lists.sourceforge.net.\nUpdates sind unter http://freedos.sourceforge.net/freecom erhltlich.\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nDie Shell ist dabei, beendet zu werden, obwohl unerlaubt\\r\n(blicherweise durch das Aktivieren der /P Option).\\r\nSie mssen Ihr System neustarten oder beenden Sie, falls\\r\ndiese Shell in einer Multitasking-Umgebung luft, diesen\\r\nProzess manuell.\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nAusfhrbare FreeCOM Datei nicht gefunden.\nSie mssen den vollen Pfad zur COMMAND.COM als ersten\nParameter von COMMAND angeben, z.B. C:\\\\FREEDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1%\nUmgebungs-Segment    : max %5u Bytes; frei %5u Bytes\n.\n:TEXT_MEMORY_CONTEXT#1%\nKontext-Segment      : max %5u Bytes; frei %5u Bytes\n.\n:TEXT_MEMORY_HEAP#1%\nHeap                 : frei %5lu Bytes\n.\n:TEXT_MEMORY_CTXT_ALIAS#1%\n\\tAliase       : Grenze %5u Bytes, momentan %5u Bytes, %5u Elemente\n.\n:TEXT_MEMORY_CTXT_HISTORY#1%\n\\tHistory      : Grenze %5u Bytes, momentan %5u Bytes, %5u Elemente\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1%\n\\tDateivz-Stack: Grenze %5u Bytes, momentan %5u Bytes, %5u Elemente\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1%\n\\tVorheriger-Verz-Cache : gebraucht  %5u Bytes, %5u Elemente\n.\n:TEXT_MEMORY_CTXT_BATCH#1%\n\\tStapel-Verschachtelung: gebraucht  %5u Bytes, %5u Elemente\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1%\n\\tSwapinfo              : gebraucht  %5u Bytes, %5u Elemente\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nAnlegen der aktuellen Codepage durch das System fehlgeschlagen.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nnderung der aktuellen Codepage fehlgeschlagen.\n.\n:TEXT_DISPLAY_CODEPAGE#1%\nAktuelle Codepage ist %u.\nDie richtige System-Codepage ist %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nZeigt an, setzt oder entfernt Aliase.\n\nALIAS [Variable[=][Zeichenkette]]\n\n  Variable     Spezifiziert den Aliasnamen.\n  Zeichenkette Spezifiziert eine Reihe von Zeichen,\n               die dem Alias zugeordnet werden.\n\n\nGeben Sie ALIAS ohne Parameter ein, um die aktuellen\nAliase anzuzeigen.\n.\n\n:TEXT_CMDHELP_BEEP\nBeep-Ton ausgeben.\n.\n\n:TEXT_CMDHELP_BREAK\nSetzt oder lscht die erweiterte STRG+C berprfung.\n\nBREAK [ON | OFF]\n\nGeben Sie BREAK ohne Parameter ein, um die aktuelle\nBREAK Einstellung anzuzeigen.\n.\n\n:TEXT_CMDHELP_CALL#1\nRuft ein Stapelverarbeitungsprogramm von einem anderen aus auf.\n\nCALL [/S | /N] [/Y] [Laufwerk:][Pfad]Dateiname [Stapeldatei-Parameter]\n\n  Stapeldatei-Parameter   Spezifiziert alle vom Stapelprogramm bentigten\n                          Befehlszeilen-Informationen.\n  /S erzwingt, /N verweigert das Swappen von FreeCOM.\n  /Y aktiviert den Einzelschritt-Modus whrend der Ausfhrung des Befehls.\n.\n\n:TEXT_CMDHELP_CD\nZeigt den Namen oder wechselt das aktuelle Verzeichnis.\n\nCHDIR [Laufwerk:][Pfad]\nCHDIR[..]\nCD [Laufwerk:][Pfad]\nCD[..]\nCD -\n\n  ..   Spezifiziert, dass Sie zum bergeordneten Verzeichnis wechseln mchten.\n  -    Falls das \"vorheriges Verzeichnis\"-Feature aktiviert ist, Wechsel zum\n       vorherigen Verzeichnis.\n\nGeben Sie CD Laufwerk: ein, um das aktuelle Verzeichnis des angegebenen\nLaufwerks anzuzeigen.\nGeben Sie CD ohne Parameter ein, um das aktuelle Laufwerk und Verzeichnis\nanzuzeigen.\nSiehe auch: CDD\n.\n\n:TEXT_CMDHELP_CDD\nZeigt den Namen oder wechselt das aktuelle Verzeichnis und Laufwerk.\n\nCDD [Laufwerk:][Pfad]\nCDD[..]\n\n  ..   Spezifiziert, dass Sie zum bergeordneten Verzeichnis wechseln mchten.\n  -    Falls das \"vorheriges Verzeichnis\"-Feature aktiviert ist, Wechsel zum\n       vorherigen Verzeichnis.\n\nFalls Laufwerk: angegeben ist, wird das aktuelle Arbeitslaufwerk gewechselt;\ndies ist der einzige Unterschied zu \"CHDIR\".\nGeben Sie CDD ohne Parameter ein, um das aktuelle Laufwerk und Verzeichnis\nanzuzeigen.\n.\n\n:TEXT_CMDHELP_CHCP\nZeigt oder setzt die Nummer der aktiven Codepage.\n\nCHCP [nnn]\n\n  nnn   Spezifiziert eine Codepage-Nummer.\n\nGeben Sie CHCP ohne Parameter ein, um die Nummer der aktiven Codepage\nanzuzeigen.\n.\n\n:TEXT_CMDHELP_CLS\nLscht den Bildschirm.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\nStartet eine neue Instanz der FreeDOS Command Shell.\nCOMMAND [[Laufwerk:]Pfad] [Gert] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG]\n        [/LOW] [/Y [/[C|K] Befehl]]\n  [Laufwerk:]Pfad\n               Spezifiziert das Verzeichnis, das die COMMAND.COM enthlt.\n  Gert        Spezifiziert das fr die Befehls - Ein- und Ausgabe zu\n               benutzende Gert.\n  /E:nnnnn     Setzt die anfngiche Umgebungsgre auf nnnnn Bytes.\n               (nnnnn sollte eine Zahl zwischen 256 und 32.768 sein.)\n  /L:nnnn      Spezifiziert die Gre der internen Puffer (braucht /P).\n               (nnnn sollte eine Zahl zwischen 128 und 1.024 sein.)\n  /U:nnn       Spezifiziert die Eingabepuffergre (erfordert ebenso /P).\n               (nnn sollte eine Zahl zwischen 128 und 255 sein.)\n  /P           Richtet die neue Command Shell Instanz dauerhaft ein\n               (kann nicht beendet werden).\n  /MSG         Speichert alle Fehlermeldungen im Speicher (braucht /P).\n  /LOW         Zwingt Command Shell, bleibende Daten im LoMem zu speichern.\n  /Y           Arbeitet schrittweise die durch /C oder /K spezifizierten\n               Stapelverarbeitungsdateien ab.\n  /C Befehl    Fhrt den spezifizierten Befehl aus und kehrt zurck.\n  /K Befehl    Fhrt den spezifizierten Befehl aus und luft weiter.\n.\n\n:TEXT_CMDHELP_COPY\nKopiert eine oder mehrere Dateien an einen anderen Ort.\n\nCOPY [/A | /B] Quelle [/A | /B] [+ Quelle [/A | /B] [+ ...]] [Ziel [/A | /B]]\n     [/V] [/Y | /-Y]\n\n  Quelle  Spezifiziert die zu kopierende(n) Datei(en).\n  /A      Gibt an, dass es sich um eine ASCII Textdatei handelt.\n  /B      Gibt an, dass es sich um eine Binrdatei handelt.\n  Ziel    Spezifiziert das Verzeichnis und/oder den Dateinamen fr\n          die neue(n) Datei(en).\n  /V      Verifiziert, dass neue Dateien korrekt geschrieben werden.\n  /Y      Unterdrckt Besttigungsabfragen fr das berschreiben bereits\n          existierender Zieldateien.\n  /-Y     Bewirkt, dass das berschreiben bereits existierender\n          Zieldateien besttigt werden muss.\n\nDie /Y Option kann in der COPYCMD Umgebungsvariable voreingestellt sein.\nDies kann mit /-Y in der Befehlszeile bergangen werden.\n\nUm Dateien hinzuzufgen geben Sie eine einzelne Datei als Ziel und\nmehrere Dateien als Quelle ein. Benutzen Sie hierzu Wildcards oder\ndas Format Datei1+Datei2+Datei3.\n.\n\n:TEXT_CMDHELP_CTTY\nWechselt das Terminalgert, das zur Steuerung Ihres Systems verwendet wird.\n\nCTTY Gert\n\n  Gert   Das Terminalgert das Sie verwenden mchten, z.B. COM1.\n.\n\n:TEXT_CMDHELP_DATE#1\nZeigt oder setzt das Datum.\n\nDATE [/D] [Datum]\n\nGeben Sie DATE ohne Parameter ein, um die aktuelle Datumseinstellung und\ndie Abfrage fr eine neue anzuzeigen.  Drcken Sie ENTER, um das Datum\nbeizubehalten.\n\n/D verhindert, dass DATE interaktiv wird.\n.\n\n:TEXT_CMDHELP_DEL#2\nLscht eine oder mehrere Dateien.\n\nDEL [Laufwerk:][Pfad]Dateiname [/P] [/V]\nERASE [Laufwerk:][Pfad]Dateiname [/P] [/V]\n\n  [Laufwerk:][Pfad]Dateiname\n                   Spezifiziert die zu lschende(n) Datei(en).\n                   Benutzen Sie Wildcards, um mehrere Dateien anzugeben.\n  /P               Fragt fr jede zu lschende Datei nach Besttigung.\n  /V               Zeigt alle gelschten Dateien an.\n.\n\n:TEXT_CMDHELP_DIR#4\nZeigt eine Liste von Dateien und Unterverzeichnissen in einem Verzeichnis an.\n\nDIR [Laufwerk:][Pfad][Dateiname] [/P] [/W] [/A[[:]Attribute]]\n    [/O[[:]Reihenfolge]] [/S] [/B] [/L]\n\n  [Laufwerk:][Pfad][Dateiname]\n               Spezifiziert Laufwerk, Verzeichnis, und/oder aufzulistende\n               Dateien. (Knnen sowohl erweiterte als auch mehrere Datei-\n               spezifikationen sein.)\n  /P           Legt nach jedem vollstndigen Ausfllen des Bildschirms mit\n               Informationen eine Pause ein.\n  /W           Benutzt das ausfhrliche Listenformat.\n  /A           Zeigt nur Dateien mit den spezifizierten Attributen an.\n               (Grundeinstellung ist /ADHSRA)\n  Attribute    D  Verzeichnisse (Directories)\n               R  Schreibgeschtzte Dateien (Read-only)\n               H  Versteckte Dateien (Hidden)\n               A  Zur Archivierung bereite Dateien\n               S  Systemdateien\n               -  (Das Prefix invertiert die jeweilige Bedeutung)\n  /O           Listet Dateien in (Sortier-)Reihenfolge auf.\n  Reihenfolge  N  Nach Name (alphabetisch)\n               S  Nach Gre (Size) (kleinste zuerst)\n               E  Nach Erweiterung (alphabetisch)\n               D  Nach Datum und Zeit (lteste zuerst)\n               G  Verzeichnisse zuerst\n               -  (Das Prefix kehrt die Reihenfolge um)\n               U  Unsortiert\n               (Grundeinstelung ist /ONG)\n  /S           Zeigt Dateien im spezifizierten Verzeichnis und allen\n               Unterverzeichnissen an.\n  /B           Benutzt das knappe Format (ohne Kopftext und Zusammenfasung).\n  /L           Benutzt Kleinbuchstaben.\n  /Y or /4     Zeigt vierstellige Jahreszahlen an.\n\nEinstellungen knnen in der DIRCMD Umgebungsvariable gespeichert werden.\nGrundeinstellungen knnen durch das Voranstellen eines - (Bindestrich)\nbergangen werden; z.B. /-W.\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nDas externe DOSKey Dienstprogramm wurde in FreeCOM eingebunden.\nBenutzen Sie die Pfeiltasten HOCH und RUNTER, um die Befehls-History\nabzurufen und durch HISTORY anzeigen zu lassen.\nBenutzen Sie LINKS und RECHTS und die ENDE und POS1 Tasten, um innerhalb\nder Befehlszeile zu navigieren und schalten Sie mit der EINFG-Taste\nzwischen dem berschreibe- und Einfge-Modus hin und her.\nBenutzen Sie die Tabulatortaste, um das aktuelle Wort als Dateinamen zu\nvervollstndigen; drcken Sie sie zweimal, um alle mglichen Treffer\nanzuzeigen.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nEditiert die Befehlszeile, ruft Befehlseingaben ab und erstellt Makros.\n\nDOSKEY [/Switch ...] [Makroname=[Text]]\n\n  /BUFSIZE:Gre  Legt die Gre des Makro- und Befehlspuffers fest\n                  (Voreinstellung: 512)\n  /ECHO:on|off    Aktiviert/deaktiviert das Echo fr Makroerweiterungen\n                  (Voreinstellung: on)\n  /FILE:Datei     Spezifiziert eine Datei, die eine Liste mit Makros\n                  enthlt\n  /HISTORY        Zeigt alle im Speicher abgelegten Befehle an\n  /INSERT         Fgt neu getippte Buchstaben in die Zeile ein\n  /KEYSIZE:Gre  Legt die Gre des Tastatur-vortipp-Puffers fest\n                  (Voreinstellung: 15)\n  /LINE:Gre     Legt die Gre des Zeileneditionspuffers fest\n                  (Voreinstellung: 128)\n  /MACROS         Zeigt alle DOSKey Makros an\n  /OVERSTRIKE     berschreibt Buchstaben in der Zeile mit neu getippten\n                  Buchstaben (Voreinstellung)\n  /REINSTALL      Richtet eine neue Instanz von DOSKey ein\n  Makroname       Spezifiziert den Namen des Makros den Sie erstellen\n  Text            Spezifiziert Befehle, die Sie dem Makro zuweisen mchten\n\n   HOCH, RUNTER   Ruft Befehle ab\n            Esc   Lscht den aktuellen Befehl\n             F7   Zeigt die Befehls-History an\n         Alt+F7   Lscht die Befehls-History\n [Buchstaben]F8   Sucht nach Befehlen, die mit [Buchstaben] beginnen\n             F9   Whlt einen Befehl durch seine Nummer aus\n        Alt+F10   Lscht Makrodefinitionen\n\nDie folgenden Spezialcodes knnen Sie in DOSKey Makrodefinitionen nutzen:\n  $T     Befehlstrennzeichen: ermglicht mehrere Befehle in einem Makro\n  $1-$9  Stapelparameter: gleichbedeutend mit %1-%9 in Stapelprogrammen\n  $*     Symbol wird durch alles, was in der Befehlszeile auf den\n         Makronamen folgt, ersetzt.\n.\n\n:TEXT_CMDHELP_ECHO\nZeigt Nachrichten an oder schaltet das Befehls-Echoing an oder aus.\n\n  ECHO [ON | OFF]\n  ECHO [Nachricht]\n  ECHO.\n\nECHO. Zeigt eine leere Zeile (nur in Batch-Dateien)\nGeben Sie ECHO ohne Parameter ein, um die aktuelle Echoeinstellung\nanzuzeigen.\n.\n\n:TEXT_CMDHELP_EXIT\nBeendet die FreeDOS Command Shell.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\nFhrt einen spezifizierten Befehl fr jede Datei eines Dateisatzes aus.\n\nFOR %%Variable IN (Dateisatz) DO Befehl [Befehlsparameter]\n\n  %%Variable    Spezifiziert einen ersetzbaren Parameter.\n  (Dateisatz)  Spezifiziert einen Satz aus einer oder mehreren Dateien.\n               Wildcards knnen benutzt werden.\n  Befehl       Spezifiziert einen auf jede Datei anzuwendenden Befehl.\n  Befehlsparameter\n               Spezifiziert Parameter oder Switches fr den angegebenen Befehl.\n\nUm den FOR-Befehl in einem Stapelprogramm zu benutzen, geben Sie %%%%Variable\nanstelle von %%Variable an.\nZum Beispiel:\n  FOR %%%%f IN (---Start--- a*.* ---Ende---) DO ECHO - %%%%f -\n.\n\n:TEXT_CMDHELP_GOTO\nSetzt den Befehlszeileninterpreter auf eine Sprungmarke in einem\nStapelverarbeitungsprogramm.\n\nGOTO Sprungmarke\n\n  Sprungmarke  Spezifiziert eine Zeichenkette, die in einem Stapelprogramm\n               als Sprungmarke verwendet wird.\n\nGeben Sie in eine extra Zeile einen Doppelpunkt gefolgt von der Sprungmarke\nein.\n.\n\n:TEXT_CMDHELP_HISTORY#1\nHistory-Befehl.\n\nHISTORY [Gre]\n\nOhne \"Gre\" wird der aktuelle Inhalt des Befehlszeilen-History-Puffers an-\ngezeigt. Bei Angabe einer Gre wird die Gre des History-Puffers gendert.\n.\n\n:TEXT_CMDHELP_IF\nBewirkt bedingungsabhngige Verarbeitung in einem Stapelprogramm.\n\nIF [NOT] ERRORLEVEL Nummer Befehl\nIF [NOT] Zeichenkette1==Zeichenkette2 Befehl\nIF [NOT] EXIST Dateiname Befehl\n/I string==STRING\n\n  NOT                 Gibt an, dass der Interpreter den Befehl nur dann\n                      ausfhren soll, wenn die Bedingung nicht zutrifft.\n  ERRORLEVEL Nummer   Ergibt eine wahre Bedingung, falls das zuletzt ausge-\n                      fhrte Programm einen Ausgangscode zurckgegeben hat,\n                      der gleich oder grer als die spezifizierte Nummer ist\n  Befehl              Spezifiziert den bei zutreffender Bedingung auszu-\n                      fhrenden Befehl.\n  Zeichenkette1==Zeichenkette2\n                      Ergibt eine wahre Bedingung, falls die spezifizierten\n                      Zeichenketten bereinstimmen.\n  EXIST Dateiname     Ergibt eine wahre Bedingung, falls die spezifizierte\n                      Datei existiert.\n  /I string==STRING  Ignoriert Gro-/Kleinschreibung\n.\n\n:TEXT_CMDHELP_LFNFOR\nErmglicht/deaktiviert lange Dateinamen beim FOR Befehl oder bei der\nDateinamenvervollstndigung mit \"TAB\".\n\nLFNFOR [ON | OFF]\nLFNFOR COMPLETE [ON | OFF]\n\nGeben Sie LFNFOR oder LFNFOR COMPLETE ohne Parameter ein um die aktuelle\nLFNFOR Einstellung anzuzeigen.\n.\n\n:TEXT_CMDHELP_LH\nLdt ein Programm in den hheren Speicherbereich.\n\nLOADHIGH [Laufwerk:][Pfad]Dateiname [Parameter]\nLOADHIGH [/L:Region1[,minGre1][;Region2[,minGre2]...] [/S]]\n         [Laufwerk:][Pfad]Dateiname [Parameter]\n\n/L:Region1[,minGre1][;Region2[,minGre2]]...\n          Spezifiziert die Speicherregionen, in die das Programm geladen\n          werden soll.  Region1 spezifiziert die Nummer der ersten\n          Speicherregion; minGre1 spezifiziert, falls vorhanden, die\n          minimale Gre fr Region1. Region2 und minGre2 spezifizieren,\n          falls erforderlich, Nummer und minimale Gre fr die zweite\n          Region. Sie knnen beliebig viele Regionen spezifizieren.\n\n/S        Schrumpft ein UMB auf seine Minimalgre whrend das Programm\n          geladen wird.\n\n[Laufwerk:][Pfad]Dateiname\n          Spezifiziert Pfad und Namen des zu ladenden Programms.\n.\n\n:TEXT_CMDHELP_LOADFIX\nLdt ein Programm nach den ersten 64K des Speichers und fhrt es aus.\n\nLOADFIX [Laufwerk:][Pfad]Dateiname\n\nBenutzen Sie LOADFIX um ein Programm zu laden, wenn Ihnen beim Versuch, es\nim LoMem zu laden, die Nachricht \"Packed file corrupt\" (Gepackte Datei\nbeschdigt) angezeigt wurde.\n.\n\n:TEXT_CMDHELP_MD\nErstellt ein Verzeichnis.\n\nMKDIR [Laufwerk:]Pfad\nMD [Laufwerk:]Pfad\n.\n\n:TEXT_CMDHELP_PATH\nZeigt oder setzt einen Suchpfad fr ausfhrbare Dateien.\n\nPATH [[Laufwerk:]Pfad[;...]]\nPATH ;\n\nGeben Sie PATH ; ein, um alle Suchpfadeinstelungen zu lschen und die\nCommand Shell lediglich im jeweils aktuellen Verzeichnis suchen zu lassen.\nGeben Sie PATH ohne Parameter ein, um die aktuelle Suchpfadeinstellung\nanzuzeigen.\n.\n\n:TEXT_CMDHELP_PAUSE\nUnterbricht die Verarbeitung eines Stapelprogramms und zeigt die\nNachricht \"Drcken Sie eine beliebige Taste, um fortzufahren...\"\noder eine optional spezifizierte Nachricht an.\n\nPAUSE [Nachricht]\n.\n\n:TEXT_CMDHELP_PROMPT\nndert das Erscheinungsbild der Eingabeaufforderung.\n\nPROMPT [Text]\n\n  Text  Spezifiziert eine neue Eingabeaufforderung.\n\nDie Eingabeaufforderung kann aus normalen Zeichen sowie den folgenden\nSpezialcodes bestehen:\n  $Q   = (Gleichheitszeichen)\n  $$   $ (Dollarzeichen)\n  $T   Aktuelle Zeit\n  $D   Aktuelles Datum\n  $P   Aktuelles Laufwerk und Pfad\n  $V   Die FreeDOS Command Shell Versionsnummer\n  $N   Aktuelles Laufwerk\n  $G   > (grer-als-Zeichen)\n  $L   < (kleiner-als-Zeichen)\n  $B   | (Pipe)\n  $H   Backspace (lscht das vorangehende Zeichen)\n  $E   Escape Code (ASCII Code 27)\n  $_   Wagenrcklauf und neue Zeile (CrLf)\n\nGeben Sie PROMPT ohne Parameter ein, um die Eingabeaufforderung auf\nGrundeinstellung zurckzusetzen.\n.\n\n:TEXT_CMDHELP_PUSHD\nLegt das aktuelle Verzeichnis mit der Option, das aktuelle Arbeitsverzeichnis\nzu wechseln, im Dateiverzeichnis-Stack ab.\n\nPUSHD [[Laufwerk:]Pfad]\n  Wobei [Laufwerk:]Pfad der Pfad ist, zu dem Sie wechseln mchten.\n.\n\n:TEXT_CMDHELP_POPD\nHolt ein Verzeichnis vom Dateiverzeichnis-Stack und wechselt zu ihm.\n\nPOPD [*]\n  Der '*' Parameter leert den Dateiverzeichnis-Stack.\n.\n\n:TEXT_CMDHELP_DIRS\nZeigt den Inhalt des Dateiverzeichnis-Stacks an.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\nLscht ein Verzeichnis.\n\nRMDIR [Laufwerk:]Pfad\nRD [Laufwerk:]Pfad\n.\n\n:TEXT_CMDHELP_REM\nWeist Kommentare (Remarks) in einer Stapeldatei oder in CONFIG.SYS aus.\n\nREM [Kommentar]\n.\n\n:TEXT_CMDHELP_REN\nBenennt eine oder mehrere Datei(en)/Verzeichnis(se) um.\n\nRENAME [Laufwerk:][Pfad][Verzeichnisname1 | Dateiname1]\n       [Verzeichnisname2 | Dateiname2]\nREN [Laufwerk:][Pfad][Verzeichnisname1 | Dateiname1]\n    [Verzeichnisname2 | Dateiname2]\n\nBitte beachten Sie, dass Sie weder ein neues Laufwerk noch einen neuen Pfad\nals Zielelement spezifizieren knnen. Benutzen Sie hierzu den MOVE-Befehl.\n.\n\n:TEXT_CMDHELP_SET#1\nZeigt, setzt oder lscht Umgebungsvariablen.\n\nSET [/C] [/P] [/E] [/U] [Variable[=[Zeichenkette]]]]\n\n  Variable      Spezifiziert den Namen der Umgebungsvariable.\n  Zeichenkette  Spezifiziert eine Zeichenkette, die der Variable\n                zugewiesen werden soll.\n*   Falls keine Zeichenkette spezifiziert wird, wird die Variable aus der\n    Umgebung gelscht.\n    Geben Sie SET ohne Parameter ein, um die aktuellen Umgebungsvariablen\n    anzuzeigen. Geben Sie SET VAR ein, um den Wert von VAR anzuzeigen.\n/C  Erzwingt die Einhaltung der Gro-/Kleinschreibung der Variable; die\n    Voreinstellung ist, die Variable in Grobuchstaben zu bernehmen,\n    falls sie nicht bereits in der Umgebung vorhanden ist. Andernfalls\n    wird die Gro-/Kleinschreibung beibehalten.\n/P  Fragt Benutzer nach einer Zeichenkette und weist die Benutzereingabe\n    der Variablen zu.\n/E  Es wird ein Befehl ausgefhrt und die erste Zeile der Ausgabe \n    des Befehls wird in einer Variablen gespeichert.\n/U  Wandelt den Wert einer Variablen in Grobuchstaben um.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nndert die Position ersetzbarer Parameter einer Stapeldatei.\n\nSHIFT [RUNTER]\n\nRUNTER verschiebt das Argumentfenster Richtung Anfang (%%0); anderenfalls\nin Richtung Ende.\n.\n\n:TEXT_CMDHELP_TIME#1\nZeigt oder setzt die Systemzeit.\n\nTIME [/T] [Zeit]\n\nGeben Sie TIME ohne Parameter ein, um die aktuelle Zeiteinstellung anzu-\nzeigen und nach der neuen Einstellung zu fragen. Drcken Sie ENTER, um\ndie Zeit beizubehalten.\n\n/T verhindert, dass TIME interaktiv wird.\n.\n\n:TEXT_CMDHELP_TRUENAME\nZeigt den vollen Pfadnamen des angegebenen Pfades an.\n\nTRUENAME [Laufwerk:][Pfad][Dateiname]\n.\n\n:TEXT_CMDHELP_TYPE\nZeigt den Inhalt von Textdateien an.\n\nTYPE [Laufwerk:][Pfad]Dateiname\n.\n\n:TEXT_CMDHELP_VER\nZeigt die Versionsnummer und andere Informationen ber die FreeDOS\nCommand Shell an.\n\nVER [/R] [/W] [/D] [/C]\n\n  /R        Zeigt die Kernelversion und weitere Informationen.\n  /W        FreeDOS Command Shell Gewhrleistung.\n  /D        FreeDOS Command Shell Weitergabeinformationen.\n  /C        FreeDOS Command Shell Beteiligte.\n.\n\n:TEXT_CMDHELP_VERIFY\nLegt fest, ob das FreeDOS Dateisystem verifizieren soll, dass Dateien\nerfolgreich abgelegt wurden.\n\nVERIFY [ON | OFF]\n\nGeben Sie VERIFY ohne Parameter ein, um die aktuelle VERIFY Einstellung\nanzuzeigen.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nFalls FreeDOS mit Fehlersuche (Debugging) kompiliert wurde, schaltet\ndieser Befehl die Ausgabe von Fehlerinformationen ein oder aus oder\ngibt die aktuelle Einstellung an.\n\nFDDEBUG [ON | OFF | Datei]\n\nGeben Sie FDDEBUG ohne Parameter ein, um die aktuelle Einstellung anzuzeigen.\nFalls eine Datei spezifiziert wird, werden alle Fehlerinformationen in diese\nDatei umgeleitet; die Ausgabe wird an die Datei angehngt, falls sie schon\nexistiert.  Die besonderen Namen \"stdout\" und \"stderr\" knnen benutzt werden,\num die Ausgabe zur Standardausgabe oder zum Standard-Fehler-Stream umzuleiten.\n.\n\n:TEXT_CMDHELP_VOL\nZeigt das Laufwerk-Volumelabel und, falls vorhanden, die\nSeriennummer an.\n\nVOL [Laufwerk:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nZeigt eine Liste der verfgbaren Befehle der Shell an.\n\n?\n?Befehl [Parameter]\n\nDie erste Variante zeigt alle verfgbaren internen Befehle und Fhigkeiten an.\nDie zweite fragt ab, ob der spezifizierte Befehl wie im Einzelschrittmodus\nausgefhrt werden soll oder nicht.\n.\n\n:TEXT_CMDHELP_WHICH\nSucht und zeigt die zum jeweiligen Befehl gehrende ausfhrbare Datei an.\n\nWHICH {Befehl}\n.\n\n:TEXT_CMDHELP_MEMORY#1\nZeigt den von FreeCOM intern verwendeten Speicher an\n\nMEMORY\n\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\nDas COPY-Ziel darf keine Pluszeichen ('+') enthalten.\n.\n\n:TEXT_DELETE_FILE#1\nLsche Datei '%s'.\n.\n\n#\n# The following messages are new in 0.82pl3, I think.\n#\n:TEXT_ERROR_WRITE_FILE_DISC_FULL#0%\nKann Datei '%s' nicht schreiben;\nIst vielleicht das Ziellaufwerk voll? (%lu bytes bentigt)\n.\n\n# Displayed for BIGcopy(), when copying takes quite a long time.\n# **_NO_END if the input file size is unknown.\n# Both must end in \\r rather than \\n!!\n:TEXT_COPY_COPIED_NO_END#0%\n%luKB kopiert\\r\\\n.\n:TEXT_COPY_COPIED#0%\n%luKB von %luKB kopiert\\r\\\n.\n\n:TEXT_ERROR_FCOM_IS_DEVICE#0%\nFreeCOM kann kein Gert sein: \"%s\"\n.\n:TEXT_ERROR_FCOM_INVALID#0%\nDiese Datei ist kein FreeCOM, zumindest keine kompatible Version:\n%s\n.\n#\n# Stupid question, but when strings cannot be found, how on\n# Earth can this message be displayed anyway???\n#\n:TEXT_ERROR_LOADING_STRINGS\nKonnte die Strings nicht von %COMSPEC% laden. Bitte geben Sie an,\nwo FreeCOM zu finden ist, zum Beispiel:\nC:\\\\COMMAND.COM\noder drcken, Sie ENTER um ohne Strings weiterzumachen.\n.\n\n:TEXT_TERMINATING\nBeende jetzt.\n.\n\n:TEXT_HIDDEN_CRITER#0%\n%u Kritische Fehleranfragen unterdrckt.\n.\n\n# The exit reasons MUST be kept in this order!\n:TEXT_DISP_EXITCODE#0%\nExitcode (ERRORLEVEL): %u, Grund: %u (%s)\n.\n:TEXT_EXIT_REASON_NEG_1\nDOS API Fehler.\\\n.\n:TEXT_EXIT_REASON_0\nNormal beendet.\\\n.\n:TEXT_EXIT_REASON_1\nBeendet durch ^Break.\\\n.\n:TEXT_EXIT_REASON_2\nDurch kritischen Fehler beendet.\\\n.\n:TEXT_EXIT_REASON_3\nResident geworden.\\\n.\n:TEXT_ERROR_EXE_CORRUPT\nEXE Datei ist korrupt.\\\n.\n"
  },
  {
    "path": "strings/indent.pro",
    "content": "-kr\r\n-di2\r\n-nbc\r\n-nfca\r\n-bl\r\n-bli0\r\n-ss\r\n-npcs\r\n-ncs\r\n-nbs\r\n-i2\r\n-ci4\r\n-nce\r\n-sob\r\n-ts80\r\n-nbad\r\n-cli2\r\n"
  },
  {
    "path": "strings/italian.err",
    "content": "# $Id$\n#\n# Critical error national customization file\n#\n#       Language: Italian\n#       Codepage: CP850\n#       Author:   Roberto Mariottini\n# \n# The critical error (criter) handler receives some information\n# from the kernel about what error condition happens, generates some\n# human friendly message from it, requests the user's opinion about\n# how to proceed and, finally, returns to the kernel.\n# \n# The human friendly message is generated using one of the following\n# templates:\n# BLOCK_DEVICE (for criters on block devices)\n# \tError %1 drive %A: %2 area: %3\n# -and- CHAR_DEVICE (for criters on character devices)\n# \tError %1 device %A: %3\n# \n# Two-character sequences, which first character is a percent sign '%',\n# are placeholders for other information:\n# %% -> a single percent sign\n# %1 -> either READ or WRITE, depending on what kind of operation\n# \tcaused the criter\n# %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA\n# %3 -> the actual error string; these are the strings associated to\n# \ta number 0 through N, and must correspond to the number passed in\n# \tlowbyte(DI) to the criter handler (see RBIL INT-24 for details)\n# %A -> drive letter (for block devices); name of device (character devices)\n# \n# Below the line describing the error the user is prompted for the action\n# to proceed. This line is dynamically constructed depending on which\n# action are available at all. The full line may look like this:\n# \t(A)bort, (I)gnore, (R)etry, (F)ail?_\n# \n# The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They\n# should indicate which user response keys is associated with them;\n# suggested is to use the first letter and enclose it in parenthesises.\n# The delimiter \", \" can be defined with DELIMITER and is the same\n# for all slots.\n# The \"? \" sequence is defined by QUESTION.\n# The order of the actions is fixed and cannot be customized.\n# \n# With each action a number of user response keys must be associated.\n# They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ...\n# strings. Because the key is searched in the same format as returned\n# by INT-16-00, both upper and lower case must be specified and\n# certain special keys cannot be used.\n# \n# The individual error strings are defined by the #: lines, where\n# the hash sign '#' refers to the number the kernel passes to the\n# criter handler. The UNKNOWN string is displayed for all error\n# numbers not specified.\n#\n# NOTE #1: The percent rule applies to _all_ criter strings!\n# NOTE #2: Each string occupies exactly one line.\n# NOTE #3: Any leading or trailing whitespaces are removed. Prefix the\n#\tfirst or suffix the last whitespace with '%.' (one percent sign and\n#\tone dot). This sequence is removed from the string totally.\n# NOTE #4: To embed any character use: %&## (one percent sign,\n#\t\tone ampersand and exactly two hexa-decimal digits)\n\n## Primary strings\nS2\nBLOCK_DEVICE: Errore di %1l'unit %A: %2 area: %3\nS3\nCHAR_DEVICE: Errore di %1 dispositivo %A: %3\n\n## kind of operation\nS0\nREAD: lettura dal\nS1\nWRITE: scrittura sul\n\n## kind of failed area of block devices\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: root\nS7\nDATA: dati\n\n## action strings\nS8\nIGNORE: (I)gnora\nS9\nRETRY: (R)iprova\nS10\nABORT: (A)nnulla\nS11\nFAIL: (F)allisci\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: iI\nKEYS_RETRY:  rR\nKEYS_ABORT:  aA\nKEYS_FAIL:   fF\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN: Codice di errore sconosciuto\nS15\n0: tentativo di violazione della protezione in scrittura\n1: unit sconosciuta al driver\n2: unit non pronta\n3: comando sconosciuto inviato al driver\n4: errore nei dati (errore CRC)\n5: errata dimensione della struttura di richiesta al driver\n6: erorre di posizionamento (seek)\n7: tipo di supporto (media) sconosciuto\n8: settore non trovato\n9: stampante senza carta\n10: scrittura fallita\n11: lettura fallita\n12: guasto generico\n13: violazione della condivisione\n14: violazione di blocco (lock)\n15: cambio di disco non valido\n16: FCB non disponibile\n17: sharing buffer overflow\n18: tabella di codici differente\n19: input esaurito\n20: spazio su disco insufficiente\n"
  },
  {
    "path": "strings/italian.lng",
    "content": "# $Id$\n#\n# Derived from: Id: DEFAULT.lng,v 1.34 2004/12/01 21:20:46 skaus Exp\n#\n# FreeCOM national customization file\n#\n#\tLanguage: Italian\n#\tCodepage: 850\n#\tAuthor:   Roberto Mariottini\n# \n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retreive the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#\t:TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n# If there is a percent sign (%) appended to the version, the printf()\n# format string %-style placeholders are compared for the strings. The\n# sign need to be set in DEFAULT.lng only.\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carrage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause an user interaction. Those ones should be in sync\n# with the issued text. To define how to interprete a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#YyNn\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceeding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the question\n# mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readibility of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH#0%\nOpzione non valida. - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH#0%\nOpzione non valida. - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION#0%\nFormato dell'opzione non corretto: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG#0%\nL'opzione '%s' non ha argomenti\n.\n\n:TEXT_ERROR_OPT_NOARG#0%\nL'opzione '%s' ha un argomento\n.\n\n:TEXT_INVALID_NUMBER#0%\nNumero specificato non valido: '%s'\n.\n\n:TEXT_ERROR_CLOSE_QUOTE#0%\nManca chiusura virgolette: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nImpossibile creare il file temporaneo\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0%\nTroppi parametri. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nTroppi parametri.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER#0%\nParametro non valido. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nPercorso non trovato.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nFile non trovato.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND#0%\nFile non trovato. - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING#0%\nManca un parametro obbligatorio.\n.\n\n:TEXT_ERROR_INVALID_DRIVE#0%\nUnit non valida %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2%\nComando o nome di file errato - \"%s\".\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nErrore di memoria esaurita.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nAllocazione di memoria DOS fallita.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nImpossibile aprire il file temporaneo!\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE#0%\nLa linea #%ld nel file batch '%s'  troppo lunga.\n.\n\n:TEXT_ERROR_BFILE_VANISHED#0%\nFile batch '%s' non trovato.\n.\n\n:TEXT_ERROR_BFILE_LABEL#0%\nIl file batch '%s' non contiene l'etichetta '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1%\n%s fallito per '%s'.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR#0%\nImpossibile impostare la variabile d'ambiente '%s'.\nSpazio ambiente esaurito?\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND#0%\nVariabile d'ambiente '%s' non trovata.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nSpazio ambiente assente. Memoria insufficiente. Specificare l'opzione /E.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1%\nImpossibile impostare l'alias '%s'. Spazio alias esaurito?\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1%\nAlias '%s' non trovato.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nSpazio alias assente. Memoria insufficiente.\n.\n\n:TEXT_ERROR_SYNTAX_STR#0%\nErrore di sintassi. - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nErrore di sintassi.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG#0%\nNome di file troppo lungo. - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY#0%\nImpossibile copiare '%s' su se stesso\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nLinea di comando troppo lunga dopo l'espansione degli alias!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nLinea troppo lunga. Impossibile eseguire il comando.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1%\nDimensione cronologia non valida '%s'.\n.\n\n:TEXT_HISTORY_EMPTY#1\nCronologia comandi vuota.\n.\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nCatena MCB corrotta, o sistema non compatibile con MS-DOS.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR#0%\nErrore non definito %d.\n.\n\n:TEXT_ERROR_REGION_WARNING#0%\nRegione di memoria illegale %d - ignorata.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nOccorre specificare ON oppure OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nSpecificazione di variabile non corretta.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR: IN mancante.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nParentesi mancante.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR: DO mancante.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR: nessun comando dopo l'istruzione DO.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE#0%\nImpossibile ridirezionare l'input dal file '%s'.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE#0%\nImpossibile ridirezionare l'output sul file '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nRidirezione vuota.\n.\n\n:TEXT_ERROR_INVALID_DATE\nData non valida.\n.\n\n:TEXT_ERROR_INVALID_TIME\nOra non valida.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nNessuna etichetta specificata per il GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nIl comando CTTY  stato escluso da questo COMMAND.COM.\n.\n\n:TEXT_ERROR_NORW_DEVICE#0%\nUnit non valida o non in lettura-scrittura - '%s'.\n.\n\n:TEXT_ERROR_CTTY_DUP#0%\nTentativo di cambiamento dei descrittori dei file per il TTY '%s' fallito.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\n/L non ancora implementato.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\n/U non ancora implementato.\n.\n\n:TEXT_ERROR_WRITING_DEST\nErrore di scrittura sulla destinazione.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE#0%\nImpossibile aprire la sorgente. - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE#0%\nImpossibile aprire il file '%s'\n.\n\n:TEXT_ERROR_READ_FILE#0%\nImpossibile leggere dal file '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE#0%\nImpossibile scrivere sul file '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\nIl carattere di concatenazione '+' non pu precedere gli argomenti.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nIl carattere di concatenazione '+' non pu seguire gli argomenti.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nNulla da fare.\n.\n\n:TEXT_ERROR_COPY\nCOPY fallito\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: nome di file mancante\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: numero mancante\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: numero non valido\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: comando mancante\n.\n\n:TEXT_NOT_IMPLEMENTED_YET\nSpiacente... non ancora implementato.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nCaricamento dei messaggi in memoria fallito.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nL'opzione /MSG  stata esclusa da questo COMMAND.COM.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1%\n%u elementi visualizzati.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nLinea di comando corrotta. Questo  un errore interno correlato al sistema\nin cui COMMAND.COM  eseguito. Si prega di segnalare l'errore.\n.\n\n:TEXT_QUOTED_C_OR_K#1\nLe opzioni /K e /C non possono essere virgolettate, quindi sono state ignorate.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1%\nIl percorso di COMMAND.COM deve essere completamente specificato!\nDeve includere la specificazione di unit ed iniziare con un backslash.\nPer esempio: C:\\\\FDOS\n\nCOMMAND.COM assume ora questo percorso:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nLe informazioni di sessione non possono essere ripristinate, ogni impostazione\nlocale  persa. Fare riferimento al precedente messaggio di errore per\ncomprendere la ragione di questo problema.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nLe informazioni attuali non possono essere mantenute durante la chiamata del\nprogramma. Fare riferimento al precedente messaggio di errore per\ncomprendere la ragione di questo problema.\n.\n\n:TEXT_ERROR_CWD_FAILED#1%\nL'unit %c: non risponde o la memoria interna  esaurita.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nSwapping fallito: gli alias occupano troppa memoria.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nSwapping fallito: impossibile allocare la memoria FAR.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nSpazio alias esaurito.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1%\nAlias non trovato: '%s'\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nInserimento alias fallito.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1%\nNome alias non valido '%s'.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nImpossibile caricare il modulo di contesto o il gestore di errori critici.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nMemoria insufficiente per il Contesto.\nSe l'errore persiste, incrementare i buffer interni,\ncome la cronologia comandi, stack di directory, ecc...\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1%\nLa dimensione totale del contesto  di %lu byte, oltre il limite minimo.\nRidimensionamento del contesto a %u byte.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nTentativo fallito di aggiungere informazioni di stato al contesto. Questo\nerrore pu indicare corruzione di memoria o una dimensione minima del\ncontesto determinata non correttamente. Informare il maintainer di\nFreeCOM all'indirizzo: freedos-devel@lists.sourceforge.net \n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nContesto mancante dopo lo scambio. Il contesto  ricreato, ma\ntutti gli alias, ecc. sono persi.\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nPremere un tasto per continuare . . .\\\n.\n\n:TEXT_MSG_HISTORY_SIZE#0%\nLa cronologia  di %d byte.\n.\n\n:TEXT_MSG_DOSKEY\nLe caratteristiche di DOSKEY sono gi abilitate.\n.\n\n:TEXT_MSG_ECHO_STATE#0%\nECHO  %s\n.\n\n:TEXT_MSG_VERIFY_STATE#0%\nVERIFY  %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE#0%\nL'output di DEBUG  %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET#0%\nL'output di DEBUG  stampato su '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE#0%\nBREAK  %s\n.\n\n:TEXT_MSG_CURRENT_DATE#0%\nLa data corrente  %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1%\nImmettere la nuova data (mm%sgg%s[aa]aa): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1%\nImmettere la nuova data (gg%smm%s[aa]aa): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1%\nImmettere la nuova data ([aa]aa%smm%sgg): \\\n.\n\n:TEXT_MSG_CURRENT_TIME#0%\nL'ora corrente  %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nImmettere la nuova ora: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING#0%\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1%\nSsNn{CR}{LF}{CBREAK}\naabb   b   b       b\nTutti i file in '%s' saranno cancellati!\nProcedere con l'operazione (S/N)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nSsNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [S=INVIO, No=ESC] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#\tby \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1%\nSsNnTt{LF}{CR}{CBREAK}{ESC}\naabbcc   a   a       c    b\nControl-Break premuto.\\r\nTerminare il file batch '%s' (S/No/Tutti) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1%\nSsNnTtEe{CBREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nSovrascrivere '%s' (S/No/Tutti/Esci) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_APPEND_FILE#1%\nYyNnAaQq{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nSsNnTtEe{CBREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nAppendere a '%s' (S/No/Tutti/Esci) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1%\nSsNnTtEe{CBREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nCancellare '%s' (S/No/Tutti/Esci) ? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<sconosciuto>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nStack delle directory vuoto.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1%\n Il volume nell'unit %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING#0%\n %s.\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nnon ha etichetta.\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER#0%\n Numero di serie del volume: %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1%\n%10s File\\\n.\n:TEXT_DIR_FTR_BYTES#0%\n   %12s byte\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nFile totali elencati:\n.\n:TEXT_DIR_FTR_DIRS#1%\n%10s Directory\\\n.\n:TEXT_DIR_FTR_BYTES_FREE#0%\n %15s byte disponibili\n.\n:TEXT_DIR_DIRECTORY#0%\nDirectory di %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE#0%\n Directory di %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1%\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE#1%\n%s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1%\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1%\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <DIR> \\\n.\n:TEXT_DIR_LINE_SIZE#1%\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1%\n%-14s\\\n.\n\n:TEXT_MSG_PATH#0%\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nNessun percorso di ricerca definito.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nDom\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nLun\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nMar\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nMer\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\nGio\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\nVen\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nSab\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\nnessun file cancellato.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\nun file cancellato.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1%\n%u file cancellati.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nComandi interni disponibili:\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\nFunzionalit disponibili:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[aliases] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[enhanced input] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[history] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[filename completion] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[swapping] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[start logging] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[last dir] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[kernel swap] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[XMS swap] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[default to swap] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[installable commands] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[directory stack (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[FreeCOM debugging] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nPremere F8 per la modalit traccia, o F5 per non eseguire %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0%\n'%s' ignorato.\n.\n\n:TEXT_MSG_VER_DOS_VERSION#0%\nDOS versione %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nFreeDOS kernel (build 1933 o precedente)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS#0%\nFreeDOS kernel versione %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\nCopyright (C) 1994-2004 Tim Norman and others.\n\nQuesto programma  distribuito nella speranza che sia utile, ma\nSENZA ALCUNA GARANZIA; senza neppure la garanzia implicita di\nCOMMERCIABILITA' o di APPLICABILITA' PER UN PARTICOLARE SCOPO. Si veda\nla Licenza Pubblica Generica GNU (GNU General Public License, in inglese)\nper avere maggiori dettagli.\n\nSegnalare eventuali bug a: freedos-devel@lists.sourceforge.net\nAggiornamenti sono disponibili all'indirizzo:\nhttp://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\nCopyright (C) 1994-2001 Tim Norman and others.\n\nQuesto programma e software libero;  lecito ridistribuirlo e/o modificarlo\nsecondo i termini della Licenza Pubblica Generica GNU come pubblicata dalla\nFree Software Foundation; o la versione 2 della licenza o (a\nvosta scelta) una qualsiasi versione successiva.\n\nSegnalare eventuali bug a: freedos-devel@lists.sourceforge.net\nAggiornamenti sono disponibili all'indirizzo:\nhttp://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\nFreeCOM (FreeDOS Command Shell)  sviluppato da molti sviluppatori,\nfare riferimento al file HISTORY.TXT incluso.\n\nSegnalare eventuali bug a: freedos-devel@lists.sourceforge.net\nAggiornamenti sono disponibili all'indirizzo:\nhttp://freedos.sourceforge.net/freecom\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nIl programma shell sta per terminare, sebbene ci sia\\r\nvietato (normalmente utilizzando l'opzione \"/P\").\\r\nE' necessario riavviare il computer o, se si sta eseguendo il\\r\nprogramma shell in un ambiente multitasking, terminare il\\r\nprocesso/task manualmente.\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nEseguibile FreeCOM non trovato.\nOccorre specificare il percorso completo COMMAND.COM\ncome primo parametro di COMMAND, per esempio:\nC:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1%\nSegmento di ambiente   : max %5u byte; liberi %5u byte\n.\n:TEXT_MEMORY_CONTEXT#1%\nSegmento di contesto   : max %5u byte; liberi %5u byte\n.\t\n:TEXT_MEMORY_HEAP#1%\nHeap                   : liberi %5lu byte\n.\n:TEXT_MEMORY_CTXT_ALIAS#1%\n\\tAlias          : limite %5u byte, attuale %5u byte, %5u elementi\n.\n:TEXT_MEMORY_CTXT_HISTORY#1%\n\\tCronologia     : limite %5u byte, attuale %5u byte, %5u elementi\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1%\n\\tStack directory: limite %5u byte, attuale %5u byte, %5u elementi\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1%\n\\tLast dir cache : usati  %5u byte, %5u elementi\n.\n:TEXT_MEMORY_CTXT_BATCH#1%\n\\tBatch nesting  : usati  %5u byte, %5u elementi\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1%\n\\tSwapinfo       : usati  %5u byte, %5u elementi\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nFallito tentativo di acquisizione della tabella codici corrente dal sistema.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nFallito tentativo di cambiamento della tabella codici corrente.\n.\n:TEXT_DISPLAY_CODEPAGE#1%\nLa tabella codici corrente  %u.\nLa tabella codici del sistema (vera e propria) : %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nVisualizza, imposta, o cancella alias.\n\nALIAS [variabile=[stringa]]\n\n        variabile  Specifica il mode dell'alias.\n        stringa    Specifica una serie di caratteri da assegnare all'alias.\n\n\nDigitare ALIAS senza parametri per visualizzare gli alias attuali.\n.\n\n:TEXT_CMDHELP_BEEP\nEmette un bip.\n.\n\n:TEXT_CMDHELP_BREAK\nImposta o annulla il controllo di CTRL+C esteso.\n\nBREAK [ON | OFF]\n\nDigitare BREAK senza parametri per visualizzare l'impostazione BREAK attuale.\n.\n\n:TEXT_CMDHELP_CALL#1\nRichiama un file batch da un altro.\n\nCALL [/S | /N] [/Y] [unit:][percorso]nomefile [parametri-batch]\n\n  parametri-batch    Specifica le informazioni a linea di comando richieste\n                     dal programma batch.\n  /S forza, /N nega lo swapping di FreeCOM.\n  /Y abilita il modo tracciamento durante l'esecuzione del programma.\n.\n\n:TEXT_CMDHELP_CD\nVisualizza o cambia la directory corrente.\n\nCHDIR [unit:][percorso]\nCHDIR[..]\nCD [unit:][percorso]\nCD[..]\nCD -\n\n  ..   Specifica che si vuole passare alla directory superiore.\n  -    Se la funzionalit \"last directory\"  abilitata, passa alla directory\n       precedente.\n\nDigitare CD unit: per visualizzare la directory corrente nell'unit\nspecificata.\nDigitare CD senza parametri per visualizzare l'unit e la directory correnti.\nVedere anche: CDD\n.\n\n:TEXT_CMDHELP_CDD\nVisualizza il nome o cambia unit e directory correnti.\n\nCDD [unit:][percorso]\nCDD[..]\nCDD -\n\n  ..   Specifica che si vuole passare alla directory superiore.\n  -    Se la funzionalit \"last directory\"  abilitata, passa alla directory\n       precedente.\n\nSe l'unit  specificata, l'unit corrente cambier di conseguenza; questa\n l'unica differenza con \"CHDIR\".\nDigitare CD senza parametri per visualizzare unit e directory correnti.\n.\n\n:TEXT_CMDHELP_CHCP\nVisualizza o imposta la tabella codici attiva.\n\nCHCP [nnn]\n\n  nnn   Specifica un numero di tabella codici.\n\nDigitare CHCP senza parametri per visualizzare il numero della tabella codici\nattiva.\n.\n\n:TEXT_CMDHELP_CLS\nCancella lo schermo.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\nEsegue una nuova copia del programma shell di FreeDOS.\n\nCOMMAND [[unit:]percorso] [dispositivo] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P]\n                           [/MSG] [/LOW] [/Y [/[C|K] comando]]\n\n  [unit:]percorso Specifica la directory che contiene COMMAND.COM.\n  dispositivo      Specifica il dispositivo da usare per l'input e l'output\n                   dei comandi.\n  /E:nnnnn         Imposta la dimensione iniziale dell'ambiente a nnnnn byte.\n                   (nnnnn deve essere compreso fra 256 e 32,768).\n  /L:nnnn          Specifica la dimensione dei buffer interni (richiede /P).\n                   (nnnn deve essere compreso fra 128 e 1,024).\n  /U:nnn           Specifica la lunghezza del buffer di input (richiede /P).\n                   (nnn deve essere compreso fra 128 e 255).\n  /P               Rende la nuova shell permanente (non pu terminare).\n  /MSG             Memorizza tutti i messagi in memoria (richiede /P).\n  /LOW             Forza la shell a mantenere i suoi dati residenti in\n                   memoria bassa.\n  /Y               Esegue il programma batch specificato da /C o /K in\n                   modalit passo passo.\n  /C comando       Esegue il comando specificato e termina.\n  /K comando       Esegue il comando specificato e continua a funzionare.\n.\n\n:TEXT_CMDHELP_COPY\nCopia uno o pi file in un'altra posizione.\n\nCOPY [/A | /B] sorgente [/A | /B] [+ sorgente [/A | /B] [+ ...]]\n               [destinazione] [/A | /B]] [/V] [/Y | /-Y]\n\n  sorgente     Specifica il o i file che devono essere copiati.\n  /A           Indica un file di testo ASCII.\n  /B           Indica un file binario.\n  destinazione Specifica la directory e/o il nomefile per il/i nuovi file.\n  /V           Verifica che i nuovi file siano scritti correttamente.\n  /Y           Sopprime la richiesta di conferma per la sovrascrittura di\n               file destinazione gi esistenti.\n  /-Y          Causa la richiesta di conferma per la sovrascrittura di\n               file destinazione gi esistenti.\n\nL'opzione /Y pu essere presente nella variabile d'ambiente COPYCMD.\nCi pu essere annullato con l'opzione /-Y sulla linea di comando.\n\nPer appendere i file specificare un singolo file come destinazione, ma\nmolteplici file come sorgente (usando i caratteri jolly o la forma\nfile1+file2+file3).\n.\n\n:TEXT_CMDHELP_CTTY\nCambia il dispositivo terminale usato per controllare il sistema.\n\nCTTY dispositivo\n\n  dispositivo   Il dispositivo terminale da usare, per esempio COM1.\n.\n\n:TEXT_CMDHELP_DATE#1\nVisualizza o imposta la data.\n\nDATE [/D] [data]\n\nDigitare DATE senza parametri per visualizzare la data attuale e la\nrichiesta di una nuova data.  Prmere INVIO per mantenere la stessa data.\n\n/D impedisce che DATE diventi interattivo.\n.\n\n:TEXT_CMDHELP_DEL#2\nCancella uno o pi file.\n\nDEL [unit:][percorso]nomefile [/P] [/V]\nERASE [unit:][percorso]nomefile [/P] [/V]\n\n  [unit:][percorso]nomefile Specifica il/i file da cancellare. Specificare\n                             file multipli usando i caratteri jolly.\n  /P    Chiede conferma prima di cancellare ogni file.\n  /V    Visualizza tutti i file cancellati.\n.\n\n:TEXT_CMDHELP_DIR#4\nVisualizza la lista dei file e sottodirectory in una directory.\n\nDIR [unit:][percorso][nomefile] [/P] [/W] [/A[[:]attributi]]\n  [/O[[:]ordine]] [/S] [/B] [/L]\n\n  [unit:][percorso][nomefile]\n           Specifica unit, directory, e/o file da visualizzare\n           (Si possono usare i caratteri jolly o nomifile multipli).\n /P        Effettua una pausa dopo ogni schermata di informazioni.\n /W        Usa il formato su pi colonne.\n /A        Visualizza i file con gli attributi specificati. (Default: /ADHSRA)\n attributi  D  Directory                 R  File di sola lettura\n            H  File nascosti             A  File pronti per l'archiviazione\n            S  File di sistema           -  Prefisso che nega gli attributi\n /O        Visualizza i file ordinati. (Default: /ONG)\n ordine     N  Per nome (alfabetico)        S  Per dimensione (crescente)\n            E  Per estensione (alfabetico)  D  Per data e ora (cronologico)\n            G  Prima le directory           -  Prefiso che inverte l'ordine\n            U  Non ordinati\n /S        Visualizza i file nelle directory specificate e tutte le\n           sottodirectory.\n /B        Usa ul formato breve (n intestazione n riepilogo).\n /L        Usa caratteri minuscoli.\n /Y or /4  Visualizza l'anno con 4 cifre.\n\nLe opzioni possono essere presenti nella variabile d'ambiente DIRCMD. Per\nannullare le opzioni preimpostate inserire un - (meno) davanti all'opzione,\nper esempio: /-W \n.\n\n:TEXT_CMDHELP_DOSKEY#1\nL'utility estaerna DOSKEY  stata incorporata in FreeCOM.\nUsare i tasti cursore SU e GIU' per richiamare la cronologia comandi e\nHISTORY per visualizzarla.\nUsare i tasti cursore SINSTRA e DESTRA ed i tasti INIZIO e FINE per navigare\nall'interno della linea di comando, ed il tasto INS per passare dal modo\ninserimento al modo sovrascrittura e viceversa.\nUsare il tasto TAB per completare la parola corrente come un nome di file;\npremerlo due volte per visualizzare tutti i file che corrispondono.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nModifica la linea di comando, richiama linee di comando, e crea macro\n\nDOSKEY [opzioni ...] [nomemacro=[testo]]\n\n  /BUFSIZE:nnnn Imposta la dimensione del buffer macro e comandi (default:512)\n  /ECHO:on|off  Abilita/disabilita l'eco dell'espansione delle\n                macro (default:on)\n  /FILE:file    Specifica un file contenente una lista di macro\n  /HISTORY      Visualizza tutte le linee di comando memorizzate\n  /INSERT       Modo inserimento: i caratteri digitati vengono inseriti\n  /KEYSIZE:size Imposta la dimensione del buffer di tastiera     (default:15)\n  /LINE:size    Imposta la dimensione massima del buffer di modifica\n                della linea (default:128)\n  /MACROS       Visualizza tutte le macro memorizzate\n  /OVERSTRIKE   Modo sovrascrittura: i caratteri sovrascrivono quelli\n                gi esistenti (default)\n  /REINSTALL    Installa una nuova copia di DOSKey\n  macroname     Specifica un nome per la macro da creare\n  text          Specifica i comandi che si vogliono assegnare alla macro\n\n  SU,GIU' (tasti cursore) richiamano le linee di comando\n      Esc cancella la linea corrente\n       F7 visualizza la cronologia comandi\n   Alt+F7 cancella la cronologia comandi\n[testo]F8 cerca un comando che comincia con [testo]\n       F9 seleziona la linea di comando per numero\n  Alt+F10 cancella le definizioni di macro\n\nI seguenti codici speciali possono essere usati nella definizione di macro:\n  $T     Separatore di comandi: permette comandi multipli in una macro\n  $1-$9  Parametri: equivalenti a %1-%9 nei programmi batch\n  $*     Simbolo sostituito da tutto ci che segue il nome della macro nella\n         linea di comando.\n.\n\n:TEXT_CMDHELP_ECHO\nVisualizza un messaggio, o abilita/disabilita l'eco dei messaggi.\n\n  ECHO [ON | OFF]\n  ECHO [messaggio]\n\nDigitare ECHO senza parametri per visualizzare l'attuale stato dell'eco\ndei messaggi.\n.\n\n:TEXT_CMDHELP_EXIT\nChiude il programma shell dei comandi di FreeDOS, tranne nel caso sia stato\neseguito con l'opzione /P.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\nEsegue il comando specificato per ogni file in un insieme di file.\n\nFOR %%variabile IN (insieme) DO comando [parametri-comando]\n\n  %%variabile Specifica il parametro sostituibile.\n  (insieme)  Specifica un insieme di uno o pi file. Valgono i caratteri jolly.\n  comando    Specifica il comando da eseguire per ogni file.\n  parametri-comando\n             Specifica i parametri e/o le opzioni per il commando.\n\nPer usare il comando FOR in un programma batch, specificare %%%%variabile\ninvece di %%variabile.\n\nPer esempio:\n  FOR %%f IN (---inizio--- a*.* ---fine---) DO ECHO - %%f -\n.\n\n:TEXT_CMDHELP_GOTO\nDirige il programma shell ad una linea etichettata in un programma batch.\n\nGOTO etichetta\n\n  etichetta Specifica una stringa usata nel programma batch come etichetta.\n\nPer definire un'etichetta posizionarla su una riga da sola, incominciando\ncon il carattere : (due punti).\n\nPer esempio:\n  ECHO prima del GOTO\n  GOTO fine\n  REM questa linea  ignorata\n  :fine\n  ECHO dopo il GOTO\n.\n\n:TEXT_CMDHELP_HISTORY#1\nCronologia comandi.\n\nHISTORY [dimensione]\n\nSenza parametri visualizza l'attuale contenuto del buffer di cronologia\ncomandi.\nSpecificando la dimensione, modifica la dimensione del buffer di cronologia\ncomandi.\n.\n\n:TEXT_CMDHELP_IF\nEsegue elaborazioni condizionali nei programmi.\n\nIF [NOT] ERRORLEVEL numero comando\nIF [NOT] stringa1==stringa2 comando\nIF [NOT] EXIST nomefile comando\n\n  NOT               Il comando sar eseguito solo se la condizione  falsa.\n  ERRORLEVEL numero Specifica una condizione vera se l'ultimo programma\n                    eseguito ha restituito un codice d'uscita maggiore o\n                    uguale al numero specificato.\n  comando           Specifica il comando da eseguire se la condizione \n                    verificata.\n  string1==string2  Specifica una condizione vera se le stringhe specificate\n                    sono identiche.\n  EXIST nomefile    Specifica una condizione vera se il file specificato\n                    esiste.\n.\n\n:TEXT_CMDHELP_LH\nCarica un programma nell'aria di memoria alta (upper memory area).\n\nLOADHIGH [unit:][percorso]nomefile [parmetri]\nLOADHIGH [/L:regione1[,mindim1][;regione2[,mindim2]...] [/S]]\n         [unit:][percorso]nomefile [parmetri]\n\n/L:regione1[,mindim1][;regione2[,mindim2]]...\n            Specifica la/le regioni di memoria in cui caricare il programma.\n            Regione1 specifica il numero prima regione di memoria; mindim1\n            specifica la dimensione minima, se presemte, per la regione1.\n            Regione2 e mindim2 specificano il numero e la dimensione minima\n            della seconda regione, se presente. Si possono specificare quante\n            regioni si vogliono.\n\n/S          Riduce l' UMB alla sua dimensione minima mentre sta caricando il\n            programma.\n\n[unit:][percorso]nomefile\n            Specifica nome e posizione del programma.\n.\n\n:TEXT_CMDHELP_LOADFIX\nCarica il programma sopra ai primi 64K di memoria, e lo esegue.\n\nLOADFIX [unit:][percorso]nomefile\n\nUsare LOADFIX per caricare il programma se si riceve il messaggio \"Packed\nfile corrupt\" quando si cerca di eseguirlo.\n.\n\n:TEXT_CMDHELP_MD\nCrea una directory.\n\nMKDIR [unit:]percorso\nMD [unit:]percorso\n.\n\n:TEXT_CMDHELP_PATH\nVisualizza o imposta il percorso di ricerca per i file eseguibili.\n\nPATH [[unit:]percorso[;...]]\nPATH ;\n\nDigitare PATH ; per cancellare il percorso di ricerca e cercare solo nella\ndirectory corrente.\nDigitare PATH senza parametri per visualizzare il percorso corrente.\n.\n\n:TEXT_CMDHELP_PAUSE\nSospende l'elaborazione di un programma batch e visualizza il messaggio:\n\"Premere un tasto per continuare...\" o il messaggio opzionale specificato.\n\nPAUSE [messaggio]\n.\n\n:TEXT_CMDHELP_PROMPT\nCambia il prompt.\n\nPROMPT [testo]\n\n  testo    Specifica il nuovo prompt.\n\nIl prompt pu essere costituito da caratteri normali e i seguenti codici\nspeciali:\n\n  $Q   = (segno di uguale)\n  $$   $ (simbolo del dollaro)\n  $T   Ora attuale\n  $D   Data odierna\n  $P   Unit and percorso correnti\n  $V   Il numero di versione della shell di FreeDOS\n  $N   Unit corrente\n  $G   > (segno di maggiore)\n  $L   < (segno di minore)\n  $B   | (segno di pipe)\n  $H   Backspace (cancella il carattere precedente)\n  $E   Codice di escape (codice ASCII 27)\n  $_   A capo (Carriage return e linefeed)\n\nDigitare PROMPT senza parametri per riottenre le impostazioni di default.\n.\n\n:TEXT_CMDHELP_PUSHD\nAggiunge la directory corrente alla pila delle directory, e cambia la\ndirectory corrente.\n\nPUSHD [[unit:]percorso]\n  Dove [unit:]percorso  la nuova directory corrente.\n.\n\n:TEXT_CMDHELP_POPD\nToglie la directory in cima alla pila delle directory, e la imposta\ncome directory corrente.\n\nPOPD [*]\n  Il parametro '*' svuota la pila delle directory.\n.\n\n:TEXT_CMDHELP_DIRS\nVisualizza il contenuto dela pila delle directory.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\nRimuove (cancella) una directory.\n\nRMDIR [unit:]percorso\nRD [unit:]percorso\n.\n\n:TEXT_CMDHELP_REM\nMemorizza commenti in un programma batch o in CONFIG.SYS.\n\nREM [commento]\n.\n\n:TEXT_CMDHELP_REN\nRinomina un file/directory.\n\nRENAME [unit:][percorso][nomedirectory1 | nomefile1]\n               [nomedirectory2 | nomefile2]\nREN [unit:][percorso][nomedirectory1 | nomefile1]\n            [nomedirectory2 | nomefile2]\n\nNotare che non si pu specificare una nuova unit o percorso come destinazione.\nUsare il comando MOVE per fare ci.\n.\n\n:TEXT_CMDHELP_SET#1\nVisualizza, imposta, o cancella variabili d'ambiente.\n\nSET [/C] [/P] [variabile=[stringa]]\n\n  variabile  Specifica il nome della variabile d'ambiente.\n  stringa    Specifica una serie di caratteri da assegnare alla variabile.\n\n* Se non  specificata una stringa, la variabile  rimossa dall'ambiente.\n\nDigitare SET senza parametri per visualizzare le variabili d'ambiente attuali.\n\n/C mantiene il carattere maiuscolo/minuscolo del nome della variabile; per\ndefault la variabile  convertita in mauscolo, se non  gi presente\nnell'ambiente, altrimenti il carattere  mantenuto.\n\n/P richiede all'utente una stringa, ed assegna l'input dell'utente alla\nvariabile.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nCambia la posizione dei parametri in un file batch.\n\nSHIFT [DOWN]\n\nDOWN sposta i parametri verso l'inizio (%%0); altrimenti verso la fine.\n.\n\n:TEXT_CMDHELP_TIME#1\nVisualizza o imposta l'ora di sistema.\n\nTIME [/T] [ora]\n\nDigitare TIME senza parmetri per visualizzare l'ora attuale e immeterne una\nnuova. Premere INVIO per mantenere la stessa ora.\n\n/T impedisce che TIME diventi interattivo.\n.\n\n:TEXT_CMDHELP_TRUENAME\nVisualizza il nome completo di percorso del file/percorso specificato.\n\nTRUENAME [unit:][percorso][nomefile]\n.\n\n:TEXT_CMDHELP_TYPE\nVisualizza il contenuto di un file di testo.\n\nTYPE [unit:][percorso]nomefile\n.\n\n:TEXT_CMDHELP_VER\nVisualizza la versione ed altre informazioni sul programma shell di FreeDOS.\n\nVER [/R] [/W] [/D] [/C]\n\n /R         Visualizza la versione del kernel ed altre informazioni.\n /W         Visualizza la garanzia.\n /D         Visualizza le informazioni per la redistribuzione.\n /C         Visualizza i collaboratori.\n.\n\n:TEXT_CMDHELP_VERIFY\nChiede a FreeDOS di verificare che i file siano scritti correttamente sul\ndisco.\n\nVERIFY [ON | OFF]\n\nDigitare VERIFY senza parametri per visualizzare l'impostazione attuale di\nVERIFY.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nSe la modalit debug  compilata in FreeDOS, questo comando attiva o disattiva\nl'output di debug, o visualizza lo stato attuale.\n\nFDDEBUG [ON | OFF | nomefile]\n\nDigitare FDDEBUG senza parametri per visualizzare lo stato corrente.\nSe si specifica un file, tutto l'output di debug  rediretto in questo file;\nl'output  aggiunto al filee, se gi esistente. I nomi speciali \"stdout\" e\n\"stderr\" possono essere usati per redirigere l'output di debug sullo\nstandard output o standard error.\n.\n\n:TEXT_CMDHELP_VOL\nVisualizza l'etichetta di volume e il numero di serie del disco, se esistenti.\n\nVOL [unit:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nVisualizza la lista di comandi e funzionalit disponibili nel programma shell.\n\n?\n?comando [argomento]\n\nLa prima variante visualizza tutti i comandi e le funzionalit disponibili.\nLa seconda richiede conferma prima di eseguire il comando specificato come\nil modo tracciamento fosse attivo.\n.\n\n:TEXT_CMDHELP_WHICH\nRicerca e visualizza il file eseguibile per ogni comando specificato.\n\nWHICH comando ...\n.\n\n:TEXT_CMDHELP_MEMORY#1\nVisualizza la memoria usata da FreeCOM internamente.\n\nMEMORY\n\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\nLa destinazione del comando COPY non pu contentere il carattere pi ('+').\n.\n\n:TEXT_DELETE_FILE#1%\nCancellazione del file \"%s\".\n.\n\n:TEXT_ERROR_WRITE_FILE_DISC_FULL#0%\nImpossibile scrivere sul file '%s';\ndisco pieno? (%lu byte richiesti)\n.\n\n# Displayed for BIGcopy(), when copying takes quite a long time.\n# **_NO_END if the input file size is unknown.\n# Both must end in \\r rather than \\n!!\n:TEXT_COPY_COPIED_NO_END#0%\ncopiati %luKB/???KB\\r\\\n.\n:TEXT_COPY_COPIED#0%\ncopiati %luKB/%luKB\\r\\\n.\n\n:TEXT_ERROR_FCOM_IS_DEVICE#0%\nFreeCOM non pu essere un dispositivo: \"%s\"\n.\n:TEXT_ERROR_FCOM_INVALID#0%\nQuesto file non  un FreeCOM valido o  di una versione incompatibile:\n%s\n.\n\n:TEXT_ERROR_LOADING_STRINGS\nCaricamento delle risorse in memoria fallito, la posizione puntata da\n%COMSPEC% sembra non essere valida. Specificare un'altra posizione da cui\nFreeCOM pu provare a caricare le risorse, per esempio:\nC:\\\\COMMAND.COM\no premi INVIO per annullare il caricamento.\n.\n\n:TEXT_TERMINATING\nFine dell'elaborazione.\n.\n\n:TEXT_HIDDEN_CRITER#0%\nRichiesta di Errore Critico %u soppressa.\n.\n\n# The exit reasons MUST be kept in this order!\n:TEXT_DISP_EXITCODE#0%\nCodice d'uscita (ERRORLEVEL): %u, causa: %u (%s)\n.\n:TEXT_EXIT_REASON_NEG_1\nerrore API DOS\\\n.\n:TEXT_EXIT_REASON_0\nterminato normalmente\\\n.\n:TEXT_EXIT_REASON_1\nterminato da ^Interr (^Break)\\\n.\n:TEXT_EXIT_REASON_2\nterminato da errore critico\\\n.\n:TEXT_EXIT_REASON_3\ndivenuto residente\\\n.\n"
  },
  {
    "path": "strings/makefile",
    "content": "# $Id$\r\n#\r\n# Makefile for the FreeDOS kernel's command interpreter\r\n#\r\n# $Log$\r\n# Revision 1.9  2003/12/09 20:25:35  skaus\r\n# bugfix: INIT: FreeCOM-path and TTY can be in any order\r\n#\r\n# Revision 1.8  2002/04/02 23:36:37  skaus\r\n# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n#\r\n# Revision 1.7  2001/04/12 00:09:06  skaus\r\n# chg: New structure\r\n# chg: If DEBUG enabled, no available commands are displayed on startup\r\n# fix: PTCHSIZE also patches min extra size to force to have this amount\r\n#    of memory available on start\r\n# bugfix: CALL doesn't reset options\r\n# add: PTCHSIZE to patch heap size\r\n# add: VSPAWN, /SWAP switch, .SWP resource handling\r\n# bugfix: COMMAND.COM A:\\\r\n# bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n# add: command MEMORY\r\n# bugfix: runExtension(): destroys command[-2]\r\n# add: clean.bat\r\n# add: localized CRITER strings\r\n# chg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n# \tvia STRINGS.LIB\r\n# add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n# add: fixstrs.c: prompts & symbolic keys\r\n# add: fixstrs.c: backslash escape sequences\r\n# add: version IDs to DEFAULT.lng and validation to FIXSTRS.C\r\n# chg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n# bugfix: IF is now using error system & STRINGS to report errors\r\n# add: CALL: /N\r\n#\r\n\r\n.INCLUDE : ../_config.mk\r\n\r\nLDLIBS !:= \r\n\r\n.IF $(LNG) != $(NULL)\r\n\r\n_LNG = $(LNG:u:s/.lng//)\r\n_LLNG = $(_LNG).lng\r\n_ELNG = $(LNG).err\r\n\r\n.ELSE\r\n\r\n_LLNG = \r\n_ELNG = \r\n\r\n.ENDIF\r\n\r\nOBJ :=\r\n\r\n#\tDefault target\r\nall: strings.h strings.dat strings.lib strings.err\r\n\r\n\r\ndist : ;\r\n\r\n.INIT : $(CFG) __errl\r\n\r\n__errl:\r\n\t@+-if exist errlist del errlist >nul\r\n\t-ctags *.c ..\\lib\\*.c\r\n\r\nstrings.h strings.dat .UPDATEALL : fixstrs.exe DEFAULT.lng $(_LLNG)\r\n\tfixstrs.exe /lib $(LNG)\r\n\t+copy strings.h .. >nul\r\n\r\nstrings.lib : fixstrs.exe DEFAULT.lng\r\n\t$(RUNMAKE) strings_lib strings_lib_clean\r\n\r\nstrings_lib .SETDIR=strings :\r\n\t$(RUNMAKE) NDEBUG!:=Yes DEBUG!:=\r\n\t+copy strings.lib ..\r\n\t+copy strings.lst ..\r\n\r\nstrings_lib_clean :\r\n\t-$(RM) -fr strings\r\n\r\nstrings.err : critstrs.exe DEFAULT.err $(_ELNG)\r\n\tcritstrs.exe $(LNG)\r\n\r\nfixstrs.exe ?= _MODEL !:= c\r\nfixstrs.exe : fixstrs.c ../include/strings.typ\r\n\r\ncritstrs.exe ?= _MODEL !:= c\r\ncritstrs.exe : critstrs.c\r\n\r\n#MAKEDEP START\r\n#MAKEDEP STOP\r\n\r\nclobber : clean\r\n\t$(RM) $(RMFLAGS) *.exe *.com ..\\strings.h ..\\strings.dat ..\\string.err\r\n\r\nclean : strings_lib_clean\r\n\t$(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj $(CFG) strings.h strings.dat\r\n\t$(RM) $(RMFLAGS) *.log strings.err strings.lib strings.lst\r\n\r\n"
  },
  {
    "path": "strings/makefile.mak",
    "content": "CFG_DEPENDENCIES = makefile.mak\r\n\r\nCOMPACT_MODEL = 1\r\n\r\nTOP = ..\r\n!include \"$(TOP)/config.mak\"\r\n\r\nall : $(CFG) strings.h strings.err fixstrs.exe\r\n\r\nstrings.h : DEFAULT.lng\r\n\t..$(DIRSEP)utilsc$(DIRSEP)fixstrs.exe $(FIXSTRSOPT) $(LNG)\r\n\t$(CP) strings.h ..\r\n\r\nstrings.err : DEFAULT.err\r\n\t..$(DIRSEP)utilsc$(DIRSEP)critstrs.exe $(LNG)\r\n\r\nfixstrs.exe: fixstrs.c\r\n"
  },
  {
    "path": "strings/polish.err",
    "content": "# $Id$\n#\n# Critical error national customization file\n#\n#       Language: Polish\n#       Codepage: 991 (Mazovia)\n#       Author:   Mateusz Viste \"Fox\" / the.killer@wp.pl\n# \n# The critical error (criter) handler receives some information\n# from the kernel about what error condition happens, generates some\n# human friendly message from it, requests the user's opinion about\n# how to proceed and, finally, returns to the kernel.\n# \n# The human friendly message is generated using one of the following\n# templates:\n# BLOCK_DEVICE (for criters on block devices)\n# \tError %1 drive %A: %2 area: %3\n# -and- CHAR_DEVICE (for criters on character devices)\n# \tError %1 device %A: %3\n# \n# Two-character sequences, which first character is a percent sign '%',\n# are placeholders for other information:\n# %% -> a single percent sign\n# %1 -> either READ or WRITE, depending on what kind of operation\n# \tcaused the criter\n# %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA\n# %3 -> the actual error string; these are the strings associated to\n# \ta number 0 through N, and must correspond to the number passed in\n# \tlowbyte(DI) to the criter handler (see RBIL INT-24 for details)\n# %A -> drive letter (for block devices); name of device (character devices)\n# \n# Below the line describing the error the user is prompted for the action\n# to proceed. This line is dynamically constructed depending on which\n# action are available at all. The full line may look like this:\n# \t(A)bort, (I)gnore, (R)etry, (F)ail?_\n# \n# The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They\n# should indicate which user response keys is associated with them;\n# suggested is to use the first letter and enclose it in parenthesises.\n# The delimiter \", \" can be defined with DELIMITER and is the same\n# for all slots.\n# The \"? \" sequence is defined by QUESTION.\n# The order of the actions is fixed and cannot be customized.\n# \n# With each action a number of user response keys must be associated.\n# They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ...\n# strings. Because the key is searched in the same format as returned\n# by INT-16-00, both upper and lower case must be specified and\n# certain special keys cannot be used.\n# \n# The individual error strings are defined by the #: lines, where\n# the hash sign '#' refers to the number the kernel passes to the\n# criter handler. The UNKNOWN string is displayed for all error\n# numbers not specified.\n#\n# NOTE #1: The percent rule applies to _all_ criter strings!\n# NOTE #2: Each string occupies exactly one line.\n# NOTE #3: Any leading or trailing whitespaces are removed. Prefix the\n#\tfirst or suffix the last whitespace with '%.' (one percent sign and\n#\tone dot). This sequence is removed from the string totally.\n# NOTE #4: To embed any character use: %&## (one percent sign,\n#\t\tone ampersand and exactly two hexa-decimal digits)\n\n## Primary strings\nS2\nBLOCK_DEVICE: Bd %1 dysku %A: %2 obszar: %3\nS3\nCHAR_DEVICE: Bd %1 urzdzenia %A: %3\n\n## kind of operation\nS0\nREAD: odczyt z\nS1\nWRITE: zapis do\n\n## kind of failed area of block devices\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: root\nS7\nDATA: dane\n\n## action strings\nS8\nIGNORE: (I)gnoruj\nS9\nRETRY: p(O)nw\nS10\nABORT: (P)rzerwij\nS11\nFAIL: (Z)rezygnuj\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: iI\nKEYS_RETRY:  pP\nKEYS_ABORT:  eE\nKEYS_FAIL:   zZ\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN: Nieznany kod bdu\nS15\n0: prba pogwacenia ochrony przez zapisem\n1: nieznana jednostka sterownika\n2: napd nie jest gotowy\n3: sterownik nie rozpozna polecenia\n4: bd danych (bdne CRC)\n5: bad device driver request structure length\n6: bd wyszukiwania\n7: nieznany typ nonika\n8: sektor nie odnaleziony\n9: brak papieru w drukarce\n10: bd zapisu\n11: bd odczytu\n12: bd oglny\n13: pogwacenie praw wspdzielenia\n14: lock violation\n15: nieprawidowa zmiana dysku\n16: FCB niedostpne\n17: przepenieniee wspdzielonych buforw\n18: nieprawidowa strona kodowa\n19: koniec wejcia\n20: niewystarczajce miejsce na dysku\n"
  },
  {
    "path": "strings/polish.lng",
    "content": "# $Id$\n#\n# FreeCOM national customization file\n#\n#       Language: Polish\n#       Codepage: 991 (Mazovia)\n#       Author:   Mateusz Viste \"Fox\" / the.killer@wp.pl\n# \n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retreive the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#\t:TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n# If there is a percent sign (%) appended to the version, the printf()\n# format string %-style placeholders are compared for the strings. The\n# sign need to be set in DEFAULT.lng only.\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carrage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause an user interaction. Those ones should be in sync\n# with the issued text. To define how to interprete a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#YyNn\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceeding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the question\n# mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readibility of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH#0%\nNiepoprawny parametr. - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH#0%\nNiepoprawny parametr. - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION#0%\nle sformuowana opcja: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG#0%\nOpcja '%s' nie moe mie argumentu\n.\n\n:TEXT_ERROR_OPT_NOARG#0%\nOpcja '%s' wymaga argumentu\n.\n\n:TEXT_INVALID_NUMBER#0%\nNiepoprawny numer w '%s'\n.\n\n:TEXT_ERROR_CLOSE_QUOTE#0%\nBrak zamykajcego cudzysowa: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nNie mona utworzy pliku tymczasowego\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0%\nZbyt wiele parametrw. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nZbyt wiele parametrw.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER#0%\nNiepoprawny parametr. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\ncieki nie odnaleziono.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nPliku nie odnaleziono.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND#0%\nPliku nie odnaleziono. - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING#0%\nBrak wymaganego parametru.\n.\n\n:TEXT_ERROR_INVALID_DRIVE#0%\nNiepoprawny napd %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2%\nZe polecenie lub nazwa pliku - \"%s\".\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nBd: Brak pamici.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nAlokacja pamici DOS nie powioda si.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nBD!  Nie mona otworzy pliku tymczasowego!\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE#0%\nLinia #%ld pliku wsadowego '%s' jest za duga.\n.\n\n:TEXT_ERROR_BFILE_VANISHED#0%\nNie odnaleziono pliku wsadowego '%s'.\n.\n\n:TEXT_ERROR_BFILE_LABEL#0%\nPlik wsadowy '%s' nie zawiera etykiety '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1%\n%s nie powiodo si dla '%s'.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR#0%\nNie mona ustawi zmiennej rodowiskowej '%s'.\nPrzepenione rodowisko?\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND#0%\nNie odnaleziono zmiennej rodowiskowej '%s'.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nBrak rodowiska. Moe zbyt mao pamici. Sprbuj z parametrem /E.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1%\nNie mog ustawi aliasu '%s'. Przestrze dla aliasw zapeniona?\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1%\nAlias '%s' nie odnaleziony.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nBrak przestrzeni dla aliasw. Moe zbyt mao pamici.\n.\n\n:TEXT_ERROR_SYNTAX_STR#0%\nBd skadni. - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nBd skadni.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG#0%\nZbyt duga nazwa pliku. - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY#0%\nNie mog skopiowa '%s' na samego siebie.\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nCommand line too long after alias expansion!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nLinia zbyt duga.  Nie mog wykona polecenia.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1%\nNieprawidowy rozmiar historii '%s'.\n.\n\n:TEXT_HISTORY_EMPTY#1\nHistoria komend pusta.\n.\n\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nacush MCB uszkodzony, lub system niekompatybilny z MS-DOS.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR#0%\nNieznany bd %d.\n.\n\n:TEXT_ERROR_REGION_WARNING#0%\nNiedozwolony region pamici %d - ignorowany.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nNaley poda ON lub OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nNiepoprawna specyfikacja zmiennej.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR: brak operatora IN.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nBrakuje jednego lub obu nawiasw.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR: Brak operatora DO.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR: Brak komendy po operatorze DO.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE#0%\nNie mona przekierowa rda z pliku '%s'.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE#0%\nNie mona przekierowa wyjcia do pliku '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nPuste przekierowanie.\n.\n\n:TEXT_ERROR_INVALID_DATE\nNieprawidowa data.\n.\n\n:TEXT_ERROR_INVALID_TIME\nNieprawidowy czas.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nBrak okrelonej etykiety dla GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nThe CTTY command has been excluded from this COMMAND.COM.\n.\n\n:TEXT_ERROR_NORW_DEVICE#0%\nUrzdzenie nieprawidowe, lub nie wspiera operacji odczyt/zapis '%s'.\n.\n\n:TEXT_ERROR_CTTY_DUP#0%\nFailed to change file descriptors to TTY '%s'.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\n/L jeszcze nie zaimplementowane.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\n/U jeszcze nie zaimplementowane.\n.\n\n:TEXT_ERROR_WRITING_DEST\nBd zapisu u celu.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE#0%\nNie mona otworzy rda. - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE#0%\nNie mona otworzy pliku '%s'\n.\n\n:TEXT_ERROR_READ_FILE#0%\nNie mona odczyta z pliku '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE#0%\nNie mona zapisa pliku '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\nZnak '+' nie moe znajdowa si przed argumentem.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nZnak '+' nie moe znajdowa si za argumentem.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nNie ma niczego do wykonania.\n.\n\n:TEXT_ERROR_COPY\nCOPY nie powiodo si\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: brak nazwy pliku\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: brak numeru\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: nieprawidowy numer\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: brak komendy\n.\n\n:TEXT_NOT_IMPLEMENTED_YET\nPrzykro mi... Jeszcze nie zaimplementowane.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nNie udao si zaadowa komunikatw do pamici.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nThe /MSG option has been excluded from this COMMAND.COM.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1%\nWywietlono %u jednostek.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nUszkodzona linia polece. To jest wewntrzny bd i jest zwizany z systemowym\nCOMMAND.COM. Prosz powiadomi zesp FreeDOS o tym bdzie.\n.\n\n:TEXT_QUOTED_C_OR_K#1\nThe /C and /K options cannot be quoted, they are ignored.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1%\ncieka do COMMAND.COM musi by w peni opracowana!\nTo oznacza, e musi skada si z litery napdu i zaczyna si backslash'em.\nNa przykad: C:\\\\FDOS\n\nCOMMAND.COM sprbuje teraz t ciek:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nThe session information could not be restored, any local settings\nare lost. Please refer to above error messages for the reason\nof this problem.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nThe current information cannot be preserved during the call of the\nprogram. Please refer to above error messages for the reason of\nthis problem.\n.\n\n:TEXT_ERROR_CWD_FAILED#1%\nDysk %c: nie odpowiada.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nSwapping failed: Aliases allocate too much memory.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nSwapping failed: Cannot allocate far memory.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nBrak pamici aliasw.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1%\nNie ma takiego aliasu: '%s'\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nNie udao si doda aliasu.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1%\nNieprawidowa nazwa aliasu '%s'.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nNie udao si zaadowa moduu kontekstowego lub bd krytyczny.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nBrak pamici kontekstowej.\nJeli bd bdzie si powtarza, sprbuj zwikszy jakie wewntrzne bufory,\ntakie jak historia, stos katalogw itp.\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1%\nKontekst wielkoci %lu bajtw przekracza maksymalny limit.\nKontekst zostanie pomniejszony do %u bajtw.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nDodanie informacji o statusie do kontekstu nie powiodo si. Moe to wskazywa\nna bd pamici lub nieprawidowo okrelon minimaln wielko kontekstu.\nProsz powiadomi gospodarza FreeCOM na:\nfreedos-devel@lists.sourceforge.net\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nKontekst zosta utracony w trakcie swapping'u. Kontekst zostanie odtworzony,\njednake wszystkie aliasy itd. zostan utracone.\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nNacinij dowolny klawisz aby kontynuowa...\\\n.\n\n:TEXT_MSG_HISTORY_SIZE#0%\nWielkoc historii to %d bajtw.\n.\n\n:TEXT_MSG_DOSKEY\nDOSKEY ju jest aktywny w shell'u.\n.\n\n:TEXT_MSG_ECHO_STATE#0%\nECHO jest %s\n.\n\n:TEXT_MSG_VERIFY_STATE#0%\nVERIFY jest %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE#0%\nWyjcie DEBUG jest %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET#0%\nWyjcie DEBUG jest drukowane do '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE#0%\nBREAK jest %s\n.\n\n:TEXT_MSG_CURRENT_DATE#0%\nObecna data to %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1%\nWprowad now dat (mm%sdd%s[cc]yy): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1%\nWprowad now dat (dd%smm%s[cc]yy): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1%\nWprowad now dat ([cc]yy%smm%sdd): \\\n.\n\n:TEXT_MSG_CURRENT_TIME#0%\nTeraz jest godzina %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nWprowad now godzin: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING#0%\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1%\nTtNn{CR}{LF}{CBREAK}\naabb   b   b       b\nWszystkie pliki z '%s' zostan wykasowane!\nCzy jeste pewien (T/N)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nTyNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [Tak=ENTER, Nie=ESC] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#\tby \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1%\nTtNnWwQq{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\nWcinito Control-Break.\\r\nZatrzyma plik wsadowy '%s' (Tak/Nie/Wszystkie) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1%\nTtNnWwKk{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nCzy nadpisa '%s' (Tak/Nie/Wszystkie/Koniec) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_APPEND_FILE#1%\nTtNnWwKk{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nCzy dopisa do '%s' (Tak/Nie/Wszystkie/Koniec) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1%\nTtNnWwKk{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nWykasowa '%s' (Tak/Nie/Wszystkie/Koniec) ? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<nieznany>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nStos katalogw jest pusty.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1%\n Zbir w stacji %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING#0%\nto %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nnie ma etykiety\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER#0%\n Numer seryjny zbioru to %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1%\n%10s pliki(w)\\\n.\n:TEXT_DIR_FTR_BYTES#0%\n   %12s bajtw\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nWszystkich plikw:\n.\n:TEXT_DIR_FTR_DIRS#1%\n%10s katalogi(w)\\\n.\n:TEXT_DIR_FTR_BYTES_FREE#0%\n %15s bajtw wolnych\n.\n:TEXT_DIR_DIRECTORY#0%\nKatalog %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE#0%\n Katalog %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1%\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE#1%\n%s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1%\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1%\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <KAT> \\\n.\n:TEXT_DIR_LINE_SIZE#1%\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1%\n%-14s\\\n.\n\n:TEXT_MSG_PATH#0%\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nNie podano cieki poszukiwa.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nNie\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nPon\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nWto\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nro\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\nCzw\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\nPi\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nSob\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\nnie usunito adnego pliku.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\nusunito jeden plik.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1%\nplikw usunitych: %u\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nDostpne komendy wewntrzne:\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\nDostpne usugi:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[aliases] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[enhanced input] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[history] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[filename completion] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[swapping] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[start logging] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[last dir] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[kernel swap] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[XMS swap] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[default to swap] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[installable commands] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[directory stack (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[FreeCOM debugging] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nWcinij F8 dla trybu krok po kroku, lub F5 by obej %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0%\nObchodzenie '%s'.\n.\n\n:TEXT_MSG_VER_DOS_VERSION#0%\nWersja DOS: %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nJdro FreeDOS (build 1933 lub nowszy)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS#0%\nWersja jdra FreeDOS: %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\nCopyright (C) 1994-2001 Tim Norman i inni.\n\nNiniejszy program rozpowszechniany jest z nadziej, i bdzie uyteczny,\njednak BEZ JAKIEJKOLWIEK GWARANCJI, nawet domylnej gwarancji PRZYDATNOCI\nHANDLOWEJ albo PRZYDATNOCI DO OKRELONYCH ZASTOSOWA. W celu uzyskania\nbliszych informacji zapoznaj si z GNU General Public License.\n\nRaporty o bdach prosz wysya do freedos-devel@lists.sourceforge.net\nNowe wersje dostpne pod http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\nCopyright (C) 1994-2001 Tim Norman i inni.\n\nNiniejszy program jest wolnym oprogramowaniem; moesz go rozprowadza dalej\ni/lub modyfikowa na warunkach Powszechnej Licencji Publicznej GNU, wydanej\nprzez Fundacj Wolnego Oprogramowania - wedug wersji 2-giej tej Licencji lub\nktrej z pniejszych wersji.\n\nRaporty o bdach prosz wysya do freedos-devel@lists.sourceforge.net\nNowe wersje dostpne pod http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\nShell FreeDOS jest rozwijany przez wielu twrcw, prosz zapozna si\nz zaczonym plikiem HISTORY.TXT.\n\nRaporty o bdach prosz wysya do freedos-devel@lists.sourceforge.net\nNowe wersje dostpne pod http://freedos.sourceforge.net/freecom\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nShell zostanie zakoczony, pomimo, i jest to zabronione (prawdopodobnie\\r\natywna jest opcja \"/P\").\\r\nNaley zrestartowa system, lub - jeli shell jest uruchomiony w\\r\nrodowisku wielozadaniowym - zakoczy ten proces/zadanie rcznie.\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nPlik wykonywalny FreeCOM nie zosta odnaleziony.\nNaley okreli pen ciek do COMMAND.COM\njako pierwszy argument za COMMAND, na razie:\nC:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1%\nSegment rodowiska     : maks %5u bajtw; wolnych %5u bajtw\n.\n:TEXT_MEMORY_CONTEXT#1%\nSegment kontekstowy    : maks %5u bajtw; wolnych %5u bajtw\n.\t\n:TEXT_MEMORY_HEAP#1%\nStos                   : wolnych %5lu bajtw\n.\n:TEXT_MEMORY_CTXT_ALIAS#1%\n\\tAliases        : limit %5u bytes, current %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_HISTORY#1%\n\\tHistory        : limit %5u bytes, current %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1%\n\\tDirectory stack: limit %5u bytes, current %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1%\n\\tLast dir cache : used  %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_BATCH#1%\n\\tBatch nesting  : used  %5u bytes, %5u items\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1%\n\\tSwapinfo       : used  %5u bytes, %5u items\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nNie udao si uzyska obecnej strony kodowej od systemu.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nZmiana obecnej strony kodowej nie powioda si.\n.\n:TEXT_DISPLAY_CODEPAGE#1%\nObecna strona kodowa to %u.\nSystemowa strona kodowa to: %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nWywietla, ustawia lub usuwa aliasy.\n\nALIAS [zmienna[=][string]]\n\n        variable  Okrela nazw aliasu.\n        string    Okrela seri znakw przyporzdkowanych aliasowi.\n\n\nWpisz ALIAS bez parametrw by wywietli obecny aliasy.\n.\n\n:TEXT_CMDHELP_BEEP\nOdgrywa jeden BEEP.\n.\n\n:TEXT_CMDHELP_BREAK\nUstawia lub czyci stan sprawdzania klawiszy CTRL+C.\n\nBREAK [ON | OFF]\n\nWpisz BREAK bez parametrw by wywietli obecny stan.\n.\n\n:TEXT_CMDHELP_CALL#1\nWywouje jeden program wsadowy z innego.\n\nCALL [/S | /N] [/Y] [dysk:][cieka]nazwapliku [parametry wsadowe]\n\n  parametry wsadowe   Okrela wszystkie informacje wymagane przez program\n                      wsadowy w wierszu polece.\n\n  /S wcza, /N wycza swapping dla FreeCOM.\n  /Y wcza tryb \"krok po kroku\".\n.\n\n:TEXT_CMDHELP_CD\nWywietla nazw obecnego katalogu lub zmienia katalog na inny.\n\nCHDIR [dysk:][cieka]\nCHDIR[..]\nCD [dysk:][cieka]\nCD[..]\nCD -\n\n  ..   Okrela e uytkownik chce przej do katalogu nadrzdnego.\n  -    Jeli usuga \"ostatni katalog\" jest wczona, przechodzi do niego.\n\nWpisz CD dysk: aby wywietli obceny katalog podanego dysku.\nWpisz CD bez parametrw aby wywietli obecny katalog i obecny dysk.\nZobacz take: CDD\n.\n\n:TEXT_CMDHELP_CDD\nWywietla obecny dysk i katalog lub przechodzi do innego dysku i katalogu.\n\nCDD [dysk:][cieka]\nCDD[..]\n\n  ..   Okrela e uytkownik chce przej do katalogu nadrzdnego.\n  -    Jeli usuga \"ostatni katalog\" jest wczona, przechodzi do niego.\n\nJeli \"dysk:\" jest okrelony i rni si od obecnego, interpreter przechodzi\ndo niego; to jest jedyna rnica midzy \"CD\" a \"CDD\".\nWpisz CD bez parametrw aby wywietli obecny dysk i katalog.\n.\n\n:TEXT_CMDHELP_CHCP\nWywietla lub ustawia aktywn stron kodow.\n\nCHCP [nnn]\n\n  nnn   Okrela numer strony kodowej.\n\nWpisz CHCP bez parametrw aby wywietli aktywn stron kodow.\n.\n\n:TEXT_CMDHELP_CLS\nCzyci ekran.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\nUruchamia now kopi interpretra komend (shell'u) FreeDOS.\n\nCOMMAND [[dysk:]cieka] [urzdzenie] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG]\n                       [/LOW] [/Y [/[C|K] command]]\n  [dysk:]cieka  Okrela dysk i katalog zawierajce COMMAND.COM.\n  urzdzenie      Okrela urzdzenie uywane dla wyj/wej.\n  /E:nnnnn        Ustawia pierwotn wielko rodowiska na nnnnn bajtw.\n                  (nnnnn powinno zawiera si midzy 256 a 32,768).\n  /L:nnnn         Ustawia dugo wewntrznych buforw (wymaga /P).\n                  (nnnn powinno zawiera si midzy 128 a 1,024).\n  /U:nnn          Ustawia dugo bufora wejciowego (wymaga /P).\n                  (nnn powinno zawiera si midzy 128 a 255).\n  /P              aduje nowy interpreter komend (shell) na stae.\n  /MSG            Skaduje wszystkie komunikaty bdw w pamici (wymaga /P).\n  /LOW            Wymusza na interpreterze komend prac w pamici niskiej.\n  /Y              Wykonuje plik wsadowy podany z /C lub /K krok po kroku.\n  /C polecenie    Wykonuje okrelone polecenie i powraca.\n  /K polecenie    Wykonuja okrelone polecenie i kontynuuje dziaanie.\n.\n\n:TEXT_CMDHELP_COPY\nKopiuje jeden lub wicej plikw w inne miejsce.\n\nCOPY [/A | /B] rdo [/A | /B] [+ rdo [/A | /B] [+ ...]] [destynacja\n  [/A | /B]] [/V] [/Y | /-Y]\n\n  rdo       Okrela plik lub pliki majce zosta skopiowane.\n  /A           Wskazuje e plik jest plikiem tekstowym ASCII.\n  /B           Wskazuje e plik jest binarny.\n  destination  Okrela katalog i/lub nazw pliku dla nowego(ych) pliku(w).\n  /V           Sprawdza czy pliki zostay poprawnie zapisane.\n  /Y           Automatycznie odpowiada \"tak\" na kade pytanie o nadpisanie\n               istniejcych plikw u celu.\n  /-Y          Wymusza pytanie przed kadym nadpisaniem istniejcego\n               pliku u celu.\n\nParametr /Y moe znajdowa si w zmiennej COPYCMD.\nMoe by anulowany z linii polece za pomoc parametru /-Y.\n\nAby dopisa pliki, naley poda jeden plik jako cel, a wiele plikw\njako rdo (uywajc masek lub formatu plik1+plik2+plik3).\n.\n\n:TEXT_CMDHELP_CTTY\nZmienia terminal zarzdzajcy systemem.\n\nCTTY urzdzenie\n\n    urzdzenie    Urzdzenie majce zosta wykorzystane, takie jak np COM1.\n.\n\n:TEXT_CMDHELP_DATE#1\nWywietla lub ustawia dat.\n\nDATE [/D] [data]\n\nWpisz DATE bez parametrw aby wywietli obecne ustawienia daty i\nzapytanie o wprowadzenie nowej.  Wcinij ENTER aby zachowa t sam dat.\n\n/D wycza interaktywno programu DATE.\n.\n\n:TEXT_CMDHELP_DEL#2\nUsuwa jeden lub wicej plikw\n\nDEL [dysk:][cieka]nazwapliku [/P] [/V]\nERASE [dysk:][cieka]nazwapliku [/P] [/V]\n\n  [dysk:][cieka]nazwapliku   Okrela plik(i) do wykasowania.\n                                                    \n  /P    Pyta o potwierdzenie przed wykasowaniem kadego pliku.\n  /V    Wywietla wszystkie wykasowane pliki.\n.\n\n:TEXT_CMDHELP_DIR#4\nWywietla list plikw i podkatalogw w katalogu.\n\nDIR [dysk:][cieka][nazwapliku] [/P] [/W] [/A[[:]atrybuty]]\n  [/O[[:]kolejno]] [/S] [/B] [/L]\n\n  [dysk:][cieka][nazwapliku]\n            Okrela dysk, katalog i/lub pliki do wywietlenia.\n            (Mona uywa wielu masek)\n /P         Zatrzymuje si po kadym wywietleniu penego ekranu.\n /W         Uywa formatu rozszerzonej listy.\n /A         Wywietla pliki z okrelonym atrybutem. (Domylnie to /ADHSRA)\n atrybuty    D  Katalogi                   R  Pliki tylko-do-odczytu\n             H  Pliki ukryte               A  Pliki gotowe do archiwizacji\n             S  Pliki systemowe            -  Prefiks negujcy\n /O         Sortuje pliki.\n kolejno   N  Po nazwach (alfabetycznie) S  Po wielkoci (od mniejszych)\n             E  Po rozszerzeniach (alf.)   D  Po dacie i czasie (od modszych)\n             G  Grupuje najpierw katalogi  -  Prefiks odwracajcy kolejno\n             U  Wycza sortowanie         Domylne to /ONG\n /S         Wywietla pliki w podanym katalogu i wszystkich podkatalogach.\n /B         Wywietla pliki w jednej kolumnie.\n /L         Uywa maych liter.\n /Y or /4   Uywa czterocyfrowej daty.\n\nParametry mog by z gry ustawione w zmiennej DIRCMD.\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nZewntrzny program uytkowy DOSKEY zosta zaimplementowany wewntrz FreeCOM.\nUyj kursorw gra/d by przewija histori, a polecenia HISTORY by j w peni\nwywietli.\nUyj klawiszy prawo/lewo i END oraz HOME by porusza si w linii polece, za\npomoc klawisza INSERT moesz przechodzi z trybu wstawiania do trybu zamiany.\nUyj klawisza TAB by kompletowa nazwy plikw; wciskaj dwukrotnie by zobaczy\nwszystkie pasujce pliki.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nEdits command lines, recalls command lines, and creates macros\n\nDOSKEY [/switch ...] [macroname=[text]]\n\n  /BUFSIZE:size Sets size of macro and command buffer            (default:512)\n  /ECHO:on|off  Enables/disables echo of macro expansions        (default:on)\n  /FILE:file    Specifies file containing a list of macros\n  /HISTORY      Displays all commands stored in memory\n  /INSERT       Inserts new characters into line when typing\n  /KEYSIZE:size Sets size of keyboard type-ahead buffer          (default:15)\n  /LINE:size    Sets maximum size of line edit buffer            (default:128)\n  /MACROS       Displays all DOSKey macros\n  /OVERSTRIKE   Overwrites new characters onto line when typing  (default)\n  /REINSTALL    Installs a new copy of DOSKey\n  macroname     Specifies a name for a macro you create\n  text          Specifies commands you want to assign to the macro\n\n  UP,DOWN arrows recall commands\n      Esc clears current command\n       F7 displays command history\n   Alt+F7 clears command history\n[chars]F8 searches for command beginning with [chars]\n       F9 selects a command by number\n  Alt+F10 clears macro definitions\n\nThe following are special codes you can use in DOSKey macro definitions:\n  $T     Command separator: allows multiple commands in a macro\n  $1-$9  Batch parameters: equivalent to %1-%9 in batch programs\n  $*     Symbol replaced by everything following macro name on the command line\n.\n\n:TEXT_CMDHELP_ECHO\nWywietla komunikaty, lub wcza/wycza zwracanie echa.\n\n  ECHO [ON | OFF]\n  ECHO [komunikat]\n\nWpisz ECHO bez parametrw by wywietli obecne ustawienie zwracania echa.\n.\n\n:TEXT_CMDHELP_EXIT\nWychodzi z interpretara komend FreeDOS, chyba e zosta zaadowany z /P.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\nUruchamia podane polecenie dla kadego pliku z zestawu plikw.\n\nFOR %%zmienna IN (zestaw) DO polecenie [parametry polecenia]\n\n  %%zmienna   Okrela parametr wymienny.\n  (zestaw)   Okrela zestaw jednego lub kilku plikw. Uywanie symboli\n             wieloznacznych jest dozwolone.\n  polecenie  Okrela polecenie, ktre ma zosta wykonane dla kadego pliku.\n  parametry polecenia\n             Okrela parametry lub przeczniki dla okrelonego polecenia.\n\nAby uy polecenia FOR w programie wsadowym, naley uywa %%%%zmienna zamiast\n%%zmienna.\n\nNa przykad:\n  FOR %%f IN (a*.*) DO ECHO - %%f -\n.\n\n:TEXT_CMDHELP_GOTO\nPrzekierowuje interpreter komend do zaetykietowanej linii pliku wsadowego.\n\nGOTO etykieta\n\n  etykieta   Okrela cig znakw uywanych w pliku wsadowym jako etykieta.\n\nEtykieta w pliku musi znajdowa si sama w linii i by poprzedzona dwukropkiem.\n.\n\n:TEXT_CMDHELP_HISTORY#1\nHistoria polece.\n\nHISTORY [wielko]\n\nBez parametru \"wielko\", program wywietla histori polece.\nWywoanie z parametrem \"wielko\" powoduje zmian wielkoci bufora historii.\n.\n\n:TEXT_CMDHELP_IF\nDokonuje warunkowego przetwarzania w plikach wsadowych.\n\nIF [NOT] ERRORLEVEL liczba polecenie\nIF [NOT] cig1==cig2 polecenie\nIF [NOT] EXIST nazwapliku polecenie\n\n  NOT               Wskazuje, e system powinien wykona polecenie tylko\n                    wtedy, gdy warunek nie jest speniony.\n  ERRORLEVEL liczba Okrela warunek prawdziwy, jeeli ostatni uruchomiony\n                    program zwrci kod wyjcia rwny lub wikszy od podanej\n                    liczby.\n  polecenie         Okrela polecenie, ktre ma zosta wykonane, jeeli warunek\n                    zostanie speniony.\n  cig1==cig2      Okrela warunek prawdziwy, jeeli podane cigi tekstowe\n                    s rwne.\n  EXIST nazwapliku  Okrela warunek prawdziwy, jeeli okrelona nazwa pliku\n                    istnieje.\n.\n\n:TEXT_CMDHELP_LH\naduje program w grny obszar pamici.\n\nLOADHIGH [dysk:][cieka]nazwapliku [parametry]\nLOADHIGH [/L:region1[,wielko1][;region2[,wielko2]...] [/S]]\n         [dysk:][cieka]nazwapliku [parametry]\n\n/L:region1[,wielko1][;region2[,wielko2]]...\n            Okrela region(y) pamici do ktrych zaadowa program.\n            Region1 okrela pierwszego regionu pamici; wielko1 okrela\n            jego minimaln wielko.\n            Region2 i wielko2 okrelaj numer i minimaln wielko drugiego\n            regionu. Mona okreli nieograniczon liczb regionw.\n\n/S          Zwiera UMB to minimalnej wielkoci podczas adowania programu.\n\n[dysk:][cieka]nazwapliku\n            Okrela umiejscowienie i nazw programu.\n.\n\n:TEXT_CMDHELP_LOADFIX\naduje program powyej pierwszych 64KB pamici i uruchamia go.\n\nLOADFIX [dysk:][cieka]nazwapliku\n\nUyj LOADFIX do zaadowania programu jeli otrzymae komunikat \"Packed\nfile corrupt\" podczas prby zaadowania go do pamici niskiej.\n.\n\n:TEXT_CMDHELP_MD\nTworzy katalog.\n\nMKDIR [dysk:]cieka\nMD [dysk:]cieka\n.\n\n:TEXT_CMDHELP_PATH\nWywietla lub ustawia ciek dla plikw wykonywalnych.\n\nPATH [[dysk:]cieka[;...]]\nPATH ;\n\nAby wyczyci ustawienie cieki przeszukiwania i wybra do przeszukiwania\njedynie biecy katalog, wpisz PATH ;.\nAby wywietli biec ciek, wpisz PATH.\n.\n\n:TEXT_CMDHELP_PAUSE\nWstrzymuje przetwarzanie pliku wsadowego i wywietla komunikat \"Nacinij\ndowolny klawisz aby kontynuowa...\" lub inny jeli zostanie okrelony.\n\nPAUSE [komunikat]\n.\n\n:TEXT_CMDHELP_PROMPT\nZmienia znak zgoszenia.\nPROMPT [tekst]\n\n  tekst    Okrela nowy znak zgoszenia.\n\nZnak zgoszenia mona zbudowa z normalnych znakw oraz nastpujcych znakw\nspecjalnych:\n\n  $Q   = (znak rwnoci)\n  $$   $ (symbol dolara)\n  $T   Bieca godzina\n  $D   Bieca data\n  $P   Biecy dysk i cieka\n  $V   Numer wersji interpretera komend FreeDOS\n  $N   Biecy dysk\n  $G   > (znak wikszoci)\n  $L   < (znak mniejszoci)\n  $B   | (potok)\n  $H   Cofacz (usuwa poprzedni znak)\n  $E   Kod escape (kod ASCII 27)\n  $_   Powrt karetki i znak wysuwu wiersza\n\nAby przywrci domylne ustawienia znaku zgoszenia, wpisz PROMPT.\n.\n\n:TEXT_CMDHELP_PUSHD\nWstawia obecny katalog do stosu katalogw, umoliwiajc przejcie do innego\nkatalogu.\n\nPUSHD [[dysk:]cieka]\n  Gdzie [dysk:]cieka jest ciek do ktrej nastpi przejcie.\n.\n\n:TEXT_CMDHELP_POPD\nOdczytuje katalog ze stosu katalogw i przechodzi do niego.\n\nPOPD [*]\n  Parametr '*' czyci stos katalogw.\n.\n\n:TEXT_CMDHELP_DIRS\nWywietla zawarto stosu katalogw.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\nUsuwa katalog.\n\nRMDIR [dysk:]cieka\nRD [dysk:]cieka\n.\n\n:TEXT_CMDHELP_REM\nUmoliwa wstawianie komentarzy do plikw wsadowych oraz w CONFIG.SYS\n\nREM [komentarz]\n.\n\n:TEXT_CMDHELP_REN\nZmienia nazw pliku/katalogu lub plikw/katalogw.\n\nRENAME [dysk:][cieka][katalog1 | plik1] [katalog2 | plik2]\nREN [dysk:][cieka][katalog1 | plik1] [katalog2 | plik2]\n\nZauwa, e nie mona poda innego dysku ani innej cieki dla nowego pliku bd\nkatalogu. Dla tego celu uyj polecenia MOVE.\n.\n\n:TEXT_CMDHELP_SET#1\nWywietla, ustawia, lub usuwa zmienne rodowiskowe.\n\nSET [/C] [/P] [zmienna=[warto]]\n\n  zmienna  Okrela nazw zmiennej rodowiskowej.\n  warto  Przyporzdkowuje cig znakw okrelonej zmiennej.\n\n* Jeeli adna warto nie zostanie podana, zmienna jest usuwana.\n\nWpisz SET bez parametrw aby wywietli wszystkie zmienne obecne w systemie.\n\n/C Zachowuje wielko liter nazwy zmiennej; domylnie nazwa zmiennej\n   przeksztacana jest na wielkie litery.\n\n/P Pyta uytkownika wartoci i przyporzdkowuje tekst wpisany\n   przez uytkownika zmiennej.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nZmienia pozycje parametrw w pliku wsadowym.\n\nSHIFT [DOWN]\n\nDOWN przesuwa wartoci w kierunku pocztku (%%0); w przeciwnym wypadku\nw kierunku koca.\n.\n\n:TEXT_CMDHELP_TIME#1\nWywietla lub ustawia czas systemowy.\n\nTIME [/T] [time]\n\nWpisz TIME bez adnych parametrw aby wywieti obecny czas wraz z pytaniem\no jego zmian.  Wcinij ENTER aby zachowa ten sam czas.\n\n/T Wycza interaktywno programu TIME.\n.\n\n:TEXT_CMDHELP_TRUENAME\nWywietla pen ciek okrelonej cieki.\n\nTRUENAME [dysk:][cieka][nazwapliku]\n.\n\n:TEXT_CMDHELP_TYPE\nWywietla zawarto plikw tekstowych.\n\nTYPE [dysk:][cieka]nazwapliku\n.\n\n:TEXT_CMDHELP_VER\nWywietla wersj shell'u FreeDOS i inne informacje.\n\nVER [/R] [/W] [/D] [/C]\n\n /R         Wywietla wersj jdra i inne informacje.\n /W         Gwarancja shell'u FreeDOS.\n /D         Informacje na temat rozpowszechniania shell'u FreeDOS.\n /C         Wsptwrcy shell'u FreeDOS.\n.\n\n:TEXT_CMDHELP_VERIFY\nNakazuje systemowi plikw FreeDOS sprawdzanie poprawnoci zapisu plikw\nna dysk.\n\nVERIFY [ON | OFF]\n\nWpisz VERIFY bez parametru aby wywietli obecny ustawienie VERIFY.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nJeli debugowanie jest wkompilowane w FreeDOS, polecenie to wczy lub\nwyczy komunikaty debug, lub wywietli w jakim jest obecnie stanie.\n\nFDDEBUG [ON | OFF | plik]\n\nWpisz FDDEBUG bez parametru aby wywietli obecny stan DEBUG.\nJeli podany jest jaki plik, wszystkie komunikaty debug zostan\nprzekierowane do tego pliku; jeli plik ju istnieje, komunikaty\nzostan do niego dodane. Urzdzenia specjalne \"stdout\" i \"stderr\"\nmog by uyte do przekierowania komunikatw do standardowego\nwyjcia lub wyjcia bdw.\n.\n\n:TEXT_CMDHELP_VOL\nWywietla etykiet zbioru oraz numer seryjny, jeli istniej.\n\nVOL [dysk:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nWywietla list polece i usug dostpnych poprzez shell.\n\n?\n?polecenie [argument]\n\nPierwszy wariant wywietla wszystkie dostpne polecenia i usugi wewntrzne.\nDrugi pyta o potwierdzenie wykonania polecenia tak jakby wczony by tryb\n\"krok po kroku\"\n.\n\n:TEXT_CMDHELP_WHICH\nWyszukuje i wywietla plik wykonywalny odpowiedzialny za podane polecenie.\n\nWHICH polecenie...\n.\n\n:TEXT_CMDHELP_MEMORY#1\nWywietla wewntrzn pami uywan przez FreeCOM.\n\nMEMORY\n\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\ncieka docelowa COPY nie moe zawiera znaku plus ('+').\n.\n\n:TEXT_DELETE_FILE#1%\nKasowanie pliku \"%s\".\n.\n\n:TEXT_ERROR_WRITE_FILE_DISC_FULL#0%\nNie mona pisa do pliku '%s';\ndysk prawdopodobnie peny? (%lu wymaganych bajtw)\n.\n\n# Displayed for BIGcopy(), when copying takes quite a long time.\n# **_NO_END if the input file size is unknown.\n# Both must end in \\r rather than \\n!!\n:TEXT_COPY_COPIED_NO_END#0%\nskopiowano %luKB/???KB\\r\\\n.\n:TEXT_COPY_COPIED#0%\nskopiowano %luKB/%luKB\\r\\\n.\n\n:TEXT_ERROR_FCOM_IS_DEVICE#0%\nFreeCOM nie moe by urzdzeniem: \"%s\"\n.\n:TEXT_ERROR_FCOM_INVALID#0%\nPlik nie jest prawidowym plikiem FreeCOM, lub jest w niekompatybilnej wersji:\n%s\n.\n\n:TEXT_ERROR_LOADING_STRINGS\nFailed to load the strings resource into memory, the location\npointed to in %COMSPEC% seems to be invalid. Please specify another\nlocation of FreeCOM to try to load the strings from, e.g.:\nC:\\\\COMMAND.COM\nor just hit enter to cancel to load the strings.\n.\n\n:TEXT_TERMINATING\nZakaczanie w toku.\n.\n\n:TEXT_HIDDEN_CRITER#0%\n%u Critical Error requests suppressed.\n.\n\n# The exit reasons MUST be kept in this order!\n:TEXT_DISP_EXITCODE#0%\nExit code (ERRORLEVEL): %u, reason: %u (%s)\n.\n:TEXT_EXIT_REASON_NEG_1\nDOS API error\\\n.\n:TEXT_EXIT_REASON_0\nzakoczono poprawnie\\\n.\n:TEXT_EXIT_REASON_1\nterminated by ^Break\\\n.\n:TEXT_EXIT_REASON_2\nzakoczono krytycznym bdem\\\n.\n:TEXT_EXIT_REASON_3\ngone resident\\\n.\n"
  },
  {
    "path": "strings/pt.err",
    "content": "# $Id: DEFAULT.ERR $\n#\n# Critical error national customization file\n#\n#\tLanguage: Portuguese\n#\tCodepage: CP860\n#\tAuthor:   Fabjo Arbaro\n# \n\n\n## Primary strings\nS2\nBLOCK_DEVICE: Erro %1 na unidade %A: %2 rea: %3\nS3\nCHAR_DEVICE: Erro %1 no dispositivo %A: %3\n\n## kind of operation\nS0\nREAD: lendo de\nS1\nWRITE: escrevendo para\n\n## kind of failed area of block devices\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: raiz\nS7\nDATA: dados\n\n## action strings\nS8\nIGNORE: (I)gnorar\nS9\nRETRY: (R)epetir\nS10\nABORT: (A)bortar\nS11\nFAIL: (F)alhar\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: iI\nKEYS_RETRY:  rR\nKEYS_ABORT:  aA\nKEYS_FAIL:   fF\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN: Cdigo de erro desconhecido\nS15\n0: tentativa de violao de proteco de escrita\n1: unidade desconhecida para controlador\n2: unidade no preparada\n3: comando desconhecido dado a controlador\n4: erro de dados (cdigo CRC invlido)\n5: dimenso da estructura de pedido ao controlador invlida\n6: erro de busca\n7: tipo de suporte desconhecido\n8: sector no encontrado\n9: impressora sem papel\n10: falha de escrita\n11: falha de leitura\n12: falha genrica\n13: falha de partilha\n14: falha de bloqueio\n15: troca de disco invlida\n16: FCB indisponvel\n17: memria partilhada esgotada\n18: pgina de cdigos incompatvel\n19: entrada esgotada\n20: espao em disco insuficiente\n"
  },
  {
    "path": "strings/pt.lng",
    "content": "# $Id: DEFAULT.LNG $\n#\n# FreeCOM national customization file\n#\n#\tLanguage: Portuguese\n#\tCodepage: CP860\n#\tAuthor:   Fabjo Arbaro\n# \n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH#0%\nParmetro invlido. - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH#0%\nParmetro invlido. - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION#0%\nOpo malformada: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG#0%\nOpo '%s' no pode ter argumentos\n.\n\n:TEXT_ERROR_OPT_NOARG#0%\nOpo '%s' deve ter um argumento\n.\n\n:TEXT_INVALID_NUMBER#0%\nNmero invlido especificado em '%s'\n.\n\n:TEXT_ERROR_CLOSE_QUOTE#0%\nFecho de aspas em falta: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nNo  possvel criar ficheiro temporrio\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0%\nDemasiados parmetros. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nDemasiados parmetros.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER#0%\nParmetro invlido. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nCaminho no encontrado.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nFicheiro no encontrado.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND#0%\nFicheiro no encontrado. - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING#0%\nParmetro obrigatrio em falta.\n.\n\n:TEXT_ERROR_INVALID_DRIVE#0%\nUnidade invlida %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2%\nComando ou nome de ficheiro no reconhecidos - '%s'.\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nMemria esgotada.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nNo  possvel alocar memoria.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nNo  possvel abrir ficheiro temporrio para redireccionamento.\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE#0%\nLinha #%ld no ficheiro batch '%s' demasiado longa.\n.\n\n:TEXT_ERROR_BFILE_VANISHED#0%\nFicheiro batch '%s' no encontrado.\n.\n\n:TEXT_ERROR_BFILE_LABEL#0%\nFicheiro batch '%s' no contem a etiqueta '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1%\n%s falhou para '%s'.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR#0%\nNo  possvel alterar varivel de ambiente '%s'.\nAmbiente pode estar cheio.\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND#0%\nVarivel de ambiente '%s' no encontrada.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nNo h ambiente. Pode faltar memria. Use a opo /E.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1%\nNo  possvel definir alias '%s'. Pode no existir espao.\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1%\nAlias '%s' no encontrado.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nNo h espao para alias. Pode faltar memria.\n.\n\n:TEXT_ERROR_SYNTAX_STR#0%\nErro de sntaxe. - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nErro de sntaxe.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG#0%\nNome de ficheiro demasiado longo. - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY#0%\nNo  possvel copiar '%s' para si mesmo\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nLinha de comandos demasiado longa aps expanso.\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nLinha de comandos ultrapassa os 125 caracteres.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1%\nTamanho de histrico invlido '%s'.\n.\n\n:TEXT_HISTORY_EMPTY#1\nHistrico de linha de comandos vazio.\n.\n\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nCadeia MCB invlida ou sistema incompatvel com DOS.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR#0%\nErro indefinido %d.\n.\n\n:TEXT_ERROR_REGION_WARNING#0%\nRegio de memria invlida %d ignorada.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nDeve especificar ON ou OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nEspecificao de varivel invlida.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR: IN em falta.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nParntesis em falta.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR: DO em falta.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR: Comando em falta aps DO.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE#0%\nNo  possvel redireccionar entrada de ficheiro '%s'.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE#0%\nNo  possvel redireccionar sada para ficheiro '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nRediccionamento vazio.\n.\n\n:TEXT_ERROR_INVALID_DATE\nData invlida.\n.\n\n:TEXT_ERROR_INVALID_TIME\nHora invlida.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nEtiqueta no especificada em GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nComando CTTY no implementado neste COMMAND.COM.\n.\n\n:TEXT_ERROR_NORW_DEVICE#0%\nDispositivo invlido ou sem acesso de leitura-escrita '%s'.\n.\n\n:TEXT_ERROR_CTTY_DUP#0%\nNo foi possvel alterar o descritor do TTY '%s'.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\nOpo /L no implementada.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\nOpo /U no implementada.\n.\n\n:TEXT_ERROR_WRITING_DEST\nErro ao escrever para destino.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE#0%\nNo  possvel abrir origem '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE#0%\nNo  possvel abrir ficheiro '%s'\n.\n\n:TEXT_ERROR_READ_FILE#0%\nNo  possvel ler de ficheiro '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE#0%\nNo  possvel escrever para ficheiro '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\nCarcter de concatenao '+' no pode preceder os argumentos.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nCarcter de concatenao '+' no pode seguir-se aos argumentos.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nNada por fazer.\n.\n\n:TEXT_ERROR_COPY\nCOPY falhou\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: nome de ficheiro em falta\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: nmero em falta\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: nmero invlido\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: Comando em falta\n.\n\n:TEXT_NOT_IMPLEMENTED_YET\nAinda no implementado.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nNo foi possvel carregar mensagens para memria.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nOpo /MSG foi excluda deste COMMAND.COM.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1%\n%u itens mostrados.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nLinha de comandos corrompida. Este  um erro interno no intrprete de comandos.\nPor favor, reporte o problema para <freecom@freedos.org>.\n.\n\n:TEXT_QUOTED_C_OR_K#1\nAs opes /C e /K no podem estar entre aspas (estas so ignoradas).\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1%\nCaminho para COMMAND.COM deve ser completo.\nExemplo: C:\\\\FDOS\n\nCOMMAND.COM assumir este caminho agora:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nNo foi possvel restaurar sesso e definies locais foram perdidas.\nConsulte as mensagens de erro acima para compreender este erro.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nNo foi possvel guardar sesso durante chamada ao programa.\nConsulte as mensagens de erro acima para compreender este erro.\n.\n\n:TEXT_ERROR_CWD_FAILED#1%\nUnidade %c: no responde.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nTroca falhou: Aliases consomem demasiada memria.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nTroca falhou: No  possvel alocar memria distante.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nEspao para aliases esgotado.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1%\nAlias no encontrado: '%s'\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nNo foi possvel inserir alias.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1%\nNome de alias invlido '%s'.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nNo  possvel carregar mdulo de contexto ou gestor de erros crticos.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nFalta de memria para contexto.\nSe este erro persistir, tente aumentar buffers internos.\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1%\nTamanho do contexto (%lu bytes) excede o limite mximo.\nRedimensionando contexto para %u bytes.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nNo foi possvel adicionar informao de estado ao contexto. Este erro pode\nindicar uma corrupo de memria ou um tamanho mnimo de texto incorrecto.\nPor favor, reporte o problema para <freecom@freedos.org>.\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nContexto em falta aps troca.\nUm novo contexto ser criado mas algumas definies sero perdidas.\n.\n\n:TEXT_ERROR_PERMISSION_DENIED#1%\n%s: Permisso negada\n.\n\n:TEXT_ERROR_NO_SUCH_FILE#1%\n%s: No existe tal ficheiro ou directrio\n.\n\n:TEXT_ERROR_UNKNOWN_ERROR#1%\n%s: Erro desconhecido\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nCarregue em qualquer teclar para continuar...\\\n.\n\n:TEXT_MSG_HISTORY_SIZE#0%\nTamanho do histrico: %d bytes.\n.\n\n:TEXT_MSG_DOSKEY\nAs funcionalidades do DOSKEY j esto activadas.\n.\n\n:TEXT_MSG_ECHO_STATE#0%\nECHO est %s\n.\n\n:TEXT_MSG_VERIFY_STATE#0%\nVERIFY est %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE#0%\nDEBUG est %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET#0%\nSada de DEBUG escrita para '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE#0%\nBREAK est %s\n.\n\n:TEXT_MSG_LFNFOR_STATE#0%\nLFNFOR est %s\n.\n\n:TEXT_MSG_LFNFOR_COMPLETE_STATE#0%\nAutocomplemento de nomes de ficheiros longos est %s\n.\n\n:TEXT_MSG_CURRENT_DATE#0%\nData actual: %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1%\nIntroduza uma nova data (mm%sdd%s[cc]yy): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1%\nIntroduza uma nova data (dd%smm%s[cc]yy): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1%\nIntroduza uma nova data ([cc]yy%smm%sdd): \\\n.\n\n:TEXT_MSG_CURRENT_TIME#0%\nHora actual: %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nIntruduza uma nova hora: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING#0%\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1%\nSsNn{CR}{LF}{CBREAK}\naabb   b   b       b\nTodos os ficheiros em '%s' sero eliminados!\nDeseja continuar (S/N) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nSsNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [Sim=ENTER, No=ESC] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n# by \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1%\nSsNnTtAa{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\nControl-Break pressionado.\\r\nTerminar batch '%s' (Sim/No/Todos) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1%\nSsNnTtAa{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nSobrescrever '%s' (Sim/No/Todos/Abortar) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_APPEND_FILE#1%\nSsNnTtAa{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nAcrescentar a '%s' (Sim/No/Todos/Abortar) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1%\nSsNnTtAa{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nEliminar '%s' (Sim/No/Todos/Abortar) ? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<unknown>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nPilha de directrios vazia.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1%\n Volume na unidade %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING#0%\n %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nno tem etiqueta\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER#0%\n Nmero de srie do volume  %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1%\n%10s ficheiro(s)\\\n.\n:TEXT_DIR_FTR_BYTES#0%\n   %12s bytes\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nNmero de ficheiros listados:\n.\n:TEXT_DIR_FTR_DIRS#1%\n%10s directrios(s)\\\n.\n:TEXT_DIR_FTR_BYTES_FREE#0%\n %15s bytes livres\n.\n:TEXT_DIR_DIRECTORY#0%\nDirectrio %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE#0%\n Directrio %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1%\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE#1%\n%s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1%\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1%\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <DIR> \\\n.\n:TEXT_DIR_LINE_SIZE#1%\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1%\n%-14s\\\n.\n\n:TEXT_MSG_PATH#0%\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nNenhum caminho de pesquisa definido.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nDom\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nSeg\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nTer\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nQua\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\nQui\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\nSex\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nSb\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\nnenhum ficheiro eliminado.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\num ficheiro eliminado.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1%\n%u ficheiros eliminados.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nComandos internos disponveis:\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\nFuncionalidades disponveis:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[aliases] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[entrada avanada] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[histrico] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[autocomplemento de nomes de ficheiro] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[troca] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[iniciar log] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[ltimo directrio] \\\n.\n:TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1\n[nomes de ficheiro longos] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[troca no kernel] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[troca com XMS] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[troca por omisso] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[comandos instalveis] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[suporte para lnguas (NLS)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[pilha de directrio (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[depurao FreeCOM] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nPressione F8 para modo passo-a-passou, ou F5 para ignorar %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0%\nIgnorando '%s'.\n.\n\n:TEXT_MSG_VER_DOS_VERSION#0%\nDOS verso %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nKernel FreeDOS (build 1933 ou anterior)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS#0%\nKernel FreeDOS verso %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\nCopyright (C) 1994-2022 Tim Norman e outros.\n\nEste programa  distribudo na esperana de que possa ser til,\nmas SEM NENHUMA GARANTIA; sem uma garantia implcita de ADEQUAO\na qualquer MERCADO ou APLICAO EM PARTICULAR.\nVeja a Licena Pblica Geral GNU para mais detalhes.\n\nEnvie relatrios de erros para <freedos-freecom@lists.sourceforge.net>.\nActualizaes disponveis em <http://freedos.sourceforge.net/freecom>.\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\nCopyright (C) 1994-2022 Tim Norman e outros.\n\nEste programa  distribudo na esperana de que possa ser til,\nmas SEM NENHUMA GARANTIA; sem uma garantia implcita de ADEQUAO\na qualquer MERCADO ou APLICAO EM PARTICULAR.\nVeja a Licena Pblica Geral GNU para mais detalhes.\n\nEnvie relatrios de erros para <freedos-freecom@lists.sourceforge.net>.\nActualizaes disponveis em <http://freedos.sourceforge.net/freecom>.\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\nEste intrprete de comandos foi desenvolvido por muitas pessoas.\nLer o ficheiro 'HISTORY.TXT' para mais detalhes.\n\nActualmente mantido por Steffen Kaiser <freecom@freedos.org>.\nEnvie relatrios de erros para <freedos-freecom@lists.sourceforge.net>.\nActualizaes disponveis em <http://freedos.sourceforge.net/freecom>.\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nTentou fechar o intrprete de comandos mas isto no  permitdo, talvez por\\r\nter sido usada a opo /P. Ter de reiniciar o sistema ou, caso esteja num\\n\nsistema multi-tarefa, terminar o processo respectivo manualmente.\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nExecutvel do FreeCOM no encontrado. Deve fornecer um caminho completo\npara o COMMAND.COM como primeiro parmetro do COMMAND.\nExemplo: C:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1%\nSegmento de ambiente   : mximo %5u bytes; livre %5u bytes\n.\n:TEXT_MEMORY_CONTEXT#1%\nSegmento de contexto   : mximo %5u bytes; livre %5u bytes\n.\n:TEXT_MEMORY_HEAP#1%\nHeap                   : livre %5lu bytes\n.\n:TEXT_MEMORY_CTXT_ALIAS#1%\n\\tAliases              : limite %5u bytes, actual %5u bytes, %5u itens\n.\n:TEXT_MEMORY_CTXT_HISTORY#1%\n\\tHistrico            : limite %5u bytes, actual %5u bytes, %5u itens\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1%\n\\tPilha de directrios : limite %5u bytes, actual %5u bytes, %5u itens\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1%\n\\tltimos directrios  : usado %5u bytes, %5u itens\n.\n:TEXT_MEMORY_CTXT_BATCH#1%\n\\tAninhamento de batch : usado %5u bytes, %5u itens\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1%\n\\tInformao de troca  : usado %5u bytes, %5u itens\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nNo foi possvel obter a pgina de cdigos do sistema.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nNo foi possvel alterar a pgina de cdigos actual.\n.\n:TEXT_DISPLAY_CODEPAGE#1%\nPgina de cdigos actual: %u.\nPgina de cdigos do sistema: %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nMostra, altera ou remove aliases.\n\nALIAS [varivel[=][valor]]\n\n  varivel  Especifica o nome do alias.\n  valor     Define uma srie de caracteres a associar ao alias.\n\n\nUse ALIAS sem parmetros para mostrar os aliases actuais.\n.\n\n:TEXT_CMDHELP_BEEP\nProduz um sinal sonoro.\n.\n\n:TEXT_CMDHELP_BREAK\nLiga ou desliga a verificao de CTRL+C.\n\nBREAK [ON | OFF]\n\nUse BREAK sem parmetros para mostrar o estado actual.\n.\n\n:TEXT_CMDHELP_CALL#1\nChama um batch a partir de outro.\n\nCALL [/S | /N] [/Y] [unidade:][caminho]ficheiro [parmetros]\n\n  /S          Garante troca do FreeCOM.\n  /N          Desliga troca do FreeCOM.\n  /Y          Liga o rastreamento durante a execuo.\n  parmetros  Especifica parmetros passados ao batch.\n.\n\n:TEXT_CMDHELP_CD\nMostra ou altera o directrio actual.\n\nCHDIR [unidade:][caminho]\nCHDIR [..]\nCD [unidade:][caminho]\nCD [..]\nCD [-]\n\n  ..  Indica que queremos mudar para o directrio acima.\n  -   Muda para o directrio actual (se a funcionalidade estiver ligada).\n\nUse CD unidade: para mostrar o directrio actual em determinada unidade.\nUse CD sem parmetros para mostrar a unidade e directrio actuais.\n\nVer tambm: CDD\n.\n\n:TEXT_CMDHELP_CDD\nMostra ou altera a unidade e directrio actuais.\n\nCDD [unidade:][caminho]\nCDD [..]\n\n  ..  Indica que queremos mudar para o directrio acima.\n  -   Muda para o directrio actual (se a funcionalidade estiver ligada).\n\nCaso uma unidade seja especificada, a unidade actual  tambm mudada.\nEsta  a nica diferena em relao aos comandos \"CHDIR\" e \"CD\".\n\nUse CD sem parmetros para mostrar a unidade e directrio actuais.\n.\n\n:TEXT_CMDHELP_CHCP\nMostra ou altera o nmero da pgina de cdigos activa.\n\nCHCP [nmero]\n\n  nmero  Especifica o nmero da pgina de cdigos.\n\nUse CHCP sem parmetro para mostrar o nmero da pgina de cdigos activa.\n.\n\n:TEXT_CMDHELP_CLS\nLimpa o visor.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\nInicia uma nova cpia do intrprete de comandos.\n\nCOMMAND [caminho] [dispositivo] [/E:tamanho] [/L:tamanho] [/U:tamanho]\n        [/P] [/MSG] [/LOW] [/Y [/[C|K] comando]]\n\n  caminho      Especifica o caminho completo para o COMMAND.COM.\n  dispositivo  Indica o disositivo a utilizar para entrada e sada de comandos.\n  /E:tamanho   Determina o tamanho inical do ambiente em bytes.\n               Valor entre 256 e 32768.\n  /L:tamanho   Determina o tamanho dos buffers internos em bytes.\n               Valor entre 128 e 1024. Requer opo /P.\n  /U:tamanho   Determina o tamanho dos buffers internos em bytes.\n               Valor entre 128 e 255. Requer opo /P.\n  /P           Cria intrprete de comandos permanente (no pode ser fechado).\n  /MSG         Armazena amensagens de erro em memria. Requer opo /P.\n  /LOW         Fora dados residantes a serem mantidos na memria baixa.\n  /Y           Avana passo-a-passo em batch passado nos parmetros /C ou /K.\n  /C comando   Executa um comando especfico e sai.\n  /K comando   Executa um comando especfico a continua aberto.\n.\n\n:TEXT_CMDHELP_COPY\nCopia um ou mais ficheiros para outra localizao.\n\nCOPY [/A | /B] origem [/A | /B] [+ source [/A | /B] [+ ...]]\n     [destino [/A | /B]] [/V] [/Y | /-Y]\n\n  origem   Especifica o ficheiro ou ficheiros a serem copiados.\n  /A       Indica um ficheiro de texto ASCII.\n  /B       Indica um ficheiro binrio.\n  destino  Especifica o directrio e/ou nome ficheiro de destino.\n  /V       Verifica se os novos ficheiros so escritos correctamente.\n  /Y       Suprime a confirmao de sobrescrita de ficheiros existentes.\n  /-Y      Liga a confirmao de sobrescrita de ficheiros existentes.\n\nA opo /Y pode ser predefinida na varivel de ambiente COPYCMD.\nNeste caso a opo pode ser desligada usando /-Y na linha de comandos.\n\nPara concatenar ficheiros, especifique vrios ficheiros como origem (usando\nwildcards ou na forma ficheiro1+ficheiro2+...) mas um nico como destino.\n.\n\n:TEXT_CMDHELP_CTTY\nAltera o dispositivo de terminal usado para controlar o sistema.\n\nCTTY dispositivo\n\n  dispositivo  Dispositivo de terminar pretendido (como COM1).\n.\n\n:TEXT_CMDHELP_DATE#1\nMostra ou altera a data do sistema.\n\nDATE [/D | data]\n\n  /D  Previne o pedido interactivo de nova data.\n\nUse DATE sem parmetros para mostrar a data actual e opcionalmente alter-la.\n.\n\n:TEXT_CMDHELP_DEL#2\nElimina um ou mais ficheiros.\n\nDEL ficheiros [/P] [/V]\nERASE ficheiros [/P] [/V]\n\n  ficheiros  Especifica o(s) ficheiro(s) a eliminar.\n  /P         Pede confirmao antes de eliminar cada ficheiro.\n  /V         Mostra o nome de todos os ficheiros eliminados.\n.\n\n:TEXT_CMDHELP_DIR#4\nMostra uma lista de ficheiros e subdirectrios num directrio.\n\nDIR [unidade:][caminho][nome] [/P] [/W] [/A[[:]atributos]]\n  [/O[[:]ordem]] [/S] [/B] [/L]\n\n /P         Pausa aps cada visor cheio de informao.\n /W         Usa formato de listagem alargada.\n /A         Mostra ficheiros com atributos especficos.\n atributos    D  Directrios           R  Ficheros apenas de leitura\n              H  Ficheiros escondidos  A  Files prontos a arquivar\n              S  Ficheiros de sistema  -  Prefixo significando negao\n /O:        Lista ficheiros ordernados.\n ordem        N  Por nome              S  Por tamanho (crescente)\n              E  Por extenso          D  Por data e hora (cronolgicas)\n              G  Agrupa directrios    -  Prefixo significando ordem inversa\n              U  No ordenar (idntico a /ONG).\n /S         Mostra ficheiros no directrio e todos os seus subdirectrios.\n /B         Usa formato mnimo (sem cabealho nem sumrio).\n /L         Usa minsculas apenas.\n /Y ou /4   Mostra anos de 4 dgitos.\n\nOpes podem ser predefinidas na varivel de ambiente DIRCMD. Opes\npredefinidas podem ser desligadas prefixando qualquer opo com '-' na\nlinha de comandos. Por exemplo, /-W para desligar listagem alargada.\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nUtilitrio DOSKEY integrado no FreeCOM.\n\nUse as teclas Cima e Baixo para navegar o histrico e HISTORY para mostr-lo.\nUse as teclas Esquerda, Direita, Home e End para navegar dentro de uma linha\nde comandos e Insert para alternar entre modo de insero e sobreposio.\nUse a tecla Tab para completar a palavra corrente como nome de ficheiro, ou\npressione-a duas vezes para mostrar todos os ficheiros correspondentes.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nEdita ou recupera linhas de comando e cria macros\n\nDOSKEY [/opes...] [nome=[texto]]\n\n  /BUFSIZE:tamanho  Define o tamanho do buffer (por omisso 512).\n  /ECHO:on|off      Liga ou desliga expanso de macros (ligada por omisso).\n  /FILE:ficheiro    Especifica o ficheiro contendo lista de macros.\n  /HISTORY          Mostra todos os comandos armazenados em memria.\n  /INSERT           Insere novos caracteres na linha ao escrever.\n  /KEYSIZE:tamanho  Define o tamanho do buffer de escrita antecipada\n                    (por omisso 15).\n  /LINE:tamanho     Define o tamanho mximo do buffer de edio da linha\n                    (por omisso 128).\n  /MACROS           Lista todas as macros.\n  /OVERSTRIKE       Sobrescreve caracteres na linha ao escrever\n                    (ligado por omisso).\n  /REINSTALL        Instala uma nova cpia do DOSKey.\n  nome              Especifica o nome da macro a criar.\n  texto             Indica o texto que deve ser associado com a macro.\n\nTeclas:\n  Cima/Baixo  Recuperar comandos.\n  Esc         Limpar comando actual.\n  F7          Mostrar histrico de comandos.\n  ALT+F7      Limpar histrico de comandos.\n  [texto]F8   Procurar por comando comeado por 'texto'.\n  F9          Selecciona um comando pelo nmero.\n  Alt+F10     Limpar definies de macros.\n\nCdigos especiais que podem ser usados em definies de macros:\n  $T          Separador de comandos (permite vrios comandos numa macro).\n  $1-$9       Parmetros (Equivalentes a %1-%9 em ficheiros batch).\n  $*          Representa todos os parmetros passados  macro.\n.\n\n:TEXT_CMDHELP_ECHO\nMostra uma mensagem, ou liga e desliga o eco dos comandos.\n\n  ECHO [ON | OFF]\n  ECHO [mensagem]\n\nUse ECHO sem parmetros para mostrar o estado de eco corrente\n.\n\n:TEXT_CMDHELP_EXIT\nSai do intrprete de comandos ou de um batch.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\nExecuta um comando especfico para cada ficheiro num conjunto.\n\nFOR %varivel IN (conjunto) DO comando [parmetros]\n\n  %varivel  Especifica o nome da varivel definida.\n  conjunto   Indica o conjunto de ficheiros percorrido.\n  comando    Define o comando a ser executado para cada ficheiro.\n  parmetros Define os parmetros passados ao comando.\n\nExemplo:\n  FOR %f IN (a b c) DO ECHO - %f -\n\nPara usar o FOR num batch, especifique %%varivel em vez de %varivel.\n.\n\n:TEXT_CMDHELP_GOTO\nRedirecciona a execuo para a linha de uma etiqueta num batch.\n\nGOTO etiqueta\n\nUma etiqueta  definida numa linha cotendo apenas ':etiqueta'.\n.\n\n:TEXT_CMDHELP_HISTORY#1\nMostra o contedo do histrico de linhas de comando ou define o seu tamanho.\n\nHISTORY [tamanho]\n\n  tamanho  Define um novo tamanho para o buffer do histrico.\n  \nUse HISTORY sem parmetros para mostrar o contedo actual do histrico.\n.\n\n:TEXT_CMDHELP_IF\nExecuta um comando condionalmente.\n\nIF [NOT] ERRORLEVEL nmero comando\nIF [NOT] texto1==texto2 comando\nIF [NOT] EXIST ficheiro comando\n\n  comando           Especifica o comando a executar de acordo com a condio.\n  NOT               Executar comando apenas a condio seguinte seja falsa.\n  ERRORLEVEL nmero Comando ser executado apenas no caso de o ltimo programa\n                    executado ter resultado num cdigo de sada igual pi\n                    superior ao valor indicado.\n  texto1==texto2    Comando ser executado caso os dois textos coincidam.\n  EXIST ficheiro    Comando ser executado caso o ficheiro indicado exista.\n.\n\n:TEXT_CMDHELP_LFNFOR\nLiga ou desliga nomes de ficheiro longos no comando FOR e autocomplemento.\n\nLFNFOR [ON | OFF]\nLFNFOR COMPLETE [ON | OFF]\n\nUse LFNFOR ou LFNFOR COMPLETE para obter o estado actual da opo.\n.\n\n:TEXT_CMDHELP_LH\nCarrega um progama na rea de memria superior.\n\nLOADHIGH [unidade:][caminho]nome [parmetros]\nLOADHIGH [/L:regio[,min][;regio2[,min2]...] [/S]]\n         [unidade:][caminho]nome [parmetros]\n\n  /L  Especifica as regies de memria para onde carregar o programa,\n      incluindo opcionalmente o tamanho mnimo de cada regio.\n  /S  Reduz UMB ao seu tamanho mnimo ao carregar o programa.\n.\n\n:TEXT_CMDHELP_LOADFIX\nCarega um programa acima dos primeiros 64KB de memria.\n\nLOADFIX [unidade:][caminho]nome\n\nUse LOADFIX para carregar um programa caso tenha obtido um erro \"Packed file\ncorrupt\" ao tentar execut-lo normalmente.\n.\n\n:TEXT_CMDHELP_MD\nCria um directrio.\n\nMKDIR [unidade:]caminho\nMD [unidade:]caminho\n.\n\n:TEXT_CMDHELP_PATH\nMostra ou altera o caminho de pesquisa de executveis.\n\nPATH [[unidade:]caminho[;...]]\nPATH ;\n\nUse PATH ; para limpar todas as definies de caminhos de pesquisa e obrigar\no intrprete de comandos a procurar apenas no caminho actual.\n\nUse PATH sem parmetros para mostrar a definio actual.\n.\n\n:TEXT_CMDHELP_PAUSE\nSuspende o processamento, mostrando uma mensagem.\n\nPAUSE [mensagem]\n\nCaso nenhuma mensagem seja especificada, ser mostrada por omisso a seguinte:\n\"Carregue em qualquer teclar para continuar...\"\n.\n\n:TEXT_CMDHELP_PROMPT\nAltera o pedido da linha de comandos.\n\nPROMPT [texto]\n\n  texto  Especifica o pedido a mostrar no incio de cada linha de comandos.\n\nCdigos especiais que podem ser usados na definio:\n\n  $Q   Sinal de igual '='.\n  $$   Cifro '$'.\n  $T   Hora actual.\n  $D   Data actual.\n  $P   Unidade e caminho actuais.\n  $V   Nmero de verso do intrprete de comandos.\n  $N   Unidade actual.\n  $G   Sinal de maior '>'.\n  $L   Sinal de menor '<'.\n  $B   Barra vertical '|'.\n  $H   Retrocesso (apaga carcter anterior).\n  $E   Cdigo de escape (cdigo ASCII 27).\n  $_   Quebra de linha (cdigos ASCII 13 e 10).\n\nUse PROMPT sem parmetros para restaurar a definio por omisso.\n.\n\n:TEXT_CMDHELP_PUSHD\nAdiciona o directrio actual  pilha de directrios, opcionalmente mudando\ntambm em seguida o directrio actual.\n\nPUSHD [[unidade:]caminho]\n\n  [unidade:]caminho  Indica qual o directrio para onde mudar.\n\nUse\tPUSHD sem parmetros se no pretender mudar o directrio actual.\n.\n\n:TEXT_CMDHELP_POPD\nRetira um directrio da pilha de directrios e muda para ele.\n\nPOPD [*]\n\nUsando o parmetro '*' a pilha de directrios  limpa.\n.\n\n:TEXT_CMDHELP_DIRS\nLista o contedo da pilha de directrios.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\nRemove um directrio vazio.\n\nRMDIR [unidade:]caminho\nRD [unidade:]caminho\n.\n\n:TEXT_CMDHELP_REM\nRegista um comentrio num batch ou no CONFIG.SYS.\n\nREM [texto]\n.\n\n:TEXT_CMDHELP_REN\nRenomeia um ou vrios ficheiros ou directrios.\n\nRENAME [unidade:][caminho][origem] [destino]\nREN [unidade:][caminho][origem] [destino]\n\nNote que no podem se pode ser especificados caminho ou unidade diferentes\npara o ficheiro ou directrio de destino. Use o comando MOVE para esse fim.\n.\n\n:TEXT_CMDHELP_SET#1\nMostra, altera ou remove variveis de ambiente.\n\nSET [/C] [/P] [/E] [/U] [varivel[=[texto]]]\n\n  varivel  Especifica o nome da varivel de ambiente.\n  texto     Define o valor atribudo  varivel (ou um comando usando /E).\n  /C        Manter maisculas e minsculas no nome da varivel (por omisso o\n            nome  passado para maisculas caso a varivel ainda no exista\n            ou mantido caso corresponda a uma varivel existente.\n  /P        Pedir um valor ao utilizador e associ-lo  varivel.\n  /E        Definir o valor da varivel para a sada do comando no texto.\n  /U        Converter o valor atribudo  varivel para maisculas.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nAltera a posio dos parmetros numricos num batch.\n\nSHIFT [DOWN]\n\nCaso se use DOWN, os parmetros sero em direco ao primeiro (%%0),\ncaso contrrio em direco ao ltimo (%9).\n.\n\n:TEXT_CMDHELP_TIME#1\nMostra ou altera a hora do sistema.\n\nTIME [/T | hora]\n\n  /T  Previne o pedido interactivo de nova hora.\n\nUse TIME sem parmetros para mostrar a hora actual e opcionalmente alter-la.\n.\n\n:TEXT_CMDHELP_TRUENAME\nMostra o caminho completo de um ficheiro ou directrio indicados.\n\nTRUENAME [unidade:][caminho][nome]\n.\n\n:TEXT_CMDHELP_TYPE\nMostra o contedo de um ficheiro de texto.\n\nTYPE [unidade:][caminho]nome\n.\n\n:TEXT_CMDHELP_VER\nMostra a verso do intrprete de comandos e outras informaes.\n\nVER [/R] [/W] [/D] [/C]\n\n /R         Informao sobre a verso do kernel e outras.\n /W         Garantia do intrprete de comandos. \n /D         Informao sobre distribuio do intrprete de comandos.\n /C         Contribuidores para o projecto do intrprete de comandos.\n.\n\n:TEXT_CMDHELP_VERIFY\nDefine se o sistema de ficheiros deve verificar a escrita em disco.\n\nVERIFY [ON | OFF]\n\nUse VERIFY para obter o estado actual desta definio.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nLigar ou desligar escrita da informao de depurao ou mostrar o seu estado.\n\nFDDEBUG [ON | OFF | ficheiro]\n\nUse FDDEBUG sem parmetros para mostrar a definio actual.\n\nSe um ficheiro for indicado, toda a informao de depurao ser adicionada\nnesse ficheiro. Podem ser usados os nomes especiais \"stdout\" ou \"stderr\" para\nespecificar as streams de sada e erro por omisso.\n\nEsta opo s poder ser ligada se o FreeDOS tiver sido compilado com suporte\npara informao de depurao.\n.\n\n:TEXT_CMDHELP_VOL\nMostra a etiqueta de volume e o nmero de srie do disco, caso existam.\n\nVOL [unidade:]\n\nUse VOL sem parmetros para mostrar a informao da unidade actual.\n.\n\n:TEXT_CMDHELP_QUESTION#1\nMostra os comandos e funcionalidades disponveis no intrprete de comandos.\n\n?\n?comando [parmetros]\n\nSem qualquer comando, so mostrados os comandos e funcionalidades disponveis.\n\nCaso seja indicado um comando, ser mostrado um pedido de confirmao antes de\nexecut-lo como se o modo passo-a-passo estivesse activo.\n.\n\n:TEXT_CMDHELP_WHICH\nMostra o ficheiro executvel para cada comando especificado.\n\nWHICH comandos...\n.\n\n:TEXT_CMDHELP_MEMORY#1\nMostra a memria interna utilizada pelo intrprete de comandos.\n\nMEMORY\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\nNo podem existir caracteres '+' na especificao de destino.\n.\n\n:TEXT_DELETE_FILE#1%\nEliminando ficheiro '%s'.\n.\n\n:TEXT_ERROR_WRITE_FILE_DISC_FULL#0%\nNo  possvel escrever no ficheiro '%s'.\nTalvez o disco esteja cheio (%lu bytes requeridos).\n.\n\n# Displayed for BIGcopy(), when copying takes quite a long time.\n# **_NO_END if the input file size is unknown.\n# Both must end in \\r rather than \\n!!\n:TEXT_COPY_COPIED_NO_END#0%\ncopiado %luKB/???KB\\r\\\n.\n:TEXT_COPY_COPIED#0%\ncopiado %luKB/%luKB\\r\\\n.\n\n:TEXT_ERROR_FCOM_IS_DEVICE#0%\nFreeCOM no pode ser um dispositivo: '%s'\n.\n:TEXT_ERROR_FCOM_INVALID#0%\nEste ficheiro no  um FreeCOM vlido ou tem uma verso incompatvel:\n%s\n.\n\n:TEXT_ERROR_LOADING_STRINGS\nNo foi possvel as carregar mensagens para memria, o caminho indicado por\n%COMSPEC% parece ser invlido. Especifique uma localizao vlida do FreeCOM\nde onde carregar as mensagens (por exemplo, \"C:\\\\COMMAND.COM\"), ou pressione\nEnter para cancelar o carregamento das mensagens.\n.\n\n:TEXT_TERMINATING\nTerminando agora.\n.\n\n:TEXT_HIDDEN_CRITER#0%\n%u pedidos de erros crtico suprimidos.\n.\n\n# The exit reasons MUST be kept in this order!\n:TEXT_DISP_EXITCODE#0%\nCdigo de sada (ERRORLEVEL): %u, motivo: %u (%s)\n.\n:TEXT_EXIT_REASON_NEG_1\nErro da API DOS\\\n.\n:TEXT_EXIT_REASON_0\nterminado normalmente\\\n.\n:TEXT_EXIT_REASON_1\nterminado por ^Break\\\n.\n:TEXT_EXIT_REASON_2\nterminado por erro crtico\\\n.\n:TEXT_EXIT_REASON_3\ntornado residente\\\n.\n"
  },
  {
    "path": "strings/pt_br.err",
    "content": "# $Id$\n#\n# Critical error national customization file\n#\n#\tLanguage: pt/BR\n#\tAuthor:   Max Velasques\n\n# Traduzido em 19 de agosto 2002\n# Por Max Velasques\n# Site: www.maxfreewares.hpg.com.br\n\n## Strings primarias\nS2\nBLOCK_DEVICE: Erro %1 drive %A: %2 area: %3\nS3\nCHAR_DEVICE: Erro %1 periferico %A: %3\n\n## Tipos de operacoes\nS0\nREAD: carregando de\nS1\nWRITE: gravando para\n\n## tipos de falhas da area de blocos de perifericos\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: root\nS7\nDATA: dados\n\n## Strings de acao\nS8\nIGNORE: (I)gnorar\nS9\nRETRY: (T)entar de novo\nS10\nABORT: (A)bortar\nS11\nFAIL: (F)alha\n## teclas associadas com as acoes\nS14 (compacted)\nKEYS_IGNORE: iI\nKEYS_RETRY:  rT\nKEYS_ABORT:  aA\nKEYS_FAIL:   fF\n## Strings embutidas\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Strings de erro\nUNKNOWN: Codigo do erro desconhecido\nS15\n0: violacao de protecao-contra-grvacao\n1: unidade para driver desconhecida\n2: drive nao esta pronto\n3: comando desconhecido dado para o driver\n4: erro de dados (CRC invalido)\n5: tamanho da estrutura de requisicao de driver de periferico e invalido\n6: erro de busca\n7: tipo de midia desconhecida\n8: setor nao encontrado\n9: impressora sem papel\n10: erro de escrita\n11: erro de leitura\n12: falha geral\n13: violacao de compartilhamento\n14: violacao de trava\n15: mudanca de disco invalida\n16: FCB nao disponivel\n17: sobrecarregamento de buffer compartilhado\n18: codico de pagina nao combina\n19: falta de entrada\n20: espaco em disco insuficiente\n"
  },
  {
    "path": "strings/pt_br.lng",
    "content": "# $Id$\n#\n# FreeCOM national customization file\n#\n#\tLanguage: pt/BR\n#\tAuthor:   Max Velasques\n# \n# Traduzido em 19 de agosto 2002\n# Por Max Velasques\n# Site: www.maxfreewares.hpg.com.br\n# \n# Este arquivo e usado para gerar todas as mensagens que o command.com\n# mostra.  Este arquivo e a entrada para o programa fixstrs, e ele\n# retorna os arquivos strings.h e strings.dat.  O arquivo .DAT e adicionado\n# ao arquivo command.exe, que e entao renomeado para command.com.  O arquivo .H\n# contem todas as informacoes para o programa mostrar as mensagens.\n#\n# O formato deste arquivo e simples.  Linhas em branco e linhas iniciando\n# com \"#\" sao ignoradas.\n# Cada mensagem inicia com um rotulo que ira ser usado para referendar\n# a mensagem no programa.  Um rotulo inicia com \"dois pontos\" \":\".\n#\n# Todas as linhas depois do rotulo sao mensagens ate uma linha com um\n# unico \".\" ou \",\" na primeira coluna.  A diferenca e o que o ponto (\".\")\n# significa que sera terminada com um retorno de carro, porem com a\n# virgula isto nao acontece.\n#\n#\n\n\n#\n#  Estas sao as mensagems de erro\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH\nA opcao e invalida. - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH\nA opcao e invalida. - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION\nA opcao esta mal-formada: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG\nA opcao '%s' nao pode ter argumentos\n.\n\n:TEXT_ERROR_OPT_NOARG\nA opcao '%s' precisa ter argumentos\n.\n\n:TEXT_INVALID_NUMBER\nO numero especificado em '%s' e invalido\n.\n\n:TEXT_ERROR_CLOSE_QUOTE\nFaltando caracter de fechamento: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nImpossivel criar arquivo temporario\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR\nHa muitos parametros. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nHa muitos parametros.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER\nO parametro e invalido. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nCaminho nao encontrado.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nArquivo nao encontrado.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND\nArquivo nao encontrado. - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING\nO paramentro requerido esta faltando.\n.\n\n:TEXT_ERROR_INVALID_DRIVE\nO drive %c: e invalido.\n.\n\n:TEXT_ERROR_BADCOMMAND\nComando ou nome de arquivo invalido.\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nErro de falta de memoria.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nA alocacao de memoria do DOS falhou.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nImpossivel canalizar!  Impossivel abrir arquivo temporario!\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE\nA linha #%ld no Arquivo de Lote '%s' e muito longa.\n.\n\n:TEXT_ERROR_BFILE_VANISHED\nO Arquivo de Lote '%s' nao foi encontrado.\n.\n\n:TEXT_ERROR_BFILE_LABEL\nO Arquivo de Lote '%s' nao contem o rotulo '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1\n%s falhou por '%s'.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR\nImpossive definir variavel de ambiente '%s'.\nO ambiente esta cheio?\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND\nA variavel de ambiente '%s' nao foi encontrada.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nNao ha espaco de ambiente. Talves a memoria esteja curta. Especifique a opcao /E.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1\nImpossivel definir apelido(alias) '%s'. O espaco de apelido(alias) esta cheio?\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1\nO apelido(alias) '%s' nao foi encontrado.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nNao ha espaco de apelido(alias). Talves a memoria esteja curta.\n.\n\n:TEXT_ERROR_SYNTAX_STR\nErro de sintaxe. - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nErro de sintaxe.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG\nNome de arquivo muito longo. - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY\nImpossivel copiar '%s' para ele mesmo.\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nLinha de comando muito longa depois da expansao do apelido(alias)!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nLinha muito longa.  Impossivel executar comando.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1\nO tamanho do historico '%s' e invalido.\n.\n\n:TEXT_HISTORY_EMPTY#1\nHistorico de linha de comando esta vazio.\n.\n\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nO encadeamento MCB esta corrompido, ou o sistema MS-DOS e incompativel.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR\nO erro %d e indefinido.\n.\n\n:TEXT_ERROR_REGION_WARNING\nA regiao %d da memoria e ilegal - ignorado.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nE preciso especificar ON ou OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nEspecificacao de variavel invalida.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR: Faltando IN.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nUm ou ambos os parenteses estao faltando.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR: Faltando DO.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR: Nao ha comando depois da declaracao DO.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE\nImpossivel redirecionar entrada do arquivo '%s'.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE\nImpossivel redirecionar saida para arquivo '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nO redirecionamento esta vazio.\n.\n\n:TEXT_ERROR_INVALID_DATE\nData invalida.\n.\n\n:TEXT_ERROR_INVALID_TIME\nHora invalida.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nNenhum rotulo foi especificado para o GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nO comando CTTY foi retirado deste COMMAND.COM.\n.\n\n:TEXT_ERROR_NORW_DEVICE\nO periferico '%s' e invalido, ou nao e de Leitura-Escrita.\n.\n\n:TEXT_ERROR_CTTY_DUP\nFalha ao mudar descritor de arquivo para TTY '%s'.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\n/L ainda nao foi implementado.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\n/U ainda nao foi implementado.\n.\n\n:TEXT_ERROR_WRITING_DEST\nErro gravando no destino.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE\nImpossivel abrir origem. - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE\nImpossivel abrir arquivo '%s'\n.\n\n:TEXT_ERROR_READ_FILE\nImpossivel ler do arquivo '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE\nImpossivel gravar para o arquivo '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\nO caracter de concatenacao '+' nao pode ser colado aos argumentos.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nO caracter de concatenacao '+' nao pode vir seguido dos argumentos.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nNada para fazer.\n.\n\n:TEXT_ERROR_COPY\nCOPY falhou.\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: faltando nome de arquivo\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: faltando numero\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: numero invalido\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: Faltando comando\n.\n\n:TEXT_NOT_IMPLEMENTED_YET\nDesculpe...ele nao foi implementado ainda.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nFalha ao carregar messagens na memoria.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nA opcao /MSG foi retirada deste COMMAND.COM.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1\n%u itens mostrados.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nLinha de comando corrompida. Este e um erro interno e e relacionado\ncomo o COMMAND.COM roda no sistena. Por favor avise-nos sobre este erro.\n.\n\n:TEXT_QUOTED_C_OR_K#1\nAs opcoes /C e /K nao puderam ser utilizadas, elas serao ignoradas.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1\nO caminho para o COMMAND.COM precisa esta completamente qualificado!\nIsto inclue a letra do drive e iniciando com uma barra invertida.\nPor exemplo: C:\\\\FDOS\n\nCOMMAND.COM assume  este caminho agora:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nA informacao da sessao nao pode ser restaurada, nenhuma das configuracoes\nlocais serao perdidas. Por favor veja as mensagens de erro para descobrir\na razao deste problema.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nA informacao atual nao pode ser preservada durante a chamada do\nprograma.  Por favor veja as mensagens de erro para descobrir\na razao deste problema.\n.\n\n:TEXT_ERROR_CWD_FAILED\nDrive %c: nao esta respondendo ou esta com falta de memoria interna.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nFalha quando trocando: Os apelidos(aliases) alocaram muita memoria.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nFalha quando trocando: Impossivel alocar muita memoria.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nFora do espaco de apelidos(aliases).\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1\nO apelido(alias) nao foi encontrado: '%s'\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nFalha ao inserir apelido(alias).\n.\n\n:TEXT_ALIAS_INVALID_NAME#1\nO nome de apelido(alias) '%s' e invalido.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nImpossivel carregar Modulo de Contexto ou Manipulador de Erros Criticos.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nContexto fora da memoria.\nSe este erro persistir, considere aumentar o buffer interno,\ncomo o do historico, pilha do diretorio, etc.\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1\nO tamanho total de contextos de %lu bytes excede o limite maximo.\nLimitando o contexto para %u bytes.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nFalha para adicionar informacoes de status no contexto. Esta mensagem de\nerro pode indicar que a memoria esta corrompida ou o tamanho minimo do\ncontexto determinado esta incorreto. Por favor informe ao sustentadore do\nFreeCOM em: freedos-devel@lists.sourceforge.net\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nO contexto esta faltando depois da troca. O contexto foi recriado,\nmas todos os apelido(aliases) foram perdidos.\n.\n\n#\n# Mensagens de informacao\n#\n\n:TEXT_MSG_PAUSE#1\nPressione qualquer tecla para continuar . . .\\\n.\n\n:TEXT_MSG_HISTORY_SIZE\nO tamanho do historico e de %d bytes.\n.\n\n:TEXT_MSG_DOSKEY\nO DOSKEY ja esta ativado no shell.\n.\n\n:TEXT_MSG_ECHO_STATE\nECHO esta %s\n.\n\n:TEXT_MSG_VERIFY_STATE\nVERIFY esta %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE\nA saida de DEBUG esta %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET\nA saida de DEBUG e impressa para '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE\nBREAK esta %s\n.\n\n:TEXT_MSG_CURRENT_DATE\nA data atual e %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1\nEntre a nova data (mm%sdd%s[cc]aa): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1\nEntre a nova data (dd%smm%s[cc]aa): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1\nEntre a nova data ([cc]aa%smm%sdd): \\\n.\n\n:TEXT_MSG_CURRENT_TIME\nA hora atual e %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nEntre uma nova hora: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1\nSsNs{CR}{LF}{CBREAK}\naabb   b   b       b\nTodos os arquivo em '%s' serao apagados!\nVoce tem certeza que deseja continuar (S/N)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nSsNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [Sim=ENTER, Nao=ESC] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#\tby \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1\nSsNnTtQq{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\nControl-Break foi pressionado.\\r\nVoce deseja terminar o Arquivo de Lote '%s' (Sim/Nao/Todos) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1\nSsNnTtCc{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nDeseja sobrescrever '%s' (Sim/Nao/Todos/Cancelar) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1\nSsNnTtCc{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nDeseja apagar '%s' (Sim/Nao/Todos/Cancelar) ? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<desconhecido>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nA pilha do diretorio esta vazia.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1\n O volume no drive %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING\ne %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nnao tem rotulo\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER\n O Numero de Serie do volume e %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1\n%10s arquivo(s)\\\n.\n:TEXT_DIR_FTR_BYTES\n   %12s bytes\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nTotal de arquivos listados:\n.\n:TEXT_DIR_FTR_DIRS#1\n%10s dir(s)\\\n.\n:TEXT_DIR_FTR_BYTES_FREE\n %15s bytes livres\n.\n:TEXT_DIR_DIRECTORY\nDiretorio de %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE\n Diretorio de %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE\n%-13s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <DIR> \\\n.\n:TEXT_DIR_LINE_SIZE#1\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1\n%-14s\\\n.\n\n:TEXT_MSG_PATH\nCaminho=%s\n.\n:TEXT_MSG_PATH_NONE#1\nNenhum caminho para procura definida.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nDom\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nSeg\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nTer\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nQua\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\nQui\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\nSex\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nSab\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\nnenhum arquivo foi removido.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\num arquivo foi removido.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1\n%u arquivos foram removidos.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nComandos internos disponiveis:\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\nCaracteristicas disponiveis:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[apelidos] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[entrada avancada] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[historico] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[complemento de nome_de_arquivo] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[trocando] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[iniciando log] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[ultimo diretorio] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[kernel swap] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[XMS swap] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[padrao para swap] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[comandos instalaveis] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[pilha de diretorio (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[depurando FreeCOM] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nPressione F8 para o modo de trilha, ou F5 para contornar %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC\nContornando '%s'.\n.\n\n:TEXT_MSG_VER_DOS_VERSION\nVersa do DOS %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nKernel do FreeDOS (compilacao 1933 ou anterior)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS\nVersao do Kernel do FreeDOS %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\nCopyright (C) 1994-2001 Tim Norman and others.\n\nEste programa e distribuido na esperanca de que ele possa ser util,\nmas SEM NENHUMA GARANTIA; sem nunca implicar em garantia de\nMERCATIBILIDADE ou AJUSTE PARA UM PROPOSITO PARTICULAR.  Veja a GNU\nGeneral Public License por mais detales.\n\nEnvie informacoes sobre bugs para freedos-devel@lists.sourceforge.net.\nAtualizacoes estao disponiveis em http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\nCopyright (C) 1994-2001 Tim Norman and others.\n\nEste programa e um software livre; voce pode redistribui-lo e/ou modifica-lo\nsobre os termos da GNU General Public License como publicado pela Free\nSoftware Foundation; ou na versao 2 da Licensa, ou (na sua opcao)\nqualquer versao posterior.\n\nEnvie informacoes sobre bugs para freedos-devel@lists.sourceforge.net.\nAtualizacoes estao disponiveis em http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\nO interpretador decomando do FreeDOS e desenvolvido por muitos programadores,\npor favor veja para anexar o arquivo HISTORY.TXT.\n\nEnvie informacoes sobre bugs para freedos-devel@lists.sourceforge.net.\nAtualizacoes estao disponiveis em http://freedos.sourceforge.net/freecom\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nO shell esta proximo de ser terminado, embora, este seja\\r\nesquecido (usualmente ativando a opcao \"/P\").\\r\nVoce precisa reiniciar o sisyema ou, se este shell roda em\\r\num ambiente multi-tarefa, termina este processo/tarefa manualmente.\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nO execultavel do FreeCOM nao foi encontrado.\nVoce precisa especificar o caminho completo para o COMMAND.COM\ncomo o primeiro argumento do COMMAND, por instancia:\nC:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1\nSegmento de ambiente   : max %5u bytes; livre %5u bytes\n.\n:TEXT_MEMORY_CONTEXT#1\nSegmento de Contexto   : max %5u bytes; livre %5u bytes\n.\t\n:TEXT_MEMORY_HEAP#1\nPilha                  : livre %5lu bytes\n.\n:TEXT_MEMORY_CTXT_ALIAS#1\n\\tApelidos               : limite %5u bytes, atual %5u bytes, %5u itens\n.\n:TEXT_MEMORY_CTXT_HISTORY#1\n\\tHistorico              : limite %5u bytes, current %5u bytes, %5u itens\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1\n\\tPilha de diretorios    : limite %5u bytes, current %5u bytes, %5u itens\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1\n\\tUltimo Dir_cache       : usado  %5u bytes, %5u itens\n.\n:TEXT_MEMORY_CTXT_BATCH#1\n\\tAninhamento de Batch's : usado  %5u bytes, %5u itens\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1\n\\tInformacoes de Swap    : usado  %5u bytes, %5u itens\n.\n\n\n#\n# Texo de Comandos de Ajuda\n#\n\n:TEXT_CMDHELP_ALIAS\nMostra, define, ou remove apelidos.\n\nALIAS [variavel[=][string]]\n\n\tvariavel  Especifica o nome do apelido.\n\tstring    Especifica uma serie de caracteres para especificar o apelido.\n\n\nDigite ALIAS sem parametros para mostrar os apelidos atuais.\n.\n\n:TEXT_CMDHELP_BEEP\nEmite um som 'beep'.\n.\n\n:TEXT_CMDHELP_BREAK\nDefine ou limpa a checagem extendida do CTRL+C.\n\nBREAK [ON | OFF]\n\nDigite BREAK sem parametros para mostrar as configuracoes atuais.\n.\n\n:TEXT_CMDHELP_CALL#1\nRoda um arquivo de lote de dentro de outro.\n\nCALL [/S | /N] [drive:][caminho]nome_de_arquivo [parametros_do_arquivo]\n\n  parametros_do_arquivo   Especifica qualquer linha-de-comando requerida pelo\n                          arquivo de lote que esta sendo chamado.\n/S forcar, /N nega troca(SWAP) do FreeCOM.\n.\n\n:TEXT_CMDHELP_CD\nMostra o nome de ou muda o diretorio atual.\n\nCHDIR [drive:][caminho]\nCHDIR[..]\nCD [drive:][caminho]\nCD[..]\nCD -\n\n  ..   Especifica que voce quer mudar para o diretorio anterior.\n  -    Se opcao \"ultimo diretorio\" esta ativada, muda para o ultimo diretorio.\n\nDigite CD drive: para mostrar diretorio atual no drive especificado.\nDigite CD sem parametros para mostrar o drive e diretorio atual.\nVeja tambem: CDD\n.\n\n:TEXT_CMDHELP_CDD\nMostra o nome de ou muda o drive e diretorio atual.\n\nCDD [drive:][path]\nCDD[..]\n\n  ..   Especifica que voce quer mudar para o diretorio anterior.\n  -    Se opcao \"ultimo diretorio\" esta ativada, muda para o ultimo diretorio.\n\nSe drive: e especificado, o drive atual e mudado; esta e a unica\ndiferenca para \"CHDIR\".\nDigite CD sem parametros para mostrar o drive e diretorio atual.\n.\n\n:TEXT_CMDHELP_CHCP\nMostra ou define o numero de codigo de pagina ativo.\n\nCHCP [nnn]\n\n  nnn   Especifica um numero de codigo de pagina.\n\nDigite CHCP sem um parametro para mostrar o numero de pagina ativo.\n.\n\n:TEXT_CMDHELP_CLS\nLimpa a tela.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\nInicia uma nova copia do interpretador de comandos do FreeDOS.\n\nCOMMAND [[drive:]caminho] [periferico] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG]\n                       [/LOW] [/Y [/[C|K] comando]]\n  [drive:]path    Especifica o diretorio contendo o COMMAND.COM.\n  device          Especifica que periferico usar para entrada e saida de comandos.\n  /E:nnnnn        Define o tamanho do ambiente inicial environment para nnnnn bytes.\n                  (nnnnn deve estar entre 256 e 32,768).\n  /L:nnnn         Especifica o tamanho do buffer interno (requer /P).\n                  (nnnn dever estar entre 128 e 1,024).\n  /U:nnn          Especifica o tamanho do buffer entrada (requer /P).\n                  (nnn dever estar entre 128 e 255).\n  /P              Faz o interpretador de comandos permanente (nao pode sair).\n  /MSG            Grava todas as mensagens de erro na memoria (requer /P).\n  /LOW            Obriga o interpretador manter os dados residentes em\n                  memoria baixa.\n  /Y              Passado atraves de Arquivos de Lotes especificado por /C ou /K.\n  /C command      Executa o comando especificado e retorna.\n  /K command      Executa o comando especificado e continua rodando.\n.\n\n:TEXT_CMDHELP_COPY\nCopia um ou mais arquivos para outro lugar.\n\nCOPY [/A | /B] origem [/A | /B] [+ origem [/A | /B] [+ ...]] [destino\n  [/A | /B]] [/V] [/Y | /-Y]\n\n  source       Especifica o arquivo ou arquivos a serem copiados.\n  /A           Indica um arquivo de texto ASCII.\n  /B           Indica um arquivo binario.\n  destino      Especifica o diretorio e/ou o nome de arquivo para\n               o(s) novo(s) arquivo(s).\n  /V           Verifica se os novos arquivos foram gravados corretamente.\n  /Y           Suprimir confirmacao de que voce deseja sobrescrever um arquivo\n               de destino ja existente.\n  /-Y          Mostra confirmacao de que voce deseja sobrescrever um arquivo\n               de destino ja existente.\n\nA opcao /Y pode ser predefinida na variavel de ambiente COPYCMD.\nIsto pode ser sobrescrito com /-Y na linha de comando.\n\nPara juntar arquivos, especifique um unico arquivo para destino, mas\nmultiplos arquivos para a origem (usando o formato arquivo1+arquivo2+arquivo3).\n.\n\n:TEXT_CMDHELP_CTTY\nMuda o periferico terminal usado para controlar seu sistema.\n\nCTTY periferico\n\n  periferico   O periferico terminal que voce quer usar, como a COM1.\n.\n\n:TEXT_CMDHELP_DATE#1\nMostra ou define a data.\n\nDATE [/D] [data]\n\nDigite DATE sem parametros para mostrar a data atual, e pedir\numa nova data.  Pressione ENTER para manter a mesma data.\n\n/D prevents DATE to become interactive.\n.\n\n:TEXT_CMDHELP_DEL\nApagar um ou mais arquivos.\n\nDEL [drive:][caminho]nome_do_arquivo [/P]\nERASE [drive:][caminho]nome_do_arquivo [/P]\n\n  [drive:][caminho]nome_do_arquivo  Especifica os arquivos a serem apagados.\n\t\t\t\t    Especifique multiplos arquivos usando\n                                    wildcards.\n  /P\t\t                    Pede por confirmacao antes de apagar cada\n                                    arquivo.\n.\n\n:TEXT_CMDHELP_DIR#1\nMostra uma lista de arquivos e subdiretorios em um diretorio.\n\nDIR [drive:][caminho][nome_do_arquivo] [/P] [/W] [/A[[:]atributos]]\n  [/O[[:]sortorder]] [/S] [/B] [/L]\n\n  [drive:][caminho][nome_do_arquivo]\n            Especifica um drive, diretorio, e/ou arquivos para listar.\n            (Nao pode ser adicionado especificacao de arquivos ou multiplas\n            especificacoes.)\n /P         Pausa depois de cada informacao de tela cheia.\n /W         Usa formato de lista largo.\n /A         Mostra arquivos com atributos especificados.\n            [SELECAO DE ATRIBUTOS AINDA NAO IMPLEMENTADA; /A e /ADRHS]\n attributes  D  Diretorios                    R  Arquivos somente-para-leitura\n             H  Arquivos ocultos              A  Arquivos pronto para arquivamento\n             S  Arquivos do sistema           -  Prefixo sem significado\n /O         Lista os arquivos em ordem. [AINDA NAO IMPLEMENTADA]\n sortorder   N  Por nome (alfabetica)         S  Por tamanho (pequenos primeiro)\n             E  Por extensao (alfabetica)     D  Por data e hora (novos primeiro)\n             G  Grupo de diretorios primeiro  -  Prefixo para reverter ordem\n             A  Por ultima Data de Accesso (novos primeiro)\n /S         Mostra os arquivos em diretorios especificados e em todos os\n            subdiretorios.\n /B         Usa formato simples(sem informacoes de cabecario ou sumario).\n /L         Usa minusculas.\n /V         Modo verboso.\n /Y         Mostra anos com 4 digitos.\n\nAs opcoes podem ser predefinidas na variavel de ambiente DIRCMD.\nSobrescreva as predefinicoes colocando em qualquer opcao um - (hifem)\nPor exemplo: /-W.\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nO utilitario externo DOSKEY foi incorporado ao FreeCOM.\nUse as teclas de Seta PARA CIMA & PARA BAIXO para chamar o historico\ne HISTORY para mostra-lo.\nUse as teclas de Seta PARA ESQUERDA & PARA DIREITA e END & HOME para\nnavegar nas linha de comandos e modifica-los em modo de insercao ou\nsobrescrever.\nUse a tecla TAB para completar a palavra atual com nome do arquivo;\nuse ele duas vezes para mostrar todos os arquivos encontrados.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nEdita e chama novamente linhas de comando, e cria macros.\n\nDOSKEY [/opcao ...] [nome_do_macro=[texto]]\n\n  /BUFSIZE:size Define o tamanho do macro e buffer de comando          (default:512)\n  /ECHO:on|off  Ativa/desativa echo de expansao de macros              (default:on)\n  /FILE:file    Especifica arquivos contendo uma lista de macros\n  /HISTORY      Mostra todos os comandos gravados na memoria\n  /INSERT       Insere novos caracteres na linha quando digitando\n  /KEYSIZE:size Define o tamanho do buffer de digitacao do teclado     (default:15)\n  /LINE:size    Define o tamanho maximo do buffer de edicao linha      (default:128)\n  /MACROS       Mostra todos os mascros do DOSKey\n  /OVERSTRIKE   Sobrescreve novos caracteres na linha quando digitando (default)\n  /REINSTALL    Instala uma nova copia do DOSKEY\n  macroname     Especifica um nome para o macro que voce criar\n  text          Especifica os comandos que voce que associar ao macro\n\nCIMA,BAIXO estas setas re-executam comandos\n       Esc limpa comando atual\n       F7 mostra historico de comandos\n   Alt+F7 limpa historico de comandos\n[carac]F8 procura comandos iniciados pelo [carac]\n       F9 seleciona um comando pelo seu numero\n  Alt+F10 limpa todas as definicoes de macros\n\nOs seguintes sao codigos especiais que voce pode usar na\ndefinicoes de macros do DOSKey:\n  $T     Separador de Comandos: permite multiplos comandos em\n         um macro\n  $1-$9  Parametros de Arquivos de Lote: equivalente ao %1-%9\n         em Arquivos de Lotes\n  $*     Simbolo substituido por todos os nomes de macro seguintes\n         na linha de comando\n.\n\n:TEXT_CMDHELP_ECHO\nMostra mensagens, ou define as saidas dos programas em\nLIGADO(ON) ou DESLIGADO(OFF).\n\n  ECHO [ON | OFF]\n  ECHO [mensagem]\n\nDigite ECHO sem parametros para mostrar as configuracoes atuais.\n.\n\n:TEXT_CMDHELP_EXIT\nFecha o Interpretador de comandos do FreeDOS.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\nExecuta um comando especificado para cada arquivo em um conjunto de arquivos.\n\nFOR %%variavel IN (set) DO comando [parametros-de-comandos]\n\n  %%variavel  Especifica um parametro substituivel.\n  (set)      Especifica um ou mais arquivos.  Wildcards podem ser usados.\n  comando    Especifica o comando a ser executado para cada arquivo.\n  parametros-de-comandos\n             Especifica os parametros ou opcoes para o comando especificado.\n\nPara usar o comando FOR em um arquivo de lote, especifique %%%%variavel ao\ninves de %%variavel.\n\nPor exemplo:\n  FOR %%f IN (---inicio--- a*.* ---fim---) DO ECHO - %%f -\n.\n\n:TEXT_CMDHELP_GOTO\nRedireciona o interpretador de comando para uma linha rotulada em um\narquivo de lote\n\nGOTO rotulo\n\n  rotulo   Especifica um texto que sera usado em um arquivo de lote com\n           um rotulo\n\nVoce digita um rotulo em uma linha por ele mesmo, iniciado com dois\npontos (:).\n.\n\n:TEXT_CMDHELP_HISTORY#1\nComando Historico\n\nHISTORY [tamanho]\n\nSem o \"tamanho\", o conteudo atual do buffer do historico e mostrado.\nCom o \"tamanho\", o tamanho buffer do historico e alterado.\n.\n\n:TEXT_CMDHELP_IF\nPossibilita processamento condicional em arquivos de lote.\n\nIF [NOT] ERRORLEVEL numero comando\nIF [NOT] string1==string2 comando\nIF [NOT] EXIST nome_de_arquivo comando\n\n  NOT               Especifica que o interpretador de comandos deve executar\n                    o comando somente se a condicao for falsa.\n  ERRORLEVEL number Especifica uma condicao verdadeira se o ultimo programa\n                    rodado retornou um codigo de saida igual ou maior que o\n                    numero especificado.\n  command           Especifica que comando que sera executado se a condicao\n                    for satisfeita.\n  string1==string2  Especifica uma condicao verdadeira se o texto definido\n                    for igual.\n  EXIST filename    Especifica uma condicao verdadeira se o nome_de_arquivo\n                    especificado existir.\n.\n\n:TEXT_CMDHELP_LH\nCarrega um programa na area de memoria alta.\n\nLOADHIGH [drive:][caminho]nome_de_arquivo [parametros]\nLOADHIGH [/L:regiao1[,tam_min1][;regiao2[,tam_min2]...] [/S]]\n         [drive:][caminho]nome_de_arquivo [parametros]\n\n/L:regiao1[,tam_min1][;regiao2[,tam_min2]]...\n            Especifica a(s) regiao(oes) da memoria para carregar o programa.\n            Regiao1 especifica o numero de primeira regiao da memoria;\n            tam_min1 especifica o tamanho minimo, seja qual for, para a regiao1.\n            Regiao2 e tam_min2 especifica o numero e o tamanho minimo da\n            segunda regiao, seja qual for.  Voce pode especificar quantas\n            regioes voce quiser.\n\n/S          Diminue um UMB para seu tamanho minimo enquanto o program e\n            carregado.\n\n[drive:][caminho]nome_de_arquivo\n            Especifica a localizacao e nome do programa.\n.\n\n:TEXT_CMDHELP_LOADFIX\nCarrega um program alem dos primeiros 64K de memoria, e roda o programa.\n\nLOADFIX [drive:][caminho]nome_de_arquivo\n\nUse LOADFIX para carregar um programa se voce tiver recebido a mensagem\n\"Pacote de arquivo corrompido\" quando tentando carregar em memoria baixa.\n.\n\n:TEXT_CMDHELP_MD\nCria um diretorio.\n\nMKDIR [drive:]caminho\nMD [drive:]caminho\n.\n\n:TEXT_CMDHELP_PATH\nMostra ou define um caminho procuravel para arquivo executaveis.\n\nPATH [[drive:]caminho[;...]]\nPATH ;\n\nDigite PATH ; para limpar todas as configuracoes definidas e direcionar o\ninterpretador para procurar somente no diretorio atual.\nDigite PATH sem parametros para mostrar os CAMINHOS atualmente definidos.\n.\n\n:TEXT_CMDHELP_PAUSE\nSuspende o processamento de um arquivo de lote e mostra a mensagem:\n\"Pressiona qualquer tecla para continuar....\" ou uma mensagem opcional\nespecificada.\n\nPAUSE [mensagem]\n.\n\n:TEXT_CMDHELP_PROMPT\nMuda o prompt de comando.\n\nPROMPT [texto]\n\n  text    Especifica um novo prompt de comando.\n\nO prompt pode ser feito de caracteres normais e os seguintes codigos\nespeciais:\n\n  $Q   = (sinal de igual)\n  $$   $ (sinal de dolar)\n  $T   Hora atual\n  $D   Data atual\n  $P   Drive e caminho atual\n  $V   O numero da versao do FreeCOM do FreeDOS\n  $N   Drive atual\n  $G   > (sinal maior-que)\n  $L   < (sinal menor-que)\n  $B   | (barra)\n  $H   Backspace (apaga caracteres anteriores)\n  $E   Escape code (Codigo ASCII 27)\n  $_   Retorno de carro e alimentacao de linha\n\nDigite PROMPT sem parametros para restaurar as configuracoes padrao.\n.\n\n:TEXT_CMDHELP_PUSHD\nArmazena o diretorio atual, com a opcao para mudar o diretorio atual.\n\nPUSHD [[drive:]caminho]\n  Onde [drive:]caminho e o caminho para onde voce que mudar.\n.\n\n:TEXT_CMDHELP_POPD\nRetira um diretorio de pilha de diretorios, e muda para ele.\n\nPOPD [*]\n  O parametro '*' limpa a pilha de diretorios.\n.\n\n:TEXT_CMDHELP_DIRS\nMostra o conteudo de uma pilha de diretorios.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\nRemove (apaga) um diretorio.\n\nRMDIR [drive:]caminho\nRD [drive:]caminho\n.\n\n:TEXT_CMDHELP_REM\nComenta (remarca) comandos em um arquivo de lote ou CONFIG.SYS.\n\nREM [comentario]\n.\n\n:TEXT_CMDHELP_REN\nRenomeia um arquivo/diretorio ou arquivos/diretorios.\n\nRENAME [drive:]caminho][diretorio1 | arquivo1] [diretorio2 | arquivo2]\nREN [drive:][caminho][diretorio1 | arquivo1] [diretorio2 | arquivo2]\n\nNote que voce nao pode especificar um novo drive ou caminho para o seu destino. Use\no comando MOVE para este proposito.\n.\n\n:TEXT_CMDHELP_SET#1\nMostra, define, ou remove variaveis de ambiente.\n\nSET [/C] [variavel=[string]]\n\n  variavel  Especifica o nome da variavel de ambiente.\n  string    Especifica uma serie de caracteres para associar a variavel.\n\n* Se nenhuma string e especificada, a variavel e removida do ambiente.\n\nDigite SET sem parametros para mostrar as variaveis de ambiente atuais.\n\n/C obriga a manter o nome da variavel como escrito; por padrao a variavel e\nem maiuscula, se ela nao e localizada no ambiente, que de outro modo e\nretornada.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nMuda a posicao dos parametros substituiveis em um arquivo de lote.\n\nSHIFT [DOWN]\n\nMuda a janela de argumentos que sera iniciada (%%0); que de outro modo\ntomado ate o fim.\n.\n\n:TEXT_CMDHELP_TIME#1\nMostra ou muda a hora do sistema.\n\nTIME [/T] [hora]\n\nDigite TIME sem parametross para mostrar a hota atual e um prompt\npara inserir uma nova hora. Pressione ENTER para mantes a mesma hora.\n\n/T mostra apenas a HORA, sem solicitar uma nova.\n.\n\n:TEXT_CMDHELP_TRUENAME\nMostra o caminho completo do caminho especificado.\n\nTRUENAME [drive:][caminho][nome_de_arquivo]\n.\n\n:TEXT_CMDHELP_TYPE\nMostra o conteudo de arquivos de texto.\n\nTYPE [drive:][caminho]nome_do_arquivo\n.\n\n:TEXT_CMDHELP_VER\nMostra a versao do FreeCOM do FreeDOS e outras informacoes.\n\nVER [/R] [/W] [/D] [/C]\n\n /R         Mostra a versao do kernel e outras informacoes.\n /W         Comando do FreeCOM de garantia.\n /D         Comando do FreeCOM com informacoes sobre redistribuicao.\n /C         Comando do FreeCOM com as nomes dos contribuidores.\n.\n\n:TEXT_CMDHELP_VERIFY\nChamado para verificar se seus arquivos estao gravados corretamente\nno disco.\n\nVERIFY [ON | OFF]\n\nDigite VERIFY sem parametros para mostrar as configuracoes atuais.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nSe a opcao de depuracao em compilada no FreeDOS, este comando ira\nativar/desativar a saida de depuracao, ou mostrar se ele esta\nativado/desativado.\n\nFDDEBUG [ON | OFF | arquivo]\n\nDigite FDDEBUG sem parametros para mostrar a configuracao de depuracao\natual.\nSe um arquivo e especificado, todas as saidas de depuracao e redirecionada\npara aquele arquivo; a saida e adicionada ao fim do arquivo, se ele ja\nexistir.\nOs nome especiais \"stdout\" e \"stderr\" podem ser usados para\nredirecionar a saida para a saida padrao ou o canal de erros padrao.\n.\n\n:TEXT_CMDHELP_VOL\nMostra o Volume do disco e o Numero de Serie, se eles existem.\n\nVOL [drive:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nMostra uma lista de comandos e caracteristicas disponiveis no FreeCOM.\n\n?\n?comando [argumento]\n\nA primeira variante mostra qualquer comando interno disponivel.\nO segundo ira perguntar se voce quer ou nao executar o comando\nespecificado como se o modo de trilha estivesse ativo.\n.\n\n:TEXT_CMDHELP_WHICH\nProcura e mostra o arquivo executavel para cada comando especificado..\n\nWHICH {comando}\n.\n\n:TEXT_CMDHELP_MEMORY#1\nMostra a memoria interna usada pelo FreeCOM internamente.\n\nMEMORY\n\n.\n"
  },
  {
    "path": "strings/russian.err",
    "content": "# $Id$\n#\n# Critical error national customization file\n#\n#\tLanguage: Russian\n#\tCodepage: CP866\n#\tAuthor:   anonymous\n#\n# The critical error (criter) handler receives some information\n# from the kernel about what error condition happens, generates some\n# human friendly message from it, requests the user's opinion about\n# how to proceed and, finally, returns to the kernel.\n#\n# The human friendly message is generated using one of the following\n# templates:\n# BLOCK_DEVICE (for criters on block devices)\n# \tError %1 drive %A: %2 area: %3\n# -and- CHAR_DEVICE (for criters on character devices)\n# \tError %1 device %A: %3\n#\n# Two-character sequences, which first character is a percent sign '%',\n# are placeholders for other information:\n# %% -> a single percent sign\n# %1 -> either READ or WRITE, depending on what kind of operation\n# \tcaused the criter\n# %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA\n# %3 -> the actual error string; these are the strings associated to\n# \ta number 0 through N, and must correspond to the number passed in\n# \tlowbyte(DI) to the criter handler (see RBIL INT-24 for details)\n# %A -> drive letter (for block devices); name of device (character devices)\n#\n# Below the line describing the error the user is prompted for the action\n# to proceed. This line is dynamically constructed depending on which\n# action are available at all. The full line may look like this:\n# \t(A)bort, (I)gnore, (R)etry, (F)ail?_\n#\n# The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They\n# should indicate which user response keys is associated with them;\n# suggested is to use the first letter and enclose it in parenthesises.\n# The delimiter \", \" can be defined with DELIMITER and is the same\n# for all slots.\n# The \"? \" sequence is defined by QUESTION.\n# The order of the actions is fixed and cannot be customized.\n#\n# With each action a number of user response keys must be associated.\n# They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ...\n# strings. Because the key is searched in the same format as returned\n# by INT-16-00, both upper and lower case must be specified and\n# certain special keys cannot be used.\n#\n# The individual error strings are defined by the #: lines, where\n# the hash sign '#' refers to the number the kernel passes to the\n# criter handler. The UNKNOWN string is displayed for all error\n# numbers not specified.\n#\n# NOTE #1: The percent rule applies to _all_ criter strings!\n# NOTE #2: Each string occupies exactly one line.\n# NOTE #3: Any leading or trailing whitespaces are removed. Prefix the\n#\tfirst or suffix the last whitespace with '%.' (one percent sign and\n#\tone dot). This sequence is removed from the string totally.\n# NOTE #4: To embed any character use: %&## (one percent sign,\n#\t\tone ampersand and exactly two hexa-decimal digits)\n\n## Primary strings\nS2\nBLOCK_DEVICE: 訡 %1  %A: %2 : %3\nS3\nCHAR_DEVICE: 訡 %1  %A: %3\n\n## kind of operation\nS0\nREAD: ⥭ \nS1\nWRITE:  \n\n## kind of failed area of block devices\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: ७\nS7\nDATA: \n\n## action strings\nS8\nIGNORE: ஢ (I)\nS9\nRETRY:  (R)\nS10\nABORT: ࢠ (A)\nS11\nFAIL: 訡 (F)\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: iI\nKEYS_RETRY:  rR\nKEYS_ABORT:  aA\nKEYS_FAIL:   fF\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN:   訡\nS15\n0: ⪠ 襭   \n1:    ࠩ\n2:   ⮢\n3: ࠩ 稫  \n4: 訡  ( CRC)\n5: ୠ    ࠩ ன⢠\n6: 訡 ᪠\n7:  ⨯ ⥫\n8: ᥪ  \n9:  ਭ 稫 㬠\n10: 訡 \n11: 訡 ⥭\n12:  訡\n13: 襭 \n14: 襭 ஢\n15: ୠ ᬥ ᪠\n16: FCB 㯥\n17: ९ 饣 \n18: ᮮ⢥⢨  ࠭\n19:  \n20: 筮   ᪥\n"
  },
  {
    "path": "strings/russian.lng",
    "content": "# $Id$\n#\n# FreeCOM national customization file\n#\n#\tLanguage: Russian\n#\tCodepage: CP866\n#\tAuthor:    ਩ ⨭, Petr-Akhlamov,\n#\t          㧭殢  堩.\n# \n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retreive the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#\t:TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n# If there is a percent sign (%) appended to the version, the printf()\n# format string %-style placeholders are compared for the strings. The\n# sign need to be set in DEFAULT.lng only.\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carrage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause an user interaction. Those ones should be in sync\n# with the issued text. To define how to interprete a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#YyNn\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceeding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the question\n# mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readibility of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH#0%\n⨬ . - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH#0%\n⨬ . - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION#0%\n⨬ : '%s'\n.\n\n:TEXT_ERROR_OPT_ARG#0%\n '%s'   㬥\n.\n\n:TEXT_ERROR_OPT_NOARG#0%\n '%s'   㬥\n.\n\n:TEXT_INVALID_NUMBER#0%\n୮ ᫮ 㪠  '%s'\n.\n\n:TEXT_ERROR_CLOSE_QUOTE#0%\n 뢠 窠: %c\n.\n\n:TEXT_ERROR_TEMPFILE\n ᮧ ६ 䠩\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0%\n誮  ࠬ஢. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\n誮  ࠬ஢.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER#0%\n⨬ ࠬ. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\n  .\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\n  .\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND#0%\n  . - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING#0%\n饭 易⥫ ࠬ.\n.\n\n:TEXT_ERROR_INVALID_DRIVE#0%\n  %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2%\n⭠   ୮  䠩 - \"%s\".\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\n訡. 筮 .\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\n 뤥  DOS.\n.\n\n:TEXT_ERROR_CANNOTPIPE\n७ࠢ :   ६ 䠩!\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE#0%\nப #%ld  ⭮ 䠩 '%s' ᫨誮 .\n.\n\n:TEXT_ERROR_BFILE_VANISHED#0%\n 䠩 '%s'  .\n.\n\n:TEXT_ERROR_BFILE_LABEL#0%\n 䠩 '%s'  ᮤন ⪨ '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1%\n%s ᡮ '%s'.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR#0%\n ⠭ 祭 ६ 㦥 '%s'.\n,    ६ 㦥 ९.\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND#0%\n६ 㦥 '%s'  .\n.\n:TEXT_ERROR_NO_ENVIRONMENT\n 뤥   ६ 㦥.\n१    樥: /E.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1%\n  ᥢ '%s'. , ⠡ ᥢ ९.\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1%\nᥢ '%s'  .\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\n 뤥   ⠡ ᥢ.\n.\n\n:TEXT_ERROR_SYNTAX_STR#0%\n⠪᪠ 訡. - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\n⠪᪠ 訡.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG#0%\n 䠩 ᫨誮 . - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY#0%\n ᪮஢ '%s'  ᠬ ᥡ\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\n ப ᫨誮  ᫥ ᥢ!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nப ᫨誮 .  믮 .\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1%\n ࠧ ਨ  ப '%s'.\n.\n\n:TEXT_HISTORY_EMPTY#1\n  ப .\n.\n\n\n:TEXT_ERROR_BAD_MCB_CHAIN\n窠  MCB ०,  ᮢ⨬  MS-DOS ⥬.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR#0%\n⭠ 訡 %d.\n.\n\n:TEXT_ERROR_REGION_WARNING#0%\nய饭 ०񭭠   %d.\n.\n\n:TEXT_ERROR_ON_OR_OFF\n  ON  OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\n୮ 㪠 ६.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR:  IN.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\n   ᪮ 뫨 ய饭.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR:  DO.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR:  㪠  ᫥ ⢥ত DO.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE#0%\n ७ࠢ   䠩 '%s'.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE#0%\n ७ࠢ 뢮  䠩 '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\n⮥ ७ࠢ.\n.\n\n:TEXT_ERROR_INVALID_DATE\n४⭠ .\n.\n\n:TEXT_ERROR_INVALID_TIME\n४⭮ ६.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\n 㪠 ⪠ ᫥ GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\n: CTTY ᪫祭  ⮣ COMMAND.COM.\n.\n\n:TEXT_ERROR_NORW_DEVICE#0%\n୮  ⠡쭮 ன⢮ '%s'.\n.\n\n:TEXT_ERROR_CTTY_DUP#0%\n  ਯ 䠩  TTY '%s'.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\n/L   ॠ.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\n/U   ॠ.\n.\n\n:TEXT_ERROR_WRITING_DEST\n   񬭨.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE#0%\n 㤠  筨. - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE#0%\n 㤠  䠩 '%s'\n.\n\n:TEXT_ERROR_READ_FILE#0%\n 㤠   䠩 '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE#0%\n 㤠   䠩 '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\n ꥤ '+'    । 㬥⮬.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\n ꥤ '+'    ᫥ 㬥⮢.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\n祣 .\n.\n\n:TEXT_ERROR_COPY\n ஢\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST:   㪠  䠩\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL:   㪠 ᫮\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: ୮ ᫮\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF:   㪠 \n.\n\n:TEXT_NOT_IMPLEMENTED_YET\n...  ॠ.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\n 㧪 ᮮ饭  .\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\n /MSG ᪫祭  ⮣ COMMAND.COM.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1%\n%u 㭪⮢ .\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\n०񭭠  ப.  ७ 訡 COMMAND.COM. ,\nᮮ  ⮩ 訡.\n.\n\n:TEXT_QUOTED_C_OR_K#1\n /C  /K     窠  ⮬ ந஢.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1%\n  䠩: COMMAND.COM   !\n  ᮤঠ  ᪠  稭  ⭮ ᮩ .\nਬ: C:\\\\FDOS\n\nCOMMAND.COM ᯮ  :\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nଠ  ᥠ 뫠 ⭮ ﭠ. ᬮ ।騥\nᮮ饭  訡  楫 ᭥ 稭 ⮩ 訡.\n.\n\n:TEXT_ERROR_SAVE_SESSION\n ଠ    ࠭  ⥪饩 ணࠬ. ᬮ\n।騥 ᮮ饭  訡  楫 ᭥ 稭 ⮩ 訡.\n.\n\n:TEXT_ERROR_CWD_FAILED#1%\n %c:  ⢥砥.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\n  祭ﬨ: ᥢ  ᫨誮  .\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\n  祭ﬨ:  뤥  .\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\n௠ ࠭⢮  ᥢ.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1%\n騩 ᥢ: '%s'\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\n ⠢ ᥢ.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1%\n୮  ᥢ '%s'.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\n 㧨 ⥪   ࠡ稪 ᪨ 訡.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\n௠   ⥪.\n᫨  訡 㤥   쭥襬, ஡ 㢥\nࠧ  ७ ஢, ਬ, ୠ ,\n⥪ ⠫  ..  ..\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1%\n ⥪ ॢᨫ ⨬ ।  %lu .\n ࠧ ⥪  ࠧ  %u .\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\n 樨  ᪮ ଠ樨  ⥪.  訡\n  - ०   - ୮ ⠭\n쭮 ࠧ ⥪. , ᢥ ࠧࠡ稪 FreeCOM\n ⮩ 訡 :\nfreedos-devel@lists.sourceforge.net\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\n ⥪  ᫥ 窨. ⥪  ᮧ , \n ᥢ  㣠 ଠ, ࠭  ⥪, 뫠 ⭮\nﭠ.\n.\n\n:TEXT_ERROR_PERMISSION_DENIED#1%\n%s:  饭\n.\n\n:TEXT_ERROR_NO_SUCH_FILE#1%\n%s:  ⠪ 䠩  ⠫\n.\n\n:TEXT_ERROR_UNKNOWN_ERROR#1%\n%s: ⭠ 訡\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\n    த . . .\\\n.\n\n:TEXT_MSG_HISTORY_SIZE#0%\n ୠ  ⠢ %d .\n.\n\n:TEXT_MSG_DOSKEY\n DOSKEY 祭  .\n.\n\n:TEXT_MSG_ECHO_STATE#0%\nECHO - %s\n.\n\n:TEXT_MSG_VERIFY_STATE#0%\nVERIFY - %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE#0%\n뢮 DEBUG - %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET#0%\n뢮 DEBUG ⠭  '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE#0%\nBREAK - %s\n.\n\n:TEXT_MSG_LFNFOR_STATE#0%\nLFNFOR - %s\n.\n\n:TEXT_MSG_LFNFOR_COMPLETE_STATE#0%\nLFNFOR COMPLETE - %s\n.\n\n:TEXT_MSG_CURRENT_DATE#0%\n : %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1%\n   (%s%s[]): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1%\n   (%s%s[]): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1%\n   ([]%s%s): \\\n.\n\n:TEXT_MSG_CURRENT_TIME#0%\n饥 ६: %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\n  祭 ६: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING#0%\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1%\nYyNn{CR}{LF}{CBREAK}\naabb   b   b       b\n 䠩  ⠫: '%s'  㤠!\n 㢥७ (Y/N)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nYyNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [=ENTER, =ESC] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#\tby \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1%\nYyNnAaQq{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\n뫠   : Control-Break.\\r\n४ 믮 ⭮ 䠩 '%s' (Yes/No/All)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1%\nYyNnAaQq{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\n१ '%s' (Yes/No/All/Quit) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_APPEND_FILE#1%\nYyNnAaQq{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nꥤ  '%s' (Yes/No/All/Quit) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1%\nYyNnAaQq{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\n '%s' (Yes/No/All/Quit) ? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\n⥪ ⠫ ⮩.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1%\n ⪠ ⮬ %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING#0%\n- %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\n\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER#0%\n ਩  ⮬ - %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1%\n%10s 䠩()\\\n.\n:TEXT_DIR_FTR_BYTES#0%\n   %12s \n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nᥣ 䠩:\n.\n:TEXT_DIR_FTR_DIRS#1%\n%10s ⠫()\\\n.\n:TEXT_DIR_FTR_BYTES_FREE#0%\n %15s  ᢮\n.\n:TEXT_DIR_DIRECTORY#0%\n騩 ⠫: %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE#0%\n 騩 ⠫: %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1%\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE#1%\n%s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1%\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1%\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n    <> \\\n.\n:TEXT_DIR_LINE_SIZE#1%\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1%\n%-14s\\\n.\n\n:TEXT_MSG_PATH#0%\n=%s\n.\n:TEXT_MSG_PATH_NONE#1\n 㪠 砫   ᪠.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\n\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\n\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\n\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\n\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\n\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\n\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\n\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\n䠩  㤠.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\n 䠩  㤠.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1%\n%u 䠩 㤠.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\n㯭 ७ :\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\n㯭 :\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[ᥢ] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[७ ] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[ୠ ] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[  䠩] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[窠] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[⮪஢] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[᫥ ⠫] \\\n.\n:TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1\n[  䠩] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[窠 ] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[窠 XMS] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[窠  㬮砭] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[⠭ ] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[⥪ ⠫ (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[⫠ FreeCOM] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\n F8  砫 ஢,  F5  室: %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0%\n: '%s'.\n.\n\n:TEXT_MSG_VER_DOS_VERSION#0%\n DOS: %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\n FreeDOS (ᡮઠ 1933  ।)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS#0%\n  FreeDOS: %d.%d.%d\n.\n\n:TEXT_MSG_VER_WARRANTY\n᪮ ࠢ (C) 1994-2005  ଠ  㣨.\n\n\t ணࠬ ࠭  ,  \n㤥 ,    -  ;  \nࠧ㬥 ࠭⨩    \n  .  祭 ஡ ᢥ ᬮ\nᠫ ⢥ 業 GNU.\n\n  訡 뫠 : freedos-devel@lists.sourceforge.net.\n ᥣ 㯭  http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\n᪮ ࠢ (C) 1994-2005  ଠ  㣨.\n\n\t ᢮ ணࠬ;   ୮\n࠭  / ஢   ᮮ⢥⢨ \nᠫ쭮 ⢥ 業 GNU, 㡫\n  ;  ᨨ 2,  ( 襬 롮)\n   ᨨ.\n\n  訡 뫠 : freedos-devel@lists.sourceforge.net.\n ᥣ 㯭  http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\n  ᮧ  窨 FreeDOS ⢮ \nࠧࠡ稪. ஡ ᠭ  䠩: HISTORY.TXT.\n\n  ६ ⢥⢥   ஥  䥭 .\n  쬠 : freedos-devel@lists.sourceforge.net\n\n  訡 뫠 : freedos-devel@lists.sourceforge.net.\n ᥣ 㯭  http://freedos.sourceforge.net/freecom\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\n 室  窨.  室 , ᪮\n窠 뫠 饭  樥: \"/P\".   १㧨 ⥬\n, ᫨  ࠡ⠥  ⨧筮 ।,  㡥  \n (ਬ,  Microsoft (R) Windows  襩   \n  믮塞 FreeCOM  ⢥न, ᫨  㦭,  ७\n४ 믮 ⮩    .).\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\n믮 䠩 FreeCOM  .   㪠   \n䠩: COMMAND.COM  ⢥ ࢮ ࠬ, , ਬ:\nC:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1%\n   ६ 㦥    : ᨬ %5u ; ᢮ %5u \n.\n:TEXT_MEMORY_CONTEXT#1%\n ⥪        : ᨬ %5u ; ᢮ %5u \n.\t\n:TEXT_MEMORY_HEAP#1%\n                   : ᢮ %5lu \n.\n:TEXT_MEMORY_CTXT_ALIAS#1%\n\\tᥢ        :  %5u , ⥪騩 ࠧ %5u , %5u 㭪⮢\n.\n:TEXT_MEMORY_CTXT_HISTORY#1%\n\\tୠ         :  %5u , ⥪騩 ࠧ %5u , %5u 㭪⮢\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1%\n\\t⥪ ⠫:  %5u , ⥪騩 ࠧ %5u , %5u 㭪⮢\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1%\n\\t᫥  ⠫ : ᯮ  %5u , %5u 㭪⮢\n.\n:TEXT_MEMORY_CTXT_BATCH#1%\n\\t 맮  䠩  : ᯮ  %5u , %5u 㭪⮢\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1%\n\\tଠ  窥       : ᯮ  %5u , %5u 㭪⮢\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\n 㤠  ⥪  ࠭  ⥬.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\n 㤠  ⥪  ࠭.\n.\n:TEXT_DISPLAY_CODEPAGE#1%\n  ࠭: %u.\n⥬  ࠭: %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\n뢮  ࠭, ⠭  㤠 ᥢ.\n\nALIAS [६[=][ப]]\n\n\t६  뢠  ᥢ.\n\tப       ᫥⥫쭮 ᨬ  ᢮ ᥢ.\n\n\n ALIAS  ࠬ஢ ⮡ࠧ ⥪騥 ᥢ.\n.\n\n:TEXT_CMDHELP_BEEP\n뢮 㪮 ᨣ.\n.\n\n:TEXT_CMDHELP_BREAK\n⠭  ⪠ 䫠 ஫  ⨥ CTRL+C.\n\nBREAK [ON | OFF]\n\n BREAK  ࠬ஢  ᭨ ⥪饥 祭 BREAK.\n.\n\n:TEXT_CMDHELP_CALL#1\n맮 ⭮ 䠩  㣮 ⭮ 䠩.\n\nCALL [/S | /N] [/Y] [:][]_䠩 [ࠬ]\n\n  ࠬ   砥  祭, ॡ㥬  ⭮ 䠩.\n  /S          砥, /N 몫砥   FreeCOM.\n  /Y          砥 ० ஢  믮 .\n.\n\n:TEXT_CMDHELP_CD\n뢮  ⥪饩 ४ਨ   .\n\nCHDIR [:][]\nCHDIR[..]\nCD [:][]\nCD[..]\nCD -\n\n  ..   室  த⥫᪨ ⠫.\n  -    ᫨   \"᫥ ⠫\" 㯭, \n       ⢫ 室  ᫥ ⠫.\n\n CD :  뢮 ⥪饣 ⠫  㪠 ᪥.\n CD  ࠬ஢  뢮 ⥪饣 ᪠  .\n ⠪: CDD\n.\n\n:TEXT_CMDHELP_CDD\n뢮  ⥪饣 ⠫  ᪠     ⥪騩 ⠫.\n\nCDD [:][]\nCDD[..]\n\n  ..   室  த⥫᪨ ⠫.\n  -    ᫨   \"᫥ ⠫\" 㯭, \n       ⢫ 室  ᫥ ⠫.\n᫨ 㪠 :,  ந ᬥ ⥪饣 ᪠  㪠. \n⢥ ⫨稥    : \"CHDIR\".\n CDD  ࠬ஢  뢮 ⥪饣 ᪠  .\n.\n\n:TEXT_CMDHELP_CHCP\n뢮  ⠭  ⨢  ࠭.\n\nCHCP []\n\n       ࠭.\n\n CHCP  ࠬ஢  뢮  ⥪饩  ࠭.\n.\n\n:TEXT_CMDHELP_CLS\n⪠ ࠭.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\n    窨 FreeDOS.\n\nCOMMAND [[:]] [ன⢮] [/E:] [/L:] [/U:] [/P] [/MSG]\n                       [/LOW] [/Y [/[C|K] ]]\n  [:]     砥 ⠫  䠩: COMMAND.COM.\n  ன⢮      砥 ன⢮, ᯮ㥬     뢮.\n  /E:        ⠭ 砫쭮 ࠧ    ६ \n                   .\n                  (祭:  㦭 ⮡ 뫮    256 \n                  32,768).\n  /L:         ⠭ 砫쭮 ࠧ ७ ஢ (ॡ\n                  ⠪  /P).\n                  (祭:  㦭 ⮡ 뫮    128 \n                  1,024).\n  /U:          ⠭ ࠧ   (ॡ ⠪  /P).\n                  (祭:  㦭 ⮡ 뫮    128  255).\n  /P              㧪     室 \n                  .\n  /MSG            ࠭ ᮮ饭  訡   (ॡ ⠪\n                   /P).\n  /LOW            饭 १  窨   ⤥\n                  .\n  /Y              蠣 믮 ⭮ 䠩, 㪠 १\n                  樨 /C  /K.\n  /C       믮   .\n  /K       믮   த 믮  \n                  窨.\n.\n\n:TEXT_CMDHELP_COPY\n஢    䠩  㣮 .\n\nCOPY [/A | /B] 筨 [/A | /B] [+ 筨 [/A | /B] [+ ...]] [񬭨]\n  [/A | /B]] [/V] [/Y | /-Y]\n\n  筨     砥    䠩  ஢.\n  /A           室 䠩  ⥪⮢.\n  /B           室 䠩  .\n  񬭨     ⠫  ࠧ饭 䠩 / 筮  䠩().\n  /V           ஢ઠ ࠢ쭮 ஢.\n  /Y           ⪫祭 ०   ⢥ত १\n               饣 筮 䠩(/).\n  /-Y          祭 ०   ⢥ত १\n               饣 筮 䠩.\n\n४⥫ /Y     ६ 㦥: COPYCMD.\n४⥫ /-Y,  ।⢥   ப,  ਮ\n .\n\n ꥤ ᪮쪨 䠩  , 㦭  ⢥ \n䠩  ᪮쪮 室 䠩 ( ᯮ짮 ᮪  䠩 \nப ଠ: 筨1+筨2+筨3...\n.\n\n:TEXT_CMDHELP_CTTY\n ன⢠, ᯮ㥬     뢮.\n\nCTTY ன⢮\n\n  ன⢮   ନ쭮 ன⢮  ᯮ짮 (ਬ, CON, AUX,\nCOM1, COM2, COM3, COM4, PRN, LPT1, LTP2, CLOCK$ :-) ).\n.\n\n:TEXT_CMDHELP_DATE#1\n뢮  ⠭  .\n\nDATE [/D] []\n\n DATE  ࠬ஢   ⥪饥 祭   뤠\n    祭 .\n⨥  ENTER ⠢ 祭   .\n\n/D 뢮      .\n.\n\n:TEXT_CMDHELP_DEL#2\n    䠩.\n\nDEL [:][]_䠩 [/P] [/V]\nERASE [:][]_䠩 [/P] [/V]\n\n  [:][]_䠩  砥  䠩(/)  㤠. 襭\n        ᯮ짮 ⠭   㤠  䠩.\n  /P\t뢮   㤠  䠩.\n  /V\t뢮   㤠 䠩.\n.\n\n:TEXT_CMDHELP_DIR#4\n뢮 ᯨ᪠ 䠩  ⠫, 室  ⥪饬 ⠫.\n\nDIR [:][][_䠩] [/P] [/W] [/A[[:]ਡ]]\n  [/O[[:]஢]] [/S] [/B] [/L]\n\n  [:][][_䠩] 砥 ,  / 䠩()  뢮 \n                           ࠭ ( 㪠뢠   ᪮쪮 ࠧ殢\n                            䠩).\n /P         㧠 ᫥   ࠭.\n /W         뢮 ᯨ᪠ 䠩  ᪮쪮 ⮫殢.\n /A         뢮 䠩  묨 ਡ⠬ ( 㬮砭 ᪠: /ADHSRA).\n ਡ    D  ⠫                   R   ⮫쪮  ⥭\n             H   䠩              A  , ।祭 \n             S  ⥬ 䠩               娢樨\n                                           䨪: \"-\"  祭: \"\".\n /O         ஢ ᯨ᪠ 䠩 ( 㬮砭 /ONG).\n ஢  N    (䠢⭠)      S   ࠧ (稭  )\n             E   ७ (䠢⭠) D     ६ (稭 \n             G   ᯨ᮪  ⠫      )\n             U   ஢             䨪: \"-\"  祭: \"\".\n             ᭮,   뢥 : DIR /O-U, . .  \n             ஢? ;-)\n /S         뢮 䠩   ⠫    ⠫.\n /B         뢮 ⮫쪮  䠩 ( 뢮 㬬୮ ଠ樨).\n /L         뢮 ᯨ᪠   ॣ.\n /Y  /4  뢮   .\n\n४⥫     ६ 㦥 DIRCMD. ⮡ ⬥\n ⢨,   ப ᫥      䨪ᮬ:\n\"-\". ਬ: DIR /-W\n.\n\n:TEXT_CMDHELP_DOSKEY#1\n\n ⨫: DOSKEY 뫠 ⥣஢  FreeCOM.\nᯮ  ६饭    ,   ப稢\nᮤন ୠ ,   ࠭   ப.  ६\nப⪨      ENTER  믮  ,\n    室   ப    稫 \nୠ .\nᯮ  ६饭    ࠢ,   ।\n ⥪饩  ப. ⨥ : INSERT 砥  몫砥\n० ⠢/१ ᨬ   ப.\n᫨   : TAB,  ந  䠩  ⥪饬 ⠫\n   ப 㤥  ⥪饣 ᫮ ⠢  䠩, ஥\n -  室  祭 ᫮. ਬ, ᫨   ப:\nDEL VER   : TAB,  ப ਬ : DEL VERSION.TXT, \n᫮,  ⠪ 䠩   ⥪饬 ⠫.  ⨢ 砥\n祣  ந.  ⨥ : TAB 뢮  ࠭ ᯨ᮪\n  䠩  ⠫  ⥪饬 ⠫.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\n஢  ப, 맮 ।    ᮧ\nᮢ.\n\nDOSKEY [/ ...] [_=[⥪]]\n\n  /BUFSIZE:ࠧ ⠭ ࠧ     ᮢ\n                  ( 㬮砭 512)\n  /ECHO:ON|OFF    롮 ० ⮡ࠦ ᮢ ( 㬮砭 ON)\n  /FILE:䠩      뫪  䠩, ᮤঠ騩 ᯨ᮪ ᮢ\n  /HISTORY        뢮  ࠭  , ᮤঠ   \n  /INSERT          ⠢  ᨬ  ।㥬 ப\n  /KEYSIZE:ࠧ    ( 㬮砭 15)\n  /LINE:ࠧ    ᨬ ࠧ   ப ( 㬮砭 128)\n  /MACROS         뢮  ࠭  ᮢ DOSKey\n  /OVERSTRIKE        ᨬ (ᯮ  㬮砭)\n  /REINSTALL         DOSKey\n  _      ᮧ \n  ⥪           , 室騥  ⠢ \n\n  ५:   : ⠭  ப  \n                    Esc: ⪠ ⥪饩  ப\n                     F7: 뢮  ࠭ ୠ \n                 Alt+F7: ⪠ ୠ \n            [ᨬ]F8:    ୠ, 稭饩  㪠\n                         ᨬ\n                     F9: 롮   \n                Alt+F10: ⪠ । ᮢ\n\n樠 ,    ᯮ짮   DOSKey:\n  $T     ⥫ : ᯥ稢  ᪮쪨    ப\n  $1-$9  ࠬ- ࠬ஢ %1-%9   䠩\n  $*      ⥪⮬, 騬   ப   \n.\n\n:TEXT_CMDHELP_ECHO\n뢮 ᮮ饭  ४祭 ० ⮡ࠦ   ࠭.\n\n  ECHO [ON | OFF]\n  ECHO [ᮮ饭]\n\n ECHO  ࠬ஢  ᭨ ⥪騩 ० ⮡ࠦ .\n.\n\n:TEXT_CMDHELP_EXIT\n室   窨 FreeDOS.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\n 㪠    䠩  .\n\nFOR %%६ IN () DO  [ࠬ]\n\n  %%६ ⠢塞 ࠬ.\n  ()     , 騩    䠩. ᪠\n              ᯮ짮 ⠭ .\n       , 믮塞   䠩  .\n  ࠬ   ࠬ  , 室  믮 .\n\n ᯮ짮 : FOR  ⭮ 䠩,  : %%६\n᫥ ᯮ짮: %%%%६.\n.\n\n:TEXT_CMDHELP_GOTO\n। ࠢ  ⬥祭 ப ⭮ 䠩.\n\nGOTO ⪠\n\n  ⪠   ⮢ ப,   ⭮ 䠩 ஫ ⪨.\n\n⪠  室  ⤥쭮 ப ⭮ 䠩  稭 \n.\n.\n\n:TEXT_CMDHELP_HISTORY#1\nୠ .\n\nHISTORY [ࠧ]\n\n᫨  㪠 ࠬ: \"ࠧ\",   ࠭ 뢮 ⥪饥 ᮤন\nୠ . ᫨ 㪠 祭 ࠬ: \"ࠧ\",  \nࠧ ୠ   㪠 ࠧ.\n.\n\n:TEXT_CMDHELP_IF\n ᫮ 믮    䠩.\n\nIF [NOT] ERRORLEVEL ᫮ \nIF [NOT] ப1==ப2 \nIF [NOT] EXIST _䠩 \n\n  NOT               뢠,    믮   ⮬\n                    砥, ᫨ ᫮ .\n  ERRORLEVEL ᫮  ᫮ ⨭, ᫨ ᫥ 饭 ணࠬ\n                    訫   , ࠢ  ॢ騬\n                    㪠 ᫮.\n             ,  ᫥ 믮  砥 ⨭\n                    ᫮.\n  ப1==ப2  ᫮ ⨭  ᮢ  ப.\n  EXIST _䠩   ᫮ ⨭, ᫨ 㪠 䠩 .\n.\n\n:TEXT_CMDHELP_LFNFOR\n砥/⪫砥   䠩   FOR  \n 䠩.\n\nLFNFOR [ON | OFF]\nLFNFOR COMPLETE [ON | OFF]\n\n LFNFOR  LFNFOR COMPLETE  ࠬ, ⮡ ⮡ࠧ ⥪騥\nன.\n.\n\n:TEXT_CMDHELP_LH\n㧪 ண   孥  (UMB).\n\nLOADHIGH [:][]_䠩 [ࠬ]\nLOADHIGH [/L:1[,_ࠧ1][;2[,_ࠧ2]...] [/S]]\n         [:][]_䠩 [ࠬ]\n\n/L:1[,_ࠧ1][;2[,_ࠧ2]]...\n             ⥩ ,   ᫥ 㦠 ணࠬ.\n            1 ।  ࢮ  ⥩ ,  _ࠧ1\n            - 室 ࠧ   1. 2  _ࠧ2\n            ।    ࠧ ன  .\n            ⢮ 㪠 ⥩  ࠭祭.\n\n/S          ⨥  UMB  㬠   㧪 ணࠬ.\n\n[:][]_䠩   ணࠬ   .\n.\n\n:TEXT_CMDHELP_LOADFIX\n㧪 ணࠬ      64     \n믮.\n\nLOADFIX [:][]_䠩\n\nᯮ LOADFIX  㧪 ணࠬ  ⮬ 砥, ᫨  砥\nᮮ饭: \"Packed file corrupt\"  ⪥ 㧪 ணࠬ  \n .\n.\n\n:TEXT_CMDHELP_MD\n  ⠫.\n\nMKDIR [:]\nMD [:]\n.\n\n:TEXT_CMDHELP_PATH\n뢮  ࠭  ⠭   ᪠ 믮塞 䠩.\n\nPATH [[:][;...]]\nPATH ;\n\n PATH ;  ⪨ ⥪饣  ᪠ 믮塞 䠩 ( ⮬\n 㤥 ந ᪫⥫쭮  ⥪饬 ⠫).\n PATH  ࠬ஢  뢮  ࠭ ⥪饣  ᪠\n믮塞 䠩.\n.\n\n:TEXT_CMDHELP_PAUSE\nਮ⠭ 믮 ⭮ 䠩  뢮 ᮮ饭:\n\"Press any key to continue....\"  㪠  ⢥ ࠬ ᮮ饭.\n\nPAUSE [ᮮ饭]\n.\n\n:TEXT_CMDHELP_PROMPT\n ਣ襭   ப  .\n\nPROMPT [⥪]\n\n  ⥪     ਣ襭  ப.\n\nਣ襭    ᨬ  ᫥騥 :\n\n  $Q   = ( ࠢ⢠)\n  $$   $ (ᨬ )\n  $T   饥 ६\n  $D    \n  $P   騥   \n  $V    ᨨ 窨 FreeDOS\n  $N   騩 \n  $G   > ( \"\")\n  $L   < ( \"\")\n  $B   | (⨪쭠 )\n  $H   Backspace (㤠 ।饣 ᨬ)\n  $E    Escape (ASCII 27)\n  $_    ⪨  ॢ ப\n\n PROMPT  ࠬ஢  ⠭ 室  ਣ襭.\n.\n\n:TEXT_CMDHELP_PUSHD\n饭  ⥪ ⠫ ⥪饣 ⠫. ᫨ 㪠 ࠬ, \n஬ 饭  ⥪ ⠫ ⥪饣 ⠫ ⢫ 室\n 㪠  ⢥ ࠬ ⠫.\n\nPUSHD [[:]]\n  ࠬ, 㪠 : [:] 砥   ⠫,  \n  ३.\n.\n\n:TEXT_CMDHELP_POPD\n祭  ⥪ ⠫ ᫥ 񭭮 㤠 ⠫  室\n .\n\nPOPD [*]\n  ᫨ 㪠 ࠬ: '*',  ந ⪠ ⥪ ⠫.\n.\n\n:TEXT_CMDHELP_DIRS\n뢮  ࠭ ᮤন ⥪ ⠫.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\n⮦ ⠫.\n\nRMDIR [:]\nRD [drive:]path\n.\n\n:TEXT_CMDHELP_REM\n饭 ਥ   䠩  䠩: CONFIG.SYS.\n\nREM [਩]\n.\n\n:TEXT_CMDHELP_REN\n२ 䠩  ⠫.\n\nRENAME [:][][⠫1 | _䠩1] [⠫2 | _䠩2]\nREN [:][][⠫1 | _䠩1] [⠫2 | _䠩2]\n\n 㣮   ⠫  १饣 䠩  ⠫\n.  ⮣  : MOVE.\n.\n\n:TEXT_CMDHELP_SET#1\n뢮  ࠭, ⠭  㤠 ६ 㦥.\n\nSET [/C] [/P] [/E] [/U] [६=[ப]]\n\n  ६  ६ 㦥.\n  ப     , ।⠢騩 ᮡ 祭 ६ 㦥.\n\n* ᫨ ᫥  ࠢ⢠ 祣 , ६ 㦥 㤥 㤠.\n\n SET  ࠬ஢  뢮  ࠭ ᮤন  ६\n㦥.\n\n/C ࠭ ॣ ६  ࠡ  .  㬮砭 \n६ । ࠡ⮩   ॢ  孨 ॣ. ᫨ \n㪠 : /C,  ॢ  孨 ॣ  ६ 믮 \n㤥.\n\n/P ᫥ : \"SET ६=\" ந    ० \n 祭 ६.\n\n/E ⠭  ६   ப 뢮 ,\n㪠  [ப].\n\n/U ॢ 祭 [ப]  孨 ॣ.\n.\n\n:TEXT_CMDHELP_SHIFT#1\n ᮤন (ᤢ) ⠢塞 ࠬ஢  ⭮ 䠩.\n\nSHIFT [DOWN]\n\nDOWN 믮 ᤢ ࠬ஢  砫 (%%0);  㣨  ந室\nᤢ  .\n.\n\n:TEXT_CMDHELP_TIME#1\n뢮  ࠭  ⠭ ⥬ ६\n\nTIME [/T] [६]\n\n TIME  ࠬ஢  뢮  ࠭ ⥪饣 ६  ᠬ\n  ⠭  ६   ०. ⨥ :\nENTER ⠢ ६  .\n\n/T ᫨ 㪠  ,  ࠭ 㤥 뢥 ⥪饥 ६   \n  ६.\n.\n\n:TEXT_CMDHELP_TRUENAME\n뢮 ।񭭮 筮    㪠 .\n\nTRUENAME [:][][_䠩]\n.\n\n:TEXT_CMDHELP_TYPE\n뢮  ࠭ ᮤন ⥪⮢ 䠩.\n\nTYPE [:][]_䠩\n.\n\n:TEXT_CMDHELP_VER\n뢮 ᨨ   FreeDOS  㣮 ଠ樨.\n\nVER [/R] [/W] [/D] [/C]\n\n /R         뢮 ᨨ  FreeDOS  㣮 ଠ樨.\n /W         ࠭⨨, ।⠢塞 짮⥫ 窨 FreeDOS.\n /D         ଠ  ࠭ 窨 FreeDOS.\n /C         ᮪ ࠧࠡ稪,   ᮧ 窨 FreeDOS.\n.\n\n:TEXT_CMDHELP_VERIFY\n⠭ ஫  ࠢ쭮  䠩  .\n\nVERIFY [ON | OFF]\n\n VERIFY  ࠬ஢  ᭥ ⥪饣 ﭨ 䫠: VERIFY.\n.\n\n:TEXT_CMDHELP_FDDEBUG\n᫨ ⫠稪 ஢  FreeDOS,   ॢ ० 뢮\n⫠筮 ଠ樨  ﭨ: 祭 : 몫祭,  ᮮ ,\n  ஢ ⫠稪   .\n\nFDDEBUG [ON | OFF | _䠩]\n\n FDDEBUG  ࠬ஢  ᭥ ⥪饣 ० ⫠筮\n뢮. ᫨ 㪠  䠩,   뢮 ⫠筮 ଠ樨 㤥\nந  㪠 䠩. ᫨ 䠩 㦥 ,  뢮 㤥\nந   . १ࢨ஢ ᥢ 䠩: \"stdout\" :\n\"stderr\"   㪠  ⢥  䠩  뢮   (뢮\n⫠筮 ଠ樨   砥 㤥 ந  ࠭).\n.\n\n:TEXT_CMDHELP_VOL\n뢮  ࠭ ਩  ⮬  ⪨ ⮬ ᪠, ᫨   \n⥪饬  㪠 ᪥.\n\nVOL [:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\n뢮  ࠭ ᯨ᪠    ⥩, 㯭   窥.\n\n?\n? [ࠬ]\n\n ਠ  뢮  ࠭ ᯨ᮪    ⥩,\n㯭   窥. ன ਠ  뢮  ࠭  \n믮 㪠 ,  ᫨  ० ஢  .\n.\n\n:TEXT_CMDHELP_WHICH\n뢮  ࠭ ᯮ 䠩, ᮮ⢥騩 譥 .\nਬ:\n      WHICH Edit\n      Edit        C:\\FREEDOS\\EDIT.EXE\n\nWHICH {}\n.\n\n:TEXT_CMDHELP_MEMORY#1\n뢮 ⨪ ᯮ짮 ७  FreeCOM.\n\nMEMORY\n\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\n 筮 䠩   ᮤঠ : '+'.\n.\n\n:TEXT_DELETE_FILE#1%\n 䠩 \"%s\".\n.\n\n:TEXT_ERROR_WRITE_FILE_DISC_FULL#0%\n   䠩 '%s';\n⭮,  ? (ॡ %lu )\n.\n\n# Displayed for BIGcopy(), when copying takes quite a long time.\n# **_NO_END if the input file size is unknown.\n# Both must end in \\r rather than \\n!!\n:TEXT_COPY_COPIED_NO_END#0%\n᪮஢ %luKB/???KB\\r\\\n.\n:TEXT_COPY_COPIED#0%\n᪮஢ %luKB/%luKB\\r\\\n.\n\n:TEXT_ERROR_FCOM_IS_DEVICE#0%\nFreeCOM    ன⢮: \"%s\"\n.\n:TEXT_ERROR_FCOM_INVALID#0%\n 䠩   FreeCOM  ᮢ⨬ ᨨ:\n%s\n.\n\n:TEXT_ERROR_LOADING_STRINGS\n 㤠 㧨 ப   , ⭮  %COMSPEC%\n㪠 ४⭮ ᯮ.  㣮 ᯮ\nFreeCOM,  ண   㧨 ப, ਬ:\nC:\\\\COMMAND.COM\n   Enter, ⮡ ⬥ 㧪 ப.\n.\n\n:TEXT_TERMINATING\n襭.\n.\n\n:TEXT_HIDDEN_CRITER#0%\n%u ᮢ  ᪨ 訡 .\n.\n\n# The exit reasons MUST be kept in this order!\n:TEXT_DISP_EXITCODE#0%\n 室 (ERRORLEVEL): %u, 稭: %u (%s)\n.\n:TEXT_EXIT_REASON_NEG_1\n訡 DOS API\\\n.\n:TEXT_EXIT_REASON_0\n訫 ଠ쭮\\\n.\n:TEXT_EXIT_REASON_1\n襭   ^Break\\\n.\n:TEXT_EXIT_REASON_2\n襭 ᪮ 訡\\\n.\n:TEXT_EXIT_REASON_3\n⠫ १\\\n.\n:TEXT_ERROR_EXE_CORRUPT\nEXE-䠩 ०\\\n.\n"
  },
  {
    "path": "strings/serbian.err",
    "content": "# $Id$\n#\n# Critical error national customization file\n#\n#  Language: Serbian / Yugoslavian\n#  Codepage: 852\n#  Author:   Dejan trbac (strbac@phreaker.net)\n#\n# The critical error (criter) handler receives some information\n# from the kernel about what error condition happens, generates some\n# human friendly message from it, requests the user's opinion about\n# how to proceed and, finally, returns to the kernel.\n#\n# The human friendly message is generated using one of the following\n# templates:\n# BLOCK_DEVICE (for criters on block devices)\n#  Error %1 drive %A: %2 area: %3\n# -and- CHAR_DEVICE (for criters on character devices)\n#  Error %1 device %A: %3\n#\n# Two-character sequences, which first character is a percent sign '%',\n# are placeholders for other information:\n# %% -> a single percent sign\n# %1 -> either READ or WRITE, depending on what kind of operation\n#  caused the criter\n# %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA\n# %3 -> the actual error string; these are the strings associated to\n#  a number 0 through N, and must correspond to the number passed in\n#  lowbyte(DI) to the criter handler (see RBIL INT-24 for details)\n# %A -> drive letter (for block devices); name of device (character devices)\n#\n# Below the line describing the error the user is prompted for the action\n# to proceed. This line is dynamically constructed depending on which\n# action are available at all. The full line may look like this:\n#  (A)bort, (I)gnore, (R)etry, (F)ail?_\n#\n# The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They\n# should indicate which user response keys is associated with them;\n# suggested is to use the first letter and enclose it in parenthesises.\n# The delimiter \", \" can be defined with DELIMITER and is the same\n# for all slots.\n# The \"? \" sequence is defined by QUESTION.\n# The order of the actions is fixed and cannot be customized.\n#\n# With each action a number of user response keys must be associated.\n# They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ...\n# strings. Because the key is searched in the same format as returned\n# by INT-16-00, both upper and lower case must be specified and\n# certain special keys cannot be used.\n#\n# The individual error strings are defined by the #: lines, where\n# the hash sign '#' refers to the number the kernel passes to the\n# criter handler. The UNKNOWN string is displayed for all error\n# numbers not specified.\n#\n# NOTE #1: The percent rule applies to _all_ criter strings!\n# NOTE #2: Each string occupies exactly one line.\n# NOTE #3: Any leading or trailing whitespaces are removed. Prefix the\n#  first or suffix the last whitespace with '%.' (one percent sign and\n#  one dot). This sequence is removed from the string totally.\n# NOTE #4: To embed any character use: %&## (one percent sign,\n#     one ampersand and exactly two hexa-decimal digits)\n\n## Primary strings\nS2\nBLOCK_DEVICE: %&0A%&0A%&0DGreka %1 na drajvu %A: - %3\nS3\nCHAR_DEVICE:  %&0A%&0A%&0DGreka %1 na ureaju %A: - %3\n\n## kind of operation\nS0\nREAD: pri itanju\nS1\nWRITE: pri upisu\n\n## kind of failed area of block devices\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: Root\nS7\nDATA: Podaci\n\n## action strings\nS8\nIGNORE: (I)gnorii\nS9\nRETRY: (P)onovo\nS10\nABORT: (O)tkaz\nS11\nFAIL: (N)euspeh\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: iI\nKEYS_RETRY:  pP\nKEYS_ABORT:  oO\nKEYS_FAIL:   nN\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN: Nepoznata greka\nS15\n0: POKUAJ PREKORAENjA ZATITE OD PISANjA\n1: NEPOZNATA JEDINICA ZA DRAJVER\n2: DRAJV NIJE SPREMAN\n3: NEPOZNATA KOMANDA PRENETA DRAJVERU\n4: GREKA U PODACIMA (LO CRC)\n5: LOA DUINA STRUKTURE ZAHTEVA DRAJVERA UREAJA\n6: GREKA PRI TRAENjU (SEEK)\n7: NEPOZNATI TIP MEDIJA\n8: SEKTOR NIJE PRONAEN\n9: U TAMPACU NEMA PAPIRA\n10: GREKA PRI PISANjU\n11: GREKA PRI ITANjU\n12: GENERALNI OTKAZ\n13: NARUAVANjE RASPODELE\n14: NARUAVANjE BLOKADE\n15: NEVAECA PROMENA DISKA\n16: FCB JE NEDOSTUPNA\n17: PREKORAENjE ZAJEDNIKOG BAFERA\n18: NEUSAGLAENOST KODNIH STRANA\n19: NEDOVOLjNO ULAZA\n20: NEDOVOLjNO DISK PROSTORA\n"
  },
  {
    "path": "strings/serbian.lng",
    "content": "# $Id$\n#\n# FreeCOM national customization file\n#\n#  Language: Serbian / Yugoslavian\n#  Codepage: 852\n#  Author:   Dejan trbac (strbac@phreaker.net)\n#\n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retreive the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#  :TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carrage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause an user interaction. Those ones should be in sync\n# with the issued text. To define how to interprete a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#YyNn\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceeding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the question\n# mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readibility of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH\nNevaei prekida - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH\nNevaei prekida - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION\nLoe formirana opcija: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG\nOpcija '%s' ne moe imati argument.\n.\n\n:TEXT_ERROR_OPT_NOARG\nOpcija '%s' mora imati argument.\n.\n\n:TEXT_INVALID_NUMBER\nNevaei broj naveden u '%s'\n.\n\n:TEXT_ERROR_CLOSE_QUOTE\nNedostaje krajnji navodnik: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nPrivremeni fajl ne moe biti kreiran.\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR\nIsuvie parametara - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nIsuvie parametara.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER\nNevaei parametar - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nPutanja nije pronaena.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nFajl nije pronaen.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND\nFajl nije pronaen - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING\nPotreban parametar nedostaje.\n.\n\n:TEXT_ERROR_INVALID_DRIVE\nNevaei drajv - %c:\n.\n\n:TEXT_ERROR_BADCOMMAND#2\nLoa komanda ili naziv fajla - \"%s\".\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nGreka nedostatka memorije.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nAlokacija DOS memorije nije uspela.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nNemogunost cevovoda! Privremeni fajl ne moe biti otvoren!\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE\nLinija #%ld u batch fajlu '%s' je preduga.\n.\n\n:TEXT_ERROR_BFILE_VANISHED\nBatch fajl '%s' nije pronaen.\n.\n\n:TEXT_ERROR_BFILE_LABEL\nBatch fajl '%s' ne sadri labelu '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1\n%s ne uspeva za '%s'.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR\nPromenljiva okruenja '%s' ne moe biti postavljena.\nOkruenje prepuno?\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND\nPromenljiva okruenja '%s' nije pronaena.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nNema okruenja. Mogui nedostatak memorije. Navedite /E opciju.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1\nAlias '%s' ne moe biti postavljen. Prostor za aliase prepun?\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1\nAlias '%s' nije pronaen.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nNema prostora za aliase. Mogui nedostatak memorije.\n.\n\n:TEXT_ERROR_SYNTAX_STR\nSintaksna greka - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nSintaksna greka.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG\nNaziv fajla je predugaak - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY\nFajl '%s' ne moe biti kopiran u sebe.\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nKomandna linija je preduga posle razvijanja aliasa!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nLinija je preduga. Komanda ne moe biti izvrena.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1\nNevaea veliina istorije - '%s'\n.\n\n:TEXT_HISTORY_EMPTY#1\nIstorija komandne linije je prazna.\n.\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nMCB lanac je oteen, ili MS-DOS nekompatibilan sistem.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR\nNedefinisana greka %d.\n.\n\n:TEXT_ERROR_REGION_WARNING\nNevaee memorijsko podruje %d - ignorisano.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nMorate navesti ON ili OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nLoe navedena promenljiva.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR: nedostaje IN\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nJedna ili obe zagrade nedostaju.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR: nedostaje DO\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR: Nedostaje komanda posle DO iskaza.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE\nUlaz ne moe biti preusmeren na fajl '%s'.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE\nIzlaz ne moe biti preusmeren na fajl '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nPrazno preusmerenje.\n.\n\n:TEXT_ERROR_INVALID_DATE\nNevaei datum.\n.\n\n:TEXT_ERROR_INVALID_TIME\nNevaee vreme.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nNema labele navedene za GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nKomanda CTTY je izostavljena iz ovog COMMAND.COMa.\n.\n\n:TEXT_ERROR_NORW_DEVICE\nNevaei ili ne postojei uitno-upisni ureaj '%s'.\n.\n\n:TEXT_ERROR_CTTY_DUP\nNeuspeh pri promeni fajl deskriptora na TTY '%s'.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\nPrekida /L nije implementiran.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\nPrekida /U nije implementiran.\n.\n\n:TEXT_ERROR_WRITING_DEST\nGreka pri upisu na odredite.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE\nIzvor nije mogao biti otvoren - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE\nFajl '%s' nije mogao biti otvoren.\n.\n\n:TEXT_ERROR_READ_FILE\nNemogunost itanja iz fajla: '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE\nNemogunost upisa u fajl: '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\nPovezujui znak '+' ne moe voditi argumente.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nPovezujui znak '+' ne moe pratiti argumente.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nNema nieg da se uradi.\n.\n\n:TEXT_ERROR_COPY\nCOPY komanda nije uspela.\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: nedostaje naziv fajla\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: nedostaje broj\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: nevaei broj\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: nedostaje komanda\n.\n:TEXT_NOT_IMPLEMENTED_YET\nao nam je. Nije implementirano.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nNeuspeh pri uitavanju poruka u memoriju.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nPrekida /MSG nije implementiran.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1\nUkupno izlistano stavki: %u\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nOteena komandna linija. Ovo je interna greka i povezana je sa\nsistemom u kome radi COMMAND.COM. Molimo vas prijavite ovu greku.\n.\n\n:TEXT_QUOTED_C_OR_K#1\nOpcije /C i /K nemogu biti pod navodnicima, ignorisane.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1\nPutanja do COMMAND.COMa mora biti potpuna!\nOvo znai ukljuujui slovo drajva poinjui obrnutom kosom crtom (\\\\).\nNa primer: C:\\\\\n\nCOMMAND.COM sada podrazumeva ovu putanju:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nInformacije o sesiji nisu mogle biti vraene. Sve lokalne postavke\nsu izgubljene. Molimo vas pogledajte gore izjavljene poruke o grekama\nza mogui razlog nastanka ovog problema.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nTrenutne informacije nemogu biti ouvane za vreme poziva programa.\nMolimo vas pogledajte gore izjavljene poruke o grekama za mogui razlog\nnastanka ovog problema.\n.\n\n:TEXT_ERROR_CWD_FAILED\nDrajv %c: ne reaguje ili nedostatak interne memorije.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nSwapping nije uspeo: Aliasi zauzimaju previe memorije.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nSwapping nije uspeo: Daleka memorija ne moe biti alocirana.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nNedostatak prostora za aliase.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1\nAlias '%s' ne postoji.\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nGreka pri umetanju aliasa.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1\nNevaee ime aliasa '%s'.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nManipulator kritinih greaka ili kontekst modul ne moe biti uitan.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nNedostatak memorije za kontekst.\nAko ova greka nastavi da se javlja, razmotrite poveanje internog\nbafera, kao istorije, steka direktorijuma itd.\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1\nVeliina konteksta prelazi maksimalni limit za %lu bajta.\nPromena veliine konteksta na %u bajta.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nNeuspeh pri dodavanju statusnih informacija u kontekst. Ova greka\nmoe znaiti oteenje memorije ili nepravilno utvrena minimalna\nveliina konteksta.\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nKontekst nedostaje posle swapa. Kontekst je rekreiran, ali su svi\naliasi itd. izgubljeni.\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nPritisnite bilo koji taster za nastavak...\\\n.\n\n:TEXT_MSG_HISTORY_SIZE\nVeliina istorije je %d bajta.\n.\n\n:TEXT_MSG_DOSKEY\nDOSKEY je ve omoguen interno u komandnoj ljusci.\nPokrenite DOSKEY /? za vie informacija o implementaciji.\n.\n\n:TEXT_MSG_ECHO_STATE\nECHO je %s\n.\n\n:TEXT_MSG_VERIFY_STATE\nVERIFY je %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE\nDEBUG izlaz je %s\n.\n:TEXT_MSG_FDDEBUG_TARGET\nDEBUG izlaz se prikazuje na '%s'\n.\n\n:TEXT_MSG_BREAK_STATE\nBREAK je %s\n.\n\n:TEXT_MSG_CURRENT_DATE\nTrenutni datum je: %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1\nUnesite novi datum (mm%sdd%s[vv]gg): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1\nUnesite novi datum (dd%smm%s[vv]gg): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1\nUnesite novi datum ([vv]gg%smm%sdd): \\\n.\n\n:TEXT_MSG_CURRENT_TIME\nTrenutno vreme je: %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nUnesite novo vreme: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1\nDdNn{CR}{LF}{CBREAK}\naabb   b   b       b\nSvi fajlovi u direktorijumu '%s' e biti obrisani!\nDa li ste sigurni (Da/Ne)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nDdNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [ENTER=Da, ESC=Ne]? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#  by \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1\nDdNnSs{LF}{CR}{CBREAK}{ESC}\naabbcc   a   a       c    b\nControl-Break pritisnuto.\\r\nPrekinuti batch fajl '%s' (Da/Ne/Sve)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1\nDdNnSsOo{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nPisati preko '%s' (Da/Ne/Svi/Otkaz)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1\nDdNnSsOo{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nObrisati '%s' (Da/Ne/Svi/Otkaz)? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<nepoznato>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nStek direktorijuma je prazan.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1\n Volumen u drajvu %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING\nje %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nnema labele\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER\n Serijski broj volumena je %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1\n%10s fajl(a)\\\n.\n:TEXT_DIR_FTR_BYTES\n   %12s bajta\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nUkupno prikazano:\n.\n:TEXT_DIR_FTR_DIRS#1\n%10s dir(a)\\\n.\n:TEXT_DIR_FTR_BYTES_FREE\n %15s bajta slobodno\n.\n:TEXT_DIR_DIRECTORY\nDirektorijum %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE\n Direktorijum %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE\n%-13s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <DIR> \\\n.\n:TEXT_DIR_LINE_SIZE#1\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1\n%-14s\\\n.\n\n:TEXT_MSG_PATH\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nPutanja nije definisana.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nNed\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nPon\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nUto\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nSre\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\net\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\nPet\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nSub\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\nNijedan fajl nije izbrisan.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\nJedan fajl izbrisan.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1\n%u fajla izbrisano.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nDostupne interne komande:\n\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\nMissing:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\nMissing \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\nMissing \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nPritisnite F8 za mod pracenja, ili F5 za preskakanje %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC\nPreskakanje preko '%s'\n.\n\n:TEXT_MSG_VER_DOS_VERSION\nDOS verzija %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nFreeDOS jezgro (gradnja 1933 ili ranija)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS\nFreeDOS jezgro %d.%d.%d\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nLjuska e sada biti prekinuta, iako je ovo zabranjeno\\r\n(obino navoenjem prekidaa \"/P\").\\r\nMorate restartovati sistem ili, ukoliko ova ljuska radi u\\r\nvieprocesnom okruenju, prekinuti ovaj proces.\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nIzvrsni fajl komandne ljuske nije pronadjen.\nMorate navesti potpunu putanju do COMMAND.COMa kao\nprvi argument COMMANDa, na primer:\nC:\\\\\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1\nNA %5u %5u\n.\n:TEXT_MEMORY_CONTEXT#1\nNA %5u %5u\n.\n:TEXT_MEMORY_HEAP#1\nNA %5lu\n.\n:TEXT_MEMORY_CTXT_ALIAS#1\nNA %5u %5u %5u\n.\n:TEXT_MEMORY_CTXT_HISTORY#1\nNA %5u %5u %5u\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1\nNA %5u %5u %5u\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1\nNA %5u %5u\n.\n:TEXT_MEMORY_CTXT_BATCH#1\nNA %5u %5u\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1\nNA %5u %5u\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nNeuspeh pri dobavljanju trenutne kodne strane iz sistema.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nNeuspeh pri promeni trenutne kodne strane.\n.\n:TEXT_DISPLAY_CODEPAGE#1\nTrenutna kodna strana je: %u.\nSistemska kodna strana (pravilno) je: %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nPrikazuje, postavlja, ili uklanja aliase.\n\n  ALIAS [promenljiva[=][string]]\n\n  promenljiva  Navodi ime aliasa.\n  string       Navodi niz karaktera za dodelu aliasu.\n\n Pokrenite ALIAS bez parametara za prikaz trenutnih aliasa. Ukoliko string\n nije naveden, postojei alias se uklanja.\n.\n\n:TEXT_CMDHELP_BEEP\nStvara kratak zvuk upozorenja.\n\n  BEEP\n.\n\n:TEXT_CMDHELP_BREAK\nPostavlja ili uklanja proirenu CTRL+C proveru.\n\n  BREAK [ON | OFF]\n\n Pokrenite BREAK bez parametara za prikaz trenutne postavke.\n.\n\n:TEXT_CMDHELP_CALL#1\nPoziva jedan batch program iz drugog.\n\n  CALL [/S | /N] [/Y] [drajv:][putanja]fajl [batch-parametri]\n\n  batch-parametri   Navodi informacije sa komandne linije potrebne\n                    batch programu.\n\n  /S ukljuuje dok /N iskljuuje swapping komandne ljuske.\n  /Y omoguava mod praenja prilikom izvrenja komande.\n.\n\n:TEXT_CMDHELP_CD\nPrikazuje naziv ili menja trenutni direktorijum.\n\n  CHDIR [drajv:][putanja]\n  CHDIR[..]\n  CD [drajv:][putanja]\n  CD[..]\n  CD -\n\n  \"..\"  Navodi da elite da promenite direktorijum u roditeljski trenutnog.\n  \"-\"   Vraa se u prethodni direktorijum.\n\n Pokrenite \"CD drajv:\" za prikaz trenutnog dira na navedenom drajvu.\n Pokrenite CD bez parametara za prikaz trenutnog drajva i direktorijuma.\n Takoe pogledajte komandu CDD.\n.\n\n:TEXT_CMDHELP_CDD\nPrikazuje trenutni direktorijum ili menja trenutni direktorijum i drajv.\n\n  CDD [drajv:][putanja]\n  CDD[..]\n  CDD -\n\n  \"..\"  Navodi da elite da promenite direktorijum u roditeljski trenutnog.\n  \"-\"   Vraa se u prethodni direktorijum.\n\n Ako je \"drajv:\" naveden, trenutni radni drajv se menja na navedeni.\n Ovo je jedina razlika u odnosu na \"CD\" odnosno \"CHDIR\".\n Pokrenite CDD bez parametara za prikaz trenutnog drajva i direktorijuma.\n.\n\n:TEXT_CMDHELP_CHCP\nPrikazuje ili postavlja broj aktivne kodne strane.\n\n  CHCP [nnn]\n\n  nnn   Navodi broj kodne strane.\n\n Pokrenite CHCP bez parametara za prikaz aktivne kodne strane.\n.\n\n:TEXT_CMDHELP_CLS\nBrie ekran i postavlja standardne atribute boja.\n\n  CLS\n.\n\n:TEXT_CMDHELP_COMMAND\nPokree novu instancu komandne ljuske.\n\n  COMMAND [[drajv:]putanja] [ureaj] [/E:nnnnn] [/P] [/MSG]\n           [/LOW] [/Y [/[C|K] komanda]]\n\n  [drajv:]putanja  Navodi direktorijum koji sadri COMMAND.COM.\n  ureaj           Navodi ureaj za komandni ulaz/izlaz.\n  /E:nnnnn         Postavlja poetnu veliinu okruenja na nnnnn bajta.\n                   (nnnnn treba biti broj izmeu 256 i 32,768).\n  /P               Postavlja novu komandnu ljusku za stalnu (nema izlaza).\n  /LOW             Primorava komandnu ljusku da dri svoje stalne podatke\n                   u niskoj memoriji.\n  /MSG             Uitava sve sistemske poruke u memoriju (zahteva i /P).\n  /Y               Koraa kroz batch program naveden sa /C ili /K.\n  /C komanda       Izvrava navedenu komandu i vraa se u trenutnu ljusku.\n  /K komanda       Izvrava navedenu komandu i nastavlja rad.\n.\n\n:TEXT_CMDHELP_COPY\nKopira jedan ili vie fajlova na drugu lokaciju.\n\n  COPY [/A | /B] izvor [/A | /B] [+ izvor [/A | /B] [+ ...]]\n        [odredite [/A | /B]] [/V] [/Y | /-Y]\n\n  izvor        Navodi fajl ili fajlove koje treba prekopirati.\n  /A           Nagoveta ASCII tekstualni fajl.\n  /B           Nagoveta binarni fajl.\n  odredite    Navodi direktorijum i/ili naziv fajla za novi(e) fajl(ove).\n  /V           Proverava korektnost upisa novih fajlova.\n  /Y           Priguava upite za pisanje preko ve postojeih fajlova u\n               odreditu, odgovarajui potvrdno.\n  /-Y          Poziva upit za potvrdu pisanja preko ve postojeih fajlova\n               u odreditu.\n\n Prekida /Y moe biti naveden u COPYCMD promenljivi okruenja.\n Ovo moe biti poniteno sa /-Y na komandnoj liniji.\n\n Za spajanje fajlova, navedite jedan fajl za odredite, ali vie fajlova za\n izvor (koriscenjem doker znakova ili fajl1+fajl2+fajl3 formatom).\n.\n\n:TEXT_CMDHELP_CTTY\nMenja terminalni ureaj korien za kontrolu sistema.\n\n  CTTY ureaj\n\n  ureaj    Terminalni ureaj koji elite koristiti, kao npr. COM1.\n.\n\n:TEXT_CMDHELP_DATE#1\nPrikazuje ili postavlja datum.\n\n  DATE [/D] [datum]\n\n  /D odvraa DATE od interaktivnosti.\n\n Pokrenite DATE bez parametara za prikaz trenutne postavke datuma\n i upit za novu. Pritisnite ENTER da zadrite isti datum.\n.\n\n:TEXT_CMDHELP_DEL#2\nBrie jedan ili vie fajlova.\n\n  DEL [drajv:][putanja]fajl [/P] [/V]\n  ERASE [drajv:][putanja]fajl [/P] [/V]\n\n  [drajv:][putanja]fajl   Navodi fajl(ove) za brisanje. Navedite vie\n                          fajlova koristei se doker znacima.\n  /P    Poziva upit za potvrdu pre brisanja svakog fajla pojedinano.\n  /V    Prikazuje sve izbrisane fajlove.\n.\n\n:TEXT_CMDHELP_DIR#4\nPrikazuje listu fajlova i pod-direktorijuma u direktorijumu.\n\n  DIR [drajv:][putanja][fajl] [/P] [/W] [/A[[:]atributi]]\n       [/O[[:]nain]] [/S] [/B] [/L] [/[Y|4]]\n\n  [drajv:][putanja][fajl]\n           Navodi drajv, direktorijum, i/ili fajlove za listanje.\n            (Moe biti sloena ili viestruka specififikacija fajlova)\n  /A       Prikazuje fajlove sa navedenim atributima. (Podraz. /ADHSRA)\n  atributi  D  Direktorijumi             R  Read-only (samo za itanje)\n            H  Hidden (sakriveni)        A  Spremni za arhiviranje\n            S  Sistemski fajlovi         -  Prefiks negacije\n  /O       Prikazuje fajlove sortirane na navedeni nain. (Podraz. /ONG)\n  nain     N  Po nazivu                 S  Po veliini\n            E  Po ekstenziji             D  Po datumu i vremenu\n            G  Grupie direktorijume     -  Prefiks inverznog redosleda\n            U  Nesortirano\n  /P       Pauzira posle svakog punog ekrana informacija.\n  /W       Koristi format irokog listanja.\n  /S       Prikazuje fajlove u navedenom diru i svim pod-direktorijumima.\n  /B       Koristi ogoljeni format (bez zaglavlja i statistike).\n  /L       Koristi mala slova.\n  /Y,/4    Prikazuje godinu sa 4 cifre.\n\n Prekidai mogu biti navedeni u DIRCMD promenljivi okruenja. Ponitite\n ve navedene prekidae postavljanjem prefiksa \"-\". Na primer: /-W.\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nDOSKEY je omoguen interno u komandnoj ljusci.\n\n Ŀ\n  Taster      Funkcija \n Ŀ\n  Gore/Dole   Poziva istoriju.                                      \n  Levo/Desno  Navigacija kroz komandnu liniju i/ili dopunjavanje    \n              trenutne linije prethodno pozvanom komandom.          \n  Home/End    Poetak/kraj linije.                                  \n  Insert      Promena izmeu moda umetanja i pisanja preko.         \n  Tab         Dopunjavanje trenutne rei kao naziv fajla. Dvostruki \n              pritisak e prikazati sve odgovarajue fajlove.       \n \n\n Komanda HISTORY e prikazati sadraj bafera istorije.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nNA %1 %9\n.\n\n:TEXT_CMDHELP_ECHO\nPrikazuje poruke, ili postavlja-uklanja odjek komandi.\n\n  ECHO [ON | OFF]\n  ECHO [poruka]\n  ECHO.\n\n Pokrenite ECHO bez parametara za prikaz trenutne postavke.\n \"ECHO.\" e ispisati praznu liniju na ekran.\n.\n\n:TEXT_CMDHELP_EXIT\nNaputa trenutno aktivnu komandnu ljusku.\n\n  EXIT\n.\n\n:TEXT_CMDHELP_FOR\nPokree navedenu komandu za svaki fajl iz navedenog skupa fajlova.\n\n  FOR %%varijabla IN (skup) DO komanda [parametri]\n\n  %%varijabla    Navodi zamenljivi parametar.\n  (skup)        Navodi skup od jednog ili vie fajlova. Doker znaci su\n                dozvoljeni.\n  komanda       Navodi komandu za izvrenje nad svakim fajlom iz skupa.\n  parametri     Navodi parametre navedene komande.\n\n U batch programima, koristite %%%%varijabla umesto %%varijabla.\n.\n\n:TEXT_CMDHELP_GOTO\nUpuuje komandnu ljusku na liniju odreenu labelom u batch programu.\n\n  GOTO labela\n\n  labela   Navodi labelu definisanu u trenutnom batch programu.\n\n Labelu piete samu na liniji, poinjui dvotakom.\n.\n\n:TEXT_CMDHELP_HISTORY#1\nPrikazuje trenutni sadraj bafera istorije.\n\n  HISTORY\n.\n\n:TEXT_CMDHELP_IF\nVri uslovno procesiranje u batch programima.\n\n  IF [NOT] ERRORLEVEL broj komanda\n  IF [NOT] string1==string2 komanda\n  IF [NOT] EXIST fajl komanda\n\n  NOT               Navodi da komandna ljuska treba da izvri komandu samo\n                    ukoliko je uslov netaan. Negacija uslova.\n  ERRORLEVEL broj   Vraa TANO ukoliko je prethodno pokrenuti program\n                    vratio izlazni kod jednak ili vei od navedenog broja.\n  komanda           Navodi komandu koja se treba izvriti ukoliko je uslov\n                    zadovoljen.\n  string1==string2  Vraa TANO ukoliko su nizovi znakova jednaki.\n  EXIST fajl        Vraa TANO ukoliko fajl sa navedenim imenom postoji.\n.\n\n:TEXT_CMDHELP_LH\nUitava program u gornje memorijsko podruje.\n\n  LOADHIGH [drajv:][putanja]fajl [parametri]\n  LOADHIGH [/L:podruje1[,min_vel1][;podruje2[,min_vel2]...] [/S]]\n           [drajv:][putanja]fajl [parametri]\n\n  /L:podruje1[,min_vel1][;podruje2[,min_vel2]...\n             Navodi podruje(a) memorije u koje treba uitati program.\n             - podruje1 navodi broj prvog memorijskog podruja.\n             - min_vel1 navodi minimalnu veliinu, ako postoji, za podruje1.\n             - podruje2 navodi broj drugog memorijskog podruja.\n             - min_vel2 navodi minimalnu veliinu, ako postoji, za podruje2.\n             Moete navesti koliko god elite memorijskih podruja.\n\n  /S         Smanjuje UMB do svoje minimalne veliine dok se program uitava.\n\n  [drajv:][putanja]fajl\n             Navodi lokaciju i naziv programa koji treba uitati.\n\n  parametri  Parametri programa koji se uitava.\n.\n\n:TEXT_CMDHELP_LOADFIX\nUitava program iznad prvih 64K memorije i pokree program.\n\n  LOADFIX [drajv:][putanja]fajl\n\n Upotrebite LOADFIX za uitavanje programa ukoliko ste dobili poruku\n \"Packed file corrupt\" pri pokuaju uitavanja u nisku memoriju.\n.\n\n:TEXT_CMDHELP_MD\nKreira novi direktorijum.\n\n  MKDIR [drajv:]putanja\n  MD [drajv:]putanja\n.\n\n:TEXT_CMDHELP_PATH\nPrikazuje ili postavlja putanju za traenje izvrnih fajlova.\n\n  PATH [[drajv:]putanja[;...]]\n  PATH ;\n\n Pokrenite \"PATH ;\" za brisanje svih putanja i usmerenje komandne\n ljuske na traenje izvrnih fajlova samo u trenutnom direktorijumu.\n Pokrenite PATH bez parametara za prikaz trenutne vrednosti.\n.\n\n:TEXT_CMDHELP_PAUSE\nZaustavlja procesiranje batch programa i prikazuje poruku:\n\"Pritisnite bilo koji taster za nastavak...\" ili navedenu poruku.\n\n  PAUSE [poruka]\n.\n\n:TEXT_CMDHELP_PROMPT\nMenja odziv komandnog prompta.\n\n  PROMPT [tekst]\n\n  tekst    Navodi novi komandni prompt\n\n Prompt moe biti sastavljen od znakova i sledeih specijalnih kodova:\n\n      $Q   = (znak za jednako)\n      $$   $ (znak za dolar)\n      $T   Trenutno vreme\n      $D   Trenutni datum\n      $P   Trenutni drajv i putanja\n      $V   Verzija komandne ljuske\n      $N   Trenutni drajv\n      $G   > (znak za vee-od)\n      $L   < (znak za manje-od)\n      $B   | (znak za cev)\n      $H   Backspace (brie prethodni znak)\n      $E   Escape kod (ASCII kod 27)\n      $_   CR i LF kodovi (nova linija)\n\n Pokrenite PROMPT bez parametara za reset prompta na standardnu postavku.\n.\n\n:TEXT_CMDHELP_PUSHD\nGura trenutni direktorijum na vrh steka direktorijuma, uz opciju da promeni\ntrenutni radni direktorijum.\n\n  PUSHD [[drajv:]putanja]\n\n  Gde je [drajv:]putanja nova putanja koju elite.\n.\n\n:TEXT_CMDHELP_POPD\nSkida direktorijum sa vrha steka direktorijuma, i postavlja ga za radni.\n\n  POPD [*]\n\n  Opcija '*' brie sadraj steka direktorijuma.\n.\n\n:TEXT_CMDHELP_DIRS\nPrikazuje sadraj steka direktorijuma.\n\n  DIRS\n.\n\n:TEXT_CMDHELP_RD\nUklanja (brie) direktorijum.\n\n  RMDIR [drajv:]putanja\n  RD [drajv:]putanja\n.\n\n:TEXT_CMDHELP_REM\nObeleava komentar (napomenu) u batch fajlu ili CONFIG.SYSu.\n\n  REM [komentar]\n.\n\n:TEXT_CMDHELP_REN\nMenja naziv fajlu ili direktorijumu.\n\n  RENAME [drajv:][putanja][dir1 | fajl1] [dir2 | fajl2]\n  REN [drajv:][putanja][dir1 | fajl1] [dir2 | fajl2]\n\n Doker znaci nisu dozvoljeni.\n\n Primetite da ne moete navesti novi drajv ili putanju za odredite.\n U tu svrhu upotrebite eksternu komandu MOVE.\n.\n\n:TEXT_CMDHELP_SET#1\nPrikazuje, postavlja, ili uklanja promenljive okruenja.\n\n  SET [/C] [/P] [promenljiva=[string]]\n\n  promenljiva  Navodi ime promenljive okruenja.\n  string       Navodi niz znakova za dodelu promenljivoj. Ukoliko string\n               nije naveden, promenljiva se uklanja iz okruenja.\n\n Pokrenite SET bez parametara za prikaz trenutnih promenljivi okruenja.\n\n  /C    Prisiljava zadravanje navedene veliine slova promenljive.\n  /P    Poziva upit sa stringom i dodeljuje korisniki unos promenljivoj.\n\n Promenljiva se standardno menja u velika slova, ukoliko se ve ne\n nalazi u okruenju, inae se navedena veliina slova zadrava.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nMenja poziciju zamenljivih parametara u batch fajlu.\n\n  SHIFT [DOWN]\n\n DOWN pomera prozor argumenata prema poetku (%%0). U ostalim sluajevima\n pomera isti prema kraju.\n.\n\n:TEXT_CMDHELP_TIME#1\nPrikazuje ili postavlja sistemsko vreme.\n\n  TIME [/T] [vreme]\n\n  /T odvraa TIME od interaktivnosti.\n\n Pokrenite TIME bez parametara za prikaz trenutne postavke vremena i\n upit za novu. Pritisnite ENTER da sauvate isto vreme.\n.\n\n:TEXT_CMDHELP_TRUENAME\nPrikazuje punu putanju trenutne ili navedene putanje.\n\n  TRUENAME [[drajv:][putanja][fajl]]\n.\n\n:TEXT_CMDHELP_TYPE\nPrikazuje sadraj tekstualnih fajlova.\n\n  TYPE [drajv:][putanja]fajl\n.\n\n:TEXT_CMDHELP_VER\nPrikazuje verziju komandne ljuske i ostale informacije.\n\n  VER [/R] [/W] [/D] [/C]\n\n  /R         Verzija jezgra i ostale informacije.\n  /W         Garancija komandne ljuske.\n  /D         Informacije o pravilima redistribuiranja.\n  /C         Imena saradnika.\n.\n\n:TEXT_CMDHELP_VERIFY\nPostavlja ili uklanja dodatne provere korektnosti upisa fajlova na disk.\n\n  VERIFY [ON | OFF]\n\n Pokrenite VERIFY bez parametara za prikaz trenutne postavke.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nNA\n.\n\n:TEXT_CMDHELP_VOL\nPrikazuje labelu volumena i serijski broj, ukoliko isti postoje.\n\n  VOL [drajv:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nPrikazuje listu komandi i osobina dostupnih u ljusci.\n\n  ?\n  ?komanda [argument]\n\n Prva varijanta prikazuje dostupne komande i osobine ljuske.\n Druga varijanta e izneti upit da li se navedena komanda treba\n izvriti, kao da je mod praenja aktivan.\n.\n\n:TEXT_CMDHELP_WHICH\nTrai i prikazuje izvrne fajlove za svaku navedenu komandu.\n\n  WHICH {komanda}\n.\n\n:TEXT_CMDHELP_MEMORY#1\nNA\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\nOdredite COPY ne sme sadrati plus ('+') znakove.\n.\n\n:TEXT_DELETE_FILE#1\nBrisanje fajla \"%s\".\n.\n"
  },
  {
    "path": "strings/slovene.err",
    "content": "# $Id$\n#\n# Critical error national customization file\n#\n# Language: Slovene\n# Codepage: 852\n# Author:   Matej Horvat (http://matejhorvat.si/)\n# \n# The critical error (criter) handler receives some information\n# from the kernel about what error condition happens, generates some\n# human friendly message from it, requests the user's opinion about\n# how to proceed and, finally, returns to the kernel.\n# \n# The human friendly message is generated using one of the following\n# templates:\n# BLOCK_DEVICE (for criters on block devices)\n# \tError %1 drive %A: %2 area: %3\n# -and- CHAR_DEVICE (for criters on character devices)\n# \tError %1 device %A: %3\n# \n# Two-character sequences, which first character is a percent sign '%',\n# are placeholders for other information:\n# %% -> a single percent sign\n# %1 -> either READ or WRITE, depending on what kind of operation\n# \tcaused the criter\n# %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA\n# %3 -> the actual error string; these are the strings associated to\n# \ta number 0 through N, and must correspond to the number passed in\n# \tlowbyte(DI) to the criter handler (see RBIL INT-24 for details)\n# %A -> drive letter (for block devices); name of device (character devices)\n# \n# Below the line describing the error the user is prompted for the action\n# to proceed. This line is dynamically constructed depending on which\n# action are available at all. The full line may look like this:\n# \t(A)bort, (I)gnore, (R)etry, (F)ail?_\n# \n# The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They\n# should indicate which user response keys is associated with them;\n# suggested is to use the first letter and enclose it in parenthesises.\n# The delimiter \", \" can be defined with DELIMITER and is the same\n# for all slots.\n# The \"? \" sequence is defined by QUESTION.\n# The order of the actions is fixed and cannot be customized.\n# \n# With each action a number of user response keys must be associated.\n# They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ...\n# strings. Because the key is searched in the same format as returned\n# by INT-16-00, both upper and lower case must be specified and\n# certain special keys cannot be used.\n# \n# The individual error strings are defined by the #: lines, where\n# the hash sign '#' refers to the number the kernel passes to the\n# criter handler. The UNKNOWN string is displayed for all error\n# numbers not specified.\n#\n# NOTE #1: The percent rule applies to _all_ criter strings!\n# NOTE #2: Each string occupies exactly one line.\n# NOTE #3: Any leading or trailing whitespaces are removed. Prefix the\n#\tfirst or suffix the last whitespace with '%.' (one percent sign and\n#\tone dot). This sequence is removed from the string totally.\n# NOTE #4: To embed any character use: %&## (one percent sign,\n#\t\tone ampersand and exactly two hexa-decimal digits)\n\n## Primary strings\nS2\nBLOCK_DEVICE: Napaka pri %1 pogona %A: obmoje %2: %3\nS3\nCHAR_DEVICE: Napaka pri %1 naprave %A: %3\n\n## kind of operation\nS0\nREAD: branju\nS1\nWRITE: pisanju\n\n## kind of failed area of block devices\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: korena\nS7\nDATA: podatkov\n\n## action strings\nS8\nIGNORE: (P)rezri\nS9\nRETRY: (Z)nova\nS10\nABORT: (O)pusti\nS11\nFAIL: (S)podleti\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: pP\nKEYS_RETRY:  zZ\nKEYS_ABORT:  oO\nKEYS_FAIL:   sS\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN: Neznana koda napake\nS15\n0: poskus prekritve zaite pred pisanjem\n1: neznana enota za gonilnik\n2: pogon ni pripravljen\n3: gonilnik je prejel neznan ukaz\n4: podatkovna napaka (napaen CRC)\n5: napana dolina strukture zahteve za gonilnik\n6: napaka pri iskanju\n7: neznana vrsta medija\n8: sektorja ni mogoe najti\n9: tiskalnik nima papirja\n10: napaka pri pisanju\n11: napaka pri branju\n12: splona napaka\n13: prekritev deljenja\n14: prekritev zaklepa\n15: neveljavna zamenjava diskete\n16: FCB ni na voljo\n17: medpomnilnik za deljenje prepoln\n18: neujemanje kodiranj\n19: ni ve vhoda\n20: ni dovolj prostora na disku\n"
  },
  {
    "path": "strings/slovene.lng",
    "content": "# $Id$\n#\n# FreeCOM national customization file\n#\n#\tLanguage: Slovene\n#\tCodepage: 852\n#\tAuthor:   Matej Horvat (http://matejhorvat.si/)\n# \n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retreive the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#\t:TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n# If there is a percent sign (%) appended to the version, the printf()\n# format string %-style placeholders are compared for the strings. The\n# sign need to be set in DEFAULT.lng only.\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carrage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause an user interaction. Those ones should be in sync\n# with the issued text. To define how to interprete a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#YyNn\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceeding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the question\n# mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readibility of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH#0%\nNeveljavna monost /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH#0%\nNeveljavna monost /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION#0%\nNepravilno oblikovana monost \"%s\"\n.\n\n:TEXT_ERROR_OPT_ARG#0%\nMonost \"%s\" ne more imeti argumenta\n.\n\n:TEXT_ERROR_OPT_NOARG#0%\nMonost \"%s\" mora imeti argument\n.\n\n:TEXT_INVALID_NUMBER#0%\nNeveljavna tevilka v monosti \"%s\"\n.\n\n:TEXT_ERROR_CLOSE_QUOTE#0%\nManjka konni narekovaj: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nNi mogoe ustvariti zaasne datoteke\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0%\nPreve parametrov: %s\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nPreve parametrov.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER#0%\nNeveljaven parameter: %s\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nPoti ni mogoe najti.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nDatoteke ni mogoe najti.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND#0%\nDatoteke ni mogoe najti: %s\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING#0%\nZahtevan parameter manjka.\n.\n\n:TEXT_ERROR_INVALID_DRIVE#0%\nNeveljaven pogon %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2%\nNeveljaven ukaz ali datoteka: %s\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nNi dovolj spomina.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nNi mogoe dodeliti spomina za DOS.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nNi mogoe preusmerjati izhoda; ni mogoe odpreti zaasne datoteke.\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE#0%\nVrstica %ld v datoteki %s je predolga.\n.\n\n:TEXT_ERROR_BFILE_VANISHED#0%\nUkazne datoteke \"%s\" ni mogoe najti.\n.\n\n:TEXT_ERROR_BFILE_LABEL#0%\nUkazna datoteka %s ne vsebuje oznake %s.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1%\n%s ni uspel za \"%s\".\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR#0%\nNi mogoe nastaviti okoljske spremenljivke %s.\nJe okolje polno?\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND#0%\nOkoljske spremenljivke %s ni mogoe najti.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nNi okolja. Morda ni dovolj spomina. Uporabite monost /E.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1%\nNi mogoe nastaviti sopomenke \"%s\". Je spomin za sopomenke poln?\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1%\nSopomenke \"%s\" ni mogoe najti.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nNi prostora za sopomenke. Morda ni dovolj spomina.\n.\n\n:TEXT_ERROR_SYNTAX_STR#0%\nSintaktina napaka: %s\n.\n\n:TEXT_ERROR_SYNTAX\nSintaktina napaka.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG#0%\nPredolgo ime datoteke: %s\n.\n\n:TEXT_ERROR_SELFCOPY#0%\nDatoteke %s ni mogoe kopirati nase.\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nUkazna vrstica je zaradi raziritve sopomenk postala predolga!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nUkazna vrstica je dalja od 125 znakov.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1%\nNeveljavna velikost zgodovine: %s\n.\n\n:TEXT_HISTORY_EMPTY#1\nZgodovina je prazna.\n.\n\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nVeriga MCB je pokodovana ali pa sistem ni zdruljiv z MS-DOS.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR#0%\nNedefinirana napaka %d.\n.\n\n:TEXT_ERROR_REGION_WARNING#0%\nIllegal memory region %d - ignored.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nTreba je doloiti ON ali OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nNeveljavna specifikacija spremenljivke.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nIN manjka v ukazu FOR.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nEn ali ve oklepajev manjka.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nDO manjka v ukazu FOR.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nBesedi DO v ukazu FOR ne sledi ukaz.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE#0%\nNi mogoe preusmeriti vhoda iz datoteke %s.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE#0%\nNi mogoe preusmeriti izhoda v datoteko %s.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nPrazna preusmeritev.\n.\n\n:TEXT_ERROR_INVALID_DATE\nNeveljaven datum.\n.\n\n:TEXT_ERROR_INVALID_TIME\nNeveljaven as.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nNi doloene oznake za GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nTa COMMAND.COM ne vsebuje ukaza CTTY.\n.\n\n:TEXT_ERROR_NORW_DEVICE#0%\nNaprava \"%\" ni veljavna ali pa ne omogoa branja in pisanja.\n.\n\n:TEXT_ERROR_CTTY_DUP#0%\nFailed to change file descriptors to TTY '%s'.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\n/L e ni podprt.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\n/U e ni podprt.\n.\n\n:TEXT_ERROR_WRITING_DEST\nNapaka pri pisanju na cilj.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE#0%\nNi mogoe odpreti izvora: %s\n.\n\n:TEXT_ERROR_OPEN_FILE#0%\nNi mogoe odpreti datoteke \"%s\"\n.\n\n:TEXT_ERROR_READ_FILE#0%\nNi mogoe brati iz datoteke \"%s\"\n.\n\n:TEXT_ERROR_WRITE_FILE#0%\nNi mogoe pisati v datoteko \"%s\"\n.\n\n:TEXT_ERROR_LEADING_PLUS\nZnak za zdruevanje, \"+\", ne more stati pred datotekami.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nZnak za zdruevanje, \"+\", ne more slediti datotekam.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nNi za postoriti.\n.\n\n:TEXT_ERROR_COPY\nCOPY ni uspel\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: manjka ime datoteke\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: manjka tevilo\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: neveljavno tevilo\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: manjka ukaz\n.\n\n:TEXT_NOT_IMPLEMENTED_YET\nTa funkcija e ni podprta.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nNi bilo mogoe naloiti sporoil v spomin.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nTa COMMAND.COM ne vsebuje monosti /MSG.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1%\nPrikazanih %u elementov.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nPokodovana ukazna vrstica. To je notranja napaka in je povezana\ns sistemom, v katerem se izvaja COMMAND.COM. Prosimo, da to\nnapako sporoite.\n.\n\n:TEXT_QUOTED_C_OR_K#1\nMonosti /C in /K ni mogoe citirati, ker se ne upotevata.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1%\nPot do COMMAND.COM mora biti absolutna!\nTo pomeni, da mora vsebovati rko pogona, ki ji sledi \"\\\\\".\nPrimer: C:\\\\FDOS\n\nCOMMAND.COM trenutno uporablja to pot:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nThe session information could not be restored, any local settings\nare lost. Please refer to above error messages for the reason\nof this problem.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nThe current information cannot be preserved during the call of the\nprogram. Please refer to above error messages for the reason of\nthis problem.\n.\n\n:TEXT_ERROR_CWD_FAILED#1%\nPogon %c: se ne odziva.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nIzmenjava ni uspela: sopomenke zavzemajo preve spomina.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nIzmenjava ni uspela: ni mogoe dodeliti oddaljenega spomina.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nNi ve prostora za sopomenke.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1%\nSopomenka \"%s\" ne obstaja.\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nNi bilo mogoe vstaviti sopomenke.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1%\nNeveljavno ime sopomenke \"%s\".\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nCannot load Context module or Critical Error handler.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nContext out of memory.\nIf this error persists, consider to increase some internal buffer,\nsuch as history, direcory stack etc.\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1%\nVelikost konteksta znaa %lu bajtov, kar je veje od omejitve.\nSpremenjena bo na %u bajtov.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nFailed to add status information into context. This error may indicate\nmemory corruption or an incorrectly determined minimum size of\nthe context. Please inform the maintainer of FreeCOM at:\nfreedos-devel@lists.sourceforge.net\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nKontekst je ob izmenjavi izginil. Bil je ponovno ustvarjen,\ntoda vse sopomenke itd. so izgubljene.\n.\n\n:TEXT_ERROR_PERMISSION_DENIED#1%\n%s: dostop zavrnjen\n.\n\n:TEXT_ERROR_NO_SUCH_FILE#1%\n%s: datoteka ali imenik ne obstaja\n.\n\n:TEXT_ERROR_UNKNOWN_ERROR#1%\n%s: neznana napaka\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nPritisnite katerokoli tipko\\\n.\n\n:TEXT_MSG_HISTORY_SIZE#0%\nVelikost zgodovine je %d bajtov.\n.\n\n:TEXT_MSG_DOSKEY\nFunkcije DOSKEY so e omogoene.\n.\n\n:TEXT_MSG_ECHO_STATE#0%\nECHO je %s\n.\n\n:TEXT_MSG_VERIFY_STATE#0%\nVERIFY je %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE#0%\nDEBUG output is %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET#0%\nDEBUG output is printed to '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE#0%\nBREAK je %s\n.\n\n:TEXT_MSG_LFNFOR_STATE#0%\nLFNFOR je %s\n.\n\n:TEXT_MSG_LFNFOR_COMPLETE_STATE#0%\nLFN Complete is %s\n.\n\n:TEXT_MSG_CURRENT_DATE#0%\nTrenutni datum je %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1%\nVnesite nov datum (mm%sdd%s[cc]yy): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1%\nVnesite nov datum (dd%smm%s[cc]yy): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1%\nVnesite nov datum ([cc]yy%smm%sdd): \\\n.\n\n:TEXT_MSG_CURRENT_TIME#0%\nTrenutni as je %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nVnesite nov as: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING#0%\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1%\nDdNn{CR}{LF}{CBREAK}\naabb   b   b       b\nVse datoteke v imeniku \"%s\" bodo izbrisane.\nSte prepriani (D/N)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nDdNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [Da=ENTER, Ne=ESC] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#\tby \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1%\nDdNnVvQq{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\nCtrl+Break pritisnjen.\\r\nPrehenam izvajati \"%s\" (Da/Ne/Vsi)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1%\nDdNnVvPp{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nNaj zamenjam \"%s\" (Da/Ne/Vse/Prekini)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_APPEND_FILE#1%\nDdNnVvPp{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nAppend to '%s' (Da/Ne/Vse/Prekini) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1%\nDdNnVvPp{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nNaj izbriem \"%s\" (Da/Ne/Vse/Prekini)? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<neznano>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nImeniki sklad je prazen.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1%\n Nosilec na pogonu %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING#0%\nje %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nnima oznake\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER#0%\n Serijska tevilka nosilca je %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1%\n%10s datotek\\\n.\n:TEXT_DIR_FTR_BYTES#0%\n   %12s bajtov\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\ntevilo izpisanih datotek:\n.\n:TEXT_DIR_FTR_DIRS#1%\n%10s imenikov\\\n.\n:TEXT_DIR_FTR_BYTES_FREE#0%\n %13s bajtov prostih\n.\n:TEXT_DIR_DIRECTORY#0%\nImenik %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE#0%\n Imenik %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1%\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE#1%\n%s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1%\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1%\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <DIR> \\\n.\n:TEXT_DIR_LINE_SIZE#1%\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1%\n%-14s\\\n.\n\n:TEXT_MSG_PATH#0%\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nPot iskanja ni definirana.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nned\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\npon\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\ntor\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nsre\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\net\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\npet\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nsob\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\n0 datotek odstranjenih.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\n1 datoteka odstranjena.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1%\n%u datotek odstranjenih.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nVgrajeni ukazi:\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\nFunkcije, ki so na voljo:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[sopomenke] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[izboljan vnos] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[zgodovina] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[dokonavanje imen datotek] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[izmenjava] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[start logging] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[prejnji imenik] \\\n.\n:TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1\n[dolga imena datotek] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[izmenjava z jedrom] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[XMS izmenjava] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[default to swap] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[namestljivi ukazi] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[imeniki sklad (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[razhroevanje FreeCOMa] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nPritisnite F8 za nain sledenja ali F5 za preskoitev %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0%\nPreskakujem %s.\n.\n\n:TEXT_MSG_VER_DOS_VERSION#0%\nDOS verzija %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nJedro FreeDOS (izgradnja 1933 ali stareja)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS#0%\nJedro FreeDOS, verzija %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\n(C) 1994-2005 Tim Norman in drugi.\n\nTa program je razpeavan v upanju, da bo komu uporaben, toda BREZ\nKAKRNEGAKOLI JAMSTVA; cel brez jamstva PRODAJNOSTI ali PRIMERNOSTI ZA\nKATERIKOLI NAMEN. Za ve podrobnosti glejte Splono dovoljenje GNU (GNU GPL).\n\nPoroajte o hroih na freedos-devel@lists.sourceforge.net.\nPosodobitve so na voljo na http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\n(C) 1994-2005 Tim Norman in drugi.\n\nTo je prosta programska oprema; razpeavate in/ali spreminjate jo lahko pod\npogoji, navedenimi v Splonem dovoljenju GNU (GNU GPL), ki ga je izdala\norganizacija Free Software Corporation; slediti morate pogojem verzije 2\nali noveje.\n\nPoroajte o hroih na  freedos-devel@lists.sourceforge.net.\nPosodobitve so na voljo na http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_DEVELOPERS\nFreeCOM, FreeDOSovo ukazno lupino, razvija veliko ljudi; glejte priloeno\ndatoteko HISTORY.TXT.\n\nPoroajte o hroih na freedos-devel@lists.sourceforge.net.\nPosodobitve so na voljo na http://freedos.sourceforge.net/freecom\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nThe shell is about to be terminated, though, this is\\r\nforbidden (usually by enabling the \"/P\" option).\\r\nYou must reboot the system or, if this shell runs in\\r\na multitasking environment, terminate this process/task manually.\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nFreeCOM executable not found.\nYou must specify the complete path to COMMAND.COM\nas the first argument of COMMAND, for instance:\nC:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1%\nOkoljski segment:  omejitev %5u bajtov; %5u bajtov prostih\n.\n:TEXT_MEMORY_CONTEXT#1%\nSegment konteksta: omejitev %5u bajtov; %5u bajtov prostih\n.\t\n:TEXT_MEMORY_HEAP#1%\nHeap:              %5lu bajtov prostih\n.\n:TEXT_MEMORY_CTXT_ALIAS#1%\n\\tSopomenke:       omejitev %5u bajtov, trenutno %5u, %5u elementov\n.\n:TEXT_MEMORY_CTXT_HISTORY#1%\n\\tZgodovina:       omejitev %5u bajtov, trenutno %5u, %5u elementov\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1%\n\\tImeniki sklad:  omejitev %5u bajtov, trenutno %5u, %5u elementov\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1%\n\\tPrejnji imenik: porabljenih %5u bajtov, %5u elementov\n.\n:TEXT_MEMORY_CTXT_BATCH#1%\n\\tBatch nesting  : porabljenih %5u bajtov, %5u elementov\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1%\n\\tSwapinfo       : porabljenih %5u bajtov, %5u elementov\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nNi mogoe dobiti podatka o trenutno izbranem kodiranju.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nNi mogoe zamenjati kodiranja.\n.\n:TEXT_DISPLAY_CODEPAGE#1%\nTrenutno izbrano kodiranje je %u.\nThe system codepage (properly) is: %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nPrikae, nastavlja, ali odstranjuje sopomenke.\n\nALIAS [sopomenka[=][definicija]]\n\n  sopomenka   Doloi ime sopomenke.\n  definicija  Doloi niz znakov, v katere bo sopomenka razirjena.\n\nVnesite ALIAS brez parametrov, da vidite trenutno definirane sopomenke.\n.\n\n:TEXT_CMDHELP_BEEP\nZapiska.\n\nBEEP\n.\n\n:TEXT_CMDHELP_BREAK\nSets or clears extended CTRL+C checking.\n\nBREAK [ON | OFF]\n\nType BREAK without a parameter to display the current BREAK setting.\n.\n\n:TEXT_CMDHELP_CALL#1\nCalls one batch program from another.\n\nCALL [/S | /N] [/Y] [pogon:][pot]datoteka [batch-parameters]\n\n  batch-parameters   Specifies any command-line information required by\n                     the batch program.\n  /S enforces, /N denies swapping of FreeCOM.\n  /Y enables tracemode during execution of the command.\n.\n\n:TEXT_CMDHELP_CD\nPrikae ime trenutnega imenika ali pa ga spremeni.\n\nCHDIR [pogon:][pot]\nCHDIR[..]\nCD [pogon:][pot]\nCD[..]\nCD -\n\n  ..  Gre v nadrejeni imenik.\n  -   Gre v prejnji imenik, e je ta funkcija omogoena.\n\nVnesite CD pogon:, da vidite trenutni imenik doloenega pogona.\nVnesite CD brez parametrov, da vidite trenutni pogon in imenik.\nGlej tudi: CDD\n.\n\n:TEXT_CMDHELP_CDD\nPrikae ime trenutnega pogona in imenika ali pa ju spremeni.\n\nCDD [pogon:][pot]\nCDD[..]\n\n  ..  Gre v nadrejeni imenik.\n  -   Gre v prejnji imenik, e je ta funkcija omogoena.\n\ne je doloen samo pogon, se spremeni trenutni pogon; to je edina razlika med\nCDD in CHDIR.\nVnesite CDD brez parametrov, da vidite trenutni pogon in imenik.\n.\n\n:TEXT_CMDHELP_CHCP\nPrikae ali spremeni trenutno kodiranje znakov (kodno stran).\n\nCHCP [nnn]\n\n  nnn  Doloi kodiranje.\n\nVnesite CHCP brez parametra, da vidite trenutno izbrano kodiranje.\n.\n\n:TEXT_CMDHELP_CLS\nIzprazni zaslon.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\nZaene novo kopijo FreeCOMa.\n\nCOMMAND [[pogon:]pot] [naprava] [/E:n] [/L:n] [/U:n] [/P] [/MSG] [/LOW]\n  [/Y [/[C|K] ukaz]]\n\n  [pogon:]pot  Doloi imenik, ki vsebuje COMMAND.COM.\n  naprava      Doloi napravo, ki naj bo uporabljena za vhod in izhod.\n  /E:nnnnn     Nastavi zaetno velikost okolja na n bajtov.\n               (n naj bo med 256 in 32768)\n  /L:n         Doloi velikost notranjih struktur (zahteva /P).\n               (n naj bo med 128 in 1024)\n  /U:n         Doloi velikost spomina za vhod (zahteva /P)\n               (n naj bo med 128 in 255)\n  /P           Naredi novo lupino trajno (ne da se je konati).\n  /MSG         Shrani vsa sporoila o napakah v spominu (zahteva /P).\n  /LOW         Prisili lupino, da shrani stalen del v niji del spomina.\n  /Y           Koraka skozi ukazno datoteko, ki jo doloi /C ali /K.\n  /C ukaz      Izvede naveden ukaz in se kona.\n  /K ukaz      Izvede naveden ukaz in nadaljuje z izvajanjem.\n.\n\n:TEXT_CMDHELP_COPY\nKopira eno ali ve datotek na drugo lokacijo.\n\nCOPY [/A | /B] izvor [/A | /B] [+ izvor [/A | /B] [+ ...]] [cilj [/A | /B]]\n  [/V] [/Y | /-Y]\n\n  izvor  Doloi datoteke, ki naj se kopirajo.\n  /A     Doloi ASCII datoteko z besedilom.\n  /B     Doloi binarno datoteko.\n  cilj   Doloi imenik in/ali ime za nove datoteke.\n  /V     Preveri, ali so se datoteke pravilno zapisale.\n  /Y     Ne vpraa, ali elite zamenjati obstojeo ciljno datoteko.\n  /-Y    Vpraa, ali elite zamenjati obstojeo ciljno datoteko.\n\nMonost /Y je lahko prednastavljena v spremenljivki COPYCMD.\nOnemogoite jo lahko z /-Y na ukazni vrstici.\n\nDa zdruite ve datotek v eno, doloite samo eno ciljno datoteko, toda ve\nizvornih datotek (z nadomestnimi znaki ali kot datoteka1+datoteka2+datoteka3).\n.\n\n:TEXT_CMDHELP_CTTY\nZamenja terminal, s katerim upravljate sistem.\n\nCTTY naprava\n\n  naprava  Terminal, ki ga elite uporabljati, npr. COM1.\n.\n\n:TEXT_CMDHELP_DATE#1\nPrikae ali nastavi datum.\n\nDATE [/D] [datum]\n\nVnesite DATE brez parametrov, da vidite trenutni datum in istoasno nastavite\nnovega. Pritisnite Enter, da obdrite isti datum.\n\n/D onemogoi interaktivnost.\n.\n\n:TEXT_CMDHELP_DEL#2\nIzbrie eno ali ve datotek.\n\nDEL [pogon:][pot]datoteka [/P] [/V]\nERASE [pogon:][pot]datoteka [/P] [/V]\n\n  [pogon:][pot]datoteka  Doloi datoteko za izbris. Ve datotek doloite z\n                         nadomestnimi znaki.\n  /P                     Vpraa za potrditev, preden izbrie vsako datoteko.\n  /V                     Prikae izbrisane datoteke.\n.\n\n:TEXT_CMDHELP_DIR#4\nPrikae seznam datotek in podimenikov v imeniku.\n\nDIR [pogon:][pot][datoteka] [/P] [/W] [/A[[:]atributi]] [/O[[:]razvrstitev]]\n  [/S] [/B] [/L] [/LFN] [/Y|/4]\n\n [pogon:][pot][datoteka]\n              Doloi pogon, imenik, in/ali datoteke, ki naj bodo prikazane.\n              Uporabite lahko nadomestne znake ali ve izrazov.\n /P           Se ustavi po vsakem zaslonu informacij.\n /W           irok seznam.\n /A           Prikae datoteke z doloenimi atributi.\n atributi      D  imeniki             R  datoteke samo za branje\n               H  skrite datoteke     A  datoteke, pripravljene za arhiviranje\n               S  sistemske datoteke  -  predpona \"ne\"\n /O           Doloi vrstni red.\n razvrstitev   N  po imenu (abecedno)     S  po velikosti (manji najprej)\n               E  po konnici (abecedno)  D  asovno (stareji najprej)\n               G  najprej imeniki         -  predpona za obratni vrstni red\n               A  po asu zadnjega dostopa (stareji najprej)\n /S           Prikae datoteke v doloenem imeniku in vseh podimenikih.\n /B           Minimalistien format (brez glave in povzetka).\n /L           Uporabi male rke.\n /LFN         Prikae dolga imena datotek.\n /Y ali /4    Prikae letnice s 4 tevkami.\n\nMonosti so lahko prednastavljene v spremenljivki DIRCMD. Onemogoite jih\nlahko tako, da pred monostjo vnesete \"-\", npr. /-W.\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nFunkcije programa DOSKEY zdaj vsebuje FreeCOM.\nS tipkama gor in dol brskate po zgodovini, z ukazom HISTORY pa vidite celotno\nzgodovino vpisanih ukazov.\nS tipkami levo, desno, Home, in End se pomikate po ukazni vrstici.\nS tipko Insert preklapljate med nainom vrivanja in prepisovanja.\nS tipko Tab dokonate ime datoteke na podlagi trenutno vneene besede; e jo\npritisnete dvakrat, boste videli vse datoteke, ki se z njo ujemajo.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nEdits command lines, recalls command lines, and creates macros\n\nDOSKEY [/switch ...] [macroname=[text]]\n\n  /BUFSIZE:size Sets size of macro and command buffer            (default:512)\n  /ECHO:on|off  Enables/disables echo of macro expansions        (default:on)\n  /FILE:file    Specifies file containing a list of macros\n  /HISTORY      Displays all commands stored in memory\n  /INSERT       Inserts new characters into line when typing\n  /KEYSIZE:size Sets size of keyboard type-ahead buffer          (default:15)\n  /LINE:size    Sets maximum size of line edit buffer            (default:128)\n  /MACROS       Displays all DOSKey macros\n  /OVERSTRIKE   Overwrites new characters onto line when typing  (default)\n  /REINSTALL    Installs a new copy of DOSKey\n  macroname     Specifies a name for a macro you create\n  text          Specifies commands you want to assign to the macro\n\n  UP,DOWN arrows recall commands\n      Esc clears current command\n       F7 displays command history\n   Alt+F7 clears command history\n[chars]F8 searches for command beginning with [chars]\n       F9 selects a command by number\n  Alt+F10 clears macro definitions\n\nThe following are special codes you can use in DOSKey macro definitions:\n  $T     Command separator: allows multiple commands in a macro\n  $1-$9  Batch parameters: equivalent to %1-%9 in batch programs\n  $*     Symbol replaced by everything following macro name on the command line\n.\n\n:TEXT_CMDHELP_ECHO\nPrikazuje sporoila ali omogoi ali onemogoi izpisovanje ukazov.\n\n  ECHO [ON | OFF]\n  ECHO [sporoilo]\n\nVnesite ECHO brez parametrov, da izveste trenutno stanje ECHO.\n.\n\n:TEXT_CMDHELP_EXIT\nKona FreeCOM, razen e je ta bil naloen z monostjo /P.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\nIzvede doloen ukaz za vsako datoteko v mnoici datotek.\n\nFOR %%spremenljivka IN (mnoica) DO ukaz [parametri]\n\n  %%spremenljivka  Doloi ime spremenljivke.\n  (mnoica)       Doloi mnoico ene ali ve datotek. Uporabite lahko\n                  nadomestne znake.\n  ukaz            Doloi ukaz, ki naj bo izveden za vsako datoteko.\n  parametri       Doloi parametre za naveden ukaz.\n\nV ukazni datoteki vnesite %%%%spremenljivka namesto %%spremenljivka.\n\nPrimer:\n  FOR %%f IN (---zaetek--- a*.* ---konec---) DO ECHO - %%f -\n.\n\n:TEXT_CMDHELP_GOTO\nV ukazni datoteki nadaljuje izvajanje od oznaene vrstice.\n\nGOTO oznaka\n\n  oznaka  Doloi oznako vrstice.\n\nOznaka v vrstici stoji sama, zane pa se z dvopijem.\n.\n\n:TEXT_CMDHELP_HISTORY#1\nZgodovina vneenih ukazov.\n\nHISTORY [velikost]\n\nBrez velikosti je prikazana celotna zgodovina vneenih ukazov.\nZ velikostjo se spremeni velikost spomina, posveenega zgodovini.\n.\n\n:TEXT_CMDHELP_IF\nV ukazni datoteki izvede ukaz, e je izpolnjen doloen pogoj.\n\nIF [NOT] ERRORLEVEL tevilo ukaz\nIF [NOT] niz1==niz2 ukaz\nIF [NOT] EXIST datoteka ukaz\n\n  NOT                 Doloi, naj ukazna lupina izvede ukaz, e pogoj ni\n                      izpolnjen.\n  ERRORLEVEL tevilo  Ukaz se bo izvedel, e je zadnji izvedeni ukaz vrnil\n                      napako, katere koda je enaka ali veja od navedenega\n                      tevila.\n  niz1==niz2          Ukaz se bo izvedel, e se niza ujemata.\n  EXIST datoteka      Ukaz se bo izvedel, e datoteka obstaja.\n  ukaz                Doloi ukaz, ki naj bo izveden, e je pogoj izpolnjen.\n.\n\n:TEXT_CMDHELP_LFNFOR\nVkljui ali izkljui dolga imena datotek v ukazu FOR ali dokonavanje imen\ndatotek.\n\nLFNFOR [ON | OFF]\nLFNFOR COMPLETE [ON | OFF]\n\nVnesite LFNFOR ali LFNFOR COMPLETE brez parametra, da vidite trenutno\nnastavitev LFNFOR.\n.\n\n:TEXT_CMDHELP_LH\nNaloi program v gornji spomin.\n\nLOADHIGH [pogon:][pot]datoteka [parametri]\nLOADHIGH [/L:regija1[,minVelikost1][;regija2[,minVelikost2]...] [/S]]\n         [pogon:][pot]datoteka [parametri]\n\n/L:regija1[,minVelikost1][;regija2[,minVelikost2]...\n    Doloi regijo oz. regije spomina, v katere naj se naloi program. Regija1\n    doloi tevilo prve regije, minVelikost1 doloi minimalno velikost (e\n    sploh) za regijo1. Regija2 in minVelikost2 doloita tevilo in minimalno\n    velikost druge regije, e obstaja. Regij lahko doloite, kolikor elite.\n/S\n  Skri UMB na minimalno velikost, medtem ko se program nalaga.\n[pogon:][pot]datoteka\n  Doloi lokacijo in ime programa.\n.\n\n:TEXT_CMDHELP_LOADFIX\nNaloi program nad prvih 64K spomina in ga izvede.\n\nLOADFIX [pogon:][pot]datoteka\n\nUporabite LOADFIX, e ste prejeli sporoilo \"Packed file corrupt\", ko ste ga\nposkuali naloiti v nizek del spomina.\n.\n\n:TEXT_CMDHELP_MD\nUstvari imenik.\n\nMKDIR [pogon:]pot\nMD [pogon:]pot\n.\n\n:TEXT_CMDHELP_PATH\nPrikae ali spremeni seznam imenikov, v katerih se iejo programi.\n\nPATH [[pogon:]pot[;...]]\nPATH ;\n\nVnesite PATH ;, da izpraznite seznam in ukaete lupini, naj programe ie le\nv trenutnem imeniku.\nVnesite PATH brez parametrov, da vidite trenutni seznam programskih imenikov.\n.\n\n:TEXT_CMDHELP_PAUSE\nZaasno prekine izvajanje ukazne datoteke in prikae sporoilo \"Pritisnite\nkaterokoli tipko\" oz. doloeno sporoilo.\n\nPAUSE [sporoilo]\n.\n\n:TEXT_CMDHELP_PROMPT\nSpremeni ukazni poziv.\n\nPROMPT [besedilo]\n\n  besedilo  Doloi novi ukazni poziv.\n\nPoziv je lahko sestavljen iz katerihkoli znakov in naslednjih posebnih kod:\n\n  $Q  = (enaaj)\n  $$  $ (dolar)\n  $T  trenutni as\n  $D  trenutni datum\n  $P  trenutni pogon in imenik\n  $V  verzija FreeCOMa\n  $N  trenutni pogon\n  $G  > (\"ve kot\")\n  $L  < (\"manj kot\")\n  $B  | (navpina rta)\n  $H  brisalka (izbrie prejnji znak)\n  $E  escape (ASCII znak 27)\n  $_  prelom vrstice\n\nVnesite PROMPT brez parametrov, da ukazni poziv ponastavite.\n.\n\n:TEXT_CMDHELP_PUSHD\nPotisne trenutni imenik na imeniki sklad z monostjo spreminjanja trenutnega\nimenika.\n\nPUSHD [[pogon:]pot]\n  kjer je [pogon:]pot pot, v katero elite.\n.\n\n:TEXT_CMDHELP_POPD\nVzame imenik z imenikega sklada in ga doloi za trenutni imenik.\n\nPOPD [*]\n  Parameter \"*\" poisti imeniki sklad.\n.\n\n:TEXT_CMDHELP_DIRS\nPrikae vsebino imenikega sklada.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\nOdstrani (izbrie) prazen imenik.\n\nRMDIR [pogon:]pot\nRD [pogon:]pot\n.\n\n:TEXT_CMDHELP_REM\nOznauje komentarje (opombe) v ukazni datoteki ali CONFIG.SYS.\n\nREM [komentar]\n.\n\n:TEXT_CMDHELP_REN\nPreimenuje eno ali ve datotek oz. imenikov.\n\nRENAME [pogon:][pot][imenik1 | datoteka1] [imenik2 | datoteka2]\nREN [pogon:][pot][imenik1 | datoteka1] [imenik2 | datoteka2]\n\nPri novem imenu ne morete doloiti novega pogona oz. poti; za ta namen\nuporabite ukaz MOVE.\n.\n\n:TEXT_CMDHELP_SET#1\nPrikae, nastavi, ali odstrani okoljsko spremenljivko.\n\nSET [/C] [/P] [/E] [/U] [spremenljivka[=[niz]]]\n\n  spremenljivka  Doloi ime spremenljivke.\n  niz            Doloi vrednost spremenljivke.\n\ne niz ni doloen, se spremenljivka odstrani iz okolja.\n\nVnesite SET brez parametrov, da vidite trenutne vrednosti vseh spremenljivk.\n\nVnesite SET in ime spremenljivke, da vidite njeno vrednost.\n\n/C obdri velike in male rke: navadno se ime datoteke spremeni v velike rke,\ne spremenljivka e obstaja.\n\n/P pozove uporabnika, da vnese niz, in ga dodeli spremenljivki.\n\n/E nastavi spremenljivko na prvo vrstico izhoda programa, ki ga doloa niz.\n\n/U spremeni vse rke niza v velike rke.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nChanges the position of replaceable parameters in a batch file.\n\nSHIFT [DOWN]\n\nDOWN shifts the argument window toward the beginning (%%0); otherwise\ntoward the end.\n.\n\n:TEXT_CMDHELP_TIME#1\nPrikae ali nastavi as.\n\nTIME [/T] [as]\n\nVnesite TIME brez parametrov, da vidite trenutni as in istoasno nastavite\nnovega. Pritisnite Enter, da obdrite starega.\n\n/T onemogoi interaktivnost.\n.\n\n:TEXT_CMDHELP_TRUENAME\nPrikae polno ime doloene poti.\n\nTRUENAME [pogon:][pot][datoteka]\n.\n\n:TEXT_CMDHELP_TYPE\nPrikae vsebino datoteke z besedilom.\n\nTYPE [pogon:][pot]datoteka\n.\n\n:TEXT_CMDHELP_VER\nPrikae verzijo FreeCOMa in druge informacije.\n\nVER [/R] [/W] [/D] [/C]\n\n  /R  Prikae verzijo jedra in druge informacije.\n  /W  Prikae informacije o jamstvu.\n  /D  Prikae pogoje za razpeavanje FreeCOMa.\n  /C  Prikae sodelujoe pri razvoju FreeCOMa.\n.\n\n:TEXT_CMDHELP_VERIFY\nPove datotenemu sistemu, naj preveri, ali se datoteke pravilno zapiejo\nna disk.\n\nVERIFY [ON | OFF]\n\nVnesite VERIFY brez parametrov, da vidite trenutno stanje VERIFY.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nIf debugging is compiled into FreeDOS, this command will turn debug\noutput on or off, or tell you if it is on or off.\n\nFDDEBUG [ON | OFF | datoteka]\n\nType FDDEBUG without a parameter to display the current debug output\nsetting.\nIf a file is specified, all debug output is redirected into that file;\nthe output is appended to the file, if it already exists. The special\nnames \"stdout\" and \"stderr\" may be used to redirect the output\nto the standard output or standard error stream.\n.\n\n:TEXT_CMDHELP_VOL\nPrikae oznako nosilca in njegovo serijsko tevilko, e ta obstajata.\n\nVOL [pogon:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nPrikae seznam ukazov in funkcij, ki so na voljo v FreeCOMu.\n\n?\n?ukaz [parametri]\n\nPrva oblika prikae vse vgrajene ukaze in funkcije.\nDruga oblika vpraa, ali naj izvede doloen ukaz, kot v nainu sledenja.\n.\n\n:TEXT_CMDHELP_WHICH\nPoie in prikae datoteko za vsak doloen ukaz.\n\nWHICH ukaz...\n.\n\n:TEXT_CMDHELP_MEMORY#1\nPrikae FreeCOMov notranji spomin.\n\nMEMORY\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\nCilj za ukaz COPY ne sme vsebovati znakov \"+\".\n.\n\n:TEXT_DELETE_FILE#1%\nBriem datoteko \"%s\".\n.\n\n:TEXT_ERROR_WRITE_FILE_DISC_FULL#0%\nNi mogoe pisati v datoteko \"%s\";\nje morda disk poln? (potrebnih je %lu bajtov)\n.\n\n# Displayed for BIGcopy(), when copying takes quite a long time.\n# **_NO_END if the input file size is unknown.\n# Both must end in \\r rather than \\n!!\n:TEXT_COPY_COPIED_NO_END#0%\n%lu/???K kopiranih\\r\\\n.\n:TEXT_COPY_COPIED#0%\n%lu/%luK kopiranih\\r\\\n.\n\n:TEXT_ERROR_FCOM_IS_DEVICE#0%\nFreeCOM ne more biti naprava: \"%s\"\n.\n:TEXT_ERROR_FCOM_INVALID#0%\nTa datoteka ni veljaven FreeCOM ali pa ni zdruljiva verzija:\n%s\n.\n\n:TEXT_ERROR_LOADING_STRINGS\nFailed to load the strings resource into memory, the location\npointed to in %COMSPEC% seems to be invalid. Please specify another\nlocation of FreeCOM to try to load the strings from, e.g.:\nC:\\\\COMMAND.COM\nor just hit enter to cancel to load the strings.\n.\n\n:TEXT_TERMINATING\nPoteka prekinitev.\n.\n\n:TEXT_HIDDEN_CRITER#0%\n%u Critical Error requests suppressed.\n.\n\n# The exit reasons MUST be kept in this order!\n:TEXT_DISP_EXITCODE#0%\nExit code (ERRORLEVEL): %u, reason: %u (%s)\n.\n:TEXT_EXIT_REASON_NEG_1\nDOS API napaka\\\n.\n:TEXT_EXIT_REASON_0\nterminated normally\\\n.\n:TEXT_EXIT_REASON_1\nterminated by ^Break\\\n.\n:TEXT_EXIT_REASON_2\nterminated by critical error\\\n.\n:TEXT_EXIT_REASON_3\ngone resident\\\n.\n"
  },
  {
    "path": "strings/spanish.err",
    "content": "# $Id$\n#\n# Critical error national customization file\n#\n#       Language:    8bit CP850, CP858 Spanish (Spain)\n#       Author:      FreeCOM maintainer\n#       Translation: Aitor SANTAMARIA MERINO\n# \n# The critical error (criter) handler receives some information\n# from the kernel about what error condition happens, generates some\n# human friendly message from it, requests the user's opinion about\n# how to proceed and, finally, returns to the kernel.\n# \n# The human friendly message is generated using one of the following\n# templates:\n# BLOCK_DEVICE (for criters on block devices)\n# \tError %1 drive %A: %2 area: %3\n# -and- CHAR_DEVICE (for criters on character devices)\n# \tError %1 device %A: %3\n# \n# Two-character sequences, which first character is a percent sign '%',\n# are placeholders for other information:\n# %% -> a single percent sign\n# %1 -> either READ or WRITE, depending on what kind of operation\n# \tcaused the criter\n# %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA\n# %3 -> the actual error string; these are the strings associated to\n# \ta number 0 through N, and must correspond to the number passed in\n# \tlowbyte(DI) to the criter handler (see RBIL INT-24 for details)\n# %A -> drive letter (for block devices); name of device (character devices)\n# \n# Below the line describing the error the user is prompted for the action\n# to proceed. This line is dynamically constructed depending on which\n# action are available at all. The full line may look like this:\n# \t(A)bort, (I)gnore, (R)etry, (F)ail?_\n# \n# The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They\n# should indicate which user response keys is associated with them;\n# suggested is to use the first letter and enclose it in parenthesises.\n# The delimiter \", \" can be defined with DELIMITER and is the same\n# for all slots.\n# The \"? \" sequence is defined by QUESTION.\n# The order of the actions is fixed and cannot be customized.\n# \n# With each action a number of user response keys must be associated.\n# They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ...\n# strings. Because the key is searched in the same format as returned\n# by INT-16-00, both upper and lower case must be specified and\n# certain special keys cannot be used.\n# \n# The individual error strings are defined by the #: lines, where\n# the hash sign '#' refers to the number the kernel passes to the\n# criter handler. The UNKNOWN string is displayed for all error\n# numbers not specified.\n#\n# NOTE #1: The percent rule applies to _all_ criter strings!\n# NOTE #2: Each string occupies exactly one line.\n# NOTE #3: Any leading or trailing whitespaces are removed. Prefix the\n#\tfirst or suffix the last whitespace with '%.' (one percent sign and\n#\tone dot). This sequence is removed from the string totally.\n# NOTE #4: To embed any character use: %&## (one percent sign,\n#\t\tone ampersand and exactly two hexa-decimal digits)\n\n## Primary strings\nS2\nBLOCK_DEVICE: Error %1 en unidad %A: %2 rea: %3\nS3\nCHAR_DEVICE: Error %1 en dispositivo %A: %3\n\n## kind of operation\nS0\nREAD: leyendo desde\nS1\nWRITE: escribiendo a\n\n## kind of failed area of block devices\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: raz\nS7\nDATA: datos\n\n## action strings\nS8\nIGNORE: (I)gnorar\nS9\nRETRY: (R)eintentar\nS10\nABORT: (A)bortar\nS11\nFAIL: (F)allo\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: iI\nKEYS_RETRY:  rR\nKEYS_ABORT:  aA\nKEYS_FAIL:   fF\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN: Cdigo de error desconocido\nS15\n0: intento de violacin de la proteccin contra escritura\n1: unidad no vlida para este dispositivo\n2: unidad no lista\n3: instruccin desconocida para el controlador\n4: error de datos (error en CRC)\n5: longitud errnea de la estructura de peticin al controlador\n6: error de bsqueda\n7: tipo de soporte desconocido\n8: sector no encontrado\n9: la impresora no tiene papel\n10: error de escritura\n11: error de lectura\n12: error general\n13: violacin de permisos de archivo compartido\n14: violacin de proteccin\n15: cambio en disco no vlido\n16: FCB no est disponible\n17: desbordamiento del buffer de acceso compartido\n18: el cdigo de pgina no concuerda\n19: fuera de la entrada\n20: espacio en disco insuficiente\n"
  },
  {
    "path": "strings/spanish.lng",
    "content": "# $Id: SPANISH.LNG,v 1.00 2003/10/12  (based on DEFAULT 1.14)\n#\n# FreeCOM national customization file\n#\n#       Language:    8bit CP850, CP858 Spanish (Spain)\n#       Author:      FreeCOM maintainer\n#       Translation: Aitor SANTAMARIA MERINO\n# \n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retreive the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#\t:TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carrage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause an user interaction. Those ones should be in sync\n# with the issued text. To define how to interprete a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#YyNn\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceeding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the question\n# mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readibility of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH\nModificador no vlido. - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH\nModificador no vlido. - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION\nArgumento no vlido: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG\nLa opcin '%s' no puede tener un argumento\n.\n\n:TEXT_ERROR_OPT_NOARG\nLa opcin '%s' requiere un argumento\n.\n\n:TEXT_INVALID_NUMBER\nNmero especificado no vlido en '%s'\n.\n\n:TEXT_ERROR_CLOSE_QUOTE\nFalta cerrado de comillas: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nNo se puede crear archivo temporal\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR\nDemasiados parmetros. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nDemasiados parmetros.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER\nParmetro no vlido. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nRuta no encontrada.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nArchivo no encontrado.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND\nArchivo no encontrado. - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING\nFalta parmetro obligatorio.\n.\n\n:TEXT_ERROR_INVALID_DRIVE\nUnidad no vlida %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2\nOrden o nombre de archivo no reconocido - \"%s\".\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nNo hay memoria suficiente.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nError en peticin de la memoria DOS requerida.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nNo se puede redireccionar (no se puede abrir archivo temporal)\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE\nLa lnea #%ld en el archivo por lotes '%s' es demasiado larga.\n.\n\n:TEXT_ERROR_BFILE_VANISHED\nArchivo por lotes '%s' no encontrado.\n.\n\n:TEXT_ERROR_BFILE_LABEL\nEl archivo por lotes '%s' no contiene la etiqueta '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1\n%s fracas para '%s'.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR\nNo se puede establecer la variable de entorno '%s'.\nEl espacio de almacenamiento puede estar lleno.\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND\nVariable de entorno '%s' no encontrada.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nNo hay espacio de entorno, quiz por falta de memoria. Use la opcin /E\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1\nNo se puede establecer el alias '%s'. Quiz no hay espacio para alias.\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1\nAlias '%s' no encontrado.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nNo hay espacio para alias. Posiblemente falte memoria.\n.\n\n:TEXT_ERROR_SYNTAX_STR\nError de sintaxis. - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nError de sintaxis.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG\nNombre de archivo demasiado largo. - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY\nNo se puede copiar '%s' en s mismo\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nLa lnea de rdenes es demasiado larga tras la expansin de los aliases\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nLnea demasiado larga. No se puede ejecutar la orden.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1\nTamao no vlido del historial '%s'.\n.\n\n:TEXT_HISTORY_EMPTY#1\nEl historial de la lnea de rdenes est vaco.\n.\n\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nLa cadena MCB est corrompida, o el sistema no es compatible con MS-DOS.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR\nError indefinido %d.\n.\n\n:TEXT_ERROR_REGION_WARNING\nRegin de memoria no vlida %d - ser ignorada.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nSe debe especificar ON u OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nEspecificacin de variable no vlida.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR: se requiere IN.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nFalta uno o ambos parntesis.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR: se requiere DO.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR: No hay instruccin despus de DO.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE\nNo se puede redirigir la entrada desde el archivo '%s'.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE\nNo se puede redirigir la salida al archivo '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nRedireccin nula.\n.\n\n:TEXT_ERROR_INVALID_DATE\nFecha no vlida.\n.\n\n:TEXT_ERROR_INVALID_TIME\nHora no vlida.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nNo se ha especificado etiqueta para GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nLa orden CTTY se ha excludo en esta versin de COMMAND.COM.\n.\n\n:TEXT_ERROR_NORW_DEVICE\nDispositivo no vlido o no de lectura/escritura: '%s'.\n.\n\n:TEXT_ERROR_CTTY_DUP\nNo se pudo cambiar los descriptores de archivo a TTY '%s'.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\n/L an no est implementado.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\n/U an no est implementado.\n.\n\n:TEXT_ERROR_WRITING_DEST\nError al escribir al archivo de destino.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE\nNo se puede abrir archivo origen. - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE\nNo se puede abrir archivo origen '%s'\n.\n\n:TEXT_ERROR_READ_FILE\nNo se puede leer desde el archivo '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE\nNo se puede escribir al archivo '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\nEl carcter de concatenacin '+' no puede preceder el argumento.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nEl carcter de concatenacin '+' no puede suceder el argumento.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nNo hay nada que hacer.\n.\n\n:TEXT_ERROR_COPY\nCOPY fracas\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: falta nombre de archivo\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: falta nmero\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: nmero no vlido\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: se requiere una instruccin\n.\n\n:TEXT_NOT_IMPLEMENTED_YET\nAn no est implementado.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nNo se pueden cargar los mensajes en memoria.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nLa opcin /MSG ha sido excluda de esta versin de COMMAND.COM.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1\nSe visualizaron %u objetos.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nLnea de rdenes no vlida. Error interno relacionado con el COMMAND.COM\nen ejecucin. Por favor, informar de este error.\n.\n\n:TEXT_QUOTED_C_OR_K#1\nLas opciones /C y /K no pueden ser entrecomilladas y se ignorarn.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1\nLa ruta hasta COMMAND.COM debe ser completa.\nDebe incluir el nmero de unidad y comenzar por barra inclinada.\nPor ejemplo: C:\\\\FDOS\n\nCOMMAND.COM asumir esta nueva ruta:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nLa informacin sobre la sesin no ha podido ser restaurada, y cualquier\nmodificacin local se ha perdido. Consultar los mensajes de error indicados\narriba para entender el motivo de este problema.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nLa informacin actual no se preservar durante la llamada del programa.\nConsultar los mensajes de error indicados arriba para entender el motivo\nde este problema.\n.\n\n:TEXT_ERROR_CWD_FAILED#1%\nLa unidad %c: no responde.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nFallo en el intercambio: los alias requieren demasiada memoria.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nFallo en el intercambio: no se puede solicitar memoria lejana.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nNo hay espacio de alias suficiente.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1\nEl alias '%s' no existe\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nNo se pudo registrar el alias.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1\nNombre de alias '%s' no vlido.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nNo se pudo cargar el mdulo del contexto o el gestor de error crtico.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nNo hay memoria para el contexto.\nSi este fallo persiste, puede intentar aumentar los bferes internos\n(historial, pila de directorios, etc.)\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1\nEl tamao del contexto excede en %lu el lmite mximo.\nSe asumir un tamao de %u bytes.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nNo se pudo registrar informacin sobre estado en el contexto. Este error\npodra indicar corrupcin de memoria o tamao mnimo de contexto no vlido.\nPor favor, informar al mantenedor de FreeCOM en:\nfreedos-devel@lists.sourceforge.net\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nContexto no hallado tras el intercambio. Se crear uno nuevo, aunque\nlas alias, etc. locales se han perdido.\n.\n\n:TEXT_ERROR_PERMISSION_DENIED#1%\n%s: Permiso denegado\n.\n\n:TEXT_ERROR_NO_SUCH_FILE#1%\n%s: No existe tal archivo o diretorio\n.\n\n:TEXT_ERROR_UNKNOWN_ERROR#1%\n%s: Error desconocido\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nPresione cualquier tecla para continuar . . .\\\n.\n\n:TEXT_MSG_HISTORY_SIZE\nEl tamao del historial es %d bytes.\n.\n\n:TEXT_MSG_DOSKEY\nLas caractersticas de DOSKEY estn ya presentes en el intrprete.\n.\n\n:TEXT_MSG_ECHO_STATE\nEl estado de ECHO es %s\n.\n\n:TEXT_MSG_VERIFY_STATE\nEl estado de VERIFY es %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE\nLa salida de DEBUG es %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET\nLa salida de DEBUG se imprimir a '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE\nEl estado de BREAK es %s\n.\n\n:TEXT_MSG_LFNFOR_STATE#0%\nLFNFOR es %s\n.\n\n:TEXT_MSG_LFNFOR_COMPLETE_STATE#0%\nAutocompletar con LFN (nombres largos de archivo) es %s\n.\n:TEXT_MSG_CURRENT_DATE\nLa fecha actual es %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1\nIntroduzca la nueva fecha (mm%sdd%s[ss]aa): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1\nIntroduzca la nueva fecha (dd%smm%s[ss]aa): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1\nIntroduzca la nueva fecha ([ss]aa%smm%sdd): \\\n.\n\n:TEXT_MSG_CURRENT_TIME\nLa hora actual es %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nIntroduzca la nueva hora: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1\nSsNn{CR}{LF}{CBREAK}\naabb   b   b       b\nTodos los archivos en '%s' sern eliminados\nDesea continuar (S/N)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nSsNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [S=ENTER, No=ESC] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#\tby \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1\nSsNnTtQq{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\nSe presion Control-Break.\\r\nDesea terminar el proceso por lotes '%s' (S/No/Todo) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1\nSsNnTtCc{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nDesea sobreescribir '%s' (S/No/Todo/Cancelar) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_APPEND_FILE#1%\nSsNnTtCc{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nAadir a '%s' (S/No/Todo/Cancelar) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1\nSsNnTtCc{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nDesea eliminar '%s' (S/No/Todo/Cancelar) ? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<desconocido>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nLa pila de directorios est vaca.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1\n El volumen de la unidad %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING\nes %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nno tiene etiqueta\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER\n El nmero de serie del volumen es %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1\n%10s archivo(s)\\\n.\n:TEXT_DIR_FTR_BYTES\n   %12s bytes\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nNmero total de archivos listados:\n.\n:TEXT_DIR_FTR_DIRS#1\n%10s directorio(s)\\\n.\n:TEXT_DIR_FTR_BYTES_FREE\n %15s bytes libres\n.\n:TEXT_DIR_DIRECTORY\nDirectorio de %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE\n Directorio de %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE#1%\n%s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <DIR> \\\n.\n:TEXT_DIR_LINE_SIZE#1\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1\n%-14s\\\n.\n\n:TEXT_MSG_PATH\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nNo se ha definido una ruta de bsqueda.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nDom\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nLun\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nMar\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nMi\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\nJue\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\nVie\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nSb\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\nno se han eliminado archivos.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\nun archivo eliminado.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1\n%u archivos eliminados.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nrdenes internas disponibles:\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\nCaractersticas disponibles:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[alias] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[edicin de rdenes avanzada] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[historial] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[autocompletar nombres de archivo] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[intercambio] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[start logging] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[ltimo directorio utilizado] \\\n.\n:TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1\n[nombres largos de archivo] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[kernel swap] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[intercambio con XMS] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[intercambio por defecto] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[rdenes instalables] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[pila de directorios (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[depuracin de FreeCOM] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nPulse F8 para confirmacin individual, o F5 para omitir %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC\nOmitiendo '%s'.\n.\n\n:TEXT_MSG_VER_DOS_VERSION\nVersin del DOS %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nNcleo de FreeDOS (build 1933 o anterior)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS\nNcleo de FreeDOS versin %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\nCopyright (C) 1994-2001 Tim Norman y otros.\n\n\nEste programa se distribuye con la esperanza de que sea til, pero\nSIN NINGUNA GARANTA, incluso sin la garanta MERCANTIL implcita\no sin garantizar la CONVENIENCIA PARA UN PROPSITO PARTICULAR.\nVase la Licencia Pblica General de GNU para ms detalles.\n\nEnve informes de errores a freedos-devel@lists.sourceforge.net.\nLas actualizaciones estarn disponibles en http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\nCopyright (C) 1994-2001 Tim Norman y otros.\n\nEste programa es software libre. Puede redistribuirlo y/o modificarlo\nbajo los trminos de la Licencia Pblica General de GNU segn es publicada\npor la Free Software Foundation, bien la versin 2 de dicha Licencia o bien\n(segn su eleccin) cualquier versin posterior.\n\nEnve informes de errores a freedos-devel@lists.sourceforge.net.\nLas actualizaciones estarn disponibles en http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\nEl intrprete de rdenes de FreeDOS ha sido desarrollado por varios\nprogramadores, refirase al archivo adjunto HISTORY.TXT para ms detalles.\n\nTraduccin al espaol por Aitor Santamara Merino mailto:nls@freedos.org\n\nEnve informes de errores a freedos-devel@lists.sourceforge.net.\nLas actualizaciones estarn disponibles en http://freedos.sourceforge.net/freecom\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nEl intrprete va a ser abortado, aunque esto no\\r\nest permitido (habitualmente por el modificador \"/P\").\\r\nDeber reiniciar su equipo, o si est ejecutndose en\\r\nun entorno multitarea, terminar este proceso/tarea manualmente.\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nEl ejecutable de FreeCOM no ha sido encontrado.\nDeber especificar la ruta completa hacia COMMAND.COM\ncomo primer argumento para COMMAND, por ejemplo:\nC:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1\nSegmento de entorno    : max %5u bytes; libre %5u bytes\n.\n:TEXT_MEMORY_CONTEXT#1\nSegmento de contexto   : max %5u bytes; libre %5u bytes\n.\t\n:TEXT_MEMORY_HEAP#1\nMontculo (heap)       : free %5lu bytes\n.\n:TEXT_MEMORY_CTXT_ALIAS#1\n\\tAlias                : lmite %5u bytes, actual %5u bytes, %5u objetos\n.\n:TEXT_MEMORY_CTXT_HISTORY#1\n\\tHistorial            : lmite %5u bytes, actual %5u bytes, %5u objetos\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1\n\\tPila de directorios  : lmite %5u bytes, actual %5u bytes, %5u objetos\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1\n\\tCach para ltimo directorio   : usado  %5u bytes, %5u objetos\n.\n:TEXT_MEMORY_CTXT_BATCH#1\n\\tAnidamiento de proc. por lotes : usado  %5u bytes, %5u objetos\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1\n\\tInformacin de intercambio     : usado  %5u bytes, %5u objetos\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nError al obtener el cdigo de pgina actual del sistema.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nError al cambiar el cdigo de pgina actual.\n.\n:TEXT_DISPLAY_CODEPAGE#1\nEl cdigo de pgina actual es %u.\nEl cdigo de pgina del sistema (apropiado) es: %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nVisualiza, establece o elimina alias.\n\nALIAS [variable[=][cadena]]\n\n        variable  Nombre del alias.\n        cadena    Secuencia de caracteres a asignar al alias.\n\n\nIntroduzca ALIAS sin parmetros para visualizar los alias activos.\n.\n\n:TEXT_CMDHELP_BEEP\nProduce una seal acstica.\n.\n\n:TEXT_CMDHELP_BREAK\nActiva o desactiva la comprobacin extendida de Control+C.\n\nBREAK [ON | OFF]\n\nIntroduzca BREAK sin parmetros para ver el estado actual de BREAK.\n.\n\n:TEXT_CMDHELP_CALL#1\nInvoca a un archivo de proceso por lotes desde otro.\n\nCALL [/S | /N] [unidad:][ruta]nombre-archivo [parmetros]\n\n  parmetros         Parmetros cualesquiera requeridos por el archivo de\n                     proceso por lotes.\n/S y /N  fuerza e inhibe el intercambio de FreeCOM.\n.\n\n:TEXT_CMDHELP_CD\nMuestra o cambia el directorio activo.\n\nCHDIR [drive:][path]\nCHDIR[..]\nCD [drive:][path]\nCD[..]\nCD -\n\n  ..   Especifica al directorio padre como directorio a cambiar.\n  -    Con la caracterstica \"ltimo directorio\" activada, cambia al\n       ltimo directorio.\n\nIntroduzca CD unidad: para visualizar el directorio activo de la unidad\nespecificada.\nIntroduzca CD sin parmetros para visualizar el directorio activo de la\nunidad activa.\nVase tambin: CDD\n.\n\n:TEXT_CMDHELP_CDD\nMuestra o cambia el nombre de la unidad y directorio activos.\n\nCDD [unidad:][ruta]\nCDD[..]\n\n  ..   Especifica al directorio padre como directorio a cambiar.\n  -    Con la caracterstica \"ltimo directorio\" activada, cambia al\n       ltimo directorio.\n\nSi se introduce unidad:, se modifica la unidad activa; sta es la nica\ndiferencia con \"CHDIR\".\nIntroduzca CDD sin parmetros para visualizar el directorio activo de la\nunidad activa.\n.\n\n:TEXT_CMDHELP_CHCP\nMuestra o cambia el cdigo de pgina del sistema.\n\nCHCP [nnn]\n\n  nnn   Nmero del cdigo de pgina.\n\nIntroduzca CHCP sin parmetros para visualizar el cdigo de pgina del sistema.\n.\n\n:TEXT_CMDHELP_CLS\nBorra la pantalla.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\nInicia una nueva copia del intrprete de rdenes de FreeDOS.\n\nCOMMAND [[unidad:]ruta] [disp] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG]\n                       [/LOW] [/Y [/[C|K] orden]]\n  [unidad:]ruta   Especifica el directorio que contiene a COMMAND.COM.\n  disp            Indica el dispositivo a usar para entrada/salida de rdenes.\n  /E:nnnnn        Establece el tamao inicial del entorno a nnnnn bytes.\n                  (nnnnn debe estar comprendido entre 256 y 32.768).\n  /L:nnnn         Especifica el tamao interno de los bfers (requiere /P).\n                  (nnnn debe estar comprendido entre 128 y 1.024).\n  /U:nnn          Especifica el tamao del bfer de entrada (requiere /P).\n                  (nnn debe estar comprendido entre 128 y 255).\n  /P              Hace el nuevo intrprete permanente (no se puede salir).\n  /MSG            Almacena los mensajes de error en memoria (requiere /P).\n  /LOW            Fuerza al intrprete a mantener sus datos residentes en\n                  el rea de memoria baja.\n  /Y              Ejecuta el programa BATCH especificado por /C o /K.\n  /C orden        Ejecuta la orden especificada y sale.\n  /K command      Ejecuta la orden especificada y se mantiene en ejecucin.\n.\n\n:TEXT_CMDHELP_COPY\nCopia uno o ms archivos a otro lugar.\n\nCOPY [/A | /B] origen [/A | /B] [+ origen [/A | /B] [+ ...]] [destino\n  [/A | /B]] [/V] [/Y | /-Y]\n\n  origen       Especifica los archivos que sern copiados\n  /A           Indica que se trata de un archivo de texto ASCII.\n  /B           Indica que se trata de un archivo binario.\n  destino      Especifica el nuevo directorio y/o nombre para los archivos.\n  /V           Verifica que los archivos han sido copiados correctamente.\n  /Y           Elimina la confirmacin de sobreescritura de archivos ya\n               existentes en destino.\n  /-Y          Solicita obligatoriamente confirmacin de sobreescritura de\n               archivos ya existentes en destino.\n\nLa opcin /Y puede estar presente en la variable de entorno COPYCMD, y\npuede ser ignorada especificando /-Y en la lnea de rdenes\n\nPara concatenar archivos, especifique un nombre de archivo destino, pero\nmltiples archivos en origen (usando comodines o bien arch1+arch2+arch3).\n.\n\n:TEXT_CMDHELP_CTTY\nCambia el dispositivo terminal usado para controlar el sistema.\n\nCTTY dispositivo\n\n  dispositivo     Dispositivo terminal que desea usar, por ejemplo COM1.\n.\n\n:TEXT_CMDHELP_DATE#1\nMuestra o establece la fecha.\n\nDATE [/D] [fecha]\n\nIntroduzca DATE sin parmetros para visualizar la fecha actual y la peticin\nde una nueva fecha. Presione ENTER para mantener la misma fecha.\n\n/D   impide que DATE acte de forma interactiva.\n.\n\n:TEXT_CMDHELP_DEL#2\nElimina uno o ms archivos.\n\nDEL [unidad:][ruta]archivo [/P] [/V]\nERASE [unidad:][ruta]archivo [/P] [/V]\n\n  [unidad:][ruta]archivo  Especifica el/los archivo/s a eliminar. Utilice\n                          varios archivos utilizando comodines.\n  /P     Solicita confirmacin antes de borrar cada archivo.\n  /V     Visualiza los archivos eliminados.       \n.\n\n:TEXT_CMDHELP_DIR#4\nMuestra un listado de archivos y subdirectorios en un directorio.\n\nDIR [unidad:][ruta][archivo] [/P] [/W] [/A[[:]atributos]]\n  [/O[[:]orden]] [/S] [/B] [/L]\n\n  [unidad:][ruta][archivo]\n            Especifica la unidad, directorio y/o archivos a listar.\n            (Puede ser una especificacin de archivo mejorada, o mltiples\n            especificaciones de archivo.)\n /P         Efecta una pausa despus de cada llenado completo de pantalla.\n /W         Usa formato de lista ancho.\n /A         Muestra los archivos con los atributos especificados.\n            (por defecto se considera /ADHSRA)\n atributos   D  Directorios                R  Archivos de slo lectura\n             H  Archivos ocultos           A  Archivos listos para archivar\n             S  Archivos de sistema        -  Prefijo para negacin\n /O         Muestra los archivos ordenados.                     \n orden       N  Alfabtico por nombre    S  Por tamao (desde el menor)\n             E  Alfabtico por extensin D  Por fecha/hora (desde el ms ant.)\n             G  Agrupar directorios      -  Prefijo para invertir el orden\n             U  Desordenado (orden natural)      (Por defecto: /ONG)\n /S         Muestra los archivos en el directorio y todos sus subdirectorios.\n /B         Usa formato simple (sin cabecera y resumen).         \n /L         Muestra el contenido en minsculas.\n /Y o /4    Muestra el ao con cuatro dgitos\n\nLos modificadores se pueden preestablecer en la variable de entorno DIRCMD.\nSus valores se pueden sobreescribir con el prefijo - antes del modificador\n(por ejemplo, /-W).\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nLa utilidad externa DOSKEY es ahora parte de FreeCOM.\nUtilice las teclas de movimiento de cursor ARRIBA y ABAJO para recuperar el\nhistorial de lneas, y HISTORY para visualizarlo.\nUtilice las teclas de movimiento de cursor DERECHA e IZQUIERDA, y las teclas\nINICIO y FIN para navegar en la lnea, y utilize INS para conmutar entre los\nmodos sobreescritura e insercin.\nUtilice la tecla TAB para completar la palabra actual a un nombre de archivo;\npresinela dos veces para mostrar todos los archivos coincidentes.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nEdita y recupera lneas de rdenes, y crea macros.\n\nDOSKEY [/opcin ...] [nombre_macro=[cadena]]\n\n  /BUFSIZE:n    Establece a n el tamao del buffer de macros y rdenes\n                (por defecto: 512)\n  /ECHO:on|off  Activa o desactiva el eco en la expansin de macros\n                (por defecto: ON)\n  /FILE:archivo Indica un archivo que contiene una lista de macros\n  /HISTORY      Visualiza las rdenes almacenadas en memoria\n  /INSERT       Inserta nuevos caracteres en la lnea al mecanografiar\n  /KEYSIZE:m    Establece a m el tamao del buffer de teclado\n                (por defecto: 15)\n  /LINE:k       Establece a k el tamao mximo del buffer de edicin de\n                lneas (por defecto: 128)\n  /MACROS       Muestra todas las macros de DOSKEY\n  /OVERSTRIKE   Sustituye nuevos caracteres en la lnea al mecanografiar\n                (por defecto)\n  /REINSTALL    Instala una nueva copia de DOSKey\n  nombre_macro  Establece un nombre para una nueva macro\n  cadena        Establece las rdenes a asignar a la macro         \n\n   cursor ARRIBA y ABAJO para recuperar las lneas de rdenes\n      Esc borra la lnea de rdenes actual\n       F7 visualiza el historial de lneas de rdenes\n   Alt+F7 elimina el historial de lneas de rdenes\n[cars.]F8 busca la primera lnea que comienza por [cars.]\n       F9 elegir una lnea de rdenes por nmero\n  Alt+F10 elimina todas las definiciones de macros\n\nLos siguientes son cdigos especiales que puede incluir en las definiciones\nde macros de DOSKey:\n  $T     Separador de rdenes: permite ms de una rden en una macro\n  $1-$9  Parmetros Batch: equivalente a %1-%9 en programas batch\n  $*     Smbolo que se reemplazar por todo lo que sigue al nombre de la\n         macro en la lnea de rdenes\n.\n\n:TEXT_CMDHELP_ECHO\nMuestra mensajes, o activa/desactiva la repeticin (eco) de la lnea de rdenes\n\n  ECHO [ON | OFF]\n  ECHO [mensaje]\n\nIntroduzca ECHO sin parmetros para visualizar el estado actual del eco.\n.\n\n:TEXT_CMDHELP_EXIT\nSale de la interfaz de rdenes de FreeDOS.\n\nEXIT\n.\n\n\n:TEXT_CMDHELP_FOR\nEjecuta la orden especificada para cada archivo en un conjunto de archivos.\n\nFOR %%variable IN (set) DO command [command-parameters]\n\n  %%variable  Especifica una variable a ser reemplazada.\n  (conjunto) Especifica un conjunto de archivos. Se admiten comodines.    \n  orden      Especifica la orden que se ejecutar para cada archivo.\n  parmetros Parmetros opcionales que la orden pueda requerir.\n\nPara usar FOR en un programa batch, usar %%%%variable en lugar de\n%%variable.\n.\n\n\n:TEXT_CMDHELP_GOTO\nRedirige la ejecucin de un programa batch a una cierta lnea etiquetada.\n\nGOTO etiqueta\n\n  etiqueta  Especifica una cadena de caracteres usada como etiqueta.\n\nUna etiqueta se crea en una lnea exclusiva que comienza con el carcter\ndos puntos (:) seguido del nombre de la etiqueta.\n.\n\n:TEXT_CMDHELP_HISTORY#1\nHistorial de rdenes.\n\nHISTORY [tamao]\n\nSin \"tamao\", muestra los contenidos del historial de rdenes actual.\nCon \"tamao\", modifica el tamao del buffer para el historial.\n.\n\n:TEXT_CMDHELP_IF\nEjecucin condicional en programas batch.\n\nIF [NOT] ERRORLEVEL nmero  orden\nIF [NOT] cadena1==cadena2  orden\nIF [NOT] EXIST nombrearchivo orden\n\n  NOT                 La orden slo se ejecutar si la condicin es falsa.\n  ERRORLEVEL nmero   La condicin es verdadera si el programa anterior\n                      devolvi un cdigo de salida igual o mayor al nmero\n                      especificado.\n  orden               Especifica la orden que se ejecutar si la condicin\n                      se verifica.\n  cadena1==cadena2    La condicin es verdadera si ambas cadenas coinciden.\n  EXIST nombrearchivo La condicin es verdadera si el archivo dado existe.\n.\n\n:TEXT_CMDHELP_LFNFOR\nActiva/Desactiva nombres largos de archivo para FOR o para autocompletar.\n\nLFNFOR [ON | OFF]\nLFNFOR COMPLETE [ON | OFF]\n\nIntroduzca LFNFOR o LFNFOR COMPLETE sin parmetros para mostrar el estado\nactual de LFNFOR.\n.\n\n:TEXT_CMDHELP_LH\nCarga un programa en memoria superior.\n\nLOADHIGH [unidad:][ruta]nombrearchivo [parmetros]\nLOADHIGH [/L:regin1[,tamMn1][;regin2[,tamMn2]...] [/S]]\n         [unidad:][ruta]nombrearchivo [parmetros]\n\n/L:regin1[,tamMn1][;regin2[,tamMn2]]...\n            Especifica las regiones de memoria donde cargar el programa.\n            Regin1 especifica el nmero de la primera regin de memoria;\n            tamMn1 especifica en su caso el tamao mnimo de la regin.\n            Regin2 especifica el nmero de la segunda regin de memoria;\n            tamMn2 especifica en su caso el tamao mnimo de la regin\n            y as sucesivamente.\n            Se pueden indicar tantas regiones como se desee.\n\n/S          Reduce un bloque de memoria superior a su tamao mnimo mientras\n            el programa se carga.\n\n[unidad:][ruta]nombrearchivo\n            Especifica la localizacin y nombre del programa.\n.\n\n:TEXT_CMDHELP_LOADFIX\nCarga un programa por encima de los primeros 64KB de memoria y lo ejecuta.\n\nLOADFIX [unidad:][ruta]nombrearchivo\n\nUtilice LOADFIX para cargar un programa para el que se obtiene el mensaje de\nerror \"Packed file corrupt\" (programa comprimido corrupto) al tratar de\ncargarlo en memoria.\n.\n\n:TEXT_CMDHELP_MD\nCrea un directorio.\n\nMKDIR [unidad:]ruta\nMD [unidad:]ruta\n.\n\n:TEXT_CMDHELP_PATH\nEstablece o muestra una lista de rutas alternativas para archivos ejecutables.\n\nPATH [[unidad:]ruta[;...]]\nPATH ;\n\nIntroduzca PATH ; para eliminar todas las rutas alternativas, e indicar al\nintrprete que slo debe utilizar el directorio actual.\nIntroduzca PATH sin parmetros para mostrar las rutas alternativas actuales.\n.\n\n:TEXT_CMDHELP_PAUSE\nSuspende la ejecucin de un programa batch hasta la pulsacin de una tecla,\ny muestra el siguiente mensaje:\n\"Presione cualquier tecla para continuar . . .\"\no cualquier otro mensaje especificado.\n\nPAUSE [mensaje]\n.\n\n:TEXT_CMDHELP_PROMPT\nModifica el indicador de rdenes.\n\nPROMPT [cadena]\n\n  cadena    Especifica el nuevo indicador de rdenes.\n\nEl indicador puede constar de caracteres normales, y los siguientes cdigos\nespeciales:\n\n  $Q   = (signo de igualdad)\n  $$   $ (signo de dlar)\n  $T   Hora actual \n  $D   Fecha actual\n  $P   Unidad y ruta actual  \n  $V   Versin del intrprete de rdenes de FreeDOS\n  $N   Unidad actual\n  $G   > (signo de mayor-que)\n  $L   < (signo de menor-que\n  $B   | (barra vertial)\n  $H   Retroceso (elimina el carcter anterior)\n  $E   Cdigo escape (cdigo ASCII 27)\n  $_   Retorno de carro e incremento de lnea\n\nIntroduzca PROMPT sin parmetros para restablecer el indicador por defecto.\n.\n\n:TEXT_CMDHELP_PUSHD\nVuelca el directorio actual a la pila de directorios (con la posibilidad de\ncambiar previamente a dicho directorio).\n\nPUSHD [[unidad:]ruta]\n\n  Donde [unidad:]ruta es la nueva ruta a la que deseas cambiar.\n.\n\n:TEXT_CMDHELP_POPD\nRecupera un directorio de la pila de directorios, y cambia a l.\n\nPOPD [*]\n  El parmetro '*' borra la pila de directorios.\n.\n\n:TEXT_CMDHELP_DIRS\nMuestra los contenidos de la pila de directorios.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\nElimina un directorio.\n\nRMDIR [unidad:]ruta\nRD [unidad:]ruta\n.\n\n:TEXT_CMDHELP_REM\nRealiza comentarios en un archivo batch o en CONFIG.SYS.\n\nREM [comentario]\n.\n\n:TEXT_CMDHELP_REN\nRenombra uno o varios archivos o directorios.\n\nRENAME [unidad:][ruta][directorio1 | archivo1] [directorio2 | archivo2]\nREN [unidad:][ruta][directorio1 | archivo1] [directorio2 | archivo2]\n\nNtese que no se permite establecer una nueva unidad o ruta en destino.\nUtilice la orden MOVE para tal propsito.\n.\n\n:TEXT_CMDHELP_SET#1\nMuestra, establece o elimina variables de entorno.\n\nSET [/C] [variable=[valor]]\n\n  variable  Especifica el nombre de la variable de entorno.\n  string    Especifica una serie de caracteres a asignar como valor.\n\n* Si no se especifica un valor, la variable de entorno se elimina.\n\nIntroduzca SET sin parmetros para mostrar las variables de entorno actuales.\n\n/C fuerza la distincin entre maysculas y minsculas. Por defecto, el nombre\nde variable se pasa a maysculas si no se encontraba previamente en el\nentorno, en cuyo caso, su estado se mantiene.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nModifica la posicin de parmetros reemplazables en un programa batch.\n\nSHIFT [DOWN]\n\nDOWN desplaza la lista de argumentos hacia el principio (%%0); en caso\ncaso contrario, hacia el final.\n.\n\n:TEXT_CMDHELP_TIME#1\nEstablece o muestra la hora del sistema.\n\nTIME [/T] [hora]\n\nIntroduzca TIME sin parmetros para mostrar la hora actual, y preguntar por\nuna nueva. Pulse ENTER para mantener la misma hora.\n\n/T impide que TIME funcione de forma interactiva.\n.\n\n:TEXT_CMDHELP_TRUENAME\nMuestra la ruta completa hacia el archivo especificado.\n\nTRUENAME [unidad:][ruta][nombrearchivo]\n.\n\n:TEXT_CMDHELP_TYPE\nMuestra el contenido de archivos de texto.\n\nTYPE [unidad:][ruta]nombrearchivo\n.\n\n:TEXT_CMDHELP_VER\nMuestra la versin del intrprete de rdenes de FreeDOS y otra informacin.\n\nVER [/R] [/W] [/D] [/C]\n\n /R         Muestra la versin del kernel y otra informacin.\n /W         Muestra la garanta del intrprete de rdenes de FreeDOS.\n /D         Muestra informacin sobre la redistribucin del intrprete.\n /C         Muestra la lista de contribuidores al intrprete de rdenes.\n.\n\n:TEXT_CMDHELP_VERIFY\nIndica al sistema de archivos de FreeDOS que debe verificar la correcta\nescritura de archivos al disco.\n\nVERIFY [ON | OFF]\n\nIntroduzca VERIFY sin parmetros para visualizar el estado actual de VERIFY.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nSi se compila FreeDOS con soporte para depuracin, esta orden activa o\ndesactiva la produccin de mensajes de depuracin, o indica su estado.\n\nFDDEBUG [ON | OFF | archivo]\n\nIndique FDDEBUG sin parmetros para visualizar el estado actual.\nSi se especifica un archivo, todas las salidas se redirigirn a dicho archivo;\nlos mensajes se aadirn al final del archivo si ste existe. Los nombres\nespeciales \"stdout\" and \"stderr\" se pueden utilizar para redirigir la salida\nhacia las salidas estndar de datos y de errores.\n.\n\n:TEXT_CMDHELP_VOL\nMuestra la etiqueta de volumen y el nmero de serie de un disco, si existen.\n\nVOL [unidad:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nMuestra la lista de rdenes y caractersticas disponibles en el intrprete.\n\n?\n?orden [argumentos]\n\nLa primera variante muestra las rdenes internas y caractersticas\ndisponibles.\nLa segunda variante pregunta si se debe o no ejecutar la orden especificada,\ncomo si estuviera activado el modo de bsqueda de errores.\n.\n\n:TEXT_CMDHELP_WHICH\nBusca el ejecutable para la orden dada, y lo muestra.\n\nWHICH {orden}\n.\n\n:TEXT_CMDHELP_MEMORY#1\nMuestra la memoria que FreeCOM usa internamente\n\nMEMORY\n\n.\n\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\nEl parmetro de destino de COPY no debe contener el carcter suma ('+').\n.\n\n:TEXT_DELETE_FILE#1\nEliminando archivo \"%s\".\n.\n\n\n:TEXT_ERROR_WRITE_FILE_DISC_FULL#0%\nNo se puede escribir el archivo '%s';\nProbablemente el disco est lleno (se requieren %lu bytes)\n.\n\n# Displayed for BIGcopy(), when copying takes quite a long time.\n# **_NO_END if the input file size is unknown.\n# Both must end in \\r rather than \\n!!\n:TEXT_COPY_COPIED_NO_END#0%\ncopiados %luKB/???KB\\r\\\n.\n:TEXT_COPY_COPIED#0%\ncopiados %luKB/%luKB\\r\\\n.\n\n:TEXT_ERROR_FCOM_IS_DEVICE#0%\nFreeCOM no puede ser un dispositivo: \"%s\"\n.\n:TEXT_ERROR_FCOM_INVALID#0%\nEste archivo no es un FreeCOM vlido, o la versin no es compatible:\n%s\n.\n\n:TEXT_ERROR_LOADING_STRINGS\nError al cargar las cadenas de caracteres en memoria, la ruta\nindicada en %COMSPEC% no parece vlida. Por favor, especifique otra\nruta hacia FreeCOM para tratar de recargar las cadenas, por ejemplo:\nC:\\\\COMMAND.COM\no pulse ENTER para cancelar la carga de dichas cadenas.\n.\n\n:TEXT_TERMINATING\nAbortando ejecucin.\n.\n\n:TEXT_HIDDEN_CRITER#0%\nSe han eliminado %u peticiones de Error Crtico.\n.\n\n# The exit reasons MUST be kept in this order!\n:TEXT_DISP_EXITCODE#0%\nCdigo de salida (ERRORLEVEL): %u, motivo: %u (%s)\n.\n:TEXT_EXIT_REASON_NEG_1\nError en el API del DOS\\\n.\n:TEXT_EXIT_REASON_0\nsalida con normalidad\\\n.\n:TEXT_EXIT_REASON_1\nsalida por ^Break\\\n.\n:TEXT_EXIT_REASON_2\nsalida por error crtico\\\n.\n:TEXT_EXIT_REASON_3\nsalida residente en memoria\\\n.\n"
  },
  {
    "path": "strings/strings/makefile.mak",
    "content": "CFG_DEPENDENCIES = makefile.mak\r\n\r\nTOP2LVL = 1\r\nTOP = ../..\r\n!include \"$(TOP)/config.mak\"\r\n\r\nall : $(CFG) strings.lib\r\n\r\n!include \"strings.mak\"\r\n\r\nstrings.lib: ../strings.h ../strings.err strings.rsp $(STRINGS_DEPS)\r\n\techo Making STRINGS library\r\n\t$(RMFILES) strings.lib\r\n\t$(AR) strings.lib @strings.rsp $(LIBLIST) strings.lst\r\n\t$(CP) strings.lib ..\r\n\t$(CP) strings.lst ..\r\n"
  },
  {
    "path": "strings/swedish.err",
    "content": "\n# Critical error national customization file\n#\n#\tLanguage: Swedish / CP850\n#\tAuthor:   Oscar Molin <oscarmolin@telia.com>\n# \n\n#\n## Primary strings\nS2\nBLOCK_DEVICE: Fel %1 enhet %A: %2 omrde: %3\nS3\nCHAR_DEVICE: Fel %1 enhet %A: %3\n\n## kind of operation\nS0\nREAD: lser frn\nS1\nWRITE: skriver till\n\n## kind of failed area of block devices\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: Rot\nS7\nDATA: Data\n\n## action strings\nS8\nIGNORE: (I)gnorera\nS9\nRETRY: (N)ytt frsk\nS10\nABORT: (A)vbryt\nS11\nFAIL: (M)isslyckas\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: iI\nKEYS_RETRY:  nN\nKEYS_ABORT:  aA\nKEYS_FAIL:   mM\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN: Oknd fel-kod\nS15\n0: frsk att bryta skrivskyddet\n1: oknd typ fr drivrutin\n2: enhet inte klar\n3: drivrutin fick oknt kommando\n4: datafel (fel CRC)\n5: ogiltig strukturlngd p drivrutinsbegran\n6: skfel\n7: oknd mediatyp\n8: sektorn hittades inte\n9: slut p papper i skrivaren\n10: skrivfel\n11: lsfel\n12: allmnt fel\n13: delningsfel\n14: ls fel\n15: felaktigt diskbyte\n16: FCB ej tillgnglig\n17: verspill av delningsbuffert\n18: kodsida stmmer inte\n19: ingen indata\n20: otillrckligt diskutrymme\n"
  },
  {
    "path": "strings/swedish.lng",
    "content": "# \n#\n# FreeCOM national customization file\n#\n#\tLanguage: Swedish / CP850\n#\tAuthor:   Oscar Molin <oscarmolin@telia.com>\n#\n\n\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH\nFelaktig vxel. - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH\nFelaktig vxel. - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION\nOgiltig parameter: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG\n'%s' kan inte ha ngra parametrar\n.\n\n:TEXT_ERROR_OPT_NOARG\n'%s' Mste ha en parameter\n.\n\n:TEXT_INVALID_NUMBER\nOgiltigt nummer angivet i '%s'\n.\n\n:TEXT_ERROR_CLOSE_QUOTE\nSaknar omslutande citattecken: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nKunde inte skapa temporr fil\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR\nFr mnga parametrar. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nFr mnga parametrar.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER\nFelaktig parameter. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nSkvgen finns inte.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nKunde inte hitta filen.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND\nKunde inte hitta filen. - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING\nErfordrad parameter saknas.\n.\n\n:TEXT_ERROR_INVALID_DRIVE\nFelaktig enhet %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2\nFelaktigt kommando eller filnamn - \"%s\".\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nDet finns inte tillrckligt med minne.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nAllokering av DOS-minne misslyckades.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nKan inte ppna temporr fil!\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE\nRad #%ld i kommandofil '%s' r fr lng.\n.\n\n:TEXT_ERROR_BFILE_VANISHED\nKommandofil '%s' hittades inte.\n.\n\n:TEXT_ERROR_BFILE_LABEL\nKommandofil '%s' innehller inte etiketten '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1\n%s misslyckades fr '%s'.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR\nKunde inte ange miljvariabeln '%s'.\nMiljomrdet fullt?\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND\nMiljvariabeln '%s' hittades inte.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nInget miljomrde. Minnet kanske r slut. Ange /E vxeln.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1\nKan inte ange alias '%s'. Alias kanske r full?\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1\nAlias '%s' hittades inte.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nInget alias-utrymme. Minnet kan vara slut.\n.\n\n:TEXT_ERROR_SYNTAX_STR\nSyntaxfel. - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nSyntaxfel.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG\nFilnamnet r fr lngt. - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY\nKan inte kopiera '%s' till sig sjlv\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nKommandoraden fr lng efter aliasutkning!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nRaden r fr lng.  Kan inte kra kommando.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1\nFelaktig storlek '%s'.\n.\n\n:TEXT_HISTORY_EMPTY#1\nDet inga lagrade kommandon hittades.\n.\n\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nMCB kedja korrupt, eller inte FreeDOS-kompatibelt system.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR\nOknt fel %d.\n.\n\n:TEXT_ERROR_REGION_WARNING\nOgiltig minnesregion %d - ignoreras.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nON eller OFF mste anges.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nFelaktig variabel angiven.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR: IN saknas.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nEn eller bda parenteserna saknas.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR: DO saknas.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR: Inget kommando efter DO.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE\nKan inte skicka indata frn filen '%s'.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE\nKan inte skicka utdata till filen '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nTom omdirigering.\n.\n\n:TEXT_ERROR_INVALID_DATE\nFelaktigt datum.\n.\n\n:TEXT_ERROR_INVALID_TIME\nFelaktig tid.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nIngen etikett angiven fr GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nCTTY-kommandot finns inte i denna COMMAND.COM.\n.\n\n:TEXT_ERROR_NORW_DEVICE\nFelaktig eller ingen ls/skriv-enhet '%s'.\n.\n\n:TEXT_ERROR_CTTY_DUP\nKunde inte ndra filbeskrivning fr TTY '%s'.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\n/L vxeln r nnu inte implementerad.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\n/U vxeln r nnu inte implementerad.\n.\n\n:TEXT_ERROR_WRITING_DEST\nKunde inte skriva till mlenhet.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE\nKunde inte ppna mlenhet. - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE\nKunde inte ppna filen '%s'\n.\n\n:TEXT_ERROR_READ_FILE\nKunde inte lsa frn filen '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE\nKunde inte skriva till filen '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\nParametrar fr inte brja med ihopsttningstecknet '+'.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nIhopsttningstecknet '+' fr inte spra parametrar.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nInget att utfra.\n.\n\n:TEXT_ERROR_COPY\nCOPY misslyckades\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: filnamn saknas\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: nummer saknas\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: ogiltigt nummer\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: Kommando saknas\n.\n\n:TEXT_NOT_IMPLEMENTED_YET\nFrlt oss...inte implementerat n.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nKunde inte ladda meddelanden i minnet.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nVxeln /MSG har exkluderats frn COMMAND.COM.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1\n%u objekt visas.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nKorrupt kommandorad. \nDetta r ett internt fel som r relaterat till det system som COMMAND.COM krs i. \nVar god rapportera detta fel.\n.\n\n:TEXT_QUOTED_C_OR_K#1\nVxlarna /C och /K fr inte omslutas av citattecken, de ignorerades.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1\nSkvgen fr COMMAND.COM mste vara fullstndig!\nDet betyder att den ska innehlla enhetsbokstav och brja med ett baktsnedstreck.\nTill exempel: C:\\\\FDOS\n\nCOMMAND.COM antar nu denna skvg:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nSessions-informationen kunde inte terstllas, alla lokala instllningar \nhar gtt frlorade. Se felmeddelanden ovan fr anledningen till detta problem.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nAktuell information kan inte sparas nr programmet anvnds. \nSe felmeddelanden ovan fr anledningen till detta problem.\n.\n\n:TEXT_ERROR_CWD_FAILED\nEnhet %c: svarar inte eller det interna minnet r slut.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nSpeglingen misslyckades: Alias allokerar fr mycket minne.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nSpeglingen misslyckades: Kunde inte allokera bortre minnet.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nSlut p alias-utrymme.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1\nAlias finns inte: '%s'\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nKunde inte stta in alias.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1\nOgiltigt namn p alias: '%s'.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nKunde inte ladda Context modulen eller Critical Error-hanteraren.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nContext har slut p minne.\nOm felet kvarstr kan ni frska med att ka ngon intern buffer, \nsom historikbufferten eller katalogstacken.\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1\nStorleken p context %lu byte verskrider max-sprren.\nndrar storlek p context %u byte.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nKunde inte lgga till statusinformation till context. Detta fel kan \nindikera korrupt minne eller felaktig uppskattning av minimistorleken p context. Var god informera prefekten fr FreeCOM p: freecom@freedos.org\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nContext-informationen r borta efter spegling. Context terskapas men alla alias etc. har gtt frlorade.\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nTryck p valfri tangent fr att fortstta . . .\\\n.\n\n:TEXT_MSG_HISTORY_SIZE\nHistorikbuffertens storlek r %d byte.\n.\n\n:TEXT_MSG_DOSKEY\nDOSKEY funktioner r redan aktiverade i prompten.\n.\n\n:TEXT_MSG_ECHO_STATE\nECHO r %s\n.\n\n:TEXT_MSG_VERIFY_STATE\nVERIFY r %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE\nDEBUG utmatning r %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET\nDEBUG utmatning skrivs ut till '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE\nBREAK r %s\n.\n\n:TEXT_MSG_CURRENT_DATE\nNuvarande datum r %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1\nSkriv in nytt datum (mm%sdd%s[cc]yy): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1\nSkriv in nytt datum (dd%smm%s[cc]yy): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1\nSkriv in nytt datum ([cc]yy%smm%sdd): \\\n.\n\n:TEXT_MSG_CURRENT_TIME\nNuvarande tid r %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nSkriv in ny tid: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1\nJjNn{CR}{LF}{CBREAK}\naabb   b   b       b\nAlla filer i '%s' kommer att tas bort!\nVill ni frtstta (J/N)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nJjNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [Ja=RETUR, Ja=ESC] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#\tby \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1\nJaNnAaQq{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\nCtrl+Break.\\r\nAvbryt kommandofil '%s' (Ja/Nej/Avbryt alla) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1\nJjNnAaFf{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nSkriv ver '%s' (Ja/Nej/Alla/Fortstt) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1\nJjNnAaFf{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nTa bort '%s' (Ja/Nej/Alla/Fortstt) ? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<oknd>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nKatalogstacken r tom.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1\n Volymen i enhet %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING\nr %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nsaknar etikett\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER\n Volymen har serienummer %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1\n%10s fil(er)\\\n.\n:TEXT_DIR_FTR_BYTES\n   %12s byte\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nTotalt antal visade filer:\n.\n:TEXT_DIR_FTR_DIRS#1\n%10s kat\\\n.\n:TEXT_DIR_FTR_BYTES_FREE\n %15s byte lediga\n.\n:TEXT_DIR_DIRECTORY\nKatalog i %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE\n Katalog i %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE\n%-13s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <KAT> \\\n.\n:TEXT_DIR_LINE_SIZE#1\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1\n%-14s\\\n.\n\n:TEXT_MSG_PATH\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nIngen katalog att ska i.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nSn\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nMn\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nTis\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nOns\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\nTor\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\nFre\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nLr\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\ningen fil togs bort.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\nen fil togs bort.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1\n%u filer togs bort.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nTillgngliga interna kommandon:\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\nTillgngliga funktioner:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[alias] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[utkad inmatning] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[historik] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[filnamns-komplettering] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[spegling] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[start-loggning] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[fregende katalog] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[krnspegling] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[XMS-spegling] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[spegling som standard] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[kommandon att installera] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[katalogstack (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[FreeCOM debug] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nTryck F8 fr sprningslge, eller F5 fr att hoppa ver %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC\nHoppar ver '%s'.\n.\n\n:TEXT_MSG_VER_DOS_VERSION\nDOS version %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nFreeDOS-krna (bygge 1933 eller tidigare)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS\nFreeDOS-krna version %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\nCopyright (C) 1994-2001 Tim Norman och andra.\n\nDetta program distribueras i hop om att det ska vara anvndbart, \nmen UTAN NGON GARANTI; utan ens pstdd garanti om att det PASSAR FR ETT VISST SYFTE. Se GNU General Public License fr mer detaljer.\n\nFelrapporter skickas till freedos-freecom@lists.sourceforge.net.\nUppdateringar finns tillgngliga p http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\nCopyright (C) 1994-2001 Tim Norman och andra.\n\nDetta program r fri programvara; ni kan omdistribuera den och/eller ndra den under reglerna definierade i GNU General Public License som det publicerats av Free Software Foundation; antingen version 2 av licensen, eller om ni nskar, den senaste.\n\nFelrapporter skickas till freedos-freecom@lists.sourceforge.net.\nUppdateringar finns tillgngliga p http://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\nFreeDOS kommandoprompt har utvecklats av mnga personer, se HISTORY.TXT fr mer detaljerad information.\n\nNuvarande prefekt r Steffen Kaiser mailto:freecom@freedos.org\n\nFelrapporter skickas till freedos-freecom@lists.sourceforge.net.\nUppdateringar finns tillgngliga p http://freedos.sourceforge.net/freecom\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nKommandoprompten hller p att avslutas, trots att detta\\r\nr frbjudet (vanligtvis genom att anvnda \"/P\" vxeln).\\r\nNi mste starta om datorn, eller om prompten krs i en \\r\nmultitaskingsmilj, stnga av processen manuellt.\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nFreeCOM:s programfil hittades inte.\nNi mste ange fullstndig skvg till COMMAND.COM\nsom frsta parameter i COMMAND, till exempel:\nC:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1\nMiljsegment       : max %5u byte; ledigt %5u byte\n.\n:TEXT_MEMORY_CONTEXT#1\nKontext-segment    : max %5u byte; ledigt %5u byte\n.\t\n:TEXT_MEMORY_HEAP#1\nHeap               : ledigt %5lu byte\n.\n:TEXT_MEMORY_CTXT_ALIAS#1\n\\tAlias            : grns %5u byte, nuvarande %5u byte, %5u objekt\n.\n:TEXT_MEMORY_CTXT_HISTORY#1\n\\tHistorik         : grns %5u byte, nuvarande %5u byte, %5u objekt\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1\n\\tKatalogstack     : grns %5u byte, nuvarande %5u byte, %5u objekt\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1\n\\tFregende kat   : anvnt  %5u byte, %5u objekt\n.\n:TEXT_MEMORY_CTXT_BATCH#1\n\\tKommandonstling : anvnt  %5u byte, %5u objekt\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1\n\\tSpelingsinfo     : anvnt  %5u byte, %5u objekt\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nKunde inte hmta kodsida frn systemet.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nKunde inte ndra aktuellt kodsida.\n.\n:TEXT_DISPLAY_CODEPAGE#1\nAktuell kodsida r %u.\nSystemets kodsida r: %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nVisar, anger eller tar bort alias.\n\nALIAS [variabel[=][strng]]\n\n\tvariabel  Anger namn p alias.\n\tstrng    Anger en serie tecken som ges till alias.\n\n\nALIAS utan parametrar visar aktuella alias.\n.\n\n:TEXT_CMDHELP_BEEP\nGr ett pip-ljud.\n.\n\n:TEXT_CMDHELP_BREAK\nAnger eller tar bort utkad CTRL+C kontroll.\n\nBREAK [ON | OFF]\n\nBREAK utan parametrar visar aktuellt BREAK-instllning.\n.\n\n:TEXT_CMDHELP_CALL#1\nAnropar ett kommandofil frn ett annat.\n\nCALL [/S | /N] [/Y] [enhet:][skvg]filnamn [kommandofilsparametrar]\n\n  kommandofilsparametrar   Anger kommandoradsinformation som                                             kommandofilen behver.                    \n  /S tvingar, /N frbjuder spegling av FreeCOM.\n  /Y aktiverar sprningslge under utfrandet av kommandot.\n.\n\n:TEXT_CMDHELP_CD\nVisar namnet p, eller ndrar, aktuell katalog.\n\nCHDIR [enhet:][skvg]\nCHDIR[..]\nCD [enhet:][skvg]\nCD[..]\nCD -\n\n  ..   Anger att ni nskar ndra aktuell katalog moderkatalogen.\n  -    Om \"fregende katalog\"-funktionen r p byts aktuell katalog ut med          fregende katalog.\n\nCD enhet: visar vilken katalog som r den aktuella p angiven enhet.\nCD utan parametrar visar aktuell enhet och katalog.\nSe ven: CDD\n.\n\n:TEXT_CMDHELP_CDD\nVisar namnet p, eller ndrar, aktuell katalog och enhet.\n\nCDD [enhet:][skvg]\nCDD[..]\n\n  ..   Anger att ni nskar ndra aktuell katalog moderkatalogen.\n  -    Om \"fregende katalog\"-funktionen r p byts aktuell katalog ut med          fregende katalog.\n\nOm enhet: anges ndras aktuell arbetsenhet; detta r den enda skillnaden \njmfrt mot \"CHDIR\".\nCDD utan parametrar visar aktuell enhet och katalog.\n.\n\n:TEXT_CMDHELP_CHCP\nVisar eller anger nummer fr aktiv kodsida.\n\nCHCP [nnn]\n\n  nnn   Anger ett nummer fr en kodsida.\n\nCHCP utan parametrar visar nummer fr aktiv kodsida.\n.\n\n:TEXT_CMDHELP_CLS\nRensar skrmen.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\nStartar en ny kopia av FreeCOM kommandoprompt.\n\nCOMMAND [[enhet:]skvg] [enhet] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG]\n                       [/LOW] [/Y [/[C|K] kommando]]\n  [enhet:]skvg  Anger skvg som innehller COMMAND.COM.\n  enhet           Anger en hrdvaruenhet att anvnda fr indata och utdata.\n  /E:nnnnn        Anger startstorleken p miljn till nnnnn byte.\n                  (nnnnn br vara mellan 256 och 32,768).\n  /L:nnnn         Anger lngd p interna buffertar (krver /P).\n                  (nnnn br vara mellan 128 och 1,024).\n  /U:nnn          Anger buffertlngd fr indata (krver /P).\n                  (nnn br vara mellan 128 och 255).\n  /P              Gr den nya kommandoprompten permanent (kan ej avslutas).\n  /MSG            Lagrar alla felmeddelanden i minnet (krver /P).\n  /LOW            Resident data behlls i det lga minnesomrdet.\n  /Y              Stegar igenom kommandofil med /C eller /K.\n  /C kommando      Utfr angivet kommando och tergr till programmet.\n  /K kommando      Utfr angivet kommando och fortstter kra..\n.\n\n:TEXT_CMDHELP_COPY\nKopierar en eller flera filer till en annan plats\n\nCOPY [/A | /B] klla [/A | /B] [+ klla [/A | /B] [+ ...]] [ml\n  [/A | /B]] [/V] [/Y | /-Y]\n\n  klla        Anger den eller de filer som ska kopieras.\n  /A           Indikerar att filen r en ASCII-textfil.\n  /B           Indikerar att filen r en binr fil.\n  klla        Anger katalog och/eller filnamn fr de nya filerna.\n  /V           Verifierar att nya filer skrivs korrekt.\n  /Y           Bekrftelse krvs inte fr att skriva ver en befintlig fil\n  /-Y          Bekrftelse krvs fr att skriva ver en befintlig fil\n\nVxeln /Y kan vara frinstlld i miljvariabeln COPYCMD.\nDet kan sidosttas med /-Y i kommandoraden\n\nLgg ihop filer genom att ange en enstaka fil som ml men flera som klla (anvnd jokertecken eller formatet fil1+fil2+fil3).\n.\n\n:TEXT_CMDHELP_CTTY\nndrar den enhet som anvnds fr att kontrollera systemet.\n\nCTTY enhet\n\n  enhet   Enheten ni vill anvnda, t ex COM1.\n.\n\n:TEXT_CMDHELP_DATE#1\nVisar eller anger datum\n\nDATE [/D] [datum]\n\nDATE utan parametrar visar aktuellt datum och frgar efter ett nytt.\nTryck RETUR fr att behlla samma datum.\n\n/D hindrar DATE frn att bli interaktivt.\n.\n\n:TEXT_CMDHELP_DEL#2\nTar bort en eller flera filer.\n\nDEL [enhet:][skvg]filnamn [/P] [/V]\nERASE [enhet:][skvg]filnamn [/P] [/V]\n\n  [enhet:][skvg]filnamn Anger fil eller filer att ta bort. \n                          Flera filer anges med jokertecken.\n  /P\tKrver bekrftelse vid borttagning av fil.\n  /V\tVisar alla borttagna filer.\n.\n\n:TEXT_CMDHELP_DIR#4\nVisar en lista med filer och underkataloger i en katalog.\n\nDIR [enhet:][skvg][filnamn] [/P] [/W] [/A[[:]attribut]]\n  [/O[[:]sortorder]] [/S] [/B] [/L]\n\n  [enhet:][skvg][filnamn]\n            Anger enhet, katalog och/eller filer att visa.\n            (Kan vara utkad eller flertalig filspecifikation)\n /P         Visar en del i taget av listan, om denna inte ryms p skrmen.\n /W         Visar filer och kataloger i kolumner.\n /A         Visar endast filer med angivet attribut. (standard r /ADHSRA)\n attribut    D  Kataloger                  R  Skrivskyddade filer\n             H  Dolda filer                A  Arkivklara filer\n             S  Systemfiler                -  Prefix fr inte\n /O         Ger lista enligt sortorder.\n sortorder   N  Efter namn (alfabetisk)    S  Efter storlek (minst frst)\n             E  Efter tillgg (alfabetisk) D  Datum och tid (ldst frst)\n             G  Gruppera kataloger frst   -  Prefix fr omvnd ordning\n             U  Osorterade\t\t      (Standard r /ONG)\n /S         Visar filer i angiven katalog och filerna i dess underkataloger.\n /B         Enkelt format (Ingen inledande information och sammanfattning).\n /L         Anvnder gemener.\n /Y eller /4 Visa 4-siffriga rtal.\n\nVxlar kan frinstllas med miljvariabeln DIRCMD.  \nsidostt dessa vxlar med - (bindestreck), till exempel /-W.\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nDet externa DOSKEY-verktyget finns inbyggt i FreeCOM. Anvnd UPP- och NEDPIL\nfr att terkalla historiken och HISTORY fr att visa den. Anvnd VNSTER-\noch HGERPIL samt END och HOME fr att navigera inom kommandoraden och\nanvnd INSERT fr att vxla mellan verskrivnings- och infogningslge.\nTryck TAB fr att komplettera aktuellt ord som filnamn; tryck tv gnger fr\natt visa alla matchande filer.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nRedigerar kommandorader, terkallar kommandorader, och skapar makron\n\nDOSKEY [/vxel ...] [makronamn=[text]]\n\n  /BUFSIZE:storlek Anger storlek p makro- och kommandobufferten    (standard:512)\n  /ECHO:ON|OFF     Anger ECHO ON/OFF i makron                       (standard:ON)\n  /FILE:fil        Anger fil med lista ver makron\n  /HISTORY         Visar alla kommandon som lagrats i minnet\n  /INSERT          Stter in nya tecken i raden nr ni skriver\n  /KEYSIZE:storlek Anger storleken p tangentbordets type-ahead-buffert (standard:15)\n  /LINE:storlek    Anger maximal storlek p radredigerings buffert  (standard:128)\n  /MACROS          Visar alla DOSKey-makron\n  /OVERSTRIKE      Skriver ver gamla tecken med nya nr ni skriver (standard)\n  /REINSTALL       Installerar en ny kopia av DOSKey\n  makronamn        Namnet p makrot som skapas\n  text             Kommandon som ni vill ha i makron\n\nUPP- och NEDPIL terkallar kommandon\n            ESC tar bort aktuellt kommando\n             F7 visar lagrade kommandon\n         Alt+F7 tar bort lagrade kommandon\n     [tecken]F8 sker efter kommando som brjar med [tecken]\n             F9 vljer kommando med nummer\n        Alt+F10 rensar alla makrodefinitioner\n\nSpecialkoder ni kan anvnda i DOSKey makrodefinitioner:\n  $T     Kommando separator: tillter flera kommandon i samma makro\n  $1-$9  kommandofilsparametrar: likvrdiga med %1-%9 i kommandofil\n  $*     Utvidgad till allt som str p kommandoraden efter makrots namn\n.\n\n:TEXT_CMDHELP_ECHO\nVisar meddelanden, eller styr hurvida kommandon som krs ska visas visas p skrmen.\n\n  ECHO [ON | OFF]\n  ECHO [meddelande]\n\nECHO utan parametrar visar aktuell ECHO-instllning.\n.\n\n:TEXT_CMDHELP_EXIT\nAvslutar FreeDOS kommandoprompt.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\nKr angivet kommando fr varje fil i en grupp av filer.\n\nFOR %variabel IN (grupp) DO kommando [kommandoparametrar]\n\n  %variabel  Anger en utbytbar parameter.\n  (grupp)    Anger en eller flera filer. Jokertecken fr anvndas.\n  kommando   Anger kommandot som ska utfras fr varje fil.\n  kommandoparametrar\n             Anger parametrar och/eller vxlar fr det angivna kommandot.\n\nFr att anvnda FOR kommandot i ett kommandofil, ange %%variabel istllet\nfr %variabel.\n.\n\n:TEXT_CMDHELP_GOTO\nStyr kommandoprompten till en rad med given etikett i ett kommandofil.\n\nGOTO etikett\n\n  etikett    Anger en textstrng som anvnds i kommandofil som etikett.\n\nNi skriver etiketten fr sig sjlv p en rad, med ett kolon fre.\n.\n\n:TEXT_CMDHELP_HISTORY#1\nHistorikkommando.\n\nHISTORY [storlek]\n\nUtan \"storlek\" visas det aktuella innehllet i historikbufferten fr\nkommandoraden.\nMed \"storlek\" s ndras storleken p historikbufferten.\n.\n\n:TEXT_CMDHELP_IF\nKr ett kommando i ett kommandoprogram om ett villkor r sant.\n\nIF [NOT] ERRORLEVEL tal kommando\nIF [NOT] strng1==strng2 kommando\nIF [NOT] EXIST filnamn kommando\n\n  NOT               Anger att kommandoprompten ska utfra kommandot bara \n                    om villkoret r falskt.                   \n  ERRORLEVEL tal    Anger att villkoret r sant om det sista programmet som \n                    krts returnerat en slutkod som r lika med eller strre \n                    n det angivna talet.\n  kommando          Anger ett kommando som ska utfras om villkoret har uppntts.\n  strng1==strng2  Anger att villkoret r sant om de angivna textstrngarna \n                    r lika.\n  EXIST filnamn     Anger att villkortet r sant om det angivna filnamnet existerar.\n.\n\n:TEXT_CMDHELP_LH\nLaddar ett program till det vre minnesomrdet.\n\nLOADHIGH [enhet:][skvg]filnamn [parametrar]\nLOADHIGH [/L:region1[,minstorlek1][;region2[,minstorlek2]...] [/S]]\n         [enhet:][skvg]filnamn [parametrar]\n\n/L:region1[,minstorlek1][;region2[,minstorlek2]]...\n            Anger de regioner av minnet dit programmet ska laddas.  \n            Region1 Anger numret fr den frsta minnesregionen; minstorlek1 \n            anger minimistorleken, om ngon, fr region1.  \n            Region2 and minstorlek2 anger nummer och minimistorlek\n            fr den andra regionen osv.\n            Ni kan ange hur mnga regioner ni vill.\n\n/S          Krymper en UMB till minimal storlek medans programmet laddas.\n\n[enhet:][skvg]filnamn\n            Anger plats och namn fr programmet.\n.\n\n:TEXT_CMDHELP_LOADFIX\nLaddar ett program ovanfr de frsta 64K i minnet, och kr programmet.\n\nLOADFIX [enhet:][skvg]filnamn\n\nAnvnd LOADFIX fr att ladda ett program om ni har ftt meddelandet \n\"Packad fil korrupt\" nr det laddas i det lgre minnesomrdet.\n.\n\n:TEXT_CMDHELP_MD\nSkapar en katalog.\n\nMKDIR [enhet:]skvg\nMD [enhet:]skvg\n.\n\n:TEXT_CMDHELP_PATH\nVisar eller anger de kataloger i vilka FreeCOM sker efter krbara filer.\n\nPATH [[enhet:]skvg[;...]]\nPATH ;\n\nSkriv PATH ; om ni vill rensa alla skvgsinstllningar \noch bara ska i den aktuella katalogen.\nPATH utan parametrar visar aktuell skvg.\n.\n\n:TEXT_CMDHELP_PAUSE\nAvbryter bearbetningen av ett kommandoprogram och visar meddelandet:\n\"Tryck p valfri tangent fr att fortstta...\" eller valfritt eget meddelande.\n\nPAUSE [meddelande]\n.\n\n:TEXT_CMDHELP_PROMPT\nndrar kommandoprompten.\n\nPROMPT [text]\n\n  text    Bestmmer den nya promptens utseende.\n\nPrompten kan best av vanliga tecken och fljande specialtecken:\n\n  $Q   = (lika med-tecken)\n  $$   $ (dollartecken)\n  $T   Aktuell tid\n  $D   Aktuellt datum\n  $P   Aktuell enhet och skvg\n  $V   FreeDOS kommandoprompts versionsnumber\n  $N   Aktuell enhet\n  $G   > (strre n-tecken)\n  $L   < (mindre n-tecken)\n  $B   | (vertikalstreck)\n  $H   Backsteg (raderar fregende tecken)\n  $E   Escape-tecken (ASCII-kod 27)\n  $_   Vagnretur och ny rad\n\nPROMPT utan parametrar terstller promptens standardutseende.\n.\n\n:TEXT_CMDHELP_PUSHD\nLgger nuvarande katalog till katalogstacken, med valet att\nndra nuvarande arbetskatalog.\n\nPUSHD [[enhet:]skvg]\n  Dr [enhet:]skvg r en skvg till det ni vill ndra.\n.\n\n:TEXT_CMDHELP_POPD\nTar en katalog frn katalogstacken, och ndras till den.\n\nPOPD [*]\n  Jockertecken ('*') parametern rensar katalogstacken.\n.\n\n:TEXT_CMDHELP_DIRS\nVisar innehllet i en katalog.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\nTar bort en katalog.\n\nRMDIR [enhet:]skvg\nRD [enhet:]skvg\n.\n\n:TEXT_CMDHELP_REM\nMarkerar kommentarer i ett kommandoprogram eller CONFIG.SYS.\n\nREM [kommentar]\n.\n\n:TEXT_CMDHELP_REN\nByter namn p en eller flera filer/kataloger.\n\nRENAME [enhet:][skvg][katalognamn1 | filnamn1] [katalognamn2 | filnamn2]\nREN [enhet:][skvg][katalognamn1 | filnamn1] [katalognamn2 | filnamn2]\n\nNi kan inte ange enhet eller skvg fr mlfil/katalog. \nAnvnd kommandot MOVE fr detta syfte.\n.\n\n:TEXT_CMDHELP_SET#1\nVisar, anger eller tar bort miljvariabler.\n\nSET [/C] [/P] [variabel=[strng]]\n\n  variabel  Anger miljvariabelns namn.\n  strng    Anger en serie tecken som tilldelas variabeln\n\n* Om ingen strng anges tas angiven miljvariabel bort.\n\nSET utan parametrar visar aktuella miljvariabler.\n\n/C tvingar SET att behlla information om gemener och VERSALER i variabelnamn; som standard s omvandlas alla gemener till versaler om miljvariabeln inte redan finns, gr den det s behller den sitt namn.\n\n/P Frgar anvndaren efter en strng som sen ges till variabeln.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nndrar numreringen av de utbytbara parametrarna i kommandoprogram.\n\nSHIFT [DOWN]\n\nDOWN Flyttar parameter mot brjan (%%0); annars mot slutet.\n.\n\n:TEXT_CMDHELP_TIME#1\nVisar eller stller in systemklockan.\n\nTIME [/T] [tid]\n\nSkriv TIME utan parametrar fr att visa nuvarande tidsinstllning och frga \nefter ny instllning.  Tryck RETUR fr att behlla samma tid.\n\n/T hindrar TIME frn att bli interaktiv.\n.\n\n:TEXT_CMDHELP_TRUENAME\nVisar hela skvgen fr given skvg.\n\nTRUENAME [enhet:][skvg][filnamn]\n.\n\n:TEXT_CMDHELP_TYPE\nVisar innehllet i textfiler.\n\nTYPE [enhet:][skvg]filnamn\n.\n\n:TEXT_CMDHELP_VER\nVisar FreeDOS kommandoprompt version och annan information.\n\nVER [/R] [/W] [/D] [/C]\n\n /R         Visar krnversion och annan information.\n /W         FreeDOS kommandoprompt garanti.\n /D         FreeDOS kommandoprompt omdistributionsinformation.\n /C         FreeDOS kommandoprompt medhjlpare.\n.\n\n:TEXT_CMDHELP_VERIFY\nSger t FreeDOS-filsystemet att verifiera att data skrivs korrekt p disken.\n\nVERIFY [ON | OFF]\n\nSkriv VERIFY utan parametrar fr att visa nuvarande VERIFY-instllning.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nOm debug (felskning) r inkompilerat i FreeDOS, s kan detta kommando\nstnga av eller sl p utmatning av debug-information, \neller visa om det r ON eller OFF.\n\nFDDEBUG [ON | OFF | fil]\n\nSkriv FDDEBUG utan parameter fr att visa nuvarande instllningar\nfr utmatning av debug-information.\nOm en fil specificeras kommer all debug-information att skickas till den filen;\nutmatningen lggs till sist i filen, om den redan finns. De speciella\nnamnen \"stdout\" och \"stderr\" kan anvndas fr att vidarebefordra utmatningen \ntill strmmen standard out eller standard error.\n.\n\n:TEXT_CMDHELP_VOL\nVisar diskens volymetikett och serienummer, om de finns.\n\nVOL [enhet:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nVisar en lista p kommandon och funktioner som finns tillgngliga i prompten.\n\n?\n?kommando [parameter]\n\nDen frsta varianten visar tillgngliga interna kommandon och funktioner.\nDen andra kommer frga om det givna kommandot ska kras som om\nsprningslge vore aktiverat.\n\n.\n\n:TEXT_CMDHELP_WHICH\nSker och visar den exekverbara filen fr varje givet kommando.\n\nWHICH {kommando}\n.\n\n:TEXT_CMDHELP_MEMORY#1\nVisar det interna minnet som anvnds av FreeCOM internt\n\nMEMORY\n\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\nMlet fr COPY fr inte innehlla plus ('+') tecken.\n.\n\n:TEXT_DELETE_FILE#1\nTar bort fil \"%s\".\n.\n"
  },
  {
    "path": "strings/turkish.err",
    "content": "# $Id$\n#\n# Critical error national customization file\n#\n#\tLanguage: Turkish\n#\tCodepage: ASCII (7bit) / CP857\n#\tAuthor:   Emir SARI\n# \n# The critical error (criter) handler receives some information\n# from the kernel about what error condition happens, generates some\n# human friendly message from it, requests the user's opinion about\n# how to proceed and, finally, returns to the kernel.\n# \n# The human friendly message is generated using one of the following\n# templates:\n# BLOCK_DEVICE (for criters on block devices)\n# \tError %1 drive %A: %2 area: %3\n# -and- CHAR_DEVICE (for criters on character devices)\n# \tError %1 device %A: %3\n# \n# Two-character sequences, which first character is a percent sign '%',\n# are placeholders for other information:\n# %% -> a single percent sign\n# %1 -> either READ or WRITE, depending on what kind of operation\n# \tcaused the criter\n# %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA\n# %3 -> the actual error string; these are the strings associated to\n# \ta number 0 through N, and must correspond to the number passed in\n# \tlowbyte(DI) to the criter handler (see RBIL INT-24 for details)\n# %A -> drive letter (for block devices); name of device (character devices)\n# \n# Below the line describing the error the user is prompted for the action\n# to proceed. This line is dynamically constructed depending on which\n# action are available at all. The full line may look like this:\n# \t(A)bort, (I)gnore, (R)etry, (F)ail?_\n# \n# The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They\n# should indicate which user response keys is associated with them;\n# suggested is to use the first letter and enclose it in parenthesises.\n# The delimiter \", \" can be defined with DELIMITER and is the same\n# for all slots.\n# The \"? \" sequence is defined by QUESTION.\n# The order of the actions is fixed and cannot be customized.\n# \n# With each action a number of user response keys must be associated.\n# They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ...\n# strings. Because the key is searched in the same format as returned\n# by INT-16-00, both upper and lower case must be specified and\n# certain special keys cannot be used.\n# \n# The individual error strings are defined by the #: lines, where\n# the hash sign '#' refers to the number the kernel passes to the\n# criter handler. The UNKNOWN string is displayed for all error\n# numbers not specified.\n#\n# NOTE #1: The percent rule applies to _all_ criter strings!\n# NOTE #2: Each string occupies exactly one line.\n# NOTE #3: Any leading or trailing whitespaces are removed. Prefix the\n#\tfirst or suffix the last whitespace with '%.' (one percent sign and\n#\tone dot). This sequence is removed from the string totally.\n# NOTE #4: To embed any character use: %&## (one percent sign,\n#\t\tone ampersand and exactly two hexa-decimal digits)\n\n## Primary strings\nS2\nBLOCK_DEVICE: Hata - %1 %A srcs: %2 alan: %3\nS3\nCHAR_DEVICE: Hata - %1 %A srcs: %3\n\n## kind of operation\nS0\nREAD: Okunma konumu:\nS1\nWRITE: Yazlma konumu:\n\n## kind of failed area of block devices\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: Kk\nS7\nDATA: Veri\n\n## action strings\nS8\nIGNORE: (Y)ok say\nS9\nRETRY: Yeniden (d)ene\nS10\nABORT: (p)tal\nS11\nFAIL: (B)aarsz say\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: yY\nKEYS_RETRY:  dD\nKEYS_ABORT:  pP\nKEYS_FAIL:   bB\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN: Bilinmeyen hata kodu\nS15\n0: Yazma korumas ihlal giriimi\n1: Src iin bilinmeyen birim\n2: Src hazr deil\n3: Srcye bilinmeyen bir komut verildi\n4: Veri hatas (yanl CRC)\n5: Yanl aygt srcs talep yaps boyutu\n6: Arama hatas\n7: Bilinmeyen ortam tr\n8: Kesim bulunamad\n9: Yazcda kt kalmad\n10: Yazma hatas\n11: Okuma hatas\n12: Genel sorun\n13: Paylam ihlali\n14: Kilitleme ihlali\n15: Geersiz disk deiimi\n16: FCB mevcut deil\n17: Paylam nbellei yetersiz\n18: Sayfa kodu uyumazl\n19: Giri sonu\n20: Yetersiz disk alan\n"
  },
  {
    "path": "strings/turkish.lng",
    "content": "# $Id: DEFAULT.lng 1277 2006-09-04 19:40:42Z blairdude $\n#\n# FreeCOM national customization file\n#\n#\tLanguage: Turkish\n#\tCodepage: ASCII (7bit) / CP857\n#\tAuthor:   Emir SARI\n#\n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retrieve the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#\t:TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n# If there is a percent sign (%) appended to the version, the printf()\n# format string %-style placeholders are compared for the strings. The\n# sign need to be set in DEFAULT.lng only.\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carriage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause a user interaction. Those ones should be in sync\n# with the issued text. To define how to interpret a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#YyNn\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitrary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the question\n# mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readability of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH#0%\nGeersiz anahtar. - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH#0%\nGeersiz anahtar. - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION#0%\nYanl oluturulmu seenek: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG#0%\n'%s' seeneinin bamsz deikeni olamaz.\n.\n\n:TEXT_ERROR_OPT_NOARG#0%\n'%s' seeneinin bamsz bir deikeni olmal.\n.\n\n:TEXT_INVALID_NUMBER#0%\n'%s' gesinde geersiz say belirtimi.\n.\n\n:TEXT_ERROR_CLOSE_QUOTE#0%\nEksik kapatma trnak imi: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nGeici dosya oluturulamad.\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR#0%\nok fazla parametre. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nok fazla parametre.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER#0%\nGeersiz parametre. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nYol bulunamad.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nDosya bulunamad.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND#0%\nDosya bulunamad. - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING#0%\nGerekli parametre eksik.\n.\n\n:TEXT_ERROR_INVALID_DRIVE#0%\nGeersiz src %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2%\nYanl komut veya dosya ad - \"%s\".\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nBellek yetersiz hatas.\n.BATCHFILE\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nDOS belleinin ayrlmas baarsz oldu.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nKanal oluturulamad! Geici dosya alamad!\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE#0%\n'%s' toplu i dosyasnda #%ld. satr ok uzun.\n.\n\n:TEXT_ERROR_BFILE_VANISHED#0%\nToplu i dosyas '%s' bulunamad.\n.\n\n:TEXT_ERROR_BFILE_LABEL#0%\n'%s' toplu i dosyas, '%s' etiketini iermemekte.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1%\n%s, '%s' iin baarsz oldu.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR#0%\n'%s' ortam deikeni ayarlanamad.\nOrtam dolu olmasn?\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND#0%\n'%s' ortam deikeni bulunamad.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nOrtam yok. Bellek yetersiz olabilir. /E seeneini belirtin.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1%\n'%s' armas ayarlanamad '%s'. Arma alan dolu olmasn?\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1%\n'%s' armas bulunamad.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nArma alan yok. Bellek yetersiz olabilir.\n.\n\n:TEXT_ERROR_SYNTAX_STR#0%\nSzdizim hatas. - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nSzdizim hatas.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG#0%\nDosya ad ok uzun. - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY#0%\n'%s' kendi zerine kopyalanamaz.\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nArma geniletilmesinden sonra komut satr ok uzun!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nKomut satr 125 karakterden uzun.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1%\nGeersiz tarihe boyutu '%s'.\n.\n\n:TEXT_HISTORY_EMPTY#1\nKomut satr tarihesi bo.\n.\n\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nMCB zinciri bozuk, veya MS-DOS ile uyumlu olmayan bir sistem.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR#0%\nTanmsz hata %d.\n.\n\n:TEXT_ERROR_REGION_WARNING#0%\nGeersiz bellek alan %d - yok sayld.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nON veya OFF belirtilmesi gerekiyor.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nYanl deiken belirtildi.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR: IN eksik.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nBir veya her iki parantez eksik.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR: DO eksik.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR: DO ardndan hibir komut girilmemi.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE#0%\nkt, '%s' dosyasndan ynlendirilemedi.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE#0%\nkt, '%s' dosyasna ynlendirilemedi.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nBo yeniden ynlendirme.\n.\n\n:TEXT_ERROR_INVALID_DATE\nGeersiz tarih.\n.\n\n:TEXT_ERROR_INVALID_TIME\nGeersiz zaman.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nGOTO iin hibir etiket belirtilmemi.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nCTTY komutu bu COMMAND.COM'dan hari tutuldu.\n.\n\n:TEXT_ERROR_NORW_DEVICE#0%\n'%s' geersiz veya okuma-yazma aygt deil.\n.\n\n:TEXT_ERROR_CTTY_DUP#0%\nDosya tanmlayclarn '%s' TTY'ye deitirilmeleri baarsz.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\n/L henz eklenmemi.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\n/U henz eklenmemi.\n.\n\n:TEXT_ERROR_WRITING_DEST\nHedefe yazma srasnda hata.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE#0%\nKaynan almas baarsz oldu. - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE#0%\n'%s' dosyas alamad\n.\n\n:TEXT_ERROR_READ_FILE#0%\n'%s' dosyasndan okuma baarsz oldu\n.\n\n:TEXT_ERROR_WRITE_FILE#0%\n'%s' dosyasna yazma baarsz oldu\n.\n\n:TEXT_ERROR_LEADING_PLUS\nBirletirme karakteri '+' bamsz deikenlerin nnde olamaz.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nBirletirme karakteri '+' bamsz deikenlerin sonunda olamaz.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nYaplacak bir ey yok.\n.\n\n:TEXT_ERROR_COPY\nCOPY baarsz oldu.\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: Eksik dosya ad.\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: Eksik say.\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: Geersiz say.\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: Eksik komut.\n.\n\n:TEXT_NOT_IMPLEMENTED_YET\nzr dileriz, zellik henz mevcut deil.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nletilerin bellee yklenmesi baarsz oldu.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\n/MSG seenei bu COMMAND.COM'dan dlanmtr.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1%\n%u ge grntlendi.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nBozuk komut satr. Bu dahili bir hatadr ve COMMAND.COM'un\nalt sistemle ilgilidir. Ltfen bu hatay rapor edin.\n.\n\n:TEXT_QUOTED_C_OR_K#1\n/C ve /K seenekleri eklenemez, grmezden gelindiler.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1%\nCOMMAND.COM'a giden yolun tamamen belirtilmi olmas gerekmektedir!\nBu, src harfinin kullanlmas ve ters eik izgi ile balanmas demektir.\nrnein: C:\\\\FREEDOS\n\nCOMMAND.COM imdi bu yolu varsaymaktadr:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nOturum verileri geri alnamad, tm yerel ayarlar kaybedildi.\nLtfen bu sorunun sebebini renmek iin yukardaki hata\niletilerini okuyun.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nGncel veriler programn arlnda muhafaza edilemedi.\nLtfen bu sorunun sebebini renmek iin yukardaki hata\niletilerini okuyun.\n.\n\n:TEXT_ERROR_CWD_FAILED#1%\n%c: srcs yant vermiyor.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nTakas baarsz oldu: Armalar ok fazla bellek ayryor.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nTakas baarsz oldu: Uzak bellek ayrlamad.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nArma alan yetersiz.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1%\nByle bir arma yok: '%s'\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nArma eklenmesi baarsz oldu.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1%\nGeersiz arma ad '%s'.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nBalam modl veya Kritik Hata Yneticisi yklenemedi.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nBalam bellei yetersiz.\nBu hata srerse herhangi bir i arabellei artrmay dnn,\nrnein tarihe, dizin yn vs. gibi.\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1%\nBalamn boyutu %lu bayta eriiyor ve azami snr geiyor.\nBalam %u bayt olarak yeniden boyutlandrlyor.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nBalama durum verileri eklenmesi baarsz oldu. Bu hata bellek bozukluunu\nveya yanl belirlenmi asgari balam boyutuna iaret edebilir.\nLtfen FreeCOM gelitiricilerine u adresten bu konuda bilgi verin:\nfreedos-devel@lists.sourceforge.net\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nTakas sonras balam eksik. Balam tekrar oluturuldu;\nancak tm armalar vs. kaybedildi.\n.\n\n:TEXT_ERROR_PERMISSION_DENIED#1%\n%s: zin reddedildi\n.\n\n:TEXT_ERROR_NO_SUCH_FILE#1%\n%s: Byle bir dosya veya dizin yok\n.\n\n:TEXT_ERROR_UNKNOWN_ERROR#1%\n%s: Bilinmeyen hata\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nSrdrmek iin herhangi bir dmeye basn...\\\n.\n\n:TEXT_MSG_HISTORY_SIZE#0%\nGemi boyutu %d bayt.\n.\n\n:TEXT_MSG_DOSKEY\nDOSKEY zellikleri halihazrda kabukta etkinletirilmi.\n.\n\n:TEXT_MSG_ECHO_STATE#0%\nECHO: %s\n.\n\n:TEXT_MSG_VERIFY_STATE#0%\nVERIFY: %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE#0%\nDEBUG kts: %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET#0%\nDEBUG kts yazlma konumu: '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE#0%\nBREAK: %s\n.\n\n:TEXT_MSG_LFNFOR_STATE#0%\nLFNFOR: %s\n.\n\n:TEXT_MSG_LFNFOR_COMPLETE_STATE#0%\nLFN Complete: %s\n.\n\n:TEXT_MSG_CURRENT_DATE#0%\nGncel tarih: %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1%\nYeni tarih gir (aa%sgg%s[yy]yy): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1%\nYeni tarih gir (gg%saa%s[yy]yy): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1%\nYeni tarih gir ([yy]yy%saa%sgg): \\\n.\n\n:TEXT_MSG_CURRENT_TIME#0%\nGncel zaman: %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nYeni zaman gir: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING#0%\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1%\nEeHh{CR}{LF}{CBREAK}\naabb   b   b       b\n'%s' iindeki tm dosyalar silinecek!\nEmin misiniz [(E)vet/(H)ayr]? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nEeHh{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [(E)vet=ENTER, (H)ayr=ESC]? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is used via BIOS; any newline MUST be prefixed\n#\tby \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1%\nEeHhTtKk{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\nControl-Break'e basld.\\r\n'%s' toplu i dosyas sonlandrlsn m [(E)vet/(H)ayr/(T)m]? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1%\nEeHhTtKk{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\n'%s' dosyasnn zerine yazlsn m [(E)vet/(H)ayr/(T)m/(k)]? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_APPEND_FILE#1%\nEeHhTtKk{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\n'%s' dosyasna eklensin mi [(E)vet/(H)ayr/(T)m/(k)]? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1%\nEeHhTtKk{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\n'%s' silinsin mi [(E)vet/(H)ayr/(T)m/(k)]? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<bilinmiyor>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nDizin yn bo.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1%\n %c srcsndeki birim \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING#0%\n: %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nblmnn bir etiketi yok\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER#0%\n Birim seri numaras: %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1%\n%10s dosya\\\n.\n:TEXT_DIR_FTR_BYTES#0%\n    %12s bayt\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nListelenen toplam dosya:\n.\n:TEXT_DIR_FTR_DIRS#1%\n%10s dizin\\\n.\n:TEXT_DIR_FTR_BYTES_FREE#0%\n %15s bayt bo\n.\n:TEXT_DIR_DIRECTORY#0%\n%s dizini\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE#0%\n %s dizini\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1%\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE#1%\n%s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1%\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1%\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n      <DZN> \\\n.\n:TEXT_DIR_LINE_SIZE#1%\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1%\n%-14s\\\n.\n\n:TEXT_MSG_PATH#0%\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nHibir arama yolu tanmlanmam.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nPaz\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nPzt\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nSal\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nar\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\nPer\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\nCum\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nCts\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\nhibir dosya silinmedi.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\nbir dosya silindi.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1%\n%u dosya silindi.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nMevcut dahili komutlar:\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\nMevcut zellikler:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[armalar] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[gelimi giri] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[tarihe] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[dosya ad tamamlanmas] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[takas] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[balang gnl] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[son dizin] \\\n.\n:TEXT_SHOWCMD_FEATURE_LONG_FILENAMES#1\n[uzun dosya adlar] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[ekirdek takas] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[XMS takas] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[varsaylan takas olsun] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[kurulabilir komutlar] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[dizin yn (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[FreeCOM hata ayklamas] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nzleme kipi iin F8'e veya %s gesini atlamak iin F5'e basn... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC#0%\n'%s' atlanyor.\n.\n\n:TEXT_MSG_VER_DOS_VERSION#0%\nDOS srm %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nFreeDOS ekirdei (yap 1933 veya ncesi)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS#0%\nFreeDOS ekirdek srm %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\nTelif hakk (C) 1994-2005 Tim Norman ve dierleri.\n\nBu program faydal olaca umuduyla, fakat HBR GARANT ERMEDEN;\nhatta TCAR ELVERLLK veya AMACA UYGUNLUK zmni garantileri de\nverilmeden sunulmaktadr. Daha fazla ayrnt iin GNU Genel Kamu Lisansn\nokuyunuz.\n\nHata raporlarn u adrese gnderiniz: freedos-devel@lists.sourceforge.net.\nGncellemeler https://github.com/FDOS/freecom adresinde mevcuttur\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\nTelif hakk (C) 1994-2005 Tim Norman ve dierleri.\n\nBu program zgr yazlmdr, onu zgr Yazlm Vakfnn yaynlad\nGNU Genel Kamu Lisansnn ya 2. srm veya (sizin seiminize\ndayal olarak) herhangi bir daha yeni srm kapsamnda tekrar\ndatabilir ve/veya deitirebilirsiniz.\n\nHata raporlarn u adrese gnderiniz: freedos-devel@lists.sourceforge.net.\nGncellemeler https://github.com/FDOS/freecom adresinde mevcuttur\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\nFreeDOS Komut Kabuu birok programc tarafndan gelitirilmitir, ltfen\nHISTORY.TXT dosyasna bakn.\n\nHata raporlar iin: freedos-devel@lists.sourceforge.net\nGncellemeler iin: https://github.com/FDOS/freecom\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nKabuk sona erdirilmek zere ancak buna izin verilmiyor\\r\n(genellikle \"/P\" seeneini etkinletirerek).\\r\nSistemi yeniden balatmanz veya eer bu kabuk oklu grev ortamnda\\r\naltrlyorsa bu grev/ilemi elle sonlandrmanz gerekir.\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nFreeCOM altrlabilir dosyas bulunamad.\nCOMMAND.COM'a giden tam yolu COMMAND'n ilk bamsz\ndeikeni olarak belirtmeniz gerekir, mesela:\nC:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1%\nOrtam segmenti      : Azami %5u bayt; bo %5u bayt\n.\n:TEXT_MEMORY_CONTEXT#1%\nBalam segmenti     : Azami %5u bayt; bo %5u bayt\n.\n:TEXT_MEMORY_HEAP#1%\nYn               : Bo %5lu bayt\n.\n:TEXT_MEMORY_CTXT_ALIAS#1%\n\\tArmalar           : Snr %5u bayt, gncel %5u bayt, %5u ge\n.\n:TEXT_MEMORY_CTXT_HISTORY#1%\n\\tTarihe           : Snr %5u bayt, gncel %5u bayt, %5u ge\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1%\n\\tDizin yn      : Snr %5u bayt, gncel %5u bayt, %5u ge\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1%\n\\tSon dizin yn  : Kullanlan %5u bayt, %5u ge\n.\n:TEXT_MEMORY_CTXT_BATCH#1%\n\\t ie toplu i   : Kullanlan %5u bayt, %5u ge\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1%\n\\tTakas bilgisi     : Kullanlan %5u bayt, %5u ge\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nSistemden gncel kod sayfas alnamad.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nGncel kod sayfas deitirilemedi.\n.\n:TEXT_DISPLAY_CODEPAGE#1%\nGncel kod sayfas: %u.\nSistem kod sayfas (uygun ekilde): %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nArmalar grntler, ayarlar, kaldrr.\n\nALIAS [deiken[=][dize]]\n\n\tdeiken  Arma adn belirtir.\n\tdizi      Armaya atanacak karakter serisini belirtir.\n\n\nGncel armalar grntlemek iin parametresiz ALIAS yazn.\n.\n\n:TEXT_CMDHELP_BEEP\nBip sesi karr.\n.\n\n:TEXT_CMDHELP_BREAK\nGeniletilmi CTRL+C denetimini etkinletirir veya kaldrr.\n\nBREAK [ON | OFF]\n\nGncel BREAK ayarn grntlemek iin parametresiz BREAK yazn.\n.\n\n:TEXT_CMDHELP_CALL#1\nBir toplu i betiinden baka bir toplu i betiini arr.\n\nCALL [/S | /N] [/Y] [src:][yol]dosyaad [toplu-i-parametre]\n\n  toplu-i-parametre    toplu i betii iin gerekli verileri belirtir.\n  FreeCOM takasn /S zorlar, /N kaldrr.\n  /Y komutun altrlmas srasnda izleme kipini etkinletirir.\n.\n\n:TEXT_CMDHELP_CD\nGncel dizini grntler veya deitirir.\n\nCHDIR [src:][yol]\nCHDIR[..]\nCD [src:][yol]\nCD[..]\nCD -\n\n  ..   Bir st dizine gitmek istediinizi belirtir.\n  -    Eer \"son dizin\" zelletirildiyse etkinletirildiyse, son dizine dn.\n\nBelirtilen srcde gncel dizini grntlemek iin CD src: yazn.\nGncel src ve dizini grntlemek iin parametresiz CD yazn.\nAyrca baknz: CDD\n.\n\n:TEXT_CMDHELP_CDD\nGncel dizin ve srcy grntler veya deitirir.\n\nCDD [src:][yol]\nCDD[..]\n\n  ..   Bir st dizine gitmek istediinizi belirtir.\n  -    Eer \"son dizin\" zelletirildiyse etkinletirildiyse, son dizine dn.\n\nEer src belirtildiyse gncel alan src deitirilir; bu\n\"CHDIR\" ile tek farktr.\nGncel src ve dizini grntlemek iin parametresiz CD yazn.\n.\n\n:TEXT_CMDHELP_CHCP\nEtkin kod sayfas numarasn grntler veya ayarlar.\n\nCHCP [nnn]\n\n  nnn   Bir kod sayfas numaras belirtir.\n\nEtkin kod sayfas numarasn grntlemek iin parametresiz CHCP yazn.\n.\n\n:TEXT_CMDHELP_CLS\nEkran temizler.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\nFreeDOS komut kabuunun yeni bir kopyasn balatr.\n\nCOMMAND [[src:]yol] [aygt] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG]\n                       [/LOW] [/Y [/[C|K] command]]\n  [src:]yol    COMMAND.COM'un bulunduu dizini belirtir.\n  device          Komut girii ve k iin kullanlan aygt belirtir.\n  /E:nnnnn        lk ortam boyutunu nnnnn bayt olarak ayarlar.\n                  (nnnnn 256 ila 32.768 arasnda olmaldr).\n  /L:nnnn         Dahili arabellein boyutunu belirtir (/P'de gerekir).\n                  (nnnn 128 ila 1.024 arasnda olmaldr).\n  /U:nnn          Girdi arabelleinin boyutunu belirtir (/P'de gerekir).\n                  (nnn 128 ila 255 arasnda olmaldr).\n  /P              Yeni komut kabuunu daimi yapar (k yaplamaz).\n  /MSG            Tm hata letilerini bellekte depolar (/P'de gerekir).\n  /LOW            Komut kabuunun yerleik verilerini Aa bellekte\n                  tutmasn zorlar.\n  /Y              /C veya /K ile belirtilen toplu i program admlar.\n  /C komut        Belirtilen komutu altrr ve dner.\n  /K komut      Belirtilen komutu altrr ve almaya devam eder.\n.\n\n:TEXT_CMDHELP_COPY\nBir veya daha fazla dosyalar baka bir konuma kopyalar.\n\nCOPY [/A | /B] kaynak [/A | /B] [+ kaynak [/A | /B] [+ ...]] [hedef\n  [/A | /B]] [/V] [/Y | /-Y]\n\n  kaynak       Kopyalanacak dosya veya dosyalar belirtir.\n  /A           ASCII metin dosyasn belirtir.\n  /B           kili bir dosya belirtir.\n  hedef        Yeni dosyalar iin dizin veya dosya adn belirtir.\n  /V           Yeni dosyalarn doru yazldn denetler.\n  /Y           Mevcut olan bir hedef dosyasnn zerine yazma teyidini\n               kaldrr.\n  /-Y          Mevcut olan bir hedef dosyasnn zerine yazma teyidini\n               zorlar.\n\n/Y anahtar COPYCMD ortam deikeninde tanmlanabilir.\nBu, komut satrnda /-Y ile geersiz klnabilir.\n\nDosya eklemek iin hedef olarak tek bir dosya belirtin fakat kaynak iin\nbirden fazla dosya belirtin (jokerler veya dosya1+dosya2+dosya3 biimi).\n.\n\n:TEXT_CMDHELP_CTTY\nSisteminizi kontrol etmek iin kullanlan ubirim aygtn deitirir.\n\nCTTY aygt\n\n  aygt   Mesela COM1 gibi kullanmak istediiniz ubirim aygt.\n.\n\n:TEXT_CMDHELP_DATE#1\nTarihi grntler veya ayarlar.\n\nDATE [/D] [tarih]\n\nGncel tarih ayarn grntlemek ve yenisini girmek iin bir istem almak\niin parametresiz DATE yazn. Tarihi korumak iin ENTER dmesine basn.\n\n/D seenei, DATE komutunun etkileimli olmasna engel olur.\n.\n\n:TEXT_CMDHELP_DEL#2\nBir veya birden ok dosyay siler.\n\nDEL [src:][yol]dosyaad [/P] [/V]\nERASE [src:][yol]dosyaad [/P] [/V]\n\n  [src:][yol]dosyaad  Silinecek dosyalar belirtir.  Birden ok dosyay\n                          joker kullanarak belirtebilirsiniz.\n  /P\tHer bir dosyasnn silinmesinden evvel teyit ister.\n  /V\tSilinen tm dosyalar grntler.\n.\n\n:TEXT_CMDHELP_DIR#4\nHerhangi bir dizindeki dosyalarn ve alt dizinlerin listesini grntler.\n\nDIR [src:][yol][dosyaad] [/P] [/W] [/A[[:]znitelikler]]\n  [/O[[:]sralamadzeni]] [/S] [/B] [/L]\n\n  [src:][yol][dosyaad]\n            Listelenecek src, dizin ve dosyalar belirtir.\n            (Dosya tanmlamas ile gelitirilebilir.)\n /P         Her bilgi ekranndan sonra duraklar.\n /W         Geni liste biimini kullanr.\n /A         Belirtilen znitelikli dosyalar grntler (varsaylan /ADHSRA)\n attributes  D  Dizinler                   R  Salt okunur dosyalar\n             H  Sakl dosyalar             A  Arivlenmeye hazr dosyalar\n             S  Sistem dosyalar           -  hayr neki\n /O         Dosyalar sralama dzenine gre listeler.\n sralama    N  Ada gre (alfabetik)       S  Boyuta gre (nce k)\n             E  Uzantya gre (alfabetik)  D  Tarih & zaman (nce eskisi)\n             G  nce dizinleri grupla      -  Ters sralama neki\n             U  Sralanmam\t\t   Varsaylan /ONG\n /S         Belirtilen dizinde ve tm alt dizinlerdeki dosyalar grntler.\n /B         Yaln biimi kullan (balk bilgisiz ve zetsiz).\n /L         Kk harf kullanr.\n /Y or /4   Seneyi 4 sayyla gsterir.\n\nAnahtarlar DIRCMD ortam deikeninde nayarlanabilir. nayarl anahtarlar\nherhangi bir anahtar - (tire) neki ile geersiz klabilir--mesela /-W.\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nHarici DOSKEY yardmc program FreeCOM'a dahil edilmitir.\nYUKARI ve AAI dmeleri ile tariheyi geri alabilir ve HISTORY ile\ngrntleyebilirsiniz. SOL, SA ve END ile HOME dmeleriyle komut satrnda\ngezinebilir ve INSERT ile ekleme veya zerine yazma kipine geebilirsiniz.\nTAB tuu ile gncel szc dosya ad olarak tamamlayabilir; iki kez basarak\ntm denkleen dosyalar gsterebilirsiniz.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nKomut satrn dzenler, geri alr ve makro oluturur\n\nDOSKEY [/anahtar ...] [makroad=[metin]]\n\n  /BUFSIZE:boyu\tMakro ve komut arabellei boyutunu ayarla (ntanml:512)\n  /ECHO:on|off  Makro genileme yazmn a/kapat (ntanml:ak)\n  /FILE:dosya   Makro listesi ieren dosya belirt\n  /HISTORY      Bellekte muhafaza edilen tm komutlar grntle\n  /INSERT       Yeni karakterleri dmesine basldnda ekle\n  /KEYSIZE:boy. Klavyenin type-ahead arabellei boyutu (ntanml:15)\n  /LINE:boyut   Satr dzenleme arabelleinin azami boyutu (ntanml:128)\n  /MACROS       Tm DOSKEY makrolarn grntle\n  /OVERSTRIKE   Yazarken yeni karakterleri satrn zerine yaz (ntanml)\n  /REINSTALL    Yeni bir DOSKEY kopyas kur\n  makroad      Oluturduunuz makro iin bir ad belirt\n  metin         Makroya atamak istediiniz komutlar belirt\n\n  YUKARI, AAI oklar komutlar geri alr\n      Esc gncel komutu temizler\n       F7 komut tarihesini grntler\n   Alt+F7 komut tarihesini temizler\n[karak]F8 [karak] ile balayan komutlar arar\n       F9 sayyla bir komut seer\n  Alt+F10 makro tanmlamalarn temizler\n\nAadakiler DOSKEY makro tanmlamalarnda kullanabileceiniz zel kodlardr:\n  $T     Komut ayrc: makroda birden ok komuta izin verir\n  $1-$9  toplu i parametreleri: toplu i programlarnda una eittir: %1-%9\n  $*     Komut satrnda makro adndan sonra her ey yerine geen sembol\n.\n\n:TEXT_CMDHELP_ECHO\nleti grntler veya komut yanksn etkinletirir veya devre d brakr.\n\n  ECHO [ON | OFF]\n  ECHO [ileti]\n\nGncel echo ayarn grntlemek iin parametresiz ECHO yazn.\n.\n\n:TEXT_CMDHELP_EXIT\n/P ile yklenmediyse FreeDOS komut kabuunu sonlandrr.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\nBelirtilen komutu bir dosya kmesindeki her dosya iin altrr.\n\nFOR %%deiken IN (kme) DO komut [komut-parametreleri]\n\n  %%deiken\tDeitirilebilir bir parametre belirtir.\n  (kme)     \tBir/birden ok dosya kmesi belirtir. Joker kullanlabilir.\n  komut      \tHer dosya iin altrlacak komutu belirtir.\n  komut-parametreleri\n             \tBelirtilen komut iin parametre veya anahtar belirtir.\n\nFOR komutunu bir toplu i betiinde kullanmak iin %%deiken yerine\n%%%%deiken kullann.\n\nrnein:\n  FOR %%%%f IN (---balang--- a*.* ---son---) DO ECHO - %%%%f -\n.\n\n:TEXT_CMDHELP_GOTO\nKomut kabuunu bir toplu i betiinde etiketli bir satra ynlendirir.\n\nGOTO etiket\n\n  etiket\tToplu i betiinde etiket olarak kullanlan bir metin belirtir.\n\nEtiket bir satra kendi bana iki nokta ile balayarak yazabilirsiniz.\n.\n\n:TEXT_CMDHELP_HISTORY#1\nHistory komutu\n\nHISTORY [boyut]\n\n\"Boyut\" yazlmadysa komut satrnn tarihe arabelleinin gncel ierikleri\ngrntlenir.\nBoyut ile tarihe arabelleinin boyutu deitirilir.\n.\n\n:TEXT_CMDHELP_IF\nToplu i programlarnda koullu ilemleri yerine getirir.\n\nIF [NOT] ERRORLEVEL say komut\nIF [NOT] dize1==dize2 komut\nIF [NOT] EXIST dosyaad komut\n\n  NOT\t\t\tKomut kabuunun komutu yalnzca koul yanl ise\n                    \taltrmas gerektiini belirtir.\n  ERRORLEVEL number \tSon altrlan program belirtilene eit veya ondan\n                    \tyksek bir k kodu geri gnderdiyse doru koul\n                    \tbelirtir.\n  komut             \tEer koul karlandysa altrlacak komutu\n                    \tbelirtir.\n  dize1==dize2      \tBelirtilen metin dizeleri eleiyorsa doru bir koul\n                    \tbelirtir.\n  EXIST dosyaad\tBelirtilen dosya ad mevcutsa doru bir koul\n                    \tbelirtir.\n.\n\n:TEXT_CMDHELP_LFNFOR\nFOR komutu veya dosya ad tamamlamas iin uzun adlar etkinletir/devre d.\nLFNFOR [ON | OFF]\nLFNFOR COMPLETE [ON | OFF]\n\nGncel LFNFOR ayarn grntlemek iin parametresiz LFNFOR veya LFNFOR\nyazn.\n.\n\n:TEXT_CMDHELP_LH\nBir program st bellek alanna ykler.\n\nLOADHIGH [src:][yol]dosyaad [parametreler]\nLOADHIGH [/L:alan1[,minboyut1][;alan2[,minboyut]...] [/S]]\n         [src:][yol]dosyaad [parametreler]\n\n/L:alan1[,minboyut1][;alan2[,minboyut2]]...\n            Programn yklenecei bellek alanlarn belirtir. Alan1\n            ilk bellek alannn saysn belirtir; minboyut1 alan1 iin\n            varsa asgari boyutu belirtir. Alan2 ve minboyut2 varsa ikinci\n            alann saysn ve asgari boyutunu belirtirler. stediiniz kadar\n            alan belirtebilirsiniz.\n\n\n/S          Program yklenirken bir UMB'yi en kk boyutuna kltr.\n\n\n[src:][yol]dosyaad\n            Programn konumunu ve adn belirtir.\n.\n\n:TEXT_CMDHELP_LOADFIX\nBir program bellein ilk 64K'snn zerine ykler ve onu altrr.\n\nLOADFIX [src:][yol]dosyaad\n\nBir program Aa bellee yklerken \"Paketlenmi dosya bozuk\" iletisini\naldysanz program LOADFIX kullanarak ykleyin.\n.\n\n:TEXT_CMDHELP_MD\nDizin oluturur.\n\nMKDIR [src:]yol\nMD [src:]yol\n.\n\n:TEXT_CMDHELP_PATH\naltrlabilir dosyalar iin arama yolu grntler veya ayarlar.\n\nPATH [[src:]yol[;...]]\nPATH ;\n\nTm arama yolu ayarlarn temizlemek ve komut kabuunu yalnzca\ngncel dizinde arama yapmaya ynlendirmek iin PATH ; yazn.\nGncel yolu grntlemek iin parametresiz PATH yazn.\n.\n\n:TEXT_CMDHELP_PAUSE\nBir toplu i betiinin ileyiini duraklatr ve aadaki iletiyi grntler:\n\"Srdrmek iin herhangi bir dmeye basn....\" veya baka bir ileti.\n\nPAUSE [ileti]\n.\n\n:TEXT_CMDHELP_PROMPT\nKomut istemini deitirir.\n\nPROMPT [metin]\n\n  metin   Yeni bir komut istemi belirtir.\n\nstem normal karakterlerden ve aadaki zel kodlardan oluturulabilir:\n\n  $Q   = (eit iareti)\n  $$   $ (dollar karakteri)\n  $T   Gncel zaman\n  $D   Gncel tarih\n  $P   Gncel src ve yol\n  $V   FreeDOS komut kabuunun srm numaras\n  $N   Gncel src\n  $G   > (byktr iareti)\n  $L   < (kktr iareti)\n  $B   | (kanal (pipe))\n  $H   Geri tuu (nceki karakteri siler)\n  $E   Ka dizgesi (ASCII kodu 27)\n  $_   Satr ba ve satr besleme\n\nstemi varsaylan deere geri almak iin parametresiz PROMPT yazn.\n.\n\n:TEXT_CMDHELP_PUSHD\nGncel dizini dizin ynnn zerine iter ve gncel alan dizini deitirme\nseenei sunar.\n\nPUSHD [[src:]yol]\n  [src:]yol deiip eskisinin yerine geecek yoldur.\n.\n\n:TEXT_CMDHELP_POPD\nDizin ynndan bir dizini grntler ve ayar ona deiir.\n\nPOPD [*]\n  '*' parametresi dizin ynn temizler.\n.\n\n:TEXT_CMDHELP_DIRS\nDizin ynnn ieriklerini grntler.\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\nBo bir dizini kaldrr (siler).\n\nRMDIR [src:]yol\nRD [src:]yol\n.\n\n:TEXT_CMDHELP_REM\nYorumlar bir toplum i dosyasna veya CONFIG.SYS dosyasna kaydeder.\n\nREM [yorum]\n.\n\n:TEXT_CMDHELP_REN\nBir dosya/dizini veya dosyalar/dizinleri yeniden adlandrr.\n\nRENAME [src:][yol][dizinad1 | dosyaad1] [dizinad2 | dosyad2]\nREN [src:][yol][dizinad1 | dosyaad1] [dizinad2 | dosyaad2]\n\nUnutmayn ki hedefiniz iin yeni bir src veya yol belirtemezsiniz. Bunun\niin MOVE komutunu kullann.\n.\n\n:TEXT_CMDHELP_SET#1\nOrtam deikenlerini grntler, ayarlar veya kaldrr.\n\nSET [/C] [/P] [/E] [/U] [deiken[=[dize]]]\n\n  deiken  Ortam deikeninin adn belirtir.\n  dize      Deikene atanacak karakter serisini belirtir.\n\n* Eer hibir dize belirtilmediyse, deiken ortamdan kaldrlr.\n\nGncel ortam deikenlerini grntlemek iin parametresiz SET yazn.\n\nVAR deikeninin deerini grntlemek iin SET VAR kullann\n\n/C deikenin harf trnn (byk-kk) korunmasn zorlar; varsaylan deer\nolarak deiken zaten ortamda konumlanmam ise byk harflidir, yoksa\nharf tr muhafaza edilir.\n\n/P dize ile kullanc istemi gsterir ve kullanc girdisini deikene atar.\n\n/E [dize] tarafndan iaret edilen komutun ktsnn ilk satrna verilen\ndeikeni ayarlar.\n\n/U [dizenin] harf trn byk harf olarak ayarlar.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nBir toplu i dosyasnda deitirilebilir parametre konumunu deitirir.\n\nSHIFT [DOWN]\n\nDOWN argman penceresini baa doru kaydrr (%%0); yoksa sona doru kaydrr.\n\n.\n\n:TEXT_CMDHELP_TIME#1\nSistem zamann grntler veya ayarlar.\n\nTIME [/T] [zaman]\n\nGncel zaman grmek ve yeni zaman girmek iin istem almak amacyla\nparametresiz TIME yazn. Ayn zaman muhafaza etmek iin ENTER dmesine basn.\n\n/T TIME komutunun etkileimli olmasna mani olur.\n.\n\n:TEXT_CMDHELP_TRUENAME\nBelirtilen yolun tam yol adn grntler.\n\nTRUENAME [src:][yol][dosyaad]\n.\n\n:TEXT_CMDHELP_TYPE\nMetin dosyalarnn ieriklerini grntler.\n\nTYPE [src:][yol]dosyaad\n.\n\n:TEXT_CMDHELP_VER\nFreeDOS komut kabuu srmn ve baka bilgiler grntler.\n\nVER [/R] [/W] [/D] [/C]\n\n /R         ekirdek srm ve baka bilgiler grntler.\n /W         FreeDOS komut kabuu garantisi.\n /D         FreeDOS komut kabuu yeniden datm bilgileri.\n /C         FreeDOS komut kabuu itirakileri.\n.\n\n:TEXT_CMDHELP_VERIFY\nFreeDOS dosya sisteminin dosyalarn diske doru bir ekilde yazlp\nyazlmadklarn denetleyip denetlemeyeceini belirtir.\n\nVERIFY [ON | OFF]\n\nGncel VERIFY ayarn grntlemek iin parametresiz VERIFY yazn.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nEer hata ayklama FreeDOS'la derlendiyse bu komut hata ayklama ktsn\nap kapatacak veya size ak veya kapal olduunu gsterecektir.\n\nFDDEBUG [ON | OFF | dosya]\n\nGncel hata ayklama kt ayarn grntlemek iin parametresiz FDDEBUG\nyazn.\nEer bir dosya belirtildiyse tm hata ayklama kts bu dosyaya\nynlendirilecektir, kt dosya mevcutsa dosyaya eklenecektir. \"stdout\" ve\n\"stderr\" zel adlar kty standart ktya veya standart hata akna\nyeniden ynlendirmek iin kullanlabilir.\n.\n\n:TEXT_CMDHELP_VOL\nVarsa disk birim etiketi ve seri numarasn grntler.\n\nVOL [src:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nKabukta bulunan komutlar ve zelliklerin listesini grntler.\n\n?\n?komut [bamsz-deiken]\n\nlk biim tm mevcut dahili komut ve zellikleri grntler.\nkinci biimse sanki izleme kipi etkinmi gibi belirtilen komutun\naltrlmasn isteyip istemediinizi soracaktr.\n.\n\n:TEXT_CMDHELP_WHICH\nHer belirtilen komut iin altrlabilir dosyas arar ve grntler.\n\nWHICH komut...\n.\n\n:TEXT_CMDHELP_MEMORY#1\nFreeCOM tarafndan isel olarak kullanlan dahili bellei grntler.\n\nMEMORY\n\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\nCOPY hedefi art ('+') karakterini iermemelidir.\n.\n\n:TEXT_DELETE_FILE#1%\n\"%s\" dosyas siliniyor.\n.\n\n:TEXT_ERROR_WRITE_FILE_DISC_FULL#0%\n'%s' dosyasna yazlamad;\nDisk dolu olabilir mi? (%lu bayt gerekli)\n.\n\n# Displayed for BIGcopy(), when copying takes quite a long time.\n# **_NO_END if the input file size is unknown.\n# Both must end in \\r rather than \\n!!\n:TEXT_COPY_COPIED_NO_END#0%\n%luKB/???KB kopyaland\\r\\\n.\n:TEXT_COPY_COPIED#0%\n%luKB/%luKB kopyaland\\r\\\n.\n\n:TEXT_ERROR_FCOM_IS_DEVICE#0%\nFreeCOM bir aygt olamaz: \"%s\"\n.\n:TEXT_ERROR_FCOM_INVALID#0%\nBu dosya geerli bir FreeCOM deil veya uyumsuz bir srmn dosyas:\n%s\n.\n\n:TEXT_ERROR_LOADING_STRINGS\nDize kaynaklar bellee yklenemedi, %COMSPEC% gesine iaret edilen konum\ngeersiz gibi grnyor. Ltfen FreeCOM iin baka bir konum belirtin ki\ndizeler bu konumdan yklenebilsinler, mesela:\nC:\\\\COMMAND.COM\nveya dizelerin yklenmesini iptal etmek iin Enter dmesine basn.\n.\n\n:TEXT_TERMINATING\nSonlandrlyor.\n.\n\n:TEXT_HIDDEN_CRITER#0%\n%u Kritik Hata talebi ortadan kaldrld.\n.\n\n# The exit reasons MUST be kept in this order!\n:TEXT_DISP_EXITCODE#0%\nk kodu (ERRORLEVEL): %u, sebep: %u (%s)\n.\n:TEXT_EXIT_REASON_NEG_1\nDOS API hatas\\\n.\n:TEXT_EXIT_REASON_0\nnormal bir ekilde sonland\\\n.\n:TEXT_EXIT_REASON_1\n^Break tarafndan sonlandrld\\\n.\n:TEXT_EXIT_REASON_2\nkritik bir hata tarafndan sonlandrld\\\n.\n:TEXT_EXIT_REASON_3\nyerleik oldu\\\n.\n:TEXT_ERROR_EXE_CORRUPT\nEXE dosyas hasarl\\\n.\n"
  },
  {
    "path": "strings/ukr.err",
    "content": "# Hello \n"
  },
  {
    "path": "strings/ukr.lng",
    "content": "# $Id$\n#\n# FreeCOM national customization file\n#\n#       Language: Ukrainian\n#       Codepage: DOS-866\n#       Author:   FreeWolle Voluntary\n# \n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retreive the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#\t:TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carrage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause an user interaction. Those ones should be in sync\n# with the issued text. To define how to interprete a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#YyNn\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceeding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the question\n# mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readibility of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH\n ६. - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH\n ६. - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION\nࠢ쭮  : '%s'\n.\n\n:TEXT_ERROR_OPT_ARG\n '%s'    㬥\n.\n\n:TEXT_ERROR_OPT_NOARG\n '%s' ॡ  㬥\n.\n\n:TEXT_INVALID_NUMBER\n '%s'   ᫮\n.\n\n:TEXT_ERROR_CLOSE_QUOTE\n ਢ : %c\n.\n\n:TEXT_ERROR_TEMPFILE\n ⢮ ⨬ᮢ 䠩\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR\n ࠬ. - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\n ࠬ.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER\n ࠬ. - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\n  .\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\n  .\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND\n  . - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING\n  '離 ࠬ.\n.\n\n:TEXT_ERROR_INVALID_DRIVE\nࠢ쭮   %c:.\n.\n\n:TEXT_ERROR_BADCOMMAND#2\nࠢ쭮    ' 䠩 - \"%s\".\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\n' ௠.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\n  ' १ DOS.\n.\n\n:TEXT_ERROR_CANNOTPIPE\n ७ࠢ!   ⨬ᮢ 䠩!\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE\n冷 #%ld   䠩 '%s' .\n.\n\n:TEXT_ERROR_BFILE_VANISHED\n 䠩 '%s'  .\n.\n\n:TEXT_ERROR_BFILE_LABEL\n 䠩 '%s'   ⪨ '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1\n%s   '%s'.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR\n ⠭ 祭  祭 '%s'.\n୥ ९ '   祭.\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND\n 祭 '%s'  .\n.\n:TEXT_ERROR_NO_ENVIRONMENT\n  '   祭.  '.   /E  .\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1\n ⠭ ᥢ '%s'. ୥ ௠ '  ᥢ.\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1\nᥢ '%s'  .\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\n௠ '  ᥢ.\n.\n\n:TEXT_ERROR_SYNTAX_STR\n⠪筠 . - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\n⠪筠 .\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG\n ' 䠩. - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY\n ᪮ '%s'  ᥡ\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\n  冷  ஧७ ᥢ!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\n 冷.   .\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1\n୨ '   '%s'.\n.\n\n:TEXT_HISTORY_EMPTY#1\n  .\n.\n\n\n:TEXT_ERROR_BAD_MCB_CHAIN\n誮  MCB  ᭠  MS-DOS ⥬.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR\n  %d.\n.\n\n:TEXT_ERROR_REGION_WARNING\n誮 ﭪ ' %d 㫠 ய饭.\n.\n\n:TEXT_ERROR_ON_OR_OFF\n   ON  OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\n  .\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR:  IN.\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\n    㦪.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR:  DO.\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR:     DO.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE\n ७ࠢ   䠩 '%s'.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE\n ७ࠢ   䠩 '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\n ७ࠢ.\n.\n\n:TEXT_ERROR_INVALID_DATE\nࠢ쭮  .\n.\n\n:TEXT_ERROR_INVALID_TIME\nࠢ쭮  .\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\n  ⪨  GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\n CTTY 祭  쮣 COMMAND.COM.\n.\n\n:TEXT_ERROR_NORW_DEVICE\n誮  ⠡쭨/  '%s'.\n.\n\n:TEXT_ERROR_CTTY_DUP\n  㢠 䠩  TTY '%s'.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\n/L  ਬ.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\n/U  ਬ.\n.\n\n:TEXT_ERROR_WRITING_DEST\n   ਩.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE\n  ५. - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE\n  䠩 '%s'\n.\n\n:TEXT_ERROR_READ_FILE\n ⠭  䠩 '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE\n   䠩 '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\n'㢠쭨 ᨬ '+'   室 । 㬥⠬.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\n'㢠쭨 ᨬ '+'   室  㬥.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\n箣 ஡!\n.\n\n:TEXT_ERROR_COPY\n COPY\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST:   ' 䠩\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL:   ᫮\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL:   ᫮\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF:   \n.\n\n:TEXT_NOT_IMPLEMENTED_YET\n...  ॠ.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\n ⠦   '.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\n /MSG 祭  쮣 COMMAND.COM.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1\nࠦ %u 㭪.\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\n誮  浪.     \n '易  㢠 COMMAND.COM. -᪠,     .\n.\n\n:TEXT_QUOTED_C_OR_K#1\n /C  /K      , ⮬  㢠.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1\n  COMMAND.COM    !\n 楩   㪢    ஧稭   \n᪨, ਪ: C:\\\\FDOS\n\n COMMAND.COM ਩ :\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nଠ       -   㢠\n㫨 祭.  ᭥ 稭   ஠ ।\n  .\n.\n\n:TEXT_ERROR_SAVE_SESSION\nଠ      ०   ணࠬ.\n ᭥ 稭   ஠ ।  \n.\n.\n\n:TEXT_ERROR_CWD_FAILED\n %c:    ௠  '.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\n 㢠:   '  ᥢ.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\n 㢠:    '.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\n௠ ஡箣  '  ᥢ.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1\nᥢ: '%s'   ࠢ쭨\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\n ⠢ﭭ ᥢ.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1\n'%s' -  ' ᥢ.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\n ⠦ ⥪⭮   ஡ 筨 .\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\n௠ '  ⥪.\n   ⨬, ஡    \n, ⠪ - ஧    浪, ⥪ , .\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1\n ⥪  %lu  ॢ ࠭筨 .\n ஧ ⥪  %u .\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\n  ᭮ ଠ  ⥪.   \n 誮 '   ࠢ쭮  쭨 ஧\n⥪. -᪠,     ஧஡ FreeCOM :\nfreedos-devel@lists.sourceforge.net\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\n⥪ 㫮 祭  㢠. ⥪  ⢮७, \n ᥢ, , 㫨 祭.\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\n -   த . . .\\\n.\n\n:TEXT_MSG_HISTORY_SIZE\n   浪 ᪫ %d .\n.\n\n:TEXT_MSG_DOSKEY\n DOSKEY    .\n.\n\n:TEXT_MSG_ECHO_STATE\n ECHO - %s\n.\n\n:TEXT_MSG_VERIFY_STATE\n VERIFY - %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE\n DEBUG - %s.\n.\n:TEXT_MSG_FDDEBUG_TARGET\n DEBUG 㪮  '%s'.\n.\n\n:TEXT_MSG_BREAK_STATE\n BREAK - %s\n.\n\n:TEXT_MSG_CURRENT_DATE\n筠 : %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1\n   (%s%s[]): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1\n   (%s%s[]): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1\n   ([]%s%s): \\\n.\n\n:TEXT_MSG_CURRENT_TIME\n筨 : %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\n  : \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1\nYyNn{CR}{LF}{CBREAK}\naabb   b   b       b\n 䠩  '%s' 㤥 饭!\n   ࠢ쭮 ᢮  (Y/N)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nYyNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [=ENTER, =ESC] ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#\tby \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1\nYyNnAaQq{LF}{CR}{CBREAK}{ESC}\naabbcccc   a   a       c    b\n Control-Break.\\r\nਯ   䠩 '%s' ((Y)/(N)/(A)) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1\nYyNnAaQq{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\n१ '%s' ((Y)/(N)/(A)/㯨(Q)) ? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1\nYyNnAaQq{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\n '%s' ((Y)/(N)/(A)/㯨(Q)) ? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\n⥪  ⨩.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1\n ⪠ ⮬ %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING\n %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\n  ⪨\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER\n   ⮬ - %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1\n%10s 䠩()\\\n.\n:TEXT_DIR_FTR_BYTES\n   %12s \n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\n 䠩:\n.\n:TEXT_DIR_FTR_DIRS#1\n%10s \\\n.\n:TEXT_DIR_FTR_BYTES_FREE\n %15s  쭮\n.\n:TEXT_DIR_DIRECTORY\n %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE\n  %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE\n%-13s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <> \\\n.\n:TEXT_DIR_LINE_SIZE#1\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1\n%-14s\\\n.\n\n:TEXT_MSG_PATH\n=%s\n.\n:TEXT_MSG_PATH_NONE#1\n    .\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\n\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\n\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\n\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\n\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\n\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\n\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\n\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\n䠩  饭.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\n 䠩 饭.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1\n%u 䠩() 饭.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\n㯭  :\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\n\n㯭 ஧७:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\n[ᥢ] \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\n[஧७ ] \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\n[] \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\n[襭  䠩] \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\n[窠] \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\n[⮪ 㢠] \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\n[⠭ ⥪] \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\n[窠 ] \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\n[窠 XMS] \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\n[窠  㢠] \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\n[ ] \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\n[DOS NLS] \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\n[⥪  (PUSHD)] \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\n[ FreeCOM] \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\n F8  㢠  F5  室 %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC\n '%s'.\n.\n\n:TEXT_MSG_VER_DOS_VERSION\n DOS %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\n FreeDOS (ઠ 1933  )\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS\n  FreeDOS %d.%d.%d\n.\n\n\n:TEXT_MSG_VER_WARRANTY\n쪥 ࠢ (C) 1994-2001  ଠ  .\n\n     ஧  ,   ⠭ , \n    ࠭  ,    ⨬;\n⠪    ࠭        ਤ \n⭮ .  ஡ﬨ ⠩  㡫筮 業\n.\n\n   ᨫ   freecom@fredos.org.\n 㯭  ⠦ :\nhttp://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_REDISTRIBUTION\n쪥 ࠢ (C) 1994-2001  ଠ  .\n\n     ணࠬ  쭨 ணࠬ 祭;   \n஧㢠  㢠  㬮,   㡫\n業   2 ( ), 㡫  쭮\nணࠬ 祭.\n\n   ᨫ   freecom@fredos.org.\n 㯭  ⠦ :\nhttp://freedos.sourceforge.net/freecom\n.\n\n:TEXT_MSG_VER_DEVELOPERS\n\n  FreeDOS ஧஡ 쬠 ஧஡; \n䠩 HISTORY.TXT.\n\n   쭨     䠭 \n(freedos-devel@lists.sourceforge.net).\n\n   ᨫ   freecom@fredos.org.\n 㯭  ⠦ :\nhttp://freedos.sourceforge.net/freecom\n.\n\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\n\n   ,  쪨  饭 \\r\n \"/P\",       १⠦.\\r\n'      ⨧筮 祭,\\r\n\"㡨\"    .\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\n㢠쭨  FreeCOM  .\n      COMMAND.COM\n 类 讣 㬥   COMMAND,\nਪ:\nC:\\\\FDOS\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1\n 祭    :  %5u ; 쭮 %5u \n.\n:TEXT_MEMORY_CONTEXT#1\n ⥪        :  %5u bytes; 쭮 %5u \n.\t\n:TEXT_MEMORY_HEAP#1\n'                   : 쭮 %5lu \n.\n:TEXT_MEMORY_CTXT_ALIAS#1\n\\tᥢ        :  %5u , ࠧ %5u , %5u \n.\n:TEXT_MEMORY_CTXT_HISTORY#1\n\\t        :  %5u , ࠧ %5u , %5u \n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1\n\\t⥪ ४:  %5u , ࠧ %5u , %5u \n.\n:TEXT_MEMORY_CTXT_LASTDIR#1\n\\t窠 ⠭ ⥪ : ⮢  %5u , %5u \n.\n:TEXT_MEMORY_CTXT_BATCH#1\n\\t   䠩  : ⮢  %5u , %5u \n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1\n\\tଠ  㢠       : ⮢  %5u , %5u \n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\n ਬ 筮    ⥬.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\n  筮  .\n.\n:TEXT_DISPLAY_CODEPAGE#1\n筠   is %u.\n⥬  : %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nࠦ,   饭 ᥢ.\n\nALIAS [[=][冷]]\n\n            ᥢ.\n        冷      ᨬ - 祭 ᥢ.\n\n\n ALIAS  ࠬ  ࠦ  ᥢ.\n.\n\n:TEXT_CMDHELP_BEEP\n 㪮 ᨣ १ .\n.\n\n:TEXT_CMDHELP_BREAK\n⠭   ஧७ ஫ ᭥ CTRL+C.\n\nBREAK [ON | OFF]\n\n BREAK  ࠬ   筮  BREAK.\n.\n\n:TEXT_CMDHELP_CALL#1\n  䠩  讣  䠩.\n\nCALL [/S | /N] [/Y] [:][]' 䠩 [㬥]\n\n  㬥          - 㬥,  ॡ \n                      䠩.\n  /S । , /N ஭ 㢠  FreeCOM.\n  /Y 祭 ० 㢠    䠩.\n.\n\n:TEXT_CMDHELP_CD\nࠦ  筮 ⥪   筮 ⥪  .\n\nCHDIR [:][]\nCHDIR[..]\nCD [:][]\nCD[..]\nCD -\n\n  ..     ⥪ 鮣 .\n  -     ஧७ \"⠭ ⥪\" 祭,  ⥪  ⠭  ⥪ .\n\n CD :  ࠦ 筮 ⥪   .\n CD  ࠬ  ࠦ 筮   ⥪.\n ⠪  CDD\n.\n\n:TEXT_CMDHELP_CDD\nࠦ  筮 ⥪   筮 ⥪  .\n\nCDD [:][]\nCD[..]\nCD -\n\n  ..     ⥪ 鮣 .\n  -     ஧७ \"⠭ ⥪\" 祭,  ⥪  ⠭  ⥪ .\n\n  ,   筮 ;   \n  \"CHDIR\".\n.\n\n:TEXT_CMDHELP_CHCP\nࠦ   筮  .\n\nCHCP [nnn]\n\n  nnn     .\n\n CHCP  ࠬ  ࠦ 筮  .\n.\n\n:TEXT_CMDHELP_CLS\n饭 ࠭.\n\nCLS\n.\n\n:TEXT_CMDHELP_COMMAND\n     FreeDOS.\n\nCOMMAND [[:]] [] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG]\n                       [/LOW] [/Y [/[C|K] ]]\n  [:]       䠩 COMMAND.COM.\n          ,  ⮢㢠⨬  /.\n  /E:nnnnn        ⠭ ⪮ ஧ । 祭\n                   nnnnn  (᫮ nnnnn    256  32768).\n  /L:nnnn         ⠭ ஧    nnnn \n                  (  ࠧ ॡ  ࠧ   /P).\n                  ᫮ nnnn    128  1024.\n  /U:nnn           ஧   (  ࠧ ॡ\n                   ࠧ   /P). ᫮ nnn    128  255.\n  /P              ଠ⭨  (  室  ).\n  /MSG            ०     (  ࠧ\n                  ॡ  ࠧ   /P).\n  /LOW             ஧饭 १⭮ ⨭ COMMAND.COM  \n                   '.\n  /Y              祭 ० 㢠   䠩, \n                  ᪠⨬   /C  /K.\n  /C             .\n  /K           訬 த\n                   .\n.\n\n:TEXT_CMDHELP_COPY\n     蠡 䠩   ਩.\n\nCOPY [/A | /B] ५ [/A | /B] [+ ५ [/A | /B] [+ ...]] [਩\n  [/A | /B]] [/V] [/Y | /-Y]\n\n  ५        䠩  .\n  /A              ASCII (⥪⮢) 䠩.\n  /B               ⥪⮢ 䠩 (୨ 䠩).\n  ਩      ' ⥪ /  '/ ᪮ 䠩.\n  /V           ॢઠ ࠢ쭮 .\n  /Y              ⢥द १  䠩\n                ਩.\n  /-Y           ⢥द  १  楢 䠩.\n\n६ /Y      祭 COPYCMD,  \n   祭 COPYCMD ६ /Y   \n ६ /-Y   浪.\n\n ' 䠩    楢 䠩  \n쪮 䠩-५,  蠡     \n浪   ⠫: 䠩-५1+䠩-५1+䠩-५3.\n.\n\n:TEXT_CMDHELP_CTTY\n -,  ᮢ    浪 \nࠦ  쮬 .\n\nCTTY \n\n     쭨   /, ᪠, 1.\n.\n\n:TEXT_CMDHELP_DATE#1\nࠦ 筮    .\n\nDATE [/D] []\n\n DATE  ࠬ  ࠦ 筮   \n   .  ० ⠭   \nENTER    .\n\n/D  筮       .\n.\n\n:TEXT_CMDHELP_DEL#2\n饭  祭    蠡 䠩.\n\nDEL [:][]' 䠩 [/P] [/V]\nERASE [:][]' 䠩 [/P] [/V]\n\n  [:][]' 䠩       䠩  饭.  \n                                 䠩  饭\n                              ⮢ 蠡  䠩.\n  /P       ⢥द   㢠 䠩.\n  /V    ࠦ  饭 䠩.\n.\n\n:TEXT_CMDHELP_DIR#4\nࠦ ᯨ 䠩   筮 ⥪.\n\nDIR [:][][' 䠩] [/P] [/W] [/A[[:]ਡ]]\n  [/O[[:]㢠]] [/S] [/B] [/L]\n\n [:][][' 䠩]   ,  /  䠩  ࠦ.\n                             (   ஧७ ᯥ 䠩\n                              蠡  ࠦ㢠  ᯨ 䠩).\n /P         㧠  ࠦ   ࠭.\n /W         ᫨ ଠ  ᯨ 䠩.\n /A         ࠦ 䠩   ਡ ( 㢠\n              /ADHSRA).\n ਡ    D                         R  쪨  ⠭\n             H  客 䠩               A    \n             S  ⥬ 䠩              -  稩 \n /O          ᯨ 䠩   ० 㢠.\n 㢠  N    (䠢⭨)       S   ஧ (稭  )\n             E   ஧७ (䠢⭨)  D      (稭 \n                                               )\n             G   ⥪                 -   ॢ\n             U   㢠               㢠 \n                                             /ONG\n /S         ࠦ 䠩  ⥪    ⠫.\n /B          ᯨ   ⪮ ଠ.\n /L           쮬 ॣ.\n /Y  /4    ਧ筮 ଠ 祭 ப.\n\n६      祭 DIRCMD,  ६,\n   浪,  騩 ਮ,    \n祭 DIRCMD.    -类      祭\n६     ६   浪  ᮬ\n\"-\", ਪ /-W.\n.\n\n:TEXT_CMDHELP_DOSKEY#1\n ⨫ DOSKEY 㤮  FreeCOM.\n ६饭  㢥      冷 ࠭\n㢥    .\n ६饭  , ࠢ,  ⠪  HOME  END\n ६   筮  浪 , ࠢ,\n ⮪   .  INSERT  ६ ०\n⠢/१ ᨢ  ।㢠  浪.\n TAB  㢥 ᫮ 宦  䠩  筮 ⥪;\n ᭥  TAB ࠦ  ࠭ ᯨ᮪  㯭 \n  䠩.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\n㢠  浪, ࠤ ࠭ 㢥  浪 \n ,  ⠪ ⢮७ .\n\nDOSKEY [/६ ...] [' =[⥪]]\n\n  /BUFSIZE:஧ ⠭ ஧    ⠪  \n                   ( 㢠 512 )\n  /ECHO:on|off    ࠦ    ( 㢠 on)\n  /FILE:䠩       䠩  ᯨ᪮ \n  /HISTORY        ࠦ ०  '   浪\n  /INSERT          ⠢  ।㢠  浪\n  /KEYSIZE:஧ ⠭ ୮  ( 㢠 15 )\n  /LINE:஧        浪 ( 㢠\n                  128 )\n  /MACROS         ࠦ   DOSKey\n  /OVERSTRIKE      १  ।㢠  浪\n                  (⮢  㢠)\n  /REINSTALL      ୨  DOSKey\n  '     ' ⢮ \n  ⥪           (/)  ᢮ \n\n  UP,DOWN   ॣ   浪\n      Esc   饭 筮  浪\n       F7   ࠦ   浪\n   Alt+F7   饭   浪\n[ᨬ]F8     浪 , 猪 ஧稭 \n             ᨬ [ᨬ]      冷\n       F9      冷     \n            浪      浪\n  Alt+F10   ࠭ ⢮७ \n\n㯭       DOSKey:\n  $T      , 直  ⠢ 쪠   \n         冷\n  $1-$9   㬥   浪 -  ᠬ,   %1-%9  \n         䠩\n  $*      ⥪⮬,       浪\n.\n\n:TEXT_CMDHELP_ECHO\nࠦ   ६ ࠦ   ࠭ \n    䠩.\n\n  ECHO [ON | OFF]\n  ECHO []\n\n ECHO  ࠬ  ࠦ 筮  ࠦ\n   䠩  ࠭    .\n.\n\n:TEXT_CMDHELP_EXIT\n    FreeDOS.\n\nEXIT\n.\n\n:TEXT_CMDHELP_FOR\n    祭  ࠧ   䠩.\n\nFOR %% IN () DO  [ࠬ]\n\n  %%    ⠢ ࠬ\n  ()      ᯨ᮪  쪮  䠩.  ⮢㢠\n             蠡  䠩.\n      , 猪 ⨬    䠩 .\n  ࠬ  ࠬ  ६     䠩 .\n\n   FOR   䠩   %% \n%%%%.\n.\n\n:TEXT_CMDHELP_GOTO\n      䠩.\n\nGOTO ⪠\n\n  ⪠    (  ᨬ) - ' ⪨.\n\n' ⪨ ஧稭  ࠯ (\":\").\n.\n\n:TEXT_CMDHELP_HISTORY#1\n  浪.\n\nHISTORY [஧]\n\n  ஧    ஧    浪.\n\n HISTORY  㬥  ࠦ   浪.\n.\n\n:TEXT_CMDHELP_IF\n ॢઠ.\n\nIF [NOT] ERRORLEVEL ᫮ \nIF [NOT] 冷1==冷2 \nIF [NOT] EXIST ' 䠩 \n\n  NOT                筮 祭 (  \n                     ⮬ ࠧ,  祭 㬮 ⨭).\n  ERRORLEVEL ᫮   ⨭   祭  ணࠬ\n                    ⨬     .\n             , 猪 㢠⨬   祭\n                    १ 㬮.\n  冷1==冷2     ⨭  ⥪   浪 ⮦.\n  EXIST ' 䠩   ⨭  ࠧ,  祭 䠩 .\n.\n\n:TEXT_CMDHELP_LH\n⠦ ணࠬ   '.\n\nLOADHIGH [:][]' 䠩 [ࠬ]\nLOADHIGH [/L:1[,쭨஧1][;2[,쭨஧2]...]\n         [/S]] [:][]' 䠩 [ࠬ]\n\n/L:1[,쭨஧1][;2[,쭨஧2]...\n             ⥩ '  ⠦ ணࠬ.\n            1 -   '  ணࠬ;\n            쭨஧1 - 쭨  ஧ \n             '. 2 - 㯭  ' \n            ணࠬ; 쭨஧2 - 쭨  ஧\n              '.  ॡ    -猪\n             ⥩ '  祭 쭨 ஧஬ \n            ﭮ ',     ⠦㢠 ணࠬ.\n/S          譥 ஧ UMB  㬠  ⠦ ணࠬ.\n[:][]' 䠩\n            ணࠬ  ⠦.\n.\n\n:TEXT_CMDHELP_LOADFIX\n⠦ ணࠬ    訬 64   '.\n\nLOADFIX [:][]' 䠩\n\nᮢ  LOADFIX  ⠦ ணࠬ,  \n  : \"Packed file corrupt\" - \" 䠩\n誮\"  ஡ ⠦ ணࠬ   '.\n.\n\n:TEXT_CMDHELP_MD\n⢮७  ⥪.\n\nMKDIR [:]\nMD [:]\n.\n\n:TEXT_CMDHELP_PATH\nࠦ  ⠭   㢠쭨 䠩.\n\nPATH [[:][;...]]\nPATH ;\n\n PATH ;  饭       \n㢠쭨 䠩 筮   .  PATH  ࠬ\n ࠦ 筮  .\n.\n\n:TEXT_CMDHELP_PAUSE\nਧ㯨   䠩     :\n\" -   த....\"   .\n\nPAUSE []\n.\n\n:TEXT_CMDHELP_PROMPT\n  襭  浪.\n\nPROMPT [⥪]\n\n  ⥪     襭  浪.\n\n襭     -直 訬 ⥪⮬ ᯥ\nࠢ  ᨬ:\n\n  $Q   = ( \"\")\n  $$   $ (ᨬ )\n  $T   筨 \n  $D   筠 \n  $P   筨   \n  $V      FreeDOS\n  $N   筨 \n  $G   > ( \"\")\n  $L   < ( \"\")\n  $B   | (㡠; ७ࠢ)\n  $H    Backspace (饭 ।쮣 ᨬ)\n  $E    Escape (ASCII  27)\n  $_      冷  ୥ ⪨\n\n PROMPT  㬥  ⠭ 祭 襭 \n㢠.\n.\n\n:TEXT_CMDHELP_PUSHD\n 筮 ⥪  ⥪   ⠪    ⥪.\n\nPUSHD [[:]]\n   [:] - ,  直     ⥪.\n.\n\n:TEXT_CMDHELP_POPD\nਬ ⥪  ⥪     .\n\nPOPD [*]\n    㬥 '*'  饭 ⥪ .\n.\n\n:TEXT_CMDHELP_DIRS\nࠦ  ⥪ .\n\nDIRS\n.\n\n:TEXT_CMDHELP_RD\n饭 ⥪.\n\nRMDIR [:]\nRD [:]\n.\n\n:TEXT_CMDHELP_REM\n    䠩   䠩 CONFIG.SYS.\n\nREM []\n.\n\n:TEXT_CMDHELP_REN\n३㢠 䠩/⥪  䠩/.\n\nRENAME [:][][⥪1 | ' 䠩1] [⥪2 | ' 䠩2]\nREN [:][][⥪1 | ' 䠩1] [⥪2 | ' 䠩2]\n\n ३㢠 ⨬  訩    - ਩.\n ७ᥭ 䠩  訩    訩  ⮢\n MOVE.\n.\n\n:TEXT_CMDHELP_SET#1\nࠦ,   饭  祭.\n\nSET [/C] [/P] [=[冷]]\n\n    '  祭.\n  冷    ᨬ - 祭 .\n\n*       祭,  .\n\n SET  ࠬ  ࠦ  祭.\n\n /C   ,  '  祭    \n ॣ,   㢠 '  祭 ॢ  \nॣ,    ⠪    .\n\n/P    㢥 祭    祭.\n.\n\n:TEXT_CMDHELP_SHIFT#1\n    ࠬ   䠩.\n\nSHIFT [DOWN]\n\nDOWN  ࠬ  ⠭쮣  讣,    讣\n ⠭쮣.\n.\n\n:TEXT_CMDHELP_TIME#1\nࠦ   筮 ⥬ .\n\nTIME [/T] []\n\n TIME  ࠬ  ࠦ 筮 ⥬  \n    .      筨 ,\n ENTER    楩 .\n\n/T ࠦ 筮       .\n.\n\n:TEXT_CMDHELP_TRUENAME\nࠦ  .\n\nTRUENAME [:][][' 䠩]\n.\n\n:TEXT_CMDHELP_TYPE\nࠦ  ⥪⮢ 䠩.\n\nTYPE [:][]' 䠩\n.\n\n:TEXT_CMDHELP_VER\nࠦ    FreeDOS   ଠ.\n\nVER [/R] [/W] [/D] [/C]\n\n /R              ଠ.\n /W            ࠭    FreeDOS.\n /D          㬮 ஧   FreeDOS.\n /C          ᯨ ஧஡   FreeDOS.\n.\n\n:TEXT_CMDHELP_VERIFY\nࠦ    ॢન ४⭮  䠩  .\n\nVERIFY [ON | OFF]\n\n VERIFY  ࠬ  ࠦ 筮  VERIFY.\n.\n\n:TEXT_CMDHELP_FDDEBUG\n   㫠 祭   FreeDOS,  \n   ०  㢠쭮 ଠ  .\n\nFDDEBUG [ON | OFF | 䠩]\n\n FDDEBUG  ࠬ   筮  .\n   浪     䠩, 㢥 㢠쭨\n ⨬  楩 䠩  㢠⨬    ( \n).  ७ࠢ  㢠쭮 ଠ  \n ⠭  \"stdout\"  \"stderr\"  ७ࠢ \n ࠭        .\n.\n\n:TEXT_CMDHELP_VOL\nࠦ  㬮 㢠 ⪨ ⮬    .\n\nVOL [:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nࠦ ५    㤮 ஧७  .\n\n?                     ࠦ ५    㤮\n                      ஧७  .\n\n? [ࠬ]       祭 ,\n                         ०  㢠.\n.\n\n:TEXT_CMDHELP_WHICH\n  ࠦ  㢠쭮 䠩    \n .\n\nWHICH {}\n.\n\n:TEXT_CMDHELP_MEMORY#1\nࠦ ⨪ ⠭  ' FreeCOM\n\nMEMORY\n\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\n਩,    COPY,    ᨬ ' ('+').\n.\n\n:TEXT_DELETE_FILE#1\n饭 䠩 \"%s\".\n.\n"
  },
  {
    "path": "strings/yu437.err",
    "content": "# $Id$\n#\n# Critical error national customization file\n#\n#  Language: Serbian / Yugoslavian\n#  Codepage: 437\n#  Author:   Dejan Strbac (strbac@phreaker.net)\n#\n# The critical error (criter) handler receives some information\n# from the kernel about what error condition happens, generates some\n# human friendly message from it, requests the user's opinion about\n# how to proceed and, finally, returns to the kernel.\n#\n# The human friendly message is generated using one of the following\n# templates:\n# BLOCK_DEVICE (for criters on block devices)\n#  Error %1 drive %A: %2 area: %3\n# -and- CHAR_DEVICE (for criters on character devices)\n#  Error %1 device %A: %3\n#\n# Two-character sequences, which first character is a percent sign '%',\n# are placeholders for other information:\n# %% -> a single percent sign\n# %1 -> either READ or WRITE, depending on what kind of operation\n#  caused the criter\n# %2 -> the kind of area the criter took place on DOS, FAT, ROOT, or DATA\n# %3 -> the actual error string; these are the strings associated to\n#  a number 0 through N, and must correspond to the number passed in\n#  lowbyte(DI) to the criter handler (see RBIL INT-24 for details)\n# %A -> drive letter (for block devices); name of device (character devices)\n#\n# Below the line describing the error the user is prompted for the action\n# to proceed. This line is dynamically constructed depending on which\n# action are available at all. The full line may look like this:\n#  (A)bort, (I)gnore, (R)etry, (F)ail?_\n#\n# The individual words are defined by ABORT, IGNORE, RETRY, FAIL. They\n# should indicate which user response keys is associated with them;\n# suggested is to use the first letter and enclose it in parenthesises.\n# The delimiter \", \" can be defined with DELIMITER and is the same\n# for all slots.\n# The \"? \" sequence is defined by QUESTION.\n# The order of the actions is fixed and cannot be customized.\n#\n# With each action a number of user response keys must be associated.\n# They can be enumerated with the KEYS_ABORT, KEYS_IGNORE, ...\n# strings. Because the key is searched in the same format as returned\n# by INT-16-00, both upper and lower case must be specified and\n# certain special keys cannot be used.\n#\n# The individual error strings are defined by the #: lines, where\n# the hash sign '#' refers to the number the kernel passes to the\n# criter handler. The UNKNOWN string is displayed for all error\n# numbers not specified.\n#\n# NOTE #1: The percent rule applies to _all_ criter strings!\n# NOTE #2: Each string occupies exactly one line.\n# NOTE #3: Any leading or trailing whitespaces are removed. Prefix the\n#  first or suffix the last whitespace with '%.' (one percent sign and\n#  one dot). This sequence is removed from the string totally.\n# NOTE #4: To embed any character use: %&## (one percent sign,\n#     one ampersand and exactly two hexa-decimal digits)\n\n## Primary strings\nS2\nBLOCK_DEVICE: %&0A%&0A%&0DGreska %1 na drajvu %A: - %3\nS3\nCHAR_DEVICE:  %&0A%&0A%&0DGreska %1 na uredjaju %A: - %3\n\n## kind of operation\nS0\nREAD: pri citanju\nS1\nWRITE: pri upisu\n\n## kind of failed area of block devices\nS4\nDOS: DOS\nS5\nFAT: FAT\nS6\nROOT: Root\nS7\nDATA: Podaci\n\n## action strings\nS8\nIGNORE: (I)gnorisi\nS9\nRETRY: (P)onovo\nS10\nABORT: (O)tkaz\nS11\nFAIL: (N)euspeh\n## keys associated with the actions\nS14 (compacted)\nKEYS_IGNORE: iI\nKEYS_RETRY:  pP\nKEYS_ABORT:  oO\nKEYS_FAIL:   nN\n## embedded strings\nS12\nQUESTION:  ? %.\nS13\nDELIMITER: , %.\n\n## Error strings\nUNKNOWN: Nepoznata greska\nS15\n0: POKUSAJ PREKORACENjA ZASTITE OD PISANjA\n1: NEPOZNATA JEDINICA ZA DRAJVER\n2: DRAJV NIJE SPREMAN\n3: NEPOZNATA KOMANDA PRENETA DRAJVERU\n4: GRESKA U PODACIMA (LOS CRC)\n5: LOSA DUZINA STRUKTURE ZAHTEVA DRAJVERA UREDjAJA\n6: GRESKA PRI TRAZENjU (SEEK)\n7: NEPOZNATI TIP MEDIJA\n8: SEKTOR NIJE PRONADjEN\n9: U STAMPACU NEMA PAPIRA\n10: GRESKA PRI PISANjU\n11: GRESKA PRI CITANjU\n12: GENERALNI OTKAZ\n13: NARUSAVANjE RASPODELE\n14: NARUSAVANjE BLOKADE\n15: NEVAZECA PROMENA DISKA\n16: FCB JE NEDOSTUPNA\n17: PREKORACENjE ZAJEDNICKOG BAFERA\n18: NEUSAGLASENOST KODNIH STRANA\n19: NEDOVOLjNO ULAZA\n20: NEDOVOLjNO DISK PROSTORA\n"
  },
  {
    "path": "strings/yu437.lng",
    "content": "# $Id$\n#\n# FreeCOM national customization file\n#\n#  Language: Serbian / Yugoslavian\n#  Codepage: 437\n#  Author:   Dejan Strbac (strbac@phreaker.net)\n#\n# This file is used to generate all the messages that command.com\n# outputs.  This file is the input to the fixstrs program, and it\n# outputs strings.h and strings.dat.  The .DAT file is appended to\n# the command.exe file, and then renamed to command.com.  The .H\n# file contains all the info for the program to retreive the\n# messages.\n#\n# The format of this file is simple.  Blank lines and lines starting\n# with \"#\" are ignored.\n# Each message starts with a label name that will be used to refer to\n# the message in the program.  A label starts with a colon \":\".\n# A label has a version ID attached to it delimited by a hash sign, e.g.:\n#  :TEXT_LABEL#1\n# This version is incremented each time the contents of the string has\n# undergo a larger change. The same language definition may contain the\n# same label up to one time, regardless of the version. FIXSTRS compares\n# both the label and the version ID and both must match.\n# A missing version is assumed as \"#0\".\n#\n# All lines after the label are the message until a line with a\n# single \".\" or \",\" in the first column.  The difference is the\n# period (\".\") signifies that there will be a final carrage return when\n# the message is displayed, but a comma does not.\n#\n# The body may contain backslash escape sequences as known from C; there\n# are the usual \\# (where '#' is a lowercase letter except 'x' or one of\n# \"[]{}?\"), \\\\ (to embed a backslash itself)\n# \\x?? (where '??' are up to two hexadecimal digits), \\0 (to embed a NUL\n# character), \\, and \\. (to specify a period or comma in the first column\n# of a line) and the single \\ at the end of the line to suppress to append\n# a newline character. Note: There is NO octal sequence except the short \\0!\n# There is a known bug (or feature): [ignore the very first hash mark]\n#:TEXT_LABEL#2\n#\n#\\\n#,\n# Although the first data line appends the newline, the second does not,\n# though the comma removes the newline from the first line.\n\n# Defining prompts\n# Some prompts may cause an user interaction. Those ones should be in sync\n# with the issued text. To define how to interprete a pressed key, they\n# are mapped into metakeys like that: [ignore first hash sign]\n\n## Return value: a -> Yes; else -> No\n#:PROMPT_YES_NO#1\n#YyNn\\n\\r{CBREAK}\n#aabb b b       b\n# (Yes/No) ? \\\n#.\n\n# All strings, which label start with \"PROMPT_\", are parsed as prompts.\n# The first two lines of the body are special; the first one enumerates all\n# valid keys, the second one assigns arbitary metakeys. Metakeys may\n# range from 'a' through 'z'; spaces are ignored; everything else cause\n# an error. The comment preceeding the prompt definition associates the\n# metakeys with their meaning.\n# The remaining lines of the body contain the text to be displayed.\n#\n# Above example defines a native Yes/No prompt with a space behind the question\n# mark and no appended newline.\n# The metakey 'a' means \"User answered with 'Yes'\" and 'b' means no.\n# The keys 'Y' and 'y' are mapped to metakey 'a' (aka Yes) and the keys\n# 'N', 'n', Enter and ^Break are mapped to metakey 'b' (aka No).\n# The spaces between the 'b's in the second line had been inserted to\n# align them with the corresponding keys of the first line, hence in order\n# to enhance readibility of the association between the pressed keys and their\n# mapping into a metakey.\n#\n# The first line (pressed keys) has to enumerate the ASCII value as returned\n# by DOS or BIOS (INT-10); special keys normally expressed with ASCII code zero,\n# but a non-zero scancode are NOT supported; this limit includes for instance\n# the function keys F1 through F12 and the cursor keys and it is not possible\n# to differ between the number pad and normal keys.\n# The keys may be enumerated by their ASCII character, by a backslash sequence,\n# or a symbolic name enclosed in curly brackets (see FIXSTRS.C \"symkeys[]\"\n# array about the supported symnames).\n\n\n#\n#  These are error messages\n#\n## Issued if a single character option is unknown\n:TEXT_ERROR_INVALID_SWITCH\nNevazeci prekidac - /%c\n.\n\n## Issued if a longname option is unknown\n:TEXT_ERROR_INVALID_LSWITCH\nNevazeci prekidac - /%s\n.\n\n## Issued if the context, the type of argument etc. is invalid\n:TEXT_ERROR_ILLFORMED_OPTION\nLose formirana opcija: '%s'\n.\n\n:TEXT_ERROR_OPT_ARG\nOpcija '%s' ne moze imati argument.\n.\n\n:TEXT_ERROR_OPT_NOARG\nOpcija '%s' mora imati argument.\n.\n\n:TEXT_INVALID_NUMBER\nNevazeci broj naveden u '%s'\n.\n\n:TEXT_ERROR_CLOSE_QUOTE\nNedostaje krajnji navodnik: %c\n.\n\n:TEXT_ERROR_TEMPFILE\nPrivremeni fajl ne moze biti kreiran.\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS_STR\nIsuvise parametara - '%s'\n.\n\n:TEXT_ERROR_TOO_MANY_PARAMETERS\nIsuvise parametara.\n.\n\n:TEXT_ERROR_INVALID_PARAMETER\nNevazeci parametar - '%s'\n.\n\n:TEXT_ERROR_PATH_NOT_FOUND\nPutanja nije pronadjena.\n.\n\n:TEXT_ERROR_FILE_NOT_FOUND\nFajl nije pronadjen.\n.\n\n:TEXT_ERROR_SFILE_NOT_FOUND\nFajl nije pronadjen - '%s'\n.\n\n:TEXT_ERROR_REQ_PARAM_MISSING\nPotreban parametar nedostaje.\n.\n\n:TEXT_ERROR_INVALID_DRIVE\nNevazeci drajv - %c:\n.\n\n:TEXT_ERROR_BADCOMMAND#2\nLosa komanda ili naziv fajla - \"%s\".\n.\n\n:TEXT_ERROR_OUT_OF_MEMORY\nGreska nedostatka memorije.\n.\n\n:TEXT_ERROR_OUT_OF_DOS_MEMORY#1\nAlokacija DOS memorije nije uspela.\n.\n\n:TEXT_ERROR_CANNOTPIPE\nNemogucnost cevovoda! Privremeni fajl ne moze biti otvoren!\n.\n\n:TEXT_ERROR_LONG_LINE_BATCHFILE\nLinija #%ld u batch fajlu '%s' je preduga.\n.\n\n:TEXT_ERROR_BFILE_VANISHED\nBatch fajl '%s' nije pronadjen.\n.\n\n:TEXT_ERROR_BFILE_LABEL\nBatch fajl '%s' ne sadrzi labelu '%s'.\n.\n\n:TEXT_ERROR_DIRFCT_FAILED#1\n%s ne uspeva za '%s'.\n.\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ENV_VAR\nPromenljiva okruzenja '%s' ne moze biti postavljena.\nOkruzenje prepuno?\n.\n:TEXT_ERROR_ENV_VAR_NOT_FOUND\nPromenljiva okruzenja '%s' nije pronadjena.\n.\n:TEXT_ERROR_NO_ENVIRONMENT\nNema okruzenja. Moguci nedostatak memorije. Navedite /E opciju.\n.\n\n# The next three errors must remain in this order!\n:TEXT_ERROR_SET_ALIAS#1\nAlias '%s' ne moze biti postavljen. Prostor za aliase prepun?\n.\n:TEXT_ERROR_ALIAS_NOT_FOUND#1\nAlias '%s' nije pronadjen.\n.\n:TEXT_ERROR_NO_ALIAS_SEGMENT#1\nNema prostora za aliase. Moguci nedostatak memorije.\n.\n\n:TEXT_ERROR_SYNTAX_STR\nSintaksna greska - '%s'\n.\n\n:TEXT_ERROR_SYNTAX\nSintaksna greska.\n.\n\n:TEXT_ERROR_FILENAME_TOO_LONG\nNaziv fajla je predugacak - '%s'\n.\n\n:TEXT_ERROR_SELFCOPY\nFajl '%s' ne moze biti kopiran u sebe.\n.\n\n:TEXT_ERROR_COMMAND_TOO_LONG\nKomandna linija je preduga posle razvijanja aliasa!\n.\n\n:TEXT_ERROR_LINE_TOO_LONG\nLinija je preduga. Komanda ne moze biti izvrsena.\n.\n\n:TEXT_ERROR_HISTORY_SIZE#1\nNevazeca velicina istorije - '%s'\n.\n\n:TEXT_HISTORY_EMPTY#1\nIstorija komandne linije je prazna.\n.\n\n:TEXT_ERROR_BAD_MCB_CHAIN\nMCB lanac je ostecen, ili MS-DOS nekompatibilan sistem.\n.\n\n:TEXT_ERROR_UNDEFINED_ERROR\nNedefinisana greska %d.\n.\n\n:TEXT_ERROR_REGION_WARNING\nNevazece memorijsko podrucje %d - ignorisano.\n.\n\n:TEXT_ERROR_ON_OR_OFF\nMorate navesti ON ili OFF.\n.\n\n:TEXT_ERROR_BAD_VARIABLE\nLose navedena promenljiva.\n.\n\n:TEXT_ERROR_IN_MISSING#1\nFOR: nedostaje IN\n.\n\n:TEXT_ERROR_MISSING_PARENTHESES#1\nJedna ili obe zagrade nedostaju.\n.\n\n:TEXT_ERROR_DO_MISSING#1\nFOR: nedostaje DO\n.\n\n:TEXT_ERROR_NO_COMMAND_AFTER_DO#1\nFOR: Nedostaje komanda posle DO iskaza.\n.\n\n:TEXT_ERROR_REDIRECT_FROM_FILE\nUlaz ne moze biti preusmeren na fajl '%s'.\n.\n\n:TEXT_ERROR_REDIRECT_TO_FILE\nIzlaz ne moze biti preusmeren na fajl '%s'.\n.\n\n:TEXT_ERROR_EMPTY_REDIRECTION#1\nPrazno preusmerenje.\n.\n\n:TEXT_ERROR_INVALID_DATE\nNevazeci datum.\n.\n\n:TEXT_ERROR_INVALID_TIME\nNevazece vreme.\n.\n\n:TEXT_ERROR_NO_GOTO_LABEL\nNema labele navedene za GOTO.\n.\n\n:TEXT_CTTY_NOTIMPLEMENTED\nKomanda CTTY je izostavljena iz ovog COMMAND.COMa.\n.\n\n:TEXT_ERROR_NORW_DEVICE\nNevazeci ili ne postojeci ucitno-upisni uredjaj '%s'.\n.\n\n:TEXT_ERROR_CTTY_DUP\nNeuspeh pri promeni fajl deskriptora na TTY '%s'.\n.\n\n:TEXT_ERROR_L_NOTIMPLEMENTED\nPrekidac /L nije implementiran.\n.\n\n:TEXT_ERROR_U_NOTIMPLEMENTED\nPrekidac /U nije implementiran.\n.\n\n:TEXT_ERROR_WRITING_DEST\nGreska pri upisu na odrediste.\n.\n\n:TEXT_ERROR_CANNOT_OPEN_SOURCE\nIzvor nije mogao biti otvoren - '%s'\n.\n\n:TEXT_ERROR_OPEN_FILE\nFajl '%s' nije mogao biti otvoren.\n.\n\n:TEXT_ERROR_READ_FILE\nNemogucnost citanja iz fajla: '%s'\n.\n\n:TEXT_ERROR_WRITE_FILE\nNemogucnost upisa u fajl: '%s'\n.\n\n:TEXT_ERROR_LEADING_PLUS\nPovezujuci znak '+' ne moze voditi argumente.\n.\n\n:TEXT_ERROR_TRAILING_PLUS\nPovezujuci znak '+' ne moze pratiti argumente.\n.\n\n:TEXT_ERROR_NOTHING_TO_DO\nNema niceg da se uradi.\n.\n\n:TEXT_ERROR_COPY\nCOPY komanda nije uspela.\n.\n\n:TEXT_ERROR_IF_EXIST_NO_FILENAME#1\nIF EXIST: nedostaje naziv fajla\n.\n:TEXT_ERROR_IF_ERRORLEVEL_NO_NUMBER#1\nIF ERRORLEVEL: nedostaje broj\n.\n:TEXT_ERROR_IF_ERRORLEVEL_INVALID_NUMBER#1\nIF ERRORLEVEL: nevazeci broj\n.\n:TEXT_ERROR_IF_MISSING_COMMAND#1\nIF: nedostaje komanda\n.\n:TEXT_NOT_IMPLEMENTED_YET\nZao nam je. Nije implementirano.\n.\n\n:TEXT_FAILED_LOAD_STRINGS\nNeuspeh pri ucitavanju poruka u memoriju.\n.\n\n:TEXT_MSG_NOTIMPLEMENTED\nPrekidac /MSG nije implementiran.\n.\n\n:TEXT_MSG_ITEMS_DISPLAYED#1\nUkupno izlistano stavki: %u\n.\n\n:TEXT_CORRUPT_COMMAND_LINE\nOstecena komandna linija. Ovo je interna greska i povezana je sa\nsistemom u kome radi COMMAND.COM. Molimo vas prijavite ovu gresku.\n.\n\n:TEXT_QUOTED_C_OR_K#1\nOpcije /C i /K nemogu biti pod navodnicima, ignorisane.\n.\n\n:TEXT_INIT_FULLY_QUALIFIED#1\nPutanja do COMMAND.COMa mora biti potpuna!\nOvo znaci ukljucujuci slovo drajva pocinjuci obrnutom kosom crtom (\\\\).\nNa primer: C:\\\\\n\nCOMMAND.COM sada podrazumeva ovu putanju:\n%s\n.\n\n:TEXT_ERROR_RESTORE_SESSION\nInformacije o sesiji nisu mogle biti vracene. Sve lokalne postavke\nsu izgubljene. Molimo vas pogledajte gore izjavljene poruke o greskama\nza moguci razlog nastanka ovog problema.\n.\n\n:TEXT_ERROR_SAVE_SESSION\nTrenutne informacije nemogu biti ocuvane za vreme poziva programa.\nMolimo vas pogledajte gore izjavljene poruke o greskama za moguci razlog\nnastanka ovog problema.\n.\n\n:TEXT_ERROR_CWD_FAILED\nDrajv %c: ne reaguje ili nedostatak interne memorije.\n.\n\n:TEXT_ERROR_KSWAP_ALIAS_SIZE\nSwapping nije uspeo: Aliasi zauzimaju previse memorije.\n.\n\n\n:TEXT_ERROR_KSWAP_ALLOCMEM\nSwapping nije uspeo: Daleka memorija ne moze biti alocirana.\n.\n\n:TEXT_ERROR_ALIAS_OUT_OF_MEM#1\nNedostatak prostora za aliase.\n.\n\n:TEXT_ERROR_ALIAS_NO_SUCH#1\nAlias '%s' ne postoji.\n.\n\n:TEXT_ERROR_ALIAS_INSERT#1\nGreska pri umetanju aliasa.\n.\n\n:TEXT_ALIAS_INVALID_NAME#1\nNevazece ime aliasa '%s'.\n.\n\n:TEXT_ERROR_LOADING_CONTEXT#1\nManipulator kriticnih gresaka ili kontekst modul ne moze biti ucitan.\n.\n\n:TEXT_ERROR_CONTEXT_OUT_OF_MEMORY#1\nNedostatak memorije za kontekst.\nAko ova greska nastavi da se javlja, razmotrite povecanje internog\nbafera, kao istorije, steka direktorijuma itd.\n.\n\n:TEXT_ERROR_CONTEXT_LENGTH#1\nVelicina konteksta prelazi maksimalni limit za %lu bajta.\nPromena velicine konteksta na %u bajta.\n.\n\n:TEXT_ERROR_CONTEXT_ADD_STATUS#1\nNeuspeh pri dodavanju statusnih informacija u kontekst. Ova greska\nmoze znaciti ostecenje memorije ili nepravilno utvrdjena minimalna\nvelicina konteksta.\n.\n\n:TEXT_ERROR_CONTEXT_AFTER_SWAP#1\nKontekst nedostaje posle swapa. Kontekst je rekreiran, ali su svi\naliasi itd. izgubljeni.\n.\n\n#\n# Informational messages\n#\n\n:TEXT_MSG_PAUSE#1\nPritisnite bilo koji taster za nastavak...\\\n.\n\n:TEXT_MSG_HISTORY_SIZE\nVelicina istorije je %d bajta.\n.\n\n:TEXT_MSG_DOSKEY\nDOSKEY je vec omogucen interno u komandnoj ljusci.\nPokrenite DOSKEY /? za vise informacija o implementaciji.\n.\n\n:TEXT_MSG_ECHO_STATE\nECHO je %s\n.\n\n:TEXT_MSG_VERIFY_STATE\nVERIFY je %s\n.\n\n:TEXT_MSG_FDDEBUG_STATE\nDEBUG izlaz je %s\n.\n:TEXT_MSG_FDDEBUG_TARGET\nDEBUG izlaz se prikazuje na '%s'\n.\n\n:TEXT_MSG_BREAK_STATE\nBREAK je %s\n.\n\n:TEXT_MSG_CURRENT_DATE\nTrenutni datum je: %s\n.\n\n## The three DATE prompts MUST be in this order!\n:TEXT_MSG_ENTER_DATE_AMERICAN#1\nUnesite novi datum (mm%sdd%s[vv]gg): \\\n.\n:TEXT_MSG_ENTER_DATE_EUROPE#1\nUnesite novi datum (dd%smm%s[vv]gg): \\\n.\n:TEXT_MSG_ENTER_DATE_JAPANESE#1\nUnesite novi datum ([vv]gg%smm%sdd): \\\n.\n\n:TEXT_MSG_CURRENT_TIME\nTrenutno vreme je: %s\n.\n\n:TEXT_STRING_PM#1\n pm\\\n.\n:TEXT_STRING_AM#1\n am\\\n.\n\n:TEXT_MSG_ENTER_TIME#1\nUnesite novo vreme: \\\n.\n\n# src-file <operation> target-file\n:TEXT_MSG_COPYING\n%s %s %s\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Used by Delete all (Y/N) --> let ENTER default to NO\n# Return value: a -> Yes; else -> No\n:PROMPT_DELETE_ALL#1\nDdNn{CR}{LF}{CBREAK}\naabb   b   b       b\nSvi fajlovi u direktorijumu '%s' ce biti obrisani!\nDa li ste sigurni (Da/Ne)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; else -> No\n:PROMPT_YES_NO#1\nDdNn{LF}{CR}{CBREAK}{ESC}\naabb   a   a       b    b\n [ENTER=Da, ESC=Ne]? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Attention: This prompt is issued via BIOS; any newline MUST be prefixed\n#  by \\r!\n# Return value: a -> Yes; b -> No; c -> All; else -> Undefined\n:PROMPT_CANCEL_BATCH#1\nDdNnSs{LF}{CR}{CBREAK}{ESC}\naabbcc   a   a       c    b\nControl-Break pritisnuto.\\r\nPrekinuti batch fajl '%s' (Da/Ne/Sve)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_OVERWRITE_FILE#1\nDdNnSsOo{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nPisati preko '%s' (Da/Ne/Svi/Otkaz)? \\\n.\n\n# This prompt MUST include the pseudo key CBREAK!\n# Note: This prompt ignores DOS NLS intentionally in order to\n# keep interactive prompt & user-interaction in sync.\n# Return value: a -> Yes; b -> No; c -> All; d -> Quit\n:PROMPT_DELETE_FILE#1\nDdNnSsOo{BREAK}{ENTER}{ESC}\naabbccdd      d      a    b\nObrisati '%s' (Da/Ne/Svi/Otkaz)? \\\n.\n\n:TEXT_UNKNOWN_FILENAME#1\n<<nepoznato>>\\\n.\n\n:TEXT_DIRSTACK_EMPTY\nStek direktorijuma je prazan.\n.\n\n## Strings to construct the DIR output\n:TEXT_DIR_HDR_VOLUME#1\n Volumen u drajvu %c \\\n.\n:TEXT_DIR_HDR_VOLUME_STRING\nje %s\n.\n:TEXT_DIR_HDR_VOLUME_NONE\nnema labele\n.\n:TEXT_DIR_HDR_SERIAL_NUMBER\n Serijski broj volumena je %04X-%04X\n.\n:TEXT_DIR_FTR_FILES#1\n%10s fajl(a)\\\n.\n:TEXT_DIR_FTR_BYTES\n   %12s bajta\n.\n:TEXT_DIR_FTR_TOTAL_NUMBER\nUkupno prikazano:\n.\n:TEXT_DIR_FTR_DIRS#1\n%10s dir(a)\\\n.\n:TEXT_DIR_FTR_BYTES_FREE\n %15s bajta slobodno\n.\n:TEXT_DIR_DIRECTORY\nDirektorijum %s\n.\n:TEXT_DIR_DIRECTORY_WITH_SPACE\n Direktorijum %s\n.\n:TEXT_DIR_LINE_FILENAME_WIDE#1\n%-15s\\\n.\n:TEXT_DIR_LINE_FILENAME_BARE\n%-13s\n.\n:TEXT_DIR_LINE_FILENAME_SINGLE#1\n%-13s\\\n.\n:TEXT_DIR_LINE_FILENAME#1\n%-8s %-3s \\\n.\n:TEXT_DIR_LINE_SIZE_DIR#1\n        <DIR> \\\n.\n:TEXT_DIR_LINE_SIZE#1\n   %10s \\\n.\n\n:TEXT_FILE_COMPLATION_DISPLAY#1\n%-14s\\\n.\n\n:TEXT_MSG_PATH\nPATH=%s\n.\n:TEXT_MSG_PATH_NONE#1\nPutanja nije definisana.\n.\n\n## The following names MUST be in this order!\n:TEXT_WEEKDAY_SHORT_NAME_SUNDAY#1\nNed\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_MONDAY#1\nPon\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_TUESDAY#1\nUto\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_WEDNSDAY#1\nSre\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_THURSDAY#1\nCet\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_FRIDAY#1\nPet\\\n.\n:TEXT_WEEKDAY_SHORT_NAME_SATURDAY#1\nSub\\\n.\n\n# Displayed by DEL how many files were removed.\n# These three strings must be kept in order!\n:TEXT_MSG_DEL_CNT_FILES#1\nNijedan fajl nije izbrisan.\n.\n:TEXT_MSG_DEL_CNT_FILES_1#1\nJedan fajl izbrisan.\n.\n:TEXT_MSG_DEL_CNT_FILES_2#1\n%u fajla izbrisano.\n.\n\n:TEXT_MSG_SHOWCMD_INTERNAL_COMMANDS\nDostupne interne komande:\n\n.\n\n:TEXT_MSG_SHOWCMD_FEATURES\nMissing:\n.\n\n## Displayed within \"?\" <-> showcmd() to enumerate the included features\n## Note the trailing single space\n:TEXT_SHOWCMD_FEATURE_ALIASES#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_ENHANCED_INPUT#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_HISTORY#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_FILENAME_COMPLETION#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_SWAP_EXEC#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_CALL_LOGGING#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_LAST_DIR#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_KERNEL_SWAP_SHELL#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_XMS_SWAP#1\nMissing \\\n.\n:TEXT_SHOWCMD_DEFAULT_TO_SWAP#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_INSTALLABLE_COMMANDS#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_NLS#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_DIRSTACK#1\nMissing \\\n.\n:TEXT_SHOWCMD_FEATURE_DEBUG#1\nMissing \\\n.\n\n:TEXT_MSG_INIT_BYPASS_AUTOEXEC#1\n\nPritisnite F8 za mod pracenja, ili F5 za preskakanje %s... \\\n.\n:TEXT_MSG_INIT_BYPASSING_AUTOEXEC\nPreskakanje preko '%s'\n.\n\n:TEXT_MSG_VER_DOS_VERSION\nDOS verzija %u.%02u\n.\n\n:TEXT_MSG_VER_EARLY_FREEDOS\nFreeDOS jezgro (gradnja 1933 ili ranija)\n.\n\n:TEXT_MSG_VER_LATER_FREEDOS\nFreeDOS jezgro %d.%d.%d\n.\n\n# Displayed when the shell is to terminate, but has been started\n# with /P option <-> shell cannot exist;\n# This is a crash situation, because FreeCOM won't reach this situation\n# normally otherwise\n# All newlines must be prefixed by \\r's !\n:TEXT_MSG_REBOOT_NOW#1\n\\r\\n\\r\nLjuska ce sada biti prekinuta, iako je ovo zabranjeno\\r\n(obicno navodjenjem prekidaca \"/P\").\\r\nMorate restartovati sistem ili, ukoliko ova ljuska radi u\\r\nviseprocesnom okruzenju, prekinuti ovaj proces.\\r\n.\n\n# Displayed during the initialization phase of FreeCOM, if its own\n# filename could not be determined.\n:TEXT_MSG_FREECOM_NOT_FOUND#1\nIzvrsni fajl komandne ljuske nije pronadjen.\nMorate navesti potpunu putanju do COMMAND.COMa kao\nprvi argument COMMANDa, na primer:\nC:\\\\\n.\n\n\n:TEXT_MEMORY_ENVIRONMENT#1\nNA %5u %5u\n.\n:TEXT_MEMORY_CONTEXT#1\nNA %5u %5u\n.\n:TEXT_MEMORY_HEAP#1\nNA %5lu\n.\n:TEXT_MEMORY_CTXT_ALIAS#1\nNA %5u %5u %5u\n.\n:TEXT_MEMORY_CTXT_HISTORY#1\nNA %5u %5u %5u\n.\n:TEXT_MEMORY_CTXT_DIRSTACK#1\nNA %5u %5u %5u\n.\n:TEXT_MEMORY_CTXT_LASTDIR#1\nNA %5u %5u\n.\n:TEXT_MEMORY_CTXT_BATCH#1\nNA %5u %5u\n.\n:TEXT_MEMORY_CTXT_SWAPINFO#1\nNA %5u %5u\n.\n\n\n## CHCP\n:TEXT_ERROR_GET_CODEPAGE#1\nNeuspeh pri dobavljanju trenutne kodne strane iz sistema.\n.\n:TEXT_ERROR_SET_CODEPAGE#1\nNeuspeh pri promeni trenutne kodne strane.\n.\n:TEXT_DISPLAY_CODEPAGE#1\nTrenutna kodna strana je: %u.\nSistemska kodna strana (pravilno) je: %u.\n.\n\n#\n# Command help text\n#\n\n:TEXT_CMDHELP_ALIAS\nPrikazuje, postavlja, ili uklanja aliase.\n\n  ALIAS [promenljiva[=][string]]\n\n  promenljiva  Navodi ime aliasa.\n  string       Navodi niz karaktera za dodelu aliasu.\n\n Pokrenite ALIAS bez parametara za prikaz trenutnih aliasa. Ukoliko string\n nije naveden, postojeci alias se uklanja.\n.\n\n:TEXT_CMDHELP_BEEP\nStvara kratak zvuk upozorenja.\n\n  BEEP\n.\n\n:TEXT_CMDHELP_BREAK\nPostavlja ili uklanja prosirenu CTRL+C proveru.\n\n  BREAK [ON | OFF]\n\n Pokrenite BREAK bez parametara za prikaz trenutne postavke.\n.\n\n:TEXT_CMDHELP_CALL#1\nPoziva jedan batch program iz drugog.\n\n  CALL [/S | /N] [/Y] [drajv:][putanja]fajl [batch-parametri]\n\n  batch-parametri   Navodi informacije sa komandne linije potrebne\n                    batch programu.\n\n  /S ukljucuje dok /N iskljucuje swapping komandne ljuske.\n  /Y omogucava mod pracenja prilikom izvrsenja komande.\n.\n\n:TEXT_CMDHELP_CD\nPrikazuje naziv ili menja trenutni direktorijum.\n\n  CHDIR [drajv:][putanja]\n  CHDIR[..]\n  CD [drajv:][putanja]\n  CD[..]\n  CD -\n\n  \"..\"  Navodi da zelite da promenite direktorijum u roditeljski trenutnog.\n  \"-\"   Vraca se u prethodni direktorijum.\n\n Pokrenite \"CD drajv:\" za prikaz trenutnog dira na navedenom drajvu.\n Pokrenite CD bez parametara za prikaz trenutnog drajva i direktorijuma.\n Takodje pogledajte komandu CDD.\n.\n\n:TEXT_CMDHELP_CDD\nPrikazuje trenutni direktorijum ili menja trenutni direktorijum i drajv.\n\n  CDD [drajv:][putanja]\n  CDD[..]\n  CDD -\n\n  \"..\"  Navodi da zelite da promenite direktorijum u roditeljski trenutnog.\n  \"-\"   Vraca se u prethodni direktorijum.\n\n Ako je \"drajv:\" naveden, trenutni radni drajv se menja na navedeni.\n Ovo je jedina razlika u odnosu na \"CD\" odnosno \"CHDIR\".\n Pokrenite CDD bez parametara za prikaz trenutnog drajva i direktorijuma.\n.\n\n:TEXT_CMDHELP_CHCP\nPrikazuje ili postavlja broj aktivne kodne strane.\n\n  CHCP [nnn]\n\n  nnn   Navodi broj kodne strane.\n\n Pokrenite CHCP bez parametara za prikaz aktivne kodne strane.\n.\n\n:TEXT_CMDHELP_CLS\nBrise ekran i postavlja standardne atribute boja.\n\n  CLS\n.\n\n:TEXT_CMDHELP_COMMAND\nPokrece novu instancu komandne ljuske.\n\n  COMMAND [[drajv:]putanja] [uredjaj] [/E:nnnnn] [/P] [/MSG]\n           [/LOW] [/Y [/[C|K] komanda]]\n\n  [drajv:]putanja  Navodi direktorijum koji sadrzi COMMAND.COM.\n  uredjaj           Navodi uredjaj za komandni ulaz/izlaz.\n  /E:nnnnn         Postavlja pocetnu velicinu okruzenja na nnnnn bajta.\n                   (nnnnn treba biti broj izmedju 256 i 32,768).\n  /P               Postavlja novu komandnu ljusku za stalnu (nema izlaza).\n  /LOW             Primorava komandnu ljusku da drzi svoje stalne podatke\n                   u niskoj memoriji.\n  /MSG             Ucitava sve sistemske poruke u memoriju (zahteva i /P).\n  /Y               Koraca kroz batch program naveden sa /C ili /K.\n  /C komanda       Izvrsava navedenu komandu i vraca se u trenutnu ljusku.\n  /K komanda       Izvrsava navedenu komandu i nastavlja rad.\n.\n\n:TEXT_CMDHELP_COPY\nKopira jedan ili vise fajlova na drugu lokaciju.\n\n  COPY [/A | /B] izvor [/A | /B] [+ izvor [/A | /B] [+ ...]]\n        [odrediste [/A | /B]] [/V] [/Y | /-Y]\n\n  izvor        Navodi fajl ili fajlove koje treba prekopirati.\n  /A           Nagovesta ASCII tekstualni fajl.\n  /B           Nagovesta binarni fajl.\n  odrediste    Navodi direktorijum i/ili naziv fajla za novi(e) fajl(ove).\n  /V           Proverava korektnost upisa novih fajlova.\n  /Y           Prigusava upite za pisanje preko vec postojecih fajlova u\n               odredistu, odgovarajuci potvrdno.\n  /-Y          Poziva upit za potvrdu pisanja preko vec postojecih fajlova\n               u odredistu.\n\n Prekidac /Y moze biti naveden u COPYCMD promenljivi okruzenja.\n Ovo moze biti ponisteno sa /-Y na komandnoj liniji.\n\n Za spajanje fajlova, navedite jedan fajl za odrediste, ali vise fajlova za\n izvor (koriscenjem dzoker znakova ili fajl1+fajl2+fajl3 formatom).\n.\n\n:TEXT_CMDHELP_CTTY\nMenja terminalni uredjaj koriscen za kontrolu sistema.\n\n  CTTY uredjaj\n\n  uredjaj    Terminalni uredjaj koji zelite koristiti, kao npr. COM1.\n.\n\n:TEXT_CMDHELP_DATE#1\nPrikazuje ili postavlja datum.\n\n  DATE [/D] [datum]\n\n  /D odvraca DATE od interaktivnosti.\n\n Pokrenite DATE bez parametara za prikaz trenutne postavke datuma\n i upit za novu. Pritisnite ENTER da zadrzite isti datum.\n.\n\n:TEXT_CMDHELP_DEL#2\nBrise jedan ili vise fajlova.\n\n  DEL [drajv:][putanja]fajl [/P] [/V]\n  ERASE [drajv:][putanja]fajl [/P] [/V]\n\n  [drajv:][putanja]fajl   Navodi fajl(ove) za brisanje. Navedite vise\n                          fajlova koristeci se dzoker znacima.\n  /P    Poziva upit za potvrdu pre brisanja svakog fajla pojedinacno.\n  /V    Prikazuje sve izbrisane fajlove.\n.\n\n:TEXT_CMDHELP_DIR#4\nPrikazuje listu fajlova i pod-direktorijuma u direktorijumu.\n\n  DIR [drajv:][putanja][fajl] [/P] [/W] [/A[[:]atributi]]\n       [/O[[:]nacin]] [/S] [/B] [/L] [/[Y|4]]\n\n  [drajv:][putanja][fajl]\n           Navodi drajv, direktorijum, i/ili fajlove za listanje.\n            (Moze biti slozena ili visestruka specififikacija fajlova)\n  /A       Prikazuje fajlove sa navedenim atributima. (Podraz. /ADHSRA)\n  atributi  D  Direktorijumi             R  Read-only (samo za citanje)\n            H  Hidden (sakriveni)        A  Spremni za arhiviranje\n            S  Sistemski fajlovi         -  Prefiks negacije\n  /O       Prikazuje fajlove sortirane na navedeni nacin. (Podraz. /ONG)\n  nacin     N  Po nazivu                 S  Po velicini\n            E  Po ekstenziji             D  Po datumu i vremenu\n            G  Grupise direktorijume     -  Prefiks inverznog redosleda\n            U  Nesortirano\n  /P       Pauzira posle svakog punog ekrana informacija.\n  /W       Koristi format sirokog listanja.\n  /S       Prikazuje fajlove u navedenom diru i svim pod-direktorijumima.\n  /B       Koristi ogoljeni format (bez zaglavlja i statistike).\n  /L       Koristi mala slova.\n  /Y,/4    Prikazuje godinu sa 4 cifre.\n\n Prekidaci mogu biti navedeni u DIRCMD promenljivi okruzenja. Ponistite\n vec navedene prekidace postavljanjem prefiksa \"-\". Na primer: /-W.\n.\n\n:TEXT_CMDHELP_DOSKEY#1\nDOSKEY je omogucen interno u komandnoj ljusci.\n\n Ŀ\n  Taster      Funkcija \n Ŀ\n  Gore/Dole   Poziva istoriju.                                      \n  Levo/Desno  Navigacija kroz komandnu liniju i/ili dopunjavanje    \n              trenutne linije prethodno pozvanom komandom.          \n  Home/End    Pocetak/kraj linije.                                  \n  Insert      Promena izmedju moda umetanja i pisanja preko.         \n  Tab         Dopunjavanje trenutne reci kao naziv fajla. Dvostruki \n              pritisak ce prikazati sve odgovarajuce fajlove.       \n \n\n Komanda HISTORY ce prikazati sadrzaj bafera istorije.\n.\n\n:TEXT_CMDHELP_ORIGINAL_DOSKEY#1\nNA %1 %9\n.\n\n:TEXT_CMDHELP_ECHO\nPrikazuje poruke, ili postavlja-uklanja odjek komandi.\n\n  ECHO [ON | OFF]\n  ECHO [poruka]\n  ECHO.\n\n Pokrenite ECHO bez parametara za prikaz trenutne postavke.\n \"ECHO.\" ce ispisati praznu liniju na ekran.\n.\n\n:TEXT_CMDHELP_EXIT\nNapusta trenutno aktivnu komandnu ljusku.\n\n  EXIT\n.\n\n:TEXT_CMDHELP_FOR\nPokrece navedenu komandu za svaki fajl iz navedenog skupa fajlova.\n\n  FOR %%varijabla IN (skup) DO komanda [parametri]\n\n  %%varijabla    Navodi zamenljivi parametar.\n  (skup)        Navodi skup od jednog ili vise fajlova. Dzoker znaci su\n                dozvoljeni.\n  komanda       Navodi komandu za izvrsenje nad svakim fajlom iz skupa.\n  parametri     Navodi parametre navedene komande.\n\n U batch programima, koristite %%%%varijabla umesto %%varijabla.\n.\n\n:TEXT_CMDHELP_GOTO\nUpucuje komandnu ljusku na liniju odredjenu labelom u batch programu.\n\n  GOTO labela\n\n  labela   Navodi labelu definisanu u trenutnom batch programu.\n\n Labelu pisete samu na liniji, pocinjuci dvotackom.\n.\n\n:TEXT_CMDHELP_HISTORY#1\nPrikazuje trenutni sadrzaj bafera istorije.\n\n  HISTORY\n.\n\n:TEXT_CMDHELP_IF\nVrsi uslovno procesiranje u batch programima.\n\n  IF [NOT] ERRORLEVEL broj komanda\n  IF [NOT] string1==string2 komanda\n  IF [NOT] EXIST fajl komanda\n\n  NOT               Navodi da komandna ljuska treba da izvrsi komandu samo\n                    ukoliko je uslov netacan. Negacija uslova.\n  ERRORLEVEL broj   Vraca TACNO ukoliko je prethodno pokrenuti program\n                    vratio izlazni kod jednak ili veci od navedenog broja.\n  komanda           Navodi komandu koja se treba izvrsiti ukoliko je uslov\n                    zadovoljen.\n  string1==string2  Vraca TACNO ukoliko su nizovi znakova jednaki.\n  EXIST fajl        Vraca TACNO ukoliko fajl sa navedenim imenom postoji.\n.\n\n:TEXT_CMDHELP_LH\nUcitava program u gornje memorijsko podrucje.\n\n  LOADHIGH [drajv:][putanja]fajl [parametri]\n  LOADHIGH [/L:podrucje1[,min_vel1][;podrucje2[,min_vel2]...] [/S]]\n           [drajv:][putanja]fajl [parametri]\n\n  /L:podrucje1[,min_vel1][;podrucje2[,min_vel2]...\n             Navodi podrucje(a) memorije u koje treba ucitati program.\n             - podrucje1 navodi broj prvog memorijskog podrucja.\n             - min_vel1 navodi minimalnu velicinu, ako postoji, za podrucje1.\n             - podrucje2 navodi broj drugog memorijskog podrucja.\n             - min_vel2 navodi minimalnu velicinu, ako postoji, za podrucje2.\n             Mozete navesti koliko god zelite memorijskih podrucja.\n\n  /S         Smanjuje UMB do svoje minimalne velicine dok se program ucitava.\n\n  [drajv:][putanja]fajl\n             Navodi lokaciju i naziv programa koji treba ucitati.\n\n  parametri  Parametri programa koji se ucitava.\n.\n\n:TEXT_CMDHELP_LOADFIX\nUcitava program iznad prvih 64K memorije i pokrece program.\n\n  LOADFIX [drajv:][putanja]fajl\n\n Upotrebite LOADFIX za ucitavanje programa ukoliko ste dobili poruku\n \"Packed file corrupt\" pri pokusaju ucitavanja u nisku memoriju.\n.\n\n:TEXT_CMDHELP_MD\nKreira novi direktorijum.\n\n  MKDIR [drajv:]putanja\n  MD [drajv:]putanja\n.\n\n:TEXT_CMDHELP_PATH\nPrikazuje ili postavlja putanju za trazenje izvrsnih fajlova.\n\n  PATH [[drajv:]putanja[;...]]\n  PATH ;\n\n Pokrenite \"PATH ;\" za brisanje svih putanja i usmerenje komandne\n ljuske na trazenje izvrsnih fajlova samo u trenutnom direktorijumu.\n Pokrenite PATH bez parametara za prikaz trenutne vrednosti.\n.\n\n:TEXT_CMDHELP_PAUSE\nZaustavlja procesiranje batch programa i prikazuje poruku:\n\"Pritisnite bilo koji taster za nastavak...\" ili navedenu poruku.\n\n  PAUSE [poruka]\n.\n\n:TEXT_CMDHELP_PROMPT\nMenja odziv komandnog prompta.\n\n  PROMPT [tekst]\n\n  tekst    Navodi novi komandni prompt\n\n Prompt moze biti sastavljen od znakova i sledecih specijalnih kodova:\n\n      $Q   = (znak za jednako)\n      $$   $ (znak za dolar)\n      $T   Trenutno vreme\n      $D   Trenutni datum\n      $P   Trenutni drajv i putanja\n      $V   Verzija komandne ljuske\n      $N   Trenutni drajv\n      $G   > (znak za vece-od)\n      $L   < (znak za manje-od)\n      $B   | (znak za cev)\n      $H   Backspace (brise prethodni znak)\n      $E   Escape kod (ASCII kod 27)\n      $_   CR i LF kodovi (nova linija)\n\n Pokrenite PROMPT bez parametara za reset prompta na standardnu postavku.\n.\n\n:TEXT_CMDHELP_PUSHD\nGura trenutni direktorijum na vrh steka direktorijuma, uz opciju da promeni\ntrenutni radni direktorijum.\n\n  PUSHD [[drajv:]putanja]\n\n  Gde je [drajv:]putanja nova putanja koju zelite.\n.\n\n:TEXT_CMDHELP_POPD\nSkida direktorijum sa vrha steka direktorijuma, i postavlja ga za radni.\n\n  POPD [*]\n\n  Opcija '*' brise sadrzaj steka direktorijuma.\n.\n\n:TEXT_CMDHELP_DIRS\nPrikazuje sadrzaj steka direktorijuma.\n\n  DIRS\n.\n\n:TEXT_CMDHELP_RD\nUklanja (brise) direktorijum.\n\n  RMDIR [drajv:]putanja\n  RD [drajv:]putanja\n.\n\n:TEXT_CMDHELP_REM\nObelezava komentar (napomenu) u batch fajlu ili CONFIG.SYSu.\n\n  REM [komentar]\n.\n\n:TEXT_CMDHELP_REN\nMenja naziv fajlu ili direktorijumu.\n\n  RENAME [drajv:][putanja][dir1 | fajl1] [dir2 | fajl2]\n  REN [drajv:][putanja][dir1 | fajl1] [dir2 | fajl2]\n\n Dzoker znaci nisu dozvoljeni.\n\n Primetite da ne mozete navesti novi drajv ili putanju za odrediste.\n U tu svrhu upotrebite eksternu komandu MOVE.\n.\n\n:TEXT_CMDHELP_SET#1\nPrikazuje, postavlja, ili uklanja promenljive okruzenja.\n\n  SET [/C] [/P] [promenljiva=[string]]\n\n  promenljiva  Navodi ime promenljive okruzenja.\n  string       Navodi niz znakova za dodelu promenljivoj. Ukoliko string\n               nije naveden, promenljiva se uklanja iz okruzenja.\n\n Pokrenite SET bez parametara za prikaz trenutnih promenljivi okruzenja.\n\n  /C    Prisiljava zadrzavanje navedene velicine slova promenljive.\n  /P    Poziva upit sa stringom i dodeljuje korisnicki unos promenljivoj.\n\n Promenljiva se standardno menja u velika slova, ukoliko se vec ne\n nalazi u okruzenju, inace se navedena velicina slova zadrzava.\n.\n\n:TEXT_CMDHELP_SHIFT#1\nMenja poziciju zamenljivih parametara u batch fajlu.\n\n  SHIFT [DOWN]\n\n DOWN pomera prozor argumenata prema pocetku (%%0). U ostalim slucajevima\n pomera isti prema kraju.\n.\n\n:TEXT_CMDHELP_TIME#1\nPrikazuje ili postavlja sistemsko vreme.\n\n  TIME [/T] [vreme]\n\n  /T odvraca TIME od interaktivnosti.\n\n Pokrenite TIME bez parametara za prikaz trenutne postavke vremena i\n upit za novu. Pritisnite ENTER da sacuvate isto vreme.\n.\n\n:TEXT_CMDHELP_TRUENAME\nPrikazuje punu putanju trenutne ili navedene putanje.\n\n  TRUENAME [[drajv:][putanja][fajl]]\n.\n\n:TEXT_CMDHELP_TYPE\nPrikazuje sadrzaj tekstualnih fajlova.\n\n  TYPE [drajv:][putanja]fajl\n.\n\n:TEXT_CMDHELP_VER\nPrikazuje verziju komandne ljuske i ostale informacije.\n\n  VER [/R] [/W] [/D] [/C]\n\n  /R         Verzija jezgra i ostale informacije.\n  /W         Garancija komandne ljuske.\n  /D         Informacije o pravilima redistribuiranja.\n  /C         Imena saradnika.\n.\n\n:TEXT_CMDHELP_VERIFY\nPostavlja ili uklanja dodatne provere korektnosti upisa fajlova na disk.\n\n  VERIFY [ON | OFF]\n\n Pokrenite VERIFY bez parametara za prikaz trenutne postavke.\n.\n\n:TEXT_CMDHELP_FDDEBUG\nNA\n.\n\n:TEXT_CMDHELP_VOL\nPrikazuje labelu volumena i serijski broj, ukoliko isti postoje.\n\n  VOL [drajv:]\n.\n\n:TEXT_CMDHELP_QUESTION#1\nPrikazuje listu komandi i osobina dostupnih u ljusci.\n\n  ?\n  ?komanda [argument]\n\n Prva varijanta prikazuje dostupne komande i osobine ljuske.\n Druga varijanta ce izneti upit da li se navedena komanda treba\n izvrsiti, kao da je mod pracenja aktivan.\n.\n\n:TEXT_CMDHELP_WHICH\nTrazi i prikazuje izvrsne fajlove za svaku navedenu komandu.\n\n  WHICH {komanda}\n.\n\n:TEXT_CMDHELP_MEMORY#1\nNA\n.\n\n:TEXT_ERROR_COPY_PLUS_DESTINATION#1\nOdrediste COPY ne sme sadrzati plus ('+') znakove.\n.\n\n:TEXT_DELETE_FILE#1\nBrisanje fajla \"%s\".\n.\n"
  },
  {
    "path": "suppl/algnbyte.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* one byte alignment */\r\n/* do not use with Micro-C ! */\r\n\r\n#if defined(__WATCOMC__)\r\n#if __WATCOMC__ > 1000\r\n#pragma pack(__push,1);\r\n#else\r\n#pragma pack(1);\r\n#endif\r\n#elif defined(_MSC_VER) || defined(_QC) || defined(__GNUC__)\r\n    #pragma pack(1)\r\n#elif defined(__ZTC__)\r\n    #pragma ZTC align 1\r\n#elif defined(__TURBOC__) && (__TURBOC__ > 0x202)\r\n    #pragma option -a-\r\n#endif\r\n"
  },
  {
    "path": "suppl/algndflt.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n\r\n/* set structure alignment to default */\r\n/* do not use with Micro-C ! */\r\n\r\n#if defined(__WATCOMC__)\r\n#if __WATCOMC__ > 1000\r\n#pragma pack(__pop);\r\n#else\r\n#pragma pack();\r\n#endif\r\n#elif defined (_MSC_VER) || defined(_QC) || defined(__GNUC__)\r\n #pragma pack()\r\n#elif defined (__ZTC__)\r\n #pragma ZTC align\r\n#elif defined(__TURBOC__) && (__TURBOC__ > 0x202)\r\n #pragma option -a.\r\n#endif\r\n"
  },
  {
    "path": "suppl/appname.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tDeclarations for the application name/path etc. functions.\r\n\tFor details refer to DOC\\DETAILS.TEX\r\n\r\n*/\r\n\r\n#ifndef __APPNAME_H\r\n#define __APPNAME_H\r\n\r\n#ifndef __PORTABLE_H\r\n#include <portable.h>\r\n#endif\r\n#ifndef __DFN_H\r\n#include \"dfn.h\"\r\n#endif\r\n\r\nchar *appName(void);\r\nchar *appPath(void);\r\nchar *appFile(void);\r\nchar *appNameEx(void);\r\nchar *appPathEx(void);\r\nchar *appFileEx(void);\r\nint appInit(const char * const fnam);\r\nint appInitEx(const char * const fnam);\r\nint appInitEnv(void);\r\nint appInitEnvEx(void);\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/clnsuppl.bat",
    "content": "@echo off\r\nIF EXIST SKIP goto noSrc\r\nrem for %%a in (compile.me *.h suppl*.lib suppl*.lst vars.bat) do if exist %%a del %%a\r\nfor %%i in (all_done untar.exe untar.com untar.obj untar.map gnumake.mak) do if exist %%i del %%i>nul\r\nfor %%i in (compile.me suppl*.lib suppl*.lst echoto.bat vars.bat *.cfg)  do if exist %%i del %%i>nul\r\nIF NOT EXIST src\\NUL goto noSrc\r\n\r\ncd src\r\nFOR %%A in (*.obj) DO DEL %%A\r\nfor %%a in (suppllib.rsp echolib.bat *.cfg gnumake.mak) do if exist %%a del %%a>nul\r\nrem FOR %%A in (NLS\\*.*) DO DEL %%A\r\nrem RMDIR nls\r\nCD ..\r\nrem RMDIR src\r\n\r\n:noSrc\r\n"
  },
  {
    "path": "suppl/cntry.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tDOS NLS implementation -- \"Country\" information DOS-65-XX\r\n\tSee DOC\\CNTRY.H\r\n\r\n\tThese functions provide an easy access to the information\r\n\tstored in the DOS NLS, but does not actually offer any\r\n\tfunctions to transform/compare etc.\r\n\r\n*/\r\n\r\n#ifndef __CNTRY_H\r\n#define __CNTRY_H\r\n\r\n#ifndef __PORTABLE_H\r\n#include <portable.h>\r\n#endif\r\n#include \"suppl.h\"\r\n\r\n/* All information from Ralf Brown's interrupt list v5.6 */\r\nstruct Country_ {\t\t/* local copy of country information */\r\n\t/* pointers to tables */\r\n\tfartbl uppercaseTbl;\t/* uppercase for \"normal\" characters */\r\n\tfartbl lowercaseTbl;\t/* lowercase for \"normal\" chars (maybe NULL) */\r\n\tfartbl fupcaseTbl;\t\t/* uppercase for filename characters */\r\n\tfartbl collateTbl;\t\t/* collating table */\r\n#if defined(DBCS)\r\n\tfartbl dbcsTbl;\t\t\t/* DBCS table */\r\n#endif\r\n\r\n\tfartbl illegalChars;\t/* illegal characters in filenames */\r\n\tint illegalLen;\t\t\t/* illegal characters in filenames */\r\n\r\n\t/* length of the tables\r\n\t\tIf length <= 0x80 the table does not contain values for\r\n\t\tthe indexs 0..0x7F, but the pointers are adjusted that index 0x80\r\n\t\treally points to the first entry of the table. */\r\n\tint uppercaseLen;\t/* uppercase for \"normal\" characters */\r\n\tint lowercaseLen;\t/* lowercase for \"normal\" chars (maybe NULL) */\r\n\tint fupcaseLen;\t\t/* uppercase for filename characters */\r\n\tint collateLen;\t\t/* collating table */\r\n\r\n\t/* Extended country information */\r\n\tword country;\t\t/* currently active DOS country code */\r\n\tword charset;\t\t/* currently active DOS codepage */\r\n\tword datefmt;\t\t/* format of date: 0/1/2 == USA/Europe/Japan */\r\n\tbyte curSymbol[6];\t/* ASCIZ currency symbol */\r\n\tbyte thousendsSep[3];\t/* ASCIZ decimal separator */\r\n\tbyte decimalSep[3];\t/* ASCIZ decimal separator */\r\n\tbyte dateSep[3];\t/* ASCIZ date separator */\r\n\tbyte timeSep[3];\t/* ASCIZ time separator */\r\n\tbyte listSep[3];\t/* ASCIZ list separator */\r\n\tbyte curFormat;\t\t/*\tbit 0: 0/1 == preceed/follow value\r\n\t\t\t\t\t\t\tbit 1: separate cur sym from value by one space\r\n\t\t\t\t\t\t\tbit 2: cur sym replaces decimal point */\r\n\tbyte precision;\t\t/* number of digits after decimal point */\r\n\tbyte timefmt;\t\t/* bit 0: 0/1 == 12/24 hour clock */\r\n\r\n\t/* valid filename characters */\r\n\tbyte inclFirst, inclLast;\t/* permissible character range */\r\n\tbyte exclFirst, exclLast;\t/* excluded character range */\r\n\r\n\tbyte initialized;\r\n};\r\n\r\n#ifdef _MICROC_\r\n#define Country struct Country_\r\n#else /*#\t!(defined(_MICROC_)) */\r\ntypedef struct Country_ Country;\r\n#endif /*#\tdefined(_MICROC_) */\r\n\r\nCountry *nlsInfo(void);\r\n/*\r\n *\tReturn a pointer to a filled copy of above structure\r\n *\r\n *\tDuring the life-time of a program the information is retrieved once.\r\n *\r\n *\tReturn: Always != NULL, but maybe ome fields are NULL.\r\n */\r\n\r\nCountry *nlsNewInfo(void);\r\n/*\r\n *\tAs nlsInfo(), but causes to reread the information cached by\r\n *\tnlsInfo().\r\n */\r\n\r\n#endif /*#\t!defined(__CNTRY_H) */\r\n"
  },
  {
    "path": "suppl/compat/conio.h",
    "content": "/* conio.h compatibility header */\r\n\r\n#ifndef __CONIO_H\r\n#define __CONIO_H\r\n\r\n#include <stdio.h>\r\n#define cputs(x) fputs((x),stdout)\r\n\r\nstatic inline int getch(void)\r\n{\r\n\tunsigned char ch;\r\n\tasm volatile(\"int $0x21\" :\r\n\t\t     \"=Ral\"(ch) :\r\n\t\t     \"a\"(0x700));\r\n\treturn ch;\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/compat/dos.h",
    "content": "/* dos.h compatibility header */\r\n\r\n#ifndef __DOS_H\r\n#define __DOS_H\r\n\r\nstatic inline unsigned char inportb (unsigned short int port)\r\n{\r\n\tunsigned char v;\r\n\r\n\tasm volatile (\"inb %w1,%0\":\"=a\" (v):\"Nd\" (port));\r\n\treturn v;\r\n}\r\n\r\nstatic inline void outportb (unsigned short int port, unsigned char value)\r\n{\r\n\tasm volatile (\"outb %b0,%w1\": :\"a\" (value), \"Nd\" (port));\r\n}\r\n\r\n/* From LGPL DJGPP libc, Copyright (C) 1995 DJ Delorie */\r\nstatic inline void sound(int freq)\r\n{\r\n\tint scale = 1193046 / freq;\r\n\toutportb(0x43, 0xb6);\r\n\toutportb(0x42, scale & 0xff);\r\n\toutportb(0x42, scale >> 8);\r\n\toutportb(0x61, inportb(0x61) | 3);\r\n}\r\nstatic inline void nosound(void)\r\n{\r\n\toutportb(0x61, inportb(0x61) & ~3);\r\n}\r\n\r\nunion REGPACK {\r\n\tstruct {\r\n\t\tunsigned char al, ah, bl, bh, cl, ch, dl, dh;\r\n\t} h;\r\n\tstruct {\r\n\t\tunsigned short ax, bx, cx, dx, bp, si, di, ds, es, flags;\r\n\t} x;\r\n};\r\nextern void _intrf(int nr, union REGPACK *r) __attribute__((regparmcall));\r\n\r\nstatic inline unsigned getpsp(void)\r\n{\r\n\tunsigned psp, scratch;\r\n\tasm volatile(\"int $0x21\" :\r\n\t\t     \"=a\"(scratch), \"=b\"(psp) :\r\n\t\t     \"Rah\"((unsigned char)0x62) :\r\n\t\t     \"cc\");\r\n\treturn psp;\r\n}\r\n#define _psp getpsp()\r\n\r\nstatic inline unsigned char getosmajor(void)\r\n{\r\n\tunsigned char osmajor, scratch;\r\n\tasm volatile(\"int $0x21\" :\r\n\t\t     \"=Ral\"(osmajor), \"=Rah\"(scratch) :\r\n\t\t     \"1\"((unsigned char)0x30) :\r\n\t\t     \"bx\", \"cx\", \"cc\");\r\n\treturn osmajor;\r\n}\r\n#define _osmajor getosmajor()\r\n\r\n#define FP_OFF(fp)\t((unsigned)(fp))\r\n#define FP_SEG(fp)\t((unsigned)((unsigned long)(void __far *)(fp)>>16))\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/compat/io.h",
    "content": "/* io.h compatibility header */\r\n\r\n#ifndef __IO_H\r\n#define __IO_H\r\n\r\n#include <unistd.h>\r\n\r\n#ifdef __GNUC__\r\n#define _lseek lseek\r\n#endif\r\n\r\nextern int _open(const char *pathname, int flags, ...);\r\nextern int _creat(const char *pathname, mode_t mode);\r\nextern int _read(int fd, void *buf, size_t cnt);\r\nextern int _write(int fd, const void *buf, size_t cnt);\r\nextern int _close(int fd);\r\nextern long int _lseek(int fd, long int pos, int whence);\r\n\r\nstatic inline long int filelength(int fd)\r\n{\r\n  long int cur = _lseek(fd, 0, SEEK_CUR);\r\n  long int fsize = _lseek(fd, 0, SEEK_END);\r\n  _lseek(fd, cur, SEEK_SET);\r\n  return fsize;\r\n}\r\n#endif\r\n"
  },
  {
    "path": "suppl/compat/process.h",
    "content": "/* process.h compatibility header */\r\n\r\n#ifndef __PROCESS_H\r\n#define __PROCESS_H\r\n\r\n#include <stdlib.h>\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/dfn.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tDeclarations for the DOS filename functions.\r\n\r\n*/\r\n\r\n#ifndef __DFN_H\r\n#define __DFN_H\r\n\r\n#include <supl_def.h>\r\n#ifndef __PORTABLE_H\r\n#include <portable.h>\r\n#endif\r\n#include <nls_f.h>\r\n#ifdef _TC_LATER_\r\n#include <direct.h>\r\n#endif\r\n#ifdef __TURBOC__\r\n#include <stddef.h>\r\n#endif\r\n\r\n/* To support UNC paths, all functions are macro'ed from\r\n\tdfn*()   --->     dfnu*()\r\n*/\r\n#ifdef SUPPORT_UNC_PATH\r\n#define dfnmerge dfnumerge\r\n#define dfnsplit dfnusplit\r\n#define dfnexpand dfnuexpand\r\n#define dfnsqueeze dfnusqueeze\r\n#define dfnmatch dfnumatch\r\n#define dfnfullpath dfnufullpath\r\n#define dfnfullpath2 dfnufullpath2\r\n#endif\r\n\r\n#define DFN_FILE\t\t0x4000\r\n#define DFN_LFN\t\t\t0x2000\r\n#define DFN_SHARABLE\t0x0080\r\n#define DFN_PENDING_DELETE\t0x0080\r\n#define DFN_ARCHIVE\t\t0x0020\r\n#define DFN_DIRECTORY\t0x0010\r\n#define DFN_LABEL\t\t0x0008\r\n#define DFN_VOLUME\t\t0x0008\r\n#define DFN_SYSTEM\t\t0x0004\r\n#define DFN_HIDDEN\t\t0x0002\r\n#define DFN_WRITE\t\t0x0001\r\n#define DFN_WRITABLE\tDFN_WRITE\r\n/* Derived attributes */\r\n#define DFN_READ\t\tDFN_FILE\t/* every file can be read */\r\n#define DFN_READABLE\tDFN_READ\r\n\r\nstruct DFN_GLOB_t {\r\n\tchar *dfn_basedir;\r\n\tstruct {\r\n\t\tunsigned dfn_rewind:1;\r\n\t\tunsigned dfn_eof:1;\r\n\t} dfn_flags;\r\n\tunsigned dfn_searchattr;\r\n\tsize_t dfn_basedirlen;\r\n\tsize_t dfn_basediroffset;\r\n\tvoid *dfn_data;\r\n\tchar dfn_pattern[1];\r\n};\r\n#ifndef _MICROC_\r\ntypedef struct DFN_GLOB_t DFN_GLOB;\r\n#else\r\n#define DFN_GLOB struct DFN_GLOB_t\r\n#endif\r\n\r\nchar *dfnexpand(const char * const fname, char * const path);\r\nchar *dfnfullpath(const char * const fname);\r\nchar *dfnfullpath2(const char * const fname);\r\nchar *dfnmerge(char *fname, const char * const dr, const char * const path\r\n , const char * const name, const char * const ext);\r\nint dfnsplit(const char * const fname, char ** const dr, char ** const path, char ** const name, char ** const ext);\r\nchar *dfnsqueeze(const char * const fname);\r\nchar *dfnpath(int drive);\r\nchar *dfntruename(const char * const fn);\r\nchar *dfnsearch(const char * const fname, const char * const path, const char * const ext);\r\nint dfnmatchcomponent(const char *fnam, const char *pattern);\r\nint dfnmatchcomponent2(const char *fnam, const char *pattern);\r\nint dfnmatchext(const char *const fnam, const char *pattern);\r\nint dfnmatchext2(const char *const fnam, const char *pattern);\r\nint dfnmatch(const char *fnam, const char *pattern);\r\nint dfnmatch2(const char *fnam, const char *pattern);\r\nint dfnmatchEx(const char *fnam\r\n\t, const char *pattern\r\n\t, int (*matchfct)(const char *, const char *));\r\nint isUNCpath(const char * const fname);\r\nchar *UNCpath(const char * const fname);\r\nint dfnwrdir(const char * const fnam);\r\nint dfnstat(const char * const fnam);\r\nint dfnmkfile(const char * const fnam);\r\nvoid dfn_tmpnam(char * const fnam);\r\nchar *dfnmktmp(const char * const path, const char * const ext);\r\nchar *dfnfilename(const char * const fnam);\r\nchar *dfnextension(const char * const fnam);\r\nchar *dfnfilenameext(const char * const fnam);\r\nchar *dfnbakname(const char * const fnam);\r\nint dfnfreplace(const char * const newname, const char * const oldname);\r\nint dfndelim(const int ch);\r\nint dfndelim2(const int ch);\r\nchar *dfnglobfilename(DFN_GLOB * const dir);\r\nchar *dfnglobfullfilename(DFN_GLOB * const dir);\r\nDFN_GLOB *dfnglobinit(const char * const pattern, unsigned flags);\r\nint dfnglobread(DFN_GLOB *const dir);\r\nvoid dfnglobfree(DFN_GLOB *dir);\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/dynstr.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tDynamic string functions.\r\n\r\nob(ject): dynstr\r\nsu(bsystem): dynstr\r\nty(pe): \r\nsh(ort description): Basic data type to represent a dynamic string\r\nlo(ng description): \r\npr(erequistes): \r\nva(lue): a (char*) pointer, must be initialized prior use\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): user\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\nob(ject): STR_SAVED_TOKENS\r\nsu(bsystem): dynstr\r\nty(pe): \r\nsh(ort description): data type for reentrant \\tok{strtok()} function\r\nlo(ng description): This data type is used to save to and restore from\r\n\treentrant information of the function \\tok{StrTokenize()}.\r\npr(erequistes): \r\nva(lue): Blackbox type used by \\tok{StrTokSave()} and \\tok{StrTokRestore()}\r\n\tonly.\r\nre(lated to): StrTokenize StrTokSave StrTokRestore\r\nse(condary subsystems): \r\nin(itialized by): StrTokSave\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\nob(ject): STR_QUOTES\r\nsu(bsystem): dynstr\r\nty(pe): \r\nsh(ort description): data type for quote-related functions\r\nlo(ng description): This structure consists of members describing\r\n\twhat quotes and character to be quoted the quote-related functions\r\n\tshall be aware of. The members enumerate the word delimiters,\r\n\tcharacters to be quoted, single character quotes, pairily used\r\n\tquotes and unpairily used quotes.\r\npr(erequistes): \r\nva(lue): \r\nre(lated to): StrQuote StrUnquote StrAppQStr\r\nse(condary subsystems): \r\nin(itialized by): user\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\nob(ject): StrTokStop\r\nsu(bsystem): dynstr\r\nty(pe): \r\nsh(ort description): End a \\fct{StrTokenize()} inspection\r\nlo(ng description): Instructres the function \\fct{StrTokenize} to\r\n\tflush all internal values in order to return \\fct{NULL} next time\r\n\tit is called and, therefore, definitely end a tokenizer loop \\em{and}\r\n\tensures that the string has been restored to its original value.\r\npr(erequistes): \r\nva(lue): none\r\nre(lated to): StrTokenize\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#ifndef __DYNSTR_H\r\n#define __DYNSTR_H\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"sstr.h\"\r\n#include \"nls_c.h\"\r\n\r\nstruct STR_SAVED_TOKENS_ {\r\n\tchar *str_next_saved_tokens;\r\n\tchar str_ch_saved_tokens;\r\n};\r\n\r\n#ifdef _MICROC_\r\n#define STR_SAVED_TOKENS struct STR_SAVED_TOKENS_\r\n#else\r\ntypedef struct STR_SAVED_TOKENS_ STR_SAVED_TOKENS;\r\n#endif\r\n\r\n/* Enumerates all quotes a string may be quoted with: */\r\n/* If one member is equal to NULL or \"\", the particular value\r\n\tdoes not exist. */\r\nstruct STR_QUOTES_ {\r\n\tconst char\r\n\t\t/* Characters that delimit two strings and must be quoted\r\n\t\t\tif they appear within a string. */\r\n\t *str_delimiters\r\n\t\t/* Characters that must be quoted if they appear within a\r\n\t\t\tstring. */\r\n\t,*str_toquote\r\n\t\t/* Characters that quote the immediately next character\r\n\t\t\tas the backslash '\\' does in C. These quotes are\r\n\t\t\tstill \"active\" within otherwise quoted strings. */\r\n\t,*str_singleQuotes\r\n\t\t/* Characters that enclose a quoted string. The same character\r\n\t\t\tappears before and after the string, just like the '\"' in C. */\r\n\t,*str_pairyQuotes\r\n\t\t/* Characters that enclose a quoted string. The first character,\r\n\t\t\tthe one on an even offset (first character has offset == 0),\r\n\t\t\tis the left quote, the second character is the right one.\r\n\t\t\tCompareble to parenthizes.  */\r\n\t,*str_unpairyQuotes\r\n\t\t/* Pairy and unpairy quotes (the left one is checked) that quote\r\n\t\t\tsingle quotes, too. */\r\n\t,*str_fullQuotes\r\n\t;\r\n};\r\n#ifdef _MICROC_\r\n#define STR_QUOTES STR_QUOTES_\r\n#else\r\ntypedef struct STR_QUOTES_ STR_QUOTES;\r\n#endif\r\n\r\n#ifdef _MICROC_\r\n#define dynstr char *\r\n#else\r\ntypedef char * dynstr;\r\n#endif\r\n\r\nint StriCmp(const char *s1, const char *s2);\r\nchar *StrDup(const char * const s);\r\n\r\n#define StrChg(poi,size)\tStrChg_(&(poi), (size))\r\nchar *StrChg_(char ** const poi, size_t len);\r\n\r\n#define StrFree(str) StrRepl_(&(str), 0)\r\n#define StrFree_(str) StrRepl_((str), 0)\r\n\r\n#define StrRepl(dest,src) StrRepl_(&(dest), (src))\r\nchar *StrRepl_(char ** const dest, char * const src);\r\n\r\n#ifdef _MICROC_\r\nregister char *StrConcat(int argcnt);\r\nregister char *EStrConcat(int argcnt);\r\n#else\r\nchar *StrConcat(int argcnt, ...);\r\nchar *EStrConcat(int argcnt, ...);\r\n#endif\r\n\r\nchar *StrTrim(char * const s);\r\nchar *StrChar(int ch);\r\nchar *StrStrip(char * const s, int ch);\r\n\r\n#define StrCpy(dest,src) StrCpy_(&(dest), (src))\r\nchar *StrCpy_(char ** const dest, const char * const src);\r\n/* Copy (duplicate) the string src[] into dest.\r\n\tIf src == NULL, this function is equal to StrFree(dest).\r\n\r\n\tReturn:\r\n\t\tNULL: malloc() failed || src == NULL\r\n\t\telse: *dest\r\n*/\r\n\r\n#define StrAppDelimStr(dst,src,q)\t\t\\\r\n\tStrAppDelimStr_(&(dst), (src), (q))\r\nchar *StrAppDelimStr_(char ** const dst, const char * const src\r\n , const STR_QUOTES * const quotes);\r\n\r\n#define StrAppStr(dst,src)\tStrCat_(&(dst), (src))\r\n#define StrAppStr_\tStrCat_\r\n#define StrCat(dest,src) StrCat_(&(dest), (src))\r\nchar *StrCat_(char ** const dest, const char * const src);\r\n\r\n#define StrAppQStr(dst,src,quote_struct)\t\t\\\r\n\tStrAppQStr_(&(dst), (src), (quote_struct))\r\nchar *StrAppQStr_(char ** const dest, const char * const src\r\n\t, const STR_QUOTES * const quotes);\r\n\r\n#define StrAppChr(dest,chr) StrAppChr_(&(dest), (chr))\r\nchar *StrAppChr_(char ** const dest, char chr);\r\n\r\nchar *StrQuote(const char * const s, const STR_QUOTES * const quotes);\r\n\r\nchar *StrUnquote(const char * const s, const STR_QUOTES * const quotes);\r\n\r\nint StrUnquoteTokenAppend(const char **src, const STR_QUOTES * const quotes\r\n\t, char ** const dst);\r\n\r\nint StrUnquoteToken(const char **src, const STR_QUOTES * const quotes\r\n\t, char ** const dst);\r\n\r\n\r\nchar *StrTokenize(char *str, const char * const token);\r\n#define StrTokStop() (void)StrTokenize(0, 0)\r\nvoid StrTokSave(STR_SAVED_TOKENS *st);\r\nvoid StrTokRestore(STR_SAVED_TOKENS *st);\r\n\r\nchar *StrLeft(const char * const s, size_t length);\r\nchar *StrRight(const char * const s, size_t length);\r\nchar *StrMiddle(const char * const s, size_t pos, size_t length);\r\nchar *StrTail(const char * const s, unsigned pos);\r\n\r\n#ifdef _MICROC_\r\n#define StrBeg strbeg\r\n#else\r\nint StrBeg(const char * const s1, const char * const s2);\r\n#endif\t\t/* !defined(_MICROC_) */\r\n\r\nint StrCString(char *str);\r\n\r\nchar *StrWord(char *s);\r\n\r\nchar *StrChr(const char * const s, int ch);\r\nsize_t StrnLen(const char * const s, size_t len);\r\nchar *StrDupe(const char * const beg, const char * const end);\r\n\r\n/* #define StrEnd Strend */\r\n\r\nextern void *Emalloc(size_t len);\r\nextern void *Ecalloc(size_t len);\r\nextern void *Erealloc(void *p, size_t size);\r\nvoid *Esetsize(void **const p, size_t);\r\nvoid *Eresize_(void **const p, size_t);\r\n#define Esetsize(poi,size)\tEsetsize_((void**)&(poi), (size))\r\n#define Eresize(poi,size)\tEresize_((void**)&(poi), (size))\r\nextern char *Estrdup(const char * const str);\r\n#define Estrchg(var,str) Estrchg_(&(var),(str))\r\nextern char *Estrchg_(char ** const pvar, const char * const str);\r\nextern char *Estrdupe(const char * const start, const char * const end);\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/environ.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n * $Locker$\t$Name$\t$State$\r\n\r\n Declaration of the subsystem environ\r\n\r\nob(ject): \r\nsu(bsystem): environ\r\nty(pe): \r\nsh(ort description): Type of the walkfunction passed to \\fct{env_forAll}\r\nlo(ng description): \r\npr(erequistes): \r\nva(lue): \r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#ifndef __ENVIRON_H\r\n#define __ENVIRON_H\r\n\r\n#include <portable.h>\r\n\r\n#ifdef _MICROC_\r\n#define ENV_WALKFUNC int *\r\n#else\r\ntypedef int (*ENV_WALKFUNC)(void *, word, word);\r\n#endif\r\n\r\n#ifndef _MICROC_\r\n/* In order to use these macros, <dos.h> must be #include'd */\r\n#define env_glbSeg peekw(_psp, 0x2c)\t/* return the current env seg addr */\r\n#define env_setGlbSeg(a) pokew(_psp, 0x2c, (a))\t/* set the current env seg addr */\r\n#else\r\n#define env_glbSeg env_glbSeg_()\r\n#define env_setGlbSeg env_setGlbSeg_\r\n#endif\r\n\r\n/* SUPPL may support two \"default\" segments:\r\n\tenv_glbSeg - the global segment as defined by the PSP, and\r\n\tenv_dfltSeg - an user-defined env segment, which is to replace the\r\n\t\tglobal segment fully (in regards of SUPPL)\r\n\r\n\tEnvironment functions, that excepts \"0\" as environent segment, expand\r\n\tuse env_dfltSeg first, env_glbSeg then.\r\n\r\n\tThe portable way is to use the function, though, for speed efficency\r\n\tthey are implemented via a global variable.\r\n*/\r\n#define env_dfltSeg  (suppl_dfltEnvSegm)\r\n#define env_setDfltSeg(value)\t(suppl_dfltEnvSegm = (value))\r\n\r\n\r\nextern unsigned env_resizeCtrl;\r\n/* Standard settings:\r\n\tdeny shrinking & moving, use UMBs, best fit */\r\n#define ENV_SHRINKBELOW 1\t\t/* resize below last used byte (will destroy\r\n\t\t\t\t\t\t\t\t\tenvironment, is necessary to delete env) */\r\n#define ENV_ALLOWMOVE\t2\t\t/* re-allocate environment segment if grow\r\n\t\t\t\t\t\t\t\t\tfails */\r\n#define ENV_USEUMB\t\t4\t\t/* when env moves, search in UMBs first */\r\n#define ENV_FIRSTFIT\t8\t\t/* when env moves, use allocation stragegy First Fit */\r\n#define ENV_LASTFIT\t\t16\t\t/* when env moves, use allocation stragegy Last Fit */\r\n\t\t\t/* If both ENV_FIRSTFIT & ENV_LASTFIT are set, behaviour is undefined */\r\n\t\t\t/* If none of the above are set, Best Fit is used */\r\n\r\n/* Defines for the env_replace() function: */\r\n#define ENV_DELETE\t\t1\t\t/* free old environment segment */\r\n#define ENV_COPY\t\t2\t\t/* copy old environment into new\r\n\t\t\t\t\t\t\t\t\tsegment, may destroy the environment, if\r\n\t\t\t\t\t\t\t\t\tnew seg is smaller than old one. */\r\n#define ENV_CLEAR\t\t4\t\t/* initialize new environment, so it does not\r\n\t\t\t\t\t\t\t\t\tcontain neither variables nor strings */\r\n#define ENV_CREATE\t\t8\t\t/* create a new environment */\r\n#define ENV_FREECOUNT\t16\t\t/* minimum amount of unused bytes specified */\r\n#define ENV_LIMITED\t\t32\t\t/* create smallest possible enviroment */\r\n\r\n\r\n/*!!!!!!!!!\r\n\tAll these functions replace segm by the current used environment if\r\n\tit is zero. The environment must be initialized with the environement\r\n\tvariable area and the string area (in the simpliest case, three byes 0).\r\n\t!!!!!!!!!*/\r\n\r\n#ifdef _MICROC_\r\nword env_glbSeg_(void);\r\nvoid env_setGlbSeg_(const word segm);\r\n#endif\r\n\r\nword env_create(const unsigned length);\r\nvoid env_delete(word segm);\r\nvoid env_clear(word segm);\r\nint cpyenv(const char * const var, char * const dst, const unsigned length);\r\nint env_get(word segm, const char * const var, char * const dst, const unsigned length);\r\nchar *dupvar(const char * const var);\r\nchar *env_dupvar(word segm, const char * const var);\r\nchar *env_fetch(word segm, const char * const var);\r\n#ifndef __GNUC__\r\nint putenv(const char *var);\r\n#endif\r\n#define chgenv(name,value) env_change(0,name,value)\r\nint env_change(word segm, const char * const var, const char * const value);\r\nint env_ovrVarOffset(word segm, word ofs, const char *varname\r\n , const char * const value);\r\nint env_insVarOffset(word segm, word ofs, const char * const varname\r\n\t, const char * const value);\r\n\r\n#ifdef _MICROC_\r\nregister word env_replace(word env /*, int mode, word segm/length*/);\r\n#else\r\nword env_replace(word env, int mode, ... /*word segm/length*/);\r\n#endif\r\n\r\nint env_matchVar(word segm, char * const var);\r\nint env_findAnyVar(word segm, const char * const var, word *ecase, word *icase);\r\n\r\nint env_noSpace(word segm, const char * const name, const char * const value, const word ign);\r\nword env_resize(word segm, int delta);\r\nword env_setsize(word segm, unsigned length);\r\n#define env_newsize(s,l)\tenv_setsize((s), (l))\r\nint env_forAll(word env, ENV_WALKFUNC fct, void *arg);\r\nword env_master(void);\r\nword env_shell(void);\r\n\r\n/*********\r\n\tEnvironment String handling functions\r\n\t*********/\r\n\r\nint env_nullStrings(word segm);\r\n\r\n/* int env_strings(const word segm); */\r\n#define env_strings(segm)\tenv_strcounter((segm), 0)\r\nint env_strcounter(word segm, int diff);\r\nword env_string(word segm, int stringNr);\r\nint env_strcpy(word segm, char * const buf, const int len, const int stringNr);\r\nchar *env_strdup(word segm, const int stringNr);\r\nint env_strput(word segm, const char * const buf, const int stringNr);\r\nint env_strinsert(word segm, const char * const buf, const int stringNr);\r\n\r\n/*********\r\n\tDO NOT PASS ZERO INTO THESE FUNCTIONS!!!\r\n\t*********/\r\n\r\n\r\nword env_findVar(const word segm, const char * const var);\r\nvoid env_subVarOffset(word segm, word offset);\r\nint env_appVar(word segm, const char * const name, const char * const value);\r\n\r\nint env_check(const word segm);\r\n/*\tCheck the environemnt, the return value:\r\n \t\t0:\tenvironment OK\r\n \t\t1:\tno environment at all (envseg is NULL)\r\n \t\t2:\tPSP corrupt (envseg points to an invalid memory block)\r\n \t\t3:\tvariable's space corrupted\r\n \t\t4:\tno string table\r\n \t\t5:\tstring table corrupted or no string table at all\r\n*/\r\n\r\nword env_firstFree(const word segm);\r\nword env_endOfVars(const word segm);\r\nword env_freeCount(const word segm);\r\nunsigned env_varlen(const word segm, const word offs);\r\nvoid env_relocateSegment(const word segm, const word tosegm);\r\n\r\n\r\n/* Private variables made public for efficency purpose only.\r\n\tAny use of them is highly unportable! */\r\nextern word suppl_dfltEnvSegm;\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/errcodes.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tError codes used by most functions returning (int) error\r\n\tcodes within SUPPL\r\n\r\n*/\r\n\r\n#ifndef __ERRCODES_H\r\n#define __ERRCODES_H\r\n\r\n#define ESUPPL_NONE\t\t 0\t\t/* no error */\r\n#define ESUPPL_OK\t\t 0\t\t/* no error */\r\n#define ESUPPL_ZERO\t\t 0\t\t/* no error */\r\n#define ESUPPL_MEM\t\t 1\t\t/* out of memory */\r\n#define ESUPPL_NOMEM\tESUPPL_MEM\r\n\t\t\t\t\t\t\t\t/* env: environment segment too small */\r\n#define ESUPPL_MISSINFO\t 2\t\t/* missing information */\r\n#define ESUPPL_FPATH\t30\t\t/* ill-formed filename path */\r\n#define ESUPPL_FACCESS\t31\t\t/* file access error */\r\n#define ESUPPL_INIT\t\t40\t\t/* Not initialized */\r\n\r\n#define ESUPPL_INVAL\t50\t\t/* Invalid argument, argument out of range */\r\n#define ESUPPL_INVENV\t51\t\t/* Invalid environment */\r\n#define ESUPPL_RANGE\t52\t\t/* Result too large */\r\n\t\t\t\t\t\t\t\t/* env: returned string too large for buffer */\r\n#define ESUPPL_NOENV\t53\t\t/* No environment at all */\r\n#define ESUPPL_NOENT\t55\t\t/* No entry / no such file or directory */\r\n\t\t\t\t\t\t\t\t/* env: no such variable / string */\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/external.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n#ifndef __EXTERNAL_H\r\n#define __EXTERNAL_H\r\n\r\nextern char *ARGV[];\r\nextern int ARGC;\r\nextern unsigned PSP;\r\nextern unsigned _AX_, _BX_, _CX_, _DX_, _DI_, _SI_;\r\nextern unsigned char Longreg[];\r\nextern unsigned IOB_size;\r\n\r\n#define fileno(a) ((a)->FILE_handle)\r\n#endif\r\n"
  },
  {
    "path": "suppl/fmemory.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tFar memory handling function.\r\n\r\n*/\r\n\r\n#ifndef __FMEMORY_H\r\n#define __FMEMORY_H\r\n\r\n#include <supl_def.h>\r\n\r\n#ifdef _MICROC_\t\t\t\t/* for use for Micro-C only */\r\n\r\n#define MK_FP(seg,ofs) (seg), (ofs)\r\n#define TO_FP(var) get_ds(), (var)\r\n#define _fnormalize(seg,ofs) _fnormalize_(&(seg), &(ofs))\r\n\r\n#else\t/* !_MICROC_ */\r\n\r\n#ifdef _TC_LATER_\r\n#include <string.h>\r\n\r\n#else\t/* !_TC_LATER_ */\r\n#if defined(_PAC_NOCLIB_) || defined(_TC_EARLY_)\r\n\r\n#ifdef _PAC_NOCLIB_\r\n#include <stdlib.h>\r\n#define _fmemcpy farmemcpy\r\n#define _fmemset farmemset\r\n\r\n#else\t/* !_PAC_NOCLIB_ */\r\nvoid far *_fmemcpy(void far * const dst, const void far * const src, unsigned length);\r\nvoid far *_fmemset(void far * const dst, int ch, unsigned length);\r\n#endif\t/* _PAC_NOCLIB_ */\r\n\r\nunsigned _fstrlen(const char far * const s);\r\nchar far *_fstrchr(const char far * const s, int ch);\r\nchar far *_fmemchr(const char far * const s, int ch, unsigned length);\r\nvoid far *_fmemmove(void far * const dst, const void far * const src, unsigned length);\r\nint _fmemcmp(const void far * const dst, const void far * const src, unsigned length);\r\nint _fmemicmp(const void far * const dst, const void far * const src, unsigned length);\r\nint _fstrcmp(const char far * const dst, const char far * const src);\r\nint _fstricmp(const char far * const dst, const char far * const src);\r\nvoid _fstrcpy(char far * const dst, const char far * const src);\r\n\r\n#endif /* defined(_PAC_NOCLIB_) || defined(_TC_EARLY_) */\r\n#endif\t\t/* _TC_LATER_ */\r\n\r\n#if defined(HI_TECH_C) || defined(_TC_EARLY_)\r\n#endif\r\n\t/* HiTech C has no huge pointers\r\n\t & early Turbo C does ignore the cast */\r\n\t/* In some circumstances any Borland C compiler do ignore the\r\n\t\tcast, so the macro is not suitable */\r\nvoid far *_fnormalize(void far *poi);\r\n/* #define _fnormalize(poi) ((void huge *)(poi)) */\r\n\r\nchar *_fdupstr(const char far * const s);\r\n#endif\t/* _MICROC_ */\r\n\r\n#ifdef _MICROC_\r\nunsigned _fstpcpy(unsigned const dseg, unsigned dofs\r\n , unsigned const sseg, unsigned sofs, unsigned length)\r\n#else\t/* !_MICROC_ */\r\nchar far* _fstpcpy (char far* dst, const char far* src);\r\n#endif\t/* _MICROC_ */\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/getopt.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tDeclarations of the GETOPT subsystem.\r\n\r\n\tIf macro GETOPT_LONG_NO_FLAG_MEMBER is defined before #including this\r\n\theader, the 'options' structure does not contain the 'flag'\r\n\tmember.\r\n\r\n*/\r\n\r\n#ifndef __GETOPT_H\r\n#define __GETOPT_H\r\n\r\n#include <portable.h>\r\n\r\nstruct option {\r\n\tconst char *name;\r\n\tint has_arg;\r\n#ifndef GETOPT_LONG_NO_FLAG_MEMBER\r\n\tint *flag;\r\n#endif\r\n\tint val;\r\n};\r\n\r\nstruct getopt_save_t {\r\n\tint gs_optind, gs_opterr;\r\n\tconst char *gs_optcur;\r\n};\r\n\r\nextern int\toptind, \t/* index into argv[] array */\r\n\t\t\toptopt,\t\t/* unmodified last-read character */\r\n\t\t\topterr;\t\t/* if non-zero, visually displays errors */\r\nextern char *optarg;\t/* address of argument of an argumented option */\r\nextern const char *optcur;\t/* address of next character to parse as\r\n\t\t\t\t\t\t\t\toption; if NULL, uses argv[optind] */\r\n\r\nint getopt(int argc, const char * const * const argv, const char * const options);\r\n\r\nint getopt_long(int argc, const char * const *  const argv\r\n , const char * const optstring\r\n , const struct option * const longopts, int * const longindex);\r\nint getopt_long_only(int argc, const char * const * const argv\r\n , const char * const optstring\r\n , const struct option * const longopts, int * const longindex);\r\nint getopt_long_noFlag(int argc, const char * const * const argv\r\n , const char * const optstring\r\n , const struct option * const longopts, int * const longindex);\r\nint getopt_long_only_noFlag(int argc, const char * const * const argv\r\n , const char * const optstring\r\n , const struct option * const longopts, int * const longindex);\r\n\r\n#ifdef GETOPT_LONG_NO_FLAG_MEMBER\r\n#define getopt_long getopt_long_noFlag\r\n#define getopt_long_only getopt_long_only_noFlag\r\n#endif\r\n\r\n#define getopt_save(s)\tgetopt_save_(aS(s))\r\nvoid getopt_save_(struct getopt_save_t * const sbuf);\r\n#define getopt_restore(s)\tgetopt_restore_(aS(s))\r\nvoid getopt_restore_(struct getopt_save_t * const sbuf);\r\nvoid getopt_init(void);\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/makefile.mak",
    "content": "CFG_DEPENDENCIES = makefile.mak\r\n\r\nTOP = ..\r\n!include \"$(TOP)/config.mak\"\r\n\r\nall : src/$(CFG)\r\n\r\nsrc/$(CFG) : $(CFG)\r\n\t$(CP) $(CFG) src\r\n\r\nclean :\r\n\tclnsuppl.bat\r\n"
  },
  {
    "path": "suppl/mcb.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n * $Locker$\t$Name$\t$State$\r\n *\r\n * header file for the MCB handling functions\r\n\r\n*/\r\n\r\n#ifndef __MCB_H\r\n#define __MCB_H\r\n\r\n#include <portable.h>\r\n\r\n#define SEG2MCB(segm) ((segm) - 1)\r\n#define MCB2SEG(mcb) ((mcb) + 1)\r\n\r\n\t/* Don't use this constant; use SEG2MCB() or MCB2SEG() instead */\r\n#define SEG_OFFSET 0x10\r\n\r\nword mcb_env(const word segm);\r\n#ifdef NDEBUG\r\n#define mcb_env(mcb) peekw((mcb), SEG_OFFSET + 0x2c)\r\n#endif\r\n\r\n#include <algnbyte.h>\r\nstruct MCB {\r\n\tbyte mcb_type;\t\t/* type of MCB, 'Z': no following MCB, 'M': following */\r\n\tword mcb_ownerPSP;\t/* PSP number of owner of this block */\r\n\tword mcb_size;\t\t/* size of this MCB */\r\n\tbyte mcb_rsrvd[3];\t/* unused */\r\n\tbyte mcb_name[8];\t/* name of program file name if PSP created in exec() */\r\n};\r\n#include <algndflt.h>\r\nstruct SUPPL_verify_alignment_MCB {\r\n\tchar x[ 1 ];\r\n};\r\n\t/* Don't use these constant; use offsetof(struct MCB, xxx) instead */\r\n#define MCB_OFF_TYPE 0\r\n#define MCB_OFF_OWNER 1\r\n#define MCB_OFF_SIZE 3\r\n#define MCB_OFF_NAME 8\r\n\r\n#ifdef _MICROC_\r\n#define MCB_WALKFUNC int *\r\n#else\r\ntypedef int (*MCB_WALKFUNC)(void *, word);\r\n#endif\r\n\r\nunsigned mcb_length(const word segm);\r\nint mcb_walk(word mcb, const MCB_WALKFUNC fct, void * const arg);\r\nint isShell(const word mcb);\r\nint isPSP(const word mcb);\r\nint isMCB(const word mcb);\r\nint isEnv(const word mcb);\r\nword nxtMCB(word mcb);\r\nint mcb_allParents(word mcb, MCB_WALKFUNC fct, void *arg);\r\nword mcb_primaryShell(void);\r\nword mcb_owner(word mcb);\r\nword mcb_shell(word mcb);\r\nword mcb_first(void);\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/msglib.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tGlobal message handling definitions.\r\n\r\n*/\r\n\r\n#ifndef __MSGLIB_H\r\n#define __MSGLIB_H\r\n\r\n#include <stdio.h>\r\n#include <portable.h>\r\n\r\n/*\r\n *\tSome macros of message groups\r\n */\r\n#define GLOBAL_GROUP 8\r\n#define LOCAL_GROUP 0\r\n#define msgIsGlobal(grp) ((grp) >= GLOBAL_GROUP)\r\n#define msgIsLocal(grp)  ((grp) <  GLOBAL_GROUP)\r\n\r\n\r\n#ifndef MSG_METHOD\r\n\t/* No method specified -> default to access method #1 */\r\n#define MSG_METHOD\t1\r\n#endif /*#\t!defined(MSG_METHOD) */\r\n\r\n/*\r\n *\tAt this point exactly one of MSG_METHOD? is defined and valid\r\n */\r\n\r\n#if MSG_METHOD == 1\r\n#include <msglib/msgconf1.h>\r\n#endif /*#\tMSG_METHOD == 1 */\r\n\r\n#if MSG_METHOD == 2\r\n#include <msglib/msgconf2.h>\r\n#endif /*#\tMSG_METHOD == 2 */\r\n\r\n\t/* Source-In the initialization for all access methods */\r\n#include <msglib/msgconf0.h>\r\n\r\n\r\n/**REMOVE ON**/\r\n#define Y_errMR \"Error in message retreiver:\\n\"\r\n#define Y_noMem \"Out of memory\\n\"\r\n#define MSG_errNrMR 125\r\n/**REMOVE OFF**/\r\n\r\n\r\n#endif /*#\t!defined(__MSGLIB_H) */\r\n"
  },
  {
    "path": "suppl/msgs.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n   SUPPL message implementation\r\n\r\n\tEach of these functions emit one particular error.\r\n\r\n\tOne can create a library implementing just these functions and\r\n\tlink it _before_ SUPPL, and one gets an user-specific error handling.\r\n\r\n*/\r\n\r\n#ifndef __MSGS_H\r\n#define __MSGS_H\r\n\r\n#include <portable.h>\r\n#include \"msgs_w.loc\"\r\n\r\nvoid Esuppl_argMissing(char ch);\r\nvoid Esuppl_nonArgOption(char ch);\r\nvoid Esuppl_argOption(char ch);\r\nvoid Esuppl_lArgOption(const char * const name);\r\nvoid Esuppl_option(char ch);\t\t/* option not found */\r\nvoid Esuppl_lOption(const char * const name);\t/* option not found */\r\nvoid Esuppl_longOption(void);\r\nvoid Esuppl_noMem(void);\r\nvoid Esuppl_writeFile(const char * const fnam);\r\nvoid Esuppl_accessFile(const char * const fnam);\r\nvoid Esuppl_openFile(const char * const fnam);\r\nvoid Esuppl_createFile(const char * const fnam);\r\nvoid Esuppl_readFile(const char * const fnam);\r\nvoid Esuppl_creatTmpFnam(void);\r\nvoid Esuppl_tmpOpen(const char * const fnam);\r\nvoid Esuppl_wrCfgFile(const char *fnam);\r\nvoid Esuppl_ovrLinkcount(const char *fnam);\r\n\r\nextern void hlpScreen(void);\r\nextern const char Y_noFNam[];\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/nls.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tDOS NLS implementation -- \"use\" functions of the NLS info\r\n\r\n*/\r\n\r\n#ifndef __NLS_H\r\n#define __NLS_H\r\n\r\n#include \"cntry.h\"\r\n\r\nstruct SupplTime {\t\t\t/* Universial time/date structure */\r\n\t\t\t/* This structure is used by all NLS time/date based\r\n\t\t\t\tfunctions and may be initialized partially only */\r\n\tint ti_hour, ti_minute, ti_second, ti_hundred;\r\n\tint ti_day, ti_month, ti_year;\r\n\tint ti_weekday;\r\n};\r\n\r\n#ifndef _MICROC_\r\ntypedef struct SupplTime nlstime;\r\n#else\r\n#define nlstime struct SupplTime\r\n#endif\r\n\r\n/*\r\n * Fill in the time portions: hour, minute, seconds, hundred seconds\r\n */\r\nvoid nlsCurTime(nlstime *t);\r\n\r\n/*\r\n * Fill in the date portions: day, month, year\r\n */\r\nvoid nlsCurDate(nlstime *t);\r\n\r\n\r\n#endif /*#\t!defined(__CNTRY_H) */\r\n"
  },
  {
    "path": "suppl/nls_c.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tNLS-depended dynamic string functions.\r\n\r\n*/\r\n\r\n#ifndef __NLS_C_H\r\n#define __NLS_C_H\r\n\r\n#include <portable.h>\r\n\r\nint toLower(int ch);\r\nint toUpper(int ch);\r\nint toFUpper(int ch);\r\n\r\n#define memcmpI MemiCmp\r\nint MemiCmp(const byte *buf1, const byte *buf2, unsigned len);\r\n\r\n#define _fmemcmpI _fMemiCmp\r\n#ifdef _MICROC_\r\nint _fMemiCmp(unsigned const dseg, unsigned dofs\r\n , unsigned const sseg, unsigned sofs, unsigned length);\r\n#else\r\nint _fMemiCmp(const byte far * dest, const byte far * src, unsigned length);\r\n#endif\r\n\r\nint StriCmp(const char *s1, const char *s2);\r\nchar *StrUpr(char *s);\r\nchar *MemUpr(char buf[], unsigned length);\r\nvoid _fStrUpr(const word dseg, word dofs);\r\nvoid _fMemUpr(const word dseg, word dofs, unsigned length);\r\n\r\nint isodigit(int ch);\r\n#define isodigit(ch)\t((ch) >= '0' && (ch) <= '7')\r\nint toxdigit(int ch);\r\n\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/nls_f.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tDeclarations for NLS depended DOS filename functions.\r\n\r\n*/\r\n\r\n#ifndef __NLS_F_H\r\n#define __NLS_F_H\r\n\r\n#include <portable.h>\r\n\r\nint toFUpper(int ch);\r\n\r\n#define memcmpFI MemFCmp\r\nint MemFCmp(const void *buf1, const void *buf2, unsigned len);\r\n\r\n#define _fmemcmpFI _fMemFCmp\r\n#ifdef _MICROC_\r\nint _fMemFCmp(unsigned const dseg, unsigned dofs\r\n , unsigned const sseg, unsigned sofs, unsigned length);\r\n#else\r\nint _fMemFCmp(const void far * dest, const void far * src, unsigned length);\r\n#endif\r\n\r\nchar *StrFUpr(char *s);\r\nvoid *MemFUpr(void * const buf, unsigned length);\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/p-bc.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* Portable include file for Turbo/Borland C */\r\n#ifdef __TURBOC__\r\n\r\n#ifndef ffblk\r\n#include <dir.h>\r\n#endif\r\n\r\n/* Global argc/argv variables */\r\n#define G_ARGV _argv\t\t/* global char **argv\tvariable */\r\n#define G_ARGC _argc\t\t/* global int argc\tvariable */\r\n#define G_ARG_DEF\t\t\t/* definition of global variables */\r\n#define G_ARG_INIT\t\t\t/* initialization of global variables */\r\n\r\n/* byte/word/dword type */\r\ntypedef unsigned char byte;\r\ntypedef unsigned short word;\r\ntypedef int FLAG;\t/* no special 8-bit handling */\r\ntypedef unsigned FLAG8;\t/* no special 8-bit handling */\r\ntypedef unsigned long dword;\r\n\r\n/* peekb() && pokeb() exist */\r\n#define peekw peek\r\n#define pokew poke\r\n\r\n#define _osversion MK_OSVERS(_osmajor, _osminor)\r\n\r\n/* get/set interrupt vecotr */\r\ntypedef void interrupt (far *isr)();\r\n#define set_isrfct(num,fct) setvect((num), (isr)(fct))\r\n#define get_isr(num,var) ((var) = getvect(num))\r\n#define set_isr(num,var) setvect((num), (var))\r\n#define ASMINTERRUPT interrupt\r\n\r\n/* calling interrupt */\r\ntypedef struct REGPACK IREGS;\r\n#define intrpt intr\r\n\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/p-gcc.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* Portable include file for GCC (ia16-elf-gcc) */\r\n\r\n#ifdef __GNUC__\r\n\r\n#include <stdlib.h>\r\n#include <stddef.h>\r\n#ifndef EZERO\r\n#define EZERO 0\r\n#endif\r\n\r\n#ifdef __FAR\r\n#define far __far\r\n#ifndef __IA16_FEATURE_FAR_STATIC_STORAGE\r\n#error Please upgrade ia16-elf-gcc to get support for far static storage\r\n#endif\r\n#else\r\n#define far\r\n#endif\r\n\r\n#define cdecl __attribute__((cdecl))\r\n\r\n/* Global argc/argv variables */\r\n#define G_ARGV _argv\t\t/* global char **argv\tvariable */\r\n#define G_ARGC _argc\t\t/* global int argc\tvariable */\r\n#define G_ARG_DEF\t\t\t/* definition of global variables */\r\n#define G_ARG_INIT\t\t\t/* initialization of global variables */\r\n\r\n\r\n\r\n/* byte/word/dword type */\r\ntypedef unsigned char byte;\r\ntypedef unsigned short word;\r\ntypedef unsigned FLAG;\r\ntypedef unsigned FLAG8;\r\n#ifdef __LP64__\r\ntypedef unsigned dword;\r\n#else\r\ntypedef unsigned long dword;\r\n#endif\r\n\r\n#ifndef _CLIB_\r\n#define peekb(segm,ofs) (*(byte far*)MK_FP((segm),(ofs)))\r\n#define peekw(segm,ofs) (*(word far*)MK_FP((segm),(ofs)))\r\n#define pokeb(segm,ofs,value) (peekb((segm),(ofs)) = (byte)(value))\r\n#define pokew(segm,ofs,value) (peekw((segm),(ofs)) = (word)(value))\r\n#endif\r\n\r\n\r\n#define _osversion MK_OSVERS(_osmajor, _osminor)\r\n\r\n/* get/set interrupt vector */\r\ntypedef void __far *isr;\r\n#define set_isrfct(num,fct) _dos_setvect((num), (isr)(fct))\r\n#define get_isr(num,var) ((var) = _dos_getvect(num))\r\n#define set_isr(num,var) _dos_setvect((num), (var))\r\n#define ASMINTERRUPT\r\n\r\n/* calling an interrupt */\r\ntypedef struct {\r\n\tunsigned int\tr_ax;\r\n\tunsigned int\tr_bx;\r\n\tunsigned int\tr_cx;\r\n\tunsigned int\tr_dx;\r\n    unsigned int    r_bp;\r\n    unsigned int    r_si;\r\n    unsigned int    r_di;\r\n    unsigned int    r_ds;\r\n    unsigned int    r_es;\r\n    unsigned int    r_flags;\r\n} IREGS;\r\n#define intrpt(num,regs) _intrf((num), (union REGPACK*)(regs))\r\n\r\nstatic inline unsigned short CS_(void)\r\n{\r\n\tunsigned short ret;\r\n\tasm volatile(\"mov %%cs, %0\" : \"=rm\"(ret));\r\n\treturn ret;\r\n}\r\n#define _CS CS_()\r\n\r\n/* get/set current working drive */\r\nstatic inline int getdisk(void)\r\n{\r\n\tunsigned char ret;\r\n\tasm volatile(\"int $0x21\" : \"=Ral\"(ret) : \"Rah\"((char)0x19));\r\n\treturn ret;\r\n}\r\n\r\nstatic inline int setdisk(int drive)\r\n{\r\n\tunsigned char ret;\r\n\tasm volatile(\"int $0x21\" : \"=Ral\"(ret) : \"Rah\"((char)0xe), \"d\"(drive));\r\n\treturn ret;\r\n}\r\n\r\n/* get/set file time and date */\r\nstatic inline int _dos_getftime(int fd, unsigned *date, unsigned *time)\r\n{\r\n\tunsigned int ret, carry;\r\n\r\n\tasm volatile(\"int $0x21; sbb %0, %0\" :\r\n\t\t     \"=r\"(carry), \"=a\"(ret), \"=c\"(*time), \"=d\"(*date) :\r\n\t\t     \"a\"(0x5700), \"b\"(fd));\r\n\treturn carry ? ret : 0;\r\n}\r\n\r\nstatic inline int _dos_setftime(int fd, unsigned date, unsigned time)\r\n{\r\n\tunsigned int ret, carry;\r\n\r\n\tasm volatile(\"int $0x21; sbb %0, %0\" :\r\n\t\t     \"=r\"(carry), \"=a\"(ret) :\r\n\t\t     \"a\"(0x5701), \"b\"(fd), \"c\"(time), \"d\"(date));\r\n\treturn carry ? ret : 0;\r\n}\r\n\r\nstatic inline void far *_dos_getvect(int intno)\r\n{\r\n\tunsigned short seg, off;\r\n\tasm volatile(\"int $0x21\" :\r\n\t\t     \"=e\"(seg), \"=b\"(off) :\r\n\t\t     \"Rah\"((char)0x35), \"Ral\"((char)intno));\r\n\treturn MK_FP(seg,off);\r\n}\r\n\r\nstatic inline void _dos_setvect(int intno, void far *vect)\r\n{\r\n\tasm volatile(\"int $0x21\" :\r\n\t\t     : \"Rah\"((char)0x25), \"Ral\"((char)intno),\r\n\t\t       \"Rds\"(FP_SEG(vect)), \"d\"(FP_OFF(vect)));\r\n}\r\n\r\nstatic inline void far *getdta(void)\r\n{\r\n\tunsigned short seg, off;\r\n\tasm volatile(\"int $0x21\" : \"=e\"(seg), \"=b\"(off) : \"Rah\"((char)0x2f));\r\n\treturn MK_FP(seg,off);\r\n}\r\n\r\nstatic inline void setdta(void far *dta)\r\n{\r\n\tasm volatile(\"int $0x21\" :\r\n\t\t     : \"Rah\"((char)0x1a), \"Rds\"(FP_SEG(dta)), \"d\"(FP_OFF(dta)));\r\n}\r\n#endif\r\n"
  },
  {
    "path": "suppl/p-mc.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* Portable include file for Micro-C */\r\n#ifdef _MICROC_\r\n\r\n#if _MICROC_ -1 == -1\r\n#error \"Patch STDIO.H to add the hexadecimal version number to the macro _MICROC_, e.g. 0x136\"\r\n#endif\r\n\r\n\t/* non-predeclared global variables */\r\n#include <external.h>\r\n\t/* struct REGPACK */\r\n#include <intr.h>\r\n\r\n#define iM(q)\tq\t\t/* if Micro-C */\r\n#define nM(q)\t\t\t/* not Mirco-C */\r\n#define inM(q,w)\tq\t/* if-not Micro-C */\r\n#define aF(fct) &(fct)\t\t/* address of function */\r\n#define aS(structure) (structure)\t/* address of structure */\r\n#define cS(strucType)\t\t/* no structure casting */\r\n/* The definition of TO_FP resides in <fmemory.h> */\r\n\r\n#ifndef NULL\r\n#define NULL 0\r\n#endif\r\n\r\n#define peekb peek\r\n#define pokeb poke\r\n#define const\r\n#define _psp PSP\r\n\r\n/* Global argc/argv variables */\r\n#define G_ARGV ARGV\t\t/* global char **argv\tvariable */\r\n#define G_ARGC ARGC\t\t/* global int argc\tvariable */\r\n#define G_ARG_DEF\t\t/* definition of global variables */\r\n#define G_ARG_INIT\t\t/* initialization of global variables */\r\n\r\n/* Handling of pointers to structures */\r\n#define sInc(poi) ((poi) += sizeof(*(poi)))\r\n#define sDec(poi) ((poi) -= sizeof(*(poi)))\r\n#define sIdx(array,index) ((array) + (index) * sizeof(*(array)))\r\n#define sAdd(poi,displacement) ((poi) += (displacement) * sizeof(*(array)))\r\n#define sSub(poi,displacement) ((poi) -= (displacement) * sizeof(*(array)))\r\n\r\n/* byte/word/dword type */\r\n#define byte unsigned char\r\n#define word unsigned\r\n#define FLAG byte\t/* Micro-C has special 8-bit handling */\r\n#define FLAG8 byte\t/* dito */\r\n#define get_ss get_ds\r\n#define size_t unsigned\r\n\r\n#define dword struct DWORD\r\nstruct DWORD {\r\n\tword lo;\t/* offset */\r\n\tword hi;\t/* segment */\r\n};\r\n#define setDW(var,seg,ofs) (var.hi = (seg), var.lo = (ofs))\r\n/* Micro-C does not support (*struct_pointer).member for struct_pointer->member */\r\n#define setDWP(varP,seg,ofs) (varP->hi = (seg), varP->lo = (ofs))\r\n#define DW_LO(var) var.lo\r\n#define DW_HI(var) var.hi\r\n#define DWP_LO(varP) varP->lo\r\n#define DWP_HI(varP) varP->hi\r\n#define DWARG dword *\t\t\t/* dword argument */\r\n\r\n/* Simulate long constants and long arguments */\r\n#define TO_LONG(num) 0, (unsigned)(num)\r\n#define MK_LONG(hi,lo) (unsigned)(hi), (unsigned)(lo)\r\n#define FARARG(var,type) word var/**/Seg, word var/**/Ofs\r\n#define COPYFARARG(var) var/**/Seg, var/**/Ofs\r\n#define longcmp1 longcmp\r\n\r\n/* version variables */\r\n#define _osmajor ((unsigned)version() >> 8)\r\n#define _osminor (version() & 0xff)\r\n#define _osversion version()\r\n\r\n/* seek() whence parameters */\r\n#define SEEK_SET 0\r\n#define SEEK_CUR 1\r\n#define SEEK_END 2\r\n\r\n/* DOS drive handling */\r\n#define getdisk get_drive\r\n#define setdisk set_drive\r\n\r\n/* set/get interrupt vector */\r\n#define isr dword\t\t/* type of variable to hold one vecotr */\r\n#define set_isrfct(num,fct) set_vector((num), get_cs(), &(fct))\r\n#define get_isr(num,var) get_vector((num), &(var).hi, &(var).lo)\r\n#define set_isr(num,var) set_vector((num), (var).hi, (var).lo)\r\n#define ASMINTERRUPT\r\n\r\n#define IREGS struct REGPACK\r\n#define intrpt intr\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/p-pac.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* Portable include file for Pacific C */\r\n\r\n#ifdef HI_TECH_C\r\n\r\n#include <dos.h>\r\n#include <stdlib.h>\r\n\r\n\t/* Pacific C does not support various stuff natively.\r\n\t\tTherefore we define a different macro for differing PAC\r\n\t\twith and without CLib.\r\n\t*/\r\n\r\n#ifndef _PAC_\r\n#ifndef _PAC_NOCLIB_\r\n#ifdef _CLIB_\r\n#define _PAC_\r\n#else\r\n#define _PAC_NOCLIB_\r\n#endif\t/* _CLIB_ */\r\n#endif\r\n#endif\r\n\r\n\r\n#ifdef _PAC_NOCLIB_\r\n/* Global argc/argv variables */\r\n#define G_ARGV ___argv\t\t/* global char **argv\tvariable */\r\n#define G_ARGC ___argc\t\t/* global int argc\tvariable */\r\n\t/* definition of global variables */\r\n#define G_ARG_DEF char *G_ARGV[]; int G_ARGC;\t\t\r\n\t/* initialization of global variables */\r\n#define G_ARG_INIT\tG_ARGV = argv; G_ARGC = argc;\r\nextern char *G_ARGV[];\t\t/* holds global argv */\r\nextern int G_ARGC;\t\t\t/* holds global argc */\r\n#else\r\n#define G_ARGV _argv\t\t/* global char **argv\tvariable */\r\n#define G_ARGC _argc\t\t/* global int argc\tvariable */\r\n#define G_ARG_DEF\t\t\t/* definition of global variables */\r\n#define G_ARG_INIT\t\t\t/* initialization of global variables */\r\n#endif\r\n\r\n\r\n\r\n/* byte/word/dword type */\r\ntypedef unsigned char byte;\r\ntypedef unsigned word;\r\ntypedef byte FLAG;\t/* PAC supports byte-aware arethmetics */\r\ntypedef byte FLAG8;\r\ntypedef unsigned long dword;\r\n\r\n#ifdef _PAC_NOCLIB_\r\n#define peekb(segm,ofs) (*(byte far*)MK_FP((segm),(ofs)))\r\n#define peekw(segm,ofs) (*(word far*)MK_FP((segm),(ofs)))\r\n#define pokeb(segm,ofs,value) (peekb((segm),(ofs)) = (byte)(value))\r\n#define pokew(segm,ofs,value) (peekw((segm),(ofs)) = (word)(value))\r\n#endif\r\n\r\n\r\n#ifdef _PAC_NOCLIB_\r\n#define _osminor (osversion() >> 8)\r\n#define _osmajor (osversion() & 0xff)\r\n#define _osversion osversion()\r\n#define _psp _psp_()\r\nextern unsigned _psp_(void);\r\n\r\n/* get/set interrupt vector */\r\n#include <intrpt.h>\r\n#define set_isrfct(num,fct) setiva((num), (isr)(fct))\r\n#define get_isr(num,var) ((var) = getiva(num))\r\n#define set_isr(num,var) setiva((num), (var))\r\n#define ASMINTERRUPT isr\r\n\r\n/* calling an interrupt */\r\ntypedef struct {\r\n\tunsigned int\tr_ax;\r\n\tunsigned int\tr_bx;\r\n\tunsigned int\tr_cx;\r\n\tunsigned int\tr_dx;\r\n    unsigned int    r_bp;\r\n    unsigned int    r_si;\r\n    unsigned int    r_di;\r\n    unsigned int    r_ds;\r\n    unsigned int    r_es;\r\n    unsigned int    r_flags;\r\n} IREGS;\r\n#define intrpt(num,regs) intr((num), (union REGPACK*)(regs))\r\n\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/p-watcom.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* Portable include file for Watcom C */\r\n\r\n#ifdef __WATCOMC__\r\n\r\n#include <direct.h>\r\n#include <stdlib.h>\r\n#include <stddef.h>\r\n#include <i86.h>\r\n\r\n/* Global argc/argv variables */\r\n#define G_ARGV _argv\t\t/* global char **argv\tvariable */\r\n#define G_ARGC _argc\t\t/* global int argc\tvariable */\r\n#define G_ARG_DEF\t\t\t/* definition of global variables */\r\n#define G_ARG_INIT\t\t\t/* initialization of global variables */\r\n\r\n\r\n\r\n/* byte/word/dword type */\r\ntypedef unsigned char byte;\r\ntypedef unsigned word;\r\ntypedef unsigned FLAG;\r\ntypedef unsigned FLAG8;\r\ntypedef unsigned long dword;\r\n\r\n#ifndef _CLIB_\r\n#define peekb(segm,ofs) (*(byte far*)MK_FP((segm),(ofs)))\r\n#define peekw(segm,ofs) (*(word far*)MK_FP((segm),(ofs)))\r\n#define pokeb(segm,ofs,value) (peekb((segm),(ofs)) = (byte)(value))\r\n#define pokew(segm,ofs,value) (peekw((segm),(ofs)) = (word)(value))\r\n#endif\r\n\r\n\r\n#define _osversion MK_OSVERS(_osmajor, _osminor)\r\n#define asm _asm\r\n\r\n/* get/set interrupt vector */\r\ntypedef void (__interrupt __far *isr)();\r\n#define set_isrfct(num,fct) _dos_setvect((num), (isr)(fct))\r\n#define get_isr(num,var) ((var) = _dos_getvect(num))\r\n#define set_isr(num,var) _dos_setvect((num), (var))\r\n#define ASMINTERRUPT interrupt cdecl\r\n\r\n/* calling an interrupt */\r\ntypedef struct {\r\n\tunsigned int\tr_ax;\r\n\tunsigned int\tr_bx;\r\n\tunsigned int\tr_cx;\r\n\tunsigned int\tr_dx;\r\n    unsigned int    r_bp;\r\n    unsigned int    r_si;\r\n    unsigned int    r_di;\r\n    unsigned int    r_ds;\r\n    unsigned int    r_es;\r\n    unsigned int    r_flags;\r\n} IREGS;\r\n\r\n#if __WATCOMC__ <= 1290\r\nvoid intrf(int inter_no, union REGPACK *regs); \r\n#endif\r\n#define intrpt(num,regs) intrf((num), (union REGPACK*)(regs))\r\n\r\nunsigned CS_(void);\r\n#pragma aux CS_ = \"mov ax, cs\" __value[__ax];\r\n#define _CS CS_()\r\n\r\n/* get/set current working drive */\r\nextern short getdisk(void);\r\n#pragma aux getdisk = \\\r\n\t\"mov ah, 19h\"\t\\\r\n\t\"int 21h\"\t\\\r\n\t\"xor ah, ah\"\t\\\r\n\t__value [__ax]\r\n\r\nextern short setdisk(int newdrive);\r\n#pragma aux setdisk = \\\r\n\t\"mov ah, 0eh\"\t\\\r\n\t\"int 21h\"\t\\\r\n\t\"xor ah, ah\"\t\\\r\n\t__parm [__dx]\t\\\r\n\t__modify [__dx]\t\\\r\n\t__value [__ax]\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/portable.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\r\n*/\r\n\r\n#ifndef H__PORTABLE_\r\n#define H__PORTABLE_\r\n\r\n#include <limits.h>\r\n#include \"regproto.h\"\r\n\r\n#define NUL '\\0'\r\n#define MK_OSVERS(major,minor) ((major << 8) | (minor))\r\n\r\n#undef FARDATA\r\n#undef FARCODE\r\n\r\n#ifdef _MICROC_\r\n\r\n#include <p-mc.h>\r\n\r\n#else\t/* no _MICROC_ */\r\n\r\n#if defined(__HUGE__) || defined(__LARGE__) || defined(__COMPACT__)\r\n#define FARDATA\r\n#endif\r\n#if defined(__HUGE__) || defined(__LARGE__) || defined(__MEDIUM__)\r\n#define FARCODE\r\n#endif\r\n\r\n/*\r\n *\tCurrently supported:\r\n *\t\tBorland C/C++ v2+\r\n *\t\tPacific C v7.51\r\n *\t\tWatcom v10.6\r\n */\r\n\r\n#define iM(q)\t\t\t/* if Micro-C */\r\n#define nM(q)\tq\t\t/* not Mirco-C */\r\n#define inM(q,w)\tw\t/* if-not Micro-C */\r\n#define aF(fct) (fct)\t\t/* address of function */\r\n#define aS(structure) &(structure)\t/* address of structure */\r\n#define cS(strucType) (strucType)\t/* casting of a structure */\r\n\r\n\r\n/* Handling of pointers to structures */\r\n#define sInc(poi) ++(poi)\r\n#define sDec(poi) --(poi)\r\n#define sIdx(array,index) ((array) + (index))\r\n#define sAdd(poi,displacement) ((poi) += (displacement))\r\n#define sSub(poi,displacement) ((poi) -= (displacement))\r\n\r\n/* far pointer variable handling */\r\n#define TO_FP(var) ((void far*) (var))\t/* cast variable to far pointer */\r\n#define FARARG(var,type) type far* var\r\n#define COPYFARARG(var) var\r\n\r\n/* DWORD variables handling */\r\n#define setDW(var,seg,ofs) ((var) = (dword)MK_FP(seg,ofs))\r\n#define setDWP(varP,seg,ofs) (*(varP) = (dword)MK_FP(seg,ofs))\r\n#define DW_LO(var) ((word)(var))\r\n#define DW_HI(var) ((word)((var) >> 16))\r\n#define DWP_LO(var) ((word)(var))\r\n#define DWP_HI(var) ((word)((var) >> 16))\r\n#define DWARG dword\r\n\r\n/* Simulate long constants and long arguments */\r\n#define TO_LONG(num) (unsigned long)(num)\r\n#define MK_LONG(hi,lo) (((unsigned long)(hi) << 16) | (unsigned)(lo))\r\n\r\n\r\n#ifndef NULL\r\n#ifdef FARDATA\r\n#define NULL (0L)\r\n#else\r\n#define NULL (0)\r\n#endif\r\n#endif\r\n\r\n/* LONGMATH */\r\n#define longcpy(a,b) ((a) = (b))\r\n#define longset(a,b) ((a) = (b))\r\n#define longmul(a,b) ((a) *= (b))\r\n#define longdiv(a,b) ((a) /= (b))\r\n#define longadd(a,b) ((a) += (b))\r\n#define longsub(a,b) ((a) -= (b))\r\n#define longtst(a) (!!(a))\r\nint longcmp(long d1, long d2);\r\n#define longcmp1(a,b) ((signed long)(a) - (signed long)(b))\r\n\r\n#define longseti(a,b) ((a) = (int)(b))\r\n#define longmuli(a,b) ((a) *= (int)(b))\r\n#define longdivi(a,b) ((a) /= (int)(b))\r\n#define longaddi(a,b) ((a) += (int)(b))\r\n#define longsubi(a,b) ((a) -= (int)(b))\r\n\r\n#define longsetu(a,b) ((a) = (unsigned)(b))\r\n#define longmulu(a,b) ((a) *= (unsigned)(b))\r\n#define longdivu(a,b) ((a) /= (unsigned)(b))\r\n#define longaddu(a,b) ((a) += (unsigned)(b))\r\n#define longsubu(a,b) ((a) -= (unsigned)(b))\r\n\r\n\r\n/* Source In compiler specific settings */\r\n#ifdef __TURBOC__\r\n#include \"p-bc.h\"\r\n#endif\r\n\r\n#ifdef HI_TECH_C\r\n#include \"p-pac.h\"\r\n#endif\r\n\r\n#ifdef __WATCOMC__\r\n#include \"p-watcom.h\"\r\n#endif\r\n\r\n#ifdef __GNUC__\r\n#include \"p-gcc.h\"\r\n#endif\r\n\r\n#endif\t/* _MICROC_ */\r\n\r\n#ifndef strend\r\n#define strend(s)\tstrchr((s), '\\0')\r\n#endif\r\n\r\n/*----------------------------------------------------------------------*/\r\n\r\n#define LOCAL static\r\n\r\n#define lonibble(v) (0x0f & (v))\r\n#define hinibble(v) (0xf0 & (v))\r\n\r\n#if CHAR_BIT == 8\r\n# define lobyte(v) ((UBYTE)(v))\r\n#else\r\n# define lobyte(v) ((UBYTE)(0xff & (v)))\r\n#endif\r\n#define hibyte(v) lobyte ((UWORD)(v) >> 8u)\r\n\r\n#if USHRT_MAX == 0xFFFF\r\n# define loword(v) ((unsigned short)(v))\r\n#else\r\n# define loword(v) (0xFFFF & (unsigned)(v))\r\n#endif\r\n#define hiword(v) loword ((v) >> 16u)\r\n\r\n#define MK_UWORD(hib,lob) (((UWORD)(hib) <<  8u) | (UBYTE)(lob))\r\n#define MK_ULONG(hiw,low) (((ULONG)(hiw) << 16u) | (UWORD)(low))\r\n\r\n/*----------------------------------------------------------------------*/\r\n\r\n#define MK_PTR(type,seg,ofs) ((type FAR*) MK_FP (seg, ofs))\r\n#if __TURBOC__ > 0x201\r\n# define MK_SEG_PTR(type,seg) ((type _seg*) (seg))\r\n#else\r\n# define _seg FAR\r\n# define MK_SEG_PTR(type,seg) MK_PTR (type, seg, 0)\r\n#endif\r\n\r\n#endif /* H__PORTABLE_ */\r\n"
  },
  {
    "path": "suppl/psp.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n * $Locker$\t$Name$\t$State$\r\n *\r\n * header file for PSP settings\r\n\r\n*/\r\n\r\n#ifndef __PSP_H\r\n#define __PSP_H\r\n\r\n#include <portable.h>\r\n\r\n#include <algnbyte.h>\r\n\r\nstruct PSP {\r\n\tbyte psp_cpm_call0[2];\t\t/* CP/M style program termination entry\r\n\t\t\t\t\t\t\t\t\t--> INT 20h (0xCD 0x20) */\r\n\tword psp_freeSegm;\t\t\t/* segm of first free byte above process */\r\n\tbyte psp_os2_fakeDOSversion;\r\n\tbyte psp_cpm_call5[5];\t\t/* FAR CALL to absolute 000C0h */\r\n\tvoid far*psp_oldInt22;\t\t/* value of INT-22 restored on exit (return) */\r\n\tvoid far*psp_oldInt23;\t\t/* value of INT-23 restored on exit (^Break) */\r\n\tvoid far*psp_oldInt24;\t\t/* value of INT-24 restored on exit (CritErr) */\r\n\tword psp_parentPSP;\r\n\tbyte psp_jft[20];\r\n\tword psp_envSegm;\r\n\tvoid far*psp_lastStack;\t\t/* SS:SP on last INT-21 */\r\n\tword psp_jft_numEntries;\r\n\tbyte far *psp_jft_addr;\r\n\tstruct PSP far*psp_share_prevPSP;\r\n\tbyte psp_dbcs_consoleFlag;\r\n\tbyte psp_append_truenameFlag;\r\n\tbyte psp_os2_flags;\r\n\tbyte psp_netware_taskNumber;\t/* valid if os2_flags == 0xCE */\r\n\tbyte psp_dosVersion[2];\t\t/* returned on DOS-30 */\r\n\tword psp_pdb_selectorNext;\r\n\tword psp_pdb_parition;\r\n\tword psp_pdb_next;\r\n\tbyte psp_win_flags;\t\t/* bit 0: set -> non-win app (==WINOLDAP) */\r\n\tbyte psp_reserved1;\r\n\tbyte psp_reserved1_1[2];\t/* Missing from RBIL v6.1 */\r\n\tword psp_pdb_entryStack;\r\n\tbyte psp_reserved2[2];\r\n\tbyte psp_serviceRequest[3];\t/* INT 21h / RETF */\r\n\tbyte psp_reserved3[2];\r\n\tbyte psp_extFCB1[7];\r\n\tbyte psp_fcb1[16];\r\n\tbyte psp_fcb2[16];\r\n\tbyte psp_reserved4[4];\r\n\tunion {\r\n\t\tbyte psp_dta[128];\r\n\t\tstruct {\r\n\t\t\tbyte psp_cmdlineLength;\r\n\t\t\tbyte psp_cmdline[127];\r\n\t\t};\r\n\t};\r\n};\r\n\r\n#include <algndflt.h>\r\n\r\nstruct SUPPL_verify_alignment_PSP {\r\n\tchar x[sizeof(struct PSP) == 128 ? 1 : -1];\r\n};\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/readme.txt",
    "content": "This version of FreeCOM has been compiled and linked with the SUPPL\r\nlibrary, which is available from the Steffen's site at\r\n\r\nftp://ftp-fd.inf.fh-rhein-sieg.de/pub/freedos/local/ALPHA\r\n-or-\r\nhttp://www2.inf.fh-rhein-sieg.de/~skaise2a/ska/sources.html#suppl\r\n\r\nA stripped down variant of SUPPL has been included into the FreeCOM\r\nrelease, because of several complains about the wicked process of\r\ncompilation. You can bypass the FreeCOM-build.bat sense of SUPPL\r\nby creating a file called \"SKIP\" in this directory (<<FreeCOM-Root>>\\SUPPL).\r\nThat way, you can use your own SUPPL, e.g. a newer release of it.\r\n"
  },
  {
    "path": "suppl/regproto.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* Enables the usage of the fast register pseudo vars for non-TURBO\r\n   compilers. That means the port Turbo -> non-Turbo is OK.\r\n   Back not, because the union holds the registers independed on\r\n   real registers.\r\n*/\r\n\r\n#ifndef __REGPROTO_H\r\n#define __REGPROTO_H\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n\r\n#ifdef __TURBOC__\r\n#define USEREGS\r\n#define NOREGS\t/* register variables active */\r\n#define _CFLAG (_FLAGS & 1)\r\n\r\n#else\r\n\r\n#ifdef _MICROC_\r\n#define USEREGS\r\n#define _AL (*(unsigned char *)&_AX_)\r\n#define _AH (((unsigned char *)&_AX_)[1])\r\n#define _BL (*(unsigned char *)&_BX_)\r\n#define _BH (((unsigned char *)&_BX_)[1])\r\n#define _CL (*(unsigned char *)&_CX_)\r\n#define _CH (((unsigned char *)&_CX_)[1])\r\n#define _DL (*(unsigned char *)&_DX_)\r\n#define _DH (((unsigned char *)&_DX_)[1])\r\n#define _AX _AX_\r\n#define _BX _BX_\r\n#define _CX _CX_\r\n#define _DX _DX_\r\n#define _SI _SI_\r\n#define _DI _DI_\r\n#define _DS get_ds()\r\n#define _SS get_ds()\r\n#define _ES get_es()\r\n#define _CS get_cs()\r\n#define _CFLAG (_FLAGS & 1)\r\nextern unsigned _FLAGS;\r\n#define geninterrupt(n)  (_FLAGS = int86(n))\r\n\r\n\r\n#else\r\n\r\n#if defined(__WATCOMC__) || defined(__GNUC__)\r\n#define USEREGS  union REGPACK reg ;\r\n#define _AH reg.h.ah\r\n#define _AL reg.h.al\r\n#define _BH reg.h.bh\r\n#define _BL reg.h.bl\r\n#define _CH reg.h.ch\r\n#define _CL reg.h.cl\r\n#define _DH reg.h.dh\r\n#define _DL reg.h.dl\r\n#define _AX reg.x.ax\r\n#define _BX reg.x.bx\r\n#define _CX reg.x.cx\r\n#define _DX reg.x.dx\r\n#define _SI reg.x.si\r\n#define _DI reg.x.di\r\n#define _DS reg.x.ds\r\n#define _ES reg.x.es\r\n#define _CFLAG (reg.x.flags & 1)\r\n#define geninterrupt(n)  intrpt(n,&reg)\r\n\r\n#else\r\n\r\n#define USEREGS  union REGS reg ; struct SREGS sreg ;\r\n#define _AH reg.h.ah\r\n#define _AL reg.h.al\r\n#define _BH reg.h.bh\r\n#define _BL reg.h.bl\r\n#define _CH reg.h.ch\r\n#define _CL reg.h.cl\r\n#define _DH reg.h.dh\r\n#define _DL reg.h.dl\r\n#define _AX reg.x.ax\r\n#define _BX reg.x.bx\r\n#define _CX reg.x.cx\r\n#define _DX reg.x.dx\r\n#define _SI reg.x.si\r\n#define _DI reg.x.di\r\n#define _DS sreg.ds\r\n#define _ES sreg.es\r\n#define _SS sreg.ss\r\n#define _CFLAG reg.x.cflag\r\n#define geninterrupt(n)  int86x(n,&reg,&reg,&sreg)\r\n\r\n#endif /* __WATCOMC__ */\r\n#endif /* _MICROC_ */\r\n#endif /* __TURBOC__ */\r\n/*\r\n   int getkey()\r\n   {\r\n      USEREGS\r\n\r\n      _AH = 0x10 ;\r\n      geninterrupt(0x16) ;\r\n      return _AX ;\r\n   }\r\n*/\r\n\r\n#ifdef _MICROC_\r\n#define asmLabel(a) a:\t\t\t/* label inside of asm {} */\r\n#define asmName(a,b) b[bp]\t\t/* variable name not available, use offset */\r\n#define FP_SEG(a) get_ds()\t/* only tiny/small available */\r\n#define FP_OFF(a) (a)\r\n#else\r\n#define asmLabel(a) } a: asm {\r\n#define asmName(a,b) a\r\n\r\n#if defined(__POWERC) || (defined(__TURBOC__) && !defined(__BORLANDC__)) || defined(__GNUC__)\r\n#define FAR far\r\n#else\r\n#define FAR _far\r\n#endif\r\n\r\n#ifndef MK_FP\r\n#define MK_FP(seg,off) ((void FAR *)(((long)(seg) << 16)|(unsigned)(off)))\r\n#endif\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/_getdcwd.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): _getdcwd\r\nsu(bsystem): portable\r\nty(pe): H\r\nsy(nopsis): \r\nsh(ort description): Return the fully-qualified current working path of a drive\r\nhe(ader files): \r\nlo(ng description): Retrieves the fully-qualified current working\r\n\tdirectory of a specified drive. The path does not contain a trailing\r\n\tbackslash unless it is the root directory. The path does contain the\r\n\tdrive letter.\\par\r\n\tIf \\para{buf} == \\tok{NULL}, a new buffer of size \\para{length} is\r\n\tallocated.\r\npr(erequistes): \r\nva(lue): NULL: on error\r\n\t\\list \\tok{ENOMEM}: out of memory\r\n\t\\item \\tok{ERANGE}: Buffer of getdcwd() too small\r\n\t\\item warning: There is no change of errno, if the DOS API call fails!!\r\n\t\\endlist\r\n\t\\item else: pointer to path\r\nre(lated to): getdisk dfnexpand\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): _getdcwd.c\r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco: Micro-C, Pacific HiTech C\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n#include \"../../config.h\"\r\n#undef FEATURE_LONG_FILENAMES\r\n\r\n#ifdef _MICROC_\r\n#define COMPILE 1\r\n#endif\r\n#ifdef _PAC_NOCLIB_\r\n#define COMPILE 2\r\n#endif\r\n#ifdef _TC_EARLY_\r\n#define COMPILE 4\r\n#endif\r\n\r\n#ifdef COMPILE\r\n#include <portable.h>\r\n#include \"suppl.h\"\r\n\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\n#ifdef _MICROC_\r\nchar *_getdcwd(int drive, char Xbuf[], unsigned length)\r\n{\tunsigned l;\r\n\tchar *buf;\r\n\r\n\tDBG_ENTER(\"_getdcwd\", Suppl_portable)\r\n\tDBG_ARGUMENTS( (\"drv=%d, buf=%s, len=%u\", drive, buf? \"passed\": \"allocate\", length) )\r\n\r\n\tif(length < 64) {\r\n\t\teno_set(ERANGE);\r\n\t\tDBG_RETURN_S( 0)\r\n\t}\r\n\r\n\tif((buf = Xbuf) || (buf = eno_malloc(length))) {\r\n\t\tbuf;\t\t\t\t\t\t/* AX := buf */\r\n\t\tasm \"mov si, ax\";\r\n\t\tdrive;\t\t\t\t\t\t/* AX := drive */\r\n\t\tasm {\r\n\t\t\tmov dx, ax\r\n\t\t\tor ax, ax\r\n\t\t\tjz currDrive\r\n\t\t\tadd al, 'A' - 1\t\t\t;/* specified drive */\r\n\t\t\tjmp short putDrive\r\ncurrDrive:\r\n\t\t\tmov ah, 19h\r\n\t\t\tint 21h\r\n\t\t\tadd al, 'A'\t\t\t\t;/* 0 == A: */\r\nputDrive:\r\n\t\t\tmov Byte Ptr [si], al\r\n\t\t\tinc si\r\n\t\t\tmov Word Ptr [si], '\\:'\r\n\t\t\tinc si\r\n\t\t\tinc si\r\n\t\t\tmov ah, 47h\r\n\t\t\tint 21h\r\n\t\t\tsbb ax, ax\t\t;; AX := C flag\r\n\t\t}\r\n\t\tif(nargs()) {\t\t\t\t/* Get path failed */\r\n\t\t\tif(!Xbuf) free(buf);\r\n\t\t\tDBG_RETURN_S( 0)\r\n\t\t}\r\n\t}\r\n\tDBG_RETURN_S( buf)\r\n}\r\n\r\n#else\r\n\r\n#ifndef __GNUC__\r\n#include <dir.h>               /* getdisk() */\r\n#endif\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#include \"suppl.h\"\r\n\r\nchar *_getdcwd(int drive, char Xbuf[], unsigned length)\r\n{\tchar *buf;\r\n\tIREGS r;\r\n\r\n\tDBG_ENTER(\"_getdcwd\", Suppl_portable)\r\n\tDBG_ARGUMENTS( (\"drv=%d, buf=%s, len=%u\", drive, buf? \"passed\": \"allocate\", length) )\r\n\r\n\tif(length < 64) {\r\n\t\teno_set(ERANGE);\r\n\t\tDBG_RETURN_S( 0)\r\n\t}\r\n\r\n\tchkHeap\r\n\tif((buf = Xbuf) != 0 || (buf = eno_malloc(length)) != 0) {\r\n\t\tchkHeap\r\n#ifndef NDEBUG\r\n\t\tmemset(buf, 0xAA, length);\r\n\t\tchkHeap\r\n#endif\r\n\t\tstrcpy(buf, \"A:\\\\\");\r\n\t\t*buf += drive? drive - 1: getdisk();\r\n\t\tr.r_si = FP_OFF(&buf[3]);\r\n\t\tr.r_dx = drive;\r\n\t\tr.r_ds = FP_SEG(buf);\r\n#ifdef FEATURE_LONG_FILENAMES\r\n\t\tr.r_flags = 1;\t/* CY before 21.71 calls! */\r\n\t\tr.r_ax = 0x7147;\r\n#else\r\n        r.r_ax = 0x4700;\r\n#endif\r\n\t\tintrpt(0x21, &r);\r\n#ifdef FEATURE_LONG_FILENAMES\r\n\t\tif((r.r_flags & 1) || r.r_ax == 0x7100) {\t\t\t\t/* Get path failed */\r\n            r.r_ax = 0x4700;\r\n            intrpt(0x21, &r);\r\n#endif\r\n            if(r.r_flags & 1) {\r\n    \t\t\tif(!Xbuf) free(buf);\r\n    \t\t\tchkHeap\r\n    \t\t\tDBG_RETURN_S( 0)\r\n            }\r\n#ifdef FEATURE_LONG_FILENAMES\r\n\t\t}\r\n#endif\r\n\t}\r\n\tchkHeap\r\n\tDBG_RETURN_S( buf)\r\n}\r\n\r\n#endif\r\n\r\n#endif\t/* COMPILE */\r\n"
  },
  {
    "path": "suppl/src/addu.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): addu\r\nsu(bsystem): portable\r\nty(pe): A\r\nsy(nopsis): int addu(unsigned * const u1, unsigned u2)\r\nsh(ort description): Performs \\tok{*\\para{u1} += \\para{u2}}\r\n\tand returns the status of the arethmetic overflow\r\nhe(ader files): portable.h\r\nfi(le): addu.c\r\npr: \\para{u1} != NULL\r\nva: !0 if arethemtic overflow occured\\item 0: no overflow\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef __WATCOMC__\r\n\r\n#include <portable.h>\r\n\r\n#ifdef HI_TECH_C\r\n\r\n#include \"addu.pac\"\r\n\r\n#else\t\t/* HI_TECH_C */\r\n\r\nint addu(nM(unsigned * const) u1, nM(const unsigned) u2)\r\n{\r\n#if defined(__GNUC__)\r\n\tint ret;\r\n\tasm(\"add %2, %1; sbb %0, %0\": \"=r\"(ret), \"+m\"(*u1): \"r\"(u2));\r\n\treturn ret;\r\n#elif defined(_TC_EARLY_)\r\n\t*u1 += u2;\t\t\t/* Is translated into exactly what's written\r\n\t\t\t\t\t\t\tin #else branch */\r\n\t__emit__(0x1b,0xc0);\t\t/* SBB AX, AX */\r\n#else\r\nasm {\r\n\t\tmov ax, asmName(u2, 4)\r\n#ifdef FARDATA\r\n\t\tles bx, asmName(u1, 6)\r\n\t\tadd es:[bx], ax\r\n#else\t/* FARDATA */\r\n\t\tmov bx, asmName(u1, 6)\r\n\t\tadd [bx], ax\r\n#endif\t/* FARDATA */\r\n\t\tsbb ax, ax\r\n\t}\r\n#endif\r\n#ifdef __TURBOC__\r\n\treturn _AX;\t\t\t/* shut up warning */\r\n\t\t\t\t\t\t/* is removed completely if -O is specified */\r\n#endif\r\n}\r\n#endif\t\t/* HI_TECH_C */\r\n\r\n#endif\t/* WATCOM */\r\n"
  },
  {
    "path": "suppl/src/app_ievx.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): appInitEnvEx\r\nsu(bsystem): appName\r\nsy(nopsis): int appInitEnvEx(void)\r\nsh(ort description): Initialize the \\subsys{appName} from environment\r\nlo(ng description): As appInitEnv, but does not replace the internally\r\n cached name, if the \\subsys{appName} is already initialized.\r\nva: integer SUPPL error code\r\nre(lated to): appFile appName appInit appPath appInitEnvEx\r\nfi(le): app_ievx.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#endif\r\n#include \"errcodes.h\"\r\n#include \"appname.loc\"\r\n\r\n#include \"environ.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint appInitEnvEx(void)\r\n{\tDBG_ENTER(\"appInitEnvEx\", Suppl_appName)\r\n\tif(app_file) {\r\n\t\tDBG_STRING(\"SUPPL subsystem appName already initialized\");\r\n\t\tDBG_RETURN_I(ESUPPL_OK)\r\n\t}\r\n\tDBG_RETURN_BI(appInit_(env_strdup(0, 0)))\r\n}\r\n"
  },
  {
    "path": "suppl/src/app_ini_.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): appInit_\r\nsu(bsystem): appName\r\nty: L\r\nsy(nopsis): int appInit_(char * const fnam)\r\nsh(ort description): Initialize the \\subsys{appName} from a filename\r\nlo(ng description): Initializes the \\subsys(appName} from passed filename.\\par\r\n This function can be called more than once and refreshes the internal\r\n buffer each time.\r\npr: The passed filename must be an absolute one and a valid pointer into\r\n the heap.\r\nva: integer SUPPL error code\r\nre(lated to): appFile appName appInitEnv appPath appInit\r\nfi(le): app_ini_.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#endif\r\n#include \"errcodes.h\"\r\n#include \"appname.loc\"\r\n#include \"dynstr.h\"\r\n#include \"dfn.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint appInit_(char * const fnam)\r\n{\tDBG_ENTER(\"appInit_\", Suppl_appName)\r\n\r\n\tif(!fnam)\t\t\tDBG_RETURN_I(ESUPPL_INIT)\r\n\r\n\tDBG_ARGUMENTS( (\"fnam=\\\"%s\\\"\", fnam) )\r\n\r\n\tchkHeap\r\n\r\n\tStrRepl(app_file, fnam); chkHeap\r\n\r\n\tapp_fnam = dfnfilename(app_file) - 1; chkHeap\r\n\tif(app_fnam <= app_file || !*app_fnam) {\r\n\t\tStrFree(app_file);\t\t\t/* indicate: not-initialized */\r\n\t\t\t\t\t\t\t\t\t/* as app_fnam is invalid */\r\n\t\tchkHeap;\r\n\t\tDBG_RETURN_I(ESUPPL_FPATH)\r\n\t}\r\n\tapp_fext = strrchr(app_fnam, '.');\r\n\tDBG_RETURN_I(ESUPPL_OK);\r\n}\r\n"
  },
  {
    "path": "suppl/src/app_init.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): appInit\r\nsu(bsystem): appName\r\nty: \r\nsy(nopsis): int appInit(const char * const fnam)\r\nsh(ort description): Initialize the \\subsys{appName} from a filename\r\nlo(ng description): Initializes the \\subsys(appName} from passed filename.\r\n The name is duplicated into the heap.\\par\r\n This function can be called more than once and refreshes the internal\r\n buffer each time.\r\npr: The passed filename must be an absolute one.\r\nva: integer SUPPL error code\r\nre(lated to): appFile appName appInitEnv appPath appInit_\r\nfi(le): app_init.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"errcodes.h\"\r\n#include \"appname.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint appInit(const char * const fnam)\r\n{\tDBG_ENTER(\"appInit\", Suppl_appName);\r\n\r\n\tif(!fnam)\t\tDBG_RETURN_I(ESUPPL_INIT);\r\n\r\n\tDBG_ARGUMENTS( (\"fnam=\\\"%s\\\"\", fnam) )\r\n\r\n\tDBG_RETURN_BI( appInit_(strdup(fnam)))\r\n}\r\n"
  },
  {
    "path": "suppl/src/app_name.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): appName\r\nsu(bsystem): appName\r\nty(pe): 0F\r\nsy(nopsis): char *appName(void)\r\nsh(ort description): Return the name of the application\r\nlo(ng description): Returns a pointer to a static buffer that holds the\r\n name of the current application.\\par\r\nva:  NULL: if not initialized\r\n \\item else: pointer to requested data\r\nre(lated to): appNameEx appFile appInit appPath\r\nfi(le): app_name.c\r\nin(itialized by): appInit appInitEx appInitEnv appInitEnvEx appNameEx\r\n appFileEx appPathEx\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include \"appname.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *appName(void)\r\n{\tDBG_ENTER(\"appName\", Suppl_appName)\r\n\tif(!app_file) {\r\n\t\tDBG_STRING(\"SUPPL subsystem appName not initialized\")\r\n\t\tDBG_RETURN_S(0)\r\n\t}\r\n\r\n\tif(app_fext) *app_fext = '\\0';\r\n\tDBG_RETURN_S( app_fnam + 1)\r\n}\r\n"
  },
  {
    "path": "suppl/src/app_namx.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): appNameEx\r\nsu(bsystem): appName\r\nty(pe): 0F\r\nsy(nopsis): char *appNameEx(void)\r\nsh(ort description): Return the name of the application\r\nlo(ng description): Returns a pointer to a static buffer that holds the\r\n name of the current application.\\par\r\n The \\subsys{appName} is initialized by appInitEnvEx.\r\nva:  NULL: if not initialized\r\n \\item else: pointer to requested data\r\nre(lated to): appName appFile appInit appPath\r\nfi(le): app_namx.c\r\nin(itialized by): appInitEnvEx\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include \"appname.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *appNameEx(void)\r\n{\tDBG_ENTER(\"appNameEx\", Suppl_appName)\r\n\tappInitEnvEx();\r\n\tDBG_RETURN_BS( appName())\r\n}\r\n"
  },
  {
    "path": "suppl/src/app_vars.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): app_file\r\nsu(bsystem): appName\r\nty(pe): 0FL\r\nsy(nopsis): char *app_file\r\nsh(ort description): Dynamically buffered filename of application\r\nhe(ader files): appname.loc\r\nva:  NULL: not initialized so far\r\n\t\\item else: pointer to dynamically duplicated filename\r\nre(lated to): appPath appFile appInit appName appInitEnv\r\nfi(le): app_vars.c\r\nin(itialized by): static appInit appInitEx appInitEnv appInitEnvEx appNameEx\r\n appFileEx appPathEx\r\n\r\nob(ject): app_fnam\r\nsu(bsystem): appName\r\nty(pe): 0FL\r\nsy(nopsis): char *app_fnam\r\nsh(ort description): Pointer to backslash before filename within app_file\r\nhe(ader files): appname.loc\r\nva:  undefined: if not initialized (app_file == NULL)\r\nre(lated to): appPath appFile appInit appName appInitEnv\r\nfi(le): app_vars.c\r\nin(itialized by): appInit appInitEx appInitEnv appInitEnvEx appNameEx\r\n appFileEx appPathEx\r\n\r\nob(ject): app_fext\r\nsu(bsystem): appName\r\nty(pe): 0FL\r\nsy(nopsis): char *app_fext\r\nsh(ort description): Pointer to dot of filename portion within app_file\r\nhe(ader files): appname.loc\r\nva:  NULL: if file has no extension\r\nre(lated to): appPath appFile appInit appName appInitEnv\r\nfi(le): app_vars.c\r\nin(itialized by): appInit appInitEx appInitEnv appInitEnvEx appNameEx\r\n appFileEx appPathEx\r\n\r\nob(ject): app_fnam\r\nsu(bsystem): appName\r\nty(pe): 0FL\r\nsy(nopsis): char *app_fnam\r\nsh(ort description): Pointer to backslash before filename within app_file\r\nhe(ader files): appname.loc\r\nva:  undefined: if not initialized (app_file == NULL)\r\nre(lated to): appPath appFile appInit appName appInitEnv\r\nfi(le): app_vars.c\r\nin(itialized by): appInit appInitEx appInitEnv appInitEnvEx appNameEx\r\n appFileEx appPathEx\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include \"appname.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *app_file = 0\t\t\t/* indicate: not initialized */\r\n\t, *app_fext, *app_fnam;\r\n"
  },
  {
    "path": "suppl/src/appname.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tInternal implementation details of appName\r\n\r\n\tThe information is stored as the absolute filename to the\r\n\texecutable. Three pointers reference to:\r\n\t\t#1) byte before name of file,\r\n\t\t#2) dot of extension of file (may be absent),\r\n\t\t#3) 1st byte of the stored filename.\r\n\r\n\tOn:\r\n\t- appFile(): *(#1) := '\\' and *(#2) := '.'; return #3\r\n\t- appName(): *(#2) := '\\0'; return #1 + 1\r\n\t- appPath(): *(#1) := '\\0'; return #3\r\n\r\n\r\n*/\r\n\r\n#ifndef __APPNAME_INC\r\n#define __APPNAME_INC\r\n\r\n#ifndef __PORTABLE_H\r\n#include <portable.h>\r\n#endif\r\n#include \"appname.h\"\r\n\r\nextern char  *app_file\t\t\t/* absolute filename of executble (#3) */\r\n\t\t\t,*app_fnam \t\t\t/* byte before name (#1) */\r\n\t\t\t,*app_fext\t\t\t/* position of dot (#2) */\r\n\t\t\t;\r\n\r\nint appInit_(char * const fnam);\r\n/*\tInitializes the appName sub system with an allocated string\r\n\tCan be called multiple times.\r\n */\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/bugs",
    "content": "This file contains the \"Known Bugs\" section.\r\n\r\no All environment functions, except env_matchVar(), are case-sensitive! Thus\r\n\tenv_findVar(0, \"temp\") will fail, because normally all DOS environment\r\n\tvariables are in upper-case.\r\n\tWell, this is, of course :-), not a bug but a feature. Just use the\r\n\tenv_matchVar() to adjust the variable's name prior using it.\r\n\r\no Because Micro-C does not have neither ungetc() nor feof(), Feof()\r\n\tsimulates an ungetc() via fseek() and assumes always true for\r\n\tFILE* pointers in write mode.\r\n\r\no The control break catcher terminates the process using the program's\r\n\texit() function. If the catcher is activated when the process is\r\n\tnot currently active, e.g. a child is currently running, this\r\n\tshould confuse DOS & application crashablely.\r\n"
  },
  {
    "path": "suppl/src/byte2par.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): BLK_byte2para\r\nsu(bsystem): portable\r\nsh(ort description): Calculates the number of paragraphes to store \\para{num} bytes\r\nva(lue): number of paragraphes 0..0x1000\r\nse(condary subsystems): dosalloc\r\nfi(le): byte2par.c\r\nwa(rning): The argument has a range: 0..0xFFFF\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n\r\n#include <portable.h>\r\n\r\nword BLK_byte2para(nM(unsigned) bytes)\r\n#ifdef _MICROC_\r\nasm {\r\n\tmov ax, asmName(bytes, 4)\r\n\tmov ch, al\r\n\tmov cl, 4\r\n\tshr ax, cl\r\n\tand ch, 0Fh\r\n\tjz b2para1\t\t; /* no partially used paragraphe */\r\n\tinc ax\r\nb2para1:\r\n}\r\n#else\r\n{ return (bytes >> 4) + ((bytes & 0xF)? 1: 0);\t}\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/cntry.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): nlsNewInfo\r\nsu(bsystem): nls\r\nty(pe): 0\r\nsy(nopsis): \r\nsh(ort description): Reread the NLS information and return a pointer to it\r\nhe(ader files): \r\nlo(ng description): Updates the internal, static buffer caching\r\n\tall NLS information provided by the DOS-65-XX interface and returns\r\n\ta pointer to it. The buffer caches information, such as:\r\n\t\\enum code page\r\n\t\\item country ID\r\n\t\\item date format\r\n\t\\item currency symbol string\r\n\t\\item thousands separator string\r\n\t\\item decimal sperator string\r\n\t\\item date separator string\r\n\t\\item time separator string\r\n\t\\item currency format\r\n\t\\item time format\r\n\t\\item data-list separator string\r\n\t\\item pointer to uppercase table\r\n\t\\item pointer to lowercase table\r\n\t\\item pointer to filenmae uppercase table\r\n\t\\item pointer to filename character table\r\n\t\\item pointer to collating sequence table\r\n\t\\endlist\r\n\t\\par\r\n\tThis function should be called whenever the NLS information is required,\r\n\tbut the possibility exists that the DOS NLS has been changed during\r\n\tthe last call to \\tok{nlsInfo()}.\\par\r\npr(erequistes): \r\nva(lue): always a pointer to a static buffer\r\nre(lated to): nlsInfo\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): cntry.c\r\nin(itialized by): \r\nwa(rning): \r\n\tNote: Though for future release one should not rely on the fact that\r\n\talways the \\em{same} pointer is returned.\r\nbu(gs): \r\n\r\nob(ject): nlsInfo\r\nsu(bsystem): nls\r\nty(pe): 0\r\nsy(nopsis): \r\nsh(ort description): Read the NLS information and return a pointer to it\r\nhe(ader files): \r\nlo(ng description): As \\tok{nlsNewInfo}, but does update the internal\r\n\tbuffer only once per life-time of the program\r\npr(erequistes): \r\nva(lue): pointer to internal buffer\r\nre(lated to): nlsNewInfo\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\nob(ject): suppl_cntry\r\nsu(bsystem): nls\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Cached information for \\tok{nlsInfo()}\r\nhe(ader files): \r\nlo(ng description): Caches information retreived by nlsNewInfo() from\r\n\tthe DOS-65-XX NLS interface.\r\npr(erequistes): \r\nva(lue): \r\nre(lated to): \r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): nlsNewInfo\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifdef __GNUC__\r\n#include <libi86/string.h>\r\n#endif\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <string.h>\r\n#endif /*#\tdefined(_MICROC_) */\r\n\r\n#include \"cntry.h\"\r\n#include \"fmemory.h\"\r\n#include \"str.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif /*#\tdefined(RCS_Version) */\r\n\r\nstatic Country suppl_cntry = {0};\t/* make sure the structure is zeroed out */\r\n\r\n\r\n#ifdef _MICROC_\r\n#define savePtr(field)\tsavePtr_(&suppl_cntry.field/**/Len\t\t\\\r\n\t\t\t\t\t\t\t, suppl_cntry.field/**/Tbl\t\t\\\r\n\t\t\t\t\t\t\t, &buf[1])\r\nstatic void savePtr_(int *len, dword *tbl, word *ptr)\r\n{\tword segm, ofs;\r\n\r\n\tofs = *ptr;\r\n\tsegm = ptr[1];\r\n\r\n\tif((*len = peekw(segm, ofs)) <= 0x80)\r\n\t\tofs -= 0x80;\r\n\tofs += 2;\r\n\r\n\ttbl->lo = ofs;\r\n\ttbl->hi = segm;\r\n\r\n\tif(!longtst(tbl))\t\t/* no table --> no length */\r\n\t\t*len = 0;\r\n}\r\n#else /*#\t!(defined(_MICROC_)) */\r\n#define savePtr(field)\tsavePtr_(&suppl_cntry.field##Len\t\t\\\r\n\t\t\t\t\t\t\t, &suppl_cntry.field##Tbl\t\t\\\r\n\t\t\t\t\t\t\t, (byte far* *)&buf[1])\r\nstatic void savePtr_(int *len, char far * *tbl, byte far * *ptr)\r\n{\tbyte far *p;\r\n\r\n\tp = *ptr;\r\n\tif((*len = *(word far*)p) <= 0x80)\r\n\t\tp -= 0x80;\r\n\tp += 2;\r\n\tif((*tbl = (char far*)p) == 0)\t\t/* no table --> no length */\r\n\t\t*len = 0;\r\n}\r\n#endif /*#\tdefined(_MICROC_) */\r\n\r\n\r\n\r\nCountry *nlsInfo(void)\r\n{\tDBG_ENTER(\"nlsInfo\", Suppl_nls)\r\n\tDBG_LEAVE( suppl_cntry.initialized? aS(suppl_cntry): nlsNewInfo())\r\n}\r\n\r\nvoid nlsWriteFallback(Country *nls)\r\n{\r\n\tstatic char illchars[] = \"\\\"+,./:;<=>[\\\\]|\";\r\n#if defined(DBCS)\r\n# if defined(JAPANESE)\r\n\tstatic unsigned char dbcstbl[] = { 0x81, 0x9f, 0xe0, 0xfc, 0, 0 };\r\n# else\r\n\tstatic unsigned char dbcstbl[] = { 0, 0, 0, 0, 0, 0 };\r\n# endif\r\n#endif\r\n\t\r\n\tnls->country = 1;\r\n\tnls->charset = 437;\r\n\tnls->datefmt = 0;\r\n\tnls->curSymbol[0] = '$';\r\n\tnls->thousendsSep[0] = ',';\r\n\tnls->decimalSep[0] = '.';\r\n\tnls->dateSep[0] = '-';\r\n\tnls->timeSep[0] = ':';\r\n\tnls->curFormat = 0;\r\n\tnls->precision = 2;\r\n\tnls->timefmt = 0;\r\n\tnls->listSep[0] = ',';\r\n\r\n#if defined(JAPANESE)\r\n\tnls->country = 81;\r\n\tnls->charset = 932;\r\n\tnls->datefmt = 2;\r\n\tnls->curSymbol[0] = '\\\\';\r\n\tnls->curFormat = 0;\r\n\tnls->precision = 0;\r\n\tnls->timefmt = 1;\r\n#endif\r\n\r\n\tnls->inclFirst = 0; nls->inclLast = 0xff;\r\n\tnls->exclFirst = 0; nls->exclLast = 0x20;\r\n\tnls->illegalLen = strlen(illchars);\r\n\tnls->illegalChars = (char far *)illchars;\r\n#if defined(DBCS)\r\n\tnls->dbcsTbl = (unsigned char far *)dbcstbl;\r\n#endif\r\n}\r\n\r\nCountry *nlsNewInfo(void)\r\n{\tunsigned char buf[50];\r\n#if 1\r\n\tIREGS r;\r\n\r\n\tDBG_ENTER(\"nlsNewInfo\", Suppl_nls)\r\n\r\n#ifdef _MICROC_\r\n\tr.r_es = get_ds();\r\n\tr.r_di = &buf[0];\r\n#else\r\n\tr.r_es = FP_SEG(&buf[0]);\r\n\tr.r_di = FP_OFF(&buf[0]);\r\n#endif\r\n\t\r\n\tr.r_bx = r.r_dx = 0xffff;\r\n#define DOS(val) r.r_ax = 0x6500 | (val);\t\\\r\n\tr.r_cx = sizeof(buf);\t\t\t\t\t\\\r\n    intrpt( 0x21, &r );                       \\\r\n\tif(0 == ( r.r_flags & 1 ) ? r.r_ax : 0)\r\n#else\r\n#ifdef _MICROC_\r\n\tIREGS r;\r\n\r\n\tDBG_ENTER(\"nlsNewInfo\", Suppl_nls)\r\n\r\n\tr.r_es = get_ds();\r\n\tr.r_di = &buf[0];\r\n\tr.r_bx = r.r_dx = 0xffff;\r\n#define errnr ((r.r_flags & 1)? r.r_ax : 0)\r\n#define DOS(val) r.r_ax = 0x6500 | (val);\t\\\r\n\tr.r_cx = sizeof(buf);\t\t\t\t\t\\\r\n\tintrpt(0x21, r);\t\t\t\t\t\t\t\\\r\n\tif(!errnr)\r\n#else /*#\t!(defined(_MICROC_)) */\r\n\tIREGS r;\r\n\r\n\tDBG_ENTER(\"nlsNewInfo\", Suppl_nls)\r\n\r\n\tr.r_es = FP_SEG(&buf[0]);\r\n\tr.r_di = FP_OFF(&buf[0]);\r\n\t\r\n\tr.r_bx = r.r_dx = 0xffff;\r\n\tr.r_ax = 0x6500;\r\n#define DOS(val) r.r_ax = 0x6500 | (val);\t\\\r\n\tr.r_cx = sizeof(buf);\t\t\t\t\t\\\r\n\tintrpt(0x21, &r);\t\t\t\t\t\\\r\n\tif(!errnr)\r\n#define errnr (r.r_flags & 1)? r.r_ax : 0)\r\n#endif /*#\tdefined(_MICROC_) */\r\n#endif \r\n\r\n\tchkHeap\r\n#define getbyte(idx)\tbuf[(idx)]\r\n#define getword(idx)\t(*(word*)&buf[(idx)])\r\n#define cpybyte(field,idx)\t(suppl_cntry.field = buf[(idx)])\r\n#define cpyword(field,idx)\t(suppl_cntry.field = (*(word*)&buf[(idx)]))\r\n#define cpymem(field,idx)\tmemcpy(suppl_cntry.field, &buf[(idx)]\t\t\\\r\n\t\t\t, sizeof(suppl_cntry.field) - 1)\r\n\r\n\tmemzerostrct(suppl_cntry);\r\n\tnlsWriteFallback(&suppl_cntry);\r\n\r\n\tDOS(1)\t{\t/* Extended country inmformation */\r\n\t\tcpyword(country, 3);\r\n\t\tcpyword(charset, 5);\r\n\t\tcpyword(datefmt, 7);\r\n\t\tcpymem(curSymbol, 9);\r\n\t\tcpymem(thousendsSep, 14);\r\n\t\tcpymem(decimalSep, 16);\r\n\t\tcpymem(dateSep, 18);\r\n\t\tcpymem(timeSep, 20);\r\n\t\tcpybyte(curFormat, 22);\r\n\t\tcpybyte(precision, 23);\r\n\t\tcpybyte(timefmt, 24);\r\n\t\tcpymem(listSep, 29);\r\n\t}\r\n\r\n\tDOS(2)\t\t/* uppercase table for normal characters */\r\n\t\tsavePtr(uppercase);\r\n\r\n\tDOS(3)\t\t/* lowercase table for normal characters */\r\n\t\tsavePtr(lowercase);\r\n\r\n\tDOS(4)\t\t/* uppercase table for filename characters */\r\n\t\tsavePtr(fupcase);\r\n\r\n\tDOS(6)\t\t/* lowercase table for normal characters */\r\n\t\tsavePtr(collate);\r\n\r\n\tDOS(5) {\t/* filename character table */\r\n#ifdef _MICROC_\r\n\t\tcpymem(illegalChars, 11);\r\n\t\tsuppl_cntry.illegalChars.lo += 10;\r\n\t\tcopy_seg(get_ds(), buf, *(word*)&buf[3], *(word*)&buf[1], 10);\r\n#else /*#\t!(defined(_MICROC_)) */\r\n\t\tsuppl_cntry.illegalChars = *(char far * *)&buf[1] + 10;\r\n\t\t_fmemcpy(buf, *(byte far* *)&buf[1], 10);\r\n#endif /*#\tdefined(_MICROC_) */\r\n\r\n\t\tcpybyte(inclFirst, 3);\r\n\t\tcpybyte(inclLast, 4);\r\n\t\tcpybyte(exclFirst, 6);\r\n\t\tcpybyte(exclLast, 7);\r\n\t\tsuppl_cntry.illegalLen= getbyte(9); \r\n\t}\r\n\r\n#if defined(DBCS)\r\n\tr.r_ax = 0x6300;\r\n\tr.r_ds = r.r_si = 0;\r\n\tintrpt(0x21, &r);\r\n\tif ( !(r.r_flags & 1) && r.r_ds && r.r_si ) {\r\n\t\tsuppl_cntry.dbcsTbl = MK_FP(r.r_ds, r.r_si);\r\n\t}\r\n#endif\r\n\r\n\tsuppl_cntry.initialized = 1;\r\n\r\n\tchkHeap\r\n\tDBG_LEAVE( aS(suppl_cntry))\r\n}\r\n\r\n#ifdef TEST\r\nmain(void)\r\n{\tnlsInfo();\r\n\treturn 0;\r\n}\r\n#endif /*#\tdefined(TEST) */\r\n"
  },
  {
    "path": "suppl/src/copying",
    "content": "\t\t    GNU GENERAL PUBLIC LICENSE\r\n\t\t       Version 2, June 1991\r\n\r\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.\r\n                          675 Mass Ave, Cambridge, MA 02139, USA\r\n Everyone is permitted to copy and distribute verbatim copies\r\n of this license document, but changing it is not allowed.\r\n\r\n\t\t\t    Preamble\r\n\r\n  The licenses for most software are designed to take away your\r\nfreedom to share and change it.  By contrast, the GNU General Public\r\nLicense is intended to guarantee your freedom to share and change free\r\nsoftware--to make sure the software is free for all its users.  This\r\nGeneral Public License applies to most of the Free Software\r\nFoundation's software and to any other program whose authors commit to\r\nusing it.  (Some other Free Software Foundation software is covered by\r\nthe GNU Library General Public License instead.)  You can apply it to\r\nyour programs, too.\r\n\r\n  When we speak of free software, we are referring to freedom, not\r\nprice.  Our General Public Licenses are designed to make sure that you\r\nhave the freedom to distribute copies of free software (and charge for\r\nthis service if you wish), that you receive source code or can get it\r\nif you want it, that you can change the software or use pieces of it\r\nin new free programs; and that you know you can do these things.\r\n\r\n  To protect your rights, we need to make restrictions that forbid\r\nanyone to deny you these rights or to ask you to surrender the rights.\r\nThese restrictions translate to certain responsibilities for you if you\r\ndistribute copies of the software, or if you modify it.\r\n\r\n  For example, if you distribute copies of such a program, whether\r\ngratis or for a fee, you must give the recipients all the rights that\r\nyou have.  You must make sure that they, too, receive or can get the\r\nsource code.  And you must show them these terms so they know their\r\nrights.\r\n\r\n  We protect your rights with two steps: (1) copyright the software, and\r\n(2) offer you this license which gives you legal permission to copy,\r\ndistribute and/or modify the software.\r\n\r\n  Also, for each author's protection and ours, we want to make certain\r\nthat everyone understands that there is no warranty for this free\r\nsoftware.  If the software is modified by someone else and passed on, we\r\nwant its recipients to know that what they have is not the original, so\r\nthat any problems introduced by others will not reflect on the original\r\nauthors' reputations.\r\n\r\n  Finally, any free program is threatened constantly by software\r\npatents.  We wish to avoid the danger that redistributors of a free\r\nprogram will individually obtain patent licenses, in effect making the\r\nprogram proprietary.  To prevent this, we have made it clear that any\r\npatent must be licensed for everyone's free use or not licensed at all.\r\n\r\n  The precise terms and conditions for copying, distribution and\r\nmodification follow.\r\n\f\r\n\t\t    GNU GENERAL PUBLIC LICENSE\r\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r\n\r\n  0. This License applies to any program or other work which contains\r\na notice placed by the copyright holder saying it may be distributed\r\nunder the terms of this General Public License.  The \"Program\", below,\r\nrefers to any such program or work, and a \"work based on the Program\"\r\nmeans either the Program or any derivative work under copyright law:\r\nthat is to say, a work containing the Program or a portion of it,\r\neither verbatim or with modifications and/or translated into another\r\nlanguage.  (Hereinafter, translation is included without limitation in\r\nthe term \"modification\".)  Each licensee is addressed as \"you\".\r\n\r\nActivities other than copying, distribution and modification are not\r\ncovered by this License; they are outside its scope.  The act of\r\nrunning the Program is not restricted, and the output from the Program\r\nis covered only if its contents constitute a work based on the\r\nProgram (independent of having been made by running the Program).\r\nWhether that is true depends on what the Program does.\r\n\r\n  1. You may copy and distribute verbatim copies of the Program's\r\nsource code as you receive it, in any medium, provided that you\r\nconspicuously and appropriately publish on each copy an appropriate\r\ncopyright notice and disclaimer of warranty; keep intact all the\r\nnotices that refer to this License and to the absence of any warranty;\r\nand give any other recipients of the Program a copy of this License\r\nalong with the Program.\r\n\r\nYou may charge a fee for the physical act of transferring a copy, and\r\nyou may at your option offer warranty protection in exchange for a fee.\r\n\r\n  2. You may modify your copy or copies of the Program or any portion\r\nof it, thus forming a work based on the Program, and copy and\r\ndistribute such modifications or work under the terms of Section 1\r\nabove, provided that you also meet all of these conditions:\r\n\r\n    a) You must cause the modified files to carry prominent notices\r\n    stating that you changed the files and the date of any change.\r\n\r\n    b) You must cause any work that you distribute or publish, that in\r\n    whole or in part contains or is derived from the Program or any\r\n    part thereof, to be licensed as a whole at no charge to all third\r\n    parties under the terms of this License.\r\n\r\n    c) If the modified program normally reads commands interactively\r\n    when run, you must cause it, when started running for such\r\n    interactive use in the most ordinary way, to print or display an\r\n    announcement including an appropriate copyright notice and a\r\n    notice that there is no warranty (or else, saying that you provide\r\n    a warranty) and that users may redistribute the program under\r\n    these conditions, and telling the user how to view a copy of this\r\n    License.  (Exception: if the Program itself is interactive but\r\n    does not normally print such an announcement, your work based on\r\n    the Program is not required to print an announcement.)\r\n\f\r\nThese requirements apply to the modified work as a whole.  If\r\nidentifiable sections of that work are not derived from the Program,\r\nand can be reasonably considered independent and separate works in\r\nthemselves, then this License, and its terms, do not apply to those\r\nsections when you distribute them as separate works.  But when you\r\ndistribute the same sections as part of a whole which is a work based\r\non the Program, the distribution of the whole must be on the terms of\r\nthis License, whose permissions for other licensees extend to the\r\nentire whole, and thus to each and every part regardless of who wrote it.\r\n\r\nThus, it is not the intent of this section to claim rights or contest\r\nyour rights to work written entirely by you; rather, the intent is to\r\nexercise the right to control the distribution of derivative or\r\ncollective works based on the Program.\r\n\r\nIn addition, mere aggregation of another work not based on the Program\r\nwith the Program (or with a work based on the Program) on a volume of\r\na storage or distribution medium does not bring the other work under\r\nthe scope of this License.\r\n\r\n  3. You may copy and distribute the Program (or a work based on it,\r\nunder Section 2) in object code or executable form under the terms of\r\nSections 1 and 2 above provided that you also do one of the following:\r\n\r\n    a) Accompany it with the complete corresponding machine-readable\r\n    source code, which must be distributed under the terms of Sections\r\n    1 and 2 above on a medium customarily used for software interchange; or,\r\n\r\n    b) Accompany it with a written offer, valid for at least three\r\n    years, to give any third party, for a charge no more than your\r\n    cost of physically performing source distribution, a complete\r\n    machine-readable copy of the corresponding source code, to be\r\n    distributed under the terms of Sections 1 and 2 above on a medium\r\n    customarily used for software interchange; or,\r\n\r\n    c) Accompany it with the information you received as to the offer\r\n    to distribute corresponding source code.  (This alternative is\r\n    allowed only for noncommercial distribution and only if you\r\n    received the program in object code or executable form with such\r\n    an offer, in accord with Subsection b above.)\r\n\r\nThe source code for a work means the preferred form of the work for\r\nmaking modifications to it.  For an executable work, complete source\r\ncode means all the source code for all modules it contains, plus any\r\nassociated interface definition files, plus the scripts used to\r\ncontrol compilation and installation of the executable.  However, as a\r\nspecial exception, the source code distributed need not include\r\nanything that is normally distributed (in either source or binary\r\nform) with the major components (compiler, kernel, and so on) of the\r\noperating system on which the executable runs, unless that component\r\nitself accompanies the executable.\r\n\r\nIf distribution of executable or object code is made by offering\r\naccess to copy from a designated place, then offering equivalent\r\naccess to copy the source code from the same place counts as\r\ndistribution of the source code, even though third parties are not\r\ncompelled to copy the source along with the object code.\r\n\f\r\n  4. You may not copy, modify, sublicense, or distribute the Program\r\nexcept as expressly provided under this License.  Any attempt\r\notherwise to copy, modify, sublicense or distribute the Program is\r\nvoid, and will automatically terminate your rights under this License.\r\nHowever, parties who have received copies, or rights, from you under\r\nthis License will not have their licenses terminated so long as such\r\nparties remain in full compliance.\r\n\r\n  5. You are not required to accept this License, since you have not\r\nsigned it.  However, nothing else grants you permission to modify or\r\ndistribute the Program or its derivative works.  These actions are\r\nprohibited by law if you do not accept this License.  Therefore, by\r\nmodifying or distributing the Program (or any work based on the\r\nProgram), you indicate your acceptance of this License to do so, and\r\nall its terms and conditions for copying, distributing or modifying\r\nthe Program or works based on it.\r\n\r\n  6. Each time you redistribute the Program (or any work based on the\r\nProgram), the recipient automatically receives a license from the\r\noriginal licensor to copy, distribute or modify the Program subject to\r\nthese terms and conditions.  You may not impose any further\r\nrestrictions on the recipients' exercise of the rights granted herein.\r\nYou are not responsible for enforcing compliance by third parties to\r\nthis License.\r\n\r\n  7. If, as a consequence of a court judgment or allegation of patent\r\ninfringement or for any other reason (not limited to patent issues),\r\nconditions are imposed on you (whether by court order, agreement or\r\notherwise) that contradict the conditions of this License, they do not\r\nexcuse you from the conditions of this License.  If you cannot\r\ndistribute so as to satisfy simultaneously your obligations under this\r\nLicense and any other pertinent obligations, then as a consequence you\r\nmay not distribute the Program at all.  For example, if a patent\r\nlicense would not permit royalty-free redistribution of the Program by\r\nall those who receive copies directly or indirectly through you, then\r\nthe only way you could satisfy both it and this License would be to\r\nrefrain entirely from distribution of the Program.\r\n\r\nIf any portion of this section is held invalid or unenforceable under\r\nany particular circumstance, the balance of the section is intended to\r\napply and the section as a whole is intended to apply in other\r\ncircumstances.\r\n\r\nIt is not the purpose of this section to induce you to infringe any\r\npatents or other property right claims or to contest validity of any\r\nsuch claims; this section has the sole purpose of protecting the\r\nintegrity of the free software distribution system, which is\r\nimplemented by public license practices.  Many people have made\r\ngenerous contributions to the wide range of software distributed\r\nthrough that system in reliance on consistent application of that\r\nsystem; it is up to the author/donor to decide if he or she is willing\r\nto distribute software through any other system and a licensee cannot\r\nimpose that choice.\r\n\r\nThis section is intended to make thoroughly clear what is believed to\r\nbe a consequence of the rest of this License.\r\n\f\r\n  8. If the distribution and/or use of the Program is restricted in\r\ncertain countries either by patents or by copyrighted interfaces, the\r\noriginal copyright holder who places the Program under this License\r\nmay add an explicit geographical distribution limitation excluding\r\nthose countries, so that distribution is permitted only in or among\r\ncountries not thus excluded.  In such case, this License incorporates\r\nthe limitation as if written in the body of this License.\r\n\r\n  9. The Free Software Foundation may publish revised and/or new versions\r\nof the General Public License from time to time.  Such new versions will\r\nbe similar in spirit to the present version, but may differ in detail to\r\naddress new problems or concerns.\r\n\r\nEach version is given a distinguishing version number.  If the Program\r\nspecifies a version number of this License which applies to it and \"any\r\nlater version\", you have the option of following the terms and conditions\r\neither of that version or of any later version published by the Free\r\nSoftware Foundation.  If the Program does not specify a version number of\r\nthis License, you may choose any version ever published by the Free Software\r\nFoundation.\r\n\r\n  10. If you wish to incorporate parts of the Program into other free\r\nprograms whose distribution conditions are different, write to the author\r\nto ask for permission.  For software which is copyrighted by the Free\r\nSoftware Foundation, write to the Free Software Foundation; we sometimes\r\nmake exceptions for this.  Our decision will be guided by the two goals\r\nof preserving the free status of all derivatives of our free software and\r\nof promoting the sharing and reuse of software generally.\r\n\r\n\t\t\t    NO WARRANTY\r\n\r\n  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\r\nFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\r\nOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\r\nPROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\r\nOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\r\nTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\r\nPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\r\nREPAIR OR CORRECTION.\r\n\r\n  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\r\nREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\r\nINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\r\nOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\r\nTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\r\nYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\r\nPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\r\nPOSSIBILITY OF SUCH DAMAGES.\r\n\r\n\t\t     END OF TERMS AND CONDITIONS\r\n\f\r\n\tAppendix: How to Apply These Terms to Your New Programs\r\n\r\n  If you develop a new program, and you want it to be of the greatest\r\npossible use to the public, the best way to achieve this is to make it\r\nfree software which everyone can redistribute and change under these terms.\r\n\r\n  To do so, attach the following notices to the program.  It is safest\r\nto attach them to the start of each source file to most effectively\r\nconvey the exclusion of warranty; and each file should have at least\r\nthe \"copyright\" line and a pointer to where the full notice is found.\r\n\r\n    <one line to give the program's name and a brief idea of what it does.>\r\n    Copyright (C) 19yy  <name of author>\r\n\r\n    This program is free software; you can redistribute it and/or modify\r\n    it under the terms of the GNU General Public License as published by\r\n    the Free Software Foundation; either version 2 of the License, or\r\n    (at your option) any later version.\r\n\r\n    This program is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n    GNU General Public License for more details.\r\n\r\n    You should have received a copy of the GNU General Public License\r\n    along with this program; if not, write to the Free Software\r\n    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n\r\nAlso add information on how to contact you by electronic and paper mail.\r\n\r\nIf the program is interactive, make it output a short notice like this\r\nwhen it starts in an interactive mode:\r\n\r\n    Gnomovision version 69, Copyright (C) 19yy name of author\r\n    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r\n    This is free software, and you are welcome to redistribute it\r\n    under certain conditions; type `show c' for details.\r\n\r\nThe hypothetical commands `show w' and `show c' should show the appropriate\r\nparts of the General Public License.  Of course, the commands you use may\r\nbe called something other than `show w' and `show c'; they could even be\r\nmouse-clicks or menu items--whatever suits your program.\r\n\r\nYou should also get your employer (if you work as a programmer) or your\r\nschool, if any, to sign a \"copyright disclaimer\" for the program, if\r\nnecessary.  Here is a sample; alter the names:\r\n\r\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\r\n  `Gnomovision' (which makes passes at compilers) written by James Hacker.\r\n\r\n  <signature of Ty Coon>, 1 April 1989\r\n  Ty Coon, President of Vice\r\n\r\nThis General Public License does not permit incorporating your program into\r\nproprietary programs.  If your program is a subroutine library, you may\r\nconsider it more useful to permit linking proprietary applications with the\r\nlibrary.  If this is what you want to do, use the GNU Library General\r\nPublic License instead of this License.\r\n\r\n"
  },
  {
    "path": "suppl/src/copying.lb",
    "content": "                  GNU LIBRARY GENERAL PUBLIC LICENSE\r\n                       Version 2, June 1991\r\n\r\n Copyright (C) 1991 Free Software Foundation, Inc.\r\n                    675 Mass Ave, Cambridge, MA 02139, USA\r\n Everyone is permitted to copy and distribute verbatim copies\r\n of this license document, but changing it is not allowed.\r\n\r\n[This is the first released version of the library GPL.  It is\r\n numbered 2 because it goes with version 2 of the ordinary GPL.]\r\n\r\n                            Preamble\r\n\r\n  The licenses for most software are designed to take away your\r\nfreedom to share and change it.  By contrast, the GNU General Public\r\nLicenses are intended to guarantee your freedom to share and change\r\nfree software--to make sure the software is free for all its users.\r\n\r\n  This license, the Library General Public License, applies to some\r\nspecially designated Free Software Foundation software, and to any\r\nother libraries whose authors decide to use it.  You can use it for\r\nyour libraries, too.\r\n\r\n  When we speak of free software, we are referring to freedom, not\r\nprice.  Our General Public Licenses are designed to make sure that you\r\nhave the freedom to distribute copies of free software (and charge for\r\nthis service if you wish), that you receive source code or can get it\r\nif you want it, that you can change the software or use pieces of it\r\nin new free programs; and that you know you can do these things.\r\n\r\n  To protect your rights, we need to make restrictions that forbid\r\nanyone to deny you these rights or to ask you to surrender the rights.\r\nThese restrictions translate to certain responsibilities for you if\r\nyou distribute copies of the library, or if you modify it.\r\n\r\n  For example, if you distribute copies of the library, whether gratis\r\nor for a fee, you must give the recipients all the rights that we gave\r\nyou.  You must make sure that they, too, receive or can get the source\r\ncode.  If you link a program with the library, you must provide\r\ncomplete object files to the recipients so that they can relink them\r\nwith the library, after making changes to the library and recompiling\r\nit.  And you must show them these terms so they know their rights.\r\n\r\n  Our method of protecting your rights has two steps: (1) copyright\r\nthe library, and (2) offer you this license which gives you legal\r\npermission to copy, distribute and/or modify the library.\r\n\r\n  Also, for each distributor's protection, we want to make certain\r\nthat everyone understands that there is no warranty for this free\r\nlibrary.  If the library is modified by someone else and passed on, we\r\nwant its recipients to know that what they have is not the original\r\nversion, so that any problems introduced by others will not reflect on\r\nthe original authors' reputations.\r\n\f\r\n  Finally, any free program is threatened constantly by software\r\npatents.  We wish to avoid the danger that companies distributing free\r\nsoftware will individually obtain patent licenses, thus in effect\r\ntransforming the program into proprietary software.  To prevent this,\r\nwe have made it clear that any patent must be licensed for everyone's\r\nfree use or not licensed at all.\r\n\r\n  Most GNU software, including some libraries, is covered by the ordinary\r\nGNU General Public License, which was designed for utility programs.  This\r\nlicense, the GNU Library General Public License, applies to certain\r\ndesignated libraries.  This license is quite different from the ordinary\r\none; be sure to read it in full, and don't assume that anything in it is\r\nthe same as in the ordinary license.\r\n\r\n  The reason we have a separate public license for some libraries is that\r\nthey blur the distinction we usually make between modifying or adding to a\r\nprogram and simply using it.  Linking a program with a library, without\r\nchanging the library, is in some sense simply using the library, and is\r\nanalogous to running a utility program or application program.  However, in\r\na textual and legal sense, the linked executable is a combined work, a\r\nderivative of the original library, and the ordinary General Public License\r\ntreats it as such.\r\n\r\n  Because of this blurred distinction, using the ordinary General\r\nPublic License for libraries did not effectively promote software\r\nsharing, because most developers did not use the libraries.  We\r\nconcluded that weaker conditions might promote sharing better.\r\n\r\n  However, unrestricted linking of non-free programs would deprive the\r\nusers of those programs of all benefit from the free status of the\r\nlibraries themselves.  This Library General Public License is intended to\r\npermit developers of non-free programs to use free libraries, while\r\npreserving your freedom as a user of such programs to change the free\r\nlibraries that are incorporated in them.  (We have not seen how to achieve\r\nthis as regards changes in header files, but we have achieved it as regards\r\nchanges in the actual functions of the Library.)  The hope is that this\r\nwill lead to faster development of free libraries.\r\n\r\n  The precise terms and conditions for copying, distribution and\r\nmodification follow.  Pay close attention to the difference between a\r\n\"work based on the library\" and a \"work that uses the library\".  The\r\nformer contains code derived from the library, while the latter only\r\nworks together with the library.\r\n\r\n  Note that it is possible for a library to be covered by the ordinary\r\nGeneral Public License rather than by this special one.\r\n\f\r\n                  GNU LIBRARY GENERAL PUBLIC LICENSE\r\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r\n\r\n  0. This License Agreement applies to any software library which\r\ncontains a notice placed by the copyright holder or other authorized\r\nparty saying it may be distributed under the terms of this Library\r\nGeneral Public License (also called \"this License\").  Each licensee is\r\naddressed as \"you\".\r\n\r\n  A \"library\" means a collection of software functions and/or data\r\nprepared so as to be conveniently linked with application programs\r\n(which use some of those functions and data) to form executables.\r\n\r\n  The \"Library\", below, refers to any such software library or work\r\nwhich has been distributed under these terms.  A \"work based on the\r\nLibrary\" means either the Library or any derivative work under\r\ncopyright law: that is to say, a work containing the Library or a\r\nportion of it, either verbatim or with modifications and/or translated\r\nstraightforwardly into another language.  (Hereinafter, translation is\r\nincluded without limitation in the term \"modification\".)\r\n\r\n  \"Source code\" for a work means the preferred form of the work for\r\nmaking modifications to it.  For a library, complete source code means\r\nall the source code for all modules it contains, plus any associated\r\ninterface definition files, plus the scripts used to control compilation\r\nand installation of the library.\r\n\r\n  Activities other than copying, distribution and modification are not\r\ncovered by this License; they are outside its scope.  The act of\r\nrunning a program using the Library is not restricted, and output from\r\nsuch a program is covered only if its contents constitute a work based\r\non the Library (independent of the use of the Library in a tool for\r\nwriting it).  Whether that is true depends on what the Library does\r\nand what the program that uses the Library does.\r\n\r\n  1. You may copy and distribute verbatim copies of the Library's\r\ncomplete source code as you receive it, in any medium, provided that\r\nyou conspicuously and appropriately publish on each copy an\r\nappropriate copyright notice and disclaimer of warranty; keep intact\r\nall the notices that refer to this License and to the absence of any\r\nwarranty; and distribute a copy of this License along with the\r\nLibrary.\r\n\r\n  You may charge a fee for the physical act of transferring a copy,\r\nand you may at your option offer warranty protection in exchange for a\r\nfee.\r\n\f\r\n  2. You may modify your copy or copies of the Library or any portion\r\nof it, thus forming a work based on the Library, and copy and\r\ndistribute such modifications or work under the terms of Section 1\r\nabove, provided that you also meet all of these conditions:\r\n\r\n    a) The modified work must itself be a software library.\r\n\r\n    b) You must cause the files modified to carry prominent notices\r\n    stating that you changed the files and the date of any change.\r\n\r\n    c) You must cause the whole of the work to be licensed at no\r\n    charge to all third parties under the terms of this License.\r\n\r\n    d) If a facility in the modified Library refers to a function or a\r\n    table of data to be supplied by an application program that uses\r\n    the facility, other than as an argument passed when the facility\r\n    is invoked, then you must make a good faith effort to ensure that,\r\n    in the event an application does not supply such function or\r\n    table, the facility still operates, and performs whatever part of\r\n    its purpose remains meaningful.\r\n\r\n    (For example, a function in a library to compute square roots has\r\n    a purpose that is entirely well-defined independent of the\r\n    application.  Therefore, Subsection 2d requires that any\r\n    application-supplied function or table used by this function must\r\n    be optional: if the application does not supply it, the square\r\n    root function must still compute square roots.)\r\n\r\nThese requirements apply to the modified work as a whole.  If\r\nidentifiable sections of that work are not derived from the Library,\r\nand can be reasonably considered independent and separate works in\r\nthemselves, then this License, and its terms, do not apply to those\r\nsections when you distribute them as separate works.  But when you\r\ndistribute the same sections as part of a whole which is a work based\r\non the Library, the distribution of the whole must be on the terms of\r\nthis License, whose permissions for other licensees extend to the\r\nentire whole, and thus to each and every part regardless of who wrote\r\nit.\r\n\r\nThus, it is not the intent of this section to claim rights or contest\r\nyour rights to work written entirely by you; rather, the intent is to\r\nexercise the right to control the distribution of derivative or\r\ncollective works based on the Library.\r\n\r\nIn addition, mere aggregation of another work not based on the Library\r\nwith the Library (or with a work based on the Library) on a volume of\r\na storage or distribution medium does not bring the other work under\r\nthe scope of this License.\r\n\r\n  3. You may opt to apply the terms of the ordinary GNU General Public\r\nLicense instead of this License to a given copy of the Library.  To do\r\nthis, you must alter all the notices that refer to this License, so\r\nthat they refer to the ordinary GNU General Public License, version 2,\r\ninstead of to this License.  (If a newer version than version 2 of the\r\nordinary GNU General Public License has appeared, then you can specify\r\nthat version instead if you wish.)  Do not make any other change in\r\nthese notices.\r\n\f\r\n  Once this change is made in a given copy, it is irreversible for\r\nthat copy, so the ordinary GNU General Public License applies to all\r\nsubsequent copies and derivative works made from that copy.\r\n\r\n  This option is useful when you wish to copy part of the code of\r\nthe Library into a program that is not a library.\r\n\r\n  4. You may copy and distribute the Library (or a portion or\r\nderivative of it, under Section 2) in object code or executable form\r\nunder the terms of Sections 1 and 2 above provided that you accompany\r\nit with the complete corresponding machine-readable source code, which\r\nmust be distributed under the terms of Sections 1 and 2 above on a\r\nmedium customarily used for software interchange.\r\n\r\n  If distribution of object code is made by offering access to copy\r\nfrom a designated place, then offering equivalent access to copy the\r\nsource code from the same place satisfies the requirement to\r\ndistribute the source code, even though third parties are not\r\ncompelled to copy the source along with the object code.\r\n\r\n  5. A program that contains no derivative of any portion of the\r\nLibrary, but is designed to work with the Library by being compiled or\r\nlinked with it, is called a \"work that uses the Library\".  Such a\r\nwork, in isolation, is not a derivative work of the Library, and\r\ntherefore falls outside the scope of this License.\r\n\r\n  However, linking a \"work that uses the Library\" with the Library\r\ncreates an executable that is a derivative of the Library (because it\r\ncontains portions of the Library), rather than a \"work that uses the\r\nlibrary\".  The executable is therefore covered by this License.\r\nSection 6 states terms for distribution of such executables.\r\n\r\n  When a \"work that uses the Library\" uses material from a header file\r\nthat is part of the Library, the object code for the work may be a\r\nderivative work of the Library even though the source code is not.\r\nWhether this is true is especially significant if the work can be\r\nlinked without the Library, or if the work is itself a library.  The\r\nthreshold for this to be true is not precisely defined by law.\r\n\r\n  If such an object file uses only numerical parameters, data\r\nstructure layouts and accessors, and small macros and small inline\r\nfunctions (ten lines or less in length), then the use of the object\r\nfile is unrestricted, regardless of whether it is legally a derivative\r\nwork.  (Executables containing this object code plus portions of the\r\nLibrary will still fall under Section 6.)\r\n\r\n  Otherwise, if the work is a derivative of the Library, you may\r\ndistribute the object code for the work under the terms of Section 6.\r\nAny executables containing that work also fall under Section 6,\r\nwhether or not they are linked directly with the Library itself.\r\n\f\r\n  6. As an exception to the Sections above, you may also compile or\r\nlink a \"work that uses the Library\" with the Library to produce a\r\nwork containing portions of the Library, and distribute that work\r\nunder terms of your choice, provided that the terms permit\r\nmodification of the work for the customer's own use and reverse\r\nengineering for debugging such modifications.\r\n\r\n  You must give prominent notice with each copy of the work that the\r\nLibrary is used in it and that the Library and its use are covered by\r\nthis License.  You must supply a copy of this License.  If the work\r\nduring execution displays copyright notices, you must include the\r\ncopyright notice for the Library among them, as well as a reference\r\ndirecting the user to the copy of this License.  Also, you must do one\r\nof these things:\r\n\r\n    a) Accompany the work with the complete corresponding\r\n    machine-readable source code for the Library including whatever\r\n    changes were used in the work (which must be distributed under\r\n    Sections 1 and 2 above); and, if the work is an executable linked\r\n    with the Library, with the complete machine-readable \"work that\r\n    uses the Library\", as object code and/or source code, so that the\r\n    user can modify the Library and then relink to produce a modified\r\n    executable containing the modified Library.  (It is understood\r\n    that the user who changes the contents of definitions files in the\r\n    Library will not necessarily be able to recompile the application\r\n    to use the modified definitions.)\r\n\r\n    b) Accompany the work with a written offer, valid for at\r\n    least three years, to give the same user the materials\r\n    specified in Subsection 6a, above, for a charge no more\r\n    than the cost of performing this distribution.\r\n\r\n    c) If distribution of the work is made by offering access to copy\r\n    from a designated place, offer equivalent access to copy the above\r\n    specified materials from the same place.\r\n\r\n    d) Verify that the user has already received a copy of these\r\n    materials or that you have already sent this user a copy.\r\n\r\n  For an executable, the required form of the \"work that uses the\r\nLibrary\" must include any data and utility programs needed for\r\nreproducing the executable from it.  However, as a special exception,\r\nthe source code distributed need not include anything that is normally\r\ndistributed (in either source or binary form) with the major\r\ncomponents (compiler, kernel, and so on) of the operating system on\r\nwhich the executable runs, unless that component itself accompanies\r\nthe executable.\r\n\r\n  It may happen that this requirement contradicts the license\r\nrestrictions of other proprietary libraries that do not normally\r\naccompany the operating system.  Such a contradiction means you cannot\r\nuse both them and the Library together in an executable that you\r\ndistribute.\r\n\f\r\n  7. You may place library facilities that are a work based on the\r\nLibrary side-by-side in a single library together with other library\r\nfacilities not covered by this License, and distribute such a combined\r\nlibrary, provided that the separate distribution of the work based on\r\nthe Library and of the other library facilities is otherwise\r\npermitted, and provided that you do these two things:\r\n\r\n    a) Accompany the combined library with a copy of the same work\r\n    based on the Library, uncombined with any other library\r\n    facilities.  This must be distributed under the terms of the\r\n    Sections above.\r\n\r\n    b) Give prominent notice with the combined library of the fact\r\n    that part of it is a work based on the Library, and explaining\r\n    where to find the accompanying uncombined form of the same work.\r\n\r\n  8. You may not copy, modify, sublicense, link with, or distribute\r\nthe Library except as expressly provided under this License.  Any\r\nattempt otherwise to copy, modify, sublicense, link with, or\r\ndistribute the Library is void, and will automatically terminate your\r\nrights under this License.  However, parties who have received copies,\r\nor rights, from you under this License will not have their licenses\r\nterminated so long as such parties remain in full compliance.\r\n\r\n  9. You are not required to accept this License, since you have not\r\nsigned it.  However, nothing else grants you permission to modify or\r\ndistribute the Library or its derivative works.  These actions are\r\nprohibited by law if you do not accept this License.  Therefore, by\r\nmodifying or distributing the Library (or any work based on the\r\nLibrary), you indicate your acceptance of this License to do so, and\r\nall its terms and conditions for copying, distributing or modifying\r\nthe Library or works based on it.\r\n\r\n  10. Each time you redistribute the Library (or any work based on the\r\nLibrary), the recipient automatically receives a license from the\r\noriginal licensor to copy, distribute, link with or modify the Library\r\nsubject to these terms and conditions.  You may not impose any further\r\nrestrictions on the recipients' exercise of the rights granted herein.\r\nYou are not responsible for enforcing compliance by third parties to\r\nthis License.\r\n\f\r\n  11. If, as a consequence of a court judgment or allegation of patent\r\ninfringement or for any other reason (not limited to patent issues),\r\nconditions are imposed on you (whether by court order, agreement or\r\notherwise) that contradict the conditions of this License, they do not\r\nexcuse you from the conditions of this License.  If you cannot\r\ndistribute so as to satisfy simultaneously your obligations under this\r\nLicense and any other pertinent obligations, then as a consequence you\r\nmay not distribute the Library at all.  For example, if a patent\r\nlicense would not permit royalty-free redistribution of the Library by\r\nall those who receive copies directly or indirectly through you, then\r\nthe only way you could satisfy both it and this License would be to\r\nrefrain entirely from distribution of the Library.\r\n\r\nIf any portion of this section is held invalid or unenforceable under any\r\nparticular circumstance, the balance of the section is intended to apply,\r\nand the section as a whole is intended to apply in other circumstances.\r\n\r\nIt is not the purpose of this section to induce you to infringe any\r\npatents or other property right claims or to contest validity of any\r\nsuch claims; this section has the sole purpose of protecting the\r\nintegrity of the free software distribution system which is\r\nimplemented by public license practices.  Many people have made\r\ngenerous contributions to the wide range of software distributed\r\nthrough that system in reliance on consistent application of that\r\nsystem; it is up to the author/donor to decide if he or she is willing\r\nto distribute software through any other system and a licensee cannot\r\nimpose that choice.\r\n\r\nThis section is intended to make thoroughly clear what is believed to\r\nbe a consequence of the rest of this License.\r\n\r\n  12. If the distribution and/or use of the Library is restricted in\r\ncertain countries either by patents or by copyrighted interfaces, the\r\noriginal copyright holder who places the Library under this License may add\r\nan explicit geographical distribution limitation excluding those countries,\r\nso that distribution is permitted only in or among countries not thus\r\nexcluded.  In such case, this License incorporates the limitation as if\r\nwritten in the body of this License.\r\n\r\n  13. The Free Software Foundation may publish revised and/or new\r\nversions of the Library General Public License from time to time.\r\nSuch new versions will be similar in spirit to the present version,\r\nbut may differ in detail to address new problems or concerns.\r\n\r\nEach version is given a distinguishing version number.  If the Library\r\nspecifies a version number of this License which applies to it and\r\n\"any later version\", you have the option of following the terms and\r\nconditions either of that version or of any later version published by\r\nthe Free Software Foundation.  If the Library does not specify a\r\nlicense version number, you may choose any version ever published by\r\nthe Free Software Foundation.\r\n\f\r\n  14. If you wish to incorporate parts of the Library into other free\r\nprograms whose distribution conditions are incompatible with these,\r\nwrite to the author to ask for permission.  For software which is\r\ncopyrighted by the Free Software Foundation, write to the Free\r\nSoftware Foundation; we sometimes make exceptions for this.  Our\r\ndecision will be guided by the two goals of preserving the free status\r\nof all derivatives of our free software and of promoting the sharing\r\nand reuse of software generally.\r\n\r\n                            NO WARRANTY\r\n\r\n  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r\nWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r\nOTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\r\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r\nLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r\n\r\n  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r\nAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r\nLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r\nFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r\nDAMAGES.\r\n\r\n                     END OF TERMS AND CONDITIONS\r\n\f\r\n     Appendix: How to Apply These Terms to Your New Libraries\r\n\r\n  If you develop a new library, and you want it to be of the greatest\r\npossible use to the public, we recommend making it free software that\r\neveryone can redistribute and change.  You can do so by permitting\r\nredistribution under these terms (or, alternatively, under the terms of the\r\nordinary General Public License).\r\n\r\n  To apply these terms, attach the following notices to the library.  It is\r\nsafest to attach them to the start of each source file to most effectively\r\nconvey the exclusion of warranty; and each file should have at least the\r\n\"copyright\" line and a pointer to where the full notice is found.\r\n\r\n    <one line to give the library's name and a brief idea of what it does.>\r\n    Copyright (C) <year>  <name of author>\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n\r\nAlso add information on how to contact you by electronic and paper mail.\r\n\r\nYou should also get your employer (if you work as a programmer) or your\r\nschool, if any, to sign a \"copyright disclaimer\" for the library, if\r\nnecessary.  Here is a sample; alter the names:\r\n\r\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the\r\n  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\r\n\r\n  <signature of Ty Coon>, 1 April 1990\r\n  Ty Coon, President of Vice\r\n\r\nThat's all there is to it!\r\n"
  },
  {
    "path": "suppl/src/dbgf_chg.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_change\r\nsu(bsystem): debug\r\nty(pe): \r\nsh(ort description): Change the current state of the logging functions\r\nhe(ader files): \r\nlo(ng description): Changes the current state of the logging functions\r\n\trepresented by the macros DBG*().\r\npr(erequistes): More than one debug stack items are present\r\nva(lue): none\r\nre(lated to): suppl_log_lock suppl_log_push\r\nse(condary subsystems): \r\nin(itialized by): suppl_log_push\r\nwa(rning): \r\nbu(gs): \r\nfi(le): dbgf_chg.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"dynstr.h\"\r\n#include \"str.h\"\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_change(suppl_log_csptr_t state)\r\n{\tsuppl_log_sptr_t p;\r\n\r\n\tassert(state);\r\n\r\n\tif(suppl_log_lock()) {\r\n\t\tassert(suppl_Stack);\r\n\t\tp = state;\r\n\t\twhile(*p) {\r\n\t\t\tswitch(*p++) {\r\n\t\t\tcase 'd':\t/* maximum nesting level */\r\n\t\t\t\tstrnum(p, &S(maxdepth), (char **)&p);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'f':\t/* files to be logged */\r\n\t\t\t\tsuppl_log_chg_list(S(ownFiles), S(files), &p);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'c':\t/* functions to be logged */\r\n\t\t\t\tsuppl_log_chg_list(S(ownFunctions), S(functions), &p);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'C':\t/* classes to be logged */\r\n\t\t\t\tsuppl_log_chg_list(S(ownClasses), S(classes), &p);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'l':\t/* global log flag */\r\n\t\t\t\tsuppl_log_flag(S(enabled), &p);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'i':\t/* indention flag */\r\n\t\t\t\tsuppl_log_flag(S(indent), &p);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(*p++ != ';')\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tsuppl_log_unlock();\r\n\t}\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_cl.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_chg_list_\r\nsu(bsystem): debug\r\nty(pe): H_\r\nsy(nopsis): \r\nsh(ort description): Handle a change state item modifying a list\r\nhe(ader files): \r\nlo(ng description): Handles a change state item that modifies a list\r\n\tof names.\\par\r\n\tWhen a new state is created by using a push_state function,\r\n\tthe old lists are not duplicated, but their references only. To\r\n\tindicate that a state has modified a list and therefore has an own\r\n\tcopy of it, a flag is maintained.\\par\r\n\tThe change state item consists of a comma-seperated list of names:\r\n\t\\tok{?****}, with:\r\n\t\\item \\tok{****} is the name, and\r\n\t\\item \\tok{?} specifies if to add \\tok{'+'} or remove \\tok{'-'} the name.\r\n\t\\endlist\r\n\tIf no name is specified, all current entries are removed and the\r\n\tdefault behaviour is changed to except everything \\tok{'+'} or\r\n\tdeny all \\tok{'-'}.\r\npr(erequistes): str != 0 && *str != 0 && flag != 0 && list != 0\r\nva(lue):\\endlist none, but\r\n\t\\item \\tok{*str :=} pointer to next semicolon or end of string\r\n\t\\item \\tok{*flag := 1}\r\n\t\\item \\tok{*list}: modified according specified items\r\nre(lated to):  suppl_log_push suppl_log_pop suppl_log_change_state\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_chg_list_(FLAG *flag\r\n\t, suppl_log_list_t *list\r\n\t, suppl_log_sptr_t *str)\r\n{\tsuppl_log_sptr_t p, q;\r\n\tsuppl_log_list_t *act, *prv;\r\n\tint flg;\r\n\r\n\tassert(flag);\r\n\tassert(list);\r\n\tassert(str);\r\n\tassert(*str);\r\n\r\n\tif(*(p = *str) == NUL || *p == ';')\t\t/* Nothing to do */\r\n\t\treturn;\r\n\r\n\tif(!*flag) {\t\t\t\t/* Must create a local copy */\r\n\t\tsuppl_log_dup_list(list);\r\n\t\t*flag = 1;\r\n\t}\r\n\r\n\t/* Now append the new entries */\r\n\tchkHeap\r\n\tdo {\r\n\t\tswitch(flg = *p) {\r\n\t\tcase '+': case '-':\r\n\t\t\t++p;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tflg = '+';\t\t\t\t/* default to \"enabled\" */\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tif((q = strpbrk(p, \";,\")) == 0)\t/* advance to end of name */\r\n\t\t\tq = strend(p);\r\n\t\tif(q == p) {\t\t\t\t/* default specified */\r\n\t\t\tsuppl_log_del_list_(list);\r\n\t\t\tlist->suppl_l_name[0] = flg;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tact = list;\r\n\t\t\twhile((act = (prv = act)->suppl_l_nxt) != 0) {\r\n\t\t\t\tif(suppl_log_match_item(act, p)) {\r\n\t\t\t\t\t/* remove the current item from the list */\r\n\t\t\t\t\tchkHeap\r\n\t\t\t\t\tprv->suppl_l_nxt = act->suppl_l_nxt;\r\n\t\t\t\t\tfree(act);\r\n\t\t\t\t\tchkHeap\r\n\t\t\t\t\tact = prv;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t/* Append a new item */\r\n\t\t\tassert(prv);\r\n\t\t\tprv->suppl_l_nxt = suppl_log_mkf_item(flg, p, (size_t)(q - p));\r\n\t\t}\r\n\r\n\t\tchkHeap\r\n\t\tp = q;\r\n\t} while(*p++ == ',');\r\n\r\n\t*str = p - 1;\r\n\tchkHeap\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_cle.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_class_enabled\r\nsu(bsystem): debug\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Check if an information class is enabled\r\nhe(ader files): \r\nlo(ng description): \r\npr(erequistes): str != NULL && list != NULL\r\nva(lue): 0: disabled\r\n\t\\item else: enabled\r\nre(lated to):  suppl_log_match_list suppl_log_item_enabled\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint suppl_log_class_enabled(suppl_log_csptr_t str)\r\n{\treturn suppl_log_item_enabled(&S(classes), str);\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_clg.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_close\r\nsu(bsystem): debug\r\nty(pe): L\r\nsy(nopsis): \r\nsh(ort description): Close the logfile\r\nlo(ng description): Closes the logfile, its data and directory information,\r\n\tso that if it asynchroneously terminates, every item written so far\r\n\treally is in the logfile. If something is written into the logfile,\r\n\tthe logfile is opened again and the new entries are appended to it.\r\npr(erequistes): \r\nva(lue): none\r\nre(lated to): \r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include <stdio.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_close(void)\r\n{\tif(suppl_l_logfile) {\r\n\t\tfclose(suppl_l_logfile);\r\n\t\tsuppl_l_logfile = 0;\t\t/* identify that no LOG file is open */\r\n\t\t*suppl_l_openmode = 'a';\t/* Don't overwrite next open */\r\n\t}\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_dl.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_del_list_\r\nsu(bsystem): debug\r\nty(pe): HL_\r\nsy(nopsis): \r\nsh(ort description): Delete a name log list\r\nhe(ader files): \r\nlo(ng description): \r\npr(erequistes): \r\nva(lue): \r\nre(lated to): suppl_log_chg_list_\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_del_list_(suppl_log_list_t *list)\r\n{\tsuppl_log_list_t *h, *act;\r\n\r\n\tassert(list);\r\n\r\n\tchkHeap\r\n\tif((act = list->suppl_l_nxt) != 0) do {\r\n\t\th = act->suppl_l_nxt;\r\n\t\tchkHeap\r\n\t\tfree(act);\r\n\t\tchkHeap\r\n\t} while((act = h) != 0);\r\n\r\n\tlist->suppl_l_nxt = 0;\r\n\tchkHeap\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_dpl.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_dup_list\r\nsu(bsystem): debug\r\nty(pe): HL\r\nsy(nopsis): \r\nsh(ort description): Duplicate a name log list\r\nhe(ader files): \r\nlo(ng description): \r\npr(erequistes): \r\nva(lue): \r\nre(lated to): suppl_log_del_list suppl_log_chg_list_\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_dup_list(suppl_log_list_t *list)\r\n{\tsuppl_log_list_t *dupList;\r\n\r\n\tassert(list);\r\n\r\n\tchkHeap\r\n\tdupList = list;\r\n\tif((list = list->suppl_l_nxt) != 0) do {\r\n\t\tdupList = dupList->suppl_l_nxt\r\n\t\t  = suppl_log_mk_item(list->suppl_l_name);\r\n\t\tchkHeap\r\n\t} while((list = list->suppl_l_nxt) != 0);\r\n\tchkHeap\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_et.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_enter\r\nsu(bsystem): debug\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Enter a new function and reconfigure logging status\r\nhe(ader files): \r\nlo(ng description): Enters a new function and reconfigures the logging\r\n\tstatus.\\par\r\n\tThe old status is preserved, if necessary, into the local data structure\r\n\tallocated within the stack frame of the function. The member \\tok{fct_enabled} is newly configured from the passed in library name, function name and\r\n\tfunction class. The \\tok{nestlevel} is incremented.\\par\r\n\tThe \\tok{fct_enabled} follows the following rules:\r\n\t\\enum If a library is specified (\\tok{library_name != NULL}),\r\n\tthis library must be explicitly enabled as function class.\r\n\tOtherwise logging is disabled for this function.\r\n\t\\item If a filename is specified and the filename is explicitly\r\n\t\tmentioned, logging is either enabled or disabled.\r\n\t\\item If both function_name and function_class are explicitly found,\r\n\tboth must be enabled. Otherwise logging is disabled.\r\n\t\\item If only one of them are explicitly found, its status is used.\r\n\t\\item If neither of them are explicitly found, one default status\r\n\tmust be enabled.\r\n\t\\endlist\r\n\t\\par\r\n\tBy default no item is explicitly available and all default status'\r\n\tdefault to \"disabled\".\r\npr(erequistes): local_data != NULL && function_name != NULL && function_class != NULL\r\nva(lue): none, but \\item \\tok{*data} is updated with data that must be\r\n\tpreserved during one nest level\r\n\t\\item the current nest level is incremented\r\n\t\\item the function-depend enable status is re-evaluated\r\nre(lated to): \r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_enter(suppl_log_sptr_t library_name\r\n\t, suppl_log_csptr_t file_name\r\n\t, suppl_log_linenr_t linenr\r\n\t, suppl_log_local_data_t *local_data\r\n\t, suppl_log_csptr_t function_name\r\n\t, suppl_log_csptr_t function_class)\r\n{\tint ch1, ch2;\r\n\r\n\tassert(local_data);\r\n\tassert(function_name);\r\n\tassert(function_class);\r\n\r\n\t/* preserve the current settings */\r\n\tlocal_data->suppl_l_prv_nestlevel = suppl_l_nestlevel;\r\n\tlocal_data->suppl_l_prv_fct_enabled = suppl_l_fct_enabled;\r\n\tlocal_data->suppl_l_fctname = function_name;\r\n\r\n\t/* Set the new values */\r\n\t++suppl_l_nestlevel;\r\n\tif(library_name) {\r\n\t\tif(suppl_log_find_list(&S(classes), library_name) != '+') {\r\n\t\t\tsuppl_l_fct_enabled = 0;\r\n\t\t\tgoto goon;\t\t\t\t/* libraries are mandotary */\r\n\t\t}\r\n\t}\r\n\r\n\tif((ch1 = suppl_log_find_list(&S(files), file_name)) != 0) {\r\n\t\tsuppl_l_fct_enabled = ch1 == '+';\r\n\t\tgoto goon;\r\n\t}\r\n\r\n\tch1 = suppl_log_find_list(&S(classes), function_class);\r\n\tch2 = suppl_log_find_list(&S(functions), function_name);\r\n\r\n\tif(ch1)\r\n\t\tsuppl_l_fct_enabled = ch1 == '+' && (!ch2 || ch2 == '+');\r\n\telse if(ch2)\r\n\t\tsuppl_l_fct_enabled = ch2 == '+';\r\n\telse\t\t\t/* Neither ch1 nor ch2 */\r\n\t\tsuppl_l_fct_enabled = S(classes).suppl_l_name[0] == '+'\r\n\t\t || S(functions).suppl_l_name[0] == '+';\r\n\r\ngoon:\r\n\tif(suppl_log_class_enabled(\"fct\")) {\r\n\t\t/* Create the log entries when entering a new function */\r\n\t\tsuppl_log_log_header();\r\n\t\tsuppl_log_log_item(\">%s() \\\"%s\\\"\", function_name, function_class);\r\n\t\tif(library_name)\r\n\t\t\tsuppl_log_log_item(\" lib:%s\", library_name);\r\n\t\tif(file_name)\r\n\t\t\tsuppl_log_log_item(\" in %s:%lu\", file_name, linenr);\r\n\t\tsuppl_log_log_trailer();\r\n\t}\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_ext.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_terminate\r\nsu(bsystem): debug\r\nty(pe): \r\nsh(ort description): Terminate the application with a message in the logs\r\nhe(ader files): \r\nlo(ng description): Terminates the application logging the passed in\r\n\tstring and \"application terminated by debug system\" (both without\r\n\tany class), then terminates the application with DBG_EXIT_CODE.\r\npr(erequistes): \r\nva(lue): none\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dbgf_chg.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <process.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_terminate(suppl_log_csptr_t loginfo)\r\n{\tif(loginfo)\r\n\t\tsuppl_log_log(loginfo);\r\n\tsuppl_log_log(\"Application terminated by debug system\");\r\n\texit(DBG_EXIT_CODE);\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_fl.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_find_list\r\nsu(bsystem): debug\r\nty(pe): L\r\nsy(nopsis): \r\nsh(ort description): Search a name in a log list\r\nlo(ng description): Searches for a name through a log list and return if\r\n\tthe name is enabled or disabled.\r\npr(erequistes): list != NULL\r\nva(lue): 0:\tno entry of the specified name or \\tok{str == NULL}\r\n\t\\item else: status of the found entry\r\nre(lated to): suppl_log_match_list\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint suppl_log_find_list(suppl_log_list_t *list\r\n\t, suppl_log_csptr_t str)\r\n{\tsuppl_log_list_t *act;\r\n\tint flg, ch;\r\n\r\n\tassert(list);\r\n\r\n\tflg = 0;\r\n\r\n\tif(str && (act = list->suppl_l_nxt) != 0) do {\r\n\t\tif((ch = suppl_log_match_item(act, str)) != 0)\r\n\t\t\tflg = ch;\r\n\t} while((act = act->suppl_l_nxt) != 0);\r\n\r\n\treturn flg;\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_flg.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_flag_\r\nsu(bsystem): debug\r\nty(pe): H_\r\nsy(nopsis): \r\nsh(ort description): Handle a change state item modifying a flag\r\nhe(ader files): \r\nlo(ng description): Handles a change state item that modifies a flag.\\par\r\n\tThe flag can be: \\tok{'+'} or \\tok{\"on\"} or \\tok{\"1\"} (Note: the\r\n\t\\em{string} \"1\", but the numerical \"one\") meaning \\em{enabled} and\r\n\t\\tok{'-'} or \\tok{\"off\"}  or \\tok{\"0\"} meaning \\em{disabled}.\\newline\r\n\tNo localization support is implemented for these values as they seem\r\n\tto be related to the programmer only. That means that one cannot use\r\n\tthe localized variant of \\tok{\"on\"} as defined for the \\subsys{cmdline}.\r\npr(erequistes): str != NULL && *str != NULL && flag != NULL\r\nva(lue):\\endlist none, but\r\n\t\\item \\tok{*str :=} pointer to next semicolon or end of string\r\n\t\\item \\tok{*flag :=} specified boolean state\r\nre(lated to):  suppl_log_push suppl_log_pop suppl_log_change_state\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_flag_(FLAG *flag, suppl_log_sptr_t *str)\r\n{\tsuppl_log_sptr_t p;\r\n\tint ch, flg;\r\n\r\n\tassert(flag);\r\n\tassert(str);\r\n\tassert(*str);\r\n\r\n\tif((ch = *(p = *str)) == NUL || ch == ';')\t\t/* Nothing to do */\r\n\t\treturn;\r\n\r\n\tflg = 0;\r\n\tswitch(*(p = *str)) {\r\n\tcase '\\0': case ';':\t\t\t/* Nothing to do */\r\n\t\tbreak;\r\n\tcase 'o': case 'O':\t\t\t\t/* on or off */\r\n\t\tswitch(*++p) {\r\n\t\tcase 'n': case 'N':\r\n\t\t\tgoto flgEnable;\r\n\t\tcase 'f': case 'F':\r\n\t\t\tif((ch = *++p) == 'f' || ch == 'F')\r\n\t\t\t\tgoto flgFound;\r\n\t\t}\r\n\t\tbreak;\t\t\t\t\t\t/* failed */\r\n\tcase '+': case '1':\r\n\tflgEnable:\tflg = 1;\r\n\tcase '-': case '0':\r\n\tflgFound:\t/* Now the change item must be finished */\r\n\t\tif((ch = *++p) == NUL || ch == ';') {\r\n\t\t\t*str = p;\r\n\t\t\t*flag = flg;\r\n\t\t}\r\n\t}\r\n\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_ien.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_item_enabled\r\nsu(bsystem): debug\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Check if an item is enabled\r\nhe(ader files): \r\nlo(ng description): Checks if 1) logging is enabled at all, 2) the nesting\r\n\tlevel permits logging, 3) the function name logging is passed, and 4)\r\n\tif the item is enabled according the given list.\r\npr(erequistes): str != NULL && list != NULL\r\nva(lue): 0: disabled\r\n\t\\item else: enabled\r\nre(lated to):  suppl_log_match_list\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint suppl_log_item_enabled(suppl_log_list_t *list\r\n\t, suppl_log_csptr_t str)\r\n{\treturn S(enabled)\t\t\t/* logging enabled at all */\r\n\t && suppl_l_nestlevel <= S(maxdepth)\r\n\t && suppl_l_fct_enabled\r\n\t && suppl_log_match_list(list, str);\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_lgh.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_log_header\r\nsu(bsystem): debug\r\nty(pe): L\r\nsy(nopsis): \r\nsh(ort description): Prepare to submit a debug log entry\r\nlo: Prepares to issue a debug log entry into the logfile.\\par\r\n\tThis function dumps the standard information (time, continueous\r\n\tnumber) and the indention. The line is left open right at the\r\n\tposition where to write the message to.\\newline\r\n\tIf the logfile is closed, it is opened automatically.\r\nhe(ader files): \r\npr(erequistes): \r\nva(lue): none\r\nre(lated to): \r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"nls.h\"\r\n#include \"appname.h\"\r\n#include \"dynstr.h\"\r\n#include \"supplio.h\"\r\n#include \"msgs.h\"\r\n\r\n#include \"syslog.loc\"\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_log_header(void)\r\n{\tchar *fnam;\r\n\tnlstime t;\r\n\r\n\tassert(suppl_Stack);\r\n\r\n\tif(!suppl_log_lock())\r\n\t\treturn;\r\n\r\n\t/* Open the logfile if not done so already */\r\n\tif(!suppl_l_logfile) {\r\n\t\t/* If to lock the debug package fails, _item() and _trailer()\r\n\t\t\twill silently ignore any calls */\r\n\t\tchkHeap\r\n\t\tif((fnam = appNameEx()) == 0)\r\n\t\t\tEsuppl_noMem();\r\n\t\tfnam = EStrConcat(2, fnam, DBG_EXTENSION);\r\n\t\tsuppl_l_logfile = Eopen(fnam, suppl_l_openmode);\r\n\t\tchkHeap\r\n\t\tfree(fnam);\r\n\t}\r\n\tchkHeap\r\n\r\n\tnlsCurTime(aS(t));\r\n\r\n\tsuppl_log_unlock();\r\n\r\n\tsuppl_log_log_item(\"%02u:%02u:%02u.%02u \", t.ti_hour, t.ti_minute\r\n\t , t.ti_second, t.ti_hundred);\r\n\r\n\tif(S(indent)) {\t\t\t/* indent */\r\n\t\tint i;\r\n\r\n\t\tsuppl_log_log_item(\"%9ld:\", suppl_l_count);\r\n\t\tfor(i = suppl_l_nestlevel; i--; )\r\n\t\t\tsuppl_log_log_item(\"\\t|\");\r\n\t}\r\n\telse {\t\t\t\t\t/* no indention, dump nestlevel numerical */\r\n\t\tsuppl_log_log_item(\"%ld [%d]: \", suppl_l_count, suppl_l_nestlevel);\r\n\t}\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_lgi.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_log_item\r\nsu(bsystem): debug\r\nty(pe): L\r\nsy(nopsis): \r\nsh(ort description): Submit a message into the debug log file\r\nhe(ader files): \r\npr(erequistes): \r\nva(lue): none\r\nre(lated to): suppl_log_log_header suppl_log_log_vitem suppl_log_log_trailer\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\nob(ject): suppl_log_log_vitem\r\nsu(bsystem): debug\r\nty(pe): L\r\nsy(nopsis): \r\nsh(ort description): Submit a message into the debug log file\r\nhe(ader files): \r\npr(erequistes): \r\nva(lue): none\r\nre(lated to): suppl_log_log_header suppl_log_log_item suppl_log_log_trailer\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"syslog.loc\"\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_log_item(suppl_log_csptr_t fmt, ...)\r\n{\tva_list ap;\r\n\r\n\tva_start(ap, fmt);\r\n\tsuppl_log_log_vitem(fmt, ap);\r\n\tva_end(ap);\r\n}\r\n\r\nvoid suppl_log_log_vitem(suppl_log_csptr_t fmt, va_list ap)\r\n{\r\n\tassert(fmt);\r\n\tif(suppl_l_logfile && suppl_log_lock()) {\r\n\t\tsuppl_log_unlock();\r\n\t\tvfprintf(suppl_l_logfile, fmt, ap);\r\n\t\tchkHeap\r\n\t}\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_lgt.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_log_trailer\r\nsu(bsystem): debug\r\nty(pe): L\r\nsy(nopsis): \r\nsh(ort description): Finish a debug log entry\r\nhe(ader files): \r\npr(erequistes): \r\nva(lue): none\r\nre(lated to): suppl_log_log_header\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <stdio.h>\r\n#include <portable.h>\r\n\r\n#include \"syslog.loc\"\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_log_trailer(void)\r\n{\r\n\tassert(suppl_Stack);\r\n\r\n\tif(suppl_l_logfile && suppl_log_lock()) {\r\n\t\tputc('\\n', suppl_l_logfile);\r\n#ifdef DBG_ALWAYS_CLOSELOG\r\n\t\t/* FreeDOS does not support commit file */\r\n\t\t/* DBG_FLUSHLOG */\r\n\t\tDBG_CLOSELOG\r\n#else\r\n#ifdef DBG_ALWAYS_FLUSH_LOG\r\n\t\tfcommit(suppl_l_logfile);\t\t/* make sure the entry is on disk */\r\n#endif\r\n#endif\r\n\t\t++suppl_l_count;\r\n\t\tchkHeap\r\n\t\tsuppl_log_unlock();\r\n\t}\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_lk.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_unlock\r\nsu(bsystem): debug\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): \"Unlock\" the debug/logging package\r\nhe(ader files): \r\nlo(ng description): \"Unlocks\" the debug/logging package to prevent\r\n\trecursively calling of these packages\r\npr(erequistes): \r\nva(lue): \r\nre(lated to): suppl_log_lock\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\nob(ject): suppl_log_lock\r\nsu(bsystem): debug\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): \"Lock\" the debug/logging package\r\nhe(ader files): \r\nlo(ng description): \"Locks\" the debug/logging package to prevent\r\n\trecursively calling of these packages\r\npr(erequistes): \r\nva(lue): \r\nre(lated to): suppl_log_unlock\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nstatic int locked = -1;\r\n\r\nint suppl_log_lock(void)\r\n{\tif(++locked) { /* recursion */\r\n\t\t--locked;\r\n\t\treturn 0;\r\n\t}\r\n\r\n\treturn 1;\r\n}\r\n\r\nvoid suppl_log_unlock(void)\r\n{\t--locked;\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_log.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_log\r\nsu(bsystem): debug\r\nty(pe): _\r\nsy(nopsis): \r\nsh(ort description): Write one log entry\r\nhe(ader files): \r\nlo(ng description): Writes one entry into the debug log.\\par\r\n\tThe entry is prefixed by the time and, if enabled, indented\r\n\tthe necessary depth. Then a printf()-like command is executed\r\n\tand one newline chatacter is appended.\r\npr(erequistes): fmt != NULL\r\nva(lue): none\r\nre(lated to):  suppl_log_log_header suppl_log_log_trailer suppl_log_log_item suppl_log_log_vitem\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_log(suppl_log_csptr_t fmt, ...)\r\n{\tva_list ap;\r\n\r\n\tassert(fmt);\r\n\r\n\tva_start(ap, fmt);\r\n\r\n\tsuppl_log_log_header();\r\n\tsuppl_log_log_vitem(fmt, ap);\r\n\tsuppl_log_log_trailer();\r\n\r\n\tva_end(ap);\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_lv.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_leave\r\nsu(bsystem): debug\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Leave a function and reconfigure logging status\r\nhe(ader files): \r\npr(erequistes): local_data != NULL\r\nva(lue): none, but\r\n\t\\item the current nest level is resetted to the original value\r\n\t\\item the function-depend enable status is re-evaluated\r\nre(lated to): \r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_leave(suppl_log_local_data_t *local_data)\r\n{\r\n\tassert(local_data);\r\n\tassert(local_data->suppl_l_fctname);\r\n\r\n\tif(suppl_log_class_enabled(\"fct\"))\r\n\t\t/* Create the log entries when leaving a function */\r\n\t\tsuppl_log_log(\"<%s()\", local_data->suppl_l_fctname);\r\n\r\n\tif(local_data->suppl_l_prv_nestlevel != suppl_l_nestlevel - 1)\r\n\t\tsuppl_log_log(\"Missing %u DBG_LEAVE macro(s)\"\r\n\t\t , suppl_l_nestlevel - 1 - local_data->suppl_l_prv_nestlevel);\r\n\r\n\t/* restore the former settings */\r\n\tsuppl_l_nestlevel = local_data->suppl_l_prv_nestlevel;\r\n\tsuppl_l_fct_enabled = local_data->suppl_l_prv_fct_enabled;\r\n\tchkHeap\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_mfi.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_mkf_item\r\nsu(bsystem): debug\r\nty(pe): HL\r\nsy(nopsis): \r\nsh(ort description): Make a new item of a name log list\r\nhe(ader files): \r\nlo(ng description): \r\npr(erequistes): \r\nva(lue): \r\nre(lated to): \r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"dynstr.h\"\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nsuppl_log_list_t *suppl_log_mkf_item(int flag, const char * const s\r\n\t, size_t length)\r\n{\tsuppl_log_list_t *h;\r\n\r\n\tassert(s);\r\n\tassert(length);\r\n\tassert(flag == '+' || flag == '-');\r\n\r\n\tchkHeap\r\n\th = Emalloc(sizeof(suppl_log_list_t) + length);\r\n\th->suppl_l_nxt = 0;\r\n\tchkHeap\r\n\tmemcpy(&h->suppl_l_name[1], s, length);\r\n\th->suppl_l_name[0] = flag;\r\n\th->suppl_l_name[1 + length] = NUL;\r\n\r\n\tchkHeap\r\n\treturn h;\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_mi.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_match_item\r\nsu(bsystem): debug\r\nty(pe): L\r\nsy(nopsis): \r\nsh(ort description): Test if the item matches the requested string\r\nhe(ader files): \r\nlo(ng description): \r\npr(erequistes): \r\nva(lue): \r\nre(lated to): \r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint suppl_log_match_item(suppl_log_list_t *item\r\n\t, suppl_log_csptr_t s)\r\n{\tassert(item);\r\n\tassert(s);\r\n\tassert(*s);\r\n\r\n\tif(memcmp(&item->suppl_l_name[1], s, strlen(&item->suppl_l_name[1])))\r\n\t\treturn 0;\t\t\t\t\t\t/* no match */\r\n\r\n\treturn item->suppl_l_name[0];\t\t/* return the enable/disable status */\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_mki.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_mk_item\r\nsu(bsystem): debug\r\nty(pe): HL\r\nsy(nopsis): \r\nsh(ort description): Make a new item of a name log list\r\nhe(ader files): \r\nlo(ng description): \r\npr(erequistes): \r\nva(lue): \r\nre(lated to): \r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"dynstr.h\"\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nsuppl_log_list_t *suppl_log_mk_item(const char * const s)\r\n{\tsuppl_log_list_t *h;\r\n\r\n\tassert(s);\r\n\tassert(*s == '+' || *s == '-');\r\n\r\n\th = Emalloc(sizeof(suppl_log_list_t) - 1 + strlen(s));\r\n\th->suppl_l_nxt = 0;\r\n\tstrcpy(&h->suppl_l_name[0], s);\r\n\r\n\tchkHeap\r\n\treturn h;\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_ml.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_match_list\r\nsu(bsystem): debug\r\nty(pe): L\r\nsy(nopsis): \r\nsh(ort description): Search a name within a log list and return its status\r\nhe(ader files): Searches for a name through a log list and return if\r\n\tthe name is enabled or disabled. If there is no entry of the name\r\n\twithin the list, the default status is returned.\r\nlo(ng description): \r\npr(erequistes): list != NULL\r\nva(lue): 0:\tdisabled or \\tok{str == NULL}\r\n\t\\item else: enabled\r\nre(lated to): suppl_log_find_list\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint suppl_log_match_list(suppl_log_list_t *list\r\n\t, suppl_log_csptr_t str)\r\n{\tint flg;\r\n\r\n\tassert(list);\r\n\r\n\tif(!str)\r\n\t\treturn 0;\r\n\r\n\tif((flg = suppl_log_find_list(list, str)) == 0)\r\n\t\t/* no explicit entry --> return default */\r\n\t\tflg = list->suppl_l_name[0];\r\n\r\n\treturn flg == '+';\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_pop.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_pop\r\nsu(bsystem): debug\r\nty(pe): \r\nsh(ort description): Discard the current state of the logging functions\r\nhe(ader files): \r\nlo(ng description): The state of the logging functions is organized within\r\n\ta stack. The topmost state is the \"current\" state under which control\r\n\tthe logging functions perform their work. This function discards the\r\n\tcurrent state and restores the previous one. The function will not\r\n\tdiscard the last state.\r\npr(erequistes): more than one state within the status-stack\r\nva(lue): none\r\nre(lated to): suppl_log_change, suppl_log_push\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dbgf_pop.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_pop(void)\r\n{\t\r\n\tif(suppl_log_lock()) {\r\n\t\tif(suppl_Stack && S(nxt)) {\r\n\t\t\t/* OK more than one entry */\r\n\t\t\tsuppl_log_stack_t *p;\r\n\r\n\t\t\tchkHeap\r\n\t\t\tif(S(ownClasses))\r\n\t\t\t\tsuppl_log_del_list(S(classes));\r\n\t\t\tif(S(ownFunctions))\r\n\t\t\t\tsuppl_log_del_list(S(functions));\r\n\t\t\tif(S(ownFiles))\r\n\t\t\t\tsuppl_log_del_list(S(files));\r\n\r\n\t\t\tchkHeap\r\n\t\t\tp = suppl_Stack;\r\n\t\t\tsuppl_Stack = S(nxt);\r\n\t\t\tfree(p);\r\n\t\t\tchkHeap\r\n\t\t}\r\n\t\tsuppl_log_unlock();\r\n\t}\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_prt.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_print_1\r\nsu(bsystem): debug\r\nty(pe): L\r\nsy(nopsis): \r\nsh(ort description): Test and open one log entry\r\nhe(ader files): \r\nlo(ng description): Tests, if enabled, and, if so, opens one entry in the debug log.\\par\r\n\tThis function dumps the usual prefix (time, entry number and indention)\r\n\tand the information class into the logfile and leaves the entry open.\r\npr(erequistes): inf_class != NULL\r\nva(lue): 0: if logging is disabled for the particular information class\r\n\t\\item else: otherwise\r\nre(lated to):  suppl_log_log_header suppl_log_log_trailer suppl_log_log_item suppl_log_log_vitem suppl_log_log suppl_log_print_2\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): The suppl_log_log() function became unsuiteable, because there is\r\n\tno portable way to implement a macro like DBG_PRINT(), which is called\r\n\twith a dynamic parameter list _and_ calls a function with this\r\n\tlist and one additional argument. Therefore the logging process is\r\n\tsplitted into two functions, what may lead to problems, if they\r\n\tare not called in sequence.\r\nbu(gs): \r\nco(mpilers): \r\n\r\nob(ject): suppl_log_print_2\r\nsu(bsystem): debug\r\nty(pe): L\r\nsy(nopsis): \r\nsh(ort description): Fill and close one log entry\r\nhe(ader files): \r\nlo(ng description): Fills and closes one entry in the debug log.\\par\r\n\tThis function dumps the usual information into the debug logfile and\r\n\tcloses this entry, thus, it is the \\em{back-end} of the suppl_log_print_1()\r\n\tfunction.\r\npr(erequistes): fmt != NULL\r\nva(lue): none\r\nre(lated to):  suppl_log_log_header suppl_log_log_trailer suppl_log_log_item suppl_log_log_vitem suppl_log_log suppl_log_print_1\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): see suppl_log_print_1()\r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint suppl_log_print_1(suppl_log_csptr_t inf_class)\r\n{\tif(suppl_log_class_enabled(inf_class)) {\r\n\t\tsuppl_log_log_header();\r\n\t\tsuppl_log_log_item(\"%s: \", inf_class);\r\n\t\treturn 1;\r\n\t}\r\n\treturn 0;\r\n}\r\n\r\nvoid suppl_log_print_2(suppl_log_csptr_t fmt, ...)\r\n{\tva_list ap;\r\n\r\n\tassert(fmt);\r\n\r\n\tva_start(ap, fmt);\r\n\r\n\tsuppl_log_log_vitem(fmt, ap);\r\n\tsuppl_log_log_trailer();\r\n\r\n\tva_end(ap);\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_psh.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_log_push\r\nsu(bsystem): debug\r\nty(pe): \r\nsh(ort description): Duplicates the current state of the logging functions\r\nhe(ader files): \r\nlo(ng description): The state of the logging function is organized within\r\n\ta stack, the topmost item controls the behaviour of the logging\r\n\tfunctions. This function duplicates the topmost item, thus, preserves the\r\n\tcurrent state to be restored later.\r\npr(erequistes): \r\nva(lue): none\r\nre(lated to): suppl_log_change, suppl_log_pop\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dbgf_psh.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n#include \"dynstr.h\"\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid suppl_log_push(void)\r\n{\t\r\n\tif(suppl_log_lock()) {\r\n\t\tsuppl_log_stack_t *p;\r\n\r\n\t\tassert(suppl_Stack);\r\n\r\n\t\tmemcpy(p = Emalloc(sizeof(suppl_log_stack_t))\r\n\t\t , suppl_Stack, sizeof(suppl_log_stack_t));\r\n\t\tp->suppl_l_nxt = suppl_Stack;\r\n\t\tsuppl_Stack = p;\r\n\r\n\t\tS(ownClasses) = S(ownFunctions) = S(ownFiles) = 0;\r\n\t\tsuppl_log_unlock();\r\n\t\tchkHeap\r\n\t}\r\n}\r\n"
  },
  {
    "path": "suppl/src/dbgf_var.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_stack1\r\nsu(bsystem): debug\r\nty(pe): L\r\nsy(nopsis): \r\nsh(ort description): Initial (default) debug stack\r\nhe(ader files): \r\nlo(ng description): Initial debug stack; the default values are:\r\n\t\\item no files to be logged; defaults to \"disable\"\r\n\t\\item no functions to be logged; defaults to \"disable\"\r\n\t\\item no classes to be logged; defaults to \"disable\"\r\n\t\\item unlimited depth (32767)\r\n\t\\item not enabled\r\n\t\\item indent enabled\r\npr(erequistes): \r\nva(lue): \r\nre(lated to): \r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\nob(ject): suppl_Stack\r\nsu(bsystem): debug\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Pointer to the current debug stack item\r\nhe(ader files): \r\nlo(ng description): \r\npr(erequistes): \r\nva(lue): \r\nre(lated to): suppl_log_change\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static suppl_log_push suppl_log_pop\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\nob: suppl_l_nestlevel\r\nsu: debug\r\nsh: current nesting level of functions during logging\r\nre: suppl_log_enter suppl_log_leave\r\nin: static suppl_log_enter suppl_log_leave\r\n\r\nob: suppl_l_fct_enabled\r\nsu: debug\r\nsh: status if the function name/class allows logging\r\nre: suppl_log_enter suppl_log_leave\r\nin: static suppl_log_enter suppl_log_leave\r\n\r\nob: suppl_l_openmode\r\nsu: debug\r\nsh: how to open the logfile\r\nre: suppl_log_enter\r\nin: static suppl_log_enter suppl_log_close\r\n\r\nob: suppl_l_logfile\r\nsu: debug\r\nsh: opened logfile\r\nre: suppl_log_log_header\r\nin: static suppl_log_log_header\r\n\r\nob: suppl_l_count\r\nsu: debug\r\nsh: line counter of logfile\r\nre: suppl_log_log_header\r\nin: static suppl_log_log_header\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <stdio.h>\r\n#endif\r\n#include <limits.h>\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\n\r\nsuppl_log_stack_t suppl_stack1 = {\r\n\t 0\t\t\t\t\t/* no next item */\r\n\t,\t\t\t\t\t\t/* files to be logged */\r\n\t\t{ 0\r\n\t\t  , { '-', '\\0' }\r\n\t\t}\r\n\t,\t\t\t\t\t\t/* classes to be logged */\r\n\t\t{ 0\r\n\t\t  , { '-', '\\0' }\r\n\t\t}\r\n\t,\t\t\t\t\t\t/* functions to be logged */\r\n\t\t{ 0\r\n\t\t  , { '-', '\\0' }\r\n\t\t}\r\n\t,INT_MAX\t\t\t\t/* maximum nesting level */\r\n\t,0\t\t\t\t\t\t/* logging active? */\r\n\t,1\t\t\t\t\t\t/* indent output? */\r\n\t,1\t\t\t\t\t\t/* 'files' member NOT inherited */\r\n\t,1\t\t\t\t\t\t/* 'classes' member NOT inherited */\r\n\t,1\t\t\t\t\t\t/* 'functions' member NOT inherited */\r\n};\r\n\r\nsuppl_log_stack_t *suppl_Stack = aS(suppl_stack1);\r\n\r\nint suppl_l_nestlevel = 0;\t\t\t\t/* current nesting level */\r\nFLAG suppl_l_fct_enabled = 0;\t\t\t/* function class permits logging */\r\nFILE *suppl_l_logfile = 0;\t\t\t/* logfile opened? */\r\nchar suppl_l_openmode[] = \"wt\";\t\t\t/* openmode for the logfile\r\n\t\t\t\t\t\t\t\t\t\t\tfirst character must be w/a */\r\nlong suppl_l_count = 0;\t\t\t\t\t/* line counter */\r\n"
  },
  {
    "path": "suppl/src/dbgm_chk.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_testMemChain\r\nsu(bsystem): debug\r\nty(pe): \r\nsh(ort description): Test the DOS Memory Chain for corruptions\r\nhe(ader files): \r\nlo(ng description): Tests if the DOS Memory Chain had been corrupted and,\r\n\tif so, the application is terminated with a message onto screen and\r\n\twithin logfiles.\r\npr(erequistes): \r\nva(lue): none\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dbgm_sr.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <conio.h>\r\n#include <stddef.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"mcb.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\n#ifndef __GNUC__\r\n#pragma argsused\r\n#endif\r\n\r\n#if defined __TURBOC__ && __TURBOC__ <= 0x201\r\n# define offsetof(s_name, m_name) (size_t)&(((s_name*)0)->m_name)\r\n#endif\r\n\r\nstatic int checkItem(void *arg, word segm)\r\n{\r\n    (void)arg;\r\n\tif((peekb(segm, offsetof(struct MCB, mcb_type)) != 'M'\r\n\t  && peekb(segm, offsetof(struct MCB, mcb_type)) != 'Z')\r\n\t || peekw(segm, offsetof(struct MCB, mcb_size)) >= ~segm) {\r\n\t\tDBG_POP_STATE\r\n\t\tDBG_PRINT(Suppl_class_mem, (\"Memory Chain corrupted\"))\r\n\t\tcputs(\"\\r\\nMemory Chain corrupted!\\r\\n\" \r\n\t\t \"\\7Press any key to terminate application\\r\\n\\7\");\r\n\t\tgetch();\r\n\t\tDBG_TERMINATE(0)\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n\r\nvoid suppl_testMemChain(void)\r\n{\tstatic volatile  FLAG8 recursive = 1;\r\n\r\n\tif(--recursive == 0) {\t/* prevent recursion */\r\n\t\tDBG_PUSH_STATE\r\n\t\tDBG_CHANGE_STATE(\"l-\")\r\n\t\tmcb_walk(0, checkItem, 0);\r\n\t\tDBG_POP_STATE\r\n\t}\r\n\t++recursive;\r\n}\r\n\r\n"
  },
  {
    "path": "suppl/src/dbgv_s0.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_SUPPL\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of the library passed to DBG_ENTER() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of the library passed to\r\n\tDBG_ENTER() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"SUPPL\"\r\nre(lated to): DBG_ENTER\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_SUPPL[] = \"SUPPL\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s10.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_mcb\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of \\subsys{mcb} passed to DBG_ENTER() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of \\subsys{mcb} passed to\r\n\tDBG_ENTER() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"mcb\"\r\nre(lated to): DBG_ENTER\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_mcb[] = \"mcb\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s13.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_farmem\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of \\subsys{farmem} passed to DBG_ENTER() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of \\subsys{farmem} passed to\r\n\tDBG_ENTER() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"farmem\"\r\nre(lated to): DBG_ENTER\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_farmem[] = \"farmem\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s14.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_dfn\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of \\subsys{dfn} passed to DBG_ENTER() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of \\subsys{dfn} passed to\r\n\tDBG_ENTER() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"dfn\"\r\nre(lated to): DBG_ENTER\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_dfn[] = \"dfn\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s15.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_portable\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of \\subsys{portable} passed to DBG_ENTER() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of \\subsys{portable} passed to\r\n\tDBG_ENTER() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"portable\"\r\nre(lated to): DBG_ENTER\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_portable[] = \"portable\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s17.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_cmdline\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of \\subsys{cmdline} passed to DBG_ENTER() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of \\subsys{cmdline} passed to\r\n\tDBG_ENTER() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"cmdline\"\r\nre(lated to): DBG_ENTER\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_cmdline[] = \"cmdline\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s19.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_class_arg\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of the class passed to DBG_PRINT() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of the class passed to\r\n\tDBG_PRINT() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"arg\"\r\nre(lated to): DBG_PRINT\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_class_arg[] = \"arg\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s2.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_appName\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of \\subsys{appName} passed to DBG_ENTER() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of \\subsys{appName} passed to\r\n\tDBG_ENTER() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"appName\"\r\nre(lated to): DBG_ENTER\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_appName[] = \"appName\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s20.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_class_rv\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of the class passed to DBG_PRINT() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of the class passed to\r\n\tDBG_PRINT() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"rv\"\r\nre(lated to): DBG_PRINT\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_class_rv[] = \"rv\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s22.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_class_inf\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of the class passed to DBG_PRINT() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of the class passed to\r\n\tDBG_PRINT() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"inf\"\r\nre(lated to): DBG_PRINT\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_class_inf[] = \"inf\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s23.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_class_env\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of the class passed to DBG_PRINT() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of the class passed to\r\n\tDBG_PRINT() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"env\"\r\nre(lated to): DBG_PRINT\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_class_env[] = \"env\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s24.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_class_mcb\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of the class passed to DBG_PRINT() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of the class passed to\r\n\tDBG_PRINT() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"mcb\"\r\nre(lated to): DBG_PRINT\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_class_mcb[] = \"mcb\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s25.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_class_mem\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of the class passed to DBG_PRINT() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of the class passed to\r\n\tDBG_PRINT() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"mem\"\r\nre(lated to): DBG_PRINT\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_class_mem[] = \"mem\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s3.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_dynstr\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of \\subsys{dynstr} passed to DBG_ENTER() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of \\subsys{dynstr} passed to\r\n\tDBG_ENTER() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"dynstr\"\r\nre(lated to): DBG_ENTER\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_dynstr[] = \"dynstr\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s4.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_env\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of \\subsys{env} passed to DBG_ENTER() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of \\subsys{env} passed to\r\n\tDBG_ENTER() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"env\"\r\nre(lated to): DBG_ENTER\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_env[] = \"env\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s5.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_error\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of \\subsys{error} passed to DBG_ENTER() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of \\subsys{error} passed to\r\n\tDBG_ENTER() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"error\"\r\nre(lated to): DBG_ENTER\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_error[] = \"error\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s6.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_misc\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of \\subsys{misc} passed to DBG_ENTER() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of \\subsys{misc} passed to\r\n\tDBG_ENTER() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"misc\"\r\nre(lated to): DBG_ENTER\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_misc[] = \"misc\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s7.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_supplio\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of \\subsys{supplio} passed to DBG_ENTER() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of \\subsys{supplio} passed to\r\n\tDBG_ENTER() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"supplio\"\r\nre(lated to): DBG_ENTER\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_supplio[] = \"supplio\";\r\n"
  },
  {
    "path": "suppl/src/dbgv_s8.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Suppl_nls\r\nsu(bsystem): debug\r\nty(pe): L0\r\nsy(nopsis): \r\nsh(ort description): Name of \\subsys{nls} passed to DBG_ENTER() macros\r\nhe(ader files): \r\nlo(ng description): Contains the name of \\subsys{nls} passed to\r\n\tDBG_ENTER() macros in order to prevent that every function\r\n\tcreates its own copy of the word into its data segment.\r\npr(erequistes): \r\nva(lue): \"nls\"\r\nre(lated to): DBG_ENTER\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nconst char Suppl_nls[] = \"nls\";\r\n"
  },
  {
    "path": "suppl/src/dfn.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tDeclarations for the DOS filename functions.\r\n\tInternal header file.\r\n\r\n*/\r\n\r\n#ifndef __DFN_LOC\r\n#define __DFN_LOC\r\n\r\n#include <portable.h>\r\n#include <assert.h>\r\n#include \"dfn.h\"\r\n\r\n#define DFN_FILENAME_BUFFER_LENGTH 512\r\n\t/*!ska Yes, I know that DOS has a more limited length but remember\r\n\t\tthis is only twice as much as a Win95 filename can have. */\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/dfndeli2.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): dfndelim2\r\nsu(bsystem): dfn\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Test if a character is any path component delimiter\r\nhe(ader files): \r\nlo(ng description): Tests if a character delimits two path components.\r\n\tThis function does match the colon delimiting the\r\n\tdrive specification from other path components.\r\npr(erequistes): \r\nva(lue): 0: no, not a component delimiter\r\n\t\\item 1: yes, is a delimiter\r\nre(lated to): dfndelim\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint dfndelim2(const int ch)\r\n{\t\r\n#define c (unsigned char)ch\r\n\treturn c == '/' || c == '\\\\' || c == ':';\r\n}\r\n"
  },
  {
    "path": "suppl/src/dfndelim.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\r\nob(ject): dfndelim\r\nsu(bsystem): dfn\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Test if a character is a path component delimiter\r\nhe(ader files): \r\nlo(ng description): Tests if a character delimits two path components.\r\n\tThis function does not match the colon delimiting the\r\n\tdrive specification from other path components.\r\npr(erequistes): \r\nva(lue): 0: no, not a component delimiter\r\n\t\\item 1: yes, is a delimiter\r\nre(lated to): dfndelim2\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint dfndelim(const int ch)\r\n{\t\r\n#define c (unsigned char)ch\r\n\treturn c == '/' || c == '\\\\';\r\n}\r\n"
  },
  {
    "path": "suppl/src/dfnexpan.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): dfnexpand\r\nsu(bsystem): dfn\r\nty(pe): H\r\nsh(ort description): Expand a path to a fully-qualified one\r\nhe(ader files): \r\nlo(ng description): Generates the fully-qualified path of a given file\r\n\tspec.\\par\r\n\tIf \\tok{*fnam == '\\0'} meaning that \\para{fnam} is an empty\r\n\tstring, \\tok{\".\"} is used.\\newline\r\n\t\\para{path} is \\em{not} expanded itself, meaning\\example{|}\r\n\t|\tdfnexpand(\"x:foo/bar\", \"humpf/er\")\r\n\tis expanded to \\tok{\"x:humpf/er\\\\FOO\\\\BAR\"}. Alternatively one\r\n\tcould say that \\para{fnam} is preprocessed by \\tok{dfnsqueeze()},\r\n\tbut \\para{path} is not.\\newline\r\n\tIf \\para{path} does not contain a drive spec, it is assumed that it matches\r\n\tthe one of \\para{fnam}; see above, too.\\newline\r\n\tIf \\tok{\\para{path} == NULL}, the current working path is used.\r\npr(erequistes): fnam != NULL\r\nva(lue): NULL: on error\r\n\t\\list \\tok{ENOMEM}: out of memory\r\n\t\\item \\tok{ENODRV}: Invalid drive while getting cwd\r\n\t\\item \\tok{ERANGE}: Buffer of getdcwd() too small\r\n\t\\item \\tok{ENODEV}: Failed to fetch cwd from drive\r\n\t\\endlist\r\n\t\\item else: pointer to dynamically allocated buffer\r\n\twith the generated path\r\nre(lated to): dfnuexpand dfnsqueeze dfnpath dfnmerge dfnsplit\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): If the macro \\tok{SUPPORT_UNC_PATH} is \\em{not} defined\r\n\tprior \\tok{#include}'ing the header file, this function does \\em{not}\r\n\tsupport UNC filenames.\r\nbu(gs): \r\nfi(le): dfnexpan.c\r\n\r\nob(ject): dfnuexpand\r\nsu(bsystem): dfn\r\nty(pe): H\r\nsy(nopsis): \r\nsh(ort description): Expand a filename to a fully-qualified one\r\nhe(ader files): \r\nlo(ng description): Expands a filename to a fully-qualified one,\r\n\tjust as \\tok{dfnexpand()}, but supports UNC filenames.\r\npr(erequistes): fnam != NULL\r\nva(lue): NULL: on error\\item else: pointer to dynamically allocated buffer\r\n\twith the generated path\r\nre(lated to): dfnexpand dfnsqueeze dfnpath dfnmerge dfnsplit\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#include <stdlib.h>\r\n#include <dos.h>\r\n#endif\r\n#include \"dfn.loc\"\r\n#include \"dynstr.h\"\r\n#include \"suppl.h\"\r\n#include \"dir.loc\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *dfnexpand(const char * const fnam, char * const path)\r\n{\tchar *h, *p;\t\t\t\t/* intermediate pointers */\r\n\tchar *dr, *pa, *na, *ex;\t/* filename components */\r\n\tchar pathDr, *pathPa;\t\t/* drive & path of 'path' */\r\n\tchar *dynPath;\r\n\r\n#ifdef SUPPORT_UNC_PATH\r\n\tDBG_ENTER(\"dfnuexpand\", Suppl_dfn)\r\n#else\r\n\tDBG_ENTER(\"dfnexpand\", Suppl_dfn)\r\n#endif\r\n\r\n\tassert(fnam);\r\n\r\n\tDBG_ARGUMENTS( (\"fnam=\\\"%s\\\", path=\\\"%s\\\"\", fnam, path) )\r\n\r\n\tchkHeap\r\n\tif((h = dfnsqueeze(fnam)) == 0) \r\n\t\tDBG_RETURN_S( 0)\r\n\r\n#ifdef SUPPORT_UNC_PATH\r\n\tif(isUNCpath(h)) {\t\t\t/* UNC paths are always fully-qualified */\r\n\t\t/* check if the trailing '\\\\' is present to mark the root direc */\r\n\t\tDBG_RETURN_BS((*UNCpath(h) != '\\\\')? StrAppChr(h, '\\\\') : h)\r\n\t}\r\n#endif\r\n\r\n\tchkHeap\r\n\tif(!*h || h[1] != ':' || h[2] != '\\\\') {\r\n\t/* the spec is not fully-qualified or completely empty */\r\n\t\tpathDr = 0;\r\n\t\tdynPath = 0;\r\n\t\tif((pathPa = path) != 0 && *pathPa) {\r\n\t\t\tif(pathPa[1] == ':') {\t/* path[] has drive spec */\r\n\t\t\t\tpathDr = *path;\r\n\t\t\t\tif(!*(pathPa += 2)) {\r\n\t\t\t\t\tpathPa = 0;\r\n\t\t\t\t\tgoto noPath;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(dfndelim(*pathPa) && !pathPa[1])\r\n\t\t\t\t++pathPa;\t\t/* Trans \"/\" || \"\\\\\" --> \"\" */\r\nnoPath:;\r\n\t\t}\r\n\t\tchkHeap\r\n\t\tif(dfnsplit(h, &dr, &pa, &na, &ex)) {\r\n\t\t\tStrFree(h);\r\n\t\t\tif(dr) {\t\t\t\t/* drive specified */\r\n\t\t\t\tif(pathDr && toFUpper(pathDr) != *dr)\r\n\t\t\t\t\t/* The specified path is for a different drive */\r\n\t\t\t\t\tpathPa = 0;\r\n\t\t\t}\r\n\t\t\telse {\t\t\t\t\t/* drive spec missing */\r\n\t\t\t\tif((dr = StrChar(pathDr? pathDr: 'A' + getdisk())) == 0)\r\n\t\t\t\t\tgoto errRet;\r\n\t\t\t}\r\n\r\n\t\t\tif(!pa || (*pa != '\\\\' && *pa != NUL)) {\r\n\t\t\t/* no path or a relative one */\r\n\t\t\t\tif(!pathPa) {\t\t\t\t/* path has no path spec in it */\r\n\t\t\t\t\tif((dynPath = dfnpath(*dr)) == 0)\r\n\t\t\t\t\t\tgoto errRet;\r\n\t\t\t\t\tpathPa = dynPath + 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif((p = dfnmerge(0, 0, pathPa, pa, 0)) == 0)\r\n\t\t\t\t\tgoto errRet;\r\n \t\t\t\tStrRepl(pa, p);\r\n\t\t\t}\r\n\t\t\th = dfnmerge(0, dr, pa, na, ex);\r\n\t\t} else\r\n\t\t\tStrFree(h);\r\n\r\nerrRet:\r\n\t\tchkHeap\r\n\t\tfree(dr);\r\n\t\tfree(pa);\r\n\t\tfree(na);\r\n\t\tfree(ex);\r\n\t\tfree(dynPath);\r\n\t}\r\n\r\n\tchkHeap\r\n\tDBG_RETURN_S( h)\r\n}\r\n"
  },
  {
    "path": "suppl/src/dfnfnam.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): dfnfilename\r\nsu(bsystem): dfn\r\nty(pe): \r\nsh(ort description): Return a pointer to the filename component\r\nhe(ader files): \r\nlo(ng description): Returns the pointer to the filename component of the\r\n\tpassed in file spec.\\par\r\n\tThe \"filename component\" is the very last component of the file spec\r\n\tand it need not reference to the regular file within the filesystem.\\newline\r\n\tIf \\para{fnam} does not have a filename portion, a pointer to \\tok{'\\0'}\r\n\tis returned.\\newline\r\n\tUNC paths are supported in so far as they don't cause problems with\r\n\tthis function. But a \\tok{\"\\\\\\\\server\\\\share\"} string will return\r\n\ta pointer to \\tok{\"share\"} and for \\tok{\"\\\\\\\\server\"} \\tok{\"server\"}\r\n\tis returned.\r\npr(erequistes): \r\nva(lue): NULL: \\para{fnam} == NULL\\item else: pointer to filename\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dfnfnam.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include \"dfn.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *dfnfilename(const char * const fnam)\r\n{\tconst char *p;\r\n\r\n\tDBG_ENTER(\"dfnfilename\", Suppl_dfn)\r\n\r\n\tif(!fnam)\tDBG_RETURN_S( 0)\r\n\r\n\tDBG_ARGUMENTS( (\"fnam=\\\"%s\\\"\", fnam) )\r\n\r\n\tp = strchr(fnam, '\\0');\r\n\twhile(--p >= fnam && !dfndelim2(*p));\r\n\r\n\tDBG_RETURN_S( (char*)p + 1)\r\n}\r\n"
  },
  {
    "path": "suppl/src/dfnfullp.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): dfnfullpath\r\nsu(bsystem): dfn\r\nty(pe): H\r\nsh(ort description): Expand a path to a minimal fully-qualified one\r\nhe(ader files): \r\nlo(ng description): Generates the fully-qualified path of a given file\r\n\tspec and removes any \"..\" and \".\" components.\\par\r\n\tBefore processing the passed in path is passed through\r\n\t\\tok{dfnexpand(path, NULL)}.\\newline\r\n\t\"..\" that chdir above the root directory are ignored, which is\r\n\tvery Unix-like, but is not supported by all DOS applications the\r\n\tsame way.\r\npr(erequistes): fnam != NULL\r\nva(lue): NULL: on error\\item else: pointer to dynamically allocated buffer\r\n\twith the generated path; the path may end with a backslash, which means\r\n\tthat the passed-in filename must match a directory\r\nre(lated to): dfnuexpand dfnsqueeze dfnpath dfnmerge dfnsplit\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): If the macro \\tok{SUPPORT_UNC_PATH} is \\em{not} defined\r\n\tprior \\tok{#include}'ing the header file, this function does \\em{not}\r\n\tsupport UNC filenames.\r\nbu(gs): \r\nfi(le): dfnexpan.c\r\n\r\nob(ject): dfnufullpath\r\nsu(bsystem): dfn\r\nty(pe): H\r\nsy(nopsis): \r\nsh(ort description): Expand a filename to a fully-qualified one\r\nhe(ader files): \r\nlo(ng description): Expands a filename to a fully-qualified one,\r\n\tjust as \\tok{dfnfullpath()}, but supports UNC filenames.\r\npr(erequistes): fnam != NULL\r\nva(lue): NULL: on error\\item else: pointer to dynamically allocated buffer\r\n\twith the generated path; the path may end with a backslash, which means\r\n\tthat the passed-in filename must match a directory\r\nre(lated to): dfnexpand dfnsqueeze dfnpath dfnmerge dfnsplit\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"../../config.h\"\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#include <stdlib.h>\r\n#include <dos.h>\r\n#endif\r\n#include \"dfn.loc\"\r\n#include \"dynstr.h\"\r\n#include \"suppl.h\"\r\n#include \"dir.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *dfnfullpath(const char * const fnam)\r\n{\tchar *fullpath;\r\n\tchar *paths;\r\n\tchar *q;\t\t\t\t/* intermediate pointers */\r\n\tchar *nxtDelim;\r\n\tint cnt;\r\n\r\n#ifdef OS_WIN32\r\n#ifdef SUPPORT_UNC_PATH\r\n\tDBG_ENTER(\"dfnufullpath2\", Suppl_dfn)\r\n#else\r\n\tDBG_ENTER(\"dfnfullpath2\", Suppl_dfn)\r\n#endif\r\n#else\r\n#ifdef SUPPORT_UNC_PATH\r\n\tDBG_ENTER(\"dfnufullpath\", Suppl_dfn)\r\n#else\r\n\tDBG_ENTER(\"dfnfullpath\", Suppl_dfn)\r\n#endif\r\n#endif\r\n\r\n\tassert(fnam);\r\n\r\n\tDBG_ARGUMENTS( (\"fnam=\\\"%s\\\"\", fnam) )\r\n\r\n\tchkHeap\r\n\tif((fullpath = dfnexpand(fnam, 0)) == 0)\r\n\t\tDBG_RETURN_S( 0)\r\n\r\n\tassert(*fullpath);\r\n\r\n#ifdef SUPPORT_UNC_PATH\r\n\tif(isUNCpath(fullpath)) paths = UNCpath(fullpath);\r\n\telse\r\n#endif\r\n\t{\r\n\t\tassert(*fullpath && fullpath[1] == ':');\r\n\t\tpaths = &fullpath[2];\r\n\t}\r\n\r\n\tchkHeap\r\n\tassert(*paths == '\\\\');\r\n\tq = paths;\r\n\twhile(*q == '\\\\' && *++q) {\r\n\t\t/* Check for special directories */\r\n\t\tif((nxtDelim = strchr(q, '\\\\')) == 0)\r\n\t\t\tnxtDelim = strchr(q, '\\0');\r\n\t\tif((cnt = strspn(q, \".\")) == nxtDelim - q\r\n#ifndef FEATURE_LONG_FILENAMES\r\n\t\t && cnt < 3\t\t/* DOS limits to \".\" and \"..\" */\r\n#endif\r\n\t\t) {\r\n\t\t\t/* all dots --> special directory */\r\n\t\t\t/* Relocate \"q\" (cnt-1) path components to the left */\r\n\t\t\twhile(--q > paths && --cnt) {\r\n\t\t\t\t/* search next '\\' to the left */\r\n\t\t\t\twhile(*--q != '\\\\');\r\n\t\t\t\t++q;\r\n\t\t\t}\r\n\t\t\tif(*nxtDelim) {\r\n\t\t\t\t/* some components left, move them up */\r\n\t\t\t\t/* Note: *nxtDelim == *q == '\\\\', but by copying over\r\n\t\t\t\t\tthis single character one needs not implement a\r\n\t\t\t\t\tspecial handling if nxtDelim[1] == '\\0' */\r\n\t\t\t\tmemmove(q, nxtDelim, strlen(nxtDelim) + 1);\r\n\t\t\t} else {\r\n\t\t\t\t/* this was the last component, but because this was\r\n\t\t\t\t\ta special directory, the information must be preserved\r\n\t\t\t\t\tthat it is a directory --> append trailing backslash */\r\n\t\t\t\tq[1] = '\\0';\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tq = nxtDelim;\r\n\t\t}\r\n\t}\r\n\r\n\tchkHeap\r\n\tDBG_RETURN_S( StrTrim(fullpath))\r\n}\r\n"
  },
  {
    "path": "suppl/src/dfnmerge.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): dfnmerge\r\nsu(bsystem): dfn\r\nty(pe): H\r\nsh(ort description): Put a filename together\r\nhe(ader files): \r\nlo(ng description): Constructs a filename from components, drive, path,\r\n\tfilename and extension.\\par\r\n\tThe result string is:\\newline\r\n\t<drive>:<path>\\<name>.<extension>\\newline\r\n\tThe ':' is added, if <drive> is present.\\newline\r\n\tThe '\\' is added, if <path> and (<name> or <ext>) are present.\\newline\r\n\tThe '.' is added, if <ext> is present.\\par\r\n\tA passed-in value of \\tok{NULL} indicates that the particular value is absent;\r\n\tthe includes the empty string \\tok{\"\"}.\\par\r\n\tIf <drive> specifies an UNC path (\\tok{dfnumerge()} only), ':' is\r\n\tsubstituted by one '\\', which is not added, if neither <path>, nor\r\n\t<name> nor <ext> is present.\\par\r\n\tIf no result buffer is specified (\\tok{\\para{fnam} == NULL}), a\r\n\tbuffer is dynamically allocated.\\par\r\n\tUnless the macro \\tok{SUPPORT_UNC_PATH} is defined prior \\tok{#include}'ing\r\n\tthe header file, UNC paths are not supported. Though, the only difference\r\n\tis that it is not checked if both filenames are UNC paths or both are not.\r\npr(erequistes): \r\nva(lue): NULL: out of memory\\item \\para{fnam}: if \\tok{\\para{fnam} != NULL}\r\n\tand no error\\item else: pointer to dynamically allocated buffer\r\nre(lated to): dfnumerge dfnsqueeze dfnexpand dfnsplit dfnpath\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): If \\tok{path != NULL && *path == '\\0'}, the path spec is\r\n\tconsidered to be absent. This is required to differ the result of\r\n\t\\tok{dfnmerge(0, 0, 0, 0, 0)} from the root directory, when passed into\r\n\t\\tok{dfnmerge()} as \\para{path} again.\r\nbu(gs): \r\nfi(le): dfnmerge.c\r\n\r\nob(ject): dfnumerge\r\nsu(bsystem): dfn\r\nty(pe): H\r\nsh(ort description): Put a filename together\r\nhe(ader files): \r\nlo(ng description): As \\tok{dfnmerge()}, but supports UNC paths.\r\npr(erequistes): \r\nva(lue): NULL: out of memory\\item \\para{fnam}: if \\tok{\\para{fnam} != NULL}\r\n\tand no error\\item else: pointer to dynamically allocated buffer\r\nre(lated to): dfnmerge dfnusqueeze dfnuexpand dfnusplit\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dfnmerge.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#include <stdlib.h>\r\n#include <dos.h>\r\n#endif\r\n#include \"eno.loc\"\r\n#include \"dfn.loc\"\r\n#include \"suppl.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\n#define isDelim dfndelim\r\n\r\nchar *dfnmerge(char *fnam, const char * const dr, const char * const Xpath\r\n , const char * const nam, const char * const ext)\r\n{\tint len;\r\n\tconst char *path;\r\n\tchar *p;\r\n\tint delim;\t\t/* type of last path component delimiter:\r\n\t\t\t\t\t\t0: none\r\n\t\t\t\t\t\t1: a \"real\" one ('/' or '\\\\') or none necessary\r\n\t\t\t\t\t\t2: a colon\r\n\t\t\t\t\t*/\r\n\r\n#ifdef SUPPORT_UNC_PATH\r\n\tDBG_ENTER(\"dfnumerge\", Suppl_dfn)\r\n#else\r\n\tDBG_ENTER(\"dfnmerge\", Suppl_dfn)\r\n#endif\r\n\tDBG_ARGUMENTS( (\"dr=\\\"%s\\\", pa=\\\"%s\\\", na=\\\"%s\\\", ex=\\\"%s\\\", out=%p\", dr, Xpath, nam, ext, fnam) )\r\n\r\n\tpath = Xpath;\r\n\tif((p = fnam) == 0) {\t/* determine file nam length */\r\n#ifdef SUPPORT_UNC_PATH\r\n\t\tlen = dr? (*dr == '\\\\'? strlen(dr) + 1: 3): 1;\r\n#else\r\n\t\tlen = dr? 3: 1;\t\t/* add the NUL terminator */\r\n#endif\r\n\t\tif(path) {\r\n\t\t\tif(*path)\r\n\t\t\t\tlen += strlen(path) + 1;\r\n\t\t\telse path = 0;\t/* no path component specified */\r\n\t\t}\r\n\t\tif(nam) len += strlen(nam);\r\n\t\tif(ext) len += strlen(ext) + 1;\r\n\t\tif((fnam = p = eno_malloc(len)) == 0)\r\n\t\t\tDBG_RETURN_S( 0)\r\n\t\t*fnam = NUL;\r\n\t}\r\n\r\n\tif(dr) {\r\n#ifdef SUPPORT_UNC_PATH\r\n\t\tif(*dr == '\\\\') {\r\n\t\t\tp = stpcpy(p, dr);\r\n\t\t\t\t/* Test if the drive spec already ends with a delimiter */\r\n\t\t\tdelim = isDelim(p[-1]);\r\n\t\t}\r\n\t\telse {\r\n#endif\r\n\t\t\tif(0 != (*p = *dr))\r\n\t\t\t\t++p;\r\n\t\t\t*p++ = ':';\r\n\t\t\t\t/* The colon is not a delimiter for root directories */\r\n\t\t\tdelim = 2;\r\n#ifdef SUPPORT_UNC_PATH\r\n\t\t}\r\n#endif\r\n\t\t*p = NUL;\r\n\t}\r\n\telse delim = 1;\t\t/* no drive --> no delim necessary */\r\n\r\n\tif(path) {\r\n\t\tswitch(delim) {\r\n\t\tcase 0:\t\t/* missing delimiter --> need one unless path\r\n\t\t\t\t\t\thas one */\r\n\t\t\tif(!isDelim(*path)) *p++ = '\\\\';\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tif(!*path)\t\t/* The root dir always requires a backslash */\r\n\t\t\t*p++ = '\\\\';\r\n\t\t/* Now, the delimiter is definitely there */\r\n\t\tp = stpcpy(p, path);\r\n\t\tif(0 == (delim = isDelim(p[-1]))) {\r\n\t\t\tif(p[-1] == ':')\r\n\t\t\t\tdelim = 2;\r\n\t\t}\r\n\t}\r\n\r\n\tif(nam)\t{\r\n\t\tif(!delim) {\r\n\t\t\tif(!isDelim(*nam))\r\n\t\t\t\t*p++ = '\\\\';\r\n\t\t\tdelim = 1;\r\n\t\t}\r\n\t\tp = stpcpy(p, nam);\r\n\t}\r\n\r\n\tif(ext) {\r\n\t\tif(!delim) {\r\n\t\t\t*p++ = '\\\\';\r\n\t\t\tdelim = 1;\r\n\t\t}\r\n\t\t*p++ = '.';\r\n\t\tstrcpy(p, ext);\r\n\t}\r\n\r\n\tDBG_RETURN_S( fnam)\r\n}\r\n"
  },
  {
    "path": "suppl/src/dfnpath.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): dfnpath\r\nsu(bsystem): dfn\r\nty(pe): H\r\nsh(ort description): Return the fully-qualified current working path of a drive\r\nhe(ader files): \r\nlo(ng description): Returns the fully-qualified filename of the current\r\n\tworking directory of a given drive. The drive can be specified as\r\n\tnumber (\\tok{0}: currently working drive, \\tok{1}..\\tok{32}: A: .. Z: \r\n\tand special Netware search drives), upper-case letters\r\n\t(\\tok{'A'}..\\tok{'Z'}) and lower-case letters (\\tok{'a'}..\\tok{'z'}).\\par\r\n\tThe path contains the drive specification \"?:\" and does not have a\r\n\ttrailing backslash, unless it is the root directory.\r\npr(erequistes): \r\nva(lue): NULL: failure; errno is assigned:\r\n\t\\list \\tok{ENOMEM}: out of memory\r\n\t\\item \\tok{ENODEV}: Invalid drive while getting cwd\r\n\t\\item \\tok{ERANGE}: Buffer of getdcwd() too small\r\n\t\\item \\tok{ENODEV}: Failed to fetch cwd from drive\r\n\t\\endlist\r\n\t\\item else: pointer to\r\n\tdynamically allocted string of absolute pathname\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dfnpath.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <ctype.h>\r\n#endif\r\n#if defined(__GNUC__)\r\n#include <direct.h>\r\n#endif\r\n#include \"dfn.loc\"\r\n#include \"dynstr.h\"\r\n#include \"suppl.h\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *dfnpath(int drive)\r\n{\tchar *h;\r\n\r\n\tDBG_ENTER(\"dfnpath\", Suppl_dfn)\r\n\tDBG_ARGUMENTS( (\"drive=%u ('%c')\", drive, drive < 32? '.': drive) )\r\n\r\n\tif (islower(drive)) drive -= 'a' - 'A';\r\n\tif (drive >= 'A') drive -= 'A' - 1;\r\n\tif ((unsigned)drive > 32) {\r\n\t\teno_set( ENODEV);\r\n\t\tDBG_RETURN_S( 0)\r\n\t}\r\n\r\n\tif(0 != (h = StrTrim(_getdcwd(drive, 0, DFN_FILENAME_BUFFER_LENGTH))))\r\n\t\tDBG_RETURN_S(h)\r\n\r\n\teno_set(ENODEV);\r\n\tDBG_RETURN_S(0)\r\n}\r\n"
  },
  {
    "path": "suppl/src/dfnsplit.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): dfnsplit\r\nsu(bsystem): dfn\r\nty(pe): H\r\nsh(ort description): Split a given filename into its components\r\nhe(ader files): \r\nlo(ng description): Splits a given filename into its components, the drive,\r\n\tpath, filename and extension. Each component may be missing, in which\r\n\tcase \\tok{NULL} is assigned to the particular result pointer.\\par\r\n\tIf one of the passed-in pointers is \\tok{NULL}, this component is\r\n\tnot passed back and, hence, not saved into dynamic memory.\\newline\r\n\tOn native FAT drives (no UNC filename), only the single drive letter,\r\n\tbut not the colon is assigned to \\tok{*\\para{drive}}.\\newline\r\n\t(\\tok{dfnusplit()} only:) It is assumed that the UNC paths start\r\n\twith two components that have the meaning of \"drive\", its: \\tok{\"\\\\\\\\server\\\\share\"}.\r\n\t\\par Unless the macro \\tok{SUPPORT_UNC_PATH} was defined prior \\tok{#include}'ing\r\n\tthe header file, this function does not support UNC paths.\r\npr(erequistes): fnam != NULL\r\nva(lue): 0: on failure \\item else: on success, \\tok{*\\para{drive}}, \\tok{*\\para{path}}, \\tok{*\\para{name}} and \\tok{*\\para{ext}} have been assigned with\r\n\tthe dynamically allocated component\r\nre(lated to): dfnusplit dfnmerge\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): The passed in filename is not preprocessed in any way, neither\r\n\t\".\" components are removed nor the path fully-qualified.\\newline\r\n\tIf the passed in filename is an UNC path and the UNC support is enabled,\r\n\t\\tok{*\\para{drive}} is not just a single letter!\r\nbu(gs): \r\nfi(le): dfnsplit.c\r\nex:\\example{|}\r\n | \t\tchar *drive, *path, *name, *ext;\r\n |\r\n | \t\tif(!dfnsplit(\"d:\\\\Path1*./Path2.dgf.575\\\\....mOrk.vOm.Ork\"\r\n | \t\t , &drive, &path, &name, &ext))\r\n | \t\t \tabort(\"memory full\");\r\n | \t-results in:\r\n | \t\tdrive = \"d\"\r\n | \t\tpath = \"\\\\Path1*.\\\\Path2.dgf.575\"\r\n | \t\tname = \"....mOrk.vOm\"\r\n | \t\text = \"Ork\"\r\n |\r\n | \t\tif(!dfnsplit(\"\\\\any.name\", &drive, &path, &name, &ext))\r\n | \t\t \tabort(\"memory full\");\r\n | \t-results in:\r\n | \t\tdrive = NULL\r\n | \t\tpath = \"\\\\\"\r\n | \t\tname = \"any\"\r\n | \t\text = \"name\"\r\n |\r\n | \t\tif(!dfnsplit(\"d:\\\\Path1*./Path2.dgf.575\\\\....mOrk.vOm.Ork\"\r\n | \t\t , &drive, NULL, &name, NULL))\r\n | \t\t \tabort(\"memory full\");\r\n | \t-results in:\r\n | \t\tdrive = \"d\"\r\n | \t\tpath = <unchanged>\r\n | \t\tname = \"....mOrk.vOm\"\r\n | \t\text = <unchanged>\r\n\r\nob(ject): dfnusplit\r\nsu(bsystem): dfn\r\nty(pe): H\r\nsh(ort description): Split a given filename into its components\r\nhe(ader files): \r\nlo(ng description): As \\tok{dfnsplit()}, but supports UNC paths.\r\npr(erequistes): fnam != NULL\r\nva(lue): 0: on failure \\item else: on success, \\tok{*\\para{drive}}, \\tok{*\\para{path}}, \\tok{*\\para{name}} and \\tok{*\\para{ext}} have been assigned with\r\n\tthe dynamically allocated component\r\nre(lated to): dfnusplit dfnmerge\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): The passed in filename is not preprocessed in any way, neither\r\n\t\".\" components are removed nor the path fully-qualified.\\newline\r\n\tIf the passed in filename is an UNC path and the UNC support is enabled,\r\n\t\\tok{*\\para{drive}} is not just a single letter!\r\nbu(gs): \r\nfi(le): dfnsplit.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n#include \"../../config.h\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#include <stdlib.h>\r\n#include <dos.h>\r\n\r\n#endif\r\n#include \"dfn.loc\"\r\n#include \"dynstr.h\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint dfnsplit(const char * const fnam, char ** const dr, char ** const path\r\n\t, char ** const name, char ** const ext)\r\n{\tconst char *p, *h;\r\n\tchar *z;\r\n\tint ch;\r\n\r\n#ifdef SUPPORT_UNC_PATH\r\n\tDBG_ENTER(\"dfnusplit\", Suppl_dfn)\r\n#else\r\n\tDBG_ENTER(\"dfnsplit\", Suppl_dfn)\r\n#endif\r\n\r\n\tassert(fnam);\r\n\r\n\tDBG_ARGUMENTS( (\"fnam=\\\"%s\\\"\", fnam) )\r\n\r\n#define iff(var,value) if(var) *(var) = (value)\r\n\tiff(dr, 0);\r\n\tiff(path, 0);\r\n\tiff(name, 0);\r\n\tiff(ext, 0);\r\n\tif((p = fnam) == 0) DBG_RETURN_I( !NUL)\r\n\r\n\tchkHeap\r\n#ifdef SUPPORT_UNC_PATH\r\n\tif(isUNCpath(p)) {\t\t\t\t\t/* UNC drive */\r\n\t\th = UNCpath(p);\t\t\t\t\t/* h := end of UNC drive */\r\n\t\tif(dr) {\r\n\t\t\tchkHeap\r\n#ifdef FARDATA\r\n\t\t\tassert((h - p) < 0x10000l);\r\n#endif\r\n\t\t\tif((*dr = *h? StrLeft(p, (size_t)(h - p)): eno_strdup(p)) == 0)\r\n\t\t\t\tDBG_RETURN_I( NUL)\r\n\t\t\tDBG_RETURN_VALUES( (\"dr=\\\"%s\\\"\", *dr) )\r\n\t\t\tif(!*h) {\t\t/* no further portion, but UNC paths are always\r\n\t\t\t\t\t\t\t\tfully-qualified -> path := root_directory */\r\n\t\t\t\tDBG_RETURN_BI((*path = eno_strdup(\"\")) != 0)\r\n\t\t\t}\r\n\t\t\tp = h;\t\t\t/* points to the '\\\\' marking the root direc */\r\n\t\t}\r\n\t}\r\n\telse\t\t\t/* check for non-UNC drive spec */\r\n#endif\r\n\tif(p[1] == ':') {\t/* drive spec */\r\n\t\tchkHeap\r\n\t\tif(dr) {\r\n\t\t\tif((*dr = StrChar(*p)) == 0)\r\n\t\t\t\tDBG_RETURN_I( NUL)\r\n\t\t}\r\n\t\tp += 2;\r\n\t}\r\n\r\n\tchkHeap\r\n\tif(*p) {\t/* there are characters left */\r\n\t/* determine last path component */\r\n\t\th = dfnfilename(p);\r\n\t\tchkHeap\r\n\t\tif(h > p) { \t/* there is a backslash => a path */\r\n\t\t\tif(path) {\r\n\t\t\t\tif((*path = z = eno_malloc(1 + (size_t)(h - p))) == 0)\r\n\t\t\t\t\tDBG_RETURN_I( NUL)\r\n\t\t\t\t/* because malloc() before squeeze => if multiple '\\\\'s \r\n\t\t\t\t\tsome memory is wasted */\r\n\t\t\t\t/* while copying squeeze multiple '\\\\'s */\r\n\t\t\t\t/* strip trailing backslash */\r\n\t\t\t\tchkHeap\r\n\t\t\t\tdo {\r\n\t\t\t\t\tif(dfndelim(ch = *p++)) {\t/* squeeze */\r\n\t\t\t\t\t\tch = '\\\\';\r\n\t\t\t\t\t\twhile(dfndelim(*p++));\r\n\t\t\t\t\t\t--p;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(p >= h) break;\r\n\t\t\t\t\t*z++ = ch;\r\n\t\t\t\t} while(1);\r\n\t\t\t\tif(z == *path)\t\t/* root directory */\r\n\t\t\t\t\t*z++ = '\\\\';\r\n\t\t\t\t*z = NUL;\r\n\t\t\t\tchkHeap\r\n\t\t\t\tDBG_RETURN_VALUES( (\"path=\\\"%s\\\"\", *path) )\r\n\t\t\t}\r\n\t\t\tp = h;\t/* skip path */\r\n\t\t}\r\n\t/* check for special names starting with a dot '.' */\r\n\t\tif(*(h = p) == '.')  while(*++h == '.');\r\n\t\tif((h = strrchr(h, '.')) == 0) \t/* no extension at all */\r\n\t\t \tDBG_RETURN_BI( name? (*name = eno_strdup(p)) != 0: !NUL)\r\n\t/* copy the name */\r\n\t\tchkHeap\r\n\t\tif(name) {\r\n\t\t\tif((*name = StrLeft(p, (size_t)(h - p))) == 0)\r\n\t\t\t\tDBG_RETURN_I( NUL)\r\n\t\t\tchkHeap\r\n\t\t\tDBG_RETURN_VALUES( (\"name=\\\"%s\\\"\", *name) )\r\n\t\t}\r\n\t/* copy the extension */\r\n\t\tif(ext) {\r\n\t\t\tif((*ext = eno_strdup(h + 1)) == 0)\r\n\t\t\t\tDBG_RETURN_I(NUL)\r\n\t\t\tchkHeap\r\n\t\t\tDBG_RETURN_VALUES( (\"ext=\\\"%s\\\"\", *ext) )\r\n\t\t}\r\n\t}\r\n\tchkHeap\r\n\tDBG_RETURN_I( !NUL)\r\n}\r\n\r\n"
  },
  {
    "path": "suppl/src/dfnsquee.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): dfnsqueeze\r\nsu(bsystem): dfn\r\nty(pe): H\r\nsh(ort description): Squeeze the given filename\r\nhe(ader files): \r\nlo(ng description): Flips forward slashes into backslashes, squeezes multiple\r\n\tbackslashes into a single one (unless the leading two for UNC paths),\r\n\tall characters are upper-cased (in order to support LFN in the future\r\n\tone should not rely on upcased characters)\r\n\tand removes any \".\" components except the very last.\\newline\r\n\tNote: On the future \"..\" might be removed, too!\r\npr(erequistes): \r\nva(lue): NULL: on failure (ENOMEM)\\item else: pointer to dynamically allocated\r\n\tsqueezed filename\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dfnsquee.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#include <stdlib.h>\r\n#include <dos.h>\r\n#endif\r\n#include \"eno.loc\"\r\n#include \"dfn.loc\"\r\n\r\n#include \"dynstr.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *dfnsqueeze(const char * const fnam)\r\n{\tchar *p, *h, *q;\r\n\r\n#ifdef SUPPORT_UNC_PATH\r\n\tDBG_ENTER(\"dfnusqueeze\", Suppl_dfn)\r\n#else\r\n\tDBG_ENTER(\"dfnsqueeze\", Suppl_dfn)\r\n#endif\r\n\tDBG_ARGUMENTS( (\"fnam=\\\"%s\\\"\", fnam) )\r\n\r\n\tif(!fnam || (h = q = eno_strdup(fnam)) == 0)\r\n\t\tDBG_RETURN_S( 0)\r\n\r\n#ifdef SUPPORT_UNC_PATH\r\n\tif(isUNCpath(q))\t\t/* keep the two backslashes */\r\n\t\tq += 2;\r\n#endif\r\n\r\n\tp = q;\t\t\t\t\t\t/* where to begin to squeeze */\r\n\r\n/* First: Flip the slashes */\r\n\twhile((q = strchr(q, '/')) != 0)\r\n\t\t*q = '\\\\';\r\n\r\n/* Second: Squeeze & upcase */\r\n\t\r\n\tq = p;\r\n\r\n\tchkHeap\r\n\tdo {\r\nredo:\r\n\t\tif(*q == '\\\\') {\t/* possibly to be squeezed */\r\n\t\t\tif(q[1] == '\\\\') {\t\t/* Squeeze '\\\\\\\\' -> '\\\\' */\r\n\t\t\t\t++q;\r\n\t\t\t\tgoto redo;\r\n\t\t\t}\r\n\t\t\tif(q[1] == '.') {\r\n\t\t\t\tif(q[2] == '\\\\') {\t\t/* squeeze '\\\\.\\\\' -> '\\\\' */\r\n\t\t\t\t\tq += 2;\r\n\t\t\t\t\tgoto redo;\r\n\t\t\t\t}\r\n#if 0\t\t\t/* this may lead to confusion -- 2000/06/07 ska*/\r\n\t\t\t\tif(q[2] == '\\0') {\t\t/* squeeze '\\\\.\\0' -> '\\\\' */\r\n\t\t\t\t\t*p = '\\\\';\r\n\t\t\t\t\t*++p = NUL;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n#endif\r\n\t\t\t}\r\n\t\t}\r\n\t} while((*p++ = toFUpper(*q++)) != 0);\r\n\r\n\tchkHeap\r\n\tDBG_RETURN_BS( StrTrim(h))\r\n}\r\n"
  },
  {
    "path": "suppl/src/dfnstat.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): dfnstat\r\nsu(bsystem): dfn\r\nty(pe): \r\nsh(ort description): Return the attributes of a given file\r\nhe(ader files): \r\nlo(ng description): Returns the attributes of a given file. If non-zero, the\r\n\treturn value is a OR'ed combination of the following flags:\r\n\t\\item tok{DFN_FILE}: file is a regular file\r\n\t\\item tok{DFN_LFN}: LFN entry\r\n\t\\item tok{DFN_DIRECTORY}: file is a directory\r\n\t\\item tok{DFN_LABEL}: file is a value label\r\n\t\\item tok{DFN_READ}: read permissions granted\r\n\t\\item tok{DFN_WRITE}: write permissions granted (may invalid for dirs)\r\n\t\\item tok{DFN_HIDDEN}: not for normal display to user\r\n\t\\item tok{DFN_SYSTEM}: file important for system, unmoveable\r\n \t\\nolist \r\n\tWildcards are \\em{not} expanded, if they are present in the filename.\r\npr(erequistes): \r\nva(lue): 0: on failure (file/path not found) (OS error code)\\item else: file attribute as\r\n\tdescribed above\r\nre(lated to): dfnwrdir\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dfnstat.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <ctype.h>\r\n#endif\r\n\r\n#include \"suppl.h\"\r\n#include \"dfn.loc\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint dfnstat(const char * const fnam)\r\n{\tIREGS r;\r\n\tint attr;\r\n\r\n\tDBG_ENTER(\"dfnstat\", Suppl_dfn)\r\n\tDBG_ARGUMENTS( (\"fnam=\\\"%s\\\"\", fnam) )\r\n\r\n\tassert(fnam);\r\n\r\n\t/* Probe for root directory */\r\n\tif(*fnam && fnam[1] == ':'\r\n\t && (!fnam[2] || (fnam[2] == '\\\\' && !fnam[3]))) {\r\n\t \t/* Root spec or drive letter only */\r\n\t \t/* Probe if the drive is ready */\r\n\t \tr.r_ax = 0x4409;\r\n\t \tr.r_bx = toupper(*fnam) - 'A' + 1;\r\n        intrpt( 0x21, &r );\r\n        if( r.r_flags & 1 ) {\r\n\t\t\teno_setOSerror(r.r_ax);\r\n\t\t\tDBG_RETURN_I( 0)\r\n\t\t}\r\n\t\tDBG_RETURN_X( DFN_DIRECTORY)\r\n\t}\r\n\r\n\tr.r_ax = 0x4300;\t\t/* get file attributes */\r\n\tr.r_ds = FP_SEG(fnam);\r\n\tr.r_dx = FP_OFF(fnam);\r\n\tintrpt( 0x21, &r );\r\n\tif( r.r_flags & 1 ) {\r\n\t\teno_setOSerror(r.r_ax);\r\n\t\tDBG_RETURN_I( 0)\t\t\t/* call failed */\r\n\t}\r\n\r\n\tif(((attr = r.r_cx) & 0xf) == 0xf)\r\n\t\tattr = DFN_LFN;\r\n\telse if(!((attr ^= DFN_WRITE) & (DFN_DIRECTORY | DFN_LABEL)))\r\n\t\tattr |= DFN_FILE;\r\n\r\n\tDBG_RETURN_X( attr)\r\n}\r\n"
  },
  {
    "path": "suppl/src/dfntruen.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): dfntruename\r\nsu(bsystem): dfn\r\nty(pe): H\r\nsh(ort description): Return the truename of a given filename\r\nhe(ader files): \r\nlo(ng description): Returns the truename of a given filename as returned\r\n\tby the DOS API function 0x60. The filename must not exceed the length\r\n\tof \\tok{DFN_FILENAME_BUFFER_LENGTH} bytes.\\par\r\n\tThe possibly only useful function in which \\tok{dfntruename()}\r\n\tshould be used is to determine if two files are actually the same\r\n\tphysical file although they have different logical filenames, e.g. assume\r\n\tthe file \\tok{C:\\FREEDOS\\SUBST.EXE} exists and one has created the\r\n\tlogical drive letter \\tok{Z:} by the following command:\r\n\t\\tok{SUBST Z: C:\\FREEDOS}. One could access the same \\em{physical}\r\n\tfile via two different logical path specifications:\r\n\t\\enum \\tok{Z:\\SUBST.EXE}, and\r\n\t\\enum \\tok{C:\\FREEDOS\\SUBST.EXE}.\r\n\t\\endlist\r\n\t\\tok{dfntruename()} applied to both path specifications would\r\n\treturn the only physical access path used by the DOS kernel.\\par\r\n\t\\em{But beware!} The truename must not be used as a function to fully-qualify\r\n\ta filename. There are at least two cases when that fails:\r\n\t\t\\enum\t\t\\tok{JOIN A: C:\\LW-A}\\newline\r\n\t\t\tNow the call\r\n\t\t\t\\tok{dfntruename(\"C:/lw-a/file\")} results into \\tok{\"A:\\\\FILE\"},\r\n\t\t\tbut drive \\tok{A:} is not accessable at all!\r\n\t\t\\enum Networked drives, e.g. CD-ROM drives and LAN drives, does not\r\n\t\tfollow the standard naming. Most of them (if not all) follow\r\n\t\tthe UNC standard. For example:\\newline\r\n\t\t\tAssume drive \\tok{F:} is a Novell Netware drive created by:\\newline\r\n\t\t\t\t\\tok{MAP ROOT F:=SERVER/VOLUME:PATH1/PATH2/PATH3}\\newline\r\n\t\t\tthe call \\tok{dfntruename(\"f:\\\\file\")} would return\r\n\t\t\t\t\\tok{\"\\\\SERVER\\\\VOLUME\\\\PATH1\\\\PATH2\\\\PATH3\\\\FILE\"}.\\par\r\n\t\t\tWindows 9x/NT can handle UNC filenames, but this results in\r\n\t\t\tmuch slower access time, because Windows 95 globs the filename\r\n\t\t\tthrough the \"network environment\" driver each time such name\r\n\t\t\tis used.\r\npr(erequistes): \r\nva(lue): NULL: on failure (OS error code)\\item else: pointer to dynamically allocated\r\n\tfilename\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): The returned filename \\em{cannot} be used to generate a\r\n\tfully-qualified pathname.\\par\r\n\tThe only useful thing to do with the result is to test, if two filenames\r\n\tpoint to the same physical file. One can think of this function as it\r\n\twould return a string generated of the device and i-node number of the\r\n\tfile in Unix (symbolic links resolved).\r\nbu(gs): \r\nfi(le): dfntruen.c\r\n\r\n*/\r\n\r\n#include \"../../config.h\"\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <stdlib.h>\r\n#endif\r\n#include \"dfn.loc\"\r\n#include \"dynstr.h\"\r\n#include \"suppl.h\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *dfntruename(const char * const fnam)\r\n{\tchar *h;\r\n\tIREGS r;\r\n\r\n\tDBG_ENTER(\"dfntruename\", Suppl_dfn)\r\n\r\n\tassert(fnam);\r\n\r\n\tDBG_ARGUMENTS( (\"fnam=\\\"%s\\\"\", fnam) )\r\n\r\n\tchkHeap\r\n\tif((h = eno_malloc(DFN_FILENAME_BUFFER_LENGTH)) != 0) {\r\n#ifdef FEATURE_LONG_FILENAMES\r\n\tr.r_flags = 1;\t/* CY before 21.71 calls! */\r\n        r.r_ax = 0x7160;\r\n        r.r_cx = 0x8002;\r\n#else\r\n\t\tr.r_ax = 0x6000;\r\n#endif\r\n        r.r_ds = FP_SEG(fnam);\r\n\t\tr.r_si = FP_OFF(fnam);\r\n\t\tr.r_es = FP_SEG(h);\r\n\t\tr.r_di = FP_OFF(h);\r\n\t\tchkHeap\r\n        intrpt( 0x21, &r );\r\n#ifdef FEATURE_LONG_FILENAMES\r\n        if( ( r.r_flags & 1 ) || r.r_ax == 0x7100 ) {\r\n            r.r_ax = 0x6000;\r\n            intrpt( 0x21, &r );\r\n#endif\r\n\t\tif(( r.r_flags & 1 ) ? r.r_ax : 0) {\t\t/* failed */\r\n\t\t\teno_setOSerror( r.r_ax);\r\n\t\t\tfree(h);\r\n\t\t\tDBG_RETURN_S( 0)\r\n\t\t}\r\n#ifdef FEATURE_LONG_FILENAMES\r\n        }\r\n#endif\r\n\t}\r\n\r\n\tDBG_RETURN_BS( StrTrim(h))\r\n}\r\n"
  },
  {
    "path": "suppl/src/dir.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/*\r\n\tIncludes DOS specific directory settings\r\n*/\r\n\r\n#ifndef _DIR__H\r\n#define _DIR__H\r\n\r\n#ifdef __TURBOC__\r\n#include <dir.h>\r\n#endif\r\n\r\n#ifdef _PAC_NOCLIB_\r\n\r\n#define MAXDIR 66\t\t/* 64: path; +1: root sign; +1: NUL terminator */\r\n#define MAXDRIVE 3\t\t/* 1: drive letter; +1: ':'; +1: NUL terminator */\r\n#define MAXNAME 9\t\t/* 8: name; +1: NUL terminator */\r\n#define MAXEXT 5\t\t/* 3: name; +1: dot; +1: NUL terminator */\r\n#define MAXPATH (MAXDIR + MAXDRIVE + MAXNAME + MAXEXT - 3)\r\n\r\n/* file attributes for Borland C */\r\n#define FA_NORMAL   0x00        /* no special */\r\n#define FA_RDONLY   0x01        /* Read only */\r\n#define FA_HIDDEN   0x02        /* Hidden */\r\n#define FA_SYSTEM   0x04        /* System */\r\n#define FA_LABEL    0x08        /* Volume */\r\n#define FA_DIREC    0x10        /* Directory */\r\n#define FA_ARCH     0x20        /* Archive */\r\n#define FA_ALL\t\t0x3F\r\n\r\n/* findfirst()/findnext() block for Borland C */\r\n#define find_t ffblk\t\t/* MSC's block structure is the same */\r\n#define _find_t ffblk\r\n#endif\r\n\r\n#ifdef __WATCOMC__\r\n#define MAXDIR 66\t\t/* 64: path; +1: root sign; +1: NUL terminator */\r\n#define MAXDRIVE 3\t\t/* 1: drive letter; +1: ':'; +1: NUL terminator */\r\n#define MAXNAME 9\t\t/* 8: name; +1: NUL terminator */\r\n#define MAXEXT 5\t\t/* 3: name; +1: dot; +1: NUL terminator */\r\n#define MAXPATH (MAXDIR + MAXDRIVE + MAXNAME + MAXEXT - 3)\r\n\r\n#define findfirst(pattern,buf,attrib) _dos_findfirst((pattern), (attrib)\t\\\r\n\t, (struct find_t*)(buf))\r\n#define findnext(buf) _dos_findnext((struct find_t*)(buf))\r\n\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/dmemcmpf.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): _fMemiCmp\r\nsu(bsystem): farmem\r\nty(pe): \r\nsh(ort description): Compare two far memory areas case-insensitively via DOS NLS\r\nhe(ader files): \r\nlo(ng description): Compares two far memory areas case-insensitively using DOS NLS\r\npr(erequistes): \r\nva(lue): <0: first block is less\\item =0: both blocks are equal\r\n\t\\item >0: first block is greater\r\nre(lated to): memcmp, _fMemFCmp\r\nse(condary subsystems): nls\r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dmemcmpf.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"dynstr.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef _MICROC_\r\nint _fMemiCmp(unsigned const dseg, unsigned dofs\r\n , unsigned const sseg, unsigned sofs, unsigned length)\r\n{\tint d;\r\n\r\n\tDBG_ENTER(\"_fMemiCmp\", Suppl_farmem)\r\n\r\n\tif(!length)\r\n\t\tDBG_RETURN_I( 0)\r\n\r\n\tif((dseg | dofs) == 0)\r\n\t\tDBG_RETURN_I((sseg | sofs) != 0)\r\n\tif((sseg | sofs) == 0)\r\n\t\tDBG_RETURN_I(-1)\r\n\r\n\twhile((d = toUpper(peekb(dseg, dofs++)) - toUpper(peekb(sseg, sofs++)))\r\n\t == 0 && --length);\r\n\r\n\tDBG_RETURN_I( d)\r\n}\r\n\r\n#else\r\n\r\nint _fMemiCmp(const byte far * dest, const byte far * src, unsigned length)\r\n{\tint d;\r\n\r\n\tDBG_ENTER(\"_fMemiCmp\", Suppl_farmem)\r\n\r\n\tif(!length)\r\n\t\tDBG_RETURN_I( 0)\r\n\r\n\tif(dest == 0)\r\n\t\tDBG_RETURN_I(src != 0)\r\n\tif(src == 0)\r\n\t\tDBG_RETURN_I(-1)\r\n\r\n\twhile((d = toUpper(*dest++) - toUpper(*src++)) == 0 && --length);\r\n\r\n\tDBG_RETURN_I( d)\r\n}\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/dosalloc.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): DOSalloc\r\nsu(bsystem): farmem\r\nty(pe): \r\nsh(ort description): Allocate a block of memory using the DOS API\r\nhe(ader files): \r\nlo(ng description): Allocates a block of memory directly via the DOS API, this\r\n\tblock must be deallocated by \\tok{DOSfree()} or any other function using\r\n\tthe DOS API to deallocate (free) a block of memory.\\par\r\n\t\\para{length} specifies the size of the block to allocate in\r\n\t\\em{paragraphes}. One paragraphe is a chunk of 16 bytes.\\newline\r\n\t\\para{mode} is a bitfield specifying what to do with UMBs. If no UMBs\r\n\tare available this setting is ignored (except for bit 0x10). Because only\r\n\tsome individual combination make sense, they are enumerated:\r\n\t\\item \\tok{0x00}: low memory first fit\r\n\t\\item \\tok{0x01}: low memory best fit\r\n\t\\item \\tok{0x02}: low memory last fit\r\n\t\\item \\tok{0x0F}: use current allocation strategy\r\n\t\\item \\tok{0x40}: high memory first fit\r\n\t\\item \\tok{0x41}: high memory best fit\r\n\t\\item \\tok{0x42}: high memory last fit\r\n\t\\item \\tok{0x80}: first fit, try high then low memory\r\n\t\\item \\tok{0x81}: best fit, try high then low memory\r\n\t\\item \\tok{0x82}: last fit, try high then low memory\r\n\t\\item \\tok{0x8F}: make high memory accessable, but don't change strategy\r\n\t\\nolist\r\n\tIf bit 0x10 is set, the maximal allocateable block size is returned.\\newline\r\n\tIf bit 0x10 is clear, a block is allocated and its segment is returned.\r\n\tThis segment is the handle to be passed back to \\tok{DOSfree()} or the\r\n\tDOS API to de-allocated the memory. The far memory address can be\r\n\tgenerated by \\tok{MK_FP(segment, 0)}.\\par\r\n\tTo support memory tracking utitilites, like \\cmd{MEM}, the applications\r\n\tID (eight byte name) is passed from its own memory block to the allocated\r\n\tones.\r\npr(erequistes): \r\nva(lue): 0: on failure\\item else: segment of allocated block or, if bit 0x10\r\n\tis set, the number of paragraphes of the largest unused block\r\nre(lated to): DOSfree DOSresize\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dosalloc.c\r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"suppl.h\"\r\n#include \"mcb.h\"\r\n#include \"fmemory.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\nword DOSalloc(word length, int mode)\r\n{\tint UMBLink = 1, allocStrat;\r\n\tUSEREGS\r\n\r\n\tDBG_ENTER(\"DOSalloc\", Suppl_farmem)\r\n\tDBG_ARGUMENTS( (\"len=%u, mode=0x%04x\", length, mode) )\r\n\r\n\tif(mode & 0x10)\t\t/* probe for max unused block */\r\n\t\tlength = ~0;\r\n\telse if(!length)\r\n\t\tDBG_RETURN_I( 0)\r\n\r\n\tif(mode & (0x40 | 0x80)) {\t/* UMBs have to be linked in */\r\n\t\t_AX = 0x5802;\t\t/* Get UMB Link State */\r\n\t\t\t/* FreeDOS doesn't change the flags if the API call fails */\r\n    /* /// Modified to use __emit__(), which doesn't require an assembler,\r\n       if we're compiling with TurboC.  - Ron Cemer */\r\n#if defined(_TC_EARLY_)\r\n        __emit__((unsigned char)0xf9);      /* stc */\r\n#elif defined(__WATCOMC__) || defined(__GNUC__)\r\n\t\treg.x.flags |= 1;\r\n#else\r\n\t\tasm {\r\n\t\t\tstc\r\n\t\t}\r\n#endif\r\n\t\tgeninterrupt(0x21);\t/* This fails prior DOS 5 */\r\n\t\tUMBLink = _AL;\r\n\t\tif(_CFLAG) \t\t/* no UMBs */\r\n\t\t\tUMBLink = 1, \t/* disables the UMB Unlink call */\r\n\t\t\tmode &= 0xF;\t/* Disables side effects with elder DOSs */\r\n\t\telse {\r\n\t\t\tif(!UMBLink) {\t\t/* UMBs need to be linked in */\r\n\t\t\t\t_BX = 1;\t\t/* Link in UMBs */\r\n\t\t\t\t_AX = 0x5803;\t/* Set UMB Link State */\r\n\t\t\t\tgeninterrupt(0x21);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tallocStrat = 0;\r\n\tif((mode & 0xF) != 0xF) {\r\n\t/* allocate the block, with the specified mode\r\n\t\t--> save the old allocation mode */\r\n\t\t_AX = 0x5800;\t\t\t\t\t\t/* Get Allocation Strategy */\r\n\t\t\t/* FreeDOS this call never fails, but doesn't change the\r\n\t\t\t\tflags */\r\n    /* /// Modified to use __emit__(), which doesn't require an assembler,\r\n       if we're compiling with TurboC.  - Ron Cemer */\r\n#if defined(_TC_EARLY_)\r\n        __emit__((unsigned char)0xf8);      /* clc */\r\n#elif defined(__WATCOMC__) || defined(__GNUC__)\r\n\t\treg.x.flags &= ~1;\r\n#else\r\n\t\tasm {\r\n\t\t\tclc\r\n\t\t}\r\n#endif\r\n\t\tgeninterrupt(0x21);\r\n\t\tallocStrat = _AL;\r\n\t\tif(_CFLAG)\t\t\t\t\t\t/* MCB chain destroyed */\r\n\t\t\tlength = 0;\t\t\t/* don't return here, because of UMB state */\r\n\t\telse {\r\n\t\t\t_BX = mode & ~0x10;\t\t\t\t/* allocation strategy to set */\r\n\t\t\t_AX = 0x5801;\t\t\t\t\t/* Set Allocation Strategy */\r\n\t\t\tgeninterrupt(0x21);\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(length) {\r\n\t\t/* now, try to allocate the block */\r\n\t\t_BX = length;\t\t\t\t\t\t\t/* size of block */\r\n\t\t_AH = 0x48;\t\t\t\t\t\t\t\t/* Allocate Memory Block */\r\n\t\tgeninterrupt(0x21);\r\n\t\tlength = _AX;\r\n\t\tif(_CFLAG)\r\n\t\t\tlength = (mode & 0x10)? _BX: 0;\t/* allocation failed */\r\n\t\telse\t\t\t\t\t/* allocation OK; update name field */\r\n\t\t\t_fmemcpy(MK_FP(SEG2MCB(length), MCB_OFF_NAME)\r\n\t\t\t , MK_FP(SEG2MCB(_psp), MCB_OFF_NAME), 8);\r\n\r\n\t\tif((mode & 0xF) != 0xF) {\r\n\t\t/* reset allocation strategy */\r\n\t\t\t_BX = allocStrat;\r\n\t\t\t_AX = 0x5801;\r\n\t\t\tgeninterrupt(0x21);\r\n\t\t}\r\n\t}\r\n\r\n\t/* reset UMBLink state */\r\n\tif(!UMBLink) {\r\n\t\t_BX = 0;\t\t\t\t\t\t\t\t/* Unlink UMBs from chain */\r\n\t\t_AX = 0x5803;\r\n\t\tgeninterrupt(0x21);\r\n\t}\r\n\r\n\tDBG_RETURN_I( length)\t\t/* allocated block */\r\n}\r\n"
  },
  {
    "path": "suppl/src/dosfree.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): DOSfree\r\nsu(bsystem): farmem\r\nty(pe): \r\nsh(ort description): De-allocate a block of memory using the DOS API\r\nhe(ader files): \r\nlo(ng description): De-allocates a block of memory directly via the DOS API.\r\n\tThis block must be allocated by \\tok{DOSalloc()} or any other function using\r\n\tthe DOS API to deallocate (free) a block of memory.\r\npr(erequistes): \r\nva(lue): 0: on success\\item else: DOS error code\r\nre(lated to): DOSalloc DOSresize\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dosfree.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"suppl.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\nint DOSfree(nM(const word) segm)\r\n#ifdef _MICROC_\r\n#ifndef SUPPL_LOG_FUNCTIONS\r\nasm {\r\n\tmov ax, asmName(segm, 4)\r\n\tor ax, ax\t\t\t\t; /* no segment to free */\r\n\tjz DOSfree1\t\r\n\tmov es, ax\r\n\tmov ah, 49h\r\n\tint 21h\r\nDOSfree1:\r\n}\r\n#else\r\n{\tIREGS r;\r\n\r\n\tDBG_ENTER(\"DOSfree\", Suppl_farmem)\r\n\tDBG_ARGUMENTS( (\"segm=%04x\", segm) )\r\n\r\n\tr.r_ax = 0x4900;\r\n\tr.r_es = segm;\r\n\tDBG_RETURN_BI(invokeDOS(aS(r)));\r\n}\r\n#endif\r\n#else\r\n{\tUSEREGS\r\n\r\n\tDBG_ENTER(\"DOSfree\", Suppl_farmem)\r\n\tDBG_ARGUMENTS( (\"segm=%04x\", segm) )\r\n\r\n\t_ES = segm;\r\n\t_AH = 0x49;\t\t/* Free Memory Block */\r\n\tgeninterrupt(0x21);\r\n\tDBG_RETURN_BI( _AX)\r\n}\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/dossize.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): DOSresize\r\nsu(bsystem): farmem\r\nty(pe): \r\nsh(ort description): Resize a block of memory using the DOS API\r\nhe(ader files): \r\nlo(ng description): Resizes a block of memory directly via the DOS API.\r\n\tThis block must be allocated by \\tok{DOSalloc()} or any other function using\r\n\tthe DOS API.\r\npr(erequistes): \r\nva(lue): 0: on success\\item else: on failure\r\nre(lated to): DOSalloc, DOSfree\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dossize.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"suppl.h\"\r\n#include \"mcb.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\nint DOSresize(word segm, word newLen)\r\n{\t\r\n\tUSEREGS\r\n\r\n\tDBG_ENTER(\"DOSresize\", Suppl_farmem)\r\n\tDBG_ARGUMENTS( (\"segm=0x%04x, len=%u\", segm, newLen) )\r\n\r\n\tif(!segm)\r\n\t\tDBG_RETURN_I( 1)\t\t/* no segment */\r\n\r\n#ifdef _MICROC_\t/* Micro-C's int86() does not support ES */\r\n\tsegm;\t\t\t/* mov ax, segm */\r\n\tasm \"mov es, ax\";\r\n\tnewLen;\t\t\t/* mov ax, newLen */\r\n\tasm {\r\n\t\tmov bx, ax\r\n\t\tmov ah, 4ah\r\n\t\tint 21h\r\n\t\tsbb ax, ax\r\n\t}\r\n#ifdef SUPPL_LOG_FUNCTIONS\r\n\tDBG_RETURN_BI(nargs())\r\n#endif\r\n\t/* implizitly returning AX */\r\n#else\r\n\t_ES = segm;\t\t/* block to resize */\r\n\t_BX = newLen;\t/* new size in paragraphs */\r\n\t_AH = 0x4a;\t\t/* DOS call Modify Allocated Memory */\r\n\tgeninterrupt(0x21);\r\n\tDBG_RETURN_BI( _CFLAG)\t\t/* return the Carry flag */\r\n#endif\r\n}\r\n\r\n#ifdef _MICROC_\r\nword resizeBlk(const word segm, const unsigned length) \r\n{\treturn DOSresize(segm, BLK_byte2para(length));\r\n}\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/dstrchar.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tchar *StrChar(int ch)\r\n\r\n\tCreate a dynamic string containing the single character ch.\r\n\r\n\tReturn:\r\n\t\tNULL: malloc() returned NULL\r\n\t\telse: pointer to the malloc()'ed string\r\n\r\n\tTarget compilers: Micro-C v3.13, v3.14; Borland C v2, v3.1, v4.52\r\n\r\nob(ject): StrChar\r\nsu(bsystem): dynstr\r\nty(pe): H\r\nsh(ort description): Create a dynstring from a character\r\nlo(ng description): Creates a dynamic string out of a single character\r\nva: NULL: if \\tok{malloc()} fails (ENOMEM)\r\n\t\\item else: pointer to dynamically allocated string\r\npr(erequistes): \r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dstrchar.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"dynstr.h\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *StrChar(int ch)\r\n{\tchar *h;\r\n\r\n\tDBG_ENTER(\"StrChar\", Suppl_dynstr)\r\n\tDBG_ARGUMENTS( (\"ch='%c' (0x02x)\", ch > 32? ch: ' ', ch) )\r\n\r\n\tchkHeap\r\n\tif((h = eno_strdup(\" \")) != 0)\r\n\t\t*h = ch;\r\n\r\n\tchkHeap\r\n\tDBG_RETURN_S( h)\r\n}\r\n"
  },
  {
    "path": "suppl/src/dstrfupr.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tchar *StrFUpr(char s[])\r\n\r\n\tUpcase the string s[] using the toFUpper() function.\r\n\ts may be NULL.\r\n\r\n\tReturn:\r\n\t\ts[]\r\n\r\nob(ject): StrFUpr\r\nsu(bsystem): nls\r\nty(pe): \r\nsh(ort description): Upcase the string using the DOS NLS\r\nlo(ng description): Upcases the string using the DOS NLS information\r\n\tfor filenames.\r\n\tThe string is overwritten,\r\npr(erequistes): \r\nre(lated to): \r\nse(condary subsystems): dynstr\r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva: \\para{s}\r\nfi(le): dstrupr.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include <portable.h>\r\n#include \"nls_f.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *StrFUpr(char *s)\r\n{\tchar *p;\r\n\r\n\tDBG_ENTER(\"StrFUpr\", Suppl_nls)\r\n\r\n\tif((p = s) != 0)\r\n\t\twhile((*p = toFUpper(*p)) != NUL)\r\n\t\t\t++p;\r\n\tDBG_RETURN_S( s)\r\n}\r\n"
  },
  {
    "path": "suppl/src/dstrleft.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tchar *StrLeft(char s[], unsigned length)\r\n\r\n\tReturn the left length characters of s.\r\n\r\n\tIf strlen(s) < length, the string is duplicated.\r\n\r\n\ts may be NULL.\r\n\r\n\tReturn:\r\n\t\tNULL: s==NULL, malloc() failed\r\n\t\telse: pointer to the malloc()'ed buffer\r\n\r\n\tTarget compilers: Micro-C, Borland C v2, v3.1, v4.52\r\n\r\nob(ject): StrLeft\r\nsu(bsystem): dynstr\r\nty(pe): H\r\nsh(ort description): Duplicate the first n characters into the heap\r\nlo(ng description): Duplicates the first \\para{len} characters of the\r\n\tstring \\para{str} into the heap.\r\npr(erequistes): \r\nva: NULL: if \\tok{malloc()} fails (ENOMEM), \\tok{s == NULL} (EINVAL)\r\n\t\\item else: pointer to dynamically allocated memory\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nfi(le): dstrleft.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"dynstr.h\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *StrLeft(const char * const s, size_t length)\r\n{\tchar *h;\r\n\tunsigned l;\r\n\r\n\tDBG_ENTER(\"StrLeft\", Suppl_dynstr)\r\n\r\n\tif(!s) {\r\n\t\teno_set(EINVAL);\r\n\t\tDBG_RETURN_S( 0)\r\n\t}\r\n\r\n\tDBG_ARGUMENTS( (\"str=\\\"%s\\\", len=%u\", s, length) )\r\n\r\n\tif((l = (unsigned)strlen(s)) < length)\r\n\t\tlength = l;\r\n\r\n\tchkHeap\r\n\tif((h = eno_malloc(length + 1)) != 0) {\r\n\t\tmemcpy(h, s, length);\r\n\t\th[length] = NUL;\r\n\t}\r\n\r\n\tchkHeap\r\n\tDBG_RETURN_S( h)\r\n}\r\n"
  },
  {
    "path": "suppl/src/dstrrepl.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tchar *StrRepl_(char *dest[], const char src[])\r\n\r\n\tFree dest[0] and place src there\r\n\r\n\tReturn: src\r\n\r\nob(ject): StrRepl_\r\nsu(bsystem): dynstr\r\nty(pe): H_\r\nsh(ort description): Replace a dynstring with a new dynstring\r\nlo(ng description): Replaces a dynamic string with another dynamic string.\\par\r\n\t\\em{Note}: The new string must be a dynamic string already, it is \\em{not}\r\n\tcreated anew by this function.\r\npr(erequistes): \r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva: \\para{src}\r\nfi(le): dstrrepl.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#endif\r\n#include <portable.h>\r\n#include <dynstr.h>\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *StrRepl_(char ** const dest, char * const src)\r\n{\tDBG_ENTER(\"StrRepl_\", Suppl_dynstr)\r\n\r\n\tassert(dest);\r\n\tchkHeap\r\n\tfree(*dest);\r\n\tchkHeap\r\n\tDBG_RETURN_BS( dest[0] = src)\r\n}\r\n"
  },
  {
    "path": "suppl/src/dstrtrim.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): StrTrim\r\nsu(bsystem): dynstr\r\nty(pe): H\r\nsh(ort description): Reallocate a dynstring\r\nlo(ng description): Reallocates a dynamic string to its smallest possible\r\n\tbuffer.\r\npr(erequistes): \r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): The passed in string is \\em{not} expected as a variable, thus,\r\n\tthe result is not stored there, but returned as return value only.\r\nbu(gs): \r\nfi(le): dstrtrim.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#include <stdlib.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"dynstr.h\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *StrTrim(char * const s)\r\n{\tchar *p;\r\n\tDBG_ENTER(\"StrTrim\", Suppl_dynstr)\r\n\r\n\tif(!s)\r\n\t\tDBG_RETURN_S( 0)\r\n\r\n\tchkHeap\r\n\tif((p = eno_realloc(s, strlen(s) + 1)) == 0) {\r\n\t\tDBG_STRING(\"realloc() should never have failed!!\")\r\n\t\tchkHeap\r\n\t\tDBG_RETURN_S( s)\r\n\t}\r\n\r\n\tchkHeap\r\n\tDBG_RETURN_S( p)\r\n}\r\n"
  },
  {
    "path": "suppl/src/dstrupr.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tchar *StrUpr(char s[])\r\n\r\n\tUpcase the string s[] using the toUpper() function.\r\n\ts may be NULL.\r\n\r\n\tReturn:\r\n\t\ts[]\r\n\r\nob(ject): StrUpr\r\nsu(bsystem): nls\r\nty(pe): \r\nsh(ort description): Upcase the string using the DOS NLS\r\nlo(ng description): Upcases the string using the DOS NLS information.\r\n\tThe string is overwritten,\r\npr(erequistes): \r\nre(lated to): \r\nse(condary subsystems): dynstr\r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva: \\para{s}\r\nfi(le): dstrupr.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include <portable.h>\r\n#include \"dynstr.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *StrUpr(char *s)\r\n{\tchar *p;\r\n\r\n\tDBG_ENTER(\"StrUpr\", Suppl_nls)\r\n\r\n\tif((p = s) != 0)\r\n\t\twhile((*p = toUpper(*p)) != NUL)\r\n\t\t\t++p;\r\n\tDBG_RETURN_S( s)\r\n}\r\n"
  },
  {
    "path": "suppl/src/eeopen.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tFILE *Eopen(const char * const fnam, const char * const mode);\r\n\r\n\tOpen the file as Fopen(), terminate the program on failure\r\n\r\nob(ject): Eopen\r\nsu(bsystem): error\r\nty(pe): S\r\nsh(ort description): Open a new stream and open a FILE pointer\r\nlo(ng description): Wrapps \\tok{fopen()}. On failure the program is\r\n\tterminated with the error message: \"Cannot open file \\\"%s\\\"\"\r\npr(erequistes): \r\nre(lated to): Ecreate Eclose Eread Ewrite Fopen Fxopen\r\nse(condary subsystems): supplio\r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): a valid FILE pointer\r\nfi(le): eeopen.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n#include \"msgs.h\"\r\n#include \"supplio.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nFILE *Eopen(const char * const fnam, const char * const mode)\r\n{\tFILE *f;\r\n\r\n\tDBG_ENTER(\"Eopen\", Suppl_error)\r\n\r\n\tif((f = Fopen(fnam, mode)) == 0)\r\n\t\tEsuppl_openFile(fnam);\r\n\r\n\tchkHeap\r\n\tDBG_RETURN_S( f)\r\n}\r\n"
  },
  {
    "path": "suppl/src/eestrcon.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tchar *EStrConcat(int argcnt, ...)\r\n\r\n\tConcats up to argcnt strings together and malloc() a buffer that will\r\n\treceive the result.\r\n\r\n\tIf one of the string == NULL, this string is ignored.\r\n\r\n\tOn failure, the program is terminated with the \"out of memory\" error.\r\n\r\n\tReturn:\r\n\t\tthe malloc'ed buffer\r\n\r\nob(ject): EStrConcat\r\nsu(bsystem): error\r\nty(pe): H\r\nsh(ort description): Concat several strings together\r\nlo(ng description): Concats several strings together, by using the\r\n\t\\tok{StrConcat()} function, and terminates the program on failure\r\n\twith the error message: \"Out of memory\"\r\npr(erequistes): \r\nre(lated to): StrConcat\r\nse(condary subsystems): dynstr\r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): constructed dynamic string\r\nfi(le): eestrcon.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#include <stdarg.h>\r\n#include <stdlib.h>\r\n#endif\r\n#include \"dynstr.h\"\r\n#include \"msgs.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\n#ifdef _MICROC_\r\nregister char *EStrConcat(int argcnt)\r\n{\tunsigned cnt, *poi;\r\n\tunsigned Xcnt, *Xpoi;\r\n\tunsigned length;\r\n\tchar *h, *p;\r\n\tDBG_ENTER1\r\n\r\n\tcnt = nargs();\r\n\r\n\tDBG_ENTER2(\"EStrConcat\", \"error\")\r\n\tDBG_ARGUMENTS( (\"argcnt=%u cnt=%u\", argcnt, cnt) )\r\n\r\n\tXpoi = poi = cnt * 2 - 2 + &argcnt;\r\n\tXcnt = cnt = min(cnt, *poi);\r\n\tfor(length = 1; cnt--;)\r\n\t\tif(*--poi) length += strlen(*poi);\r\n\r\n\tchkHeap\r\n\tif((h = p = malloc(length)) == 0)\r\n\t\tEsuppl_noMem();\r\n\r\n\tchkHeap\r\n\twhile(Xcnt--)\r\n\t\tif(*--Xpoi)\r\n\t\t\tp = stpcpy(p, *Xpoi);\r\n\r\n\tchkHeap\r\n\tDBG_RETURN_S( h)\r\n}\r\n#else\t\t/* !_MICROC_ */\r\n\r\nchar *EStrConcat(int argcnt, ...)\r\n{\tva_list strings;\r\n\tchar *p, *s;\r\n\tsize_t length, l;\r\n\r\n\tDBG_ENTER(\"EStrConcat\", Suppl_error)\r\n\tDBG_ARGUMENTS( (\"argcnt=%u cnt=%u\", argcnt, argcnt) )\r\n\r\n\tva_start(strings, argcnt);\r\n\tchkHeap\r\n\tp = Estrdup(\"\");\r\n\tchkHeap\r\n\tlength = 1;\r\n\twhile(argcnt--) {\r\n\t\ts = va_arg(strings, char *);\r\n\t\tif(s && *s) {\r\n\t\t\tl = length - 1;\r\n\t\t\tEresize(p, length += strlen(s));\r\n\t\t\tstrcpy(p + l, s);\r\n\t\t}\r\n\t}\r\n\tva_end(strings);\r\n\tchkHeap\r\n\tDBG_RETURN_S( p)\r\n}\r\n#endif\t\t/* _MICROC_ */\r\n"
  },
  {
    "path": "suppl/src/elvis.rc",
    "content": "set nomore\r\nset autoindent\r\nset autowrite\r\nset noerrorbells\r\nset exrc\r\nset showmatch\r\nset shiftwidth=4  \r\nset tabstop=4  \r\nabbr #i #include\r\nabbr! #i #include\r\nabbr #d #define\r\nabbr! #d #define\r\nabbr #f #ifdef\r\nabbr! #f #ifdef\r\nabbr #n #ifndef\r\nabbr! #n #ifndef\r\nabbr #l #else\r\nabbr! #l #else\r\nabbr #e #endif\r\nabbr! #e #endif\r\nabbr MC Micro-C\r\nabbr! MC Micro-C\r\nabbr BC Borland\u0016 C/Turbo\u0016 C\r\nabbr! BC Borland\u0016 C/Turbo\u0016 C\r\nabbr TC Turbo\u0016 C\r\nabbr! TC Turbo\u0016 C\r\nabbr WC Watcom\u0016 C\r\nabbr! WC Watcom\u0016 C\r\nabbr PAC Pacific\u0016 HiTech\u0016 C\r\nabbr! PAC Pacific\u0016 HiTech\u0016 C\r\nabbr #E #define\u0016 ESUPPL_\r\nabbr! #E #define\u0016 ESUPPL_\r\nabbr #m #ifdef _MICROC_\r\nabbr #M #ifndef _MICROC_\r\n\r\nmap q 0wCunless_segm(segm)\u0016\u001b\r\n"
  },
  {
    "path": "suppl/src/eno.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n   \tDeclarations for the local errno - wrappers\r\n\r\n*/\r\n\r\n#ifndef __SUPPL_ERRNO_LOC\r\n#define __SUPPL_ERRNO_LOC\r\n\r\n\t/* Need size_t */\r\n#include <stdlib.h>\r\n#include <errno.h>\r\n\r\n#define eno_set(eno)\t\\\r\n\t(errno = (eno))\r\nint eno_setOSerror(int errnr);\r\n\r\n\r\nchar *eno_strdup(const char * const fnam);\r\nvoid *eno_malloc(const size_t len);\r\nvoid *eno_realloc(void * const poi, const size_t len);\r\n\r\n#if !defined(_MICROC_) && !defined(__GNUC__)\r\nchar *eno_fdupstr(const char far * const s);\r\n#endif\t/* !_MICROC_ && !__GNUC__ */\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/enoallc.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): eno_malloc\r\nsu(bsystem): error\r\nty(pe): HL\r\nsy(nopsis): \r\nsh(ort description): as malloc(), but assigns errno\r\nhe(ader files): \r\nlo(ng description): as malloc(), but assigns errno = ENOMEM on failure\r\npr(erequistes): \r\nva(lue): NULL: on out-of-memory\r\n \\item else: dynamically allocated block of memory\r\nre(lated to): eno_strdup, Strdup, malloc\r\nse(condary subsystems): mem\r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid *eno_malloc(const size_t len)\r\n{\tvoid *h;\r\n\r\n\tDBG_ENTER(\"eno_malloc\", Suppl_error)\r\n\tDBG_ARGUMENTS( (\"size=%u\", len) )\r\n\r\n\tchkHeap\r\n\tif(0 == (h = malloc(len)))\r\n\t\teno_set( ENOMEM);\r\n\tchkHeap\r\n\tDBG_RETURN_P(h)\r\n}\r\n"
  },
  {
    "path": "suppl/src/enoreal.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): eno_realloc\r\nsu(bsystem): error\r\nty(pe): HL\r\nsy(nopsis): \r\nsh(ort description): as realloc(), but assigns errno\r\nhe(ader files): \r\nlo(ng description): as realloc(), but assigns errno = ENOMEM on failure\r\npr(erequistes): \r\nva(lue): NULL: on out-of-memory\r\n \\item else: dynamically allocated block of memory\r\nre(lated to): eno_strdup, Strdup, malloc\r\nse(condary subsystems): mem\r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid *eno_realloc(void * const poi, const size_t len)\r\n{\tvoid *h;\r\n\r\n\tDBG_ENTER(\"eno_realloc\", Suppl_error)\r\n\tDBG_ARGUMENTS( (\"poi=%p, size=%u\", poi, len) )\r\n\r\n\tif(0 == (h = realloc(poi, len)))\r\n\t\teno_set( ENOMEM);\r\n\tDBG_RETURN_P(h)\r\n}\r\n"
  },
  {
    "path": "suppl/src/enosdup.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): eno_strdup\r\nsu(bsystem): error\r\nty(pe): HL\r\nsy(nopsis): \r\nsh(ort description): as Strdup(), but assigns errno\r\nhe(ader files): \r\nlo(ng description): as Strdup(), but assigns errno = ENOMEM on failure\r\npr(erequistes): \r\nva(lue): \\tok{NULL}: \\tok{\\para{fnam} == NULL} or on out-of-memory\r\n \\item else: dynamically allocated block of memory\r\nre(lated to): strdup, Strdup, eno_malloc\r\nse(condary subsystems): mem\r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *eno_strdup(const char * const s)\r\n{\r\n\tDBG_ENTER(\"eno_strdup\", Suppl_error)\r\n\tDBG_ARGUMENTS( (\"s=\\\"%s\\\"\", s) )\r\n\r\n\tif(s) {\r\n\t\tchar *h = strdup(s);\r\n\t\tif(h)\r\n\t\t\tDBG_RETURN_S(h)\r\n\t\teno_set( ENOMEM);\r\n\t}\r\n\r\n\tDBG_RETURN_S(0)\r\n}\r\n"
  },
  {
    "path": "suppl/src/enosetos.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tAssigns a DOS error code to _doserrno and errno.\r\n\r\nob(ject): eno_setOSerror\r\nsu(bsystem): error\r\nty(pe): HL\r\nsy(nopsis): \r\nsh(ort description): Assign a DOS error code to _doserrno and errno\r\nhe(ader files): \r\nlo(ng description): Assigns a DOS error code to _doserrno and\r\n\trecodes the value into the corresponding errno equivalent, which\r\n\tis storred, too.\r\npr(erequistes): \r\nva(lue): \\tok{errnr}\r\nre(lated to): eno_set\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.loc\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\n#if defined(__TURBOC__) || defined(__GNUC__)\r\nextern char _dosErrorToSV [];\r\n#elif __WATCOMC__\r\nextern  int __set_errno_dos(unsigned int err);\r\n#else\r\n#error \"Unsupported compiler!\"\r\n#endif\r\n\r\nint eno_setOSerror(int errnr)\r\n{\r\n#ifdef __TURBOC__\r\n\tint eno;\r\n#endif\r\n\r\n\tDBG_ENTER(\"eno_setOSerror\", Suppl_error)\r\n\tDBG_ARGUMENTS( (\"errnr=%u\", errnr) )\r\n\r\n#if defined(__TURBOC__)\r\n\tif((unsigned)errnr > 88) {\r\n\t\tDBG_INFO( (\"Errnr exceeds range\") )\r\n\t\teno = EFAULT;\r\n\t} else {\r\n\t\teno = _dosErrorToSV[errnr];\r\n\t}\r\n\r\n\terrno = eno;\r\n\r\n\t_doserrno = errnr;\r\n#elif __WATCOMC__\r\n\t __set_errno_dos(errnr);\r\n#endif\r\n\t DBG_RETURN_I( errnr)\t\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_chg.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/*  $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_change\r\nsu(bsystem): env\r\nty(pe): \r\nsh(ort description): Insert/replace/delete a variable\r\nlo(ng description): If \\tok{\\para{value} != NULL}, the variable is\r\n\tinserted or replaced, if it already exists within the environment.\\newline\r\n\tIf \\tok{\\para{value} == NULL}, the variable is removed from the\r\n\tenvironment.\\newline\r\n\tBoth \\para{var} and \\para{value} may point to an empty string.\r\npr(erequistes): var != NULL\r\nre(lated to): chgenv env_add\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): \\tok{0}: Cannot insert variable\r\n\t\\item \\tok{1}: variable replaced or deleted\r\n\t\\item \\tok{2}: variable not found (could not delete)\r\n\t\\item \\tok{3}: variable newly inserted\r\n\t\\item \\tok{4}: no environment at all\r\n\t\\item \\tok{-1}: \\tok{\\para{varname} == NULL}\r\nfi(le): env_chg.c\r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"environ.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint env_change(word segm, const char * const var, const char * const value)\r\n{\tunsigned offset;\r\n\r\n\tDBG_ENTER(\"env_change\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u, var=\\\"%s\\\", value=\\\"%s\\\"\", segm, var, value) )\r\n\r\n\tchkMem\r\n\tif(var == 0)\r\n\t\tDBG_RETURN_I( -1)\r\n\r\n\tunless_segm(segm)\r\n\t\tDBG_RETURN_I( 4)\r\n\r\n\tDBG_ARGUMENTS( (\"effective env=%u\", segm) )\r\n\r\n\t/* Check if the variable is already in */\r\n\tif((offset = env_findVar(segm, var)) != 0xffff)\r\n\t\t/* Overwrite/delete variable */\r\n\t\tDBG_RETURN_BI( !env_ovrVarOffset(segm, offset, 0, value))\r\n\r\n\t/* not in environment */\r\n\tif(!value)\t\t\t/* nothing to delete */\r\n\t\tDBG_RETURN_I( 2)\r\n\r\n\t/* Try to insert the variable */\r\n\tDBG_RETURN_BI( env_appVar(segm, var, value)? 0: 3)\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_del.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_delete\r\nsu(bsystem): env\r\nty(pe): \r\nsh(ort description): Delete an environment segment\r\nlo(ng description): Deletes the given environment segment.\\par\r\n\tIf it is \\tok{0} (zero) or the default environment, the field of\r\n\tthe PSP is updated with \\tok{0} (zero) to indicate that no default\r\n\tenvironment exists.\r\npr(erequistes): \r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): none\r\nfi(le): env_del.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"environ.loc\"\r\n#include \"suppl.h\"\r\n#include \"mcb.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid env_delete(word segm)\r\n{\tDBG_ENTER(\"env_delete\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u\", segm) )\r\n\r\n\tchkMem\r\n \tunless_segm(segm)\r\n \t\tDBG_EXIT\r\n  \r\n \tDBG_ARGUMENTS( (\"effective env=%u\", segm) )\r\n  \r\n \tpokew(SEG2MCB(segm), MCB_OFF_OWNER, _psp);\r\n \tfreeBlk(segm);\r\n \tchkMem\r\n \t/* Make sure the deleted segment won't be referenced */\r\n \tenv_relocateSegment(segm, 0);\r\n  \r\n\r\n\tDBG_EXIT\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_dvar.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/*  $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): dupvar\r\nsu(bsystem): env\r\nty(pe): H\r\nsh(ort description): Duplicate a variable into heap\r\nlo(ng description): Retreive the value of a variable of the default\r\n\tenvironment and duplicate its value into the heap.\r\npr(erequistes): \r\nre(lated to): env_dupvar cpyenv\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): \\tok{NULL}: out of memory (ENOSPC), variable not found (ENOENT), no\r\n\tenvironment at all (ENXIO)\r\n\t\\item else: pointer to allocated buffer\r\nfi(le): env_dvar.c\r\n\r\nob(ject): env_dupvar\r\nsu(bsystem): env\r\nty(pe): H\r\nsh(ort description): Duplicate a variable into heap\r\nlo(ng description): Retreive the value of a variable of the specified\r\n\tenvironment and duplicate its value into the heap.\r\npr(erequistes): \r\nre(lated to): env_dupvar cpyenv\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): \\tok{NULL}: out of memory or variable not found\r\n\t\\item else: pointer to allocated buffer\r\nfi(le): env_dvar.c\r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <string.h>\r\n#include <stdlib.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"environ.loc\"\r\n#include \"eno.loc\"\r\n#include \"fmemory.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *dupvar(const char * const var)\r\n{\treturn env_dupvar(0, var);\t}\r\nchar *env_dupvar(word segm, const char * const var)\r\n{\tint ofs;\t\t\t\t\t\t/* offset of the variable */\r\n\tchar *h;\r\n\r\n\tDBG_ENTER(\"env_dupvar\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u, var=\\\"%s\\\"\", segm, var) )\r\n\r\n\tchkMem\r\n\tunless_segm(segm) {\r\n\t \teno_set(ENXIO);\r\n \t\tDBG_RETURN_S( 0)\r\n\t}\r\n\r\n\tif(var == 0\t\t\t\t\t\t/* nothing to do */\r\n\t || (ofs = env_findVar(segm, var)) == -1) {\t/* variable not found */\r\n\t \teno_set(ENOENT);\r\n\t\tDBG_RETURN_S( 0)\r\n\t}\r\n\r\n\tif(0 == (h = _fdupstr(MK_FP(segm, ofs + strlen(var) + 1))))\r\n\t\teno_set(ENOMEM);\r\n\tDBG_RETURN_S(h)\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_find.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/*  $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_findVar\r\nsu(bsystem): env\r\nty(pe): \r\nsh(ort description): Find a variable\r\nlo(ng description): Searches case-sensitively for a variable in the given environment\r\npr(erequistes): segm != 0\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): \\tok{(word)-1}: failure; not found (ENOENT), \\tok{segm == 0 || val == 0} (EINVAL)\r\n\t\\item else: offset of first case-sensitive match\r\nfi(le): env_find.c\r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"environ.h\"\r\n#include \"fmemory.h\"\r\n\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nword env_findVar(const word segm, const char * const var)\r\n{\tword offset;\r\n\tint len;\r\n\r\n\tDBG_ENTER(\"env_findVar\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u, var=\\\"%s\\\"\", segm, var) )\r\n\r\n\tchkMem\r\n\t\r\n\t/* for security reason, check if environment is present at all */\r\n\tif(!segm || !var) {\r\n\t\teno_set(EINVAL);\r\n\t\tDBG_RETURN_U( -1)\t\t\t/* No env --> no var can be found */\r\n\t}\r\n\t\t\t\t\t\t\t/* No var --> nothing to search for */\r\n\tDBG_ARGUMENTS( (\"effective env=%u\", segm) )\r\n\r\n\toffset = 0;\t\t\t/* env starts always at location 0 */\r\n\tlen = strlen(var);\r\n\r\n\twhile(peekb(segm, offset)) {\t\t\t/* there is another variable */\r\n\t\tif(peekb(segm, offset + len) == '='\r\n\t\t && _fmemcmp(MK_FP(segm, offset), TO_FP(var), len) == 0)\r\n\t\t\tDBG_RETURN_U( offset)\t\t/* we found it */\r\n\r\n\t\t/* skip to the next variable */\r\n\t\toffset += env_varlen(segm, offset);\r\n\t}\r\n\r\n\t/* all variables were tested, nothing found */\r\n\teno_set(ENOENT);\r\n\tDBG_RETURN_U( -1)\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_fora.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_forall\r\nsu(bsystem): env\r\nty(pe): \r\nsh(ort description): Enumerate all variables\r\nlo(ng description): Enumerates all variables of a given environment and\r\n\tinvokes a function for each found variable. The callback function must\r\n\tbe of type \\tok{ENV_WALKFUNC}, which prototype is:\r\n\t\\example{|}\r\n\t|int FCT(void *arg, word env, word offset)\r\n\tThe argument \\para{arg} is passed unchanged to the callback function and\r\n\tmay be used to pass arbitary information from the program via \\tok{env_forAll} to the callback function.\\newline\r\n\tIf the callback function returns \\tok{0} (zero), the enumeration process\r\n\tcontinues; otherwise the loop breaks immediately.\\par\r\n\tOn loop, \\tok{env_forAll} continues with the next variable following\r\n\tthe one starting at the position passed to the callback function.\r\npr(erequistes): \r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): \\tok{-1}: parameter out of range\r\n\t\t\\list \\tok{ENXIO}: No environment at all\r\n\t\t\t\\item \\tok{EINVAL}: invalid argument\r\n\t\t\\endlist\r\n\t\\item \\tok{0}: all variables enumerated, callback function returned \\tok{0}\r\n\t(zero) every time\r\n\t\\item else: the return value of the callback function\r\nfi(le): env_fora.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"environ.loc\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint env_forAll(word segm, ENV_WALKFUNC fct, void *arg)\r\n{\tword ofs;\r\n\tint retVal;\r\n\r\n\tDBG_ENTER(\"env_forAll\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u\", segm) )\r\n\r\n\tchkMem\r\n \tunless_segm(segm) {\r\n \t\teno_set(ENXIO);\r\n \t\treturn -1;\r\n \t}\r\n \tif(!fct) {\r\n \t\teno_set(EINVAL);\r\n \t\treturn -1;\r\n \t}\r\n  \t\r\n\tDBG_ARGUMENTS( (\"effective env=%u\", segm) )\r\n\r\n\tfor(ofs = 0; peekb(segm, ofs); ofs += env_varlen(segm, ofs)) {\r\n\t\tDBG_INFO( (\"invoke callback function with (%u:%u)\", segm, ofs) )\r\n\t\tif((retVal = (*fct)(arg, segm, ofs)) != 0\t/* call function & break */\r\n\t\t || !peekb(segm, ofs))\t\t/* callback function cleared env */\r\n\t\t\tDBG_RETURN_I( retVal)\r\n\t}\r\n\r\n\tDBG_RETURN_I( 0)\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_free.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/*  $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_endOfVars\r\nsu(bsystem): env\r\nty(pe): L\r\nsh(ort description): Return the first byte behind the environment variables\r\nlo(ng description): Returns the offset of the first byte of the environment\r\n\tthat is not a part of the variables area.\r\npr(erequistes): \\para{segm} != 0\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nbu(gs): \r\nva(lue): offset of first byte behind the environment variables\r\nfi(le): env_free.c\r\n\r\nob(ject): env_firstFree\r\nsu(bsystem): env\r\nty(pe): L\r\nsh(ort description): Return the first byte not used by the environment areas\r\nlo(ng description): Returns the offset of the first byte of the environment\r\n\tthat is unused currently.\r\npr(erequistes): \\para{segm} != 0\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): This offset may point outside of the environment, if it is\r\n\tcompletely filled.\r\nbu(gs): \r\nva(lue): offset of first unused byte of the environment\r\nfi(le): env_free.c\r\n\r\nob(ject): env_freeCount\r\nsu(bsystem): env\r\nty(pe): L\r\nsh(ort description): Count the number of unused bytes of the environment\r\nlo(ng description): Returns the number of unused bytes of the environment.\r\npr(erequistes): \\para{segm} != 0\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): If the segment is >= 64KB long and is filled >= (64KB - 1), this\r\n\tfunction returns invalid values.\r\nva(lue): offset of first unused byte of the environment\r\nfi(le): env_free.c\r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"environ.h\"\r\n#include \"mcb.h\"\r\n#include \"fmemory.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nword env_endOfVars(const word segm)\r\n{\tword offset;\r\n\r\n\tDBG_ENTER(\"env_endOfVars\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u\", segm) )\r\n\r\n\tchkMem\r\n\t\r\n\tassert(segm != 0);\r\n\r\n\toffset = 0;\t\t\t\t\t/* env starts always at location 0 */\r\n\r\n\twhile(peekb(segm, offset))\t/* there is a variable */\r\n\t\toffset += env_varlen(segm, offset);\r\n\r\n\tDBG_RETURN_U( offset)\t\t\t\t/* This is the terminator byte */\r\n}\r\n\r\nword env_firstFree(const word segm)\r\n{\tDBG_ENTER(\"env_firstFree\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u\", segm) )\r\n\r\n\tchkMem\r\n\t\r\n\tassert(segm != 0);\r\n\r\n\tDBG_RETURN_BU( env_string(segm, env_strings(segm)))\r\n}\r\n\r\nword env_freeCount(const word segm)\r\n{\tDBG_ENTER(\"env_firstCount\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u\", segm) )\r\n\r\n\tchkMem\r\n\t\r\n\tassert(segm != 0);\r\n\r\n\tDBG_RETURN_BU( mcb_length(segm) - env_firstFree(segm))\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_insv.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/*  $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_appVar\r\nsu(bsystem): env\r\nty(pe): L\r\nsh(ort description): Append a variable to the end of the environment\r\nlo(ng description): Inserts a variable before the end of the\r\n\tvariables area of the environment\r\npr(erequistes):\r\nre(lated to): env_change putenv env_insVarOffset\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning):\r\nbu(gs): \r\nva(lue): \\endlist integer SUPPL error code\\newline\r\n\t\\item \\tok{ESUPPL_OK}: variable inserted or \\tok{\\para{value} == NULL}\r\n\t\\item \\tok{ESUPPL_NOMEM}: failed to insert variable\r\n\t\\item \\tok{ESUPPL_INVAL}: parameter out of range\r\n\t\\item \\tok{ESUPPL_NOENV}: no environment at all\r\nfi(le): env_insv.c\r\n\r\nob(ject): env_insVarOffset\r\nsu(bsystem): env\r\nty(pe): L\r\nsh(ort description): Insert a variable into the environment\r\nlo(ng description): Inserts a variable before the specified\r\n\toffset of an environment\r\npr(erequistes):\r\nre(lated to): env_change putenv env_appVar\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning):\r\nbu(gs): \r\nva(lue): \\tok{ESUPPL_OK}: variable inserted or \\tok{\\para{value} == NULL}\r\n\t\\item \\tok{ESUPPL_NOMEM}: failed to insert variable\r\n\t\\item \\tok{ESUPPL_INVAL}: parameter out of range\r\n\t\\item \\tok{ESUPPL_NOENV}: no environment at all\r\nfi(le): env_insv.c\r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"environ.loc\"\r\n#include \"errcodes.h\"\r\n#include \"fmemory.h\"\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint env_appVar(word segm, const char * const var, const char * const value)\r\n{\tDBG_ENTER(\"env_appVar\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u, var=\\\"%s\\\", value=\\\"%s\\\"\", segm, var, value) )\r\n\r\n\tchkMem\r\n\t\r\n\tunless_segm(segm)\r\n\t\tDBG_RETURN_I( ESUPPL_NOENV)\r\n\r\n\tDBG_ARGUMENTS( (\"effective env=%u\", segm) )\r\n\r\n\tDBG_RETURN_BI( env_insVarOffset(segm, env_endOfVars(segm)\r\n\t\t, var, value))\r\n}\r\n\r\nint env_insVarOffset(word segm, word offset, const char * const var\r\n , const char * const value)\r\n{\tint lenN, lenV, lenG;\r\n\r\n\tDBG_ENTER(\"env_insVarOffset\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u, ofs=%u, var=\\\"%s\\\", value=\\\"%s\\\"\", segm, offset, var, value) )\r\n\r\n\tchkMem\r\n\t\r\n\tunless_segm(segm)\r\n\t\tDBG_RETURN_I( ESUPPL_NOENV)\r\n\r\n\tDBG_ARGUMENTS( (\"effective env=%u\", segm) )\r\n\r\n\tif(!value)\t\t/* ignore */\r\n\t\tDBG_RETURN_I( ESUPPL_OK)\r\n\tif(!var)\r\n\t\tDBG_RETURN_I( ESUPPL_INVAL)\r\n\r\n\tif(env_freeCount(segm)\r\n\t < (lenG = (lenN = strlen(var)) + (lenV = strlen(value)) + 2)\r\n\t  || lenG <= 1)\t\t/* longer than 32KB */\r\n\t\tDBG_RETURN_I( ESUPPL_NOMEM)\t/* sorry, no space free in the env seg */\r\n\r\n\t/* 1) move the following variables and the string table out of the way */\r\n\t_fmemmove(MK_FP(segm, offset + lenG), MK_FP(segm, offset)\r\n\t , env_firstFree(segm) - offset);\r\n\r\n\t/* 2) move the variable */\r\n\tchkMem\r\n\t_fmemcpy(MK_FP(segm, offset), TO_FP(var), lenN);\r\n\tchkMem\r\n\t_fmemcpy(MK_FP(segm, offset + lenN + 1), TO_FP(value), lenV + 1);\r\n\tchkMem\r\n\tpokeb(segm, offset + lenN, '=');\r\n\r\n\tchkMem\r\n\t\r\n\tDBG_RETURN_I( ESUPPL_OK)\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_len.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/*  $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_varlen\r\nsu(bsystem): env\r\nty(pe): \r\nsh(ort description): Return the number of bytes used by the variable\r\nlo(ng description): Returns the number of bytes used by the variable\r\n\tat the specified offset, including \\tok{NUL} terminator byte.\r\npr(erequistes): \\para{segm} != NULL\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): number of bytes used by the variable\r\nfi(le): env_len.c\r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"environ.loc\"\r\n#include \"fmemory.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nunsigned env_varlen(const word segm, const word offset)\r\n/* Return the length of the string at segm:offset */\r\n{\tassert(segm != 0);\r\n\treturn _fstrlen(MK_FP(segm, offset)) + 1;\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_mtch.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_matchVar\r\nsu(bsystem): env\r\nty(pe): \r\nsh(ort description): Retreive the name of a variable\r\nlo(ng description): Retrieves the case-sensitive name of a variable.\\par\r\n\tIf no case-sensitive match is located within the environment, the\r\n\tfirst case-insensitive match is found and overwrites the passed\r\n\tin buffer of the name of the variable.\r\npr(erequistes): \r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): \\tok{1}: parameter out of range\r\n\t\\item \\tok{2}: no match found, \\para{var][]} unchanged\r\n\t\\item \\tok{3}: no environment at all, \\para{var][]} unchanged\r\n\t\\nolist\r\n\tIf \\tok{(\\para{return_value} & 7) == 0}, the return value is any combination\r\n\tof the following numbers:\r\n\t\\item \\tok{4}: more than one case-sensitive match found\r\n\t\\item \\tok{8}: more than one case-insensitive match found\r\n\t\\item \\tok{16}: at least one case-sensitive match found\r\n\t\\item \\tok{32}: at least one case-insensitive match found\r\n\t\\nolist\r\n\tIf \\tok{(\\para{return_value} & (4 | 16)) == 0}, the \\tok{var[]} array\r\n\tis unchanged. Otherwise its contents is updated with the name of the first\r\n\tcase-insensitively matched variable.\r\nfi(le): env_mtch.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"fmemory.h\"\r\n\r\n#include \"suppl.h\"\r\n#include \"dynstr.h\"\r\n#include \"environ.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint env_matchVar(word segm, char * const var)\r\n{\tint retVal, varLen;\r\n\tword firstOfs, ofs;\r\n\r\n\tDBG_ENTER(\"env_matchVar\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u, var=\\\"%s\\\"\", segm, var) )\r\n\r\n\tchkMem\r\n\t\r\n\tif(!var) DBG_RETURN_I( 1)\t\t\t/* no variable to search for */\r\n\r\n\tunless_segm(segm)\r\n\t\tDBG_RETURN_I( 3)\t\t\t\t/* no environment at all */\r\n\r\n\tDBG_ARGUMENTS( (\"effective env=%u\", segm) )\r\n\r\n\tretVal = ofs = 0;\r\n\tvarLen = strlen(var);\t\t/* offset of '=' sign */\r\n\twhile(peekb(segm, ofs)) {\r\n\t\tif(peekb(segm, ofs + varLen) == '=') {\t/* length is OK */\r\n\t\t\tif(_fmemcmp(MK_FP(segm, ofs), TO_FP(var), varLen) == 0) {\r\n\t\t\t\t/* case-sensitive match */\r\n\t\t\t\tretVal |= (retVal & 16)? 4: 16;\r\n\t\t\t}\r\n\t\t\telse if(_fMemiCmp(MK_FP(segm, ofs), TO_FP(var), varLen) == 0) {\r\n\t\t\t\t/* case-insensitive match */\r\n\t\t\t\tif(!retVal) firstOfs = ofs;\r\n\t\t\t\tretVal |= (retVal & 32)? 8: 32;\r\n\t\t\t}\r\n\t\t}\r\n\t\tofs += env_varlen(segm, ofs);\r\n\t}\r\n\r\n\tif(!retVal)\t\t\t\t\t\t\t\t/* no match found */\r\n\t\tDBG_RETURN_I( 2)\r\n\r\n\tif(!(retVal & (16 | 4)))\t\t/* no case-sensitive match -> update var */\r\n\t\t_fmemcpy(TO_FP(var), MK_FP(segm, firstOfs), varLen);\r\n\r\n\tchkMem\r\n\t\r\n\tDBG_RETURN_BI( retVal & (32 | 16 | 8 | 4))\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_new.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_create\r\nsu(bsystem): env\r\nty(pe): \r\nsh(ort description): Create a new environment\r\nlo(ng description): Creates a new environment of a given length\r\npr(erequistes): \r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): \\tok{0}: failure; out of memory (ENOMEM), parameter out of range (EINVAL)\r\n\t\\item else: address of new environment\r\nfi(le): env_new.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include <portable.h>\r\n#include \"environ.h\"\r\n#include \"suppl.h\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nword env_create(const unsigned length)\r\n{\tword segm;\r\n\tint allocMode;\r\n\r\n\tDBG_ENTER(\"env_create\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"len=%u\", length) )\r\n\r\n\tchkMem\r\n\t\r\n\tif(length == 0) {\r\n\t\teno_set(EINVAL);\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tswitch(env_resizeCtrl & (ENV_FIRSTFIT | ENV_LASTFIT)) {\r\n\t\tcase ENV_FIRSTFIT:\tallocMode = 0; break;/* first fit */\r\n\t\tcase ENV_LASTFIT:\tallocMode = 2; break;/* last fit */\r\n\t\tdefault:\t\t\tallocMode = 1; break;/* best fit */\r\n\t}\r\n\r\n\tDBG_ARGUMENTS( (\"allocMode=%u, use UMB?=%u\", allocMode, !!(env_resizeCtrl & ENV_USEUMB)) )\r\n\r\n\t/* try to allocate block in the UMBs */\r\n\tif(!(env_resizeCtrl & ENV_USEUMB)\r\n\t || (segm = allocBlk(length, allocMode | 0x40)) == 0)\r\n\t\tsegm = allocBlk(length, allocMode);\t/* try the low memory */\r\n\r\n\tchkMem\r\n\t\r\n\tif(segm)\tpoked(segm, 0, 0);\t/* initialize to an unused environment */\r\n\telse\t\teno_set(ENOMEM);\r\n\r\n\tchkMem\r\n\t\r\n\tDBG_RETURN_U( segm)\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_nost.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_nullStrings\r\nsu(bsystem): env\r\nty(pe): \r\nsh(ort description): Empty string area\r\nlo(ng description): Removes all strings from the string area of the\r\n\tenvironment. Can be called if \\tok{env_check()} returned \"invalid\r\n\tstring area\".\r\npr(erequistes): \r\nre(lated to): env_strings\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): \\endlist integer SUPPL error code\\newline\r\n\t\\item \\tok{ESUPPL_OK}: success\r\n\t\\item \\tok{ESUPPL_NOMEM}: no room to write counter\r\n\t\\item \\tok{ESUPPL_NOENV}: no environment at all\r\nfi(le): env_nost.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"errcodes.h\"\r\n#include \"environ.loc\"\r\n#include \"mcb.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint env_nullStrings(word segm)\r\n{\tword ofs;\r\n\r\n\tDBG_ENTER(\"env_nullStrings\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u\", segm) )\r\n\r\n\tchkMem\r\n\t\r\n\tunless_segm(segm)\r\n\t\tDBG_RETURN_I( ESUPPL_NOENV)\r\n\r\n\tDBG_ARGUMENTS( (\"effective env=%u\", segm) )\r\n\r\n\tofs = env_endOfVars(segm) + 1;\t\t/* offset of string counter word */\r\n\tif(mcb_length(segm) - 2 <= ofs)\r\n\t\tDBG_RETURN_I( ESUPPL_NOMEM)\r\n\r\n\tpokew(segm, ofs, 0);\r\n\tchkMem\r\n\t\r\n\tDBG_RETURN_I( ESUPPL_OK)\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_ovrw.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/*  $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_ovrVarOffset\r\nsu(bsystem): env\r\nty(pe): L\r\nsh(ort description): Overwrite a variable\r\nlo(ng description): Overwrites the variable at a given offset in the\r\n\tenvironment.\\par\r\n\tIf \\tok{\\para{value} == NULL}, the variable is removed.\\newline\r\n\tIf \\tok{\\para{var} == NULL}, the name of the variable is kept\r\n\tunchanged.\r\npr(erequistes): The offset must be point into the variable area.\r\nre(lated to): env_insVarOffset\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): \\endlist integer SUPPL error code\\newline\r\n\t\\item \\tok{ESUPPL_OK}: success\r\n\t\\item\\tok{ESUPPL_INVENV}: corrupted environment\r\n\t\\item\\tok{ESUPPL_NOMEM}: environment too small\r\n\t\\item\\tok{ESUPPL_NOENV}: no environment at all\r\nfi(le): env_ovrw.c\r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"errcodes.h\"\r\n#include \"environ.loc\"\r\n#include \"fmemory.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint env_ovrVarOffset(word segm, word ofs, const char *var\r\n , const char * const value)\r\n{\tint ch;\r\n\tint lenO, lenON, lenN, lenV, lenG;\r\n\r\n\tDBG_ENTER(\"env_ovrVarOffset\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u, ofs=%u, var=\\\"%s\\\", value=\\\"%s\\\"\", segm, ofs, var, value) )\r\n\r\n\tchkMem\r\n\t\r\n\tunless_segm(segm)\r\n\t\tDBG_RETURN_I( ESUPPL_NOENV)\r\n\r\n\tDBG_ARGUMENTS( (\"effective env=%u\", segm) )\r\n\r\n\tif(!value) {\t\t/* delete variable */\r\n\t\tenv_subVarOffset(segm, ofs);\r\n\t\tchkMem\r\n\t\r\n\t\tDBG_RETURN_I( ESUPPL_OK)\r\n\t}\r\n\r\n\tlenON = 0;\t\t/* keep the length of the var name for later when\r\n\t\t\t\t\t\tthe total length of the variable is checked to\r\n\t\t\t\t\t\tNOT exceed 32KB */\r\n\r\n\tif(!var) {\t\t/* keep the current variable name */\r\n\t\t/* skip until the '=' sign is found */\r\n\t\twhile((ch = peekb(segm, ofs)) != '=') {\r\n\t\t\t++ofs;\r\n\t\t\t++lenON;\r\n\t\t\tif(!ch)\t\t\t/* env corrupt */\r\n\t\t\t\tDBG_RETURN_I( ESUPPL_INVENV)\r\n\t\t}\r\n\t\tvar = \"\";\t\t/* the name is preserved */\r\n\t}\r\n\r\n\t/* Moved assignments before if():\r\n\t\tAggressive compiler optimizations may cause parts of this\r\n\t\tstatement to not be calculated. -- 2000/0705 Ron Cemer */\r\n\tlenO = env_varlen(segm, ofs);\r\n\tlenG = (lenN = strlen(var)) + (lenV = strlen(value)) + 2;\r\n\tif(lenG + lenON < 0\t\t\t\t/* single var may not exceed 32KB */\r\n\t || (lenO < lenG\t\t\t\t/* will consume more space */\r\n\t  && env_freeCount(segm) <= lenG - lenO))\t/* not enough memory */\r\n\t \tDBG_RETURN_I( ESUPPL_NOMEM)\r\n\r\n\t/* adjust the following variable(s) and the string area */\r\n\tif(lenG != lenO)\r\n\t\t_fmemmove(MK_FP(segm, ofs + lenG), MK_FP(segm, ofs + lenO)\r\n\t\t , env_firstFree(segm) - (ofs + lenO));\r\n\r\n\tchkMem\r\n\tif(lenN)\r\n\t\t_fmemcpy(MK_FP(segm, ofs), TO_FP(var), lenN);\r\n\tchkMem\r\n\tpokeb(segm, ofs + lenN, '=');\r\n\tchkMem\r\n\t_fmemcpy(MK_FP(segm, ofs + lenN + 1), TO_FP(value), lenV + 1);\r\n\tchkMem\r\n\r\n\tDBG_RETURN_I( ESUPPL_OK)\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_repl.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/*  $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_replace\r\nsu(bsystem): env\r\nty(pe): \r\nsh(ort description): Replace an environment by another one\r\nlo(ng description): Replaces or moves one environment to another one.\r\n\tThe following modes control various features:\r\n\t\\item\\tok{ENV_DELETE}: Remove environment \\para{env} on success\r\n\t\\item\\tok{ENV_COPY}: Copy the contents of the old environment into the\r\n\tnew one. If the size of the new environment is less than the size of the\r\n\told one, the contents could be destroyed.\r\n\t\\item\\tok{ENV_CLEAR}: Initialize the new environment to contain no\r\n\tvariables and no strings. \\tok{ENV_COPY} superceeds this flag.\r\n\t\\item\\tok{ENV_CREATE}: Create a new environment of the length specified as\r\n\tthe third argument. If this flag is not\r\n\tset, the third parameter specifies an already created environment to\r\n\tbe used.\r\n\t\\item\\tok{ENV_FREECOUNT}: Only applicable if \\tok{ENV_CREATE} is set. The\r\n\tthird argument specifies the amount of bytes that shall be unused in\r\n\tthe new environment after copying the old one, if necessary. This flag\r\n\tis supperceeded by \\tok{ENV_LIMITED}.\r\n\t\\item\\tok{ENV_LIMITED}: Only applicable if \\tok{ENV_CREATE} is set. The\r\n\tlength of the new environment is choosen as the lowest possible number.\r\n\tThe third argument is ignored and need not to be specified at all.\r\n\t\\nolist\r\n\tTo duplicate an environment one can use:\r\n\t\\example{|}\r\n\t|newEnv = env_replace(oldEnv? oldEnv: env_glbSeg\r\n\t|\t, ENV_CREATE | ENV_FREECOUNT | ENV_COPY, 0)\r\n\tor\r\n\t\\example{|}\r\n\t|newEnv = env_replace(oldEnv? oldEnv: env_glbSeg\r\n\t|\t, ENV_CREATE | ENV_LIMITED | ENV_COPY)\r\n\tThe first example creates an environment with the same size as the old\r\n\tone; the second one uses the smallest possible size to fit the old\r\n\tcontents in.\\newline\r\n\tIf the \\tok{?:} construct is not used to pass the old environment into\r\n\tthe function \\em{and} \\tok{\\para{oldEnv} == 0}, \\tok{env_replace()}\r\n\twill also change the default segment to the newly created one. Unless the\r\n\t\\tok{ENV_DELETE} flag is set, this could leave the old environment\r\n\tinaccessable within memory wasting resources.\r\npr(erequistes): \r\nre(lated to): env_create env_delete\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): \\tok{0}: on failure: errno is assigned\r\n\t\\list \\tok{ENXIO}: if no source environment could be identified\r\n\t\t\\item \\tok{ENOMEM}: could not allocated enough memory\r\n\t\t\\item \\tok{E2BIG}: destination environment exceeds 64KB\r\n\t\t\\item \\tok{EINVAL}: specified destination environment segment is not present\r\n\t\t\\item \\tok{EEXIST}: source and destination environment are equal\r\n\t\\endlist\r\n\t\\item else: new environment\r\nfi(le): env_repl.c\r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"mcb.h\"\r\n#include \"suppl.h\"\r\n#include \"environ.loc\"\r\n#include \"fmemory.h\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\n#ifdef _MICROC_\r\nregister wor env_replace(word XOenv /*, int mode, unsigned segm/length*/)\r\n#else\r\n#include <stdarg.h>\r\nword env_replace(word Oenv, int mode, ...)\r\n#endif\r\n{\tunsigned env, segm;\r\n\tDBG_ENTER1\r\n#define length segm\r\n\r\n#ifdef _MICROC_\r\n\tunsigned Oenv, mode;\r\n\r\n\tenv = nargs() * 2 + &XOenv;\r\n\tOenv = *(unsigned *)env;\r\n\tmode = ((unsigned *)env)[1];\r\n\tsegm = ((unsigned *)env)[2];\r\n#else\r\n\t{\r\n\t\tva_list ap;\r\n\t\tva_start(ap, mode);\r\n\t\tsegm = va_arg(ap, unsigned);\r\n\t\tva_end(ap);\r\n\t}\r\n#endif\r\n\r\n\tDBG_ENTER2(\"env_replace\", \"env\")\r\n\tDBG_ARGUMENTS( (\"env=%u, mode=0x%x, segm/length=%u\", Oenv, mode, segm) )\r\n\r\n\tchkMem\r\n\r\n\tunless_Xsegm(env, Oenv) {\r\n\t\teno_set(ENXIO);\r\n\t\tDBG_RETURN_U( 0)\t\t/* no source environment */\r\n\t}\r\n\r\n\tDBG_ARGUMENTS( (\"effective env=%u\", env) )\r\n\r\n\tif(mode & ENV_CREATE) {\t\t/* create a new environment */\r\n\t\tif(mode & ENV_LIMITED)\r\n\t\t\tlength = env_firstFree(env);\r\n\t\telse if(mode & ENV_FREECOUNT) {\r\n\t\t\tif(addu(&length, env_firstFree(env))) {\r\n\t\t\t\teno_set(E2BIG);\r\n\t\t\t\tDBG_RETURN_U( 0)\r\n\t\t\t}\r\n\t\t}\r\n\t\tif((segm = env_create(length)) == 0)\r\n\t\t\tDBG_RETURN_U( 0)\r\n\t}\r\n\telse {\t\t\t\t\t\t/* the 3rd argument is a segment */\r\n\t\tunless_segm(segm) {\r\n\t\t\teno_set(EINVAL);\r\n\t\t\tDBG_RETURN_U( 0)\r\n\t\t}\r\n\t\tif(segm == env) {\r\n\t\t\teno_set(EEXIST);\r\n\t\t\tDBG_RETURN_U( 0)\r\n\t\t}\r\n\t}\r\n\tassert(segm);\r\n\tassert(env);\r\n\r\n\tchkMem\r\n\t\r\n\tif(mode & ENV_COPY)\r\n#ifndef _MICROC_\r\n#ifdef min\r\n#undef min\r\n#endif\r\n#define min(a,b) (((a)<(b))?(a):(b))\r\n#endif\r\n\t\t_fmemcpy(MK_FP(segm, 0), MK_FP(env, 0)\r\n\t\t , min(mcb_length(segm), mcb_length(env)));\r\n\telse if(mode & ENV_CLEAR)\r\n\t\tENV_CLEAR_SEGM(segm);\t\t/* the first 3 bytes must be zero */\r\n\r\n\tchkMem\r\n \t/* Update other global references by the new segment. If DELETE is\r\n \t\tenabled, delete() won't find the old references anymore, thus,\r\n \t\tkeeps the new segments in those references */\r\n \tif(!Oenv)\r\n \t\tenv_relocateSegment(env, segm);\r\n \t\r\n\tchkMem\r\n\t\r\n\tif(mode & ENV_DELETE)\r\n\t\tenv_delete(env);\r\n\r\n\tchkMem\r\n\t\r\n\tDBG_RETURN_U( segm)\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_rlsg.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_relocateSegment\r\nsu(bsystem): env\r\nty(pe): \r\nsh(ort description): Update relocated environment segments\r\nlo(ng description): Updates other global variables, such as \\tok{env_glbSeg}\r\n\tand \\tok{env_dfltSeg}, that a segment has been changed. Deleted\r\n\tsegments are called with \\tok{tosegm == 0}.\r\npr(erequistes): segm != 0\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nva(lue): none\r\nfi(le): env_del.c\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"environ.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid env_relocateSegment(const word segm, const word tosegm)\r\n{\r\n\tDBG_ENTER(\"env_relocateSegment\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u to=%u\", segm, tosegm) )\r\n\r\n\tassert(segm);\r\n\r\n\t/* Make sure the deleted segment won't be referenced */\r\n\tif(segm == env_glbSeg) {\r\n\t\tenv_setGlbSeg(tosegm);\r\n\t\tDBG_INFO((\"Change global segment: %04x -> %04x\", segm, tosegm))\r\n\t}\r\n\tif(segm == env_dfltSeg) {\r\n\t\tenv_setDfltSeg(tosegm);\r\n\t\tDBG_INFO((\"Change default segment: %04x -> %04x\", segm, tosegm))\r\n\t}\r\n\r\n\tDBG_EXIT\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_scnt.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_stringcounter\r\nsu(bsystem): env\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Modify and return the counter of environment strings\r\nhe(ader files): \r\nlo(ng description): Adds \\para{diff} to the current number of environment\r\n\tstrings and return the result.\r\npr(erequistes): \r\nva(lue): 0: No environment (ENXIO) or no string (EZERO)\\item else: Number of strings\r\nre(lated to): env_string\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include \"environ.loc\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint env_strcounter(word segm, int diff)\r\n{\tword cntOfs;\r\n\r\n\tDBG_ENTER(\"env_strcounter\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u, diff=%d\", segm, diff) )\r\n\r\n\tchkMem\r\n\t\r\n\tunless_segm(segm) {\r\n\t\teno_set(ENXIO);\r\n\t\tDBG_RETURN_I( 0)\r\n\t}\r\n\r\n\tDBG_ARGUMENTS( (\"effective env=%u\", segm) )\r\n\r\n\tdiff += peekw(segm, cntOfs = env_endOfVars(segm) + 1);\r\n\tif(!diff) eno_set(EZERO);\r\n\tpokew(segm, cntOfs, diff);\r\n\r\n\tDBG_RETURN_U( diff)\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_sdup.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_strdup\r\nsu(bsystem): env\r\nty(pe): H\r\nsy(nopsis): \r\nsh(ort description): Duplicate an environment string into the heap\r\nhe(ader files): \r\nlo(ng description): Duplicates an environment string into the\r\n\theap. The string must be deallocated by the user.\r\npr(erequistes): \r\nva(lue): \\tok{NULL}: on failure; errno is assigned\r\n\t\t\\list \\tok{ENXIO}: no environment found\r\n\t\t\t\\tok{ENOENT}: no such string (string number too high)\r\n\t\t\t\\tok{ENOMEM}: out of memory\r\n\t\t\\endlist\r\n\t\\item else: pointer to allocated string\r\nre(lated to): env_string\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#include <dos.h>\r\n#include <stdlib.h>\r\n#endif\r\n#include \"environ.loc\"\r\n#include \"fmemory.h\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *env_strdup(word segm, const int index)\r\n{\tchar *buf;\r\n\tword ofs;\r\n\tunsigned length;\r\n\r\n\tDBG_ENTER(\"env_strdup\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u, idx=%d\", segm, index) )\r\n\r\n\tchkMem\r\n\r\n\tunless_segm(segm) {\r\n\t\teno_set(ENXIO);\r\n\t\tDBG_RETURN_S( 0)\t\t\t\t\t\t/* no environment at all */\r\n\t}\r\n\r\n\tDBG_ARGUMENTS( (\"effective env=%u\", segm) )\r\n\r\n\tif((ofs = env_string(segm, index)) == 0 ||\r\n\t    ofs == env_firstFree(segm)) {\r\n\t\teno_set(ENOENT);\r\n\t\tDBG_RETURN_S( 0)\t\t\t\t\t\t/* string number too high */\r\n\t}\r\n\r\n\tchkHeap\r\n\tif((buf = eno_malloc(length = env_varlen(segm, ofs))) != 0)\r\n\t\t_fmemcpy(TO_FP(buf), MK_FP(segm, ofs), length);\r\n\r\n\tchkHeap\r\n\tDBG_RETURN_S( buf)\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_size.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_resize\r\nsu(bsystem): env\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Resize an environment\r\nhe(ader files): \r\nlo(ng description): Resizes an environment by the amount of bytes\r\n\tspecified via \\para{delta}. The contents is retained, except if the\r\n\tenvironment shrinks below the last used byte.\\par\r\n\tIf \\tok{\\para{delta} == 0}, the length of the environment\r\n\tis returned rather than its address. The environment itself remains\r\n\tunchanged.\\par\r\n \tIf the block shrinks below the currently first free byte limit or\r\n \tthe block must be moved, the global variable \\tok{env_resizeCtrl} controls\r\n \tvarious special modes.\\par\r\n \tIf the block is resized below the first free byte limit, the\r\n \tcontents of the environment is most probably destroyed and should\r\n \tbe totally cleared before it is used.\r\npr(erequistes): \r\nva(lue): 0: on failure; out-of-memory (ENOMEM), if EZERO, \\tok{\\para{delta} == 0} and\r\n\tthe length of the source environment is zero\r\n\t\\item else: if \\tok{\\para{delta} == 0}, the\r\n\tsize of the environment segment; otherwise the possibly new\r\n\tsegment address of the environment\r\nre(lated to): env_resizeCtrl env_setsize\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers):\r\n\r\nob(ject): env_setsize\r\nsu(bsystem): env\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Set the size of an environment\r\nhe(ader files): \r\nlo(ng description): Resizes an environment to the amount of bytes\r\n\tspecified via \\para{newLength}. The contents is retained, except if the\r\n\tenvironment shrinks below the last used byte.\\par\r\n\tIf \\tok{\\para{newLength} == 0}, the environment segment is deallocated.\\par\r\n\tSee \\tok{env_resize} for more information.\r\npr(erequistes): \r\nva(lue): 0: on out-of-memory (ENOMEM) or environment was deleted (EZERO)\\item else: \r\n\t the possibly new segment address of the environment\r\nre(lated to): env_resizeCtrl env_resize\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers):\r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"environ.loc\"\r\n#include \"mcb.h\"\r\n#include \"suppl.h\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nword env_setsize(word Osegm, unsigned newLength)\r\n{\tunsigned segm, length;\r\n\r\n\tDBG_ENTER(\"env_setsize\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u, new length=%u\", Osegm, newLength) )\r\n\r\n\tchkMem\r\n\r\n\tif(newLength == 0) {\t\t/* remove segment */\r\n\t\tenv_delete(Osegm);\r\n\t\teno_set(EZERO);\r\n\t\tDBG_RETURN_I( 0)\r\n\t}\r\n\r\n \tenv_Xsegm(segm, Osegm);\r\n \tlength = mcb_length(segm);\t\t/* returns 0 on segm == 0 */\r\n\r\n\r\n\tDBG_ARGUMENTS( (\"effective env=%u, cur len=%u\", segm, length) )\r\n\r\n\tif(length > newLength) {\t\t/* shrink the block */\r\n\t\t/* Because length > newLength > 0 --> segm != 0 */\r\n\t\tDBG_STRING(\"Shrink block\")\r\n\t\tlength = env_firstFree(segm);\r\n\t\tresizeBlk(segm, (length > newLength\r\n\t\t\t\t && !(env_resizeCtrl & ENV_SHRINKBELOW))\r\n\t\t  ? length\t\t/* don't shrink below last used byte */\r\n\t\t  : newLength);\r\n\t\t/* shrinking cannot fail --> ignore return value */\r\n\t}\r\n \telse if(length != newLength) {\r\n \t\tif(segm) {\r\n \t\t\t DBG_STRING(\"Grow block\")\r\n \t\t\t if(resizeBlk(segm, newLength)) {\r\n \t\t\t\t /* Grow failed --> try to allocate a new block */\r\n \t\t\t \tif(!(env_resizeCtrl & ENV_ALLOWMOVE)) {\r\n \t\t\t \t\t\t/* fail as to allocate is not allowed */\r\n \t\t\t \t\teno_set(ENOMEM);\r\n \t\t\t \t\tDBG_RETURN_U(0)\t\r\n\t\t\t\t}\r\n \t\t\t\tsegm = env_replace(Osegm\r\n \t\t\t\t\t  , ENV_DELETE | ENV_COPY | ENV_CREATE, newLength);\r\n \t\t\t \t\t/* On success, the replace() function already updates\r\n \t\t\t \t\t\tglbSeg or dfltSeg if applicable */\r\n \t\t\t }\r\n \t\t} else {\r\n \t\t\tDBG_STRING(\"Create new environment\")\r\n \t\t\tif((segm = env_create(newLength)) != 0) {\r\n \t\t\t\t/* This point is reached only, if setsize() has been called\r\n \t\t\t\t\twith Osegm == dlftSeg == glbSeg == 0.\r\n \t\t\t\t\tTherefore it is assumed that the global segment is to\r\n \t\t\t\t\tbe set */\r\n \t\t\t\tenv_setGlbSeg(segm);\r\n \t\t\t\tDBG_INFO((\"New global environment: %04x\", segm))\r\n  \t\t\t}\r\n  \t\t}\r\n  \t}\r\n\tchkMem\r\n\tDBG_RETURN_U( segm)\t\t/* return the segment address */\r\n}\r\n\r\nword env_resize(word segm, int delta)\r\n{\tunsigned length;\r\n\r\n\tDBG_ENTER(\"env_resize\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u, delta=%d\", segm, delta) )\r\n\r\n\tlength = mcb_length(env_segment(segm));\r\n\r\n\tif(delta == 0) {\t/* it's a request of the current length */\r\n\t\teno_set(EZERO);\r\n\t\tDBG_RETURN_U( length)\r\n\t}\r\n\r\n\t/* honor the arethmetic (int) warp in the expressions */\r\n\tif(delta < 0)\t\t/* shrink block */\r\n\t\tDBG_RETURN_BU( env_setsize(segm, length <= -delta? 0: length + delta))\r\n\r\n\t/* grow block */\r\n\tDBG_RETURN_BU( env_setsize(segm\r\n\t , inM(65535, 65535U) - length < (unsigned)delta? inM(65535, 65535U)\r\n\t \t: length + (unsigned)delta))\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_strg.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_string\r\nsu(bsystem): env\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Return the address of an environment string\r\nhe(ader files): \r\nlo(ng description): Returns the offset of a string into the specified\r\n\tenvironment.\\par\r\n\tIf \\tok{index == env_strings()}, the first unused byte behind the last\r\n\tstring is returned.\r\npr(erequistes): \r\nva(lue): 0: on failure; index too large (ENOENT) or no environment (ENXIO)\r\n\t\\item else: offset of string\r\nre(lated to): env_stringcounter\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers):\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include \"environ.loc\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nword env_string(word segm, int index)\r\n{\tword ofs;\r\n\r\n\tDBG_ENTER(\"env_string\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u, idx=%d\", segm, index) )\r\n\r\n\tchkMem\r\n\tunless_segm(segm) {\r\n\t\teno_set(ENXIO);\r\n\t\tDBG_RETURN_I( 0)\r\n\t}\r\n\r\n\tDBG_ARGUMENTS( (\"effective env=%u\", segm) )\r\n\r\n\t/* the string number \"index\" maybe equal to the number of\r\n\t\tstrings, in which case the proper position of a new string\r\n\t\tis to be returned. */\r\n\tif(peekw(segm, ofs = 1 + env_endOfVars(segm)) < index) {\r\n\t\teno_set(ENOENT);\r\n\t\tDBG_RETURN_I( 0)\t\t/* string number too high */\r\n\t}\r\n\r\n\tofs += 2;\t\t\t\t/* 1st string */\r\n\twhile(index--)\t\t/* skip current string */\r\n\t\tofs += env_varlen(segm, ofs);\r\n\r\n\tDBG_RETURN_I( ofs)\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_sub.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\r\nob(ject): env_subVarOffset\r\nsu(bsystem): env\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Remove an environment variable\r\nhe(ader files): \r\nlo(ng description): Removes the environment variable at a\r\n\tspecified offset\r\npr(erequistes): \\tok{\\para{segm} != 0}\r\n\t\\item \\para{offset} must point into the variables area of the\r\n\tenvironment\r\nva(lue): none\r\nre(lated to): env_insVarOffset env_ovrVarOffset env_change\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers):\r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"environ.h\"\r\n#include \"fmemory.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nvoid env_subVarOffset(word segm, word offset)\r\n{\tregister unsigned moveStart;\r\n\r\n\tDBG_ENTER(\"env_subVarOffset\", Suppl_env)\r\n\tDBG_ARGUMENTS( (\"env=%u, ofs=%u\", segm, offset) )\r\n\r\n\tchkMem\r\n\tassert(segm);\r\n\tassert(offset < env_endOfVars(segm));\r\n\r\n\tmoveStart = offset + env_varlen(segm, offset);\r\n\r\n\t_fmemmove(MK_FP(segm, offset), MK_FP(segm, moveStart),\r\n\t\tenv_firstFree(segm) - moveStart);\r\n\tchkMem\r\n\r\n\tDBG_EXIT\r\n}\r\n"
  },
  {
    "path": "suppl/src/env_var1.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): env_resizeCtrl\r\nsu(bsystem): \r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Controls how the \\subsys{env} internally works\r\nhe(ader files): \r\nlo(ng description): This variable contains a \\tok{'|'} combination of the\r\n\tfollowing macros, defined in ENVIRON.H:\r\n\t\\item \\tok{ENV_SHRINKBELOW}: allows to resize the environment segment\r\n\t\tbelow its last used byte (will destroy environment,\r\n\t\tis necessary to delete env)\r\n\t\\item \\tok{ENV_ALLOWMOVE}: allows to relocate environment segment\r\n\t\tif to grow it fails (meaning to move it into another memory\r\n\t\tsegment)\r\n\t\\item \\tok{ENV_USEUMB}: when the environment segment is relocated, search\r\n\t\tin the UMBs first\r\n\t\\item \\tok{ENV_FIRSTFIT}: when the environment segment is relocated,\r\n\t\t use the memory allocation strategy \\em{First Fit}\r\n\t\\item \\tok{ENV_LASTFIT}: when the environment segment is relocated,\r\n\t\tuse the memory allocation strategy \\em{Last Fit}\r\n\t\\item If both \\tok{ENV_FIRSTFIT} and \\tok{ENV_LASTFIT} are set,\r\n\t\tthe behaviour is undefined\r\n\t\\item If neither \\tok{ENV_FIRSTFIT} nor \\tok{ENV_LASTFIT} are set,\r\n\t\t\t \\em{Best Fit} is used\r\n\t\\nolist\r\n\tThe default settings are: deny shrinking & moving, use UMBs, best fit\r\npr(erequistes): \r\nva(lue): none\r\nre(lated to): env_resize env_setsize\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static; may be changes any time by the user directly\r\nwa(rning): \r\nbu(gs): \r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include \"environ.h\"\r\n\r\nunsigned env_resizeCtrl = ENV_USEUMB;\t/* control flags */\r\n"
  },
  {
    "path": "suppl/src/env_var2.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): suppl_dfltEnvSegm\r\nsu(bsystem): \r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): default environment for SUPPL\r\nhe(ader files): \r\nlo(ng description): All functions of \\subsys{env}, that accept a \\tok{0]\r\n\tas environment segment, first use \\tok{env_dfltSeg} first,\r\n\t\\tok{env_glbSeg} then. The variable \\tok{suppl_dfltEnvSegm} contains\r\n\tthe value read by \\tok{env_dfltSeg} and written by \\tok{env_setDfltSeg}.\r\n\tThis variable is also automatically updated by functions, that delete\r\n\tor relocate an environment segments.\\par\r\n\tdefault: \\tok{0}\r\npr(erequistes): \r\nva(lue): none\r\nre(lated to): env_dfltSeg env_setDfltSeg\r\nse(condary subsystems): \r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): static; may be changes any time by the user directly\r\nwa(rning): \r\nbu(gs): \r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include \"environ.h\"\r\n\r\nword suppl_dfltEnvSegm = 0;\r\n"
  },
  {
    "path": "suppl/src/environ.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tEnvironment functions.\r\n\tInternal header file.\r\n\r\n*/\r\n\r\n#ifndef __ENVIRON_LOC\r\n#define __ENVIRON_LOC\r\n\r\n#include <assert.h>\r\n#include \"environ.h\"\r\n\r\n/* env_segm(segm) <->\r\n\t\tsegm := segm || env_dfltSeg || env_glbSeg\r\n\r\n \tAssigns & returns the target environment segment of variable segm\r\n */\r\n#define env_segment(segm)\t((segm)? (segm)\t\t\t\t\t\t\t\\\r\n\t\t\t\t\t\t\t\t\t: env_dfltSeg? env_dfltSeg\t\t\\\r\n\t\t\t\t\t\t\t\t\t: env_glbSeg)\r\n#define env_segm(segm)\t((segm) = env_segment((segm)))\r\n\r\n/* if-no-environment-segment macro */\r\n#define unless_segm(segm)\tif(!(segm)\t\t\t\t\t\t\t\t\\\r\n\t\t\t\t\t\t\t\t\t&& ((segm) = env_dfltSeg) == 0\t\\\r\n\t\t\t\t\t\t\t\t\t&& ((segm) = env_glbSeg) == 0)\r\n\r\n/* The Xsegm variants take the initial value of segm as a second parameter */\r\n#define env_Xsegm(segm,orgSeg)\t((segm) = env_segment(orgSeg))\r\n\r\n/* if-no-environment-segment macro */\r\n#define unless_Xsegm(segm,orgSeg)\tif(((segm) = (orgSeg)) == 0\t\t\t\\\r\n\t\t\t\t\t\t\t\t\t&& ((segm) = env_dfltSeg) == 0\t\t\\\r\n\t\t\t\t\t\t\t\t\t&& ((segm) = env_glbSeg) == 0)\r\n\r\n\r\n#define ENV_CLEAR_SEGM(segm)\tpoked((segm), 0, 0)\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/erfc_00f.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* DON'T MODIFY THIS FILE!\r\n\r\n\tThis is an auto-generated file (by mkerrfct.pl), don't\r\n\tmodify because next time the script runs, your modifications\r\n\tare lost.\r\n\r\n\tDefines one of the default error functions.\r\n*/\r\n\r\n#include \"msgs.loc\"\r\n#include \"msgs.lng\"\r\n\r\nvoid Esuppl_noMem(void)\r\n{\r\n\terror0(E_noMem);\r\n\r\n}\r\n"
  },
  {
    "path": "suppl/src/erfc_015.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* DON'T MODIFY THIS FILE!\r\n\r\n\tThis is an auto-generated file (by mkerrfct.pl), don't\r\n\tmodify because next time the script runs, your modifications\r\n\tare lost.\r\n\r\n\tDefines one of the default error functions.\r\n*/\r\n\r\n#include \"msgs.loc\"\r\n#include \"msgs.lng\"\r\n\r\nvoid Esuppl_openFile(const char * const fnam)\r\n{\r\n\terror(E_openFile, fnam);\r\n\r\n}\r\n"
  },
  {
    "path": "suppl/src/ffmaxbuf.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Fmaxbuf\r\nsu(bsystem): supplio\r\nty(pe): H\r\nsh(ort description): Allocate a large chunk of memory\r\npr(erequistes): buf != NULL && len != NULL\r\nva(lue): \\tok{0}: on success; \\tok{*buf} := pointer to dynamically allocated\r\n\tbuffer, \\tok{*len} := length of the buffer\r\n\t\\item else: on failure\r\nre(lated to): \r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#endif\r\n#include \"supplio.loc\"\r\n#include \"eno.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint Fmaxbuf(byte ** const Xbuf, size_t * const Xlen)\r\n{\tbyte *buf;\r\n\tsize_t len;\r\n\r\n\tDBG_ENTER(\"Fmaxbuf\", Suppl_supplio)\r\n\r\n\tassert(Xbuf);\r\n\tassert(Xlen);\r\n\r\n\tlen = 32 * 1024u;\t\t\t/* try to allocate 32KB */\r\n\tchkHeap\r\n\twhile((buf = malloc(len)) == 0)\r\n\t\tif((len >>= 1) < 16) {\r\n\t\t\teno_set(ENOMEM);\r\n\t\t\tDBG_RETURN_I( 1)\t\t\t/* out of memory */\r\n\t\t}\r\n\r\n\t*Xbuf = buf;\r\n\t*Xlen = len;\r\n\r\n\tchkHeap\r\n\tDBG_RETURN_VALUES( (\"buf=%p, len=%u\", buf, len) )\r\n\tDBG_RETURN_I( 0)\r\n}\r\n"
  },
  {
    "path": "suppl/src/fgetpos.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): fgetpos\r\nsu(bsystem): portable\r\nty(pe): S\r\nsh(ort description): ISO9899 compatible \\tok{fgetpos()} function\r\nlo: ISO9899 compatible \\tok{fgetpos()} function to aquire the\r\n\tcurrent stream position into a \\tok{(fpos_t)} structure.\r\npr(erequistes): stream != NULL && pos != NULL\r\nva(lue): 0: on succes\\item else: on failure\r\nre(lated to): fsetpos FFgetpos\r\nse(condary subsystems): supplio\r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): Pacific HiTech C only\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifdef _PAC_NOCLIB_\r\n#include \"supplio.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\n\r\nint fgetpos(FILE * const stream, fpos_t * const pos)\r\n{\tlong p;\r\n\r\n\t/* The description of ftell() suggests that this function never\r\n\t\tfails?! */\r\n\tif((p = ftell(stream)) == -1l)\r\n\t\treturn 1;\r\n\r\n\t*pos = p;\r\n\treturn 0;\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/file_id.diz",
    "content": "This package contains: SUPPL a supplemental library written by\r\n\t\tCopyright (C) 1995-98 Steffen Kaiser\r\n\t\tRelease Version 2.7\r\n\r\nAlso included are:\r\n\t- a patched version of DMAKE v4.00\r\n\t- the utilities: RM, MSGCOMP, _XSET, FOREACH\r\n"
  },
  {
    "path": "suppl/src/filefind.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile: FILEFIND.C $\r\n   $Locker: ska $\t$Name:  $\t$State: Exp $\r\n\r\nob(ject): findfirst\r\nsu(bsystem): portable\r\nty(pe): \r\nsh(ort description): Initiate a file search loop\r\nlo(ng description): Initiates a file search loop.\\par\r\n\tThis function returns the first entry matching the specified\r\n\tpattern within a directory and initializes the structure \\para{ff}\r\n\tthat subsequent calls to \\tok{findnext()} will enumerate all\r\n\tentries matching the pattern.\r\n\t\\example{|}\r\n\t|struct ffblk ff;\r\n\t|int done;\r\n\t|\r\n\t|done = findfirst(pattern, aF(ff), attributes);\r\n\t|while(!done) {\r\n\t|\t// do something with the values of the structure ff\r\n\t|\tdone = findnext(aF(ff));\r\n\t|}\r\npr(erequistes): ff != NULL && pattern != NULL\r\nva(lue): 0: on success\\item else: OS error code (usually interpreted as\r\n\t\"no more matching entries\")\r\nre(lated to): findnext\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): Pacific HiTech C only\r\n\r\nob(ject): findnext\r\nsu(bsystem): portable\r\nty(pe): \r\nsh(ort description): Continue a directory enumeration loop\r\nlo(ng description): Continues a directory enumeration loop;\r\n\tfor more details see function \\tok{findfirst()}.\r\npr(erequistes): ff != NULL\r\nva(lue): 0: on success\\item else: OS error code (usually interpreted as\r\n\t\"no more matching entries\")\r\nre(lated to): findfirst\r\nse(condary subsystems): \r\nin(itialized by): findfirst\r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): Pacific HiTech C only\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#if defined(_PAC_NOCLIB_) || defined(__GNUC__)\r\n#include \"suppl.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id: FILEFIND.C 1.5 1999/12/13 02:23:13 ska Exp ska $\";\r\n#endif\r\n\r\nint findfirst(const char * const pattern, struct ffblk *ff, int attrib)\r\n{\tvoid far *dta;\r\n\tIREGS r;\r\n\tint rv;\r\n\r\n\t/* DOS uses the DTA to store the internal search data to.\r\n\t\tThe usual implementation of find*() keeps the first\r\n\t\t21 bytes of the DTA or simply hope that no DOS will use\r\n\t\tmore than 21 byte and point the DTA directly on the\r\n\t\tsearch data buffer. */\r\n\tdta = getdta();\r\n\tsetdta((void far*)ff);\r\n\tr.r_dx = FP_OFF(pattern);\r\n\tr.r_ds = FP_SEG(pattern);\r\n\tr.r_cx = attrib;\r\n\tr.r_ax = 0x4e00;\r\n\trv = invokeDOS(&r);\r\n\r\n\tsetdta(dta);\r\n\r\n\treturn rv;\r\n}\r\n\t\r\nint findnext(struct ffblk *ff)\r\n{\tvoid far *dta;\r\n\tIREGS r;\r\n\tint rv;\r\n\r\n\tdta = getdta();\r\n\tsetdta((void far*)ff);\r\n\tr.r_ax = 0x4f00;\r\n\trv = invokeDOS(&r);\r\n\r\n\tsetdta(dta);\r\n\r\n\treturn rv;\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/fmemchr.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): _fmemchr\r\nsu(bsystem): farmem\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Search a far string for a character\r\nhe(ader files): \r\npr(erequistes): pointer must not be \\tok{NULL}\r\nva(lue): 0: value not found\\item else: offset of first occurence of character\r\nre(lated to): \r\nse(condary subsystems): portable\r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): If \\tok{offset == 0} and the character is located at the first\r\n\tposition of the string, \\tok{0} is returned, too.\r\nco(mpilers): Micro-C only\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifdef _MICROC_\r\n#include <portable.h>\r\n\r\nunsigned _fmemchr(unsigned const seg, unsigned ofs, const unsigned value, unsigned length)\r\n{\tunsigned char v, i;\r\n\r\n\twhile(v = value; length--;)\r\n\t\tif(peekb(seg, ofs) == v)\r\n\t\t\treturn ofs;\r\n\t\telse if(!++ofs) break;\r\n\r\n\treturn 0;\r\n}\r\n\r\n#else\r\n#if defined(_TC_EARLY_)\r\n#include <portable.h>\r\n#include \"fmemory.h\"\r\n\r\nchar far *_fmemchr(const char far* const s, int ch, unsigned length)\r\n{\tconst byte far *p;\r\n\r\n\tfor(p = (const byte far*)s; length--; ++p)\r\n\t\tif(*p == ch)\r\n\t\t\treturn (char far*)p;\r\n\r\n\treturn 0;\r\n}\r\n\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/fmemcmp.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): _fmemcmp\r\nsu(bsystem): farmem\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Compare two far memory areas\r\nhe(ader files): \r\npr(erequistes): pointers must not be equal to \\tok{NULL}\r\nva(lue): \r\n\t \\tok{== 0}: both areas are equal\r\n\t\\item \\tok{> 0}: 1st area > 2nd area\r\n\t  \\item \\tok{< 0}: 1st area < 2nd area\r\nre(lated to): memcmp _fmemicmp\r\nse(condary subsystems): portable\r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): Micro-C and Pacific HiTech C\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifdef _MICROC_\r\n#include <portable.h>\r\n\r\nint _fmemcmp(unsigned const dseg, unsigned dofs\r\n , unsigned const sseg, unsigned sofs, unsigned length)\r\n{\tint d;\r\n\r\n\tif(!length)\r\n\t\treturn 0;\r\n\r\n\twhile((d = peekb(dseg, dofs++) - peekb(sseg, sofs++)) == 0 && --length);\r\n\r\n\treturn d;\r\n}\r\n\r\n#else\r\n\r\n#if defined(_PAC_NOCLIB_) || defined(_TC_EARLY_)\r\n#include <portable.h>\r\n#include \"fmemory.h\"\r\n\r\nint _fmemcmp(const void far * const s1, const void far * const s2\r\n\t, unsigned length)\r\n{\tconst byte far *p;\r\n\tconst byte far *q;\r\n\tint d;\r\n\r\n\tif(!length)\r\n\t\treturn 0;\r\n\r\n\tp = s1;\r\n\tq = s2;\r\n\twhile((d = *p++ - *q++) == 0 && --length);\r\n\treturn d;\r\n}\r\n#endif\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/fmemcpy.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): _fmemcpy\r\nsu(bsystem): farmem\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Copy a far memory areas onto another\r\nlo: Copies one far memory area onto another one, the destination\r\n\tarea must be at least \\para{length} bytes long.\\par\r\n\tIf both areas overlap themselves, the behaviour is undefined.\r\nhe(ader files): \r\npr(erequistes): pointers must not be equal to \\tok{NULL}\r\nva(lue): none\r\nre(lated to): memcpy _fmemmove\r\nse(condary subsystems): portable\r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): Both areas must not overlap each other.\r\nbu(gs): \r\nco(mpilers): Micro-C only\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifdef _MICROC_\r\n#include <portable.h>\r\n\r\nvoid _fmemcpy(unsigned const dseg, unsigned const dofs\r\n , unsigned const sseg, unsigned const sofs, unsigned length)\r\n{\tcopy_seg(dseg, dofs, sseg, sofs, length);\r\n}\r\n\r\n#else\r\n\r\n#if defined(_TC_EARLY_)\r\n#include <portable.h>\r\n#include \"fmemory.h\"\r\n\r\nvoid far *_fmemcpy(void far * const s1, const void far * const s2, unsigned length)\r\n{\tbyte far*p;\r\n\tconst byte far*q;\r\n\r\n\tif(length) {\r\n\t\tp = s1;\r\n\t\tq = s2;\r\n\t\tdo *p++ = *q++;\r\n\t\twhile(--length);\r\n\t}\r\n\treturn s1;\r\n}\r\n\r\n#endif\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/fmemory.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/*\r\n\tSet up the compiler depend macros\r\n\tfor far memory subsystem\r\n*/\r\n\r\n#ifdef COMPILE\r\n#undef COMPILE\r\n#endif\r\n\r\n#ifdef _MICROC_\r\n#define COMPILE\r\n\r\n#define fargDecl(type,name)\tunsigned name/**/_segm, unsigned name/**/_ofs\r\n#define fargPass(name)\t name/**/_segm,  name/**/_ofs\r\n#endif\r\n\r\n#if defined(_TC_EARLY_)\r\n#define COMPILE\r\n\r\n#define fargDecl(type,name)\ttype far * const  name\r\n#define fargPass(name)\t name\r\n#endif\r\n\r\n\r\n#ifdef COMPILE\r\n#include <portable.h>\r\n#include \"fmemory.h\"\r\n\r\n/* Don't create a new function as the \"+1\" is just one byte\r\n\tnormally. This function has to be called lots of time to\r\n\tsave more of these single bytes than a new function actually\r\n\twould cost */\r\n#define _fstrlen1(name)\t(_fstrlen(fargPass(name)) + 1)\r\n\r\n#define COMPILE\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/fmemove.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): _fmemmove\r\nsu(bsystem): farmem\r\nty(pe): \r\nsy(nopsis): \r\nsh(ort description): Copy a far memory areas onto another\r\nlo: Copies one far memory area onto another one, the destination\r\n\tarea must be at least \\para{length} bytes long. Both areas may\r\n\toverlap themselves.\r\nhe(ader files): \r\npr(erequistes): pointers must not be equal to \\tok{NULL}\r\nva(lue): none\r\nre(lated to): memmove _fmemcpy\r\nse(condary subsystems): portable\r\nxr(ef): \r\nim(port): \r\nfi(le): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): Micro-C and Pacific HiTech C\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifdef _MICROC_\r\n#include <portable.h>\r\n#include \"fmemory.h\"\r\n\r\nvoid _fmemmove(unsigned dseg, unsigned dofs\r\n , unsigned sseg, unsigned sofs, unsigned length)\r\n{\tunsigned seg, ofs;\r\n\r\n\tif(!length)\r\n\t\treturn;\r\n\r\n\t/* 1st: normalize pointers for compare */\r\n\t_fnormalize(dseg, dofs);\r\n\t_fnormalize(sseg, sofs);\r\n\r\n\tif(sseg == dseg && sofs == dofs)\r\n\t\treturn;\r\n\r\n\tseg = sseg;\t\t\t\t/* end of source area */\r\n\tofs = sofs + length;\r\n\t_fnormalize(seg, ofs);\r\n\r\n\t/* 2nd: check, if the areas overlap and if this matters at all */\r\n\t/* Bad results will occur, if sseg:sofs < dseg:dofs < seg:ofs */\r\n\tif(_fcompare(sseg, sofs, dseg, dofs) < 0\r\n\t && _fcompare(dseg, dofs, seg, ofs) <= 0) {\t/* perform manually */\r\n\t \tdofs += length;\t\t/* both point behind the areas now */\r\n\t \tsofs += length;\r\n\t\tdo pokeb(dseg, --dofs, peekb(sseg, --sofs));\r\n\t\twhile(--length);\r\n\t}\r\n\telse _fmemcpy(dseg, dofs, sseg, sofs, length);\r\n}\r\n\r\n#else\r\n#if defined(_PAC_NOCLIB_) || defined(_TC_EARLY_)\r\n#include <portable.h>\r\n#include \"fmemory.h\"\r\n\r\nvoid far *_fmemmove(void far * const s1, const void far * const s2\r\n\t, unsigned length)\r\n{\tbyte far *p;\r\n\tbyte far *q;\r\n\tbyte far *h;\r\n\r\n\tif(!length)\r\n\t\treturn s1;\r\n\r\n\tp = _fnormalize(s1);\r\n\tq = _fnormalize((void far*)s2);\r\n\th = _fnormalize(q + length);\r\n\r\n\t/* Cases:\r\n\t\tp == q --> nothing to do\r\n\r\n\t\tno overlapping areas --> call _fmemcpy()\r\n\r\n\t\tp < q && overlapping -->\r\n\t\t\t   ..ABCDE\r\n\t\t\t   1234\r\n\t\t\tIf the string ABCDE is copied from the beginning one-by-one\r\n\t\t\tover 1234, the result is OK.\r\n\t\t\t\t--> call _fmemcpy()\r\n\r\n\t\tp > q && overlapping -->\r\n\t\t\t\tABCDE\r\n\t\t\t\t..1234\r\n\t\t\tIf now one starts from the beginning of ABCDE, the 'A' will\r\n\t\t\toverwrite the position of '1', which is also 'E' ---\r\n\t\t\tbut 'E' would be copied later another time.\r\n\t\t\t\t--> copy backwardly\r\n\t*/\r\n\tif(p == q)\r\n\t\treturn s1;\r\n\r\n\t/*\r\n\t * without the typecasts TC++1 ignores the segment portions completely\r\n\t */\r\n#ifdef __GNUC__\r\n\tif(p > q && p <= h) {\r\n#else\r\n\tif((char huge*)p > (char huge*)q && (char huge*)p <= (char huge*)h) {\r\n#endif\r\n\t\t/* overlapping areas */\r\n\t\tp += length;\r\n\t\tq += length;\r\n\t\tdo *--p = *--q;\r\n\t\twhile(--length);\r\n\t}\r\n\telse {\r\n\t\t_fmemcpy(s1, s2, length);\r\n\t}\r\n\treturn s1;\r\n}\r\n#endif\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/fnorm.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\r\nob(ject): _fnormalize\r\nsu(bsystem): farmem\r\nty(pe): \r\nsh(ort description): Normalize a far memory pointer\r\nlo(ng description): Normalizes a far memory pointer. A normalized pointer\r\n\thas an offset smaller than 16.\r\npr(erequistes): \r\nva(lue): none: Micro-C\r\n\t\\item normalize far pointer: Pacific HiTech C\r\nre(lated to): _fcompare\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): Micro-C and Pacific HiTech C\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifdef _MICROC_\r\n#include <portable.h>\r\n\r\nvoid _fnormalize_(unsigned *seg, unsigned *ofs)\r\n{\t*seg += *ofs >> 4;\r\n\t*ofs &= 0xf;\r\n}\r\n\r\n#else\r\n#include <portable.h>\r\n#include <dos.h>\r\n\r\nvoid far *_fnormalize(void far *poi)\r\n{\treturn\tMK_FP(FP_SEG(poi) + (FP_OFF(poi) >> 4), FP_OFF(poi) & 0xF);\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/fputmc.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): fputmc\r\nsu(bsystem): supplio\r\nty(pe): \r\nsh(ort description): Dump the same character multiple times\r\nlo(ng description): Writes the same character multiple times into\r\n\tthe stream.\\par\r\n\tIf \\tok{cnt == 0}, nothing happens.\r\npr(erequistes): f != NULL\r\nva(lue): \\para{ch}: on success\\item \\tok{EOF}: on failure\r\nre(lated to): putc\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include <stdio.h>\r\n#include <string.h>\r\n#include <portable.h>\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef SUPPL_LOG_FUNCTION\r\n#include <ctype.h>\r\n#endif\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint fputmc(int ch, int cnt, FILE *f)\r\n{\tint i;\r\n\tchar buf[80];\r\n\tDBG_ENTER(\"fputmc\", Suppl_supplio)\r\n\r\n\tassert(f);\r\n\r\n\tDBG_ARGUMENTS( (\"ch='%c' (0x%02x), cnt=%u\", isprint(ch)? ch: ' ', ch & 0xff, cnt) )\r\n\r\n\tif(!cnt) DBG_RETURN_I( ch)\r\n\r\n\ti = sizeof(buf)-1;\r\n\tif (cnt < sizeof(buf)-1) i = cnt;\r\n\tmemset(buf, ch, i);\r\n\tbuf[i] = '\\0';\r\n\twhile(cnt > 0) {\r\n\t\tif(fprintf(f, \"%s\", buf) == EOF)\r\n\t\t\tDBG_RETURN_I( EOF)\r\n\t\tcnt -= sizeof(buf)-1;\r\n\t\tif (cnt < sizeof(buf)-1) buf[cnt] = '\\0';\r\n\t}\r\n\r\n\tDBG_RETURN_I( ch)\r\n}\r\n"
  },
  {
    "path": "suppl/src/fstrcpy.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): _fstrcpy\r\nsu(bsystem): farmem\r\nty(pe): \r\nsh(ort description): Copy a far string onto another\r\nlo(ng description): Copies a far string onto another one. The destination\r\n\tstring must have at least \\tok{_fstrlen()+1} bytes in size.\r\npr(erequistes): pointers must not be \\tok{NULL}\r\nva(lue): none\r\nre(lated to): strcpy\r\nse(condary subsystems): portable\r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): Micro-C only\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n#include \"fmemory.loc\"\r\n\r\n#ifdef COMPILE\r\nvoid _fstrcpy(fargDecl(char, dst), fargDecl(const char, src))\r\n{\t_fmemcpy(fargPass(dst), fargPass(src), _fstrlen1(src));\r\n}\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/fstrdup.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): _fdupstr\r\nsu(bsystem): farmem\r\nty(pe): \r\nsh(ort description): Duplicate a far string into local heap\r\nlo(ng description): Duplicates the far string into the local,\r\n\tusually near heap\r\npr(erequistes): the source pointer must not be \\tok{NULL}\r\nva(lue): NULL: on failure\\item else: pointer to the string in the\r\n\theap\r\nre(lated to): strdup\r\nse(condary subsystems): portable\r\nin(itialized by): \r\nwa(rning): This function cannot be named \\tok{_fstrdup}, because this\r\n\twould interfere with the implementation of string functions of\r\n\tcompilers supporting far poiners and a far heap.\r\nbu(gs): \r\nco(mpilers):\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifdef _MICROC_\r\n#include <portable.h>\r\n#include \"dynstr.h\"\r\n#include \"fmemory.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\nchar *_fdupstr(unsigned const segm, unsigned const ofs)\r\n{\tsize_t len;\r\n\tchar *p;\r\n\r\n\tif(!(p = malloc(len = _fstrlen(MK_FP(segm, ofs)) + 1)))\r\n\t\treturn 0;\r\n\tcopy_seg(TO_FP(p), segm, ofs, len);\r\n\r\n\treturn p;\r\n}\r\n\r\n#else\r\n\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#include <portable.h>\r\n#include \"fmemory.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\nchar *_fdupstr(const char far * const s)\r\n{\tsize_t len;\r\n\tchar *p;\r\n\r\n\tchkHeap\r\n\tif((p = malloc(len = _fstrlen(s) + 1)) == 0)\r\n\t\treturn 0;\r\n\t_fmemcpy(TO_FP(p), s, len);\r\n\r\n\tchkHeap\r\n\treturn p;\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/fstrlen.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): _fstrlen\r\nsu(bsystem): farmem\r\nty(pe): \r\nsh(ort description): Return the length of a far string\r\npr(erequistes): the pointer must not be \\tok{NULL}\r\nva(lue): length of far string\r\nre(lated to): strlen\r\nse(condary subsystems): portable\r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): Micro-C only\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifdef _MICROC_\r\n#include <portable.h>\r\n\r\nunsigned _fstrlen(unsigned const seg, unsigned const ofs)\r\n{\tunsigned p;\r\n\r\n\tfor(p = ofs; peekb(seg, p); ++p);\r\n\r\n\treturn p - ofs;\r\n}\r\n\r\n#else\r\n\r\n#if defined(_TC_EARLY_)\r\n#include <assert.h>\r\n#include <portable.h>\r\n#include \"fmemory.h\"\r\n\r\nunsigned _fstrlen(const char far * const s)\r\n{\tconst byte far *p = (const byte far*)s;\r\n\r\n    while (*p++);\r\n    assert((p - (const byte far*)s) <= 0x10000l);\r\n    return (unsigned)(p - (const byte far*)s) - 1;\r\n}\r\n\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/gm_chgm.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Erealloc\r\nsu(bsystem): error\r\nty(pe): 0H\r\nsh(ort description): Reallocate a chunk of memory\r\nlo(ng description): Reallocate a dynamically allocated chunk of\r\n\tmemory.\\par\r\n\tIf \\tok{poi == NULL}, a new block is allocated.\\newline\r\n\tIf \\tok{len == 0}, the block is deallocated.\\newline\r\n\tIf \\tok{poi == NULL && len == 0}, the behaviour is undefined.\\par\r\n\tOn failure, the program is terminated with the error message:\r\n\t\"Out of memory\".\r\npr(erequistes): \r\nva(lue): pointer to reallocated chunk\r\nre(lated to): \r\nse(condary subsystems): dynstr\r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include <assert.h>\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#endif /*#\t!defined(_MICROC_) */\r\n#include <portable.h>\r\n#include \"msgs.h\"\r\n\r\n#include \"dynstr.h\"\r\n\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif /*#\tdefined(RCS_Version) */\r\n\r\n/*\r\n *\tReallocate a chunk of memory and terminate the application on failure\r\n */\r\nvoid *Erealloc(void *p1, size_t size)\r\n{\tvoid *p;\r\n\r\n\tDBG_ENTER(\"Erealloc\", Suppl_error)\r\n\tDBG_ARGUMENTS( (\"poi=%p, new_len=%u\", p1, size) )\r\n\r\n\tchkHeap\r\n\tif((p = realloc(p1, size)) == 0 && size)\r\n\t\tEsuppl_noMem();\r\n\tchkHeap\r\n\tDBG_RETURN_P( p)\r\n}\r\n"
  },
  {
    "path": "suppl/src/gm_dup.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Estrdup\r\nsu(bsystem): error\r\nty(pe): 0H\r\nsh(ort description): Duplicate a string into heap\r\nlo(ng description): Duplicates a string into the heap.\\par\r\n\tIf \\tok{s == NULL}, \\tok{NULL} is returned.\\newline\r\n\tOn failure, the program is terminated with the error message:\r\n\t\"Out of memory\".\r\npr(erequistes): \r\nva(lue): NULL: if \\tok{s == NULL}\\item else: pointer to duplicated string\r\nre(lated to): \r\nse(condary subsystems): dynstr\r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include <assert.h>\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#endif /*#\t!defined(_MICROC_) */\r\n#include <portable.h>\r\n#include \"msgs.h\"\r\n\r\n#include \"dynstr.h\"\r\n\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif /*#\tdefined(RCS_Version) */\r\n\r\n/*\r\n *\tDuplicate a string into the local heap.\r\n *\tOn failure: Terminate with an error message\r\n */\r\nchar *Estrdup(const char * const str)\r\n{\tchar *h;\r\n\r\n\tDBG_ENTER(\"Estrdup\", Suppl_error)\r\n\r\n\tif(!str) DBG_RETURN_S( 0)\r\n\r\n\tDBG_ARGUMENTS( (\"str=\\\"%s\\\"\", str) )\r\n\r\n\tchkHeap\r\n\tif((h = strdup(str)) == 0)\r\n\t\tEsuppl_noMem();\r\n\r\n\tchkHeap\r\n\tDBG_RETURN_S( h)\r\n}\r\n"
  },
  {
    "path": "suppl/src/gm_gtmem.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Emalloc\r\nsu(bsystem): error\r\nty(pe): 0H\r\nsh(ort description): Allocate a chunk of memory\r\nlo(ng description): Allocates a new chunk of memory from the heap.\\par\r\n\tIf \\tok{size == 0}, the behaviour is undefined.\\newline\r\n\tOn failure, the program is terminated with the error message:\r\n\t\"Out of memory\".\r\npr(erequistes): \r\nva(lue): pointer to newly allocated memory\r\nre(lated to): \r\nse(condary subsystems): dynstr\r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include <assert.h>\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#endif /*#\t!defined(_MICROC_) */\r\n#include <portable.h>\r\n#include \"msgs.h\"\r\n\r\n#include \"dynstr.h\"\r\n\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif /*#\tdefined(RCS_Version) */\r\n\r\n/*\r\n *\tAllocate a chunk of memory\r\n *\tOn failure: Terminate with an error message\r\n */\r\nvoid *Emalloc(size_t size)\r\n{\tbyte *h;\r\n\r\n\tDBG_ENTER(\"Emalloc\", Suppl_error)\r\n\tDBG_ARGUMENTS( (\"len=%u\", size) )\r\n\r\n\tchkHeap\r\n\tif((h = malloc(size)) == 0)\r\n\t\tEsuppl_noMem();\r\n\r\n\tchkHeap\r\n\tDBG_RETURN_P( h)\r\n}\r\n"
  },
  {
    "path": "suppl/src/gm_res.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): Eresize\r\nsu(bsystem): error\r\nty(pe): 0H_\r\nsh(ort description): Resize a chunk of dynamic memory\r\nlo(ng description): Resizes a chunk of dynamic memory.\\par\r\n\tIf \\tok{*poi == NULL}, a new chunk is allocated.\\newline\r\n\tIf \\tok{len == 0}, the chunk is deallocated\r\n\tOn failure, the program is terminated with the error message:\r\n\t\"Out of memory\".\r\npr(erequistes): \\tok{poi != NULL} and \\tok{*poi} must be either \\tok{NULL}\r\n\tor a chunk of dynamic memory or a dynamic string\r\nva(lue): pointer to reallocated memory \\tok{*poi}\r\nre(lated to): \r\nse(condary subsystems): dynstr\r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <assert.h>\r\n#include <portable.h>\r\n#include \"dynstr.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\n\r\nvoid *Eresize_(void ** const poi, size_t len)\r\n{\tDBG_ENTER(\"Eresize\", Suppl_error)\r\n\r\n\tassert(poi);\r\n\r\n\tDBG_ARGUMENTS( (\"*poi=%p, new_len=%u\", *poi, len) )\r\n\r\n\tchkHeap\r\n\tDBG_RETURN_BP( *poi = Erealloc(*poi, len))\r\n}\r\n"
  },
  {
    "path": "suppl/src/initsupl.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/*\r\n\tSet up the compiler depend macros\r\n\t-and-\r\n\tSet up SUPPL global macros\r\n*/\r\n\r\n\r\n#include \"supl_def.h\"\r\n\r\n\r\n\t/* Identify to compile a SUPPL file */\r\n#define _SUPPL_\r\n\r\n#if 0\r\n\t/* Add the RCS ID into the files */\r\n#ifndef NDEBUG\r\n#define RCS_Version\r\n#endif\r\n#endif\r\n\r\n\r\n/*\r\n *\tDebug settings\r\n *\tNote: Debugging is globally turned off when the NDEBUG macro is\r\n *\tdefined, which causes to nullify assert()'s, too.\r\n *\tSee SUPPLDBG.H\tfor more details.\r\n */\r\n\t/* Enable all debug/logging features of SUPPL */\r\n/* #define SUPPL_DBG_ALL */\r\n#define SUPPL_DBG_HEAP\r\n#define SUPPL_DBG_MEMORY\r\n/* #define SUPPL_LOG_MEMORY */\r\n#define SUPPL_LOG_FUNCTION\r\n\r\n\t/* Prevent possible program crashes:\r\n\t\tIf the logfiles are closed rather than just flushed, the possibility\r\n\t\tthat the data is really commited to disk instead of kept in memory\r\n\t\t(BUFFERs) is much higher; the disadvantage is that the logfiles\r\n\t\tare opened and closed for each line individually, what makes logging\r\n\t\ta very time-consuming action.\r\n\r\n\t\tFLUSH is a weaker method, but less time-consuming.\r\n\t\tCLOSE superceeds FLUSH.\r\n\t*/\r\n#define DBG_ALWAYS_CLOSELOG\r\n/* #define DBG_ALWAYS_FLUSHLOG */\r\n/* #define SYSLOG_ALWAYS_FLUSHLOG */\r\n\r\n\t/* Mark all files of this library as part of it */\r\n#define DBG_LIBRARY Suppl_SUPPL\r\n"
  },
  {
    "path": "suppl/src/intr.asm",
    "content": "; File:\r\n;                         intr.asm\r\n; Description:\r\n;       Assembly implementation of calling an interrupt\r\n;\r\n;                    Copyright (c) 2000\r\n;                       Steffen Kaiser\r\n;                       All Rights Reserved\r\n;\r\n; This file is part of FreeDOS.\r\n;\r\n; FreeDOS is free software; you can redistribute it and/or\r\n; modify it under the terms of the GNU General Public License\r\n; as published by the Free Software Foundation; either version\r\n; 2, or (at your option) any later version.\r\n;\r\n; DOS-C is distributed in the hope that it will be useful, but\r\n; WITHOUT ANY WARRANTY; without even the implied warranty of\r\n; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See\r\n; the GNU General Public License for more details.\r\n;\r\n; You should have received a copy of the GNU General Public\r\n; License along with DOS-C; see the file COPYING.  If not,\r\n; write to the Free Software Foundation, Inc.,\r\n; 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.\r\n;\r\n\r\n%include \"model.inc\"\r\n\r\n%ifidn __OUTPUT_FORMAT__, elf \t; only for ia16-elf-gcc compilations\r\n%define COMPILE 1\r\n\r\nsegment .text\r\n\r\nbits 16\r\n\r\nglobal intrf\r\nglobal _intrf\r\n\r\nintrf:\r\n_intrf:\r\n\r\n%elifidni COMPILER, WATCOM \t; and Open Watcom\r\n%define COMPILE 1\r\n\r\nsegment _TEXT\r\n\r\nglobal intrf_\r\nglobal _intrf_\r\n\r\nintrf_:\r\n_intrf_:\r\n%endif\r\n\r\n%ifdef COMPILE\r\n\t\tpush\tbp\t\t\t; Standard C entry\r\n%ifidn __OUTPUT_FORMAT__, elf\r\n\t\tpush\tes\t\t\t; gcc-ia16 has es caller-saved\r\n%endif\r\n\t\tpush\tbx\r\n\t\tpush\tcx\r\n\t\tmov\tbx, dx\r\n\t\tpush\tdx\r\n\t\tpush\tsi\r\n\t\tpush\tdi\r\n\t\tpush\tds\r\n\t\tmov\t[cs:intr_1-1], al\r\n\t\tjmp\tshort intr_2\t\t; flush the instruction cache\r\nintr_2:\r\n\t\tmov\tah, [bx+18]\t\t; SZAPC flags\r\n\t\tsahf\r\n\t\tmov\tax, [bx]\r\n\t\tmov\tcx, [bx+4]\r\n\t\tmov\tdx, [bx+6]\r\n\t\tmov\tbp, [bx+8]\r\n\t\tmov\tsi, [bx+10]\r\n\t\tmov\tdi, [bx+12]\r\n\t\tpush\tword [bx+14]\t\t; ds\r\n\t\tmov\tes, [bx+16]\r\n\t\tmov\tbx, [bx+2]\r\n\t\tpop\tds\r\n\t\tint\t0\r\nintr_1:\r\n\t\tpushf\r\n\t\tpush\tds\r\n\t\tpush\tbx\r\n\t\tmov\tbx, sp\r\n\t\tmov\tds, [ss:bx+6]\r\n\t\tmov\tbx, [ss:bx+12]\t\t; address of REGPACK\r\n\t\tmov\t[bx], ax\r\n\t\tpop\tword [bx+2]\r\n\t\tmov\t[bx+4], cx\r\n\t\tmov\t[bx+6], dx\r\n\t\tmov\t[bx+8], bp\r\n\t\tmov\t[bx+10], si\r\n\t\tmov\t[bx+12], di\r\n\t\tpop\tword [bx+14]\r\n\t\tmov\t[bx+16], es\r\n\t\tpop\tword [bx+18]\r\n\r\n\t\tpop\tds\r\n\t\tpop\tdi\r\n\t\tpop\tsi\r\n\t\tpop\tdx\r\n\t\tpop\tcx\r\n\t\tpop\tbx\r\n%ifidn __OUTPUT_FORMAT__, elf\r\n\t\tpop\tes\r\n%endif\r\n\t\tpop\tbp\r\n\t\tret\t\t\t\t\t; retf/retn model specific, see model.inc\r\n%endif\r\n"
  },
  {
    "path": "suppl/src/invokedo.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile: INVOKEDO.C $\r\n   $Locker: ska $\t$Name:  $\t$State: Exp $\r\n\r\nob(ject): invokeDOS\r\nsu(bsystem): portable\r\nty(pe): \r\nsh(ort description): Call the DOS system API\r\nlo(ng description): Calls the DOS system API interrupt 0x21. The initial\r\n\tregister values passed to the system are read from the \\tok{IREGS}\r\n\tstructure \\para{prp}. On exit,\r\n\tthe register values are dumped into the same structure overwriting\r\n\tthe passed-in values.\r\npr(erequistes): prp != NULL\r\nva(lue): 0: Carry flag was clear on return\\item else: AX register, if\r\n\tCarry flag was set. Most DOS functions use the Carry flag to\r\n\tindicate an error condition and return the error number in the\r\n\tregister AX, please consult a DOS system API reference, such as\r\n\tRalf Brown's interrupt list, for more details.\r\nre(lated to): IREGS\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"suppl.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id: INVOKEDO.C 1.9 1999/12/13 02:23:22 ska Exp ska $\";\r\n#endif\r\n\r\nint invokeDOS(IREGS *prp)\r\n{\tDBG_ENTER(\"invokeDOS\", Suppl_portable)\r\n\tassert(prp);\r\n\tDBG_ARGUMENTS( (\"AX=0x%04x\", prp->r_ax) )\r\n\tintrpt(0x21, prp);\r\n\tDBG_RETURN_BI( (prp->r_flags & 1)? prp->r_ax: 0)\r\n}\r\n"
  },
  {
    "path": "suppl/src/makefile.mak",
    "content": "CFG_DEPENDENCIES = makefile.mak\r\n\r\nTOP2LVL = 1\r\nTOP = ../..\r\n!include \"$(TOP)/config.mak\"\r\n\r\nSUPPL=suppl_$(SHELL_MMODEL)\r\nCC = $(CC) -I..\r\n\r\nall : ../$(SUPPL).lib\r\n\r\nOBJS1 = addu.obj byte2par.obj cntry.obj dfndeli2.obj dfndelim.obj dfnexpan.obj dfnfnam.obj\r\nOBJS2 = dfnfullp.obj dfnmerge.obj dfnpath.obj dfnsplit.obj dfnsquee.obj dfnstat.obj\r\nOBJS3 = dfntruen.obj dmemcmpf.obj dosalloc.obj dosfree.obj dossize.obj dstrchar.obj\r\nOBJS4 = dstrfupr.obj dstrleft.obj dstrrepl.obj dstrtrim.obj dstrupr.obj enoallc.obj\r\nOBJS5 = enoreal.obj enosdup.obj enosetos.obj env_chg.obj env_del.obj env_dvar.obj env_find.obj\r\nOBJS6 = env_fora.obj env_free.obj env_insv.obj env_len.obj env_mtch.obj env_new.obj\r\nOBJS7 = env_nost.obj env_ovrw.obj env_repl.obj env_rlsg.obj env_scnt.obj env_size.obj\r\nOBJS8 = env_strg.obj env_sub.obj env_var1.obj env_var2.obj ffmaxbuf.obj fgetpos.obj\r\nOBJS9 = fmemchr.obj fmemcmp.obj fmemcpy.obj fmemove.obj fnorm.obj fputmc.obj fstrcpy.obj\r\nOBJS10 = fstrdup.obj fstrlen.obj _getdcwd.obj mcb_1st.obj mcb_is.obj mcb_leng.obj  mcb_nxt.obj\r\nOBJS11 = mcb_walk.obj stpcat.obj stpcpy.obj toupperx.obj filefind.obj invokedo.obj intr.obj\r\n\r\nDOBJS1 = app_ievx.obj app_ini_.obj app_name.obj app_namx.obj app_vars.obj dbgf_chg.obj\r\nDOBJS2 = dbgf_cl.obj dbgf_cle.obj dbgf_clg.obj dbgf_dl.obj dbgf_dpl.obj dbgf_et.obj\r\nDOBJS3 = dbgf_ext.obj dbgf_fl.obj dbgf_flg.obj dbgf_ien.obj dbgf_lgh.obj dbgf_lgi.obj\r\nDOBJS4 = dbgf_lgt.obj dbgf_lk.obj dbgf_log.obj dbgf_lv.obj dbgf_mfi.obj dbgf_mi.obj\r\nDOBJS5 = dbgf_mki.obj dbgf_ml.obj dbgf_pop.obj dbgf_prt.obj dbgf_psh.obj dbgf_var.obj\r\nDOBJS6 = dbgm_chk.obj dbgv_s0.obj dbgv_s2.obj dbgv_s3.obj dbgv_s4.obj dbgv_s5.obj\r\nDOBJS7 = dbgv_s6.obj dbgv_s7.obj dbgv_s8.obj dbgv_s10.obj dbgv_s13.obj dbgv_s14.obj\r\nDOBJS8 = dbgv_s15.obj dbgv_s17.obj dbgv_s19.obj dbgv_s20.obj dbgv_s22.obj dbgv_s25.obj\r\nDOBJS9 = eeopen.obj eestrcon.obj env_sdup.obj erfc_00f.obj erfc_015.obj gm_res.obj \r\nDOBJS10 = gm_dup.obj gm_chgm.obj gm_gtmem.obj nlstime.obj strnum.obj s_skipws.obj s_skipwd.obj\r\n\r\n# Prepare Librarian Response File\r\nsuppllib.rsp: $(ECHOLIBDEP) makefile.mak\r\n\t$(RMFILES) suppllib.rsp\r\n\t$(ECHOLIB) suppllib.rsp $(OBJS1)\r\n\t$(ECHOLIB) suppllib.rsp $(OBJS2)\r\n\t$(ECHOLIB) suppllib.rsp $(OBJS3)\r\n\t$(ECHOLIB) suppllib.rsp $(OBJS4)\r\n\t$(ECHOLIB) suppllib.rsp $(OBJS5)\r\n\t$(ECHOLIB) suppllib.rsp $(OBJS6)\r\n\t$(ECHOLIB) suppllib.rsp $(OBJS7)\r\n\t$(ECHOLIB) suppllib.rsp $(OBJS8)\r\n\t$(ECHOLIB) suppllib.rsp $(OBJS9)\r\n\t$(ECHOLIB) suppllib.rsp $(OBJS10)\r\n\t$(ECHOLIB) suppllib.rsp $(OBJS11)\r\n\t$(ECHOLIB) suppllib.rsp $(DOBJS1)\r\n\t$(ECHOLIB) suppllib.rsp $(DOBJS2)\r\n\t$(ECHOLIB) suppllib.rsp $(DOBJS3)\r\n\t$(ECHOLIB) suppllib.rsp $(DOBJS4)\r\n\t$(ECHOLIB) suppllib.rsp $(DOBJS5)\r\n\t$(ECHOLIB) suppllib.rsp $(DOBJS6)\r\n\t$(ECHOLIB) suppllib.rsp $(DOBJS7)\r\n\t$(ECHOLIB) suppllib.rsp $(DOBJS8)\r\n\t$(ECHOLIB) suppllib.rsp $(DOBJS9)\r\n\t$(ECHOLIB) suppllib.rsp $(DOBJS10)\r\n\r\n# Create the library\r\n../$(SUPPL).lib: $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) $(OBJS6) $(OBJS7) \\\r\n$(OBJS8) $(OBJS9) $(OBJS10) $(OBJS11) $(DOBJS1) $(DOBJS2) $(DOBJS3) $(DOBJS4) \\\r\n$(DOBJS5) $(DOBJS6) $(DOBJS7) $(DOBJS8) $(DOBJS9) $(DOBJS10) suppllib.rsp\r\n\t$(RMFILES) ..$(DIRSEP)$(SUPPL).lib\r\n\t$(AR) ..$(DIRSEP)$(SUPPL).lib @suppllib.rsp $(LIBLIST) ..$(DIRSEP)$(SUPPL).lst\r\n"
  },
  {
    "path": "suppl/src/mcb_1st.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): mcb_first\r\nsu(bsystem): mcb\r\nty(pe): \r\nsh(ort description): Return the first MCB\r\nlo(ng description): Returns the first MCB within the chain\r\npr(erequistes): \r\nva(lue): The first MCB\r\nre(lated to):\r\nse(condary subsystems): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"mcb.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nword mcb_first(void)\r\n{\tword ofs, mcb;\r\n\tUSEREGS\r\n\r\n\tDBG_ENTER(\"mcb_first\", Suppl_mcb)\r\n\r\n\t_AH = 0x52;\t\t\t/* get list of list */\r\n\tgeninterrupt(0x21);\r\n\tofs = _BX;\t\t\t/* mcb:ofs := pointer to list of lists */\r\n\tmcb = _ES;\r\n\r\n\tif(ofs < 2) --mcb, ofs += 16;\t/* Avoid the segment warp */\r\n\r\n\tDBG_RETURN_U( peekw(mcb, ofs - 2) )\t/* 1st MCB */\r\n}\r\n"
  },
  {
    "path": "suppl/src/mcb_is.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\r\nob(ject): isMCB\r\nsu(bsystem): mcb\r\nty(pe): \r\nsh(ort description): Test if a MCB is valid\r\nlo(ng description): Tests if a given MCB is valid.\r\npr(erequistes): \r\nva(lue): 0: is no MCB\\item else: is a MCB\r\nre(lated to): isPSP isEnv mcb_walk\r\nse(condary subsystems): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include <portable.h>\r\n#include \"mcb.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nstatic int isMCBcomp(void *arg, word mcb)\r\n{\treturn mcb == (unsigned)arg;\r\n}\r\n\r\nint isMCB(const word mcb)\r\n{\tDBG_ENTER(\"isMCB\", Suppl_mcb)\r\n\tDBG_ARGUMENTS( (\"mcb=%u\", mcb) )\r\n\tDBG_RETURN_BI( mcb_walk(0, aF(isMCBcomp), (void*)mcb))\r\n}\r\n"
  },
  {
    "path": "suppl/src/mcb_leng.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): mcb_length\r\nsu(bsystem): mcb\r\nty(pe): \r\nsh(ort description): Return the length of a memory block as \\tok{(int)}\r\nlo(ng description): Returns the length of a memory block in bytes, \\em{but}\r\n\tin the range 0..65534!\\par\r\n\tThe specified value must be the address to the \\em{memory segment} rather\r\n\tthan the address of the associated MCB!\r\npr(erequistes): \r\nva(lue): 0: \\tok{segm == 0} or the block is really empty\r\n\t\\item \\tok{0xFFFFu}: the block is larger than 64KB\r\n\t\\item else: the size of the block at address \\para{segm}, in range\r\n\t\t0..65520 bytes\r\nre(lated to): \r\nse(condary subsystems): \r\nbu(gs): \r\nco(mpilers): \r\nwa:+ Unlike most of the functions of this subsystem the specified\r\n\taddress must point to the real memory segment rather than its MCB!\r\n\r\n */\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"mcb.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nunsigned mcb_length(const word segm)\r\n/* Return the length of the memory block starting at segm */\r\n{\tunsigned length;\r\n\r\n\tDBG_ENTER(\"mcb_length\", Suppl_mcb)\r\n\tDBG_ARGUMENTS( (\"segm=%u\", segm) )\r\n\r\n\tif(segm == 0) {\t\t\t/* security value */\r\n\t\tDBG_STRING(\"Invalid memory segment\")\r\n\t\tDBG_RETURN_I( 0)\r\n\t}\r\n\r\n\tlength = peekw(SEG2MCB(segm), MCB_OFF_SIZE);\t/* len of block in paras */\r\n\r\n\tDBG_RETURN_BI( length >= 4096?\t/* larger than 64KB */\r\n\t\t~0: length << 4)\r\n}\r\n"
  },
  {
    "path": "suppl/src/mcb_nxt.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): nxtMCB\r\nsu(bsystem): mcb\r\nty(pe): \r\nsh(ort description): Skip to next MCB in chain\r\nlo(ng description): Skips to next MCB in the chain. To enrich the\r\n\terror detection mechanism the functions fails, if the passed in\r\n\tMCB \\para{mcb} points to does not have the magic number 'M'.\r\npr(erequistes): mcb != 0\r\nva(lue): 0: no further MCB in chain\r\n\t\\item else: address of next MCB \r\nre(lated to): isMCB\r\nse(condary subsystems): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"mcb.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nword nxtMCB(word mcb)\r\n{\tDBG_ENTER(\"nxtMCB\", Suppl_mcb)\r\n\tDBG_ARGUMENTS( (\"MCB=%u\", mcb) )\r\n\tassert(mcb);\r\n\r\n\tDBG_RETURN_BI( peekb(mcb, 0) == 'M'\r\n\t\t? MCB2SEG(mcb) + peekw(mcb, MCB_OFF_SIZE)\r\n\t\t: 0)\r\n}\r\n"
  },
  {
    "path": "suppl/src/mcb_walk.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): mcb_walk\r\nsu(bsystem): mcb\r\nty(pe): \r\nsh(ort description): Enumerate all remaining MCBs of the chain\r\nlo(ng description): Enumerates all remaining MCBs of the chain. The callback\r\n\tfunction pointed to by \\para{fct} is invoked for each found MCB.\r\n\tThe function must comply to the \\tok{MCB_WALKFUNC} type and gets\r\n\tpassed in the unchanged \\para{arg} parameter and the address of\r\n\tthe found MCB. The callback function returns if the\r\n\tenumeration process shall proceed (return value equal to \\tok{0} (zero))\r\n\tor terminate (returns anything unequal to zero).\\par\r\n\tIf \\tok{mcb == 0}, the enumeration begins with the first MCB of the\r\n\tsystem.\\par\r\n\tDuring the enumeration process UMBs, if any, are linked into the\r\n\tchain. They are unlinked upon return of \\tok{mcb_walk()}.\r\npr(erequistes): \\para{fct} != NULL\r\nva(lue): -1: MCB chain corrupted (maybe returned by the callback\r\n\t\tfunction, too)\r\n\t\\item 0: all MCB entries enumerated, the callback function always returned\r\n\t\tzero itself\r\n\t\\item else: the value returned by the callback, unequal to zero\r\nre(lated to): MCB_WALKFUNC mcb_allParents\r\nse(condary subsystems): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#ifndef NDEBUG\r\n#include <stdio.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"mcb.h\"\r\n#include \"suppl.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint mcb_walk(word mcb, const MCB_WALKFUNC fct, void * const arg)\r\n{\tword ofs;\r\n\tFLAG UMBLink;\r\n\tFLAG8 MCBtype;\r\n\tUSEREGS\r\n\r\n\tDBG_ENTER(\"mcb_walk\", Suppl_mcb)\r\n\tDBG_ARGUMENTS( (\"mcb=%u\", mcb) )\r\n\r\n\tassert(fct);\r\n\r\n\tif(!mcb)\t\t/* begin with the 1st MCB */\r\n\t\tmcb = mcb_first();\r\n\r\n\tDBG_ARGUMENTS( (\"effective mcb=%u\", mcb) )\r\n\r\n\t/* for walking, link in UMB list */\r\n\tUMBLink = 1;\t\t/* Don't unlink UMBs */\r\n\t{\r\n\t\t_AX = 0x5802;\t/* Get UMB Link state */\r\n    /* /// Modified to use __emit__(), which doesn't require an assembler,\r\n       if we're compiling with TurboC.  - Ron Cemer */\r\n#if defined(_TC_EARLY_)\r\n\t        __emit__((unsigned char)0xf9);      /* stc */\r\n#elif defined(__WATCOMC__) || defined(__GNUC__)\r\n\t\treg.x.flags |= 1;\r\n#else\r\n\t\tasm {\r\n\t\t\tstc\r\n\t\t}\r\n#endif\r\n\t\tgeninterrupt(0x21);\r\n\t\tif(!_CFLAG && !_AL) {\t/* There are UMBs && not linked, yet */\r\n\t\t\tUMBLink = _AL;\r\n\t\t\tDBG_STRING(\"Link in UMBs\")\r\n\t\t\t_BX = 1;\t/* Link them */\r\n\t\t\t_AX = 0x5803;\t/* Set UMB Link state */\r\n\t\t\tgeninterrupt(0x21);\r\n\t\t}\r\n\t}\r\n\r\n\twhile(ofs = -1, (MCBtype = peekb(mcb, MCB_OFF_TYPE)) == 'M' || MCBtype == 'Z') {\r\n\t\t/* MCB seems to be valid */\r\n\r\n\t\tif((ofs = (*fct)(arg, mcb)) != 0\t/* call fct & break if necessary */\r\n\t\t || MCBtype == 'Z') break;\t/* end of chain */\r\n\t\tmcb += peekw(mcb, MCB_OFF_SIZE) + 1;\t/* advance to next MCB */\r\n\t}\r\n\r\n\tif(UMBLink == 0) {\t/* unlink UMBs */\r\n\t\tDBG_STRING(\"Unlink UMBs\")\r\n\t\t_AX = 0x5803;\r\n\t\t_BX = 0;\r\n\t\tgeninterrupt(0x21);\r\n\t}\r\n\r\n\tDBG_RETURN_I( ofs)\r\n}\r\n"
  },
  {
    "path": "suppl/src/msgs.lng",
    "content": "\t/* standard strings */\r\n#include \"nls/english.lng\"\r\n\t/* generated error codes */\r\n#include \"nls/english.err\"\r\n"
  },
  {
    "path": "suppl/src/msgs.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n   SUPPL message implementation\r\n\r\n\tDeclares the default message handler.\r\n\r\n*/\r\n\r\n#ifndef __MSGS_INC\r\n#define __MSGS_INC\r\n\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#endif\r\n#include <stdio.h>\r\n\r\n#include <portable.h>\r\n#include \"msgs.h\"\r\n/*#include \"msgs.lng\"*/\r\n\r\n#define errexit exit(125)\r\n\r\n#define error(msg,param)\tfprintf(stderr, msg, param); errexit\r\n#define error0(msg)\t\t\tfputs(msg, stderr); errexit\r\n#define warning(msg,param)\tfprintf(stderr, msg, param)\r\n#define warning0(msg)\t\tfputs(msg, stderr)\r\n\r\n#define msgLock(msg) (msg)\r\n#define msgUnlock(msg)\r\n\r\n#ifdef _MICROC_\r\n#define MSGID char *\r\n#else\r\ntypedef char const * MSGID;\r\n#endif\r\n\r\nextern const char I_wdInc[];\r\nextern const char I_sgnPlus[];\r\nextern const char I_wdDec[];\r\nextern const char I_sgnMinus[];\r\nextern const char I_wdOff[];\r\nextern const char I_wdFalse[];\r\nextern const char I_wdNo[];\r\nextern const char I_wdClear[];\r\nextern const char I_wdOn[];\r\nextern const char I_wdTrue[];\r\nextern const char I_wdYes[];\r\nextern const char I_wdSet[];\r\nextern const char I_wdToggle[];\r\nextern const char I_wdSwitch[];\r\nextern const char I_TcfgErr[];\r\nextern const char I_TcfgNone[];\r\nextern const char I_TcfgStr[];\r\nextern const char I_TcfgExpStr[];\r\nextern const char I_TcfgInt[];\r\nextern const char I_TcfgBool[];\r\nextern const char I_TcfgExpInt[];\r\nextern const char I_TcfgExpBool[];\r\n\r\nextern const char I_success[];\r\nextern const char I_error[];\r\nextern const char I_failure[];\r\n\r\n#ifdef _MICROC_\r\n#define LookupFct int\r\n#else\r\ntypedef int (*LookupFct)(char *, char *, size_t);\r\n#endif\r\n\r\n\r\n/*\r\n *\tLookup word case-sensitively\r\n *\tThe array contains entries to be retrieved dynamically if possible.\r\n *\r\n *\tReturn:\r\n *\t\t0: not found\r\n *\t\telse: (index + 1) of the found word, the word matches 100%\r\n *\t\t\tthe entry within the array\r\n */\r\n#define lookupword(wd,arr) lookupwd_((wd), (arr), nM((LookupFct))aF(memcmp))\r\n/*size_t lookupword(const char * const wd, const char * const * const arr);*/\r\n\r\n/*\r\n *\tLookup word case-insensitively\r\n *\tThe array contains entries to be retrieved dynamically if possible.\r\n *\r\n *\tReturn:\r\n *\t\t0: not found\r\n *\t\telse: (index + 1) of the found word, the word matches\r\n *\t\t\tthe entry within the array case-insentitively\r\n *\t\t\tthe match is performed with the MemiCmp() function\r\n */\r\n#define lookupwordi(wd,arr) lookupwd_((wd), (arr), nM((LookupFct))aF(MemiCmp))\r\n/*size_t lookupwordi(const char * const wd, const char * const * const arr);*/\r\n\r\n/*\r\n *\tLookup word user-specific\r\n *\tThe array contains entries to be retrieved dynamically if possible.\r\n *\r\n *\tReturn:\r\n *\t\t0: not found\r\n *\t\telse: (index + 1) of the found word, the word matches\r\n *\t\t\tthe entry within the supplied function\r\n */\r\nsize_t lookupwd_(const char * const wd, const MSGID *const arr\r\n\t, inM(int cmpfct, int (*cmpfct)(char *, char *, size_t)));\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/msgs_w.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\nvoid Wsuppl_argMissing(char ch);\r\nvoid Wsuppl_nonArgOption(char ch);\r\nvoid Wsuppl_argOption(char ch);\r\nvoid Wsuppl_lArgOption(const char * const name);\r\nvoid Wsuppl_option(char ch);\r\nvoid Wsuppl_lOption(const char * const name);\r\nvoid Wsuppl_longOption(void);\r\nvoid Wsuppl_noMem(void);\r\nvoid Wsuppl_writeFile(const char * const fnam);\r\nvoid Wsuppl_accessFile(const char * const fnam);\r\nvoid Wsuppl_openFile(const char * const fnam);\r\nvoid Wsuppl_createFile(const char * const fnam);\r\nvoid Wsuppl_readFile(const char * const fnam);\r\nvoid Wsuppl_creatTmpFnam(void);\r\nvoid Wsuppl_tmpOpen(const char * const fnam);\r\nvoid Wsuppl_wrCfgFile(const char *fnam);\r\nvoid Wsuppl_ovrLinkcount(const char *fnam);\r\n"
  },
  {
    "path": "suppl/src/nls/english.err",
    "content": "/* automatically generated by mkerrcod.pl */\r\n\r\n/*\r\n *\tcfg error codes\r\n */\r\n#define E_CFG0 \"no error, must be 0 (zero) !\\n\"\r\n#define E_CFG1 \"passed argument(s) invalid\\n\"\r\n#define E_CFG2 \"out of memory\\n\"\r\n#define E_CFG3 \"output file not open\\n\"\r\n#define E_CFG4 \"general access error\\n\"\r\n#define E_CFG5 \"cannot open file\\n\"\r\n#define E_CFG6 \"INI file already opened\\n\"\r\n#define E_CFG7 \"user home directory does not exist\\n\"\r\n#define E_CFG8 \"key not found\\n\"\r\n#define E_CFG9 \"section/value already exists\\n\"\r\n#define E_CFG10 \"no section/value to advance to\\n\"\r\n#define E_CFG11 \"unrecoverable change of INI file\\n\"\r\n#define E_CFG12 \"line is a comment\\n\"\r\n#define E_CFG13 \"ill-formed line in INI file\\n\"\r\n#define E_CFG14 \"no user INI file\\n\"\r\n#define E_CFG15 \"cannot write to INI file\\n\"\r\n#define E_CFG16 \"cannot read from INI file\\n\"\r\n\r\n/* end of cfg error codes */\r\n\r\n\r\n"
  },
  {
    "path": "suppl/src/nls/english.lng",
    "content": "/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n   SUPPL message definitions for the English tongue\r\n\r\n   Every entry must be an #define; also, don't prevent multiple\r\n   inclusion\r\n\r\n   $Log$\r\n   Revision 1.1  2006/06/28 16:04:19  blairdude\r\n   Initial checkin\r\n\r\n*/\r\n\r\n/* standard MSGLIB errors */\r\n#define E_argMissing\t\"Option '%c' requires a non-empty argument\\n\"\r\n#define E_nonArgOption \t\"Option '%c' cannot have an argument\\n\"\r\n#define E_argOption\t\t\"Option '%c' requires an argument\\n\"\r\n#define E_lArgOption\t\"Option '%s' requires an argument\\n\"\r\n#define E_option\t\t\"Unknown option '%c'\\n\"\r\n#define E_lOption\t\t\"Unknown option '%s'\\n\"\r\n#define E_longOption\t\"Long options not supported\\n\"\r\n#define E_noMem\t\t\t\"Out of memory\\n\"\r\n#define Y_noFNam\t\t\"<<unknown filename>>\"\r\n#define E_openFile\t\t\"Cannot open file: %s\\n\"\r\n#define E_createFile\t\"Cannot create file: %s\\n\"\r\n#define E_readFile\t\t\"Cannot read file: %s\\n\"\r\n#define E_writeFile\t\t\"Cannot write file: %s\\n\"\r\n#define E_accessFile\t\"Cannot access file: %s\\n\"\r\n#define E_creatTmpFnam\t\"Cannot create filename for temporary file\\n\"\r\n#define E_tmpOpen\t\t\"Cannot open temporary file: %s\\n\"\r\n#define E_wrCfgFile\t\t\"Cannot write binary configuration file: %s\\n\"\r\n#define E_ovrLinkcount\t\"Locked the same key too often in cfg file: %s\\n\"\r\n\r\n#define I_success \"success\"\r\n#define I_failure \"failure\"\r\n#define I_error \"error\"\r\n\r\n#define  I_wdInc\t\t\"inc\"\r\n#define  I_sgnPlus\t\t\"+\"\r\n#define  I_wdDec\t\t\"dec\"\r\n#define  I_sgnMinus\t\t\"-\"\r\n#define  I_wdOff\t\t\"off\"\r\n#define  I_wdFalse\t\t\"false\"\r\n#define  I_wdNo\t\t\t\"no\"\r\n#define  I_wdClear\t\t\"clear\"\r\n#define  I_wdOn\t\t\t\"on\"\r\n#define  I_wdTrue\t\t\"true\"\r\n#define  I_wdYes\t\t\"yes\"\r\n#define  I_wdSet\t\t\"set\"\r\n#define  I_wdToggle\t\t\"toggle\"\r\n#define  I_wdSwitch\t\t\"switch\"\r\n\r\n#define\tI_TcfgErr\t\t\"unknown\"\r\n#define\tI_TcfgNone\t\t\"unspecified\"\r\n#define\tI_TcfgStr\t\t\"string\"\r\n#define\tI_TcfgExpStr\t\"expandable string\"\r\n#define\tI_TcfgInt\t\t\"integer\"\r\n#define\tI_TcfgBool\t\t\"boolean\"\r\n#define\tI_TcfgExpInt\t\"expandable integer\"\r\n#define\tI_TcfgExpBool\t\"expandable boolean\"\r\n\r\n/* cfg errors */\r\n#define E_CFGunknown \"Unknown error\\n\"\r\n"
  },
  {
    "path": "suppl/src/nls.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tDOS NLS implementation -- \"use\" functions of the NLS info\r\n\r\n\tInternal declarations.\r\n\r\n*/\r\n\r\n#ifndef __NLS_LOC\r\n#define __NLS_LOC\r\n\r\n#include <assert.h>\r\n#include \"nls.h\"\r\n\r\n#endif /*#\t!defined(__CNTRY_H) */\r\n"
  },
  {
    "path": "suppl/src/nlstime.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): nlsCurTime\r\nsu(bsystem): nls\r\nty(pe): \r\nsh(ort description): Fill the current time into the NLS structure\r\nlo(ng description): Fills the current time into the specified NLS\r\n\tstructure. This function only modifies the fields \\tok{ti_hour},\r\n\t\\tok{ti_minute}, \\tok{ti_second} and \\tok{ti_hundred}. The\r\n\tdata may range in:\r\n \t\\item hour: 0..23\r\n \t\\item minute: 0..59\r\n \t\\item second: 0..59\r\n \t\\item hundred: 0..99\r\n \t\\endlist\r\npr(erequistes): t != NULL\r\nva(lue): none; \\tok{*t} structure has been updated\r\nre(lated to): nlsCurDate\r\nse(condary subsystems): portable\r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#endif\r\n#include \"nls.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\n#if defined(_MICROC_) || defined(_TC_EARLY_) || defined(__GNUC__)\r\n#undef HAVE_DOSTIME\r\n#else\r\n#define HAVE_DOSTIME\r\n#endif\r\n\r\nvoid nlsCurTime(nlstime *t)\r\n{\r\n#ifdef HAVE_DOSTIME\r\n\tstruct dostime_t dt;\r\n#else\r\n\tUSEREGS\r\n#endif\r\n\r\n\tDBG_ENTER(\"nlsCurTime\", Suppl_nls)\r\n\tassert(t);\r\n\r\n#ifdef HAVE_DOSTIME\r\n\t_dos_gettime(&dt);\r\n\tt->ti_hour = dt.hour;\r\n\tt->ti_minute = dt.minute;\r\n\tt->ti_second = dt.second;\r\n\tt->ti_hundred = dt.hsecond;\r\n#else\r\n\t_AX = 0x2c00;\r\n\tgeninterrupt(0x21);\r\n\tt->ti_hour = _CH;\r\n\tt->ti_minute = _CL;\r\n\tt->ti_second = _DH;\r\n\tt->ti_hundred = _DL;\r\n#endif\r\n\r\n\tDBG_RETURN_VALUES( (\"h:m:s.h=%u:%u:%u.%u\", t->ti_hour, t->ti_minute, t->ti_second, t->ti_hundred) )\r\n\tDBG_EXIT\r\n}\r\n"
  },
  {
    "path": "suppl/src/s_skipwd.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): skipwd\r\nsu(bsystem): misc\r\nty(pe): \r\nsh(ort description): Skip to end of word\r\nlo(ng description): Skips to the end of the word pointed to by \\para{s}.\\par\r\n\tThe end of a word is any character \\tok{ch}, for which\r\n\t\\tok{isspace(ch) || ch == '\\0'} is true.\\newline\r\n\tIf \\tok{*s} is an end-of-word character itself, \\tok{s} is returned.\r\npr(erequistes): \r\nva(lue): NULL: if \\tok{s == NULL}\r\n\t\\item \\para{s}: if \\tok{*s ==} end-of-word character\r\n\t\\item else: first end-of-word character of string \\para{s}\r\nre(lated to): skipws\r\nse(condary subsystems): \r\nwa: No quotes are recognized.\r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n#include <ctype.h>\r\n#include \"str.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *skipwd(const char *s)\r\n{\r\n\tDBG_ENTER(\"skipwd\", Suppl_misc)\r\n\r\n\tif(!s)\r\n\t\tDBG_RETURN_P( 0)\r\n\r\n\tDBG_ARGUMENTS( (\"str=%p \\\"%s\\\"\", s, s) )\r\n\r\n\twhile(*s && !isspace(*s)) ++s;\r\n\r\n\tDBG_RETURN_P( (char *)s)\r\n}\r\n"
  },
  {
    "path": "suppl/src/s_skipws.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): skipws\r\nsu(bsystem): misc\r\nty(pe): \r\nsh(ort description): Skip any whitespaces\r\nlo(ng description): Skips any whitespaces pointed to by \\para{s}.\r\npr(erequistes): \r\nva(lue): NULL: if \\tok{s == NULL}\r\n\t\\item \\para{s}: if \\tok{!isspace(*s) || *s == '\\0'}\r\n\t\\item else: first non-whitespace character or \\tok{'\\0'}\r\nre(lated to): skipwd\r\nse(condary subsystems): \r\nwa: No quotes are recognized.\r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <portable.h>\r\n#include <ctype.h>\r\n#include \"str.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nchar *skipws(const char *s)\r\n{\tDBG_ENTER(\"skipws\", Suppl_misc)\r\n\r\n\tif(!s)\r\n\t\tDBG_RETURN_P( 0)\r\n\r\n\tDBG_ARGUMENTS( (\"str=%p \\\"%s\\\"\", s, s) )\r\n\r\n\twhile(isspace(*s)) ++s;\r\n\r\n\tDBG_RETURN_P( (char *)s)\r\n}\r\n"
  },
  {
    "path": "suppl/src/sstr.src",
    "content": "/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tSecure string functions.\r\n\r\n\tThey accept NULLs as string/memory pointers.\r\n\r\n   $Log$\r\n   Revision 1.1  2006/06/17 03:25:06  blairdude\r\n   Suppl files in CVS\r\n\r\n   Revision 1.1  1999/01/18 05:32:29  ska\r\n   Initial revision\r\n\r\n\r\n*/\r\n\r\n#ifndef __SSTR_H\r\n#define __SSTR_H\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#define Strcmpi\tStricmp\r\n#define Strncmpi\tStrnicmp\r\n#define Memcmpi\tMemicmp\r\n\r\n"
  },
  {
    "path": "suppl/src/stpcat.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): stpcat\r\nsu(bsystem): portable\r\nty(pe): \r\nsh(ort description): Append a string to another\r\nlo(ng description): Appends a string to another one and return\r\n\tthe end of the constructed string.\r\npr(erequistes): \\tok{dst != NULL && src != NULL} and \\tok{dst[]}\r\n\tmust have enough space to append the string \\tok{src[]}.\r\nva(lue): pointer to the \\tok{'\\0'} terminator byte of the\r\n\tresulting string in \\tok{dst[]}\r\nre(lated to): strcpy\r\nse(condary subsystems): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#include <portable.h>\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include \"suppl.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\nchar *stpcat(char * const dst, const char * const src)\r\n{\tassert(dst);\r\n\tassert(src);\r\n\r\n\treturn stpcpy(strchr(dst, NUL), src);\r\n}\r\n"
  },
  {
    "path": "suppl/src/stpcpy.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tstpcpy(char *dst, char *src)\r\n\r\n\tCopy src onto dst\r\n\r\n\tReturn a pointer to the '\\0' of dst\r\n\r\n   Target compilers: Pacific C v7.51\r\n\r\nob(ject): stpcpy\r\nsu(bsystem): portable\r\nty(pe): \r\nsh(ort description): Copy a string onto another\r\nlo(ng description): Copies string \\tok{src[]} over \\tok{dst[]}\r\n\tand returns the end of the resulting string\r\npr(erequistes): \\tok{dst != NULL && src != NULL} and \\tok{dst[]}\r\n\tmust have enough space to copy \\tok{src[]} to\r\nva(lue): pointer to \\tok{'\\0'} terminator byte of the resulting\r\n\tstring\r\nre(lated to): \r\nse(condary subsystems): \r\nbu(gs): \r\nco(mpilers): Pacific HiTech C only\r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifdef COMPILE\r\n#undef COMPILE\r\n#endif\r\n\r\n#ifdef _PAC_NOCLIB_\r\n#define COMPILE\r\n#endif\r\n#ifdef __WATCOMC__\r\n#define COMPILE\r\n#endif\r\n\r\n#ifdef COMPILE\r\n#include <portable.h>\r\n\r\n#include <assert.h>\r\n\r\nchar *stpcpy(char * const dst, const char * const src)\r\n{\tregister char *p;\r\n\tregister const char *q;\r\n\r\n\tassert(dst);\r\n\tassert(src);\r\n\r\n\tp = dst - 1;\r\n\tq = src - 1;\r\n\twhile(*++p = *++q);\r\n\treturn p;\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/str.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tSupplemental string functions.\r\n\tInternal header file.\r\n\r\n*/\r\n\r\n#ifndef __STR_LOC\r\n#define __STR_LOC\r\n\r\n#include <assert.h>\r\n#include \"str.h\"\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/strnum.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob(ject): strnum\r\nsu(bsystem): cmdline\r\nty(pe): \r\nsh(ort description): Parse a numerical option string\r\nlo(ng description): Parses a string of a numeric option. The complete\r\n\tsupported syntax is:\\newline\r\n\t/^\\s*[+-]?(0x)?[0-9a-f][oqdbh]?\\s*$/i\r\n\t\\item The optional \"[+-]\" signs indicate that the number as signed.\r\n\tIn this case\r\n \tthe number itself must range between \\tok{INT_MIN} and \\tok{INT_MAX}.\r\n \tOtherwise the number is \\tok{0}..\\tok{UINT_MAX}.\r\n \t\\item\r\n \tThe optional \"(0x)\" prefix and \"[oqdbh]\" signs specify the radix of the\r\n \tnumber:\\newlist\r\n \t\\item 0x --> hexadecimal (radix == 16), [oqdbh] must not be present\r\n \t\\item [oqdbh] --> o & q: octal (radix == 8), d: decimal (radix == 10),\r\n \t\tb: binary (radix == 2), h: hexadecimal (radix == 16)\r\n \t\\endlist\r\n \tThe radix defaults to decimal, even if the first digit is \\tok{'0'}.\r\n \t\\item\r\n \tThe numbers itself \"[0-9a-f]\" can only contain digits valid for the\r\n \tspecified radix.\r\n \t\\endlist\\par\r\n \tIf \\tok{endp == NULL}, no error position is stored.\r\npr(erequistes): s != NULL && num != NULL\r\nva(lue): \r\n \t\t0: on success, \\tok{*endp} unchanged, \\tok{*num} contains the number\r\n \\item\t\telse: on failure, the error position is assigned to \\tok{*endp}.\r\n \t\t\\tok{*num} contains the value processed so far, zero when no\r\n \t\t\tdigit was parsed, yet.\r\nre(lated to): strbool atoi strtol\r\nse(condary subsystems): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#endif\r\n#include <ctype.h>\r\n#include <limits.h>\r\n#include \"str.loc\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\nint strnum(const char * const s, int * const num, char ** const endp)\r\n{\tchar *p, *q;\r\n\tint neg, radix, ch;\r\n\tunsigned n, maxn, modn;\r\n\r\n\tDBG_ENTER(\"strnum\", Suppl_cmdline)\r\n\r\n\tassert(s);\r\n\tassert(num);\r\n\r\n\tDBG_ARGUMENTS( (\"str=\\\"%s\\\"\", s) )\r\n\r\n\tn = 0;\r\n\tp = skipws(s);\t\t/* skip leading whitespaces */\r\n\r\n\t/* Scan sign */\r\n\tmaxn = INT_MAX;\r\n\tswitch(*p++) {\r\n\tcase '-':\tneg = 1;\tbreak;\r\n\tdefault:\t--p;\r\n\t\t\t\tmaxn = UINT_MAX;\r\n\tcase '+':\tneg = 0;\tbreak;\r\n\t}\r\n\r\n\t/* Aquire radix */\r\n\tq = skipwd(p) - 1;\r\n\tradix = 10;\r\n\tif(*p == '0' && toupper(p[1]) == 'X') {\t/* C style hexadecimal */\r\n\t\tp += 2;\r\n\t\tradix = 16;\r\n\t} else if(p < q) {\t\t\t\t/* check the last character */\r\n\t\tswitch(toupper(*q)) {\r\n\t\tcase 'B':\t\t\t\tradix = 2;\tbreak;\r\n\t\tcase 'O': case 'Q':\t\tradix = 8;\tbreak;\r\n\t\tcase 'D':\t\t\t\tradix = 10;\tbreak;\r\n\t\tcase 'H':\t\t\t\tradix = 16;\tbreak;\r\n\t\tdefault:\t++q;\t/* q is the upper limit */\r\n\t\t}\r\n\t}\r\n\tmodn = maxn % radix;\t/* maximum digit if n == maxn */\r\n\tmaxn /= radix;\r\n\r\n\t--p;\r\n\twhile(++p < q\t\t\t\t/* there is a next character */\r\n\t && n <= maxn) {\t\t\t/* can add the next character */\r\n\t\t\t/* transform next ASCII digit into number */\r\n\t\tch = toupper(*p) - '0';\r\n\t\tif(ch < 0\t\t\t\t\t\t\t/* invalid digit < '0' */\r\n\t\t || (ch > 9 && (ch -= 'A' - ('9' + 1)) < 10)\t/* invalid */\r\n\t\t || ch >= radix\t\t\t\t\t\t/* invalid greater than radix */\r\n\t\t || (ch > modn && n == maxn))\t\t/* overflow */\r\n\t\t\tbreak;\r\n\t\tn = n * radix + ch;\r\n\t}\r\n\r\n\tif(p == q)\t\t\t\t\t/* ignore trailing whitespaces */\r\n\t\tp = skipws(p);\r\n\r\n\t*num = neg? -n: n;\r\n\r\n\tif(!*p)\t\t\t/* no error */\r\n\t\tDBG_RETURN_I( 0)\r\n\r\n\tif(endp) *endp = p;\r\n\tDBG_RETURN_I( 1)\r\n}\r\n"
  },
  {
    "path": "suppl/src/suppldbg.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n   \tDeclarations for the local debug implementation\r\n\r\n*/\r\n\r\n#ifndef __SUPPL_DBG_LOC\r\n#define __SUPPL_DBG_LOC\r\n\r\n#include <stdarg.h>\r\n\r\n#include \"suppldbg.h\"\r\n#include \"supplio.h\"\r\n\r\n\t/* Extension appended to application name to form the logfile name */\r\n#define DBG_EXTENSION \".DBG\"\r\n\r\n\t/* Exit code if debug system terminates application\r\n\t\tE*() functions use 125 */\r\n#define DBG_EXIT_CODE 124\r\n\r\n/*\r\n\tThe log list is a double linked list;\r\n\r\n\tThe sentinel element contains the default flag ('+' == enabled or\r\n\t'-' == disabled). To look up, the list is always completely walked\r\n\tthrough and the last matched entry is used.\r\n\r\n\tEach element is prefixed by either '+' == enabled or '-' == disabled.\r\n*/\r\ntypedef struct SUPPL_LOG_LIST {\r\n\tstruct SUPPL_LOG_LIST *suppl_l_nxt;\r\n\tchar suppl_l_name[2];\t\t\t/* Dynamically expanded */\r\n} suppl_log_list_t;\r\n\r\n/* Declarations for the function logging package\r\n\r\n\t\"Stack\" expands to the currently active logging status and\r\n\tthe macro S() expands to a member of this status.\r\n*/\r\n\r\nstruct SUPPL_LOG_STATUS {\r\n\tstruct SUPPL_LOG_STATUS *suppl_l_nxt;\r\n\tsuppl_log_list_t suppl_l_files;\t\t/* files to be logged */\r\n\tsuppl_log_list_t suppl_l_classes;\t/* classes to be logged */\r\n\tsuppl_log_list_t suppl_l_functions;\t/* functions to be logged */\r\n\tint suppl_l_maxdepth;\t\t\t\t/* maximum nesting level */\r\n\tFLAG suppl_l_enabled;\t\t\t\t/* logging active? */\r\n\tFLAG suppl_l_indent;\t\t\t\t/* indent output? */\r\n\tFLAG suppl_l_ownFiles;\t\t\t\t/* 'files' member NOT inherited */\r\n\tFLAG suppl_l_ownClasses;\t\t\t/* 'classes' member NOT inherited */\r\n\tFLAG suppl_l_ownFunctions;\t\t\t/* 'functions' member NOT inherited */\r\n};\r\ntypedef struct SUPPL_LOG_STATUS suppl_log_stack_t;\r\n\r\nextern suppl_log_stack_t *suppl_Stack;\r\n#define S(member)\tsuppl_Stack->suppl_l_##member\r\n\r\nextern int suppl_l_nestlevel;\t\t\t\t/* current nesting level */\r\nextern FLAG suppl_l_fct_enabled;\t\t\t/* function class permits logging */\r\nextern FILE *suppl_l_logfile;\t\t\t\t/* logfile opened already? */\r\nextern char suppl_l_openmode[];\t\t\t\t/* how to open the logfile */\r\nextern long suppl_l_count;\t\t\t\t\t/* line counter */\r\n\r\n/* Prevent recursion of the debug/logging package */\r\nint suppl_log_lock(void);\r\nvoid suppl_log_unlock(void);\r\n\r\n#define suppl_log_chg_list(f,l,p)\t\\\r\n\tsuppl_log_chg_list_(&(f), &(l), p)\r\n\r\nvoid suppl_log_chg_list_(FLAG *ownCopy\r\n\t, suppl_log_list_t *baseCopy\r\n\t, suppl_log_sptr_t *p);\r\n\r\nsuppl_log_list_t *suppl_log_mkf_item(int flag, suppl_log_csptr_t s\r\n\t, size_t length);\r\nsuppl_log_list_t *suppl_log_mk_item(suppl_log_csptr_t s);\r\n\r\nvoid suppl_log_dup_list(suppl_log_list_t *list);\r\n#define suppl_log_del_list(list)\t\t\\\r\n\tsuppl_log_del_list_(aS(list))\r\nvoid suppl_log_del_list_(suppl_log_list_t *list);\r\n\r\nint suppl_log_match_item(suppl_log_list_t *item\r\n\t, suppl_log_csptr_t s);\r\nint suppl_log_find_list(suppl_log_list_t *list\r\n\t, suppl_log_csptr_t s);\r\nint suppl_log_item_enabled(suppl_log_list_t *list\r\n\t, suppl_log_csptr_t str);\r\nint suppl_log_find_list(suppl_log_list_t *list\r\n\t, suppl_log_csptr_t str);\r\nint suppl_log_match_list(suppl_log_list_t *list\r\n\t, suppl_log_csptr_t str);\r\n\r\n#define suppl_log_flag(flag,poi)\t\t\\\r\n\tsuppl_log_flag_(&(flag), (poi))\r\nvoid suppl_log_flag_(FLAG *flag, suppl_log_sptr_t *p);\r\n\r\nvoid suppl_log_log_item(suppl_log_csptr_t fmt, ...);\r\nvoid suppl_log_log_vitem(suppl_log_csptr_t fmt, va_list ap);\r\nvoid suppl_log_log_header(void);\r\nvoid suppl_log_log_trailer(void);\r\nvoid suppl_log_log_open(void);\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/supplio.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tDeclarations for the supplemental I/O functions.\r\n\tInternal declarations.\r\n\r\n*/\r\n\r\n#ifndef __SUPPLIO_INC\r\n#define __SUPPLIO_INC\r\n\r\n#include <assert.h>\r\n#include <portable.h>\r\n#include \"supplio.h\"\r\n\r\n#ifdef _MICROC_\r\n#define FF_OPENMODE_ARGS FLAG r, w, a, u, b;\r\n#define FF_OPENMODE_ARG &r\r\n#endif\r\n\r\nSuppl_ExtAttr *F_xinfo(const FILE * const fp, Suppl_ExtAttr ** const prev);\r\nextern Suppl_ExtAttr suppl_dfltExtAttr;\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/syslog.loc",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tInternal declarations for the SYSLOG subsystem.\r\n\r\n*/\r\n\r\n#ifndef __SYSLOG_LOC\r\n#define __SYSLOG_LOC\r\n\r\n#include <assert.h>\r\n#include <portable.h>\r\n#include <stdio.h>\r\n#include <stdarg.h>\r\n#include \"syslog.h\"\r\n\r\n/* How to construct the filenmae from the basename */\r\n#define SYSLOG_FNAM(fnam)\tEStrConcat(2, fnam, \".LOG\")\r\n\r\n/* Extract level & facility from priority */\r\n#define LEVEL(pri)\t(((pri) >> 12) & 0xf)\r\n#define FACILITY(pri)\t((pri) & 0xfff)\r\n\r\n/* Internal variables */\r\nextern int syslog_options;\r\nextern int syslog_facility;\r\nextern FILE *syslog_logfile;\r\nextern char *syslog_fnam;\r\nextern char syslog_openmode[];\r\nextern char *syslog_ident;\r\nextern int syslog_opencount;\r\n\r\n/*\r\n *\tDump one line via printf() into the log file\r\n *\tDump the time into the log file.\r\n *\tThe log file must be open already.\r\n */\r\nvoid syslog_print(const char * const format, ...);\r\nvoid syslog_vprint(const char * const format, va_list ap);\r\nvoid syslog_print_time(void);\r\n\r\n/*\r\n * Dump a newline character into the log file, if the passed\r\n * string does not terminate with one.\r\n */\r\nvoid syslog_eol(const char * const str);\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/src/toupperx.c",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\nob: toFUpper\r\nsu(bsystem): nls\r\nty(pe): \r\nsh(ort description): Upcases a character for filenames\r\nlo(ng description): Transforms a character to uppercase according the\r\n\tDOS NLS table for filename characters. If no such table is\r\n\tavailable, the standard C \\tok{toupper()} function is used.\r\npr(erequistes): \r\nva(lue): upcased character in the range: 0..255\r\nre(lated to): nlsInfo toUpper\r\nse(condary subsystems): \r\nbu(gs): \r\nco(mpilers): \r\n\r\nob: toUpper\r\nsu(bsystem): nls\r\nty(pe): \r\nsh(ort description): Upcases a character\r\nlo(ng description): Transforms a character to uppercase according the\r\n\tDOS NLS table for characters. If no such table is\r\n\tavailable, the standard C \\tok{toupper()} function is used.\r\npr(erequistes): \r\nva(lue): upcased character in the range: 0..255\r\nre(lated to): nlsInfo toFUpper toLower\r\nse(condary subsystems): \r\nbu(gs): \r\nco(mpilers): \r\n\r\nob: toLower\r\nsu(bsystem): nls\r\nty(pe): \r\nsh(ort description): Lowercases a character for filenames\r\nlo(ng description): Transforms a character to lowercase according the\r\n\tDOS NLS table for characters. If no such table is\r\n\tavailable, the standard C \\tok{tolower()} function is used.\r\npr(erequistes): \r\nva(lue): lowercased character in the range: 0..255\r\nre(lated to): nlsInfo toUpper\r\nse(condary subsystems): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#include \"initsupl.loc\"\r\n\r\n#ifndef _MICROC_\r\n#include <dos.h>\r\n#include <ctype.h>\r\n#endif\r\n#include <portable.h>\r\n#include \"suppl.h\"\r\n#include \"dynstr.h\"\r\n#include \"cntry.h\"\r\n#include \"fmemory.h\"\r\n\r\n#include \"suppldbg.h\"\r\n\r\n#ifdef RCS_Version\r\nstatic char const rcsid[] = \r\n\t\"$Id$\";\r\n#endif\r\n\r\n\r\nstatic int toMTrans(int ch, int len, fartbl iM(*)tbl, int (*fct)(int))\r\n{\r\n\t/* If len <= 0x80, the table has been filled only with\r\n\t\tthe values from 0x80..0xFF */\r\n\tch &= 0xFF;\r\n\treturn (len <= 0x80 && ch < 0x80)\r\n\t\t? (byte)fct(ch)\t\t/* this is the standard case */\r\n\t\t: dpeekb(tbl, ch);\r\n}\r\n\r\n#undef toupper\r\nint toFUpper(int ch)\r\n{\treturn toMTrans(ch, nlsInfo()->fupcaseLen, nlsInfo()->fupcaseTbl\r\n\t\t, toupper);\r\n}\r\n\r\nint toUpper(int ch)\r\n{\treturn toMTrans(ch, nlsInfo()->uppercaseLen, nlsInfo()->uppercaseTbl\r\n\t\t, toupper);\r\n}\r\n\r\n#undef tolower\r\n#if 0\r\nint toLower(int ch)\r\n{\treturn toMTrans(ch, nlsInfo()->lowercaseLen, nlsInfo()->lowercaseTbl\r\n\t\t, tolower);\r\n}\r\n#endif\r\n"
  },
  {
    "path": "suppl/sstr.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* This file was automatically generated from SSTR.SRC */\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tSecure string functions.\r\n\r\n\tThey accept NULLs as string/memory pointers.\r\n\r\n*/\r\n\r\n#ifndef __SSTR_H\r\n#define __SSTR_H\r\n\r\n#ifndef _MICROC_\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n#define Strcmpi\tStricmp\r\n#define Strncmpi\tStrnicmp\r\n#define Memcmpi\tMemicmp\r\n\r\n\r\n\r\n/* Generated string function replacements */\r\nvoid *Memccpy(void *dst, void const *src, int ch, size_t length);\r\nvoid *Memchr(void const *s, int ch, size_t length);\r\nint Memcmp(char const *s1, char const *s2, size_t length);\r\nvoid *Memcpy(void *dst, void const *src, size_t length);\r\nint Memicmp(char const *s1, char const *s2, size_t length);\r\nvoid *Memmove(void *dst, void const *src, size_t length);\r\nvoid *Memset(void *s, int ch, size_t length);\r\nchar *Stpcat(char *dst, char const *src);\r\nchar *Stpcpy(char *dst, char const *src);\r\nchar *Strcat(char *dst, char const *src);\r\nchar *Strchr(char const *s, int ch);\r\nint Strcmp(char const *s1, char const *s2);\r\nint Strcoll(char const *s1, char const *s2);\r\nchar *Strcpy(char *dst, char const *src);\r\nsize_t Strcspn(char const *str, char const *chset);\r\nchar *Strdup(char const *s);\r\nint Stricmp(char const *s1, char const *s2);\r\nsize_t Strlen(char const *s);\r\nchar *Strlwr(char *s);\r\nchar *Strncat(char *dst, char const *src, size_t length);\r\nint Strncmp(char const *s1, char const *s2, size_t length);\r\nchar *Strncpy(char *dst, char const *src, size_t length);\r\nint Strnicmp(char const *s1, char const *s2, size_t length);\r\nchar *Strnset(char *s, int ch, size_t length);\r\nchar *Strpbrk(char const *str, char const *chset);\r\nchar *Strrchr(char const *s, int ch);\r\nchar *Strrev(char *s);\r\nchar *Strset(char *s, int ch);\r\nsize_t Strspn(char const *str, char const *chset);\r\nchar *Strstr(char const *str, char const *substr);\r\nchar *Strtok(char *str, char const *delim);\r\nchar *Strupr(char *s);\r\nchar *Strend(char *s);\r\n\r\n\r\n#ifdef SUPPL_STR_REMAP\r\n\t/*Remap standard function names to replacements */\r\n\r\n#define strupr Strupr\r\n#define stricmp Stricmp\r\n#define memmove Memmove\r\n#define stpcpy Stpcpy\r\n#define strspn Strspn\r\n#define strchr Strchr\r\n#define strnset Strnset\r\n#define strcoll Strcoll\r\n#define memicmp Memicmp\r\n#define strnicmp Strnicmp\r\n#define stpcat Stpcat\r\n#define memccpy Memccpy\r\n#define strcpy Strcpy\r\n#define strcspn Strcspn\r\n#define memcpy Memcpy\r\n#define strlwr Strlwr\r\n#define strncpy Strncpy\r\n#define strlen Strlen\r\n#define strstr Strstr\r\n#define strrev Strrev\r\n#define memset Memset\r\n#define memchr Memchr\r\n#define strcmp Strcmp\r\n#define memcmp Memcmp\r\n#define strncat Strncat\r\n#define strcat Strcat\r\n#define strdup Strdup\r\n#define strtok Strtok\r\n#define strncmp Strncmp\r\n#define strrchr Strrchr\r\n#define strset Strset\r\n#define strpbrk Strpbrk\r\n#define strend Strend\r\n#endif\t/* defined(SUPPL_STR_REMAP) */\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/str.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tSupplemental string functions.\r\n\r\nob(ject): utoa10\r\nsu(bsystem): misc\r\nty(pe): M\r\nsh(ort description): Transform an unsigned decimal number into ASCII format\r\nlo(ng description): Transforms an unsigned decimal number into its ASCII\r\n\trepresentation.\r\npr(erequistes): buf != NULL\r\nva(lue): none\r\nre(lated to): itoa10\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\nob(ject): itoa10\r\nsu(bsystem): misc\r\nty(pe): M\r\nsh(ort description): Transform a signed decimal number into ASCII format\r\nlo(ng description): Transforms a signed decimal number into its ASCII\r\n\trepresentation.\r\npr(erequistes): buf != NULL\r\nva(lue): none\r\nre(lated to): utoa10\r\nse(condary subsystems): \r\nin(itialized by): \r\nwa(rning): \r\nbu(gs): \r\nco(mpilers): \r\n\r\n*/\r\n\r\n#ifndef __STR_H\r\n#define __STR_H\r\n\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#include <string.h>\r\n#endif\r\n#include <portable.h>\r\n\r\nchar *skipws(const char *s);\r\nchar *skipwd(const char *s);\r\nchar *singleword(char *s);\r\n\r\n/* void itoa10(int num, char * const buf); */\r\n/* void utoa10(int num, char * const buf); */\r\n#ifndef _MICROC_\r\n#define itoa10(num,buf)\titoa((num), (buf), 10)\r\n#define utoa10(num,buf) ultoa((unsigned)(num), (buf), 10)\r\n#else\r\n\t/* negative radix --> signed */\r\n#define itoa10(num,buf)\titoa((num), (buf), -10)\r\n\t/* positive radix --> unsigned */\r\n#define utoa10(num,buf)\titoa((num), (buf), 10)\r\n#endif\r\n\r\nint strnum(const char * const s, int * const num, char ** const endp);\r\nint strbool(char *s);\r\n\r\n/* memzero() fills a block of memory with 0; used throughout\r\n\tSUPPL where a larger amount of values of data types: (int), (short),\r\n\t(char) and pointers are to initialize with 0 or NULL.\r\n\tIt is unportable, but efficient on portable systems; because of this\r\n\tmacro places, where to port on failure, are easy to locate. */\r\n/* void memzero(void *poi, size_t length); */\r\n#define memzero(poi,length)\tmemset((poi), 0, (length))\r\n#define memzerobj(object)\tmemzero(&object,sizeof(object))\r\n#define memzerostrct(structure)\tmemzero(aS(structure),sizeof(structure))\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/supl_def.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n#ifndef __SUPPL_COMPILER_DEFINES\r\n#define __SUPPL_COMPILER_DEFINES\r\n\r\n/**********************************\r\n ***** Pacific HiTech C\r\n **********************************/\r\n#ifdef HI_TECH_C\r\n\t/* Probe if PAC is used in conjunction with CLib */\r\n#include <stddef.h>\r\n\r\n#ifdef _CLIB_\r\n#define _PAC_\t1\r\n#else\r\n#define _PAC_NOCLIB_\t1\r\n#endif\t/* _CLIB_ */\r\n\r\n#endif /* HI_TECH_C */\r\n\r\n\r\n/**********************************\r\n ***** Early Turbo C++\r\n **********************************/\r\n#ifdef __TURBOC__\r\n#if __TURBOC__ <= 0x297\r\n#define _TC_EARLY_\r\n#else\r\n#define _TC_LATER_\r\n#endif\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/suppl.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tDeclarations for the supplemental functions.\r\n\r\n\tThis header file is part of the \"portable\" subsystem\r\n\tand will be removed, or moved to another purpose.\r\n\r\n*/\r\n\r\n#ifndef __SUPPL_H\r\n#define __SUPPL_H\r\n\r\n#include <stdio.h>\r\n\r\n#include <supl_def.h>\r\n\r\n#include <portable.h>\r\n\r\n#define itemsof(array)\t(sizeof(array) / sizeof(array[0]))\r\n#define NIL(type)\t\t((type)0)\r\n\r\n/* length of the longmath numbers. */\r\n#define LSIZE sizeof(dword)\r\n\r\n#ifndef _MICROC_\r\n\r\n#define longsubi(a,b) ((a) -= (int)(b))\r\n#define longsubu(a,b) ((a) -= (unsigned)(b))\r\n#define longaddi(a,b) ((a) += (int)(b))\r\n#define longaddu(a,b) ((a) += (unsigned)(b))\r\n#define longmuli(a,b) ((a) *= (int)(b))\r\n#define longmulu(a,b) ((a) *= (unsigned)(b))\r\n#define longdivi(a,b) ((a) /= (int)(b))\r\n#define longdivu(a,b) ((a) /= (unsigned)(b))\r\n#define longseti(a,b) ((a) = (int)(b))\r\n#define longsetu(a,b) ((a) = (unsigned)(b))\r\n#define longshln(a,c) ((a) <<= (c))\r\n#define longshrn(a,c) ((a) >>= (c))\r\nint longcmp(long d1, long d2);\r\n#define longcmp_(a,b) ((signed long)(a) - (signed long)(b))\r\n#define longsgn(a)    ((signed long)(a))\r\n#define longclr(a)\t  ((a) = 0)\r\n\r\n#define poked(seg,ofs,value)\t(*(dword far*)MK_FP(seg,ofs) = (value))\r\n#define pokedd(seg,ofs,hi,lo)\t(*(dword far*)MK_FP(seg,ofs) = ((dword)(hi)<<16)|(lo))\r\n#define peekd(segm,ofs,value)\t((value) = *(dword far*)MK_FP(segm,ofs))\r\nint peekdd(word segm, word ofs, word *valHi, word *valLo);\r\n\r\ntypedef char far *fartbl;\t\t/* far table */\r\n#define dpeekc(fartable,idx)\t(*(((char far *)fartable) + (idx)))\r\n#define dpeekb(fartable,idx)\t(*(((byte far *)fartable) + (idx)))\r\n#define dpeekw(fartable,idx)\t(*(word far*)(((byte far *)fartable) + (idx)))\r\n\r\n#define _fmemcmpi _fmemicmp\r\n#define _fstrcmpi _fstricmp\r\n#define memcmpi memicmp\r\n\r\n#ifdef _PAC_NOCLIB_\r\nint memicmp(const void *s1, const void *s2, unsigned len);\r\nvoid *memccpy(void *s1, const void *s2, int ch, size_t len);\r\n#endif\r\n\r\n#else\t\t/* defined(_MICROC_) */\r\n\r\n#define longcmp_ longcmp\r\n#define longsgn(a) (longtst(a) && ((int*)(a))[1])\r\n\r\n#define fartbl dword\t\t/* pointer to far table */\r\n#define dpeekc(tbl,idx) (char)dpeekb((tbl), (idx))\r\nint dpeekb(fartbl fartable, int idx);\r\nword dpeekw(fartbl fartable, int idx);\r\nint memicmp(const void *s1, const void *s2, unsigned len);\r\nvoid *memccpy(void *s1, const void *s2, int ch, size_t len);\r\n\r\n#endif\t\t/* !defined(_MICROC_) */\r\n\r\n\r\n\r\n#define putcm fputcm\r\nint fputmc(int ch, int cnt, FILE *f);\r\n/*\tEmit the same character several times into the stream\r\n*/\r\n\r\n\r\nword DOSalloc(word length, int mode);\r\n/* Allocate a chunk of memory directly via the DOS API.\r\n\tlength is the number of paragraphes that shall be allocated.\r\n\tmode is the allocation strategy to be used.\r\n\r\n\tIf mode specifies to use high memory, the high memory will be\r\n\tautomatically made accessable.\r\n\r\n\tIf the bit 0x10 of mode is set, length is ignored and the size of\r\n\tthe largest unallocated block is returned, which can be allocated\r\n\tlater.\r\n\r\n\tThis function does not alter the allocation strategy permanently.\r\n\r\n\tReturn:\r\n\t\t0: Allocation failed\r\n\t\telse:\tif 0x10 of mode was clear: segment address of allocated memory\r\n\t\t\t\tif 0x10 of mode was set: the largest unallocated block\r\n*/\r\n\r\nint DOSresize(word segm, word length);\r\n/* Resize a chunk of memory directly via the DOS API.\r\n\tsegm is the segment to resize, it must be allocated via the DOS API\r\n\t\tor a comparable function, like DOSalloc(), allocBlk().\r\n\tlength is the new number of paragraphes.\r\n\r\n\tIf to resize the segment fails, the block of memory is not relocated\r\n\tinto a larger space of the DOS memory.\r\n\r\n\tReturn:\r\n\t\t0: resize failed\r\n\t\t!0: resize OK\r\n*/\r\n\r\nint DOSfree(const word segm);\r\n/* Free a chunk of memory directly via the DOS API.\r\n\tsegm is the segment to resize, it must be allocated via the DOS API\r\n\t\tor a comparable function, like DOSalloc(), allocBlk().\r\n\r\n\tReturn:\r\n\t\t0: free OK\r\n\t\t!0: DOS error code\r\n*/\r\n\r\n#define allocBlk(length,allocMode) DOSalloc(BLK_byte2para(length), allocMode)\r\n\r\n#ifdef _MICROC_\r\nword resizeBlk(const word segm, const unsigned length);\r\n#else\r\n#define resizeBlk(segm,length) DOSresize(segm, BLK_byte2para(length))\r\n#endif\r\n\r\n#define freeBlk DOSfree\r\n/* Free the segment using the DOSfree() function. */\r\n/* No differences, only for completeness. */\r\n\r\nunsigned BLK_byte2para(const unsigned bytes);\r\n/* Return the number of paragraphes that will be needed to store �bytes�\r\n\tbytes in.\r\n\r\n\tIf bytes == 0, the return value is zero, too.\r\n\r\n*/\r\n\r\nint addu(unsigned *u1, unsigned u2);\r\n/* Performs the operation:\r\n\t\t*u1 += u2;\r\n\tand returns, if an overflow occured.\r\n\r\n\tReturn:\t0: no overflow\r\n\t\t\t!0: overflow\r\n*/\r\n#ifdef __WATCOMC__\r\n#ifdef FARDATA\r\n#pragma aux addu = \\\r\n\t\"add word ptr es:[bx], ax\"\t\\\r\n\t\"sbb ax, ax\"\t\\\r\n\t__parm [__es __bx] [__ax]   \\\r\n\t__value [__ax]  \\\r\n\t__modify [__es __bx]\r\n#else\r\n#pragma aux addu = \\\r\n\t\"add word ptr [bx], ax\"\t\\\r\n\t\"sbb ax, ax\"\t\\\r\n\t__parm [__bx] [__ax]    \\\r\n\t__value [__ax]  \\\r\n\t__modify [__bx]\r\n#endif\r\n#endif\r\n\r\nint invokeDOS(nM(IREGS *prp));\r\n/* Invoke DOS using intr(0x21, prp).\r\n\r\n\tReturn:\r\n\t\t 0: DOS returned with Carry flag cleared\r\n\t\t!0: AX value (DOS error code) if DOS returned with Carry flag set\r\n*/\r\n\r\n#ifndef _CLIB_\r\nchar *stpcat(char * const dst, const char * const src);\r\n/* Append src to dst and return the address of the '\\0' character of dst\r\n*/\r\n#endif\r\n\r\n\r\n#if defined(__WATCOMC__) || defined(__GNUC__)\r\nchar *stpcpy(char * const dst, const char * const src);\r\n/*\tCopy src into dst\r\n\tReturn pointer to '\\0' terminator of dst\r\n*/\r\n\r\n/* different names */\r\n#ifndef ffblk\r\n#include <algnbyte.h>\r\nstruct ffblk {\r\n    char        ff_reserved[21];\r\n    byte        ff_attrib;\r\n    unsigned    ff_ftime;\r\n    unsigned    ff_fdate;\r\n    long        ff_fsize;\r\n    char        ff_name[13];\r\n};\r\n#include <algndflt.h>\r\n#endif\r\n\r\n#ifdef __WATCOMC__\r\n#define findfirst(pattern,buf,attrib) _dos_findfirst((pattern), (attrib)\t\\\r\n\t, (struct find_t*)(buf))\r\n#define findnext(buf) _dos_findnext((struct find_t*)(buf))\r\n\r\n#define FA_RDONLY _A_RDONLY\r\n#define FA_ARCH _A_ARCH\r\n#define FA_SYSTEM _A_SYSTEM\r\n#define FA_HIDDEN _A_HIDDEN\r\n#define FA_DIREC _A_SUBDIR\r\n#define FA_LABEL _A_VOLID\r\n\r\n#else /* __GNUC__ */\r\n\r\nint findfirst(const char * const pattern, struct ffblk *ff, int attrib);\r\nint findnext(struct ffblk *ff);\r\n\r\n#define FA_RDONLY   0x01\r\n#define FA_ARCH     0x20\r\n#define FA_SYSTEM   0x04\r\n#define FA_HIDDEN   0x02\r\n#define FA_DIREC    0x10\r\n#define FA_LABEL    0x08\r\n#endif\r\n\r\n#ifndef MAXDIR\r\n#define MAXDIR 66               /* 64: path; +1: root sign; +1: NUL terminator */\r\n#define MAXDRIVE 3              /* 1: drive letter; +1: ':'; +1: NUL terminator */\r\n#define MAXFILE 9               /* 8: name; +1: NUL terminator */\r\n#define MAXNAME 9\r\n#define MAXEXT 5                /* 3: name; +1: dot; +1: NUL terminator */\r\n#define MAXPATH (MAXDIR + MAXDRIVE + MAXNAME + MAXEXT - 3)\r\n#endif\r\n#endif\t/* WATCOMC */\r\n\r\n\r\n#ifdef _PAC_NOCLIB_\r\nchar *stpcpy(char * const dst, const char * const src);\r\n/* Copy src onto dst, Return a pointer to the '\\0' character of dst\r\n*/\r\n\r\nint getdisk(void);\r\n/*\tReturn the current working drive. 0 == A:, 1 == B: ...\r\n*/\r\n\r\nint setdisk(void);\r\n/*\tChange the current working drive. 0 == A:, 1 == B: ...\r\n\tReturns the number of available drive letters (not necessary\r\n\tcurrently accessable).\r\n*/\r\n\r\n/*\r\n *\tPacific does not offer any OS version information\r\n */\r\nunsigned osversion(void);\r\n/*\tReturn: _osmajor | (_osminor << 8)\r\n*/\r\n\r\n/*\r\n *\tNo findfirst()\r\n */\r\nstruct ffblk {\r\n    char        ff_reserved[21];\r\n    byte        ff_attrib;\r\n    unsigned    ff_ftime;\r\n    unsigned    ff_fdate;\r\n    long        ff_fsize;\r\n    char        ff_name[13];\r\n};\r\n\r\nint findfirst(const char * const pattern, struct ffblk *ff, int attrib);\r\n/*\tInitiate file search\r\n\tReturn:\t0 on success\r\n*/\r\n\r\nint findnext(struct ffblk *ff);\r\n/*\tNext file search\r\n\tReturn:\t0 on success\r\n*/\r\n\r\nvoid far *getdta(void);\r\n/*\tReturn current working DTA\r\n*/\r\n\r\nvoid setdta(void far *dta);\r\n/*\tSet current working DTA\r\n*/\r\n\r\nunsigned _psp_(void);\r\n/*\tReturn the current PSP\r\n*/\r\n\r\nvoid ctrlbrk(int (*fct)(void));\r\n/*\tSet new ^Break handler\r\n*/\r\n\r\n#endif\t/* _PAC_NOCLIB_ */\r\n\r\n#ifdef COMPILE\r\n#undef COMPILE\r\n#endif\r\n\r\n#ifdef _MICROC_\r\n#define COMPILE\r\n#endif\r\n#ifdef _PAC_NOCLIB_\r\n#define COMPILE\r\n#endif\r\n#ifdef __WATCOMC__\r\n#define COMPILE\r\n#endif\r\n#ifdef _TC_EARLY_\r\n#define COMPILE\r\n#endif\r\n\r\n#ifdef COMPILE\r\n#undef COMPILE\r\n\r\nchar *_getdcwd(int drive, char *buf, unsigned length);\r\n/*\tReturn the fully-qualified path of drive in the format:\r\n\t\t?:\\...\\...\\...\r\n\tIf buf == NULL, a buffer of length bytes is allocated.\r\n\r\n\tReturn:\r\n\t\tNULL: On failure\r\n\t\telse: on success (buf or allocated buffer)\r\n*/\r\n#endif\r\n\r\nint getbootdisk(void);\r\n/*\tas getdisk() but returns the boot drive\r\n\tReturn:\r\n\t\t1 == A:, 2 == B:\r\n\t\t0: failure\r\n*/\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/suppldbg.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $RCSfile$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tSUPPL common debugging features\r\n\r\n\tIf used by an application, SUPPL and the application will use the\r\n\tsame debugging driver and, therefore, debugging extends from the\r\n\tapplication into the functions included from SUPPL. This is\r\n\tuseful especially while debugging heap actions (alloc/dealloc).\r\n\r\n\tNote #1: If NDEBUG is defined, all debugging features are turned off!\r\n\tNote #2: This #include file MUST be included at the end of the list,\r\n\tat least behind all the standard #includes referencing via '<...>'.\r\n\tOtherwise it is possible that some redefines do not work or the\r\n\tcompiler will detect errors within standard include files.\r\n\r\n\tUnderstood debugging features:\r\n\tSUPPL_DBG_MEMORY:\r\n\t\tCauses that the macro chkMem performs an extensive test of\r\n\t\tthe logical memory management of DOS and the C runtime environment.\r\n\tSUPPL_DBG_HEAP:\r\n\t\tCauses that the macro 'chkHeap' actively checks the local\r\n\t\theap for corruption.\r\n\t\tchkHeap includes chkMem!\r\n\tSUPPL_LOG_MEMORY:\r\n\t\tCauses to redefine heap-related CLib functions (malloc, calloc,\r\n\t\trealloc, free,& strdup).\r\n\tSUPPL_LOG_FUNCTION:\r\n\t\tNote: These package was inspired by Fred Fish's DBUG package\r\n\t\t\tshipped with DMake v3+.\r\n\t\tWhen the macro SUPPL_LOG_NO_INFO is #define'ed prior including\r\n\t\tthis header file, the macro DBG_INFO() expands to nothing.\r\n\r\n\t\tCauses to active all of the DBG_* macros:\r\n\t\tDBG_ENTER() - logs that a function was entered\r\n\t\tDBG_ENTER1/DBG_ENTER2() - as DBG_ENTER, *1 -> declaration, *2 -> fct\r\n\t\tDBG_ARGUMENTS() - logs function arguments\r\n\t\tDBG_RETURN_VALUES() - logs function return values\r\n\t\tDBG_EXIT() - logs that a function was exited\r\n\t\tDBG_LEAVE() - logs that a function was exited (with parameter, no log)\r\n\t\tDBG_LONG_RETURN() - logs that a function was exited (with param & log)\r\n\t\tDBG_RETURN_?() - logs that a function was exited (with param & log)\r\n\t\tDBG_PRINT() - logs arbitary information\r\n\t\tDBG_INFO() - logs arbitary information of information class \"inf\"\r\n\t\tDBG_STRING() - logs a string in information class \"inf\"\r\n\t\tDBG_CHANGE_STATE() - changes logging status\r\n\t\tDBG_PUSH_STATE() - duplicates current logging status\r\n\t\tDBG_POP_STATE() - forget current logging status & restore previous one\r\n\t\tDBG_TERMINATE() - terminate application with a log message\r\n\r\n*/\r\n\r\n#ifndef __SUPPLDBG_H\r\n#define __SUPPLDBG_H\r\n\r\n#include <assert.h>\r\n#ifndef _MICROC_\r\n#include <stdlib.h>\r\n#endif\r\n#include <portable.h>\r\n\r\n/*\r\n *\tInitialize all macros with dummy values. They are undefined later\r\n *\tright before a debugging specific value is added.\r\n *\tInitializing them here ensures that they are correctly set for\r\n *\tnon-debugging.\r\n */\r\n#define chkHeap\t\t;\r\n#define chkMem\t\t;\r\n\r\n\r\n#ifdef NDEBUG\t\t\t/* native debug support disabled? */\r\n\r\n/* Turn off every SUPPL specific debugging feature */\r\n#undef SUPPL_DBG_HEAP\r\n#undef SUPPL_DBG_MEMORY\r\n#undef SUPPL_LOG_MEMORY\r\n#undef SUPPL_LOG_FUNCTION\r\n\r\n#else\r\n\r\n#ifdef SUPPL_DBG_ALL\r\n\r\n/* Turn on every SUPPL specific debugging feature */\r\n#define SUPPL_DBG_HEAP\r\n#define SUPPL_DBG_MEMORY\r\n#define SUPPL_LOG_MEMORY\r\n#define SUPPL_LOG_FUNCTION\r\n\r\n#endif\r\n\r\n#endif\t\t/* !defined(NDEBUG) */\r\n\r\n#ifdef SUPPL_ALWAYS_DEBUG_HEAP\r\n#define SUPPL_DBG_HEAP\r\n#endif\r\n#ifdef SUPPL_ALWAYS_DEBUG_MEMORY\r\n#define SUPPL_DBG_MEMORY\r\n#endif\r\n\r\n#ifdef SUPPL_DBG_MEMORY\r\n\r\n#undef chkMem\r\n#define chkMem\t\tsuppl_testMemChain();\r\n\r\n#endif\r\n\r\n\r\n#ifdef SUPPL_DBG_HEAP\r\n\r\n/* Define the macro 'chkHeap' to actively test the local heap for\r\n   corruption. Note: The macro must be used without semicolon!\r\n*/\r\n#undef chkHeap\r\n#if __TURBOC__ > 0x201\r\n#include <alloc.h>\r\n#ifdef NDEBUG\r\n#define chkHeap\tsuppl_testHeap();  chkMem\r\n#else\r\n#define chkHeap\tassert(heapcheck() == _HEAPOK); chkMem\r\n#endif\r\n#else\r\n#define chkHeap\tchkMem\r\n#endif\r\n\r\n#endif\r\n\r\n#ifdef SUPPL_LOG_MEMORY\r\n#include \"syslog.h\"\r\n\r\n/* Use internal wrappers for CLib symbols */\r\n\r\n#ifdef malloc\r\n#undef malloc\r\n#endif\r\n\r\n#ifdef realloc\r\n#undef realloc\r\n#endif\r\n\r\n#ifdef calloc\r\n#undef calloc\r\n#endif\r\n\r\n#ifdef free\r\n#undef free\r\n#endif\r\n\r\n#ifdef strdup\r\n#undef strdup\r\n#endif\r\n\r\n#define malloc(size)\t\tsuppl_malloc((size))\r\n#define calloc(nelem,size)\tsuppl_calloc((nelem), (size))\r\n#define realloc(poi,size)\tsuppl_realloc((poi), (size))\r\n#define free(poi)\t\t\tsuppl_free((poi))\r\n#define strdup(poi)\t\t\tsuppl_strdup((poi))\r\n\r\n#endif\r\n\r\n#ifdef SUPPL_LOG_FUNCTION\r\n\r\n/* The following macros are defined:\r\n\r\n\tDBG_EXTENSION\r\n\t\tExtension of the logfile\r\n\r\n\tDBG_LIBRARY\r\n\t\tIf redefined by the user, this macros specifies the name\r\n\t\tof the library, the current file is located in.\r\n\t\tDefaults to none.\r\n\r\n\tDBG_ALWAYS_FLUSHLOG\r\n\t\tIf defined, the log file is flushed each time one entry has been\r\n\t\twritten successfully into the logfile. (compile-time option\r\n\t\t- see INITSUPL.LOC!)\r\n\r\n\tDBG_ALWAYS_CLOSELOG\r\n\t\tIf defined, the log file is closed each time one entry has been\r\n\t\twritten successfully into the logfile. (compile-time option\r\n\t\t- see INITSUPL.LOC!)\r\n\t\tUse this option if system crashes corrupt the logfile or same\r\n\t\tentries won't appear there.\r\n\r\n\tNONE OF THESE MACROS MUST NOT BE USED WITH A TRAILING SEMICOLON!\r\n\r\n\tDBG_CLOSELOG\r\n\t\tClose the logfile.\r\n\r\n\tDBG_FLUSHLOG\r\n\t\tFlush the log file and make sure all data is written to disk\r\n\t\tand the directory entry has been updated.\r\n\t\tThis function should be called each time when it is possible\r\n\t\tthat the program is going to crash or is going to be\r\n\t\tasynchroneously terminated (e.g. Ctrl-Alt-Del).\r\n\r\n\tDBG_ENTER(char *function_name, char *function_class)\r\n\t\tEnters the function with name \"function_name\" and class. (see STATE)\r\n\t\tIt must be the first statement immediately following the variable\r\n\t\tdeclaration, because it will define a variable as well.\r\n\t\tThis macro must be pairly used with DBG_LEAVE or DBG_EXIT.\r\n\t\tAll of the other macros won't work without DBG_ENTER.\r\n\r\n\tDBG_ENTER1\r\n\t\tIs the variable declaration part of DBG_ENTER()\r\n\r\n\tDBG_ENTER2(char *function_name, char *function_class)\r\n\t\tIs the function calling part of DBG_ENTER()\r\n\r\n\tDBG_ARGUMENTS( (char *format_spec, arguments) )\r\n\t\tLogs the arguments of the current function. The parameters follow\r\n\t\tthe same rules as in DBG_PRINT. The only difference to DBG_PRINT\r\n\t\tis that the output can be selectively enabled/disabled.\r\n\r\n\tDBG_RETURN_VALUES( (char *format_spec, arguments) )\r\n\t\tLogs the retrun values of the current function. The parameters follow\r\n\t\tthe same rules as in DBG_PRINT. The only difference to DBG_PRINT\r\n\t\tis that the output can be selectively enabled/disabled.\r\n\r\n\tDBG_EXIT\r\n\t\tExits a void function. The \"return\" statement is already\r\n\t\tincluded.\r\n\r\n\tDBG_LEAVE(return_expression)\r\n\t\tAs DBG_EXIT, but \"return_expression\" is passed as an argument\r\n\t\tto \"return\". The return value is NOT logged automatically.\r\n\r\n\tDBG_LONG_RETURN(type, char *format_spec, return_expression)\r\n\t\tThis macro combines: DBG_RETURN_VALUES and DBG_LEAVE.\r\n\t\tUnfortunately return_expression would be evaluated twice,\r\n\t\ttherefore it is evaluated once and stored into a temporary\r\n\t\tvariable of the specified type; 'type' must (or, at least,\r\n\t\tshould) be of the same type as the function returns. The\r\n\t\tsame applies to the format specification, which is passed\r\n\t\tto printf().\r\n\r\n\tDBG_RETURN_#(return_expression)\r\n\t\tAs DBG_RETURN(), '#' is the uppercase letter usually find\r\n\t\twithin a printf()-format specification:\r\n\t\t#\ttype\t\t\tformat_spec\r\n\t\tC\tchar\t\t\t\"%c\"\r\n\t\tS\tchar*\t\t\t\"\\\"%s\\\"\"\r\n\t\tI\tint\t\t\t\t\"%d\"\r\n\t\tU\tunsigned\t\t\"%u\"\r\n\t\tX\tint\t\t\t\t\"0x%x\"\r\n\t\tL\tlong\t\t\t\"%ld\"\r\n\t\tUL\tunsigned long\t\"%lu\"\r\n\t\tF\tdouble\t\t\t\"%f\"\r\n\t\tG\tdouble\t\t\t\"%g\"\r\n\t\tP\tvoid *\t\t\t\"%p\"\r\n\r\n\t\tA 'B' may be prefixed to buffer \"return_expression\" within a\r\n\t\ttemporary variable to suppress side effects and/or multiple\r\n\t\tevalutation of a complex expression.\r\n\r\n\tDBG_PRINT( char *information_class, (char *format_spec, arguments) )\r\n\t\tLogs ONE line. \"format_spec\" is a valid printf() format\r\n\t\tstring and should not contain no '\\n' character. Both the\r\n\t\tformat spec and the arguments must be enclosed into\r\n\t\tparenthises.\r\n\t\tThe information_class specifies whether or not this information\r\n\t\tis logged (see STATE).\r\n\r\n\tDBG_INFO( (char *format_spec, arguments) )\r\n\t\tAs DBG_PRINT(), but prints message of class \"inf\".\r\n\t\tBecause these macro may generate a lot of strings, they can be\r\n\t\tindividually disable with the SUPPL_LOG_NO_INFO macro. It must\r\n\t\tbe #define'ed prior including \"suppldbg.h\"\r\n\r\n\tDBG_STRING(char *string)\r\n\t\tAs DBG_INFO(), but prints a string only\r\n\r\n\tDBG_PUSH_STATE\r\n\t\tDuplicates the current logging status. Any subsequent DBG_CHANGE_STATE\r\n\t\twill effect the newly generated status only.\r\n\t\tIf there is no status currently, this function is ignored.\r\n\r\n\tDBG_POP_STATE\r\n\t\tDiscards the topmost logging status and restores the previous one.\r\n\t\tIf there is only one or none pushed status, this function is\r\n\t\tignored.\r\n\r\n\tDBG_CHANGE_STATE(char *state_spec)\r\n\t\tModifies the current logging status according the state_spec.\r\n\t\tIf there is no current status, a new one will be created.\r\n\t\tThe state_spec is a sequence of log_specs delimited by semicolons.\r\n\t\tA log_spec consists of a log_format_letter and arguments,\r\n\t\tthe arguments can be delimited by commas, if necessary.\r\n\t\tNo superflous whitespaces or such are allowed!\r\n\r\n\t\tThe following log_format_letters are understood:\r\n\r\n\t\td#\t\tset the maximum logging depth (#: unsigned number)\r\n\t\t\t\tdefault: no limit\r\n\t\tf?*,...\tfiles to be logged (*: one file name), each filename\r\n\t\t\t\tis prefixed by '+' enable, or '-' disable file.\r\n\t\t\t\tWildcards are not allowed. The filename must be specified\r\n\t\t\t\tthe same way as the compiler named them in their __FILE__\r\n\t\t\t\tmacro, this is usually the fully-qualified filename.\r\n\t\t\t\t\"+\" alone logs everything (clears every previous settings),\r\n\t\t\t\t\"-\" alone logs nothing (also clears every previous settings).\r\n\t\t\t\tdefault: log everything.\r\n\t\tc?*,...\tfunctions to be logged (*: one function name)\r\n\t\t\t\tSyntax the same as \"f*,...\", but the string must\r\n\t\t\t\tcase-sensitively match the string passed to DBG_ENTER()\r\n\t\tl?\t\tglobally enable/disable logging (?: + enable, - disable)\r\n\t\ti?\t\tindent output (?: + enable, - disable)\r\n\t\t\t\tIf disbale the nesting level is inserted as number, otherwise\r\n\t\t\t\tas a repetive count of \"|  \" strings\r\n\t\tC?*,...\tclasses to be logged\r\n\t\t\t\tSyntax the same as \"f*,...\", but the string must either\r\n\t\t\t\tcase-sensitively match one of the classes specified as\r\n\t\t\t\tfunction_class (DBG_ENTER) or information_class (DBG_PRINT)\r\n\t\t\t\tor one of the SUPPL classes:\r\n\t\t\t\tinformation classes:\r\n\t\t\t\t\t\"arg\" - DBG_ARGUMENTS\r\n\t\t\t\t\t\"rv\"  - DBG_RETURN_VALUE\r\n\t\t\t\t\t\"fct\" - DBG_ENTER & DBG_EXIT/DBG_LEAVE\r\n\t\t\t\t\t\"inf\" - informative information\r\n\r\n\t\t\t\tfunction classes:\r\n\t\t\t\t\t\"env\" - environment\r\n\t\t\t\t\t\"mcb\" - MCB\r\n\t\t\t\t\t\"mem\" - memory\r\n\t\t\t\t\t\"str\" - string\r\n\t\t\t\t\t\"ini\" - INI file\r\n\t\t\t\t\t\"cmd\" - command line handling\r\n\t\t\t\t\t\"err\" - error wrappers\r\n\t\t\t\t\t\"dfn\" - filename functions\r\n\t\t\t\t\t\"fil\" - FILE wrappers\r\n\t\t\t\t\t\"lmt\" - long mathematics\r\n\t\t\t\t\t\"nls\" - NLS\r\n\t\t\t\t\t\"log\" - syslog / logging\r\n\t\t\t\t\t\"msc\" - misc.\r\n\r\n\t\t\t\tNote: function and information classes share the same\r\n\t\t\t\tname space.\r\n\t\t\t\tNote: If the library name is specify with DBG_LIBRARY,\r\n\t\t\t\tone must enable the library as well. All SUPPL files\r\n\t\t\t\tuse the library name \"SUPPL\". E.g. to enable SUPPL logging,\r\n\t\t\t\tit is _not_ sufficient to specify \"C+\", but \"C+,+SUPPL\",\r\n\t\t\t\tnote that \"+SUPPL\" must trail \"+\"!\r\n\t\t\t\tDefaults to '-' (disable everything).\r\n\r\n\tDBG_TERMINATE(char *string)\r\n\t\tlogs the string, then \"program terminated by debug system\",\r\n\t\tthen terminates the application via exit(DBG_EXIT_CODE)\r\n*/\r\n\r\n#ifndef DBG_LIBRARY\r\n#define DBG_LIBRARY 0\r\n#endif\r\n\r\n#define DBG_CLOSELOG\t\t\t\t\t\t\t\t\\\r\n\tsuppl_log_close();\r\n\r\n#define DBG_FLUSHLOG\t\t\t\t\t\t\t\t\\\r\n\tsuppl_log_flush();\r\n\r\n#define DBG_ENTER1\t\t\t\t\t\t\t\t\t\\\r\n\tauto suppl_log_local_data_t suppl_log_data;\r\n\r\n#define DBG_ENTER2(fct_name, fct_class)\t\t\t\t\\\r\n\tsuppl_log_enter(DBG_LIBRARY, __FILE__, __LINE__, &suppl_log_data\t\\\r\n\t\t, (fct_name), (fct_class));\r\n\r\n#define DBG_ENTER(fct_name, fct_class)\t\t\t\t\\\r\n\tDBG_ENTER1\t\t\t\t\t\t\t\t\t\t\\\r\n\tDBG_ENTER2(fct_name, fct_class)\r\n\r\n#define DBG_ARGUMENTS( info )\t\t\t\t\t\t\\\r\n\tDBG_PRINT( Suppl_class_arg , info )\r\n\r\n#define DBG_RETURN_VALUES( info )\t\t\t\t\t\\\r\n\tDBG_PRINT( Suppl_class_rv , info )\r\n\r\n#define DBG_EXIT\t\t\t\t\t\t\t\t\t\\\r\n\t{\tsuppl_log_leave(&suppl_log_data);\t\t\\\r\n\t\treturn; }\r\n\r\n#define DBG_LEAVE(expr)\t\t\t\t\t\t\t\t\\\r\n\t{\tsuppl_log_leave(&suppl_log_data);\t\t\\\r\n\t\treturn (expr); }\r\n\r\n#define DBG_LONG_RETURN(type, fmt, expr)\t\t\t\\\r\n\t{\ttype suppl_temp_var;\t\t\t\t\t\t\\\r\n\t\tsuppl_temp_var = (expr);\t\t\t\t\t\\\r\n\t\tDBG_RETURN_VALUES( (fmt, suppl_temp_var) )\t\\\r\n\t\tDBG_LEAVE( suppl_temp_var )\t\t\t\t\t\\\r\n\t}\r\n\r\n#define DBG_RETURN(fmt, expr)\t\t\t\t\t\\\r\n\t{\tDBG_RETURN_VALUES( (fmt, (expr)) )\t\t\\\r\n\t\tDBG_LEAVE( (expr) )\t\t\t\t\t\t\\\r\n\t}\r\n\r\n#if 1\r\n#define DBG_PRINT(inf_class, info)\t\t\t\t\t\\\r\n\t{ if(suppl_log_print_1((inf_class)))\t\t\t\\\r\n\t\t\tsuppl_log_print_2 info;\t\t\t\t\t\\\r\n\t}\r\n#else\r\n#define DBG_PRINT(inf_class, info)\t\t\t\t\t\\\r\n\t{ if(suppl_log_class_enabled((inf_class)))\t\t\\\r\n\t\t\tsuppl_log_log info;\t\t\t\t\t\t\\\r\n\t}\r\n#endif\r\n\r\n#ifdef SUPPL_LOG_NO_INFO\r\n#define DBG_INFO(info)\t\t\t\t\t\t\t\t;\r\n#define DBG_STRING(info)\t\t\t\t\t\t\t\t;\r\n#else\r\n#define DBG_INFO( info )\t\t\t\t\t\t\\\r\n\tDBG_PRINT( Suppl_class_inf , info )\r\n#define DBG_STRING(str)\t\t\tDBG_INFO( (str) )\r\n#endif\r\n\r\n#define DBG_PUSH_STATE\t\t\t\t\t\t\t\t\\\r\n\tsuppl_log_push();\r\n\r\n#define DBG_POP_STATE\t\t\t\t\t\t\t\t\\\r\n\tsuppl_log_pop();\r\n\r\n#define DBG_CHANGE_STATE(state)\t\t\t\t\t\t\\\r\n\tsuppl_log_change((state));\r\n\r\n#define DBG_TERMINATE(loginfo)\t\t\t\t\t\t\\\r\n\tsuppl_log_terminate((loginfo));\r\n\r\n#else\r\n\r\n/* Generate pseudo-macros */\r\n#define DBG_CLOSELOG\t\t\t\t\t\t\t;\r\n#define DBG_FLUSHLOG\t\t\t\t\t\t\t;\r\n#define DBG_ENTER1\t\t\t\t\t\t\t\t;\r\n#define DBG_ENTER2(fct_name, fct_class)\t\t\t;\r\n#define DBG_ENTER(fct_name, fct_class)\t\t\t;\r\n#define DBG_ARGUMENTS( info )\t\t\t\t\t;\r\n#define DBG_RETURN_VALUES( info )\t\t\t\t;\r\n#define DBG_EXIT\t\t\t\t\t\t\t\treturn;\r\n#define DBG_LEAVE(expr)\t\t\t\t\t\t\treturn (expr);\r\n#define DBG_LONG_RETURN(t,f,expr)\t\t\t\treturn (expr);\r\n#define DBG_RETURN(f,expr)\t\t\t\t\t\treturn (expr);\r\n#define DBG_PRINT(inf_class, info)\t\t\t\t;\r\n#define DBG_INFO( info )\t\t\t\t\t\t;\r\n#define DBG_STRING(str)\t\t\t\t\t\t\t;\r\n#define DBG_PUSH_STATE\t\t\t\t\t\t\t;\r\n#define DBG_POP_STATE\t\t\t\t\t\t\t;\r\n#define DBG_CHANGE_STATE(state)\t\t\t\t\t;\r\n#define DBG_TERMINATE(string)\t\t\t\t\tsuppl_log_exit((string));\r\n\r\n#endif\r\n\r\n/* Format specs used for the DBG_RETURN_*() macros */\r\n#define DBG_RETURN_FMT_SPEC_C\t\"%c\"\r\n#define DBG_RETURN_FMT_SPEC_S\t\"\\\"%s\\\"\"\r\n#define DBG_RETURN_FMT_SPEC_I\t\"%d\"\r\n#define DBG_RETURN_FMT_SPEC_U\t\"%u\"\r\n#define DBG_RETURN_FMT_SPEC_X\t\"0x%x\"\r\n#define DBG_RETURN_FMT_SPEC_L\t\"%ld\"\r\n#define DBG_RETURN_FMT_SPEC_UL\t\"%lu\"\r\n#define DBG_RETURN_FMT_SPEC_F\t\"%f\"\r\n#define DBG_RETURN_FMT_SPEC_G\t\"%g\"\r\n#define DBG_RETURN_FMT_SPEC_P\t\"%p\"\r\n\r\n#define DBG_RETURN_BC(expr)\tDBG_LONG_RETURN(char, DBG_RETURN_FMT_SPEC_C, (expr))\r\n#define DBG_RETURN_BS(expr)\tDBG_LONG_RETURN(char*, DBG_RETURN_FMT_SPEC_S, (expr))\r\n#define DBG_RETURN_BI(expr)\tDBG_LONG_RETURN(int, DBG_RETURN_FMT_SPEC_I, (expr))\r\n#define DBG_RETURN_BU(expr)\tDBG_LONG_RETURN(unsigned, DBG_RETURN_FMT_SPEC_U, (expr))\r\n#define DBG_RETURN_BX(expr)\tDBG_LONG_RETURN(int, DBG_RETURN_FMT_SPEC_X, (expr))\r\n#define DBG_RETURN_BL(expr)\tDBG_LONG_RETURN(long, DBG_RETURN_FMT_SPEC_L, (expr))\r\n#define DBG_RETURN_BUL(expr)\tDBG_LONG_RETURN(unsigned long, DBG_RETURN_FMT_SPEC_UL, (expr))\r\n#define DBG_RETURN_BF(expr)\tDBG_LONG_RETURN(double, DBG_RETURN_FMT_SPEC_F, (expr))\r\n#define DBG_RETURN_BG(expr)\tDBG_LONG_RETURN(double, DBG_RETURN_FMT_SPEC_G, (expr))\r\n#define DBG_RETURN_BP(expr)\tDBG_LONG_RETURN(void *, DBG_RETURN_FMT_SPEC_P, (expr))\r\n\r\n#define DBG_RETURN_C(expr)\tDBG_RETURN(DBG_RETURN_FMT_SPEC_C, (expr))\r\n#define DBG_RETURN_S(expr)\tDBG_RETURN(DBG_RETURN_FMT_SPEC_S, (expr))\r\n#define DBG_RETURN_I(expr)\tDBG_RETURN(DBG_RETURN_FMT_SPEC_I, (expr))\r\n#define DBG_RETURN_U(expr)\tDBG_RETURN(DBG_RETURN_FMT_SPEC_U, (expr))\r\n#define DBG_RETURN_X(expr)\tDBG_RETURN(DBG_RETURN_FMT_SPEC_X, (expr))\r\n#define DBG_RETURN_L(expr)\tDBG_RETURN(DBG_RETURN_FMT_SPEC_L, (expr))\r\n#define DBG_RETURN_UL(expr)\tDBG_RETURN(DBG_RETURN_FMT_SPEC_UL, (expr))\r\n#define DBG_RETURN_F(expr)\tDBG_RETURN(DBG_RETURN_FMT_SPEC_F, (expr))\r\n#define DBG_RETURN_G(expr)\tDBG_RETURN(DBG_RETURN_FMT_SPEC_G, (expr))\r\n#define DBG_RETURN_P(expr)\tDBG_RETURN(DBG_RETURN_FMT_SPEC_P, (expr))\r\n\r\n/*\r\n *\tDeclarations of functions\r\n */\r\n\r\n/* Some special log functions:\r\n\tmalloc --> malloc(size) = poi; <success|failure>\r\n\tcalloc --> malloc(size) = poi; <success|failure>\r\n\trealloc --> realloc(poi, size) = poi; <success|failure>\r\n\tfree --> free(poi);\r\n\tstrdup -->\tmalloc(size) = poi;\t<success|failure>\r\n\r\n\tThese functions will automatically open the logfile if necessary.\r\n*/\r\nextern void suppl_log_malloc(void const * const newpoi, const size_t size);\r\n/* extern void suppl_log_calloc(void const * const newpoi, const size_t nelem, const size_t size); */\r\n#define suppl_log_calloc(newpoi,nelem,size)\t\t\\\r\n\tsuppl_log_malloc((newpoi), (nelem) * (size))\r\nextern void suppl_log_realloc(void const * const newpoi, const void * const oldpoi, const size_t size);\r\nextern void suppl_log_free(const void * const oldpoi);\r\nextern void suppl_log_strdup(char const * const newpoi, const char * const string);\r\n\r\n/* These functions substitutes the associated function and\r\n\tcall suppl_log_*(), too. */\r\nextern void *suppl_malloc(const size_t size);\r\nextern void *suppl_calloc(const size_t nelem, const size_t size);\r\nextern void *suppl_realloc(void * const poi, const size_t size);\r\nextern void suppl_free(void * const poi);\r\nextern char *suppl_strdup(const char * const string);\r\n\r\n/* Function to test if the DOS Memory Chain has been corrupted\r\n\tif so, the application is terminated */\r\nextern void suppl_testMemChain(void);\r\nextern void suppl_testHeap(void);\r\n\r\n/* These functions are the backend of the logging package */\r\ntypedef unsigned suppl_log_lvl_t;\t/* nesting level type */\r\ntypedef unsigned long suppl_log_linenr_t;\t/* compiler line number type */\r\ntypedef const char * suppl_log_sptr_t;\t/* string pointer */\r\ntypedef const char * const suppl_log_csptr_t;\t/* string pointer */\r\ntypedef struct {\r\n\tsuppl_log_lvl_t\tsuppl_l_prv_nestlevel;\r\n\tFLAG\t\t\tsuppl_l_prv_fct_enabled;\r\n\tsuppl_log_sptr_t suppl_l_fctname;\r\n} suppl_log_local_data_t;\r\n\r\nvoid suppl_log_enter(suppl_log_sptr_t library_name\r\n\t, suppl_log_csptr_t file_name\r\n\t, suppl_log_linenr_t linenr\r\n\t, suppl_log_local_data_t *data\r\n\t, suppl_log_csptr_t function_name\r\n\t, suppl_log_csptr_t function_class);\r\nvoid suppl_log_leave(suppl_log_local_data_t *data);\r\nint suppl_log_class_enabled(suppl_log_csptr_t classname);\r\nvoid suppl_log_log(suppl_log_csptr_t fmt, ...);\r\nint suppl_log_print_1(suppl_log_csptr_t inf_class);\r\nvoid suppl_log_print_2(suppl_log_csptr_t fmt, ...);\r\nvoid suppl_log_push(void);\r\nvoid suppl_log_pop(void);\r\nvoid suppl_log_change(suppl_log_csptr_t state);\r\nvoid suppl_log_flush(void);\r\nvoid suppl_log_close(void);\r\nvoid suppl_log_terminate(suppl_log_csptr_t loginfo);\r\nvoid suppl_log_exit(suppl_log_csptr_t loginfo);\r\n\r\n\r\n/*\r\n *\tStrings of the function classes used within SUPPL\r\n *\tdefined as constant character arrays to prevent that each file\r\n *\tcreates its own local copy of the string in its data segment\r\n */\r\nextern const char Suppl_appName[];\r\nextern const char Suppl_cmdline[];\r\nextern const char Suppl_dfn[];\r\nextern const char Suppl_dynstr[];\r\nextern const char Suppl_env[];\r\nextern const char Suppl_error[];\r\nextern const char Suppl_farmem[];\r\nextern const char Suppl_inifile[];\r\nextern const char Suppl_inifile1[];\r\nextern const char Suppl_inifile2[];\r\nextern const char Suppl_inifile3[];\r\nextern const char Suppl_mcb[];\r\nextern const char Suppl_misc[];\r\nextern const char Suppl_nls[];\r\nextern const char Suppl_portable[];\r\nextern const char Suppl_SUPPL[];\r\nextern const char Suppl_supplio[];\r\nextern const char Suppl_syslog[];\r\nextern const char Suppl_usr[];\r\n\r\n/*\r\n *\tStrings of the log classes used within SUPPL\r\n *\tdefined as constant character arrays to prevent that each file\r\n *\tcreates its own local copy of the string in its data segment\r\n */\r\nextern const char Suppl_class_arg[];\r\nextern const char Suppl_class_rv[];\r\nextern const char Suppl_class_fct[];\r\nextern const char Suppl_class_inf[];\r\nextern const char Suppl_class_env[];\r\nextern const char Suppl_class_mcb[];\r\nextern const char Suppl_class_mem[];\r\nextern const char Suppl_class_str[];\r\nextern const char Suppl_class_ini[];\r\nextern const char Suppl_class_cmd[];\r\nextern const char Suppl_class_err[];\r\nextern const char Suppl_class_dfn[];\r\nextern const char Suppl_class_fil[];\r\nextern const char Suppl_class_lmt[];\r\nextern const char Suppl_class_nls[];\r\nextern const char Suppl_class_log[];\r\nextern const char Suppl_class_msc[];\r\n#endif\t\t/* defined(__DBUG_H) */\r\n"
  },
  {
    "path": "suppl/supplio.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tDeclarations for the supplemental I/O functions.\r\n\r\n\tTo overcome the difference between Micro-C and ANSI C:\r\n\tAll identifiers starts with an uppercase 'F', the leading\r\n\tlowercase 'f' is stripped, if present.\r\n\r\n\tFunctions that will automatically terminate the program with an\r\n\tappropriate error message if the action fails. They have an uppercase\r\n\t'E' instead of the 'F'. The Eopen(), Ecreate() and Eclose() functions\r\n\tuse the Fxopen() and Fxclose() to save the extended attributes;\r\n\tthey use the filename to issue with the error messages.\r\n\r\n\tThree functions support the \"extended attributes per file\" feature:\r\n\tFxopen(): open a file and generate & store the extended attributes\r\n\tFxclose(): close the file and destroy the extended attributes\r\n\tFxinfo(): retrieve the extended attributes\r\n\r\n\tThe implementation is such that Fxopen() returns a normal (FILE*),\r\n\tin order to be passed to the normal F*() functions, but also sets\r\n\tup an association between the (FILE*) pointer and the extended\r\n\tattributes.\r\n\r\n\tIf the macro SUPPL_USE_EXTENDED_ATTRIBUTES is defined prior\r\n\t#include'ing this header file, Fxopen() and Fxclose() replace\r\n\tFopen() and Fclose() by default.\r\n\r\n*/\r\n\r\n#ifndef __SUPPLIO_H\r\n#define __SUPPLIO_H\r\n\r\n#include <stdio.h>\r\n#include <supl_def.h>\r\n#ifndef __PORTABLE_H\r\n#include <portable.h>\r\n#endif\r\n\r\n#ifdef _PAC_NOCLIB_\r\n/*\r\n *\tMissing fpos_t and assoc. functions\r\n */\r\n\r\ntypedef long fpos_t;\r\n\r\n#define fsetpos(stream,position) fseek((stream), *(position), 0)\r\nint fgetpos(FILE * const fp, fpos_t * const pos);\r\n/* fsetpos() is similar to fseek() and fgetpos() to ftell(), though,\r\n\tbetter portabel. Both return 0 (zero) on success.\r\n*/\r\n#endif\r\n\r\n/*\r\n *\tMacros passed into Fsetmode()\r\n */\r\n#define FF_RD 1\t\t/* read access */\r\n#define FF_WR 2\t\t/* write access */\r\n#define FF_RW 3\t\t/* read & write access */\r\n\r\n/*\r\n *\tReplacement of stdio functions\r\n *\tAll of these macros evaluate all parameter exactly once.\r\n */\r\n#define Fflush fflush\r\n#define Fyclose fclose\r\n#define Frewind rewind\r\n#define Fgetc(fp) getc((fp))\r\n#define Fputc(c,fp) putc((c),(fp))\r\n#define Ffgetc(fp) fgetc((fp))\r\n#define Ffputc(c,fp) fputc((c),(fp))\r\n#define Fgets fgets\r\n#define Fputs fputs\r\n#define Ferror ferror\r\n#define Fclearerr clearerr\r\n#ifndef _MICROC_\r\n#define Fget(buf,size,fp) fread((buf), 1, (size), (fp))\r\n#define Fput(buf,size,fp) fwrite((buf), 1, (size), (fp))\r\n#define Fgetpos(fp,pos) fgetpos((fp), (pos))\r\n#define Fsetpos(fp,pos) fsetpos((fp), (pos))\r\n#define Fsetmode(fp,mode) \t/* overcome Micro-C bug with R&W files */\r\n#define Fseeki(fp,ofs)\tfseek((fp), (long)(ofs), SEEK_CUR)\r\n#define Fseekc(fp,pos)\tFseeki((fp), (ofs))\r\n#define Fpseekc(fp,pos)\tFseeki((fp), *(ofs))\r\n#define Fseeke(fp)\tfseek((fp), (long)0, SEEK_END)\r\n#define Fyopen fopen\r\n#define Fseek(fp,pos,whence)\tfseek((fp), (long)(pos), (whence))\r\n#define Fpseek(fp,pos,whence)\tFseek((fp), *(pos), (whence))\r\n#define Fileno(fp) fileno((fp))\r\n#define Fdopen fdopen\r\n#define Feof feof\r\n#else\r\n#include <file.h>\r\n#ifndef SEEK_SET\r\n#define SEEK_SET 0\r\n#define SEEK_CUR 1\r\n#define SEEK_END 2\r\n#endif\r\n#define fpos_t dword\r\n#define Fput fput\r\n#define Fget fget\r\nvoid Fsetmode(FILE *fp, int mode);\r\nint Fgetpos(FILE *fp, fpos_t *pos);\r\n#define Fsetpos(fp,pos)\tFseek((fp), (pos), SEEK_SET)\r\nint Fseeki(FILE *fp, int ofs);\r\n#define Fseekc(fp,pos)\tFseek((fp), (pos), SEEK_CUR)\r\n#define Fpseekc(fp,pos)\tFseekc((fp),(pos))\r\n#define Fseeke(fp)\tfseek((fp), 0, 0, SEEK_END)\r\nFILE *Fyopen(char *fnam, char *mode);\r\nFILE *Fdopen(int fd, char *mode);\r\nint Fseek(FILE *fp, dword *pos, int whence);\r\n#define Fpseek Fseek\r\n#define Fileno(fp)\t(fp)->FILE_handle\r\nint Feof(FILE *fp);\r\n#endif\r\n#define FFgetpos(fp,pos) Fgetpos((fp), aS(pos))\r\n#define FFsetpos(fp,pos) Fsetpos((fp), aS(pos))\r\n\r\n/* Read/write a buffer to the file.\r\n *\tIs a function in order to evaluate all parameters only once.\r\n *\tReturn:\r\n *\t\t0: on success\r\n */\r\nint FFget(void * const buf, size_t len, FILE *const f);\r\nint FFput(const void * const buf, size_t len, FILE *const f);\r\n\r\n/*\r\n * Commit a file\r\n *\r\n *\tFlushes the buffers cached by the C library, and\r\n *\tFlushes the buffers cached by the system and also makes sure\r\n *\tthat the directory structure is updated.\r\n */\r\n#define Fcommit fcommit\r\nint fcommit(FILE *fp);\r\nint commit(int fd);\r\n\r\n/* Read a line into dynamical memory.\r\n *\r\n *\tThere is always an '\\n' (newline) character at the end of the line,\r\n *\teven at the end of file without one.\r\n *\r\n *\tReturn:\r\n *\t\tNULL: on failure (out of memory)\r\n *\t\telse: pointer to malloc()'ed buffer, must be free()'ed by the user\r\n *\t\t\tif the returned buffer is a pointer to \"\", EOF or a read\r\n *\t\t\terror was encountered.\r\n *\t\t\tNote: The \"\" must also be free()'ed.\r\n */\r\nchar *Fgetline(FILE * const f);\r\n\r\n\r\nFILE *Ftmpfile(void);\r\n/* Create and open a temporary file in binary mode\r\n\r\n\tShould be closed by Fxclose() in order to remove the file.\r\n\r\n\tReturn:\r\n\t\tNULL: on failure (e.g. malloc() failed, no writeble directory found)\r\n\t\telse: opened FILE* pointer to be closed with Fxclose()\r\n*/\r\n\r\nFILE *F_tmpfile(const char * const fnam);\r\n/* Create and open a temporary file in binary mode\r\n\r\n\tShould be closed by Fxclose() in order to remove the file.\r\n\r\n\tReturn:\r\n\t\tNULL: on failure (e.g. malloc() failed, or fnam == NULL)\r\n\t\t\tremoves external file 'fnam' if it exists\r\n\t\telse: opened FILE* pointer to be closed with Fxclose()\r\n*/\r\n\r\nchar *Ftmpnam(const char * const ext);\r\n/* Create a temporary filename, create it as a zero-length file and\r\n\treturn its name.\r\n\r\n\tThe name is overwritten the next time Ftmpnam(), Ftmpdir(),\r\n\tEtmpnam() or Etmpdir() is called.\r\n\r\n\tReturn:\r\n\t\tNULL: on failure, e.g. malloc() failed, no writeble directory found\r\n*/\r\n\r\nchar *Ftmpdir(void);\r\n/* Return the current writeble temporary directory with a trailing\r\n\tbackslash.\r\n\r\n\tThe user must free() the returned string manually.\r\n\tThis function overwrites the string returned by Ftmpnam() or\r\n\tEtmpnam().\r\n\r\n\tReturn:\r\n\t\tNULL: on failure, e.g. malloc() failed, no directory found\r\n\t\telse: pointer to pathname\r\n*/\r\n\r\n#define Fposcpy(dst,src)\tmemcpy((dst), (src), sizeof(fpos_t))\r\n/* Copy the value of one position to another location\r\n*/\r\n\r\n\t/* if debug enabled --> use the function and provide the test\r\n\t\tif fpos_t==long */\r\nint Fposcmp(const fpos_t * const pos1, const fpos_t * const pos2);\r\n\r\n#ifdef NDEBUG\r\n#define Fposcmp(pos1,pos2)\t\\\r\n\tlongcmp1(nM(*(unsigned long*))pos1, nM(*(unsigned long*))pos2)\r\n#endif\r\n/* Compare both positions\r\n\tReturn:\r\n\t\t<0: if pos1 < pos2\r\n\t\t=0: if pos1 = pos2\r\n\t\t>0: if pos1 > pos2\r\n*/\r\n\r\n#define Fpos2dword(fpos,longPos) (longPos) = (dword)(fpos);\r\n#define Fppos2dword(fpos,longPos) *(longPos) = (dword)(fpos);\r\n/* Extract the file position from a (fpos_t) type\r\n\r\n\tNote: There is _NO_ reverse function.\r\n\r\n\tAlso note: (fpos_t) is known to contain more than just the\r\n\tfile position, when special text handling code is enabled, such\r\n\tas multi-byte characters.\r\n*/\r\n\r\nint Fmaxbuf(byte ** const buf, size_t * const len);\r\n/* Allocate are rather large amount of memory, usually a power of 2\r\n\tReturn: 0 on success\r\n */\r\n\r\nint Fcopyto(FILE * const fdst, FILE * const fsrc, const fpos_t * const pos);\r\n/* Copy (a part of) a file to another.\r\n\tBoth files must be already opened with the proper permissions and\r\n\tfile modes (e.g. both either binary or text, fdst has write permission,\r\n\tfsrc has read permission).\r\n\tAny bytes from fsrc are copied to fdst upto, but excluding to the\r\n\tposition 'pos'.\r\n\tIf the soruce file is in text mode, it is possible that 'pos' points\r\n\tto an invalid file position. In this case the behaviour is undefined.\r\n\r\n\tReturn:\r\n\t\t0: OK\r\n\t\telse: on failure\r\n*/\r\n\r\nint Fcopy(FILE * const fdst, FILE * const fsrc);\r\n/* Copy any byte from fsrc into fdst\r\n\tReturn: 0 on success\r\n*/\r\n\r\nint Fcopyi(FILE * const fdst, FILE * const fsrc, size_t len);\r\n/* Copy len byte from fsrc into fdst\r\n\tReturn: 0 on success\r\n*/\r\n\r\nint Fcopyl(FILE * const fdst, FILE * const fsrc, dword iM(*) len);\r\n/* Copy len byte from fsrc into fdst\r\n\tReturn: 0 on success\r\n*/\r\n\r\nint Fcopybuf(FILE * const fdst, FILE * const fsrc, byte * const buf\r\n\t, const size_t len, size_t * const num);\r\n/* Copies one block from one stream into another one.\r\n\tReturn: 0 on success\r\n*/\r\n\r\n/*\r\n *\tReplace for the F*() functions to automatically terminate the\r\n *\tprogram if the action fails.\r\n *\r\n *\tIf the FILE* pointer is associated with an extended attribute,\r\n *\tthe message contains the name of the file.\r\n */\r\n\r\nFILE *Eopen(const char * const fnam, const char * const mode);\r\n/* Open file as Fopen(), on failure return: \"Cannot open file\"\r\n*/\r\n\r\nFILE *Ecreate(const char * const fnam, const char * const mode);\r\n/* Open file as Fopen(), on failure return: \"Cannot create file\"\r\n*/\r\n\r\nvoid Eclose(FILE *f);\r\n/* Close the file and free all allocated resources. If the error flag\r\n\tis true, the program terminates with: \"Error to access file\"\r\n*/\r\n\r\n#define Erewind\tFrewind\r\n#define Egetc Fgetc\r\n#define Efgetc Ffgetc\r\n#define Efputc Ffputc\r\n#define Eputc Fputc\r\n#define Esetmode\tFsetmode\r\n#define Efileno Fileno\r\n/* Definitions that don't generate error states or, if they would be\r\n\tchecked, it could be drastically performance drop */\r\n\r\n\r\nchar *Egets(char * const str, size_t size, FILE * const fp);\r\n/* Inputs a line from the stream; on failure the program\r\n\tis terminated with: \"Cannot read from file\"\r\n\tReturn: NULL: if EOF\r\n\t\t\telse: str\r\n*/\r\n\r\nchar *Eputs(const char * const str, FILE * const fp);\r\n/* Outputs a line into the stream; on failure the program\r\n\tis terminated with: \"Cannot write into file\"\r\n\tReturn: str\r\n*/\r\n\r\nvoid *Eget(void * const buf, size_t size, FILE * const fp);\r\n/* Read size bytes from the stream into the buffer; on failure\r\n\tterminate the program with: \"Cannot read from file\"\r\n\tReturn: buf\r\n*/\r\n\r\nvoid Eput(const void * const buf, size_t size, FILE * const fp);\r\n/* Write size bytes from the buffer into the stream; on failure\r\n\tterminate the program with: \"Cannot write into file\"\r\n*/\r\n\r\n#define EEgetpos(fp,pos) Egetpos((fp), aS(pos))\r\nvoid Egetpos(FILE * const fp, fpos_t * const pos);\r\n/* Retreive the file position from the stream; on failure terminate\r\n\tthe program with: \"Cannot access file\"\r\n*/\r\n\r\n#define EEsetpos(fp,pos) Esetpos((fp), aS(pos))\r\nvoid Esetpos(FILE * const fp, const fpos_t * const pos);\r\n/* Seek to the position saved in *pos; on failure terminate the\r\n\tprogram with: \"Cannot access file\"\r\n*/\r\n\r\n#define Eclearerr Fclearerr\r\nvoid Eerror(const FILE * const fp);\r\n/* Terminate the program with \"Cannot access file\" if the ferror()\r\n\tstatue is true.\r\n*/\r\n\r\nvoid Ereaderr(const FILE * const fp);\r\nvoid Ewriteerr(const FILE * const fp);\r\n/* Terminate the program with \"Cannot read from file\" or \"Cannot\r\n\twrite to file\" if the ferror() status is true\r\n*/\r\n\r\n#ifndef _MICROC_\r\n#define Eseeki(fp,ofs)\tEseek((fp), (long)(ofs), SEEK_CUR)\r\n#define Eseekc(fp,pos)\tEseeki((fp), (ofs))\r\n#define Epseekc(fp,pos)\tEseeki((fp), *(ofs))\r\n#define Eseeke(fp)\tEseek((fp), (long)0, SEEK_END)\r\n#define Epseek(fp,pos,whence)\tEseek((fp), *(pos), (whence))\r\nvoid Eseek(FILE * const fp, dword pos, int whence);\r\n#else\r\n#define Eseeki(fp,ofs)\tEfseek((fp), (ofs), SEEK_CUR)\r\n#define Eseeke(fp)\tEfseek((fp), 0, SEEK_END)\r\nvoid Efseek(FILE *fp, int pos, int whence);\r\n#define Eseekc(fp,pos)\tEseek((fp), (ofs), SEEK_CUR)\r\n#define Epseekc(fp,pos)\tEseek((fp), (ofs), SEEK_CUR)\r\n#define Epseek Eseek\r\nvoid Eseek(FILE * fp, dword *pos, int whence);\r\n#endif\r\n/* On failure terminate with: \"Cannot access file\"\r\n*/\r\n\r\n/* Read a line into dynamical memory.\r\n *\r\n *\tOn error, an appropriate message is issued and the program\r\n *\tis terminated.\r\n *\r\n *\tThere is always an '\\n' (newline) character at the end of the line,\r\n *\teven at the end of file without one.\r\n *\r\n *\tReturn:\r\n *\t\tNULL: EOF (or read error)\r\n *\t\telse: pointer to malloc()'ed buffer, must be free()'ed by the user\r\n */\r\nchar *Egetline(FILE * const f);\r\n\r\nFILE *Etmpfile(void);\r\n/* Create and open a binary temporary file. On failure the program\r\n\tis terminated with: Cannot create temporary file\r\n\tThe file is create with mode \"w+b\"\r\n*/\r\n\r\nchar *Etmpnam(const char * const ext);\r\n/* Create a temporary filename with the extension ext. On failure\r\n\tterminate the program.\r\n\r\n\tThe returned string is overwritten by the next call to Ftmpnam(),\r\n\tFtmpdir(), Etmpnam() or Etmpdir().\r\n*/\r\n\r\nchar *Etmpdir(void);\r\n/* Return the current writeble temporary directory with a trailing backslash.\r\n\tOn failure the program is terminated\r\n\tThe returned string must be free()'ed by the user of this function.\r\n\tThis function overwrites the string returned by Ftmpnam() or Etmpnam().\r\n*/\r\n\r\n\r\n/*\r\n *\tExtended attributes\r\n */\r\nstruct Suppl_ExtAttr_ {\t/* extended attributes */\r\n\tstruct Suppl_ExtAttr_ *sea_nxt;\r\n\tFILE *sea_fp;\t\t/* associated FILE* pointer; if NULL this is the\r\n\t\t\t\t\t\t\tdefault entry */\r\n\tchar *sea_fnam;\t\t/* absolute filename; dflt: \"<<unknown filename>>\" */\r\n\tFLAG sea_istmp;\t\t/* is temporary file */\r\n};\r\n#ifdef _MICROC_\r\n#define Suppl_ExtAttr struct Suppl_ExtAttr_\r\n#else\r\ntypedef struct Suppl_ExtAttr_ Suppl_ExtAttr;\r\n#endif\r\n\r\nextern Suppl_ExtAttr suppl_dfltExtAttr;\t/* Returned by Fxinfo() on failure */\r\n\r\nSuppl_ExtAttr *F_xopen(const char * const fnam, const char * const mode);\r\nFILE *Fxopen(const char * const fnam, const char * const mode);\r\nFILE *Exopen(const char * const fnam, const char * const mode);\r\nvoid Fxclose(FILE *fp);\r\nvoid Exclose(FILE *fp);\r\nSuppl_ExtAttr *F_xinfo(const FILE * const fp, Suppl_ExtAttr ** const prev);\r\nSuppl_ExtAttr *Fxinfo(const FILE * const fp);\r\n#define E_xinfo F_xinfo\r\n#define Exinfo Fxinfo\r\n/* Return the extended attributes associated with the FILE* pointer fp;\r\n\r\n\tIf fp is not associated, a default entry is returned, which 'fp' is\r\n\tNULL, but all other members contain some sort of useful data\r\n\r\n\tNote: F_xinfo() is for internal puprose only.\r\n*/\r\n\r\nvoid Fxcloseall(void);\r\n/* Close all functions opened by Fxopen()\r\n */\r\n\r\n#ifdef SUPPL_USE_EXTENDED_ATTRIBUTES\r\n#define Fopen Fxopen\r\n#define Fclose Fxclose\r\n#define Eopen Exopen\r\n#define Eclose Exclose\r\n#else\r\n#define Fopen Fyopen\r\n#define Fclose Fyclose\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "suppl/syslog.h",
    "content": "/*\r\n    This file is part of SUPPL - the supplemental library for DOS\r\n    Copyright (C) 1996-2000 Steffen Kaiser\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free\r\n    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n*/\r\n/* $Id$\r\n   $Locker$\t$Name$\t$State$\r\n\r\n\tImplementation of the Unix-like syslog() function for DOS.\r\n\tThe absent of an independed syslogd deamon caused some\r\n\tdifferences in the internal functionality of the function,\r\n\tmeaning that some flags have no effect and that the call to\r\n\topenlog() is mandetory rather than optional.\r\n\r\n\tAlso, the '%m' is not implemented right now and any useage of\r\n\tthis token will result in undefined behaviour (sorry).\r\n\r\n\tSee also the Linux MAN page: SYSLOG.MAN.\r\n\r\n*/\r\n\r\n#ifndef __SYSLOG_H\r\n#define __SYSLOG_H\r\n\r\n#include <stdarg.h>\r\n\r\n/*****************************************\r\n ******** Constants for flags etc. *******\r\n *****************************************/\r\n/*\r\n * openlog() options. Use a | combination of these:\r\n */\r\n#define LOG_CONS 0\t\t\t/* NOT IMPLEMENTED -- NO EFFECT */\r\n          /*  write directly to system console  if  there  is  an\r\n              error while sending to system logger */\r\n\r\n#define LOG_NDELAY 0\t\t/* NOT IMPLEMENTED -- NO EFFECT */\r\n          /*  open the connection immediately (normally, the con-\r\n              nection is opened when the first message is logged) */\r\n\r\n#define LOG_PERROR 1\r\n          /*  print to stderr as well */\r\n\r\n#define LOG_PID 2\r\n          /*  include PID with each message */\r\n\r\n#define LOG_NOTIME 4\t\t/* unique to SUPPL */\r\n\t\t  /*  do not prepend the date & time syslog() is called */\r\n\r\n/*\r\n * openlog()/syslog() facilities. Use only one of these:\r\n * Note: the DOS implementation does not really use them, instead it\r\n * prepends them at the start of the line as a number.\r\n */\r\n#define LOG_AUTH 1\r\n           /* security/authorization  messages  (DEPRECATED   Use\r\n              LOG_AUTHPRIV instead) */\r\n\r\n#define LOG_AUTHPRIV 2\r\n           /* security/authorization messages (private) */\r\n\r\n#define LOG_CRON 3\r\n           /* clock daemon (cron and at) */\r\n\r\n#define LOG_DAEMON 4\r\n           /* other system daemons */\r\n\r\n#define LOG_KERN 5\r\n           /* kernel messages */\r\n\r\n#define LOG_LOCAL0 24\r\n#define LOG_LOCAL1 25\r\n#define LOG_LOCAL2 26\r\n#define LOG_LOCAL3 27\r\n#define LOG_LOCAL4 28\r\n#define LOG_LOCAL5 29\r\n#define LOG_LOCAL6 30\r\n#define LOG_LOCAL7 31\r\n           /* reserved for local use */\r\n\r\n#define LOG_LPR 6\r\n           /* line printer subsystem */\r\n\r\n#define LOG_MAIL 7\r\n           /* mail subsystem */\r\n\r\n#define LOG_NEWS 8\r\n           /* USENET news subsystem */\r\n\r\n#define LOG_SYSLOG 9\r\n           /* messages generated internally by syslogd */\r\n\r\n#define LOG_USER 10\t\t\t\t/* default */\r\n           /* generic user-level messages */\r\n\r\n#define LOG_UUCP 11\r\n           /* UUCP subsystem */\r\n\r\n/*\r\n * level -- importance of the log message. Can be |'ed to a facility\r\n * to construct a priority.\r\n * Use only one of these:\r\n */\r\n#define LOG_EMERG 0x1000\r\n           /* system is unusable */\r\n\r\n#define LOG_ALERT 0x2000\r\n           /* action must be taken immediately */\r\n\r\n#define LOG_CRIT 0x3000\r\n           /* critical conditions */\r\n\r\n#define LOG_ERR 0x4000\r\n           /* error conditions */\r\n\r\n#define LOG_WARNING 0x5000\r\n           /* warning conditions */\r\n\r\n#define LOG_NOTICE 0x6000\r\n           /* normal, but significant, condition */\r\n\r\n#define LOG_INFO 0x7000\r\n           /* informational message */\r\n\r\n#define LOG_DEBUG 0x0000\r\n           /* debug-level message */\r\n\r\n/*****************************************\r\n ******** Functions **********************\r\n *****************************************/\r\n\r\nvoid openlog(const char * const ident, int option, int  facility);\r\nvoid syslog( int priority, char *format, ...);\r\nvoid syslogo( int priority, char *format, ...);\r\nvoid syslogv( int priority, char *format, va_list ap);\r\nvoid closelog( void );\r\n\r\n#endif\r\n"
  },
  {
    "path": "tests/args.bat",
    "content": "@echo off\r\necho 0=%0\r\necho 1=%1\r\necho 2=%2\r\necho 3=%3\r\necho 4=%4\r\necho 5=%5\r\necho 6=%6\r\necho 7=%7\r\necho 8=%8\r\necho 9=%9\r\n"
  },
  {
    "path": "tests/bat1.bat",
    "content": "echo in bat 1\r\ncall bat2.bat\r\necho back in bat 1\r\n"
  },
  {
    "path": "tests/bat2.bat",
    "content": "echo in bat 2\r\ncall bat3.bat ../nonexistantdir/argument1 ..\\nonexistantdir\\argument2 3\\4\\5/6\r\necho back in bat 2\r\n"
  },
  {
    "path": "tests/bat3.bat",
    "content": "echo in bat 3\r\necho %1\r\necho all the args [%1 %2 %3 %4 %5 %6 %7 %8 %9]\r\necho leaving bat 3"
  },
  {
    "path": "tests/benny.bat",
    "content": "@echo off\r\n: Test of Benny levels\r\n\r\n: Run after a program has been invoked, which does set the error level\r\n: to 1==A:, 2==B:, ..., 26==Z: (else: error)\r\n\r\nSET drv=\r\nFOR %%Z IN (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF ERRORLEVEL H%%Z SET drv=%%Z\r\nIF ERRORLEVEL 27 SET drv=\r\nIF \"%drv%\"==\"\" ECHO ERROR: No drive letter - Exit code == %ERRORLEVEL%\r\nIF NOT \"%drv%\"==\"\" ECHO Drive letter: %drv%:\r\n"
  },
  {
    "path": "tests/compat.bat",
    "content": "@ECHO OFF\r\nSET DEV=1\r\nIF NOT \"%1\"==\"EXTENDED\" IF NOT \"%1\"==\"\" GOTO %1\r\nREM This is intended to be a primary batch file for standard MSDOS compatible testing\r\nREM Run with option EXTENDED for testing advanced FreeCOM commands supported\r\nREM Requires errlvl.exe in same directory and current directory writable\r\nREM Note: if piping output to a file without being visible, press Enter twice after a small delay\r\nREM Note: if updating, then change SET DEV=0 at top to SET DEV=1 for additional PAUSEs\r\nREM This file uses many quirks and tests and is spaghetti like for testing batch file processing\r\nREM\r\nREM commands with a * are post MSDOS version 6 commands\r\nREM commands with a ** are not included in FreeCOM by default but optionally compiled in\r\nREM neither * nor ** commands are be tested if 1st argument is not EXTENDED\r\nREM unsupported:         SETLOCAL ENDLOCAL ASSOC COLOR LOCK UNLOCK ELSE\r\nREM\r\nREM BATCH file commands: REM ECHO GOTO IF *ELSE NOT EXIST FOR PAUSE SHIFT EXIT *SETLOCAL *ENDLOCAL\r\nREM EXECUTION commands:  CALL COMMAND LOADFIX LOADHIGH LH PATH *ASSOC\r\nREM GENERAL commands:    SET CLS *COLOR TYPE PROMPT BREAK VERIFY VER *TITLE\r\nREM VOLUME commands:     VOL *LOCK *UNLOCK\r\nREM DIRECTORY commands:  CD CHDIR MD MKDIR RD RMDIR *PUSHD *POPD\r\nREM FILE commands:       COPY DEL ERASE DIR MOVE REN RENAME TRUENAME\r\nREM DATE/TIME commands:  DATE TIME\r\nREM INTL & CON commands: CHCP CTTY\r\nREM note: environment variables also expanded in REMarks\r\nREM INTERNAL VARIABLES:  %%ERRORLEVEL%% (%ERRORLEVL%)\r\nREM ENV VARIABLES:       %%COMSPEC%% %%DIRCMD%% %%PROMPT%% %%PATH%%\r\nREM FreeCOM commands:    ALIAS BEEP CDD DIRS DOSKEY HISTORY LFNFOR **MEMORY ? WHICH WHERE\r\nIF \"%DEV%\"==\"1\" pause\r\nREM PROMPT options: \r\nREM $b vertical bar (pipe) *** can't use actual symbol as COMMAND will try to do the redirection\r\nREM $d system date\r\nREM $e esc char\r\nREM $g greater than symbol\r\nREM $h destructive backspace\r\nREM $i less than symbol\r\nREM $n current (default) drive letter\r\nREM $p current (default) path including drive\r\nREM $q =\r\nREM $t sytem time\r\nREM $v DOS/COMMAND.COM version string\r\nREM $_ \\r\\n\r\nREM $$ $\r\nREM WILDCARDS: * and ?\r\nREM PIPING/REDIRECTION: gt overwrite gtgt append pipe and ls pipe to another program\r\nREM These are remarks and should be ignored\r\n\r\nREM this will fail on MS/PC DOS COMMAND.COM but not CMD, ignored by FreeCOM\r\nTITLE FreeCOM tests\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\nREM testing ECHO\r\nIF \"%1\"==\"EXTENDED\" ECHO /?\r\nECHO ON\r\nECHO this command should be echo'd and then this comment shown\r\n@ECHO OFF\r\nECHO this comment should be shown but the command not echo'd\r\nECHO this should say ECHO is off\r\nECHO\r\nECHO and this should say ECHO is on\r\nECHO ON\r\n@ECHO\r\n@ECHO OFF\r\nECHO and this should be followed by a blank line\r\nECHO,\r\nECHO the following command shows the version 3 times  \r\nECHO *** these will not match other COMMAND.COMs !!!\r\nECHO testing variations of explicit no echo (using @) with echo on\r\nECHO and then explicit no echo (using @) with echo off\r\nECHO and again with just ECHO OFF\r\nECHO ON\r\n@VER\r\n@ECHO OFF\r\n@VER\r\nVER\r\nIF \"%DEV%\"==\"1\" pause\r\nREM determine if running under CMD on Windows, ver /r not supported and sets errorlevel\r\nECHO if running under CMD on Windows this will say syntax incorrect\r\nver /r\r\nSET SHELL_IS_CMD=0\r\nif \"%ERRORLEVEL%\"==\"1\" SET SHELL_IS_CMD=1\r\nREM determine if running under COMMAND.COM, it doesn't support labels longer than 8 chars\r\nGOTO tst_cmd_freecom\r\n:tst_cmd_\r\nSET SHELL_IS_COMMAND=1\r\nGOTO t_cmd_end\r\n:tst_cmd_freecom\r\nSET SHELL_IS_COMMAND=0\r\n:t_cmd_end\r\nECHO SHELL_IS_COMMAND is %SHELL_IS_COMMAND% (0 for CMD/FREECOM, 1 for COMMAND)\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\nREM TESTING IF and GOTO and comparison to arguments\r\nIF \"%1\"==\"EXTENDED\" GOTO ext_ver\r\n:continue_ver\r\nGOTO tst_goto\r\nECHO THIS SHOULD NOT BE SHOWN!\r\n:tst_goto\r\nECHO VER complete\r\nGOTO skip_ext_ver\r\nREM this section only evaluated if EXTENDED passed on command line\r\n:ext_ver\r\nECHO EXTENDED version tests\r\nECHO show version help\r\nVER /?\r\nECHO show kernel version\r\nVER /R\r\nECHO show shell warranty\r\nVER /W\r\nECHO show shell redistribution info\r\nVER /D\r\nECHO show shell contributors\r\nVER /C\r\nGOTO continue_ver\r\n\r\nREM continue normal testing\r\n:skip_ext_ver\r\nECHO Testing IF and ERRORLEVEL\r\nREM %errorleve% not supported by MSDOS, last command was ver /r so 0 if supported (dos), 1 if not (win)\r\nECHO ERRORLEVEL %ERRORLEVEL% should be 0 or \"\" on COMMAND (DOS) and 1 with CMD (WIN)\r\nECHO should print Four Three Two One Zero each on its own line\r\nSET LVL=4\r\n:loop\r\nerrlvl %LVL%\r\nIF ERRORLEVEL 4 GOTO FOUR\r\nIF ERRORLEVEL 3 GOTO THREE\r\nIF ERRORLEVEL 2 GOTO TWO\r\nIF ERRORLEVEL 1 GOTO ONE\r\n\r\necho Zero\r\nGOTO tst_show_errlvl\r\n\r\n:FOUR\r\necho Four\r\nSET LVL=3\r\nGOTO loop\r\n\r\n:THREE\r\necho Three\r\nSET LVL=2\r\nGOTO loop\r\n\r\n:TWO\r\necho Two\r\nSET LVL=1\r\nGOTO loop\r\n\r\n:ONE\r\necho One\r\nSET LVL=0\r\nGOTO loop\r\n\r\n:tst_show_errlvl\r\nECHO if %%ERRORLEVEL%% is supported shows 3 2 1 each on its own line, else ECHO is off 3 times\r\nerrlvl 3\r\nECHO %ERRORLEVEL%\r\nerrlvl 2\r\nECHO %ERRORLEVEL%\r\nerrlvl 1\r\nECHO %ERRORLEVEL%\r\nECHO,\r\nECHO Testing PAUSE\r\nIF \"%1\"==\"EXTENDED\" PAUSE /?\r\nREM CMD and COMMAND will ignore prompt and always show default pause message\r\nPAUSE Press any key and then screen will clear & the default pause message will show\r\nCLS\r\nPAUSE\r\n\r\nECHO Testing label variations work\r\n: Usual spelling\r\ngoto label1\r\nECHO If you see me then label1 didn't work\r\n:label1\r\necho Label 1 found\r\n: Prefixed colon\r\ngoto :label2\r\nECHO If you see me then label2 didn't work\r\n:label2\r\necho Label 2 found\r\n: Prefixed colon seperated by whitespaces\r\n: Though 4dos searches for ' label3' here?\r\n: doesn't work in CMD or COMMAND, so we check if a bad ver argument has errorlevel 1 and skip it\r\nIF NOT \"%1\"==\"EXTENDED\"  GOTO label3\r\nREM the following line may terminate the batch file if unsupported instead of showing didn't work\r\ngoto : label3\r\nECHO If you see me then label3 didn't work\r\n:label3\r\necho Label 3 found\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\nECHO Testing IF and EXISTS\r\nECHO Testing the EXIST format, you should see \"((OK))\" two times\r\necho.\r\nECHO WARNING!!! this will overwrite NOTAFILE.ERR if it exists and delete it!\r\nECHO This is a test file and should be deleted > NOTAFILE.ERR\r\nECHO.\r\nif exist NOTAFILE.ERR     echo File NOTAFILE.ERR exists\t        ((OK))\r\nif not exist NOTAFILE.ERR echo File NOTAFILE.ERR does not exist ((ERROR!!??))\r\nREM this will delete NOTAFILE.ERR, but should not display anything in the process\r\nERASE NOTAFILE.ERR\r\nif exist NOTAFILE.ERR     echo File NOTAFILE.ERR exists         ((ERROR!!??))\r\nif not exist NOTAFILE.ERR echo File NOTAFILE.ERR does not exist\t((OK))\r\necho.\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\n:tst_SHIFT\r\nECHO invoking self [%0] with showargs as label to goto then testing shift\r\nECHO This will print the batch name showargs and empty arguments from 2 to 9\r\nCALL %0 showargs\r\nECHO back from self\r\nIF \"%DEV%\"==\"1\" pause\r\nECHO This will print the batch name showargs and arguments matching from 2 to 9\r\nCALL %0 showargs 2 3 4 5 6 7 8 9\r\nECHO back from self\r\nIF \"%DEV%\"==\"1\" pause\r\nECHO This will print the batch name showargs and args from 2-9 then repeating to 10 and to 11\r\nCALL %0 showargs 2 3 4 5 6 7 8 9 10 11\r\nECHO back from self\r\nIF \"%DEV%\"==\"1\" pause\r\nGOTO end_tst_SHIFT\r\n\r\nECHO oops why do you see me?\r\nPAUSE\r\n\r\n:showargs\r\necho 0=%0\r\necho 1=%1\r\necho 2=%2\r\necho 3=%3\r\necho 4=%4\r\necho 5=%5\r\necho 6=%6\r\necho 7=%7\r\necho 8=%8\r\necho 9=%9\r\nSHIFT\r\nECHO \"%9%\" is it blank? no then keep looping\r\nIF NOT \"%9\"==\"\" GOTO showargs\r\nGOTO END\r\n\r\n:end_tst_SHIFT\r\nECHO,\r\nECHO Testing CALL and COMMAND /C\r\nECHO should see in bat 1, in bat 2, in bat 3, back to bat 2, back to bat 1\r\nECHO @ECHO OFF > _b1.bat\r\nECHO echo in bat 1 >> _b1.bat\r\nECHO call _b2.bat >> _b1.bat\r\nECHO echo back in bat 1 >> _b1.bat\r\nECHO @ECHO OFF > _b2.bat\r\nECHO echo in bat 2 >> _b2.bat\r\nECHO call _b3.bat >> _b2.bat\r\nECHO echo back in bat 2 >> _b2.bat\r\nECHO @ECHO OFF > _b3.bat\r\nECHO echo in bat 3 >> _b3.bat\r\nCALL _b1.bat\r\nIF \"%DEV%\"==\"1\" pause\r\nREM using COMMAND /C form instead of call\r\nECHO COMSPEC is %COMSPEC%\r\n%COMSPEC% /C _b1.bat\r\nDEL _b1.bat\r\nDEL _b2.bat\r\nDEL _b3.bat\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\n:tst_FOR\r\nECHO,\r\nECHO Testing FOR\r\nIF \"%1\"==\"EXTENDED\" FOR /?\r\nif %SHELL_IS_CMD%==1 GOTO benny_done\r\nECHO BENNY level test - IF ERRORLEVEL HA or IF ERRORLEVEL xa\r\nECHO where A is A-Z for errorcode 1 to 26 and a is a-z for errorcode 1 to 26\r\nECHO this will fail on Windows COMMAND and 4DOS with HA was unexpected at this time.\r\nREM benny test for last drive, requires program to return last drive as errorlevel so we fake as Y using ERRLVL\r\nERRLVL 25\r\nSET drv=:\r\nFOR %%Z IN (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF ERRORLEVEL H%%Z SET drv=%%Z\r\nIF ERRORLEVEL 27 SET drv=\r\nIF \"%drv%\"==\"\" ECHO ERROR: No drive letter - Exit code == %ERRORLEVEL%\r\nIF NOT \"%drv%\"==\"\" ECHO Faked last drive letter: %drv%: (should be Y)\r\nERRLVL 25\r\nSET drv=:\r\nFOR %%Z IN (Z Y X W V U T S R Q P O N M L K J I H G F E D C B A) DO IF ERRORLEVEL H%%Z SET drv=%%Z\r\nIF ERRORLEVEL 27 SET drv=\r\nIF \"%drv%\"==\"\" ECHO ERROR: No drive letter - Exit code == %ERRORLEVEL%\r\nIF NOT \"%drv%\"==\"\" ECHO Faked last drive letter: %drv%: (should be A)\r\nERRLVL 3\r\nSET drv=:\r\nFOR %%Z IN (a b c d e f g h i j k l m n o p q r s t u v w x y z) DO IF ERRORLEVEL x%%Z SET drv=%%Z\r\nIF ERRORLEVEL 27 SET drv=\r\nIF \"%drv%\"==\"\" ECHO ERROR: No drive letter - Exit code == %ERRORLEVEL%\r\nIF NOT \"%drv%\"==\"\" ECHO Faked last drive letter: %drv%: (should be C)\r\nSET drv=\r\n:benny_done\r\nFOR %%A IN (3 2 1) DO ECHO %%A\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\n:tst_CTTY\r\nif %SHELL_IS_CMD%==1 GOTO skip_ctty\r\nIF \"%1\"==\"EXTENDED\" CTTY /?\r\nECHO.\r\nECHO Testing CTTY\r\nctty nul\r\necho not to be seen\r\nctty con\r\nECHO if nothing was shown then successful\r\nIF \"%DEV%\"==\"1\" pause\r\n:skip_ctty\r\n\r\n:tst_load\r\nif %SHELL_IS_CMD%==1 GOTO skip_load\r\nECHO;\r\nECHO LOADFIX, LOADHIGH, and LH\r\nLOADFIX /?\r\nLOADHIGH /?\r\nLH /?\r\nerrlvl 33\r\nECHO %ERRORLEVEL% is 33\r\nREM this is external for MSDOS so don't run for COMMAND\r\nIF \"%SHELL_IS_COMMAND%\"==\"1\" GOTO skip_lfx\r\nLOADFIX errlvl 32\r\nECHO %ERRORLEVEL% is 32\r\n:skip_lfx\r\nLOADHIGH errlvl 31\r\nECHO %ERRORLEVEL% is 31\r\nLH errlvl 30\r\nECHO %ERRORLEVEL% is 30\r\n:: TODO add a program that shows it load address to verify lh and loadfix loaded program correctly\r\nIF \"%DEV%\"==\"1\" pause\r\n:skip_load\r\nECHO.\r\nECHO testing if can continue a batch file if changed while executing\r\nECHO @ECHO ON > _b1.bat\r\nECHO ECHO 2nd line of _b1.bat >> _b1.bat\r\nECHO COPY /A _b1.bat + _b2.bat _b1.bat >> _b1.bat\r\nREM next line is 1 char short of filling line, should not print blank line\r\nECHO ECHO 4th line of _b1.bat    and only line of _b2> _b2.bat\r\nECHO _b1.bat is:\r\nTYPE _b1.bat\r\nECHO _b2.bat is:\r\nTYPE _b2.bat\r\nECHO running _b1.bat now:\r\nCALL _b1.bat\r\nECHO should restore to being off here\r\n@ECHO OFF\r\nECHO _b1.bat should now include _b2.bat and all the lines should have printed\r\nTYPE _b1.bat\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\nECHO TESTING PATH MD CD RD\r\nIF \"%1\"==\"EXTENDED\" PATH /?\r\nIF \"%1\"==\"EXTENDED\" MD /?\r\nIF \"%1\"==\"EXTENDED\" MKDIR /?\r\nIF \"%1\"==\"EXTENDED\" CD /?\r\nIF \"%1\"==\"EXTENDED\" CHDIR /?\r\nIF \"%1\"==\"EXTENDED\" RD /?\r\nIF \"%1\"==\"EXTENDED\" RMDIR /?\r\nIF \"%1\"==\"EXTENDED\" CDD /?\r\nECHO @ECHO Hello from bat 1 > _b1.bat\r\nMKDIR TESTING\r\nCOPY _b1.bat TESTING\r\nECHO PATH is %PATH%\r\nPATH\r\nSET __PATH=%PATH%\r\nPATH TESTING\r\nECHO PATH is now %PATH%\r\nPATH\r\nCALL _b1.bat\r\nSET PATH=%__PATH%\r\nECHO PATH is restored to %PATH%\r\nPATH\r\nECHO current path is:\r\nCD\r\nCD TESTING\r\nECHO new path is:\r\nif %SHELL_IS_CMD%==1 ECHO %CD%\r\nif %SHELL_IS_CMD%==0 IF %SHELL_IS_COMMAND%==0 CDD\r\nif %SHELL_IS_COMMAND%==1 CD\r\ndel _b1.bat\r\nCD ..\r\nRD TESTING\r\nMD TESTING\r\ncopy _b1.bat TESTING\r\nCHDIR TESTING\r\nCALL _b1.bat\r\nCHDIR ..\r\nREM CDD TESTING\r\nif %SHELL_IS_CMD%==0 IF %SHELL_IS_COMMAND%==0 CDD TESTING\r\nif %SHELL_IS_CMD%==1 CD TESTING\r\nif %SHELL_IS_COMMAND%==1 CD TESTING\r\nECHO still in same path?\r\nCD\r\nREM CDD -\r\nif %SHELL_IS_CMD%==0 IF %SHELL_IS_COMMAND%==0 CDD -\r\nif %SHELL_IS_CMD%==1 CD ..\r\nif %SHELL_IS_COMMAND%==1 CD ..\r\nECHO should be back to original path\r\nCD\r\ndel TESTING\\_b1.bat\r\nRMDIR TESTING\r\nDEL _b1.bat\r\nIF EXIST _b2.bat DEL _b2.bat\r\nIF EXIST _b3.bat DEL _b3.bat\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\nECHO.\r\nECHO testing passing long command to FreeCOM and calling a program with a long command\r\nECHO this tests setting CMDLINE for caller and FreeCOM reading CMDLINE as callee\r\nECHO CMDLINE is '%CMDLINE%'\r\nECHO running a long command:\r\nECHO ON\r\n%COMSPEC% /c ECHO 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345\r\n%COMSPEC% /c ECHO 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789\r\n@ECHO OFF\r\necho now test the environment substitution\r\necho path is %path%\r\necho PATH is %PATH%\r\necho Absent variable is %Absent%\r\necho Bad format : %bad format\r\necho Testing double %%comspec%%\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\nCLS\r\nIF \"%1\"==\"EXTENDED\" CLS /?\r\nIF \"%1\"==\"EXTENDED\" SET /?\r\nECHO env var Pfun is '%Pfun%'\r\nIF NOT %SHELL_IS_COMMAND%==1 SET Pfun\r\nIF %SHELL_IS_COMMAND%==1 ECHO %Pfun%\r\nSET Pfun=\r\nSET Pfun=PFUNy\r\nECHO env var PFUNy is '%Pfun%'\r\nIF NOT %SHELL_IS_COMMAND%==1 SET Pfun\r\nIF %SHELL_IS_COMMAND%==1 ECHO %Pfun%\r\nSET Pfun=\r\nIF %SHELL_IS_COMMAND%==1 GOTO end_Pfun\r\nif %SHELL_IS_CMD%==1 GOTO end_Pfun\r\nSET /U Pfun=PFUNy\r\nECHO env var PFUNY is '%Pfun%'\r\nECHO %Pfun%\r\nSET Pfun=\r\nSET /C Pfun=Pfuny\r\nECHO env var Pfuny is '%Pfun%'\r\nSET Pfun\r\nSET Pfun=\r\nVER /? > _b1.txt\r\nSET /E Pfun=VER /?\r\nECHO env var Pfun is '%Pfun%'\r\nSET Pfun\r\nSET Pfun=\r\nSET /E Pfun=TYPE _b1.txt\r\nDEL _b1.txt\r\nECHO env var Pfun is '%Pfun%'\r\nSET Pfun\r\nSET Pfun=\r\nECHO env var Pfun is '%Pfun%'\r\nSET Pfun\r\n:end_Pfun\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\nCLS\r\nECHO.\r\nECHO Testing running a program where part of the program name is passed in as an argument\r\nCALL %0 tst_arg lvl 3\r\nGOTO skip_tst_arg\r\n:tst_arg\r\nERR%2 %3\r\nIF ERRORLEVEL == 3 ECHO It Worked!\r\nGOTO END\r\n:skip_tst_arg\r\nECHO And back\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\nECHO.\r\nECHO BREAK and VERIFY, should should each OFF, ON, OFF again (BREAK not shown for some shells)\r\nBREAK\r\nVERIFY\r\nBREAK ON\r\nBREAK\r\nBREAK OFF\r\nBREAK\r\nVERIFY ON\r\nVERIFY\r\nVERIFY OFF\r\nVERIFY\r\nIF \"%1\"==\"EXTENDED\" BREAK /?\r\nIF \"%1\"==\"EXTENDED\" VERIFY /?\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\nECHO.\r\nECHO Some builtin variables:\r\nECHO current path is %CD%\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\nECHO.\r\nECHO test copy to NUL and redirect to NUL\r\nCOPY compat.bat NUL > NUL\r\nECHO nothing should have displayed\r\nIF \"%DEV%\"==\"1\" pause\r\n\r\n\r\nGOTO end_with_funny_prompt\r\n:RESTORE\r\nPROMPT $p$g\r\nGOTO END\r\n:end_with_funny_prompt\r\nECHO PROMPT is set to vb date vb lt drive gt path == time\\n$Run COMPAT RESTORE gtgt\r\nPROMPT $b $d $b $g$h$L$n$g $p $q$q $t$_$v$$Run COMPAT RESTORE $g$g\r\nREM this marks the end of the BATCH file since EXIT will terminate the shell\r\nREM we expect this to fail on MS/PC DOS command.com so don't do it there\r\nIF NOT \"%SHELL_IS_COMMAND%\"==\"1\" TITLE Command Prompt\r\nSET SHELL_IS_CMD=\r\nSET SHELL_IS_COMMAND=\r\nSET DEV=\r\n:END\r\n"
  },
  {
    "path": "tests/ctty-nul.bat",
    "content": "@echo off\r\nctty nul\r\necho not to be seen\r\nctty con\r\n"
  },
  {
    "path": "tests/dir-test.txt",
    "content": "Regression tests for dir.c\r\n--------------------------\r\n\r\nIf you add tests, please email them to normat@rpi.edu\r\n\r\nThe following directories must exist: C:\\TEMP, D:\\TIM, C:\\WINDOWS D:\\TIM\\C\r\n\r\nCurrent working directories are: C:\\TEMP, D:\\TIM\r\n\r\nCurrent drive is: C\r\n\r\nType the command in the \"From\" column and make sure the files listed are what\r\nare shown in the other columns.\r\n\r\nFrom                                    Drive   Dir             File\r\n----                                    -----   ---             ----\r\nDIR                                     C       \\TEMP           *.*\r\nDIR \\                                   C       \\               *.*\r\nDIR \\windows                            C       \\windows        *.*\r\nDIR d:                                  D       \\tim            *.*\r\nDIR d:\\                                 D       \\               *.*\r\nDIR d:.                                 D       \\tim            *.*\r\nDIR file                                C       \\TEMP           file.*\r\nDIR .ext                                C       \\TEMP           *.ext\r\nDIR D:c                                 D       \\tim\\c          *.*\r\n"
  },
  {
    "path": "tests/errlvl.bat",
    "content": "@echo off\r\nECHO should print Four Three Two One Zero 3 2 1 each on its own line\r\nSET LVL=4\r\n:loop\r\nerrlvl %LVL%\r\nIF ERRORLEVEL 4 GOTO FOUR\r\nIF ERRORLEVEL 3 GOTO THREE\r\nIF ERRORLEVEL 2 GOTO TWO\r\nIF ERRORLEVEL 1 GOTO ONE\r\n\r\necho Zero\r\nGOTO END\r\n\r\n:FOUR\r\necho Four\r\nSET LVL=3\r\nGOTO loop\r\n\r\n:THREE\r\necho Three\r\nSET LVL=2\r\nGOTO loop\r\n\r\n:TWO\r\necho Two\r\nSET LVL=1\r\nGOTO loop\r\n\r\n:ONE\r\necho One\r\nSET LVL=0\r\nGOTO loop\r\n\r\n:END\r\nerrlvl 3\r\nECHO %ERRORLEVEL%\r\nerrlvl 2\r\nECHO %ERRORLEVEL%\r\nerrlvl 1\r\nECHO %ERRORLEVEL%\r\necho Done\r\n"
  },
  {
    "path": "tests/errlvl.c",
    "content": "/*\tReturns the specified errorlevel\r\n*/\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n\r\nmain(int argc, char **argv)\r\n{\r\n\tif(argc != 2) {\r\n\t\tfputs(\"Usage: ERRLVL number\\n\"\r\n\t\t\t\"Returns the specified number as errorlevel (exit code)\\n\"\r\n\t\t\t, stderr);\r\n\t\treturn 127;\r\n\t}\r\n\r\n\treturn atoi(argv[1]);\r\n}\r\n"
  },
  {
    "path": "tests/fdos.out",
    "content": "\r\nD:\\FREEDOS\\COM074BS\\SOURCE\\PACK\\TEST>echo This is a test batch file\r\nThis is a test batch file\r\n\r\nD:\\FREEDOS\\COM074BS\\SOURCE\\PACK\\TEST>echo\r\nECHO is on\r\nTesting with echo off\r\n\r\nD:\\FREEDOS\\COM074BS\\SOURCE\\PACK\\TEST>echo Testing wih echo on\r\nTesting wih echo on\r\n\r\nD:\\FREEDOS\\COM074BS\\SOURCE\\PACK\\TEST>echo off\r\nTesting : test2 p1 p2 p3 p4\r\nTesting : p1 p2 p3 p4\r\nTesting : p2 p3 p4\r\nnow test the environment substitution\r\npath is D:\\AMI\\TOOLS\\MASM611\\BIN;D:\\AMI\\TOOLS\\BIN;C:\\BIN;C:\\WINDOWS;C:\\WINDOWS\\COMMAND;C:\\BC45\\BIN;C:\\BRIEF;\r\nPATH is D:\\AMI\\TOOLS\\MASM611\\BIN;D:\\AMI\\TOOLS\\BIN;C:\\BIN;C:\\WINDOWS;C:\\WINDOWS\\COMMAND;C:\\BC45\\BIN;C:\\BRIEF;\r\nAbsent variable is\r\nBad format : bad format\r\nTesting double %comspec%\r\nCall another batch file...\r\nTesting : test3.bat t3p1 t3p2 t3p3\r\nTesting : t3p1 t3p2 t3p3\r\nTesting : t3p2 t3p3\r\nPress any key to continue . . .\r\n\r\n.\r\nReturned to TEST2\r\n.\r\nTesting : p2 p3 p4\r\nTesting : p3 p4\r\nTesting : p4\r\n"
  },
  {
    "path": "tests/hbp001a.bat",
    "content": "echo on\r\necho Root batch, echo on\r\necho starting hbp001b\r\ncall hbp001b\r\necho root batch: I'm back, this should be echo'd\r\n\r\necho off\r\necho Root batch, echo off\r\necho starting hbp001b\r\ncall hbp001b\r\necho root batch: I'm back, this should NOT be echo'd\r\n\r\n"
  },
  {
    "path": "tests/hbp001b.bat",
    "content": "echo This is the start of called batch echo state form caller\r\n\r\necho on\r\necho This should always be echoed\r\n\r\n\r\n"
  },
  {
    "path": "tests/hbp002.txt",
    "content": "OK, here is my implementation of the FOR command, files changed :\r\n\r\n   BATCH.C\r\n   BATCH.H\r\n   FOR.C\r\n\r\n\r\nThere is a problem running form BATCH files. Formthe command line\r\ntype in something like:\r\n\r\n\tfor %%a in (a bb ccc) do echo %%a\r\n  or\r\n        for %%a in (*.c) do echo %%a\r\n\r\n\r\nPut it in the next release and I'll work on fixing the batch issue.\r\n\r\nHans\r\n19 Jul 1998\r\n\r\n\r\n\r\n\r\n"
  },
  {
    "path": "tests/hbp_001.txt",
    "content": "Minor changes to BATCH.C and BATCH.H to preserve the staets of the echo\r\nflag across batch calls.\r\n\r\nPlease add HBP_001a.bat and hbp_001b.bat to test directory.\r\n\r\n\r\n19 July 1998\r\nHans B Pufal\r\n\r\n"
  },
  {
    "path": "tests/label.bat",
    "content": "@echo off\r\n: Test if all the labels work\r\n\r\n: Usual spelling\r\ngoto label1\r\n\r\n:label1\r\necho Label 1 found\r\n\r\n: Prefixed colon\r\ngoto :label2\r\n\r\n:label2\r\necho Label 2 found\r\n\r\n: Prefixed colon seperated by whitespaces\r\n: Though 4dos searches for ' label3' here?\r\ngoto : label3\r\n\r\n:label3\r\necho Label 3 found\r\n\r\n\r\n"
  },
  {
    "path": "tests/longcmd.bat",
    "content": "command /c ECHO 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234567 \r\n"
  },
  {
    "path": "tests/msdos.out",
    "content": "\r\nD:\\freedos\\com074bs\\source\\PACK\\test>echo This is a test batch file\r\nThis is a test batch file\r\n\r\nD:\\freedos\\com074bs\\source\\PACK\\test>echo\r\nECHO is on\r\nTesting with echo off\r\n\r\nD:\\freedos\\com074bs\\source\\PACK\\test>echo Testing wih echo on\r\nTesting wih echo on\r\n\r\nD:\\freedos\\com074bs\\source\\PACK\\test>echo off\r\nTesting : test2 p1 p2 p3 p4\r\nTesting : p1 p2 p3 p4\r\nTesting : p2 p3 p4\r\nnow test the environment substitution\r\npath is D:\\AMI\\TOOLS\\MASM611\\BIN;D:\\AMI\\TOOLS\\BIN;C:\\BIN;C:\\WINDOWS;C:\\WINDOWS\\COMMAND;C:\\BC45\\BIN;C:\\BRIEF;\r\nPATH is D:\\AMI\\TOOLS\\MASM611\\BIN;D:\\AMI\\TOOLS\\BIN;C:\\BIN;C:\\WINDOWS;C:\\WINDOWS\\COMMAND;C:\\BC45\\BIN;C:\\BRIEF;\r\nAbsent variable is\r\nBad format : bad format\r\nTesting double %comspec%\r\nCall another batch file...\r\nTesting : test3.bat t3p1 t3p2 t3p3\r\nTesting : t3p1 t3p2 t3p3\r\nTesting : t3p2 t3p3\r\nPress any key to continue . . .\r\n\r\n.\r\nReturned to TEST2\r\n.\r\nTesting : p2 p3 p4\r\nTesting : p3 p4\r\nTesting : p4\r\n"
  },
  {
    "path": "tests/refl.bat",
    "content": "rem @echo off\r\nc:\r\ncd\\reflex\r\nreflex%1\r\nrem cls\r\n\r\n"
  },
  {
    "path": "tests/t.bat",
    "content": "c:\\command /c test1 >msdos.out\r\ncommand /c test1 >fdos.out\r\n"
  },
  {
    "path": "tests/test.bat",
    "content": "echo\r\necho hi, this is a test\r\nfreda\r\nrem a comment\r\npause\r\n@echo the path is %PATH%\r\necho the path is %path%\r\necho Batch file called as : %0 %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n@shift\r\necho shifted : %0 %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n@shift down\r\necho shifted  down: %0 %1 %2 %3 %4 %5 %6 %7 %8 %9\r\npause\r\necho this is bogus: %bogus%\r\necho this is a test: %test\r\necho\r\necho off\r\necho\r\ngoto next\r\n\r\necho this line will never be reached\r\n\r\n:next\r\necho continue form here...\r\necho END OF test.bat\r\n"
  },
  {
    "path": "tests/test1.bat",
    "content": "echo This is a test batch file\r\necho\r\n@echo off\r\necho Testing with echo off\r\necho on\r\necho Testing wih echo on\r\necho off\r\ntest2 p1 p2 p3 p4\r\necho This should not appear!!\r\necho END OF test1.bat\r\n"
  },
  {
    "path": "tests/test2.bat",
    "content": "@echo off\r\necho Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8\r\nshift\r\necho Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8\r\nshift\r\necho Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8\r\n\r\necho now test the environment substitution\r\necho path is %path%\r\necho PATH is %PATH%\r\necho Absent variable is %Absent%\r\necho Bad format : %bad format\r\necho Testing double %%comspec%%\r\n\r\necho Call another batch file...\r\ncall test3.bat t3p1 t3p2 t3p3\r\n\r\necho .\r\necho Returned to TEST2\r\necho .\r\necho Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8\r\nshift\r\necho Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8\r\nshift\r\necho Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8\r\necho END OF test2.bat\r\n"
  },
  {
    "path": "tests/test3.bat",
    "content": "echo Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8\r\nshift\r\necho Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8\r\nshift\r\necho Testing : %0 %1 %2 %3 %4 %5 %6 %7 %8\r\npause\r\n\r\necho END OF test3.bat\r\n"
  },
  {
    "path": "tests/test4.bat",
    "content": "dir > q1\r\ndir >> q1\r\nsort <q1 >q1s\r\ndir | sort >>q1s\r\n\r\necho END OF test4.bat\r\n"
  },
  {
    "path": "tests/testenv.c",
    "content": "#include <stdio.h>\r\n#include <stdlib.h>\r\n\r\n/* OW does not seem to support *env[] arg to main */\r\nextern char **environ;\r\n\r\nint\r\nmain(int argc, char *argv[], char *env[])\r\n{\r\n  int count;\r\n\r\n  puts(\"Commandline:\");\r\n\r\n  for (count = 0; count < argc; count++)\r\n    printf(\"%d: %s\\n\", count, argv[count]);\r\n\r\n  puts(\"\\nEnvironment:\");\r\n  \r\n  for (count = 0; environ[count] != NULL; count++)\r\n    printf(\"%d: %s\\n\", count, environ[count]);\r\n\r\n  putenv(\"PATH=\");\r\n\r\n  puts(\"\\nEnvironment after a setenv (\\\"PATH=\\\");:\");\r\n\r\n  for (count = 0; environ[count]; count++)\r\n    printf(\"%d: %s\\n\", count, environ[count]);\r\n\r\n  return 0;\r\n}\r\n"
  },
  {
    "path": "tests/tst-if.bat",
    "content": "@echo off\r\n: IF test script\r\n\r\ncls\r\nECHO.\r\nECHO TEST SCRIPT FOR THE IF COMMAND\r\nECHO.\r\nECHO Testing the EXIST format\r\nECHO.\r\nECHO It is assumed that the file TST-IF.BAT does exist, but\r\nECHO NICHT-DA.TGL does not exist\r\nECHO.\r\nif exist tst-if.bat       echo File TST-IF.BAT exists\t        ((OK))\r\nif not exist tst-if.bat   echo File TST-IF.BAT does not exist   ((ERROR!!??))\r\nif exist nicht-da.tgl     echo File NICHT-DA.TGL exists         ((ERROR!!??))\r\nif not exist nicht-da.tgl echo File NICHT-DA.TGL does not exist\t((OK))\r\necho.\r\necho You should see \"((OK))\" two times\r\necho.\r\necho If you see an ERROR, check if the specified file is really\r\necho not there (TST-IF.BAT) or really is there (NICHT-DA.TGL)\r\necho.\r\npause\r\n\r\ncls\r\nECHO Testing the ERRORLEVEL format\r\nECHO.\r\nif exist errlvl.exe goto err_OK\r\nif exist errlvl.com goto err_OK\r\necho Cannot find an executable of the ERRLVL program, please\r\necho compile it, in order to run this test\r\ngoto err_SKIP\r\n\r\n:err_OK\r\nerrlvl 0\r\n::echo Errorlevel %? (must be '0')\r\necho Errorlevel %errorlevel% (must be '0')\r\nif not errorlevel 1 echo Probe #1 passed\r\nif errorlevel 1 echo Probe #2 failed\r\nerrlvl 15\r\n::echo Errorlevel %? (must be '15')\r\necho Errorlevel %ERRORLEVEL% (must be '15')\r\nif errorlevel 15 echo Probe #3 passed\r\nif errorlevel 16 echo Probe #4 failed\r\nif errorlevel 14 echo Probe #5 passed\r\necho.\r\necho You should see passed probes 1, 3,& 5 and no failed one.\r\necho Also make sure that the displayed errorlevels match the one\r\necho mentioned as \"must be 'XX'\"\r\necho.\r\npause\r\n\r\ncls\r\nECHO Testing the == format\r\nECHO.\r\nif 1==1 echo Probe #1 passed\r\nif 2==1 echo Probe #2 failed\r\nif not 1==2 echo Probe #3 passed\r\nif not 1==1 echo Probe #4 failed\r\nif 1 == 1 echo Probe #5 passed\r\nif 1 == 2 echo Probe #6 failed\r\nif 1 ==1 echo Probe #7 passed\r\nif 1 ==2 echo Probe #8 failed\r\nif 1== 1 echo Probe #9 passed\r\nif 1== 2 echo Probe #10 failed\r\nif not 1==\"1\" echo Probe #11 passed\r\nif not \"1 2 3 4\"==\"1 2 3 4\" echo Probe #12 failed\r\nif \"1 2 3 4\"==\"1 2 3 4\" echo Probe #13 passed\r\necho.\r\necho You should see passed probes 1, 3, 5, 7, 9, 11,& 13 and no failed one\r\necho.\r\npause\r\n\r\ncls\r\nECHO Testing /I and NOT options\r\nECHO.\r\nif NOT a==A echo Probe #1 passed\r\nif /I a==A echo Probe #2 passed\r\nif /I NOT a==A echo Probe #3 failed\r\nif NOT /I a==A echo Probe #4 failed\r\nif /i b==A echo Probe #5 failed\r\nif not /i not b==A ECHO Probe #6 passed\r\nif /i a==A echo Probe #7 passed\r\nif /i not exist nicht-da.tgl echo Probe #8 passed\r\nif /i exist nicht-da.tgl echo Probe #9 failed\r\nif not exist nicht-da.tgl echo Probe #10 passed\r\necho.\r\necho You should see passed probes 1, 2, 6, 7, 8, & 10 and no failed ones\r\necho.\r\npause\r\n\r\ncls\r\nECHO Testing incomplete COMMAND\r\nECHO you should see multiple error messages \"IF: Missing command\" or similar message\r\nECHO.\r\nREM [a==a], [a==a ], [a==a] note the middle one has a space before the end of line and other 2 do not\r\nif a==a ECHO Next 3 commands should fail\r\nif a==a\r\nif a==a \r\nif a==a\r\necho.\r\npause\r\n\r\ncls\r\necho Testing \" and extra characters included with ==\r\necho .\r\nif \"a==\"a echo Probe #1 passed\r\nif \"a == \"a echo Probe #2 passed\r\nif a \"== a echo Probe #3 passed\r\nif a garbage== a echo Probe #4 passed\r\nif a garbage==garbage a echo Probe #5 failed\r\nif .a == .a echo Probe #6 passed\r\nif \" a==\" a echo Probe #7 failed, a is not a valid command\r\nif \" echo==\" echo Probe #8 passed\r\necho .\r\necho You should see passed probes 1,2,3,4,6,& 8 with 7 giving a bad command error\r\npause\r\n\r\necho.\r\necho Test finished\r\n"
  },
  {
    "path": "tests/tstcmdln.bat",
    "content": "@ECHO OFF\r\nmkdir \"a long dir\" > NUL\r\ncopy testenv.exe \"a long dir\\testenv.exe\" > NUL\r\n\"a long dir\"\\testenv aaaaaaaaa realllly long command line to create a env variable that can pass the long name to it oh yeah a really long command line still going.  Oh yeah is is at the end yet, nope, lets keep going untilout of characters. \r\nECHO CMDLINE should start with quoted \"a long dir\\testenv.exe\"\r\ndel \"a long dir\\testenv.exe\" > NUL\r\nrmdir \"a long dir\" > NUL\r\n\r\n"
  },
  {
    "path": "tools/28.asm",
    "content": "org 100h\r\n\r\n\tmov ax, 1111h\r\n\txor bl, bl\r\n\tint 10h\r\n\tret\r\n"
  },
  {
    "path": "tools/50.asm",
    "content": "org 100h\r\n\r\n\tmov ax, 1112h\r\n\txor bl, bl\r\n\tint 10h\r\n\tret\r\n"
  },
  {
    "path": "tools/debug.h",
    "content": "#include \"../debug.h\"\r\n"
  },
  {
    "path": "tools/depend.mk",
    "content": "tools .SEQUENTIAL : utils err_fcts.h strings context lib tools_dir\r\n\r\ndefault.mk : ../config.h\r\n\t..\\utils\\mktools.exe >$@\r\n\r\ntools_dir .SETDIR=tools : default.mk\r\n\t@echo Entering $(PWD)\r\n\t$(RUNMAKE) all\r\n\t@echo Leaving $(PWD)\r\n\r\nCLEAN_DEPENDENCIES += tools_clean\r\ntools_clean .SETDIR=tools :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) clean\r\n\t@echo Leaving  $(PWD)\r\n\r\nCLOBBER_DEPENDENCIES += tools_clobber\r\ntools_clobber .SETDIR=tools :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) clobber\r\n\t@echo Leaving  $(PWD)\r\n\r\nDIST_DEPENDENCIES += tools_dist\r\ntools_dist .SETDIR=tools :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) dist\r\n\t@echo Leaving  $(PWD)\r\n"
  },
  {
    "path": "tools/files.txt",
    "content": "Implementation of tools useful for FreeCOM at run-time\r\n\r\nPTCHSIZE\ttool to display/restrict the default heap of FreeCOM\r\nPTCHLDRV\ttool to change the drive the FEATURE_CALL_LOGGING\r\n\t\tcreates the logfile on.\r\n\r\nLOAD_ICD\ttool to load samples of Installable Commands\r\nICMD_*.NAS\tNASM sources of samples of Installable Commands\r\nICMD_TPL.NAS\ttemplate of samples of Installable Commands\r\nICMD_INC.INC\tcommand code shared by all samples of Installable Commands\r\n\r\nKSSF.ASM\tKernel Swap Support Faker\r\nVSPAWN.ASM\tVSpawn - KSSF #2\r\n"
  },
  {
    "path": "tools/icmd_1.nas",
    "content": ";; Installable Command sample #1\r\n;;\r\n;;\tEcho command line arguments to screen via INT-10-0E\r\n;;\r\n\r\n%macro icmdAction 0\r\n\tmov ax, ds\r\n\tmov es, ax\r\n\txor ax, ax\r\n\tmov BYTE [si], al\t\t;; zero the length byte --> shell stops interprete\r\n\tinc bx\r\n\tmov al, [bx]\r\n\tmov cx, ax\r\n\tinc bx\r\n\tcall oString\r\n%endmacro\r\n\r\n%macro icmdComment 0\r\n\tDB 'Displays command line and outputs lots of debug information'\r\n%endmacro\r\n\r\n%macro icmdStuff 0\r\n%endmacro\r\n\r\n;; include the ICMD template\r\n%include 'icmd_inc.inc'\r\n"
  },
  {
    "path": "tools/icmd_2.nas",
    "content": ";; Installable Command sample #2\r\n;;\r\n;;\tDo nothing --> if named as an internal command --> disables it\r\n;;\r\n\r\n%macro icmdAction 0\r\n\tmov ax, ds\r\n\tmov es, ax\r\n\tmov ax, cs\r\n\tmov ds, ax\r\n\tmov di, si\r\n\tmov si, newCommandName\r\n\tmov cx, newCommandNameEnd - newCommandName\r\n\trep movsb\r\n%endmacro\r\n\r\n%macro icmdComment 0\r\n\tDB 'Do nothing (disabling internal command) and outputs lots of debug information'\r\n%endmacro\r\n\r\n%macro icmdStuff 0\r\nnewCommandName: DB 0, 'REM     '\r\nnewCommandNameEnd:\r\n%endmacro\r\n\r\n;; include the ICMD template\r\n%include 'icmd_inc.inc'\r\n"
  },
  {
    "path": "tools/icmd_3.nas",
    "content": ";; Installable Command sample #3\r\n;;\r\n;;\tMaps the command into ECHO.\r\n;;\r\n\r\n;; %define DEBUG_ME 1\r\n\r\n%ifdef DEBUG_ME\r\n\tmov ax, cs\r\n\tadd ax, 10h\r\n\tmov ds, ax\r\n\tmov es, ax\r\n\tpush ax\r\n\tmov ax, start\r\n\tpush ax\r\n\tmov di, myNameLen\r\n\tmov si, tstName\r\n\txor cx, cx\r\n\tmov cl, [si]\r\n\tinc cl\r\n\tcld\r\n\trep movsb\r\n\tmov ax, 0ae01h\r\n\tmov bx, tstLine\r\n\tmov si, tstName\r\n\tmov dx, -1\r\n\tmov es, dx\r\n\tmov cx, 5678h\r\n\tretf\r\n\r\ntstLine: DB 128,11,'TST11 12345',13,0\r\n\ttimes 130-($-tstLine) DB 0\r\ntstName: DB 5,'TST11'\r\n\ttimes 7 DB ' '\r\n\r\nstart:\r\n%endif\r\n\r\n\r\n%macro icmdAction 0\r\n\t; adjust command line buffer\r\n\tmov ax, ds\r\n\tmov es, ax\r\n\txor ax, ax\r\n\tmov al, [si]\t\t\t;; icmd's own length\r\n\tsub al, [CS:newCommandName]\r\n\tjz act0\t; nothing to do\r\n\tjc act2\t; command line grows\r\n\t; command line shrinks\r\n\tinc bx\r\n\tsub BYTE [bx], al\r\n\tjc error\r\n\tinc bx\r\n\tmov di, bx\r\n\tadd bx, ax\r\n\tmov al, [di-2]\r\n\tmov cx, ax\r\n\tmov si, bx\r\n\trep movsb\r\n\tjmp short act5\r\n\r\nerror:\r\n\tmov ax, cs\r\n\tmov es, ax\r\n\tmov bx, errString\r\n\tcall oASCIIZ\r\n\tmov bx, [bp+6]\r\n\tmov ds, [bp+2]\r\n\tmov BYTE [bx], 0\r\n\tjmp short actEnde\r\n\r\nact2:\t;\tcommand line grows\r\n\tmov ch, ah\r\n\tinc bx\r\n\tsub BYTE [bx], al\r\n\tjnc error\r\n\tmov di, bx\r\n\tdec ah\r\n\tadd bx, ax\r\n\tmov cl, [di-1]\r\n\tcmp cl, [di]\r\n\tjc error\r\n\tadd di, cx\r\n\tadd bx, cx\r\n\tstd\r\n\tmov si, bx\r\n\trep movsb\r\n\tinc di\r\n\tsub cx, ax\r\n\tmov al, '.'\r\n\trep stosb\r\n\r\nact5:\r\nact4:\r\nact0:\r\n\tmov es, [bp+2]\r\n\tmov ax, cs\r\n\tmov ds, ax\r\n\tmov di, [bp+6]\r\n\tmov si, newCommandName\r\n\txor ax, ax\r\n\tmov al, [si]\t\t\t;; get new command's length of name\r\n\tinc al\t\t\t\t\t;; this byte itself\r\n\tmov cx, ax\r\n\tcld\r\n\trep movsb\r\nactEnde:\r\n%endmacro\r\n\r\n%macro icmdComment 0\r\n\tDB 'Maps the command into ECHO. and outputs lots of debug information'\r\n%endmacro\r\n\r\n%macro icmdStuff 0\r\nnewCommandName: DB 4, 'ECHO'\r\nerrString: DB 7,'Command line buffer over- or underflow',13,10,0\r\n%endmacro\r\n\r\n;; include the ICMD template\r\n%include 'icmd_inc.inc'\r\n"
  },
  {
    "path": "tools/icmd_inc.inc",
    "content": ";; Installable Command sample template\r\n;;\r\n;; DS:BX :- command line buffer <max length><cur length><command line>\r\n;; DS:SI :- command name buffer <length><command name>\r\n;; DX == 0xFFFF :- magic number\r\n\r\n\tcmp dx, 0ffffh\t;; probe magic number\r\n\tjne chain3\r\n\tpusha\t\t;; DI -4, SI -6, BP-8, SP-10, BX-12, DX-14, CX-16, AX-18\r\n\tpush ds\t\t;; -2\r\n\tpush es\t\t;; 0\r\n\tmov bp, sp\r\n\tcmp ah, 0aeh\r\n\tjne chain\r\n\tor al, al\r\n\tje check\r\n\tcmp al, 1\r\n\tje perform\r\nchain:\r\nchain2:\r\n\tpop es\r\n\tpop ds\r\n\tpopa\r\nchain3:\r\n\tjmp word 0:0\r\nchain_addr:\r\n\r\ncheck:\r\n\tmov di, sFctCheck\r\n\tcall amicalled\r\n\tjc chain2\r\n\tpop es\r\n\tpop ds\r\n\tpopa\r\n\tdec al\t\t\t\t;; AL := 0xFF :- OK, it's me\r\n\tiret\r\n\r\nperform:\r\n\tmov di, sFctPerform\r\n\tcall amicalled\r\n\tjc chain2\r\n\tmov ds, [bp+2]\r\n\tmov bx, [bp+12]\r\n\tmov si, [bp+6]\r\n\ticmdAction\r\n\tmov ds, [bp+2]\r\n\tmov bx, [bp+12]\r\n\tmov si, [bp+6]\r\n\tmov di, sFctReturn\r\n\tcall amicalled\r\n\tpop es\r\n\tpop ds\r\n\tpopa\r\n\tiret\r\n\r\namicalled:\r\n\tmov bx, cs\r\n\tmov es, bx\r\n\tcld\r\n\tmov bx, di\r\n\tcall oASCIIZ\r\n\tmov bx, sCmd\r\n\tcall oASCIIZ\r\n\tmov es, [bp+2]\r\n\tmov bx, si\r\n\tcall oPStringAddr\r\n\tmov bx, cs\r\n\tmov es, bx\r\n\tmov bx, sNL\r\n\tcall oASCIIZ\r\n\tmov bx, sLine\r\n\tcall oASCIIZ\r\n\tmov bx, [bp+12]\r\n\tinc bx\r\n\tmov es, [bp+2]\r\n\tcall oPStringAddr\r\n\tmov bx, sNL\r\n\tcall oASCIIZ\r\n\tmov di, myName-1\r\n\txor cx, cx\r\n\tmov cl, [SI]\r\n\tinc cx\r\n\trepe cmpsb\r\n\tjne notme\r\n\tmov bx, sIsMe\r\n\tcall oASCIIZ\r\n\tclc\r\n\tret\r\nnotme:\r\n\tmov bx, sIsNotMe\r\n\tcall oASCIIZ\r\n\tstc\r\n\tret\r\n\r\noMyName:\r\n\tpush cx\r\n\tpush bx\r\n\tmov cl, [ES:myNameLen]\r\n\tmov ch, 0\r\n\tmov bx, myName\r\n\tcall oString\r\n\tpop bx\r\n\tpop cx\r\n\tjmp short oStr1\r\n\r\noPStringAddr:\r\n\tcall oESBX\r\noPString:\r\n\tmov cl, [ES:BX]\r\n\tmov al, cl\r\n\tcall oAL\r\n\tinc bx\r\n\tmov ch, 0\r\n\tjmp short oString\r\noASCIIZ:\r\n\tmov cx, -1\r\noString:\r\n\tmov al, [ES:bx]\r\n\tinc bx\r\n\tor al, al\r\n\tje oStr2\r\n\tcmp al, 1\r\n\tje oMyName\r\n\tmov ah, 0eh\r\n\tpush bx\r\n\tpush bp\r\n\tmov bx, 7\r\n\tint 10h\r\n\tpop bp\r\n\tpop bx\r\noStr1:\r\n\tloop oString\r\noStr2:\r\n\tret\r\n\r\noAL:\r\n\tpush bx\r\n\tpush cx\r\n\tmov bx, sB\r\n\tcall convALtoBX\r\n\tmov bx, sByte\r\n\tmov cx, 4\r\n\tpush es\r\n\tmov ax, cs\r\n\tmov es, ax\r\n\tcall oString\r\n\tpop es\r\n\tpop cx\r\n\tpop bx\r\n\tret\r\n\r\noESBX:\r\n\tpush cx\r\n\tpush es\r\n\tpush bx\r\n\tmov ax, es\r\n\tmov bx, sAddr\r\n\tcall convAXtoBX\r\n\tpop ax\r\n\tpush ax\r\n\tmov bx, sAddr2\r\n\tcall convAXtoBX\r\n\tmov cx, 9\r\n\tmov ax, cs\r\n\tmov es, ax\r\n\tmov bx, sAddr\r\n\tcall oString\r\n\tpop bx\r\n\tpop es\r\n\tpop cx\r\n\tret\r\n\r\nconvAXtoBX:\r\n\tpush ax\r\n\tmov al, ah\r\n\tcall convALtoBX\r\n\tinc bx\r\n\tpop ax\r\nconvALtoBX:\r\n\tpush ax\r\n\tshr al, 4\r\n\tcall convLowALtoBX\r\n\tinc bx\r\n\tpop ax\r\nconvLowALtoBX:\r\n\tand al, 0fh\r\n\tcmp al, 10\r\n\tjc conv1\r\n\tadd al, 'A' - '0' - 10\r\nconv1:\r\n\tadd al, '0'\r\nconv3:\r\n\tmov BYTE [CS:bx], al\r\n\tret\r\n\r\n\ticmdStuff\r\n\r\nsFctCheck:\tDB '>>', 1, ': check'\r\nsNL:\tDB 13, 10, 0\r\nsAddr:\tDB 0,0,0,0, ':'\r\nsAddr2: DB 0,0,0,0\r\nsByte:\tDB '<'\r\nsB\t\tDB 0, 0, '>'\r\nsFctPerform:\tDB '>>', 1, ': perform', 13, 10, 0\r\nsFctReturn:\tDB '>>', 1, ': return', 13, 10, 0\r\nsCmd:\tDB '>>', 1, ': command name: ', 0\r\nsLine:\tDB '>>', 1, ': command line: ', 0\r\nsIsMe:\tDB '>>', 1, ': -- is me --', 13, 10, 0\r\nsIsNotMe:\tDB '>>', 1, ': -- is NOT me --', 13, 10, 0\r\n\r\nmyNameLen:\tDB 0\r\nmyName:\t\tDB 0\r\n\r\nDW chain_addr - 4\r\nDW myNameLen\r\nDB 0\r\n\ticmdComment\r\nDB 'INSTALLABLE COMMAND - ICD v1.0'\r\n"
  },
  {
    "path": "tools/icmd_tpl.nas",
    "content": ";; Installable Command sample template\r\n;;\r\n;;\t<description>\r\n;;\r\n\r\n%macro icmdAction 0\r\n\tpusha\r\n\t<<<<<<<< Action performed within MUX-AE-01 >>>>>>>>>>>>>\r\n\tpopa\r\n%endmacro\r\n\r\n%macro icmdComment 0\r\n\tDB '<<<<<<<<<<<<<<<< Comment record >>>>>>>>>>>>>>>>>>'\r\n%endmacro\r\n\r\n%macro icmdStuff 0\r\n\t<<<<<<<<<<<<<< Stuff required by Action >>>>>>>>>>>>>>>>\r\n%endmacro\r\n\r\n;; include the ICMD template\r\n%include 'icmd_inc.inc'\r\n"
  },
  {
    "path": "tools/kssf.asm",
    "content": ";; $Id$\r\n\r\n; Kernel Swap Support Faker\r\n\r\n; Useage: kssf freecom [{ arguments }]\r\n;\t\"freecom\" is the absolute path to FreeCOM -- including drive, path\r\n;\t\tand extenstion\r\n;\targuments are any arguments to passed to FreeCOM\r\n\r\n; This program fakes all interrupts and behaviour assumed by FreeCOM\r\n; to use the kernel swap support. See DOS\\K-SWAP.TXT for more details.\r\n\r\n%include \"../context.inc\"\r\n\r\nSTACK_SIZE EQU 64\r\n%define tsrend (tsrend_ - start + 100h + ((tsrend_ - start) & 1))\r\n\r\n\tABSOLUTE 5ch\t; where the temp variables do reside\r\nexecBlock:\r\neb_envseg\tRESW 1\r\neb_cmdline\tRESD 1\r\neb_fcb\t\tRESD 2\r\nshellCmdLine\tRESB 2\r\ncontext\t\tRESW 1\r\nctxt_owner\tRESW 1\r\norigParent\tRESW 1\r\ncmd_buf:\r\n\r\nSEGMENT .text\r\n\r\nORG 100h\t\t; this is an executable program, but as small as possible\r\n\r\nstart:\r\njmp goon\r\n\r\n%ifdef DEBUG\r\nstrExiting\tDB 13, 10, 'Exiting KSSF'\r\nstrNL\t\tDB 13, 10, '$', 0\r\nstrNotMe\tDB 'The current PSP is not me!', 7, 13, 10, '$', 0\r\n%endif\r\n\r\nerrString DB 13, 10, 'Failed to execute shell - '\r\n\tDB 'Exiting Kernel Swap Support Faker.', 7, 13, 10\r\n\tDB 'Press any key to preceed ...', 13, 10\r\n\tDB '$', 0\r\n\r\nerrExecShell:\t\t; Failed to execute the shell\r\n\tmov dx, errString\r\n\tmov ah, 9\r\n\tint 21h\r\n\tmov ah, 7\r\n\tint 21h\r\n\tjmp exit\r\n\r\nerr2:\r\n\tjmp err2_\r\n\r\ntsrstart:\r\n\tmov ah, 4ah\t\t; Resize memory\r\n\tint 21h\r\n\tjc err2\r\n\r\nmainloop:\r\n\txor ax, ax\r\n\tmov WORD [ES:ctxt_owner], ax\t; let the shell brand this KSSF\r\n\tmov bx, execBlock\r\n\tmov ah, 4bh\t\t; load & run shell\r\n\tint 21h\r\n\tmov sp, tsrend + STACK_SIZE\t; standard stack position\r\n\tmov ax, cs\r\n\tmov ds, ax\r\n\tjc errExecShell\t; failed to execute the shell\r\n\t;; Run external program if one exists\r\n\tmov ax, [context]\r\n\tor ax, ax\r\n\tjz exit\t\t; no context -> terminate kssf\r\n\tmov es, ax\r\n\tmov ax, [ES:?envSegm]\r\n\tmov WORD [eb_envseg], ax\t; applies to shell & prg\r\n\tmov ax, [ES:?prg + 2]\t; segment of program name\r\n\tor ax, ax\r\n\tjz execShell\r\n\t;; execute external program\r\n\tmov dx, [ES:?prg]\t\t; offset of program name\r\n\tles bx, [es:?cmdline]\t; pointer to command line\r\n\tmov WORD [eb_cmdline], bx\r\n\tmov WORD [eb_cmdline+2], es\r\n\tmov bx, cs\r\n\tmov es, bx\r\n\tmov bx, execBlock\r\n\tmov ds, ax\r\n\tmov ax, 4b00h\r\n\tint 21h\t\t\t\t\t; execute external program\r\n\tjc execPrg1\r\n\txor ax, ax\t\t\t\t; no error\r\nexecPrg1:\r\n\tmov sp, tsrend + STACK_SIZE\t; standard stack position\r\n\tmov dx, cs\r\n\tmov ds, dx\r\n\tmov es, [context]\r\n\tmov [ES:?execErr], ax\t; error code of DOS-4B API\r\nexecShell:\r\n\tmov ax, shellCmdLine\r\n\tmov [eb_cmdline], ax\r\n\tmov ax, cs\r\n\tmov [eb_cmdline+2], ax\r\n\tlds dx, [ES:?shell]\r\n\tmov es, ax\r\n\tmov ax, ds\t\t\t\t; probe if a name exists\r\n\tor ax, ax\r\n\tjne mainloop\r\nexit:\t\t\t\t\t\t; exit kssf\r\n\tmov ax, cs\r\n\tmov ds, ax\t\t\t\t; ensure DS == PSP\r\n%ifdef DEBUG\r\n\tmov dx, strExiting\r\n\tmov ah, 9\r\n\tint 21h\r\n\tmov ah, 62h\r\n\tint 21h\r\n\tmov ax, cs\r\n\tcmp ax, bx\r\n\tje dbg_1\r\n\tmov dx, strNotMe\r\n\tmov ah, 9\r\n\tint 21h\r\ndbg_1:\r\n%endif\r\n\tmov ax, WORD [origParent]\t; restore parentPSP to original value\r\n\tmov WORD [ds:16h], ax\r\n\r\n\tmov ax, [context]\t\t; let context be deallocated, too\r\n\tor ax, ax\r\n\tjz exit_noCtxt\r\n\tdec ax\r\n\tmov es, ax\t\t\t\t; MCB of context\r\n\tmov WORD [ES:1], ds\t\t; owner of context := kssf\r\n\tmov ax, [ES:10h+?envSegm]\t\t; environment segm\r\n\tor ax, ax\r\n\tjz exit_noCtxt\r\n\tdec ax\r\n\tmov es, ax\t\t\t\t; MCB of env segm\r\n\tmov WORD [ES:1], ds\t\t; owner of env segm := kssf\r\nexit_noCtxt:\r\n\tlds dx, [old_isr21]\t\t; old INT-21\r\n\tmov ax, 2521h\r\n\tint 21h\t\t\t\t\t; install old handler\r\n\tmov ax, 4c00h\r\n\tint 21h\r\n\tint 20h\r\n\r\nisr21:\t\t\t\t\t\t;; DOS interrupt chain\r\n\tcmp dx, 'FD'\t\t\t;; magic number\r\n\tjne isr21_chain\r\n\tcmp ax, 4bfeh\r\n\tje isr21_do\r\n\tcmp ax, 4bfdh\r\n\tje isr21_do\r\nisr21_chain:\r\n\tjmp 0:0\r\nold_isr21 EQU $-4\r\n\r\nisr21_do:\r\n\tpush ds\r\n\tpush cs\r\n\tpop ds\r\n\tpush bp\r\n\tmov bp, sp\t\t;; BP+8 == flags\r\n\tpush dx\r\n\tpush ax\r\n\tmov dx, bx\t\t;; new context\r\n\tmov ah,62h\t\t; get current PSP\r\n\tint 21h\t\r\n\tmov ax, [ctxt_owner]\r\n\tor ax, ax\r\n\tjnz isr21_1\r\n\t;; first call --> brand the KSSF to this process\r\n\tmov WORD [ctxt_owner], bx\r\nisr21_1:\r\n\txchg bx, dx\r\n\tpop ax\r\n\tcmp al, 0feh\r\n\tmov ax, [ctxt_owner]\r\n\tje isr21_getCtxt\r\n\t;; set Ctxt\r\n\tcmp ax, dx\r\n\tjne isr21_noAcc\r\nisr21_setCtxt:\r\n\txchg [context], bx\r\n\tjmp short isr21_ok\r\n\r\nisr21_getCtxt:\r\n\tmov bx, [context]\r\n\tcmp ax, dx\r\n\tjne isr21_noAcc\r\nisr21_ok:\r\n\tand BYTE [bp+8], 0feh\t\t; clear Carry flag\r\n%ifdef DEBUG\r\n\tmov ax, cs\t\t\t\t\t; our PSP / PID\r\n%endif\r\nisr21_iret:\r\n\tpop dx\r\n\tpop bp\r\n\tpop ds\r\n\tiret\r\nisr21_noAcc:\r\n\tor BYTE [bp+8], 1\t\t\t; set Carry flag\r\n\tmov ax, 5\r\n\tjmp short isr21_iret\r\ntsrend_:\r\n\r\nerr2_:\r\n\tmov dx, errResize\r\n\tjmp errOut\r\n\r\ngoon:\t;; Initialization a.s.o.\r\n\t; Decode command line argument list\r\n\tmov ax, cs\t\t; Get PSP\r\n\tmov ds, ax\r\n\r\n\tmov ax, 3521h\r\n\tint 21h\t\t\t; Get interrupt vector\r\n\tmov WORD [old_isr21], bx\r\n\tmov WORD [old_isr21+2], es\r\n\tmov dx, isr21\r\n\tmov ax, 2521h\r\n\tint 21h\t\t\t; Set interrupt vector\r\n%ifdef DEBUG\r\n\tcall printLoadSegm\r\n%endif\r\n\r\n\tmov ax, cs\r\n\tmov es, ax\r\n\r\n\txor ax, ax\r\n\tmov di, execBlock\r\n\tmov cx, cmd_buf - execBlock\r\n\trep stosb\t\t; erase the execBlock\r\n\tmov BYTE [shellCmdLine+1], 0dh\r\n\r\n\tmov bx, 80h\t\t; length byte of command line\r\n\tmov al, [bx]\r\n\tinc al\r\n\tadd bx, ax\t\t; end of line\r\n\tmov BYTE [bx], 0dh\t; even if length == 126,\r\n\t\t\t\t\t\t; the first byte of program is unsed\r\n\tmov si, 81h\t\t; command line\r\nfcom1:\r\n\tlodsb\r\n\tcmp al, 0dh\t\t; end of line\r\n\tje err1\r\n\tcmp al, ' '+1\t; whitespaces\r\n\tjc fcom1\r\n\r\n\tcmp al, '/'\t\t; KSSF /y COMMAND.COM if F8 during CONFIG.SYS\r\n\tjne noY\r\n\tcmp byte [si], 'Y'\r\n\tjne noY\r\n\tinc byte [haveY]\r\n\tinc si\r\n\tjmp short fcom1\r\n\t\r\nnoY:\r\n\t;; Copy the command to an unused place, because between command and\r\n\t;; argument list two bytes must be inserted.\r\n\tmov dx, cmd_buf\t; where the command is temporarily stored to\r\n\tmov di, dx\r\nfcom_cpy:\r\n\tstosb\r\n\tlodsb\r\n\tcmp al, ' ' + 1\r\n\tjnc fcom_cpy\r\n\tmov BYTE [di], 0\t; end of command name\r\n\tmov ax, bx\t\t\t; BX == end of command line\r\n\t\t\t\t\t\t; SI == begin of command line + 1\r\n\tdec si\t\t\t\t; correction for SI + 1\r\n\tcmp byte [haveY], 0\r\n\tje noAddY\r\n\t;; preserve the /Y\r\n\tcmp byte [si], 0dh\r\n\tje ignEOS\r\n\tmov byte [si], ' '\r\nignEOS:\r\n\tdec si\r\n\tmov byte [si], 'Y'\r\n\tdec si\r\n\tmov byte [si], '/'\r\nnoAddY:\r\n\tsub ax, si\t\t\t; length of remaining command line\r\n\tdec si\t\t\t\t; position to the length byte\r\n\tmov BYTE [si], al\t; prefixed the command line tail with the length byte\r\n\tmov WORD [eb_cmdline], si\t; DWORD eb_cmdline := DS:SI\r\n\tmov WORD [eb_cmdline+2], ds\r\n\r\n\tmov ax, cs\r\n;;\tmov WORD [ds:16h], cs\t; set our owner to ourselves <-> shell hack\r\n\txchg WORD [ds:16h], ax\t; set our owner to ourselves <-> shell hack\r\n\tmov WORD [origParent], ax\r\n\r\n\t;; DS:DX == command name\r\n\t;; execBlock is filled\r\n\tmov bx, (tsrend + STACK_SIZE + 15) / 16\r\n\t\t\t\t\t; := number of paragraphes\r\n\t\t\t\t\t; required for TSR and stack\r\n\tmov sp, tsrend + STACK_SIZE\t; new stack size\r\n\tjmp tsrstart\r\n\r\nerr1:\r\n\tmov dx, useage\r\nerrOut:\r\n\tmov ah, 9\r\n\tint 21h\r\n\tmov ah, 7\r\n\tint 21h\r\n\tmov ax, 4c03h\r\n\tint 21h\r\n\tint 20h\r\n\r\nuseage DB 7, 'Useage: KSSF freecom [{ arguments }]', 13, 10\r\n\tDB 9, 'freecom: absolute filename of FreeCOM', 13, 10\r\n\tDB 9, 'arguments: any optionally arguments or options', 13, 10\r\n\tDB 'Spawns FreeCOM and fakes the necessary kernel functions for', 13, 10\r\n\tDB 'the Kernel Swap Support', 7, 13, 10, '$'\r\n\r\nerrResize DB 7, 'Failed to resize KSSF memory block', 13, 10, '$'\r\n\r\nhaveY\tDB 0\r\n\r\n%ifdef DEBUG\r\nprintLoadSegm:\r\n\tmov dx, dbgStr1\r\n\tmov ah, 9\r\n\tint 21h\r\n\tmov ax, cs\r\n\tcall printWord\r\n\tmov dl, ':'\r\n\tmov ah, 2\r\n\tint 21h\r\n\tmov ax, isr21\r\n\tcall printWord\r\n\tmov dx, dbgStr2\r\n\tmov ah, 9\r\n\tint 21h\r\n\tret\r\n\r\nprintWord:\r\n\tpush ax\r\n\tmov al, ah\r\n\tcall printByte\r\n\tpop ax\r\nprintByte:\r\n\tpush ax\r\n\tshr al, 4\r\n\tcall printNybble\r\n\tpop ax\r\nprintNybble:\r\n\tand al, 0fh\r\n\tadd al, '0'\r\n\tcmp al, '0' + 10\r\n\tjc print1\r\n\tadd al, 'A' - '0' - 10\r\nprint1:\r\n\tmov dl, al\r\n\tmov ah, 2\r\n\tint 21h\r\n\tret\r\ndbgStr1\tDB 'KSSF loaded at ', '$'\r\ndbgStr2 DB 10, 13, '$'\r\n%endif\r\n\r\n;;END\r\n"
  },
  {
    "path": "tools/load_icd.c",
    "content": "/* $Id$\r\n\r\n\tLoad Installable Commands samples into memory\r\n */\r\n\r\n#include <dos.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../config.h\"\r\n\r\n#include \"suppl.h\"\r\n#include \"portable.h\"\r\n#if defined(_TC_EARLY_)\r\n# include \"fmemory.h\"\r\n#endif\r\n\r\n#define BUFFER_SIZE 10*1024\r\nconst char id[] = \"INSTALLABLE COMMAND - ICD v1.0\";\r\n\r\nint main(int argc, char **argv)\r\n{\tunsigned char *buf, *h;\r\n\tsize_t len, offName, offPtr;\r\n\tunsigned *p;\r\n\tFILE *f;\r\n\tchar *q;\r\n\tIREGS r;\r\n\tunsigned char _seg *icmd;\r\n\r\n\tif(argc != 2) {\r\n\t\tputs(\"Load Installable Commands (FreeCOM shell extensions)\");\r\n\t\tfputs(\"\\nUseage: \", stdout);\r\n\t\tfputs(argv[0], stdout);\r\n\t\tputs(\" command\");\r\n\t\treturn 127;\r\n\t}\r\n\r\n\tif((buf = malloc(BUFFER_SIZE)) == NULL) {\r\n\t\tputs(\"Cannot allocate transfer buffer - Out of memory\");\r\n\t\treturn 33;\r\n\t}\r\n\r\n\tif((f = fopen(argv[1], \"rb\")) == NULL) {\r\n\t\tstrcpy(stpcpy((char*)buf, argv[1]), \".icd\");\r\n\t\tif((f = fopen((char *)buf, \"rb\")) == NULL) {\r\n\t\t\tfputs(\"Cannot open file: \", stdout);\r\n\t\t\tputs(argv[1]);\r\n\t\t\treturn 34;\r\n\t\t}\r\n\t}\r\n\r\n\tlen = fread(buf, 1, BUFFER_SIZE, f);\r\n\tif(ferror(f) || len == (size_t)-1 || len < sizeof(id) + 4) {\r\n\t\tfputs(\"Error reading command: \", stdout);\r\n\t\tputs(argv[1]);\r\n\t\treturn 35;\r\n\t}\r\n\tfclose(f);\r\n\tif(len == BUFFER_SIZE) {\r\n\t\tfputs(\"Command too large: \", stdout);\r\n\t\tputs(argv[1]);\r\n\t\treturn 36;\r\n\t}\r\n\r\n\th = &buf[len - (sizeof(id) - 1)];\r\n\tif(memcmp(h, id, sizeof(id) - 1)) {\r\n\t\tputs(\"File does not contain a valid Installable Command\");\r\n\t\treturn 37;\r\n\t}\r\n\r\n\t*h = 0;\r\n\twhile(--h > buf && *h);\r\n\tif(h == buf) {\r\n\t\tputs(\"File does not contain a valid Installable Command\");\r\n\t\treturn 39;\r\n\t}\r\n\tp = (unsigned*)h;\r\n\toffName = *--p;\r\n\toffPtr  = *--p;\r\n\r\n\tif(*++h) {\r\n\t\tputs(\"Installable Command comment record:\");\r\n\t\tputs((char*)h);\r\n\t}\r\n\r\n\tif(offName > len - sizeof(id) + 1 || offPtr > len - sizeof(id) + 1) {\r\n\t\tputs(\"File does not contain a valid Installable Command\");\r\n\t\treturn 38;\r\n\t}\r\n\r\n\t/* Add Installable Command name */\r\n\tfor(q = strchr(argv[1], 0); --q >= argv[1] && *q != ':' && *q != '\\\\'; )\r\n\t\tif(*q == '.')\r\n\t\t\t*q = 0;\r\n\t++q;\r\n\tif(!strlen(q) || strlen(q) > sizeof(id) - 2) {\r\n\t\tputs(\"Invalid filename syntax\");\r\n\t\treturn 40;\r\n\t}\r\n\r\n\tstrupr(q);\r\n\tbuf[offName] = (unsigned char)strlen(q);\r\n\tstrcpy((char*)&buf[offName + 1], q);\r\n\tlen = offName + strlen(q) + 2;\r\n\r\n\tr.r_ax = 0x352f;\r\n\tintrpt(0x21, &r);\r\n\t*(void far**)&buf[offPtr] = MK_FP(r.r_es, r.r_bx);\r\n\r\n\t/* Add into memory */\r\n\tr.r_ax = 0x4800;\r\n\tr.r_bx = (len + 15) / 16;\r\n\tintrpt(0x21, &r);\r\n\tif(r.r_flags & 1) {\r\n\t\tputs(\"Error allocating memory for resident portion of command\");\r\n\t\treturn 41;\r\n\t}\r\n\r\n\ticmd = MK_SEG_PTR (unsigned char, r.r_ax - 1);\r\n\t*(unsigned far *)&icmd[1] = 8;\t\t/* make it system property */\r\n\t_fmemcpy(&icmd[8], &buf[offName + 1], 8);\r\n\t_fmemcpy(&icmd[16], buf, len);\r\n\r\n\tr.r_ds = r.r_ax;\r\n\tr.r_dx = 0;\r\n\tr.r_ax = 0x252f;\r\n\tintrpt(0x21, &r);\r\n\r\n\tprintf(\"Installable Command %s loaded to 0x%04x\\n\"\r\n\t , &buf[offName + 1], r.r_ds);\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "tools/makefile",
    "content": "# $Id$\r\n#\r\n# Makefile for tools of the FreeDOS kernel's command interpreter\r\n#\r\n#\tThere is no default target!!\r\n#\r\n# Available main targets:\r\n#\tptchldrv.exe\t- patch log drive\r\n#\ticmd\t\t\t- Installable Commands samples\r\n#\r\n#\r\n# $Log$\r\n# Revision 1.9  2004/06/29 14:14:57  skaus\r\n# fix: help screen of internal commands causes \"Unknown command error\" {Bernd Blaauw}\r\n#\r\n# Revision 1.8  2002/04/02 23:36:37  skaus\r\n# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n#\r\n# Revision 1.7  2001/04/12 00:09:06  skaus\r\n# chg: New structure\r\n# chg: If DEBUG enabled, no available commands are displayed on startup\r\n# fix: PTCHSIZE also patches min extra size to force to have this amount\r\n#    of memory available on start\r\n# bugfix: CALL doesn't reset options\r\n# add: PTCHSIZE to patch heap size\r\n# add: VSPAWN, /SWAP switch, .SWP resource handling\r\n# bugfix: COMMAND.COM A:\\\r\n# bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n# add: command MEMORY\r\n# bugfix: runExtension(): destroys command[-2]\r\n# add: clean.bat\r\n# add: localized CRITER strings\r\n# chg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n# \tvia STRINGS.LIB\r\n# add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n# add: fixstrs.c: prompts & symbolic keys\r\n# add: fixstrs.c: backslash escape sequences\r\n# add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n# chg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n# bugfix: IF is now using error system & STRINGS to report errors\r\n# add: CALL: /N\r\n#\r\n\r\n.IF $(NASM) == $(NULL)\r\n\r\n.INCLUDE : ../_config.mk\r\n\r\n.ENDIF\r\n\r\nINCDIR +=;$(FREEDOS)\\SRC\\INCLUDE;..\r\n# LIBDIR +=;$(FREEDOS)\\SRC\\LIB\\$(_COMPILER)\r\nLDLIBS = $(FREEDOS)\\SRC\\LIB\\$(_COMPILER)\\Suppl_$(_MODEL).lib\r\nLDFLAGS += /msl\r\n\r\n# Project specific C compiler flags\r\nMYCFLAGS_DBG = -DNDEBUG=1 $(null,$(DEBUG) $(NULL) -DDEBUG=1)\r\nMYCFLAGS_NDBG =\r\nMYCFLAGS = $(null,$(NDEBUG) $(MYCFLAGS_DBG) $(MYCFLAGS_NDBG))\r\n# Project specific NASM compiler flags\r\nNASMFLAGS_DBG = $(null,$(DEBUG) $(NULL) -DDEBUG=1) -s\r\nNASMFLAGS_NDBG = -s\r\nNASMFLAGS = $(null,$(NDEBUG) $(NASMFLAGS_DBG) $(NASMFLAGS_NDBG))\r\n\r\n\r\n.SOURCE.h := . ..\r\n.SOURCE.lib := $(LIBDIR:s/;/ /:u)\r\n.IF $(FRREDOS) == $(NULL)\r\n.IMPORT : FREEDOS\r\n.ENDIF\r\n\r\n# Sources of this make target\r\n\r\n.IF $(MAKETARGETS:s/all//) == $(NULL)\r\n#\tDefault target\r\n#\tRequired only, if no targets were specified on command line\r\n.INCLUDE : default.mk\r\n## all: ptchldrv.exe kssf.com icmd\r\nerror:\r\n\terrlvl 127\r\n.ENDIF\r\n\r\ndist : ;\r\n\r\nicmd : load_icd.exe icmd_{1 2 3}.icd\r\n\r\n%.icd : %.nas ; $(NASM) -f bin -o $@ $<\r\n\r\nicmd_1.icd : icmd_inc.inc icmd_1.nas\r\n\r\nicmd_2.icd : icmd_inc.inc icmd_2.nas\r\n\r\nicmd_3.icd : icmd_inc.inc icmd_3.nas\r\n\r\nicmd_4.icd : icmd_inc.inc icmd_4.nas\r\n\r\n.INIT : $(CFG) __errl\r\n\r\n__errl:\r\n\t@+-if exist errlist del errlist >nul\r\n\t-ctags *.c\r\n\r\n\r\nptchldrv.obj : ptchldrv.c\r\n\r\nvspawn.com : vspawn.asm\r\n\t$(NASM) $(NASMFLAGS) -f bin -o $@ $(MYASMFLAGS) $<\r\n\r\nkssf.com : kssf.asm\r\n\t$(NASM) $(NASMFLAGS) -f bin -o $@ $(MYASMFLAGS) $<\r\n\r\nload_icd.obj : load_icd.c\r\n\r\n.INCLUDE : makefile.1\r\n\r\n"
  },
  {
    "path": "tools/makefile.1",
    "content": "# $Id$\r\n#\r\n\r\nall :\r\n\r\nclobber : clean\r\n\t$(RM) $(RMFLAGS) *.exe *.com *.icd default.mk lastmake.mk *.cfg\r\n\r\nclean :\r\n\t$(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj $(CFG) *.dmp\r\n\r\n"
  },
  {
    "path": "tools/ptchldrv.c",
    "content": "/*  $Id$\r\n\r\n  Patch log drive\r\n\r\n  This little utitilty patches the drive letter COMMAND.COM\r\n  creates its log file on.\r\n\r\n  2000/01/05 ska\r\n  started as of implementation of the start logging feature\r\n*/\r\n\r\n#include <stdio.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n\r\n  /* Aquire LOG_FILE, the name of the logfile */\r\n#include \"../config.h\"\r\n\r\nstatic char logFilename[] = LOG_FILE;\r\nstatic char hbuf[] = LOG_FILE;\r\nstatic char buf[sizeof(logFilename) - 1];\r\n\r\nmain(int argc, char **argv)\r\n{ long stringpos;\r\n  char *fnam;\r\n  FILE *f;\r\n  int fill, ch;\r\n  char ibuf[1024];\r\n\r\n  if(argc > 2\r\n   || argc == 2 && (strlen(argv[1]) != 1 || !isalpha(argv[1][0]))) {\r\n    puts(\"Patches the drive letter FreeCom.COM creates its logfile on\\nUsage: PTCHLDRV [drive_letter]\");\r\n    return 40;\r\n  }\r\n\r\n  if((f = fopen(fnam = \"com.com\", \"r+b\")) == NULL\r\n   && (f = fopen(fnam = \"com.exe\", \"r+b\")) == NULL\r\n   && (f = fopen(fnam = \"command.com\", \"r+b\")) == NULL) {\r\n    puts(\"Cannot find COMMAND.COM\");\r\n    return 41;\r\n  }\r\n  printf(\"File \\\"%s\\\" successfully opened.\\n\", fnam);\r\n\r\n  /* Search for the position of the logFilename within the image */\r\n  stringpos = 0;\r\n  fill = 0;\r\n  do {\r\n      /* fill the buffer */\r\n    if(fill != sizeof(buf)\r\n     && fread(buf + fill, sizeof(buf) - fill, 1, f) != 1)\r\n        break;\r\n    if(memcmp(logFilename + 1, buf, sizeof(buf)) == 0) {\r\n      if(stringpos) {\r\n        puts(\"The opened file contains the logfilename multiple times.\\nThis file cannot be patched.\");\r\n        return 42;\r\n      }\r\n      stringpos = ftell(f);\r\n      if(stringpos == -1L) {\r\n        puts(\"General access error.\\n\");\r\n        return 44;\r\n      }\r\n      stringpos -= sizeof(logFilename);\r\n    }\r\n      /* Read-in the next chunk */\r\n    if((fnam = memchr(buf + 1, logFilename[1], sizeof(buf) - 1)) == NULL)\r\n      fill = 0;\r\n    else {\r\n      fill = sizeof(buf) - (fnam - buf);\r\n      memmove(buf, fnam, fill);\r\n    }\r\n  } while(1);\r\n\r\n  if(!stringpos) {\r\n    puts(\"The logfilename could not be located within the opened file.\\nThis can happen, if FEATURE_CALL_LOGGING was disabled,\\nwhen FreeCom was compiled.\");\r\n    return 43;\r\n  }\r\n\r\n  if(fseek(f, stringpos, SEEK_SET)) {\r\n    puts(\"Cannot seek to logfilename.\\n\");\r\n    return 45;\r\n  }\r\n\r\n  if(fread(hbuf, sizeof(hbuf), 1, f) != 1) {\r\n    puts(\"Reading of logfilename failed.\\n\");\r\n    return 46;\r\n  }\r\n\r\n  if(memcmp(hbuf + 1, logFilename + 1, sizeof(hbuf) - 1) != 0) {\r\n    puts(\"Unexpected change in file.\\n\");\r\n    return 47;\r\n  }\r\n\r\n  if(!isalpha(*hbuf)) {\r\n    puts(\"Invalid drive letter within logfilename.\\nFreeCom must be re-compiled.\");\r\n    return 50;\r\n  }\r\n\r\n  printf(\"Current drive letter the logfile is created on: %c\\n\", *hbuf);\r\n\r\n  if(argc == 2) {\r\n    printf(\"The drive letter shall be changed to: %c\\n\", ch = argv[1][0]);\r\n    if(toupper(*hbuf) == toupper(ch)) {\r\n      puts(\"No modification necessary.\");\r\n      return 0;\r\n    }\r\n\r\n    if(ferror(f)) {\r\n      puts(\"General access error on file.\");\r\n      return 47;\r\n    }\r\n\r\n    printf(\"Shall the file be patched?\\nIf you proceed, but the process fails,\\nthe file must be replaced by a new copy!\\n\\nAnswer \\\"yes\\\" (all three characters) to proceed: \");\r\n    if(fgets(ibuf, sizeof(ibuf), stdin) == NULL\r\n     || ibuf[4] != '\\0'\r\n     || strcmp(ibuf, \"yes\\n\") != 0) {\r\n      puts(\"The input does not match \\\"yes\\\" --> Abort.\\nThe file has not been modified.\");\r\n      return 60;\r\n    }\r\n\r\n    puts(\"\\n\\nProceed patching...\");\r\n    if(fseek(f, stringpos, SEEK_SET)) {\r\n      puts(\"Cannot seek to logfilename.\\n\");\r\n      return 48;\r\n    }\r\n    *logFilename = ch;\r\n\r\n    if(fwrite(logFilename, 1, 1, f) != 1 || ferror(f)) {\r\n      puts(\"Patching failed!\\nThis file cannot be used no longer!\");\r\n      return 49;\r\n    }\r\n\r\n    fclose(f);\r\n\r\n    puts(\"File patched successfully.\");\r\n  }\r\n\r\n  return 0;\r\n}\r\n"
  },
  {
    "path": "tools/ptchsize.c",
    "content": "/* $Id$\r\n\r\n\tPatch heap size into FreeCOM executable\r\n\r\n\tUseage: PTCHSIZE freecom [{ size }]\r\n\r\n\tWithout any argument: Display the internal information\r\n\tElse: patch the executable\r\n\t\tif the sum of \"size\" arguments evaluates to zero,\r\n\t\tthe estimated minimum heap size is used.\r\n*/\r\n\r\n#undef DEBUG\r\n\r\n#include <ctype.h>\r\n#include <limits.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../include/res.h\"\r\n#include \"../include/infores.h\"\r\n\r\n\r\nFILE *freecom = 0;\r\nunsigned char *info = 0;\r\nunsigned infoLen = 0;\r\nunsigned long minSize;\r\n\r\nstruct {\r\n\tunsigned alias, hist, dirs, bufsize, extraSpace;\r\n#ifdef __LP64__\r\n\tunsigned int heapPos;\r\n#else\r\n\tunsigned long heapPos;\r\n#endif\r\n} ival;\r\n\r\n#define PTCHSIZE\r\n#include \"../lib/res_r.c\"\t\t/* make a single file project */\r\n\r\nint getInfo (res_majorid_t major,\r\n                    res_minorid_t minor,\r\n                    unsigned long length,\r\n                    int fd,\r\n                    void *const arg) {\r\n        (void)arg;\r\n\tif(major == RES_ID_INFO && minor == 0) {\r\n\t\tif(length >= INT_MAX) {\r\n\t\t\tputs(\"Info resource is too large\");\r\n\t\t\treturn 100;\r\n\t\t}\r\n\t\tif((info = malloc(infoLen = (unsigned)length)) == 0) {\r\n\t\t\tputs(\"Out of memory\");\r\n\t\t\treturn 101;\r\n\t\t}\r\n\t\tif(read(fd, info, (unsigned)length) != (unsigned)length) {\r\n\t\t\tputs(\"Read error from file\");\r\n\t\t\treturn 102;\r\n\t\t}\r\n\t\treturn 1;\t\t/* Success */\r\n\t}\r\n\treturn 0;\t\t/* Proceed */\r\n}\r\n\r\n#define err(num)\terr_(i, (num))\r\nvoid err_(int i, int num)\r\n{\tprintf(\"Info resource corrupted at offset %u\\n\", i);\r\n\texit(num);\r\n}\r\nvoid getInfoValues(void)\r\n{\tint i;\r\n\tunsigned *pu;\r\n\r\n\tival.alias = ival.hist = ival.dirs = ~0;\r\n\tival.extraSpace = 2 * 1024 / 16;\r\n\tival.bufsize = 256;\r\n\tival.heapPos = ~0;\r\n\r\n\tassert(sizeof(ival.heapPos) == 4);\r\n\r\n\tfor(i = 0; i < infoLen; i += 1 + info[i]) {\r\n\t\tif((unsigned long)i + 1 + info[i + 1] > infoLen)\r\n\t\t\terr(81);\r\n\t\tswitch(info[i++]) {\r\n\t\tcase INFO_END:\treturn;\r\n\t\tcase INFO_POS_HEAPLEN:\r\n\t\t\tif(info[i] != 4) err(82);\r\n\t\t\tmemcpy(&ival.heapPos, &info[i + 1], 4);\r\n\t\t\tbreak;\r\n\t\tcase INFO_ALIASES:\r\n\t\t\tpu = &ival.alias;\r\n\t\tvalUnsigned:\r\n\t\t\tif(info[i] != 2) err(83);\r\n\t\t\tmemcpy(pu, &info[i + 1], 2);\r\n\t\t\tbreak;\r\n\t\tcase INFO_HISTORY:\r\n\t\t\tpu = &ival.hist;\r\n\t\t\tgoto valUnsigned;\r\n\t\tcase INFO_DIRSTACK:\r\n\t\t\tpu = &ival.dirs;\r\n\t\t\tgoto valUnsigned;\r\n\t\tcase INFO_BUFSIZE:\r\n\t\t\tpu = &ival.bufsize;\r\n\t\t\tgoto valUnsigned;\r\n\t\tcase INFO_EXTRA_SPACE:\r\n\t\t\tpu = &ival.extraSpace;\r\n\t\t\tgoto valUnsigned;\r\n\t\tdefault:\r\n\t\t\tprintf(\"Warning: Unknown info tag found: %u\\n\", info[i - 1]);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nvoid prUns(unsigned val, char *name)\r\n{\r\n\tfputs(name, stdout);\r\n\tif(val == (unsigned)~0)\r\n\t\tputs(\" not included or in separated segment\");\r\n\telse printf(\" default buffer size: %u\\n\", val);\r\n}\r\n\r\n#define addUns(val)\taddUns_(&minSize, (val))\r\nvoid addUns_(unsigned long *minVal, unsigned val)\r\n{\t\r\n\tif(val != (unsigned)~0)\r\n\t\t*minVal += val;\r\n}\r\n\r\nvoid addSize(unsigned short *size, char * const Xp)\r\n{\tunsigned long n;\r\n\tchar *p = Xp;\r\n\r\n\tif(memcmp(p, \"+\", 2) == 0)\r\n\t\tn = minSize;\r\n\telse {\r\n\t\tn = 0;\r\n\t\tif(*p == '+')\r\n\t\t\t++p;\r\n\t\tif(*p == '0' && toupper(p[1]) == 'X') {\r\n\t\t\t/* parse hexadecimal */\r\n\t\t\t++p;\r\n\t\t\twhile(isxdigit(*++p))\r\n\t\t\t\tif(isdigit(*p))\r\n\t\t\t\t\tn = n * 16 + *p - '0';\r\n\t\t\t\telse\r\n\t\t\t\t\tn = n * 16 + toupper(*p) - 'A' + 10;\r\n\t\t} else {\r\n\t\t\t/* parse decimal */\r\n\t\t\twhile(isdigit(*p))\r\n\t\t\t\tn = n * 10 + *p++ - '0';\r\n\t\t}\r\n\r\n\t\tif(toupper(*p) == 'K') {\r\n\t\t\tn *= 1024;\r\n\t\t\t++p;\r\n\t\t\tif(toupper(*p) == 'B')\r\n\t\t\t\t++p;\r\n\t\t}\r\n\r\n\t\tif(*p) {\r\n\t\t\tprintf(\"Number parse error: %s\\n\", Xp);\r\n\t\t\texit(103);\r\n\t\t}\r\n\t}\r\n\r\n\tif(n > USHRT_MAX || (n + *size) > USHRT_MAX) {\r\n\t\tputs(\"Sum of sizes exceed 64KB\");\r\n\t\texit(104);\r\n\t}\r\n\r\n\t*size += (unsigned)n;\r\n}\r\n\r\nint main(int argc, char **argv)\r\n{\tstruct EXE_header exe;\r\n\tunsigned short tosize;\r\n\r\n\tif(argc <= 1) {\r\n\t\tputs(\"Patch heap size into FreeCOM executable\\n\"\r\n\t\t\t\"\\nuseage: PTCHSIZE freecom [{ size }]\\n\"\r\n\t\t\t\"\\nSize may be given hexadecimal (0x###) or decimal.\\n\"\r\n\t\t\t\"If 'KB' is appended to size, it's multiplied with 1024.\\n\"\r\n\t\t\t\"A leading plus sign is ignored.\\n\"\r\n\t\t\t\"A plus sign by its own is treated as estimated minimum size.\\n\"\r\n\t\t\t\"More than one sizes are summed up.\\n\"\r\n\t\t\t\"If size evaluates to 0 (zero), the restriction is disabled.\\n\"\r\n\t\t\t\"\\ne.g.: PTCHSIZE freecom + 5K\\n\"\r\n\t\t\t\"means: reserve 5*1024 bytes in addition to minimum size.\"\r\n\t\t);\r\n\t\treturn 127;\r\n\t}\r\n\r\n\tif(enumFileResources(argv[1], RES_ID_INFO, getInfo, 0) != 1) {\r\n\t\tputs(\"Failed to locate FreeCOM's info resource\\n\"\r\n\t\t\t\"Possible errors:\\n\"\r\n\t\t\t\"\\tAn error is issued above.\\n\"\r\n\t\t\t\"\\tThe file could not be opened.\\n\"\r\n\t\t\t\"\\tThe version of FreeCOM is too old.\\n\"\r\n\t\t\t\"\\tFile read error.\");\r\n\t\treturn 80;\r\n\t}\r\n\r\n\tif((freecom = fopen(argv[1], \"r+b\")) == 0) {\r\n\t\tprintf(\"Cannot open FreeCOM: %s\\n\", argv[1]);\r\n\t\treturn 30;\r\n\t}\r\n\r\n\tif(fread(&exe, sizeof(exe), 1, freecom) != 1) {\r\n\t\tprintf(\"Read error from: %s\\n\", argv[1]);\r\n\t\treturn 44;\r\n\t}\r\n\t/* exe.extraMin is not trustworthy as it might have been tweak\r\n\t\tin a previous run */\r\n\r\n\tassert(info);\r\n\t/* Decompose the info resource */\r\n\tgetInfoValues();\r\n\tminSize = 5 * (unsigned long)ival.bufsize\t/* command lines */\r\n\t\t+ 3 * (64 + 3 + 8 + 5)\t\t\t\t/* filenames */\r\n\t\t+ 256\t\t\t\t\t\t\t\t/* env var buffer %PATH% etc */\r\n\t\t;\r\n\taddUns(ival.alias);\r\n\taddUns(ival.hist);\r\n\taddUns(ival.dirs);\r\n\tif(minSize > USHRT_MAX) {\r\n\t\tputs(\"Estimated minimum heap size exceeds 64KB.\\n\"\r\n\t\t\t\"There is most probably a corrupted info resource.\");\r\n\t\treturn 71;\r\n\t}\r\n\r\n\tif(argc == 2\r\n#ifndef GCC\r\n\t   || ival.heapPos == ~0\r\n#endif\r\n\t   ) {\r\n\t\tprUns(ival.alias, \"Aliases\");\r\n\t\tprUns(ival.hist, \"Command line history\");\r\n\t\tprUns(ival.dirs, \"Directory stack\");\r\n\t\tprUns(ival.bufsize, \"Command line buffer\");\r\n\t\tif(ival.heapPos == ~0)\r\n\t\t\tputs(\"Missing heap position -> cannot change heap size\");\r\n\t\telse {\r\n\t\t\tif(fseek(freecom, ival.heapPos, SEEK_SET) != 0) {\r\n\t\t\t\tprintf(\"Failed to seek to heap size offset in %s\\n\", argv[1]);\r\n\t\t\t\treturn 43;\r\n\t\t\t}\r\n\t\t\tassert(sizeof(tosize) == 2);\r\n\t\t\tif(fread(&tosize, sizeof(tosize), 1, freecom) != 1) {\r\n\t\t\t\tputs(\"Failed to read heap size from FreeCOM executable.\");\r\n\t\t\t\treturn 76;\r\n\t\t\t}\r\n\t\t\tfclose(freecom);\r\n\t\t\tif(tosize)\r\n\t\t\t\tprintf(\"Heap size restricted to %u bytes\\n\"\r\n\t\t\t\t , tosize);\r\n\t\t\telse\r\n\t\t\t\tputs(\"Heap size is currently not restricted\");\r\n\t\t}\r\n\t\tprintf(\"Estimated minimum of heap: %u\\n\", (unsigned)minSize);\r\n\t\treturn 0;\r\n\t}\r\n\r\n\ttosize = 0;\r\n\targc = 1;\r\n\twhile(argv[++argc])\r\n\t\taddSize(&tosize, argv[argc]);\r\n\tif(tosize && tosize < minSize) {\r\n\t\tprintf(\"size smaller than estimated minimum size: %u\\n\"\r\n\t\t , (unsigned)minSize);\r\n\t\treturn 72;\r\n\t}\r\n\r\n\tprintf(\"Patching '%s' to heap size of %u bytes\\n\"\r\n\t , argv[1], tosize);\r\n\t/* Watcom already has extraMin minimal and dynamically adjusts its MCB*/\r\n\tif(tosize) {\r\n#ifdef GCC\r\n\t\t/* need to adjust SP */\r\n\t\tunsigned startbss = 0x10000 - exe.extraMax * 16;\r\n\t\texe.fSP = startbss + ival.extraSpace * 16 + tosize;\r\n#endif\r\n\t\texe.extraMin = exe.extraMax = ival.extraSpace + tosize / 16;\r\n\t}\r\n\telse {\r\n\t\texe.extraMax = 0xffff;\r\n\t\texe.extraMin = ival.extraSpace;\r\n\t}\r\n\trewind(freecom);\r\n\tif(fwrite(&exe, sizeof(exe), 1, freecom) != 1) {\r\n\t\tprintf(\"Failed to patch heap size into FreeCOM executable.\\n\"\r\n\t\t\t\"File most probably corrupted now: %s\\n\", argv[1]);\r\n\t\treturn 77;\r\n\t}\r\n\r\n#ifndef GCC\r\n\tif(fseek(freecom, ival.heapPos, SEEK_SET) != 0) {\r\n\t\tprintf(\"Failed to seek to heap size offset in %s\\n\", argv[1]);\r\n\t\treturn 42;\r\n\t}\r\n\tassert(sizeof(tosize) == 2);\r\n\tif(fwrite(&tosize, sizeof(tosize), 1, freecom) != 1) {\r\n\t\tprintf(\"Failed to patch heap size into FreeCOM executable.\\n\"\r\n\t\t\t\"File most probably corrupted now: %s\\n\", argv[1]);\r\n\t\treturn 75;\r\n\t}\r\n#endif\r\n\r\n\tfflush(freecom);\r\n\tif(ferror(freecom)) {\r\n\t\tprintf(\"Failed to patch heap size into FreeCOM executable.\\n\"\r\n\t\t\t\"File most probably corrupted now: %s\\n\", argv[1]);\r\n\t\treturn 76;\r\n\t}\r\n\tfclose(freecom);\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "tools/resource.h",
    "content": "#include \"../resource.h\"\r\n"
  },
  {
    "path": "tools/tools.m1",
    "content": "CFG_DEPENDENCIES = tools.m1 ../utils/mktools.c tools.m2\r\n\r\nTOP = ..\r\n!include \"$(TOP)/config.mak\"\r\n"
  },
  {
    "path": "tools/tools.m2",
    "content": "\r\nerror:\r\n\terrlvl 127\r\n\r\nicmd : load_icd.exe icmd_1.icd icmd_2.icd icmd_3.icd\r\n\r\n#\t\t*Implicit Rules*\r\n.asm.com:\r\n\t$(NASM) $(NASMFLAGS) -f bin -o $*.com  $<\r\n#.asm.obj:\r\n#\t$(NASM) $(NASMFLAGS) -f obj $<\r\n\r\nicmd_1.icd : icmd_inc.inc icmd_1.nas\r\n\t$(NASM) $(NASMFLAGS) -o icmd_1.icd icmd_1.nas\r\n\r\nicmd_2.icd : icmd_inc.inc icmd_2.nas\r\n\t$(NASM) $(NASMFLAGS) -o icmd_2.icd icmd_2.nas\r\n\r\nicmd_3.icd : icmd_inc.inc icmd_3.nas\r\n\t$(NASM) $(NASMFLAGS) -o icmd_3.icd icmd_3.nas\r\n\r\nload_icd.exe: load_icd.obj\r\n\t$(CL) $(CLO) load_icd.obj $(SUPPL_LIB_PATH)$(DIRSEP)suppl_$(SHELL_MMODEL).lib $(LIBC)\r\n"
  },
  {
    "path": "tools/vspawn.asm",
    "content": ";; $Id$\r\n\r\n; Kernel Swap Support Faker #2\r\n\r\n; Useage: VSPAWN [{ arguments }]\r\n;\targuments are any arguments to passed to FreeCOM\r\n;\tThe FreeCOM executable wil be created by the name of VPSAWN\r\n;\titself, with the extenstion patched to .SWP\r\n\r\n; This program fakes all interrupts and behaviour assumed by FreeCOM\r\n; to use the kernel swap support. See DOS\\K-SWAP.TXT for more details.\r\n\r\n%include \"../criter/context.inc\"\r\n\r\nSTACK_SIZE EQU 64\r\n%define tsrend (tsrend_ - start + 100h + ((tsrend_ - start) & 1))\r\n\r\n\tABSOLUTE 5ch\t; where the temp variables do reside\r\nexecBlock:\r\neb_envseg\tRESW 1\r\neb_cmdline\tRESD 1\r\neb_fcb\t\tRESD 2\r\nshellCmdLine\tRESB 2\r\ncontext\t\tRESW 1\r\nctxt_owner\tRESW 1\r\norigParent\tRESW 1\r\ncmd_buf:\r\n\r\nSEGMENT .text\r\n\r\nORG 100h\t\t; this is an executable program, but as small as possible\r\n\r\nstart:\r\njmp goon\r\n\r\n%ifdef DEBUG\r\nstrExiting\tDB 13, 10, 'Exiting VSpawn'\r\nstrNL\t\tDB 13, 10, '$', 0\r\nstrNotMe\tDB 'The current PSP is not me!', 7, 13, 10, '$', 0\r\n%endif\r\n\r\nerrString DB 13, 10, 'Failed to execute shell - '\r\n\tDB 'Exiting Kernel Swap Support Faker #2.', 7, 13, 10\r\n\tDB 'Press any key to preceed ...', 13, 10\r\n\tDB '$', 0\r\n\r\nerrExecShell:\t\t; Failed to execute the shell\r\n\tmov dx, errString\r\n\tmov ah, 9\r\n\tint 21h\r\n\tmov ah, 7\r\n\tint 21h\r\n\tjmp exit\r\n\r\nerr2:\r\n\tjmp err2_\r\n\r\ntsrstart:\r\n\tmov ah, 4ah\t\t; Resize memory\r\n\tint 21h\r\n\tjc err2\r\n\r\nmainloop:\r\n\txor ax, ax\r\n\tmov WORD [ES:ctxt_owner], ax\t; let the shell brand this KSSF\r\n\tmov bx, execBlock\r\n\tmov ah, 4bh\t\t; load & run shell\r\n\tint 21h\r\n\tmov sp, tsrend + STACK_SIZE\t; standard stack position\r\n\tmov ax, cs\r\n\tmov ds, ax\r\n\tjc errExecShell\t; failed to execute the shell\r\n\t;; Run external program if one exists\r\n\tmov ax, [context]\r\n\tor ax, ax\r\n\tjz exit\t\t; no context -> terminate kssf\r\n\tmov es, ax\r\n\tmov ax, [ES:?envSegm]\r\n\tmov WORD [eb_envseg], ax\t; applies to shell & prg\r\n\tmov ax, [ES:?prg + 2]\t; segment of program name\r\n\tor ax, ax\r\n\tjz execShell\r\n\t;; execute external program\r\n\tmov dx, [ES:?prg]\t\t; offset of program name\r\n\tles bx, [es:?cmdline]\t; pointer to command line\r\n\tmov WORD [eb_cmdline], bx\r\n\tmov WORD [eb_cmdline+2], es\r\n\tmov bx, cs\r\n\tmov es, bx\r\n\tmov bx, execBlock\r\n\tmov ds, ax\r\n\tmov ax, 4b00h\r\n\tint 21h\t\t\t\t\t; execute external program\r\n\tjc execPrg1\r\n\txor ax, ax\t\t\t\t; no error\r\nexecPrg1:\r\n\tmov sp, tsrend + STACK_SIZE\t; standard stack position\r\n\tmov dx, cs\r\n\tmov ds, dx\r\n\tmov es, [context]\r\n\tmov [ES:?execErr], ax\t; error code of DOS-4B API\r\nexecShell:\r\n\tmov ax, shellCmdLine\r\n\tmov [eb_cmdline], ax\r\n\tmov ax, cs\r\n\tmov [eb_cmdline+2], ax\r\n\tlds dx, [ES:?shell]\r\n\tmov es, ax\r\n\tmov ax, ds\t\t\t\t; probe if a name exists\r\n\tor ax, ax\r\n\tjne mainloop\r\nexit:\t\t\t\t\t\t; exit kssf\r\n\tmov ax, cs\r\n\tmov ds, ax\t\t\t\t; ensure DS == PSP\r\n%ifdef DEBUG\r\n\tmov dx, strExiting\r\n\tmov ah, 9\r\n\tint 21h\r\n\tmov ah, 62h\r\n\tint 21h\r\n\tmov ax, cs\r\n\tcmp ax, bx\r\n\tje dbg_1\r\n\tmov dx, strNotMe\r\n\tmov ah, 9\r\n\tint 21h\r\ndbg_1:\r\n%endif\r\n\tmov ax, WORD [origParent]\t; restore parentPSP to original value\r\n\tmov WORD [ds:16h], ax\r\n\r\n\tmov ax, [context]\t\t; let context be deallocated, too\r\n\tor ax, ax\r\n\tjz exit_noCtxt\r\n\tdec ax\r\n\tmov es, ax\t\t\t\t; MCB of context\r\n\tmov WORD [ES:1], ds\t\t; owner of context := kssf\r\n\tmov ax, [ES:10h+?envSegm]\t\t; environment segm\r\n\tor ax, ax\r\n\tjz exit_noCtxt\r\n\tdec ax\r\n\tmov es, ax\t\t\t\t; MCB of env segm\r\n\tmov WORD [ES:1], ds\t\t; owner of env segm := kssf\r\nexit_noCtxt:\r\n\tlds dx, [old_isr21]\t\t; old INT-21\r\n\tmov ax, 2521h\r\n\tint 21h\t\t\t\t\t; install old handler\r\n\tmov ax, 4c00h\r\n\tint 21h\r\n\tint 20h\r\n\r\nisr21:\t\t\t\t\t\t;; DOS interrupt chain\r\n\tcmp dx, 'FD'\t\t\t;; magic number\r\n\tjne isr21_chain\r\n\tcmp ax, 4bfeh\r\n\tje isr21_do\r\n\tcmp ax, 4bfdh\r\n\tje isr21_do\r\nisr21_chain:\r\n\tjmp 0:0\r\nold_isr21 EQU $-4\r\n\r\nisr21_do:\r\n\tpush ds\r\n\tpush cs\r\n\tpop ds\r\n\tpush bp\r\n\tmov bp, sp\t\t;; BP+8 == flags\r\n\tpush dx\r\n\tpush ax\r\n\tmov dx, bx\t\t;; new context\r\n\tmov ah,62h\t\t; get current PSP\r\n\tint 21h\t\r\n\tmov ax, [ctxt_owner]\r\n\tor ax, ax\r\n\tjnz isr21_1\r\n\t;; first call --> brand the KSSF to this process\r\n\tmov WORD [ctxt_owner], bx\r\nisr21_1:\r\n\txchg bx, dx\r\n\tpop ax\r\n\tcmp al, 0feh\r\n\tmov ax, [ctxt_owner]\r\n\tje isr21_getCtxt\r\n\t;; set Ctxt\r\n\tcmp ax, dx\r\n\tjne isr21_noAcc\r\nisr21_setCtxt:\r\n\txchg [context], bx\r\n\tjmp short isr21_ok\r\n\r\nisr21_getCtxt:\r\n\tmov bx, [context]\r\n\tcmp ax, dx\r\n\tjne isr21_noAcc\r\nisr21_ok:\r\n\tand BYTE [bp+8], 0feh\t\t; clear Carry flag\r\n%ifdef DEBUG\r\n\tmov ax, cs\t\t\t\t\t; our PSP / PID\r\n%endif\r\nisr21_iret:\r\n\tpop dx\r\n\tpop bp\r\n\tpop ds\r\n\tiret\r\nisr21_noAcc:\r\n\tor BYTE [bp+8], 1\t\t\t; set Carry flag\r\n\tmov ax, 5\r\n\tjmp short isr21_iret\r\ntsrend_:\r\n\r\nerr2_:\r\n\tmov dx, errResize\r\n\tjmp errOut\r\n\r\nerr3:\r\n\tjmp err3_\r\ngoon:\t;; Initialization a.s.o.\r\n\t; Decode command line argument list\r\n\tmov ax, cs\t\t; Get PSP\r\n\tmov ds, ax\r\n\tmov es, ax\r\n\tcld\r\n\r\n\txor ax, ax\r\n\tmov di, execBlock\r\n\tmov cx, cmd_buf - execBlock\r\n\trep stosb\t\t; erase the execBlock\r\n\tmov BYTE [shellCmdLine+1], 0dh\r\n\r\n\tmov WORD [eb_cmdline], 80h\r\n\tmov WORD [eb_cmdline+2], ds\r\n\r\n\tmov ax, [2ch]\t\t\t; environment segment\r\n\tor ax, ax\r\n\tjz err3\r\n\tdec ax\r\n\tmov es, ax\r\n\tmov cx, [es:3]\t\t\t; size of environment segment in paras\r\n\tinc ax\r\n\tmov es, ax\r\n\ttest ch, 0f0h\r\n\tjz ???1\t\t\t\t\t; no overflow\r\n\tmov cx, 0ffffh\t\t\t; longer environment\r\n\tjmp short searchCmdName\r\n???1:\r\n\tshl cx, 4\r\nsearchCmdName:\r\n\txor ax, ax\r\n\tmov di, ax\t\t\t\t; environment starts at first byte\r\n???2:\r\n\trepne scasb\r\n\tjcxz err4\r\n\tcmp al, [es:di]\t\t\t; end of var area reached?\r\n\tjnz ???2\r\n\tmov ax, [es:di+1]\t\t; number of strings\r\n\tor ax, ax\r\n\tje err4\r\n\tadd di, 3\r\n\tmov dx, di\t\t\t\t; start of command to spawn\r\n\txor al, al\r\n\tsub cx, 3\r\n\tjc err4\r\n\trepne scasb\r\n\tjcxz err4\r\n\r\n\tmov bx, cx\r\n\tmov cx, 5\r\n\r\n???5:\r\n\tdec di\r\n\tinc bx\r\n\tcmp BYTE [ES:di], '.'\r\n\tloopne ???5\r\n\r\n\tje ???6\t\t\t\t\t; dot found\r\n\t;; no dot found --> append\r\n\tadd di, 5\r\n\tsub bx, 5\r\n???6:\r\n\tcmp bx, 6\r\n\tjc err4\r\n\tmov cx, ((extensionEnd - extensionStart) + 1) / 2 \r\n\tmov si, extensionStart\r\n\trep movsw\r\n\tmov di, dx\t\t\t; save start of command name\r\n\r\n;; Chain KSSF into the system\r\n\tmov ax, 3521h\r\n\tint 21h\t\t\t; Get interrupt vector\r\n\tmov WORD [old_isr21], bx\r\n\tmov WORD [old_isr21+2], es\r\n\tmov dx, isr21\r\n\tmov ax, 2521h\r\n\tint 21h\t\t\t; Set interrupt vector\r\n%ifdef DEBUG\r\n\tcall printLoadSegm\r\n%endif\r\n\r\n\tmov ax, cs\r\n\tmov es, ax\r\n\txchg WORD [16h], ax\t; set our owner to ourselves <-> shell hack\r\n\tmov WORD [origParent], ax\r\n\r\n\tmov ds, [ds:2ch]\r\n\tmov dx, di\r\n\t;; DS:DX == command name\r\n\t;; execBlock is filled\r\n\tmov bx, (tsrend + STACK_SIZE + 15) / 16\r\n\t\t\t\t\t; := number of paragraphes\r\n\t\t\t\t\t; required for TSR and stack\r\n\tmov sp, tsrend + STACK_SIZE\t; new stack size\r\n\tjmp tsrstart\r\n\r\nerr3_:\r\n\tmov dx, ErrEnvSeg\r\n\tjmp short errOut\r\nerr4:\r\n\tmov dx, ErrBadEnv\r\n\tjmp short errOut\r\nerr1:\r\n\tmov dx, useage\r\nerrOut:\r\n\tmov ah, 9\r\n\tint 21h\r\n\tmov ah, 7\r\n\tint 21h\r\n\tmov ax, 4c03h\r\n\tint 21h\r\n\tint 20h\r\n\r\nErrBadEnv DB 7, 'Bad environment', 13, 10, '$'\r\nErrEnvSeg DB 7, 'Cannot determine my own executable file name', 13, 10, '$'\r\nuseage DB 7, 'Useage: VSpawn freecom [{ arguments }]', 13, 10\r\n\tDB 9, 'freecom: absolute filename of FreeCOM', 13, 10\r\n\tDB 9, 'arguments: any optionally arguments or options', 13, 10\r\n\tDB 'Spawns FreeCOM and fakes the necessary kernel functions for', 13, 10\r\n\tDB 'the Kernel Swap Support', 7, 13, 10, '$'\r\n\r\nerrResize DB 7, 'Failed to resize VSpawn memory block', 13, 10, '$'\r\n\r\nalign 2 ;;EVEN\r\nextensionStart\tDB '.SWP', 0\r\nextensionEnd\tDB 0\r\n\r\n%ifdef DEBUG\r\nprintLoadSegm:\r\n\tmov dx, dbgStr1\r\n\tmov ah, 9\r\n\tint 21h\r\n\tmov ax, cs\r\n\tcall printWord\r\n\tmov dl, ':'\r\n\tmov ah, 2\r\n\tint 21h\r\n\tmov ax, isr21\r\n\tcall printWord\r\n\tmov dx, dbgStr2\r\n\tmov ah, 9\r\n\tint 21h\r\n\tret\r\n\r\nprintWord:\r\n\tpush ax\r\n\tmov al, ah\r\n\tcall printByte\r\n\tpop ax\r\nprintByte:\r\n\tpush ax\r\n\tshr al, 4\r\n\tcall printNybble\r\n\tpop ax\r\nprintNybble:\r\n\tand al, 0fh\r\n\tadd al, '0'\r\n\tcmp al, '0' + 10\r\n\tjc print1\r\n\tadd al, 'A' - '0' - 10\r\nprint1:\r\n\tmov dl, al\r\n\tmov ah, 2\r\n\tint 21h\r\n\tret\r\ndbgStr1\tDB 'VSpawn loaded at ', '$'\r\ndbgStr2 DB 10, 13, '$'\r\n%endif\r\n\r\n;;END\r\n"
  },
  {
    "path": "utils/MAKECMD.BAT",
    "content": "@echo off\r\nrem This is part of the FreeCOM FreeDOS package to replace default command.com with language specific version\r\ndel command.com\r\nif exist cmd-%lang%.com ren cmd-%lang%.com command.com\r\ndel cmd-*.com\r\n"
  },
  {
    "path": "utils/chunk.c",
    "content": "/* $Id$\r\n\r\n\tChunk a large dependency list into portions with less than\r\n\t128 entries each. They'll form a cascaded dependency list\r\n\twith \"argv[1]\" is the primary target.\r\n\r\n*/\r\n\r\n#include <stdio.h>\r\n#include <string.h>\r\n\r\nchar buf[1024];\r\n\r\nint main(int argc, char **argv)\r\n{\tint i;\r\n\tchar *p;\r\n\tunsigned long lnr;\r\n\tint chunk;\r\n\r\n\tif(argc != 2) {\r\n\t\tfputs(\"Useage: CHUNK primary_target <infile >outfile\\n\", stderr);\r\n\t\treturn 127;\r\n\t}\r\n\r\n\tfputs(argv[1], stdout);\r\n\tfputs(\" : \", stdout);\r\n\r\n\tchunk = i = 0;\r\n\tlnr = 0;\r\n\twhile(fgets(buf, sizeof(buf), stdin)) {\r\n\t\t++lnr;\r\n\t\tp = strchr(buf, '\\0');\r\n\t\tif(*--p != '\\n') {\r\n\t\t\tfprintf(stderr, \"Line #%lu too long\\n\", lnr);\r\n\t\t\treturn 40;\r\n\t\t}\r\n\t\t*p = 0;\r\n\t\tif(++i >= 127) {\r\n\t\t\t++chunk;\r\n\t\t\tprintf(\" \\\\\\n\\tchunk%u\\n\\nchunk%u : \", chunk, chunk);\r\n\t\t\ti = 0;\r\n\t\t}\r\n\t\tfputs(\" \\\\\\n\\t\", stdout);\r\n\t\tfputs(buf, stdout);\r\n\t}\r\n\tputs(\"\\n\\n\");\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "utils/debug.h",
    "content": "#include \"../debug.h\"\r\n"
  },
  {
    "path": "utils/depend.mk",
    "content": "utils .SETDIR=utils :\r\n\t@echo Entering $(PWD)\r\n\t$(RUNMAKE) all\r\n\t@echo Leaving $(PWD)\r\n\r\nCLEAN_DEPENDENCIES += utils_clean\r\nutils_clean .SETDIR=utils :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) clean\r\n\t@echo Leaving  $(PWD)\r\n\r\nCLOBBER_DEPENDENCIES += utils_clobber\r\nutils_clobber .SETDIR=utils :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) clobber\r\n\t@echo Leaving  $(PWD)\r\n\r\nDIST_DEPENDENCIES += utils_dist\r\nutils_dist .SETDIR=utils :\r\n\t@echo Entering  $(PWD)\r\n\t$(RUNMAKE) dist\r\n\t@echo Leaving  $(PWD)\r\n"
  },
  {
    "path": "utils/files.txt",
    "content": "Implementation of utilities required for the build process of FreeCOM\r\n\r\nMKCTXT\t\tCreates .DEF, .H_C, .INC files from .X (see MKCTXT.C)\r\nMKTOOLS\t\tCreates the default target for TOOLS\\ subdir\r\n"
  },
  {
    "path": "utils/makefile",
    "content": "# $Id$\r\n#\r\n# Makefile for tools of the FreeDOS kernel's command interpreter\r\n#\r\n#\r\n# $Log$\r\n# Revision 1.5  2002/04/02 23:36:37  skaus\r\n# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)\r\n#\r\n# Revision 1.4  2001/04/12 00:09:06  skaus\r\n# chg: New structure\r\n# chg: If DEBUG enabled, no available commands are displayed on startup\r\n# fix: PTCHSIZE also patches min extra size to force to have this amount\r\n#    of memory available on start\r\n# bugfix: CALL doesn't reset options\r\n# add: PTCHSIZE to patch heap size\r\n# add: VSPAWN, /SWAP switch, .SWP resource handling\r\n# bugfix: COMMAND.COM A:\\\r\n# bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n# add: command MEMORY\r\n# bugfix: runExtension(): destroys command[-2]\r\n# add: clean.bat\r\n# add: localized CRITER strings\r\n# chg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n# \tvia STRINGS.LIB\r\n# add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n# add: fixstrs.c: prompts & symbolic keys\r\n# add: fixstrs.c: backslash escape sequences\r\n# add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n# chg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n# bugfix: IF is now using error system & STRINGS to report errors\r\n# add: CALL: /N\r\n#\r\n# Revision 1.1.2.1  2001/02/18 17:59:37  skaus\r\n# bugfix: KSSF: restore parentPSP on exit\r\n# chg: Using STRINGS resource for all non-interactive messages\r\n# chg: moving all assembly files to NASM\r\n#\r\n\r\nINCDIR +=;$(FREEDOS)\\SRC\\INCLUDE;..\r\nLIBDIR +=;$(FREEDOS)\\SRC\\LIB\\$(_COMPILER)\r\n# LDLIBS = suppl_$(_MODEL).lib\r\nLDFLAGS += /msl\r\n\r\n# Project specific C compiler flags\r\nMYCFLAGS_DBG = -DNDEBUG=1 $(null,$(DEBUG) $(NULL) -DDEBUG=1)\r\nMYCFLAGS_NDBG =\r\nMYASMFLAGS_DBG = $(null,$(DEBUG) $(NULL) -DDEBUG=1) -s\r\nMYASMFLAGS_NDBG = -s\r\nMYCFLAGS = $(null,$(NDEBUG) $(MYCFLAGS_DBG) $(MYCFLAGS_NDBG))\r\nMYASMFLAGS = $(null,$(NDEBUG) $(MYASMFLAGS_DBG) $(MYASMFLAGS_NDBG))\r\n\r\n.SOURCE.h := . ..\r\n.SOURCE.lib := $(LIBDIR:s/;/ /:u)\r\n.IMPORT : FREEDOS\r\n\r\n# Sources of this make target\r\n\r\n#\tDefault target\r\nall: mkctxt.exe mktools.exe chunk.exe mkinfres.exe\r\n\r\nmkctxt.exe : mkctxt.c\r\n\r\nchunk.exe : chunk.c\r\n\r\nmktools.exe : mktools.c ..\\config.h\r\n\r\ndist : ;\r\n\r\n.INIT : $(CFG) __errl\r\n\r\n__errl:\r\n\t@+-if exist errlist del errlist >nul\r\n\t-ctags *.c\r\n\r\n\r\n\r\nclobber : clean\r\n\t$(RM) $(RMFLAGS) *.exe *.com *.cfg\r\n\r\nclean :\r\n\t$(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj $(CFG) *.dmp\r\n\r\n"
  },
  {
    "path": "utils/makefile.mak",
    "content": "CFG_DEPENDENCIES = makefile.mak\r\n\r\nUTILS_BUILD = 1\r\n\r\nTOP = ..\r\n!include \"$(TOP)/config.mak\"\r\n\r\nall: $(CFG) mktools.exe mkctxt.exe chunk.exe mkinfres.exe ptchsize.exe\r\n\r\nmktools.exe : mktools.c ../config.h\r\nptchsize.exe : ptchsize.c ../tools/ptchsize.c"
  },
  {
    "path": "utils/misc.h",
    "content": "#include \"../misc.h\"\r\n"
  },
  {
    "path": "utils/mkctxt.c",
    "content": "/*  $Id$\r\n\r\n\tCreate the various file from the CONTEXT.X file\r\n\t(See there for syntax description)\r\n\r\n\tUseage: MKCTXT filename[.X]\r\n\r\n\tProduces:\r\n\tfilename.h_c: contains the structure in C syntax\r\n\tfilename.inc: contains the definition of the structure in assembly\r\n\tfilename.def: contains the EQUs of the offsets of a value into the structure\r\n\t\ttwo definitions per offset:\r\n\t\t<value> - offset from the very beginning of the context\r\n\t\t<package>_<value> - offset of the value relative to the beginning\r\n\t\t\tof the specific package\r\n\r\n  \t$Log$\r\n  \tRevision 1.3  2001/04/12 00:09:06  skaus\r\n  \tchg: New structure\r\n  \tchg: If DEBUG enabled, no available commands are displayed on startup\r\n  \tfix: PTCHSIZE also patches min extra size to force to have this amount\r\n  \t   of memory available on start\r\n  \tbugfix: CALL doesn't reset options\r\n  \tadd: PTCHSIZE to patch heap size\r\n  \tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n  \tbugfix: COMMAND.COM A:\\\r\n  \tbugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed\r\n  \tadd: command MEMORY\r\n  \tbugfix: runExtension(): destroys command[-2]\r\n  \tadd: clean.bat\r\n  \tadd: localized CRITER strings\r\n  \tchg: use LNG files for hard-coded strings (hangForEver(), init.c)\r\n  \t\tvia STRINGS.LIB\r\n  \tadd: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts\r\n  \tadd: fixstrs.c: prompts & symbolic keys\r\n  \tadd: fixstrs.c: backslash escape sequences\r\n  \tadd: version IDs to DEFAULT.LNG and validation to FIXSTRS.C\r\n  \tchg: splitted code apart into LIB\\*.c and CMD\\*.c\r\n  \tbugfix: IF is now using error system & STRINGS to report errors\r\n  \tadd: CALL: /N\r\n\r\n  \tRevision 1.1.2.2  2001/02/18 21:08:24  skaus\r\n  \tadd: command WHICH\r\n  \tfix: BUILD.BAT and accompanying makefiles for TC++ v1.01\r\n  \t\r\n  \tRevision 1.1.2.1  2001/02/18 17:59:37  skaus\r\n  \tbugfix: KSSF: restore parentPSP on exit\r\n  \tchg: Using STRINGS resource for all non-interactive messages\r\n  \tchg: moving all assembly files to NASM\r\n  \t\r\n  \tRevision 1.1.2.1  2000/12/17 21:57:37  skaus\r\n  \tintermediate update 1\r\n  \t\r\n*/\r\n\r\n#include <stdio.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n#include <stdlib.h>\r\n#ifdef __GNUC__\r\n#define memicmp strncasecmp\r\n#endif\r\n\r\nstatic char *typename = NULL;\t/* Current typedef */\r\nstatic char *pkg = NULL;\t/* Current package */\r\nstatic char *stru = NULL;\t/* Current structure */\r\nstatic unsigned pkgOffs = 0, offset = 0;\t/* package and overall offset */\r\nstatic char *fnam = NULL;\t/* filename with spare room for extension */\r\nstatic char *fext;\t\t\t/* pointer to extension of fnam */\r\nstatic char buf[1024];\r\nstatic unsigned lineNr = 0;\r\nstatic FILE *fincc, *finca, *fdefa, *fx;\r\n\r\n\r\nstatic char *skipws(char *p)\r\n{\twhile(*p && isspace(*p))\r\n\t\t++p;\r\n\treturn p;\r\n}\r\nstatic void incOffs(int size)\r\n{\toffset += size;\r\n\tpkgOffs += size;\r\n}\r\nstatic void dumpDefine(char *name, char *value)\r\n{\tlong i;\r\n\r\n\ti = strtol(value, 0, 0);\r\n\tfprintf(fincc, \"#define %s %ld\\n\", name, i);\r\n\tfprintf(finca, \"%%define %s %ld\\n\", name, i);\r\n}\r\nstatic void dumpEQU(char *symbol)\r\n{\tfprintf(finca, \"?%s EQU %u\\n\", symbol, offset);\r\n\tfprintf(fdefa, \"??%s:\\n\", symbol);\r\n\r\n\tif(pkg && pkg != symbol)\r\n\t\tfprintf(finca, \"?%s_%s EQU %u\\n\", pkg, symbol, pkgOffs);\r\n}\r\nstatic void indent(void)\r\n{\tif(typename) putc('\\t', fincc);\r\n\tif(pkg)\tputc('\\t', fincc);\r\n\tif(stru)\tputc('\\t', fincc);\r\n}\r\nstatic void endStru(void)\r\n{\tif(stru) {\r\n\t\tfprintf(fincc, \"\\t\\t} %s;\\n\", stru);\r\n\t\tfree(stru);\r\n\t\tstru = NULL;\r\n\t}\r\n}\r\nstatic void endPkg(void)\r\n{\tif(pkg) {\r\n\t\tfprintf(fincc, \"\\t} %s;\\n\", pkg);\r\n\t\tfree(pkg);\r\n\t\tpkg = NULL;\r\n\t}\r\n}\r\nstatic void endType(void)\r\n{\tif(typename) {\r\n\t\tfprintf(fincc, \"} %s;\\n\\n#include <algndflt.h>\\n\", typename);\r\n\t\tfree(typename);\r\n\t\ttypename = NULL;\r\n\t}\r\n}\r\n\r\nstatic void dumpItem(char *name, char *value, char *Ctype, char asmType)\r\n{\tdumpEQU(name);\r\n\tindent();\r\n\tfprintf(fincc, \"%s %s;\\n\", Ctype, name);\r\n\tfprintf(fdefa, \"\\tD%c %s\\n\", asmType, value);\r\n}\r\n#define word word_(&p)\r\nstatic char *word_(char **Xp)\r\n{\tchar *p, *q;\r\n\r\n\tq = p = skipws(*Xp);\r\n\tif(!*p || *p == '#') {\r\n\t\tprintf(\"Syntax error in line %u: Missing argument\\n\", lineNr);\r\n\t\texit(62);\r\n\t}\r\n\twhile(*++q && !isspace(*q));\r\n\tif(*q) {\r\n\t\t*q = '\\0';\r\n\t\t*Xp = skipws(q + 1);\r\n\t} else\r\n\t\t*Xp = q;\r\n\treturn p;\r\n}\r\n#define match(w) match_(&p, (w))\r\nstatic int match_(char **Xp, char *w)\r\n{\tchar *p, *q;\r\n\r\n\tq = p = skipws(*Xp);\r\n\tif(!*p || *p == '#') {\r\n\t\tprintf(\"Syntax error in line %u: Missing keyword\\n\", lineNr);\r\n\t\texit(62);\r\n\t}\r\n\twhile(*++q && !isspace(*q));\r\n\tif(strlen(w) == q - p && memicmp(w, p, q - p) == 0) {\r\n\t\t/* equal */\r\n\t\tif(*q)\t*Xp = skipws(q + 1);\r\n\t\telse\t*Xp = q;\r\n\t\treturn 1;\r\n\t}\r\n\treturn 0;\r\n}\r\n\r\nint main(int argc, char **argv)\r\n{\r\n\tchar *p, *name, *value;\r\n\tint err;\r\n\r\n\tif(argc != 2) {\r\n\t\tputs(\"MKCTXT - Create definition file from *.X files\\n\\n\"\r\n\t\t\t\"Useage: MKCTXT filename[.X]\\n\");\r\n\t\treturn 127;\r\n\t}\r\n\r\n\tif((fnam = strdup(argv[1])) == NULL\r\n\t || (fnam = realloc(fnam, strlen(fnam) + 4)) == NULL) {\r\n\t \tputs(\"Out of memory\");\r\n\t \treturn 120;\r\n\t}\r\n\r\n\tfext = strchr(fnam, '\\0');\r\n\twhile(--fext >= fnam && *fext != '.' && *fext != '/' && *fext != '\\\\');\r\n\tif(fext < fnam || *fext != '.') {\r\n\t\tfext = strchr(fnam, '\\0');\r\n\t\tstrcpy(fext++, \".x\");\r\n\t} else ++fext;\r\n\r\n\tif((fx = fopen(fnam, \"rt\")) == NULL) {\r\n\t\tprintf(\"Cannot open input file: %s\\n\", fnam);\r\n\t\treturn 40;\r\n\t}\r\n\tstrcpy(fext, \"h_c\");\r\n\tif((fincc = fopen(fnam, \"wt\")) == NULL) {\r\n\t\tprintf(\"Cannot create C include file: %s\\n\", fnam);\r\n\t\treturn 41;\r\n\t}\r\n\tstrcpy(fext, \"inc\");\r\n\tif((finca = fopen(fnam, \"wt\")) == NULL) {\r\n\t\tprintf(\"Cannot create assembly include file: %s\\n\", fnam);\r\n\t\treturn 42;\r\n\t}\r\n\tstrcpy(fext, \"def\");\r\n\tif((fdefa = fopen(fnam, \"wt\")) == NULL) {\r\n\t\tprintf(\"Cannot create assembly definition file: %s\\n\", fnam);\r\n\t\treturn 43;\r\n\t}\r\n\r\n\t/* Dump the headers into the files */\r\n\t/* C include file: autogenerated notice and one-byte alignment */\r\n\tfputs(\"/* This is an autogenerated file.\\n\"\r\n\t\t\"\\tAny modifications are lost once MKCTXT runs the next time.\\n\"\r\n\t\t\"\\tModify the particular *.X source file instead. */\\n\\n\", fincc);\r\n\tfputs(\";; This is an autogenerated file.\\n\"\r\n\t\t\";;\\tAny modifications are lost once MKCTXT runs the next time.\\n\"\r\n\t\t\";;\\tModify the particular *.X source file instead. \\n\\n\", finca);\r\n\tfputs(\";; This is an autogenerated file.\\n\"\r\n\t\t\";;\\tAny modifications are lost once MKCTXT runs the next time.\\n\"\r\n\t\t\";;\\tModify the particular *.X source file instead. \\n\\n\", fdefa);\r\n\r\n\twhile(fgets(buf, sizeof(buf), fx)) {\r\n\t\t++lineNr;\r\n\t\tp = skipws(buf);\r\n\t\tif(!*p) {\r\n\t\t\tendStru();\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif(*p == '#')\r\n\t\t\tcontinue;\r\n\t\tif(match(\"typedef\")) {\r\n\t\t\tendStru();\r\n\t\t\tendPkg();\r\n\t\t\tendType();\r\n\t\t\ttypename = strdup(word);\r\n\t\t\tif(!typename) {\r\n\t\t\t\tputs(\"Out of memory\");\r\n\t\t\t\treturn 120;\r\n\t\t\t}\r\n\t\t\r\n\t\t\tfprintf(fincc, \"\\n#include <algnbyte.h>\\n\\n\"\r\n\t\t\t \"typedef struct {\\t/* type %s */\\n\", typename);\r\n\t\t} else if(match(\"package\")) {\r\n\t\t\tpkgOffs = 0;\r\n\t\t\tendStru();\r\n\t\t\tendPkg();\r\n\t\t\tindent();\r\n\t\t\tpkg = strdup(word);\r\n\t\t\tif(!pkg) {\r\n\t\t\t\tputs(\"Out of memory\");\r\n\t\t\t\treturn 120;\r\n\t\t\t}\r\n\t\t\tfprintf(fincc, \"struct {\\t/* package %s */\\n\", pkg);\r\n\t\t\tdumpEQU(pkg);\r\n\t\t} else if(match(\"structure\")) {\r\n\t\t\tendStru();\r\n\t\t\tindent();\r\n\t\t\tstru = strdup(word);\r\n\t\t\tif(!stru) {\r\n\t\t\t\tputs(\"Out of memory\");\r\n\t\t\t\treturn 120;\r\n\t\t\t}\r\n\t\t\tfprintf(fincc, \"struct {\\t/* structure %s */\\n\", stru);\r\n\t\t\tdumpEQU(stru);\r\n\t\t} else if(match(\"byte\")) {\r\n\t\t\tname = word;\r\n\t\t\tvalue = word;\r\n\t\t\tdumpItem(name, value, \"byte\", 'B');\r\n\t\t\tincOffs(1);\r\n\t\t} else if(match(\"word\")) {\r\n\t\t\tname = word;\r\n\t\t\tvalue = word;\r\n\t\t\tdumpItem(name, value, \"word\", 'W');\r\n\t\t\tincOffs(2);\r\n\t\t} else if(match(\"pointer\")) {\r\n\t\t\tname = word;\r\n\t\t\tvalue = word;\r\n\t\t\tdumpItem(name, value, \"void far*\", 'D');\r\n\t\t\tincOffs(4);\r\n\t\t} else if(match(\"reference\")) {\r\n\t\t\tname = word;\r\n\t\t\tdumpEQU(name);\r\n\t\t\tindent();\r\n\t\t\tfprintf(fincc, \"unsigned char %s[];\\n\", name);\r\n\t\t} else if(match(\"constant\")) {\r\n\t\t\tname = word;\r\n\t\t\tvalue = word;\r\n\t\t\tdumpDefine(name, value);\r\n\t\t} else {\r\n\t\t\tprintf(\"Syntax error in line %u: Invalid keyword\\n\", lineNr);\r\n\t\t\treturn 60;\r\n\t\t}\r\n\r\n\t\tif(*p && *p != '#') {\r\n\t\t\tprintf(\"Syntax error in line %u: Too many arguments\\n\", lineNr);\r\n\t\t\treturn 61;\r\n\t\t}\r\n\t}\r\n\r\n\tendStru();\r\n\tendPkg();\r\n\tendType();\r\n\r\n\tfflush(fincc);\r\n\tfflush(finca);\r\n\tfflush(fdefa);\r\n\r\n\terr = 0;\r\n\tif(ferror(fx)) {\r\n\t\tstrcpy(fext, \"x\");\r\n\t\tprintf(\"Read error from: %s\\n\", fnam);\r\n\t\terr = 50;\r\n\t}\r\n\tif(ferror(fincc)) {\r\n\t\tstrcpy(fext, \"h_c\");\r\n\t\tprintf(\"Write error to: %s\\n\", fnam);\r\n\t\terr = 51;\r\n\t}\r\n\tif(ferror(finca)) {\r\n\t\tstrcpy(fext, \"inc\");\r\n\t\tprintf(\"Write error to: %s\\n\", fnam);\r\n\t\terr = 52;\r\n\t}\r\n\tif(ferror(fdefa)) {\r\n\t\tstrcpy(fext, \"def\");\r\n\t\tprintf(\"Write error to: %s\\n\", fnam);\r\n\t\terr = 53;\r\n\t}\r\n\t\r\n\tfclose(fx);\r\n\tfclose(fincc);\r\n\tfclose(finca);\r\n\tfclose(fdefa);\r\n\r\n\treturn err;\r\n}\r\n"
  },
  {
    "path": "utils/mkinfres.c",
    "content": "/* $Id$\r\n\r\n\tTool to create the _heaplen resource\r\n\r\n\tUseage: MKINFRES resfile mapfile\r\n\r\n*/\r\n\r\n#include <ctype.h>\r\n#include <limits.h>\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../config.h\"\r\n#define MKINFRES\r\n#include \"../include/command.h\"\r\n#include \"../include/res.h\"\r\n#include \"../include/infores.h\"\r\n\r\n#define pch(ch) (isprint((unsigned)(ch) & 0xFF)? (unsigned)(ch) & 0xFF: '.')\r\n\r\nFILE *txt = 0;\r\nFILE *info = 0;\r\nchar buf[3*1024];\r\n\r\n#include \"../lib/res_w.c\"\t\t/* Make this a single file project */\r\n\r\nint scanMapFile(const char * const fnam\r\n\t, unsigned long * const hpos\r\n\t, unsigned long * const spos\r\n\t, unsigned *extraSpace)\r\n{\tFILE *map;\r\n\tchar *w1, *w2, *w3, *w5;\r\n\tunsigned long v;\r\n\r\n\tassert(hpos);\r\n\tassert(spos);\r\n\tassert(fnam);\r\n\tassert(extraSpace);\r\n\r\n\t*extraSpace = 0;\r\n\t*hpos = *spos = 0;\r\n\r\n\tif((map = fopen(fnam, \"rt\")) == 0) {\r\n\t\tprintf(\"Failed to open file: %s\\n\", fnam);\r\n\t\treturn 40;\r\n\t}\r\n\twhile(fgets(buf, sizeof(buf), map)) {\r\n\t\tif((w1 = strtok(buf, \" \\t\\r\\n\")) != 0\r\n\t\t && (w2 = strtok(0, \" \\t\\r\\n\")) != 0) {\r\n\t\t \tif((w3 = strtok(0, \" \\t\\r\\n\")) == 0) {\r\n\t\t\t\tif(strcmp(w2, \"__heaplen\") == 0 ||\r\n\t\t\t\t   strcmp(w2, \"__stklen\") == 0) {\r\n\t\t\t\t\tunsigned long n1, n2;\r\n\r\n\t\t\t\t\tn1 = strtoul(w1, &w1, 16);\r\n\t\t\t\t\tif(w1 && *w1 == ':') {\r\n\t\t\t\t\t\tn2 = strtoul(w1 + 1, &w1, 16);\r\n\t\t\t\t\t\tif(w1 == 0 || *w1 == 0 ||\r\n\t\t\t\t\t\t   (*w1 == '+' && w1[1] == 0)) {\r\n\t\t\t\t\t\t\tv = (unsigned long)n1 * 16 + n2;\r\n\t\t\t\t\t\t\tif (w2[2] == 'h')\r\n\t\t\t\t\t\t\t\t*hpos = v;\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t*spos = v;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if((strtok(0, \" \\t\\r\\n\")) != 0\r\n\t\t\t && (w5 = strtok(0, \" \\t\\r\\n\")) != 0) {\r\n\t\t\t\tif(strcmp(w5, \"BSS\") == 0 || strcmp(w1, \".bss\") == 0) {\r\n\t\t\t\t \tunsigned long n;\r\n\t\t\t\t \tchar *p = 0;\r\n\r\n\t\t\t\t \tn = strtoul(w3, &p, 16);\r\n\t\t\t\t \tif(p && (*p == 'H' || w1[0]=='.')) {\r\n\t\t\t\t \t\tif(n > USHRT_MAX || (n += *extraSpace) > USHRT_MAX) {\r\n\t\t\t\t \t\t\tputs(\"Extra space exceeds range\");\r\n\t\t\t\t \t\t\treturn 56;\r\n\t\t\t\t \t\t}\r\n\t\t\t\t \t\t*extraSpace = (unsigned)n;\r\n\t\t\t\t \t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfclose(map);\r\n\tif (*hpos == 0)\r\n\t\tprintf(\"No valid entry of _heaplen found in: %s\\n\", fnam);\r\n#ifdef __TURBOC__\r\n\tif (*spos == 0)\r\n\t\tprintf(\"No valid entry of _stklen found in: %s\\n\", fnam);\r\n#endif\r\n\treturn 0;\r\n}\r\n\r\nint addImageDisplacement(const char * const fnam\r\n\t, unsigned long spos\r\n\t, unsigned long * const pos\r\n\t, unsigned *extraSpace)\r\n{\tFILE *f;\r\n\tstruct EXE_header exe;\r\n\tunsigned stacksize;\r\n\r\n\tassert(fnam);\r\n\tassert(pos);\r\n\r\n\tif((f = fopen(fnam, \"rb\")) == 0) {\r\n\t\tprintf(\"Failed to open file: %s\\n\", fnam);\r\n\t\treturn 42;\r\n\t}\r\n\tif(fread(&exe, sizeof(exe), 1, f) != 1) {\r\n\t\tprintf(\"Read error from: %s\\n\", fnam);\r\n\t\treturn 52;\r\n\t}\r\n\tif (*pos)\r\n\t\t*pos += exe.header * 16;\r\n\tif (spos) {\r\n\t\tspos += exe.header * 16;\r\n\t\tif(fseek(f, spos, SEEK_SET) != 0) {\r\n\t\t\tprintf(\"Failed to seek to stack size offset in %s\\n\", fnam);\r\n\t\t\treturn 62;\r\n\t\t}\r\n\t\tif(fread(&stacksize, sizeof(stacksize), 1, f) != 1) {\r\n\t\t\tprintf(\"Read error from: %s\\n\", fnam);\r\n\t\t\treturn 72;\r\n\t\t}\r\n\t\t*extraSpace += (stacksize+15)/16;\r\n\t}\r\n\tfclose(f);\r\n#ifdef GCC\r\n\tstacksize = 4*1024;\r\n\t*extraSpace += stacksize / 16;\r\n#else\r\n\tif(exe.extraMin > *extraSpace)\r\n\t\t*extraSpace = exe.extraMin;\r\n#endif\r\n\treturn 0;\r\n}\r\n\r\nvoid dumpTag(int ttype, int tlength, void *tvalue)\r\n{\r\n\tinfotag tag;\r\n\tassert(sizeof(tag) == 2);\r\n\tassert(info);\r\n\r\n\ttag.type = ttype;\r\n\ttag.length = tlength;\r\n\tfwrite(&tag, sizeof(tag), 1, info);\r\n\tif(tlength) {\r\n\t\tassert(tvalue);\r\n\t\tfwrite(tvalue, tlength, 1, info);\r\n\t}\r\n\r\n\tif(txt) {\r\n\t\tswitch(ttype) {\r\n\t\tcase INFO_END:         fputs(\"End             \", txt); break;\r\n\t\tcase INFO_EXTRA_SPACE: fputs(\"Extra space     \", txt); break;\r\n\t\tcase INFO_POS_HEAPLEN: fputs(\"Heaplen position\", txt); break;\r\n\t\tcase INFO_ALIASES:     fputs(\"Alias size      \", txt); break;\r\n\t\tcase INFO_HISTORY:     fputs(\"History size    \", txt); break;\r\n\t\tcase INFO_DIRSTACK:    fputs(\"Dirstack size   \", txt); break;\r\n\t\tcase INFO_BUFSIZE:     fputs(\"Bufsize         \", txt); break;\r\n\t\tdefault:               fputs(\"Unknown tag     \", txt); break;\r\n\t\t}\r\n\t\tfprintf(txt, \": %u\", tlength);\r\n\t\tswitch(tlength) {\r\n\t\tcase 0: break;\r\n\t\tcase 1:\r\n\t\t\t{\tunsigned char ch;\r\n\r\n\t\t\t\tch = *(unsigned char*)tvalue;\r\n\t\t\t\tfprintf(txt, \": %u 0x%02x (%c)\", ch, ch, pch(ch));\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\t{\tunsigned w;\r\n\r\n\t\t\t\tw = *(unsigned*)tvalue;\r\n\t\t\t\tfprintf(txt, \": %5u 0x%04x\", w, w);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\t{\tunsigned long l;\r\n\r\n\t\t\t\tl = *(unsigned long*)tvalue;\r\n\t\t\t\tfprintf(txt, \": %lu 0x%08lx\", l, l);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tdefault:\tbreak;\r\n\t\t}\r\n\t\tputc('\\n', txt);\r\n\t}\r\n}\r\n\r\nvoid dumpTagU(int ttype, unsigned tvalue)\r\n{\tdumpTag(ttype, 2, &tvalue);\r\n}\r\n\r\nint main(int argc, char **argv)\r\n{\tchar *txtFile = 0;\r\n\tunsigned long heapPos, stackPos;\r\n\tint rc;\r\n\tunsigned extraSpace;\r\n\r\n\tif(argc > 1 && (*argv[1] == '/' || *argv[1] == '-') && toupper(argv[1][1]) == 'T') {\r\n\t\ttxtFile = &argv[1][2];\r\n\t\t--argc;\r\n\t\t++argv;\r\n\t}\r\n\tif(argc != 4) {\r\n\t\tputs(\"Useage: INFORES resfile mapfile exefile\");\r\n\t\treturn 127;\r\n\t}\r\n\tif((rc = scanMapFile(argv[2], &heapPos, &stackPos, &extraSpace)) != 0)\r\n\t\treturn rc;\r\n\t/* convert extraSpace to paragraphs */\r\n\textraSpace = (extraSpace + 15)/16;\r\n\tif((rc = addImageDisplacement(argv[3], stackPos, &heapPos, &extraSpace)) != 0)\r\n\t\treturn rc;\r\n\r\n\tif(txtFile && (txt = fopen(txtFile, \"wt\")) == 0) {\r\n\t\tprintf(\"Failed to create text file: %s\\n\", txtFile);\r\n\t\treturn 43;\r\n\t}\r\n\tif((info = fopen(argv[1], \"wb\")) == 0) {\r\n\t\tprintf(\"Failed to create file: %s\\n\", argv[1]);\r\n\t\treturn 41;\r\n\t}\r\n\tstartResource(info, RES_ID_INFO, 0);\r\n\tdumpTagU(INFO_EXTRA_SPACE, extraSpace);\r\n\tif(heapPos)\r\n\t\tdumpTag(INFO_POS_HEAPLEN, 4, &heapPos);\r\n#if 0\t\t\t/* They are external now */\r\n#ifdef FEATURE_ALIASES\r\n\tdumpTagU(INFO_ALIASES, 0);\r\n#endif\r\n#ifdef FEATURE_HISTORY\r\n\tdumpTagU(INFO_HISTORY, 256);\r\n#endif\r\n#ifdef INCLUDE_CMD_PUSHD\r\n\tdumpTagU(INFO_DIRSTACK, DIRSTACK_DEFAULT_SIZE);\r\n#endif\r\n#endif\r\n\tdumpTagU(INFO_BUFSIZE, MAX_INTERNAL_COMMAND_SIZE);\r\n\tdumpTag(INFO_END, 0, 0);\r\n\tendResource(info);\r\n\r\n\tfflush(info);\r\n\tif(ferror(info)) {\r\n\t\tprintf(\"Error writing file: %s\\n\", argv[1]);\r\n\t\treturn 60;\r\n\t}\r\n\r\n\tfclose(info);\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "utils/mktools.c",
    "content": "/* $Id$\r\n\r\n\tImplements an utility that creates the default target for\r\n\tthe TOOLS sub-directory\r\n\r\n\tuseage: MKTOOLS >makefile.mk\r\n\r\n\t$Log$\r\n\tRevision 1.3  2001/04/01 21:05:44  skaus\r\n\tbugfix: CALL doesn't reset options\r\n\tadd: PTCHSIZE to patch heap size\r\n\tadd: VSPAWN, /SWAP switch, .SWP resource handling\r\n\r\n\tRevision 1.2  2001/03/07 19:49:01  skaus\r\n\tMerged in Swap Support changes\r\n\t\r\n\tRevision 1.1.2.2  2001/02/18 21:19:26  skaus\r\n\tfix: MKTOOLS must include $(CFG) into list\r\n\t\r\n\tRevision 1.1.2.1  2001/02/18 18:03:51  skaus\r\n\tintermediate update #3\r\n\t\r\n*/\r\n\r\n#include <stdio.h>\r\n\r\n#include \"../config.h\"\r\n\r\nint main(void)\r\n{\r\n\tfputs(\"all : $(CFG) ptchsize.exe\", stdout);\r\n#ifdef FEATURE_KERNEL_SWAP_SHELL\r\n\tfputs(\" kssf.com vspawn.com\", stdout);\r\n#endif\r\n#ifdef FEATURE_CALL_LOGGING\r\n\tfputs(\" ptchldrv.exe\", stdout);\r\n#endif\r\n#ifdef FEATURE_INSTALLABLE_COMMANDS\r\n\tfputs(\" icmd\", stdout);\r\n#endif\r\n\tfputs(\" 28.com 50.com\", stdout);\r\n\tputchar('\\n');\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "utils/ptchsize.c",
    "content": "/*\r\n        Redirection file to enable native host build of ptchsize utility\r\n*/\r\n#include \"../tools/ptchsize.c\"\r\n"
  },
  {
    "path": "utils/resource.h",
    "content": "#include \"../resource.h\"\r\n"
  },
  {
    "path": "utilsc/critstrs.c",
    "content": "/*\r\nThis program will read in the language file for Critical Error\r\n\tstrings and create the file:\r\n\r\nstrings.err - contains all the strings. will be appended on the end\r\n              of the exe file.\r\n\r\nThere are two input files:\r\nDEFAULT.err and the language file passed as argument to CRITSTRS.\r\nAny definition in the latter will override setting from the\r\nfirst one.\r\n\r\n1) If an individual *.err file does not define a certain string, its\r\n\tcontents is taken from the DEFAULT file.\r\n2) The strings do not have any particular order within the *.ERR files,\r\n\tthe order is implicitly applied by CRITSTRS.\r\n\r\nThe area is constructed in memory and dumped into the file after all\r\nfiles have been read and the contents has passed all transformation\r\nand validation checks.\r\nTherefore it is recommended to build the program in the Compact\r\nmemory model.\r\n\r\n2000/07/11 ska\r\nstarted\r\n\r\n26.03.2003 Dejan Strbac (strbac@phreaker.net) - hexadecimal bug\r\n\r\n*/\r\n\r\n#define MODULE_VERSION 0\r\n\r\n#include <ctype.h>\r\n#include <stdio.h>\r\n#include <string.h>\r\n#include <stdlib.h>\r\n#include <limits.h>\r\n\r\n/*ska: no resource in this project! #include \"../resource.h\"*/\r\n\r\n#define fDAT \"strings.err\"\r\n#define fTXT \"DEFAULT.err\"\r\n#define fEXT \".err\"\r\n\r\n\r\n#define MAXSTRINGS       256\r\n\r\ntypedef struct {\r\n\tchar *name;\t\t\t\t/* name of string */\r\n\tchar *text;\t\t\t\t/* text of this string */\r\n} strings;\r\n\r\ntypedef unsigned short word;\t\t/* MUST BE EXACTLY unsigned 16bit */\r\ntypedef unsigned char byte;\t\t\t/* MUST BE EXACTLY unsigned 8bit */\r\n#if USHRT_MAX != 65535U\r\n#error \"word must be exactly an unsigned 16-bit value\"\r\n#endif\r\n#if UCHAR_MAX != 255\r\n#error \"byte must be exactly an unsigned 8-bit value\"\r\n#endif\r\n\r\nstrings strg[MAXSTRINGS] = {\r\n\t { \"READ\", NULL }\t\t\t/* 0 */\r\n\t,{ \"WRITE\", NULL }\t\t\t/* 1 */\r\n\t,{ \"BLOCK_DEVICE\", NULL }\t/* 2 */\r\n\t,{ \"CHAR_DEVICE\", NULL }\t/* 3 */\r\n\t,{ \"DOS\", NULL }\t\t\t/* 4 */\r\n\t,{ \"FAT\", NULL }\t\t\t/* 5 */\r\n\t,{ \"ROOT\", NULL }\t\t\t/* 6 */\r\n\t,{ \"DATA\", NULL }\t\t\t/* 7 */\r\n\t,{ \"IGNORE\", NULL }\t\t\t/* 8 */\r\n\t,{ \"RETRY\", NULL }\t\t\t/* 9 */\r\n\t,{ \"ABORT\", NULL }\t\t\t/* 10 */\r\n\t,{ \"FAIL\", NULL }\t\t\t/* 11 */\r\n\t,{ \"QUESTION\", NULL }\t\t/* 12 */\r\n\t,{ \"DELIMITER\", NULL }\t\t/* 13 */\r\n\t,{ NULL, NULL }\r\n};\r\n\r\nint maxNr = -1;\r\n\r\n#define STR_KEYS 14\t\t\t\t/* combined keys */\r\n#define STR_ERROR 15\t\t\t/* first error string */\r\n\r\nstrings special[] = {\r\n\t { \"KEYS_IGNORE\", NULL }\r\n\t,{ \"KEYS_RETRY\", NULL }\r\n\t,{ \"KEYS_ABORT\", NULL }\r\n\t,{ \"KEYS_FAIL\", NULL }\r\n\t,{ \"UNKNOWN\", NULL }\r\n\t,{ NULL, NULL }\r\n};\r\n\r\n#if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)\r\n#error \"This program must be compiled with far data pointers\"\r\n#endif\r\n\r\nchar temp[256];\r\n\r\n\t/* keep it a single-file project */\r\n/*ska: no resource in this project! #include \"../res_w.c\"*/\r\n\r\n#if defined(__GNUC__) && !defined(__MINGW32__)\r\nstatic void strupr(char *s)\r\n{\r\n  for (; *s; s++)\r\n    *s = toupper(*s);\r\n}\r\n#endif\r\n\r\n#ifdef __TURBOC__\r\n#define join(s1,s2)\tstrcpy(stpcpy(temp, s1), s2);\r\n#else\r\n#define join(s1,s2)\tstrcat(strcpy(temp, s1), s2);\r\n#endif\r\nvoid pxerror(char *msg1, char *msg2)\r\n{\tjoin(msg1, msg2);\r\n\tperror(temp);\r\n}\r\n\r\nint tonum(int ch)\r\n{\treturn isdigit(ch)? ch - '0'\r\n\t : toupper(ch) - 'A' + 10;\r\n}\r\n\r\nvoid savetext(strings s[], int i, const char * const line)\r\n{\tconst char *p;\r\n\tchar *q;\r\n\r\n\tif(i > maxNr)\r\n\t\tmaxNr = i;\r\n\r\n\tfree(s[i].text);\r\n\tif((q = s[i].text = malloc(strlen(p = line) + 1)) == NULL) {\r\n\t\tfputs(\"Out of memory\\n\", stderr);\r\n\t\texit(85);\r\n\t}\r\n\t/* Check  and compact the string */\r\n\twhile(isspace(*p)) ++p;\r\n\twhile(*p) {\r\n\t\tif(*p == '%') {\r\n\t\t\tswitch(*++p) {\r\n\t\t\tcase '%': break;\t\t/* expands to single '%' */\r\n\t\t\tcase '\\0': --p; break;\t/* dito */\r\n\t\t\tcase '.': \t\t/* ignore completely */\r\n\t\t\t\t++p;\r\n\t\t\t\tcontinue;\r\n\t\t\tcase '&':\t\t/* hexa-decimal string */\r\n\t\t\t\tif(isxdigit(p[1]) && isxdigit(p[2])) {\r\n\t\t\t\t\t*q++ = (tonum(p[1]) << 4) | tonum(p[2]);\r\n\t\t\t\t\tp += 3;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t/** fall though **/\r\n\t\t\tcase '1': case '2': case '3': case 'A':\r\n\t\t\t\t/* Leave both in the string */\r\n\t\t\t\t*q++ = '%';\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t*q++ = *p++;\r\n\t}\r\n\t*q++ = '\\0';\r\n}\r\n\r\nint search(strings s[], const char * const k, const char * const line)\r\n{\tint i = 0;\r\n\r\n\tdo if(strcmp(s[i].name, k) == 0) {\r\n\t\tsavetext(s, i, line);\r\n\t\treturn 1;\r\n\t} while(s[++i].name);\r\n\r\n\treturn 0;\r\n}\r\n\r\nint loadFile(char *fnam)\r\n{\tunsigned long linenr;\r\n\tchar *p;\r\n\tFILE *fin;\r\n\r\n\tjoin(fnam, fEXT);\r\n\tif((fin = fopen(fnam, \"rt\")) == NULL\r\n\t && (fin = fopen(temp, \"rt\")) == NULL) {\r\n\t\tpxerror(\"opening \", fnam);\r\n\t\treturn 33;\r\n\t}\r\n\r\n\tprintf(\"CRITSTRS: load file %s\\n\", fnam);\r\n\r\n\tlinenr = 0;\r\n\twhile (fgets(temp, sizeof(temp), fin)) {\r\n\t\t++linenr;\r\n\t\tp = strchr(temp, '\\0');\r\n\t\tif(p[-1] != '\\n') {\r\n\t\t\tfprintf(stderr, \"Line %lu too long\\n\", linenr);\r\n\t\t\treturn 41;\r\n\t\t}\r\n\t\t\t/* Cut trailing control characters */\r\n\t\twhile (--p >= temp && (iscntrl(*p) || isspace(*p)));\r\n\t\tp[1] = '\\0';\r\n\r\n\t\tswitch (*temp) {\r\n\t\tcase ';': case '#': case '\\0':\t/* comment line */\r\n\t\t\tbreak;\r\n\t\tcase 'S':\t\t/* possible help line */\r\n\t\t\tif(isdigit(temp[1]))\t\t/* help line */\r\n\t\t\t\tbreak;\r\n\t\tdefault:\t\t/* line */\r\n\t\t\tif((p = strchr(temp, ':')) == NULL) {\r\n\t\t\t\tfprintf(stderr, \"Syntax error in line %lu\\n\", linenr);\r\n\t\t\t\treturn 42;\r\n\t\t\t}\r\n\t\t\t*p = '\\0';\r\n\t\t\tif(isdigit(*temp)) {\t\t/* error string */\r\n\t\t\t\tchar *q = temp;\r\n\t\t\t\tint nr = 0;\r\n\t\t\t\tdo nr = nr * 10 + *q - '0';\r\n\t\t\t\twhile(isdigit(*++q));\r\n\t\t\t\tif(*q) {\r\n\t\t\t\t\tfprintf(stderr, \"Invalid number in line %lu\\n\", linenr);\r\n\t\t\t\t\treturn 44;\r\n\t\t\t\t}\r\n\t\t\t\tif(nr < 0 || nr > 255 - STR_ERROR) {\r\n\t\t\t\t\tfprintf(stderr, \"String number too large in line %lu\\n\"\r\n\t\t\t\t\t , linenr);\r\n\t\t\t\t\treturn 45;\r\n\t\t\t\t}\r\n\t\t\t\tsavetext(strg, STR_ERROR + nr, p + 1);\r\n\t\t\t} else {\r\n\t\t\t\tstrupr(temp);\r\n\t\t\t\tif(!search(strg, temp, p + 1)\r\n\t\t\t\t && !search(special, temp, p + 1)) {\r\n\t\t\t\t\tfprintf(stderr, \"Unknown string name in line %lu\\n\"\r\n\t\t\t\t\t , linenr);\r\n\t\t\t\t\treturn 43;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif(ferror(fin)) {\r\n\t\tpxerror(\"reading \", fnam);\r\n\t\treturn 34;\r\n\t}\r\n\tfclose(fin);\r\n\r\n\treturn 0;\r\n}\r\n\r\n\r\nint main(int argc, char **argv)\r\n{\r\n\tFILE *dat;\r\n\tint rc, i, j;\r\n\tunsigned long size;\r\n\r\n\t/*word w;*/\r\n\tbyte *p;\r\n\t/*byte b, *p;*/\r\n\r\n\r\n\tif(argc > 2) {\r\n\t\tputs(\"CRITSTRS - Generate Critical Error string for a language\\n\"\r\n\t\t\t\"Useage: CRITSTRS [language]\\n\"\r\n\t\t\t\"\\tIf no language is specified, the default strings are read only.\\n\"\r\n\t\t\t\"\\tThere must be <language>.ERR file in the current directory.\\n\"\r\n\t\t\t\"Note: DEFAULT.err must be present in the current directory, too.\");\r\n\t\treturn 127;\r\n\t}\r\n\r\n\r\n\r\n\tif((rc = loadFile(fTXT)) != 0)\r\n\t\treturn rc;\r\n\tif(argc > 1 && (rc = loadFile(argv[1])) != 0)\r\n\t\treturn rc;\r\n\r\n/* Now all the strings are cached into memory */\r\n\r\n\tputs(\"CRITSTRS: Running validation check\");\r\n\r\n\ti = rc = 0;\r\n\tdo if(!strg[i].text) {\r\n\t\tfprintf(stderr, \"Missing string \\\"%s\\\"\\n\", strg[i].name);\r\n\t\trc = 46;\r\n\t} while(strg[++i].name);\r\n\ti = 0;\r\n\tdo if(!special[i].text) {\r\n\t\tfprintf(stderr, \"Missing string \\\"%s\\\"\\n\", special[i].name);\r\n\t\trc = 47;\r\n\t} while(special[++i].name);\r\n\tif(rc) return rc;\r\n\r\n\t/* Create the compacted S14 (keys)\r\n\t\tformat: LK..KA..A\r\n\t\t\t'L': number of K's\r\n\t\t\t'K': Keycode (== ASCII code)\r\n\t\t\t'A': Action code\r\n\t\t\tThe number of keycodes is equal to the number of action codes.\r\n\t\t\tThe leftmost keycode is associated to the leftmost action code.\r\n\t*/\r\n\t\t/* first: count */\r\n\tfor(rc = i = 0; i < 4; ++i)\r\n\t\trc += strlen(special[i].text);\r\n\tif((p = (byte*)(strg[STR_KEYS].text = malloc(1 + rc * 2))) == NULL) {\r\n\t\tfputs(\"Out of memory\\n\", stderr);\r\n\t\treturn 89;\r\n\t}\r\n\t\t/* then insert the data */\r\n\t*p = 0;\r\n\tfor(i = 0; i < 4; ++i) {\t\t/* also the action code */\r\n\t\tmemcpy(p + 1 + *p, special[i].text, j = strlen(special[i].text));\r\n\t\tmemset(p + 1 + *p + rc, i, j);\r\n\t\t*p += (unsigned char)j;\r\n\t}\r\n\r\n\t/* check if the error strings are continueous */\r\n\tfor(rc = 0, i = STR_ERROR; i < maxNr; ++i)\r\n\t\tif(!strg[i].text) {\r\n\t\t\tfprintf(stderr, \"Missing error string #%d\\n\", i - STR_ERROR);\r\n\t\t\trc = 48;\r\n\t\t}\r\n\tif(rc) return rc;\r\n\tstrg[++maxNr].text = special[4].text;\r\n\r\n\tputs(\"CRITSTRS: Dumping CRITER strings resource\");\r\n\r\n/* Dump the stuff into a file */\r\n\t/*if((dat = fopen(fDAT, \"wb\")) == NULL) {*/\r\n\tif((dat = fopen(fDAT, \"wt\")) == NULL) {\r\n\t\tperror(\"creating \" fDAT);\r\n\t\treturn 35;\r\n\t}\r\n\r\n\t/*ska: no resource in this project! startResource(dat, RES_ID_CRITER, 2, MODULE_VERSION);*/\r\n\t\t/* Number of strings EXCEPT trailing \"Unknown error\" */\r\n\tfprintf(dat, \"??strings\tDB %u\\n\", maxNr);\r\n\t/*b = maxNr;*/\r\n\t/*fwrite(&b, sizeof(b), 1, dat);*/\r\n\t\t/* when loaded the pointer to the string, now offset\r\n\t\t\twithin file */\r\n\tsize = 1l + maxNr * 2;\r\n\tfor(i = 0; i <= maxNr; ++i) {\r\n\t\tfprintf(dat, \"\\tDW S%u\\n\", i);\r\n\t\t/*w = (word)size;*/\r\n\t\t/*fwrite(&w, sizeof(w), 1, dat);*/\r\n\t\tsize += i == STR_KEYS? 1 + *(byte*)strg[STR_KEYS].text * 2\r\n\t\t\t: strlen(strg[i].text) + 1;\r\n\t}\r\n\tif(size > 0xfffful) {\r\n\t\tfputs(\"Overall size of Critical Error string database exceeds 64KB\\n\"\r\n\t\t , stderr);\r\n\t\treturn 37;\r\n\t}\r\n\t\t/* Now dump the strings themselves */\r\n\tfor(i = 0; i <= maxNr; ++i) {\r\n\t\tint l;\r\n\r\n\t\tfprintf(dat, \"S%u\\tDB \", i);\r\n\t\tl = i == STR_KEYS? 1 + *(byte*)strg[STR_KEYS].text * 2\r\n\t\t                 : strlen(strg[i].text) + 1;\r\n\t\tp = (unsigned char*)strg[i].text;\r\n\t\tif(l) {\r\n\t\t\twhile(--l)\r\n\t\t\t\tfprintf(dat, \"%u,\", *p++);\r\n\t\t\tfprintf(dat, \"%u\\n\", *p);\r\n\t\t}\r\n\t\t/*fwrite(strg[i].text, 1\r\n\t\t //, i == STR_KEYS? 1 + *(byte*)strg[STR_KEYS].text * 2\r\n\t\t //               : strlen(strg[i].text) + 1\r\n\t\t //, dat);*/\r\n\t}\r\n\r\n\t/*ska: no resource in this project! endResource(dat);*/\r\n\r\n\tfflush(dat);\r\n\tif(ferror(dat)) {\r\n\t\tfputs(\"General write error into: \" fDAT \"\\n\", stderr);\r\n\t\treturn 36;\r\n\t}\r\n\tfclose(dat);\r\n\r\n\treturn 0;\r\n}\r\n"
  },
  {
    "path": "utilsc/fixstrs.c",
    "content": "/*\r\n        Redirection file to enable native host build of fixstrs utility\r\n*/\r\n#include \"../strings/fixstrs.c\"\r\n"
  },
  {
    "path": "utilsc/makefile.mak",
    "content": "CFG_DEPENDENCIES = makefile.mak\r\n\r\nUTILS_BUILD = 1\r\n\r\nCOMPACT_MODEL = 1\r\n\r\nTOP = ..\r\n!include \"$(TOP)/config.mak\"\r\n\r\nall : $(CFG) fixstrs.exe critstrs.exe\r\n\r\nfixstrs.exe: fixstrs.c ../strings/fixstrs.c\r\n\r\ncritstrs.exe: critstrs.c\r\n"
  },
  {
    "path": "version.h",
    "content": "#define FREECOM_VERSION \"0.87\"\r\n"
  }
]